]> git.saurik.com Git - apple/xnu.git/blame_incremental - bsd/kern/mach_header.h
xnu-123.5.tar.gz
[apple/xnu.git] / bsd / kern / mach_header.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * File: kern/mach_header.h
24 *
25 * Definitions for accessing mach-o headers.
26 *
27 * HISTORY
28 * 29-Jan-92 Mike DeMoney (mike@next.com)
29 * Made into machine independent form from machdep/m68k/mach_header.h.
30 * Ifdef'ed out most of this since I couldn't find any references.
31 */
32
33#ifndef _KERN_MACH_HEADER_
34#define _KERN_MACH_HEADER_
35
36#include <mach/mach_types.h>
37#include <mach-o/loader.h>
38
39#if KERNEL
40struct mach_header **getmachheaders(void);
41vm_offset_t getlastaddr(void);
42
43struct segment_command *firstseg(void);
44struct segment_command *firstsegfromheader(struct mach_header *header);
45struct segment_command *nextseg(struct segment_command *sgp);
46struct segment_command *nextsegfromheader(
47 struct mach_header *header,
48 struct segment_command *seg);
49struct segment_command *getsegbyname(char *seg_name);
50struct segment_command *getsegbynamefromheader(
51 struct mach_header *header,
52 char *seg_name);
53void *getsegdatafromheader(struct mach_header *, char *, int *);
54struct section *getsectbyname(char *seg_name, char *sect_name);
55struct section *getsectbynamefromheader(
56 struct mach_header *header,
57 char *seg_name,
58 char *sect_name);
59void *getsectdatafromheader(struct mach_header *, char *, char *, int *);
60struct section *firstsect(struct segment_command *sgp);
61struct section *nextsect(struct segment_command *sgp, struct section *sp);
62struct fvmlib_command *fvmlib(void);
63struct fvmlib_command *fvmlibfromheader(struct mach_header *header);
64struct segment_command *getfakefvmseg(void);
65
66#endif /* KERNEL */
67
68#endif /* _KERN_MACH_HEADER_ */