Chameleon

Chameleon Commit Details

Date:2011-08-04 15:01:15 (8 years 15 days ago)
Author:Evan Lojewski
Commit:1270
Parents: 1269
Message:Add arm headers. update makefiles
Changes:
D/branches/xZenu/src/arm
A/branches/xZenu/src/include/mach/arm/rpc.h
A/branches/xZenu/src/include/architecture/arm
A/branches/xZenu/src/include/arm/_param.h
A/branches/xZenu/src/include/libkern/arm
A/branches/xZenu/src/include/arm/_limits.h
A/branches/xZenu/src/include/arm/param.h
A/branches/xZenu/src/include/arm/setjmp.h
A/branches/xZenu/src/include/mach/arm/exception.h
A/branches/xZenu/src/include/mach/arm/kern_return.h
A/branches/xZenu/src/include/mach/arm/ndr_def.h
A/branches/xZenu/src/include/arm
A/branches/xZenu/src/include/mach/arm/task.h
A/branches/xZenu/src/include/arm/signal.h
A/branches/xZenu/src/include/arm/arch.h
A/branches/xZenu/src/include/mach/arm/vm_types.h
A/branches/xZenu/src/include/architecture/arm/fenv.h
A/branches/xZenu/src/include/mach/arm
A/branches/xZenu/src/include/libkern/arm/OSByteOrder.h
A/branches/xZenu/src/include/mach/arm/boolean.h
A/branches/xZenu/src/include/mach/arm/asm.h
A/branches/xZenu/src/include/arm/endian.h
A/branches/xZenu/src/include/arm/limits.h
A/branches/xZenu/src/include/mach/arm/processor_info.h
A/branches/xZenu/src/include/arm/_types.h
A/branches/xZenu/src/include/arm/types.h
A/branches/xZenu/src/include/mach/arm/thread_act.h
A/branches/xZenu/src/include/arm/_structs.h
A/branches/xZenu/src/include/mach/arm/vm_param.h
A/branches/xZenu/src/include/architecture/arm/math.h
A/branches/xZenu/src/include/sys/signal.h
A/branches/xZenu/src/include/mach/arm/_structs.h
A/branches/xZenu/src/include/mach/arm/thread_state.h
A/branches/xZenu/src/include/mach/arm/thread_status.h
M/branches/xZenu/src/arch/i386/Make.rules
M/branches/xZenu/src/arch/armv5/Make.rules
M/branches/xZenu/Make.rules
M/branches/xZenu/src/include/sys/param.h
M/branches/xZenu/src/arch/ppc/Make.rules
M/branches/xZenu/src/arch/x86_64/Make.rules
M/branches/xZenu/src/modules/MakeInc.dir
M/branches/xZenu/src/arch/i386/boot2/Makefile

File differences

