Chameleon

Chameleon Svn Source Tree

Root/branches/Chimera/i386/include/mach/ppc/_structs.h

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 * @OSF_COPYRIGHT@
30 */
31
32#ifndef_MACH_PPC__STRUCTS_H_
33#define_MACH_PPC__STRUCTS_H_
34
35#include <sys/cdefs.h>
36
37/*
38 * ppc_thread_state is the structure that is exported to user threads for
39 * use in status/mutate calls. This structure should never change.
40 *
41 */
42
43#if __DARWIN_UNIX03
44#define_STRUCT_PPC_THREAD_STATEstruct __darwin_ppc_thread_state
45_STRUCT_PPC_THREAD_STATE
46{
47unsigned int __srr0;/* Instruction address register (PC) */
48unsigned int __srr1;/* Machine state register (supervisor) */
49unsigned int __r0;
50unsigned int __r1;
51unsigned int __r2;
52unsigned int __r3;
53unsigned int __r4;
54unsigned int __r5;
55unsigned int __r6;
56unsigned int __r7;
57unsigned int __r8;
58unsigned int __r9;
59unsigned int __r10;
60unsigned int __r11;
61unsigned int __r12;
62unsigned int __r13;
63unsigned int __r14;
64unsigned int __r15;
65unsigned int __r16;
66unsigned int __r17;
67unsigned int __r18;
68unsigned int __r19;
69unsigned int __r20;
70unsigned int __r21;
71unsigned int __r22;
72unsigned int __r23;
73unsigned int __r24;
74unsigned int __r25;
75unsigned int __r26;
76unsigned int __r27;
77unsigned int __r28;
78unsigned int __r29;
79unsigned int __r30;
80unsigned int __r31;
81
82unsigned int __cr;/* Condition register */
83unsigned int __xer;/* User's integer exception register */
84unsigned int __lr;/* Link register */
85unsigned int __ctr;/* Count register */
86unsigned int __mq;/* MQ register (601 only) */
87
88unsigned int __vrsave;/* Vector Save Register */
89};
90#else /* !__DARWIN_UNIX03 */
91#define_STRUCT_PPC_THREAD_STATEstruct ppc_thread_state
92_STRUCT_PPC_THREAD_STATE
93{
94unsigned int srr0;/* Instruction address register (PC) */
95unsigned int srr1;/* Machine state register (supervisor) */
96unsigned int r0;
97unsigned int r1;
98unsigned int r2;
99unsigned int r3;
100unsigned int r4;
101unsigned int r5;
102unsigned int r6;
103unsigned int r7;
104unsigned int r8;
105unsigned int r9;
106unsigned int r10;
107unsigned int r11;
108unsigned int r12;
109unsigned int r13;
110unsigned int r14;
111unsigned int r15;
112unsigned int r16;
113unsigned int r17;
114unsigned int r18;
115unsigned int r19;
116unsigned int r20;
117unsigned int r21;
118unsigned int r22;
119unsigned int r23;
120unsigned int r24;
121unsigned int r25;
122unsigned int r26;
123unsigned int r27;
124unsigned int r28;
125unsigned int r29;
126unsigned int r30;
127unsigned int r31;
128
129unsigned int cr;/* Condition register */
130unsigned int xer;/* User's integer exception register */
131unsigned int lr;/* Link register */
132unsigned int ctr;/* Count register */
133unsigned int mq;/* MQ register (601 only) */
134
135unsigned int vrsave;/* Vector Save Register */
136};
137#endif /* __DARWIN_UNIX03 */
138
139#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
140
141#pragma pack(4)/* Make sure the structure stays as we defined it */
142
143#if __DARWIN_UNIX03
144#define _STRUCT_PPC_THREAD_STATE64struct __darwin_ppc_thread_state64
145_STRUCT_PPC_THREAD_STATE64
146{
147unsigned long long __srr0;/* Instruction address register (PC) */
148unsigned long long __srr1;/* Machine state register (supervisor) */
149unsigned long long __r0;
150unsigned long long __r1;
151unsigned long long __r2;
152unsigned long long __r3;
153unsigned long long __r4;
154unsigned long long __r5;
155unsigned long long __r6;
156unsigned long long __r7;
157unsigned long long __r8;
158unsigned long long __r9;
159unsigned long long __r10;
160unsigned long long __r11;
161unsigned long long __r12;
162unsigned long long __r13;
163unsigned long long __r14;
164unsigned long long __r15;
165unsigned long long __r16;
166unsigned long long __r17;
167unsigned long long __r18;
168unsigned long long __r19;
169unsigned long long __r20;
170unsigned long long __r21;
171unsigned long long __r22;
172unsigned long long __r23;
173unsigned long long __r24;
174unsigned long long __r25;
175unsigned long long __r26;
176unsigned long long __r27;
177unsigned long long __r28;
178unsigned long long __r29;
179unsigned long long __r30;
180unsigned long long __r31;
181
182unsigned int __cr;/* Condition register */
183unsigned long long __xer;/* User's integer exception register */
184unsigned long long __lr;/* Link register */
185unsigned long long __ctr;/* Count register */
186
187unsigned int __vrsave;/* Vector Save Register */
188};
189#else /* !__DARWIN_UNIX03 */
190#define _STRUCT_PPC_THREAD_STATE64struct ppc_thread_state64
191_STRUCT_PPC_THREAD_STATE64
192{
193unsigned long long srr0;/* Instruction address register (PC) */
194unsigned long long srr1;/* Machine state register (supervisor) */
195unsigned long long r0;
196unsigned long long r1;
197unsigned long long r2;
198unsigned long long r3;
199unsigned long long r4;
200unsigned long long r5;
201unsigned long long r6;
202unsigned long long r7;
203unsigned long long r8;
204unsigned long long r9;
205unsigned long long r10;
206unsigned long long r11;
207unsigned long long r12;
208unsigned long long r13;
209unsigned long long r14;
210unsigned long long r15;
211unsigned long long r16;
212unsigned long long r17;
213unsigned long long r18;
214unsigned long long r19;
215unsigned long long r20;
216unsigned long long r21;
217unsigned long long r22;
218unsigned long long r23;
219unsigned long long r24;
220unsigned long long r25;
221unsigned long long r26;
222unsigned long long r27;
223unsigned long long r28;
224unsigned long long r29;
225unsigned long long r30;
226unsigned long long r31;
227
228unsigned int cr;/* Condition register */
229unsigned long long xer;/* User's integer exception register */
230unsigned long long lr;/* Link register */
231unsigned long long ctr;/* Count register */
232
233unsigned int vrsave;/* Vector Save Register */
234};
235#endif /* __DARWIN_UNIX03 */
236
237#pragma pack()
238
239#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
240
241/* This structure should be double-word aligned for performance */
242
243#if __DARWIN_UNIX03
244#define_STRUCT_PPC_FLOAT_STATEstruct __darwin_ppc_float_state
245_STRUCT_PPC_FLOAT_STATE
246{
247double __fpregs[32];
248
249unsigned int __fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */
250unsigned int __fpscr;/* floating point status register */
251};
252#else /* !__DARWIN_UNIX03 */
253#define_STRUCT_PPC_FLOAT_STATEstruct ppc_float_state
254_STRUCT_PPC_FLOAT_STATE
255{
256double fpregs[32];
257
258unsigned int fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */
259unsigned int fpscr;/* floating point status register */
260};
261#endif /* __DARWIN_UNIX03 */
262
263#pragma pack(4)/* Make sure the structure stays as we defined it */
264
265#if __DARWIN_UNIX03
266#define _STRUCT_PPC_VECTOR_STATEstruct __darwin_ppc_vector_state
267_STRUCT_PPC_VECTOR_STATE
268{
269#if defined(__LP64__)
270unsigned int__save_vr[32][4];
271unsigned int__save_vscr[4];
272#else
273unsigned long__save_vr[32][4];
274unsigned long__save_vscr[4];
275#endif
276unsigned int__save_pad5[4];
277unsigned int__save_vrvalid;/* VRs that have been saved */
278unsigned int__save_pad6[7];
279};
280#else /* !__DARWIN_UNIX03 */
281#define _STRUCT_PPC_VECTOR_STATEstruct ppc_vector_state
282_STRUCT_PPC_VECTOR_STATE
283{
284#if defined(__LP64__)
285unsigned intsave_vr[32][4];
286unsigned intsave_vscr[4];
287#else
288unsigned longsave_vr[32][4];
289unsigned longsave_vscr[4];
290#endif
291unsigned intsave_pad5[4];
292unsigned intsave_vrvalid;/* VRs that have been saved */
293unsigned intsave_pad6[7];
294};
295#endif /* __DARWIN_UNIX03 */
296
297#pragma pack()
298
299/*
300 * ppc_exception_state
301 *
302 * This structure corresponds to some additional state of the user
303 * registers as saved in the PCB upon kernel entry. They are only
304 * available if an exception is passed out of the kernel, and even
305 * then not all are guaranteed to be updated.
306 *
307 * Some padding is included in this structure which allows space for
308 * servers to store temporary values if need be, to maintain binary
309 * compatiblity.
310 */
311
312/* Exception state for 32-bit thread (on 32-bit processor) */
313/* Still available on 64-bit processors, but may fall short */
314/* of covering the full potential state (hi half available). */
315
316#pragma pack(4)/* Make sure the structure stays as we defined it */
317
318#if __DARWIN_UNIX03
319#define _STRUCT_PPC_EXCEPTION_STATEstruct __darwin_ppc_exception_state
320_STRUCT_PPC_EXCEPTION_STATE
321{
322#if defined(__LP64__)
323unsigned int __dar;/* Fault registers for coredump */
324unsigned int __dsisr;
325unsigned int __exception;/* number of powerpc exception taken */
326unsigned int __pad0;/* align to 16 bytes */
327unsigned int __pad1[4];/* space in PCB "just in case" */
328#else
329unsigned long __dar;/* Fault registers for coredump */
330unsigned long __dsisr;
331unsigned long __exception;/* number of powerpc exception taken */
332unsigned long __pad0;/* align to 16 bytes */
333unsigned long __pad1[4];/* space in PCB "just in case" */
334#endif
335};
336#else /* !__DARWIN_UNIX03 */
337#define _STRUCT_PPC_EXCEPTION_STATEstruct ppc_exception_state
338_STRUCT_PPC_EXCEPTION_STATE
339{
340#if defined(__LP64__)
341unsigned int dar;/* Fault registers for coredump */
342unsigned int dsisr;
343unsigned int exception;/* number of powerpc exception taken */
344unsigned int pad0;/* align to 16 bytes */
345unsigned int pad1[4];/* space in PCB "just in case" */
346#else
347unsigned long dar;/* Fault registers for coredump */
348unsigned long dsisr;
349unsigned long exception;/* number of powerpc exception taken */
350unsigned long pad0;/* align to 16 bytes */
351unsigned long pad1[4];/* space in PCB "just in case" */
352#endif
353};
354#endif /* __DARWIN_UNIX03 */
355
356#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
357#if __DARWIN_UNIX03
358#define _STRUCT_PPC_EXCEPTION_STATE64struct __darwin_ppc_exception_state64
359_STRUCT_PPC_EXCEPTION_STATE64
360{
361unsigned long long __dar;/* Fault registers for coredump */
362#if defined(__LP64__)
363unsigned int __dsisr;
364unsigned int __exception;/* number of powerpc exception taken */
365unsigned int __pad1[4];/* space in PCB "just in case" */
366#else
367unsigned long __dsisr;
368unsigned long __exception;/* number of powerpc exception taken */
369unsigned long __pad1[4];/* space in PCB "just in case" */
370#endif
371};
372#else /* !__DARWIN_UNIX03 */
373#define _STRUCT_PPC_EXCEPTION_STATE64struct ppc_exception_state64
374_STRUCT_PPC_EXCEPTION_STATE64
375{
376unsigned long long dar;/* Fault registers for coredump */
377#if defined(__LP64__)
378unsigned int dsisr;
379unsigned int exception;/* number of powerpc exception taken */
380unsigned int pad1[4];/* space in PCB "just in case" */
381#else
382unsigned long dsisr;
383unsigned long exception;/* number of powerpc exception taken */
384unsigned long pad1[4];/* space in PCB "just in case" */
385#endif
386};
387#endif /* __DARWIN_UNIX03 */
388#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
389
390#pragma pack()
391
392#endif /* _MACH_PPC__STRUCTS_H_ */
393

Archive Download this file

Revision: 2225