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