]>
git.saurik.com Git - apple/xnu.git/blob - bsd/kern/mach_loader.h
89ef0e4da9701dee0a61decbd656e121d15a06d4
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (C) 1992, NeXT, Inc.
26 * File: kern/mach_loader.h
28 * Mach object file loader API.
31 * 24-Aug-92 Doug Mitchell at NeXT
35 #ifndef _BSD_KERN_MACH_LOADER_H_
36 #define _BSD_KERN_MACH_LOADER_H_
38 #include <mach/mach_types.h>
39 #include <mach-o/loader.h>
41 typedef int load_return_t
;
44 * Structure describing the result from calling load_machfile(), if that
45 * function returns LOAD_SUCCESS.
47 typedef struct _load_result
{
48 user_addr_t mach_header
;
49 user_addr_t entry_point
;
50 user_addr_t user_stack
;
53 /* boolean_t */ unixproc
:1,
60 load_return_t
load_machfile(
61 struct image_params
*imgp
,
62 struct mach_header
*header
,
65 boolean_t clean_regions
,
66 load_result_t
*result
);
68 #define LOAD_SUCCESS 0
69 #define LOAD_BADARCH 1 /* CPU type/subtype not found */
70 #define LOAD_BADMACHO 2 /* malformed mach-o file */
71 #define LOAD_SHLIB 3 /* shlib version mismatch */
72 #define LOAD_FAILURE 4 /* Miscellaneous error */
73 #define LOAD_NOSPACE 5 /* No VM available */
74 #define LOAD_PROTECT 6 /* protection violation */
75 #define LOAD_RESOURCE 7 /* resource allocation failure */
76 #define LOAD_ENOENT 8 /* resource not found */
77 #define LOAD_IOERROR 9 /* IO error */
79 #endif /* _BSD_KERN_MACH_LOADER_H_ */