···11+/*
22+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+#ifndef _MACH_PPC__STRUCTS_H_
3333+#define _MACH_PPC__STRUCTS_H_
3434+3535+#include <sys/cdefs.h>
3636+3737+/*
3838+ * ppc_thread_state is the structure that is exported to user threads for
3939+ * use in status/mutate calls. This structure should never change.
4040+ *
4141+ */
4242+4343+#if __DARWIN_UNIX03
4444+#define _STRUCT_PPC_THREAD_STATE struct __darwin_ppc_thread_state
4545+_STRUCT_PPC_THREAD_STATE
4646+{
4747+ unsigned int __srr0; /* Instruction address register (PC) */
4848+ unsigned int __srr1; /* Machine state register (supervisor) */
4949+ unsigned int __r0;
5050+ unsigned int __r1;
5151+ unsigned int __r2;
5252+ unsigned int __r3;
5353+ unsigned int __r4;
5454+ unsigned int __r5;
5555+ unsigned int __r6;
5656+ unsigned int __r7;
5757+ unsigned int __r8;
5858+ unsigned int __r9;
5959+ unsigned int __r10;
6060+ unsigned int __r11;
6161+ unsigned int __r12;
6262+ unsigned int __r13;
6363+ unsigned int __r14;
6464+ unsigned int __r15;
6565+ unsigned int __r16;
6666+ unsigned int __r17;
6767+ unsigned int __r18;
6868+ unsigned int __r19;
6969+ unsigned int __r20;
7070+ unsigned int __r21;
7171+ unsigned int __r22;
7272+ unsigned int __r23;
7373+ unsigned int __r24;
7474+ unsigned int __r25;
7575+ unsigned int __r26;
7676+ unsigned int __r27;
7777+ unsigned int __r28;
7878+ unsigned int __r29;
7979+ unsigned int __r30;
8080+ unsigned int __r31;
8181+8282+ unsigned int __cr; /* Condition register */
8383+ unsigned int __xer; /* User's integer exception register */
8484+ unsigned int __lr; /* Link register */
8585+ unsigned int __ctr; /* Count register */
8686+ unsigned int __mq; /* MQ register (601 only) */
8787+8888+ unsigned int __vrsave; /* Vector Save Register */
8989+};
9090+#else /* !__DARWIN_UNIX03 */
9191+#define _STRUCT_PPC_THREAD_STATE struct ppc_thread_state
9292+_STRUCT_PPC_THREAD_STATE
9393+{
9494+ unsigned int srr0; /* Instruction address register (PC) */
9595+ unsigned int srr1; /* Machine state register (supervisor) */
9696+ unsigned int r0;
9797+ unsigned int r1;
9898+ unsigned int r2;
9999+ unsigned int r3;
100100+ unsigned int r4;
101101+ unsigned int r5;
102102+ unsigned int r6;
103103+ unsigned int r7;
104104+ unsigned int r8;
105105+ unsigned int r9;
106106+ unsigned int r10;
107107+ unsigned int r11;
108108+ unsigned int r12;
109109+ unsigned int r13;
110110+ unsigned int r14;
111111+ unsigned int r15;
112112+ unsigned int r16;
113113+ unsigned int r17;
114114+ unsigned int r18;
115115+ unsigned int r19;
116116+ unsigned int r20;
117117+ unsigned int r21;
118118+ unsigned int r22;
119119+ unsigned int r23;
120120+ unsigned int r24;
121121+ unsigned int r25;
122122+ unsigned int r26;
123123+ unsigned int r27;
124124+ unsigned int r28;
125125+ unsigned int r29;
126126+ unsigned int r30;
127127+ unsigned int r31;
128128+129129+ unsigned int cr; /* Condition register */
130130+ unsigned int xer; /* User's integer exception register */
131131+ unsigned int lr; /* Link register */
132132+ unsigned int ctr; /* Count register */
133133+ unsigned int mq; /* MQ register (601 only) */
134134+135135+ unsigned int vrsave; /* Vector Save Register */
136136+};
137137+#endif /* __DARWIN_UNIX03 */
138138+139139+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
140140+141141+#pragma pack(4) /* Make sure the structure stays as we defined it */
142142+143143+#if __DARWIN_UNIX03
144144+#define _STRUCT_PPC_THREAD_STATE64 struct __darwin_ppc_thread_state64
145145+_STRUCT_PPC_THREAD_STATE64
146146+{
147147+ unsigned long long __srr0; /* Instruction address register (PC) */
148148+ unsigned long long __srr1; /* Machine state register (supervisor) */
149149+ unsigned long long __r0;
150150+ unsigned long long __r1;
151151+ unsigned long long __r2;
152152+ unsigned long long __r3;
153153+ unsigned long long __r4;
154154+ unsigned long long __r5;
155155+ unsigned long long __r6;
156156+ unsigned long long __r7;
157157+ unsigned long long __r8;
158158+ unsigned long long __r9;
159159+ unsigned long long __r10;
160160+ unsigned long long __r11;
161161+ unsigned long long __r12;
162162+ unsigned long long __r13;
163163+ unsigned long long __r14;
164164+ unsigned long long __r15;
165165+ unsigned long long __r16;
166166+ unsigned long long __r17;
167167+ unsigned long long __r18;
168168+ unsigned long long __r19;
169169+ unsigned long long __r20;
170170+ unsigned long long __r21;
171171+ unsigned long long __r22;
172172+ unsigned long long __r23;
173173+ unsigned long long __r24;
174174+ unsigned long long __r25;
175175+ unsigned long long __r26;
176176+ unsigned long long __r27;
177177+ unsigned long long __r28;
178178+ unsigned long long __r29;
179179+ unsigned long long __r30;
180180+ unsigned long long __r31;
181181+182182+ unsigned int __cr; /* Condition register */
183183+ unsigned long long __xer; /* User's integer exception register */
184184+ unsigned long long __lr; /* Link register */
185185+ unsigned long long __ctr; /* Count register */
186186+187187+ unsigned int __vrsave; /* Vector Save Register */
188188+};
189189+#else /* !__DARWIN_UNIX03 */
190190+#define _STRUCT_PPC_THREAD_STATE64 struct ppc_thread_state64
191191+_STRUCT_PPC_THREAD_STATE64
192192+{
193193+ unsigned long long srr0; /* Instruction address register (PC) */
194194+ unsigned long long srr1; /* Machine state register (supervisor) */
195195+ unsigned long long r0;
196196+ unsigned long long r1;
197197+ unsigned long long r2;
198198+ unsigned long long r3;
199199+ unsigned long long r4;
200200+ unsigned long long r5;
201201+ unsigned long long r6;
202202+ unsigned long long r7;
203203+ unsigned long long r8;
204204+ unsigned long long r9;
205205+ unsigned long long r10;
206206+ unsigned long long r11;
207207+ unsigned long long r12;
208208+ unsigned long long r13;
209209+ unsigned long long r14;
210210+ unsigned long long r15;
211211+ unsigned long long r16;
212212+ unsigned long long r17;
213213+ unsigned long long r18;
214214+ unsigned long long r19;
215215+ unsigned long long r20;
216216+ unsigned long long r21;
217217+ unsigned long long r22;
218218+ unsigned long long r23;
219219+ unsigned long long r24;
220220+ unsigned long long r25;
221221+ unsigned long long r26;
222222+ unsigned long long r27;
223223+ unsigned long long r28;
224224+ unsigned long long r29;
225225+ unsigned long long r30;
226226+ unsigned long long r31;
227227+228228+ unsigned int cr; /* Condition register */
229229+ unsigned long long xer; /* User's integer exception register */
230230+ unsigned long long lr; /* Link register */
231231+ unsigned long long ctr; /* Count register */
232232+233233+ unsigned int vrsave; /* Vector Save Register */
234234+};
235235+#endif /* __DARWIN_UNIX03 */
236236+237237+#pragma pack()
238238+239239+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
240240+241241+/* This structure should be double-word aligned for performance */
242242+243243+#if __DARWIN_UNIX03
244244+#define _STRUCT_PPC_FLOAT_STATE struct __darwin_ppc_float_state
245245+_STRUCT_PPC_FLOAT_STATE
246246+{
247247+ double __fpregs[32];
248248+249249+ unsigned int __fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */
250250+ unsigned int __fpscr; /* floating point status register */
251251+};
252252+#else /* !__DARWIN_UNIX03 */
253253+#define _STRUCT_PPC_FLOAT_STATE struct ppc_float_state
254254+_STRUCT_PPC_FLOAT_STATE
255255+{
256256+ double fpregs[32];
257257+258258+ unsigned int fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */
259259+ unsigned int fpscr; /* floating point status register */
260260+};
261261+#endif /* __DARWIN_UNIX03 */
262262+263263+#pragma pack(4) /* Make sure the structure stays as we defined it */
264264+265265+#if __DARWIN_UNIX03
266266+#define _STRUCT_PPC_VECTOR_STATE struct __darwin_ppc_vector_state
267267+_STRUCT_PPC_VECTOR_STATE
268268+{
269269+#if defined(__LP64__)
270270+ unsigned int __save_vr[32][4];
271271+ unsigned int __save_vscr[4];
272272+#else
273273+ unsigned long __save_vr[32][4];
274274+ unsigned long __save_vscr[4];
275275+#endif
276276+ unsigned int __save_pad5[4];
277277+ unsigned int __save_vrvalid; /* VRs that have been saved */
278278+ unsigned int __save_pad6[7];
279279+};
280280+#else /* !__DARWIN_UNIX03 */
281281+#define _STRUCT_PPC_VECTOR_STATE struct ppc_vector_state
282282+_STRUCT_PPC_VECTOR_STATE
283283+{
284284+#if defined(__LP64__)
285285+ unsigned int save_vr[32][4];
286286+ unsigned int save_vscr[4];
287287+#else
288288+ unsigned long save_vr[32][4];
289289+ unsigned long save_vscr[4];
290290+#endif
291291+ unsigned int save_pad5[4];
292292+ unsigned int save_vrvalid; /* VRs that have been saved */
293293+ unsigned int save_pad6[7];
294294+};
295295+#endif /* __DARWIN_UNIX03 */
296296+297297+#pragma pack()
298298+299299+/*
300300+ * ppc_exception_state
301301+ *
302302+ * This structure corresponds to some additional state of the user
303303+ * registers as saved in the PCB upon kernel entry. They are only
304304+ * available if an exception is passed out of the kernel, and even
305305+ * then not all are guaranteed to be updated.
306306+ *
307307+ * Some padding is included in this structure which allows space for
308308+ * servers to store temporary values if need be, to maintain binary
309309+ * compatiblity.
310310+ */
311311+312312+/* Exception state for 32-bit thread (on 32-bit processor) */
313313+/* Still available on 64-bit processors, but may fall short */
314314+/* of covering the full potential state (hi half available). */
315315+316316+#pragma pack(4) /* Make sure the structure stays as we defined it */
317317+318318+#if __DARWIN_UNIX03
319319+#define _STRUCT_PPC_EXCEPTION_STATE struct __darwin_ppc_exception_state
320320+_STRUCT_PPC_EXCEPTION_STATE
321321+{
322322+#if defined(__LP64__)
323323+ unsigned int __dar; /* Fault registers for coredump */
324324+ unsigned int __dsisr;
325325+ unsigned int __exception; /* number of powerpc exception taken */
326326+ unsigned int __pad0; /* align to 16 bytes */
327327+ unsigned int __pad1[4]; /* space in PCB "just in case" */
328328+#else
329329+ unsigned long __dar; /* Fault registers for coredump */
330330+ unsigned long __dsisr;
331331+ unsigned long __exception; /* number of powerpc exception taken */
332332+ unsigned long __pad0; /* align to 16 bytes */
333333+ unsigned long __pad1[4]; /* space in PCB "just in case" */
334334+#endif
335335+};
336336+#else /* !__DARWIN_UNIX03 */
337337+#define _STRUCT_PPC_EXCEPTION_STATE struct ppc_exception_state
338338+_STRUCT_PPC_EXCEPTION_STATE
339339+{
340340+#if defined(__LP64__)
341341+ unsigned int dar; /* Fault registers for coredump */
342342+ unsigned int dsisr;
343343+ unsigned int exception; /* number of powerpc exception taken */
344344+ unsigned int pad0; /* align to 16 bytes */
345345+ unsigned int pad1[4]; /* space in PCB "just in case" */
346346+#else
347347+ unsigned long dar; /* Fault registers for coredump */
348348+ unsigned long dsisr;
349349+ unsigned long exception; /* number of powerpc exception taken */
350350+ unsigned long pad0; /* align to 16 bytes */
351351+ unsigned long pad1[4]; /* space in PCB "just in case" */
352352+#endif
353353+};
354354+#endif /* __DARWIN_UNIX03 */
355355+356356+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
357357+#if __DARWIN_UNIX03
358358+#define _STRUCT_PPC_EXCEPTION_STATE64 struct __darwin_ppc_exception_state64
359359+_STRUCT_PPC_EXCEPTION_STATE64
360360+{
361361+ unsigned long long __dar; /* Fault registers for coredump */
362362+#if defined(__LP64__)
363363+ unsigned int __dsisr;
364364+ unsigned int __exception; /* number of powerpc exception taken */
365365+ unsigned int __pad1[4]; /* space in PCB "just in case" */
366366+#else
367367+ unsigned long __dsisr;
368368+ unsigned long __exception; /* number of powerpc exception taken */
369369+ unsigned long __pad1[4]; /* space in PCB "just in case" */
370370+#endif
371371+};
372372+#else /* !__DARWIN_UNIX03 */
373373+#define _STRUCT_PPC_EXCEPTION_STATE64 struct ppc_exception_state64
374374+_STRUCT_PPC_EXCEPTION_STATE64
375375+{
376376+ unsigned long long dar; /* Fault registers for coredump */
377377+#if defined(__LP64__)
378378+ unsigned int dsisr;
379379+ unsigned int exception; /* number of powerpc exception taken */
380380+ unsigned int pad1[4]; /* space in PCB "just in case" */
381381+#else
382382+ unsigned long dsisr;
383383+ unsigned long exception; /* number of powerpc exception taken */
384384+ unsigned long pad1[4]; /* space in PCB "just in case" */
385385+#endif
386386+};
387387+#endif /* __DARWIN_UNIX03 */
388388+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
389389+390390+#pragma pack()
391391+392392+#endif /* _MACH_PPC__STRUCTS_H_ */
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+/*
3232+ * Mach Operating System
3333+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
3434+ * All Rights Reserved.
3535+ *
3636+ * Permission to use, copy, modify and distribute this software and its
3737+ * documentation is hereby granted, provided that both the copyright
3838+ * notice and this permission notice appear in all copies of the
3939+ * software, derivative works or modified versions, and any portions
4040+ * thereof, and that both notices appear in supporting documentation.
4141+ *
4242+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
4343+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
4444+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4545+ *
4646+ * Carnegie Mellon requests users of this software to return to
4747+ *
4848+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
4949+ * School of Computer Science
5050+ * Carnegie Mellon University
5151+ * Pittsburgh PA 15213-3890
5252+ *
5353+ * any improvements or extensions that they make and grant Carnegie Mellon
5454+ * the rights to redistribute these changes.
5555+ */
5656+/*
5757+ */
5858+5959+/*
6060+ * File: boolean.h
6161+ *
6262+ * Boolean type, for ppc.
6363+ */
6464+6565+#ifndef _MACH_PPC_BOOLEAN_H_
6666+#define _MACH_PPC_BOOLEAN_H_
6767+6868+#if defined(__ppc64__)
6969+typedef unsigned int boolean_t;
7070+#else
7171+typedef int boolean_t;
7272+#endif
7373+7474+#endif /* _MACH_PPC_BOOLEAN_H_ */
+119
platform-include/mach/ppc/exception.h
···11+/*
22+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+/*
3232+ * Copyright (c) 1990, 1991, 1992, The University of Utah and
3333+ * the Center for Software Science at the University of Utah (CSS).
3434+ * All rights reserved.
3535+ *
3636+ * Permission to use, copy, modify and distribute this software is hereby
3737+ * granted provided that (1) source code retains these copyright, permission,
3838+ * and disclaimer notices, and (2) redistributions including binaries
3939+ * reproduce the notices in supporting documentation, and (3) all advertising
4040+ * materials mentioning features or use of this software display the following
4141+ * acknowledgement: ``This product includes software developed by the Center
4242+ * for Software Science at the University of Utah.''
4343+ *
4444+ * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
4545+ * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF
4646+ * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4747+ *
4848+ * CSS requests users of this software to return to css-dist@cs.utah.edu any
4949+ * improvements that they make and grant CSS redistribution rights.
5050+ *
5151+ * Utah $Hdr: $
5252+ */
5353+5454+#ifndef _MACH_PPC_EXCEPTION_H_
5555+#define _MACH_PPC_EXCEPTION_H_
5656+5757+#define EXC_TYPES_COUNT 11 /* incl. illegal exception 0 */
5858+5959+#define EXCEPTION_CODE_MAX 2 /* elements in vector (code+subcode) */
6060+/*
6161+ * EXC_BAD_INSTRUCTION
6262+ */
6363+6464+#define EXC_PPC_INVALID_SYSCALL 1 /* invalid syscall number */
6565+#define EXC_PPC_UNIPL_INST 2 /* unimplemented instruction */
6666+#define EXC_PPC_PRIVINST 3 /* priviledged instruction */
6767+#define EXC_PPC_PRIVREG 4 /* priviledged register */
6868+#define EXC_PPC_TRACE 5 /* trace/single-step */
6969+#define EXC_PPC_PERFMON 6 /* performance monitor */
7070+7171+/*
7272+ * EXC_BAD_ACCESS
7373+ * Note: do not conflict with kern_return_t values returned by vm_fault
7474+ */
7575+7676+#define EXC_PPC_VM_PROT_READ 0x101 /* error reading syscall args */
7777+#define EXC_PPC_BADSPACE 0x102 /* bad space referenced */
7878+#define EXC_PPC_UNALIGNED 0x103 /* unaligned data reference */
7979+8080+/*
8181+ * EXC_ARITHMETIC
8282+ */
8383+8484+#define EXC_PPC_OVERFLOW 1 /* integer overflow */
8585+#define EXC_PPC_ZERO_DIVIDE 2 /* integer divide by zero */
8686+#define EXC_PPC_FLT_INEXACT 3 /* IEEE inexact exception */
8787+#define EXC_PPC_FLT_ZERO_DIVIDE 4 /* IEEE zero divide */
8888+#define EXC_PPC_FLT_UNDERFLOW 5 /* IEEE floating underflow */
8989+#define EXC_PPC_FLT_OVERFLOW 6 /* IEEE floating overflow */
9090+#define EXC_PPC_FLT_NOT_A_NUMBER 7 /* IEEE not a number */
9191+9292+/*
9393+ * EXC_PPC_NOEMULATION should go away when we add software emulation
9494+ * for floating point. Right now we don't support this.
9595+ */
9696+9797+#define EXC_PPC_NOEMULATION 8 /* no floating point emulation */
9898+#define EXC_PPC_ALTIVECASSIST 9 /* Altivec Denorm Assist */
9999+100100+/*
101101+ * EXC_SOFTWARE
102102+ * Note: 0x10000-0x10003 in use for unix signal
103103+ */
104104+#define EXC_PPC_TRAP 1 /* Program trap */
105105+#define EXC_PPC_MIGRATE 0x10100 /* Time to bolt */
106106+107107+108108+/*
109109+ * EXC_BREAKPOINT
110110+ */
111111+112112+#define EXC_PPC_BREAKPOINT EXC_PPC_TRAP /* breakpoint trap */
113113+114114+/*
115115+ * machine dependent exception masks
116116+ */
117117+#define EXC_MASK_MACHINE 0
118118+119119+#endif /* _MACH_PPC_EXCEPTION_H_ */
+74
platform-include/mach/ppc/kern_return.h
···11+/*
22+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+/*
3232+ * Mach Operating System
3333+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
3434+ * All Rights Reserved.
3535+ *
3636+ * Permission to use, copy, modify and distribute this software and its
3737+ * documentation is hereby granted, provided that both the copyright
3838+ * notice and this permission notice appear in all copies of the
3939+ * software, derivative works or modified versions, and any portions
4040+ * thereof, and that both notices appear in supporting documentation.
4141+ *
4242+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
4343+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
4444+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4545+ *
4646+ * Carnegie Mellon requests users of this software to return to
4747+ *
4848+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
4949+ * School of Computer Science
5050+ * Carnegie Mellon University
5151+ * Pittsburgh PA 15213-3890
5252+ *
5353+ * any improvements or extensions that they make and grant Carnegie Mellon
5454+ * the rights to redistribute these changes.
5555+ */
5656+/*
5757+ */
5858+5959+/*
6060+ * File: kern_return.h
6161+ * Author: Avadis Tevanian, Jr., Michael Wayne Young
6262+ * Date: 1985
6363+ *
6464+ * Machine-dependent kernel return definitions.
6565+ */
6666+6767+#ifndef _MACH_PPC_KERN_RETURN_H_
6868+#define _MACH_PPC_KERN_RETURN_H_
6969+7070+#ifndef ASSEMBLER
7171+typedef int kern_return_t;
7272+#endif /* ASSEMBLER */
7373+7474+#endif /* _MACH_PPC_KERN_RETURN_H_ */
+126
platform-include/mach/ppc/machine_types.defs
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+/*
3333+ * Header file for basic, machine-dependent data types.
3434+ */
3535+3636+#ifndef _PPC_VM_TYPES_DEFS_
3737+#define _PPC_VM_TYPES_DEFS_
3838+3939+type short = int16_t;
4040+type int = int32_t;
4141+type unsigned = uint32_t;
4242+4343+type float = MACH_MSG_TYPE_REAL_32;
4444+type double = MACH_MSG_TYPE_REAL_64;
4545+4646+/* from ISO/IEC 988:1999 spec */
4747+/* 7.18.1.4 Integer types capable of holding object pointers */
4848+/*
4949+ * The [u]intptr_t types for the native
5050+ * integer type, e.g. 32 or 64 or.. whatever
5151+ * register size the machine has. They are
5252+ * used for entities that might be either
5353+ * [unsigned] integers or pointers, and for
5454+ * type-casting between the two.
5555+ *
5656+ * For instance, the IPC system represents
5757+ * a port in user space as an integer and
5858+ * in kernel space as a pointer.
5959+ */
6060+#if defined(__ppc64__)
6161+type uintptr_t = uint64_t;
6262+type intptr_t = int64_t;
6363+#else
6464+type uintptr_t = uint32_t;
6565+type intptr_t = int32_t;
6666+#endif
6767+6868+/*
6969+ * These are the legacy Mach types that are
7070+ * the [rough] equivalents of the standards above.
7171+ * They were defined in terms of int, not
7272+ * long int, so they remain separate.
7373+ */
7474+#if defined(__ppc64__)
7575+type register_t = int64_t;
7676+#else
7777+type register_t = int32_t;
7878+#endif
7979+type integer_t = int32_t;
8080+type natural_t = uint32_t;
8181+8282+/*
8383+ * These are the VM types that scale with the address
8484+ * space size of a given process.
8585+ */
8686+8787+#if defined(__ppc64__)
8888+type vm_address_t = uint64_t;
8989+type vm_offset_t = uint64_t;
9090+type vm_size_t = uint64_t;
9191+#else
9292+type vm_address_t = natural_t;
9393+type vm_offset_t = natural_t;
9494+type vm_size_t = natural_t;
9595+#endif
9696+9797+/*
9898+ * The mach_vm_xxx_t types are sized to hold the
9999+ * maximum pointer, offset, etc... supported on the
100100+ * platform.
101101+ */
102102+type mach_vm_address_t = uint64_t;
103103+type mach_vm_offset_t = uint64_t;
104104+type mach_vm_size_t = uint64_t;
105105+106106+#if MACH_IPC_COMPAT
107107+/*
108108+ * For the old IPC interface
109109+ */
110110+#define MSG_TYPE_PORT_NAME uint32_t
111111+112112+#endif /* MACH_IPC_COMPAT */
113113+114114+/*
115115+ * These are types used internal to Mach to implement the
116116+ * legacy 32-bit VM APIs published by the kernel.
117117+ */
118118+#define VM32_SUPPORT 1
119119+120120+type vm32_address_t = uint32_t;
121121+type vm32_offset_t = uint32_t;
122122+type vm32_size_t = uint32_t;
123123+124124+#endif /* _PPC_VM_TYPES_DEFS_ */
125125+126126+/* vim: set ft=c : */
+43
platform-include/mach/ppc/ndr_def.h
···11+/*
22+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+#include <mach/ndr.h>
3333+3434+NDR_record_t NDR_record = {
3535+ 0, /* mig_reserved */
3636+ 0, /* mig_reserved */
3737+ 0, /* mig_reserved */
3838+ NDR_PROTOCOL_2_0,
3939+ NDR_INT_BIG_ENDIAN,
4040+ NDR_CHAR_ASCII,
4141+ NDR_FLOAT_IEEE,
4242+ 0,
4343+};
+42
platform-include/mach/ppc/processor_info.h
···11+/*
22+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+/*
3030+ * File: mach/ppc/processor_info.h
3131+ *
3232+ * Data structure definitions for ppc specific processor control
3333+ */
3434+3535+#ifndef _MACH_PPC_PROCESSOR_INFO_H_
3636+#define _MACH_PPC_PROCESSOR_INFO_H_
3737+3838+#include <mach/machine.h>
3939+#include <mach/message.h>
4040+4141+4242+#endif /* _MACH_PPC_PROCESSOR_INFO_H_ */
+35
platform-include/mach/ppc/rpc.h
···11+/*
22+ * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+#ifndef _MACH_PPC_RPC_H_
3333+#define _MACH_PPC_RPC_H_
3434+3535+#endif /* _MACH_PPC_RPC_H_ */
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+#ifndef _MACH_PPC_THREAD_STATE_H_
3333+#define _MACH_PPC_THREAD_STATE_H_
3434+3535+/* Size of maximum exported thread state in words */
3636+#define PPC_THREAD_STATE_MAX (144) /* Size of biggest state possible */
3737+3838+#if defined (__ppc__) || defined (__ppc64__)
3939+#define THREAD_STATE_MAX PPC_THREAD_STATE_MAX
4040+#endif
4141+4242+#endif /* _MACH_PPC_THREAD_STATE_H_ */
+150
platform-include/mach/ppc/thread_status.h
···11+/*
22+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+#ifndef _MACH_PPC_THREAD_STATUS_H_
3333+#define _MACH_PPC_THREAD_STATUS_H_
3434+3535+#include <mach/ppc/_structs.h>
3636+#include <mach/message.h>
3737+3838+/*
3939+ * ppc_thread_state is the structure that is exported to user threads for
4040+ * use in status/mutate calls. This structure should never change.
4141+ *
4242+ */
4343+4444+#define PPC_THREAD_STATE 1
4545+#define PPC_FLOAT_STATE 2
4646+#define PPC_EXCEPTION_STATE 3
4747+#define PPC_VECTOR_STATE 4
4848+#define PPC_THREAD_STATE64 5
4949+#define PPC_EXCEPTION_STATE64 6
5050+#define THREAD_STATE_NONE 7
5151+5252+/*
5353+ * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed
5454+ * an exception flavor will return whether that is a defined flavor for
5555+ * that platform.
5656+ * The macro must be manually updated to include all of the valid exception
5757+ * flavors as defined above.
5858+ */
5959+#define VALID_THREAD_STATE_FLAVOR(x) \
6060+ ((x == PPC_THREAD_STATE) || \
6161+ (x == PPC_FLOAT_STATE) || \
6262+ (x == PPC_EXCEPTION_STATE) || \
6363+ (x == PPC_VECTOR_STATE) || \
6464+ (x == PPC_THREAD_STATE64) || \
6565+ (x == PPC_EXCEPTION_STATE64) || \
6666+ (x == THREAD_STATE_NONE))
6767+6868+typedef _STRUCT_PPC_THREAD_STATE ppc_thread_state_t;
6969+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
7070+typedef _STRUCT_PPC_THREAD_STATE64 ppc_thread_state64_t;
7171+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
7272+typedef _STRUCT_PPC_FLOAT_STATE ppc_float_state_t;
7373+typedef _STRUCT_PPC_VECTOR_STATE ppc_vector_state_t;
7474+7575+/*
7676+ * saved state structure
7777+ *
7878+ * This structure corresponds to the saved state.
7979+ *
8080+ */
8181+8282+#ifdef MACH__POSIX_C_SOURCE_PRIVATE
8383+8484+#include <ppc/savearea.h>
8585+8686+typedef struct savearea ppc_saved_state_t;
8787+8888+#else /* MACH__POSIX_C_SOURCE_PRIVATE */
8989+9090+typedef struct ppc_thread_state ppc_saved_state_t;
9191+9292+#endif /* MACH__POSIX_C_SOURCE_PRIVATE */
9393+9494+/*
9595+ * ppc_exception_state
9696+ *
9797+ * This structure corresponds to some additional state of the user
9898+ * registers as saved in the PCB upon kernel entry. They are only
9999+ * available if an exception is passed out of the kernel, and even
100100+ * then not all are guaranteed to be updated.
101101+ *
102102+ * Some padding is included in this structure which allows space for
103103+ * servers to store temporary values if need be, to maintain binary
104104+ * compatiblity.
105105+ */
106106+107107+/* Exception state for 32-bit thread (on 32-bit processor) */
108108+/* Still available on 64-bit processors, but may fall short */
109109+/* of covering the full potential state (hi half available). */
110110+111111+typedef _STRUCT_PPC_EXCEPTION_STATE ppc_exception_state_t;
112112+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
113113+typedef _STRUCT_PPC_EXCEPTION_STATE64 ppc_exception_state64_t;
114114+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
115115+116116+/*
117117+ * Save State Flags
118118+ */
119119+120120+#define PPC_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
121121+ (sizeof(ppc_thread_state_t) / sizeof(int)))
122122+123123+#define PPC_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \
124124+ (sizeof(ppc_thread_state64_t) / sizeof(int)))
125125+126126+#define PPC_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \
127127+ (sizeof(ppc_exception_state_t) / sizeof(int)))
128128+129129+#define PPC_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
130130+ (sizeof(ppc_exception_state64_t) / sizeof(int)))
131131+132132+#define PPC_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \
133133+ (sizeof(ppc_float_state_t) / sizeof(int)))
134134+135135+#define PPC_VECTOR_STATE_COUNT ((mach_msg_type_number_t) \
136136+ (sizeof(ppc_vector_state_t) / sizeof(int)))
137137+138138+/*
139139+ * Machine-independent way for servers and Mach's exception mechanism to
140140+ * choose the most efficient state flavor for exception RPC's:
141141+ */
142142+#define MACHINE_THREAD_STATE PPC_THREAD_STATE
143143+#define MACHINE_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
144144+145145+/*
146146+ * Largest state on this machine:
147147+ */
148148+#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX
149149+150150+#endif /* _MACH_PPC_THREAD_STATUS_H_ */
+78
platform-include/mach/ppc/vm_param.h
···11+/*
22+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+3232+#ifndef _MACH_PPC_VM_PARAM_H_
3333+#define _MACH_PPC_VM_PARAM_H_
3434+3535+/*
3636+ * These are the global definitions
3737+ */
3838+3939+#define BYTE_SIZE 8 /* byte size in bits */
4040+4141+#define PPC_PGBYTES 4096 /* bytes per ppc page */
4242+#define PPC_PGSHIFT 12 /* number of bits to shift for pages */
4343+4444+#define PAGE_SIZE PPC_PGBYTES
4545+#define PAGE_SHIFT PPC_PGSHIFT
4646+#define PAGE_MASK (PAGE_SIZE - 1)
4747+4848+#if 0
4949+#define VM_MAX_PAGE_ADDRESS 0xFFFFFFFFFFFFF000ULL
5050+#else
5151+/*
5252+ * LP64todo - For now, we are limited to 51-bits of user addressing
5353+ */
5454+#define VM_MAX_PAGE_ADDRESS 0x0007FFFFFFFFF000ULL
5555+#endif
5656+5757+#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
5858+#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS)
5959+6060+/*
6161+ * These are the values relative to the local process.
6262+ */
6363+#if defined (__ppc64__)
6464+/*
6565+ * LP64todo - We don't have the 64-bit address space layout yet.
6666+ * Use the 32-bit stack layout for now.
6767+ */
6868+#define VM_MIN_ADDRESS ((vm_offset_t) MACH_VM_MIN_ADDRESS)
6969+#define VM_MAX_ADDRESS ((vm_offset_t) MACH_VM_MAX_ADDRESS)
7070+#define USER_STACK_END ((vm_offset_t) 0x00000000ffff0000ULL)
7171+#else
7272+#define VM_MIN_ADDRESS ((vm_offset_t) 0)
7373+#define VM_MAX_ADDRESS ((vm_offset_t) (VM_MAX_PAGE_ADDRESS & 0xFFFFFFFF))
7474+#define USER_STACK_END ((vm_offset_t) 0xffff0000U)
7575+#endif /* defined(__ppc64__) */
7676+7777+7878+#endif /* _MACH_PPC_VM_PARAM_H_ */
+142
platform-include/mach/ppc/vm_types.h
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+/*
3232+ * Mach Operating System
3333+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
3434+ * All Rights Reserved.
3535+ *
3636+ * Permission to use, copy, modify and distribute this software and its
3737+ * documentation is hereby granted, provided that both the copyright
3838+ * notice and this permission notice appear in all copies of the
3939+ * software, derivative works or modified versions, and any portions
4040+ * thereof, and that both notices appear in supporting documentation.
4141+ *
4242+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
4343+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
4444+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4545+ *
4646+ * Carnegie Mellon requests users of this software to return to
4747+ *
4848+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
4949+ * School of Computer Science
5050+ * Carnegie Mellon University
5151+ * Pittsburgh PA 15213-3890
5252+ *
5353+ * any improvements or extensions that they make and grant Carnegie Mellon
5454+ * the rights to redistribute these changes.
5555+ */
5656+/*
5757+ */
5858+5959+/*
6060+ * File: vm_types.h
6161+ * Author: Avadis Tevanian, Jr.
6262+ * Date: 1985
6363+ *
6464+ * Header file for VM data types. PPC version.
6565+ */
6666+6767+#ifndef _MACH_PPC_VM_TYPES_H_
6868+#define _MACH_PPC_VM_TYPES_H_
6969+7070+#ifndef ASSEMBLER
7171+7272+#include <ppc/_types.h>
7373+#include <mach/ppc/vm_param.h>
7474+#include <stdint.h>
7575+7676+/*
7777+ * natural_t and integer_t are Mach's legacy types for machine-
7878+ * independent integer types (unsigned, and signed, respectively).
7979+ * Their original purpose was to define other types in a machine/
8080+ * compiler independent way.
8181+ *
8282+ * They also had an implicit "same size as pointer" characteristic
8383+ * to them (i.e. Mach's traditional types are very ILP32 or ILP64
8484+ * centric). We support PowerPC ABIs that do not follow either of
8585+ * these models (specifically LP64). Therefore, we had to make a
8686+ * choice between making these types scale with pointers or stay
8787+ * tied to integers. Because their use is predominantly tied to
8888+ * to the size of an integer, we are keeping that association and
8989+ * breaking free from pointer size guarantees.
9090+ *
9191+ * New use of these types is discouraged.
9292+ */
9393+typedef __darwin_natural_t natural_t;
9494+typedef int integer_t;
9595+9696+#if defined(__ppc__)
9797+9898+/*
9999+ * For 32-bit PowerPC ABIs, the scalable types were
100100+ * always based upon natural_t (unsigned int).
101101+ * Because of potential legacy issues with name mangling,
102102+ * we cannot use the stdint uintptr_t type.
103103+ */
104104+typedef natural_t vm_offset_t;
105105+typedef natural_t vm_size_t;
106106+107107+#else /* __ppc64__ */
108108+109109+/*
110110+ * For 64-bit PowerPC ABIs, we have no legacy name mangling
111111+ * issues, so we use the stdint types for scaling these
112112+ * types to the same size as a pointer.
113113+ */
114114+typedef uintptr_t vm_offset_t;
115115+typedef uintptr_t vm_size_t;
116116+117117+#endif
118118+119119+/*
120120+ * This new type is independent of a particular vm map's
121121+ * implementation size - and represents appropriate types
122122+ * for all possible maps. This is used for interfaces
123123+ * where the size of the map is not known - or we don't
124124+ * want to have to distinguish.
125125+ */
126126+typedef uint64_t mach_vm_address_t;
127127+typedef uint64_t mach_vm_offset_t;
128128+typedef uint64_t mach_vm_size_t;
129129+130130+typedef uint64_t vm_map_offset_t;
131131+typedef uint64_t vm_map_address_t;
132132+typedef uint64_t vm_map_size_t;
133133+134134+135135+#endif /* ASSEMBLER */
136136+137137+/*
138138+ * If composing messages by hand (please do not)
139139+ */
140140+#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
141141+142142+#endif /* _MACH_PPC_VM_TYPES_H_ */
+2
platform-include/machine/_mcontext.h
···2727 */
2828#if defined (__i386__) || defined (__x86_64__)
2929#include "i386/_mcontext.h"
3030+#elif defined(__ppc__)
3131+#include "ppc/_mcontext.h"
3032#else
3133#error architecture not supported
3234#endif
+2
platform-include/machine/_param.h
···2727 */
2828#if defined (__i386__) || defined (__x86_64__)
2929#include "i386/_param.h"
3030+#elif defined(__ppc__)
3131+#include "ppc/param.h"
3032#else
3133#error architecture not supported
3234#endif
+2
platform-include/machine/_types.h
···30303131#if defined (__i386__) || defined(__x86_64__)
3232#include "i386/_types.h"
3333+#elif defined(__ppc__)
3434+#include "ppc/types.h"
3335#else
3436#error architecture not supported
3537#endif
+2
platform-include/machine/endian.h
···33333434#if defined (__i386__) || defined(__x86_64__)
3535#include "i386/endian.h"
3636+#elif defined(__ppc__)
3737+#include "ppc/endian.h"
3638#else
3739#error architecture not supported
3840#endif
+2
platform-include/machine/limits.h
···44 This file is public domain. */
55#if defined (__i386__) || defined(__x86_64__)
66#include <i386/limits.h>
77+#elif defined (__ppc__)
88+#include <ppc/limits.h>
79#else
810#error architecture not supported
911#endif
+2
platform-include/machine/signal.h
···30303131#if defined (__i386__) || defined(__x86_64__)
3232#include "i386/signal.h"
3333+#elif defined(__ppc__)
3434+#include "ppc/signal.h"
3335#else
3436#error architecture not supported
3537#endif
+2
platform-include/machine/types.h
···33333434#if defined (__i386__) || defined(__x86_64__)
3535#include "i386/types.h"
3636+#elif defined(__ppc__)
3737+#include "ppc/types.h"
3638#else
3739#error architecture not supported
3840#endif
+27
platform-include/ppc/_limits.h
···11+/*
22+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_LICENSE_HEADER_START@
55+ *
66+ * The contents of this file constitute Original Code as defined in and
77+ * are subject to the Apple Public Source License Version 1.1 (the
88+ * "License"). You may not use this file except in compliance with the
99+ * License. Please obtain a copy of the License at
1010+ * http://www.apple.com/publicsource and read it before using this file.
1111+ *
1212+ * This Original Code and all software distributed under the License are
1313+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1414+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1515+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1616+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
1717+ * License for the specific language governing rights and limitations
1818+ * under the License.
1919+ *
2020+ * @APPLE_LICENSE_HEADER_END@
2121+ */
2222+#ifndef _PPC__LIMITS_H_
2323+#define _PPC__LIMITS_H_
2424+2525+#define __DARWIN_CLK_TCK 100 /* ticks per second */
2626+2727+#endif /* _PPC__LIMITS_H_ */
···11+/*
22+ * Copyright (c) 2008 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+#ifndef _PPC__PARAM_H_
3030+#define _PPC__PARAM_H_
3131+3232+#include <ppc/_types.h>
3333+3434+/*
3535+ * Round p (pointer or byte index) up to a correctly-aligned value for all
3636+ * data types (int, long, ...). The result is unsigned int and must be
3737+ * cast to any desired pointer type.
3838+ */
3939+#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1)
4040+#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
4141+4242+#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
4343+#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
4444+4545+4646+#endif /* _PPC__PARAM_H_ */
+217
platform-include/ppc/_structs.h
···11+/*
22+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+#include <sys/cdefs.h>
3030+3131+#ifdef __need_mcontext_t
3232+#ifndef __need_struct_mcontext
3333+#define __need_struct_mcontext
3434+#endif /* __need_struct_mcontext */
3535+#endif /* __need_mcontext_t */
3636+3737+#ifdef __need_mcontext64_t
3838+#ifndef __need_struct_mcontext64
3939+#define __need_struct_mcontext64
4040+#endif /* __need_struct_mcontext64 */
4141+#endif /* __need_mcontext64_t */
4242+4343+#if defined(__need_struct_mcontext) || defined(__need_struct_mcontext64)
4444+#include <mach/ppc/_structs.h>
4545+#endif /* __need_struct_mcontext || __need_struct_mcontext64 */
4646+4747+#ifdef __need_struct_mcontext
4848+#undef __need_struct_mcontext
4949+#ifndef _STRUCT_MCONTEXT
5050+#if __DARWIN_UNIX03
5151+#define _STRUCT_MCONTEXT struct __darwin_mcontext
5252+_STRUCT_MCONTEXT
5353+{
5454+ _STRUCT_PPC_EXCEPTION_STATE __es;
5555+ _STRUCT_PPC_THREAD_STATE __ss;
5656+ _STRUCT_PPC_FLOAT_STATE __fs;
5757+ _STRUCT_PPC_VECTOR_STATE __vs;
5858+};
5959+#else /* !__DARWIN_UNIX03 */
6060+#define _STRUCT_MCONTEXT struct mcontext
6161+_STRUCT_MCONTEXT
6262+{
6363+ _STRUCT_PPC_EXCEPTION_STATE es;
6464+ _STRUCT_PPC_THREAD_STATE ss;
6565+ _STRUCT_PPC_FLOAT_STATE fs;
6666+ _STRUCT_PPC_VECTOR_STATE vs;
6767+};
6868+#endif /* __DARWIN_UNIX03 */
6969+#endif /* _STRUCT_MCONTEXT */
7070+#endif /* __need_struct_mcontext */
7171+7272+#ifdef __need_struct_mcontext64
7373+#undef __need_struct_mcontext64
7474+#ifndef _STRUCT_MCONTEXT64
7575+#if __DARWIN_UNIX03
7676+#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
7777+_STRUCT_MCONTEXT64
7878+{
7979+ _STRUCT_PPC_EXCEPTION_STATE64 __es;
8080+ _STRUCT_PPC_THREAD_STATE64 __ss;
8181+ _STRUCT_PPC_FLOAT_STATE __fs;
8282+ _STRUCT_PPC_VECTOR_STATE __vs;
8383+};
8484+#else /* !__DARWIN_UNIX03 */
8585+#define _STRUCT_MCONTEXT64 struct mcontext64
8686+_STRUCT_MCONTEXT64
8787+{
8888+ _STRUCT_PPC_EXCEPTION_STATE64 es;
8989+ _STRUCT_PPC_THREAD_STATE64 ss;
9090+ _STRUCT_PPC_FLOAT_STATE fs;
9191+ _STRUCT_PPC_VECTOR_STATE vs;
9292+};
9393+#endif /* __DARWIN_UNIX03 */
9494+#endif /* _STRUCT_MCONTEXT64 */
9595+#endif /* __need_struct_mcontext64 */
9696+9797+#ifdef __need_mcontext_t
9898+#undef __need_mcontext_t
9999+#ifndef _MCONTEXT_T
100100+#define _MCONTEXT_T
101101+typedef _STRUCT_MCONTEXT *mcontext_t;
102102+#endif /* _MCONTEXT_T */
103103+#endif /* __need_mcontext_t */
104104+105105+#ifdef __need_mcontext64_t
106106+#undef __need_mcontext64_t
107107+#ifndef _MCONTEXT64_T
108108+#define _MCONTEXT64_T
109109+typedef _STRUCT_MCONTEXT64 *mcontext64_t;
110110+#endif /* _MCONTEXT64_T */
111111+#endif /* __need_mcontext64_t */
112112+113113+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
114114+#ifndef PPC_MCONTEXT_SIZE
115115+#define PPC_MCONTEXT_SIZE (PPC_THREAD_STATE_COUNT + PPC_FLOAT_STATE_COUNT + PPC_EXCEPTION_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int)
116116+#endif /* PPC_MCONTEXT_SIZE */
117117+#ifndef PPC_MCONTEXT64_SIZE
118118+#define PPC_MCONTEXT64_SIZE (PPC_THREAD_STATE64_COUNT + PPC_FLOAT_STATE_COUNT + PPC_EXCEPTION_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int)
119119+#endif /* PPC_MCONTEXT64_SIZE */
120120+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
121121+122122+/*
123123+ * For now, just duplicate the 32-bit context as the generic one.
124124+ */
125125+#ifdef __need_struct_sigcontext
126126+#undef __need_struct_sigcontext
127127+#ifndef _STRUCT_SIGCONTEXT
128128+#if __DARWIN_UNIX03 /* signal.h needs struct sigcontext visible */
129129+#define _STRUCT_SIGCONTEXT struct __darwin_sigcontext
130130+_STRUCT_SIGCONTEXT
131131+{
132132+ int __sc_onstack; /* sigstack state to restore */
133133+ int __sc_mask; /* signal mask to restore */
134134+ int __sc_ir; /* pc */
135135+ int __sc_psw; /* processor status word */
136136+ int __sc_sp; /* stack pointer if sc_regs == NULL */
137137+ void *__sc_regs; /* (kernel private) saved state */
138138+};
139139+#else /* !__DARWIN_UNIX03 */
140140+#define _STRUCT_SIGCONTEXT struct sigcontext
141141+_STRUCT_SIGCONTEXT
142142+{
143143+ int sc_onstack; /* sigstack state to restore */
144144+ int sc_mask; /* signal mask to restore */
145145+ int sc_ir; /* pc */
146146+ int sc_psw; /* processor status word */
147147+ int sc_sp; /* stack pointer if sc_regs == NULL */
148148+ void *sc_regs; /* (kernel private) saved state */
149149+};
150150+#endif /* __DARWIN_UNIX03 */
151151+#endif /* _STRUCT_SIGCONTEXT */
152152+#endif /* __need_struct_sigcontext */
153153+154154+/*
155155+ * Information pushed on stack when a signal is delivered.
156156+ * This is used by the kernel to restore state following
157157+ * execution of the signal handler. It is also made available
158158+ * to the handler to allow it to properly restore state if
159159+ * a non-standard exit is performed.
160160+ */
161161+#ifdef __need_struct_sigcontext32
162162+#undef __need_struct_sigcontext32
163163+#ifndef _STRUCT_SIGCONTEXT32
164164+#if __DARWIN_UNIX03
165165+#define _STRUCT_SIGCONTEXT32 struct __darwin_sigcontext32
166166+_STRUCT_SIGCONTEXT32
167167+{
168168+ int __sc_onstack; /* sigstack state to restore */
169169+ int __sc_mask; /* signal mask to restore */
170170+ int __sc_ir; /* pc */
171171+ int __sc_psw; /* processor status word */
172172+ int __sc_sp; /* stack pointer if sc_regs == NULL */
173173+ void *__sc_regs; /* (kernel private) saved state */
174174+};
175175+#else /* !__DARWIN_UNIX03 */
176176+#define _STRUCT_SIGCONTEXT32 struct sigcontext32
177177+_STRUCT_SIGCONTEXT32
178178+{
179179+ int sc_onstack; /* sigstack state to restore */
180180+ int sc_mask; /* signal mask to restore */
181181+ int sc_ir; /* pc */
182182+ int sc_psw; /* processor status word */
183183+ int sc_sp; /* stack pointer if sc_regs == NULL */
184184+ void *sc_regs; /* (kernel private) saved state */
185185+};
186186+#endif /* __DARWIN_UNIX03 */
187187+#endif /* _STRUCT_SIGCONTEXT32 */
188188+#endif /* __need_struct_sigcontext32 */
189189+190190+#ifdef __need_struct_sigcontext64
191191+#undef __need_struct_sigcontext64
192192+#ifndef _STRUCT_SIGCONTEXT64
193193+#if __DARWIN_UNIX03
194194+#define _STRUCT_SIGCONTEXT64 struct __darwin_sigcontext64
195195+_STRUCT_SIGCONTEXT64
196196+{
197197+ int __sc_onstack; /* sigstack state to restore */
198198+ int __sc_mask; /* signal mask to restore */
199199+ long long __sc_ir; /* pc */
200200+ long long __sc_psw; /* processor status word */
201201+ long long __sc_sp; /* stack pointer if sc_regs == NULL */
202202+ void *__sc_regs; /* (kernel private) saved state */
203203+};
204204+#else /* !__DARWIN_UNIX03 */
205205+#define _STRUCT_SIGCONTEXT64 struct sigcontext64
206206+_STRUCT_SIGCONTEXT64
207207+{
208208+ int sc_onstack; /* sigstack state to restore */
209209+ int sc_mask; /* signal mask to restore */
210210+ long long sc_ir; /* pc */
211211+ long long sc_psw; /* processor status word */
212212+ long long sc_sp; /* stack pointer if sc_regs == NULL */
213213+ void *sc_regs; /* (kernel private) saved state */
214214+};
215215+#endif /* __DARWIN_UNIX03 */
216216+#endif /* _STRUCT_SIGCONTEXT64 */
217217+#endif /* __need_struct_sigcontext64 */
+120
platform-include/ppc/_types.h
···11+/*
22+ * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+#ifndef _BSD_PPC__TYPES_H_
2929+#define _BSD_PPC__TYPES_H_
3030+3131+/*
3232+ * This header file contains integer types. It's intended to also contain
3333+ * flotaing point and other arithmetic types, as needed, later.
3434+ */
3535+3636+#ifdef __GNUC__
3737+typedef __signed char __int8_t;
3838+#else /* !__GNUC__ */
3939+typedef char __int8_t;
4040+#endif /* !__GNUC__ */
4141+typedef unsigned char __uint8_t;
4242+typedef short __int16_t;
4343+typedef unsigned short __uint16_t;
4444+typedef int __int32_t;
4545+typedef unsigned int __uint32_t;
4646+typedef long long __int64_t;
4747+typedef unsigned long long __uint64_t;
4848+4949+typedef long __darwin_intptr_t;
5050+typedef unsigned int __darwin_natural_t;
5151+5252+/*
5353+ * The rune type below is declared to be an ``int'' instead of the more natural
5454+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
5555+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
5656+ * it looks like 10646 will be a 31 bit standard. This means that if your
5757+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
5858+ * chosen over a long is that the is*() and to*() routines take ints (says
5959+ * ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it
6060+ * here, you lose a bit of ANSI conformance, but your programs will still
6161+ * work.
6262+ *
6363+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
6464+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
6565+ * rune_t must be the same type. Also wint_t must be no narrower than
6666+ * wchar_t, and should also be able to hold all members of the largest
6767+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
6868+ */
6969+7070+typedef int __darwin_ct_rune_t; /* ct_rune_t */
7171+7272+/*
7373+ * mbstate_t is an opaque object to keep conversion state, during multibyte
7474+ * stream conversions. The content must not be referenced by user programs.
7575+ */
7676+typedef union {
7777+ char __mbstate8[128];
7878+ long long _mbstateL; /* for alignment */
7979+} __mbstate_t;
8080+8181+typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
8282+8383+#if defined(__GNUC__) && defined(__PTRDIFF_TYPE__)
8484+typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
8585+#else
8686+typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
8787+#endif /* __GNUC__ */
8888+8989+#if defined(__GNUC__) && defined(__SIZE_TYPE__)
9090+typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
9191+#else
9292+typedef unsigned long __darwin_size_t; /* sizeof() */
9393+#endif
9494+9595+#if (__GNUC__ > 2)
9696+typedef __builtin_va_list __darwin_va_list; /* va_list */
9797+#else
9898+typedef char * __darwin_va_list; /* va_list */
9999+#endif
100100+101101+#if defined(__GNUC__) && defined(__WCHAR_TYPE__)
102102+typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
103103+#else
104104+typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
105105+#endif
106106+107107+typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */
108108+109109+#if defined(__GNUC__) && defined(__WINT_TYPE__)
110110+typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */
111111+#else
112112+typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */
113113+#endif
114114+115115+typedef unsigned long __darwin_clock_t; /* clock() */
116116+typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
117117+typedef long __darwin_ssize_t; /* byte count or error */
118118+typedef long __darwin_time_t; /* time() */
119119+120120+#endif /* _BSD_PPC__TYPES_H_ */
+124
platform-include/ppc/endian.h
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+/*
3030+ * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
3131+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3232+ *
3333+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
3434+ *
3535+ * This file contains Original Code and/or Modifications of Original Code
3636+ * as defined in and that are subject to the Apple Public Source License
3737+ * Version 2.0 (the 'License'). You may not use this file except in
3838+ * compliance with the License. The rights granted to you under the License
3939+ * may not be used to create, or enable the creation or redistribution of,
4040+ * unlawful or unlicensed copies of an Apple operating system, or to
4141+ * circumvent, violate, or enable the circumvention or violation of, any
4242+ * terms of an Apple operating system software license agreement.
4343+ *
4444+ * Please obtain a copy of the License at
4545+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
4646+ *
4747+ * The Original Code and all software distributed under the License are
4848+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
4949+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
5050+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
5151+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
5252+ * Please see the License for the specific language governing rights and
5353+ * limitations under the License.
5454+ *
5555+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
5656+ */
5757+/*
5858+ * Copyright (c) 1987, 1991, 1993
5959+ * The Regents of the University of California. All rights reserved.
6060+ *
6161+ * Redistribution and use in source and binary forms, with or without
6262+ * modification, are permitted provided that the following conditions
6363+ * are met:
6464+ * 1. Redistributions of source code must retain the above copyright
6565+ * notice, this list of conditions and the following disclaimer.
6666+ * 2. Redistributions in binary form must reproduce the above copyright
6767+ * notice, this list of conditions and the following disclaimer in the
6868+ * documentation and/or other materials provided with the distribution.
6969+ * 3. All advertising materials mentioning features or use of this software
7070+ * must display the following acknowledgement:
7171+ * This product includes software developed by the University of
7272+ * California, Berkeley and its contributors.
7373+ * 4. Neither the name of the University nor the names of its contributors
7474+ * may be used to endorse or promote products derived from this software
7575+ * without specific prior written permission.
7676+ *
7777+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
7878+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7979+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
8080+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
8181+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8282+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
8383+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
8484+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
8585+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
8686+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
8787+ * SUCH DAMAGE.
8888+ *
8989+ * @(#)endian.h 8.1 (Berkeley) 6/10/93
9090+ */
9191+9292+#ifndef _PPC_ENDIAN_H_
9393+#define _PPC_ENDIAN_H_
9494+9595+#include <sys/cdefs.h>
9696+9797+/*
9898+ * Define the order of 32-bit words in 64-bit words.
9999+ */
100100+#define _QUAD_HIGHWORD 0
101101+#define _QUAD_LOWWORD 1
102102+103103+/*
104104+ * Definitions for byte order, according to byte significance from low
105105+ * address to high.
106106+ */
107107+#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
108108+#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */
109109+#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
110110+111111+#define __DARWIN_BYTE_ORDER __DARWIN_BIG_ENDIAN
112112+113113+#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
114114+115115+#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
116116+#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
117117+#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
118118+119119+#define BYTE_ORDER __DARWIN_BYTE_ORDER
120120+121121+#include <sys/_endian.h>
122122+123123+#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
124124+#endif /* !_PPC_ENDIAN_H_ */
+106
platform-include/ppc/fasttrap_isa.h
···11+/*
22+ * Copyright (c) 2007 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+/*
3030+ * CDDL HEADER START
3131+ *
3232+ * The contents of this file are subject to the terms of the
3333+ * Common Development and Distribution License, Version 1.0 only
3434+ * (the "License"). You may not use this file except in compliance
3535+ * with the License.
3636+ *
3737+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3838+ * or http://www.opensolaris.org/os/licensing.
3939+ * See the License for the specific language governing permissions
4040+ * and limitations under the License.
4141+ *
4242+ * When distributing Covered Code, include this CDDL HEADER in each
4343+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4444+ * If applicable, add the following below this CDDL HEADER, with the
4545+ * fields enclosed by brackets "[]" replaced with your own identifying
4646+ * information: Portions Copyright [yyyy] [name of copyright owner]
4747+ *
4848+ * CDDL HEADER END
4949+ */
5050+/*
5151+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5252+ * Use is subject to license terms.
5353+ */
5454+5555+#ifndef _FASTTRAP_ISA_H
5656+#define _FASTTRAP_ISA_H
5757+5858+/* #pragma ident "@(#)fasttrap_isa.h 1.4 05/06/08 SMI" */
5959+6060+#include <sys/types.h>
6161+#if defined(__APPLE__)
6262+#include <stdint.h>
6363+#endif
6464+6565+#ifdef __cplusplus
6666+extern "C" {
6767+#endif
6868+6969+typedef uint32_t fasttrap_instr_t;
7070+7171+typedef struct fasttrap_machtp {
7272+ fasttrap_instr_t ftmt_instr; /* Original instruction */
7373+ int32_t ftmt_trgt; /* Offset or absolute address */
7474+ uint8_t ftmt_type; /* Emulation function type */
7575+#define ftmtNOP 0
7676+#define ftmtCommon 1
7777+#define ftmtB 2
7878+#define ftmtBC 3
7979+#define ftmtBLR 4
8080+#define ftmtBCTR 5
8181+ uint8_t ftmt_bo; /* Branch options */
8282+ uint8_t ftmt_bi; /* Condition bit */
8383+ uint8_t ftmt_flgs; /* Flags */
8484+#define ftmtAbs 2
8585+#define ftmtLink 1
8686+} fasttrap_machtp_t;
8787+8888+#define ftt_instr ftt_mtp.ftmt_instr
8989+#define ftt_trgt ftt_mtp.ftmt_trgt
9090+#define ftt_type ftt_mtp.ftmt_type
9191+#define ftt_bo ftt_mtp.ftmt_bo
9292+#define ftt_bi ftt_mtp.ftmt_bi
9393+#define ftt_flgs ftt_mtp.ftmt_flgs
9494+9595+#define FASTTRAP_INSTR 0x0FFFDDDD
9696+#define T_DTRACE_RET (0x2E * 4)
9797+9898+#define FASTTRAP_RETURN_AFRAMES 7
9999+#define FASTTRAP_ENTRY_AFRAMES 7
100100+#define FASTTRAP_OFFSET_AFRAMES 6
101101+102102+#ifdef __cplusplus
103103+}
104104+#endif
105105+106106+#endif /* _FASTTRAP_ISA_H */
+107
platform-include/ppc/limits.h
···11+/*
22+ * Copyright (c) 1988, 1993
33+ * The Regents of the University of California. All rights reserved.
44+ *
55+ * Redistribution and use in source and binary forms, with or without
66+ * modification, are permitted provided that the following conditions
77+ * are met:
88+ * 1. Redistributions of source code must retain the above copyright
99+ * notice, this list of conditions and the following disclaimer.
1010+ * 2. Redistributions in binary form must reproduce the above copyright
1111+ * notice, this list of conditions and the following disclaimer in the
1212+ * documentation and/or other materials provided with the distribution.
1313+ * 3. All advertising materials mentioning features or use of this software
1414+ * must display the following acknowledgement:
1515+ * This product includes software developed by the University of
1616+ * California, Berkeley and its contributors.
1717+ * 4. Neither the name of the University nor the names of its contributors
1818+ * may be used to endorse or promote products derived from this software
1919+ * without specific prior written permission.
2020+ *
2121+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2222+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2323+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2424+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2525+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2626+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2727+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2828+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2929+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3030+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3131+ * SUCH DAMAGE.
3232+ *
3333+ * @(#)limits.h 8.3 (Berkeley) 1/4/94
3434+ */
3535+3636+#ifndef _PPC_LIMITS_H_
3737+#define _PPC_LIMITS_H_
3838+3939+#include <sys/cdefs.h>
4040+#include <ppc/_limits.h>
4141+4242+#define CHAR_BIT 8 /* number of bits in a char */
4343+#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
4444+4545+#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
4646+#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */
4747+#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
4848+4949+/*
5050+ * According to ANSI (section 2.2.4.2), the values below must be usable by
5151+ * #if preprocessing directives. Additionally, the expression must have the
5252+ * same type as would an expression that is an object of the corresponding
5353+ * type converted according to the integral promotions. The subtraction for
5454+ * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
5555+ * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
5656+ * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values
5757+ * are written as hex so that GCC will be quiet about large integer constants.
5858+ */
5959+#define SCHAR_MAX 127 /* min value for a signed char */
6060+#define SCHAR_MIN (-128) /* max value for a signed char */
6161+6262+#define UCHAR_MAX 255 /* max value for an unsigned char */
6363+#define CHAR_MAX 127 /* max value for a char */
6464+#define CHAR_MIN (-128) /* min value for a char */
6565+6666+#define USHRT_MAX 65535 /* max value for an unsigned short */
6767+#define SHRT_MAX 32767 /* max value for a short */
6868+#define SHRT_MIN (-32768) /* min value for a short */
6969+7070+#define UINT_MAX 0xffffffff /* max value for an unsigned int */
7171+#define INT_MAX 2147483647 /* max value for an int */
7272+#define INT_MIN (-2147483647-1) /* min value for an int */
7373+7474+#ifdef __LP64__
7575+#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */
7676+#define LONG_MAX 0x7fffffffffffffffL /* max signed long */
7777+#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */
7878+#else /* !__LP64__ */
7979+#define ULONG_MAX 0xffffffffUL /* max unsigned long */
8080+#define LONG_MAX 2147483647L /* max signed long */
8181+#define LONG_MIN (-2147483647L-1) /* min signed long */
8282+#endif /* __LP64__ */
8383+8484+#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */
8585+#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
8686+#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
8787+8888+#if !defined(_ANSI_SOURCE)
8989+#ifdef __LP64__
9090+#define LONG_BIT 64
9191+#else /* !__LP64__ */
9292+#define LONG_BIT 32
9393+#endif /* __LP64__ */
9494+#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
9595+#define WORD_BIT 32
9696+9797+#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
9898+#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */
9999+100100+#define UQUAD_MAX ULLONG_MAX
101101+#define QUAD_MAX LLONG_MAX
102102+#define QUAD_MIN LLONG_MIN
103103+104104+#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
105105+#endif /* !_ANSI_SOURCE */
106106+107107+#endif /* _PPC_LIMITS_H_ */
+141
platform-include/ppc/param.h
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/* Copyright (c) 1993,1995 NeXT Computer, Inc. All Rights Reserved */
2929+3030+#ifndef _PPC_PARAM_H_
3131+#define _PPC_PARAM_H_
3232+3333+#include <ppc/_param.h>
3434+3535+/*
3636+ * Round p (pointer or byte index) up to a correctly-aligned value for all
3737+ * data types (int, long, ...). The result is unsigned int and must be
3838+ * cast to any desired pointer type.
3939+ */
4040+#define ALIGNBYTES __DARWIN_ALIGNBYTES
4141+#define ALIGN(p) __DARWIN_ALIGN(p)
4242+4343+#define NBPG 4096 /* bytes/page */
4444+#define PGOFSET (NBPG-1) /* byte offset into page */
4545+#define PGSHIFT 12 /* LOG2(NBPG) */
4646+4747+#define NBSEG 0x40000000 /* bytes/segment (quadrant) */
4848+#define SEGOFSET (NBSEG-1) /* byte offset into segment */
4949+#define SEGSHIFT 30 /* LOG2(NBSEG) */
5050+5151+#define DEV_BSIZE 512
5252+#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
5353+#define BLKDEV_IOSIZE 2048
5454+#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
5555+5656+#define STACK_GROWTH_UP 0 /* stack grows to lower addresses */
5757+5858+#define CLSIZE 1
5959+#define CLSIZELOG2 0
6060+6161+#define STACKSIZE 4 /* pages in kernel stack */
6262+#define UPAGES 0 /* total pages in u-area */
6363+ /* red zone is beyond this */
6464+6565+/*
6666+ * Constants related to network buffer management.
6767+ * MCLBYTES must be no larger than CLBYTES (the software page size), and,
6868+ * on machines that exchange pages of input or output buffers with mbuf
6969+ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
7070+ * of the hardware page size.
7171+ */
7272+#define MSIZE 256 /* size of an mbuf */
7373+#define MCLBYTES 2048 /* large enough for ether MTU */
7474+#define MCLSHIFT 11
7575+#define MCLOFSET (MCLBYTES - 1)
7676+#ifndef NMBCLUSTERS
7777+#if GATEWAY
7878+#define NMBCLUSTERS ((1024 * 1024) / MCLBYTES) /* cl map size: 1MB */
7979+#else
8080+#define NMBCLUSTERS ((1024 * 1024) / MCLBYTES)
8181+ /* cl map size was 0.5MB when MSIZE was 128, now it's 1MB*/
8282+#endif
8383+#endif
8484+8585+/* pages ("clicks") (NBPG bytes) to disk blocks */
8686+#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
8787+#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
8888+#define dtob(x) ((x)<<DEV_BSHIFT)
8989+9090+/* pages to bytes */
9191+#define ctob(x) ((x)<<PGSHIFT)
9292+9393+/* bytes to pages */
9494+#define btoc(x) (((unsigned)(x)+(PGOFSET))>>PGSHIFT)
9595+#ifdef __APPLE__
9696+#define btodb(bytes, devBlockSize) \
9797+ ((unsigned)(bytes) / devBlockSize)
9898+#define dbtob(db, devBlockSize) \
9999+ ((unsigned)(db) * devBlockSize)
100100+#else
101101+#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
102102+ ((unsigned)(bytes) >> DEV_BSHIFT)
103103+#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
104104+ ((unsigned)(db) << DEV_BSHIFT)
105105+#endif
106106+107107+/*
108108+ * Map a ``block device block'' to a file system block.
109109+ * This should be device dependent, and should use the bsize
110110+ * field from the disk label.
111111+ * For now though just use DEV_BSIZE.
112112+ */
113113+#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
114114+115115+/* from machdep/ppc/proc_reg.h */
116116+#ifdef __BIG_ENDIAN__
117117+#define ENDIAN_MASK(val,size) (1 << (size-1 - val))
118118+#else
119119+#error code not ported to little endian targets yet
120120+#endif /* __BIG_ENDIAN__ */
121121+122122+#ifndef MASK
123123+#define MASK(PART) ENDIAN_MASK(PART ## _BIT, 32)
124124+#endif
125125+126126+#define MSR_EE_BIT 16
127127+#define MSR_PR_BIT 17
128128+#define USERMODE(msr) (msr & MASK(MSR_PR) ? TRUE : FALSE)
129129+#define BASEPRI(msr) (msr & MASK(MSR_EE) ? TRUE : FALSE)
130130+/* end of from proc_reg.h */
131131+132132+#if defined(KERNEL) || defined(STANDALONE)
133133+#define DELAY(n) delay(n)
134134+#else
135135+#define DELAY(n) { register int N = (n); while (--N > 0); }
136136+#endif /* defined(KERNEL) || defined(STANDALONE) */
137137+138138+#define NPIDS 16 /* maximum number of PIDs per process */
139139+#define NIOPIDS 8 /* maximum number of IO space PIDs */
140140+141141+#endif /* _PPC_PARAM_H_ */
+39
platform-include/ppc/profile.h
···11+/*
22+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * Copyright (c) 1997, Apple Computer, Inc. All rights reserved.
3030+ *
3131+ */
3232+3333+#ifndef _BSD_PPC_PROFILE_H_
3434+#define _BSD_PPC_PROFILE_H_
3535+3636+#include <sys/appleapiopts.h>
3737+3838+3939+#endif /* _BSD_PPC_PROFILE_H_ */
+97
platform-include/ppc/setjmp.h
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
2929+ *
3030+ * File: ppc/setjmp.h
3131+ *
3232+ * Declaration of setjmp routines and data structures.
3333+ */
3434+#ifndef _BSD_PPC_SETJMP_H_
3535+#define _BSD_PPC_SETJMP_H_
3636+3737+#include <sys/cdefs.h>
3838+3939+#define __need_struct_sigcontext
4040+#include <ppc/_structs.h>
4141+4242+struct _jmp_buf {
4343+#if __DARWIN_UNIX03
4444+ _STRUCT_SIGCONTEXT __sigcontext; /* kernel state preserved by set/longjmp */
4545+ unsigned int __vmask __attribute__((aligned(8))); /* vector mask register */
4646+ unsigned int __vreg[32 * 4] __attribute__((aligned(16)));
4747+ /* 32 128-bit vector registers */
4848+#else /* !__DARWIN_UNIX03 */
4949+ _STRUCT_SIGCONTEXT sigcontext; /* kernel state preserved by set/longjmp */
5050+ unsigned int vmask __attribute__((aligned(8))); /* vector mask register */
5151+ unsigned int vreg[32 * 4] __attribute__((aligned(16)));
5252+ /* 32 128-bit vector registers */
5353+#endif /* __DARWIN_UNIX03 */
5454+};
5555+5656+/*
5757+ * _JBLEN is number of ints required to save the following:
5858+ * r1, r2, r13-r31, lr, cr, ctr, xer, sig == 26 register_t sized
5959+ * fr14 - fr31 = 18 doubles
6060+ * vmask, 32 vector registers = 129 ints
6161+ * 2 ints to get all the elements aligned
6262+ *
6363+ * register_t is 2 ints for ppc64 threads
6464+ */
6565+#define _JBLEN64 (26*2 + 18*2 + 129 + 1)
6666+#define _JBLEN32 (26 + 18*2 + 129 + 1)
6767+#define _JBLEN_MAX _JBLEN64
6868+6969+/*
7070+ * Locally scoped sizes
7171+ */
7272+#if defined(__ppc64__)
7373+#define _JBLEN _JBLEN64
7474+#else
7575+#define _JBLEN _JBLEN32
7676+#endif
7777+7878+typedef int jmp_buf[_JBLEN];
7979+typedef int sigjmp_buf[_JBLEN + 1];
8080+8181+__BEGIN_DECLS
8282+int setjmp(jmp_buf);
8383+void longjmp(jmp_buf, int);
8484+8585+#ifndef _ANSI_SOURCE
8686+int _setjmp(jmp_buf);
8787+void _longjmp(jmp_buf, int);
8888+int sigsetjmp(sigjmp_buf, int);
8989+void siglongjmp(sigjmp_buf, int);
9090+#endif /* _ANSI_SOURCE */
9191+9292+#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
9393+void longjmperror(void);
9494+#endif /* neither ANSI nor POSIX */
9595+__END_DECLS
9696+9797+#endif /* !_BSD_PPC_SETJMP_H_ */
+83
platform-include/ppc/signal.h
···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * Copyright (c) 1992, 1993 NeXT Computer, Inc.
3030+ */
3131+3232+#ifndef _PPC_SIGNAL_H_
3333+#define _PPC_SIGNAL_H_ 1
3434+3535+#include <sys/cdefs.h>
3636+3737+#ifndef _ANSI_SOURCE
3838+3939+typedef int sig_atomic_t;
4040+4141+#include <sys/appleapiopts.h>
4242+4343+#ifdef __APPLE_API_OBSOLETE
4444+4545+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
4646+4747+#define __need_struct_sigcontext
4848+#define __need_struct_sigcontext32
4949+#define __need_struct_sigcontext64
5050+#include <ppc/_structs.h>
5151+5252+/*
5353+ * Machine-dependant flags used in sigvec call.
5454+ */
5555+#define SV_SAVE_REGS 0x1000 /* Save all regs in sigcontext */
5656+5757+/*
5858+ * regs_saved_t -- Describes which registers beyond what the kernel cares
5959+ * about are saved to and restored from this sigcontext.
6060+ *
6161+ * The default is REGS_SAVED_CALLER, only the caller saved registers
6262+ * are saved. If the SV_SAVE_REGS flag was set when the signal
6363+ * handler was registered with sigvec() then all the registers will be
6464+ * saved in the sigcontext, and REGS_SAVED_ALL will be set. The C
6565+ * library uses REGS_SAVED_NONE in order to quickly restore kernel
6666+ * state during a longjmp().
6767+ */
6868+typedef enum {
6969+ REGS_SAVED_NONE, /* Only kernel managed regs restored */
7070+ REGS_SAVED_CALLER, /* "Caller saved" regs: rpc, a0-a7,
7171+ t0-t4, at, lk0-lk1, xt1-xt20,
7272+ xr0-xr1 */
7373+ REGS_SAVED_ALL /* All registers */
7474+} regs_saved_t;
7575+7676+#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
7777+7878+#endif /* __APPLE_API_OBSOLETE */
7979+8080+#endif /* _ANSI_SOURCE */
8181+8282+#endif /* _PPC_SIGNAL_H_ */
8383+
+135
platform-include/ppc/types.h
···11+/*
22+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * Copyright 1995 NeXT Computer, Inc. All rights reserved.
3030+ */
3131+/*
3232+ * Copyright (c) 1990, 1993
3333+ * The Regents of the University of California. All rights reserved.
3434+ *
3535+ * Redistribution and use in source and binary forms, with or without
3636+ * modification, are permitted provided that the following conditions
3737+ * are met:
3838+ * 1. Redistributions of source code must retain the above copyright
3939+ * notice, this list of conditions and the following disclaimer.
4040+ * 2. Redistributions in binary form must reproduce the above copyright
4141+ * notice, this list of conditions and the following disclaimer in the
4242+ * documentation and/or other materials provided with the distribution.
4343+ * 3. All advertising materials mentioning features or use of this software
4444+ * must display the following acknowledgement:
4545+ * This product includes software developed by the University of
4646+ * California, Berkeley and its contributors.
4747+ * 4. Neither the name of the University nor the names of its contributors
4848+ * may be used to endorse or promote products derived from this software
4949+ * without specific prior written permission.
5050+ *
5151+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
5252+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5353+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5454+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5555+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5656+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5757+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5858+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5959+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
6060+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6161+ * SUCH DAMAGE.
6262+ *
6363+ * @(#)types.h 8.3 (Berkeley) 1/5/94
6464+ */
6565+6666+#ifndef _MACHTYPES_H_
6767+#define _MACHTYPES_H_
6868+6969+#ifndef __ASSEMBLER__
7070+#include <ppc/_types.h>
7171+#include <sys/cdefs.h>
7272+/*
7373+ * Basic integral types. Omit the typedef if
7474+ * not possible for a machine/compiler combination.
7575+ */
7676+#ifndef _INT8_T
7777+#define _INT8_T
7878+typedef __signed char int8_t;
7979+#endif
8080+typedef unsigned char u_int8_t;
8181+#ifndef _INT16_T
8282+#define _INT16_T
8383+typedef short int16_t;
8484+#endif
8585+typedef unsigned short u_int16_t;
8686+#ifndef _INT32_T
8787+#define _INT32_T
8888+typedef int int32_t;
8989+#endif
9090+typedef unsigned int u_int32_t;
9191+#ifndef _INT64_T
9292+#define _INT64_T
9393+typedef long long int64_t;
9494+#endif
9595+typedef unsigned long long u_int64_t;
9696+9797+#if __LP64__
9898+typedef int64_t register_t;
9999+#else
100100+typedef int32_t register_t;
101101+#endif
102102+103103+#ifndef _INTPTR_T
104104+#define _INTPTR_T
105105+typedef __darwin_intptr_t intptr_t;
106106+#endif
107107+#ifndef _UINTPTR_T
108108+#define _UINTPTR_T
109109+typedef unsigned long uintptr_t;
110110+#endif
111111+112112+#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
113113+/* These types are used for reserving the largest possible size. */
114114+typedef u_int64_t user_addr_t;
115115+typedef u_int64_t user_size_t;
116116+typedef int64_t user_ssize_t;
117117+typedef int64_t user_long_t;
118118+typedef u_int64_t user_ulong_t;
119119+typedef int64_t user_time_t;
120120+typedef int64_t user_off_t;
121121+#define USER_ADDR_NULL ((user_addr_t) 0)
122122+#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
123123+124124+125125+#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
126126+127127+/* This defines the size of syscall arguments after copying into the kernel: */
128128+typedef u_int64_t syscall_arg_t;
129129+130130+//#ifndef __offsetof
131131+//#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
132132+//#endif
133133+134134+#endif /* __ASSEMBLER__ */
135135+#endif /* _MACHTYPES_H_ */
+66
platform-include/ppc/vmparam.h
···11+/*
22+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+#ifndef _BSD_PPC_VMPARAM_H_
3030+#define _BSD_PPC_VMPARAM_H_ 1
3131+3232+#include <sys/resource.h>
3333+3434+#define USRSTACK (0xc0000000)
3535+3636+/*
3737+ * put the default 64-bit stack at the max address
3838+ * (minus one 32-bit address space for other incidentals)
3939+ */
4040+#define USRSTACK64 (0x00007FFF5FC00000ULL)
4141+4242+/*
4343+ * Virtual memory related constants, all in bytes
4444+ */
4545+#ifndef DFLDSIZ
4646+#define DFLDSIZ (RLIM_INFINITY) /* initial data size limit */
4747+// XXX Not enforced
4848+//#define DFLDSIZ (6*1024*1024) /* initial data size limit */
4949+#endif
5050+#ifndef MAXDSIZ
5151+#define MAXDSIZ (RLIM_INFINITY) /* max data size */
5252+#endif
5353+#ifndef DFLSSIZ
5454+#define DFLSSIZ (8*1024*1024) /* initial stack size limit */
5555+#endif
5656+#ifndef MAXSSIZ
5757+#define MAXSSIZ (64*1024*1024) /* max stack size */
5858+#endif
5959+#ifndef DFLCSIZ
6060+#define DFLCSIZ (0) /* initial core size limit */
6161+#endif
6262+#ifndef MAXCSIZ
6363+#define MAXCSIZ (RLIM_INFINITY) /* max core size */
6464+#endif
6565+6666+#endif /* _BSD_PPC_VMPARAM_H_ */