]> git.saurik.com Git - apple/xnu.git/blame - bsd/kern/mach_header.h
xnu-792.2.4.tar.gz
[apple/xnu.git] / bsd / kern / mach_header.h
CommitLineData
1c79356b 1/*
91447636 2 * Copyright (c) 2000-2004 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 * File: kern/mach_header.h
24 *
25 * Definitions for accessing mach-o headers.
26 *
91447636
A
27 * NOTE: The functions prototyped by this header only operate againt
28 * 32 bit mach headers. Many of these functions imply the
29 * currently running kernel, and cannot be used against mach
30 * headers other than that of the currently running kernel.
31 *
1c79356b
A
32 * HISTORY
33 * 29-Jan-92 Mike DeMoney (mike@next.com)
34 * Made into machine independent form from machdep/m68k/mach_header.h.
35 * Ifdef'ed out most of this since I couldn't find any references.
36 */
37
38#ifndef _KERN_MACH_HEADER_
39#define _KERN_MACH_HEADER_
40
41#include <mach/mach_types.h>
42#include <mach-o/loader.h>
43
44#if KERNEL
45struct mach_header **getmachheaders(void);
46vm_offset_t getlastaddr(void);
47
48struct segment_command *firstseg(void);
49struct segment_command *firstsegfromheader(struct mach_header *header);
50struct segment_command *nextseg(struct segment_command *sgp);
51struct segment_command *nextsegfromheader(
52 struct mach_header *header,
53 struct segment_command *seg);
91447636 54struct segment_command *getsegbyname(const char *seg_name);
1c79356b
A
55struct segment_command *getsegbynamefromheader(
56 struct mach_header *header,
91447636
A
57 const char *seg_name);
58void *getsegdatafromheader(struct mach_header *, const char *, int *);
59struct section *getsectbyname(const char *seg_name, const char *sect_name);
1c79356b
A
60struct section *getsectbynamefromheader(
61 struct mach_header *header,
91447636
A
62 const char *seg_name,
63 const char *sect_name);
64void *getsectdatafromheader(struct mach_header *, const char *, const char *, int *);
1c79356b
A
65struct section *firstsect(struct segment_command *sgp);
66struct section *nextsect(struct segment_command *sgp, struct section *sp);
67struct fvmlib_command *fvmlib(void);
68struct fvmlib_command *fvmlibfromheader(struct mach_header *header);
69struct segment_command *getfakefvmseg(void);
70
71#endif /* KERNEL */
72
73#endif /* _KERN_MACH_HEADER_ */