Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/include/mach-o/swap.h

Source at commit 1146 created 12 years 11 months ago.
By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing).
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23#ifndef _MACH_O_SWAP_H_
24#define _MACH_O_SWAP_H_
25
26#include <stdint.h>
27#include <architecture/byte_order.h>
28#include <mach-o/fat.h>
29#include <mach-o/loader.h>
30#include <mach-o/nlist.h>
31#include <mach-o/reloc.h>
32#include <mach-o/ranlib.h>
33
34#if __cplusplus
35extern "C" {
36#endif /* __cplusplus */
37
38extern void swap_fat_header(
39 struct fat_header *fat_header,
40 enum NXByteOrder target_byte_order);
41
42extern void swap_fat_arch(
43 struct fat_arch *fat_archs,
44 uint32_t nfat_arch,
45 enum NXByteOrder target_byte_order);
46
47extern void swap_mach_header(
48 struct mach_header *mh,
49 enum NXByteOrder target_byte_order);
50
51extern void swap_mach_header_64(
52 struct mach_header_64 *mh,
53 enum NXByteOrder target_byte_order);
54
55extern void swap_load_command(
56 struct load_command *lc,
57 enum NXByteOrder target_byte_order);
58
59extern void swap_segment_command(
60 struct segment_command *sg,
61 enum NXByteOrder target_byte_order);
62
63extern void swap_segment_command_64(
64 struct segment_command_64 *sg,
65 enum NXByteOrder target_byte_order);
66
67extern void swap_section(
68 struct section *s,
69 uint32_t nsects,
70 enum NXByteOrder target_byte_order);
71
72extern void swap_section_64(
73 struct section_64 *s,
74 uint32_t nsects,
75 enum NXByteOrder target_byte_order);
76
77extern void swap_symtab_command(
78 struct symtab_command *st,
79 enum NXByteOrder target_byte_order);
80
81extern void swap_dysymtab_command(
82 struct dysymtab_command *dyst,
83 enum NXByteOrder target_byte_sex);
84
85extern void swap_symseg_command(
86 struct symseg_command *ss,
87 enum NXByteOrder target_byte_order);
88
89extern void swap_fvmlib_command(
90 struct fvmlib_command *fl,
91 enum NXByteOrder target_byte_order);
92
93extern void swap_dylib_command(
94 struct dylib_command *dl,
95 enum NXByteOrder target_byte_sex);
96
97extern void swap_sub_framework_command(
98 struct sub_framework_command *sub,
99 enum NXByteOrder target_byte_sex);
100
101extern void swap_sub_umbrella_command(
102 struct sub_umbrella_command *usub,
103 enum NXByteOrder target_byte_sex);
104
105extern void swap_sub_library_command(
106 struct sub_library_command *lsub,
107 enum NXByteOrder target_byte_sex);
108
109extern void swap_sub_client_command(
110 struct sub_client_command *csub,
111 enum NXByteOrder target_byte_sex);
112
113extern void swap_prebound_dylib_command(
114 struct prebound_dylib_command *pbdylib,
115 enum NXByteOrder target_byte_sex);
116
117extern void swap_dylinker_command(
118 struct dylinker_command *dyld,
119 enum NXByteOrder target_byte_sex);
120
121extern void swap_fvmfile_command(
122 struct fvmfile_command *ff,
123 enum NXByteOrder target_byte_order);
124
125extern void swap_thread_command(
126 struct thread_command *ut,
127 enum NXByteOrder target_byte_order);
128
129extern void swap_ident_command(
130 struct ident_command *ident,
131 enum NXByteOrder target_byte_order);
132
133extern void swap_routines_command(
134 struct routines_command *r_cmd,
135 enum NXByteOrder target_byte_sex);
136
137extern void swap_routines_command_64(
138 struct routines_command_64 *r_cmd,
139 enum NXByteOrder target_byte_sex);
140
141extern void swap_twolevel_hints_command(
142 struct twolevel_hints_command *hints_cmd,
143 enum NXByteOrder target_byte_sex);
144
145extern void swap_prebind_cksum_command(
146 struct prebind_cksum_command *cksum_cmd,
147 enum NXByteOrder target_byte_sex);
148
149extern void swap_uuid_command(
150 struct uuid_command *uuid_cmd,
151 enum NXByteOrder target_byte_sex);
152
153extern void swap_twolevel_hint(
154 struct twolevel_hint *hints,
155 uint32_t nhints,
156 enum NXByteOrder target_byte_sex);
157
158extern void swap_nlist(
159 struct nlist *symbols,
160 uint32_t nsymbols,
161 enum NXByteOrder target_byte_order);
162
163extern void swap_nlist_64(
164 struct nlist_64 *symbols,
165 uint32_t nsymbols,
166 enum NXByteOrder target_byte_order);
167
168extern void swap_ranlib(
169 struct ranlib *ranlibs,
170 uint32_t nranlibs,
171 enum NXByteOrder target_byte_order);
172
173extern void swap_relocation_info(
174 struct relocation_info *relocs,
175 uint32_t nrelocs,
176 enum NXByteOrder target_byte_order);
177
178extern void swap_indirect_symbols(
179 uint32_t *indirect_symbols,
180 uint32_t nindirect_symbols,
181 enum NXByteOrder target_byte_sex);
182
183extern void swap_dylib_reference(
184 struct dylib_reference *refs,
185 uint32_t nrefs,
186 enum NXByteOrder target_byte_sex);
187
188extern void swap_dylib_module(
189 struct dylib_module *mods,
190 uint32_t nmods,
191 enum NXByteOrder target_byte_sex);
192
193extern void swap_dylib_module_64(
194 struct dylib_module_64 *mods,
195 uint32_t nmods,
196 enum NXByteOrder target_byte_sex);
197
198extern void swap_dylib_table_of_contents(
199 struct dylib_table_of_contents *tocs,
200 uint32_t ntocs,
201 enum NXByteOrder target_byte_sex);
202
203#if __cplusplus
204}
205#endif /* __cplusplus */
206
207#endif /* _MACH_O_SWAP_H_ */
208

Archive Download this file

Revision: 1146