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