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 long __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
32 #define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ())
36 /* ANSI alternative. */
38 #define va_start(pvar, firstarg) \
39 ((pvar) = *(__gnuc_va_list *) __builtin_saveregs ())
41 #endif /* _STDARG_H */
47 /* Values returned by __builtin_classify_type. */
54 __enumeral_type_class,
57 __reference_type_class,
61 __function_type_class,
74 /* Note that parameters are always aligned at least to a word boundary
75 (when passed) regardless of what GCC's __alignof__ operator says. */
77 /* Avoid errors if compiling GCC v2 with GCC v1. */
82 /* Get the size of a type in bytes, rounded up to an integral number
85 #define __va_tsize(__type) \
86 (((sizeof (__type) + sizeof (long) - 1) / sizeof (long)) * sizeof (long))
88 #define va_arg(__va, __type) \
89 (*(((__va).__offset += __va_tsize (__type)), \
90 (__type *)((__va).__base + (__va).__offset \
91 - (((__builtin_classify_type (* (__type *) 0) \
92 == __real_type_class) && (__va).__offset <= (6 * 8)) \
93 ? (6 * 8) + 8 : __va_tsize (__type)))))
95 #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */