]> git.saurik.com Git - apple/xnu.git/blob - osfmk/libsa/ppc/va_list.h
e4d2ea110ae64001a47ad4c3459e4ba1b8dd5d30
[apple/xnu.git] / osfmk / libsa / ppc / va_list.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 #if !defined(APPLE) && !defined(NeXT)
29 /*
30 * @OSF_COPYRIGHT@
31 */
32 /*
33 * HISTORY
34 *
35 * Revision 1.1.1.1 1998/09/22 21:05:51 wsanchez
36 * Import of Mac OS X kernel (~semeria)
37 *
38 * Revision 1.1.1.1 1998/03/07 02:25:36 wsanchez
39 * Import of OSF Mach kernel (~mburg)
40 *
41 * Revision 1.1.2.1 1996/12/09 16:59:07 stephen
42 * nmklinux_1.0b3_shared into pmk1.1
43 * [1996/12/09 11:18:59 stephen]
44 *
45 * Revision 1.1.4.1 1996/04/11 14:37:05 emcmanus
46 * Copied from mainline.ppc.
47 * [1996/04/11 14:36:22 emcmanus]
48 *
49 * Revision 1.1.2.1 1995/12/28 16:37:24 barbou
50 * Self-Contained Mach Distribution:
51 * created.
52 * [95/12/28 barbou]
53 *
54 * $EndLog$
55 */
56
57 /*
58 * Four possible situations:
59 * - We are being included by {var,std}args.h (or anyone) before stdio.h.
60 * define real type.
61 *
62 * - We are being included by stdio.h before {var,std}args.h.
63 * define hidden type for prototypes in stdio, don't pollute namespace.
64 *
65 * - We are being included by {var,std}args.h after stdio.h.
66 * define real type to match hidden type. no longer use hidden type.
67 *
68 * - We are being included again after defining the real va_list.
69 * do nothing.
70 *
71 */
72
73 #if !defined(_HIDDEN_VA_LIST) && !defined(_VA_LIST)
74
75 /* Define __gnuc_va_list. */
76
77 #ifndef __GNUC_VA_LIST
78 /*
79 * If this is for internal libc use, don't define
80 * anything but __gnuc_va_list.
81 */
82 #define __GNUC_VA_LIST
83 typedef struct {
84 char gpr; /* index into the array of 8 GPRs stored in the
85 register save area gpr=0 corresponds to r3,
86 gpr=1 to r4, etc. */
87 char fpr; /* index into the array of 8 FPRs stored in the
88 register save area fpr=0 corresponds to f1,
89 fpr=1 to f2, etc. */
90 char *overflow_arg_area; /* location on stack that holds the next
91 overflow argument */
92 char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
93 } __gnuc_va_list[1];
94
95 #endif /* not __GNUC_VA_LIST */
96
97 #define _VA_LIST
98 typedef struct {
99 char gpr; /* index into the array of 8 GPRs stored in the
100 register save area gpr=0 corresponds to r3,
101 gpr=1 to r4, etc. */
102 char fpr; /* index into the array of 8 FPRs stored in the
103 register save area fpr=0 corresponds to f1,
104 fpr=1 to f2, etc. */
105 char *overflow_arg_area; /* location on stack that holds the next
106 overflow argument */
107 char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
108 } va_list[1];
109
110 #elif defined(_HIDDEN_VA_LIST) && !defined(_VA_LIST)
111
112 #define _VA_LIST
113 typedef struct {
114 char gpr; /* index into the array of 8 GPRs stored in the
115 register save area gpr=0 corresponds to r3,
116 gpr=1 to r4, etc. */
117 char fpr; /* index into the array of 8 FPRs stored in the
118 register save area fpr=0 corresponds to f1,
119 fpr=1 to f2, etc. */
120 char *overflow_arg_area; /* location on stack that holds the next
121 overflow argument */
122 char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
123 } __va_list[1];
124
125 #elif defined(_HIDDEN_VA_LIST) && defined(_VA_LIST)
126
127 #undef _HIDDEN_VA_LIST
128 typedef __va_list va_list;
129
130 #endif
131
132 #endif