|
|
1.1 ! root 1: /* GNU C varargs support for the Intel 80960. */ ! 2: ! 3: /* Define __gnuc_va_list. */ ! 4: ! 5: #ifndef __GNUC_VA_LIST ! 6: #define __GNUC_VA_LIST ! 7: /* The first element is the address of the first argument. ! 8: The second element is the number of bytes skipped past so far. */ ! 9: typedef unsigned __gnuc_va_list[2]; ! 10: #endif /* not __GNUC_VA_LIST */ ! 11: ! 12: /* If this is for internal libc use, don't define anything but ! 13: __gnuc_va_list. */ ! 14: #if defined (_STDARG_H) || defined (_VARARGS_H) ! 15: ! 16: /* In GCC version 2, we want an ellipsis at the end of the declaration ! 17: of the argument list. GCC version 1 can't parse it. */ ! 18: ! 19: #if __GNUC__ > 1 ! 20: #define __va_ellipsis ... ! 21: #else ! 22: #define __va_ellipsis ! 23: #endif ! 24: ! 25: /* The stack size of the type t. */ ! 26: #define __vsiz(T) (((sizeof (T) + 3) / 4) * 4) ! 27: /* The stack alignment of the type t. */ ! 28: #define __vali(T) (__alignof__ (T) >= 4 ? __alignof__ (T) : 4) ! 29: /* The offset of the next stack argument after one of type t at offset i. */ ! 30: #define __vpad(I, T) ((((I) + __vali (T) - 1) / __vali (T)) \ ! 31: * __vali (T) + __vsiz (T)) ! 32: ! 33: /* Avoid errors if compiling GCC v2 with GCC v1. */ ! 34: #if __GNUC__ == 1 ! 35: #define __extension__ ! 36: #endif ! 37: ! 38: #ifdef _STDARG_H ! 39: #define va_start(AP, LASTARG) \ ! 40: __extension__ \ ! 41: ({ __asm__ ("st g14,%0" : "=m" (*(AP))); \ ! 42: (AP)[1] = (__builtin_args_info (0) + __builtin_args_info (1)) * 4; }) ! 43: ! 44: #else ! 45: ! 46: #define va_alist __builtin_va_alist ! 47: #define va_dcl char *__builtin_va_alist; __va_ellipsis ! 48: #define va_start(AP) ((AP)[1] = 0, *(AP) = (unsigned) &va_alist) ! 49: #endif ! 50: ! 51: /* We cast to void * and then to TYPE * because this avoids ! 52: a warning about increasing the alignment requirement. */ ! 53: #define va_arg(AP, T) \ ! 54: ( \ ! 55: ( \ ! 56: ((AP)[1] <= 48 && (__vpad ((AP)[1], T) > 48 || __vsiz (T) > 16)) \ ! 57: ? ((AP)[1] = 48 + __vsiz (T)) \ ! 58: : ((AP)[1] = __vpad ((AP)[1], T)) \ ! 59: ), \ ! 60: \ ! 61: *((T *) (void *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \ ! 62: ) ! 63: ! 64: #ifndef va_end ! 65: void va_end (__gnuc_va_list); /* Defined in libgcc.a */ ! 66: #endif ! 67: #define va_end(AP) ! 68: ! 69: #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ ! 70:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.