add directory Linux-0.98

This commit is contained in:
gohigh
2024-02-19 00:21:16 -05:00
parent 265896c4ae
commit 56596ada90
13765 changed files with 3471432 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
/* Allow this file to be included multiple times
with different settings of NDEBUG. */
#undef assert
#undef __assert
#ifdef NDEBUG
#define assert(ignore) ((void) 0)
#else
#ifndef __GNUC__
#define assert(expression) \
((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
#define __assert(expression, file, lineno) \
(printf ("%s:%u: failed assertion\n", file, lineno), \
abort (), 0)
#else
#if defined(__STDC__) || defined (__cplusplus)
/* Defined in libgcc.a */
#ifdef __cplusplus
extern "C" {
extern void __eprintf (const char *, const char *, int, const char *);
}
#else
extern void __eprintf (const char *, const char *, int, const char *);
#endif
#define assert(expression) \
((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
#define __assert(expression, file, line) \
(__eprintf ("%s:%u: failed assertion `%s'\n", \
file, line, expression), 0)
#else /* no __STDC__ and not C++; i.e. -traditional. */
extern void __eprintf (); /* Defined in libgcc.a */
#define assert(expression) \
((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
#define __assert(expression, file, lineno) \
(__eprintf ("%s:%u: failed assertion `%s'\n", \
file, lineno, "expression"), 0)
#endif /* no __STDC__ and not C++; i.e. -traditional. */
#endif /* no __GNU__; i.e., /bin/cc. */
#endif

View File

@@ -0,0 +1,67 @@
/* float.h */
#ifndef _FLOAT_H___
#define _FLOAT_H___
/* Produced by enquire version 4.3, CWI, Amsterdam */
/* Radix of exponent representation */
#define FLT_RADIX 2
/* Number of base-FLT_RADIX digits in the significand of a float */
#define FLT_MANT_DIG 24
/* Number of decimal digits of precision in a float */
#define FLT_DIG 6
/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
#define FLT_ROUNDS 1
/* Difference between 1.0 and the minimum float greater than 1.0 */
#define FLT_EPSILON 1.19209290e-07F
/* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
#define FLT_MIN_EXP (-125)
/* Minimum normalised float */
#define FLT_MIN 1.17549435e-38F
/* Minimum int x such that 10**x is a normalised float */
#define FLT_MIN_10_EXP (-37)
/* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
#define FLT_MAX_EXP 128
/* Maximum float */
#define FLT_MAX 3.40282347e+38F
/* Maximum int x such that 10**x is a representable float */
#define FLT_MAX_10_EXP 38
/* Number of base-FLT_RADIX digits in the significand of a double */
#define DBL_MANT_DIG 53
/* Number of decimal digits of precision in a double */
#define DBL_DIG 15
/* Difference between 1.0 and the minimum double greater than 1.0 */
#define DBL_EPSILON 2.2204460492503131e-16
/* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
#define DBL_MIN_EXP (-1021)
/* Minimum normalised double */
#define DBL_MIN 2.2250738585072014e-308
/* Minimum int x such that 10**x is a normalised double */
#define DBL_MIN_10_EXP (-307)
/* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
#define DBL_MAX_EXP 1024
/* Maximum double */
#define DBL_MAX 1.7976931348623157e+308
/* Maximum int x such that 10**x is a representable double */
#define DBL_MAX_10_EXP 308
/* Number of base-FLT_RADIX digits in the significand of a long double */
#define LDBL_MANT_DIG 53
/* Number of decimal digits of precision in a long double */
#define LDBL_DIG 15
/* Difference between 1.0 and the minimum long double greater than 1.0 */
#define LDBL_EPSILON 2.2204460492503131e-16L
/* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
#define LDBL_MIN_EXP (-1021)
/* Minimum normalised long double */
#define LDBL_MIN 2.2250738585072014e-308L
/* Minimum int x such that 10**x is a normalised long double */
#define LDBL_MIN_10_EXP (-307)
/* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
#define LDBL_MAX_EXP 1024
/* Maximum long double */
#define LDBL_MAX 1.7976931348623157e+308L
/* Maximum int x such that 10**x is a representable long double */
#define LDBL_MAX_10_EXP 308
#endif /* _FLOAT_H___ */

View File

@@ -0,0 +1,88 @@
/* This administrivia gets added to the beginning of limits.h
if the system has its own version of limits.h. */
#include_next <limits.h>
#ifndef _LIMITS_H___
#ifndef _MACH_MACHLIMITS_H_
/* _MACH_MACHLIMITS_H_ is used on OSF/1. */
#define _LIMITS_H___
#define _MACH_MACHLIMITS_H_
/* Number of bits in a `char'. */
#undef CHAR_BIT
#define CHAR_BIT 8
/* No multibyte characters supported yet. */
#undef MB_LEN_MAX
#define MB_LEN_MAX 1
/* Minimum and maximum values a `signed char' can hold. */
#undef SCHAR_MIN
#define SCHAR_MIN (-128)
#undef SCHAR_MAX
#define SCHAR_MAX 127
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
#undef UCHAR_MAX
#define UCHAR_MAX 255
/* Minimum and maximum values a `char' can hold. */
#ifdef __CHAR_UNSIGNED__
#undef CHAR_MIN
#define CHAR_MIN 0
#undef CHAR_MAX
#define CHAR_MAX 255
#else
#undef CHAR_MIN
#define CHAR_MIN (-128)
#undef CHAR_MAX
#define CHAR_MAX 127
#endif
/* Minimum and maximum values a `signed short int' can hold. */
#undef SHRT_MIN
#define SHRT_MIN (-32768)
#undef SHRT_MAX
#define SHRT_MAX 32767
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
#undef USHRT_MAX
#define USHRT_MAX 65535
/* Minimum and maximum values a `signed int' can hold. */
#undef INT_MIN
#define INT_MIN (-INT_MAX-1)
#undef INT_MAX
#define INT_MAX 2147483647
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
#undef UINT_MAX
#define UINT_MAX 4294967295U
/* Minimum and maximum values a `signed long int' can hold.
(Same as `int'). */
#undef LONG_MIN
#define LONG_MIN (-LONG_MAX-1)
#undef LONG_MAX
#define LONG_MAX 2147483647L
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
#undef ULONG_MAX
#define ULONG_MAX 4294967295UL
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
/* Minimum and maximum values a `signed long long int' can hold. */
#undef LONG_LONG_MIN
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
#undef LONG_LONG_MAX
#define LONG_LONG_MAX 9223372036854775807LL
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
#undef ULONG_LONG_MAX
#define ULONG_LONG_MAX 18446744073709551615ULL
#endif
#endif /* _MACH_MACHLIMITS_H_ */
#endif /* _LIMITS_H___ */

View File

@@ -0,0 +1,4 @@
/* This header file is to avoid trouble with semi-ANSI header files
on the Convex in system version 8.0. */
#define _PROTO(list) ()

View File

@@ -0,0 +1,73 @@
/* stdarg.h for GNU.
Note that the type used in va_arg is supposed to match the
actual type **after default promotions**.
Thus, va_arg (..., short) is not valid. */
#ifndef _STDARG_H
#define _STDARG_H
#ifndef __GNUC__
/* Use the system's macros with the system's compiler. */
#include <stdarg.h>
#else
#ifdef __m88k__
#include "va-m88k.h"
#else
#ifdef __i860__
#include "va-i860.h"
#else
#ifdef __hp9000s800__
#include "va-hp800.h"
#else
#ifdef __mips__
#include "va-mips.h"
#else
#ifdef __sparc__
#include "va-sparc.h"
#else
#ifdef __i960__
#include "va-i960.h"
#else
#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
#undef _VA_LIST
#endif
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */
#ifndef _VA_LIST_
/* The macro _VA_LIST is used in SCO Unix 3.2. */
#ifndef _VA_LIST
#define _VA_LIST_
#define _VA_LIST
#ifndef __svr4__
typedef char *va_list;
#else
typedef void *va_list;
#endif
#endif /* _VA_LIST */
#endif /* _VA_LIST_ */
/* Amount of space required in an argument list for an arg of type TYPE.
TYPE may alternatively be an expression whose type is used. */
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_start(AP, LASTARG) \
(AP = ((char *) __builtin_next_arg ()))
void va_end (va_list); /* Defined in libgcc.a */
#define va_end(AP)
#define va_arg(AP, TYPE) \
(AP = ((char *) (AP)) += __va_rounded_size (TYPE), \
*((TYPE *) ((char *) (AP) - __va_rounded_size (TYPE))))
#endif /* not i960 */
#endif /* not sparc */
#endif /* not mips */
#endif /* not hp9000s800 */
#endif /* not i860 */
#endif /* not m88k */
#endif /* __GNUC__ */
#endif /* _STDARG_H */

View File

@@ -0,0 +1,152 @@
#ifndef _STDDEF_H
#ifndef _STDDEF_H_
/* Any one of these symbols __need_* means that GNU libc
wants us just to define one data type. So don't define
the symbols that indicate this file's entire job has been done. */
#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
&& !defined(__need_ptrdiff_t) && !defined(__need_NULL))
#define _STDDEF_H
#define _STDDEF_H_
#endif
#ifndef __sys_stdtypes_h
/* This avoids lossage on Sunos but only if stdtypes.h comes first.
There's no way to win with the other order! Sun lossage. */
/* In case nobody has defined these types, but we aren't running under
GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
__WCHAR_TYPE__ have reasonable values. This can happen if the
parts of GCC is compiled by an older compiler, that actually
include gstddef.h, such as collect2. */
/* Signed type of difference of two pointers. */
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
#ifndef _T_PTRDIFF_
#ifndef _T_PTRDIFF
#ifndef __PTRDIFF_T
#ifndef _PTRDIFF_T_
#ifndef ___int_ptrdiff_t_h
#ifndef _GCC_PTRDIFF_T
#define _PTRDIFF_T
#define _T_PTRDIFF_
#define _T_PTRDIFF
#define __PTRDIFF_T
#define _PTRDIFF_T_
#define ___int_ptrdiff_t_h
#define _GCC_PTRDIFF_T
#ifndef __PTRDIFF_TYPE__
#define __PTRDIFF_TYPE__ long int
#endif
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif /* _GCC_PTRDIFF_T */
#endif /* ___int_ptrdiff_t_h */
#endif /* _PTRDIFF_T_ */
#endif /* __PTRDIFF_T */
#endif /* _T_PTRDIFF */
#endif /* _T_PTRDIFF_ */
#endif /* _PTRDIFF_T */
/* If this symbol has done its job, get rid of it. */
#undef __need_ptrdiff_t
#endif /* <stddef.h> or __need_ptrdiff_t. */
/* Unsigned type of `sizeof' something. */
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_size_t)
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
#ifndef _T_SIZE_
#ifndef _T_SIZE
#ifndef __SIZE_T
#ifndef _SIZE_T_
#ifndef ___int_size_t_h
#ifndef _GCC_SIZE_T
#ifndef _SIZET_
#define _SIZE_T
#define _T_SIZE_
#define _T_SIZE
#define __SIZE_T
#define _SIZE_T_
#define ___int_size_t_h
#define _GCC_SIZE_T
#define _SIZET_
#ifndef __SIZE_TYPE__
#define __SIZE_TYPE__ long unsigned int
#endif
typedef __SIZE_TYPE__ size_t;
#endif /* _SIZET_ */
#endif /* _GCC_SIZE_T */
#endif /* ___int_size_t_h */
#endif /* _SIZE_T_ */
#endif /* __SIZE_T */
#endif /* _T_SIZE */
#endif /* _T_SIZE_ */
#endif /* _SIZE_T */
#undef __need_size_t
#endif /* <stddef.h> or __need_size_t. */
/* Wide character type.
Locale-writers should change this as necessary to
be big enough to hold unique values not between 0 and 127,
and not (wchar_t) -1, for each defined multibyte character. */
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_wchar_t)
#ifndef _WCHAR_T
#ifndef _T_WCHAR_
#ifndef _T_WCHAR
#ifndef __WCHAR_T
#ifndef _WCHAR_T_
#ifndef ___int_wchar_t_h
#ifndef _GCC_WCHAR_T
#define _WCHAR_T
#define _T_WCHAR_
#define _T_WCHAR
#define __WCHAR_T
#define _WCHAR_T_
#define ___int_wchar_t_h
#define _GCC_WCHAR_T
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ int
#endif
typedef __WCHAR_TYPE__ wchar_t;
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#undef __need_wchar_t
#endif /* <stddef.h> or __need_wchar_t. */
#endif /* __sys_stdtypes_h */
/* A null pointer constant. */
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#define NULL ((void *)0)
#endif /* NULL not defined and <stddef.h> or need NULL. */
#undef __need_NULL
#ifdef _STDDEF_H
/* Offset of member MEMBER in a struct of type TYPE. */
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif /* _STDDEF_H was defined this time */
#endif /* _STDDEF_H_ was not defined before */
#endif /* _STDDEF_H was not defined before */

View File

@@ -0,0 +1,86 @@
#if __GNUC__ > 1
typedef struct
{
char *__va_stack_start; /* Real start of stack args. */
char *__va_int; /* Pointer to the general register */
/* args and stack. */
char *__va_float; /* Pointer to the fp register args. */
char *__va_double;
} va_list;
#ifdef _STDARG_H
#define va_start(AP,LASTARG) ((AP) = *(va_list *)__builtin_saveregs())
#else
#define va_alist __builtin_va_alist
/* The ... causes current_function_varargs to be set in cc1. */
#define va_dcl int __builtin_va_alist; ...
#define va_start(AP) ((AP) = *(va_list *)__builtin_saveregs())
#endif /* _STDARG_H */
/* Handle pass by invisible reference and voids left by aligned */
/* doubles. */
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_arg(AP, TYPE) \
(((__va_rounded_size(TYPE) <= 8) \
? ((AP).__va_int -= __va_rounded_size (TYPE), \
(AP).__va_float -= __va_rounded_size (TYPE), \
(AP).__va_double -= __va_rounded_size (TYPE), \
(__alignof__ (TYPE) > 4 ? ((int)(AP).__va_int &= ~(0x7), \
(int)(AP).__va_float &= ~(0x7), \
(int)(AP).__va_double &= ~(0x7)) : 0))\
: (int)((AP).__va_int -= sizeof (TYPE *), \
(AP).__va_float -= sizeof (TYPE *), \
(AP).__va_double -= sizeof (TYPE *))), \
(((AP).__va_int < (AP).__va_stack_start \
|| __builtin_classify_type (* (TYPE *) 0) != 8) \
? ((__va_rounded_size(TYPE) <= 8) ? *(TYPE *)(AP).__va_int \
: **(TYPE **)(AP).__va_int) \
: ((__va_rounded_size(TYPE) <= 4) ? *(TYPE *)(AP).__va_float \
: ((__va_rounded_size(TYPE) <= 8) ? *(TYPE *)(AP).__va_double \
: **(TYPE **)(AP).__va_int))))
void va_end (va_list); /* Defined in libgcc.a */
#define va_end(AP)
#else /* __GNUCC__ > 1 */
typedef char *va_list;
/* __builtin_saveregs () tickles a bug in the pa-risc gcc 1.39 port, */
/* so don't use it for varargs. Obviously the stdarg stuff doesn't */
/* work very well. */
#ifdef _STDARG_H
#define va_start(AP,LASTARG) \
(__builtin_saveregs(), (AP) = __builtin_next_arg ())
/* gcc1 doesn't implement pass by invisible reference */
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_arg(AP,TYPE) \
((AP) -= __va_rounded_size (TYPE), (__alignof__ (TYPE) > 4 ? \
(int)AP &= ~(0x7) : 0), \
*(TYPE *)(AP))
void va_end (va_list); /* Defined in libgcc.a */
#define va_end(AP)
#else /* _STDARG_H */
#define va_alist __va_a__, __va_b__, __va_c__, __va_d__
#define va_dcl int __va_a__, __va_b__, __va_c__, __va_d__;
#define va_start(list) list = (char *) &__va_a__, &__va_b__, &__va_c__, \
&__va_d__
# define va_arg(list,mode) *(mode *) ((int) (list = (char *) \
(((int) list + sizeof(int /*__va_a__*/) - sizeof(mode)) & ~(sizeof(mode)-1)) \
- sizeof(int /*__va_a__*/)) + sizeof(int /*__va_a__*/))
#define va_end(list)
#endif /* _STDARG_H */
#endif /* __GNUCC__ > 1 */

View File

@@ -0,0 +1,197 @@
/* Note: We must use the name __builtin_savregs. GCC attaches special
significance to that name. In particular, regardless of where in a
function __builtin_saveregs is called, GCC moves the call up to the
very start of the function. */
#if !defined(_STDARG_H)
/* varargs support */
#define va_alist __builtin_va_alist
#define va_dcl
#define va_start(pvar) ((pvar) = * (va_list *) __builtin_saveregs ())
#else /* ANSI stdarg.h */
/* Note that CUMULATIVE_ARGS elements are measured in bytes on the i860,
so we divide by 4 to get # of registers. */
#define va_start(pvar, firstarg) \
((pvar) = *(va_list *) __builtin_saveregs (), \
(pvar).__ireg_used = __builtin_args_info (0) / 4, \
(pvar).__freg_used = __builtin_args_info (1) / 4, \
(pvar).__mem_ptr = __builtin_next_arg ())
#endif /* !defined(_STDARG_H) ... varargs support */
typedef union {
float __freg[8];
double __dreg[4];
} __f_regs;
typedef struct {
#ifdef __SVR4__
__f_regs __float_regs; long __ireg[12];
#else /* pre-SVR4 */
long __ireg[12]; __f_regs __float_regs;
#endif
} __va_saved_regs;
#ifndef _VA_LIST
#define _VA_LIST
#define __GNU_VA_LIST /* Field names were properly prefixed with `__'. */
typedef struct {
#ifdef __SVR4__
unsigned __ireg_used; /* How many int regs consumed 'til now? */
unsigned __freg_used; /* How many flt regs consumed 'til now? */
long *__reg_base; /* Address of where we stored the regs. */
long * __mem_ptr; /* Address of memory overflow args area. */
#else /* pre-SVR4 */
long *__reg_base; /* Address of where we stored the regs. */
long * __mem_ptr; /* Address of memory overflow args area. */
unsigned __ireg_used; /* How many int regs consumed 'til now? */
unsigned __freg_used; /* How many flt regs consumed 'til now? */
#endif
} va_list;
#endif /* !defined(_VA_LIST) */
#define va_end(__va)
/* Values returned by __builtin_classify_type. */
enum {
__no_type_class = -1,
__void_type_class,
__integer_type_class,
__char_type_class,
__enumeral_type_class,
__boolean_type_class,
__pointer_type_class,
__reference_type_class,
__offset_type_class,
__real_type_class,
__complex_type_class,
__function_type_class,
__method_type_class,
__record_type_class,
__union_type_class,
__array_type_class,
__string_type_class,
__set_type_class,
__file_type_class,
__lang_type_class
};
#define __NUM_PARM_FREGS 8
#define __NUM_PARM_IREGS 12
#define __savereg(__va) ((__va_saved_regs *) (__va.__reg_base))
/* This macro works both for SVR4 and pre-SVR4 environments. */
/* Note that parameters are always aligned at least to a word boundary
(when passed) regardless of what GCC's __alignof__ operator says. */
/* Make allowances here for adding 128-bit (long double) floats someday. */
#ifndef __GNU_VA_LIST
#define __ireg_used ireg_used
#define __freg_used freg_used
#define __mem_ptr mem_ptr
#define __reg_base reg_base
#endif
/* Avoid errors if compiling GCC v2 with GCC v1. */
#if __GNUC__ == 1
#define __extension__
#endif
#define va_arg(__va, __type) \
__extension__ \
(* (__type *) \
({ \
register void *__rv; /* result value */ \
register unsigned __align; \
switch (__builtin_classify_type (* (__type *) 0)) \
{ \
case __real_type_class: \
switch (sizeof (__type)) \
{ \
case sizeof (float): \
case sizeof (double): \
if (__va.__freg_used < __NUM_PARM_FREGS - 1) \
{ \
if ((__va.__freg_used & 1) != 0) \
__va.__freg_used++; /* skip odd */ \
__rv = &__savereg(__va)->__float_regs.__freg[__va.__freg_used];\
__va.__freg_used += 2; \
} \
else \
{ \
if ((((unsigned) __va.__mem_ptr) & (sizeof(double)-1)) != 0) \
__va.__mem_ptr++; /* skip odd */ \
__rv = __va.__mem_ptr; \
__va.__mem_ptr += 2; \
} \
if (sizeof (__type) == sizeof (float)) \
{ \
*((float *) __rv) = *((double *) __rv); \
*(((long *) __rv) + 1) = 0xfff00001; \
} \
break; \
default: \
abort (); \
} \
break; \
case __void_type_class: \
case __integer_type_class: \
case __char_type_class: \
case __enumeral_type_class: \
case __boolean_type_class: \
case __pointer_type_class: \
case __reference_type_class: \
case __offset_type_class: \
if (sizeof (__type) <= 4) \
{ \
__rv = (__va.__ireg_used < __NUM_PARM_IREGS \
? (&__savereg(__va)->__ireg[__va.__ireg_used++]) \
: __va.__mem_ptr++); \
break; \
} \
else if (__va.__ireg_used + sizeof (__type) / 4 <= __NUM_PARM_IREGS) \
{ \
__rv = &__savereg(__va)->__ireg[__va.__ireg_used]; \
__va.__ireg_used += sizeof (__type) / 4; \
break; \
} \
/* Fall through to fetch from memory. */ \
case __record_type_class: \
case __union_type_class: \
__align = (__alignof__ (__type) < sizeof (long) \
? sizeof (long) \
: __alignof__ (__type)); \
__va.__mem_ptr \
= (long *) \
((((unsigned) __va.__mem_ptr) + (__align-1)) & ~(__align-1)); \
__rv = __va.__mem_ptr; \
__va.__mem_ptr \
+= ((sizeof (__type) + sizeof (long) - 1) / sizeof (long)); \
break; \
case __complex_type_class: \
case __function_type_class: \
case __method_type_class: \
case __array_type_class: \
case __string_type_class: \
case __set_type_class: \
case __file_type_class: \
case __lang_type_class: \
case __no_type_class: \
default: \
abort (); \
} \
__rv; \
}))

View File

@@ -0,0 +1,45 @@
/* GNU C varargs support for the Intel 80960. */
/* In GCC version 2, we want an ellipsis at the end of the declaration
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
/* The first element is the address of the first argument.
The second element is the number of bytes skipped past so far. */
typedef unsigned va_list[2];
/* The stack size of the type t. */
#define __vsiz(T) (((sizeof (T) + 3) / 4) * 4)
/* The stack alignment of the type t. */
#define __vali(T) (__alignof__ (T) >= 4 ? __alignof__ (T) : 4)
/* The offset of the next stack argument after one of type t at offset i. */
#define __vpad(I, T) ((((I) + __vali (T) - 1) / __vali (T)) \
* __vali (T) + __vsiz (T))
#ifdef _STDARG_H
#define va_start(AP, LASTARG) ((AP)[1] = 0, \
*(AP) = (unsigned) __builtin_next_arg ())
#else
#define va_alist __builtin_va_alist
#define va_dcl char *__builtin_va_alist; __va_ellipsis
#define va_start(AP) ((AP)[1] = 0, *(AP) = (unsigned) &va_alist)
#endif
#define va_arg(AP, T) \
( \
( \
((AP)[1] <= 48 && (__vpad ((AP)[1], T) > 48 || __vsiz (T) > 16)) \
? ((AP)[1] = 48 + __vsiz (T)) \
: ((AP)[1] = __vpad ((AP)[1], T)) \
), \
\
*((T *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \
)
#define va_end(AP)

View File

@@ -0,0 +1,59 @@
/* This file contains changes made by Data General, December 1989. */
/* GNU C varargs support for the Motorola 88100 */
#ifndef __INT_VARARGS_H /* Prevent multiple inclusions of this file */
#define __INT_VARARGS_H /* and _int_varargs.h under DG/UX */
typedef struct
{
int __va_arg; /* argument number */
int *__va_stk; /* start of args passed on stack */
int *__va_reg; /* start of args passed in regs */
} va_list;
#else
#undef __va_size
#undef __va_reg_p
#endif /* __INT_VARARGS_H */
#ifdef _STDARG_H /* stdarg.h support */
#if __GNUC__ > 1 /* GCC 2.0 and beyond */
#define va_start(AP,LASTARG) ((AP) = *(va_list *)__builtin_saveregs())
#else
#define va_start(AP,LASTARG) \
( (AP).__va_reg = (int *) __builtin_saveregs2(0), \
(AP).__va_stk = (int *) __builtin_argptr(), \
(AP).__va_arg = (int) (__builtin_argsize() + 3) / 4 )
#endif
#else /* varargs.h support */
#if __GNUC__ > 1 /* GCC 2.0 and beyond */
#define va_start(AP) ((AP) = *(va_list *)__builtin_saveregs())
#else
#define va_start(AP) \
( (AP).__va_reg = (int *) __builtin_saveregs2(1), \
(AP).__va_stk = (int *) __builtin_argptr(), \
(AP).__va_arg = (int) (__builtin_argsize() - 4 + 3) / 4 )
#endif
#define va_alist __va_1st_arg
#define va_dcl register int va_alist;
#endif /* _STDARG_H */
#define __va_reg_p(TYPE) \
(__builtin_classify_type(*(TYPE *)0) < 12 \
? sizeof(TYPE) <= 8 : sizeof(TYPE) == 4 && __alignof__(TYPE) == 4)
#define __va_size(TYPE) ((sizeof(TYPE) + 3) >> 2)
#define va_arg(AP,TYPE) \
( (AP).__va_arg = (((AP).__va_arg + (1 << (__alignof__(TYPE) >> 3)) - 1) \
& ~((1 << (__alignof__(TYPE) >> 3)) - 1)) \
+ __va_size(TYPE), \
*((TYPE *) ((__va_reg_p(TYPE) && (AP).__va_arg < 8 + __va_size(TYPE) \
? (AP).__va_reg : (AP).__va_stk) \
+ ((AP).__va_arg - __va_size(TYPE)))))
#define va_end(AP)

View File

@@ -0,0 +1,52 @@
/* ---------------------------------------- */
/* VARARGS for MIPS/GNU CC */
/* */
/* */
/* */
/* */
/* ---------------------------------------- */
/* These macros implement traditional (non-ANSI) varargs
for GNU C. */
/* In GCC version 2, we want an ellipsis at the end of the declaration
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
#ifndef _VA_LIST_
#define _VA_LIST_
/* Make this a macro rather than a typedef, so we can undef any other defn. */
#define va_list __va___list
typedef char * __va___list;
#endif
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#ifdef _STDARG_H
#define va_start(AP, LASTARG) \
(AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
#else
#define va_alist __builtin_va_alist
#define va_dcl int __builtin_va_alist; __va_ellipsis
#define va_start(AP) AP = (char *) &__builtin_va_alist
#endif
#define va_end(AP)
#ifdef lint /* complains about constant in conditional context */
#define va_arg(list, mode) ((mode *)(list += sizeof(mode)))[-1]
#else /* !lint */
#define va_arg(AP, mode) \
((mode *)(AP = (char *) (__alignof(mode) > 4 \
? ((int)AP + 2*8 - 1) & -8 \
: ((int)AP + 2*4 - 1) & -4)))[-1]
#endif /* lint */

View File

@@ -0,0 +1,114 @@
/**
*
* Varargs for PYR/GNU CC
*
* WARNING -- WARNING -- DANGER
*
* The code in this file implements varargs for gcc on a pyr in
* a way that is compatible with code compiled by the Pyramid Technology
* C compiler.
* As such, it depends strongly on the Pyramid conventions for
* parameter passing.ct and independent implementation.
* These (somewhat bizarre) parameter-passing conventions are described
* in the ``OSx Operating System Porting Guide''.
*
* A quick summary is useful:
* 12 of the 48 register-windowed regs available for
* parameter passing. Parameters of a function call that are eligible
* to be passed in registers are assigned registers from TR0/PR0 onwards;
* all other arguments are passed on the stack.
* Structure and union parameters are *never* passed in registers,
* even if they are small enough to fit. They are always passed on
* the stack.
*
* Double-sized parameters cannot be passed in TR11, because
* TR12 is not used for passing parameters. If, in the absence of this
* rule, a double-sized param would have been passed in TR11,
* that parameter is passed on the stack and no parameters are
* passed in TR11.
*
* It is only known to work for passing 32-bit integer quantities
* (ie chars, shorts, ints/enums, longs), doubles, or pointers.
* Passing structures on a Pyramid via varargs is a loser.
* Passing an object larger than 8 bytes on a pyramid via varargs may
* also be a loser.
*
*/
/*
* pointer to next stack parameter in __va_buf[0]
* pointer to next parameter register in __va_buf[1]
* Count of registers seen at __va_buf[2]
* saved pr0..pr11 in __va_buf[3..14]
* # of calls to va_arg (debugging) at __va_buf[15]
*/
typedef void *__voidptr;
#if 1
typedef struct __va_regs {
__voidptr __stackp,__regp,__count;
__voidptr __pr0,__pr1,__pr2,__pr3,__pr4,__pr5,__pr6,__pr7,__pr8,__pr9,__pr10,__pr11;
} __va_regs;
typedef __va_regs __va_buf;
#else
/* __va_buf[0] = address of next arg passed on the stack
__va_buf[1] = address of next arg passed in a register
__va_buf[2] = register-# of next arg passed in a register
*/
typedef __voidptr(*__va_buf);
#endif
/* In GCC version 2, we want an ellipsis at the end of the declaration
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
#define va_alist \
__va0,__va1,__va2,__va3,__va4,__va5,__va6,__va7,__va8,__va9,__va10,__va11, \
__builtin_va_alist
/* The ... causes current_function_varargs to be set in cc1. */
#define va_dcl __voidptr va_alist; __va_ellipsis
typedef __va_buf va_list;
/* __asm ("rcsp %0" : "=r" ( _AP [0]));*/
#define va_start(_AP) \
_AP = ((struct __va_regs) { \
&(_AP.__pr0), (void*)&__builtin_va_alist, (void*)0, \
__va0,__va1,__va2,__va3,__va4,__va5, \
__va6,__va7,__va8,__va9,__va10,__va11})
/* Avoid errors if compiling GCC v2 with GCC v1. */
#if __GNUC__ == 1
#define __extension__
#endif
#define va_arg(_AP, _MODE) \
__extension__ \
({__voidptr *__ap = (__voidptr*)&_AP; \
register int __size = sizeof (_MODE); \
register int __onstack = \
(__size > 8 || ( (int)(__ap[2]) > 11) || \
(__size==8 && (int)(__ap[2])==11)); \
register int* __param_addr = ((int*)((__ap) [__onstack])); \
\
((void *)__ap[__onstack])+=__size; \
if (__onstack==0 || (int)(__ap[2])==11) \
__ap[2]+= (__size >> 2); \
*(( _MODE *)__param_addr); \
})
#define va_end(_X)

View File

@@ -0,0 +1,64 @@
/* This is just like the default gvarargs.h
except for differences described below. */
/* Make this a macro rather than a typedef, so we can undef any other defn. */
#define va_list __va___list
#ifndef __svr4__
/* This has to be a char * to be compatible with Sun.
i.e., we have to pass a `va_list' to vsprintf. */
typedef char * __va___list;
#else
/* This has to be a void * to be compatible with Sun svr4.
i.e., we have to pass a `va_list' to vsprintf. */
typedef void * __va___list;
#endif
/* In GCC version 2, we want an ellipsis at the end of the declaration
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
#ifdef _STDARG_H
#define va_start(AP, LASTARG) \
(__builtin_saveregs (), AP = ((char *) __builtin_next_arg ()))
#else
#define va_alist __builtin_va_alist
/* The ... causes current_function_varargs to be set in cc1. */
#define va_dcl int __builtin_va_alist; __va_ellipsis
#define va_start(AP) \
(__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
#endif
#define va_end(pvar)
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
/* Avoid errors if compiling GCC v2 with GCC v1. */
#if __GNUC__ == 1
#define __extension__
#endif
/* RECORD_TYPE args passed using the C calling convention are
passed by invisible reference. ??? RECORD_TYPE args passed
in the stack are made to be word-aligned; for an aggregate that is
not word-aligned, we advance the pointer to the first non-reg slot. */
#define va_arg(pvar,TYPE) \
__extension__ \
({ TYPE __va_temp; \
((__builtin_classify_type (__va_temp) >= 12) \
? ((pvar) += __va_rounded_size (TYPE *), \
**(TYPE **) ((pvar) - __va_rounded_size (TYPE *))) \
: __va_rounded_size (TYPE) == 8 \
? ({ union {TYPE d; int i[2];} u; \
u.i[0] = ((int *) (pvar))[0]; \
u.i[1] = ((int *) (pvar))[1]; \
(pvar) += 8; \
u.d; }) \
: ((pvar) += __va_rounded_size (TYPE), \
*((TYPE *) ((pvar) - __va_rounded_size (TYPE)))));})

View File

@@ -0,0 +1,61 @@
/* varargs.h for SPUR */
/* NB. This is NOT the definition needed for the new ANSI proposed
standard */
struct __va_struct { char __regs[20]; };
#define va_alist __va_regs, __va_stack
/* In GCC version 2, we want an ellipsis at the end of the declaration
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
/* The ... causes current_function_varargs to be set in cc1. */
#define va_dcl struct __va_struct __va_regs; int __va_stack;
typedef struct {
int __pnt;
char *__regs;
char *__stack;
} va_list;
#define va_start(pvar) \
((pvar).__pnt = 0, (pvar).__regs = __va_regs.__regs, \
(pvar).__stack = (char *) &__va_stack)
#define va_end(pvar)
/* Avoid errors if compiling GCC v2 with GCC v1. */
#if __GNUC__ == 1
#define __extension__
#endif
#define va_arg(pvar,type) \
__extension__ \
({ type __va_result; \
if ((pvar).__pnt >= 20) { \
__va_result = *( (type *) ((pvar).__stack + (pvar).__pnt - 20)); \
(pvar).__pnt += (sizeof(type) + 7) & ~7; \
} \
else if ((pvar).__pnt + sizeof(type) > 20) { \
__va_result = * (type *) (pvar).__stack; \
(pvar).__pnt = 20 + ( (sizeof(type) + 7) & ~7); \
} \
else if (sizeof(type) == 8) { \
union {double d; int i[2];} __u; \
__u.i[0] = *(int *) ((pvar).__regs + (pvar).__pnt); \
__u.i[1] = *(int *) ((pvar).__regs + (pvar).__pnt + 4); \
__va_result = * (type *) &__u; \
(pvar).__pnt += 8; \
} \
else { \
__va_result = * (type *) ((pvar).__regs + (pvar).__pnt); \
(pvar).__pnt += (sizeof(type) + 3) & ~3; \
} \
__va_result; })

View File

@@ -0,0 +1,110 @@
#ifndef __GNUC__
/* Use the system's macros with the system's compiler. */
#include <varargs.h>
#else
/* Record that varargs.h is defined; this turns off stdarg.h. */
#ifndef _VARARGS_H
#define _VARARGS_H
#ifdef __sparc__
#include "va-sparc.h"
#else
#ifdef __spur__
#include "va-spur.h"
#else
#ifdef __mips__
#include "va-mips.h"
#else
#ifdef __i860__
#include "va-i860.h"
#else
#ifdef __pyr__
#include "va-pyr.h"
#else
#ifdef __m88k__
#include "va-m88k.h"
#else
#ifdef __hp9000s800__
#include "va-hp800.h"
#else
#ifdef __i960__
#include "va-i960.h"
#else
#ifdef __NeXT__
/* On Next, erase any vestiges of stdarg.h. */
#undef va_alist
#undef va_dcl
#undef va_list
#undef va_start
#undef va_end
#undef __va_rounded_size
#undef va_arg
#endif /* __NeXT__ */
/* In GCC version 2, we want an ellipsis at the end of the declaration
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
/* These macros implement traditional (non-ANSI) varargs
for GNU C. */
#define va_alist __builtin_va_alist
/* The ... causes current_function_varargs to be set in cc1. */
#define va_dcl int __builtin_va_alist; __va_ellipsis
#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
#undef _VA_LIST
#endif
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */
/* But in 4.3bsd-net2, _VA_LIST_ has another meaning. So ignore it. */
#if !defined (_VA_LIST_) || defined (_ANSI_H)
/* The macro _VA_LIST is used in SCO Unix 3.2. */
#ifndef _VA_LIST
#ifndef _VA_LIST_
#define _VA_LIST_
#endif
#define _VA_LIST
/* Make this a macro rather than a typedef, so we can undef any other defn. */
#define va_list __va___list
typedef char * __va___list;
#endif /* _VA_LIST */
#endif /* !defined (_VA_LIST_) || defined (_ANSI_H) */
/* In 4.3bsd-net2, it is said we must #undef this.
I hope this successfully identifies that system.
I don't know why this works--rms. */
#ifdef _ANSI_H
#undef _VA_LIST_
#endif
#define va_start(AP) AP=(char *) &__builtin_va_alist
#define va_end(AP)
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_arg(AP, TYPE) \
(AP += __va_rounded_size (TYPE), \
*((TYPE *) (AP - __va_rounded_size (TYPE))))
#endif /* not i960 */
#endif /* not hp800 */
#endif /* not m88k */
#endif /* not pyr */
#endif /* not i860 */
#endif /* not mips */
#endif /* not spur */
#endif /* not sparc */
#endif /* not _VARARGS_H */
#endif /* __GNUC__ */