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