branches/xZenu/Make.rules
6565
6666
6767
68
69
70
71
72
7368
7469
7570
$(SRCROOT)/autoconf.h \
$(SRCROOT)/autoconf.inc
$(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h $(SRCROOT)/autoconf.inc $(SRCROOT)/.config: rebuild_cofig
.PHONY: $(SRCROOT)/autoconf.h
.PHONY: rebuild_config
.PHONY: config
.PHONY: clean
.PHONY: $(SYMROOT)/vers.h
branches/xZenu/src/include/arm/arch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (c) 2007 Apple Inc. All rights reserved.
*/
#ifndef _ARM_ARCH_H
#define _ARM_ARCH_H
/* Collect the __ARM_ARCH_*__ compiler flags into something easier to use. */
#if defined (__ARM_ARCH_7A__)
#define _ARM_ARCH_7
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
#define _ARM_ARCH_6K
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__)
#define _ARM_ARCH_6Z
#endif
#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \
defined (_ARM_ARCH_6Z) || defined (_ARM_ARCH_6K)
#define _ARM_ARCH_6
#endif
#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5E__) || \
defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
#define _ARM_ARCH_5E
#endif
#if defined (_ARM_ARCH_5E) || defined (__ARM_ARCH_5__) || \
defined (__ARM_ARCH_5T__)
#define _ARM_ARCH_5
#endif
#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
#define _ARM_ARCH_4T
#endif
#if defined (_ARM_ARCH_4T) || defined (__ARM_ARCH_4__)
#define _ARM_ARCH_4
#endif
#endif
branches/xZenu/src/include/arm/signal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright (c) 1992 NeXT Computer, Inc.
*
*/
#ifndef_ARM_SIGNAL_
#define_ARM_SIGNAL_ 1
#include <sys/appleapiopts.h>
#ifndef _ANSI_SOURCE
#ifdef __APPLE_API_OBSOLETE
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define __need_struct_sigcontext
#include <arm/_structs.h>
typedef int sig_atomic_t;
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
#endif /* __APPLE_API_OBSOLETE */
#endif /* _ANSI_SOURCE */
#endif/* _ARM_SIGNAL_ */
branches/xZenu/src/include/arm/endian.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
*/
/*
* Copyright (c) 1987, 1991, 1993
*The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*This product includes software developed by the University of
*California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*@(#)endian.h8.1 (Berkeley) 6/11/93
*/
#ifndef _ARM__ENDIAN_H_
#define_ARM__ENDIAN_H_
#include <sys/cdefs.h>
/*
* Define _NOQUAD if the compiler does NOT support 64-bit integers.
*/
/* #define _NOQUAD */
/*
* Define the order of 32-bit words in 64-bit words.
*/
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define__DARWIN_LITTLE_ENDIAN1234/* LSB first: i386, vax */
#define__DARWIN_BIG_ENDIAN4321/* MSB first: 68000, ibm, net */
#define__DARWIN_PDP_ENDIAN3412/* LSB first in word, MSW first in long */
#define__DARWIN_BYTE_ORDER__DARWIN_LITTLE_ENDIAN
#ifdefined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#defineLITTLE_ENDIAN__DARWIN_LITTLE_ENDIAN
#defineBIG_ENDIAN__DARWIN_BIG_ENDIAN
#definePDP_ENDIAN__DARWIN_PDP_ENDIAN
#defineBYTE_ORDER__DARWIN_BYTE_ORDER
#include <sys/_endian.h>
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
#endif /* !_ARM__ENDIAN_H_ */
branches/xZenu/src/include/arm/_param.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
* Copyright (c) 2006-2007 Apple Inc. All rights reserved.
*/
#ifndef _ARM__PARAM_H_
#define _ARM__PARAM_H_
#include <arm/_types.h>
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is unsigned int and must be
* cast to any desired pointer type.
*/
#define__DARWIN_ALIGNBYTES(sizeof(__darwin_size_t) - 1)
#define__DARWIN_ALIGN(p)((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
#endif /* _ARM__PARAM_H_ */
branches/xZenu/src/include/arm/_limits.h
1
2
3
4
5
6
7
8
9
/*
* Copyright (c) 2004-2007 Apple Inc. All rights reserved.
*/
#ifndef_ARM__LIMITS_H_
#define_ARM__LIMITS_H_
#define__DARWIN_CLK_TCK100/* ticks per second */
#endif/* _ARM__LIMITS_H_ */
branches/xZenu/src/include/arm/param.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*-
* Copyright (c) 1990, 1993
*The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*This product includes software developed by the University of
*California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*@(#)param.h8.1 (Berkeley) 4/4/95
*/
/*
* Machine dependent constants for ARM
*/
#ifndef _ARM_PARAM_H_
#define _ARM_PARAM_H_
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is unsigned int and must be
* cast to any desired pointer type.
*/
#defineALIGNBYTES3
#defineALIGN(p)(((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
#defineNBPG4096/* bytes/page */
#definePGOFSET(NBPG-1)/* byte offset into page */
#definePGSHIFT12/* LOG2(NBPG) */
#defineDEV_BSIZE512
#defineDEV_BSHIFT9/* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE2048
#defineMAXPHYS(64 * 1024)/* max raw I/O transfer size */
#defineCLSIZE1
#defineCLSIZELOG20
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than CLBYTES (the software page size), and,
* on machines that exchange pages of input or output buffers with mbuf
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
* of the hardware page size.
*/
#defineMSIZE256/* size of an mbuf */
#defineMCLBYTES2048/* large enough for ether MTU */
#defineMCLSHIFT11
#defineMCLOFSET(MCLBYTES - 1)
#ifndef NMBCLUSTERS
#defineNMBCLUSTERSCONFIG_NMBCLUSTERS/* cl map size */
#endif
/*
* Some macros for units conversion
*/
/* Core clicks (NeXT_page_size bytes) to segments and vice versa */
#definectos(x)(x)
#definestoc(x)(x)
/* Core clicks (4096 bytes) to disk blocks */
#definectod(x)((x)<<(PGSHIFT-DEV_BSHIFT))
#definedtoc(x)((x)>>(PGSHIFT-DEV_BSHIFT))
#definedtob(x)((x)<<DEV_BSHIFT)
/* clicks to bytes */
#definectob(x)((x)<<PGSHIFT)
/* bytes to clicks */
#definebtoc(x)(((unsigned)(x)+(NBPG-1))>>PGSHIFT)
#ifdef __APPLE__
#define btodb(bytes, devBlockSize) \
((unsigned)(bytes) / devBlockSize)
#define dbtob(db, devBlockSize) \
((unsigned)(db) * devBlockSize)
#else
#definebtodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
((unsigned)(bytes) >> DEV_BSHIFT)
#definedbtob(db)/* calculates (db * DEV_BSIZE) */ \
((unsigned)(db) << DEV_BSHIFT)
#endif
/*
* Map a ``block device block'' to a file system block.
* This should be device dependent, and will be if we
* add an entry to cdevsw/bdevsw for that purpose.
* For now though just use DEV_BSIZE.
*/
#definebdbtofsb(bn)((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
/*
* Macros to decode (and encode) processor status word.
*/
#define STATUS_WORD(rpl, ipl)(((ipl) << 8) | (rpl))
#defineUSERMODE(x)(((x) & 3) == 3)
#defineBASEPRI(x)(((x) & (255 << 8)) == 0)
#ifdefined(KERNEL) || defined(STANDALONE)
#defineDELAY(n) delay(n)
#else/* defined(KERNEL) || defined(STANDALONE) */
#defineDELAY(n){ register int N = (n); while (--N > 0); }
#endif/* defined(KERNEL) || defined(STANDALONE) */
#endif /* _ARM_PARAM_H_ */
branches/xZenu/src/include/arm/limits.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright (c) 1988, 1993
*The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*This product includes software developed by the University of
*California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*@(#)limits.h8.3 (Berkeley) 1/4/94
*/
#ifndef _ARM_LIMITS_H_
#define _ARM_LIMITS_H_
#include <sys/cdefs.h>
#include <arm/_limits.h>
#defineCHAR_BIT8/* number of bits in a char */
#defineMB_LEN_MAX6/* Allow 31 bit UTF2 */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#defineCLK_TCK__DARWIN_CLK_TCK/* ticks per second */
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
* These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values
* are written as hex so that GCC will be quiet about large integer constants.
*/
#defineSCHAR_MAX127/* min value for a signed char */
#defineSCHAR_MIN(-128)/* max value for a signed char */
#defineUCHAR_MAX255/* max value for an unsigned char */
#defineCHAR_MAX127/* max value for a char */
#defineCHAR_MIN(-128)/* min value for a char */
#defineUSHRT_MAX65535/* max value for an unsigned short */
#defineSHRT_MAX32767/* max value for a short */
#defineSHRT_MIN(-32768)/* min value for a short */
#defineUINT_MAX0xffffffff/* max value for an unsigned int */
#defineINT_MAX2147483647/* max value for an int */
#defineINT_MIN(-2147483647-1)/* min value for an int */
#ifdef __LP64__
#defineULONG_MAX0xffffffffffffffffUL/* max unsigned long */
#defineLONG_MAX0x7fffffffffffffffL/* max signed long */
#defineLONG_MIN(-0x7fffffffffffffffL-1) /* min signed long */
#else /* !__LP64__ */
#defineULONG_MAX0xffffffffUL/* max unsigned long */
#defineLONG_MAX2147483647L/* max signed long */
#defineLONG_MIN(-2147483647L-1) /* min signed long */
#endif /* __LP64__ */
#defineULLONG_MAX0xffffffffffffffffULL/* max unsigned long long */
#defineLLONG_MAX0x7fffffffffffffffLL/* max signed long long */
#defineLLONG_MIN(-0x7fffffffffffffffLL-1) /* min signed long long */
#if !defined(_ANSI_SOURCE)
#ifdef __LP64__
#define LONG_BIT64
#else /* !__LP64__ */
#define LONG_BIT32
#endif /* __LP64__ */
#defineSSIZE_MAXLONG_MAX/* max value for a ssize_t */
#define WORD_BIT32
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#defineSIZE_T_MAXULONG_MAX/* max value for a size_t */
#defineUQUAD_MAXULLONG_MAX
#defineQUAD_MAXLLONG_MAX
#defineQUAD_MINLLONG_MIN
#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
#endif /* !_ANSI_SOURCE */
#endif /* _ARM_LIMITS_H_ */
branches/xZenu/src/include/arm/setjmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
*
*File:setjmp.h
*
*Declaration of setjmp routines and data structures.
*/
#ifndef _BSD_ARM_SETJMP_H
#define _BSD_ARM_SETJMP_H
#include <sys/cdefs.h>
#include <machine/signal.h>
/*
*_JBLEN is number of ints required to save the following:
*r4-r8, r10, fp, sp, lr, sig == 10 register_t sized
*s16-s31 == 16 register_t sized + 1 int for FSTMX
*1 extra int for future use
*/
#define _JBLEN(10 + 16 + 2)
#define _JBLEN_MAX_JBLEN
typedef int jmp_buf[_JBLEN];
typedef int sigjmp_buf[_JBLEN + 1];
__BEGIN_DECLS
extern int setjmp(jmp_buf env);
extern void longjmp(jmp_buf env, int val);
#ifndef _ANSI_SOURCE
int_setjmp(jmp_buf env);
void_longjmp(jmp_buf, int val);
int sigsetjmp(sigjmp_buf env, int val);
void siglongjmp(sigjmp_buf env, int val);
#endif /* _ANSI_SOURCE */
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE)
voidlongjmperror(void);
#endif /* neither ANSI nor POSIX */
__END_DECLS
#endif /* !_BSD_ARM_SETJMP_H */
branches/xZenu/src/include/arm/_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
#ifndef_BSD_ARM__TYPES_H_
#define_BSD_ARM__TYPES_H_
/*
* This header file contains integer types. It's intended to also contain
* flotaing point and other arithmetic types, as needed, later.
*/
#ifdef __GNUC__
typedef __signed char__int8_t;
#else/* !__GNUC__ */
typedef char__int8_t;
#endif/* !__GNUC__ */
typedef unsigned char__uint8_t;
typedefshort__int16_t;
typedefunsigned short__uint16_t;
typedef int__int32_t;
typedef unsigned int__uint32_t;
typedef long long__int64_t;
typedef unsigned long long__uint64_t;
typedef long__darwin_intptr_t;
typedef unsigned int__darwin_natural_t;
/*
* The rune type below is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
* it looks like 10646 will be a 31 bit standard. This means that if your
* ints cannot hold 32 bits, you will be in trouble. The reason an int was
* chosen over a long is that the is*() and to*() routines take ints (says
* ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it
* here, you lose a bit of ANSI conformance, but your programs will still
* work.
*
* NOTE: rune_t is not covered by ANSI nor other standards, and should not
* be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
* rune_t must be the same type. Also wint_t must be no narrower than
* wchar_t, and should also be able to hold all members of the largest
* character set plus one extra value (WEOF). wint_t must be at least 16 bits.
*/
typedef int__darwin_ct_rune_t;/* ct_rune_t */
/*
* mbstate_t is an opaque object to keep conversion state, during multibyte
* stream conversions. The content must not be referenced by user programs.
*/
typedef union {
char__mbstate8[128];
long long_mbstateL;/* for alignment */
} __mbstate_t;
typedef __mbstate_t__darwin_mbstate_t;/* mbstate_t */
#if defined(__GNUC__) && defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE____darwin_ptrdiff_t;/* ptr1 - ptr2 */
#else
typedef int__darwin_ptrdiff_t;/* ptr1 - ptr2 */
#endif /* __GNUC__ */
#if defined(__GNUC__) && defined(__SIZE_TYPE__)
typedef __SIZE_TYPE____darwin_size_t;/* sizeof() */
#else
typedef unsigned long__darwin_size_t;/* sizeof() */
#endif
#if (__GNUC__ > 2)
typedef __builtin_va_list__darwin_va_list;/* va_list */
#else
typedef void *__darwin_va_list;/* va_list */
#endif
#if defined(__GNUC__) && defined(__WCHAR_TYPE__)
typedef __WCHAR_TYPE____darwin_wchar_t;/* wchar_t */
#else
typedef __darwin_ct_rune_t__darwin_wchar_t;/* wchar_t */
#endif
typedef __darwin_wchar_t__darwin_rune_t;/* rune_t */
#if defined(__GNUC__) && defined(__WINT_TYPE__)
typedef __WINT_TYPE____darwin_wint_t;/* wint_t */
#else
typedef __darwin_ct_rune_t__darwin_wint_t;/* wint_t */
#endif
typedef unsigned long__darwin_clock_t;/* clock() */
typedef __uint32_t__darwin_socklen_t;/* socklen_t (duh) */
typedef long__darwin_ssize_t;/* byte count or error */
typedef long__darwin_time_t;/* time() */
#endif/* _BSD_ARM__TYPES_H_ */
branches/xZenu/src/include/arm/types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*/
/*
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
*/
/*
* Copyright (c) 1990, 1993
*The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*This product includes software developed by the University of
*California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*@(#)types.h8.3 (Berkeley) 1/5/94
*/
#ifndef_MACHTYPES_H_
#define_MACHTYPES_H_
#ifndef __ASSEMBLER__
#include <arm/_types.h>
#include <sys/cdefs.h>
/*
* Basic integral types. Omit the typedef if
* not possible for a machine/compiler combination.
*/
#ifndef _INT8_T
#define _INT8_T
typedef__signed charint8_t;
#endif
typedefunsigned charu_int8_t;
#ifndef _INT16_T
#define _INT16_T
typedefshortint16_t;
#endif
typedefunsigned shortu_int16_t;
#ifndef _INT32_T
#define _INT32_T
typedefintint32_t;
#endif
typedefunsigned intu_int32_t;
#ifndef _INT64_T
#define _INT64_T
typedeflong longint64_t;
#endif
typedefunsigned long longu_int64_t;
typedef int32_tregister_t;
#ifndef _INTPTR_T
#define _INTPTR_T
typedef __darwin_intptr_tintptr_t;
#endif
#ifndef _UINTPTR_T
#define _UINTPTR_T
typedef unsigned longuintptr_t;
#endif
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
/* These types are used for reserving the largest possible size. */
typedef u_int32_tuser_addr_t;
typedef u_int32_tuser_size_t;
typedef int32_tuser_ssize_t;
typedef int32_tuser_long_t;
typedef u_int32_tuser_ulong_t;
typedef int32_tuser_time_t;
typedef int64_tuser_off_t;
#define USER_ADDR_NULL((user_addr_t) 0)
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/* This defines the size of syscall arguments after copying into the kernel: */
typedef u_int32_tsyscall_arg_t;
#ifndef __offsetof
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
#endif
#endif /* __ASSEMBLER__ */
#endif/* _MACHTYPES_H_ */
branches/xZenu/src/include/arm/_structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) 2006-2007 Apple Inc. All rights reserved.
*/
#include <sys/appleapiopts.h>
#ifdef __need_mcontext_t
#ifndef __need_struct_mcontext
#define __need_struct_mcontext
#endif /* __need_struct_mcontext */
#endif /* __need_mcontext_t */
#if defined(__need_struct_mcontext)
#include <mach/arm/_structs.h>
#endif /* __need_struct_mcontext */
#ifdef __need_struct_mcontext
#undef __need_struct_mcontext
#ifndef _STRUCT_MCONTEXT
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT struct __darwin_mcontext
_STRUCT_MCONTEXT
{
_STRUCT_ARM_EXCEPTION_STATE__es;
_STRUCT_ARM_THREAD_STATE__ss;
_STRUCT_ARM_VFP_STATE__fs;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_MCONTEXT struct mcontext
_STRUCT_MCONTEXT
{
_STRUCT_ARM_EXCEPTION_STATEes;
_STRUCT_ARM_THREAD_STATEss;
_STRUCT_ARM_VFP_STATEfs;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT */
#endif /* __need_struct_mcontext */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#ifndef ARM_MCONTEXT_SIZE
#define ARM_MCONTEXT_SIZE (ARM_THREAD_STATE_COUNT + ARM_VFP_STATE_COUNT + ARM_EXCEPTION_STATE_COUNT) * sizeof(int)
#endif /* ARM_MCONTEXT_SIZE */
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
branches/xZenu/src/include/architecture/arm/math.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
/*
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*******************************************************************************
* *
* File: math.h *
* *
* Contains: typedefs, prototypes, and macros germane to C99 floating point.*
* *
*******************************************************************************/
#ifndef __MATH__
#define __MATH__
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* Floating point data types *
******************************************************************************/
/* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2,
taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may
define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler
must and may define only in float.h).
*/
#if __FLT_EVAL_METHOD__ == 0
typedef float float_t;
typedef double double_t;
#elif __FLT_EVAL_METHOD__ == 1
typedef double float_t;
typedef double double_t;
#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
typedef long double float_t;
typedef long double double_t;
#else /* __FLT_EVAL_METHOD__ */
#error "Unsupported value of __FLT_EVAL_METHOD__."
#endif /* __FLT_EVAL_METHOD__ */
#if defined(__GNUC__)
#define HUGE_VAL __builtin_huge_val()
#define HUGE_VALF __builtin_huge_valf()
#define HUGE_VALL __builtin_huge_vall()
#define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */
#define __MATH_H_ALWAYS_INLINE__ __attribute__ ((__always_inline__))
#if defined( __LONG_DOUBLE_128__ )
// This is the arm Libm header. Arm has 64-bit long doubles.
// If you are trying to build for Intel or PowerPC this is not the right header.
#error This math library does not support 128-bit long doubles
#endif
#else
#define HUGE_VAL 1e500
#define HUGE_VALF 1e50f
#define HUGE_VALL 1e5000L
#define NAN __nan( )
#define __MATH_H_ALWAYS_INLINE__
#endif
#define INFINITY HUGE_VALF
/******************************************************************************
* Taxonomy of floating point data types *
******************************************************************************/
#define FP_NAN 1
#define FP_INFINITE 2
#define FP_ZERO 3
#define FP_NORMAL 4
#define FP_SUBNORMAL 5
#define FP_SUPERNORMAL 6 /* meaningful only on PowerPC */
/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */
/* For single and double precision, the cost isn't too bad, because we can fall back on higher */
/* precision hardware, with the necessary range to handle infinite precision products. However, */
/* expect the long double fma to be at least an order of magnitude slower than a simple multiply */
/* and an add. */
#undef FP_FAST_FMA
#undef FP_FAST_FMAF
#undef FP_FAST_FMAL
/* The values returned by `ilogb' for 0 and NaN respectively. */
#define FP_ILOGB0 (-2147483647 - 1)
#define FP_ILOGBNAN (-2147483647 - 1)
/* Bitmasks for the math_errhandling macro. */
#define MATH_ERRNO 1 /* errno set by math functions. */
#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */
#define math_errhandling (__math_errhandling())
extern int __math_errhandling ( void );
/********************************************************************************
* *
* Inquiry macros *
* *
* fpclassify Returns one of the FP_* values. *
* isnormal Non-zero if and only if the argument x is normalized. *
* isfinite Non-zero if and only if the argument x is finite. *
* isnan Non-zero if and only if the argument x is a NaN. *
* signbit Non-zero if and only if the sign of the argument x is *
* negative. This includes, NaNs, infinities and zeros. *
* *
********************************************************************************/
#define fpclassify(x) \
( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) \
: sizeof (x) == sizeof(double) ? __fpclassify((double)(x)) \
: __fpclassifyl ((long double)(x)))
extern int __fpclassifyf(float );
extern int __fpclassify(double );
extern int __fpclassifyl(long double);
/*
Note that these inline functions will fail to return expected results if you turn on unsafe math optimization flags,
including -ffast-math. This is not a bug. You have explicitly told the compiler that NaN's and Infs never happen.
As a result, the compiler simply assumes that they can't happen and things like isnan() return false even when
presented with a NaN.
*/
#define isnormal(x) \
( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \
: sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \
: __inline_isnormal ((long double)(x)))
#define isfinite(x) \
( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \
: sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \
: __inline_isfinite ((long double)(x)))
#define isinf(x) \
( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \
: sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \
: __inline_isinf ((long double)(x)))
#define isnan(x) \
( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \
: sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \
: __inline_isnan ((long double)(x)))
#define signbit(x) \
( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \
: sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \
: __inline_signbit((long double)(x)))
static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__;
static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); }
static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); }
static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); }
static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); }
static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); }
static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); }
static __inline__ int __inline_isnanf( float __x ) { return __x != __x; }
static __inline__ int __inline_isnand( double __x ) { return __x != __x; }
static __inline__ int __inline_isnan( long double __x ) { return __x != __x; }
static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); }
static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long long __u; }__u; __u.__f = __x; return (int)(__u.__u >> 63); }
static __inline__ int __inline_signbit( long double __x ){ union{ double __f; unsigned long long __u; }__u; __u.__f = __x; return (int)(__u.__u >> 63); }
static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; }
static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; }
static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; }
/********************************************************************************
* *
* Math Functions *
* *
********************************************************************************/
extern double acos( double );
extern float acosf( float );
extern double asin( double );
extern float asinf( float );
extern double atan( double );
extern float atanf( float );
extern double atan2( double, double );
extern float atan2f( float, float );
extern double cos( double );
extern float cosf( float );
extern double sin( double );
extern float sinf( float );
extern double tan( double );
extern float tanf( float );
extern double acosh( double );
extern float acoshf( float );
extern double asinh( double );
extern float asinhf( float );
extern double atanh( double );
extern float atanhf( float );
extern double cosh( double );
extern float coshf( float );
extern double sinh( double );
extern float sinhf( float );
extern double tanh( double );
extern float tanhf( float );
extern double exp ( double );
extern float expf ( float );
extern double exp2 ( double );
extern float exp2f ( float );
extern double expm1 ( double );
extern float expm1f ( float );
extern double log ( double );
extern float logf ( float );
extern double log10 ( double );
extern float log10f ( float );
extern double log2 ( double );
extern float log2f ( float );
extern double log1p ( double );
extern float log1pf ( float );
extern double logb ( double );
extern float logbf ( float );
extern double modf ( double, double * );
extern float modff ( float, float * );
extern double ldexp ( double, int );
extern float ldexpf ( float, int );
extern double frexp ( double, int * );
extern float frexpf ( float, int * );
extern int ilogb ( double );
extern int ilogbf ( float );
extern double scalbn ( double, int );
extern float scalbnf ( float, int );
extern double scalbln ( double, long int );
extern float scalblnf ( float, long int );
extern double fabs( double );
extern float fabsf( float );
extern double cbrt( double );
extern float cbrtf( float );
extern double hypot ( double, double );
extern float hypotf ( float, float );
extern double pow ( double, double );
extern float powf ( float, float );
extern double sqrt( double );
extern float sqrtf( float );
extern double erf( double );
extern float erff( float );
extern double erfc( double );
extern float erfcf( float );
/*lgamma and lgammaf are not thread-safe. The thread-safe variants lgamma_r and lgammaf_r
are available if _REENTRANT symbol is defined
*/
extern double lgamma( double );
extern float lgammaf( float );
extern double tgamma( double );
extern float tgammaf( float );
extern double ceil ( double );
extern float ceilf ( float );
extern double floor ( double );
extern float floorf ( float );
extern double nearbyint ( double );
extern float nearbyintf ( float );
extern double rint ( double );
extern float rintf ( float );
extern long int lrint ( double );
extern long int lrintf ( float );
extern double round ( double );
extern float roundf ( float );
extern long int lround ( double );
extern long int lroundf ( float );
#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ )
/* long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */
extern long long int llrint ( double );
extern long long int llrintf ( float );
extern long long int llround ( double );
extern long long int llroundf ( float );
#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */
extern double trunc ( double );
extern float truncf ( float );
extern double fmod ( double, double );
extern float fmodf ( float, float );
extern double remainder ( double, double );
extern float remainderf ( float, float );
extern double remquo ( double, double, int * );
extern float remquof ( float, float, int * );
extern double copysign ( double, double );
extern float copysignf ( float, float );
extern double nan( const char * );
extern float nanf( const char * );
extern double nextafter ( double, double );
extern float nextafterf ( float, float );
extern double fdim ( double, double );
extern float fdimf ( float, float );
extern double fmax ( double, double );
extern float fmaxf ( float, float );
extern double fmin ( double, double );
extern float fminf ( float, float );
extern double fma ( double, double, double );
extern float fmaf ( float, float, float );
extern long double acosl(long double);
extern long double asinl(long double);
extern long double atanl(long double);
extern long double atan2l(long double, long double);
extern long double cosl(long double);
extern long double sinl(long double);
extern long double tanl(long double);
extern long double acoshl(long double);
extern long double asinhl(long double);
extern long double atanhl(long double);
extern long double coshl(long double);
extern long double sinhl(long double);
extern long double tanhl(long double);
extern long double expl(long double);
extern long double exp2l(long double);
extern long double expm1l(long double);
extern long double logl(long double);
extern long double log10l(long double);
extern long double log2l(long double);
extern long double log1pl(long double);
extern long double logbl(long double);
extern long double modfl(long double, long double *);
extern long double ldexpl(long double, int);
extern long double frexpl(long double, int *);
extern int ilogbl(long double);
extern long double scalbnl(long double, int);
extern long double scalblnl(long double, long int);
extern long double fabsl(long double);
extern long double cbrtl(long double);
extern long double hypotl(long double, long double);
extern long double powl(long double, long double);
extern long double sqrtl(long double);
extern long double erfl(long double);
extern long double erfcl(long double);
/*lgammal is not thread-safe. The thread-safe variant lgammal_r is available if _REENTRANT symbol is defined */
extern long double lgammal(long double);
extern long double tgammal(long double);
extern long double ceill(long double);
extern long double floorl(long double);
extern long double nearbyintl(long double);
extern long double rintl(long double);
extern long int lrintl(long double);
extern long double roundl(long double);
extern long int lroundl(long double);
#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ )
// long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this.
extern long long int llrintl(long double);
extern long long int llroundl(long double);
#endif
extern long double truncl(long double);
extern long double fmodl(long double, long double);
extern long double remainderl(long double, long double);
extern long double remquol(long double, long double, int *);
extern long double copysignl(long double, long double);
extern long double nanl(const char *);
extern long double nextafterl(long double, long double);
extern double nexttoward(double, long double);
extern float nexttowardf(float, long double);
extern long double nexttowardl(long double, long double);
extern long double fdiml(long double, long double);
extern long double fmaxl(long double, long double);
extern long double fminl(long double, long double);
extern long double fmal(long double, long double, long double);
#define isgreater(x, y) __builtin_isgreater ((x),(y))
#define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y))
#define isless(x, y) __builtin_isless ((x),(y))
#define islessequal(x, y) __builtin_islessequal ((x),(y))
#define islessgreater(x, y) __builtin_islessgreater ((x),(y))
#define isunordered(x, y) __builtin_isunordered ((x),(y))
#if !defined(_ANSI_SOURCE)
/*
* set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
* (one may replace the following line by "#include <values.h>")
*/
#define X_TLOSS1.41484755040568800000e+16
extern double j0 ( double );
extern double j1 ( double );
extern double jn ( int, double );
extern double y0 ( double );
extern double y1 ( double );
extern double yn ( int, double );
extern double scalb ( double, double );
extern int signgam; /* required for unix 2003 */
/*
* Constants required by UNIX 2003 / POSIX:
*
* http://www.opengroup.org/onlinepubs/007908799/xsh/math.h.html
*
* Even though these would be more useful as long double, POSIX requires these to be double.
*/
#define M_E 2.71828182845904523536028747135266250 /* e */
#define M_LOG2E 1.44269504088896340735992468100189214 /* log2(e) */
#define M_LOG10E 0.434294481903251827651128918916605082 /* log10(e) */
#define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */
#define M_LN10 2.30258509299404568401799145468436421 /* loge(10) */
#define M_PI 3.14159265358979323846264338327950288 /* pi */
#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */
#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */
#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */
#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */
#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
#define MAXFLOAT 0x1.fffffep+127f
#endif /* !defined(_ANSI_SOURCE) */
#if !defined(__NOEXTENSIONS__) && !defined(__STRICT_ANSI__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#ifdef _REENTRANT
/* Thread safe variants of the lgamma[fl]_r functions. */
extern float lgammaf_r(float, int *);
extern double lgamma_r(double, int *);
extern long double lgammal_r(long double, int *);
#endif // _REENTRANT
#endif // !defined(__NOEXTENSIONS__) && !defined(__STRICT_ANSI__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#ifdef __cplusplus
}
#endif
#endif /* __MATH__ */
branches/xZenu/src/include/architecture/arm/fenv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*******************************************************************************
* *
* File: fenv.h *
* *
* Contains: typedefs and prototypes for C99 floating point environment. *
* *
*******************************************************************************/
#ifndef __FENV__
#define __FENV__
/* We require VFP for this set of interfaces to work */
#if !defined(__VFP_FP__) || defined(__SOFTFP__)
#warning The <fenv.h> functions are not supported on platforms that do not have hardware floating-point.
#else
#ifdef __cplusplus
extern "C" {
#endif
/*
A collection of functions designed to provide access to the floating
point environment for numerical programming. It is compliant with
the floating-point requirements in C99.
The file <fenv.h> declares many functions in support of numerical
programming. Programs that test flags or run under
non-default modes must do so under the effect of an enabling
"fenv_access" pragma:
#pragma STDC FENV_ACCESS on
Note that prior to iPhone OS 2.0, these interfaces did nothing.
*/
/********************************************************************************
* *
* fenv_t is a type for representing the entire floating-point *
* environment in a single object. *
* *
* fexcept_t is a type for representing the floating-point *
* exception flag state collectively. *
* *
********************************************************************************/
typedef struct {
union
{
struct
{
unsigned int __fpscr;
unsigned int __reserved0;
unsigned int __reserved1;
unsigned int __reserved2;
};
#if defined( __GNUC__ )
struct
{
unsigned int __fpscr_cmp_n : 1;
unsigned int __fpscr_cmp_z : 1;
unsigned int __fpscr_cmp_c : 1;
unsigned int __fpscr_cmp_v : 1;
unsigned int __fpscr_do_not_modify_1 : 2; /* Should be zero */
unsigned int __fpscr_default_nan_mode : 1;
unsigned int __fpscr_flush_to_zero : 1;
unsigned int __fpscr_rounding_mode : 2;
unsigned int __fpscr_stride : 2;
unsigned int __fpscr_do_not_modify_2 : 1; /* Should be zero */
unsigned int __fpscr_len : 3 ;
unsigned int __fpscr_trap_enable_subnormal : 1 ; /* Note: we run under "Run Fast Mode". Setting this bit has undefined results. */
unsigned int __fpscr_do_not_modfify_3 : 2; /* Should be zero */
unsigned int __fpscr_trap_enable_inexact : 1; /* Note: we run under "Run Fast Mode". Setting this bit has undefined results. */
unsigned int __fpscr_trap_enable_underflow : 1; /* Note: we run under "Run Fast Mode". Setting this bit has undefined results. */
unsigned int __fpscr_trap_enable_overflow : 1; /* Note: we run under "Run Fast Mode". Setting this bit has undefined results. */
unsigned int __fpscr_trap_enable_div_by_zero : 1; /* Note: we run under "Run Fast Mode". Setting this bit has undefined results. */
unsigned int __fpscr_trap_enable_invalid : 1; /* Note: we run under "Run Fast Mode". Setting this bit has undefined results. */
unsigned int __fpscr_fp_state_flag_subnormal : 1;
unsigned int __fpscr_do_not_modify_4 : 2; /* Should be zero */
unsigned int __fpscr_fp_state_flag_inexact : 1;
unsigned int __fpscr_fp_state_flag_underflow : 1;
unsigned int __fpscr_fp_state_flag_overflow : 1;
unsigned int __fpscr_fp_state_flag_div_by_zero : 1;
unsigned int __fpscr_fp_state_flag_invalid : 1;
} __attribute((packed));
#endif
};
} fenv_t;
typedef unsigned short fexcept_t;
/* Definitions of floating-point exception macros */
#define FE_INEXACT 0x0010
#define FE_UNDERFLOW 0x0008
#define FE_OVERFLOW 0x0004
#define FE_DIVBYZERO 0x0002
#define FE_INVALID 0x0001
#define FE_ALL_EXCEPT 0x001F
/* Definitions of rounding direction macros */
#define FE_TONEAREST 0x00000000
#define FE_UPWARD 0x00400000
#define FE_DOWNWARD 0x00800000
#define FE_TOWARDZERO 0x00C00000
/* default environment object */
extern const fenv_t _FE_DFL_ENV;
#define FE_DFL_ENV &_FE_DFL_ENV /* pointer to default environment */
/*******************************************************************************
* The following functions provide high level access to the exception flags.*
* The "int" input argument can be constructed by bitwise ORs of the *
* exception macros: for example: FE_OVERFLOW | FE_INEXACT. *
*******************************************************************************/
/*******************************************************************************
* The function "feclearexcept" clears the supported floating point *
* exceptions represented by its argument. *
*******************************************************************************/
extern int feclearexcept(int /*excepts*/);
/*******************************************************************************
* The function "fegetexceptflag" stores a implementation-defined *
* representation of the states of the floating-point status flags indicated *
* by its integer argument excepts in the object pointed to by the argument, *
* flagp. *
*******************************************************************************/
extern int fegetexceptflag(fexcept_t * /*flagp*/, int /*excepts*/);
/*******************************************************************************
* The function "feraiseexcept" raises the supported floating-point *
* exceptions represented by its argument. The order in which these *
* floating-point exceptions are raised is unspecified. *
*******************************************************************************/
extern int feraiseexcept(int /*excepts*/);
/*******************************************************************************
* The function "fesetexceptflag" sets or clears the floating point status *
* flags indicated by the argument excepts to the states stored in the *
* object pointed to by flagp. The value of the *flagp shall have been set *
* by a previous call to fegetexceptflag whose second argument represented *
* at least those floating-point exceptions represented by the argument *
* excepts. This function does not raise floating-point exceptions; it just *
* sets the state of the flags. *
*******************************************************************************/
extern int fesetexceptflag(const fexcept_t * /*flagp*/, int /*excepts*/);
/*******************************************************************************
* The function "fetestexcept" determines which of the specified subset of *
* the floating-point exception flags are currently set. The excepts *
* argument specifies the floating-point status flags to be queried. This *
* function returns the value of the bitwise OR of the floating-point *
* exception macros corresponding to the currently set floating-point *
* exceptions included in excepts. *
* *
*******************************************************************************/
extern int fetestexcept(int /*excepts*/);
/*******************************************************************************
* The following functions provide control of rounding direction modes. *
*******************************************************************************/
/*******************************************************************************
* The function "fegetround" returns the value of the rounding direction *
* macro which represents the current rounding direction, or a negative *
* if there is no such rounding direction macro or the current rounding *
* direction is not determinable. *
*******************************************************************************/
extern int fegetround(void);
/*******************************************************************************
* The function "fesetround" establishes the rounding direction represented *
* by its argument "round". If the argument is not equal to the value of a *
* rounding direction macro, the rounding direction is not changed. It *
* returns zero if and only if the argument is equal to a rounding *
* direction macro. *
*******************************************************************************/
extern int fesetround(int /*round*/);
/*******************************************************************************
* The following functions manage the floating-point environment, exception *
* flags and dynamic modes, as one entity. *
*******************************************************************************/
/*******************************************************************************
* The fegetenv function stores the current floating-point enviornment in *
* the object pointed to by envp. *
*******************************************************************************/
extern int fegetenv(fenv_t * /*envp*/);
/*******************************************************************************
* The feholdexcept function saves the current floating-point environment in *
* the object pointed to by envp, clears the floating-point status flags, *
* and then installs a non-stop (continue on floating-point exceptions) *
* mode, if available, for all floating-point exceptions. The feholdexcept *
* function returns zero if and only if non-stop floating-point exceptions *
* handling was successfully installed. *
*******************************************************************************/
extern int feholdexcept(fenv_t * /*envp*/);
/*******************************************************************************
* The fesetnv function establishes the floating-point environment *
* represented by the object pointed to by envp. The argument envp shall *
* point to an object set by a call to fegetenv or feholdexcept, or equal to *
* a floating-point environment macro -- we define only *FE_DFL_ENV and *
* FE_DISABLE_SSE_DENORMS_ENV -- to be C99 standard compliant and portable *
* to other architectures. Note that fesetnv merely installs the state of *
* the floating-point status flags represented through its argument, and *
* does not raise these floating-point exceptions. *
*******************************************************************************/
extern int fesetenv(const fenv_t * /*envp*/);
/*******************************************************************************
* The feupdateenv function saves the currently raised floating-point *
* exceptions in its automatic storage, installs the floating-point *
* environment represented by the object pointed to by envp, and then raises *
* the saved floating-point exceptions. The argument envp shall point to an *
* object set by a call to feholdexcept or fegetenv or equal a *
* floating-point environment macro. *
*******************************************************************************/
extern int feupdateenv(const fenv_t * /*envp*/);
#ifdef __cplusplus
}
#endif
#endif // HARDWARE FP
#endif /* __FENV__ */
branches/xZenu/src/include/mach/arm/processor_info.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* Copyright (c) 2007 Apple Inc. All rights reserved.
*/
/*
* FILE_ID: processor_info.h
*/
#ifndef _MACH_ARM_PROCESSOR_INFO_H_
#define _MACH_ARM_PROCESSOR_INFO_H_
#define PROCESSOR_CPU_STAT0x10000003/* Low level cpu statistics */
struct processor_cpu_stat {
uint32_tirq_ex_cnt;
uint32_tipi_cnt;
uint32_ttimer_cnt;
uint32_tundef_ex_cnt;
uint32_tunaligned_cnt;
uint32_tvfp_cnt;
uint32_tdata_ex_cnt;
uint32_tinstr_ex_cnt;
};
typedefstruct processor_cpu_statprocessor_cpu_stat_data_t;
typedef struct processor_cpu_stat*processor_cpu_stat_t;
#define PROCESSOR_CPU_STAT_COUNT((mach_msg_type_number_t) \
(sizeof(processor_cpu_stat_data_t)/sizeof(natural_t)))
#endif /* _MACH_ARM_PROCESSOR_INFO_H_ */
branches/xZenu/src/include/mach/arm/thread_status.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright (c) 2007 Apple Inc. All rights reserved.
*/
/*
* FILE_ID: thread_status.h
*/
#ifndef _ARM_THREAD_STATUS_H_
#define _ARM_THREAD_STATUS_H_
#include <mach/arm/_structs.h>
#include <mach/message.h>
#include <mach/arm/thread_state.h>
/*
* Support for determining the state of a thread
*/
/*
* Flavors
*/
#define ARM_THREAD_STATE1
#define ARM_VFP_STATE2
#define ARM_EXCEPTION_STATE3
#define ARM_DEBUG_STATE 4
#define THREAD_STATE_NONE 5
#define VALID_THREAD_STATE_FLAVOR(x) \
((x == ARM_THREAD_STATE) || \
(x == ARM_VFP_STATE) || \
(x == ARM_EXCEPTION_STATE) || \
(x == ARM_DEBUG_STATE) || \
(x == THREAD_STATE_NONE ))
typedef _STRUCT_ARM_THREAD_STATEarm_thread_state_t;
typedef _STRUCT_ARM_VFP_STATEarm_vfp_state_t;
typedef _STRUCT_ARM_EXCEPTION_STATEarm_exception_state_t;
typedef _STRUCT_ARM_DEBUG_STATE arm_debug_state_t;
#define ARM_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state_t)/sizeof(uint32_t)))
#define ARM_VFP_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_vfp_state_t)/sizeof(uint32_t)))
#define ARM_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_exception_state_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state_t)/sizeof(uint32_t)))
#define MACHINE_THREAD_STATE ARM_THREAD_STATE
#define MACHINE_THREAD_STATE_COUNT ARM_THREAD_STATE_COUNT
/*
* Largest state on this machine:
*/
#define THREAD_MACHINE_STATE_MAXTHREAD_STATE_MAX
#endif /* _ARM_THREAD_STATUS_H_ */
branches/xZenu/src/include/mach/arm/exception.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (c) 2007 Apple Inc. All rights reserved.
*/
#ifndef_MACH_ARM_EXCEPTION_H_
#define _MACH_ARM_EXCEPTION_H_
#define EXC_TYPES_COUNT 11 /* incl. illegal exception 0 */
#define EXC_MASK_MACHINE 0
#define EXCEPTION_CODE_MAX 2 /* code and subcode */
/*
*Trap numbers as defined by the hardware exception vectors.
*/
/*
* EXC_BAD_INSTRUCTION
*/
#define EXC_ARM_UNDEFINED1/* Undefined */
/*
* EXC_BAD_ACCESS
* Note: do not conflict with kern_return_t values returned by vm_fault
*/
#define EXC_ARM_DA_ALIGN0x101/* Alignment Fault */
#define EXC_ARM_DA_DEBUG0x102/* Debug (watch/break) Fault */
/*
*EXC_BREAKPOINT
*/
#define EXC_ARM_BREAKPOINT1/* breakpoint trap */
#endif/* _MACH_ARM_EXCEPTION_H_ */
branches/xZenu/src/include/mach/arm/kern_return.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
*File:kern_return.h
*Author:Avadis Tevanian, Jr., Michael Wayne Young
*Date:1985
*
*Machine-dependent kernel return definitions.
*/
#ifndef_MACH_ARM_KERN_RETURN_H_
#define _MACH_ARM_KERN_RETURN_H_
#ifndefASSEMBLER
typedefintkern_return_t;
#endif/* ASSEMBLER */
#endif/* _MACH_ARM_KERN_RETURN_H_ */
branches/xZenu/src/include/mach/arm/thread_act.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
#ifndef_thread_act_user_
#define_thread_act_user_
/* Module thread_act */
#include <string.h>
#include <mach/ndr.h>
#include <mach/boolean.h>
#include <mach/kern_return.h>
#include <mach/notify.h>
#include <mach/mach_types.h>
#include <mach/message.h>
#include <mach/mig_errors.h>
#include <mach/port.h>
#ifdef AUTOTEST
#ifndef FUNCTION_PTR_T
#define FUNCTION_PTR_T
typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
typedef struct {
char *name;
function_ptr_t function;
} function_table_entry;
typedef function_table_entry *function_table_t;
#endif /* FUNCTION_PTR_T */
#endif /* AUTOTEST */
#ifndefthread_act_MSG_COUNT
#definethread_act_MSG_COUNT25
#endif/* thread_act_MSG_COUNT */
#include <mach/std_types.h>
#include <mach/mig.h>
#include <mach/mig.h>
#include <mach/mach_types.h>
#ifdef __BeforeMigUserHeader
__BeforeMigUserHeader
#endif /* __BeforeMigUserHeader */
#include <sys/cdefs.h>
__BEGIN_DECLS
/* Routine thread_terminate */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_terminate
(
thread_act_t target_act
);
/* Routine act_get_state */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t act_get_state
(
thread_act_t target_act,
int flavor,
thread_state_t old_state,
mach_msg_type_number_t *old_stateCnt
);
/* Routine act_set_state */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t act_set_state
(
thread_act_t target_act,
int flavor,
thread_state_t new_state,
mach_msg_type_number_t new_stateCnt
);
/* Routine thread_get_state */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_get_state
(
thread_act_t target_act,
thread_state_flavor_t flavor,
thread_state_t old_state,
mach_msg_type_number_t *old_stateCnt
);
/* Routine thread_set_state */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_set_state
(
thread_act_t target_act,
thread_state_flavor_t flavor,
thread_state_t new_state,
mach_msg_type_number_t new_stateCnt
);
/* Routine thread_suspend */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_suspend
(
thread_act_t target_act
);
/* Routine thread_resume */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_resume
(
thread_act_t target_act
);
/* Routine thread_abort */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_abort
(
thread_act_t target_act
);
/* Routine thread_abort_safely */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_abort_safely
(
thread_act_t target_act
);
/* Routine thread_depress_abort */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_depress_abort
(
thread_act_t thread
);
/* Routine thread_get_special_port */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_get_special_port
(
thread_act_t thr_act,
int which_port,
mach_port_t *special_port
);
/* Routine thread_set_special_port */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_set_special_port
(
thread_act_t thr_act,
int which_port,
mach_port_t special_port
);
/* Routine thread_info */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_info
(
thread_act_t target_act,
thread_flavor_t flavor,
thread_info_t thread_info_out,
mach_msg_type_number_t *thread_info_outCnt
);
/* Routine thread_set_exception_ports */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_set_exception_ports
(
thread_act_t thread,
exception_mask_t exception_mask,
mach_port_t new_port,
exception_behavior_t behavior,
thread_state_flavor_t new_flavor
);
/* Routine thread_get_exception_ports */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_get_exception_ports
(
thread_act_t thread,
exception_mask_t exception_mask,
exception_mask_array_t masks,
mach_msg_type_number_t *masksCnt,
exception_handler_array_t old_handlers,
exception_behavior_array_t old_behaviors,
exception_flavor_array_t old_flavors
);
/* Routine thread_swap_exception_ports */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_swap_exception_ports
(
thread_act_t thread,
exception_mask_t exception_mask,
mach_port_t new_port,
exception_behavior_t behavior,
thread_state_flavor_t new_flavor,
exception_mask_array_t masks,
mach_msg_type_number_t *masksCnt,
exception_handler_array_t old_handlers,
exception_behavior_array_t old_behaviors,
exception_flavor_array_t old_flavors
);
/* Routine thread_policy */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_policy
(
thread_act_t thr_act,
policy_t policy,
policy_base_t base,
mach_msg_type_number_t baseCnt,
boolean_t set_limit
);
/* Routine thread_policy_set */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_policy_set
(
thread_act_t thread,
thread_policy_flavor_t flavor,
thread_policy_t policy_info,
mach_msg_type_number_t policy_infoCnt
);
/* Routine thread_policy_get */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_policy_get
(
thread_act_t thread,
thread_policy_flavor_t flavor,
thread_policy_t policy_info,
mach_msg_type_number_t *policy_infoCnt,
boolean_t *get_default
);
/* Routine thread_sample */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_sample
(
thread_act_t thread,
mach_port_t reply
);
/* Routine etap_trace_thread */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t etap_trace_thread
(
thread_act_t target_act,
boolean_t trace_status
);
/* Routine thread_assign */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_assign
(
thread_act_t thread,
processor_set_t new_set
);
/* Routine thread_assign_default */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_assign_default
(
thread_act_t thread
);
/* Routine thread_get_assignment */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_get_assignment
(
thread_act_t thread,
processor_set_name_t *assigned_set
);
/* Routine thread_set_policy */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_set_policy
(
thread_act_t thr_act,
processor_set_t pset,
policy_t policy,
policy_base_t base,
mach_msg_type_number_t baseCnt,
policy_limit_t limit,
mach_msg_type_number_t limitCnt
);
__END_DECLS
/********************** Caution **************************/
/* The following data types should be used to calculate */
/* maximum message sizes only. The actual message may be */
/* smaller, and the position of the arguments within the */
/* message layout may vary from what is presented here. */
/* For example, if any of the arguments are variable- */
/* sized, and less than the maximum is sent, the data */
/* will be packed tight in the actual message to reduce */
/* the presence of holes. */
/********************** Caution **************************/
/* typedefs for all requests */
#ifndef __Request__thread_act_subsystem__defined
#define __Request__thread_act_subsystem__defined
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_terminate_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
int flavor;
mach_msg_type_number_t old_stateCnt;
} __Request__act_get_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
int flavor;
mach_msg_type_number_t new_stateCnt;
natural_t new_state[144];
} __Request__act_set_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_state_flavor_t flavor;
mach_msg_type_number_t old_stateCnt;
} __Request__thread_get_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_state_flavor_t flavor;
mach_msg_type_number_t new_stateCnt;
natural_t new_state[144];
} __Request__thread_set_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_suspend_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_resume_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_abort_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_abort_safely_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_depress_abort_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
int which_port;
} __Request__thread_get_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t special_port;
/* end of the kernel processed data */
NDR_record_t NDR;
int which_port;
} __Request__thread_set_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_flavor_t flavor;
mach_msg_type_number_t thread_info_outCnt;
} __Request__thread_info_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_port;
/* end of the kernel processed data */
NDR_record_t NDR;
exception_mask_t exception_mask;
exception_behavior_t behavior;
thread_state_flavor_t new_flavor;
} __Request__thread_set_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
exception_mask_t exception_mask;
} __Request__thread_get_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_port;
/* end of the kernel processed data */
NDR_record_t NDR;
exception_mask_t exception_mask;
exception_behavior_t behavior;
thread_state_flavor_t new_flavor;
} __Request__thread_swap_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
policy_t policy;
mach_msg_type_number_t baseCnt;
integer_t base[5];
boolean_t set_limit;
} __Request__thread_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_policy_flavor_t flavor;
mach_msg_type_number_t policy_infoCnt;
integer_t policy_info[16];
} __Request__thread_policy_set_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_policy_flavor_t flavor;
mach_msg_type_number_t policy_infoCnt;
boolean_t get_default;
} __Request__thread_policy_get_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t reply;
/* end of the kernel processed data */
} __Request__thread_sample_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
boolean_t trace_status;
} __Request__etap_trace_thread_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_set;
/* end of the kernel processed data */
} __Request__thread_assign_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_assign_default_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_get_assignment_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t pset;
/* end of the kernel processed data */
NDR_record_t NDR;
policy_t policy;
mach_msg_type_number_t baseCnt;
integer_t base[5];
mach_msg_type_number_t limitCnt;
integer_t limit[1];
} __Request__thread_set_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#endif /* !__Request__thread_act_subsystem__defined */
/* union of all requests */
#ifndef __RequestUnion__thread_act_subsystem__defined
#define __RequestUnion__thread_act_subsystem__defined
union __RequestUnion__thread_act_subsystem {
__Request__thread_terminate_t Request_thread_terminate;
__Request__act_get_state_t Request_act_get_state;
__Request__act_set_state_t Request_act_set_state;
__Request__thread_get_state_t Request_thread_get_state;
__Request__thread_set_state_t Request_thread_set_state;
__Request__thread_suspend_t Request_thread_suspend;
__Request__thread_resume_t Request_thread_resume;
__Request__thread_abort_t Request_thread_abort;
__Request__thread_abort_safely_t Request_thread_abort_safely;
__Request__thread_depress_abort_t Request_thread_depress_abort;
__Request__thread_get_special_port_t Request_thread_get_special_port;
__Request__thread_set_special_port_t Request_thread_set_special_port;
__Request__thread_info_t Request_thread_info;
__Request__thread_set_exception_ports_t Request_thread_set_exception_ports;
__Request__thread_get_exception_ports_t Request_thread_get_exception_ports;
__Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports;
__Request__thread_policy_t Request_thread_policy;
__Request__thread_policy_set_t Request_thread_policy_set;
__Request__thread_policy_get_t Request_thread_policy_get;
__Request__thread_sample_t Request_thread_sample;
__Request__etap_trace_thread_t Request_etap_trace_thread;
__Request__thread_assign_t Request_thread_assign;
__Request__thread_assign_default_t Request_thread_assign_default;
__Request__thread_get_assignment_t Request_thread_get_assignment;
__Request__thread_set_policy_t Request_thread_set_policy;
};
#endif /* !__RequestUnion__thread_act_subsystem__defined */
/* typedefs for all replies */
#ifndef __Reply__thread_act_subsystem__defined
#define __Reply__thread_act_subsystem__defined
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_terminate_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t old_stateCnt;
natural_t old_state[144];
} __Reply__act_get_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__act_set_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t old_stateCnt;
natural_t old_state[144];
} __Reply__thread_get_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_set_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_suspend_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_resume_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_abort_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_abort_safely_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_depress_abort_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t special_port;
/* end of the kernel processed data */
} __Reply__thread_get_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_set_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t thread_info_outCnt;
integer_t thread_info_out[12];
} __Reply__thread_info_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_set_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t old_handlers[32];
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t masksCnt;
exception_mask_t masks[32];
exception_behavior_t old_behaviors[32];
thread_state_flavor_t old_flavors[32];
} __Reply__thread_get_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t old_handlers[32];
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t masksCnt;
exception_mask_t masks[32];
exception_behavior_t old_behaviors[32];
thread_state_flavor_t old_flavors[32];
} __Reply__thread_swap_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_policy_set_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t policy_infoCnt;
integer_t policy_info[16];
boolean_t get_default;
} __Reply__thread_policy_get_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_sample_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__etap_trace_thread_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_assign_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_assign_default_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t assigned_set;
/* end of the kernel processed data */
} __Reply__thread_get_assignment_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__thread_set_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#endif /* !__Reply__thread_act_subsystem__defined */
/* union of all replies */
#ifndef __ReplyUnion__thread_act_subsystem__defined
#define __ReplyUnion__thread_act_subsystem__defined
union __ReplyUnion__thread_act_subsystem {
__Reply__thread_terminate_t Reply_thread_terminate;
__Reply__act_get_state_t Reply_act_get_state;
__Reply__act_set_state_t Reply_act_set_state;
__Reply__thread_get_state_t Reply_thread_get_state;
__Reply__thread_set_state_t Reply_thread_set_state;
__Reply__thread_suspend_t Reply_thread_suspend;
__Reply__thread_resume_t Reply_thread_resume;
__Reply__thread_abort_t Reply_thread_abort;
__Reply__thread_abort_safely_t Reply_thread_abort_safely;
__Reply__thread_depress_abort_t Reply_thread_depress_abort;
__Reply__thread_get_special_port_t Reply_thread_get_special_port;
__Reply__thread_set_special_port_t Reply_thread_set_special_port;
__Reply__thread_info_t Reply_thread_info;
__Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports;
__Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports;
__Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports;
__Reply__thread_policy_t Reply_thread_policy;
__Reply__thread_policy_set_t Reply_thread_policy_set;
__Reply__thread_policy_get_t Reply_thread_policy_get;
__Reply__thread_sample_t Reply_thread_sample;
__Reply__etap_trace_thread_t Reply_etap_trace_thread;
__Reply__thread_assign_t Reply_thread_assign;
__Reply__thread_assign_default_t Reply_thread_assign_default;
__Reply__thread_get_assignment_t Reply_thread_get_assignment;
__Reply__thread_set_policy_t Reply_thread_set_policy;
};
#endif /* !__RequestUnion__thread_act_subsystem__defined */
#ifndef subsystem_to_name_map_thread_act
#define subsystem_to_name_map_thread_act \
{ "thread_terminate", 3600 },\
{ "act_get_state", 3601 },\
{ "act_set_state", 3602 },\
{ "thread_get_state", 3603 },\
{ "thread_set_state", 3604 },\
{ "thread_suspend", 3605 },\
{ "thread_resume", 3606 },\
{ "thread_abort", 3607 },\
{ "thread_abort_safely", 3608 },\
{ "thread_depress_abort", 3609 },\
{ "thread_get_special_port", 3610 },\
{ "thread_set_special_port", 3611 },\
{ "thread_info", 3612 },\
{ "thread_set_exception_ports", 3613 },\
{ "thread_get_exception_ports", 3614 },\
{ "thread_swap_exception_ports", 3615 },\
{ "thread_policy", 3616 },\
{ "thread_policy_set", 3617 },\
{ "thread_policy_get", 3618 },\
{ "thread_sample", 3619 },\
{ "etap_trace_thread", 3620 },\
{ "thread_assign", 3621 },\
{ "thread_assign_default", 3622 },\
{ "thread_get_assignment", 3623 },\
{ "thread_set_policy", 3624 }
#endif
#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
#endif /* _thread_act_user_ */
branches/xZenu/src/include/mach/arm/boolean.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
*File:boolean.h
*
*Boolean type, for ARM.
*/
#ifndef_MACH_ARM_BOOLEAN_H_
#define _MACH_ARM_BOOLEAN_H_
typedef intboolean_t;
#endif/* _MACH_ARM_BOOLEAN_H_ */
branches/xZenu/src/include/mach/arm/asm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*
* Copyright (c) 2007 Apple Inc. All rights reserved.
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
#ifndef_ARM_ASM_H_
#define_ARM_ASM_H_
#include <arm/arch.h>
#ifdef _KERNEL
#include <gprof.h>
#endif/* _KERNEL */
#ifdef MACH_KERNEL
#include <mach_kdb.h>
#else/* !MACH_KERNEL */
#defineMACH_KDB 0
#endif/* !MACH_KERNEL */
#ifdefined(MACH_KERNEL) || defined(_KERNEL)
#include <gprof.h>
#endif/* MACH_KERNEL || _KERNEL */
#define FRAMEpushl %ebp; movl %esp, %ebp
#define EMARFleave
/* There is another definition of ALIGN for .c sources */
#ifdef ASSEMBLER
#define ALIGN 4
#endif /* ASSEMBLER */
#ifndef FALIGN
#define FALIGN ALIGN
#endif
#define LB(x,n) n
#if__STDC__
#ifndef __NO_UNDERSCORES__
#defineLCL(x)L ## x
#define EXT(x) _ ## x
#define LEXT(x) _ ## x ## :
#else
#defineLCL(x).L ## x
#define EXT(x) x
#define LEXT(x) x ## :
#endif
#define LBc(x,n) n ## :
#define LBb(x,n) n ## b
#define LBf(x,n) n ## f
#else /* __STDC__ */
#ifndef __NO_UNDERSCORES__
#define LCL(x) L/**/x
#define EXT(x) _/**/x
#define LEXT(x) _/**/x/**/:
#else /* __NO_UNDERSCORES__ */
#defineLCL(x).L/**/x
#define EXT(x) x
#define LEXT(x) x/**/:
#endif /* __NO_UNDERSCORES__ */
#define LBc(x,n) n/**/:
#define LBb(x,n) n/**/b
#define LBf(x,n) n/**/f
#endif /* __STDC__ */
#define String.asciz
#define Value.word
#define Times(a,b) (a*b)
#define Divide(a,b) (a/b)
#if 0 /* TOTOJK */
#ifdef __ELF__
#define ELF_FUNC(x).type x,@function
#define ELF_DATA(x).type x,@object
#define ELF_SIZE(x,s).size x,s
#else
#define ELF_FUNC(x)
#define ELF_DATA(x)
#define ELF_SIZE(x,s)
#endif
#else
#define ELF_FUNC(x)
#define ELF_DATA(x)
#define ELF_SIZE(x,s)
#endif /* TODOJK */
#defineEntry(x).globl EXT(x); ELF_FUNC(EXT(x)); .align FALIGN; LEXT(x)
#defineENTRY(x)Entry(x) MCOUNT
#defineENTRY2(x,y).globl EXT(x); .globl EXT(y); \
ELF_FUNC(EXT(x)); ELF_FUNC(EXT(y)); \
.align FALIGN; LEXT(x); LEXT(y) \
MCOUNT
#if __STDC__
#defineASENTRY(x) .globl x; .align FALIGN; x ## : ELF_FUNC(x) MCOUNT
#else
#defineASENTRY(x) .globl x; .align FALIGN; x: ELF_FUNC(x) MCOUNT
#endif /* __STDC__ */
#defineDATA(x).globl EXT(x); ELF_DATA(EXT(x)); .align ALIGN; LEXT(x)
#define End(x)ELF_SIZE(x,.-x)
#define END(x)End(EXT(x))
#define ENDDATA(x)END(x)
#define Enddata(x)End(x)
#ifdef ASSEMBLER
#ifMACH_KDB
#include <ddb/stab.h>
/*
* This pseudo-assembler line is added so that there will be at least
*one N_SO entry in the symbol stable to define the current file name.
*/
#endif/* MACH_KDB */
#define MCOUNT
#else /* NOT ASSEMBLER */
/* These defines are here for .c files that wish to reference global symbols
* within __asm__ statements.
*/
#ifndef __NO_UNDERSCORES__
#define CC_SYM_PREFIX "_"
#else
#define CC_SYM_PREFIX ""
#endif /* __NO_UNDERSCORES__ */
#endif /* ASSEMBLER */
#ifdef ASSEMBLER
#if defined (_ARM_ARCH_4T)
# define RET bx lr
# define RETeq bxeq lr
# define RETne bxne lr
# ifdef __STDC__
# define RETc(c) bx##c lr
# else
# define RETc(c) bx/**/c lr
# endif
#else
# define RET mov pc, lr
# define RETeq moveq pc, lr
# define RETne movne pc, lr
# ifdef __STDC__
# define RETc(c) mov##c pc, lr
# else
# define RETc(c) mov/**/c pc, lr
# endif
#endif
#if defined (__thumb__)
# define BRANCH_EXTERN(x)ldrpc, [pc, #-4] ;\
.longEXT(x)
#else
# define BRANCH_EXTERN(x)bEXT(x)
#endif
#endif /* ASSEMBLER */
#endif /* _ARM_ASM_H_ */
branches/xZenu/src/include/mach/arm/ndr_def.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* @OSF_COPYRIGHT@
*/
/* NDR record for Intel x86s */
#include <mach/ndr.h>
NDR_record_t NDR_record = {
0,/* mig_reserved */
0,/* mig_reserved */
0,/* mig_reserved */
NDR_PROTOCOL_2_0,
NDR_INT_LITTLE_ENDIAN,
NDR_CHAR_ASCII,
NDR_FLOAT_IEEE,
0,
};
branches/xZenu/src/include/mach/arm/task.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
#ifndef_task_user_
#define_task_user_
/* Module task */
#include <string.h>
#include <mach/ndr.h>
#include <mach/boolean.h>
#include <mach/kern_return.h>
#include <mach/notify.h>
#include <mach/mach_types.h>
#include <mach/message.h>
#include <mach/mig_errors.h>
#include <mach/port.h>
#ifdef AUTOTEST
#ifndef FUNCTION_PTR_T
#define FUNCTION_PTR_T
typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
typedef struct {
char *name;
function_ptr_t function;
} function_table_entry;
typedef function_table_entry *function_table_t;
#endif /* FUNCTION_PTR_T */
#endif /* AUTOTEST */
#ifndeftask_MSG_COUNT
#definetask_MSG_COUNT35
#endif/* task_MSG_COUNT */
#include <mach/std_types.h>
#include <mach/mig.h>
#include <mach/mig.h>
#include <mach/mach_types.h>
#ifdef __BeforeMigUserHeader
__BeforeMigUserHeader
#endif /* __BeforeMigUserHeader */
#include <sys/cdefs.h>
__BEGIN_DECLS
/* Routine task_create */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_create
(
task_t target_task,
ledger_array_t ledgers,
mach_msg_type_number_t ledgersCnt,
boolean_t inherit_memory,
task_t *child_task
);
/* Routine task_terminate */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_terminate
(
task_t target_task
);
/* Routine task_threads */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_threads
(
task_t target_task,
thread_act_array_t *act_list,
mach_msg_type_number_t *act_listCnt
);
/* Routine mach_ports_register */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t mach_ports_register
(
task_t target_task,
mach_port_array_t init_port_set,
mach_msg_type_number_t init_port_setCnt
);
/* Routine mach_ports_lookup */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t mach_ports_lookup
(
task_t target_task,
mach_port_array_t *init_port_set,
mach_msg_type_number_t *init_port_setCnt
);
/* Routine task_info */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_info
(
task_name_t target_task,
task_flavor_t flavor,
task_info_t task_info_out,
mach_msg_type_number_t *task_info_outCnt
);
/* Routine task_set_info */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_info
(
task_t target_task,
task_flavor_t flavor,
task_info_t task_info_in,
mach_msg_type_number_t task_info_inCnt
);
/* Routine task_suspend */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_suspend
(
task_t target_task
);
/* Routine task_resume */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_resume
(
task_t target_task
);
/* Routine task_get_special_port */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_get_special_port
(
task_t task,
int which_port,
mach_port_t *special_port
);
/* Routine task_set_special_port */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_special_port
(
task_t task,
int which_port,
mach_port_t special_port
);
/* Routine thread_create */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_create
(
task_t parent_task,
thread_act_t *child_act
);
/* Routine thread_create_running */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t thread_create_running
(
task_t parent_task,
thread_state_flavor_t flavor,
thread_state_t new_state,
mach_msg_type_number_t new_stateCnt,
thread_act_t *child_act
);
/* Routine task_set_exception_ports */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_exception_ports
(
task_t task,
exception_mask_t exception_mask,
mach_port_t new_port,
exception_behavior_t behavior,
thread_state_flavor_t new_flavor
);
/* Routine task_get_exception_ports */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_get_exception_ports
(
task_t task,
exception_mask_t exception_mask,
exception_mask_array_t masks,
mach_msg_type_number_t *masksCnt,
exception_handler_array_t old_handlers,
exception_behavior_array_t old_behaviors,
exception_flavor_array_t old_flavors
);
/* Routine task_swap_exception_ports */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_swap_exception_ports
(
task_t task,
exception_mask_t exception_mask,
mach_port_t new_port,
exception_behavior_t behavior,
thread_state_flavor_t new_flavor,
exception_mask_array_t masks,
mach_msg_type_number_t *masksCnt,
exception_handler_array_t old_handlerss,
exception_behavior_array_t old_behaviors,
exception_flavor_array_t old_flavors
);
/* Routine lock_set_create */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t lock_set_create
(
task_t task,
lock_set_t *new_lock_set,
int n_ulocks,
int policy
);
/* Routine lock_set_destroy */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t lock_set_destroy
(
task_t task,
lock_set_t lock_set
);
/* Routine semaphore_create */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t semaphore_create
(
task_t task,
semaphore_t *semaphore,
int policy,
int value
);
/* Routine semaphore_destroy */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t semaphore_destroy
(
task_t task,
semaphore_t semaphore
);
/* Routine task_policy_set */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_policy_set
(
task_t task,
task_policy_flavor_t flavor,
task_policy_t policy_info,
mach_msg_type_number_t policy_infoCnt
);
/* Routine task_policy_get */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_policy_get
(
task_t task,
task_policy_flavor_t flavor,
task_policy_t policy_info,
mach_msg_type_number_t *policy_infoCnt,
boolean_t *get_default
);
/* Routine task_sample */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_sample
(
task_t task,
mach_port_t reply
);
/* Routine task_policy */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_policy
(
task_t task,
policy_t policy,
policy_base_t base,
mach_msg_type_number_t baseCnt,
boolean_t set_limit,
boolean_t change
);
/* Routine task_set_emulation */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_emulation
(
task_t target_port,
vm_address_t routine_entry_pt,
int routine_number
);
/* Routine task_get_emulation_vector */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_get_emulation_vector
(
task_t task,
int *vector_start,
emulation_vector_t *emulation_vector,
mach_msg_type_number_t *emulation_vectorCnt
);
/* Routine task_set_emulation_vector */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_emulation_vector
(
task_t task,
int vector_start,
emulation_vector_t emulation_vector,
mach_msg_type_number_t emulation_vectorCnt
);
/* Routine task_set_ras_pc */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_ras_pc
(
task_t target_task,
vm_address_t basepc,
vm_address_t boundspc
);
/* Routine task_assign */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_assign
(
task_t task,
processor_set_t new_set,
boolean_t assign_threads
);
/* Routine task_assign_default */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_assign_default
(
task_t task,
boolean_t assign_threads
);
/* Routine task_get_assignment */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_get_assignment
(
task_t task,
processor_set_name_t *assigned_set
);
/* Routine task_set_policy */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_policy
(
task_t task,
processor_set_t pset,
policy_t policy,
policy_base_t base,
mach_msg_type_number_t baseCnt,
policy_limit_t limit,
mach_msg_type_number_t limitCnt,
boolean_t change
);
/* Routine task_get_state */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_get_state
(
task_t task,
thread_state_flavor_t flavor,
thread_state_t old_state,
mach_msg_type_number_t *old_stateCnt
);
/* Routine task_set_state */
#ifdefmig_external
mig_external
#else
extern
#endif/* mig_external */
kern_return_t task_set_state
(
task_t task,
thread_state_flavor_t flavor,
thread_state_t new_state,
mach_msg_type_number_t new_stateCnt
);
__END_DECLS
/********************** Caution **************************/
/* The following data types should be used to calculate */
/* maximum message sizes only. The actual message may be */
/* smaller, and the position of the arguments within the */
/* message layout may vary from what is presented here. */
/* For example, if any of the arguments are variable- */
/* sized, and less than the maximum is sent, the data */
/* will be packed tight in the actual message to reduce */
/* the presence of holes. */
/********************** Caution **************************/
/* typedefs for all requests */
#ifndef __Request__task_subsystem__defined
#define __Request__task_subsystem__defined
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_ool_ports_descriptor_t ledgers;
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t ledgersCnt;
boolean_t inherit_memory;
} __Request__task_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__task_terminate_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__task_threads_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_ool_ports_descriptor_t init_port_set;
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t init_port_setCnt;
} __Request__mach_ports_register_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__mach_ports_lookup_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
task_flavor_t flavor;
mach_msg_type_number_t task_info_outCnt;
} __Request__task_info_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
task_flavor_t flavor;
mach_msg_type_number_t task_info_inCnt;
integer_t task_info_in[10];
} __Request__task_set_info_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__task_suspend_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__task_resume_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
int which_port;
} __Request__task_get_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t special_port;
/* end of the kernel processed data */
NDR_record_t NDR;
int which_port;
} __Request__task_set_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__thread_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_state_flavor_t flavor;
mach_msg_type_number_t new_stateCnt;
natural_t new_state[144];
} __Request__thread_create_running_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_port;
/* end of the kernel processed data */
NDR_record_t NDR;
exception_mask_t exception_mask;
exception_behavior_t behavior;
thread_state_flavor_t new_flavor;
} __Request__task_set_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
exception_mask_t exception_mask;
} __Request__task_get_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_port;
/* end of the kernel processed data */
NDR_record_t NDR;
exception_mask_t exception_mask;
exception_behavior_t behavior;
thread_state_flavor_t new_flavor;
} __Request__task_swap_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
int n_ulocks;
int policy;
} __Request__lock_set_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t lock_set;
/* end of the kernel processed data */
} __Request__lock_set_destroy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
int policy;
int value;
} __Request__semaphore_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t semaphore;
/* end of the kernel processed data */
} __Request__semaphore_destroy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
task_policy_flavor_t flavor;
mach_msg_type_number_t policy_infoCnt;
integer_t policy_info[16];
} __Request__task_policy_set_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
task_policy_flavor_t flavor;
mach_msg_type_number_t policy_infoCnt;
boolean_t get_default;
} __Request__task_policy_get_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t reply;
/* end of the kernel processed data */
} __Request__task_sample_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
policy_t policy;
mach_msg_type_number_t baseCnt;
integer_t base[5];
boolean_t set_limit;
boolean_t change;
} __Request__task_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
vm_address_t routine_entry_pt;
int routine_number;
} __Request__task_set_emulation_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__task_get_emulation_vector_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_ool_descriptor_t emulation_vector;
/* end of the kernel processed data */
NDR_record_t NDR;
int vector_start;
mach_msg_type_number_t emulation_vectorCnt;
} __Request__task_set_emulation_vector_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
vm_address_t basepc;
vm_address_t boundspc;
} __Request__task_set_ras_pc_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_set;
/* end of the kernel processed data */
NDR_record_t NDR;
boolean_t assign_threads;
} __Request__task_assign_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
boolean_t assign_threads;
} __Request__task_assign_default_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
} __Request__task_get_assignment_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t pset;
/* end of the kernel processed data */
NDR_record_t NDR;
policy_t policy;
mach_msg_type_number_t baseCnt;
integer_t base[5];
mach_msg_type_number_t limitCnt;
integer_t limit[1];
boolean_t change;
} __Request__task_set_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_state_flavor_t flavor;
mach_msg_type_number_t old_stateCnt;
} __Request__task_get_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
thread_state_flavor_t flavor;
mach_msg_type_number_t new_stateCnt;
natural_t new_state[144];
} __Request__task_set_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#endif /* !__Request__task_subsystem__defined */
/* union of all requests */
#ifndef __RequestUnion__task_subsystem__defined
#define __RequestUnion__task_subsystem__defined
union __RequestUnion__task_subsystem {
__Request__task_create_t Request_task_create;
__Request__task_terminate_t Request_task_terminate;
__Request__task_threads_t Request_task_threads;
__Request__mach_ports_register_t Request_mach_ports_register;
__Request__mach_ports_lookup_t Request_mach_ports_lookup;
__Request__task_info_t Request_task_info;
__Request__task_set_info_t Request_task_set_info;
__Request__task_suspend_t Request_task_suspend;
__Request__task_resume_t Request_task_resume;
__Request__task_get_special_port_t Request_task_get_special_port;
__Request__task_set_special_port_t Request_task_set_special_port;
__Request__thread_create_t Request_thread_create;
__Request__thread_create_running_t Request_thread_create_running;
__Request__task_set_exception_ports_t Request_task_set_exception_ports;
__Request__task_get_exception_ports_t Request_task_get_exception_ports;
__Request__task_swap_exception_ports_t Request_task_swap_exception_ports;
__Request__lock_set_create_t Request_lock_set_create;
__Request__lock_set_destroy_t Request_lock_set_destroy;
__Request__semaphore_create_t Request_semaphore_create;
__Request__semaphore_destroy_t Request_semaphore_destroy;
__Request__task_policy_set_t Request_task_policy_set;
__Request__task_policy_get_t Request_task_policy_get;
__Request__task_sample_t Request_task_sample;
__Request__task_policy_t Request_task_policy;
__Request__task_set_emulation_t Request_task_set_emulation;
__Request__task_get_emulation_vector_t Request_task_get_emulation_vector;
__Request__task_set_emulation_vector_t Request_task_set_emulation_vector;
__Request__task_set_ras_pc_t Request_task_set_ras_pc;
__Request__task_assign_t Request_task_assign;
__Request__task_assign_default_t Request_task_assign_default;
__Request__task_get_assignment_t Request_task_get_assignment;
__Request__task_set_policy_t Request_task_set_policy;
__Request__task_get_state_t Request_task_get_state;
__Request__task_set_state_t Request_task_set_state;
};
#endif /* !__RequestUnion__task_subsystem__defined */
/* typedefs for all replies */
#ifndef __Reply__task_subsystem__defined
#define __Reply__task_subsystem__defined
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t child_task;
/* end of the kernel processed data */
} __Reply__task_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_terminate_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_ool_ports_descriptor_t act_list;
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t act_listCnt;
} __Reply__task_threads_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__mach_ports_register_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_ool_ports_descriptor_t init_port_set;
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t init_port_setCnt;
} __Reply__mach_ports_lookup_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t task_info_outCnt;
integer_t task_info_out[10];
} __Reply__task_info_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_info_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_suspend_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_resume_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t special_port;
/* end of the kernel processed data */
} __Reply__task_get_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_special_port_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t child_act;
/* end of the kernel processed data */
} __Reply__thread_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t child_act;
/* end of the kernel processed data */
} __Reply__thread_create_running_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t old_handlers[32];
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t masksCnt;
exception_mask_t masks[32];
exception_behavior_t old_behaviors[32];
thread_state_flavor_t old_flavors[32];
} __Reply__task_get_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t old_handlerss[32];
/* end of the kernel processed data */
NDR_record_t NDR;
mach_msg_type_number_t masksCnt;
exception_mask_t masks[32];
exception_behavior_t old_behaviors[32];
thread_state_flavor_t old_flavors[32];
} __Reply__task_swap_exception_ports_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t new_lock_set;
/* end of the kernel processed data */
} __Reply__lock_set_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__lock_set_destroy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t semaphore;
/* end of the kernel processed data */
} __Reply__semaphore_create_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__semaphore_destroy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_policy_set_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t policy_infoCnt;
integer_t policy_info[16];
boolean_t get_default;
} __Reply__task_policy_get_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_sample_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_emulation_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_ool_descriptor_t emulation_vector;
/* end of the kernel processed data */
NDR_record_t NDR;
int vector_start;
mach_msg_type_number_t emulation_vectorCnt;
} __Reply__task_get_emulation_vector_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_emulation_vector_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_ras_pc_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_assign_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_assign_default_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
/* start of the kernel processed data */
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t assigned_set;
/* end of the kernel processed data */
} __Reply__task_get_assignment_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_policy_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t old_stateCnt;
natural_t old_state[144];
} __Reply__task_get_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
NDR_record_t NDR;
kern_return_t RetCode;
} __Reply__task_set_state_t;
#ifdef __MigPackStructs
#pragma pack()
#endif
#endif /* !__Reply__task_subsystem__defined */
/* union of all replies */
#ifndef __ReplyUnion__task_subsystem__defined
#define __ReplyUnion__task_subsystem__defined
union __ReplyUnion__task_subsystem {
__Reply__task_create_t Reply_task_create;
__Reply__task_terminate_t Reply_task_terminate;
__Reply__task_threads_t Reply_task_threads;
__Reply__mach_ports_register_t Reply_mach_ports_register;
__Reply__mach_ports_lookup_t Reply_mach_ports_lookup;
__Reply__task_info_t Reply_task_info;
__Reply__task_set_info_t Reply_task_set_info;
__Reply__task_suspend_t Reply_task_suspend;
__Reply__task_resume_t Reply_task_resume;
__Reply__task_get_special_port_t Reply_task_get_special_port;
__Reply__task_set_special_port_t Reply_task_set_special_port;
__Reply__thread_create_t Reply_thread_create;
__Reply__thread_create_running_t Reply_thread_create_running;
__Reply__task_set_exception_ports_t Reply_task_set_exception_ports;
__Reply__task_get_exception_ports_t Reply_task_get_exception_ports;
__Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports;
__Reply__lock_set_create_t Reply_lock_set_create;
__Reply__lock_set_destroy_t Reply_lock_set_destroy;
__Reply__semaphore_create_t Reply_semaphore_create;
__Reply__semaphore_destroy_t Reply_semaphore_destroy;
__Reply__task_policy_set_t Reply_task_policy_set;
__Reply__task_policy_get_t Reply_task_policy_get;
__Reply__task_sample_t Reply_task_sample;
__Reply__task_policy_t Reply_task_policy;
__Reply__task_set_emulation_t Reply_task_set_emulation;
__Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector;
__Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector;
__Reply__task_set_ras_pc_t Reply_task_set_ras_pc;
__Reply__task_assign_t Reply_task_assign;
__Reply__task_assign_default_t Reply_task_assign_default;
__Reply__task_get_assignment_t Reply_task_get_assignment;
__Reply__task_set_policy_t Reply_task_set_policy;
__Reply__task_get_state_t Reply_task_get_state;
__Reply__task_set_state_t Reply_task_set_state;
};
#endif /* !__RequestUnion__task_subsystem__defined */
#ifndef subsystem_to_name_map_task
#define subsystem_to_name_map_task \
{ "task_create", 3400 },\
{ "task_terminate", 3401 },\
{ "task_threads", 3402 },\
{ "mach_ports_register", 3403 },\
{ "mach_ports_lookup", 3404 },\
{ "task_info", 3405 },\
{ "task_set_info", 3406 },\
{ "task_suspend", 3407 },\
{ "task_resume", 3408 },\
{ "task_get_special_port", 3409 },\
{ "task_set_special_port", 3410 },\
{ "thread_create", 3411 },\
{ "thread_create_running", 3412 },\
{ "task_set_exception_ports", 3413 },\
{ "task_get_exception_ports", 3414 },\
{ "task_swap_exception_ports", 3415 },\
{ "lock_set_create", 3416 },\
{ "lock_set_destroy", 3417 },\
{ "semaphore_create", 3418 },\
{ "semaphore_destroy", 3419 },\
{ "task_policy_set", 3420 },\
{ "task_policy_get", 3421 },\
{ "task_sample", 3422 },\
{ "task_policy", 3423 },\
{ "task_set_emulation", 3424 },\
{ "task_get_emulation_vector", 3425 },\
{ "task_set_emulation_vector", 3426 },\
{ "task_set_ras_pc", 3427 },\
{ "task_assign", 3429 },\
{ "task_assign_default", 3430 },\
{ "task_get_assignment", 3431 },\
{ "task_set_policy", 3432 },\
{ "task_get_state", 3433 },\
{ "task_set_state", 3434 }
#endif
#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
#endif /* _task_user_ */
branches/xZenu/src/include/mach/arm/vm_param.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright (c) 2007 Apple Inc. All rights reserved.
*/
/*
* FILE_ID: vm_param.h
*/
/*
*ARM machine dependent virtual memory parameters.
*/
#ifndef_MACH_ARM_VM_PARAM_H_
#define _MACH_ARM_VM_PARAM_H_
#define BYTE_SIZE8/* byte size in bits */
#define ARM_PGBYTES4096/* bytes per ARM small page */
#define ARM_PGSHIFT12/* number of bits to shift for pages */
#define PAGE_SIZE ARM_PGBYTES
#define PAGE_SHIFT ARM_PGSHIFT
#define PAGE_MASK (PAGE_SIZE-1)
#define VM_PAGE_SIZEARM_PGBYTES
#define KERNEL_STACK_SIZE(4*ARM_PGBYTES)
#define INTSTACK_SIZE(4*ARM_PGBYTES)
/* interrupt stack size */
#ifndef __ASSEMBLER__
/*
*Round off or truncate to the nearest page. These will work
*for either addresses or counts. (i.e. 1 byte rounds to 1 page
*bytes.
*/
/*
* ARMtodo: Make user address spaces small for now (to make
* context switch more efficient). Since we don't have VM
* pageout yet, just make it 1GB for now.
*/
#define VM_MIN_ADDRESS((vm_address_t) 0x00000000)
#define VM_MAX_ADDRESS((vm_address_t) 0x40000000)
#define HIGH_EXC_VECTORS((vm_address_t) 0xFFFF0000) /* exception vectors virt */
#define VM_MIN_KERNEL_ADDRESS((vm_address_t) 0x80000000)
#define VM_MIN_KERNEL_AND_KEXT_ADDRESS VM_MIN_KERNEL_ADDRESS
#define VM_MAX_KERNEL_ADDRESS((vm_address_t) 0xFFFEFFFF) /* end short of exc vecs */
#define VM_KERNEL_ADDRESS(va)((((vm_address_t)(va))>=VM_MIN_KERNEL_ADDRESS) && \
(((vm_address_t)(va))<=VM_MAX_KERNEL_ADDRESS))
/* system-wide values */
#define MACH_VM_MIN_ADDRESS((mach_vm_offset_t) 0)
#define MACH_VM_MAX_ADDRESS((mach_vm_offset_t) VM_MAX_ADDRESS)
/*
*Physical memory is mapped linearly at an offset virtual memory.
*/
extern unsigned long gVirtBase, gPhysBase, gPhysSize;
#define isphysmem(a) (((vm_address_t)(a) - gPhysBase) < gPhysSize)
#define phystokv(a)((vm_address_t)(a) - gPhysBase + gVirtBase)
#endif
#define SWI_SYSCALL0x80
#endif/* _MACH_ARM_VM_PARAM_H_ */
branches/xZenu/src/include/mach/arm/rpc.h
1
2
3
4
5
6
7
8
9
10
11
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef_MACH_I386_RPC_H_
#define_MACH_I386_RPC_H_
#endif /* _MACH_I386_RPC_H_ */
branches/xZenu/src/include/mach/arm/_structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Copyright (c) 2004-2007 Apple Inc. All rights reserved.
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef_MACH_ARM__STRUCTS_H_
#define_MACH_ARM__STRUCTS_H_
#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATEstruct __darwin_arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
__uint32_t__exception; /* number of arm exception taken */
__uint32_t__fsr; /* Fault status */
__uint32_t__far; /* Virtual Fault Address */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_EXCEPTION_STATEstruct arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
__uint32_texception; /* number of arm exception taken */
__uint32_tfsr; /* Fault status */
__uint32_tfar; /* Virtual Fault Address */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATEstruct __darwin_arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
__uint32_t__r[13];/* General purpose register r0-r12 */
__uint32_t__sp;/* Stack pointer r13 */
__uint32_t__lr;/* Link register r14 */
__uint32_t__pc;/* Program counter r15 */
__uint32_t__cpsr;/* Current program status register */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_THREAD_STATEstruct arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
__uint32_tr[13];/* General purpose register r0-r12 */
__uint32_tsp;/* Stack pointer r13 */
__uint32_tlr;/* Link register r14 */
__uint32_tpc;/* Program counter r15 */
__uint32_tcpsr;/* Current program status register */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_VFP_STATEstruct __darwin_arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
__uint32_t __r[64];
__uint32_t __fpscr;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_VFP_STATEstruct arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
__uint32_t r[64];
__uint32_t fpscr;
};
#endif /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_DEBUG_STATEstruct __darwin_arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
};
#endif /* _MACH_ARM__STRUCTS_H_ */
branches/xZenu/src/include/mach/arm/vm_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14