Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/include/ppc/_structs.h

Source at commit 1271 created 12 years 8 months ago.
By meklort, Add missing ppc headers
1/*
2 * Copyright (c) 2004 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
29#include <sys/cdefs.h>
30
31#ifdef __need_mcontext_t
32#ifndef __need_struct_mcontext
33#define __need_struct_mcontext
34#endif /* __need_struct_mcontext */
35#endif /* __need_mcontext_t */
36
37#ifdef __need_mcontext64_t
38#ifndef __need_struct_mcontext64
39#define __need_struct_mcontext64
40#endif /* __need_struct_mcontext64 */
41#endif /* __need_mcontext64_t */
42
43#if defined(__need_struct_mcontext) || defined(__need_struct_mcontext64)
44#include <mach/ppc/_structs.h>
45#endif /* __need_struct_mcontext || __need_struct_mcontext64 */
46
47#ifdef __need_struct_mcontext
48#undef __need_struct_mcontext
49#ifndef _STRUCT_MCONTEXT
50#if __DARWIN_UNIX03
51#define_STRUCT_MCONTEXTstruct __darwin_mcontext
52_STRUCT_MCONTEXT
53{
54_STRUCT_PPC_EXCEPTION_STATE__es;
55_STRUCT_PPC_THREAD_STATE__ss;
56_STRUCT_PPC_FLOAT_STATE__fs;
57_STRUCT_PPC_VECTOR_STATE__vs;
58};
59#else /* !__DARWIN_UNIX03 */
60#define_STRUCT_MCONTEXTstruct mcontext
61_STRUCT_MCONTEXT
62{
63_STRUCT_PPC_EXCEPTION_STATEes;
64_STRUCT_PPC_THREAD_STATEss;
65_STRUCT_PPC_FLOAT_STATEfs;
66_STRUCT_PPC_VECTOR_STATEvs;
67};
68#endif /* __DARWIN_UNIX03 */
69#endif /* _STRUCT_MCONTEXT */
70#endif /* __need_struct_mcontext */
71
72#ifdef __need_struct_mcontext64
73#undef __need_struct_mcontext64
74#ifndef _STRUCT_MCONTEXT64
75#if __DARWIN_UNIX03
76#define _STRUCT_MCONTEXT64struct __darwin_mcontext64
77_STRUCT_MCONTEXT64
78{
79_STRUCT_PPC_EXCEPTION_STATE64__es;
80_STRUCT_PPC_THREAD_STATE64__ss;
81_STRUCT_PPC_FLOAT_STATE__fs;
82_STRUCT_PPC_VECTOR_STATE__vs;
83};
84#else /* !__DARWIN_UNIX03 */
85#define _STRUCT_MCONTEXT64struct mcontext64
86_STRUCT_MCONTEXT64
87{
88_STRUCT_PPC_EXCEPTION_STATE64es;
89_STRUCT_PPC_THREAD_STATE64ss;
90_STRUCT_PPC_FLOAT_STATEfs;
91_STRUCT_PPC_VECTOR_STATEvs;
92};
93#endif /* __DARWIN_UNIX03 */
94#endif /* _STRUCT_MCONTEXT64 */
95#endif /* __need_struct_mcontext64 */
96
97#ifdef __need_mcontext_t
98#undef __need_mcontext_t
99#ifndef _MCONTEXT_T
100#define _MCONTEXT_T
101typedef _STRUCT_MCONTEXT*mcontext_t;
102#endif /* _MCONTEXT_T */
103#endif /* __need_mcontext_t */
104
105#ifdef __need_mcontext64_t
106#undef __need_mcontext64_t
107#ifndef _MCONTEXT64_T
108#define _MCONTEXT64_T
109typedef _STRUCT_MCONTEXT64*mcontext64_t;
110#endif /* _MCONTEXT64_T */
111#endif /* __need_mcontext64_t */
112
113#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
114#ifndef PPC_MCONTEXT_SIZE
115#define PPC_MCONTEXT_SIZE(PPC_THREAD_STATE_COUNT + PPC_FLOAT_STATE_COUNT + PPC_EXCEPTION_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int)
116#endif /* PPC_MCONTEXT_SIZE */
117#ifndef PPC_MCONTEXT64_SIZE
118#define PPC_MCONTEXT64_SIZE(PPC_THREAD_STATE64_COUNT + PPC_FLOAT_STATE_COUNT + PPC_EXCEPTION_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int)
119#endif /* PPC_MCONTEXT64_SIZE */
120#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
121
122/*
123 * LP64todo - Have to decide how to handle this.
124 * For now, just duplicate the 32-bit context as the generic one.
125 */
126#ifdef __need_struct_sigcontext
127#undef __need_struct_sigcontext
128#ifndef _STRUCT_SIGCONTEXT
129#if __DARWIN_UNIX03/* signal.h needs struct sigcontext visible */
130#define _STRUCT_SIGCONTEXTstruct __darwin_sigcontext
131_STRUCT_SIGCONTEXT
132{
133 int__sc_onstack;/* sigstack state to restore */
134 int__sc_mask;/* signal mask to restore */
135 int__sc_ir;/* pc */
136 int__sc_psw;/* processor status word */
137 int__sc_sp;/* stack pointer if sc_regs == NULL */
138 void*__sc_regs;/* (kernel private) saved state */
139};
140#else /* !__DARWIN_UNIX03 */
141#define _STRUCT_SIGCONTEXTstruct sigcontext
142_STRUCT_SIGCONTEXT
143{
144 intsc_onstack;/* sigstack state to restore */
145 intsc_mask;/* signal mask to restore */
146 intsc_ir;/* pc */
147 intsc_psw;/* processor status word */
148 intsc_sp;/* stack pointer if sc_regs == NULL */
149 void*sc_regs;/* (kernel private) saved state */
150};
151#endif /* __DARWIN_UNIX03 */
152#endif /* _STRUCT_SIGCONTEXT */
153#endif /* __need_struct_sigcontext */
154
155/*
156 * Information pushed on stack when a signal is delivered.
157 * This is used by the kernel to restore state following
158 * execution of the signal handler. It is also made available
159 * to the handler to allow it to properly restore state if
160 * a non-standard exit is performed.
161 */
162#ifdef __need_struct_sigcontext32
163#undef __need_struct_sigcontext32
164#ifndef _STRUCT_SIGCONTEXT32
165#if __DARWIN_UNIX03
166#define _STRUCT_SIGCONTEXT32struct __darwin_sigcontext32
167_STRUCT_SIGCONTEXT32
168{
169 int__sc_onstack;/* sigstack state to restore */
170 int__sc_mask;/* signal mask to restore */
171 int__sc_ir;/* pc */
172 int__sc_psw;/* processor status word */
173 int__sc_sp;/* stack pointer if sc_regs == NULL */
174 void*__sc_regs;/* (kernel private) saved state */
175};
176#else /* !__DARWIN_UNIX03 */
177#define _STRUCT_SIGCONTEXT32struct sigcontext32
178_STRUCT_SIGCONTEXT32
179{
180 intsc_onstack;/* sigstack state to restore */
181 intsc_mask;/* signal mask to restore */
182 intsc_ir;/* pc */
183 intsc_psw;/* processor status word */
184 intsc_sp;/* stack pointer if sc_regs == NULL */
185 void*sc_regs;/* (kernel private) saved state */
186};
187#endif /* __DARWIN_UNIX03 */
188#endif /* _STRUCT_SIGCONTEXT32 */
189#endif /* __need_struct_sigcontext32 */
190
191#ifdef __need_struct_sigcontext64
192#undef __need_struct_sigcontext64
193#ifndef _STRUCT_SIGCONTEXT64
194#if __DARWIN_UNIX03
195#define _STRUCT_SIGCONTEXT64struct __darwin_sigcontext64
196_STRUCT_SIGCONTEXT64
197{
198 int__sc_onstack;/* sigstack state to restore */
199 int__sc_mask;/* signal mask to restore */
200 long long__sc_ir;/* pc */
201 long long__sc_psw;/* processor status word */
202 long long__sc_sp;/* stack pointer if sc_regs == NULL */
203 void*__sc_regs;/* (kernel private) saved state */
204};
205#else /* !__DARWIN_UNIX03 */
206#define _STRUCT_SIGCONTEXT64struct sigcontext64
207_STRUCT_SIGCONTEXT64
208{
209 intsc_onstack;/* sigstack state to restore */
210 intsc_mask;/* signal mask to restore */
211 long longsc_ir;/* pc */
212 long longsc_psw;/* processor status word */
213 long longsc_sp;/* stack pointer if sc_regs == NULL */
214 void*sc_regs;/* (kernel private) saved state */
215};
216#endif /* __DARWIN_UNIX03 */
217#endif /* _STRUCT_SIGCONTEXT64 */
218#endif /* __need_struct_sigcontext64 */
219

Archive Download this file

Revision: 1271