Chameleon

Chameleon Commit Details

Date:2011-08-04 16:18:20 (7 years 11 months ago)
Author:Evan Lojewski
Commit:1271
Parents: 1270
Message:Add missing ppc headers
Changes:
A/branches/xZenu/src/include/ppc/_limits.h
A/branches/xZenu/src/include/ppc/fasttrap_isa.h
A/branches/xZenu/src/include/ppc/param.h
A/branches/xZenu/src/include/ppc/profile.h
A/branches/xZenu/src/include/ppc/limits.h
A/branches/xZenu/src/include/ppc/setjmp.h
A/branches/xZenu/src/include/ppc/_types.h
A/branches/xZenu/src/include/ppc/vmparam.h
A/branches/xZenu/src/include/ppc/types.h
A/branches/xZenu/src/include/ppc/_structs.h
A/branches/xZenu/src/include/ppc
A/branches/xZenu/src/include/ppc/signal.h
A/branches/xZenu/src/include/ppc/endian.h
A/branches/xZenu/src/include/ppc/_param.h

File differences

branches/xZenu/src/include/ppc/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
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
/*
* Copyright (c) 2000-2004 Apple Computer, 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@
*/
/*
* Copyright (c) 1992, 1993 NeXT Computer, Inc.
*/
#ifndef_PPC_SIGNAL_H_
#define_PPC_SIGNAL_H_ 1
#include <sys/cdefs.h>
#ifndef _ANSI_SOURCE
typedef int sig_atomic_t;
#include <sys/appleapiopts.h>
#ifdef __APPLE_API_OBSOLETE
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define __need_struct_sigcontext
#define __need_struct_sigcontext32
#define __need_struct_sigcontext64
#include <ppc/_structs.h>
/*
* Machine-dependant flags used in sigvec call.
*/
#defineSV_SAVE_REGS0x1000/* Save all regs in sigcontext */
/*
* regs_saved_t -- Describes which registers beyond what the kernel cares
* about are saved to and restored from this sigcontext.
*
* The default is REGS_SAVED_CALLER, only the caller saved registers
* are saved. If the SV_SAVE_REGS flag was set when the signal
* handler was registered with sigvec() then all the registers will be
* saved in the sigcontext, and REGS_SAVED_ALL will be set. The C
* library uses REGS_SAVED_NONE in order to quickly restore kernel
* state during a longjmp().
*/
typedef enum {
REGS_SAVED_NONE,/* Only kernel managed regs restored */
REGS_SAVED_CALLER,/* "Caller saved" regs: rpc, a0-a7,
t0-t4, at, lk0-lk1, xt1-xt20,
xr0-xr1 */
REGS_SAVED_ALL/* All registers */
} regs_saved_t;
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
#endif /* __APPLE_API_OBSOLETE */
#endif /* _ANSI_SOURCE */
#endif /* _PPC_SIGNAL_H_ */
branches/xZenu/src/include/ppc/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
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
/*
* Copyright (c) 2000-2004 Apple Computer, 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@
*/
/*
* Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
* Copyright (c) 2000-2002 Apple Computer, 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@
*/
/*
* 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/10/93
*/
#ifndef _PPC_ENDIAN_H_
#define_PPC_ENDIAN_H_
#include <sys/cdefs.h>
/*
* Define the order of 32-bit words in 64-bit words.
*/
#define _QUAD_HIGHWORD 0
#define _QUAD_LOWWORD 1
/*
* 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, ppc */
#define__DARWIN_PDP_ENDIAN3412/* LSB first in word, MSW first in long */
#define__DARWIN_BYTE_ORDER__DARWIN_BIG_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 /* !_PPC_ENDIAN_H_ */
branches/xZenu/src/include/ppc/_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
/*
* Copyright (c) 2004 Apple Computer, 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@
*/
#ifndef_PPC__PARAM_H_
#define_PPC__PARAM_H_
#include <ppc/_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 *)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
#endif/* _PPC__PARAM_H_ */
branches/xZenu/src/include/ppc/_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
/*
* Copyright (c) 2004 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@
*/
#ifndef_PPC__LIMITS_H_
#define_PPC__LIMITS_H_
#define__DARWIN_CLK_TCK100/* ticks per second */
#endif/* _PPC__LIMITS_H_ */
branches/xZenu/src/include/ppc/fasttrap_isa.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
/*
* Copyright (c) 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@
*/
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef_FASTTRAP_ISA_H
#define_FASTTRAP_ISA_H
/* #pragma ident"@(#)fasttrap_isa.h1.405/06/08 SMI" */
#include <sys/types.h>
#if defined(__APPLE__)
#include <stdint.h>
#endif
#ifdef__cplusplus
extern "C" {
#endif
typedefuint32_tfasttrap_instr_t;
typedef struct fasttrap_machtp {
fasttrap_instr_tftmt_instr; /* Original instruction */
int32_tftmt_trgt;/* Offset or absolute address */
uint8_tftmt_type;/* Emulation function type */
#define ftmtNOP 0
#define ftmtCommon 1
#define ftmtB 2
#define ftmtBC 3
#define ftmtBLR 4
#define ftmtBCTR 5
uint8_tftmt_bo;/* Branch options */
uint8_tftmt_bi;/* Condition bit */
uint8_tftmt_flgs;/* Flags */
#define ftmtAbs 2
#define ftmtLink 1
} fasttrap_machtp_t;
#defineftt_instrftt_mtp.ftmt_instr
#defineftt_trgtftt_mtp.ftmt_trgt
#defineftt_typeftt_mtp.ftmt_type
#defineftt_boftt_mtp.ftmt_bo
#defineftt_biftt_mtp.ftmt_bi
#defineftt_flgsftt_mtp.ftmt_flgs
#defineFASTTRAP_INSTR 0x0FFFDDDD
#define T_DTRACE_RET (0x2E * 4)
#defineFASTTRAP_RETURN_AFRAMES7
#defineFASTTRAP_ENTRY_AFRAMES7
#defineFASTTRAP_OFFSET_AFRAMES6
#ifdef__cplusplus
}
#endif
#endif/* _FASTTRAP_ISA_H */
branches/xZenu/src/include/ppc/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
140
141
/*
* Copyright (c) 2000-2004 Apple Computer, 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@
*/
/* Copyright (c) 1993,1995 NeXT Computer, Inc. All Rights Reserved */
#ifndef_PPC_PARAM_H_
#define_PPC_PARAM_H_
#include <ppc/_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.
*/
#defineALIGNBYTES__DARWIN_ALIGNBYTES
#defineALIGN(p)__DARWIN_ALIGN(p)
#defineNBPG4096/* bytes/page */
#definePGOFSET(NBPG-1)/* byte offset into page */
#definePGSHIFT12/* LOG2(NBPG) */
#define NBSEG0x40000000/* bytes/segment (quadrant) */
#defineSEGOFSET(NBSEG-1)/* byte offset into segment */
#defineSEGSHIFT30/* LOG2(NBSEG) */
#defineDEV_BSIZE512
#defineDEV_BSHIFT9/* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE2048
#defineMAXPHYS(128 * 1024)/* max raw I/O transfer size */
#defineSTACK_GROWTH_UP0/* stack grows to lower addresses */
#defineCLSIZE1
#defineCLSIZELOG20
#define STACKSIZE 4/* pages in kernel stack */
#defineUPAGES0/* total pages in u-area */
/* red zone is beyond this */
/*
* 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
#if GATEWAY
#defineNMBCLUSTERS((1024 * 1024) / MCLBYTES)/* cl map size: 1MB */
#else
#defineNMBCLUSTERS((1024 * 1024) / MCLBYTES)
/* cl map size was 0.5MB when MSIZE was 128, now it's 1MB*/
#endif
#endif
/* pages ("clicks") (NBPG bytes) to disk blocks */
#definectod(x)((x)<<(PGSHIFT-DEV_BSHIFT))
#definedtoc(x)((x)>>(PGSHIFT-DEV_BSHIFT))
#definedtob(x)((x)<<DEV_BSHIFT)
/* pages to bytes */
#definectob(x)((x)<<PGSHIFT)
/* bytes to pages */
#definebtoc(x)(((unsigned)(x)+(PGOFSET))>>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 should use the bsize
* field from the disk label.
* For now though just use DEV_BSIZE.
*/
#definebdbtofsb(bn)((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
/* from machdep/ppc/proc_reg.h */
#ifdef __BIG_ENDIAN__
#define ENDIAN_MASK(val,size) (1 << (size-1 - val))
#else
#error code not ported to little endian targets yet
#endif /* __BIG_ENDIAN__ */
#ifndef MASK
#define MASK(PART)ENDIAN_MASK(PART ## _BIT, 32)
#endif
#defineMSR_EE_BIT16
#defineMSR_PR_BIT17
#define USERMODE(msr) (msr & MASK(MSR_PR) ? TRUE : FALSE)
#define BASEPRI(msr) (msr & MASK(MSR_EE) ? TRUE : FALSE)
/* end of from proc_reg.h */
#ifdefined(KERNEL) || defined(STANDALONE)
#defineDELAY(n) delay(n)
#else
#defineDELAY(n){ register int N = (n); while (--N > 0); }
#endif/* defined(KERNEL) || defined(STANDALONE) */
#defineNPIDS16/* maximum number of PIDs per process */
#defineNIOPIDS8/* maximum number of IO space PIDs */
#endif/* _PPC_PARAM_H_ */
branches/xZenu/src/include/ppc/profile.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
/*
* Copyright (c) 2000-2002 Apple Computer, 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@
*/
/*
* Copyright (c) 1997, Apple Computer, Inc. All rights reserved.
*
*/
#ifndef _BSD_PPC_PROFILE_H_
#define _BSD_PPC_PROFILE_H_
#include <sys/appleapiopts.h>
#endif /* _BSD_PPC_PROFILE_H_ */
branches/xZenu/src/include/ppc/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
/*
* 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 _PPC_LIMITS_H_
#define _PPC_LIMITS_H_
#include <sys/cdefs.h>
#include <ppc/_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 /* _PPC_LIMITS_H_ */
branches/xZenu/src/include/ppc/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
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
/*
* Copyright (c) 2000-2004 Apple Computer, 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@
*/
/* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
*
*File:ppc/setjmp.h
*
*Declaration of setjmp routines and data structures.
*/
#ifndef _BSD_PPC_SETJMP_H_
#define _BSD_PPC_SETJMP_H_
#include <sys/cdefs.h>
#define __need_struct_sigcontext
#include <ppc/_structs.h>
struct _jmp_buf {
#if __DARWIN_UNIX03
_STRUCT_SIGCONTEXT__sigcontext; /* kernel state preserved by set/longjmp */
unsigned int __vmask __attribute__((aligned(8))); /* vector mask register */
unsigned int __vreg[32 * 4] __attribute__((aligned(16)));
/* 32 128-bit vector registers */
#else /* !__DARWIN_UNIX03 */
_STRUCT_SIGCONTEXTsigcontext; /* kernel state preserved by set/longjmp */
unsigned int vmask __attribute__((aligned(8))); /* vector mask register */
unsigned int vreg[32 * 4] __attribute__((aligned(16)));
/* 32 128-bit vector registers */
#endif /* __DARWIN_UNIX03 */
};
/*
*_JBLEN is number of ints required to save the following:
*r1, r2, r13-r31, lr, cr, ctr, xer, sig == 26 register_t sized
*fr14 - fr31 = 18 doubles
*vmask, 32 vector registers = 129 ints
*2 ints to get all the elements aligned
*
*register_t is 2 ints for ppc64 threads
*/
#define _JBLEN64(26*2 + 18*2 + 129 + 1)
#define _JBLEN32(26 + 18*2 + 129 + 1)
#define _JBLEN_MAX_JBLEN64
/*
* Locally scoped sizes
*/
#if defined(__ppc64__)
#define _JBLEN _JBLEN64
#else
#define _JBLEN _JBLEN32
#endif
typedef int jmp_buf[_JBLEN];
typedef int sigjmp_buf[_JBLEN + 1];
__BEGIN_DECLS
intsetjmp(jmp_buf);
voidlongjmp(jmp_buf, int);
#ifndef _ANSI_SOURCE
int_setjmp(jmp_buf);
void_longjmp(jmp_buf, int);
intsigsetjmp(sigjmp_buf, int);
voidsiglongjmp(sigjmp_buf, int);
#endif /* _ANSI_SOURCE */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
voidlongjmperror(void);
#endif /* neither ANSI nor POSIX */
__END_DECLS
#endif /* !_BSD_PPC_SETJMP_H_ */
branches/xZenu/src/include/ppc/_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
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* Copyright (c) 2000-2003 Apple Computer, 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@
*/
#ifndef_BSD_PPC__TYPES_H_
#define_BSD_PPC__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 char *__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_PPC__TYPES_H_ */
branches/xZenu/src/include/ppc/vmparam.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
/*
* Copyright (c) 2000-2002 Apple Computer, 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@
*/
#ifndef_BSD_PPC_VMPARAM_H_
#define_BSD_PPC_VMPARAM_H_ 1
#include <sys/resource.h>
#defineUSRSTACK(0xc0000000)
/*
* put the default 64-bit stack at the max address
* (minus one 32-bit address space for other incidentals)
*/
#defineUSRSTACK64 (0x00007FFF5FC00000ULL)
/*
* Virtual memory related constants, all in bytes
*/
#ifndef DFLDSIZ
#defineDFLDSIZ(RLIM_INFINITY)/* initial data size limit */
// XXX Not enforced
//#define DFLDSIZ(6*1024*1024)/* initial data size limit */
#endif
#ifndef MAXDSIZ
#defineMAXDSIZ(RLIM_INFINITY)/* max data size */
#endif
#ifndefDFLSSIZ
#defineDFLSSIZ(8*1024*1024)/* initial stack size limit */
#endif
#ifndefMAXSSIZ
#defineMAXSSIZ(64*1024*1024)/* max stack size */
#endif
#ifndefDFLCSIZ
#define DFLCSIZ(0)/* initial core size limit */
#endif
#ifndefMAXCSIZ
#define MAXCSIZ(RLIM_INFINITY)/* max core size */
#endif
#endif/* _BSD_PPC_VMPARAM_H_ */
branches/xZenu/src/include/ppc/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
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
/*
* Copyright (c) 2000-2004 Apple Computer, 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@
*/
/*
* 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 <ppc/_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;
#if defined(__ppc64__)
typedef int64_tregister_t;
#else
typedef int32_tregister_t;
#endif
#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))
/* with LP64 support pointers and longs from user address space may vary */
/* in size depending on the type of process (currently 32 or 64-bit, but */
/* may change in the future). These types are used for reserving the largest */
/* possible size. */
typedef u_int64_tuser_addr_t;
typedef u_int64_tuser_size_t;
typedef int64_tuser_ssize_t;
typedef int64_tuser_long_t;
typedef u_int64_tuser_ulong_t;
typedef int64_tuser_time_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_int64_tsyscall_arg_t;
#ifndef __offsetof
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
#endif
#endif /* __ASSEMBLER__ */
#endif/* _MACHTYPES_H_ */
branches/xZenu/src/include/ppc/_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
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
/*
* Copyright (c) 2004 Apple Computer, 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@
*/
#include <sys/cdefs.h>
#ifdef __need_mcontext_t
#ifndef __need_struct_mcontext
#define __need_struct_mcontext
#endif /* __need_struct_mcontext */
#endif /* __need_mcontext_t */
#ifdef __need_mcontext64_t
#ifndef __need_struct_mcontext64
#define __need_struct_mcontext64
#endif /* __need_struct_mcontext64 */
#endif /* __need_mcontext64_t */
#if defined(__need_struct_mcontext) || defined(__need_struct_mcontext64)
#include <mach/ppc/_structs.h>
#endif /* __need_struct_mcontext || __need_struct_mcontext64 */
#ifdef __need_struct_mcontext
#undef __need_struct_mcontext
#ifndef _STRUCT_MCONTEXT
#if __DARWIN_UNIX03
#define_STRUCT_MCONTEXTstruct __darwin_mcontext
_STRUCT_MCONTEXT
{
_STRUCT_PPC_EXCEPTION_STATE__es;
_STRUCT_PPC_THREAD_STATE__ss;
_STRUCT_PPC_FLOAT_STATE__fs;
_STRUCT_PPC_VECTOR_STATE__vs;
};
#else /* !__DARWIN_UNIX03 */
#define_STRUCT_MCONTEXTstruct mcontext
_STRUCT_MCONTEXT
{
_STRUCT_PPC_EXCEPTION_STATEes;
_STRUCT_PPC_THREAD_STATEss;
_STRUCT_PPC_FLOAT_STATEfs;
_STRUCT_PPC_VECTOR_STATEvs;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT */
#endif /* __need_struct_mcontext */
#ifdef __need_struct_mcontext64
#undef __need_struct_mcontext64
#ifndef _STRUCT_MCONTEXT64
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT64struct __darwin_mcontext64
_STRUCT_MCONTEXT64
{
_STRUCT_PPC_EXCEPTION_STATE64__es;
_STRUCT_PPC_THREAD_STATE64__ss;
_STRUCT_PPC_FLOAT_STATE__fs;
_STRUCT_PPC_VECTOR_STATE__vs;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_MCONTEXT64struct mcontext64
_STRUCT_MCONTEXT64
{
_STRUCT_PPC_EXCEPTION_STATE64es;
_STRUCT_PPC_THREAD_STATE64ss;
_STRUCT_PPC_FLOAT_STATEfs;
_STRUCT_PPC_VECTOR_STATEvs;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT64 */
#endif /* __need_struct_mcontext64 */
#ifdef __need_mcontext_t
#undef __need_mcontext_t
#ifndef _MCONTEXT_T
#define _MCONTEXT_T
typedef _STRUCT_MCONTEXT*mcontext_t;
#endif /* _MCONTEXT_T */
#endif /* __need_mcontext_t */
#ifdef __need_mcontext64_t
#undef __need_mcontext64_t
#ifndef _MCONTEXT64_T
#define _MCONTEXT64_T
typedef _STRUCT_MCONTEXT64*mcontext64_t;
#endif /* _MCONTEXT64_T */
#endif /* __need_mcontext64_t */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#ifndef PPC_MCONTEXT_SIZE
#define PPC_MCONTEXT_SIZE(PPC_THREAD_STATE_COUNT + PPC_FLOAT_STATE_COUNT + PPC_EXCEPTION_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int)
#endif /* PPC_MCONTEXT_SIZE */
#ifndef PPC_MCONTEXT64_SIZE
#define PPC_MCONTEXT64_SIZE(PPC_THREAD_STATE64_COUNT + PPC_FLOAT_STATE_COUNT + PPC_EXCEPTION_STATE_COUNT + PPC_VECTOR_STATE_COUNT) * sizeof(int)
#endif /* PPC_MCONTEXT64_SIZE */
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
/*
* LP64todo - Have to decide how to handle this.
* For now, just duplicate the 32-bit context as the generic one.
*/
#ifdef __need_struct_sigcontext
#undef __need_struct_sigcontext
#ifndef _STRUCT_SIGCONTEXT
#if __DARWIN_UNIX03/* signal.h needs struct sigcontext visible */
#define _STRUCT_SIGCONTEXTstruct __darwin_sigcontext
_STRUCT_SIGCONTEXT
{
int__sc_onstack;/* sigstack state to restore */
int__sc_mask;/* signal mask to restore */
int__sc_ir;/* pc */
int__sc_psw;/* processor status word */
int__sc_sp;/* stack pointer if sc_regs == NULL */
void*__sc_regs;/* (kernel private) saved state */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_SIGCONTEXTstruct sigcontext
_STRUCT_SIGCONTEXT
{
intsc_onstack;/* sigstack state to restore */
intsc_mask;/* signal mask to restore */
intsc_ir;/* pc */
intsc_psw;/* processor status word */
intsc_sp;/* stack pointer if sc_regs == NULL */
void*sc_regs;/* (kernel private) saved state */
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_SIGCONTEXT */
#endif /* __need_struct_sigcontext */
/*
* Information pushed on stack when a signal is delivered.
* This is used by the kernel to restore state following
* execution of the signal handler. It is also made available
* to the handler to allow it to properly restore state if
* a non-standard exit is performed.
*/
#ifdef __need_struct_sigcontext32
#undef __need_struct_sigcontext32
#ifndef _STRUCT_SIGCONTEXT32
#if __DARWIN_UNIX03
#define _STRUCT_SIGCONTEXT32struct __darwin_sigcontext32
_STRUCT_SIGCONTEXT32
{
int__sc_onstack;/* sigstack state to restore */
int__sc_mask;/* signal mask to restore */
int__sc_ir;/* pc */
int__sc_psw;/* processor status word */
int__sc_sp;/* stack pointer if sc_regs == NULL */
void*__sc_regs;/* (kernel private) saved state */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_SIGCONTEXT32struct sigcontext32
_STRUCT_SIGCONTEXT32
{
intsc_onstack;/* sigstack state to restore */
intsc_mask;/* signal mask to restore */
intsc_ir;/* pc */
intsc_psw;/* processor status word */
intsc_sp;/* stack pointer if sc_regs == NULL */
void*sc_regs;/* (kernel private) saved state */
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_SIGCONTEXT32 */
#endif /* __need_struct_sigcontext32 */
#ifdef __need_struct_sigcontext64
#undef __need_struct_sigcontext64
#ifndef _STRUCT_SIGCONTEXT64
#if __DARWIN_UNIX03
#define _STRUCT_SIGCONTEXT64struct __darwin_sigcontext64
_STRUCT_SIGCONTEXT64
{
int__sc_onstack;/* sigstack state to restore */
int__sc_mask;/* signal mask to restore */
long long__sc_ir;/* pc */
long long__sc_psw;/* processor status word */
long long__sc_sp;/* stack pointer if sc_regs == NULL */
void*__sc_regs;/* (kernel private) saved state */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_SIGCONTEXT64struct sigcontext64
_STRUCT_SIGCONTEXT64
{
intsc_onstack;/* sigstack state to restore */
intsc_mask;/* signal mask to restore */
long longsc_ir;/* pc */
long longsc_psw;/* processor status word */
long longsc_sp;/* stack pointer if sc_regs == NULL */
void*sc_regs;/* (kernel private) saved state */
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_SIGCONTEXT64 */
#endif /* __need_struct_sigcontext64 */

Archive Download the corresponding diff file

Revision: 1271