]> git.saurik.com Git - apple/xnu.git/blob - bsd/ppc/endian.h
xnu-792.13.8.tar.gz
[apple/xnu.git] / bsd / ppc / endian.h
1 /*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30
31 /*
32 * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
33 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
34 *
35 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
36 *
37 * This file contains Original Code and/or Modifications of Original Code
38 * as defined in and that are subject to the Apple Public Source License
39 * Version 2.0 (the 'License'). You may not use this file except in
40 * compliance with the License. The rights granted to you under the
41 * License may not be used to create, or enable the creation or
42 * redistribution of, unlawful or unlicensed copies of an Apple operating
43 * system, or to circumvent, violate, or enable the circumvention or
44 * violation of, any terms of an Apple operating system software license
45 * agreement.
46 *
47 * Please obtain a copy of the License at
48 * http://www.opensource.apple.com/apsl/ and read it before using this
49 * file.
50 *
51 * The Original Code and all software distributed under the License are
52 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
53 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
54 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
55 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
56 * Please see the License for the specific language governing rights and
57 * limitations under the License.
58 *
59 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
60 */
61 /*
62 * Copyright (c) 1987, 1991, 1993
63 * The Regents of the University of California. All rights reserved.
64 *
65 * Redistribution and use in source and binary forms, with or without
66 * modification, are permitted provided that the following conditions
67 * are met:
68 * 1. Redistributions of source code must retain the above copyright
69 * notice, this list of conditions and the following disclaimer.
70 * 2. Redistributions in binary form must reproduce the above copyright
71 * notice, this list of conditions and the following disclaimer in the
72 * documentation and/or other materials provided with the distribution.
73 * 3. All advertising materials mentioning features or use of this software
74 * must display the following acknowledgement:
75 * This product includes software developed by the University of
76 * California, Berkeley and its contributors.
77 * 4. Neither the name of the University nor the names of its contributors
78 * may be used to endorse or promote products derived from this software
79 * without specific prior written permission.
80 *
81 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
82 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
83 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
84 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
85 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
86 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
87 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
88 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
89 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
90 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
91 * SUCH DAMAGE.
92 *
93 * @(#)endian.h 8.1 (Berkeley) 6/10/93
94 */
95
96 #ifndef _PPC_ENDIAN_H_
97 #define _PPC_ENDIAN_H_
98
99 /*
100 * Define the order of 32-bit words in 64-bit words.
101 */
102 #define _QUAD_HIGHWORD 0
103 #define _QUAD_LOWWORD 1
104
105 /*
106 * Definitions for byte order, according to byte significance from low
107 * address to high.
108 */
109 #define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
110 #define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */
111 #define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
112
113 #define __DARWIN_BYTE_ORDER __DARWIN_BIG_ENDIAN
114
115 #if defined(KERNEL) || !defined(_POSIX_C_SOURCE)
116
117 #define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
118 #define BIG_ENDIAN __DARWIN_BIG_ENDIAN
119 #define PDP_ENDIAN __DARWIN_PDP_ENDIAN
120
121 #define BYTE_ORDER __DARWIN_BYTE_ORDER
122
123 #include <sys/_endian.h>
124
125 #endif /* defined(KERNEL) || !defined(_POSIX_C_SOURCE) */
126 #endif /* !_PPC_ENDIAN_H_ */