]>
git.saurik.com Git - apple/xnu.git/blob - bsd/ppc/exec.h
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1994, The University of Utah and
27 * the Center for Software Science at the University of Utah (CSS).
28 * All rights reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
37 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF
38 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * CSS requests users of this software to return to css-dist@cs.utah.edu any
41 * improvements that they make and grant CSS redistribution rights.
45 #ifndef _BSD_PPC_EXEC_H_
46 #define _BSD_PPC_EXEC_H_
49 #include <sys/appleapiopts.h>
51 #ifdef __APPLE_API_OBSOLETE
52 /* Size of a page in an object file. */
55 /* Valid magic number check. */
56 #define N_BADMAG(ex) \
57 ((ex).a_magic != NMAGIC && (ex).a_magic != OMAGIC && \
58 (ex).a_magic != ZMAGIC)
60 /* Address of the bottom of the text segment. */
61 #define N_TXTADDR(X) 0
63 /* Address of the bottom of the data segment. */
64 #define N_DATADDR(ex) \
65 (N_TXTADDR(ex) + ((ex).a_magic == OMAGIC ? (ex).a_text \
66 : __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
68 /* Text segment offset. */
69 #define N_TXTOFF(ex) \
70 ((ex).a_magic == ZMAGIC ? __LDPGSZ : sizeof(struct exec))
72 /* Data segment offset. */
73 #define N_DATOFF(ex) \
74 (N_TXTOFF(ex) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \
75 __LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
77 /* Symbol table offset. */
78 #define N_SYMOFF(ex) \
79 (N_TXTOFF(ex) + (ex).a_text + (ex).a_data + (ex).a_trsize + \
82 /* String table offset. */
83 #define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms)
85 /* Description of the object file header (a.out format). */
87 #define OMAGIC 0407 /* old impure format */
88 #define NMAGIC 0410 /* read-only text */
89 #define ZMAGIC 0413 /* demand load format */
90 #define QMAGIC 0314 /* demand load format. Header in text. */
91 unsigned int a_magic
; /* magic number */
93 unsigned int a_text
; /* text segment size */
94 unsigned int a_data
; /* initialized data size */
95 unsigned int a_bss
; /* uninitialized data size */
96 unsigned int a_syms
; /* symbol table size */
97 unsigned int a_entry
; /* entry point */
98 unsigned int a_trsize
; /* text relocation size */
99 unsigned int a_drsize
; /* data relocation size */
103 * Address of ps_strings structure (in user space).
106 ((struct ps_strings *)(USRSTACK - sizeof(struct ps_strings)))
108 #endif /* __APPLE_API_OBSOLETE */
110 #endif /* _BSD_PPC_EXEC_H_ */