]>
git.saurik.com Git - apple/xnu.git/blob - bsd/ppc/exec.h
799b490d1abbecadec30797684317a48c43e8126
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
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
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
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.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 * Copyright (c) 1994, The University of Utah and
32 * the Center for Software Science at the University of Utah (CSS).
33 * All rights reserved.
35 * Permission to use, copy, modify and distribute this software and its
36 * documentation is hereby granted, provided that both the copyright
37 * notice and this permission notice appear in all copies of the
38 * software, derivative works or modified versions, and any portions
39 * thereof, and that both notices appear in supporting documentation.
41 * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
42 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF
43 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 * CSS requests users of this software to return to css-dist@cs.utah.edu any
46 * improvements that they make and grant CSS redistribution rights.
50 #ifndef _BSD_PPC_EXEC_H_
51 #define _BSD_PPC_EXEC_H_
54 #include <sys/appleapiopts.h>
56 #ifdef BSD_KERNEL_PRIVATE
57 /* Size of a page in an object file. */
60 /* Valid magic number check. */
61 #define N_BADMAG(ex) \
62 ((ex).a_magic != NMAGIC && (ex).a_magic != OMAGIC && \
63 (ex).a_magic != ZMAGIC)
65 /* Address of the bottom of the text segment. */
66 #define N_TXTADDR(X) 0
68 /* Address of the bottom of the data segment. */
69 #define N_DATADDR(ex) \
70 (N_TXTADDR(ex) + ((ex).a_magic == OMAGIC ? (ex).a_text \
71 : __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
73 /* Text segment offset. */
74 #define N_TXTOFF(ex) \
75 ((ex).a_magic == ZMAGIC ? __LDPGSZ : sizeof(struct exec))
77 /* Data segment offset. */
78 #define N_DATOFF(ex) \
79 (N_TXTOFF(ex) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \
80 __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
82 /* Symbol table offset. */
83 #define N_SYMOFF(ex) \
84 (N_TXTOFF(ex) + (ex).a_text + (ex).a_data + (ex).a_trsize + \
87 /* String table offset. */
88 #define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms)
90 /* Description of the object file header (a.out format). */
92 #define OMAGIC 0407 /* old impure format */
93 #define NMAGIC 0410 /* read-only text */
94 #define ZMAGIC 0413 /* demand load format */
95 #define QMAGIC 0314 /* demand load format. Header in text. */
96 unsigned int a_magic
; /* magic number */
98 unsigned int a_text
; /* text segment size */
99 unsigned int a_data
; /* initialized data size */
100 unsigned int a_bss
; /* uninitialized data size */
101 unsigned int a_syms
; /* symbol table size */
102 unsigned int a_entry
; /* entry point */
103 unsigned int a_trsize
; /* text relocation size */
104 unsigned int a_drsize
; /* data relocation size */
107 #endif /* BSD_KERNEL_PRIVATE */
109 #endif /* _BSD_PPC_EXEC_H_ */