Author: blueswirl Date: 2008-07-07 20:38:30 +0200 (Mon, 07 Jul 2008) New Revision: 192
Added: openbios-devel/libgcc/libgcc.h Modified: openbios-devel/libgcc/__divdi3.c openbios-devel/libgcc/__divti3.c openbios-devel/libgcc/__lshrdi3.c openbios-devel/libgcc/__udivdi3.c openbios-devel/libgcc/__udivmoddi4.c openbios-devel/libgcc/__udivmodti4.c openbios-devel/libgcc/__udivti3.c openbios-devel/libgcc/__umoddi3.c openbios-devel/libgcc/__umodti3.c openbios-devel/libgcc/ashldi3.c openbios-devel/libgcc/ashrdi3.c openbios-devel/libgcc/multi3.c Log: Add a common header file for libgcc functions
Modified: openbios-devel/libgcc/__divdi3.c =================================================================== --- openbios-devel/libgcc/__divdi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__divdi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -2,11 +2,8 @@ * arch/i386/libgcc/__divdi3.c */
-#include <stdint.h> -#include <stddef.h> +#include "libgcc.h"
-extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem); - int64_t __divdi3(int64_t num, int64_t den) { int minus = 0;
Modified: openbios-devel/libgcc/__divti3.c =================================================================== --- openbios-devel/libgcc/__divti3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__divti3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -2,11 +2,8 @@ * arch/i386/libgcc/__divti3.c */
-#include "asm/types.h" -#define NULL ((void *)0) +#include "libgcc.h"
-extern __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem); - __int128_t __divti3(__int128_t num, __int128_t den) { int minus = 0;
Modified: openbios-devel/libgcc/__lshrdi3.c =================================================================== --- openbios-devel/libgcc/__lshrdi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__lshrdi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -18,13 +18,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include "libgcc.h" + #define BITS_PER_UNIT 8
-typedef int SItype __attribute__ ((mode (SI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); -typedef int word_type __attribute__ ((mode (__word__))); - struct DIstruct {SItype high, low;};
typedef union
Modified: openbios-devel/libgcc/__udivdi3.c =================================================================== --- openbios-devel/libgcc/__udivdi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__udivdi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -2,11 +2,8 @@ * arch/i386/libgcc/__divdi3.c */
-#include <stdint.h> -#include <stddef.h> +#include "libgcc.h"
-extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem); - uint64_t __udivdi3(uint64_t num, uint64_t den) { return __udivmoddi4(num, den, NULL);
Modified: openbios-devel/libgcc/__udivmoddi4.c =================================================================== --- openbios-devel/libgcc/__udivmoddi4.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__udivmoddi4.c 2008-07-07 18:38:30 UTC (rev 192) @@ -1,7 +1,5 @@ -#include <stdint.h> +#include "libgcc.h"
-extern void __divide_error(); - uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p) { uint64_t quot = 0, qbit = 1;
Modified: openbios-devel/libgcc/__udivmodti4.c =================================================================== --- openbios-devel/libgcc/__udivmodti4.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__udivmodti4.c 2008-07-07 18:38:30 UTC (rev 192) @@ -1,7 +1,5 @@ -#include "asm/types.h" +#include "libgcc.h"
-extern void __divide_error(); - __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem_p) { __uint128_t quot = 0, qbit = 1;
Modified: openbios-devel/libgcc/__udivti3.c =================================================================== --- openbios-devel/libgcc/__udivti3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__udivti3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -2,11 +2,8 @@ * arch/i386/libgcc/__divdi3.c */
-#include "asm/types.h" -#define NULL ((void *)0) +#include "libgcc.h"
-extern __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem); - __uint128_t __udivti3(__uint128_t num, __uint128_t den) { return __udivmodti4(num, den, NULL);
Modified: openbios-devel/libgcc/__umoddi3.c =================================================================== --- openbios-devel/libgcc/__umoddi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__umoddi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -2,11 +2,8 @@ * arch/i386/libgcc/__umoddi3.c */
-#include <stdint.h> -#include <stddef.h> +#include "libgcc.h"
-extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem); - uint64_t __umoddi3(uint64_t num, uint64_t den) { uint64_t v;
Modified: openbios-devel/libgcc/__umodti3.c =================================================================== --- openbios-devel/libgcc/__umodti3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/__umodti3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -2,10 +2,8 @@ * arch/i386/libgcc/__umoddi3.c */
-#include "asm/types.h" +#include "libgcc.h"
-extern __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem); - __uint128_t __umodti3(__uint128_t num, __uint128_t den) { __uint128_t v;
Modified: openbios-devel/libgcc/ashldi3.c =================================================================== --- openbios-devel/libgcc/ashldi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/ashldi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -18,13 +18,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include "libgcc.h" + #define BITS_PER_UNIT 8
-typedef int SItype __attribute__ ((mode (SI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); -typedef int word_type __attribute__ ((mode (__word__))); - struct DIstruct {SItype high, low;};
typedef union
Modified: openbios-devel/libgcc/ashrdi3.c =================================================================== --- openbios-devel/libgcc/ashrdi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/ashrdi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -18,13 +18,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include "libgcc.h" + #define BITS_PER_UNIT 8
-typedef int SItype __attribute__ ((mode (SI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); -typedef int word_type __attribute__ ((mode (__word__))); - struct DIstruct {SItype high, low;};
typedef union
Added: openbios-devel/libgcc/libgcc.h =================================================================== --- openbios-devel/libgcc/libgcc.h (rev 0) +++ openbios-devel/libgcc/libgcc.h 2008-07-07 18:38:30 UTC (rev 192) @@ -0,0 +1,37 @@ +#ifndef _LIBGCC_H +#define _LIBGCC_H + +#include "asm/types.h" + +#ifndef NULL +#define NULL ((void *)0) +#endif + +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef int DItype __attribute__ ((mode (DI))); +typedef unsigned int UDItype __attribute__ ((mode (DI))); +typedef int TItype __attribute__ ((mode (TI))); +typedef int word_type __attribute__ ((mode (__word__))); + +uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem); +__uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem); + +int64_t __divdi3(int64_t num, int64_t den); +uint64_t __udivdi3(uint64_t num, uint64_t den); +__int128_t __divti3(__int128_t num, __int128_t den); +__uint128_t __udivti3(__uint128_t num, __uint128_t den); + +uint64_t __umoddi3(uint64_t num, uint64_t den); +__uint128_t __umodti3(__uint128_t num, __uint128_t den); + +DItype __ashldi3 (DItype u, word_type b); +DItype __lshrdi3 (DItype u, word_type b); +DItype __ashrdi3 (DItype u, word_type b); + +TItype __multi3 (TItype u, TItype v); + +// Must be implemented outside: +void __divide_error(void); + +#endif /* _LIBGCC_H */
Modified: openbios-devel/libgcc/multi3.c =================================================================== --- openbios-devel/libgcc/multi3.c 2008-07-07 18:37:24 UTC (rev 191) +++ openbios-devel/libgcc/multi3.c 2008-07-07 18:38:30 UTC (rev 192) @@ -1,4 +1,4 @@ -/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and +/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and gcc-2.7.2.3/longlong.h which is: */ /* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
@@ -19,6 +19,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include "libgcc.h" + #define BITS_PER_UNIT 8 #define DI_TYPE_SIZE 64
@@ -56,11 +58,6 @@ umul_ppmm (__w.s.high, __w.s.low, u, v); \ __w.ll; })
-typedef int DItype __attribute__ ((mode (DI))); -typedef unsigned int UDItype __attribute__ ((mode (DI))); -typedef int TItype __attribute__ ((mode (TI))); -typedef int word_type __attribute__ ((mode (__word__))); - struct TIstruct {DItype high, low;};
typedef union