1 /* GNU C varargs and stdargs support for the DEC Alpha. */
3 /* Note: We must use the name __builtin_savregs. GCC attaches special
4 significance to that name. In particular, regardless of where in a
5 function __builtin_saveregs is called, GCC moves the call up to the
6 very start of the function. */
8 /* Define __gnuc_va_list. */
10 #ifndef __GNUC_VA_LIST
11 #define __GNUC_VA_LIST
14 char *__base
; /* Pointer to first integer register. */
15 int __offset
; /* Byte offset of args so far. */
17 #endif /* not __GNUC_VA_LIST */
19 /* If this is for internal libc use, don't define anything but
21 #if defined (_STDARG_H) || defined (_VARARGS_H)
23 #define va_list __gnuc_va_list
27 #if !defined(_STDARG_H)
30 #define va_alist __builtin_va_alist
31 #define va_dcl int __builtin_va_alist;...
32 #define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ())
36 /* ANSI alternative. */
38 /* Call __builtin_next_arg even though we aren't using its value, so that
39 we can verify that firstarg is correct. */
40 #define va_start(pvar, firstarg) \
41 (__builtin_next_arg (firstarg), \
42 (pvar) = *(__gnuc_va_list *) __builtin_saveregs ())
44 #endif /* _STDARG_H */
48 #define va_end(__va) ((void) 0)
50 /* Values returned by __builtin_classify_type. */
57 __enumeral_type_class
,
60 __reference_type_class
,
64 __function_type_class
,
77 /* Note that parameters are always aligned at least to a word boundary
78 (when passed) regardless of what GCC's __alignof__ operator says. */
80 /* Avoid errors if compiling GCC v2 with GCC v1. */
85 /* Get the size of a type in bytes, rounded up to an integral number
88 #define __va_tsize(__type) \
89 (((sizeof (__type) + __extension__ sizeof (long long) - 1) \
90 / __extension__ sizeof (long long)) * __extension__ sizeof (long long))
92 #define va_arg(__va, __type) \
93 (*(((__va).__offset += __va_tsize (__type)), \
94 (__type *)(void *)((__va).__base + (__va).__offset \
95 - (((__builtin_classify_type (* (__type *) 0) \
96 == __real_type_class) && (__va).__offset <= (6 * 8)) \
97 ? (6 * 8) + 8 : __va_tsize (__type)))))
99 #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */