authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 21:12:18-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 21:12:18-08:00
logb0cbd0ad2df8afa1ac7a94c8ecee191f52855cd6
treec8f054df0034824ab6998a57f498485ef959f6e9
parentcd221b9df9391758925200514c7648812ca4334a

macos libc headers: add more

these new files are generated by recursively including: sysexits.h mach/mach.h sys/attr.h sys/mount.h crt_externs.h execinfo.h all of which are depended on by LLVM libraries.

76 files changed, 21197 insertions(+), 0 deletions(-)

lib/libc/include/x86_64-macos-gnu/crt_externs.h created+47
...@@ -0,0 +1,47 @@
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/*
24 * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
25 */
26
27/*
28** Prototypes for the functions to get environment information in
29** the world of dynamic libraries. Lifted from .c file of same name.
30** Fri Jun 23 12:56:47 PDT 1995
31** AOF (afreier@next.com)
32*/
33
34#include <sys/cdefs.h>
35
36__BEGIN_DECLS
37extern char ***_NSGetArgv(void);
38extern int *_NSGetArgc(void);
39extern char ***_NSGetEnviron(void);
40extern char **_NSGetProgname(void);
41#ifdef __LP64__
42extern struct mach_header_64 *
43#else /* !__LP64__ */
44extern struct mach_header *
45#endif /* __LP64__ */
46 _NSGetMachExecuteHeader(void);
47__END_DECLS
lib/libc/include/x86_64-macos-gnu/execinfo.h created+63
...@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2007 Apple 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 _EXECINFO_H_
24#define _EXECINFO_H_ 1
25
26#include <sys/cdefs.h>
27#include <Availability.h>
28#include <os/base.h>
29#include <os/availability.h>
30#include <stdint.h>
31#include <uuid/uuid.h>
32
33__BEGIN_DECLS
34
35int backtrace(void**,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
36
37API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0))
38OS_EXPORT
39int backtrace_from_fp(void *startfp, void **array, int size);
40
41char** backtrace_symbols(void* const*,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
42void backtrace_symbols_fd(void* const*,int,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
43
44struct image_offset {
45 /*
46 * The UUID of the image.
47 */
48 uuid_t uuid;
49
50 /*
51 * The offset is relative to the __TEXT section of the image.
52 */
53 uint32_t offset;
54};
55
56API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0))
57OS_EXPORT
58void backtrace_image_offsets(void* const* array,
59 struct image_offset *image_offsets, int size);
60
61__END_DECLS
62
63#endif /* !_EXECINFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/clock_priv.h created+199
...@@ -0,0 +1,199 @@
1#ifndef _clock_priv_user_
2#define _clock_priv_user_
3
4/* Module clock_priv */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef clock_priv_MSG_COUNT
52#define clock_priv_MSG_COUNT 2
53#endif /* clock_priv_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach/mach_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine clock_set_time */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t clock_set_time
76(
77 clock_ctrl_t clock_ctrl,
78 mach_timespec_t new_time
79);
80
81/* Routine clock_set_attributes */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87kern_return_t clock_set_attributes
88(
89 clock_ctrl_t clock_ctrl,
90 clock_flavor_t flavor,
91 clock_attr_t clock_attr,
92 mach_msg_type_number_t clock_attrCnt
93);
94
95__END_DECLS
96
97/********************** Caution **************************/
98/* The following data types should be used to calculate */
99/* maximum message sizes only. The actual message may be */
100/* smaller, and the position of the arguments within the */
101/* message layout may vary from what is presented here. */
102/* For example, if any of the arguments are variable- */
103/* sized, and less than the maximum is sent, the data */
104/* will be packed tight in the actual message to reduce */
105/* the presence of holes. */
106/********************** Caution **************************/
107
108/* typedefs for all requests */
109
110#ifndef __Request__clock_priv_subsystem__defined
111#define __Request__clock_priv_subsystem__defined
112
113#ifdef __MigPackStructs
114#pragma pack(push, 4)
115#endif
116 typedef struct {
117 mach_msg_header_t Head;
118 NDR_record_t NDR;
119 mach_timespec_t new_time;
120 } __Request__clock_set_time_t __attribute__((unused));
121#ifdef __MigPackStructs
122#pragma pack(pop)
123#endif
124
125#ifdef __MigPackStructs
126#pragma pack(push, 4)
127#endif
128 typedef struct {
129 mach_msg_header_t Head;
130 NDR_record_t NDR;
131 clock_flavor_t flavor;
132 mach_msg_type_number_t clock_attrCnt;
133 int clock_attr[1];
134 } __Request__clock_set_attributes_t __attribute__((unused));
135#ifdef __MigPackStructs
136#pragma pack(pop)
137#endif
138#endif /* !__Request__clock_priv_subsystem__defined */
139
140/* union of all requests */
141
142#ifndef __RequestUnion__clock_priv_subsystem__defined
143#define __RequestUnion__clock_priv_subsystem__defined
144union __RequestUnion__clock_priv_subsystem {
145 __Request__clock_set_time_t Request_clock_set_time;
146 __Request__clock_set_attributes_t Request_clock_set_attributes;
147};
148#endif /* !__RequestUnion__clock_priv_subsystem__defined */
149/* typedefs for all replies */
150
151#ifndef __Reply__clock_priv_subsystem__defined
152#define __Reply__clock_priv_subsystem__defined
153
154#ifdef __MigPackStructs
155#pragma pack(push, 4)
156#endif
157 typedef struct {
158 mach_msg_header_t Head;
159 NDR_record_t NDR;
160 kern_return_t RetCode;
161 } __Reply__clock_set_time_t __attribute__((unused));
162#ifdef __MigPackStructs
163#pragma pack(pop)
164#endif
165
166#ifdef __MigPackStructs
167#pragma pack(push, 4)
168#endif
169 typedef struct {
170 mach_msg_header_t Head;
171 NDR_record_t NDR;
172 kern_return_t RetCode;
173 } __Reply__clock_set_attributes_t __attribute__((unused));
174#ifdef __MigPackStructs
175#pragma pack(pop)
176#endif
177#endif /* !__Reply__clock_priv_subsystem__defined */
178
179/* union of all replies */
180
181#ifndef __ReplyUnion__clock_priv_subsystem__defined
182#define __ReplyUnion__clock_priv_subsystem__defined
183union __ReplyUnion__clock_priv_subsystem {
184 __Reply__clock_set_time_t Reply_clock_set_time;
185 __Reply__clock_set_attributes_t Reply_clock_set_attributes;
186};
187#endif /* !__RequestUnion__clock_priv_subsystem__defined */
188
189#ifndef subsystem_to_name_map_clock_priv
190#define subsystem_to_name_map_clock_priv \
191 { "clock_set_time", 1200 },\
192 { "clock_set_attributes", 1201 }
193#endif
194
195#ifdef __AfterMigUserHeader
196__AfterMigUserHeader
197#endif /* __AfterMigUserHeader */
198
199#endif /* _clock_priv_user_ */
lib/libc/include/x86_64-macos-gnu/mach/clock_types.h created+127
...@@ -0,0 +1,127 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * File: clock_types.h
33 * Purpose: Clock facility header definitions. These
34 * definitons are needed by both kernel and
35 * user-level software.
36 */
37
38/*
39 * All interfaces defined here are obsolete.
40 */
41
42#ifndef _MACH_CLOCK_TYPES_H_
43#define _MACH_CLOCK_TYPES_H_
44
45#include <stdint.h>
46#include <mach/time_value.h>
47
48/*
49 * Type definitions.
50 */
51typedef int alarm_type_t; /* alarm time type */
52typedef int sleep_type_t; /* sleep time type */
53typedef int clock_id_t; /* clock identification type */
54typedef int clock_flavor_t; /* clock flavor type */
55typedef int *clock_attr_t; /* clock attribute type */
56typedef int clock_res_t; /* clock resolution type */
57
58/*
59 * Normal time specification used by the kernel clock facility.
60 */
61struct mach_timespec {
62 unsigned int tv_sec; /* seconds */
63 clock_res_t tv_nsec; /* nanoseconds */
64};
65typedef struct mach_timespec mach_timespec_t;
66
67/*
68 * Reserved clock id values for default clocks.
69 */
70#define SYSTEM_CLOCK 0
71#define CALENDAR_CLOCK 1
72
73#define REALTIME_CLOCK 0
74
75/*
76 * Attribute names.
77 */
78#define CLOCK_GET_TIME_RES 1 /* get_time call resolution */
79/* 2 * was map_time call resolution */
80#define CLOCK_ALARM_CURRES 3 /* current alarm resolution */
81#define CLOCK_ALARM_MINRES 4 /* minimum alarm resolution */
82#define CLOCK_ALARM_MAXRES 5 /* maximum alarm resolution */
83
84#define NSEC_PER_USEC 1000ull /* nanoseconds per microsecond */
85#define USEC_PER_SEC 1000000ull /* microseconds per second */
86#define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */
87#define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */
88
89#define BAD_MACH_TIMESPEC(t) \
90 ((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)
91
92/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */
93#define CMP_MACH_TIMESPEC(t1, t2) \
94 ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
95 ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
96 (t1)->tv_nsec - (t2)->tv_nsec))
97
98/* t1 += t2 */
99#define ADD_MACH_TIMESPEC(t1, t2) \
100 do { \
101 if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
102 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \
103 (t1)->tv_sec += 1; \
104 } \
105 (t1)->tv_sec += (t2)->tv_sec; \
106 } while (0)
107
108/* t1 -= t2 */
109#define SUB_MACH_TIMESPEC(t1, t2) \
110 do { \
111 if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
112 (t1)->tv_nsec += (long) NSEC_PER_SEC; \
113 (t1)->tv_sec -= 1; \
114 } \
115 (t1)->tv_sec -= (t2)->tv_sec; \
116 } while (0)
117
118/*
119 * Alarm parameter defines.
120 */
121#define ALRMTYPE 0xff /* type (8-bit field) */
122#define TIME_ABSOLUTE 0x00 /* absolute time */
123#define TIME_RELATIVE 0x01 /* relative time */
124
125#define BAD_ALRMTYPE(t) (((t) &~ TIME_RELATIVE) != 0)
126
127#endif /* _MACH_CLOCK_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach/dyld_kernel.h created+66
...@@ -0,0 +1,66 @@
1/*
2 * Copyright (c) 2016 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_DYLIB_INFO_H_
30#define _MACH_DYLIB_INFO_H_
31
32#include <mach/boolean.h>
33#include <stdint.h>
34#include <sys/_types/_fsid_t.h>
35#include <sys/_types/_u_int32_t.h>
36#include <sys/_types/_fsobj_id_t.h>
37#include <sys/_types/_uuid_t.h>
38
39/* These definitions must be kept in sync with the ones in
40 * osfmk/mach/mach_types.defs.
41 */
42
43struct dyld_kernel_image_info {
44 uuid_t uuid;
45 fsobj_id_t fsobjid;
46 fsid_t fsid;
47 uint64_t load_addr;
48};
49
50struct dyld_kernel_process_info {
51 struct dyld_kernel_image_info cache_image_info;
52 uint64_t timestamp; // mach_absolute_time of last time dyld change to image list
53 uint32_t imageCount; // number of images currently loaded into process
54 uint32_t initialImageCount; // number of images statically loaded into process (before any dlopen() calls)
55 uint8_t dyldState; // one of dyld_process_state_* values
56 boolean_t no_cache; // process is running without a dyld cache
57 boolean_t private_cache; // process is using a private copy of its dyld cache
58};
59
60/* typedefs so our MIG is sane */
61
62typedef struct dyld_kernel_image_info dyld_kernel_image_info_t;
63typedef struct dyld_kernel_process_info dyld_kernel_process_info_t;
64typedef dyld_kernel_image_info_t *dyld_kernel_image_info_array_t;
65
66#endif /* _MACH_DYLIB_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/error.h created+114
...@@ -0,0 +1,114 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/error.h
60 * Purpose:
61 * error module definitions
62 *
63 */
64
65#ifndef _MACH_ERROR_H_
66#define _MACH_ERROR_H_
67
68#include <mach/kern_return.h>
69
70/*
71 * error number layout as follows:
72 *
73 * hi lo
74 * | system(6) | subsystem(12) | code(14) |
75 */
76
77
78#define err_none (mach_error_t)0
79#define ERR_SUCCESS (mach_error_t)0
80#define ERR_ROUTINE_NIL (mach_error_fn_t)0
81
82
83#define err_system(x) ((signed)((((unsigned)(x))&0x3f)<<26))
84#define err_sub(x) (((x)&0xfff)<<14)
85
86#define err_get_system(err) (((err)>>26)&0x3f)
87#define err_get_sub(err) (((err)>>14)&0xfff)
88#define err_get_code(err) ((err)&0x3fff)
89
90#define system_emask (err_system(0x3f))
91#define sub_emask (err_sub(0xfff))
92#define code_emask (0x3fff)
93
94
95/* major error systems */
96#define err_kern err_system(0x0) /* kernel */
97#define err_us err_system(0x1) /* user space library */
98#define err_server err_system(0x2) /* user space servers */
99#define err_ipc err_system(0x3) /* old ipc errors */
100#define err_mach_ipc err_system(0x4) /* mach-ipc errors */
101#define err_dipc err_system(0x7) /* distributed ipc */
102#define err_local err_system(0x3e) /* user defined errors */
103#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
104
105#define err_max_system 0x3f
106
107
108/* unix errors get lumped into one subsystem */
109#define unix_err(errno) (err_kern|err_sub(3)|errno)
110
111typedef kern_return_t mach_error_t;
112typedef mach_error_t (* mach_error_fn_t)( void );
113
114#endif /* _MACH_ERROR_H_ */
lib/libc/include/x86_64-macos-gnu/mach/host_info.h created+260
...@@ -0,0 +1,260 @@
1/*
2 * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56
57/*
58 * File: mach/host_info.h
59 *
60 * Definitions for host_info call.
61 */
62
63#ifndef _MACH_HOST_INFO_H_
64#define _MACH_HOST_INFO_H_
65
66#include <mach/message.h>
67#include <mach/vm_statistics.h>
68#include <mach/machine.h>
69#include <mach/machine/vm_types.h>
70#include <mach/time_value.h>
71
72#include <sys/cdefs.h>
73
74/*
75 * Generic information structure to allow for expansion.
76 */
77typedef integer_t *host_info_t; /* varying array of int. */
78typedef integer_t *host_info64_t; /* varying array of int. */
79
80#define HOST_INFO_MAX (1024) /* max array size */
81typedef integer_t host_info_data_t[HOST_INFO_MAX];
82
83#define KERNEL_VERSION_MAX (512)
84typedef char kernel_version_t[KERNEL_VERSION_MAX];
85
86#define KERNEL_BOOT_INFO_MAX (4096)
87typedef char kernel_boot_info_t[KERNEL_BOOT_INFO_MAX];
88
89/*
90 * Currently defined information.
91 */
92/* host_info() */
93typedef integer_t host_flavor_t;
94#define HOST_BASIC_INFO 1 /* basic info */
95#define HOST_SCHED_INFO 3 /* scheduling info */
96#define HOST_RESOURCE_SIZES 4 /* kernel struct sizes */
97#define HOST_PRIORITY_INFO 5 /* priority information */
98#define HOST_SEMAPHORE_TRAPS 7 /* Has semaphore traps */
99#define HOST_MACH_MSG_TRAP 8 /* Has mach_msg_trap */
100#define HOST_VM_PURGABLE 9 /* purg'e'able memory info */
101#define HOST_DEBUG_INFO_INTERNAL 10 /* Used for kernel internal development tests only */
102#define HOST_CAN_HAS_DEBUGGER 11
103#define HOST_PREFERRED_USER_ARCH 12 /* Get the preferred user-space architecture */
104
105
106struct host_can_has_debugger_info {
107 boolean_t can_has_debugger;
108};
109typedef struct host_can_has_debugger_info host_can_has_debugger_info_data_t;
110typedef struct host_can_has_debugger_info *host_can_has_debugger_info_t;
111#define HOST_CAN_HAS_DEBUGGER_COUNT ((mach_msg_type_number_t) \
112 (sizeof(host_can_has_debugger_info_data_t)/sizeof(integer_t)))
113
114#pragma pack(push, 4)
115
116struct host_basic_info {
117 integer_t max_cpus; /* max number of CPUs possible */
118 integer_t avail_cpus; /* number of CPUs now available */
119 natural_t memory_size; /* size of memory in bytes, capped at 2 GB */
120 cpu_type_t cpu_type; /* cpu type */
121 cpu_subtype_t cpu_subtype; /* cpu subtype */
122 cpu_threadtype_t cpu_threadtype; /* cpu threadtype */
123 integer_t physical_cpu; /* number of physical CPUs now available */
124 integer_t physical_cpu_max; /* max number of physical CPUs possible */
125 integer_t logical_cpu; /* number of logical cpu now available */
126 integer_t logical_cpu_max; /* max number of physical CPUs possible */
127 uint64_t max_mem; /* actual size of physical memory */
128};
129
130#pragma pack(pop)
131
132typedef struct host_basic_info host_basic_info_data_t;
133typedef struct host_basic_info *host_basic_info_t;
134#define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
135 (sizeof(host_basic_info_data_t)/sizeof(integer_t)))
136
137struct host_sched_info {
138 integer_t min_timeout; /* minimum timeout in milliseconds */
139 integer_t min_quantum; /* minimum quantum in milliseconds */
140};
141
142typedef struct host_sched_info host_sched_info_data_t;
143typedef struct host_sched_info *host_sched_info_t;
144#define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) \
145 (sizeof(host_sched_info_data_t)/sizeof(integer_t)))
146
147struct kernel_resource_sizes {
148 natural_t task;
149 natural_t thread;
150 natural_t port;
151 natural_t memory_region;
152 natural_t memory_object;
153};
154
155typedef struct kernel_resource_sizes kernel_resource_sizes_data_t;
156typedef struct kernel_resource_sizes *kernel_resource_sizes_t;
157#define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) \
158 (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t)))
159
160struct host_priority_info {
161 integer_t kernel_priority;
162 integer_t system_priority;
163 integer_t server_priority;
164 integer_t user_priority;
165 integer_t depress_priority;
166 integer_t idle_priority;
167 integer_t minimum_priority;
168 integer_t maximum_priority;
169};
170
171typedef struct host_priority_info host_priority_info_data_t;
172typedef struct host_priority_info *host_priority_info_t;
173#define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) \
174 (sizeof(host_priority_info_data_t)/sizeof(integer_t)))
175
176/* host_statistics() */
177#define HOST_LOAD_INFO 1 /* System loading stats */
178#define HOST_VM_INFO 2 /* Virtual memory stats */
179#define HOST_CPU_LOAD_INFO 3 /* CPU load stats */
180
181/* host_statistics64() */
182#define HOST_VM_INFO64 4 /* 64-bit virtual memory stats */
183#define HOST_EXTMOD_INFO64 5 /* External modification stats */
184#define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */
185
186
187struct host_load_info {
188 integer_t avenrun[3]; /* scaled by LOAD_SCALE */
189 integer_t mach_factor[3]; /* scaled by LOAD_SCALE */
190};
191
192typedef struct host_load_info host_load_info_data_t;
193typedef struct host_load_info *host_load_info_t;
194#define HOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
195 (sizeof(host_load_info_data_t)/sizeof(integer_t)))
196
197typedef struct vm_purgeable_info host_purgable_info_data_t;
198typedef struct vm_purgeable_info *host_purgable_info_t;
199#define HOST_VM_PURGABLE_COUNT ((mach_msg_type_number_t) \
200 (sizeof(host_purgable_info_data_t)/sizeof(integer_t)))
201
202/* in <mach/vm_statistics.h> */
203/* vm_statistics64 */
204#define HOST_VM_INFO64_COUNT ((mach_msg_type_number_t) \
205 (sizeof(vm_statistics64_data_t)/sizeof(integer_t)))
206
207/* size of the latest version of the structure */
208#define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT
209#define HOST_VM_INFO64_REV1_COUNT HOST_VM_INFO64_LATEST_COUNT
210/* previous versions: adjust the size according to what was added each time */
211#define HOST_VM_INFO64_REV0_COUNT /* added compression and swapper info (14 ints) */ \
212 ((mach_msg_type_number_t) \
213 (HOST_VM_INFO64_REV1_COUNT - 14))
214
215/* in <mach/vm_statistics.h> */
216/* vm_extmod_statistics */
217#define HOST_EXTMOD_INFO64_COUNT ((mach_msg_type_number_t) \
218 (sizeof(vm_extmod_statistics_data_t)/sizeof(integer_t)))
219
220/* size of the latest version of the structure */
221#define HOST_EXTMOD_INFO64_LATEST_COUNT HOST_EXTMOD_INFO64_COUNT
222
223/* vm_statistics */
224#define HOST_VM_INFO_COUNT ((mach_msg_type_number_t) \
225 (sizeof(vm_statistics_data_t)/sizeof(integer_t)))
226
227/* size of the latest version of the structure */
228#define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT
229#define HOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT
230/* previous versions: adjust the size according to what was added each time */
231#define HOST_VM_INFO_REV1_COUNT /* added "speculative_count" (1 int) */ \
232 ((mach_msg_type_number_t) \
233 (HOST_VM_INFO_REV2_COUNT - 1))
234#define HOST_VM_INFO_REV0_COUNT /* added "purgable" info (2 ints) */ \
235 ((mach_msg_type_number_t) \
236 (HOST_VM_INFO_REV1_COUNT - 2))
237
238struct host_cpu_load_info { /* number of ticks while running... */
239 natural_t cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */
240};
241
242typedef struct host_cpu_load_info host_cpu_load_info_data_t;
243typedef struct host_cpu_load_info *host_cpu_load_info_t;
244#define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
245 (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t)))
246
247struct host_preferred_user_arch {
248 cpu_type_t cpu_type; /* Preferred user-space cpu type */
249 cpu_subtype_t cpu_subtype; /* Preferred user-space cpu subtype */
250};
251
252typedef struct host_preferred_user_arch host_preferred_user_arch_data_t;
253typedef struct host_preferred_user_arch *host_preferred_user_arch_t;
254#define HOST_PREFERRED_USER_ARCH_COUNT ((mach_msg_type_number_t) \
255 (sizeof(host_preferred_user_arch_data_t)/sizeof(integer_t)))
256
257
258
259
260#endif /* _MACH_HOST_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/host_notify.h created+39
...@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_HOST_NOTIFY_H_
30#define _MACH_HOST_NOTIFY_H_
31
32#define HOST_NOTIFY_CALENDAR_CHANGE 0
33#define HOST_NOTIFY_CALENDAR_SET 1
34#define HOST_NOTIFY_TYPE_MAX 1
35
36#define HOST_CALENDAR_CHANGED_REPLYID 950
37#define HOST_CALENDAR_SET_REPLYID 951
38
39#endif /* _MACH_HOST_NOTIFY_H_ */
lib/libc/include/x86_64-macos-gnu/mach/host_priv.h created+1163
...@@ -0,0 +1,1163 @@
1#ifndef _host_priv_user_
2#define _host_priv_user_
3
4/* Module host_priv */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef host_priv_MSG_COUNT
52#define host_priv_MSG_COUNT 26
53#endif /* host_priv_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach/mach_types.h>
60#include <mach_debug/mach_debug_types.h>
61
62#ifdef __BeforeMigUserHeader
63__BeforeMigUserHeader
64#endif /* __BeforeMigUserHeader */
65
66#include <sys/cdefs.h>
67__BEGIN_DECLS
68
69
70/* Routine host_get_boot_info */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t host_get_boot_info
77(
78 host_priv_t host_priv,
79 kernel_boot_info_t boot_info
80);
81
82/* Routine host_reboot */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t host_reboot
89(
90 host_priv_t host_priv,
91 int options
92);
93
94/* Routine host_priv_statistics */
95#ifdef mig_external
96mig_external
97#else
98extern
99#endif /* mig_external */
100kern_return_t host_priv_statistics
101(
102 host_priv_t host_priv,
103 host_flavor_t flavor,
104 host_info_t host_info_out,
105 mach_msg_type_number_t *host_info_outCnt
106);
107
108/* Routine host_default_memory_manager */
109#ifdef mig_external
110mig_external
111#else
112extern
113#endif /* mig_external */
114kern_return_t host_default_memory_manager
115(
116 host_priv_t host_priv,
117 memory_object_default_t *default_manager,
118 memory_object_cluster_size_t cluster_size
119);
120
121/* Routine vm_wire */
122#ifdef mig_external
123mig_external
124#else
125extern
126#endif /* mig_external */
127kern_return_t vm_wire
128(
129 host_priv_t host_priv,
130 vm_map_t task,
131 vm_address_t address,
132 vm_size_t size,
133 vm_prot_t desired_access
134);
135
136/* Routine thread_wire */
137#ifdef mig_external
138mig_external
139#else
140extern
141#endif /* mig_external */
142kern_return_t thread_wire
143(
144 host_priv_t host_priv,
145 thread_act_t thread,
146 boolean_t wired
147);
148
149/* Routine vm_allocate_cpm */
150#ifdef mig_external
151mig_external
152#else
153extern
154#endif /* mig_external */
155kern_return_t vm_allocate_cpm
156(
157 host_priv_t host_priv,
158 vm_map_t task,
159 vm_address_t *address,
160 vm_size_t size,
161 int flags
162);
163
164/* Routine host_processors */
165#ifdef mig_external
166mig_external
167#else
168extern
169#endif /* mig_external */
170kern_return_t host_processors
171(
172 host_priv_t host_priv,
173 processor_array_t *out_processor_list,
174 mach_msg_type_number_t *out_processor_listCnt
175);
176
177/* Routine host_get_clock_control */
178#ifdef mig_external
179mig_external
180#else
181extern
182#endif /* mig_external */
183kern_return_t host_get_clock_control
184(
185 host_priv_t host_priv,
186 clock_id_t clock_id,
187 clock_ctrl_t *clock_ctrl
188);
189
190/* Routine kmod_create */
191#ifdef mig_external
192mig_external
193#else
194extern
195#endif /* mig_external */
196kern_return_t kmod_create
197(
198 host_priv_t host_priv,
199 vm_address_t info,
200 kmod_t *module
201);
202
203/* Routine kmod_destroy */
204#ifdef mig_external
205mig_external
206#else
207extern
208#endif /* mig_external */
209kern_return_t kmod_destroy
210(
211 host_priv_t host_priv,
212 kmod_t module
213);
214
215/* Routine kmod_control */
216#ifdef mig_external
217mig_external
218#else
219extern
220#endif /* mig_external */
221kern_return_t kmod_control
222(
223 host_priv_t host_priv,
224 kmod_t module,
225 kmod_control_flavor_t flavor,
226 kmod_args_t *data,
227 mach_msg_type_number_t *dataCnt
228);
229
230/* Routine host_get_special_port */
231#ifdef mig_external
232mig_external
233#else
234extern
235#endif /* mig_external */
236kern_return_t host_get_special_port
237(
238 host_priv_t host_priv,
239 int node,
240 int which,
241 mach_port_t *port
242);
243
244/* Routine host_set_special_port */
245#ifdef mig_external
246mig_external
247#else
248extern
249#endif /* mig_external */
250kern_return_t host_set_special_port
251(
252 host_priv_t host_priv,
253 int which,
254 mach_port_t port
255);
256
257/* Routine host_set_exception_ports */
258#ifdef mig_external
259mig_external
260#else
261extern
262#endif /* mig_external */
263kern_return_t host_set_exception_ports
264(
265 host_priv_t host_priv,
266 exception_mask_t exception_mask,
267 mach_port_t new_port,
268 exception_behavior_t behavior,
269 thread_state_flavor_t new_flavor
270);
271
272/* Routine host_get_exception_ports */
273#ifdef mig_external
274mig_external
275#else
276extern
277#endif /* mig_external */
278kern_return_t host_get_exception_ports
279(
280 host_priv_t host_priv,
281 exception_mask_t exception_mask,
282 exception_mask_array_t masks,
283 mach_msg_type_number_t *masksCnt,
284 exception_handler_array_t old_handlers,
285 exception_behavior_array_t old_behaviors,
286 exception_flavor_array_t old_flavors
287);
288
289/* Routine host_swap_exception_ports */
290#ifdef mig_external
291mig_external
292#else
293extern
294#endif /* mig_external */
295kern_return_t host_swap_exception_ports
296(
297 host_priv_t host_priv,
298 exception_mask_t exception_mask,
299 mach_port_t new_port,
300 exception_behavior_t behavior,
301 thread_state_flavor_t new_flavor,
302 exception_mask_array_t masks,
303 mach_msg_type_number_t *masksCnt,
304 exception_handler_array_t old_handlerss,
305 exception_behavior_array_t old_behaviors,
306 exception_flavor_array_t old_flavors
307);
308
309/* Routine mach_vm_wire */
310#ifdef mig_external
311mig_external
312#else
313extern
314#endif /* mig_external */
315kern_return_t mach_vm_wire
316(
317 host_priv_t host_priv,
318 vm_map_t task,
319 mach_vm_address_t address,
320 mach_vm_size_t size,
321 vm_prot_t desired_access
322);
323
324/* Routine host_processor_sets */
325#ifdef mig_external
326mig_external
327#else
328extern
329#endif /* mig_external */
330kern_return_t host_processor_sets
331(
332 host_priv_t host_priv,
333 processor_set_name_array_t *processor_sets,
334 mach_msg_type_number_t *processor_setsCnt
335);
336
337/* Routine host_processor_set_priv */
338#ifdef mig_external
339mig_external
340#else
341extern
342#endif /* mig_external */
343kern_return_t host_processor_set_priv
344(
345 host_priv_t host_priv,
346 processor_set_name_t set_name,
347 processor_set_t *set
348);
349
350/* Routine host_set_UNDServer */
351#ifdef mig_external
352mig_external
353#else
354extern
355#endif /* mig_external */
356kern_return_t host_set_UNDServer
357(
358 host_priv_t host,
359 UNDServerRef server
360);
361
362/* Routine host_get_UNDServer */
363#ifdef mig_external
364mig_external
365#else
366extern
367#endif /* mig_external */
368kern_return_t host_get_UNDServer
369(
370 host_priv_t host,
371 UNDServerRef *server
372);
373
374/* Routine kext_request */
375#ifdef mig_external
376mig_external
377#else
378extern
379#endif /* mig_external */
380kern_return_t kext_request
381(
382 host_priv_t host_priv,
383 uint32_t user_log_flags,
384 vm_offset_t request_data,
385 mach_msg_type_number_t request_dataCnt,
386 vm_offset_t *response_data,
387 mach_msg_type_number_t *response_dataCnt,
388 vm_offset_t *log_data,
389 mach_msg_type_number_t *log_dataCnt,
390 kern_return_t *op_result
391);
392
393__END_DECLS
394
395/********************** Caution **************************/
396/* The following data types should be used to calculate */
397/* maximum message sizes only. The actual message may be */
398/* smaller, and the position of the arguments within the */
399/* message layout may vary from what is presented here. */
400/* For example, if any of the arguments are variable- */
401/* sized, and less than the maximum is sent, the data */
402/* will be packed tight in the actual message to reduce */
403/* the presence of holes. */
404/********************** Caution **************************/
405
406/* typedefs for all requests */
407
408#ifndef __Request__host_priv_subsystem__defined
409#define __Request__host_priv_subsystem__defined
410
411#ifdef __MigPackStructs
412#pragma pack(push, 4)
413#endif
414 typedef struct {
415 mach_msg_header_t Head;
416 } __Request__host_get_boot_info_t __attribute__((unused));
417#ifdef __MigPackStructs
418#pragma pack(pop)
419#endif
420
421#ifdef __MigPackStructs
422#pragma pack(push, 4)
423#endif
424 typedef struct {
425 mach_msg_header_t Head;
426 NDR_record_t NDR;
427 int options;
428 } __Request__host_reboot_t __attribute__((unused));
429#ifdef __MigPackStructs
430#pragma pack(pop)
431#endif
432
433#ifdef __MigPackStructs
434#pragma pack(push, 4)
435#endif
436 typedef struct {
437 mach_msg_header_t Head;
438 NDR_record_t NDR;
439 host_flavor_t flavor;
440 mach_msg_type_number_t host_info_outCnt;
441 } __Request__host_priv_statistics_t __attribute__((unused));
442#ifdef __MigPackStructs
443#pragma pack(pop)
444#endif
445
446#ifdef __MigPackStructs
447#pragma pack(push, 4)
448#endif
449 typedef struct {
450 mach_msg_header_t Head;
451 /* start of the kernel processed data */
452 mach_msg_body_t msgh_body;
453 mach_msg_port_descriptor_t default_manager;
454 /* end of the kernel processed data */
455 NDR_record_t NDR;
456 memory_object_cluster_size_t cluster_size;
457 } __Request__host_default_memory_manager_t __attribute__((unused));
458#ifdef __MigPackStructs
459#pragma pack(pop)
460#endif
461
462#ifdef __MigPackStructs
463#pragma pack(push, 4)
464#endif
465 typedef struct {
466 mach_msg_header_t Head;
467 /* start of the kernel processed data */
468 mach_msg_body_t msgh_body;
469 mach_msg_port_descriptor_t task;
470 /* end of the kernel processed data */
471 NDR_record_t NDR;
472 vm_address_t address;
473 vm_size_t size;
474 vm_prot_t desired_access;
475 } __Request__vm_wire_t __attribute__((unused));
476#ifdef __MigPackStructs
477#pragma pack(pop)
478#endif
479
480#ifdef __MigPackStructs
481#pragma pack(push, 4)
482#endif
483 typedef struct {
484 mach_msg_header_t Head;
485 /* start of the kernel processed data */
486 mach_msg_body_t msgh_body;
487 mach_msg_port_descriptor_t thread;
488 /* end of the kernel processed data */
489 NDR_record_t NDR;
490 boolean_t wired;
491 } __Request__thread_wire_t __attribute__((unused));
492#ifdef __MigPackStructs
493#pragma pack(pop)
494#endif
495
496#ifdef __MigPackStructs
497#pragma pack(push, 4)
498#endif
499 typedef struct {
500 mach_msg_header_t Head;
501 /* start of the kernel processed data */
502 mach_msg_body_t msgh_body;
503 mach_msg_port_descriptor_t task;
504 /* end of the kernel processed data */
505 NDR_record_t NDR;
506 vm_address_t address;
507 vm_size_t size;
508 int flags;
509 } __Request__vm_allocate_cpm_t __attribute__((unused));
510#ifdef __MigPackStructs
511#pragma pack(pop)
512#endif
513
514#ifdef __MigPackStructs
515#pragma pack(push, 4)
516#endif
517 typedef struct {
518 mach_msg_header_t Head;
519 } __Request__host_processors_t __attribute__((unused));
520#ifdef __MigPackStructs
521#pragma pack(pop)
522#endif
523
524#ifdef __MigPackStructs
525#pragma pack(push, 4)
526#endif
527 typedef struct {
528 mach_msg_header_t Head;
529 NDR_record_t NDR;
530 clock_id_t clock_id;
531 } __Request__host_get_clock_control_t __attribute__((unused));
532#ifdef __MigPackStructs
533#pragma pack(pop)
534#endif
535
536#ifdef __MigPackStructs
537#pragma pack(push, 4)
538#endif
539 typedef struct {
540 mach_msg_header_t Head;
541 NDR_record_t NDR;
542 vm_address_t info;
543 } __Request__kmod_create_t __attribute__((unused));
544#ifdef __MigPackStructs
545#pragma pack(pop)
546#endif
547
548#ifdef __MigPackStructs
549#pragma pack(push, 4)
550#endif
551 typedef struct {
552 mach_msg_header_t Head;
553 NDR_record_t NDR;
554 kmod_t module;
555 } __Request__kmod_destroy_t __attribute__((unused));
556#ifdef __MigPackStructs
557#pragma pack(pop)
558#endif
559
560#ifdef __MigPackStructs
561#pragma pack(push, 4)
562#endif
563 typedef struct {
564 mach_msg_header_t Head;
565 /* start of the kernel processed data */
566 mach_msg_body_t msgh_body;
567 mach_msg_ool_descriptor_t data;
568 /* end of the kernel processed data */
569 NDR_record_t NDR;
570 kmod_t module;
571 kmod_control_flavor_t flavor;
572 mach_msg_type_number_t dataCnt;
573 } __Request__kmod_control_t __attribute__((unused));
574#ifdef __MigPackStructs
575#pragma pack(pop)
576#endif
577
578#ifdef __MigPackStructs
579#pragma pack(push, 4)
580#endif
581 typedef struct {
582 mach_msg_header_t Head;
583 NDR_record_t NDR;
584 int node;
585 int which;
586 } __Request__host_get_special_port_t __attribute__((unused));
587#ifdef __MigPackStructs
588#pragma pack(pop)
589#endif
590
591#ifdef __MigPackStructs
592#pragma pack(push, 4)
593#endif
594 typedef struct {
595 mach_msg_header_t Head;
596 /* start of the kernel processed data */
597 mach_msg_body_t msgh_body;
598 mach_msg_port_descriptor_t port;
599 /* end of the kernel processed data */
600 NDR_record_t NDR;
601 int which;
602 } __Request__host_set_special_port_t __attribute__((unused));
603#ifdef __MigPackStructs
604#pragma pack(pop)
605#endif
606
607#ifdef __MigPackStructs
608#pragma pack(push, 4)
609#endif
610 typedef struct {
611 mach_msg_header_t Head;
612 /* start of the kernel processed data */
613 mach_msg_body_t msgh_body;
614 mach_msg_port_descriptor_t new_port;
615 /* end of the kernel processed data */
616 NDR_record_t NDR;
617 exception_mask_t exception_mask;
618 exception_behavior_t behavior;
619 thread_state_flavor_t new_flavor;
620 } __Request__host_set_exception_ports_t __attribute__((unused));
621#ifdef __MigPackStructs
622#pragma pack(pop)
623#endif
624
625#ifdef __MigPackStructs
626#pragma pack(push, 4)
627#endif
628 typedef struct {
629 mach_msg_header_t Head;
630 NDR_record_t NDR;
631 exception_mask_t exception_mask;
632 } __Request__host_get_exception_ports_t __attribute__((unused));
633#ifdef __MigPackStructs
634#pragma pack(pop)
635#endif
636
637#ifdef __MigPackStructs
638#pragma pack(push, 4)
639#endif
640 typedef struct {
641 mach_msg_header_t Head;
642 /* start of the kernel processed data */
643 mach_msg_body_t msgh_body;
644 mach_msg_port_descriptor_t new_port;
645 /* end of the kernel processed data */
646 NDR_record_t NDR;
647 exception_mask_t exception_mask;
648 exception_behavior_t behavior;
649 thread_state_flavor_t new_flavor;
650 } __Request__host_swap_exception_ports_t __attribute__((unused));
651#ifdef __MigPackStructs
652#pragma pack(pop)
653#endif
654
655#ifdef __MigPackStructs
656#pragma pack(push, 4)
657#endif
658 typedef struct {
659 mach_msg_header_t Head;
660 /* start of the kernel processed data */
661 mach_msg_body_t msgh_body;
662 mach_msg_port_descriptor_t task;
663 /* end of the kernel processed data */
664 NDR_record_t NDR;
665 mach_vm_address_t address;
666 mach_vm_size_t size;
667 vm_prot_t desired_access;
668 } __Request__mach_vm_wire_t __attribute__((unused));
669#ifdef __MigPackStructs
670#pragma pack(pop)
671#endif
672
673#ifdef __MigPackStructs
674#pragma pack(push, 4)
675#endif
676 typedef struct {
677 mach_msg_header_t Head;
678 } __Request__host_processor_sets_t __attribute__((unused));
679#ifdef __MigPackStructs
680#pragma pack(pop)
681#endif
682
683#ifdef __MigPackStructs
684#pragma pack(push, 4)
685#endif
686 typedef struct {
687 mach_msg_header_t Head;
688 /* start of the kernel processed data */
689 mach_msg_body_t msgh_body;
690 mach_msg_port_descriptor_t set_name;
691 /* end of the kernel processed data */
692 } __Request__host_processor_set_priv_t __attribute__((unused));
693#ifdef __MigPackStructs
694#pragma pack(pop)
695#endif
696
697#ifdef __MigPackStructs
698#pragma pack(push, 4)
699#endif
700 typedef struct {
701 mach_msg_header_t Head;
702 /* start of the kernel processed data */
703 mach_msg_body_t msgh_body;
704 mach_msg_port_descriptor_t server;
705 /* end of the kernel processed data */
706 } __Request__host_set_UNDServer_t __attribute__((unused));
707#ifdef __MigPackStructs
708#pragma pack(pop)
709#endif
710
711#ifdef __MigPackStructs
712#pragma pack(push, 4)
713#endif
714 typedef struct {
715 mach_msg_header_t Head;
716 } __Request__host_get_UNDServer_t __attribute__((unused));
717#ifdef __MigPackStructs
718#pragma pack(pop)
719#endif
720
721#ifdef __MigPackStructs
722#pragma pack(push, 4)
723#endif
724 typedef struct {
725 mach_msg_header_t Head;
726 /* start of the kernel processed data */
727 mach_msg_body_t msgh_body;
728 mach_msg_ool_descriptor_t request_data;
729 /* end of the kernel processed data */
730 NDR_record_t NDR;
731 uint32_t user_log_flags;
732 mach_msg_type_number_t request_dataCnt;
733 } __Request__kext_request_t __attribute__((unused));
734#ifdef __MigPackStructs
735#pragma pack(pop)
736#endif
737#endif /* !__Request__host_priv_subsystem__defined */
738
739/* union of all requests */
740
741#ifndef __RequestUnion__host_priv_subsystem__defined
742#define __RequestUnion__host_priv_subsystem__defined
743union __RequestUnion__host_priv_subsystem {
744 __Request__host_get_boot_info_t Request_host_get_boot_info;
745 __Request__host_reboot_t Request_host_reboot;
746 __Request__host_priv_statistics_t Request_host_priv_statistics;
747 __Request__host_default_memory_manager_t Request_host_default_memory_manager;
748 __Request__vm_wire_t Request_vm_wire;
749 __Request__thread_wire_t Request_thread_wire;
750 __Request__vm_allocate_cpm_t Request_vm_allocate_cpm;
751 __Request__host_processors_t Request_host_processors;
752 __Request__host_get_clock_control_t Request_host_get_clock_control;
753 __Request__kmod_create_t Request_kmod_create;
754 __Request__kmod_destroy_t Request_kmod_destroy;
755 __Request__kmod_control_t Request_kmod_control;
756 __Request__host_get_special_port_t Request_host_get_special_port;
757 __Request__host_set_special_port_t Request_host_set_special_port;
758 __Request__host_set_exception_ports_t Request_host_set_exception_ports;
759 __Request__host_get_exception_ports_t Request_host_get_exception_ports;
760 __Request__host_swap_exception_ports_t Request_host_swap_exception_ports;
761 __Request__mach_vm_wire_t Request_mach_vm_wire;
762 __Request__host_processor_sets_t Request_host_processor_sets;
763 __Request__host_processor_set_priv_t Request_host_processor_set_priv;
764 __Request__host_set_UNDServer_t Request_host_set_UNDServer;
765 __Request__host_get_UNDServer_t Request_host_get_UNDServer;
766 __Request__kext_request_t Request_kext_request;
767};
768#endif /* !__RequestUnion__host_priv_subsystem__defined */
769/* typedefs for all replies */
770
771#ifndef __Reply__host_priv_subsystem__defined
772#define __Reply__host_priv_subsystem__defined
773
774#ifdef __MigPackStructs
775#pragma pack(push, 4)
776#endif
777 typedef struct {
778 mach_msg_header_t Head;
779 NDR_record_t NDR;
780 kern_return_t RetCode;
781 mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */
782 mach_msg_type_number_t boot_infoCnt;
783 char boot_info[4096];
784 } __Reply__host_get_boot_info_t __attribute__((unused));
785#ifdef __MigPackStructs
786#pragma pack(pop)
787#endif
788
789#ifdef __MigPackStructs
790#pragma pack(push, 4)
791#endif
792 typedef struct {
793 mach_msg_header_t Head;
794 NDR_record_t NDR;
795 kern_return_t RetCode;
796 } __Reply__host_reboot_t __attribute__((unused));
797#ifdef __MigPackStructs
798#pragma pack(pop)
799#endif
800
801#ifdef __MigPackStructs
802#pragma pack(push, 4)
803#endif
804 typedef struct {
805 mach_msg_header_t Head;
806 NDR_record_t NDR;
807 kern_return_t RetCode;
808 mach_msg_type_number_t host_info_outCnt;
809 integer_t host_info_out[68];
810 } __Reply__host_priv_statistics_t __attribute__((unused));
811#ifdef __MigPackStructs
812#pragma pack(pop)
813#endif
814
815#ifdef __MigPackStructs
816#pragma pack(push, 4)
817#endif
818 typedef struct {
819 mach_msg_header_t Head;
820 /* start of the kernel processed data */
821 mach_msg_body_t msgh_body;
822 mach_msg_port_descriptor_t default_manager;
823 /* end of the kernel processed data */
824 } __Reply__host_default_memory_manager_t __attribute__((unused));
825#ifdef __MigPackStructs
826#pragma pack(pop)
827#endif
828
829#ifdef __MigPackStructs
830#pragma pack(push, 4)
831#endif
832 typedef struct {
833 mach_msg_header_t Head;
834 NDR_record_t NDR;
835 kern_return_t RetCode;
836 } __Reply__vm_wire_t __attribute__((unused));
837#ifdef __MigPackStructs
838#pragma pack(pop)
839#endif
840
841#ifdef __MigPackStructs
842#pragma pack(push, 4)
843#endif
844 typedef struct {
845 mach_msg_header_t Head;
846 NDR_record_t NDR;
847 kern_return_t RetCode;
848 } __Reply__thread_wire_t __attribute__((unused));
849#ifdef __MigPackStructs
850#pragma pack(pop)
851#endif
852
853#ifdef __MigPackStructs
854#pragma pack(push, 4)
855#endif
856 typedef struct {
857 mach_msg_header_t Head;
858 NDR_record_t NDR;
859 kern_return_t RetCode;
860 vm_address_t address;
861 } __Reply__vm_allocate_cpm_t __attribute__((unused));
862#ifdef __MigPackStructs
863#pragma pack(pop)
864#endif
865
866#ifdef __MigPackStructs
867#pragma pack(push, 4)
868#endif
869 typedef struct {
870 mach_msg_header_t Head;
871 /* start of the kernel processed data */
872 mach_msg_body_t msgh_body;
873 mach_msg_ool_ports_descriptor_t out_processor_list;
874 /* end of the kernel processed data */
875 NDR_record_t NDR;
876 mach_msg_type_number_t out_processor_listCnt;
877 } __Reply__host_processors_t __attribute__((unused));
878#ifdef __MigPackStructs
879#pragma pack(pop)
880#endif
881
882#ifdef __MigPackStructs
883#pragma pack(push, 4)
884#endif
885 typedef struct {
886 mach_msg_header_t Head;
887 /* start of the kernel processed data */
888 mach_msg_body_t msgh_body;
889 mach_msg_port_descriptor_t clock_ctrl;
890 /* end of the kernel processed data */
891 } __Reply__host_get_clock_control_t __attribute__((unused));
892#ifdef __MigPackStructs
893#pragma pack(pop)
894#endif
895
896#ifdef __MigPackStructs
897#pragma pack(push, 4)
898#endif
899 typedef struct {
900 mach_msg_header_t Head;
901 NDR_record_t NDR;
902 kern_return_t RetCode;
903 kmod_t module;
904 } __Reply__kmod_create_t __attribute__((unused));
905#ifdef __MigPackStructs
906#pragma pack(pop)
907#endif
908
909#ifdef __MigPackStructs
910#pragma pack(push, 4)
911#endif
912 typedef struct {
913 mach_msg_header_t Head;
914 NDR_record_t NDR;
915 kern_return_t RetCode;
916 } __Reply__kmod_destroy_t __attribute__((unused));
917#ifdef __MigPackStructs
918#pragma pack(pop)
919#endif
920
921#ifdef __MigPackStructs
922#pragma pack(push, 4)
923#endif
924 typedef struct {
925 mach_msg_header_t Head;
926 /* start of the kernel processed data */
927 mach_msg_body_t msgh_body;
928 mach_msg_ool_descriptor_t data;
929 /* end of the kernel processed data */
930 NDR_record_t NDR;
931 mach_msg_type_number_t dataCnt;
932 } __Reply__kmod_control_t __attribute__((unused));
933#ifdef __MigPackStructs
934#pragma pack(pop)
935#endif
936
937#ifdef __MigPackStructs
938#pragma pack(push, 4)
939#endif
940 typedef struct {
941 mach_msg_header_t Head;
942 /* start of the kernel processed data */
943 mach_msg_body_t msgh_body;
944 mach_msg_port_descriptor_t port;
945 /* end of the kernel processed data */
946 } __Reply__host_get_special_port_t __attribute__((unused));
947#ifdef __MigPackStructs
948#pragma pack(pop)
949#endif
950
951#ifdef __MigPackStructs
952#pragma pack(push, 4)
953#endif
954 typedef struct {
955 mach_msg_header_t Head;
956 NDR_record_t NDR;
957 kern_return_t RetCode;
958 } __Reply__host_set_special_port_t __attribute__((unused));
959#ifdef __MigPackStructs
960#pragma pack(pop)
961#endif
962
963#ifdef __MigPackStructs
964#pragma pack(push, 4)
965#endif
966 typedef struct {
967 mach_msg_header_t Head;
968 NDR_record_t NDR;
969 kern_return_t RetCode;
970 } __Reply__host_set_exception_ports_t __attribute__((unused));
971#ifdef __MigPackStructs
972#pragma pack(pop)
973#endif
974
975#ifdef __MigPackStructs
976#pragma pack(push, 4)
977#endif
978 typedef struct {
979 mach_msg_header_t Head;
980 /* start of the kernel processed data */
981 mach_msg_body_t msgh_body;
982 mach_msg_port_descriptor_t old_handlers[32];
983 /* end of the kernel processed data */
984 NDR_record_t NDR;
985 mach_msg_type_number_t masksCnt;
986 exception_mask_t masks[32];
987 exception_behavior_t old_behaviors[32];
988 thread_state_flavor_t old_flavors[32];
989 } __Reply__host_get_exception_ports_t __attribute__((unused));
990#ifdef __MigPackStructs
991#pragma pack(pop)
992#endif
993
994#ifdef __MigPackStructs
995#pragma pack(push, 4)
996#endif
997 typedef struct {
998 mach_msg_header_t Head;
999 /* start of the kernel processed data */
1000 mach_msg_body_t msgh_body;
1001 mach_msg_port_descriptor_t old_handlerss[32];
1002 /* end of the kernel processed data */
1003 NDR_record_t NDR;
1004 mach_msg_type_number_t masksCnt;
1005 exception_mask_t masks[32];
1006 exception_behavior_t old_behaviors[32];
1007 thread_state_flavor_t old_flavors[32];
1008 } __Reply__host_swap_exception_ports_t __attribute__((unused));
1009#ifdef __MigPackStructs
1010#pragma pack(pop)
1011#endif
1012
1013#ifdef __MigPackStructs
1014#pragma pack(push, 4)
1015#endif
1016 typedef struct {
1017 mach_msg_header_t Head;
1018 NDR_record_t NDR;
1019 kern_return_t RetCode;
1020 } __Reply__mach_vm_wire_t __attribute__((unused));
1021#ifdef __MigPackStructs
1022#pragma pack(pop)
1023#endif
1024
1025#ifdef __MigPackStructs
1026#pragma pack(push, 4)
1027#endif
1028 typedef struct {
1029 mach_msg_header_t Head;
1030 /* start of the kernel processed data */
1031 mach_msg_body_t msgh_body;
1032 mach_msg_ool_ports_descriptor_t processor_sets;
1033 /* end of the kernel processed data */
1034 NDR_record_t NDR;
1035 mach_msg_type_number_t processor_setsCnt;
1036 } __Reply__host_processor_sets_t __attribute__((unused));
1037#ifdef __MigPackStructs
1038#pragma pack(pop)
1039#endif
1040
1041#ifdef __MigPackStructs
1042#pragma pack(push, 4)
1043#endif
1044 typedef struct {
1045 mach_msg_header_t Head;
1046 /* start of the kernel processed data */
1047 mach_msg_body_t msgh_body;
1048 mach_msg_port_descriptor_t set;
1049 /* end of the kernel processed data */
1050 } __Reply__host_processor_set_priv_t __attribute__((unused));
1051#ifdef __MigPackStructs
1052#pragma pack(pop)
1053#endif
1054
1055#ifdef __MigPackStructs
1056#pragma pack(push, 4)
1057#endif
1058 typedef struct {
1059 mach_msg_header_t Head;
1060 NDR_record_t NDR;
1061 kern_return_t RetCode;
1062 } __Reply__host_set_UNDServer_t __attribute__((unused));
1063#ifdef __MigPackStructs
1064#pragma pack(pop)
1065#endif
1066
1067#ifdef __MigPackStructs
1068#pragma pack(push, 4)
1069#endif
1070 typedef struct {
1071 mach_msg_header_t Head;
1072 /* start of the kernel processed data */
1073 mach_msg_body_t msgh_body;
1074 mach_msg_port_descriptor_t server;
1075 /* end of the kernel processed data */
1076 } __Reply__host_get_UNDServer_t __attribute__((unused));
1077#ifdef __MigPackStructs
1078#pragma pack(pop)
1079#endif
1080
1081#ifdef __MigPackStructs
1082#pragma pack(push, 4)
1083#endif
1084 typedef struct {
1085 mach_msg_header_t Head;
1086 /* start of the kernel processed data */
1087 mach_msg_body_t msgh_body;
1088 mach_msg_ool_descriptor_t response_data;
1089 mach_msg_ool_descriptor_t log_data;
1090 /* end of the kernel processed data */
1091 NDR_record_t NDR;
1092 mach_msg_type_number_t response_dataCnt;
1093 mach_msg_type_number_t log_dataCnt;
1094 kern_return_t op_result;
1095 } __Reply__kext_request_t __attribute__((unused));
1096#ifdef __MigPackStructs
1097#pragma pack(pop)
1098#endif
1099#endif /* !__Reply__host_priv_subsystem__defined */
1100
1101/* union of all replies */
1102
1103#ifndef __ReplyUnion__host_priv_subsystem__defined
1104#define __ReplyUnion__host_priv_subsystem__defined
1105union __ReplyUnion__host_priv_subsystem {
1106 __Reply__host_get_boot_info_t Reply_host_get_boot_info;
1107 __Reply__host_reboot_t Reply_host_reboot;
1108 __Reply__host_priv_statistics_t Reply_host_priv_statistics;
1109 __Reply__host_default_memory_manager_t Reply_host_default_memory_manager;
1110 __Reply__vm_wire_t Reply_vm_wire;
1111 __Reply__thread_wire_t Reply_thread_wire;
1112 __Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm;
1113 __Reply__host_processors_t Reply_host_processors;
1114 __Reply__host_get_clock_control_t Reply_host_get_clock_control;
1115 __Reply__kmod_create_t Reply_kmod_create;
1116 __Reply__kmod_destroy_t Reply_kmod_destroy;
1117 __Reply__kmod_control_t Reply_kmod_control;
1118 __Reply__host_get_special_port_t Reply_host_get_special_port;
1119 __Reply__host_set_special_port_t Reply_host_set_special_port;
1120 __Reply__host_set_exception_ports_t Reply_host_set_exception_ports;
1121 __Reply__host_get_exception_ports_t Reply_host_get_exception_ports;
1122 __Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports;
1123 __Reply__mach_vm_wire_t Reply_mach_vm_wire;
1124 __Reply__host_processor_sets_t Reply_host_processor_sets;
1125 __Reply__host_processor_set_priv_t Reply_host_processor_set_priv;
1126 __Reply__host_set_UNDServer_t Reply_host_set_UNDServer;
1127 __Reply__host_get_UNDServer_t Reply_host_get_UNDServer;
1128 __Reply__kext_request_t Reply_kext_request;
1129};
1130#endif /* !__RequestUnion__host_priv_subsystem__defined */
1131
1132#ifndef subsystem_to_name_map_host_priv
1133#define subsystem_to_name_map_host_priv \
1134 { "host_get_boot_info", 400 },\
1135 { "host_reboot", 401 },\
1136 { "host_priv_statistics", 402 },\
1137 { "host_default_memory_manager", 403 },\
1138 { "vm_wire", 404 },\
1139 { "thread_wire", 405 },\
1140 { "vm_allocate_cpm", 406 },\
1141 { "host_processors", 407 },\
1142 { "host_get_clock_control", 408 },\
1143 { "kmod_create", 409 },\
1144 { "kmod_destroy", 410 },\
1145 { "kmod_control", 411 },\
1146 { "host_get_special_port", 412 },\
1147 { "host_set_special_port", 413 },\
1148 { "host_set_exception_ports", 414 },\
1149 { "host_get_exception_ports", 415 },\
1150 { "host_swap_exception_ports", 416 },\
1151 { "mach_vm_wire", 418 },\
1152 { "host_processor_sets", 419 },\
1153 { "host_processor_set_priv", 420 },\
1154 { "host_set_UNDServer", 423 },\
1155 { "host_get_UNDServer", 424 },\
1156 { "kext_request", 425 }
1157#endif
1158
1159#ifdef __AfterMigUserHeader
1160__AfterMigUserHeader
1161#endif /* __AfterMigUserHeader */
1162
1163#endif /* _host_priv_user_ */
lib/libc/include/x86_64-macos-gnu/mach/host_security.h created+221
...@@ -0,0 +1,221 @@
1#ifndef _host_security_user_
2#define _host_security_user_
3
4/* Module host_security */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef host_security_MSG_COUNT
52#define host_security_MSG_COUNT 2
53#endif /* host_security_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine host_security_create_task_token */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t host_security_create_task_token
75(
76 host_security_t host_security,
77 task_t parent_task,
78 security_token_t sec_token,
79 audit_token_t audit_token,
80 host_t host,
81 ledger_array_t ledgers,
82 mach_msg_type_number_t ledgersCnt,
83 boolean_t inherit_memory,
84 task_t *child_task
85);
86
87/* Routine host_security_set_task_token */
88#ifdef mig_external
89mig_external
90#else
91extern
92#endif /* mig_external */
93kern_return_t host_security_set_task_token
94(
95 host_security_t host_security,
96 task_t target_task,
97 security_token_t sec_token,
98 audit_token_t audit_token,
99 host_t host
100);
101
102__END_DECLS
103
104/********************** Caution **************************/
105/* The following data types should be used to calculate */
106/* maximum message sizes only. The actual message may be */
107/* smaller, and the position of the arguments within the */
108/* message layout may vary from what is presented here. */
109/* For example, if any of the arguments are variable- */
110/* sized, and less than the maximum is sent, the data */
111/* will be packed tight in the actual message to reduce */
112/* the presence of holes. */
113/********************** Caution **************************/
114
115/* typedefs for all requests */
116
117#ifndef __Request__host_security_subsystem__defined
118#define __Request__host_security_subsystem__defined
119
120#ifdef __MigPackStructs
121#pragma pack(push, 4)
122#endif
123 typedef struct {
124 mach_msg_header_t Head;
125 /* start of the kernel processed data */
126 mach_msg_body_t msgh_body;
127 mach_msg_port_descriptor_t parent_task;
128 mach_msg_port_descriptor_t host;
129 mach_msg_ool_ports_descriptor_t ledgers;
130 /* end of the kernel processed data */
131 NDR_record_t NDR;
132 security_token_t sec_token;
133 audit_token_t audit_token;
134 mach_msg_type_number_t ledgersCnt;
135 boolean_t inherit_memory;
136 } __Request__host_security_create_task_token_t __attribute__((unused));
137#ifdef __MigPackStructs
138#pragma pack(pop)
139#endif
140
141#ifdef __MigPackStructs
142#pragma pack(push, 4)
143#endif
144 typedef struct {
145 mach_msg_header_t Head;
146 /* start of the kernel processed data */
147 mach_msg_body_t msgh_body;
148 mach_msg_port_descriptor_t target_task;
149 mach_msg_port_descriptor_t host;
150 /* end of the kernel processed data */
151 NDR_record_t NDR;
152 security_token_t sec_token;
153 audit_token_t audit_token;
154 } __Request__host_security_set_task_token_t __attribute__((unused));
155#ifdef __MigPackStructs
156#pragma pack(pop)
157#endif
158#endif /* !__Request__host_security_subsystem__defined */
159
160/* union of all requests */
161
162#ifndef __RequestUnion__host_security_subsystem__defined
163#define __RequestUnion__host_security_subsystem__defined
164union __RequestUnion__host_security_subsystem {
165 __Request__host_security_create_task_token_t Request_host_security_create_task_token;
166 __Request__host_security_set_task_token_t Request_host_security_set_task_token;
167};
168#endif /* !__RequestUnion__host_security_subsystem__defined */
169/* typedefs for all replies */
170
171#ifndef __Reply__host_security_subsystem__defined
172#define __Reply__host_security_subsystem__defined
173
174#ifdef __MigPackStructs
175#pragma pack(push, 4)
176#endif
177 typedef struct {
178 mach_msg_header_t Head;
179 /* start of the kernel processed data */
180 mach_msg_body_t msgh_body;
181 mach_msg_port_descriptor_t child_task;
182 /* end of the kernel processed data */
183 } __Reply__host_security_create_task_token_t __attribute__((unused));
184#ifdef __MigPackStructs
185#pragma pack(pop)
186#endif
187
188#ifdef __MigPackStructs
189#pragma pack(push, 4)
190#endif
191 typedef struct {
192 mach_msg_header_t Head;
193 NDR_record_t NDR;
194 kern_return_t RetCode;
195 } __Reply__host_security_set_task_token_t __attribute__((unused));
196#ifdef __MigPackStructs
197#pragma pack(pop)
198#endif
199#endif /* !__Reply__host_security_subsystem__defined */
200
201/* union of all replies */
202
203#ifndef __ReplyUnion__host_security_subsystem__defined
204#define __ReplyUnion__host_security_subsystem__defined
205union __ReplyUnion__host_security_subsystem {
206 __Reply__host_security_create_task_token_t Reply_host_security_create_task_token;
207 __Reply__host_security_set_task_token_t Reply_host_security_set_task_token;
208};
209#endif /* !__RequestUnion__host_security_subsystem__defined */
210
211#ifndef subsystem_to_name_map_host_security
212#define subsystem_to_name_map_host_security \
213 { "host_security_create_task_token", 600 },\
214 { "host_security_set_task_token", 601 }
215#endif
216
217#ifdef __AfterMigUserHeader
218__AfterMigUserHeader
219#endif /* __AfterMigUserHeader */
220
221#endif /* _host_security_user_ */
lib/libc/include/x86_64-macos-gnu/mach/host_special_ports.h created+281
...@@ -0,0 +1,281 @@
1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/host_special_ports.h
60 *
61 * Defines codes for access to host-wide special ports.
62 */
63
64#ifndef _MACH_HOST_SPECIAL_PORTS_H_
65#define _MACH_HOST_SPECIAL_PORTS_H_
66
67/*
68 * Cannot be set or gotten from user space
69 */
70#define HOST_SECURITY_PORT 0
71
72#define HOST_MIN_SPECIAL_PORT HOST_SECURITY_PORT
73
74/*
75 * Always provided by kernel (cannot be set from user-space).
76 */
77#define HOST_PORT 1
78#define HOST_PRIV_PORT 2
79#define HOST_IO_MASTER_PORT 3
80#define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */
81
82#define HOST_LAST_SPECIAL_KERNEL_PORT HOST_IO_MASTER_PORT
83
84/*
85 * Not provided by kernel
86 */
87#define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT)
88#define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT)
89#define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT)
90#define HOST_AUTOMOUNTD_PORT (4 + HOST_MAX_SPECIAL_KERNEL_PORT)
91#define HOST_LOCKD_PORT (5 + HOST_MAX_SPECIAL_KERNEL_PORT)
92#define HOST_KTRACE_BACKGROUND_PORT (6 + HOST_MAX_SPECIAL_KERNEL_PORT)
93#define HOST_SEATBELT_PORT (7 + HOST_MAX_SPECIAL_KERNEL_PORT)
94#define HOST_KEXTD_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT)
95#define HOST_LAUNCHCTL_PORT (9 + HOST_MAX_SPECIAL_KERNEL_PORT)
96#define HOST_UNFREED_PORT (10 + HOST_MAX_SPECIAL_KERNEL_PORT)
97#define HOST_AMFID_PORT (11 + HOST_MAX_SPECIAL_KERNEL_PORT)
98#define HOST_GSSD_PORT (12 + HOST_MAX_SPECIAL_KERNEL_PORT)
99#define HOST_TELEMETRY_PORT (13 + HOST_MAX_SPECIAL_KERNEL_PORT)
100#define HOST_ATM_NOTIFICATION_PORT (14 + HOST_MAX_SPECIAL_KERNEL_PORT)
101#define HOST_COALITION_PORT (15 + HOST_MAX_SPECIAL_KERNEL_PORT)
102#define HOST_SYSDIAGNOSE_PORT (16 + HOST_MAX_SPECIAL_KERNEL_PORT)
103#define HOST_XPC_EXCEPTION_PORT (17 + HOST_MAX_SPECIAL_KERNEL_PORT)
104#define HOST_CONTAINERD_PORT (18 + HOST_MAX_SPECIAL_KERNEL_PORT)
105#define HOST_NODE_PORT (19 + HOST_MAX_SPECIAL_KERNEL_PORT)
106#define HOST_RESOURCE_NOTIFY_PORT (20 + HOST_MAX_SPECIAL_KERNEL_PORT)
107#define HOST_CLOSURED_PORT (21 + HOST_MAX_SPECIAL_KERNEL_PORT)
108#define HOST_SYSPOLICYD_PORT (22 + HOST_MAX_SPECIAL_KERNEL_PORT)
109#define HOST_FILECOORDINATIOND_PORT (23 + HOST_MAX_SPECIAL_KERNEL_PORT)
110#define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT)
111
112#define HOST_MAX_SPECIAL_PORT HOST_FAIRPLAYD_PORT
113/* MAX = last since rdar://35861175 */
114
115/* obsolete name */
116#define HOST_CHUD_PORT HOST_LAUNCHCTL_PORT
117
118/*
119 * Special node identifier to always represent the local node.
120 */
121#define HOST_LOCAL_NODE -1
122
123/*
124 * Definitions for ease of use.
125 *
126 * In the get call, the host parameter can be any host, but will generally
127 * be the local node host port. In the set call, the host must the per-node
128 * host port for the node being affected.
129 */
130#define host_get_host_port(host, port) \
131 (host_get_special_port((host), \
132 HOST_LOCAL_NODE, HOST_PORT, (port)))
133#define host_set_host_port(host, port) (KERN_INVALID_ARGUMENT)
134
135#define host_get_host_priv_port(host, port) \
136 (host_get_special_port((host), \
137 HOST_LOCAL_NODE, HOST_PRIV_PORT, (port)))
138#define host_set_host_priv_port(host, port) (KERN_INVALID_ARGUMENT)
139
140#define host_get_io_master_port(host, port) \
141 (host_get_special_port((host), \
142 HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port)))
143#define host_set_io_master_port(host, port) (KERN_INVALID_ARGUMENT)
144
145/*
146 * User-settable special ports.
147 */
148#define host_get_dynamic_pager_port(host, port) \
149 (host_get_special_port((host), \
150 HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port)))
151#define host_set_dynamic_pager_port(host, port) \
152 (host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port)))
153
154#define host_get_audit_control_port(host, port) \
155 (host_get_special_port((host), \
156 HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port)))
157#define host_set_audit_control_port(host, port) \
158 (host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port)))
159
160#define host_get_user_notification_port(host, port) \
161 (host_get_special_port((host), \
162 HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port)))
163#define host_set_user_notification_port(host, port) \
164 (host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port)))
165
166#define host_get_automountd_port(host, port) \
167 (host_get_special_port((host), \
168 HOST_LOCAL_NODE, HOST_AUTOMOUNTD_PORT, (port)))
169#define host_set_automountd_port(host, port) \
170 (host_set_special_port((host), HOST_AUTOMOUNTD_PORT, (port)))
171
172#define host_get_lockd_port(host, port) \
173 (host_get_special_port((host), \
174 HOST_LOCAL_NODE, HOST_LOCKD_PORT, (port)))
175#define host_set_lockd_port(host, port) \
176 (host_set_special_port((host), HOST_LOCKD_PORT, (port)))
177
178#define host_get_ktrace_background_port(host, port) \
179 (host_get_special_port((host), \
180 HOST_LOCAL_NODE, HOST_KTRACE_BACKGROUND_PORT, (port)))
181#define host_set_ktrace_background_port(host, port) \
182 (host_set_special_port((host), HOST_KTRACE_BACKGROUND_PORT, (port)))
183
184#define host_get_kextd_port(host, port) \
185 (host_get_special_port((host), \
186 HOST_LOCAL_NODE, HOST_KEXTD_PORT, (port)))
187#define host_set_kextd_port(host, port) \
188 (host_set_special_port((host), HOST_KEXTD_PORT, (port)))
189
190#define host_get_launchctl_port(host, port) \
191 (host_get_special_port((host), HOST_LOCAL_NODE, HOST_LAUNCHCTL_PORT, \
192 (port)))
193#define host_set_launchctl_port(host, port) \
194 (host_set_special_port((host), HOST_LAUNCHCTL_PORT, (port)))
195
196#define host_get_chud_port(host, port) host_get_launchctl_port(host, port)
197#define host_set_chud_port(host, port) host_set_launchctl_port(host, port)
198
199#define host_get_unfreed_port(host, port) \
200 (host_get_special_port((host), \
201 HOST_LOCAL_NODE, HOST_UNFREED_PORT, (port)))
202#define host_set_unfreed_port(host, port) \
203 (host_set_special_port((host), HOST_UNFREED_PORT, (port)))
204
205#define host_get_amfid_port(host, port) \
206 (host_get_special_port((host), \
207 HOST_LOCAL_NODE, HOST_AMFID_PORT, (port)))
208#define host_set_amfid_port(host, port) \
209 (host_set_special_port((host), HOST_AMFID_PORT, (port)))
210
211#define host_get_gssd_port(host, port) \
212 (host_get_special_port((host), \
213 HOST_LOCAL_NODE, HOST_GSSD_PORT, (port)))
214#define host_set_gssd_port(host, port) \
215 (host_set_special_port((host), HOST_GSSD_PORT, (port)))
216
217#define host_get_telemetry_port(host, port) \
218 (host_get_special_port((host), \
219 HOST_LOCAL_NODE, HOST_TELEMETRY_PORT, (port)))
220#define host_set_telemetry_port(host, port) \
221 (host_set_special_port((host), HOST_TELEMETRY_PORT, (port)))
222
223#define host_get_atm_notification_port(host, port) \
224 (host_get_special_port((host), \
225 HOST_LOCAL_NODE, HOST_ATM_NOTIFICATION_PORT, (port)))
226#define host_set_atm_notification_port(host, port) \
227 (host_set_special_port((host), HOST_ATM_NOTIFICATION_PORT, (port)))
228
229#define host_get_coalition_port(host, port) \
230 (host_get_special_port((host), \
231 HOST_LOCAL_NODE, HOST_COALITION_PORT, (port)))
232#define host_set_coalition_port(host, port) \
233 (host_set_special_port((host), HOST_COALITION_PORT, (port)))
234
235#define host_get_sysdiagnose_port(host, port) \
236 (host_get_special_port((host), \
237 HOST_LOCAL_NODE, HOST_SYSDIAGNOSE_PORT, (port)))
238#define host_set_sysdiagnose_port(host, port) \
239 (host_set_special_port((host), HOST_SYSDIAGNOSE_PORT, (port)))
240
241#define host_get_container_port(host, port) \
242 (host_get_special_port((host), \
243 HOST_LOCAL_NODE, HOST_CONTAINERD_PORT, (port)))
244#define host_set_container_port(host, port) \
245 (host_set_special_port((host), HOST_CONTAINERD_PORT, (port)))
246
247#define host_get_node_port(host, port) \
248 (host_get_special_port((host), \
249 HOST_LOCAL_NODE, HOST_NODE_PORT, (port)))
250#define host_set_node_port(host, port) \
251 (host_set_special_port((host), HOST_NODE_PORT, (port)))
252
253#define host_get_closured_port(host, port) \
254 (host_get_special_port((host), \
255 HOST_LOCAL_NODE, HOST_CLOSURED_PORT, (port)))
256#define host_set_closured_port(host, port) \
257 (host_set_special_port((host), HOST_CLOSURED_PORT, (port)))
258
259#define host_get_syspolicyd_port(host, port) \
260 (host_get_special_port((host), \
261 HOST_LOCAL_NODE, HOST_SYSPOLICYD_PORT, (port)))
262#define host_set_syspolicyd_port(host, port) \
263 (host_set_special_port((host), HOST_SYSPOLICYD_PORT, (port)))
264
265#define host_get_filecoordinationd_port(host, port) \
266 (host_get_special_port((host), \
267 HOST_LOCAL_NODE, HOST_FILECOORDINATIOND_PORT, (port)))
268#define host_set_filecoordinationd_port(host, port) \
269 (host_set_special_port((host), HOST_FILECOORDINATIOND_PORT, (port)))
270
271#define host_get_fairplayd_port(host, port) \
272 (host_get_special_port((host), \
273 HOST_LOCAL_NODE, HOST_FAIRPLAYD_PORT, (port)))
274#define host_set_fairplayd_port(host, port) \
275 (host_set_special_port((host), HOST_FAIRPLAYD_PORT, (port)))
276
277/* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences.
278 * All lookups go through send_resource_violation()
279 */
280
281#endif /* _MACH_HOST_SPECIAL_PORTS_H_ */
lib/libc/include/x86_64-macos-gnu/mach/i386/processor_info.h created+37
...@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * File: mach/i386/processor_info.h
30 *
31 * Data structure definitions for i386 specific processor control
32 */
33
34#ifndef _MACH_I386_PROCESSOR_INFO_H_
35#define _MACH_I386_PROCESSOR_INFO_H_
36
37#endif /* _MACH_I386_PROCESSOR_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/i386/rpc.h created+35
...@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32#ifndef _MACH_I386_RPC_H_
33#define _MACH_I386_RPC_H_
34
35#endif /* _MACH_I386_RPC_H_ */
lib/libc/include/x86_64-macos-gnu/mach/kmod.h created+180
...@@ -0,0 +1,180 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
30 * support for mandatory and extensible security protections. This notice
31 * is included in support of clause 2.2 (b) of the Apple Public License,
32 * Version 2.0.
33 */
34
35#ifndef _MACH_KMOD_H_
36#define _MACH_KMOD_H_
37
38#include <mach/kern_return.h>
39#include <mach/mach_types.h>
40
41#include <sys/cdefs.h>
42
43__BEGIN_DECLS
44
45#if PRAGMA_MARK
46#pragma mark Basic macros & typedefs
47#endif
48/***********************************************************************
49* Basic macros & typedefs
50***********************************************************************/
51#define KMOD_MAX_NAME 64
52
53#define KMOD_RETURN_SUCCESS KERN_SUCCESS
54#define KMOD_RETURN_FAILURE KERN_FAILURE
55
56typedef int kmod_t;
57
58struct kmod_info;
59typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data);
60typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data);
61
62#if PRAGMA_MARK
63#pragma mark Structure definitions
64#endif
65/***********************************************************************
66* Structure definitions
67*
68* All structures must be #pragma pack(4).
69***********************************************************************/
70#pragma pack(push, 4)
71
72/* Run-time struct only; never saved to a file */
73typedef struct kmod_reference {
74 struct kmod_reference * next;
75 struct kmod_info * info;
76} kmod_reference_t;
77
78/***********************************************************************
79* Warning: Any changes to the kmod_info structure affect the
80* KMOD_..._DECL macros below.
81***********************************************************************/
82
83/* The kmod_info_t structure is only safe to use inside the running
84 * kernel. If you need to work with a kmod_info_t structure outside
85 * the kernel, please use the compatibility definitions below.
86 */
87typedef struct kmod_info {
88 struct kmod_info * next;
89 int32_t info_version; // version of this structure
90 uint32_t id;
91 char name[KMOD_MAX_NAME];
92 char version[KMOD_MAX_NAME];
93 int32_t reference_count; // # linkage refs to this
94 kmod_reference_t * reference_list; // who this refs (links on)
95 vm_address_t address; // starting address
96 vm_size_t size; // total size
97 vm_size_t hdr_size; // unwired hdr size
98 kmod_start_func_t * start;
99 kmod_stop_func_t * stop;
100} kmod_info_t;
101
102/* A compatibility definition of kmod_info_t for 32-bit kexts.
103 */
104typedef struct kmod_info_32_v1 {
105 uint32_t next_addr;
106 int32_t info_version;
107 uint32_t id;
108 uint8_t name[KMOD_MAX_NAME];
109 uint8_t version[KMOD_MAX_NAME];
110 int32_t reference_count;
111 uint32_t reference_list_addr;
112 uint32_t address;
113 uint32_t size;
114 uint32_t hdr_size;
115 uint32_t start_addr;
116 uint32_t stop_addr;
117} kmod_info_32_v1_t;
118
119/* A compatibility definition of kmod_info_t for 64-bit kexts.
120 */
121typedef struct kmod_info_64_v1 {
122 uint64_t next_addr;
123 int32_t info_version;
124 uint32_t id;
125 uint8_t name[KMOD_MAX_NAME];
126 uint8_t version[KMOD_MAX_NAME];
127 int32_t reference_count;
128 uint64_t reference_list_addr;
129 uint64_t address;
130 uint64_t size;
131 uint64_t hdr_size;
132 uint64_t start_addr;
133 uint64_t stop_addr;
134} kmod_info_64_v1_t;
135
136#pragma pack(pop)
137
138#if PRAGMA_MARK
139#pragma mark Kmod structure declaration macros
140#endif
141/***********************************************************************
142* Kmod structure declaration macros
143***********************************************************************/
144#define KMOD_INFO_NAME kmod_info
145#define KMOD_INFO_VERSION 1
146
147#define KMOD_DECL(name, version) \
148 static kmod_start_func_t name ## _module_start; \
149 static kmod_stop_func_t name ## _module_stop; \
150 kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \
151 { #name }, { version }, -1, 0, 0, 0, 0, \
152 name ## _module_start, \
153 name ## _module_stop };
154
155#define KMOD_EXPLICIT_DECL(name, version, start, stop) \
156 kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \
157 { #name }, { version }, -1, 0, 0, 0, 0, \
158 start, stop };
159
160#if PRAGMA_MARK
161#pragma mark Kernel private declarations
162#endif
163/***********************************************************************
164* Kernel private declarations.
165***********************************************************************/
166
167
168#if PRAGMA_MARK
169#pragma mark Obsolete kmod stuff
170#endif
171/***********************************************************************
172* These 3 should be dropped but they're referenced by MIG declarations.
173***********************************************************************/
174typedef void * kmod_args_t;
175typedef int kmod_control_flavor_t;
176typedef kmod_info_t * kmod_info_array_t;
177
178__END_DECLS
179
180#endif /* _MACH_KMOD_H_ */
lib/libc/include/x86_64-macos-gnu/mach/lock_set.h created+350
...@@ -0,0 +1,350 @@
1#ifndef _lock_set_user_
2#define _lock_set_user_
3
4/* Module lock_set */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef lock_set_MSG_COUNT
52#define lock_set_MSG_COUNT 6
53#endif /* lock_set_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine lock_acquire */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t lock_acquire
75(
76 lock_set_t lock_set,
77 int lock_id
78);
79
80/* Routine lock_release */
81#ifdef mig_external
82mig_external
83#else
84extern
85#endif /* mig_external */
86kern_return_t lock_release
87(
88 lock_set_t lock_set,
89 int lock_id
90);
91
92/* Routine lock_try */
93#ifdef mig_external
94mig_external
95#else
96extern
97#endif /* mig_external */
98kern_return_t lock_try
99(
100 lock_set_t lock_set,
101 int lock_id
102);
103
104/* Routine lock_make_stable */
105#ifdef mig_external
106mig_external
107#else
108extern
109#endif /* mig_external */
110kern_return_t lock_make_stable
111(
112 lock_set_t lock_set,
113 int lock_id
114);
115
116/* Routine lock_handoff */
117#ifdef mig_external
118mig_external
119#else
120extern
121#endif /* mig_external */
122kern_return_t lock_handoff
123(
124 lock_set_t lock_set,
125 int lock_id
126);
127
128/* Routine lock_handoff_accept */
129#ifdef mig_external
130mig_external
131#else
132extern
133#endif /* mig_external */
134kern_return_t lock_handoff_accept
135(
136 lock_set_t lock_set,
137 int lock_id
138);
139
140__END_DECLS
141
142/********************** Caution **************************/
143/* The following data types should be used to calculate */
144/* maximum message sizes only. The actual message may be */
145/* smaller, and the position of the arguments within the */
146/* message layout may vary from what is presented here. */
147/* For example, if any of the arguments are variable- */
148/* sized, and less than the maximum is sent, the data */
149/* will be packed tight in the actual message to reduce */
150/* the presence of holes. */
151/********************** Caution **************************/
152
153/* typedefs for all requests */
154
155#ifndef __Request__lock_set_subsystem__defined
156#define __Request__lock_set_subsystem__defined
157
158#ifdef __MigPackStructs
159#pragma pack(push, 4)
160#endif
161 typedef struct {
162 mach_msg_header_t Head;
163 NDR_record_t NDR;
164 int lock_id;
165 } __Request__lock_acquire_t __attribute__((unused));
166#ifdef __MigPackStructs
167#pragma pack(pop)
168#endif
169
170#ifdef __MigPackStructs
171#pragma pack(push, 4)
172#endif
173 typedef struct {
174 mach_msg_header_t Head;
175 NDR_record_t NDR;
176 int lock_id;
177 } __Request__lock_release_t __attribute__((unused));
178#ifdef __MigPackStructs
179#pragma pack(pop)
180#endif
181
182#ifdef __MigPackStructs
183#pragma pack(push, 4)
184#endif
185 typedef struct {
186 mach_msg_header_t Head;
187 NDR_record_t NDR;
188 int lock_id;
189 } __Request__lock_try_t __attribute__((unused));
190#ifdef __MigPackStructs
191#pragma pack(pop)
192#endif
193
194#ifdef __MigPackStructs
195#pragma pack(push, 4)
196#endif
197 typedef struct {
198 mach_msg_header_t Head;
199 NDR_record_t NDR;
200 int lock_id;
201 } __Request__lock_make_stable_t __attribute__((unused));
202#ifdef __MigPackStructs
203#pragma pack(pop)
204#endif
205
206#ifdef __MigPackStructs
207#pragma pack(push, 4)
208#endif
209 typedef struct {
210 mach_msg_header_t Head;
211 NDR_record_t NDR;
212 int lock_id;
213 } __Request__lock_handoff_t __attribute__((unused));
214#ifdef __MigPackStructs
215#pragma pack(pop)
216#endif
217
218#ifdef __MigPackStructs
219#pragma pack(push, 4)
220#endif
221 typedef struct {
222 mach_msg_header_t Head;
223 NDR_record_t NDR;
224 int lock_id;
225 } __Request__lock_handoff_accept_t __attribute__((unused));
226#ifdef __MigPackStructs
227#pragma pack(pop)
228#endif
229#endif /* !__Request__lock_set_subsystem__defined */
230
231/* union of all requests */
232
233#ifndef __RequestUnion__lock_set_subsystem__defined
234#define __RequestUnion__lock_set_subsystem__defined
235union __RequestUnion__lock_set_subsystem {
236 __Request__lock_acquire_t Request_lock_acquire;
237 __Request__lock_release_t Request_lock_release;
238 __Request__lock_try_t Request_lock_try;
239 __Request__lock_make_stable_t Request_lock_make_stable;
240 __Request__lock_handoff_t Request_lock_handoff;
241 __Request__lock_handoff_accept_t Request_lock_handoff_accept;
242};
243#endif /* !__RequestUnion__lock_set_subsystem__defined */
244/* typedefs for all replies */
245
246#ifndef __Reply__lock_set_subsystem__defined
247#define __Reply__lock_set_subsystem__defined
248
249#ifdef __MigPackStructs
250#pragma pack(push, 4)
251#endif
252 typedef struct {
253 mach_msg_header_t Head;
254 NDR_record_t NDR;
255 kern_return_t RetCode;
256 } __Reply__lock_acquire_t __attribute__((unused));
257#ifdef __MigPackStructs
258#pragma pack(pop)
259#endif
260
261#ifdef __MigPackStructs
262#pragma pack(push, 4)
263#endif
264 typedef struct {
265 mach_msg_header_t Head;
266 NDR_record_t NDR;
267 kern_return_t RetCode;
268 } __Reply__lock_release_t __attribute__((unused));
269#ifdef __MigPackStructs
270#pragma pack(pop)
271#endif
272
273#ifdef __MigPackStructs
274#pragma pack(push, 4)
275#endif
276 typedef struct {
277 mach_msg_header_t Head;
278 NDR_record_t NDR;
279 kern_return_t RetCode;
280 } __Reply__lock_try_t __attribute__((unused));
281#ifdef __MigPackStructs
282#pragma pack(pop)
283#endif
284
285#ifdef __MigPackStructs
286#pragma pack(push, 4)
287#endif
288 typedef struct {
289 mach_msg_header_t Head;
290 NDR_record_t NDR;
291 kern_return_t RetCode;
292 } __Reply__lock_make_stable_t __attribute__((unused));
293#ifdef __MigPackStructs
294#pragma pack(pop)
295#endif
296
297#ifdef __MigPackStructs
298#pragma pack(push, 4)
299#endif
300 typedef struct {
301 mach_msg_header_t Head;
302 NDR_record_t NDR;
303 kern_return_t RetCode;
304 } __Reply__lock_handoff_t __attribute__((unused));
305#ifdef __MigPackStructs
306#pragma pack(pop)
307#endif
308
309#ifdef __MigPackStructs
310#pragma pack(push, 4)
311#endif
312 typedef struct {
313 mach_msg_header_t Head;
314 NDR_record_t NDR;
315 kern_return_t RetCode;
316 } __Reply__lock_handoff_accept_t __attribute__((unused));
317#ifdef __MigPackStructs
318#pragma pack(pop)
319#endif
320#endif /* !__Reply__lock_set_subsystem__defined */
321
322/* union of all replies */
323
324#ifndef __ReplyUnion__lock_set_subsystem__defined
325#define __ReplyUnion__lock_set_subsystem__defined
326union __ReplyUnion__lock_set_subsystem {
327 __Reply__lock_acquire_t Reply_lock_acquire;
328 __Reply__lock_release_t Reply_lock_release;
329 __Reply__lock_try_t Reply_lock_try;
330 __Reply__lock_make_stable_t Reply_lock_make_stable;
331 __Reply__lock_handoff_t Reply_lock_handoff;
332 __Reply__lock_handoff_accept_t Reply_lock_handoff_accept;
333};
334#endif /* !__RequestUnion__lock_set_subsystem__defined */
335
336#ifndef subsystem_to_name_map_lock_set
337#define subsystem_to_name_map_lock_set \
338 { "lock_acquire", 617000 },\
339 { "lock_release", 617001 },\
340 { "lock_try", 617002 },\
341 { "lock_make_stable", 617003 },\
342 { "lock_handoff", 617004 },\
343 { "lock_handoff_accept", 617005 }
344#endif
345
346#ifdef __AfterMigUserHeader
347__AfterMigUserHeader
348#endif /* __AfterMigUserHeader */
349
350#endif /* _lock_set_user_ */
lib/libc/include/x86_64-macos-gnu/mach/mach.h created+245
...@@ -0,0 +1,245 @@
1/*
2 * Copyright (c) 1999-2014 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
52 */
53
54/*
55 * Includes all the types that a normal user
56 * of Mach programs should need
57 */
58
59#ifndef _MACH_H_
60#define _MACH_H_
61
62#define __MACH30__
63#define MACH_IPC_FLAVOR UNTYPED
64
65#include <mach/std_types.h>
66#include <mach/mach_types.h>
67#include <mach/mach_interface.h>
68#include <mach/mach_port.h>
69#include <mach/mach_init.h>
70#include <mach/mach_host.h>
71#include <mach/thread_switch.h>
72
73#include <mach/rpc.h> /* for compatibility only */
74#include <mach/mig.h>
75
76#include <mach/mig_errors.h>
77#include <mach/mach_error.h>
78
79#include <sys/cdefs.h>
80
81__BEGIN_DECLS
82/*
83 * Standard prototypes
84 */
85extern void panic_init(mach_port_t);
86extern void panic(const char *, ...);
87
88extern void safe_gets(char *,
89 char *,
90 int);
91
92extern void slot_name(cpu_type_t,
93 cpu_subtype_t,
94 char **,
95 char **);
96
97extern void mig_reply_setup(mach_msg_header_t *,
98 mach_msg_header_t *);
99
100__WATCHOS_PROHIBITED __TVOS_PROHIBITED
101extern void mach_msg_destroy(mach_msg_header_t *);
102
103__WATCHOS_PROHIBITED __TVOS_PROHIBITED
104extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *);
105
106__WATCHOS_PROHIBITED __TVOS_PROHIBITED
107extern mach_msg_return_t mach_msg_send(mach_msg_header_t *);
108
109__WATCHOS_PROHIBITED __TVOS_PROHIBITED
110extern mach_msg_return_t mach_msg_server_once(boolean_t (*)
111 (mach_msg_header_t *,
112 mach_msg_header_t *),
113 mach_msg_size_t,
114 mach_port_t,
115 mach_msg_options_t);
116
117__WATCHOS_PROHIBITED __TVOS_PROHIBITED
118extern mach_msg_return_t mach_msg_server(boolean_t (*)
119 (mach_msg_header_t *,
120 mach_msg_header_t *),
121 mach_msg_size_t,
122 mach_port_t,
123 mach_msg_options_t);
124
125__WATCHOS_PROHIBITED __TVOS_PROHIBITED
126extern mach_msg_return_t mach_msg_server_importance(boolean_t (*)
127 (mach_msg_header_t *,
128 mach_msg_header_t *),
129 mach_msg_size_t,
130 mach_port_t,
131 mach_msg_options_t);
132
133/*
134 * Prototypes for compatibility
135 */
136extern kern_return_t clock_get_res(mach_port_t,
137 clock_res_t *);
138extern kern_return_t clock_set_res(mach_port_t,
139 clock_res_t);
140
141extern kern_return_t clock_sleep(mach_port_t,
142 int,
143 mach_timespec_t,
144 mach_timespec_t *);
145
146/*!
147 * @group voucher_mach_msg Prototypes
148 */
149
150#define VOUCHER_MACH_MSG_API_VERSION 20140205
151
152/*!
153 * @typedef voucher_mach_msg_state_t
154 *
155 * @abstract
156 * Opaque object encapsulating state changed by voucher_mach_msg_adopt().
157 */
158typedef struct voucher_mach_msg_state_s *voucher_mach_msg_state_t;
159
160/*!
161 * @const VOUCHER_MACH_MSG_STATE_UNCHANGED
162 *
163 * @discussion
164 * Constant indicating no state change occurred.
165 */
166#define VOUCHER_MACH_MSG_STATE_UNCHANGED ((voucher_mach_msg_state_t)~0ul)
167
168/*!
169 * @function voucher_mach_msg_set
170 *
171 * @abstract
172 * Change specified message header to contain current mach voucher with a
173 * COPY_SEND disposition.
174 * Does not change message if it already has non-zero MACH_MSGH_BITS_VOUCHER.
175 *
176 * @discussion
177 * Borrows reference to current thread voucher so message should be sent
178 * immediately (without intervening calls that might change that voucher).
179 *
180 * @param msg
181 * The message to modify.
182 *
183 * @result
184 * True if header was changed.
185 */
186extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg);
187
188/*!
189 * @function voucher_mach_msg_clear
190 *
191 * @abstract
192 * Removes changes made to specified message header by voucher_mach_msg_set()
193 * and any mach_msg() send operations (successful or not).
194 * If the message is not needed further, mach_msg_destroy() should be called
195 * instead.
196 *
197 * @discussion
198 * Not intended to be called if voucher_mach_msg_set() returned false.
199 * Releases reference to message mach voucher if an extra reference was
200 * acquired due to an unsuccessful send operation (pseudo-receive).
201 *
202 * @param msg
203 * The message to modify.
204 */
205extern void voucher_mach_msg_clear(mach_msg_header_t *msg);
206
207/*!
208 * @function voucher_mach_msg_adopt
209 *
210 * @abstract
211 * Adopt the voucher contained in the specified message on the current thread
212 * and return the previous thread voucher state.
213 *
214 * @discussion
215 * Ownership of the mach voucher in the message is transferred to the current
216 * thread and the message header voucher fields are cleared.
217 *
218 * @param msg
219 * The message to query and modify.
220 *
221 * @result
222 * The previous thread voucher state or VOUCHER_MACH_MSG_STATE_UNCHANGED if no
223 * state change occurred.
224 */
225extern voucher_mach_msg_state_t voucher_mach_msg_adopt(mach_msg_header_t *msg);
226
227/*!
228 * @function voucher_mach_msg_revert
229 *
230 * @abstract
231 * Restore thread voucher state previously modified by voucher_mach_msg_adopt().
232 *
233 * @discussion
234 * Current thread voucher reference is released.
235 * No change to thread voucher state if passed VOUCHER_MACH_MSG_STATE_UNCHANGED.
236 *
237 * @param state
238 * The thread voucher state to restore.
239 */
240
241extern void voucher_mach_msg_revert(voucher_mach_msg_state_t state);
242
243__END_DECLS
244
245#endif /* _MACH_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_error.h created+93
...@@ -0,0 +1,93 @@
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie the
51 * rights to redistribute these changes.
52 */
53
54/*
55 * File: mach_error.h
56 * Author: Douglas Orr, Carnegie Mellon University
57 * Date: Mar. 1988
58 *
59 * Definitions of routines in mach_error.c
60 */
61
62#ifndef _MACH_ERROR_
63#define _MACH_ERROR_ 1
64
65#include <mach/error.h>
66
67#include <sys/cdefs.h>
68
69__BEGIN_DECLS
70char *mach_error_string(
71/*
72 * Returns a string appropriate to the error argument given
73 */
74 mach_error_t error_value
75 );
76
77void mach_error(
78/*
79 * Prints an appropriate message on the standard error stream
80 */
81 const char *str,
82 mach_error_t error_value
83 );
84
85char *mach_error_type(
86/*
87 * Returns a string with the error system, subsystem and code
88 */
89 mach_error_t error_value
90 );
91__END_DECLS
92
93#endif /* _MACH_ERROR_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_host.h created+1295
...@@ -0,0 +1,1295 @@
1#ifndef _mach_host_user_
2#define _mach_host_user_
3
4/* Module mach_host */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef mach_host_MSG_COUNT
52#define mach_host_MSG_COUNT 35
53#endif /* mach_host_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach/mach_types.h>
60#include <mach_debug/mach_debug_types.h>
61#include <mach/mach_init.h>
62
63#ifdef __BeforeMigUserHeader
64__BeforeMigUserHeader
65#endif /* __BeforeMigUserHeader */
66
67#include <sys/cdefs.h>
68__BEGIN_DECLS
69
70
71/* Routine host_info */
72#ifdef mig_external
73mig_external
74#else
75extern
76#endif /* mig_external */
77__WATCHOS_PROHIBITED
78__TVOS_PROHIBITED
79kern_return_t host_info
80(
81 host_t host,
82 host_flavor_t flavor,
83 host_info_t host_info_out,
84 mach_msg_type_number_t *host_info_outCnt
85);
86
87/* Routine host_kernel_version */
88#ifdef mig_external
89mig_external
90#else
91extern
92#endif /* mig_external */
93kern_return_t host_kernel_version
94(
95 host_t host,
96 kernel_version_t kernel_version
97);
98
99/* Routine _host_page_size */
100#ifdef mig_external
101mig_external
102#else
103extern
104#endif /* mig_external */
105kern_return_t _host_page_size
106(
107 host_t host,
108 vm_size_t *out_page_size
109);
110
111/* Routine mach_memory_object_memory_entry */
112#ifdef mig_external
113mig_external
114#else
115extern
116#endif /* mig_external */
117kern_return_t mach_memory_object_memory_entry
118(
119 host_t host,
120 boolean_t internal,
121 vm_size_t size,
122 vm_prot_t permission,
123 memory_object_t pager,
124 mach_port_t *entry_handle
125);
126
127/* Routine host_processor_info */
128#ifdef mig_external
129mig_external
130#else
131extern
132#endif /* mig_external */
133kern_return_t host_processor_info
134(
135 host_t host,
136 processor_flavor_t flavor,
137 natural_t *out_processor_count,
138 processor_info_array_t *out_processor_info,
139 mach_msg_type_number_t *out_processor_infoCnt
140);
141
142/* Routine host_get_io_master */
143#ifdef mig_external
144mig_external
145#else
146extern
147#endif /* mig_external */
148kern_return_t host_get_io_master
149(
150 host_t host,
151 io_master_t *io_master
152);
153
154/* Routine host_get_clock_service */
155#ifdef mig_external
156mig_external
157#else
158extern
159#endif /* mig_external */
160kern_return_t host_get_clock_service
161(
162 host_t host,
163 clock_id_t clock_id,
164 clock_serv_t *clock_serv
165);
166
167/* Routine kmod_get_info */
168#ifdef mig_external
169mig_external
170#else
171extern
172#endif /* mig_external */
173kern_return_t kmod_get_info
174(
175 host_t host,
176 kmod_args_t *modules,
177 mach_msg_type_number_t *modulesCnt
178);
179
180/* Routine host_virtual_physical_table_info */
181#ifdef mig_external
182mig_external
183#else
184extern
185#endif /* mig_external */
186kern_return_t host_virtual_physical_table_info
187(
188 host_t host,
189 hash_info_bucket_array_t *info,
190 mach_msg_type_number_t *infoCnt
191);
192
193/* Routine processor_set_default */
194#ifdef mig_external
195mig_external
196#else
197extern
198#endif /* mig_external */
199kern_return_t processor_set_default
200(
201 host_t host,
202 processor_set_name_t *default_set
203);
204
205/* Routine processor_set_create */
206#ifdef mig_external
207mig_external
208#else
209extern
210#endif /* mig_external */
211kern_return_t processor_set_create
212(
213 host_t host,
214 processor_set_t *new_set,
215 processor_set_name_t *new_name
216);
217
218/* Routine mach_memory_object_memory_entry_64 */
219#ifdef mig_external
220mig_external
221#else
222extern
223#endif /* mig_external */
224kern_return_t mach_memory_object_memory_entry_64
225(
226 host_t host,
227 boolean_t internal,
228 memory_object_size_t size,
229 vm_prot_t permission,
230 memory_object_t pager,
231 mach_port_t *entry_handle
232);
233
234/* Routine host_statistics */
235#ifdef mig_external
236mig_external
237#else
238extern
239#endif /* mig_external */
240kern_return_t host_statistics
241(
242 host_t host_priv,
243 host_flavor_t flavor,
244 host_info_t host_info_out,
245 mach_msg_type_number_t *host_info_outCnt
246);
247
248/* Routine host_request_notification */
249#ifdef mig_external
250mig_external
251#else
252extern
253#endif /* mig_external */
254__WATCHOS_PROHIBITED
255__TVOS_PROHIBITED
256kern_return_t host_request_notification
257(
258 host_t host,
259 host_flavor_t notify_type,
260 mach_port_t notify_port
261);
262
263/* Routine host_lockgroup_info */
264#ifdef mig_external
265mig_external
266#else
267extern
268#endif /* mig_external */
269kern_return_t host_lockgroup_info
270(
271 host_t host,
272 lockgroup_info_array_t *lockgroup_info,
273 mach_msg_type_number_t *lockgroup_infoCnt
274);
275
276/* Routine host_statistics64 */
277#ifdef mig_external
278mig_external
279#else
280extern
281#endif /* mig_external */
282kern_return_t host_statistics64
283(
284 host_t host_priv,
285 host_flavor_t flavor,
286 host_info64_t host_info64_out,
287 mach_msg_type_number_t *host_info64_outCnt
288);
289
290/* Routine mach_zone_info */
291#ifdef mig_external
292mig_external
293#else
294extern
295#endif /* mig_external */
296kern_return_t mach_zone_info
297(
298 host_priv_t host,
299 mach_zone_name_array_t *names,
300 mach_msg_type_number_t *namesCnt,
301 mach_zone_info_array_t *info,
302 mach_msg_type_number_t *infoCnt
303);
304
305/* Routine host_create_mach_voucher */
306#ifdef mig_external
307mig_external
308#else
309extern
310#endif /* mig_external */
311__WATCHOS_PROHIBITED
312__TVOS_PROHIBITED
313kern_return_t host_create_mach_voucher
314(
315 host_t host,
316 mach_voucher_attr_raw_recipe_array_t recipes,
317 mach_msg_type_number_t recipesCnt,
318 ipc_voucher_t *voucher
319);
320
321/* Routine host_register_mach_voucher_attr_manager */
322#ifdef mig_external
323mig_external
324#else
325extern
326#endif /* mig_external */
327__WATCHOS_PROHIBITED
328__TVOS_PROHIBITED
329kern_return_t host_register_mach_voucher_attr_manager
330(
331 host_t host,
332 mach_voucher_attr_manager_t attr_manager,
333 mach_voucher_attr_value_handle_t default_value,
334 mach_voucher_attr_key_t *new_key,
335 ipc_voucher_attr_control_t *new_attr_control
336);
337
338/* Routine host_register_well_known_mach_voucher_attr_manager */
339#ifdef mig_external
340mig_external
341#else
342extern
343#endif /* mig_external */
344__WATCHOS_PROHIBITED
345__TVOS_PROHIBITED
346kern_return_t host_register_well_known_mach_voucher_attr_manager
347(
348 host_t host,
349 mach_voucher_attr_manager_t attr_manager,
350 mach_voucher_attr_value_handle_t default_value,
351 mach_voucher_attr_key_t key,
352 ipc_voucher_attr_control_t *new_attr_control
353);
354
355/* Routine host_set_atm_diagnostic_flag */
356#ifdef mig_external
357mig_external
358#else
359extern
360#endif /* mig_external */
361__WATCHOS_PROHIBITED
362__TVOS_PROHIBITED
363kern_return_t host_set_atm_diagnostic_flag
364(
365 host_t host,
366 uint32_t diagnostic_flag
367);
368
369/* Routine host_get_atm_diagnostic_flag */
370#ifdef mig_external
371mig_external
372#else
373extern
374#endif /* mig_external */
375__WATCHOS_PROHIBITED
376__TVOS_PROHIBITED
377kern_return_t host_get_atm_diagnostic_flag
378(
379 host_t host,
380 uint32_t *diagnostic_flag
381);
382
383/* Routine mach_memory_info */
384#ifdef mig_external
385mig_external
386#else
387extern
388#endif /* mig_external */
389kern_return_t mach_memory_info
390(
391 host_priv_t host,
392 mach_zone_name_array_t *names,
393 mach_msg_type_number_t *namesCnt,
394 mach_zone_info_array_t *info,
395 mach_msg_type_number_t *infoCnt,
396 mach_memory_info_array_t *memory_info,
397 mach_msg_type_number_t *memory_infoCnt
398);
399
400/* Routine host_set_multiuser_config_flags */
401#ifdef mig_external
402mig_external
403#else
404extern
405#endif /* mig_external */
406kern_return_t host_set_multiuser_config_flags
407(
408 host_priv_t host_priv,
409 uint32_t multiuser_flags
410);
411
412/* Routine host_get_multiuser_config_flags */
413#ifdef mig_external
414mig_external
415#else
416extern
417#endif /* mig_external */
418kern_return_t host_get_multiuser_config_flags
419(
420 host_t host,
421 uint32_t *multiuser_flags
422);
423
424/* Routine host_check_multiuser_mode */
425#ifdef mig_external
426mig_external
427#else
428extern
429#endif /* mig_external */
430kern_return_t host_check_multiuser_mode
431(
432 host_t host,
433 uint32_t *multiuser_mode
434);
435
436/* Routine mach_zone_info_for_zone */
437#ifdef mig_external
438mig_external
439#else
440extern
441#endif /* mig_external */
442kern_return_t mach_zone_info_for_zone
443(
444 host_priv_t host,
445 mach_zone_name_t name,
446 mach_zone_info_t *info
447);
448
449__END_DECLS
450
451/********************** Caution **************************/
452/* The following data types should be used to calculate */
453/* maximum message sizes only. The actual message may be */
454/* smaller, and the position of the arguments within the */
455/* message layout may vary from what is presented here. */
456/* For example, if any of the arguments are variable- */
457/* sized, and less than the maximum is sent, the data */
458/* will be packed tight in the actual message to reduce */
459/* the presence of holes. */
460/********************** Caution **************************/
461
462/* typedefs for all requests */
463
464#ifndef __Request__mach_host_subsystem__defined
465#define __Request__mach_host_subsystem__defined
466
467#ifdef __MigPackStructs
468#pragma pack(push, 4)
469#endif
470 typedef struct {
471 mach_msg_header_t Head;
472 NDR_record_t NDR;
473 host_flavor_t flavor;
474 mach_msg_type_number_t host_info_outCnt;
475 } __Request__host_info_t __attribute__((unused));
476#ifdef __MigPackStructs
477#pragma pack(pop)
478#endif
479
480#ifdef __MigPackStructs
481#pragma pack(push, 4)
482#endif
483 typedef struct {
484 mach_msg_header_t Head;
485 } __Request__host_kernel_version_t __attribute__((unused));
486#ifdef __MigPackStructs
487#pragma pack(pop)
488#endif
489
490#ifdef __MigPackStructs
491#pragma pack(push, 4)
492#endif
493 typedef struct {
494 mach_msg_header_t Head;
495 } __Request___host_page_size_t __attribute__((unused));
496#ifdef __MigPackStructs
497#pragma pack(pop)
498#endif
499
500#ifdef __MigPackStructs
501#pragma pack(push, 4)
502#endif
503 typedef struct {
504 mach_msg_header_t Head;
505 /* start of the kernel processed data */
506 mach_msg_body_t msgh_body;
507 mach_msg_port_descriptor_t pager;
508 /* end of the kernel processed data */
509 NDR_record_t NDR;
510 boolean_t internal;
511 vm_size_t size;
512 vm_prot_t permission;
513 } __Request__mach_memory_object_memory_entry_t __attribute__((unused));
514#ifdef __MigPackStructs
515#pragma pack(pop)
516#endif
517
518#ifdef __MigPackStructs
519#pragma pack(push, 4)
520#endif
521 typedef struct {
522 mach_msg_header_t Head;
523 NDR_record_t NDR;
524 processor_flavor_t flavor;
525 } __Request__host_processor_info_t __attribute__((unused));
526#ifdef __MigPackStructs
527#pragma pack(pop)
528#endif
529
530#ifdef __MigPackStructs
531#pragma pack(push, 4)
532#endif
533 typedef struct {
534 mach_msg_header_t Head;
535 } __Request__host_get_io_master_t __attribute__((unused));
536#ifdef __MigPackStructs
537#pragma pack(pop)
538#endif
539
540#ifdef __MigPackStructs
541#pragma pack(push, 4)
542#endif
543 typedef struct {
544 mach_msg_header_t Head;
545 NDR_record_t NDR;
546 clock_id_t clock_id;
547 } __Request__host_get_clock_service_t __attribute__((unused));
548#ifdef __MigPackStructs
549#pragma pack(pop)
550#endif
551
552#ifdef __MigPackStructs
553#pragma pack(push, 4)
554#endif
555 typedef struct {
556 mach_msg_header_t Head;
557 } __Request__kmod_get_info_t __attribute__((unused));
558#ifdef __MigPackStructs
559#pragma pack(pop)
560#endif
561
562#ifdef __MigPackStructs
563#pragma pack(push, 4)
564#endif
565 typedef struct {
566 mach_msg_header_t Head;
567 } __Request__host_virtual_physical_table_info_t __attribute__((unused));
568#ifdef __MigPackStructs
569#pragma pack(pop)
570#endif
571
572#ifdef __MigPackStructs
573#pragma pack(push, 4)
574#endif
575 typedef struct {
576 mach_msg_header_t Head;
577 } __Request__processor_set_default_t __attribute__((unused));
578#ifdef __MigPackStructs
579#pragma pack(pop)
580#endif
581
582#ifdef __MigPackStructs
583#pragma pack(push, 4)
584#endif
585 typedef struct {
586 mach_msg_header_t Head;
587 } __Request__processor_set_create_t __attribute__((unused));
588#ifdef __MigPackStructs
589#pragma pack(pop)
590#endif
591
592#ifdef __MigPackStructs
593#pragma pack(push, 4)
594#endif
595 typedef struct {
596 mach_msg_header_t Head;
597 /* start of the kernel processed data */
598 mach_msg_body_t msgh_body;
599 mach_msg_port_descriptor_t pager;
600 /* end of the kernel processed data */
601 NDR_record_t NDR;
602 boolean_t internal;
603 memory_object_size_t size;
604 vm_prot_t permission;
605 } __Request__mach_memory_object_memory_entry_64_t __attribute__((unused));
606#ifdef __MigPackStructs
607#pragma pack(pop)
608#endif
609
610#ifdef __MigPackStructs
611#pragma pack(push, 4)
612#endif
613 typedef struct {
614 mach_msg_header_t Head;
615 NDR_record_t NDR;
616 host_flavor_t flavor;
617 mach_msg_type_number_t host_info_outCnt;
618 } __Request__host_statistics_t __attribute__((unused));
619#ifdef __MigPackStructs
620#pragma pack(pop)
621#endif
622
623#ifdef __MigPackStructs
624#pragma pack(push, 4)
625#endif
626 typedef struct {
627 mach_msg_header_t Head;
628 /* start of the kernel processed data */
629 mach_msg_body_t msgh_body;
630 mach_msg_port_descriptor_t notify_port;
631 /* end of the kernel processed data */
632 NDR_record_t NDR;
633 host_flavor_t notify_type;
634 } __Request__host_request_notification_t __attribute__((unused));
635#ifdef __MigPackStructs
636#pragma pack(pop)
637#endif
638
639#ifdef __MigPackStructs
640#pragma pack(push, 4)
641#endif
642 typedef struct {
643 mach_msg_header_t Head;
644 } __Request__host_lockgroup_info_t __attribute__((unused));
645#ifdef __MigPackStructs
646#pragma pack(pop)
647#endif
648
649#ifdef __MigPackStructs
650#pragma pack(push, 4)
651#endif
652 typedef struct {
653 mach_msg_header_t Head;
654 NDR_record_t NDR;
655 host_flavor_t flavor;
656 mach_msg_type_number_t host_info64_outCnt;
657 } __Request__host_statistics64_t __attribute__((unused));
658#ifdef __MigPackStructs
659#pragma pack(pop)
660#endif
661
662#ifdef __MigPackStructs
663#pragma pack(push, 4)
664#endif
665 typedef struct {
666 mach_msg_header_t Head;
667 } __Request__mach_zone_info_t __attribute__((unused));
668#ifdef __MigPackStructs
669#pragma pack(pop)
670#endif
671
672#ifdef __MigPackStructs
673#pragma pack(push, 4)
674#endif
675 typedef struct {
676 mach_msg_header_t Head;
677 NDR_record_t NDR;
678 mach_msg_type_number_t recipesCnt;
679 uint8_t recipes[5120];
680 } __Request__host_create_mach_voucher_t __attribute__((unused));
681#ifdef __MigPackStructs
682#pragma pack(pop)
683#endif
684
685#ifdef __MigPackStructs
686#pragma pack(push, 4)
687#endif
688 typedef struct {
689 mach_msg_header_t Head;
690 /* start of the kernel processed data */
691 mach_msg_body_t msgh_body;
692 mach_msg_port_descriptor_t attr_manager;
693 /* end of the kernel processed data */
694 NDR_record_t NDR;
695 mach_voucher_attr_value_handle_t default_value;
696 } __Request__host_register_mach_voucher_attr_manager_t __attribute__((unused));
697#ifdef __MigPackStructs
698#pragma pack(pop)
699#endif
700
701#ifdef __MigPackStructs
702#pragma pack(push, 4)
703#endif
704 typedef struct {
705 mach_msg_header_t Head;
706 /* start of the kernel processed data */
707 mach_msg_body_t msgh_body;
708 mach_msg_port_descriptor_t attr_manager;
709 /* end of the kernel processed data */
710 NDR_record_t NDR;
711 mach_voucher_attr_value_handle_t default_value;
712 mach_voucher_attr_key_t key;
713 } __Request__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
714#ifdef __MigPackStructs
715#pragma pack(pop)
716#endif
717
718#ifdef __MigPackStructs
719#pragma pack(push, 4)
720#endif
721 typedef struct {
722 mach_msg_header_t Head;
723 NDR_record_t NDR;
724 uint32_t diagnostic_flag;
725 } __Request__host_set_atm_diagnostic_flag_t __attribute__((unused));
726#ifdef __MigPackStructs
727#pragma pack(pop)
728#endif
729
730#ifdef __MigPackStructs
731#pragma pack(push, 4)
732#endif
733 typedef struct {
734 mach_msg_header_t Head;
735 } __Request__host_get_atm_diagnostic_flag_t __attribute__((unused));
736#ifdef __MigPackStructs
737#pragma pack(pop)
738#endif
739
740#ifdef __MigPackStructs
741#pragma pack(push, 4)
742#endif
743 typedef struct {
744 mach_msg_header_t Head;
745 } __Request__mach_memory_info_t __attribute__((unused));
746#ifdef __MigPackStructs
747#pragma pack(pop)
748#endif
749
750#ifdef __MigPackStructs
751#pragma pack(push, 4)
752#endif
753 typedef struct {
754 mach_msg_header_t Head;
755 NDR_record_t NDR;
756 uint32_t multiuser_flags;
757 } __Request__host_set_multiuser_config_flags_t __attribute__((unused));
758#ifdef __MigPackStructs
759#pragma pack(pop)
760#endif
761
762#ifdef __MigPackStructs
763#pragma pack(push, 4)
764#endif
765 typedef struct {
766 mach_msg_header_t Head;
767 } __Request__host_get_multiuser_config_flags_t __attribute__((unused));
768#ifdef __MigPackStructs
769#pragma pack(pop)
770#endif
771
772#ifdef __MigPackStructs
773#pragma pack(push, 4)
774#endif
775 typedef struct {
776 mach_msg_header_t Head;
777 } __Request__host_check_multiuser_mode_t __attribute__((unused));
778#ifdef __MigPackStructs
779#pragma pack(pop)
780#endif
781
782#ifdef __MigPackStructs
783#pragma pack(push, 4)
784#endif
785 typedef struct {
786 mach_msg_header_t Head;
787 NDR_record_t NDR;
788 mach_zone_name_t name;
789 } __Request__mach_zone_info_for_zone_t __attribute__((unused));
790#ifdef __MigPackStructs
791#pragma pack(pop)
792#endif
793#endif /* !__Request__mach_host_subsystem__defined */
794
795/* union of all requests */
796
797#ifndef __RequestUnion__mach_host_subsystem__defined
798#define __RequestUnion__mach_host_subsystem__defined
799union __RequestUnion__mach_host_subsystem {
800 __Request__host_info_t Request_host_info;
801 __Request__host_kernel_version_t Request_host_kernel_version;
802 __Request___host_page_size_t Request__host_page_size;
803 __Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry;
804 __Request__host_processor_info_t Request_host_processor_info;
805 __Request__host_get_io_master_t Request_host_get_io_master;
806 __Request__host_get_clock_service_t Request_host_get_clock_service;
807 __Request__kmod_get_info_t Request_kmod_get_info;
808 __Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info;
809 __Request__processor_set_default_t Request_processor_set_default;
810 __Request__processor_set_create_t Request_processor_set_create;
811 __Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64;
812 __Request__host_statistics_t Request_host_statistics;
813 __Request__host_request_notification_t Request_host_request_notification;
814 __Request__host_lockgroup_info_t Request_host_lockgroup_info;
815 __Request__host_statistics64_t Request_host_statistics64;
816 __Request__mach_zone_info_t Request_mach_zone_info;
817 __Request__host_create_mach_voucher_t Request_host_create_mach_voucher;
818 __Request__host_register_mach_voucher_attr_manager_t Request_host_register_mach_voucher_attr_manager;
819 __Request__host_register_well_known_mach_voucher_attr_manager_t Request_host_register_well_known_mach_voucher_attr_manager;
820 __Request__host_set_atm_diagnostic_flag_t Request_host_set_atm_diagnostic_flag;
821 __Request__host_get_atm_diagnostic_flag_t Request_host_get_atm_diagnostic_flag;
822 __Request__mach_memory_info_t Request_mach_memory_info;
823 __Request__host_set_multiuser_config_flags_t Request_host_set_multiuser_config_flags;
824 __Request__host_get_multiuser_config_flags_t Request_host_get_multiuser_config_flags;
825 __Request__host_check_multiuser_mode_t Request_host_check_multiuser_mode;
826 __Request__mach_zone_info_for_zone_t Request_mach_zone_info_for_zone;
827};
828#endif /* !__RequestUnion__mach_host_subsystem__defined */
829/* typedefs for all replies */
830
831#ifndef __Reply__mach_host_subsystem__defined
832#define __Reply__mach_host_subsystem__defined
833
834#ifdef __MigPackStructs
835#pragma pack(push, 4)
836#endif
837 typedef struct {
838 mach_msg_header_t Head;
839 NDR_record_t NDR;
840 kern_return_t RetCode;
841 mach_msg_type_number_t host_info_outCnt;
842 integer_t host_info_out[68];
843 } __Reply__host_info_t __attribute__((unused));
844#ifdef __MigPackStructs
845#pragma pack(pop)
846#endif
847
848#ifdef __MigPackStructs
849#pragma pack(push, 4)
850#endif
851 typedef struct {
852 mach_msg_header_t Head;
853 NDR_record_t NDR;
854 kern_return_t RetCode;
855 mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */
856 mach_msg_type_number_t kernel_versionCnt;
857 char kernel_version[512];
858 } __Reply__host_kernel_version_t __attribute__((unused));
859#ifdef __MigPackStructs
860#pragma pack(pop)
861#endif
862
863#ifdef __MigPackStructs
864#pragma pack(push, 4)
865#endif
866 typedef struct {
867 mach_msg_header_t Head;
868 NDR_record_t NDR;
869 kern_return_t RetCode;
870 vm_size_t out_page_size;
871 } __Reply___host_page_size_t __attribute__((unused));
872#ifdef __MigPackStructs
873#pragma pack(pop)
874#endif
875
876#ifdef __MigPackStructs
877#pragma pack(push, 4)
878#endif
879 typedef struct {
880 mach_msg_header_t Head;
881 /* start of the kernel processed data */
882 mach_msg_body_t msgh_body;
883 mach_msg_port_descriptor_t entry_handle;
884 /* end of the kernel processed data */
885 } __Reply__mach_memory_object_memory_entry_t __attribute__((unused));
886#ifdef __MigPackStructs
887#pragma pack(pop)
888#endif
889
890#ifdef __MigPackStructs
891#pragma pack(push, 4)
892#endif
893 typedef struct {
894 mach_msg_header_t Head;
895 /* start of the kernel processed data */
896 mach_msg_body_t msgh_body;
897 mach_msg_ool_descriptor_t out_processor_info;
898 /* end of the kernel processed data */
899 NDR_record_t NDR;
900 natural_t out_processor_count;
901 mach_msg_type_number_t out_processor_infoCnt;
902 } __Reply__host_processor_info_t __attribute__((unused));
903#ifdef __MigPackStructs
904#pragma pack(pop)
905#endif
906
907#ifdef __MigPackStructs
908#pragma pack(push, 4)
909#endif
910 typedef struct {
911 mach_msg_header_t Head;
912 /* start of the kernel processed data */
913 mach_msg_body_t msgh_body;
914 mach_msg_port_descriptor_t io_master;
915 /* end of the kernel processed data */
916 } __Reply__host_get_io_master_t __attribute__((unused));
917#ifdef __MigPackStructs
918#pragma pack(pop)
919#endif
920
921#ifdef __MigPackStructs
922#pragma pack(push, 4)
923#endif
924 typedef struct {
925 mach_msg_header_t Head;
926 /* start of the kernel processed data */
927 mach_msg_body_t msgh_body;
928 mach_msg_port_descriptor_t clock_serv;
929 /* end of the kernel processed data */
930 } __Reply__host_get_clock_service_t __attribute__((unused));
931#ifdef __MigPackStructs
932#pragma pack(pop)
933#endif
934
935#ifdef __MigPackStructs
936#pragma pack(push, 4)
937#endif
938 typedef struct {
939 mach_msg_header_t Head;
940 /* start of the kernel processed data */
941 mach_msg_body_t msgh_body;
942 mach_msg_ool_descriptor_t modules;
943 /* end of the kernel processed data */
944 NDR_record_t NDR;
945 mach_msg_type_number_t modulesCnt;
946 } __Reply__kmod_get_info_t __attribute__((unused));
947#ifdef __MigPackStructs
948#pragma pack(pop)
949#endif
950
951#ifdef __MigPackStructs
952#pragma pack(push, 4)
953#endif
954 typedef struct {
955 mach_msg_header_t Head;
956 /* start of the kernel processed data */
957 mach_msg_body_t msgh_body;
958 mach_msg_ool_descriptor_t info;
959 /* end of the kernel processed data */
960 NDR_record_t NDR;
961 mach_msg_type_number_t infoCnt;
962 } __Reply__host_virtual_physical_table_info_t __attribute__((unused));
963#ifdef __MigPackStructs
964#pragma pack(pop)
965#endif
966
967#ifdef __MigPackStructs
968#pragma pack(push, 4)
969#endif
970 typedef struct {
971 mach_msg_header_t Head;
972 /* start of the kernel processed data */
973 mach_msg_body_t msgh_body;
974 mach_msg_port_descriptor_t default_set;
975 /* end of the kernel processed data */
976 } __Reply__processor_set_default_t __attribute__((unused));
977#ifdef __MigPackStructs
978#pragma pack(pop)
979#endif
980
981#ifdef __MigPackStructs
982#pragma pack(push, 4)
983#endif
984 typedef struct {
985 mach_msg_header_t Head;
986 /* start of the kernel processed data */
987 mach_msg_body_t msgh_body;
988 mach_msg_port_descriptor_t new_set;
989 mach_msg_port_descriptor_t new_name;
990 /* end of the kernel processed data */
991 } __Reply__processor_set_create_t __attribute__((unused));
992#ifdef __MigPackStructs
993#pragma pack(pop)
994#endif
995
996#ifdef __MigPackStructs
997#pragma pack(push, 4)
998#endif
999 typedef struct {
1000 mach_msg_header_t Head;
1001 /* start of the kernel processed data */
1002 mach_msg_body_t msgh_body;
1003 mach_msg_port_descriptor_t entry_handle;
1004 /* end of the kernel processed data */
1005 } __Reply__mach_memory_object_memory_entry_64_t __attribute__((unused));
1006#ifdef __MigPackStructs
1007#pragma pack(pop)
1008#endif
1009
1010#ifdef __MigPackStructs
1011#pragma pack(push, 4)
1012#endif
1013 typedef struct {
1014 mach_msg_header_t Head;
1015 NDR_record_t NDR;
1016 kern_return_t RetCode;
1017 mach_msg_type_number_t host_info_outCnt;
1018 integer_t host_info_out[68];
1019 } __Reply__host_statistics_t __attribute__((unused));
1020#ifdef __MigPackStructs
1021#pragma pack(pop)
1022#endif
1023
1024#ifdef __MigPackStructs
1025#pragma pack(push, 4)
1026#endif
1027 typedef struct {
1028 mach_msg_header_t Head;
1029 NDR_record_t NDR;
1030 kern_return_t RetCode;
1031 } __Reply__host_request_notification_t __attribute__((unused));
1032#ifdef __MigPackStructs
1033#pragma pack(pop)
1034#endif
1035
1036#ifdef __MigPackStructs
1037#pragma pack(push, 4)
1038#endif
1039 typedef struct {
1040 mach_msg_header_t Head;
1041 /* start of the kernel processed data */
1042 mach_msg_body_t msgh_body;
1043 mach_msg_ool_descriptor_t lockgroup_info;
1044 /* end of the kernel processed data */
1045 NDR_record_t NDR;
1046 mach_msg_type_number_t lockgroup_infoCnt;
1047 } __Reply__host_lockgroup_info_t __attribute__((unused));
1048#ifdef __MigPackStructs
1049#pragma pack(pop)
1050#endif
1051
1052#ifdef __MigPackStructs
1053#pragma pack(push, 4)
1054#endif
1055 typedef struct {
1056 mach_msg_header_t Head;
1057 NDR_record_t NDR;
1058 kern_return_t RetCode;
1059 mach_msg_type_number_t host_info64_outCnt;
1060 integer_t host_info64_out[256];
1061 } __Reply__host_statistics64_t __attribute__((unused));
1062#ifdef __MigPackStructs
1063#pragma pack(pop)
1064#endif
1065
1066#ifdef __MigPackStructs
1067#pragma pack(push, 4)
1068#endif
1069 typedef struct {
1070 mach_msg_header_t Head;
1071 /* start of the kernel processed data */
1072 mach_msg_body_t msgh_body;
1073 mach_msg_ool_descriptor_t names;
1074 mach_msg_ool_descriptor_t info;
1075 /* end of the kernel processed data */
1076 NDR_record_t NDR;
1077 mach_msg_type_number_t namesCnt;
1078 mach_msg_type_number_t infoCnt;
1079 } __Reply__mach_zone_info_t __attribute__((unused));
1080#ifdef __MigPackStructs
1081#pragma pack(pop)
1082#endif
1083
1084#ifdef __MigPackStructs
1085#pragma pack(push, 4)
1086#endif
1087 typedef struct {
1088 mach_msg_header_t Head;
1089 /* start of the kernel processed data */
1090 mach_msg_body_t msgh_body;
1091 mach_msg_port_descriptor_t voucher;
1092 /* end of the kernel processed data */
1093 } __Reply__host_create_mach_voucher_t __attribute__((unused));
1094#ifdef __MigPackStructs
1095#pragma pack(pop)
1096#endif
1097
1098#ifdef __MigPackStructs
1099#pragma pack(push, 4)
1100#endif
1101 typedef struct {
1102 mach_msg_header_t Head;
1103 /* start of the kernel processed data */
1104 mach_msg_body_t msgh_body;
1105 mach_msg_port_descriptor_t new_attr_control;
1106 /* end of the kernel processed data */
1107 NDR_record_t NDR;
1108 mach_voucher_attr_key_t new_key;
1109 } __Reply__host_register_mach_voucher_attr_manager_t __attribute__((unused));
1110#ifdef __MigPackStructs
1111#pragma pack(pop)
1112#endif
1113
1114#ifdef __MigPackStructs
1115#pragma pack(push, 4)
1116#endif
1117 typedef struct {
1118 mach_msg_header_t Head;
1119 /* start of the kernel processed data */
1120 mach_msg_body_t msgh_body;
1121 mach_msg_port_descriptor_t new_attr_control;
1122 /* end of the kernel processed data */
1123 } __Reply__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
1124#ifdef __MigPackStructs
1125#pragma pack(pop)
1126#endif
1127
1128#ifdef __MigPackStructs
1129#pragma pack(push, 4)
1130#endif
1131 typedef struct {
1132 mach_msg_header_t Head;
1133 NDR_record_t NDR;
1134 kern_return_t RetCode;
1135 } __Reply__host_set_atm_diagnostic_flag_t __attribute__((unused));
1136#ifdef __MigPackStructs
1137#pragma pack(pop)
1138#endif
1139
1140#ifdef __MigPackStructs
1141#pragma pack(push, 4)
1142#endif
1143 typedef struct {
1144 mach_msg_header_t Head;
1145 NDR_record_t NDR;
1146 kern_return_t RetCode;
1147 uint32_t diagnostic_flag;
1148 } __Reply__host_get_atm_diagnostic_flag_t __attribute__((unused));
1149#ifdef __MigPackStructs
1150#pragma pack(pop)
1151#endif
1152
1153#ifdef __MigPackStructs
1154#pragma pack(push, 4)
1155#endif
1156 typedef struct {
1157 mach_msg_header_t Head;
1158 /* start of the kernel processed data */
1159 mach_msg_body_t msgh_body;
1160 mach_msg_ool_descriptor_t names;
1161 mach_msg_ool_descriptor_t info;
1162 mach_msg_ool_descriptor_t memory_info;
1163 /* end of the kernel processed data */
1164 NDR_record_t NDR;
1165 mach_msg_type_number_t namesCnt;
1166 mach_msg_type_number_t infoCnt;
1167 mach_msg_type_number_t memory_infoCnt;
1168 } __Reply__mach_memory_info_t __attribute__((unused));
1169#ifdef __MigPackStructs
1170#pragma pack(pop)
1171#endif
1172
1173#ifdef __MigPackStructs
1174#pragma pack(push, 4)
1175#endif
1176 typedef struct {
1177 mach_msg_header_t Head;
1178 NDR_record_t NDR;
1179 kern_return_t RetCode;
1180 } __Reply__host_set_multiuser_config_flags_t __attribute__((unused));
1181#ifdef __MigPackStructs
1182#pragma pack(pop)
1183#endif
1184
1185#ifdef __MigPackStructs
1186#pragma pack(push, 4)
1187#endif
1188 typedef struct {
1189 mach_msg_header_t Head;
1190 NDR_record_t NDR;
1191 kern_return_t RetCode;
1192 uint32_t multiuser_flags;
1193 } __Reply__host_get_multiuser_config_flags_t __attribute__((unused));
1194#ifdef __MigPackStructs
1195#pragma pack(pop)
1196#endif
1197
1198#ifdef __MigPackStructs
1199#pragma pack(push, 4)
1200#endif
1201 typedef struct {
1202 mach_msg_header_t Head;
1203 NDR_record_t NDR;
1204 kern_return_t RetCode;
1205 uint32_t multiuser_mode;
1206 } __Reply__host_check_multiuser_mode_t __attribute__((unused));
1207#ifdef __MigPackStructs
1208#pragma pack(pop)
1209#endif
1210
1211#ifdef __MigPackStructs
1212#pragma pack(push, 4)
1213#endif
1214 typedef struct {
1215 mach_msg_header_t Head;
1216 NDR_record_t NDR;
1217 kern_return_t RetCode;
1218 mach_zone_info_t info;
1219 } __Reply__mach_zone_info_for_zone_t __attribute__((unused));
1220#ifdef __MigPackStructs
1221#pragma pack(pop)
1222#endif
1223#endif /* !__Reply__mach_host_subsystem__defined */
1224
1225/* union of all replies */
1226
1227#ifndef __ReplyUnion__mach_host_subsystem__defined
1228#define __ReplyUnion__mach_host_subsystem__defined
1229union __ReplyUnion__mach_host_subsystem {
1230 __Reply__host_info_t Reply_host_info;
1231 __Reply__host_kernel_version_t Reply_host_kernel_version;
1232 __Reply___host_page_size_t Reply__host_page_size;
1233 __Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry;
1234 __Reply__host_processor_info_t Reply_host_processor_info;
1235 __Reply__host_get_io_master_t Reply_host_get_io_master;
1236 __Reply__host_get_clock_service_t Reply_host_get_clock_service;
1237 __Reply__kmod_get_info_t Reply_kmod_get_info;
1238 __Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info;
1239 __Reply__processor_set_default_t Reply_processor_set_default;
1240 __Reply__processor_set_create_t Reply_processor_set_create;
1241 __Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64;
1242 __Reply__host_statistics_t Reply_host_statistics;
1243 __Reply__host_request_notification_t Reply_host_request_notification;
1244 __Reply__host_lockgroup_info_t Reply_host_lockgroup_info;
1245 __Reply__host_statistics64_t Reply_host_statistics64;
1246 __Reply__mach_zone_info_t Reply_mach_zone_info;
1247 __Reply__host_create_mach_voucher_t Reply_host_create_mach_voucher;
1248 __Reply__host_register_mach_voucher_attr_manager_t Reply_host_register_mach_voucher_attr_manager;
1249 __Reply__host_register_well_known_mach_voucher_attr_manager_t Reply_host_register_well_known_mach_voucher_attr_manager;
1250 __Reply__host_set_atm_diagnostic_flag_t Reply_host_set_atm_diagnostic_flag;
1251 __Reply__host_get_atm_diagnostic_flag_t Reply_host_get_atm_diagnostic_flag;
1252 __Reply__mach_memory_info_t Reply_mach_memory_info;
1253 __Reply__host_set_multiuser_config_flags_t Reply_host_set_multiuser_config_flags;
1254 __Reply__host_get_multiuser_config_flags_t Reply_host_get_multiuser_config_flags;
1255 __Reply__host_check_multiuser_mode_t Reply_host_check_multiuser_mode;
1256 __Reply__mach_zone_info_for_zone_t Reply_mach_zone_info_for_zone;
1257};
1258#endif /* !__RequestUnion__mach_host_subsystem__defined */
1259
1260#ifndef subsystem_to_name_map_mach_host
1261#define subsystem_to_name_map_mach_host \
1262 { "host_info", 200 },\
1263 { "host_kernel_version", 201 },\
1264 { "_host_page_size", 202 },\
1265 { "mach_memory_object_memory_entry", 203 },\
1266 { "host_processor_info", 204 },\
1267 { "host_get_io_master", 205 },\
1268 { "host_get_clock_service", 206 },\
1269 { "kmod_get_info", 207 },\
1270 { "host_virtual_physical_table_info", 209 },\
1271 { "processor_set_default", 213 },\
1272 { "processor_set_create", 214 },\
1273 { "mach_memory_object_memory_entry_64", 215 },\
1274 { "host_statistics", 216 },\
1275 { "host_request_notification", 217 },\
1276 { "host_lockgroup_info", 218 },\
1277 { "host_statistics64", 219 },\
1278 { "mach_zone_info", 220 },\
1279 { "host_create_mach_voucher", 222 },\
1280 { "host_register_mach_voucher_attr_manager", 223 },\
1281 { "host_register_well_known_mach_voucher_attr_manager", 224 },\
1282 { "host_set_atm_diagnostic_flag", 225 },\
1283 { "host_get_atm_diagnostic_flag", 226 },\
1284 { "mach_memory_info", 227 },\
1285 { "host_set_multiuser_config_flags", 228 },\
1286 { "host_get_multiuser_config_flags", 229 },\
1287 { "host_check_multiuser_mode", 230 },\
1288 { "mach_zone_info_for_zone", 231 }
1289#endif
1290
1291#ifdef __AfterMigUserHeader
1292__AfterMigUserHeader
1293#endif /* __AfterMigUserHeader */
1294
1295#endif /* _mach_host_user_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_init.h created+110
...@@ -0,0 +1,110 @@
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
52 */
53
54/*
55 * Items provided by the Mach environment initialization.
56 */
57
58#ifndef _MACH_INIT_
59#define _MACH_INIT_ 1
60
61#include <mach/mach_types.h>
62#include <mach/vm_page_size.h>
63#include <stdarg.h>
64
65#include <sys/cdefs.h>
66
67/*
68 * Kernel-related ports; how a task/thread controls itself
69 */
70
71__BEGIN_DECLS
72extern mach_port_t mach_host_self(void);
73extern mach_port_t mach_thread_self(void);
74extern kern_return_t host_page_size(host_t, vm_size_t *);
75
76extern mach_port_t mach_task_self_;
77#define mach_task_self() mach_task_self_
78#define current_task() mach_task_self()
79
80__END_DECLS
81#include <mach/mach_traps.h>
82__BEGIN_DECLS
83
84/*
85 * Other important ports in the Mach user environment
86 */
87
88extern mach_port_t bootstrap_port;
89
90/*
91 * Where these ports occur in the "mach_ports_register"
92 * collection... only servers or the runtime library need know.
93 */
94
95#define NAME_SERVER_SLOT 0
96#define ENVIRONMENT_SLOT 1
97#define SERVICE_SLOT 2
98
99#define MACH_PORTS_SLOTS_USED 3
100
101/*
102 * fprintf_stderr uses vprintf_stderr_func to produce
103 * error messages, this can be overridden by a user
104 * application to point to a user-specified output function
105 */
106extern int (*vprintf_stderr_func)(const char *format, va_list ap);
107
108__END_DECLS
109
110#endif /* _MACH_INIT_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_interface.h created+53
...@@ -0,0 +1,53 @@
1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Copyright (C) Apple Computer 1998
30 * ALL Rights Reserved
31 */
32/*
33 * This file represents the interfaces that used to come
34 * from creating the user headers from the mach.defs file.
35 * Because mach.defs was decomposed, this file now just
36 * wraps up all the new interface headers generated from
37 * each of the new .defs resulting from that decomposition.
38 */
39#ifndef _MACH_INTERFACE_H_
40#define _MACH_INTERFACE_H_
41
42#include <mach/clock_priv.h>
43#include <mach/host_priv.h>
44#include <mach/host_security.h>
45#include <mach/lock_set.h>
46#include <mach/processor.h>
47#include <mach/processor_set.h>
48#include <mach/semaphore.h>
49#include <mach/task.h>
50#include <mach/thread_act.h>
51#include <mach/vm_map.h>
52
53#endif /* _MACH_INTERFACE_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_port.h created+1808
...@@ -0,0 +1,1808 @@
1#ifndef _mach_port_user_
2#define _mach_port_user_
3
4/* Module mach_port */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef mach_port_MSG_COUNT
52#define mach_port_MSG_COUNT 40
53#endif /* mach_port_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach_debug/mach_debug_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine mach_port_names */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t mach_port_names
76(
77 ipc_space_t task,
78 mach_port_name_array_t *names,
79 mach_msg_type_number_t *namesCnt,
80 mach_port_type_array_t *types,
81 mach_msg_type_number_t *typesCnt
82);
83
84/* Routine mach_port_type */
85#ifdef mig_external
86mig_external
87#else
88extern
89#endif /* mig_external */
90kern_return_t mach_port_type
91(
92 ipc_space_t task,
93 mach_port_name_t name,
94 mach_port_type_t *ptype
95);
96
97/* Routine mach_port_rename */
98#ifdef mig_external
99mig_external
100#else
101extern
102#endif /* mig_external */
103kern_return_t mach_port_rename
104(
105 ipc_space_t task,
106 mach_port_name_t old_name,
107 mach_port_name_t new_name
108);
109
110/* Routine mach_port_allocate_name */
111#ifdef mig_external
112mig_external
113#else
114extern
115#endif /* mig_external */
116__WATCHOS_PROHIBITED
117__TVOS_PROHIBITED
118kern_return_t mach_port_allocate_name
119(
120 ipc_space_t task,
121 mach_port_right_t right,
122 mach_port_name_t name
123);
124
125/* Routine mach_port_allocate */
126#ifdef mig_external
127mig_external
128#else
129extern
130#endif /* mig_external */
131kern_return_t mach_port_allocate
132(
133 ipc_space_t task,
134 mach_port_right_t right,
135 mach_port_name_t *name
136);
137
138/* Routine mach_port_destroy */
139#ifdef mig_external
140mig_external
141#else
142extern
143#endif /* mig_external */
144kern_return_t mach_port_destroy
145(
146 ipc_space_t task,
147 mach_port_name_t name
148);
149
150/* Routine mach_port_deallocate */
151#ifdef mig_external
152mig_external
153#else
154extern
155#endif /* mig_external */
156kern_return_t mach_port_deallocate
157(
158 ipc_space_t task,
159 mach_port_name_t name
160);
161
162/* Routine mach_port_get_refs */
163#ifdef mig_external
164mig_external
165#else
166extern
167#endif /* mig_external */
168kern_return_t mach_port_get_refs
169(
170 ipc_space_t task,
171 mach_port_name_t name,
172 mach_port_right_t right,
173 mach_port_urefs_t *refs
174);
175
176/* Routine mach_port_mod_refs */
177#ifdef mig_external
178mig_external
179#else
180extern
181#endif /* mig_external */
182kern_return_t mach_port_mod_refs
183(
184 ipc_space_t task,
185 mach_port_name_t name,
186 mach_port_right_t right,
187 mach_port_delta_t delta
188);
189
190/* Routine mach_port_peek */
191#ifdef mig_external
192mig_external
193#else
194extern
195#endif /* mig_external */
196kern_return_t mach_port_peek
197(
198 ipc_space_t task,
199 mach_port_name_t name,
200 mach_msg_trailer_type_t trailer_type,
201 mach_port_seqno_t *request_seqnop,
202 mach_msg_size_t *msg_sizep,
203 mach_msg_id_t *msg_idp,
204 mach_msg_trailer_info_t trailer_infop,
205 mach_msg_type_number_t *trailer_infopCnt
206);
207
208/* Routine mach_port_set_mscount */
209#ifdef mig_external
210mig_external
211#else
212extern
213#endif /* mig_external */
214kern_return_t mach_port_set_mscount
215(
216 ipc_space_t task,
217 mach_port_name_t name,
218 mach_port_mscount_t mscount
219);
220
221/* Routine mach_port_get_set_status */
222#ifdef mig_external
223mig_external
224#else
225extern
226#endif /* mig_external */
227kern_return_t mach_port_get_set_status
228(
229 ipc_space_inspect_t task,
230 mach_port_name_t name,
231 mach_port_name_array_t *members,
232 mach_msg_type_number_t *membersCnt
233);
234
235/* Routine mach_port_move_member */
236#ifdef mig_external
237mig_external
238#else
239extern
240#endif /* mig_external */
241kern_return_t mach_port_move_member
242(
243 ipc_space_t task,
244 mach_port_name_t member,
245 mach_port_name_t after
246);
247
248/* Routine mach_port_request_notification */
249#ifdef mig_external
250mig_external
251#else
252extern
253#endif /* mig_external */
254kern_return_t mach_port_request_notification
255(
256 ipc_space_t task,
257 mach_port_name_t name,
258 mach_msg_id_t msgid,
259 mach_port_mscount_t sync,
260 mach_port_t notify,
261 mach_msg_type_name_t notifyPoly,
262 mach_port_t *previous
263);
264
265/* Routine mach_port_insert_right */
266#ifdef mig_external
267mig_external
268#else
269extern
270#endif /* mig_external */
271kern_return_t mach_port_insert_right
272(
273 ipc_space_t task,
274 mach_port_name_t name,
275 mach_port_t poly,
276 mach_msg_type_name_t polyPoly
277);
278
279/* Routine mach_port_extract_right */
280#ifdef mig_external
281mig_external
282#else
283extern
284#endif /* mig_external */
285kern_return_t mach_port_extract_right
286(
287 ipc_space_t task,
288 mach_port_name_t name,
289 mach_msg_type_name_t msgt_name,
290 mach_port_t *poly,
291 mach_msg_type_name_t *polyPoly
292);
293
294/* Routine mach_port_set_seqno */
295#ifdef mig_external
296mig_external
297#else
298extern
299#endif /* mig_external */
300kern_return_t mach_port_set_seqno
301(
302 ipc_space_t task,
303 mach_port_name_t name,
304 mach_port_seqno_t seqno
305);
306
307/* Routine mach_port_get_attributes */
308#ifdef mig_external
309mig_external
310#else
311extern
312#endif /* mig_external */
313kern_return_t mach_port_get_attributes
314(
315 ipc_space_inspect_t task,
316 mach_port_name_t name,
317 mach_port_flavor_t flavor,
318 mach_port_info_t port_info_out,
319 mach_msg_type_number_t *port_info_outCnt
320);
321
322/* Routine mach_port_set_attributes */
323#ifdef mig_external
324mig_external
325#else
326extern
327#endif /* mig_external */
328kern_return_t mach_port_set_attributes
329(
330 ipc_space_t task,
331 mach_port_name_t name,
332 mach_port_flavor_t flavor,
333 mach_port_info_t port_info,
334 mach_msg_type_number_t port_infoCnt
335);
336
337/* Routine mach_port_allocate_qos */
338#ifdef mig_external
339mig_external
340#else
341extern
342#endif /* mig_external */
343kern_return_t mach_port_allocate_qos
344(
345 ipc_space_t task,
346 mach_port_right_t right,
347 mach_port_qos_t *qos,
348 mach_port_name_t *name
349);
350
351/* Routine mach_port_allocate_full */
352#ifdef mig_external
353mig_external
354#else
355extern
356#endif /* mig_external */
357kern_return_t mach_port_allocate_full
358(
359 ipc_space_t task,
360 mach_port_right_t right,
361 mach_port_t proto,
362 mach_port_qos_t *qos,
363 mach_port_name_t *name
364);
365
366/* Routine task_set_port_space */
367#ifdef mig_external
368mig_external
369#else
370extern
371#endif /* mig_external */
372__WATCHOS_PROHIBITED
373__TVOS_PROHIBITED
374kern_return_t task_set_port_space
375(
376 ipc_space_t task,
377 int table_entries
378);
379
380/* Routine mach_port_get_srights */
381#ifdef mig_external
382mig_external
383#else
384extern
385#endif /* mig_external */
386kern_return_t mach_port_get_srights
387(
388 ipc_space_t task,
389 mach_port_name_t name,
390 mach_port_rights_t *srights
391);
392
393/* Routine mach_port_space_info */
394#ifdef mig_external
395mig_external
396#else
397extern
398#endif /* mig_external */
399kern_return_t mach_port_space_info
400(
401 ipc_space_inspect_t task,
402 ipc_info_space_t *space_info,
403 ipc_info_name_array_t *table_info,
404 mach_msg_type_number_t *table_infoCnt,
405 ipc_info_tree_name_array_t *tree_info,
406 mach_msg_type_number_t *tree_infoCnt
407);
408
409/* Routine mach_port_dnrequest_info */
410#ifdef mig_external
411mig_external
412#else
413extern
414#endif /* mig_external */
415kern_return_t mach_port_dnrequest_info
416(
417 ipc_space_t task,
418 mach_port_name_t name,
419 unsigned *dnr_total,
420 unsigned *dnr_used
421);
422
423/* Routine mach_port_kernel_object */
424#ifdef mig_external
425mig_external
426#else
427extern
428#endif /* mig_external */
429kern_return_t mach_port_kernel_object
430(
431 ipc_space_inspect_t task,
432 mach_port_name_t name,
433 unsigned *object_type,
434 unsigned *object_addr
435);
436
437/* Routine mach_port_insert_member */
438#ifdef mig_external
439mig_external
440#else
441extern
442#endif /* mig_external */
443kern_return_t mach_port_insert_member
444(
445 ipc_space_t task,
446 mach_port_name_t name,
447 mach_port_name_t pset
448);
449
450/* Routine mach_port_extract_member */
451#ifdef mig_external
452mig_external
453#else
454extern
455#endif /* mig_external */
456kern_return_t mach_port_extract_member
457(
458 ipc_space_t task,
459 mach_port_name_t name,
460 mach_port_name_t pset
461);
462
463/* Routine mach_port_get_context */
464#ifdef mig_external
465mig_external
466#else
467extern
468#endif /* mig_external */
469kern_return_t mach_port_get_context
470(
471 ipc_space_inspect_t task,
472 mach_port_name_t name,
473 mach_port_context_t *context
474);
475
476/* Routine mach_port_set_context */
477#ifdef mig_external
478mig_external
479#else
480extern
481#endif /* mig_external */
482kern_return_t mach_port_set_context
483(
484 ipc_space_t task,
485 mach_port_name_t name,
486 mach_port_context_t context
487);
488
489/* Routine mach_port_kobject */
490#ifdef mig_external
491mig_external
492#else
493extern
494#endif /* mig_external */
495kern_return_t mach_port_kobject
496(
497 ipc_space_inspect_t task,
498 mach_port_name_t name,
499 natural_t *object_type,
500 mach_vm_address_t *object_addr
501);
502
503/* Routine mach_port_construct */
504#ifdef mig_external
505mig_external
506#else
507extern
508#endif /* mig_external */
509kern_return_t mach_port_construct
510(
511 ipc_space_t task,
512 mach_port_options_ptr_t options,
513 mach_port_context_t context,
514 mach_port_name_t *name
515);
516
517/* Routine mach_port_destruct */
518#ifdef mig_external
519mig_external
520#else
521extern
522#endif /* mig_external */
523kern_return_t mach_port_destruct
524(
525 ipc_space_t task,
526 mach_port_name_t name,
527 mach_port_delta_t srdelta,
528 mach_port_context_t guard
529);
530
531/* Routine mach_port_guard */
532#ifdef mig_external
533mig_external
534#else
535extern
536#endif /* mig_external */
537kern_return_t mach_port_guard
538(
539 ipc_space_t task,
540 mach_port_name_t name,
541 mach_port_context_t guard,
542 boolean_t strict
543);
544
545/* Routine mach_port_unguard */
546#ifdef mig_external
547mig_external
548#else
549extern
550#endif /* mig_external */
551kern_return_t mach_port_unguard
552(
553 ipc_space_t task,
554 mach_port_name_t name,
555 mach_port_context_t guard
556);
557
558/* Routine mach_port_space_basic_info */
559#ifdef mig_external
560mig_external
561#else
562extern
563#endif /* mig_external */
564kern_return_t mach_port_space_basic_info
565(
566 ipc_space_inspect_t task,
567 ipc_info_space_basic_t *basic_info
568);
569
570/* Routine mach_port_guard_with_flags */
571#ifdef mig_external
572mig_external
573#else
574extern
575#endif /* mig_external */
576kern_return_t mach_port_guard_with_flags
577(
578 ipc_space_t task,
579 mach_port_name_t name,
580 mach_port_context_t guard,
581 uint64_t flags
582);
583
584/* Routine mach_port_swap_guard */
585#ifdef mig_external
586mig_external
587#else
588extern
589#endif /* mig_external */
590kern_return_t mach_port_swap_guard
591(
592 ipc_space_t task,
593 mach_port_name_t name,
594 mach_port_context_t old_guard,
595 mach_port_context_t new_guard
596);
597
598/* Routine mach_port_kobject_description */
599#ifdef mig_external
600mig_external
601#else
602extern
603#endif /* mig_external */
604kern_return_t mach_port_kobject_description
605(
606 ipc_space_inspect_t task,
607 mach_port_name_t name,
608 natural_t *object_type,
609 mach_vm_address_t *object_addr,
610 kobject_description_t description
611);
612
613__END_DECLS
614
615/********************** Caution **************************/
616/* The following data types should be used to calculate */
617/* maximum message sizes only. The actual message may be */
618/* smaller, and the position of the arguments within the */
619/* message layout may vary from what is presented here. */
620/* For example, if any of the arguments are variable- */
621/* sized, and less than the maximum is sent, the data */
622/* will be packed tight in the actual message to reduce */
623/* the presence of holes. */
624/********************** Caution **************************/
625
626/* typedefs for all requests */
627
628#ifndef __Request__mach_port_subsystem__defined
629#define __Request__mach_port_subsystem__defined
630
631#ifdef __MigPackStructs
632#pragma pack(push, 4)
633#endif
634 typedef struct {
635 mach_msg_header_t Head;
636 } __Request__mach_port_names_t __attribute__((unused));
637#ifdef __MigPackStructs
638#pragma pack(pop)
639#endif
640
641#ifdef __MigPackStructs
642#pragma pack(push, 4)
643#endif
644 typedef struct {
645 mach_msg_header_t Head;
646 NDR_record_t NDR;
647 mach_port_name_t name;
648 } __Request__mach_port_type_t __attribute__((unused));
649#ifdef __MigPackStructs
650#pragma pack(pop)
651#endif
652
653#ifdef __MigPackStructs
654#pragma pack(push, 4)
655#endif
656 typedef struct {
657 mach_msg_header_t Head;
658 NDR_record_t NDR;
659 mach_port_name_t old_name;
660 mach_port_name_t new_name;
661 } __Request__mach_port_rename_t __attribute__((unused));
662#ifdef __MigPackStructs
663#pragma pack(pop)
664#endif
665
666#ifdef __MigPackStructs
667#pragma pack(push, 4)
668#endif
669 typedef struct {
670 mach_msg_header_t Head;
671 NDR_record_t NDR;
672 mach_port_right_t right;
673 mach_port_name_t name;
674 } __Request__mach_port_allocate_name_t __attribute__((unused));
675#ifdef __MigPackStructs
676#pragma pack(pop)
677#endif
678
679#ifdef __MigPackStructs
680#pragma pack(push, 4)
681#endif
682 typedef struct {
683 mach_msg_header_t Head;
684 NDR_record_t NDR;
685 mach_port_right_t right;
686 } __Request__mach_port_allocate_t __attribute__((unused));
687#ifdef __MigPackStructs
688#pragma pack(pop)
689#endif
690
691#ifdef __MigPackStructs
692#pragma pack(push, 4)
693#endif
694 typedef struct {
695 mach_msg_header_t Head;
696 NDR_record_t NDR;
697 mach_port_name_t name;
698 } __Request__mach_port_destroy_t __attribute__((unused));
699#ifdef __MigPackStructs
700#pragma pack(pop)
701#endif
702
703#ifdef __MigPackStructs
704#pragma pack(push, 4)
705#endif
706 typedef struct {
707 mach_msg_header_t Head;
708 NDR_record_t NDR;
709 mach_port_name_t name;
710 } __Request__mach_port_deallocate_t __attribute__((unused));
711#ifdef __MigPackStructs
712#pragma pack(pop)
713#endif
714
715#ifdef __MigPackStructs
716#pragma pack(push, 4)
717#endif
718 typedef struct {
719 mach_msg_header_t Head;
720 NDR_record_t NDR;
721 mach_port_name_t name;
722 mach_port_right_t right;
723 } __Request__mach_port_get_refs_t __attribute__((unused));
724#ifdef __MigPackStructs
725#pragma pack(pop)
726#endif
727
728#ifdef __MigPackStructs
729#pragma pack(push, 4)
730#endif
731 typedef struct {
732 mach_msg_header_t Head;
733 NDR_record_t NDR;
734 mach_port_name_t name;
735 mach_port_right_t right;
736 mach_port_delta_t delta;
737 } __Request__mach_port_mod_refs_t __attribute__((unused));
738#ifdef __MigPackStructs
739#pragma pack(pop)
740#endif
741
742#ifdef __MigPackStructs
743#pragma pack(push, 4)
744#endif
745 typedef struct {
746 mach_msg_header_t Head;
747 NDR_record_t NDR;
748 mach_port_name_t name;
749 mach_msg_trailer_type_t trailer_type;
750 mach_port_seqno_t request_seqnop;
751 mach_msg_type_number_t trailer_infopCnt;
752 } __Request__mach_port_peek_t __attribute__((unused));
753#ifdef __MigPackStructs
754#pragma pack(pop)
755#endif
756
757#ifdef __MigPackStructs
758#pragma pack(push, 4)
759#endif
760 typedef struct {
761 mach_msg_header_t Head;
762 NDR_record_t NDR;
763 mach_port_name_t name;
764 mach_port_mscount_t mscount;
765 } __Request__mach_port_set_mscount_t __attribute__((unused));
766#ifdef __MigPackStructs
767#pragma pack(pop)
768#endif
769
770#ifdef __MigPackStructs
771#pragma pack(push, 4)
772#endif
773 typedef struct {
774 mach_msg_header_t Head;
775 NDR_record_t NDR;
776 mach_port_name_t name;
777 } __Request__mach_port_get_set_status_t __attribute__((unused));
778#ifdef __MigPackStructs
779#pragma pack(pop)
780#endif
781
782#ifdef __MigPackStructs
783#pragma pack(push, 4)
784#endif
785 typedef struct {
786 mach_msg_header_t Head;
787 NDR_record_t NDR;
788 mach_port_name_t member;
789 mach_port_name_t after;
790 } __Request__mach_port_move_member_t __attribute__((unused));
791#ifdef __MigPackStructs
792#pragma pack(pop)
793#endif
794
795#ifdef __MigPackStructs
796#pragma pack(push, 4)
797#endif
798 typedef struct {
799 mach_msg_header_t Head;
800 /* start of the kernel processed data */
801 mach_msg_body_t msgh_body;
802 mach_msg_port_descriptor_t notify;
803 /* end of the kernel processed data */
804 NDR_record_t NDR;
805 mach_port_name_t name;
806 mach_msg_id_t msgid;
807 mach_port_mscount_t sync;
808 } __Request__mach_port_request_notification_t __attribute__((unused));
809#ifdef __MigPackStructs
810#pragma pack(pop)
811#endif
812
813#ifdef __MigPackStructs
814#pragma pack(push, 4)
815#endif
816 typedef struct {
817 mach_msg_header_t Head;
818 /* start of the kernel processed data */
819 mach_msg_body_t msgh_body;
820 mach_msg_port_descriptor_t poly;
821 /* end of the kernel processed data */
822 NDR_record_t NDR;
823 mach_port_name_t name;
824 } __Request__mach_port_insert_right_t __attribute__((unused));
825#ifdef __MigPackStructs
826#pragma pack(pop)
827#endif
828
829#ifdef __MigPackStructs
830#pragma pack(push, 4)
831#endif
832 typedef struct {
833 mach_msg_header_t Head;
834 NDR_record_t NDR;
835 mach_port_name_t name;
836 mach_msg_type_name_t msgt_name;
837 } __Request__mach_port_extract_right_t __attribute__((unused));
838#ifdef __MigPackStructs
839#pragma pack(pop)
840#endif
841
842#ifdef __MigPackStructs
843#pragma pack(push, 4)
844#endif
845 typedef struct {
846 mach_msg_header_t Head;
847 NDR_record_t NDR;
848 mach_port_name_t name;
849 mach_port_seqno_t seqno;
850 } __Request__mach_port_set_seqno_t __attribute__((unused));
851#ifdef __MigPackStructs
852#pragma pack(pop)
853#endif
854
855#ifdef __MigPackStructs
856#pragma pack(push, 4)
857#endif
858 typedef struct {
859 mach_msg_header_t Head;
860 NDR_record_t NDR;
861 mach_port_name_t name;
862 mach_port_flavor_t flavor;
863 mach_msg_type_number_t port_info_outCnt;
864 } __Request__mach_port_get_attributes_t __attribute__((unused));
865#ifdef __MigPackStructs
866#pragma pack(pop)
867#endif
868
869#ifdef __MigPackStructs
870#pragma pack(push, 4)
871#endif
872 typedef struct {
873 mach_msg_header_t Head;
874 NDR_record_t NDR;
875 mach_port_name_t name;
876 mach_port_flavor_t flavor;
877 mach_msg_type_number_t port_infoCnt;
878 integer_t port_info[17];
879 } __Request__mach_port_set_attributes_t __attribute__((unused));
880#ifdef __MigPackStructs
881#pragma pack(pop)
882#endif
883
884#ifdef __MigPackStructs
885#pragma pack(push, 4)
886#endif
887 typedef struct {
888 mach_msg_header_t Head;
889 NDR_record_t NDR;
890 mach_port_right_t right;
891 mach_port_qos_t qos;
892 } __Request__mach_port_allocate_qos_t __attribute__((unused));
893#ifdef __MigPackStructs
894#pragma pack(pop)
895#endif
896
897#ifdef __MigPackStructs
898#pragma pack(push, 4)
899#endif
900 typedef struct {
901 mach_msg_header_t Head;
902 /* start of the kernel processed data */
903 mach_msg_body_t msgh_body;
904 mach_msg_port_descriptor_t proto;
905 /* end of the kernel processed data */
906 NDR_record_t NDR;
907 mach_port_right_t right;
908 mach_port_qos_t qos;
909 mach_port_name_t name;
910 } __Request__mach_port_allocate_full_t __attribute__((unused));
911#ifdef __MigPackStructs
912#pragma pack(pop)
913#endif
914
915#ifdef __MigPackStructs
916#pragma pack(push, 4)
917#endif
918 typedef struct {
919 mach_msg_header_t Head;
920 NDR_record_t NDR;
921 int table_entries;
922 } __Request__task_set_port_space_t __attribute__((unused));
923#ifdef __MigPackStructs
924#pragma pack(pop)
925#endif
926
927#ifdef __MigPackStructs
928#pragma pack(push, 4)
929#endif
930 typedef struct {
931 mach_msg_header_t Head;
932 NDR_record_t NDR;
933 mach_port_name_t name;
934 } __Request__mach_port_get_srights_t __attribute__((unused));
935#ifdef __MigPackStructs
936#pragma pack(pop)
937#endif
938
939#ifdef __MigPackStructs
940#pragma pack(push, 4)
941#endif
942 typedef struct {
943 mach_msg_header_t Head;
944 } __Request__mach_port_space_info_t __attribute__((unused));
945#ifdef __MigPackStructs
946#pragma pack(pop)
947#endif
948
949#ifdef __MigPackStructs
950#pragma pack(push, 4)
951#endif
952 typedef struct {
953 mach_msg_header_t Head;
954 NDR_record_t NDR;
955 mach_port_name_t name;
956 } __Request__mach_port_dnrequest_info_t __attribute__((unused));
957#ifdef __MigPackStructs
958#pragma pack(pop)
959#endif
960
961#ifdef __MigPackStructs
962#pragma pack(push, 4)
963#endif
964 typedef struct {
965 mach_msg_header_t Head;
966 NDR_record_t NDR;
967 mach_port_name_t name;
968 } __Request__mach_port_kernel_object_t __attribute__((unused));
969#ifdef __MigPackStructs
970#pragma pack(pop)
971#endif
972
973#ifdef __MigPackStructs
974#pragma pack(push, 4)
975#endif
976 typedef struct {
977 mach_msg_header_t Head;
978 NDR_record_t NDR;
979 mach_port_name_t name;
980 mach_port_name_t pset;
981 } __Request__mach_port_insert_member_t __attribute__((unused));
982#ifdef __MigPackStructs
983#pragma pack(pop)
984#endif
985
986#ifdef __MigPackStructs
987#pragma pack(push, 4)
988#endif
989 typedef struct {
990 mach_msg_header_t Head;
991 NDR_record_t NDR;
992 mach_port_name_t name;
993 mach_port_name_t pset;
994 } __Request__mach_port_extract_member_t __attribute__((unused));
995#ifdef __MigPackStructs
996#pragma pack(pop)
997#endif
998
999#ifdef __MigPackStructs
1000#pragma pack(push, 4)
1001#endif
1002 typedef struct {
1003 mach_msg_header_t Head;
1004 NDR_record_t NDR;
1005 mach_port_name_t name;
1006 } __Request__mach_port_get_context_t __attribute__((unused));
1007#ifdef __MigPackStructs
1008#pragma pack(pop)
1009#endif
1010
1011#ifdef __MigPackStructs
1012#pragma pack(push, 4)
1013#endif
1014 typedef struct {
1015 mach_msg_header_t Head;
1016 NDR_record_t NDR;
1017 mach_port_name_t name;
1018 mach_port_context_t context;
1019 } __Request__mach_port_set_context_t __attribute__((unused));
1020#ifdef __MigPackStructs
1021#pragma pack(pop)
1022#endif
1023
1024#ifdef __MigPackStructs
1025#pragma pack(push, 4)
1026#endif
1027 typedef struct {
1028 mach_msg_header_t Head;
1029 NDR_record_t NDR;
1030 mach_port_name_t name;
1031 } __Request__mach_port_kobject_t __attribute__((unused));
1032#ifdef __MigPackStructs
1033#pragma pack(pop)
1034#endif
1035
1036#ifdef __MigPackStructs
1037#pragma pack(push, 4)
1038#endif
1039 typedef struct {
1040 mach_msg_header_t Head;
1041 /* start of the kernel processed data */
1042 mach_msg_body_t msgh_body;
1043 mach_msg_ool_descriptor_t options;
1044 /* end of the kernel processed data */
1045 NDR_record_t NDR;
1046 mach_port_context_t context;
1047 } __Request__mach_port_construct_t __attribute__((unused));
1048#ifdef __MigPackStructs
1049#pragma pack(pop)
1050#endif
1051
1052#ifdef __MigPackStructs
1053#pragma pack(push, 4)
1054#endif
1055 typedef struct {
1056 mach_msg_header_t Head;
1057 NDR_record_t NDR;
1058 mach_port_name_t name;
1059 mach_port_delta_t srdelta;
1060 mach_port_context_t guard;
1061 } __Request__mach_port_destruct_t __attribute__((unused));
1062#ifdef __MigPackStructs
1063#pragma pack(pop)
1064#endif
1065
1066#ifdef __MigPackStructs
1067#pragma pack(push, 4)
1068#endif
1069 typedef struct {
1070 mach_msg_header_t Head;
1071 NDR_record_t NDR;
1072 mach_port_name_t name;
1073 mach_port_context_t guard;
1074 boolean_t strict;
1075 } __Request__mach_port_guard_t __attribute__((unused));
1076#ifdef __MigPackStructs
1077#pragma pack(pop)
1078#endif
1079
1080#ifdef __MigPackStructs
1081#pragma pack(push, 4)
1082#endif
1083 typedef struct {
1084 mach_msg_header_t Head;
1085 NDR_record_t NDR;
1086 mach_port_name_t name;
1087 mach_port_context_t guard;
1088 } __Request__mach_port_unguard_t __attribute__((unused));
1089#ifdef __MigPackStructs
1090#pragma pack(pop)
1091#endif
1092
1093#ifdef __MigPackStructs
1094#pragma pack(push, 4)
1095#endif
1096 typedef struct {
1097 mach_msg_header_t Head;
1098 } __Request__mach_port_space_basic_info_t __attribute__((unused));
1099#ifdef __MigPackStructs
1100#pragma pack(pop)
1101#endif
1102
1103#ifdef __MigPackStructs
1104#pragma pack(push, 4)
1105#endif
1106 typedef struct {
1107 mach_msg_header_t Head;
1108 NDR_record_t NDR;
1109 mach_port_name_t name;
1110 mach_port_context_t guard;
1111 uint64_t flags;
1112 } __Request__mach_port_guard_with_flags_t __attribute__((unused));
1113#ifdef __MigPackStructs
1114#pragma pack(pop)
1115#endif
1116
1117#ifdef __MigPackStructs
1118#pragma pack(push, 4)
1119#endif
1120 typedef struct {
1121 mach_msg_header_t Head;
1122 NDR_record_t NDR;
1123 mach_port_name_t name;
1124 mach_port_context_t old_guard;
1125 mach_port_context_t new_guard;
1126 } __Request__mach_port_swap_guard_t __attribute__((unused));
1127#ifdef __MigPackStructs
1128#pragma pack(pop)
1129#endif
1130
1131#ifdef __MigPackStructs
1132#pragma pack(push, 4)
1133#endif
1134 typedef struct {
1135 mach_msg_header_t Head;
1136 NDR_record_t NDR;
1137 mach_port_name_t name;
1138 } __Request__mach_port_kobject_description_t __attribute__((unused));
1139#ifdef __MigPackStructs
1140#pragma pack(pop)
1141#endif
1142#endif /* !__Request__mach_port_subsystem__defined */
1143
1144/* union of all requests */
1145
1146#ifndef __RequestUnion__mach_port_subsystem__defined
1147#define __RequestUnion__mach_port_subsystem__defined
1148union __RequestUnion__mach_port_subsystem {
1149 __Request__mach_port_names_t Request_mach_port_names;
1150 __Request__mach_port_type_t Request_mach_port_type;
1151 __Request__mach_port_rename_t Request_mach_port_rename;
1152 __Request__mach_port_allocate_name_t Request_mach_port_allocate_name;
1153 __Request__mach_port_allocate_t Request_mach_port_allocate;
1154 __Request__mach_port_destroy_t Request_mach_port_destroy;
1155 __Request__mach_port_deallocate_t Request_mach_port_deallocate;
1156 __Request__mach_port_get_refs_t Request_mach_port_get_refs;
1157 __Request__mach_port_mod_refs_t Request_mach_port_mod_refs;
1158 __Request__mach_port_peek_t Request_mach_port_peek;
1159 __Request__mach_port_set_mscount_t Request_mach_port_set_mscount;
1160 __Request__mach_port_get_set_status_t Request_mach_port_get_set_status;
1161 __Request__mach_port_move_member_t Request_mach_port_move_member;
1162 __Request__mach_port_request_notification_t Request_mach_port_request_notification;
1163 __Request__mach_port_insert_right_t Request_mach_port_insert_right;
1164 __Request__mach_port_extract_right_t Request_mach_port_extract_right;
1165 __Request__mach_port_set_seqno_t Request_mach_port_set_seqno;
1166 __Request__mach_port_get_attributes_t Request_mach_port_get_attributes;
1167 __Request__mach_port_set_attributes_t Request_mach_port_set_attributes;
1168 __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos;
1169 __Request__mach_port_allocate_full_t Request_mach_port_allocate_full;
1170 __Request__task_set_port_space_t Request_task_set_port_space;
1171 __Request__mach_port_get_srights_t Request_mach_port_get_srights;
1172 __Request__mach_port_space_info_t Request_mach_port_space_info;
1173 __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info;
1174 __Request__mach_port_kernel_object_t Request_mach_port_kernel_object;
1175 __Request__mach_port_insert_member_t Request_mach_port_insert_member;
1176 __Request__mach_port_extract_member_t Request_mach_port_extract_member;
1177 __Request__mach_port_get_context_t Request_mach_port_get_context;
1178 __Request__mach_port_set_context_t Request_mach_port_set_context;
1179 __Request__mach_port_kobject_t Request_mach_port_kobject;
1180 __Request__mach_port_construct_t Request_mach_port_construct;
1181 __Request__mach_port_destruct_t Request_mach_port_destruct;
1182 __Request__mach_port_guard_t Request_mach_port_guard;
1183 __Request__mach_port_unguard_t Request_mach_port_unguard;
1184 __Request__mach_port_space_basic_info_t Request_mach_port_space_basic_info;
1185 __Request__mach_port_guard_with_flags_t Request_mach_port_guard_with_flags;
1186 __Request__mach_port_swap_guard_t Request_mach_port_swap_guard;
1187 __Request__mach_port_kobject_description_t Request_mach_port_kobject_description;
1188};
1189#endif /* !__RequestUnion__mach_port_subsystem__defined */
1190/* typedefs for all replies */
1191
1192#ifndef __Reply__mach_port_subsystem__defined
1193#define __Reply__mach_port_subsystem__defined
1194
1195#ifdef __MigPackStructs
1196#pragma pack(push, 4)
1197#endif
1198 typedef struct {
1199 mach_msg_header_t Head;
1200 /* start of the kernel processed data */
1201 mach_msg_body_t msgh_body;
1202 mach_msg_ool_descriptor_t names;
1203 mach_msg_ool_descriptor_t types;
1204 /* end of the kernel processed data */
1205 NDR_record_t NDR;
1206 mach_msg_type_number_t namesCnt;
1207 mach_msg_type_number_t typesCnt;
1208 } __Reply__mach_port_names_t __attribute__((unused));
1209#ifdef __MigPackStructs
1210#pragma pack(pop)
1211#endif
1212
1213#ifdef __MigPackStructs
1214#pragma pack(push, 4)
1215#endif
1216 typedef struct {
1217 mach_msg_header_t Head;
1218 NDR_record_t NDR;
1219 kern_return_t RetCode;
1220 mach_port_type_t ptype;
1221 } __Reply__mach_port_type_t __attribute__((unused));
1222#ifdef __MigPackStructs
1223#pragma pack(pop)
1224#endif
1225
1226#ifdef __MigPackStructs
1227#pragma pack(push, 4)
1228#endif
1229 typedef struct {
1230 mach_msg_header_t Head;
1231 NDR_record_t NDR;
1232 kern_return_t RetCode;
1233 } __Reply__mach_port_rename_t __attribute__((unused));
1234#ifdef __MigPackStructs
1235#pragma pack(pop)
1236#endif
1237
1238#ifdef __MigPackStructs
1239#pragma pack(push, 4)
1240#endif
1241 typedef struct {
1242 mach_msg_header_t Head;
1243 NDR_record_t NDR;
1244 kern_return_t RetCode;
1245 } __Reply__mach_port_allocate_name_t __attribute__((unused));
1246#ifdef __MigPackStructs
1247#pragma pack(pop)
1248#endif
1249
1250#ifdef __MigPackStructs
1251#pragma pack(push, 4)
1252#endif
1253 typedef struct {
1254 mach_msg_header_t Head;
1255 NDR_record_t NDR;
1256 kern_return_t RetCode;
1257 mach_port_name_t name;
1258 } __Reply__mach_port_allocate_t __attribute__((unused));
1259#ifdef __MigPackStructs
1260#pragma pack(pop)
1261#endif
1262
1263#ifdef __MigPackStructs
1264#pragma pack(push, 4)
1265#endif
1266 typedef struct {
1267 mach_msg_header_t Head;
1268 NDR_record_t NDR;
1269 kern_return_t RetCode;
1270 } __Reply__mach_port_destroy_t __attribute__((unused));
1271#ifdef __MigPackStructs
1272#pragma pack(pop)
1273#endif
1274
1275#ifdef __MigPackStructs
1276#pragma pack(push, 4)
1277#endif
1278 typedef struct {
1279 mach_msg_header_t Head;
1280 NDR_record_t NDR;
1281 kern_return_t RetCode;
1282 } __Reply__mach_port_deallocate_t __attribute__((unused));
1283#ifdef __MigPackStructs
1284#pragma pack(pop)
1285#endif
1286
1287#ifdef __MigPackStructs
1288#pragma pack(push, 4)
1289#endif
1290 typedef struct {
1291 mach_msg_header_t Head;
1292 NDR_record_t NDR;
1293 kern_return_t RetCode;
1294 mach_port_urefs_t refs;
1295 } __Reply__mach_port_get_refs_t __attribute__((unused));
1296#ifdef __MigPackStructs
1297#pragma pack(pop)
1298#endif
1299
1300#ifdef __MigPackStructs
1301#pragma pack(push, 4)
1302#endif
1303 typedef struct {
1304 mach_msg_header_t Head;
1305 NDR_record_t NDR;
1306 kern_return_t RetCode;
1307 } __Reply__mach_port_mod_refs_t __attribute__((unused));
1308#ifdef __MigPackStructs
1309#pragma pack(pop)
1310#endif
1311
1312#ifdef __MigPackStructs
1313#pragma pack(push, 4)
1314#endif
1315 typedef struct {
1316 mach_msg_header_t Head;
1317 NDR_record_t NDR;
1318 kern_return_t RetCode;
1319 mach_port_seqno_t request_seqnop;
1320 mach_msg_size_t msg_sizep;
1321 mach_msg_id_t msg_idp;
1322 mach_msg_type_number_t trailer_infopCnt;
1323 char trailer_infop[68];
1324 } __Reply__mach_port_peek_t __attribute__((unused));
1325#ifdef __MigPackStructs
1326#pragma pack(pop)
1327#endif
1328
1329#ifdef __MigPackStructs
1330#pragma pack(push, 4)
1331#endif
1332 typedef struct {
1333 mach_msg_header_t Head;
1334 NDR_record_t NDR;
1335 kern_return_t RetCode;
1336 } __Reply__mach_port_set_mscount_t __attribute__((unused));
1337#ifdef __MigPackStructs
1338#pragma pack(pop)
1339#endif
1340
1341#ifdef __MigPackStructs
1342#pragma pack(push, 4)
1343#endif
1344 typedef struct {
1345 mach_msg_header_t Head;
1346 /* start of the kernel processed data */
1347 mach_msg_body_t msgh_body;
1348 mach_msg_ool_descriptor_t members;
1349 /* end of the kernel processed data */
1350 NDR_record_t NDR;
1351 mach_msg_type_number_t membersCnt;
1352 } __Reply__mach_port_get_set_status_t __attribute__((unused));
1353#ifdef __MigPackStructs
1354#pragma pack(pop)
1355#endif
1356
1357#ifdef __MigPackStructs
1358#pragma pack(push, 4)
1359#endif
1360 typedef struct {
1361 mach_msg_header_t Head;
1362 NDR_record_t NDR;
1363 kern_return_t RetCode;
1364 } __Reply__mach_port_move_member_t __attribute__((unused));
1365#ifdef __MigPackStructs
1366#pragma pack(pop)
1367#endif
1368
1369#ifdef __MigPackStructs
1370#pragma pack(push, 4)
1371#endif
1372 typedef struct {
1373 mach_msg_header_t Head;
1374 /* start of the kernel processed data */
1375 mach_msg_body_t msgh_body;
1376 mach_msg_port_descriptor_t previous;
1377 /* end of the kernel processed data */
1378 } __Reply__mach_port_request_notification_t __attribute__((unused));
1379#ifdef __MigPackStructs
1380#pragma pack(pop)
1381#endif
1382
1383#ifdef __MigPackStructs
1384#pragma pack(push, 4)
1385#endif
1386 typedef struct {
1387 mach_msg_header_t Head;
1388 NDR_record_t NDR;
1389 kern_return_t RetCode;
1390 } __Reply__mach_port_insert_right_t __attribute__((unused));
1391#ifdef __MigPackStructs
1392#pragma pack(pop)
1393#endif
1394
1395#ifdef __MigPackStructs
1396#pragma pack(push, 4)
1397#endif
1398 typedef struct {
1399 mach_msg_header_t Head;
1400 /* start of the kernel processed data */
1401 mach_msg_body_t msgh_body;
1402 mach_msg_port_descriptor_t poly;
1403 /* end of the kernel processed data */
1404 } __Reply__mach_port_extract_right_t __attribute__((unused));
1405#ifdef __MigPackStructs
1406#pragma pack(pop)
1407#endif
1408
1409#ifdef __MigPackStructs
1410#pragma pack(push, 4)
1411#endif
1412 typedef struct {
1413 mach_msg_header_t Head;
1414 NDR_record_t NDR;
1415 kern_return_t RetCode;
1416 } __Reply__mach_port_set_seqno_t __attribute__((unused));
1417#ifdef __MigPackStructs
1418#pragma pack(pop)
1419#endif
1420
1421#ifdef __MigPackStructs
1422#pragma pack(push, 4)
1423#endif
1424 typedef struct {
1425 mach_msg_header_t Head;
1426 NDR_record_t NDR;
1427 kern_return_t RetCode;
1428 mach_msg_type_number_t port_info_outCnt;
1429 integer_t port_info_out[17];
1430 } __Reply__mach_port_get_attributes_t __attribute__((unused));
1431#ifdef __MigPackStructs
1432#pragma pack(pop)
1433#endif
1434
1435#ifdef __MigPackStructs
1436#pragma pack(push, 4)
1437#endif
1438 typedef struct {
1439 mach_msg_header_t Head;
1440 NDR_record_t NDR;
1441 kern_return_t RetCode;
1442 } __Reply__mach_port_set_attributes_t __attribute__((unused));
1443#ifdef __MigPackStructs
1444#pragma pack(pop)
1445#endif
1446
1447#ifdef __MigPackStructs
1448#pragma pack(push, 4)
1449#endif
1450 typedef struct {
1451 mach_msg_header_t Head;
1452 NDR_record_t NDR;
1453 kern_return_t RetCode;
1454 mach_port_qos_t qos;
1455 mach_port_name_t name;
1456 } __Reply__mach_port_allocate_qos_t __attribute__((unused));
1457#ifdef __MigPackStructs
1458#pragma pack(pop)
1459#endif
1460
1461#ifdef __MigPackStructs
1462#pragma pack(push, 4)
1463#endif
1464 typedef struct {
1465 mach_msg_header_t Head;
1466 NDR_record_t NDR;
1467 kern_return_t RetCode;
1468 mach_port_qos_t qos;
1469 mach_port_name_t name;
1470 } __Reply__mach_port_allocate_full_t __attribute__((unused));
1471#ifdef __MigPackStructs
1472#pragma pack(pop)
1473#endif
1474
1475#ifdef __MigPackStructs
1476#pragma pack(push, 4)
1477#endif
1478 typedef struct {
1479 mach_msg_header_t Head;
1480 NDR_record_t NDR;
1481 kern_return_t RetCode;
1482 } __Reply__task_set_port_space_t __attribute__((unused));
1483#ifdef __MigPackStructs
1484#pragma pack(pop)
1485#endif
1486
1487#ifdef __MigPackStructs
1488#pragma pack(push, 4)
1489#endif
1490 typedef struct {
1491 mach_msg_header_t Head;
1492 NDR_record_t NDR;
1493 kern_return_t RetCode;
1494 mach_port_rights_t srights;
1495 } __Reply__mach_port_get_srights_t __attribute__((unused));
1496#ifdef __MigPackStructs
1497#pragma pack(pop)
1498#endif
1499
1500#ifdef __MigPackStructs
1501#pragma pack(push, 4)
1502#endif
1503 typedef struct {
1504 mach_msg_header_t Head;
1505 /* start of the kernel processed data */
1506 mach_msg_body_t msgh_body;
1507 mach_msg_ool_descriptor_t table_info;
1508 mach_msg_ool_descriptor_t tree_info;
1509 /* end of the kernel processed data */
1510 NDR_record_t NDR;
1511 ipc_info_space_t space_info;
1512 mach_msg_type_number_t table_infoCnt;
1513 mach_msg_type_number_t tree_infoCnt;
1514 } __Reply__mach_port_space_info_t __attribute__((unused));
1515#ifdef __MigPackStructs
1516#pragma pack(pop)
1517#endif
1518
1519#ifdef __MigPackStructs
1520#pragma pack(push, 4)
1521#endif
1522 typedef struct {
1523 mach_msg_header_t Head;
1524 NDR_record_t NDR;
1525 kern_return_t RetCode;
1526 unsigned dnr_total;
1527 unsigned dnr_used;
1528 } __Reply__mach_port_dnrequest_info_t __attribute__((unused));
1529#ifdef __MigPackStructs
1530#pragma pack(pop)
1531#endif
1532
1533#ifdef __MigPackStructs
1534#pragma pack(push, 4)
1535#endif
1536 typedef struct {
1537 mach_msg_header_t Head;
1538 NDR_record_t NDR;
1539 kern_return_t RetCode;
1540 unsigned object_type;
1541 unsigned object_addr;
1542 } __Reply__mach_port_kernel_object_t __attribute__((unused));
1543#ifdef __MigPackStructs
1544#pragma pack(pop)
1545#endif
1546
1547#ifdef __MigPackStructs
1548#pragma pack(push, 4)
1549#endif
1550 typedef struct {
1551 mach_msg_header_t Head;
1552 NDR_record_t NDR;
1553 kern_return_t RetCode;
1554 } __Reply__mach_port_insert_member_t __attribute__((unused));
1555#ifdef __MigPackStructs
1556#pragma pack(pop)
1557#endif
1558
1559#ifdef __MigPackStructs
1560#pragma pack(push, 4)
1561#endif
1562 typedef struct {
1563 mach_msg_header_t Head;
1564 NDR_record_t NDR;
1565 kern_return_t RetCode;
1566 } __Reply__mach_port_extract_member_t __attribute__((unused));
1567#ifdef __MigPackStructs
1568#pragma pack(pop)
1569#endif
1570
1571#ifdef __MigPackStructs
1572#pragma pack(push, 4)
1573#endif
1574 typedef struct {
1575 mach_msg_header_t Head;
1576 NDR_record_t NDR;
1577 kern_return_t RetCode;
1578 mach_port_context_t context;
1579 } __Reply__mach_port_get_context_t __attribute__((unused));
1580#ifdef __MigPackStructs
1581#pragma pack(pop)
1582#endif
1583
1584#ifdef __MigPackStructs
1585#pragma pack(push, 4)
1586#endif
1587 typedef struct {
1588 mach_msg_header_t Head;
1589 NDR_record_t NDR;
1590 kern_return_t RetCode;
1591 } __Reply__mach_port_set_context_t __attribute__((unused));
1592#ifdef __MigPackStructs
1593#pragma pack(pop)
1594#endif
1595
1596#ifdef __MigPackStructs
1597#pragma pack(push, 4)
1598#endif
1599 typedef struct {
1600 mach_msg_header_t Head;
1601 NDR_record_t NDR;
1602 kern_return_t RetCode;
1603 natural_t object_type;
1604 mach_vm_address_t object_addr;
1605 } __Reply__mach_port_kobject_t __attribute__((unused));
1606#ifdef __MigPackStructs
1607#pragma pack(pop)
1608#endif
1609
1610#ifdef __MigPackStructs
1611#pragma pack(push, 4)
1612#endif
1613 typedef struct {
1614 mach_msg_header_t Head;
1615 NDR_record_t NDR;
1616 kern_return_t RetCode;
1617 mach_port_name_t name;
1618 } __Reply__mach_port_construct_t __attribute__((unused));
1619#ifdef __MigPackStructs
1620#pragma pack(pop)
1621#endif
1622
1623#ifdef __MigPackStructs
1624#pragma pack(push, 4)
1625#endif
1626 typedef struct {
1627 mach_msg_header_t Head;
1628 NDR_record_t NDR;
1629 kern_return_t RetCode;
1630 } __Reply__mach_port_destruct_t __attribute__((unused));
1631#ifdef __MigPackStructs
1632#pragma pack(pop)
1633#endif
1634
1635#ifdef __MigPackStructs
1636#pragma pack(push, 4)
1637#endif
1638 typedef struct {
1639 mach_msg_header_t Head;
1640 NDR_record_t NDR;
1641 kern_return_t RetCode;
1642 } __Reply__mach_port_guard_t __attribute__((unused));
1643#ifdef __MigPackStructs
1644#pragma pack(pop)
1645#endif
1646
1647#ifdef __MigPackStructs
1648#pragma pack(push, 4)
1649#endif
1650 typedef struct {
1651 mach_msg_header_t Head;
1652 NDR_record_t NDR;
1653 kern_return_t RetCode;
1654 } __Reply__mach_port_unguard_t __attribute__((unused));
1655#ifdef __MigPackStructs
1656#pragma pack(pop)
1657#endif
1658
1659#ifdef __MigPackStructs
1660#pragma pack(push, 4)
1661#endif
1662 typedef struct {
1663 mach_msg_header_t Head;
1664 NDR_record_t NDR;
1665 kern_return_t RetCode;
1666 ipc_info_space_basic_t basic_info;
1667 } __Reply__mach_port_space_basic_info_t __attribute__((unused));
1668#ifdef __MigPackStructs
1669#pragma pack(pop)
1670#endif
1671
1672#ifdef __MigPackStructs
1673#pragma pack(push, 4)
1674#endif
1675 typedef struct {
1676 mach_msg_header_t Head;
1677 NDR_record_t NDR;
1678 kern_return_t RetCode;
1679 } __Reply__mach_port_guard_with_flags_t __attribute__((unused));
1680#ifdef __MigPackStructs
1681#pragma pack(pop)
1682#endif
1683
1684#ifdef __MigPackStructs
1685#pragma pack(push, 4)
1686#endif
1687 typedef struct {
1688 mach_msg_header_t Head;
1689 NDR_record_t NDR;
1690 kern_return_t RetCode;
1691 } __Reply__mach_port_swap_guard_t __attribute__((unused));
1692#ifdef __MigPackStructs
1693#pragma pack(pop)
1694#endif
1695
1696#ifdef __MigPackStructs
1697#pragma pack(push, 4)
1698#endif
1699 typedef struct {
1700 mach_msg_header_t Head;
1701 NDR_record_t NDR;
1702 kern_return_t RetCode;
1703 natural_t object_type;
1704 mach_vm_address_t object_addr;
1705 mach_msg_type_number_t descriptionOffset; /* MiG doesn't use it */
1706 mach_msg_type_number_t descriptionCnt;
1707 char description[512];
1708 } __Reply__mach_port_kobject_description_t __attribute__((unused));
1709#ifdef __MigPackStructs
1710#pragma pack(pop)
1711#endif
1712#endif /* !__Reply__mach_port_subsystem__defined */
1713
1714/* union of all replies */
1715
1716#ifndef __ReplyUnion__mach_port_subsystem__defined
1717#define __ReplyUnion__mach_port_subsystem__defined
1718union __ReplyUnion__mach_port_subsystem {
1719 __Reply__mach_port_names_t Reply_mach_port_names;
1720 __Reply__mach_port_type_t Reply_mach_port_type;
1721 __Reply__mach_port_rename_t Reply_mach_port_rename;
1722 __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name;
1723 __Reply__mach_port_allocate_t Reply_mach_port_allocate;
1724 __Reply__mach_port_destroy_t Reply_mach_port_destroy;
1725 __Reply__mach_port_deallocate_t Reply_mach_port_deallocate;
1726 __Reply__mach_port_get_refs_t Reply_mach_port_get_refs;
1727 __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs;
1728 __Reply__mach_port_peek_t Reply_mach_port_peek;
1729 __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount;
1730 __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status;
1731 __Reply__mach_port_move_member_t Reply_mach_port_move_member;
1732 __Reply__mach_port_request_notification_t Reply_mach_port_request_notification;
1733 __Reply__mach_port_insert_right_t Reply_mach_port_insert_right;
1734 __Reply__mach_port_extract_right_t Reply_mach_port_extract_right;
1735 __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno;
1736 __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes;
1737 __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes;
1738 __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos;
1739 __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full;
1740 __Reply__task_set_port_space_t Reply_task_set_port_space;
1741 __Reply__mach_port_get_srights_t Reply_mach_port_get_srights;
1742 __Reply__mach_port_space_info_t Reply_mach_port_space_info;
1743 __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info;
1744 __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object;
1745 __Reply__mach_port_insert_member_t Reply_mach_port_insert_member;
1746 __Reply__mach_port_extract_member_t Reply_mach_port_extract_member;
1747 __Reply__mach_port_get_context_t Reply_mach_port_get_context;
1748 __Reply__mach_port_set_context_t Reply_mach_port_set_context;
1749 __Reply__mach_port_kobject_t Reply_mach_port_kobject;
1750 __Reply__mach_port_construct_t Reply_mach_port_construct;
1751 __Reply__mach_port_destruct_t Reply_mach_port_destruct;
1752 __Reply__mach_port_guard_t Reply_mach_port_guard;
1753 __Reply__mach_port_unguard_t Reply_mach_port_unguard;
1754 __Reply__mach_port_space_basic_info_t Reply_mach_port_space_basic_info;
1755 __Reply__mach_port_guard_with_flags_t Reply_mach_port_guard_with_flags;
1756 __Reply__mach_port_swap_guard_t Reply_mach_port_swap_guard;
1757 __Reply__mach_port_kobject_description_t Reply_mach_port_kobject_description;
1758};
1759#endif /* !__RequestUnion__mach_port_subsystem__defined */
1760
1761#ifndef subsystem_to_name_map_mach_port
1762#define subsystem_to_name_map_mach_port \
1763 { "mach_port_names", 3200 },\
1764 { "mach_port_type", 3201 },\
1765 { "mach_port_rename", 3202 },\
1766 { "mach_port_allocate_name", 3203 },\
1767 { "mach_port_allocate", 3204 },\
1768 { "mach_port_destroy", 3205 },\
1769 { "mach_port_deallocate", 3206 },\
1770 { "mach_port_get_refs", 3207 },\
1771 { "mach_port_mod_refs", 3208 },\
1772 { "mach_port_peek", 3209 },\
1773 { "mach_port_set_mscount", 3210 },\
1774 { "mach_port_get_set_status", 3211 },\
1775 { "mach_port_move_member", 3212 },\
1776 { "mach_port_request_notification", 3213 },\
1777 { "mach_port_insert_right", 3214 },\
1778 { "mach_port_extract_right", 3215 },\
1779 { "mach_port_set_seqno", 3216 },\
1780 { "mach_port_get_attributes", 3217 },\
1781 { "mach_port_set_attributes", 3218 },\
1782 { "mach_port_allocate_qos", 3219 },\
1783 { "mach_port_allocate_full", 3220 },\
1784 { "task_set_port_space", 3221 },\
1785 { "mach_port_get_srights", 3222 },\
1786 { "mach_port_space_info", 3223 },\
1787 { "mach_port_dnrequest_info", 3224 },\
1788 { "mach_port_kernel_object", 3225 },\
1789 { "mach_port_insert_member", 3226 },\
1790 { "mach_port_extract_member", 3227 },\
1791 { "mach_port_get_context", 3228 },\
1792 { "mach_port_set_context", 3229 },\
1793 { "mach_port_kobject", 3230 },\
1794 { "mach_port_construct", 3231 },\
1795 { "mach_port_destruct", 3232 },\
1796 { "mach_port_guard", 3233 },\
1797 { "mach_port_unguard", 3234 },\
1798 { "mach_port_space_basic_info", 3235 },\
1799 { "mach_port_guard_with_flags", 3237 },\
1800 { "mach_port_swap_guard", 3238 },\
1801 { "mach_port_kobject_description", 3239 }
1802#endif
1803
1804#ifdef __AfterMigUserHeader
1805__AfterMigUserHeader
1806#endif /* __AfterMigUserHeader */
1807
1808#endif /* _mach_port_user_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h created+303
...@@ -0,0 +1,303 @@
1/*
2 * Copyright (c) 2000-2019 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * Definitions of general Mach system traps.
60 *
61 * These are the definitions as seen from user-space.
62 * The kernel definitions are in <mach/syscall_sw.h>.
63 * Kernel RPC functions are defined in <mach/mach_interface.h>.
64 */
65
66#ifndef _MACH_MACH_TRAPS_H_
67#define _MACH_MACH_TRAPS_H_
68
69#include <stdint.h>
70
71#include <mach/std_types.h>
72#include <mach/mach_types.h>
73#include <mach/kern_return.h>
74#include <mach/port.h>
75#include <mach/vm_types.h>
76#include <mach/clock_types.h>
77
78#include <machine/endian.h>
79
80#include <sys/cdefs.h>
81
82__BEGIN_DECLS
83
84
85
86extern kern_return_t clock_sleep_trap(
87 mach_port_name_t clock_name,
88 sleep_type_t sleep_type,
89 int sleep_sec,
90 int sleep_nsec,
91 mach_timespec_t *wakeup_time);
92
93extern kern_return_t _kernelrpc_mach_vm_allocate_trap(
94 mach_port_name_t target,
95 mach_vm_offset_t *addr,
96 mach_vm_size_t size,
97 int flags);
98
99extern kern_return_t _kernelrpc_mach_vm_deallocate_trap(
100 mach_port_name_t target,
101 mach_vm_address_t address,
102 mach_vm_size_t size
103 );
104
105extern kern_return_t _kernelrpc_mach_vm_protect_trap(
106 mach_port_name_t target,
107 mach_vm_address_t address,
108 mach_vm_size_t size,
109 boolean_t set_maximum,
110 vm_prot_t new_protection
111 );
112
113extern kern_return_t _kernelrpc_mach_vm_map_trap(
114 mach_port_name_t target,
115 mach_vm_offset_t *address,
116 mach_vm_size_t size,
117 mach_vm_offset_t mask,
118 int flags,
119 vm_prot_t cur_protection
120 );
121
122extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap(
123 mach_port_name_t target,
124 mach_vm_offset_t address,
125 vm_purgable_t control,
126 int *state);
127
128extern kern_return_t _kernelrpc_mach_port_allocate_trap(
129 mach_port_name_t target,
130 mach_port_right_t right,
131 mach_port_name_t *name
132 );
133
134
135extern kern_return_t _kernelrpc_mach_port_destroy_trap(
136 mach_port_name_t target,
137 mach_port_name_t name
138 );
139
140extern kern_return_t _kernelrpc_mach_port_deallocate_trap(
141 mach_port_name_t target,
142 mach_port_name_t name
143 );
144
145extern kern_return_t _kernelrpc_mach_port_mod_refs_trap(
146 mach_port_name_t target,
147 mach_port_name_t name,
148 mach_port_right_t right,
149 mach_port_delta_t delta
150 );
151
152extern kern_return_t _kernelrpc_mach_port_move_member_trap(
153 mach_port_name_t target,
154 mach_port_name_t member,
155 mach_port_name_t after
156 );
157
158extern kern_return_t _kernelrpc_mach_port_insert_right_trap(
159 mach_port_name_t target,
160 mach_port_name_t name,
161 mach_port_name_t poly,
162 mach_msg_type_name_t polyPoly
163 );
164
165extern kern_return_t _kernelrpc_mach_port_get_attributes_trap(
166 mach_port_name_t target,
167 mach_port_name_t name,
168 mach_port_flavor_t flavor,
169 mach_port_info_t port_info_out,
170 mach_msg_type_number_t *port_info_outCnt
171 );
172
173extern kern_return_t _kernelrpc_mach_port_insert_member_trap(
174 mach_port_name_t target,
175 mach_port_name_t name,
176 mach_port_name_t pset
177 );
178
179extern kern_return_t _kernelrpc_mach_port_extract_member_trap(
180 mach_port_name_t target,
181 mach_port_name_t name,
182 mach_port_name_t pset
183 );
184
185extern kern_return_t _kernelrpc_mach_port_construct_trap(
186 mach_port_name_t target,
187 mach_port_options_t *options,
188 uint64_t context,
189 mach_port_name_t *name
190 );
191
192extern kern_return_t _kernelrpc_mach_port_destruct_trap(
193 mach_port_name_t target,
194 mach_port_name_t name,
195 mach_port_delta_t srdelta,
196 uint64_t guard
197 );
198
199extern kern_return_t _kernelrpc_mach_port_guard_trap(
200 mach_port_name_t target,
201 mach_port_name_t name,
202 uint64_t guard,
203 boolean_t strict
204 );
205
206extern kern_return_t _kernelrpc_mach_port_unguard_trap(
207 mach_port_name_t target,
208 mach_port_name_t name,
209 uint64_t guard
210 );
211
212extern kern_return_t mach_generate_activity_id(
213 mach_port_name_t target,
214 int count,
215 uint64_t *activity_id
216 );
217
218extern kern_return_t macx_swapon(
219 uint64_t filename,
220 int flags,
221 int size,
222 int priority);
223
224extern kern_return_t macx_swapoff(
225 uint64_t filename,
226 int flags);
227
228extern kern_return_t macx_triggers(
229 int hi_water,
230 int low_water,
231 int flags,
232 mach_port_t alert_port);
233
234extern kern_return_t macx_backing_store_suspend(
235 boolean_t suspend);
236
237extern kern_return_t macx_backing_store_recovery(
238 int pid);
239
240extern boolean_t swtch_pri(int pri);
241
242extern boolean_t swtch(void);
243
244extern kern_return_t thread_switch(
245 mach_port_name_t thread_name,
246 int option,
247 mach_msg_timeout_t option_time);
248
249extern mach_port_name_t task_self_trap(void);
250
251extern kern_return_t host_create_mach_voucher_trap(
252 mach_port_name_t host,
253 mach_voucher_attr_raw_recipe_array_t recipes,
254 int recipes_size,
255 mach_port_name_t *voucher);
256
257extern kern_return_t mach_voucher_extract_attr_recipe_trap(
258 mach_port_name_t voucher_name,
259 mach_voucher_attr_key_t key,
260 mach_voucher_attr_raw_recipe_t recipe,
261 mach_msg_type_number_t *recipe_size);
262
263extern kern_return_t _kernelrpc_mach_port_type_trap(
264 ipc_space_t task,
265 mach_port_name_t name,
266 mach_port_type_t *ptype);
267
268extern kern_return_t _kernelrpc_mach_port_request_notification_trap(
269 ipc_space_t task,
270 mach_port_name_t name,
271 mach_msg_id_t msgid,
272 mach_port_mscount_t sync,
273 mach_port_name_t notify,
274 mach_msg_type_name_t notifyPoly,
275 mach_port_name_t *previous);
276
277/*
278 * Obsolete interfaces.
279 */
280
281extern kern_return_t task_for_pid(
282 mach_port_name_t target_tport,
283 int pid,
284 mach_port_name_t *t);
285
286extern kern_return_t task_name_for_pid(
287 mach_port_name_t target_tport,
288 int pid,
289 mach_port_name_t *tn);
290
291extern kern_return_t pid_for_task(
292 mach_port_name_t t,
293 int *x);
294
295extern kern_return_t debug_control_port_for_pid(
296 mach_port_name_t target_tport,
297 int pid,
298 mach_port_name_t *t);
299
300
301__END_DECLS
302
303#endif /* _MACH_MACH_TRAPS_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_types.h created+254
...@@ -0,0 +1,254 @@
1/*
2 * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
60 * support for mandatory and extensible security protections. This notice
61 * is included in support of clause 2.2 (b) of the Apple Public License,
62 * Version 2.0.
63 */
64/*
65 * File: mach/mach_types.h
66 * Author: Avadis Tevanian, Jr., Michael Wayne Young
67 * Date: 1986
68 *
69 * Mach external interface definitions.
70 *
71 */
72
73#ifndef _MACH_MACH_TYPES_H_
74#define _MACH_MACH_TYPES_H_
75
76#include <stdint.h>
77
78#include <sys/cdefs.h>
79
80#include <mach/host_info.h>
81#include <mach/host_notify.h>
82#include <mach/host_special_ports.h>
83#include <mach/machine.h>
84#include <mach/machine/vm_types.h>
85#include <mach/memory_object_types.h>
86#include <mach/message.h>
87#include <mach/exception_types.h>
88#include <mach/port.h>
89#include <mach/mach_voucher_types.h>
90#include <mach/processor_info.h>
91#include <mach/task_info.h>
92#include <mach/task_inspect.h>
93#include <mach/task_policy.h>
94#include <mach/task_special_ports.h>
95#include <mach/thread_info.h>
96#include <mach/thread_policy.h>
97#include <mach/thread_special_ports.h>
98#include <mach/thread_status.h>
99#include <mach/time_value.h>
100#include <mach/clock_types.h>
101#include <mach/vm_attributes.h>
102#include <mach/vm_inherit.h>
103#include <mach/vm_purgable.h>
104#include <mach/vm_behavior.h>
105#include <mach/vm_prot.h>
106#include <mach/vm_statistics.h>
107#include <mach/vm_sync.h>
108#include <mach/vm_types.h>
109#include <mach/vm_region.h>
110#include <mach/kmod.h>
111#include <mach/dyld_kernel.h>
112
113
114/*
115 * If we are not in the kernel, then these will all be represented by
116 * ports at user-space.
117 */
118typedef mach_port_t task_t;
119typedef mach_port_t task_name_t;
120typedef mach_port_t task_inspect_t;
121typedef mach_port_t task_suspension_token_t;
122typedef mach_port_t thread_t;
123typedef mach_port_t thread_act_t;
124typedef mach_port_t thread_inspect_t;
125typedef mach_port_t ipc_space_t;
126typedef mach_port_t ipc_space_inspect_t;
127typedef mach_port_t coalition_t;
128typedef mach_port_t host_t;
129typedef mach_port_t host_priv_t;
130typedef mach_port_t host_security_t;
131typedef mach_port_t processor_t;
132typedef mach_port_t processor_set_t;
133typedef mach_port_t processor_set_control_t;
134typedef mach_port_t semaphore_t;
135typedef mach_port_t lock_set_t;
136typedef mach_port_t ledger_t;
137typedef mach_port_t alarm_t;
138typedef mach_port_t clock_serv_t;
139typedef mach_port_t clock_ctrl_t;
140typedef mach_port_t arcade_register_t;
141typedef mach_port_t suid_cred_t;
142
143
144/*
145 * These aren't really unique types. They are just called
146 * out as unique types at one point in history. So we list
147 * them here for compatibility.
148 */
149typedef processor_set_t processor_set_name_t;
150
151/*
152 * These types are just hard-coded as ports
153 */
154typedef mach_port_t clock_reply_t;
155typedef mach_port_t bootstrap_t;
156typedef mach_port_t mem_entry_name_port_t;
157typedef mach_port_t exception_handler_t;
158typedef exception_handler_t *exception_handler_array_t;
159typedef mach_port_t vm_task_entry_t;
160typedef mach_port_t io_master_t;
161typedef mach_port_t UNDServerRef;
162
163/*
164 * Mig doesn't translate the components of an array.
165 * For example, Mig won't use the thread_t translations
166 * to translate a thread_array_t argument. So, these definitions
167 * are not completely accurate at the moment for other kernel
168 * components.
169 */
170typedef task_t *task_array_t;
171typedef thread_t *thread_array_t;
172typedef processor_set_t *processor_set_array_t;
173typedef processor_set_t *processor_set_name_array_t;
174typedef processor_t *processor_array_t;
175typedef thread_act_t *thread_act_array_t;
176typedef ledger_t *ledger_array_t;
177
178/*
179 * However the real mach_types got declared, we also have to declare
180 * types with "port" in the name for compatability with the way OSF
181 * had declared the user interfaces at one point. Someday these should
182 * go away.
183 */
184typedef task_t task_port_t;
185typedef task_array_t task_port_array_t;
186typedef thread_t thread_port_t;
187typedef thread_array_t thread_port_array_t;
188typedef ipc_space_t ipc_space_port_t;
189typedef host_t host_name_t;
190typedef host_t host_name_port_t;
191typedef processor_set_t processor_set_port_t;
192typedef processor_set_t processor_set_name_port_t;
193typedef processor_set_array_t processor_set_name_port_array_t;
194typedef processor_set_t processor_set_control_port_t;
195typedef processor_t processor_port_t;
196typedef processor_array_t processor_port_array_t;
197typedef thread_act_t thread_act_port_t;
198typedef thread_act_array_t thread_act_port_array_t;
199typedef semaphore_t semaphore_port_t;
200typedef lock_set_t lock_set_port_t;
201typedef ledger_t ledger_port_t;
202typedef ledger_array_t ledger_port_array_t;
203typedef alarm_t alarm_port_t;
204typedef clock_serv_t clock_serv_port_t;
205typedef clock_ctrl_t clock_ctrl_port_t;
206typedef exception_handler_t exception_port_t;
207typedef exception_handler_array_t exception_port_arrary_t;
208typedef char vfs_path_t[4096];
209typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */
210typedef char suid_cred_path_t[1024];
211typedef uint32_t suid_cred_uid_t;
212
213#define TASK_NULL ((task_t) 0)
214#define TASK_NAME_NULL ((task_name_t) 0)
215#define TASK_INSPECT_NULL ((task_inspect_t) 0)
216#define THREAD_NULL ((thread_t) 0)
217#define THREAD_INSPECT_NULL ((thread_inspect_t) 0)
218#define TID_NULL ((uint64_t) 0)
219#define THR_ACT_NULL ((thread_act_t) 0)
220#define IPC_SPACE_NULL ((ipc_space_t) 0)
221#define IPC_SPACE_INSPECT_NULL ((ipc_space_inspect_t) 0)
222#define COALITION_NULL ((coalition_t) 0)
223#define HOST_NULL ((host_t) 0)
224#define HOST_PRIV_NULL ((host_priv_t) 0)
225#define HOST_SECURITY_NULL ((host_security_t) 0)
226#define PROCESSOR_SET_NULL ((processor_set_t) 0)
227#define PROCESSOR_NULL ((processor_t) 0)
228#define SEMAPHORE_NULL ((semaphore_t) 0)
229#define LOCK_SET_NULL ((lock_set_t) 0)
230#define LEDGER_NULL ((ledger_t) 0)
231#define ALARM_NULL ((alarm_t) 0)
232#define CLOCK_NULL ((clock_t) 0)
233#define UND_SERVER_NULL ((UNDServerRef) 0)
234#define ARCADE_REG_NULL ((arcade_register_t) 0)
235#define SUID_CRED_NULL ((suid_cred_t) 0)
236
237/* DEPRECATED */
238typedef natural_t ledger_item_t;
239#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
240
241typedef int64_t ledger_amount_t;
242#define LEDGER_LIMIT_INFINITY ((ledger_amount_t)((1ULL << 63) - 1))
243
244typedef mach_vm_offset_t *emulation_vector_t;
245typedef char *user_subsystem_t;
246
247typedef char *labelstr_t;
248/*
249 * Backwards compatibility, for those programs written
250 * before mach/{std,mach}_types.{defs,h} were set up.
251 */
252#include <mach/std_types.h>
253
254#endif /* _MACH_MACH_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mach_voucher_types.h created+245
...@@ -0,0 +1,245 @@
1/*
2 * Copyright (c) 2013 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_VOUCHER_TYPES_H_
30#define _MACH_VOUCHER_TYPES_H_
31
32#include <mach/std_types.h>
33#include <mach/port.h>
34
35/*
36 * Mach Voucher - an immutable collection of attribute value handles.
37 *
38 * The mach voucher is such that it can be passed between processes
39 * as a Mach port send right (by convention in the mach_msg_header_t’s
40 * msgh_voucher field).
41 *
42 * You may construct a new mach voucher by passing a construction
43 * recipe to host_create_mach_voucher(). The construction recipe supports
44 * generic commands for copying, removing, and redeeming attribute value
45 * handles from previous vouchers, or running attribute-mananger-specific
46 * commands within the recipe.
47 *
48 * Once the set of attribute value handles is constructed and returned,
49 * that set will not change for the life of the voucher (just because the
50 * attribute value handle itself doesn't change, the value the handle refers
51 * to is free to change at will).
52 */
53typedef mach_port_t mach_voucher_t;
54#define MACH_VOUCHER_NULL ((mach_voucher_t) 0)
55
56typedef mach_port_name_t mach_voucher_name_t;
57#define MACH_VOUCHER_NAME_NULL ((mach_voucher_name_t) 0)
58
59typedef mach_voucher_name_t *mach_voucher_name_array_t;
60#define MACH_VOUCHER_NAME_ARRAY_NULL ((mach_voucher_name_array_t) 0)
61
62/*
63 * This type changes appearance between user-space and kernel. It is
64 * a port at user-space and a reference to an ipc_voucher structure in-kernel.
65 */
66typedef mach_voucher_t ipc_voucher_t;
67#define IPC_VOUCHER_NULL ((ipc_voucher_t) 0)
68
69/*
70 * mach_voucher_selector_t - A means of specifying which thread/task value to extract -
71 * the current voucher set at this level, or a voucher representing
72 * the full [layered] effective value for the task/thread.
73 */
74typedef uint32_t mach_voucher_selector_t;
75#define MACH_VOUCHER_SELECTOR_CURRENT ((mach_voucher_selector_t)0)
76#define MACH_VOUCHER_SELECTOR_EFFECTIVE ((mach_voucher_selector_t)1)
77
78
79/*
80 * mach_voucher_attr_key_t - The key used to identify a particular managed resource or
81 * to select the specific resource manager’s data associated
82 * with a given voucher.
83 */
84typedef uint32_t mach_voucher_attr_key_t;
85typedef mach_voucher_attr_key_t *mach_voucher_attr_key_array_t;
86
87#define MACH_VOUCHER_ATTR_KEY_ALL ((mach_voucher_attr_key_t)~0)
88#define MACH_VOUCHER_ATTR_KEY_NONE ((mach_voucher_attr_key_t)0)
89
90/* other well-known-keys will be added here */
91#define MACH_VOUCHER_ATTR_KEY_ATM ((mach_voucher_attr_key_t)1)
92#define MACH_VOUCHER_ATTR_KEY_IMPORTANCE ((mach_voucher_attr_key_t)2)
93#define MACH_VOUCHER_ATTR_KEY_BANK ((mach_voucher_attr_key_t)3)
94#define MACH_VOUCHER_ATTR_KEY_PTHPRIORITY ((mach_voucher_attr_key_t)4)
95
96#define MACH_VOUCHER_ATTR_KEY_USER_DATA ((mach_voucher_attr_key_t)7)
97#define MACH_VOUCHER_ATTR_KEY_BITS MACH_VOUCHER_ATTR_KEY_USER_DATA /* deprecated */
98#define MACH_VOUCHER_ATTR_KEY_TEST ((mach_voucher_attr_key_t)8)
99
100#define MACH_VOUCHER_ATTR_KEY_NUM_WELL_KNOWN MACH_VOUCHER_ATTR_KEY_TEST
101
102/*
103 * mach_voucher_attr_content_t
104 *
105 * Data passed to a resource manager for modifying an attribute
106 * value or returned from the resource manager in response to a
107 * request to externalize the current value for that attribute.
108 */
109typedef uint8_t *mach_voucher_attr_content_t;
110typedef uint32_t mach_voucher_attr_content_size_t;
111
112/*
113 * mach_voucher_attr_command_t - The private verbs implemented by each voucher
114 * attribute manager via mach_voucher_attr_command().
115 */
116typedef uint32_t mach_voucher_attr_command_t;
117
118/*
119 * mach_voucher_attr_recipe_command_t
120 *
121 * The verbs used to create/morph a voucher attribute value.
122 * We define some system-wide commands here - related to creation, and transport of
123 * vouchers and attributes. Additional commands can be defined by, and supported by,
124 * individual attribute resource managers.
125 */
126typedef uint32_t mach_voucher_attr_recipe_command_t;
127typedef mach_voucher_attr_recipe_command_t *mach_voucher_attr_recipe_command_array_t;
128
129#define MACH_VOUCHER_ATTR_NOOP ((mach_voucher_attr_recipe_command_t)0)
130#define MACH_VOUCHER_ATTR_COPY ((mach_voucher_attr_recipe_command_t)1)
131#define MACH_VOUCHER_ATTR_REMOVE ((mach_voucher_attr_recipe_command_t)2)
132#define MACH_VOUCHER_ATTR_SET_VALUE_HANDLE ((mach_voucher_attr_recipe_command_t)3)
133#define MACH_VOUCHER_ATTR_AUTO_REDEEM ((mach_voucher_attr_recipe_command_t)4)
134#define MACH_VOUCHER_ATTR_SEND_PREPROCESS ((mach_voucher_attr_recipe_command_t)5)
135
136/* redeem is on its way out? */
137#define MACH_VOUCHER_ATTR_REDEEM ((mach_voucher_attr_recipe_command_t)10)
138
139/* recipe command(s) for importance attribute manager */
140#define MACH_VOUCHER_ATTR_IMPORTANCE_SELF ((mach_voucher_attr_recipe_command_t)200)
141
142/* recipe command(s) for bit-store attribute manager */
143#define MACH_VOUCHER_ATTR_USER_DATA_STORE ((mach_voucher_attr_recipe_command_t)211)
144#define MACH_VOUCHER_ATTR_BITS_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE /* deprecated */
145
146/* recipe command(s) for test attribute manager */
147#define MACH_VOUCHER_ATTR_TEST_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE
148
149/*
150 * mach_voucher_attr_recipe_t
151 *
152 * An element in a recipe list to create a voucher.
153 */
154#pragma pack(push, 1)
155
156typedef struct mach_voucher_attr_recipe_data {
157 mach_voucher_attr_key_t key;
158 mach_voucher_attr_recipe_command_t command;
159 mach_voucher_name_t previous_voucher;
160 mach_voucher_attr_content_size_t content_size;
161 uint8_t content[];
162} mach_voucher_attr_recipe_data_t;
163typedef mach_voucher_attr_recipe_data_t *mach_voucher_attr_recipe_t;
164typedef mach_msg_type_number_t mach_voucher_attr_recipe_size_t;
165
166/* Make the above palatable to MIG */
167typedef uint8_t *mach_voucher_attr_raw_recipe_t;
168typedef mach_voucher_attr_raw_recipe_t mach_voucher_attr_raw_recipe_array_t;
169typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_size_t;
170typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_array_size_t;
171
172#define MACH_VOUCHER_ATTR_MAX_RAW_RECIPE_ARRAY_SIZE 5120
173#define MACH_VOUCHER_TRAP_STACK_LIMIT 256
174
175#pragma pack(pop)
176
177/*
178 * VOUCHER ATTRIBUTE MANAGER Writer types
179 */
180
181/*
182 * mach_voucher_attr_manager_t
183 *
184 * A handle through which the mach voucher mechanism communicates with the voucher
185 * attribute manager for a given attribute key.
186 */
187typedef mach_port_t mach_voucher_attr_manager_t;
188#define MACH_VOUCHER_ATTR_MANAGER_NULL ((mach_voucher_attr_manager_t) 0)
189
190/*
191 * mach_voucher_attr_control_t
192 *
193 * A handle provided to the voucher attribute manager for a given attribute key
194 * through which it makes inquiries or control operations of the mach voucher mechanism.
195 */
196typedef mach_port_t mach_voucher_attr_control_t;
197#define MACH_VOUCHER_ATTR_CONTROL_NULL ((mach_voucher_attr_control_t) 0)
198
199/*
200 * These types are different in-kernel vs user-space. They are ports in user-space,
201 * pointers to opaque structs in most of the kernel, and pointers to known struct
202 * types in the Mach portion of the kernel.
203 */
204typedef mach_port_t ipc_voucher_attr_manager_t;
205typedef mach_port_t ipc_voucher_attr_control_t;
206#define IPC_VOUCHER_ATTR_MANAGER_NULL ((ipc_voucher_attr_manager_t) 0)
207#define IPC_VOUCHER_ATTR_CONTROL_NULL ((ipc_voucher_attr_control_t) 0)
208
209/*
210 * mach_voucher_attr_value_handle_t
211 *
212 * The private handle that the voucher attribute manager provides to
213 * the mach voucher mechanism to represent a given attr content/value.
214 */
215typedef uint64_t mach_voucher_attr_value_handle_t;
216typedef mach_voucher_attr_value_handle_t *mach_voucher_attr_value_handle_array_t;
217
218typedef mach_msg_type_number_t mach_voucher_attr_value_handle_array_size_t;
219#define MACH_VOUCHER_ATTR_VALUE_MAX_NESTED ((mach_voucher_attr_value_handle_array_size_t)4)
220
221typedef uint32_t mach_voucher_attr_value_reference_t;
222typedef uint32_t mach_voucher_attr_value_flags_t;
223#define MACH_VOUCHER_ATTR_VALUE_FLAGS_NONE ((mach_voucher_attr_value_flags_t)0)
224#define MACH_VOUCHER_ATTR_VALUE_FLAGS_PERSIST ((mach_voucher_attr_value_flags_t)1)
225
226/* USE - TBD */
227typedef uint32_t mach_voucher_attr_control_flags_t;
228#define MACH_VOUCHER_ATTR_CONTROL_FLAGS_NONE ((mach_voucher_attr_control_flags_t)0)
229
230/*
231 * Commands and types for the IPC Importance Attribute Manager
232 *
233 * These are the valid mach_voucher_attr_command() options with the
234 * MACH_VOUCHER_ATTR_KEY_IMPORTANCE key.
235 */
236#define MACH_VOUCHER_IMPORTANCE_ATTR_ADD_EXTERNAL 1 /* Add some number of external refs (not supported) */
237#define MACH_VOUCHER_IMPORTANCE_ATTR_DROP_EXTERNAL 2 /* Drop some number of external refs */
238typedef uint32_t mach_voucher_attr_importance_refs;
239
240/*
241 * Activity id Generation defines
242 */
243#define MACH_ACTIVITY_ID_COUNT_MAX 16
244
245#endif /* _MACH_VOUCHER_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h created+38
...@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_MACHINE_PROCESSOR_INFO_H_
30#define _MACH_MACHINE_PROCESSOR_INFO_H_
31
32#if defined (__i386__) || defined(__x86_64__)
33#include "mach/i386/processor_info.h"
34#else
35#error architecture not supported
36#endif
37
38#endif /* _MACH_MACHINE_PROCESSOR_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h created+38
...@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_MACHINE_RPC_H_
30#define _MACH_MACHINE_RPC_H_
31
32#if defined (__i386__) || defined(__x86_64__)
33#include "mach/i386/rpc.h"
34#else
35#error architecture not supported
36#endif
37
38#endif /* _MACH_MACHINE_RPC_H_ */
lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h created+38
...@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_MACHINE_VM_PARAM_H_
30#define _MACH_MACHINE_VM_PARAM_H_
31
32#if defined (__i386__) || defined(__x86_64__)
33#include "mach/i386/vm_param.h"
34#else
35#error architecture not supported
36#endif
37
38#endif /* _MACH_MACHINE_VM_PARAM_H_ */
lib/libc/include/x86_64-macos-gnu/mach/memory_object_types.h created+299
...@@ -0,0 +1,299 @@
1/*
2 * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: memory_object.h
60 * Author: Michael Wayne Young
61 *
62 * External memory management interface definition.
63 */
64
65#ifndef _MACH_MEMORY_OBJECT_TYPES_H_
66#define _MACH_MEMORY_OBJECT_TYPES_H_
67
68/*
69 * User-visible types used in the external memory
70 * management interface:
71 */
72
73#include <mach/port.h>
74#include <mach/message.h>
75#include <mach/vm_prot.h>
76#include <mach/vm_sync.h>
77#include <mach/vm_types.h>
78#include <mach/machine/vm_types.h>
79
80#include <sys/cdefs.h>
81
82#define VM_64_BIT_DATA_OBJECTS
83
84typedef unsigned long long memory_object_offset_t;
85typedef unsigned long long memory_object_size_t;
86typedef natural_t memory_object_cluster_size_t;
87typedef natural_t * memory_object_fault_info_t;
88
89typedef unsigned long long vm_object_id_t;
90
91
92/*
93 * Temporary until real EMMI version gets re-implemented
94 */
95
96
97typedef mach_port_t memory_object_t;
98typedef mach_port_t memory_object_control_t;
99
100
101typedef memory_object_t *memory_object_array_t;
102/* A memory object ... */
103/* Used by the kernel to retrieve */
104/* or store data */
105
106typedef mach_port_t memory_object_name_t;
107/* Used to describe the memory ... */
108/* object in vm_regions() calls */
109
110typedef mach_port_t memory_object_default_t;
111/* Registered with the host ... */
112/* for creating new internal objects */
113
114#define MEMORY_OBJECT_NULL ((memory_object_t) 0)
115#define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0)
116#define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0)
117#define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0)
118
119
120typedef int memory_object_copy_strategy_t;
121/* How memory manager handles copy: */
122#define MEMORY_OBJECT_COPY_NONE 0
123/* ... No special support */
124#define MEMORY_OBJECT_COPY_CALL 1
125/* ... Make call on memory manager */
126#define MEMORY_OBJECT_COPY_DELAY 2
127/* ... Memory manager doesn't
128 * change data externally.
129 */
130#define MEMORY_OBJECT_COPY_TEMPORARY 3
131/* ... Memory manager doesn't
132 * change data externally, and
133 * doesn't need to see changes.
134 */
135#define MEMORY_OBJECT_COPY_SYMMETRIC 4
136/* ... Memory manager doesn't
137 * change data externally,
138 * doesn't need to see changes,
139 * and object will not be
140 * multiply mapped.
141 *
142 * XXX
143 * Not yet safe for non-kernel use.
144 */
145
146#define MEMORY_OBJECT_COPY_INVALID 5
147/* ... An invalid copy strategy,
148 * for external objects which
149 * have not been initialized.
150 * Allows copy_strategy to be
151 * examined without also
152 * examining pager_ready and
153 * internal.
154 */
155
156typedef int memory_object_return_t;
157/* Which pages to return to manager
158 * this time (lock_request) */
159#define MEMORY_OBJECT_RETURN_NONE 0
160/* ... don't return any. */
161#define MEMORY_OBJECT_RETURN_DIRTY 1
162/* ... only dirty pages. */
163#define MEMORY_OBJECT_RETURN_ALL 2
164/* ... dirty and precious pages. */
165#define MEMORY_OBJECT_RETURN_ANYTHING 3
166/* ... any resident page. */
167
168/*
169 * Data lock request flags
170 */
171
172#define MEMORY_OBJECT_DATA_FLUSH 0x1
173#define MEMORY_OBJECT_DATA_NO_CHANGE 0x2
174#define MEMORY_OBJECT_DATA_PURGE 0x4
175#define MEMORY_OBJECT_COPY_SYNC 0x8
176#define MEMORY_OBJECT_DATA_SYNC 0x10
177#define MEMORY_OBJECT_IO_SYNC 0x20
178#define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40
179
180/*
181 * Types for the memory object flavor interfaces
182 */
183
184#define MEMORY_OBJECT_INFO_MAX (1024)
185typedef int *memory_object_info_t;
186typedef int memory_object_flavor_t;
187typedef int memory_object_info_data_t[MEMORY_OBJECT_INFO_MAX];
188
189
190#define MEMORY_OBJECT_PERFORMANCE_INFO 11
191#define MEMORY_OBJECT_ATTRIBUTE_INFO 14
192#define MEMORY_OBJECT_BEHAVIOR_INFO 15
193
194
195struct memory_object_perf_info {
196 memory_object_cluster_size_t cluster_size;
197 boolean_t may_cache;
198};
199
200struct memory_object_attr_info {
201 memory_object_copy_strategy_t copy_strategy;
202 memory_object_cluster_size_t cluster_size;
203 boolean_t may_cache_object;
204 boolean_t temporary;
205};
206
207struct memory_object_behave_info {
208 memory_object_copy_strategy_t copy_strategy;
209 boolean_t temporary;
210 boolean_t invalidate;
211 boolean_t silent_overwrite;
212 boolean_t advisory_pageout;
213};
214
215
216typedef struct memory_object_behave_info *memory_object_behave_info_t;
217typedef struct memory_object_behave_info memory_object_behave_info_data_t;
218
219typedef struct memory_object_perf_info *memory_object_perf_info_t;
220typedef struct memory_object_perf_info memory_object_perf_info_data_t;
221
222typedef struct memory_object_attr_info *memory_object_attr_info_t;
223typedef struct memory_object_attr_info memory_object_attr_info_data_t;
224
225#define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) \
226 (sizeof(memory_object_behave_info_data_t)/sizeof(int)))
227#define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) \
228 (sizeof(memory_object_perf_info_data_t)/sizeof(int)))
229#define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) \
230 (sizeof(memory_object_attr_info_data_t)/sizeof(int)))
231
232#define invalid_memory_object_flavor(f) \
233 (f != MEMORY_OBJECT_ATTRIBUTE_INFO && \
234 f != MEMORY_OBJECT_PERFORMANCE_INFO && \
235 f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && \
236 f != MEMORY_OBJECT_BEHAVIOR_INFO && \
237 f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO)
238
239
240/*
241 * Used to support options on memory_object_release_name call
242 */
243#define MEMORY_OBJECT_TERMINATE_IDLE 0x1
244#define MEMORY_OBJECT_RESPECT_CACHE 0x2
245#define MEMORY_OBJECT_RELEASE_NO_OP 0x4
246
247
248/* named entry processor mapping options */
249/* enumerated */
250#define MAP_MEM_NOOP 0
251#define MAP_MEM_COPYBACK 1
252#define MAP_MEM_IO 2
253#define MAP_MEM_WTHRU 3
254#define MAP_MEM_WCOMB 4 /* Write combining mode */
255 /* aka store gather */
256#define MAP_MEM_INNERWBACK 5
257#define MAP_MEM_POSTED 6
258#define MAP_MEM_RT 7
259#define MAP_MEM_POSTED_REORDERED 8
260#define MAP_MEM_POSTED_COMBINED_REORDERED 9
261
262#define GET_MAP_MEM(flags) \
263 ((((unsigned int)(flags)) >> 24) & 0xFF)
264
265#define SET_MAP_MEM(caching, flags) \
266 ((flags) = ((((unsigned int)(caching)) << 24) \
267 & 0xFF000000) | ((flags) & 0xFFFFFF));
268
269/* leave room for vm_prot bits (0xFF ?) */
270#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */
271#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */
272#define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */
273#define MAP_MEM_ONLY 0x010000 /* change processor caching */
274#define MAP_MEM_NAMED_CREATE 0x020000 /* create extant object */
275#define MAP_MEM_PURGABLE 0x040000 /* create a purgable VM object */
276#define MAP_MEM_NAMED_REUSE 0x080000 /* reuse provided entry if identical */
277#define MAP_MEM_USE_DATA_ADDR 0x100000 /* preserve address of data, rather than base of page */
278#define MAP_MEM_VM_COPY 0x200000 /* make a copy of a VM range */
279#define MAP_MEM_VM_SHARE 0x400000 /* extract a VM range for remap */
280#define MAP_MEM_4K_DATA_ADDR 0x800000 /* preserve 4K aligned address of data */
281
282#define MAP_MEM_FLAGS_MASK 0x00FFFF00
283#define MAP_MEM_FLAGS_USER ( \
284 MAP_MEM_PURGABLE_KERNEL_ONLY | \
285 MAP_MEM_GRAB_SECLUDED | \
286 MAP_MEM_ONLY | \
287 MAP_MEM_NAMED_CREATE | \
288 MAP_MEM_PURGABLE | \
289 MAP_MEM_NAMED_REUSE | \
290 MAP_MEM_USE_DATA_ADDR | \
291 MAP_MEM_VM_COPY | \
292 MAP_MEM_VM_SHARE | \
293 MAP_MEM_LEDGER_TAGGED | \
294 MAP_MEM_4K_DATA_ADDR)
295#define MAP_MEM_FLAGS_ALL ( \
296 MAP_MEM_FLAGS_USER)
297
298
299#endif /* _MACH_MEMORY_OBJECT_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mig.h created+180
...@@ -0,0 +1,180 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32/*
33 * Mach MIG Subsystem Interfaces
34 */
35
36#ifndef _MACH_MIG_H_
37#define _MACH_MIG_H_
38
39#include <stdint.h>
40#include <mach/port.h>
41#include <mach/message.h>
42#include <mach/vm_types.h>
43
44#include <sys/cdefs.h>
45
46#if defined(MACH_KERNEL)
47
48#if !defined(__MigTypeCheck)
49/* Turn MIG type checking on by default for kernel */
50#define __MigTypeCheck 1
51#endif
52
53#define __MigKernelSpecificCode 1
54#define _MIG_KERNEL_SPECIFIC_CODE_ 1
55
56#elif !defined(__MigTypeCheck)
57
58#if defined(TypeCheck)
59/* use legacy setting (temporary) */
60#define __MigTypeCheck TypeCheck
61#else
62/* default MIG type checking on */
63#define __MigTypeCheck 1
64#endif
65
66#endif /* !defined(MACH_KERNEL) && !defined(__MigTypeCheck) */
67
68/*
69 * Pack MIG message structs.
70 * This is an indicator of the need to view shared structs in a
71 * binary-compatible format - and MIG message structs are no different.
72 */
73#define __MigPackStructs 1
74
75/*
76 * Definition for MIG-generated server stub routines. These routines
77 * unpack the request message, call the server procedure, and pack the
78 * reply message.
79 */
80typedef void (*mig_stub_routine_t) (mach_msg_header_t *InHeadP,
81 mach_msg_header_t *OutHeadP);
82
83typedef mig_stub_routine_t mig_routine_t;
84
85/*
86 * Definition for MIG-generated server routine. This routine takes a
87 * message, and returns the appropriate stub function for handling that
88 * message.
89 */
90typedef mig_routine_t (*mig_server_routine_t) (mach_msg_header_t *InHeadP);
91
92/*
93 * Generic definition for implementation routines. These routines do
94 * the real work associated with this request. This generic type is
95 * used for keeping the pointers in the subsystem array.
96 */
97typedef kern_return_t (*mig_impl_routine_t)(void);
98
99typedef mach_msg_type_descriptor_t routine_arg_descriptor;
100typedef mach_msg_type_descriptor_t *routine_arg_descriptor_t;
101typedef mach_msg_type_descriptor_t *mig_routine_arg_descriptor_t;
102
103#define MIG_ROUTINE_ARG_DESCRIPTOR_NULL ((mig_routine_arg_descriptor_t)0)
104
105struct routine_descriptor {
106 mig_impl_routine_t impl_routine; /* Server work func pointer */
107 mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */
108 unsigned int argc; /* Number of argument words */
109 unsigned int descr_count; /* Number complex descriptors */
110 routine_arg_descriptor_t
111 arg_descr; /* pointer to descriptor array*/
112 unsigned int max_reply_msg; /* Max size for reply msg */
113};
114typedef struct routine_descriptor *routine_descriptor_t;
115
116typedef struct routine_descriptor mig_routine_descriptor;
117typedef mig_routine_descriptor *mig_routine_descriptor_t;
118
119#define MIG_ROUTINE_DESCRIPTOR_NULL ((mig_routine_descriptor_t)0)
120
121typedef struct mig_subsystem {
122 mig_server_routine_t server; /* pointer to demux routine */
123 mach_msg_id_t start; /* Min routine number */
124 mach_msg_id_t end; /* Max routine number + 1 */
125 mach_msg_size_t maxsize; /* Max reply message size */
126 vm_address_t reserved; /* reserved for MIG use */
127 mig_routine_descriptor
128 routine[1]; /* Routine descriptor array */
129} *mig_subsystem_t;
130
131#define MIG_SUBSYSTEM_NULL ((mig_subsystem_t)0)
132
133typedef struct mig_symtab {
134 char *ms_routine_name;
135 int ms_routine_number;
136 void (*ms_routine)(void); /* Since the functions in the
137 * symbol table have unknown
138 * signatures, this is the best
139 * we can do...
140 */
141} mig_symtab_t;
142
143/*
144 * A compiler attribute for annotating all MIG server routines and other
145 * functions that should behave similarly. Allows the compiler to perform
146 * additional static bug-finding over them.
147 */
148#if __has_attribute(mig_server_routine)
149#define MIG_SERVER_ROUTINE __attribute__((mig_server_routine))
150#else
151#define MIG_SERVER_ROUTINE
152#endif
153
154
155__BEGIN_DECLS
156
157/* Client side reply port allocate */
158extern mach_port_t mig_get_reply_port(void);
159
160/* Client side reply port deallocate */
161extern void mig_dealloc_reply_port(mach_port_t reply_port);
162
163/* Client side reply port "deallocation" */
164extern void mig_put_reply_port(mach_port_t reply_port);
165
166/* Bounded string copy */
167extern int mig_strncpy(char *dest, const char *src, int len);
168extern int mig_strncpy_zerofill(char *dest, const char *src, int len);
169
170
171/* Allocate memory for out-of-line mig structures */
172extern void mig_allocate(vm_address_t *, vm_size_t);
173
174/* Deallocate memory used for out-of-line mig structures */
175extern void mig_deallocate(vm_address_t, vm_size_t);
176
177
178__END_DECLS
179
180#endif /* _MACH_MIG_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mig_errors.h created+125
...@@ -0,0 +1,125 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * Mach Interface Generator errors
60 *
61 */
62
63#ifndef _MACH_MIG_ERRORS_H_
64#define _MACH_MIG_ERRORS_H_
65
66#include <mach/mig.h>
67#include <mach/ndr.h>
68#include <mach/message.h>
69#include <mach/kern_return.h>
70
71#include <sys/cdefs.h>
72
73/*
74 * These error codes should be specified as system 4, subsytem 2.
75 * But alas backwards compatibility makes that impossible.
76 * The problem is old clients of new servers (eg, the kernel)
77 * which get strange large error codes when there is a Mig problem
78 * in the server. Unfortunately, the IPC system doesn't have
79 * the knowledge to convert the codes in this situation.
80 */
81
82#define MIG_TYPE_ERROR -300 /* client type check failure */
83#define MIG_REPLY_MISMATCH -301 /* wrong reply message ID */
84#define MIG_REMOTE_ERROR -302 /* server detected error */
85#define MIG_BAD_ID -303 /* bad request message ID */
86#define MIG_BAD_ARGUMENTS -304 /* server type check failure */
87#define MIG_NO_REPLY -305 /* no reply should be send */
88#define MIG_EXCEPTION -306 /* server raised exception */
89#define MIG_ARRAY_TOO_LARGE -307 /* array not large enough */
90#define MIG_SERVER_DIED -308 /* server died */
91#define MIG_TRAILER_ERROR -309 /* trailer has an unknown format */
92
93/*
94 * Whenever MIG detects an error, it sends back a generic
95 * mig_reply_error_t format message. Clients must accept
96 * these in addition to the expected reply message format.
97 */
98#pragma pack(4)
99typedef struct {
100 mach_msg_header_t Head;
101 NDR_record_t NDR;
102 kern_return_t RetCode;
103} mig_reply_error_t;
104#pragma pack()
105
106
107__BEGIN_DECLS
108
109#if !defined(__NDR_convert__mig_reply_error_t__defined)
110#define __NDR_convert__mig_reply_error_t__defined
111
112static __inline__ void
113__NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x)
114{
115#if defined(__NDR_convert__int_rep__kern_return_t__defined)
116 if (x->NDR.int_rep != NDR_record.int_rep) {
117 __NDR_convert__int_rep__kern_return_t(&x->RetCode, x->NDR.int_rep);
118 }
119#endif /* __NDR_convert__int_rep__kern_return_t__defined */
120}
121#endif /* !defined(__NDR_convert__mig_reply_error_t__defined) */
122
123__END_DECLS
124
125#endif /* _MACH_MIG_ERRORS_H_ */
lib/libc/include/x86_64-macos-gnu/mach/mig_strncpy_zerofill_support.h created+35
...@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28//This dummy header file is created for mig to check when to call mig_strncpy_zerofill.
29//Mig checks if this file is available to include and knows that Libsyscall has the new mig_strncpy_zerofill symbols to link to.
30//Do not delete this file, mig will stop calling mig_strncpy_zerofill.
31
32#ifndef __MACH_MIG_STRNCPY_ZEROFILL_SUPPORT__
33#define __MACH_MIG_STRNCPY_ZEROFILL_SUPPORT__
34
35#endif // __MACH_MIG_STRNCPY_ZEROFILL_SUPPORT__
lib/libc/include/x86_64-macos-gnu/mach/ndr.h created+207
...@@ -0,0 +1,207 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32#ifndef _MACH_NDR_H_
33#define _MACH_NDR_H_
34
35#include <stdint.h>
36#include <sys/cdefs.h>
37#include <libkern/OSByteOrder.h>
38
39
40typedef struct {
41 unsigned char mig_vers;
42 unsigned char if_vers;
43 unsigned char reserved1;
44 unsigned char mig_encoding;
45 unsigned char int_rep;
46 unsigned char char_rep;
47 unsigned char float_rep;
48 unsigned char reserved2;
49} NDR_record_t;
50
51/*
52 * MIG supported protocols for Network Data Representation
53 */
54#define NDR_PROTOCOL_2_0 0
55
56/*
57 * NDR 2.0 format flag type definition and values.
58 */
59#define NDR_INT_BIG_ENDIAN 0
60#define NDR_INT_LITTLE_ENDIAN 1
61#define NDR_FLOAT_IEEE 0
62#define NDR_FLOAT_VAX 1
63#define NDR_FLOAT_CRAY 2
64#define NDR_FLOAT_IBM 3
65#define NDR_CHAR_ASCII 0
66#define NDR_CHAR_EBCDIC 1
67
68extern NDR_record_t NDR_record;
69
70/* NDR conversion off by default */
71
72#if !defined(__NDR_convert__)
73#define __NDR_convert__ 0
74#endif /* !defined(__NDR_convert__) */
75
76#ifndef __NDR_convert__int_rep__
77#define __NDR_convert__int_rep__ __NDR_convert__
78#endif /* __NDR_convert__int_rep__ */
79
80#ifndef __NDR_convert__char_rep__
81#define __NDR_convert__char_rep__ 0
82#endif /* __NDR_convert__char_rep__ */
83
84#ifndef __NDR_convert__float_rep__
85#define __NDR_convert__float_rep__ 0
86#endif /* __NDR_convert__float_rep__ */
87
88#if __NDR_convert__
89
90#define __NDR_convert__NOOP do ; while (0)
91#define __NDR_convert__UNKNOWN(s) __NDR_convert__NOOP
92#define __NDR_convert__SINGLE(a, f, r) do { r((a), (f)); } while (0)
93#define __NDR_convert__ARRAY(a, f, c, r) \
94 do { int __i__, __C__ = (c); \
95 for (__i__ = 0; __i__ < __C__; __i__++) \
96 r(&(a)[__i__], f); } while (0)
97#define __NDR_convert__2DARRAY(a, f, s, c, r) \
98 do { int __i__, __C__ = (c), __S__ = (s); \
99 for (__i__ = 0; __i__ < __C__; __i__++) \
100 r(&(a)[__i__ * __S__], f, __S__); } while (0)
101
102#if __NDR_convert__int_rep__
103
104#define __NDR_READSWAP_assign(a, rs) do { *(a) = rs(a); } while (0)
105
106#define __NDR_READSWAP__uint16_t(a) OSReadSwapInt16((void *)a, 0)
107#define __NDR_READSWAP__int16_t(a) (int16_t)OSReadSwapInt16((void *)a, 0)
108#define __NDR_READSWAP__uint32_t(a) OSReadSwapInt32((void *)a, 0)
109#define __NDR_READSWAP__int32_t(a) (int32_t)OSReadSwapInt32((void *)a, 0)
110#define __NDR_READSWAP__uint64_t(a) OSReadSwapInt64((void *)a, 0)
111#define __NDR_READSWAP__int64_t(a) (int64_t)OSReadSwapInt64((void *)a, 0)
112
113__BEGIN_DECLS
114
115static __inline__ float
116__NDR_READSWAP__float(float *argp)
117{
118 union {
119 float sv;
120 uint32_t ull;
121 } result;
122 result.ull = __NDR_READSWAP__uint32_t((uint32_t *)argp);
123 return result.sv;
124}
125
126static __inline__ double
127__NDR_READSWAP__double(double *argp)
128{
129 union {
130 double sv;
131 uint64_t ull;
132 } result;
133 result.ull = __NDR_READSWAP__uint64_t((uint64_t *)argp);
134 return result.sv;
135}
136
137__END_DECLS
138
139#define __NDR_convert__int_rep__int16_t__defined
140#define __NDR_convert__int_rep__int16_t(v, f) \
141 __NDR_READSWAP_assign(v, __NDR_READSWAP__int16_t)
142
143#define __NDR_convert__int_rep__uint16_t__defined
144#define __NDR_convert__int_rep__uint16_t(v, f) \
145 __NDR_READSWAP_assign(v, __NDR_READSWAP__uint16_t)
146
147#define __NDR_convert__int_rep__int32_t__defined
148#define __NDR_convert__int_rep__int32_t(v, f) \
149 __NDR_READSWAP_assign(v, __NDR_READSWAP__int32_t)
150
151#define __NDR_convert__int_rep__uint32_t__defined
152#define __NDR_convert__int_rep__uint32_t(v, f) \
153 __NDR_READSWAP_assign(v, __NDR_READSWAP__uint32_t)
154
155#define __NDR_convert__int_rep__int64_t__defined
156#define __NDR_convert__int_rep__int64_t(v, f) \
157 __NDR_READSWAP_assign(v, __NDR_READSWAP__int64_t)
158
159#define __NDR_convert__int_rep__uint64_t__defined
160#define __NDR_convert__int_rep__uint64_t(v, f) \
161 __NDR_READSWAP_assign(v, __NDR_READSWAP__uint64_t)
162
163#define __NDR_convert__int_rep__float__defined
164#define __NDR_convert__int_rep__float(v, f) \
165 __NDR_READSWAP_assign(v, __NDR_READSWAP__float)
166
167#define __NDR_convert__int_rep__double__defined
168#define __NDR_convert__int_rep__double(v, f) \
169 __NDR_READSWAP_assign(v, __NDR_READSWAP__double)
170
171#define __NDR_convert__int_rep__boolean_t__defined
172#define __NDR_convert__int_rep__boolean_t(v, f) \
173 __NDR_convert__int_rep__int32_t(v,f)
174
175#define __NDR_convert__int_rep__kern_return_t__defined
176#define __NDR_convert__int_rep__kern_return_t(v, f) \
177 __NDR_convert__int_rep__int32_t(v,f)
178
179#define __NDR_convert__int_rep__mach_port_name_t__defined
180#define __NDR_convert__int_rep__mach_port_name_t(v, f) \
181 __NDR_convert__int_rep__uint32_t(v,f)
182
183#define __NDR_convert__int_rep__mach_msg_type_number_t__defined
184#define __NDR_convert__int_rep__mach_msg_type_number_t(v, f) \
185 __NDR_convert__int_rep__uint32_t(v,f)
186
187#endif /* __NDR_convert__int_rep__ */
188
189#if __NDR_convert__char_rep__
190
191#warning NDR character representation conversions not implemented yet!
192#define __NDR_convert__char_rep__char(v, f) __NDR_convert__NOOP
193#define __NDR_convert__char_rep__string(v, f, l) __NDR_convert__NOOP
194
195#endif /* __NDR_convert__char_rep__ */
196
197#if __NDR_convert__float_rep__
198
199#warning NDR floating point representation conversions not implemented yet!
200#define __NDR_convert__float_rep__float(v, f) __NDR_convert__NOOP
201#define __NDR_convert__float_rep__double(v, f) __NDR_convert__NOOP
202
203#endif /* __NDR_convert__float_rep__ */
204
205#endif /* __NDR_convert__ */
206
207#endif /* _MACH_NDR_H_ */
lib/libc/include/x86_64-macos-gnu/mach/notify.h created+141
...@@ -0,0 +1,141 @@
1/*
2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/notify.h
60 *
61 * Kernel notification message definitions.
62 */
63
64#ifndef _MACH_NOTIFY_H_
65#define _MACH_NOTIFY_H_
66
67#include <mach/port.h>
68#include <mach/message.h>
69#include <mach/ndr.h>
70
71/*
72 * An alternative specification of the notification interface
73 * may be found in mach/notify.defs.
74 */
75
76#define MACH_NOTIFY_FIRST 0100
77#define MACH_NOTIFY_PORT_DELETED (MACH_NOTIFY_FIRST + 001)
78/* A send or send-once right was deleted. */
79#define MACH_NOTIFY_SEND_POSSIBLE (MACH_NOTIFY_FIRST + 002)
80/* Now possible to send using specified right */
81#define MACH_NOTIFY_PORT_DESTROYED (MACH_NOTIFY_FIRST + 005)
82/* A receive right was (would have been) deallocated */
83#define MACH_NOTIFY_NO_SENDERS (MACH_NOTIFY_FIRST + 006)
84/* Receive right has no extant send rights */
85#define MACH_NOTIFY_SEND_ONCE (MACH_NOTIFY_FIRST + 007)
86/* An extant send-once right died */
87#define MACH_NOTIFY_DEAD_NAME (MACH_NOTIFY_FIRST + 010)
88/* Send or send-once right died, leaving a dead-name */
89#define MACH_NOTIFY_LAST (MACH_NOTIFY_FIRST + 015)
90
91typedef mach_port_t notify_port_t;
92
93/*
94 * Hard-coded message structures for receiving Mach port notification
95 * messages. However, they are not actual large enough to receive
96 * the largest trailers current exported by Mach IPC (so they cannot
97 * be used for space allocations in situations using these new larger
98 * trailers). Instead, the MIG-generated server routines (and
99 * related prototypes should be used).
100 */
101typedef struct {
102 mach_msg_header_t not_header;
103 NDR_record_t NDR;
104 mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
105 mach_msg_format_0_trailer_t trailer;
106} mach_port_deleted_notification_t;
107
108typedef struct {
109 mach_msg_header_t not_header;
110 NDR_record_t NDR;
111 mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
112 mach_msg_format_0_trailer_t trailer;
113} mach_send_possible_notification_t;
114
115typedef struct {
116 mach_msg_header_t not_header;
117 mach_msg_body_t not_body;
118 mach_msg_port_descriptor_t not_port;/* MACH_MSG_TYPE_PORT_RECEIVE */
119 mach_msg_format_0_trailer_t trailer;
120} mach_port_destroyed_notification_t;
121
122typedef struct {
123 mach_msg_header_t not_header;
124 NDR_record_t NDR;
125 mach_msg_type_number_t not_count;
126 mach_msg_format_0_trailer_t trailer;
127} mach_no_senders_notification_t;
128
129typedef struct {
130 mach_msg_header_t not_header;
131 mach_msg_format_0_trailer_t trailer;
132} mach_send_once_notification_t;
133
134typedef struct {
135 mach_msg_header_t not_header;
136 NDR_record_t NDR;
137 mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
138 mach_msg_format_0_trailer_t trailer;
139} mach_dead_name_notification_t;
140
141#endif /* _MACH_NOTIFY_H_ */
lib/libc/include/x86_64-macos-gnu/mach/policy.h created+235
...@@ -0,0 +1,235 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_POLICY_H_
60#define _MACH_POLICY_H_
61
62/*
63 * mach/policy.h
64 *
65 * Definitions for scheduing policy.
66 */
67
68/*
69 * All interfaces defined here are obsolete.
70 */
71
72#include <mach/boolean.h>
73#include <mach/message.h>
74#include <mach/vm_types.h>
75
76/*
77 * Old scheduling control interface
78 */
79typedef int policy_t;
80typedef integer_t *policy_info_t;
81typedef integer_t *policy_base_t;
82typedef integer_t *policy_limit_t;
83
84/*
85 * Policy definitions. Policies should be powers of 2,
86 * but cannot be or'd together other than to test for a
87 * policy 'class'.
88 */
89#define POLICY_NULL 0 /* none */
90#define POLICY_TIMESHARE 1 /* timesharing */
91#define POLICY_RR 2 /* fixed round robin */
92#define POLICY_FIFO 4 /* fixed fifo */
93
94#define __NEW_SCHEDULING_FRAMEWORK__
95
96/*
97 * Check if policy is of 'class' fixed-priority.
98 */
99#define POLICYCLASS_FIXEDPRI (POLICY_RR | POLICY_FIFO)
100
101/*
102 * Check if policy is valid.
103 */
104#define invalid_policy(policy) \
105 ((policy) != POLICY_TIMESHARE && \
106 (policy) != POLICY_RR && \
107 (policy) != POLICY_FIFO)
108
109
110/*
111 * Types for TIMESHARE policy
112 */
113struct policy_timeshare_base {
114 integer_t base_priority;
115};
116struct policy_timeshare_limit {
117 integer_t max_priority;
118};
119struct policy_timeshare_info {
120 integer_t max_priority;
121 integer_t base_priority;
122 integer_t cur_priority;
123 boolean_t depressed;
124 integer_t depress_priority;
125};
126
127typedef struct policy_timeshare_base *policy_timeshare_base_t;
128typedef struct policy_timeshare_limit *policy_timeshare_limit_t;
129typedef struct policy_timeshare_info *policy_timeshare_info_t;
130
131typedef struct policy_timeshare_base policy_timeshare_base_data_t;
132typedef struct policy_timeshare_limit policy_timeshare_limit_data_t;
133typedef struct policy_timeshare_info policy_timeshare_info_data_t;
134
135
136#define POLICY_TIMESHARE_BASE_COUNT ((mach_msg_type_number_t) \
137 (sizeof(struct policy_timeshare_base)/sizeof(integer_t)))
138#define POLICY_TIMESHARE_LIMIT_COUNT ((mach_msg_type_number_t) \
139 (sizeof(struct policy_timeshare_limit)/sizeof(integer_t)))
140#define POLICY_TIMESHARE_INFO_COUNT ((mach_msg_type_number_t) \
141 (sizeof(struct policy_timeshare_info)/sizeof(integer_t)))
142
143
144/*
145 * Types for the ROUND ROBIN (RR) policy
146 */
147struct policy_rr_base {
148 integer_t base_priority;
149 integer_t quantum;
150};
151struct policy_rr_limit {
152 integer_t max_priority;
153};
154struct policy_rr_info {
155 integer_t max_priority;
156 integer_t base_priority;
157 integer_t quantum;
158 boolean_t depressed;
159 integer_t depress_priority;
160};
161
162typedef struct policy_rr_base *policy_rr_base_t;
163typedef struct policy_rr_limit *policy_rr_limit_t;
164typedef struct policy_rr_info *policy_rr_info_t;
165
166typedef struct policy_rr_base policy_rr_base_data_t;
167typedef struct policy_rr_limit policy_rr_limit_data_t;
168typedef struct policy_rr_info policy_rr_info_data_t;
169
170#define POLICY_RR_BASE_COUNT ((mach_msg_type_number_t) \
171 (sizeof(struct policy_rr_base)/sizeof(integer_t)))
172#define POLICY_RR_LIMIT_COUNT ((mach_msg_type_number_t) \
173 (sizeof(struct policy_rr_limit)/sizeof(integer_t)))
174#define POLICY_RR_INFO_COUNT ((mach_msg_type_number_t) \
175 (sizeof(struct policy_rr_info)/sizeof(integer_t)))
176
177
178/*
179 * Types for the FIRST-IN-FIRST-OUT (FIFO) policy
180 */
181struct policy_fifo_base {
182 integer_t base_priority;
183};
184struct policy_fifo_limit {
185 integer_t max_priority;
186};
187struct policy_fifo_info {
188 integer_t max_priority;
189 integer_t base_priority;
190 boolean_t depressed;
191 integer_t depress_priority;
192};
193
194typedef struct policy_fifo_base *policy_fifo_base_t;
195typedef struct policy_fifo_limit *policy_fifo_limit_t;
196typedef struct policy_fifo_info *policy_fifo_info_t;
197
198typedef struct policy_fifo_base policy_fifo_base_data_t;
199typedef struct policy_fifo_limit policy_fifo_limit_data_t;
200typedef struct policy_fifo_info policy_fifo_info_data_t;
201
202#define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t) \
203 (sizeof(struct policy_fifo_base)/sizeof(integer_t)))
204#define POLICY_FIFO_LIMIT_COUNT ((mach_msg_type_number_t) \
205 (sizeof(struct policy_fifo_limit)/sizeof(integer_t)))
206#define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t) \
207 (sizeof(struct policy_fifo_info)/sizeof(integer_t)))
208
209/*
210 * Aggregate policy types
211 */
212
213struct policy_bases {
214 policy_timeshare_base_data_t ts;
215 policy_rr_base_data_t rr;
216 policy_fifo_base_data_t fifo;
217};
218
219struct policy_limits {
220 policy_timeshare_limit_data_t ts;
221 policy_rr_limit_data_t rr;
222 policy_fifo_limit_data_t fifo;
223};
224
225struct policy_infos {
226 policy_timeshare_info_data_t ts;
227 policy_rr_info_data_t rr;
228 policy_fifo_info_data_t fifo;
229};
230
231typedef struct policy_bases policy_base_data_t;
232typedef struct policy_limits policy_limit_data_t;
233typedef struct policy_infos policy_info_data_t;
234
235#endif /* _MACH_POLICY_H_ */
lib/libc/include/x86_64-macos-gnu/mach/processor.h created+360
...@@ -0,0 +1,360 @@
1#ifndef _processor_user_
2#define _processor_user_
3
4/* Module processor */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef processor_MSG_COUNT
52#define processor_MSG_COUNT 6
53#endif /* processor_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine processor_start */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t processor_start
75(
76 processor_t processor
77);
78
79/* Routine processor_exit */
80#ifdef mig_external
81mig_external
82#else
83extern
84#endif /* mig_external */
85kern_return_t processor_exit
86(
87 processor_t processor
88);
89
90/* Routine processor_info */
91#ifdef mig_external
92mig_external
93#else
94extern
95#endif /* mig_external */
96kern_return_t processor_info
97(
98 processor_t processor,
99 processor_flavor_t flavor,
100 host_t *host,
101 processor_info_t processor_info_out,
102 mach_msg_type_number_t *processor_info_outCnt
103);
104
105/* Routine processor_control */
106#ifdef mig_external
107mig_external
108#else
109extern
110#endif /* mig_external */
111kern_return_t processor_control
112(
113 processor_t processor,
114 processor_info_t processor_cmd,
115 mach_msg_type_number_t processor_cmdCnt
116);
117
118/* Routine processor_assign */
119#ifdef mig_external
120mig_external
121#else
122extern
123#endif /* mig_external */
124kern_return_t processor_assign
125(
126 processor_t processor,
127 processor_set_t new_set,
128 boolean_t wait
129);
130
131/* Routine processor_get_assignment */
132#ifdef mig_external
133mig_external
134#else
135extern
136#endif /* mig_external */
137kern_return_t processor_get_assignment
138(
139 processor_t processor,
140 processor_set_name_t *assigned_set
141);
142
143__END_DECLS
144
145/********************** Caution **************************/
146/* The following data types should be used to calculate */
147/* maximum message sizes only. The actual message may be */
148/* smaller, and the position of the arguments within the */
149/* message layout may vary from what is presented here. */
150/* For example, if any of the arguments are variable- */
151/* sized, and less than the maximum is sent, the data */
152/* will be packed tight in the actual message to reduce */
153/* the presence of holes. */
154/********************** Caution **************************/
155
156/* typedefs for all requests */
157
158#ifndef __Request__processor_subsystem__defined
159#define __Request__processor_subsystem__defined
160
161#ifdef __MigPackStructs
162#pragma pack(push, 4)
163#endif
164 typedef struct {
165 mach_msg_header_t Head;
166 } __Request__processor_start_t __attribute__((unused));
167#ifdef __MigPackStructs
168#pragma pack(pop)
169#endif
170
171#ifdef __MigPackStructs
172#pragma pack(push, 4)
173#endif
174 typedef struct {
175 mach_msg_header_t Head;
176 } __Request__processor_exit_t __attribute__((unused));
177#ifdef __MigPackStructs
178#pragma pack(pop)
179#endif
180
181#ifdef __MigPackStructs
182#pragma pack(push, 4)
183#endif
184 typedef struct {
185 mach_msg_header_t Head;
186 NDR_record_t NDR;
187 processor_flavor_t flavor;
188 mach_msg_type_number_t processor_info_outCnt;
189 } __Request__processor_info_t __attribute__((unused));
190#ifdef __MigPackStructs
191#pragma pack(pop)
192#endif
193
194#ifdef __MigPackStructs
195#pragma pack(push, 4)
196#endif
197 typedef struct {
198 mach_msg_header_t Head;
199 NDR_record_t NDR;
200 mach_msg_type_number_t processor_cmdCnt;
201 integer_t processor_cmd[20];
202 } __Request__processor_control_t __attribute__((unused));
203#ifdef __MigPackStructs
204#pragma pack(pop)
205#endif
206
207#ifdef __MigPackStructs
208#pragma pack(push, 4)
209#endif
210 typedef struct {
211 mach_msg_header_t Head;
212 /* start of the kernel processed data */
213 mach_msg_body_t msgh_body;
214 mach_msg_port_descriptor_t new_set;
215 /* end of the kernel processed data */
216 NDR_record_t NDR;
217 boolean_t wait;
218 } __Request__processor_assign_t __attribute__((unused));
219#ifdef __MigPackStructs
220#pragma pack(pop)
221#endif
222
223#ifdef __MigPackStructs
224#pragma pack(push, 4)
225#endif
226 typedef struct {
227 mach_msg_header_t Head;
228 } __Request__processor_get_assignment_t __attribute__((unused));
229#ifdef __MigPackStructs
230#pragma pack(pop)
231#endif
232#endif /* !__Request__processor_subsystem__defined */
233
234/* union of all requests */
235
236#ifndef __RequestUnion__processor_subsystem__defined
237#define __RequestUnion__processor_subsystem__defined
238union __RequestUnion__processor_subsystem {
239 __Request__processor_start_t Request_processor_start;
240 __Request__processor_exit_t Request_processor_exit;
241 __Request__processor_info_t Request_processor_info;
242 __Request__processor_control_t Request_processor_control;
243 __Request__processor_assign_t Request_processor_assign;
244 __Request__processor_get_assignment_t Request_processor_get_assignment;
245};
246#endif /* !__RequestUnion__processor_subsystem__defined */
247/* typedefs for all replies */
248
249#ifndef __Reply__processor_subsystem__defined
250#define __Reply__processor_subsystem__defined
251
252#ifdef __MigPackStructs
253#pragma pack(push, 4)
254#endif
255 typedef struct {
256 mach_msg_header_t Head;
257 NDR_record_t NDR;
258 kern_return_t RetCode;
259 } __Reply__processor_start_t __attribute__((unused));
260#ifdef __MigPackStructs
261#pragma pack(pop)
262#endif
263
264#ifdef __MigPackStructs
265#pragma pack(push, 4)
266#endif
267 typedef struct {
268 mach_msg_header_t Head;
269 NDR_record_t NDR;
270 kern_return_t RetCode;
271 } __Reply__processor_exit_t __attribute__((unused));
272#ifdef __MigPackStructs
273#pragma pack(pop)
274#endif
275
276#ifdef __MigPackStructs
277#pragma pack(push, 4)
278#endif
279 typedef struct {
280 mach_msg_header_t Head;
281 /* start of the kernel processed data */
282 mach_msg_body_t msgh_body;
283 mach_msg_port_descriptor_t host;
284 /* end of the kernel processed data */
285 NDR_record_t NDR;
286 mach_msg_type_number_t processor_info_outCnt;
287 integer_t processor_info_out[20];
288 } __Reply__processor_info_t __attribute__((unused));
289#ifdef __MigPackStructs
290#pragma pack(pop)
291#endif
292
293#ifdef __MigPackStructs
294#pragma pack(push, 4)
295#endif
296 typedef struct {
297 mach_msg_header_t Head;
298 NDR_record_t NDR;
299 kern_return_t RetCode;
300 } __Reply__processor_control_t __attribute__((unused));
301#ifdef __MigPackStructs
302#pragma pack(pop)
303#endif
304
305#ifdef __MigPackStructs
306#pragma pack(push, 4)
307#endif
308 typedef struct {
309 mach_msg_header_t Head;
310 NDR_record_t NDR;
311 kern_return_t RetCode;
312 } __Reply__processor_assign_t __attribute__((unused));
313#ifdef __MigPackStructs
314#pragma pack(pop)
315#endif
316
317#ifdef __MigPackStructs
318#pragma pack(push, 4)
319#endif
320 typedef struct {
321 mach_msg_header_t Head;
322 /* start of the kernel processed data */
323 mach_msg_body_t msgh_body;
324 mach_msg_port_descriptor_t assigned_set;
325 /* end of the kernel processed data */
326 } __Reply__processor_get_assignment_t __attribute__((unused));
327#ifdef __MigPackStructs
328#pragma pack(pop)
329#endif
330#endif /* !__Reply__processor_subsystem__defined */
331
332/* union of all replies */
333
334#ifndef __ReplyUnion__processor_subsystem__defined
335#define __ReplyUnion__processor_subsystem__defined
336union __ReplyUnion__processor_subsystem {
337 __Reply__processor_start_t Reply_processor_start;
338 __Reply__processor_exit_t Reply_processor_exit;
339 __Reply__processor_info_t Reply_processor_info;
340 __Reply__processor_control_t Reply_processor_control;
341 __Reply__processor_assign_t Reply_processor_assign;
342 __Reply__processor_get_assignment_t Reply_processor_get_assignment;
343};
344#endif /* !__RequestUnion__processor_subsystem__defined */
345
346#ifndef subsystem_to_name_map_processor
347#define subsystem_to_name_map_processor \
348 { "processor_start", 3000 },\
349 { "processor_exit", 3001 },\
350 { "processor_info", 3002 },\
351 { "processor_control", 3003 },\
352 { "processor_assign", 3004 },\
353 { "processor_get_assignment", 3005 }
354#endif
355
356#ifdef __AfterMigUserHeader
357__AfterMigUserHeader
358#endif /* __AfterMigUserHeader */
359
360#endif /* _processor_user_ */
lib/libc/include/x86_64-macos-gnu/mach/processor_info.h created+153
...@@ -0,0 +1,153 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59/*
60 * File: mach/processor_info.h
61 * Author: David L. Black
62 * Date: 1988
63 *
64 * Data structure definitions for processor_info, processor_set_info
65 */
66
67#ifndef _MACH_PROCESSOR_INFO_H_
68#define _MACH_PROCESSOR_INFO_H_
69
70#include <mach/message.h>
71#include <mach/machine.h>
72#include <mach/machine/processor_info.h>
73
74/*
75 * Generic information structure to allow for expansion.
76 */
77typedef integer_t *processor_info_t; /* varying array of int. */
78typedef integer_t *processor_info_array_t; /* varying array of int */
79
80#define PROCESSOR_INFO_MAX (1024) /* max array size */
81typedef integer_t processor_info_data_t[PROCESSOR_INFO_MAX];
82
83
84typedef integer_t *processor_set_info_t; /* varying array of int. */
85
86#define PROCESSOR_SET_INFO_MAX (1024) /* max array size */
87typedef integer_t processor_set_info_data_t[PROCESSOR_SET_INFO_MAX];
88
89/*
90 * Currently defined information.
91 */
92typedef int processor_flavor_t;
93#define PROCESSOR_BASIC_INFO 1 /* basic information */
94#define PROCESSOR_CPU_LOAD_INFO 2 /* cpu load information */
95#define PROCESSOR_PM_REGS_INFO 0x10000001 /* performance monitor register info */
96#define PROCESSOR_TEMPERATURE 0x10000002 /* Processor core temperature */
97
98struct processor_basic_info {
99 cpu_type_t cpu_type; /* type of cpu */
100 cpu_subtype_t cpu_subtype; /* subtype of cpu */
101 boolean_t running; /* is processor running */
102 int slot_num; /* slot number */
103 boolean_t is_master; /* is this the master processor */
104};
105
106typedef struct processor_basic_info processor_basic_info_data_t;
107typedef struct processor_basic_info *processor_basic_info_t;
108#define PROCESSOR_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
109 (sizeof(processor_basic_info_data_t)/sizeof(natural_t)))
110
111struct processor_cpu_load_info { /* number of ticks while running... */
112 unsigned int cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */
113};
114
115typedef struct processor_cpu_load_info processor_cpu_load_info_data_t;
116typedef struct processor_cpu_load_info *processor_cpu_load_info_t;
117#define PROCESSOR_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
118 (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t)))
119
120/*
121 * Scaling factor for load_average, mach_factor.
122 */
123#define LOAD_SCALE 1000
124
125typedef int processor_set_flavor_t;
126#define PROCESSOR_SET_BASIC_INFO 5 /* basic information */
127
128struct processor_set_basic_info {
129 int processor_count; /* How many processors */
130 int default_policy; /* When others not enabled */
131};
132
133typedef struct processor_set_basic_info processor_set_basic_info_data_t;
134typedef struct processor_set_basic_info *processor_set_basic_info_t;
135#define PROCESSOR_SET_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
136 (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t)))
137
138#define PROCESSOR_SET_LOAD_INFO 4 /* scheduling statistics */
139
140struct processor_set_load_info {
141 int task_count; /* How many tasks */
142 int thread_count; /* How many threads */
143 integer_t load_average; /* Scaled */
144 integer_t mach_factor; /* Scaled */
145};
146
147typedef struct processor_set_load_info processor_set_load_info_data_t;
148typedef struct processor_set_load_info *processor_set_load_info_t;
149#define PROCESSOR_SET_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
150 (sizeof(processor_set_load_info_data_t)/sizeof(natural_t)))
151
152
153#endif /* _MACH_PROCESSOR_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/processor_set.h created+540
...@@ -0,0 +1,540 @@
1#ifndef _processor_set_user_
2#define _processor_set_user_
3
4/* Module processor_set */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef processor_set_MSG_COUNT
52#define processor_set_MSG_COUNT 10
53#endif /* processor_set_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine processor_set_statistics */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t processor_set_statistics
75(
76 processor_set_name_t pset,
77 processor_set_flavor_t flavor,
78 processor_set_info_t info_out,
79 mach_msg_type_number_t *info_outCnt
80);
81
82/* Routine processor_set_destroy */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t processor_set_destroy
89(
90 processor_set_t set
91);
92
93/* Routine processor_set_max_priority */
94#ifdef mig_external
95mig_external
96#else
97extern
98#endif /* mig_external */
99kern_return_t processor_set_max_priority
100(
101 processor_set_t processor_set,
102 int max_priority,
103 boolean_t change_threads
104);
105
106/* Routine processor_set_policy_enable */
107#ifdef mig_external
108mig_external
109#else
110extern
111#endif /* mig_external */
112kern_return_t processor_set_policy_enable
113(
114 processor_set_t processor_set,
115 int policy
116);
117
118/* Routine processor_set_policy_disable */
119#ifdef mig_external
120mig_external
121#else
122extern
123#endif /* mig_external */
124kern_return_t processor_set_policy_disable
125(
126 processor_set_t processor_set,
127 int policy,
128 boolean_t change_threads
129);
130
131/* Routine processor_set_tasks */
132#ifdef mig_external
133mig_external
134#else
135extern
136#endif /* mig_external */
137kern_return_t processor_set_tasks
138(
139 processor_set_t processor_set,
140 task_array_t *task_list,
141 mach_msg_type_number_t *task_listCnt
142);
143
144/* Routine processor_set_threads */
145#ifdef mig_external
146mig_external
147#else
148extern
149#endif /* mig_external */
150kern_return_t processor_set_threads
151(
152 processor_set_t processor_set,
153 thread_act_array_t *thread_list,
154 mach_msg_type_number_t *thread_listCnt
155);
156
157/* Routine processor_set_policy_control */
158#ifdef mig_external
159mig_external
160#else
161extern
162#endif /* mig_external */
163kern_return_t processor_set_policy_control
164(
165 processor_set_t pset,
166 processor_set_flavor_t flavor,
167 processor_set_info_t policy_info,
168 mach_msg_type_number_t policy_infoCnt,
169 boolean_t change
170);
171
172/* Routine processor_set_stack_usage */
173#ifdef mig_external
174mig_external
175#else
176extern
177#endif /* mig_external */
178kern_return_t processor_set_stack_usage
179(
180 processor_set_t pset,
181 unsigned *ltotal,
182 vm_size_t *space,
183 vm_size_t *resident,
184 vm_size_t *maxusage,
185 vm_offset_t *maxstack
186);
187
188/* Routine processor_set_info */
189#ifdef mig_external
190mig_external
191#else
192extern
193#endif /* mig_external */
194kern_return_t processor_set_info
195(
196 processor_set_name_t set_name,
197 int flavor,
198 host_t *host,
199 processor_set_info_t info_out,
200 mach_msg_type_number_t *info_outCnt
201);
202
203__END_DECLS
204
205/********************** Caution **************************/
206/* The following data types should be used to calculate */
207/* maximum message sizes only. The actual message may be */
208/* smaller, and the position of the arguments within the */
209/* message layout may vary from what is presented here. */
210/* For example, if any of the arguments are variable- */
211/* sized, and less than the maximum is sent, the data */
212/* will be packed tight in the actual message to reduce */
213/* the presence of holes. */
214/********************** Caution **************************/
215
216/* typedefs for all requests */
217
218#ifndef __Request__processor_set_subsystem__defined
219#define __Request__processor_set_subsystem__defined
220
221#ifdef __MigPackStructs
222#pragma pack(push, 4)
223#endif
224 typedef struct {
225 mach_msg_header_t Head;
226 NDR_record_t NDR;
227 processor_set_flavor_t flavor;
228 mach_msg_type_number_t info_outCnt;
229 } __Request__processor_set_statistics_t __attribute__((unused));
230#ifdef __MigPackStructs
231#pragma pack(pop)
232#endif
233
234#ifdef __MigPackStructs
235#pragma pack(push, 4)
236#endif
237 typedef struct {
238 mach_msg_header_t Head;
239 } __Request__processor_set_destroy_t __attribute__((unused));
240#ifdef __MigPackStructs
241#pragma pack(pop)
242#endif
243
244#ifdef __MigPackStructs
245#pragma pack(push, 4)
246#endif
247 typedef struct {
248 mach_msg_header_t Head;
249 NDR_record_t NDR;
250 int max_priority;
251 boolean_t change_threads;
252 } __Request__processor_set_max_priority_t __attribute__((unused));
253#ifdef __MigPackStructs
254#pragma pack(pop)
255#endif
256
257#ifdef __MigPackStructs
258#pragma pack(push, 4)
259#endif
260 typedef struct {
261 mach_msg_header_t Head;
262 NDR_record_t NDR;
263 int policy;
264 } __Request__processor_set_policy_enable_t __attribute__((unused));
265#ifdef __MigPackStructs
266#pragma pack(pop)
267#endif
268
269#ifdef __MigPackStructs
270#pragma pack(push, 4)
271#endif
272 typedef struct {
273 mach_msg_header_t Head;
274 NDR_record_t NDR;
275 int policy;
276 boolean_t change_threads;
277 } __Request__processor_set_policy_disable_t __attribute__((unused));
278#ifdef __MigPackStructs
279#pragma pack(pop)
280#endif
281
282#ifdef __MigPackStructs
283#pragma pack(push, 4)
284#endif
285 typedef struct {
286 mach_msg_header_t Head;
287 } __Request__processor_set_tasks_t __attribute__((unused));
288#ifdef __MigPackStructs
289#pragma pack(pop)
290#endif
291
292#ifdef __MigPackStructs
293#pragma pack(push, 4)
294#endif
295 typedef struct {
296 mach_msg_header_t Head;
297 } __Request__processor_set_threads_t __attribute__((unused));
298#ifdef __MigPackStructs
299#pragma pack(pop)
300#endif
301
302#ifdef __MigPackStructs
303#pragma pack(push, 4)
304#endif
305 typedef struct {
306 mach_msg_header_t Head;
307 NDR_record_t NDR;
308 processor_set_flavor_t flavor;
309 mach_msg_type_number_t policy_infoCnt;
310 integer_t policy_info[5];
311 boolean_t change;
312 } __Request__processor_set_policy_control_t __attribute__((unused));
313#ifdef __MigPackStructs
314#pragma pack(pop)
315#endif
316
317#ifdef __MigPackStructs
318#pragma pack(push, 4)
319#endif
320 typedef struct {
321 mach_msg_header_t Head;
322 } __Request__processor_set_stack_usage_t __attribute__((unused));
323#ifdef __MigPackStructs
324#pragma pack(pop)
325#endif
326
327#ifdef __MigPackStructs
328#pragma pack(push, 4)
329#endif
330 typedef struct {
331 mach_msg_header_t Head;
332 NDR_record_t NDR;
333 int flavor;
334 mach_msg_type_number_t info_outCnt;
335 } __Request__processor_set_info_t __attribute__((unused));
336#ifdef __MigPackStructs
337#pragma pack(pop)
338#endif
339#endif /* !__Request__processor_set_subsystem__defined */
340
341/* union of all requests */
342
343#ifndef __RequestUnion__processor_set_subsystem__defined
344#define __RequestUnion__processor_set_subsystem__defined
345union __RequestUnion__processor_set_subsystem {
346 __Request__processor_set_statistics_t Request_processor_set_statistics;
347 __Request__processor_set_destroy_t Request_processor_set_destroy;
348 __Request__processor_set_max_priority_t Request_processor_set_max_priority;
349 __Request__processor_set_policy_enable_t Request_processor_set_policy_enable;
350 __Request__processor_set_policy_disable_t Request_processor_set_policy_disable;
351 __Request__processor_set_tasks_t Request_processor_set_tasks;
352 __Request__processor_set_threads_t Request_processor_set_threads;
353 __Request__processor_set_policy_control_t Request_processor_set_policy_control;
354 __Request__processor_set_stack_usage_t Request_processor_set_stack_usage;
355 __Request__processor_set_info_t Request_processor_set_info;
356};
357#endif /* !__RequestUnion__processor_set_subsystem__defined */
358/* typedefs for all replies */
359
360#ifndef __Reply__processor_set_subsystem__defined
361#define __Reply__processor_set_subsystem__defined
362
363#ifdef __MigPackStructs
364#pragma pack(push, 4)
365#endif
366 typedef struct {
367 mach_msg_header_t Head;
368 NDR_record_t NDR;
369 kern_return_t RetCode;
370 mach_msg_type_number_t info_outCnt;
371 integer_t info_out[5];
372 } __Reply__processor_set_statistics_t __attribute__((unused));
373#ifdef __MigPackStructs
374#pragma pack(pop)
375#endif
376
377#ifdef __MigPackStructs
378#pragma pack(push, 4)
379#endif
380 typedef struct {
381 mach_msg_header_t Head;
382 NDR_record_t NDR;
383 kern_return_t RetCode;
384 } __Reply__processor_set_destroy_t __attribute__((unused));
385#ifdef __MigPackStructs
386#pragma pack(pop)
387#endif
388
389#ifdef __MigPackStructs
390#pragma pack(push, 4)
391#endif
392 typedef struct {
393 mach_msg_header_t Head;
394 NDR_record_t NDR;
395 kern_return_t RetCode;
396 } __Reply__processor_set_max_priority_t __attribute__((unused));
397#ifdef __MigPackStructs
398#pragma pack(pop)
399#endif
400
401#ifdef __MigPackStructs
402#pragma pack(push, 4)
403#endif
404 typedef struct {
405 mach_msg_header_t Head;
406 NDR_record_t NDR;
407 kern_return_t RetCode;
408 } __Reply__processor_set_policy_enable_t __attribute__((unused));
409#ifdef __MigPackStructs
410#pragma pack(pop)
411#endif
412
413#ifdef __MigPackStructs
414#pragma pack(push, 4)
415#endif
416 typedef struct {
417 mach_msg_header_t Head;
418 NDR_record_t NDR;
419 kern_return_t RetCode;
420 } __Reply__processor_set_policy_disable_t __attribute__((unused));
421#ifdef __MigPackStructs
422#pragma pack(pop)
423#endif
424
425#ifdef __MigPackStructs
426#pragma pack(push, 4)
427#endif
428 typedef struct {
429 mach_msg_header_t Head;
430 /* start of the kernel processed data */
431 mach_msg_body_t msgh_body;
432 mach_msg_ool_ports_descriptor_t task_list;
433 /* end of the kernel processed data */
434 NDR_record_t NDR;
435 mach_msg_type_number_t task_listCnt;
436 } __Reply__processor_set_tasks_t __attribute__((unused));
437#ifdef __MigPackStructs
438#pragma pack(pop)
439#endif
440
441#ifdef __MigPackStructs
442#pragma pack(push, 4)
443#endif
444 typedef struct {
445 mach_msg_header_t Head;
446 /* start of the kernel processed data */
447 mach_msg_body_t msgh_body;
448 mach_msg_ool_ports_descriptor_t thread_list;
449 /* end of the kernel processed data */
450 NDR_record_t NDR;
451 mach_msg_type_number_t thread_listCnt;
452 } __Reply__processor_set_threads_t __attribute__((unused));
453#ifdef __MigPackStructs
454#pragma pack(pop)
455#endif
456
457#ifdef __MigPackStructs
458#pragma pack(push, 4)
459#endif
460 typedef struct {
461 mach_msg_header_t Head;
462 NDR_record_t NDR;
463 kern_return_t RetCode;
464 } __Reply__processor_set_policy_control_t __attribute__((unused));
465#ifdef __MigPackStructs
466#pragma pack(pop)
467#endif
468
469#ifdef __MigPackStructs
470#pragma pack(push, 4)
471#endif
472 typedef struct {
473 mach_msg_header_t Head;
474 NDR_record_t NDR;
475 kern_return_t RetCode;
476 unsigned ltotal;
477 vm_size_t space;
478 vm_size_t resident;
479 vm_size_t maxusage;
480 vm_offset_t maxstack;
481 } __Reply__processor_set_stack_usage_t __attribute__((unused));
482#ifdef __MigPackStructs
483#pragma pack(pop)
484#endif
485
486#ifdef __MigPackStructs
487#pragma pack(push, 4)
488#endif
489 typedef struct {
490 mach_msg_header_t Head;
491 /* start of the kernel processed data */
492 mach_msg_body_t msgh_body;
493 mach_msg_port_descriptor_t host;
494 /* end of the kernel processed data */
495 NDR_record_t NDR;
496 mach_msg_type_number_t info_outCnt;
497 integer_t info_out[5];
498 } __Reply__processor_set_info_t __attribute__((unused));
499#ifdef __MigPackStructs
500#pragma pack(pop)
501#endif
502#endif /* !__Reply__processor_set_subsystem__defined */
503
504/* union of all replies */
505
506#ifndef __ReplyUnion__processor_set_subsystem__defined
507#define __ReplyUnion__processor_set_subsystem__defined
508union __ReplyUnion__processor_set_subsystem {
509 __Reply__processor_set_statistics_t Reply_processor_set_statistics;
510 __Reply__processor_set_destroy_t Reply_processor_set_destroy;
511 __Reply__processor_set_max_priority_t Reply_processor_set_max_priority;
512 __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable;
513 __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable;
514 __Reply__processor_set_tasks_t Reply_processor_set_tasks;
515 __Reply__processor_set_threads_t Reply_processor_set_threads;
516 __Reply__processor_set_policy_control_t Reply_processor_set_policy_control;
517 __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage;
518 __Reply__processor_set_info_t Reply_processor_set_info;
519};
520#endif /* !__RequestUnion__processor_set_subsystem__defined */
521
522#ifndef subsystem_to_name_map_processor_set
523#define subsystem_to_name_map_processor_set \
524 { "processor_set_statistics", 4000 },\
525 { "processor_set_destroy", 4001 },\
526 { "processor_set_max_priority", 4002 },\
527 { "processor_set_policy_enable", 4003 },\
528 { "processor_set_policy_disable", 4004 },\
529 { "processor_set_tasks", 4005 },\
530 { "processor_set_threads", 4006 },\
531 { "processor_set_policy_control", 4007 },\
532 { "processor_set_stack_usage", 4008 },\
533 { "processor_set_info", 4009 }
534#endif
535
536#ifdef __AfterMigUserHeader
537__AfterMigUserHeader
538#endif /* __AfterMigUserHeader */
539
540#endif /* _processor_set_user_ */
lib/libc/include/x86_64-macos-gnu/mach/rpc.h created+135
...@@ -0,0 +1,135 @@
1/*
2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32/*
33 * Mach RPC Subsystem Interfaces
34 */
35
36#ifndef _MACH_RPC_H_
37#define _MACH_RPC_H_
38
39#include <mach/boolean.h>
40#include <mach/kern_return.h>
41#include <mach/port.h>
42#include <mach/vm_types.h>
43
44#include <mach/mig.h>
45#include <mach/mig_errors.h>
46#include <mach/machine/rpc.h>
47#include <mach/thread_status.h>
48
49/*
50 * These are the types for RPC-specific variants of the MIG routine
51 * descriptor and subsystem data types.
52 *
53 * THIS IS ONLY FOR COMPATIBILITY. WE WILL NOT BE IMPLEMENTING THIS.
54 */
55
56/*
57 * Basic mach rpc types.
58 */
59typedef unsigned int routine_arg_type;
60typedef unsigned int routine_arg_offset;
61typedef unsigned int routine_arg_size;
62
63/*
64 * Definitions for a signature's argument and routine descriptor's.
65 */
66struct rpc_routine_arg_descriptor {
67 routine_arg_type type; /* Port, Array, etc. */
68 routine_arg_size size; /* element size in bytes */
69 routine_arg_size count; /* number of elements */
70 routine_arg_offset offset; /* Offset in list of routine args */
71};
72typedef struct rpc_routine_arg_descriptor *rpc_routine_arg_descriptor_t;
73
74struct rpc_routine_descriptor {
75 mig_impl_routine_t impl_routine; /* Server work func pointer */
76 mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */
77 unsigned int argc; /* Number of argument words */
78 unsigned int descr_count; /* Number of complex argument */
79 /* descriptors */
80 rpc_routine_arg_descriptor_t
81 arg_descr; /* Pointer to beginning of */
82 /* the arg_descr array */
83 unsigned int max_reply_msg; /* Max size for reply msg */
84};
85typedef struct rpc_routine_descriptor *rpc_routine_descriptor_t;
86
87#define RPC_DESCR_SIZE(x) ((x)->descr_count * \
88 sizeof(struct rpc_routine_arg_descriptor))
89
90struct rpc_signature {
91 struct rpc_routine_descriptor rd;
92 struct rpc_routine_arg_descriptor rad[1];
93};
94
95#define RPC_SIGBUF_SIZE 8
96
97/*
98 * A subsystem describes a set of server routines that can be invoked by
99 * mach_rpc() on the ports that are registered with the subsystem. For
100 * each routine, the routine number is given, along with the
101 * address of the implementation function in the server and a
102 * description of the arguments of the routine (it's "signature").
103 *
104 * This structure definition is only a template for what is really a
105 * variable-length structure (generated by MIG for each subsystem).
106 * The actual structures do not always have one entry in the routine
107 * array, and also have a varying number of entries in the arg_descr
108 * array. Each routine has an array of zero or more arg descriptors
109 * one for each complex arg. These arrays are all catenated together
110 * to form the arg_descr field of the subsystem struct. The
111 * arg_descr field of each routine entry points to a unique sub-sequence
112 * within this catenated array. The goal is to keep everything
113 * contiguous.
114 */
115struct rpc_subsystem {
116 void *reserved; /* Reserved for system use */
117
118 mach_msg_id_t start; /* Min routine number */
119 mach_msg_id_t end; /* Max routine number + 1 */
120 unsigned int maxsize; /* Max mach_msg size */
121 vm_address_t base_addr; /* Address of this struct in user */
122
123 struct rpc_routine_descriptor /* Array of routine descriptors */
124 routine[1 /* Actually, (start-end+1) */
125 ];
126
127 struct rpc_routine_arg_descriptor
128 arg_descriptor[1 /* Actually, the sum of the descr_ */
129 ]; /* count fields for all routines */
130};
131typedef struct rpc_subsystem *rpc_subsystem_t;
132
133#define RPC_SUBSYSTEM_NULL ((rpc_subsystem_t) 0)
134
135#endif /* _MACH_RPC_H_ */
lib/libc/include/x86_64-macos-gnu/mach/semaphore.h created+78
...@@ -0,0 +1,78 @@
1/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_SEMAPHORE_H_
30#define _MACH_SEMAPHORE_H_
31
32#include <mach/port.h>
33#include <mach/mach_types.h>
34#include <mach/kern_return.h>
35#include <mach/sync_policy.h>
36
37/*
38 * Forward Declarations
39 *
40 * The semaphore creation and deallocation routines are
41 * defined with the Mach task APIs in <mach/task.h>.
42 *
43 * kern_return_t semaphore_create(task_t task,
44 * semaphore_t *new_semaphore,
45 * sync_policy_t policy,
46 * int value);
47 *
48 * kern_return_t semaphore_destroy(task_t task,
49 * semaphore_t semaphore);
50 */
51
52#include <sys/cdefs.h>
53__BEGIN_DECLS
54
55extern kern_return_t semaphore_signal(semaphore_t semaphore);
56extern kern_return_t semaphore_signal_all(semaphore_t semaphore);
57
58extern kern_return_t semaphore_wait(semaphore_t semaphore);
59
60
61extern kern_return_t semaphore_timedwait(semaphore_t semaphore,
62 mach_timespec_t wait_time);
63
64extern kern_return_t semaphore_timedwait_signal(semaphore_t wait_semaphore,
65 semaphore_t signal_semaphore,
66 mach_timespec_t wait_time);
67
68extern kern_return_t semaphore_wait_signal(semaphore_t wait_semaphore,
69 semaphore_t signal_semaphore);
70
71extern kern_return_t semaphore_signal_thread(semaphore_t semaphore,
72 thread_t thread);
73
74
75__END_DECLS
76
77
78#endif /* _MACH_SEMAPHORE_H_ */
lib/libc/include/x86_64-macos-gnu/mach/std_types.h created+75
...@@ -0,0 +1,75 @@
1/*
2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * Mach standard external interface type definitions.
60 *
61 */
62
63#ifndef _MACH_STD_TYPES_H_
64#define _MACH_STD_TYPES_H_
65
66#include <stdint.h>
67#include <mach/boolean.h>
68#include <mach/kern_return.h>
69#include <mach/port.h>
70#include <mach/vm_types.h>
71
72#include <sys/_types.h>
73#include <sys/_types/_uuid_t.h>
74
75#endif /* _MACH_STD_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach/sync_policy.h created+49
...@@ -0,0 +1,49 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32#ifndef _MACH_SYNC_POLICY_H_
33#define _MACH_SYNC_POLICY_H_
34
35typedef int sync_policy_t;
36
37/*
38 * These options define the wait ordering of the synchronizers
39 */
40#define SYNC_POLICY_FIFO 0x0
41#define SYNC_POLICY_FIXED_PRIORITY 0x1
42#define SYNC_POLICY_REVERSED 0x2
43#define SYNC_POLICY_ORDER_MASK 0x3
44#define SYNC_POLICY_LIFO (SYNC_POLICY_FIFO|SYNC_POLICY_REVERSED)
45
46
47#define SYNC_POLICY_MAX 0x7
48
49#endif /* _MACH_SYNC_POLICY_H_ */
lib/libc/include/x86_64-macos-gnu/mach/task.h created+2523
...@@ -0,0 +1,2523 @@
1#ifndef _task_user_
2#define _task_user_
3
4/* Module task */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef task_MSG_COUNT
52#define task_MSG_COUNT 55
53#endif /* task_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach_debug/mach_debug_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine task_create */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t task_create
76(
77 task_t target_task,
78 ledger_array_t ledgers,
79 mach_msg_type_number_t ledgersCnt,
80 boolean_t inherit_memory,
81 task_t *child_task
82);
83
84/* Routine task_terminate */
85#ifdef mig_external
86mig_external
87#else
88extern
89#endif /* mig_external */
90kern_return_t task_terminate
91(
92 task_t target_task
93);
94
95/* Routine task_threads */
96#ifdef mig_external
97mig_external
98#else
99extern
100#endif /* mig_external */
101kern_return_t task_threads
102(
103 task_inspect_t target_task,
104 thread_act_array_t *act_list,
105 mach_msg_type_number_t *act_listCnt
106);
107
108/* Routine mach_ports_register */
109#ifdef mig_external
110mig_external
111#else
112extern
113#endif /* mig_external */
114__WATCHOS_PROHIBITED
115__TVOS_PROHIBITED
116kern_return_t mach_ports_register
117(
118 task_t target_task,
119 mach_port_array_t init_port_set,
120 mach_msg_type_number_t init_port_setCnt
121);
122
123/* Routine mach_ports_lookup */
124#ifdef mig_external
125mig_external
126#else
127extern
128#endif /* mig_external */
129__WATCHOS_PROHIBITED
130__TVOS_PROHIBITED
131kern_return_t mach_ports_lookup
132(
133 task_t target_task,
134 mach_port_array_t *init_port_set,
135 mach_msg_type_number_t *init_port_setCnt
136);
137
138/* Routine task_info */
139#ifdef mig_external
140mig_external
141#else
142extern
143#endif /* mig_external */
144kern_return_t task_info
145(
146 task_name_t target_task,
147 task_flavor_t flavor,
148 task_info_t task_info_out,
149 mach_msg_type_number_t *task_info_outCnt
150);
151
152/* Routine task_set_info */
153#ifdef mig_external
154mig_external
155#else
156extern
157#endif /* mig_external */
158__WATCHOS_PROHIBITED
159__TVOS_PROHIBITED
160kern_return_t task_set_info
161(
162 task_t target_task,
163 task_flavor_t flavor,
164 task_info_t task_info_in,
165 mach_msg_type_number_t task_info_inCnt
166);
167
168/* Routine task_suspend */
169#ifdef mig_external
170mig_external
171#else
172extern
173#endif /* mig_external */
174__WATCHOS_PROHIBITED
175__TVOS_PROHIBITED
176kern_return_t task_suspend
177(
178 task_t target_task
179);
180
181/* Routine task_resume */
182#ifdef mig_external
183mig_external
184#else
185extern
186#endif /* mig_external */
187__WATCHOS_PROHIBITED
188__TVOS_PROHIBITED
189kern_return_t task_resume
190(
191 task_t target_task
192);
193
194/* Routine task_get_special_port */
195#ifdef mig_external
196mig_external
197#else
198extern
199#endif /* mig_external */
200__WATCHOS_PROHIBITED
201__TVOS_PROHIBITED
202kern_return_t task_get_special_port
203(
204 task_inspect_t task,
205 int which_port,
206 mach_port_t *special_port
207);
208
209/* Routine task_set_special_port */
210#ifdef mig_external
211mig_external
212#else
213extern
214#endif /* mig_external */
215__WATCHOS_PROHIBITED
216__TVOS_PROHIBITED
217kern_return_t task_set_special_port
218(
219 task_t task,
220 int which_port,
221 mach_port_t special_port
222);
223
224/* Routine thread_create */
225#ifdef mig_external
226mig_external
227#else
228extern
229#endif /* mig_external */
230__WATCHOS_PROHIBITED
231__TVOS_PROHIBITED
232kern_return_t thread_create
233(
234 task_t parent_task,
235 thread_act_t *child_act
236);
237
238/* Routine thread_create_running */
239#ifdef mig_external
240mig_external
241#else
242extern
243#endif /* mig_external */
244__WATCHOS_PROHIBITED
245__TVOS_PROHIBITED
246kern_return_t thread_create_running
247(
248 task_t parent_task,
249 thread_state_flavor_t flavor,
250 thread_state_t new_state,
251 mach_msg_type_number_t new_stateCnt,
252 thread_act_t *child_act
253);
254
255/* Routine task_set_exception_ports */
256#ifdef mig_external
257mig_external
258#else
259extern
260#endif /* mig_external */
261__WATCHOS_PROHIBITED
262__TVOS_PROHIBITED
263kern_return_t task_set_exception_ports
264(
265 task_t task,
266 exception_mask_t exception_mask,
267 mach_port_t new_port,
268 exception_behavior_t behavior,
269 thread_state_flavor_t new_flavor
270);
271
272/* Routine task_get_exception_ports */
273#ifdef mig_external
274mig_external
275#else
276extern
277#endif /* mig_external */
278__WATCHOS_PROHIBITED
279__TVOS_PROHIBITED
280kern_return_t task_get_exception_ports
281(
282 task_inspect_t task,
283 exception_mask_t exception_mask,
284 exception_mask_array_t masks,
285 mach_msg_type_number_t *masksCnt,
286 exception_handler_array_t old_handlers,
287 exception_behavior_array_t old_behaviors,
288 exception_flavor_array_t old_flavors
289);
290
291/* Routine task_swap_exception_ports */
292#ifdef mig_external
293mig_external
294#else
295extern
296#endif /* mig_external */
297__WATCHOS_PROHIBITED
298__TVOS_PROHIBITED
299kern_return_t task_swap_exception_ports
300(
301 task_t task,
302 exception_mask_t exception_mask,
303 mach_port_t new_port,
304 exception_behavior_t behavior,
305 thread_state_flavor_t new_flavor,
306 exception_mask_array_t masks,
307 mach_msg_type_number_t *masksCnt,
308 exception_handler_array_t old_handlerss,
309 exception_behavior_array_t old_behaviors,
310 exception_flavor_array_t old_flavors
311);
312
313/* Routine lock_set_create */
314#ifdef mig_external
315mig_external
316#else
317extern
318#endif /* mig_external */
319kern_return_t lock_set_create
320(
321 task_t task,
322 lock_set_t *new_lock_set,
323 int n_ulocks,
324 int policy
325);
326
327/* Routine lock_set_destroy */
328#ifdef mig_external
329mig_external
330#else
331extern
332#endif /* mig_external */
333kern_return_t lock_set_destroy
334(
335 task_t task,
336 lock_set_t lock_set
337);
338
339/* Routine semaphore_create */
340#ifdef mig_external
341mig_external
342#else
343extern
344#endif /* mig_external */
345kern_return_t semaphore_create
346(
347 task_t task,
348 semaphore_t *semaphore,
349 int policy,
350 int value
351);
352
353/* Routine semaphore_destroy */
354#ifdef mig_external
355mig_external
356#else
357extern
358#endif /* mig_external */
359kern_return_t semaphore_destroy
360(
361 task_t task,
362 semaphore_t semaphore
363);
364
365/* Routine task_policy_set */
366#ifdef mig_external
367mig_external
368#else
369extern
370#endif /* mig_external */
371__WATCHOS_PROHIBITED
372__TVOS_PROHIBITED
373kern_return_t task_policy_set
374(
375 task_t task,
376 task_policy_flavor_t flavor,
377 task_policy_t policy_info,
378 mach_msg_type_number_t policy_infoCnt
379);
380
381/* Routine task_policy_get */
382#ifdef mig_external
383mig_external
384#else
385extern
386#endif /* mig_external */
387__WATCHOS_PROHIBITED
388__TVOS_PROHIBITED
389kern_return_t task_policy_get
390(
391 task_t task,
392 task_policy_flavor_t flavor,
393 task_policy_t policy_info,
394 mach_msg_type_number_t *policy_infoCnt,
395 boolean_t *get_default
396);
397
398/* Routine task_sample */
399#ifdef mig_external
400mig_external
401#else
402extern
403#endif /* mig_external */
404kern_return_t task_sample
405(
406 task_t task,
407 mach_port_t reply
408);
409
410/* Routine task_policy */
411#ifdef mig_external
412mig_external
413#else
414extern
415#endif /* mig_external */
416kern_return_t task_policy
417(
418 task_t task,
419 policy_t policy,
420 policy_base_t base,
421 mach_msg_type_number_t baseCnt,
422 boolean_t set_limit,
423 boolean_t change
424);
425
426/* Routine task_set_emulation */
427#ifdef mig_external
428mig_external
429#else
430extern
431#endif /* mig_external */
432kern_return_t task_set_emulation
433(
434 task_t target_port,
435 vm_address_t routine_entry_pt,
436 int routine_number
437);
438
439/* Routine task_get_emulation_vector */
440#ifdef mig_external
441mig_external
442#else
443extern
444#endif /* mig_external */
445kern_return_t task_get_emulation_vector
446(
447 task_t task,
448 int *vector_start,
449 emulation_vector_t *emulation_vector,
450 mach_msg_type_number_t *emulation_vectorCnt
451);
452
453/* Routine task_set_emulation_vector */
454#ifdef mig_external
455mig_external
456#else
457extern
458#endif /* mig_external */
459kern_return_t task_set_emulation_vector
460(
461 task_t task,
462 int vector_start,
463 emulation_vector_t emulation_vector,
464 mach_msg_type_number_t emulation_vectorCnt
465);
466
467/* Routine task_set_ras_pc */
468#ifdef mig_external
469mig_external
470#else
471extern
472#endif /* mig_external */
473kern_return_t task_set_ras_pc
474(
475 task_t target_task,
476 vm_address_t basepc,
477 vm_address_t boundspc
478);
479
480/* Routine task_zone_info */
481#ifdef mig_external
482mig_external
483#else
484extern
485#endif /* mig_external */
486__WATCHOS_PROHIBITED
487__TVOS_PROHIBITED
488kern_return_t task_zone_info
489(
490 task_t target_task,
491 mach_zone_name_array_t *names,
492 mach_msg_type_number_t *namesCnt,
493 task_zone_info_array_t *info,
494 mach_msg_type_number_t *infoCnt
495);
496
497/* Routine task_assign */
498#ifdef mig_external
499mig_external
500#else
501extern
502#endif /* mig_external */
503kern_return_t task_assign
504(
505 task_t task,
506 processor_set_t new_set,
507 boolean_t assign_threads
508);
509
510/* Routine task_assign_default */
511#ifdef mig_external
512mig_external
513#else
514extern
515#endif /* mig_external */
516kern_return_t task_assign_default
517(
518 task_t task,
519 boolean_t assign_threads
520);
521
522/* Routine task_get_assignment */
523#ifdef mig_external
524mig_external
525#else
526extern
527#endif /* mig_external */
528kern_return_t task_get_assignment
529(
530 task_t task,
531 processor_set_name_t *assigned_set
532);
533
534/* Routine task_set_policy */
535#ifdef mig_external
536mig_external
537#else
538extern
539#endif /* mig_external */
540kern_return_t task_set_policy
541(
542 task_t task,
543 processor_set_t pset,
544 policy_t policy,
545 policy_base_t base,
546 mach_msg_type_number_t baseCnt,
547 policy_limit_t limit,
548 mach_msg_type_number_t limitCnt,
549 boolean_t change
550);
551
552/* Routine task_get_state */
553#ifdef mig_external
554mig_external
555#else
556extern
557#endif /* mig_external */
558__WATCHOS_PROHIBITED
559__TVOS_PROHIBITED
560kern_return_t task_get_state
561(
562 task_t task,
563 thread_state_flavor_t flavor,
564 thread_state_t old_state,
565 mach_msg_type_number_t *old_stateCnt
566);
567
568/* Routine task_set_state */
569#ifdef mig_external
570mig_external
571#else
572extern
573#endif /* mig_external */
574__WATCHOS_PROHIBITED
575__TVOS_PROHIBITED
576kern_return_t task_set_state
577(
578 task_t task,
579 thread_state_flavor_t flavor,
580 thread_state_t new_state,
581 mach_msg_type_number_t new_stateCnt
582);
583
584/* Routine task_set_phys_footprint_limit */
585#ifdef mig_external
586mig_external
587#else
588extern
589#endif /* mig_external */
590__WATCHOS_PROHIBITED
591__TVOS_PROHIBITED
592kern_return_t task_set_phys_footprint_limit
593(
594 task_t task,
595 int new_limit,
596 int *old_limit
597);
598
599/* Routine task_suspend2 */
600#ifdef mig_external
601mig_external
602#else
603extern
604#endif /* mig_external */
605__WATCHOS_PROHIBITED
606__TVOS_PROHIBITED
607kern_return_t task_suspend2
608(
609 task_t target_task,
610 task_suspension_token_t *suspend_token
611);
612
613/* Routine task_resume2 */
614#ifdef mig_external
615mig_external
616#else
617extern
618#endif /* mig_external */
619__WATCHOS_PROHIBITED
620__TVOS_PROHIBITED
621kern_return_t task_resume2
622(
623 task_suspension_token_t suspend_token
624);
625
626/* Routine task_purgable_info */
627#ifdef mig_external
628mig_external
629#else
630extern
631#endif /* mig_external */
632kern_return_t task_purgable_info
633(
634 task_t task,
635 task_purgable_info_t *stats
636);
637
638/* Routine task_get_mach_voucher */
639#ifdef mig_external
640mig_external
641#else
642extern
643#endif /* mig_external */
644__WATCHOS_PROHIBITED
645__TVOS_PROHIBITED
646kern_return_t task_get_mach_voucher
647(
648 task_t task,
649 mach_voucher_selector_t which,
650 ipc_voucher_t *voucher
651);
652
653/* Routine task_set_mach_voucher */
654#ifdef mig_external
655mig_external
656#else
657extern
658#endif /* mig_external */
659__WATCHOS_PROHIBITED
660__TVOS_PROHIBITED
661kern_return_t task_set_mach_voucher
662(
663 task_t task,
664 ipc_voucher_t voucher
665);
666
667/* Routine task_swap_mach_voucher */
668#ifdef mig_external
669mig_external
670#else
671extern
672#endif /* mig_external */
673__WATCHOS_PROHIBITED
674__TVOS_PROHIBITED
675kern_return_t task_swap_mach_voucher
676(
677 task_t task,
678 ipc_voucher_t new_voucher,
679 ipc_voucher_t *old_voucher
680);
681
682/* Routine task_generate_corpse */
683#ifdef mig_external
684mig_external
685#else
686extern
687#endif /* mig_external */
688kern_return_t task_generate_corpse
689(
690 task_t task,
691 mach_port_t *corpse_task_port
692);
693
694/* Routine task_map_corpse_info */
695#ifdef mig_external
696mig_external
697#else
698extern
699#endif /* mig_external */
700kern_return_t task_map_corpse_info
701(
702 task_t task,
703 task_t corspe_task,
704 vm_address_t *kcd_addr_begin,
705 uint32_t *kcd_size
706);
707
708/* Routine task_register_dyld_image_infos */
709#ifdef mig_external
710mig_external
711#else
712extern
713#endif /* mig_external */
714kern_return_t task_register_dyld_image_infos
715(
716 task_t task,
717 dyld_kernel_image_info_array_t dyld_images,
718 mach_msg_type_number_t dyld_imagesCnt
719);
720
721/* Routine task_unregister_dyld_image_infos */
722#ifdef mig_external
723mig_external
724#else
725extern
726#endif /* mig_external */
727kern_return_t task_unregister_dyld_image_infos
728(
729 task_t task,
730 dyld_kernel_image_info_array_t dyld_images,
731 mach_msg_type_number_t dyld_imagesCnt
732);
733
734/* Routine task_get_dyld_image_infos */
735#ifdef mig_external
736mig_external
737#else
738extern
739#endif /* mig_external */
740kern_return_t task_get_dyld_image_infos
741(
742 task_inspect_t task,
743 dyld_kernel_image_info_array_t *dyld_images,
744 mach_msg_type_number_t *dyld_imagesCnt
745);
746
747/* Routine task_register_dyld_shared_cache_image_info */
748#ifdef mig_external
749mig_external
750#else
751extern
752#endif /* mig_external */
753kern_return_t task_register_dyld_shared_cache_image_info
754(
755 task_t task,
756 dyld_kernel_image_info_t dyld_cache_image,
757 boolean_t no_cache,
758 boolean_t private_cache
759);
760
761/* Routine task_register_dyld_set_dyld_state */
762#ifdef mig_external
763mig_external
764#else
765extern
766#endif /* mig_external */
767kern_return_t task_register_dyld_set_dyld_state
768(
769 task_t task,
770 uint8_t dyld_state
771);
772
773/* Routine task_register_dyld_get_process_state */
774#ifdef mig_external
775mig_external
776#else
777extern
778#endif /* mig_external */
779kern_return_t task_register_dyld_get_process_state
780(
781 task_t task,
782 dyld_kernel_process_info_t *dyld_process_state
783);
784
785/* Routine task_map_corpse_info_64 */
786#ifdef mig_external
787mig_external
788#else
789extern
790#endif /* mig_external */
791kern_return_t task_map_corpse_info_64
792(
793 task_t task,
794 task_t corspe_task,
795 mach_vm_address_t *kcd_addr_begin,
796 mach_vm_size_t *kcd_size
797);
798
799/* Routine task_inspect */
800#ifdef mig_external
801mig_external
802#else
803extern
804#endif /* mig_external */
805kern_return_t task_inspect
806(
807 task_inspect_t task,
808 task_inspect_flavor_t flavor,
809 task_inspect_info_t info_out,
810 mach_msg_type_number_t *info_outCnt
811);
812
813/* Routine task_get_exc_guard_behavior */
814#ifdef mig_external
815mig_external
816#else
817extern
818#endif /* mig_external */
819kern_return_t task_get_exc_guard_behavior
820(
821 task_inspect_t task,
822 task_exc_guard_behavior_t *behavior
823);
824
825/* Routine task_set_exc_guard_behavior */
826#ifdef mig_external
827mig_external
828#else
829extern
830#endif /* mig_external */
831kern_return_t task_set_exc_guard_behavior
832(
833 task_t task,
834 task_exc_guard_behavior_t behavior
835);
836
837/* Routine task_create_suid_cred */
838#ifdef mig_external
839mig_external
840#else
841extern
842#endif /* mig_external */
843kern_return_t task_create_suid_cred
844(
845 task_t task,
846 suid_cred_path_t path,
847 suid_cred_uid_t uid,
848 suid_cred_t *delegation
849);
850
851__END_DECLS
852
853/********************** Caution **************************/
854/* The following data types should be used to calculate */
855/* maximum message sizes only. The actual message may be */
856/* smaller, and the position of the arguments within the */
857/* message layout may vary from what is presented here. */
858/* For example, if any of the arguments are variable- */
859/* sized, and less than the maximum is sent, the data */
860/* will be packed tight in the actual message to reduce */
861/* the presence of holes. */
862/********************** Caution **************************/
863
864/* typedefs for all requests */
865
866#ifndef __Request__task_subsystem__defined
867#define __Request__task_subsystem__defined
868
869#ifdef __MigPackStructs
870#pragma pack(push, 4)
871#endif
872 typedef struct {
873 mach_msg_header_t Head;
874 /* start of the kernel processed data */
875 mach_msg_body_t msgh_body;
876 mach_msg_ool_ports_descriptor_t ledgers;
877 /* end of the kernel processed data */
878 NDR_record_t NDR;
879 mach_msg_type_number_t ledgersCnt;
880 boolean_t inherit_memory;
881 } __Request__task_create_t __attribute__((unused));
882#ifdef __MigPackStructs
883#pragma pack(pop)
884#endif
885
886#ifdef __MigPackStructs
887#pragma pack(push, 4)
888#endif
889 typedef struct {
890 mach_msg_header_t Head;
891 } __Request__task_terminate_t __attribute__((unused));
892#ifdef __MigPackStructs
893#pragma pack(pop)
894#endif
895
896#ifdef __MigPackStructs
897#pragma pack(push, 4)
898#endif
899 typedef struct {
900 mach_msg_header_t Head;
901 } __Request__task_threads_t __attribute__((unused));
902#ifdef __MigPackStructs
903#pragma pack(pop)
904#endif
905
906#ifdef __MigPackStructs
907#pragma pack(push, 4)
908#endif
909 typedef struct {
910 mach_msg_header_t Head;
911 /* start of the kernel processed data */
912 mach_msg_body_t msgh_body;
913 mach_msg_ool_ports_descriptor_t init_port_set;
914 /* end of the kernel processed data */
915 NDR_record_t NDR;
916 mach_msg_type_number_t init_port_setCnt;
917 } __Request__mach_ports_register_t __attribute__((unused));
918#ifdef __MigPackStructs
919#pragma pack(pop)
920#endif
921
922#ifdef __MigPackStructs
923#pragma pack(push, 4)
924#endif
925 typedef struct {
926 mach_msg_header_t Head;
927 } __Request__mach_ports_lookup_t __attribute__((unused));
928#ifdef __MigPackStructs
929#pragma pack(pop)
930#endif
931
932#ifdef __MigPackStructs
933#pragma pack(push, 4)
934#endif
935 typedef struct {
936 mach_msg_header_t Head;
937 NDR_record_t NDR;
938 task_flavor_t flavor;
939 mach_msg_type_number_t task_info_outCnt;
940 } __Request__task_info_t __attribute__((unused));
941#ifdef __MigPackStructs
942#pragma pack(pop)
943#endif
944
945#ifdef __MigPackStructs
946#pragma pack(push, 4)
947#endif
948 typedef struct {
949 mach_msg_header_t Head;
950 NDR_record_t NDR;
951 task_flavor_t flavor;
952 mach_msg_type_number_t task_info_inCnt;
953 integer_t task_info_in[87];
954 } __Request__task_set_info_t __attribute__((unused));
955#ifdef __MigPackStructs
956#pragma pack(pop)
957#endif
958
959#ifdef __MigPackStructs
960#pragma pack(push, 4)
961#endif
962 typedef struct {
963 mach_msg_header_t Head;
964 } __Request__task_suspend_t __attribute__((unused));
965#ifdef __MigPackStructs
966#pragma pack(pop)
967#endif
968
969#ifdef __MigPackStructs
970#pragma pack(push, 4)
971#endif
972 typedef struct {
973 mach_msg_header_t Head;
974 } __Request__task_resume_t __attribute__((unused));
975#ifdef __MigPackStructs
976#pragma pack(pop)
977#endif
978
979#ifdef __MigPackStructs
980#pragma pack(push, 4)
981#endif
982 typedef struct {
983 mach_msg_header_t Head;
984 NDR_record_t NDR;
985 int which_port;
986 } __Request__task_get_special_port_t __attribute__((unused));
987#ifdef __MigPackStructs
988#pragma pack(pop)
989#endif
990
991#ifdef __MigPackStructs
992#pragma pack(push, 4)
993#endif
994 typedef struct {
995 mach_msg_header_t Head;
996 /* start of the kernel processed data */
997 mach_msg_body_t msgh_body;
998 mach_msg_port_descriptor_t special_port;
999 /* end of the kernel processed data */
1000 NDR_record_t NDR;
1001 int which_port;
1002 } __Request__task_set_special_port_t __attribute__((unused));
1003#ifdef __MigPackStructs
1004#pragma pack(pop)
1005#endif
1006
1007#ifdef __MigPackStructs
1008#pragma pack(push, 4)
1009#endif
1010 typedef struct {
1011 mach_msg_header_t Head;
1012 } __Request__thread_create_t __attribute__((unused));
1013#ifdef __MigPackStructs
1014#pragma pack(pop)
1015#endif
1016
1017#ifdef __MigPackStructs
1018#pragma pack(push, 4)
1019#endif
1020 typedef struct {
1021 mach_msg_header_t Head;
1022 NDR_record_t NDR;
1023 thread_state_flavor_t flavor;
1024 mach_msg_type_number_t new_stateCnt;
1025 natural_t new_state[614];
1026 } __Request__thread_create_running_t __attribute__((unused));
1027#ifdef __MigPackStructs
1028#pragma pack(pop)
1029#endif
1030
1031#ifdef __MigPackStructs
1032#pragma pack(push, 4)
1033#endif
1034 typedef struct {
1035 mach_msg_header_t Head;
1036 /* start of the kernel processed data */
1037 mach_msg_body_t msgh_body;
1038 mach_msg_port_descriptor_t new_port;
1039 /* end of the kernel processed data */
1040 NDR_record_t NDR;
1041 exception_mask_t exception_mask;
1042 exception_behavior_t behavior;
1043 thread_state_flavor_t new_flavor;
1044 } __Request__task_set_exception_ports_t __attribute__((unused));
1045#ifdef __MigPackStructs
1046#pragma pack(pop)
1047#endif
1048
1049#ifdef __MigPackStructs
1050#pragma pack(push, 4)
1051#endif
1052 typedef struct {
1053 mach_msg_header_t Head;
1054 NDR_record_t NDR;
1055 exception_mask_t exception_mask;
1056 } __Request__task_get_exception_ports_t __attribute__((unused));
1057#ifdef __MigPackStructs
1058#pragma pack(pop)
1059#endif
1060
1061#ifdef __MigPackStructs
1062#pragma pack(push, 4)
1063#endif
1064 typedef struct {
1065 mach_msg_header_t Head;
1066 /* start of the kernel processed data */
1067 mach_msg_body_t msgh_body;
1068 mach_msg_port_descriptor_t new_port;
1069 /* end of the kernel processed data */
1070 NDR_record_t NDR;
1071 exception_mask_t exception_mask;
1072 exception_behavior_t behavior;
1073 thread_state_flavor_t new_flavor;
1074 } __Request__task_swap_exception_ports_t __attribute__((unused));
1075#ifdef __MigPackStructs
1076#pragma pack(pop)
1077#endif
1078
1079#ifdef __MigPackStructs
1080#pragma pack(push, 4)
1081#endif
1082 typedef struct {
1083 mach_msg_header_t Head;
1084 NDR_record_t NDR;
1085 int n_ulocks;
1086 int policy;
1087 } __Request__lock_set_create_t __attribute__((unused));
1088#ifdef __MigPackStructs
1089#pragma pack(pop)
1090#endif
1091
1092#ifdef __MigPackStructs
1093#pragma pack(push, 4)
1094#endif
1095 typedef struct {
1096 mach_msg_header_t Head;
1097 /* start of the kernel processed data */
1098 mach_msg_body_t msgh_body;
1099 mach_msg_port_descriptor_t lock_set;
1100 /* end of the kernel processed data */
1101 } __Request__lock_set_destroy_t __attribute__((unused));
1102#ifdef __MigPackStructs
1103#pragma pack(pop)
1104#endif
1105
1106#ifdef __MigPackStructs
1107#pragma pack(push, 4)
1108#endif
1109 typedef struct {
1110 mach_msg_header_t Head;
1111 NDR_record_t NDR;
1112 int policy;
1113 int value;
1114 } __Request__semaphore_create_t __attribute__((unused));
1115#ifdef __MigPackStructs
1116#pragma pack(pop)
1117#endif
1118
1119#ifdef __MigPackStructs
1120#pragma pack(push, 4)
1121#endif
1122 typedef struct {
1123 mach_msg_header_t Head;
1124 /* start of the kernel processed data */
1125 mach_msg_body_t msgh_body;
1126 mach_msg_port_descriptor_t semaphore;
1127 /* end of the kernel processed data */
1128 } __Request__semaphore_destroy_t __attribute__((unused));
1129#ifdef __MigPackStructs
1130#pragma pack(pop)
1131#endif
1132
1133#ifdef __MigPackStructs
1134#pragma pack(push, 4)
1135#endif
1136 typedef struct {
1137 mach_msg_header_t Head;
1138 NDR_record_t NDR;
1139 task_policy_flavor_t flavor;
1140 mach_msg_type_number_t policy_infoCnt;
1141 integer_t policy_info[16];
1142 } __Request__task_policy_set_t __attribute__((unused));
1143#ifdef __MigPackStructs
1144#pragma pack(pop)
1145#endif
1146
1147#ifdef __MigPackStructs
1148#pragma pack(push, 4)
1149#endif
1150 typedef struct {
1151 mach_msg_header_t Head;
1152 NDR_record_t NDR;
1153 task_policy_flavor_t flavor;
1154 mach_msg_type_number_t policy_infoCnt;
1155 boolean_t get_default;
1156 } __Request__task_policy_get_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 /* start of the kernel processed data */
1167 mach_msg_body_t msgh_body;
1168 mach_msg_port_descriptor_t reply;
1169 /* end of the kernel processed data */
1170 } __Request__task_sample_t __attribute__((unused));
1171#ifdef __MigPackStructs
1172#pragma pack(pop)
1173#endif
1174
1175#ifdef __MigPackStructs
1176#pragma pack(push, 4)
1177#endif
1178 typedef struct {
1179 mach_msg_header_t Head;
1180 NDR_record_t NDR;
1181 policy_t policy;
1182 mach_msg_type_number_t baseCnt;
1183 integer_t base[5];
1184 boolean_t set_limit;
1185 boolean_t change;
1186 } __Request__task_policy_t __attribute__((unused));
1187#ifdef __MigPackStructs
1188#pragma pack(pop)
1189#endif
1190
1191#ifdef __MigPackStructs
1192#pragma pack(push, 4)
1193#endif
1194 typedef struct {
1195 mach_msg_header_t Head;
1196 NDR_record_t NDR;
1197 vm_address_t routine_entry_pt;
1198 int routine_number;
1199 } __Request__task_set_emulation_t __attribute__((unused));
1200#ifdef __MigPackStructs
1201#pragma pack(pop)
1202#endif
1203
1204#ifdef __MigPackStructs
1205#pragma pack(push, 4)
1206#endif
1207 typedef struct {
1208 mach_msg_header_t Head;
1209 } __Request__task_get_emulation_vector_t __attribute__((unused));
1210#ifdef __MigPackStructs
1211#pragma pack(pop)
1212#endif
1213
1214#ifdef __MigPackStructs
1215#pragma pack(push, 4)
1216#endif
1217 typedef struct {
1218 mach_msg_header_t Head;
1219 /* start of the kernel processed data */
1220 mach_msg_body_t msgh_body;
1221 mach_msg_ool_descriptor_t emulation_vector;
1222 /* end of the kernel processed data */
1223 NDR_record_t NDR;
1224 int vector_start;
1225 mach_msg_type_number_t emulation_vectorCnt;
1226 } __Request__task_set_emulation_vector_t __attribute__((unused));
1227#ifdef __MigPackStructs
1228#pragma pack(pop)
1229#endif
1230
1231#ifdef __MigPackStructs
1232#pragma pack(push, 4)
1233#endif
1234 typedef struct {
1235 mach_msg_header_t Head;
1236 NDR_record_t NDR;
1237 vm_address_t basepc;
1238 vm_address_t boundspc;
1239 } __Request__task_set_ras_pc_t __attribute__((unused));
1240#ifdef __MigPackStructs
1241#pragma pack(pop)
1242#endif
1243
1244#ifdef __MigPackStructs
1245#pragma pack(push, 4)
1246#endif
1247 typedef struct {
1248 mach_msg_header_t Head;
1249 } __Request__task_zone_info_t __attribute__((unused));
1250#ifdef __MigPackStructs
1251#pragma pack(pop)
1252#endif
1253
1254#ifdef __MigPackStructs
1255#pragma pack(push, 4)
1256#endif
1257 typedef struct {
1258 mach_msg_header_t Head;
1259 /* start of the kernel processed data */
1260 mach_msg_body_t msgh_body;
1261 mach_msg_port_descriptor_t new_set;
1262 /* end of the kernel processed data */
1263 NDR_record_t NDR;
1264 boolean_t assign_threads;
1265 } __Request__task_assign_t __attribute__((unused));
1266#ifdef __MigPackStructs
1267#pragma pack(pop)
1268#endif
1269
1270#ifdef __MigPackStructs
1271#pragma pack(push, 4)
1272#endif
1273 typedef struct {
1274 mach_msg_header_t Head;
1275 NDR_record_t NDR;
1276 boolean_t assign_threads;
1277 } __Request__task_assign_default_t __attribute__((unused));
1278#ifdef __MigPackStructs
1279#pragma pack(pop)
1280#endif
1281
1282#ifdef __MigPackStructs
1283#pragma pack(push, 4)
1284#endif
1285 typedef struct {
1286 mach_msg_header_t Head;
1287 } __Request__task_get_assignment_t __attribute__((unused));
1288#ifdef __MigPackStructs
1289#pragma pack(pop)
1290#endif
1291
1292#ifdef __MigPackStructs
1293#pragma pack(push, 4)
1294#endif
1295 typedef struct {
1296 mach_msg_header_t Head;
1297 /* start of the kernel processed data */
1298 mach_msg_body_t msgh_body;
1299 mach_msg_port_descriptor_t pset;
1300 /* end of the kernel processed data */
1301 NDR_record_t NDR;
1302 policy_t policy;
1303 mach_msg_type_number_t baseCnt;
1304 integer_t base[5];
1305 mach_msg_type_number_t limitCnt;
1306 integer_t limit[1];
1307 boolean_t change;
1308 } __Request__task_set_policy_t __attribute__((unused));
1309#ifdef __MigPackStructs
1310#pragma pack(pop)
1311#endif
1312
1313#ifdef __MigPackStructs
1314#pragma pack(push, 4)
1315#endif
1316 typedef struct {
1317 mach_msg_header_t Head;
1318 NDR_record_t NDR;
1319 thread_state_flavor_t flavor;
1320 mach_msg_type_number_t old_stateCnt;
1321 } __Request__task_get_state_t __attribute__((unused));
1322#ifdef __MigPackStructs
1323#pragma pack(pop)
1324#endif
1325
1326#ifdef __MigPackStructs
1327#pragma pack(push, 4)
1328#endif
1329 typedef struct {
1330 mach_msg_header_t Head;
1331 NDR_record_t NDR;
1332 thread_state_flavor_t flavor;
1333 mach_msg_type_number_t new_stateCnt;
1334 natural_t new_state[614];
1335 } __Request__task_set_state_t __attribute__((unused));
1336#ifdef __MigPackStructs
1337#pragma pack(pop)
1338#endif
1339
1340#ifdef __MigPackStructs
1341#pragma pack(push, 4)
1342#endif
1343 typedef struct {
1344 mach_msg_header_t Head;
1345 NDR_record_t NDR;
1346 int new_limit;
1347 } __Request__task_set_phys_footprint_limit_t __attribute__((unused));
1348#ifdef __MigPackStructs
1349#pragma pack(pop)
1350#endif
1351
1352#ifdef __MigPackStructs
1353#pragma pack(push, 4)
1354#endif
1355 typedef struct {
1356 mach_msg_header_t Head;
1357 } __Request__task_suspend2_t __attribute__((unused));
1358#ifdef __MigPackStructs
1359#pragma pack(pop)
1360#endif
1361
1362#ifdef __MigPackStructs
1363#pragma pack(push, 4)
1364#endif
1365 typedef struct {
1366 mach_msg_header_t Head;
1367 } __Request__task_resume2_t __attribute__((unused));
1368#ifdef __MigPackStructs
1369#pragma pack(pop)
1370#endif
1371
1372#ifdef __MigPackStructs
1373#pragma pack(push, 4)
1374#endif
1375 typedef struct {
1376 mach_msg_header_t Head;
1377 } __Request__task_purgable_info_t __attribute__((unused));
1378#ifdef __MigPackStructs
1379#pragma pack(pop)
1380#endif
1381
1382#ifdef __MigPackStructs
1383#pragma pack(push, 4)
1384#endif
1385 typedef struct {
1386 mach_msg_header_t Head;
1387 NDR_record_t NDR;
1388 mach_voucher_selector_t which;
1389 } __Request__task_get_mach_voucher_t __attribute__((unused));
1390#ifdef __MigPackStructs
1391#pragma pack(pop)
1392#endif
1393
1394#ifdef __MigPackStructs
1395#pragma pack(push, 4)
1396#endif
1397 typedef struct {
1398 mach_msg_header_t Head;
1399 /* start of the kernel processed data */
1400 mach_msg_body_t msgh_body;
1401 mach_msg_port_descriptor_t voucher;
1402 /* end of the kernel processed data */
1403 } __Request__task_set_mach_voucher_t __attribute__((unused));
1404#ifdef __MigPackStructs
1405#pragma pack(pop)
1406#endif
1407
1408#ifdef __MigPackStructs
1409#pragma pack(push, 4)
1410#endif
1411 typedef struct {
1412 mach_msg_header_t Head;
1413 /* start of the kernel processed data */
1414 mach_msg_body_t msgh_body;
1415 mach_msg_port_descriptor_t new_voucher;
1416 mach_msg_port_descriptor_t old_voucher;
1417 /* end of the kernel processed data */
1418 } __Request__task_swap_mach_voucher_t __attribute__((unused));
1419#ifdef __MigPackStructs
1420#pragma pack(pop)
1421#endif
1422
1423#ifdef __MigPackStructs
1424#pragma pack(push, 4)
1425#endif
1426 typedef struct {
1427 mach_msg_header_t Head;
1428 } __Request__task_generate_corpse_t __attribute__((unused));
1429#ifdef __MigPackStructs
1430#pragma pack(pop)
1431#endif
1432
1433#ifdef __MigPackStructs
1434#pragma pack(push, 4)
1435#endif
1436 typedef struct {
1437 mach_msg_header_t Head;
1438 /* start of the kernel processed data */
1439 mach_msg_body_t msgh_body;
1440 mach_msg_port_descriptor_t corspe_task;
1441 /* end of the kernel processed data */
1442 } __Request__task_map_corpse_info_t __attribute__((unused));
1443#ifdef __MigPackStructs
1444#pragma pack(pop)
1445#endif
1446
1447#ifdef __MigPackStructs
1448#pragma pack(push, 4)
1449#endif
1450 typedef struct {
1451 mach_msg_header_t Head;
1452 /* start of the kernel processed data */
1453 mach_msg_body_t msgh_body;
1454 mach_msg_ool_descriptor_t dyld_images;
1455 /* end of the kernel processed data */
1456 NDR_record_t NDR;
1457 mach_msg_type_number_t dyld_imagesCnt;
1458 } __Request__task_register_dyld_image_infos_t __attribute__((unused));
1459#ifdef __MigPackStructs
1460#pragma pack(pop)
1461#endif
1462
1463#ifdef __MigPackStructs
1464#pragma pack(push, 4)
1465#endif
1466 typedef struct {
1467 mach_msg_header_t Head;
1468 /* start of the kernel processed data */
1469 mach_msg_body_t msgh_body;
1470 mach_msg_ool_descriptor_t dyld_images;
1471 /* end of the kernel processed data */
1472 NDR_record_t NDR;
1473 mach_msg_type_number_t dyld_imagesCnt;
1474 } __Request__task_unregister_dyld_image_infos_t __attribute__((unused));
1475#ifdef __MigPackStructs
1476#pragma pack(pop)
1477#endif
1478
1479#ifdef __MigPackStructs
1480#pragma pack(push, 4)
1481#endif
1482 typedef struct {
1483 mach_msg_header_t Head;
1484 } __Request__task_get_dyld_image_infos_t __attribute__((unused));
1485#ifdef __MigPackStructs
1486#pragma pack(pop)
1487#endif
1488
1489#ifdef __MigPackStructs
1490#pragma pack(push, 4)
1491#endif
1492 typedef struct {
1493 mach_msg_header_t Head;
1494 NDR_record_t NDR;
1495 dyld_kernel_image_info_t dyld_cache_image;
1496 boolean_t no_cache;
1497 boolean_t private_cache;
1498 } __Request__task_register_dyld_shared_cache_image_info_t __attribute__((unused));
1499#ifdef __MigPackStructs
1500#pragma pack(pop)
1501#endif
1502
1503#ifdef __MigPackStructs
1504#pragma pack(push, 4)
1505#endif
1506 typedef struct {
1507 mach_msg_header_t Head;
1508 NDR_record_t NDR;
1509 uint8_t dyld_state;
1510 char dyld_statePad[3];
1511 } __Request__task_register_dyld_set_dyld_state_t __attribute__((unused));
1512#ifdef __MigPackStructs
1513#pragma pack(pop)
1514#endif
1515
1516#ifdef __MigPackStructs
1517#pragma pack(push, 4)
1518#endif
1519 typedef struct {
1520 mach_msg_header_t Head;
1521 } __Request__task_register_dyld_get_process_state_t __attribute__((unused));
1522#ifdef __MigPackStructs
1523#pragma pack(pop)
1524#endif
1525
1526#ifdef __MigPackStructs
1527#pragma pack(push, 4)
1528#endif
1529 typedef struct {
1530 mach_msg_header_t Head;
1531 /* start of the kernel processed data */
1532 mach_msg_body_t msgh_body;
1533 mach_msg_port_descriptor_t corspe_task;
1534 /* end of the kernel processed data */
1535 } __Request__task_map_corpse_info_64_t __attribute__((unused));
1536#ifdef __MigPackStructs
1537#pragma pack(pop)
1538#endif
1539
1540#ifdef __MigPackStructs
1541#pragma pack(push, 4)
1542#endif
1543 typedef struct {
1544 mach_msg_header_t Head;
1545 NDR_record_t NDR;
1546 task_inspect_flavor_t flavor;
1547 mach_msg_type_number_t info_outCnt;
1548 } __Request__task_inspect_t __attribute__((unused));
1549#ifdef __MigPackStructs
1550#pragma pack(pop)
1551#endif
1552
1553#ifdef __MigPackStructs
1554#pragma pack(push, 4)
1555#endif
1556 typedef struct {
1557 mach_msg_header_t Head;
1558 } __Request__task_get_exc_guard_behavior_t __attribute__((unused));
1559#ifdef __MigPackStructs
1560#pragma pack(pop)
1561#endif
1562
1563#ifdef __MigPackStructs
1564#pragma pack(push, 4)
1565#endif
1566 typedef struct {
1567 mach_msg_header_t Head;
1568 NDR_record_t NDR;
1569 task_exc_guard_behavior_t behavior;
1570 } __Request__task_set_exc_guard_behavior_t __attribute__((unused));
1571#ifdef __MigPackStructs
1572#pragma pack(pop)
1573#endif
1574
1575#ifdef __MigPackStructs
1576#pragma pack(push, 4)
1577#endif
1578 typedef struct {
1579 mach_msg_header_t Head;
1580 NDR_record_t NDR;
1581 mach_msg_type_number_t pathOffset; /* MiG doesn't use it */
1582 mach_msg_type_number_t pathCnt;
1583 char path[1024];
1584 suid_cred_uid_t uid;
1585 } __Request__task_create_suid_cred_t __attribute__((unused));
1586#ifdef __MigPackStructs
1587#pragma pack(pop)
1588#endif
1589#endif /* !__Request__task_subsystem__defined */
1590
1591/* union of all requests */
1592
1593#ifndef __RequestUnion__task_subsystem__defined
1594#define __RequestUnion__task_subsystem__defined
1595union __RequestUnion__task_subsystem {
1596 __Request__task_create_t Request_task_create;
1597 __Request__task_terminate_t Request_task_terminate;
1598 __Request__task_threads_t Request_task_threads;
1599 __Request__mach_ports_register_t Request_mach_ports_register;
1600 __Request__mach_ports_lookup_t Request_mach_ports_lookup;
1601 __Request__task_info_t Request_task_info;
1602 __Request__task_set_info_t Request_task_set_info;
1603 __Request__task_suspend_t Request_task_suspend;
1604 __Request__task_resume_t Request_task_resume;
1605 __Request__task_get_special_port_t Request_task_get_special_port;
1606 __Request__task_set_special_port_t Request_task_set_special_port;
1607 __Request__thread_create_t Request_thread_create;
1608 __Request__thread_create_running_t Request_thread_create_running;
1609 __Request__task_set_exception_ports_t Request_task_set_exception_ports;
1610 __Request__task_get_exception_ports_t Request_task_get_exception_ports;
1611 __Request__task_swap_exception_ports_t Request_task_swap_exception_ports;
1612 __Request__lock_set_create_t Request_lock_set_create;
1613 __Request__lock_set_destroy_t Request_lock_set_destroy;
1614 __Request__semaphore_create_t Request_semaphore_create;
1615 __Request__semaphore_destroy_t Request_semaphore_destroy;
1616 __Request__task_policy_set_t Request_task_policy_set;
1617 __Request__task_policy_get_t Request_task_policy_get;
1618 __Request__task_sample_t Request_task_sample;
1619 __Request__task_policy_t Request_task_policy;
1620 __Request__task_set_emulation_t Request_task_set_emulation;
1621 __Request__task_get_emulation_vector_t Request_task_get_emulation_vector;
1622 __Request__task_set_emulation_vector_t Request_task_set_emulation_vector;
1623 __Request__task_set_ras_pc_t Request_task_set_ras_pc;
1624 __Request__task_zone_info_t Request_task_zone_info;
1625 __Request__task_assign_t Request_task_assign;
1626 __Request__task_assign_default_t Request_task_assign_default;
1627 __Request__task_get_assignment_t Request_task_get_assignment;
1628 __Request__task_set_policy_t Request_task_set_policy;
1629 __Request__task_get_state_t Request_task_get_state;
1630 __Request__task_set_state_t Request_task_set_state;
1631 __Request__task_set_phys_footprint_limit_t Request_task_set_phys_footprint_limit;
1632 __Request__task_suspend2_t Request_task_suspend2;
1633 __Request__task_resume2_t Request_task_resume2;
1634 __Request__task_purgable_info_t Request_task_purgable_info;
1635 __Request__task_get_mach_voucher_t Request_task_get_mach_voucher;
1636 __Request__task_set_mach_voucher_t Request_task_set_mach_voucher;
1637 __Request__task_swap_mach_voucher_t Request_task_swap_mach_voucher;
1638 __Request__task_generate_corpse_t Request_task_generate_corpse;
1639 __Request__task_map_corpse_info_t Request_task_map_corpse_info;
1640 __Request__task_register_dyld_image_infos_t Request_task_register_dyld_image_infos;
1641 __Request__task_unregister_dyld_image_infos_t Request_task_unregister_dyld_image_infos;
1642 __Request__task_get_dyld_image_infos_t Request_task_get_dyld_image_infos;
1643 __Request__task_register_dyld_shared_cache_image_info_t Request_task_register_dyld_shared_cache_image_info;
1644 __Request__task_register_dyld_set_dyld_state_t Request_task_register_dyld_set_dyld_state;
1645 __Request__task_register_dyld_get_process_state_t Request_task_register_dyld_get_process_state;
1646 __Request__task_map_corpse_info_64_t Request_task_map_corpse_info_64;
1647 __Request__task_inspect_t Request_task_inspect;
1648 __Request__task_get_exc_guard_behavior_t Request_task_get_exc_guard_behavior;
1649 __Request__task_set_exc_guard_behavior_t Request_task_set_exc_guard_behavior;
1650 __Request__task_create_suid_cred_t Request_task_create_suid_cred;
1651};
1652#endif /* !__RequestUnion__task_subsystem__defined */
1653/* typedefs for all replies */
1654
1655#ifndef __Reply__task_subsystem__defined
1656#define __Reply__task_subsystem__defined
1657
1658#ifdef __MigPackStructs
1659#pragma pack(push, 4)
1660#endif
1661 typedef struct {
1662 mach_msg_header_t Head;
1663 /* start of the kernel processed data */
1664 mach_msg_body_t msgh_body;
1665 mach_msg_port_descriptor_t child_task;
1666 /* end of the kernel processed data */
1667 } __Reply__task_create_t __attribute__((unused));
1668#ifdef __MigPackStructs
1669#pragma pack(pop)
1670#endif
1671
1672#ifdef __MigPackStructs
1673#pragma pack(push, 4)
1674#endif
1675 typedef struct {
1676 mach_msg_header_t Head;
1677 NDR_record_t NDR;
1678 kern_return_t RetCode;
1679 } __Reply__task_terminate_t __attribute__((unused));
1680#ifdef __MigPackStructs
1681#pragma pack(pop)
1682#endif
1683
1684#ifdef __MigPackStructs
1685#pragma pack(push, 4)
1686#endif
1687 typedef struct {
1688 mach_msg_header_t Head;
1689 /* start of the kernel processed data */
1690 mach_msg_body_t msgh_body;
1691 mach_msg_ool_ports_descriptor_t act_list;
1692 /* end of the kernel processed data */
1693 NDR_record_t NDR;
1694 mach_msg_type_number_t act_listCnt;
1695 } __Reply__task_threads_t __attribute__((unused));
1696#ifdef __MigPackStructs
1697#pragma pack(pop)
1698#endif
1699
1700#ifdef __MigPackStructs
1701#pragma pack(push, 4)
1702#endif
1703 typedef struct {
1704 mach_msg_header_t Head;
1705 NDR_record_t NDR;
1706 kern_return_t RetCode;
1707 } __Reply__mach_ports_register_t __attribute__((unused));
1708#ifdef __MigPackStructs
1709#pragma pack(pop)
1710#endif
1711
1712#ifdef __MigPackStructs
1713#pragma pack(push, 4)
1714#endif
1715 typedef struct {
1716 mach_msg_header_t Head;
1717 /* start of the kernel processed data */
1718 mach_msg_body_t msgh_body;
1719 mach_msg_ool_ports_descriptor_t init_port_set;
1720 /* end of the kernel processed data */
1721 NDR_record_t NDR;
1722 mach_msg_type_number_t init_port_setCnt;
1723 } __Reply__mach_ports_lookup_t __attribute__((unused));
1724#ifdef __MigPackStructs
1725#pragma pack(pop)
1726#endif
1727
1728#ifdef __MigPackStructs
1729#pragma pack(push, 4)
1730#endif
1731 typedef struct {
1732 mach_msg_header_t Head;
1733 NDR_record_t NDR;
1734 kern_return_t RetCode;
1735 mach_msg_type_number_t task_info_outCnt;
1736 integer_t task_info_out[87];
1737 } __Reply__task_info_t __attribute__((unused));
1738#ifdef __MigPackStructs
1739#pragma pack(pop)
1740#endif
1741
1742#ifdef __MigPackStructs
1743#pragma pack(push, 4)
1744#endif
1745 typedef struct {
1746 mach_msg_header_t Head;
1747 NDR_record_t NDR;
1748 kern_return_t RetCode;
1749 } __Reply__task_set_info_t __attribute__((unused));
1750#ifdef __MigPackStructs
1751#pragma pack(pop)
1752#endif
1753
1754#ifdef __MigPackStructs
1755#pragma pack(push, 4)
1756#endif
1757 typedef struct {
1758 mach_msg_header_t Head;
1759 NDR_record_t NDR;
1760 kern_return_t RetCode;
1761 } __Reply__task_suspend_t __attribute__((unused));
1762#ifdef __MigPackStructs
1763#pragma pack(pop)
1764#endif
1765
1766#ifdef __MigPackStructs
1767#pragma pack(push, 4)
1768#endif
1769 typedef struct {
1770 mach_msg_header_t Head;
1771 NDR_record_t NDR;
1772 kern_return_t RetCode;
1773 } __Reply__task_resume_t __attribute__((unused));
1774#ifdef __MigPackStructs
1775#pragma pack(pop)
1776#endif
1777
1778#ifdef __MigPackStructs
1779#pragma pack(push, 4)
1780#endif
1781 typedef struct {
1782 mach_msg_header_t Head;
1783 /* start of the kernel processed data */
1784 mach_msg_body_t msgh_body;
1785 mach_msg_port_descriptor_t special_port;
1786 /* end of the kernel processed data */
1787 } __Reply__task_get_special_port_t __attribute__((unused));
1788#ifdef __MigPackStructs
1789#pragma pack(pop)
1790#endif
1791
1792#ifdef __MigPackStructs
1793#pragma pack(push, 4)
1794#endif
1795 typedef struct {
1796 mach_msg_header_t Head;
1797 NDR_record_t NDR;
1798 kern_return_t RetCode;
1799 } __Reply__task_set_special_port_t __attribute__((unused));
1800#ifdef __MigPackStructs
1801#pragma pack(pop)
1802#endif
1803
1804#ifdef __MigPackStructs
1805#pragma pack(push, 4)
1806#endif
1807 typedef struct {
1808 mach_msg_header_t Head;
1809 /* start of the kernel processed data */
1810 mach_msg_body_t msgh_body;
1811 mach_msg_port_descriptor_t child_act;
1812 /* end of the kernel processed data */
1813 } __Reply__thread_create_t __attribute__((unused));
1814#ifdef __MigPackStructs
1815#pragma pack(pop)
1816#endif
1817
1818#ifdef __MigPackStructs
1819#pragma pack(push, 4)
1820#endif
1821 typedef struct {
1822 mach_msg_header_t Head;
1823 /* start of the kernel processed data */
1824 mach_msg_body_t msgh_body;
1825 mach_msg_port_descriptor_t child_act;
1826 /* end of the kernel processed data */
1827 } __Reply__thread_create_running_t __attribute__((unused));
1828#ifdef __MigPackStructs
1829#pragma pack(pop)
1830#endif
1831
1832#ifdef __MigPackStructs
1833#pragma pack(push, 4)
1834#endif
1835 typedef struct {
1836 mach_msg_header_t Head;
1837 NDR_record_t NDR;
1838 kern_return_t RetCode;
1839 } __Reply__task_set_exception_ports_t __attribute__((unused));
1840#ifdef __MigPackStructs
1841#pragma pack(pop)
1842#endif
1843
1844#ifdef __MigPackStructs
1845#pragma pack(push, 4)
1846#endif
1847 typedef struct {
1848 mach_msg_header_t Head;
1849 /* start of the kernel processed data */
1850 mach_msg_body_t msgh_body;
1851 mach_msg_port_descriptor_t old_handlers[32];
1852 /* end of the kernel processed data */
1853 NDR_record_t NDR;
1854 mach_msg_type_number_t masksCnt;
1855 exception_mask_t masks[32];
1856 exception_behavior_t old_behaviors[32];
1857 thread_state_flavor_t old_flavors[32];
1858 } __Reply__task_get_exception_ports_t __attribute__((unused));
1859#ifdef __MigPackStructs
1860#pragma pack(pop)
1861#endif
1862
1863#ifdef __MigPackStructs
1864#pragma pack(push, 4)
1865#endif
1866 typedef struct {
1867 mach_msg_header_t Head;
1868 /* start of the kernel processed data */
1869 mach_msg_body_t msgh_body;
1870 mach_msg_port_descriptor_t old_handlerss[32];
1871 /* end of the kernel processed data */
1872 NDR_record_t NDR;
1873 mach_msg_type_number_t masksCnt;
1874 exception_mask_t masks[32];
1875 exception_behavior_t old_behaviors[32];
1876 thread_state_flavor_t old_flavors[32];
1877 } __Reply__task_swap_exception_ports_t __attribute__((unused));
1878#ifdef __MigPackStructs
1879#pragma pack(pop)
1880#endif
1881
1882#ifdef __MigPackStructs
1883#pragma pack(push, 4)
1884#endif
1885 typedef struct {
1886 mach_msg_header_t Head;
1887 /* start of the kernel processed data */
1888 mach_msg_body_t msgh_body;
1889 mach_msg_port_descriptor_t new_lock_set;
1890 /* end of the kernel processed data */
1891 } __Reply__lock_set_create_t __attribute__((unused));
1892#ifdef __MigPackStructs
1893#pragma pack(pop)
1894#endif
1895
1896#ifdef __MigPackStructs
1897#pragma pack(push, 4)
1898#endif
1899 typedef struct {
1900 mach_msg_header_t Head;
1901 NDR_record_t NDR;
1902 kern_return_t RetCode;
1903 } __Reply__lock_set_destroy_t __attribute__((unused));
1904#ifdef __MigPackStructs
1905#pragma pack(pop)
1906#endif
1907
1908#ifdef __MigPackStructs
1909#pragma pack(push, 4)
1910#endif
1911 typedef struct {
1912 mach_msg_header_t Head;
1913 /* start of the kernel processed data */
1914 mach_msg_body_t msgh_body;
1915 mach_msg_port_descriptor_t semaphore;
1916 /* end of the kernel processed data */
1917 } __Reply__semaphore_create_t __attribute__((unused));
1918#ifdef __MigPackStructs
1919#pragma pack(pop)
1920#endif
1921
1922#ifdef __MigPackStructs
1923#pragma pack(push, 4)
1924#endif
1925 typedef struct {
1926 mach_msg_header_t Head;
1927 NDR_record_t NDR;
1928 kern_return_t RetCode;
1929 } __Reply__semaphore_destroy_t __attribute__((unused));
1930#ifdef __MigPackStructs
1931#pragma pack(pop)
1932#endif
1933
1934#ifdef __MigPackStructs
1935#pragma pack(push, 4)
1936#endif
1937 typedef struct {
1938 mach_msg_header_t Head;
1939 NDR_record_t NDR;
1940 kern_return_t RetCode;
1941 } __Reply__task_policy_set_t __attribute__((unused));
1942#ifdef __MigPackStructs
1943#pragma pack(pop)
1944#endif
1945
1946#ifdef __MigPackStructs
1947#pragma pack(push, 4)
1948#endif
1949 typedef struct {
1950 mach_msg_header_t Head;
1951 NDR_record_t NDR;
1952 kern_return_t RetCode;
1953 mach_msg_type_number_t policy_infoCnt;
1954 integer_t policy_info[16];
1955 boolean_t get_default;
1956 } __Reply__task_policy_get_t __attribute__((unused));
1957#ifdef __MigPackStructs
1958#pragma pack(pop)
1959#endif
1960
1961#ifdef __MigPackStructs
1962#pragma pack(push, 4)
1963#endif
1964 typedef struct {
1965 mach_msg_header_t Head;
1966 NDR_record_t NDR;
1967 kern_return_t RetCode;
1968 } __Reply__task_sample_t __attribute__((unused));
1969#ifdef __MigPackStructs
1970#pragma pack(pop)
1971#endif
1972
1973#ifdef __MigPackStructs
1974#pragma pack(push, 4)
1975#endif
1976 typedef struct {
1977 mach_msg_header_t Head;
1978 NDR_record_t NDR;
1979 kern_return_t RetCode;
1980 } __Reply__task_policy_t __attribute__((unused));
1981#ifdef __MigPackStructs
1982#pragma pack(pop)
1983#endif
1984
1985#ifdef __MigPackStructs
1986#pragma pack(push, 4)
1987#endif
1988 typedef struct {
1989 mach_msg_header_t Head;
1990 NDR_record_t NDR;
1991 kern_return_t RetCode;
1992 } __Reply__task_set_emulation_t __attribute__((unused));
1993#ifdef __MigPackStructs
1994#pragma pack(pop)
1995#endif
1996
1997#ifdef __MigPackStructs
1998#pragma pack(push, 4)
1999#endif
2000 typedef struct {
2001 mach_msg_header_t Head;
2002 /* start of the kernel processed data */
2003 mach_msg_body_t msgh_body;
2004 mach_msg_ool_descriptor_t emulation_vector;
2005 /* end of the kernel processed data */
2006 NDR_record_t NDR;
2007 int vector_start;
2008 mach_msg_type_number_t emulation_vectorCnt;
2009 } __Reply__task_get_emulation_vector_t __attribute__((unused));
2010#ifdef __MigPackStructs
2011#pragma pack(pop)
2012#endif
2013
2014#ifdef __MigPackStructs
2015#pragma pack(push, 4)
2016#endif
2017 typedef struct {
2018 mach_msg_header_t Head;
2019 NDR_record_t NDR;
2020 kern_return_t RetCode;
2021 } __Reply__task_set_emulation_vector_t __attribute__((unused));
2022#ifdef __MigPackStructs
2023#pragma pack(pop)
2024#endif
2025
2026#ifdef __MigPackStructs
2027#pragma pack(push, 4)
2028#endif
2029 typedef struct {
2030 mach_msg_header_t Head;
2031 NDR_record_t NDR;
2032 kern_return_t RetCode;
2033 } __Reply__task_set_ras_pc_t __attribute__((unused));
2034#ifdef __MigPackStructs
2035#pragma pack(pop)
2036#endif
2037
2038#ifdef __MigPackStructs
2039#pragma pack(push, 4)
2040#endif
2041 typedef struct {
2042 mach_msg_header_t Head;
2043 /* start of the kernel processed data */
2044 mach_msg_body_t msgh_body;
2045 mach_msg_ool_descriptor_t names;
2046 mach_msg_ool_descriptor_t info;
2047 /* end of the kernel processed data */
2048 NDR_record_t NDR;
2049 mach_msg_type_number_t namesCnt;
2050 mach_msg_type_number_t infoCnt;
2051 } __Reply__task_zone_info_t __attribute__((unused));
2052#ifdef __MigPackStructs
2053#pragma pack(pop)
2054#endif
2055
2056#ifdef __MigPackStructs
2057#pragma pack(push, 4)
2058#endif
2059 typedef struct {
2060 mach_msg_header_t Head;
2061 NDR_record_t NDR;
2062 kern_return_t RetCode;
2063 } __Reply__task_assign_t __attribute__((unused));
2064#ifdef __MigPackStructs
2065#pragma pack(pop)
2066#endif
2067
2068#ifdef __MigPackStructs
2069#pragma pack(push, 4)
2070#endif
2071 typedef struct {
2072 mach_msg_header_t Head;
2073 NDR_record_t NDR;
2074 kern_return_t RetCode;
2075 } __Reply__task_assign_default_t __attribute__((unused));
2076#ifdef __MigPackStructs
2077#pragma pack(pop)
2078#endif
2079
2080#ifdef __MigPackStructs
2081#pragma pack(push, 4)
2082#endif
2083 typedef struct {
2084 mach_msg_header_t Head;
2085 /* start of the kernel processed data */
2086 mach_msg_body_t msgh_body;
2087 mach_msg_port_descriptor_t assigned_set;
2088 /* end of the kernel processed data */
2089 } __Reply__task_get_assignment_t __attribute__((unused));
2090#ifdef __MigPackStructs
2091#pragma pack(pop)
2092#endif
2093
2094#ifdef __MigPackStructs
2095#pragma pack(push, 4)
2096#endif
2097 typedef struct {
2098 mach_msg_header_t Head;
2099 NDR_record_t NDR;
2100 kern_return_t RetCode;
2101 } __Reply__task_set_policy_t __attribute__((unused));
2102#ifdef __MigPackStructs
2103#pragma pack(pop)
2104#endif
2105
2106#ifdef __MigPackStructs
2107#pragma pack(push, 4)
2108#endif
2109 typedef struct {
2110 mach_msg_header_t Head;
2111 NDR_record_t NDR;
2112 kern_return_t RetCode;
2113 mach_msg_type_number_t old_stateCnt;
2114 natural_t old_state[614];
2115 } __Reply__task_get_state_t __attribute__((unused));
2116#ifdef __MigPackStructs
2117#pragma pack(pop)
2118#endif
2119
2120#ifdef __MigPackStructs
2121#pragma pack(push, 4)
2122#endif
2123 typedef struct {
2124 mach_msg_header_t Head;
2125 NDR_record_t NDR;
2126 kern_return_t RetCode;
2127 } __Reply__task_set_state_t __attribute__((unused));
2128#ifdef __MigPackStructs
2129#pragma pack(pop)
2130#endif
2131
2132#ifdef __MigPackStructs
2133#pragma pack(push, 4)
2134#endif
2135 typedef struct {
2136 mach_msg_header_t Head;
2137 NDR_record_t NDR;
2138 kern_return_t RetCode;
2139 int old_limit;
2140 } __Reply__task_set_phys_footprint_limit_t __attribute__((unused));
2141#ifdef __MigPackStructs
2142#pragma pack(pop)
2143#endif
2144
2145#ifdef __MigPackStructs
2146#pragma pack(push, 4)
2147#endif
2148 typedef struct {
2149 mach_msg_header_t Head;
2150 /* start of the kernel processed data */
2151 mach_msg_body_t msgh_body;
2152 mach_msg_port_descriptor_t suspend_token;
2153 /* end of the kernel processed data */
2154 } __Reply__task_suspend2_t __attribute__((unused));
2155#ifdef __MigPackStructs
2156#pragma pack(pop)
2157#endif
2158
2159#ifdef __MigPackStructs
2160#pragma pack(push, 4)
2161#endif
2162 typedef struct {
2163 mach_msg_header_t Head;
2164 NDR_record_t NDR;
2165 kern_return_t RetCode;
2166 } __Reply__task_resume2_t __attribute__((unused));
2167#ifdef __MigPackStructs
2168#pragma pack(pop)
2169#endif
2170
2171#ifdef __MigPackStructs
2172#pragma pack(push, 4)
2173#endif
2174 typedef struct {
2175 mach_msg_header_t Head;
2176 NDR_record_t NDR;
2177 kern_return_t RetCode;
2178 task_purgable_info_t stats;
2179 } __Reply__task_purgable_info_t __attribute__((unused));
2180#ifdef __MigPackStructs
2181#pragma pack(pop)
2182#endif
2183
2184#ifdef __MigPackStructs
2185#pragma pack(push, 4)
2186#endif
2187 typedef struct {
2188 mach_msg_header_t Head;
2189 /* start of the kernel processed data */
2190 mach_msg_body_t msgh_body;
2191 mach_msg_port_descriptor_t voucher;
2192 /* end of the kernel processed data */
2193 } __Reply__task_get_mach_voucher_t __attribute__((unused));
2194#ifdef __MigPackStructs
2195#pragma pack(pop)
2196#endif
2197
2198#ifdef __MigPackStructs
2199#pragma pack(push, 4)
2200#endif
2201 typedef struct {
2202 mach_msg_header_t Head;
2203 NDR_record_t NDR;
2204 kern_return_t RetCode;
2205 } __Reply__task_set_mach_voucher_t __attribute__((unused));
2206#ifdef __MigPackStructs
2207#pragma pack(pop)
2208#endif
2209
2210#ifdef __MigPackStructs
2211#pragma pack(push, 4)
2212#endif
2213 typedef struct {
2214 mach_msg_header_t Head;
2215 /* start of the kernel processed data */
2216 mach_msg_body_t msgh_body;
2217 mach_msg_port_descriptor_t old_voucher;
2218 /* end of the kernel processed data */
2219 } __Reply__task_swap_mach_voucher_t __attribute__((unused));
2220#ifdef __MigPackStructs
2221#pragma pack(pop)
2222#endif
2223
2224#ifdef __MigPackStructs
2225#pragma pack(push, 4)
2226#endif
2227 typedef struct {
2228 mach_msg_header_t Head;
2229 /* start of the kernel processed data */
2230 mach_msg_body_t msgh_body;
2231 mach_msg_port_descriptor_t corpse_task_port;
2232 /* end of the kernel processed data */
2233 } __Reply__task_generate_corpse_t __attribute__((unused));
2234#ifdef __MigPackStructs
2235#pragma pack(pop)
2236#endif
2237
2238#ifdef __MigPackStructs
2239#pragma pack(push, 4)
2240#endif
2241 typedef struct {
2242 mach_msg_header_t Head;
2243 NDR_record_t NDR;
2244 kern_return_t RetCode;
2245 vm_address_t kcd_addr_begin;
2246 uint32_t kcd_size;
2247 } __Reply__task_map_corpse_info_t __attribute__((unused));
2248#ifdef __MigPackStructs
2249#pragma pack(pop)
2250#endif
2251
2252#ifdef __MigPackStructs
2253#pragma pack(push, 4)
2254#endif
2255 typedef struct {
2256 mach_msg_header_t Head;
2257 NDR_record_t NDR;
2258 kern_return_t RetCode;
2259 } __Reply__task_register_dyld_image_infos_t __attribute__((unused));
2260#ifdef __MigPackStructs
2261#pragma pack(pop)
2262#endif
2263
2264#ifdef __MigPackStructs
2265#pragma pack(push, 4)
2266#endif
2267 typedef struct {
2268 mach_msg_header_t Head;
2269 NDR_record_t NDR;
2270 kern_return_t RetCode;
2271 } __Reply__task_unregister_dyld_image_infos_t __attribute__((unused));
2272#ifdef __MigPackStructs
2273#pragma pack(pop)
2274#endif
2275
2276#ifdef __MigPackStructs
2277#pragma pack(push, 4)
2278#endif
2279 typedef struct {
2280 mach_msg_header_t Head;
2281 /* start of the kernel processed data */
2282 mach_msg_body_t msgh_body;
2283 mach_msg_ool_descriptor_t dyld_images;
2284 /* end of the kernel processed data */
2285 NDR_record_t NDR;
2286 mach_msg_type_number_t dyld_imagesCnt;
2287 } __Reply__task_get_dyld_image_infos_t __attribute__((unused));
2288#ifdef __MigPackStructs
2289#pragma pack(pop)
2290#endif
2291
2292#ifdef __MigPackStructs
2293#pragma pack(push, 4)
2294#endif
2295 typedef struct {
2296 mach_msg_header_t Head;
2297 NDR_record_t NDR;
2298 kern_return_t RetCode;
2299 } __Reply__task_register_dyld_shared_cache_image_info_t __attribute__((unused));
2300#ifdef __MigPackStructs
2301#pragma pack(pop)
2302#endif
2303
2304#ifdef __MigPackStructs
2305#pragma pack(push, 4)
2306#endif
2307 typedef struct {
2308 mach_msg_header_t Head;
2309 NDR_record_t NDR;
2310 kern_return_t RetCode;
2311 } __Reply__task_register_dyld_set_dyld_state_t __attribute__((unused));
2312#ifdef __MigPackStructs
2313#pragma pack(pop)
2314#endif
2315
2316#ifdef __MigPackStructs
2317#pragma pack(push, 4)
2318#endif
2319 typedef struct {
2320 mach_msg_header_t Head;
2321 NDR_record_t NDR;
2322 kern_return_t RetCode;
2323 dyld_kernel_process_info_t dyld_process_state;
2324 } __Reply__task_register_dyld_get_process_state_t __attribute__((unused));
2325#ifdef __MigPackStructs
2326#pragma pack(pop)
2327#endif
2328
2329#ifdef __MigPackStructs
2330#pragma pack(push, 4)
2331#endif
2332 typedef struct {
2333 mach_msg_header_t Head;
2334 NDR_record_t NDR;
2335 kern_return_t RetCode;
2336 mach_vm_address_t kcd_addr_begin;
2337 mach_vm_size_t kcd_size;
2338 } __Reply__task_map_corpse_info_64_t __attribute__((unused));
2339#ifdef __MigPackStructs
2340#pragma pack(pop)
2341#endif
2342
2343#ifdef __MigPackStructs
2344#pragma pack(push, 4)
2345#endif
2346 typedef struct {
2347 mach_msg_header_t Head;
2348 NDR_record_t NDR;
2349 kern_return_t RetCode;
2350 mach_msg_type_number_t info_outCnt;
2351 integer_t info_out[4];
2352 } __Reply__task_inspect_t __attribute__((unused));
2353#ifdef __MigPackStructs
2354#pragma pack(pop)
2355#endif
2356
2357#ifdef __MigPackStructs
2358#pragma pack(push, 4)
2359#endif
2360 typedef struct {
2361 mach_msg_header_t Head;
2362 NDR_record_t NDR;
2363 kern_return_t RetCode;
2364 task_exc_guard_behavior_t behavior;
2365 } __Reply__task_get_exc_guard_behavior_t __attribute__((unused));
2366#ifdef __MigPackStructs
2367#pragma pack(pop)
2368#endif
2369
2370#ifdef __MigPackStructs
2371#pragma pack(push, 4)
2372#endif
2373 typedef struct {
2374 mach_msg_header_t Head;
2375 NDR_record_t NDR;
2376 kern_return_t RetCode;
2377 } __Reply__task_set_exc_guard_behavior_t __attribute__((unused));
2378#ifdef __MigPackStructs
2379#pragma pack(pop)
2380#endif
2381
2382#ifdef __MigPackStructs
2383#pragma pack(push, 4)
2384#endif
2385 typedef struct {
2386 mach_msg_header_t Head;
2387 /* start of the kernel processed data */
2388 mach_msg_body_t msgh_body;
2389 mach_msg_port_descriptor_t delegation;
2390 /* end of the kernel processed data */
2391 } __Reply__task_create_suid_cred_t __attribute__((unused));
2392#ifdef __MigPackStructs
2393#pragma pack(pop)
2394#endif
2395#endif /* !__Reply__task_subsystem__defined */
2396
2397/* union of all replies */
2398
2399#ifndef __ReplyUnion__task_subsystem__defined
2400#define __ReplyUnion__task_subsystem__defined
2401union __ReplyUnion__task_subsystem {
2402 __Reply__task_create_t Reply_task_create;
2403 __Reply__task_terminate_t Reply_task_terminate;
2404 __Reply__task_threads_t Reply_task_threads;
2405 __Reply__mach_ports_register_t Reply_mach_ports_register;
2406 __Reply__mach_ports_lookup_t Reply_mach_ports_lookup;
2407 __Reply__task_info_t Reply_task_info;
2408 __Reply__task_set_info_t Reply_task_set_info;
2409 __Reply__task_suspend_t Reply_task_suspend;
2410 __Reply__task_resume_t Reply_task_resume;
2411 __Reply__task_get_special_port_t Reply_task_get_special_port;
2412 __Reply__task_set_special_port_t Reply_task_set_special_port;
2413 __Reply__thread_create_t Reply_thread_create;
2414 __Reply__thread_create_running_t Reply_thread_create_running;
2415 __Reply__task_set_exception_ports_t Reply_task_set_exception_ports;
2416 __Reply__task_get_exception_ports_t Reply_task_get_exception_ports;
2417 __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports;
2418 __Reply__lock_set_create_t Reply_lock_set_create;
2419 __Reply__lock_set_destroy_t Reply_lock_set_destroy;
2420 __Reply__semaphore_create_t Reply_semaphore_create;
2421 __Reply__semaphore_destroy_t Reply_semaphore_destroy;
2422 __Reply__task_policy_set_t Reply_task_policy_set;
2423 __Reply__task_policy_get_t Reply_task_policy_get;
2424 __Reply__task_sample_t Reply_task_sample;
2425 __Reply__task_policy_t Reply_task_policy;
2426 __Reply__task_set_emulation_t Reply_task_set_emulation;
2427 __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector;
2428 __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector;
2429 __Reply__task_set_ras_pc_t Reply_task_set_ras_pc;
2430 __Reply__task_zone_info_t Reply_task_zone_info;
2431 __Reply__task_assign_t Reply_task_assign;
2432 __Reply__task_assign_default_t Reply_task_assign_default;
2433 __Reply__task_get_assignment_t Reply_task_get_assignment;
2434 __Reply__task_set_policy_t Reply_task_set_policy;
2435 __Reply__task_get_state_t Reply_task_get_state;
2436 __Reply__task_set_state_t Reply_task_set_state;
2437 __Reply__task_set_phys_footprint_limit_t Reply_task_set_phys_footprint_limit;
2438 __Reply__task_suspend2_t Reply_task_suspend2;
2439 __Reply__task_resume2_t Reply_task_resume2;
2440 __Reply__task_purgable_info_t Reply_task_purgable_info;
2441 __Reply__task_get_mach_voucher_t Reply_task_get_mach_voucher;
2442 __Reply__task_set_mach_voucher_t Reply_task_set_mach_voucher;
2443 __Reply__task_swap_mach_voucher_t Reply_task_swap_mach_voucher;
2444 __Reply__task_generate_corpse_t Reply_task_generate_corpse;
2445 __Reply__task_map_corpse_info_t Reply_task_map_corpse_info;
2446 __Reply__task_register_dyld_image_infos_t Reply_task_register_dyld_image_infos;
2447 __Reply__task_unregister_dyld_image_infos_t Reply_task_unregister_dyld_image_infos;
2448 __Reply__task_get_dyld_image_infos_t Reply_task_get_dyld_image_infos;
2449 __Reply__task_register_dyld_shared_cache_image_info_t Reply_task_register_dyld_shared_cache_image_info;
2450 __Reply__task_register_dyld_set_dyld_state_t Reply_task_register_dyld_set_dyld_state;
2451 __Reply__task_register_dyld_get_process_state_t Reply_task_register_dyld_get_process_state;
2452 __Reply__task_map_corpse_info_64_t Reply_task_map_corpse_info_64;
2453 __Reply__task_inspect_t Reply_task_inspect;
2454 __Reply__task_get_exc_guard_behavior_t Reply_task_get_exc_guard_behavior;
2455 __Reply__task_set_exc_guard_behavior_t Reply_task_set_exc_guard_behavior;
2456 __Reply__task_create_suid_cred_t Reply_task_create_suid_cred;
2457};
2458#endif /* !__RequestUnion__task_subsystem__defined */
2459
2460#ifndef subsystem_to_name_map_task
2461#define subsystem_to_name_map_task \
2462 { "task_create", 3400 },\
2463 { "task_terminate", 3401 },\
2464 { "task_threads", 3402 },\
2465 { "mach_ports_register", 3403 },\
2466 { "mach_ports_lookup", 3404 },\
2467 { "task_info", 3405 },\
2468 { "task_set_info", 3406 },\
2469 { "task_suspend", 3407 },\
2470 { "task_resume", 3408 },\
2471 { "task_get_special_port", 3409 },\
2472 { "task_set_special_port", 3410 },\
2473 { "thread_create", 3411 },\
2474 { "thread_create_running", 3412 },\
2475 { "task_set_exception_ports", 3413 },\
2476 { "task_get_exception_ports", 3414 },\
2477 { "task_swap_exception_ports", 3415 },\
2478 { "lock_set_create", 3416 },\
2479 { "lock_set_destroy", 3417 },\
2480 { "semaphore_create", 3418 },\
2481 { "semaphore_destroy", 3419 },\
2482 { "task_policy_set", 3420 },\
2483 { "task_policy_get", 3421 },\
2484 { "task_sample", 3422 },\
2485 { "task_policy", 3423 },\
2486 { "task_set_emulation", 3424 },\
2487 { "task_get_emulation_vector", 3425 },\
2488 { "task_set_emulation_vector", 3426 },\
2489 { "task_set_ras_pc", 3427 },\
2490 { "task_zone_info", 3428 },\
2491 { "task_assign", 3429 },\
2492 { "task_assign_default", 3430 },\
2493 { "task_get_assignment", 3431 },\
2494 { "task_set_policy", 3432 },\
2495 { "task_get_state", 3433 },\
2496 { "task_set_state", 3434 },\
2497 { "task_set_phys_footprint_limit", 3435 },\
2498 { "task_suspend2", 3436 },\
2499 { "task_resume2", 3437 },\
2500 { "task_purgable_info", 3438 },\
2501 { "task_get_mach_voucher", 3439 },\
2502 { "task_set_mach_voucher", 3440 },\
2503 { "task_swap_mach_voucher", 3441 },\
2504 { "task_generate_corpse", 3442 },\
2505 { "task_map_corpse_info", 3443 },\
2506 { "task_register_dyld_image_infos", 3444 },\
2507 { "task_unregister_dyld_image_infos", 3445 },\
2508 { "task_get_dyld_image_infos", 3446 },\
2509 { "task_register_dyld_shared_cache_image_info", 3447 },\
2510 { "task_register_dyld_set_dyld_state", 3448 },\
2511 { "task_register_dyld_get_process_state", 3449 },\
2512 { "task_map_corpse_info_64", 3450 },\
2513 { "task_inspect", 3451 },\
2514 { "task_get_exc_guard_behavior", 3452 },\
2515 { "task_set_exc_guard_behavior", 3453 },\
2516 { "task_create_suid_cred", 3454 }
2517#endif
2518
2519#ifdef __AfterMigUserHeader
2520__AfterMigUserHeader
2521#endif /* __AfterMigUserHeader */
2522
2523#endif /* _task_user_ */
lib/libc/include/x86_64-macos-gnu/mach/task_info.h created+478
...@@ -0,0 +1,478 @@
1/*
2 * Copyright (c) 2000-2007, 2015 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 * Machine-independent task information structures and definitions.
58 *
59 * The definitions in this file are exported to the user. The kernel
60 * will translate its internal data structures to these structures
61 * as appropriate.
62 *
63 */
64
65#ifndef _MACH_TASK_INFO_H_
66#define _MACH_TASK_INFO_H_
67
68#include <mach/message.h>
69#include <mach/machine/vm_types.h>
70#include <mach/time_value.h>
71#include <mach/policy.h>
72#include <mach/vm_statistics.h> /* for vm_extmod_statistics_data_t */
73#include <Availability.h>
74
75#include <sys/cdefs.h>
76
77/*
78 * Generic information structure to allow for expansion.
79 */
80typedef natural_t task_flavor_t;
81typedef integer_t *task_info_t; /* varying array of int */
82
83/* Deprecated, use per structure _data_t's instead */
84#define TASK_INFO_MAX (1024) /* maximum array size */
85typedef integer_t task_info_data_t[TASK_INFO_MAX];
86
87/*
88 * Currently defined information structures.
89 */
90
91#pragma pack(push, 4)
92
93/* Don't use this, use MACH_TASK_BASIC_INFO instead */
94#define TASK_BASIC_INFO_32 4 /* basic information */
95#define TASK_BASIC2_INFO_32 6
96
97struct task_basic_info_32 {
98 integer_t suspend_count; /* suspend count for task */
99 natural_t virtual_size; /* virtual memory size (bytes) */
100 natural_t resident_size; /* resident memory size (bytes) */
101 time_value_t user_time; /* total user run time for
102 * terminated threads */
103 time_value_t system_time; /* total system run time for
104 * terminated threads */
105 policy_t policy; /* default policy for new threads */
106};
107typedef struct task_basic_info_32 task_basic_info_32_data_t;
108typedef struct task_basic_info_32 *task_basic_info_32_t;
109#define TASK_BASIC_INFO_32_COUNT \
110 (sizeof(task_basic_info_32_data_t) / sizeof(natural_t))
111
112/* Don't use this, use MACH_TASK_BASIC_INFO instead */
113struct task_basic_info_64 {
114 integer_t suspend_count; /* suspend count for task */
115 mach_vm_size_t virtual_size; /* virtual memory size (bytes) */
116 mach_vm_size_t resident_size; /* resident memory size (bytes) */
117 time_value_t user_time; /* total user run time for
118 * terminated threads */
119 time_value_t system_time; /* total system run time for
120 * terminated threads */
121 policy_t policy; /* default policy for new threads */
122};
123typedef struct task_basic_info_64 task_basic_info_64_data_t;
124typedef struct task_basic_info_64 *task_basic_info_64_t;
125
126#define TASK_BASIC_INFO_64 5 /* 64-bit capable basic info */
127#define TASK_BASIC_INFO_64_COUNT \
128 (sizeof(task_basic_info_64_data_t) / sizeof(natural_t))
129
130
131/* localized structure - cannot be safely passed between tasks of differing sizes */
132/* Don't use this, use MACH_TASK_BASIC_INFO instead */
133struct task_basic_info {
134 integer_t suspend_count; /* suspend count for task */
135 vm_size_t virtual_size; /* virtual memory size (bytes) */
136 vm_size_t resident_size; /* resident memory size (bytes) */
137 time_value_t user_time; /* total user run time for
138 * terminated threads */
139 time_value_t system_time; /* total system run time for
140 * terminated threads */
141 policy_t policy; /* default policy for new threads */
142};
143
144typedef struct task_basic_info task_basic_info_data_t;
145typedef struct task_basic_info *task_basic_info_t;
146#define TASK_BASIC_INFO_COUNT \
147 (sizeof(task_basic_info_data_t) / sizeof(natural_t))
148#if !defined(__LP64__)
149#define TASK_BASIC_INFO TASK_BASIC_INFO_32
150#else
151#define TASK_BASIC_INFO TASK_BASIC_INFO_64
152#endif
153
154
155
156#define TASK_EVENTS_INFO 2 /* various event counts */
157
158struct task_events_info {
159 integer_t faults; /* number of page faults */
160 integer_t pageins; /* number of actual pageins */
161 integer_t cow_faults; /* number of copy-on-write faults */
162 integer_t messages_sent; /* number of messages sent */
163 integer_t messages_received; /* number of messages received */
164 integer_t syscalls_mach; /* number of mach system calls */
165 integer_t syscalls_unix; /* number of unix system calls */
166 integer_t csw; /* number of context switches */
167};
168typedef struct task_events_info task_events_info_data_t;
169typedef struct task_events_info *task_events_info_t;
170#define TASK_EVENTS_INFO_COUNT ((mach_msg_type_number_t) \
171 (sizeof(task_events_info_data_t) / sizeof(natural_t)))
172
173#define TASK_THREAD_TIMES_INFO 3 /* total times for live threads -
174 * only accurate if suspended */
175
176struct task_thread_times_info {
177 time_value_t user_time; /* total user run time for
178 * live threads */
179 time_value_t system_time; /* total system run time for
180 * live threads */
181};
182
183typedef struct task_thread_times_info task_thread_times_info_data_t;
184typedef struct task_thread_times_info *task_thread_times_info_t;
185#define TASK_THREAD_TIMES_INFO_COUNT ((mach_msg_type_number_t) \
186 (sizeof(task_thread_times_info_data_t) / sizeof(natural_t)))
187
188#define TASK_ABSOLUTETIME_INFO 1
189
190struct task_absolutetime_info {
191 uint64_t total_user;
192 uint64_t total_system;
193 uint64_t threads_user; /* existing threads only */
194 uint64_t threads_system;
195};
196
197typedef struct task_absolutetime_info task_absolutetime_info_data_t;
198typedef struct task_absolutetime_info *task_absolutetime_info_t;
199#define TASK_ABSOLUTETIME_INFO_COUNT ((mach_msg_type_number_t) \
200 (sizeof (task_absolutetime_info_data_t) / sizeof (natural_t)))
201
202#define TASK_KERNELMEMORY_INFO 7
203
204struct task_kernelmemory_info {
205 uint64_t total_palloc; /* private kernel mem alloc'ed */
206 uint64_t total_pfree; /* private kernel mem freed */
207 uint64_t total_salloc; /* shared kernel mem alloc'ed */
208 uint64_t total_sfree; /* shared kernel mem freed */
209};
210
211typedef struct task_kernelmemory_info task_kernelmemory_info_data_t;
212typedef struct task_kernelmemory_info *task_kernelmemory_info_t;
213#define TASK_KERNELMEMORY_INFO_COUNT ((mach_msg_type_number_t) \
214 (sizeof (task_kernelmemory_info_data_t) / sizeof (natural_t)))
215
216#define TASK_SECURITY_TOKEN 13
217#define TASK_SECURITY_TOKEN_COUNT ((mach_msg_type_number_t) \
218 (sizeof(security_token_t) / sizeof(natural_t)))
219
220#define TASK_AUDIT_TOKEN 15
221#define TASK_AUDIT_TOKEN_COUNT \
222 (sizeof(audit_token_t) / sizeof(natural_t))
223
224
225#define TASK_AFFINITY_TAG_INFO 16 /* This is experimental. */
226
227struct task_affinity_tag_info {
228 integer_t set_count;
229 integer_t min;
230 integer_t max;
231 integer_t task_count;
232};
233typedef struct task_affinity_tag_info task_affinity_tag_info_data_t;
234typedef struct task_affinity_tag_info *task_affinity_tag_info_t;
235#define TASK_AFFINITY_TAG_INFO_COUNT \
236 (sizeof(task_affinity_tag_info_data_t) / sizeof(natural_t))
237
238#define TASK_DYLD_INFO 17
239
240struct task_dyld_info {
241 mach_vm_address_t all_image_info_addr;
242 mach_vm_size_t all_image_info_size;
243 integer_t all_image_info_format;
244};
245typedef struct task_dyld_info task_dyld_info_data_t;
246typedef struct task_dyld_info *task_dyld_info_t;
247#define TASK_DYLD_INFO_COUNT \
248 (sizeof(task_dyld_info_data_t) / sizeof(natural_t))
249#define TASK_DYLD_ALL_IMAGE_INFO_32 0 /* format value */
250#define TASK_DYLD_ALL_IMAGE_INFO_64 1 /* format value */
251
252
253#define TASK_EXTMOD_INFO 19
254
255struct task_extmod_info {
256 unsigned char task_uuid[16];
257 vm_extmod_statistics_data_t extmod_statistics;
258};
259typedef struct task_extmod_info task_extmod_info_data_t;
260typedef struct task_extmod_info *task_extmod_info_t;
261#define TASK_EXTMOD_INFO_COUNT \
262 (sizeof(task_extmod_info_data_t) / sizeof(natural_t))
263
264
265#define MACH_TASK_BASIC_INFO 20 /* always 64-bit basic info */
266struct mach_task_basic_info {
267 mach_vm_size_t virtual_size; /* virtual memory size (bytes) */
268 mach_vm_size_t resident_size; /* resident memory size (bytes) */
269 mach_vm_size_t resident_size_max; /* maximum resident memory size (bytes) */
270 time_value_t user_time; /* total user run time for
271 * terminated threads */
272 time_value_t system_time; /* total system run time for
273 * terminated threads */
274 policy_t policy; /* default policy for new threads */
275 integer_t suspend_count; /* suspend count for task */
276};
277typedef struct mach_task_basic_info mach_task_basic_info_data_t;
278typedef struct mach_task_basic_info *mach_task_basic_info_t;
279#define MACH_TASK_BASIC_INFO_COUNT \
280 (sizeof(mach_task_basic_info_data_t) / sizeof(natural_t))
281
282
283#define TASK_POWER_INFO 21
284
285struct task_power_info {
286 uint64_t total_user;
287 uint64_t total_system;
288 uint64_t task_interrupt_wakeups;
289 uint64_t task_platform_idle_wakeups;
290 uint64_t task_timer_wakeups_bin_1;
291 uint64_t task_timer_wakeups_bin_2;
292};
293
294typedef struct task_power_info task_power_info_data_t;
295typedef struct task_power_info *task_power_info_t;
296#define TASK_POWER_INFO_COUNT ((mach_msg_type_number_t) \
297 (sizeof (task_power_info_data_t) / sizeof (natural_t)))
298
299
300
301#define TASK_VM_INFO 22
302#define TASK_VM_INFO_PURGEABLE 23
303struct task_vm_info {
304 mach_vm_size_t virtual_size; /* virtual memory size (bytes) */
305 integer_t region_count; /* number of memory regions */
306 integer_t page_size;
307 mach_vm_size_t resident_size; /* resident memory size (bytes) */
308 mach_vm_size_t resident_size_peak; /* peak resident size (bytes) */
309
310 mach_vm_size_t device;
311 mach_vm_size_t device_peak;
312 mach_vm_size_t internal;
313 mach_vm_size_t internal_peak;
314 mach_vm_size_t external;
315 mach_vm_size_t external_peak;
316 mach_vm_size_t reusable;
317 mach_vm_size_t reusable_peak;
318 mach_vm_size_t purgeable_volatile_pmap;
319 mach_vm_size_t purgeable_volatile_resident;
320 mach_vm_size_t purgeable_volatile_virtual;
321 mach_vm_size_t compressed;
322 mach_vm_size_t compressed_peak;
323 mach_vm_size_t compressed_lifetime;
324
325 /* added for rev1 */
326 mach_vm_size_t phys_footprint;
327
328 /* added for rev2 */
329 mach_vm_address_t min_address;
330 mach_vm_address_t max_address;
331
332 /* added for rev3 */
333 int64_t ledger_phys_footprint_peak;
334 int64_t ledger_purgeable_nonvolatile;
335 int64_t ledger_purgeable_novolatile_compressed;
336 int64_t ledger_purgeable_volatile;
337 int64_t ledger_purgeable_volatile_compressed;
338 int64_t ledger_tag_network_nonvolatile;
339 int64_t ledger_tag_network_nonvolatile_compressed;
340 int64_t ledger_tag_network_volatile;
341 int64_t ledger_tag_network_volatile_compressed;
342 int64_t ledger_tag_media_footprint;
343 int64_t ledger_tag_media_footprint_compressed;
344 int64_t ledger_tag_media_nofootprint;
345 int64_t ledger_tag_media_nofootprint_compressed;
346 int64_t ledger_tag_graphics_footprint;
347 int64_t ledger_tag_graphics_footprint_compressed;
348 int64_t ledger_tag_graphics_nofootprint;
349 int64_t ledger_tag_graphics_nofootprint_compressed;
350 int64_t ledger_tag_neural_footprint;
351 int64_t ledger_tag_neural_footprint_compressed;
352 int64_t ledger_tag_neural_nofootprint;
353 int64_t ledger_tag_neural_nofootprint_compressed;
354
355 /* added for rev4 */
356 uint64_t limit_bytes_remaining;
357
358 /* added for rev5 */
359 integer_t decompressions;
360};
361typedef struct task_vm_info task_vm_info_data_t;
362typedef struct task_vm_info *task_vm_info_t;
363#define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \
364 (sizeof (task_vm_info_data_t) / sizeof (natural_t)))
365#define TASK_VM_INFO_REV5_COUNT TASK_VM_INFO_COUNT
366#define TASK_VM_INFO_REV4_COUNT /* doesn't include decompressions */ \
367 ((mach_msg_type_number_t) (TASK_VM_INFO_REV5_COUNT - 1))
368#define TASK_VM_INFO_REV3_COUNT /* doesn't include limit bytes */ \
369 ((mach_msg_type_number_t) (TASK_VM_INFO_REV4_COUNT - 2))
370#define TASK_VM_INFO_REV2_COUNT /* doesn't include extra ledgers info */ \
371 ((mach_msg_type_number_t) (TASK_VM_INFO_REV3_COUNT - 42))
372#define TASK_VM_INFO_REV1_COUNT /* doesn't include min and max address */ \
373 ((mach_msg_type_number_t) (TASK_VM_INFO_REV2_COUNT - 4))
374#define TASK_VM_INFO_REV0_COUNT /* doesn't include phys_footprint */ \
375 ((mach_msg_type_number_t) (TASK_VM_INFO_REV1_COUNT - 2))
376
377typedef struct vm_purgeable_info task_purgable_info_t;
378
379
380#define TASK_TRACE_MEMORY_INFO 24
381struct task_trace_memory_info {
382 uint64_t user_memory_address; /* address of start of trace memory buffer */
383 uint64_t buffer_size; /* size of buffer in bytes */
384 uint64_t mailbox_array_size; /* size of mailbox area in bytes */
385};
386typedef struct task_trace_memory_info task_trace_memory_info_data_t;
387typedef struct task_trace_memory_info * task_trace_memory_info_t;
388#define TASK_TRACE_MEMORY_INFO_COUNT ((mach_msg_type_number_t) \
389 (sizeof(task_trace_memory_info_data_t) / sizeof(natural_t)))
390
391#define TASK_WAIT_STATE_INFO 25 /* deprecated. */
392struct task_wait_state_info {
393 uint64_t total_wait_state_time; /* Time that all threads past and present have been in a wait state */
394 uint64_t total_wait_sfi_state_time; /* Time that threads have been in SFI wait (should be a subset of total wait state time */
395 uint32_t _reserved[4];
396};
397typedef struct task_wait_state_info task_wait_state_info_data_t;
398typedef struct task_wait_state_info * task_wait_state_info_t;
399#define TASK_WAIT_STATE_INFO_COUNT ((mach_msg_type_number_t) \
400 (sizeof(task_wait_state_info_data_t) / sizeof(natural_t)))
401
402#define TASK_POWER_INFO_V2 26
403
404typedef struct {
405 uint64_t task_gpu_utilisation;
406 uint64_t task_gpu_stat_reserved0;
407 uint64_t task_gpu_stat_reserved1;
408 uint64_t task_gpu_stat_reserved2;
409} gpu_energy_data;
410
411typedef gpu_energy_data *gpu_energy_data_t;
412struct task_power_info_v2 {
413 task_power_info_data_t cpu_energy;
414 gpu_energy_data gpu_energy;
415 uint64_t task_ptime;
416 uint64_t task_pset_switches;
417};
418
419typedef struct task_power_info_v2 task_power_info_v2_data_t;
420typedef struct task_power_info_v2 *task_power_info_v2_t;
421#define TASK_POWER_INFO_V2_COUNT_OLD \
422 ((mach_msg_type_number_t) (sizeof (task_power_info_v2_data_t) - sizeof(uint64_t)*2) / sizeof (natural_t))
423#define TASK_POWER_INFO_V2_COUNT \
424 ((mach_msg_type_number_t) (sizeof (task_power_info_v2_data_t) / sizeof (natural_t)))
425
426#define TASK_VM_INFO_PURGEABLE_ACCOUNT 27 /* Used for xnu purgeable vm unit tests */
427
428
429#define TASK_FLAGS_INFO 28 /* return t_flags field */
430struct task_flags_info {
431 uint32_t flags; /* task flags */
432};
433typedef struct task_flags_info task_flags_info_data_t;
434typedef struct task_flags_info * task_flags_info_t;
435#define TASK_FLAGS_INFO_COUNT ((mach_msg_type_number_t) \
436 (sizeof(task_flags_info_data_t) / sizeof (natural_t)))
437
438#define TF_LP64 0x00000001 /* task has 64-bit addressing */
439#define TF_64B_DATA 0x00000002 /* task has 64-bit data registers */
440
441#define TASK_DEBUG_INFO_INTERNAL 29 /* Used for kernel internal development tests. */
442
443
444/*
445 * Type to control EXC_GUARD delivery options for a task
446 * via task_get/set_exc_guard_behavior interface(s).
447 */
448typedef uint32_t task_exc_guard_behavior_t;
449
450/* EXC_GUARD optional delivery settings on a per-task basis */
451#define TASK_EXC_GUARD_VM_DELIVER 0x01 /* Deliver virtual memory EXC_GUARD exceptions */
452#define TASK_EXC_GUARD_VM_ONCE 0x02 /* Deliver them only once */
453#define TASK_EXC_GUARD_VM_CORPSE 0x04 /* Deliver them via a forked corpse */
454#define TASK_EXC_GUARD_VM_FATAL 0x08 /* Virtual Memory EXC_GUARD delivery is fatal */
455#define TASK_EXC_GUARD_VM_ALL 0x0f
456
457#define TASK_EXC_GUARD_MP_DELIVER 0x10 /* Deliver mach port EXC_GUARD exceptions */
458#define TASK_EXC_GUARD_MP_ONCE 0x20 /* Deliver them only once */
459#define TASK_EXC_GUARD_MP_CORPSE 0x40 /* Deliver them via a forked corpse */
460#define TASK_EXC_GUARD_MP_FATAL 0x80 /* mach port EXC_GUARD delivery is fatal */
461#define TASK_EXC_GUARD_MP_ALL 0xf0
462
463#define TASK_EXC_GUARD_ALL 0xff /* All optional deliver settings */
464
465
466/*
467 * Obsolete interfaces.
468 */
469
470#define TASK_SCHED_TIMESHARE_INFO 10
471#define TASK_SCHED_RR_INFO 11
472#define TASK_SCHED_FIFO_INFO 12
473
474#define TASK_SCHED_INFO 14
475
476#pragma pack(pop)
477
478#endif /* _MACH_TASK_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/task_inspect.h created+54
...@@ -0,0 +1,54 @@
1/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef MACH_TASK_INSPECT_H
30#define MACH_TASK_INSPECT_H
31
32/*
33 * XXX These interfaces are still in development -- they are subject to change
34 * without notice.
35 */
36
37typedef natural_t task_inspect_flavor_t;
38
39enum task_inspect_flavor {
40 TASK_INSPECT_BASIC_COUNTS = 1,
41};
42
43struct task_inspect_basic_counts {
44 uint64_t instructions;
45 uint64_t cycles;
46};
47#define TASK_INSPECT_BASIC_COUNTS_COUNT \
48 (sizeof(struct task_inspect_basic_counts) / sizeof(natural_t))
49typedef struct task_inspect_basic_counts task_inspect_basic_counts_data_t;
50typedef struct task_inspect_basic_counts *task_inspect_basic_counts_t;
51
52typedef integer_t *task_inspect_info_t;
53
54#endif /* !defined(MACH_TASK_INSPECT_H) */
lib/libc/include/x86_64-macos-gnu/mach/task_policy.h created+189
...@@ -0,0 +1,189 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_TASK_POLICY_H_
30#define _MACH_TASK_POLICY_H_
31
32#include <mach/mach_types.h>
33
34/*
35 * These are the calls for accessing the policy parameters
36 * of a particular task.
37 *
38 * The extra 'get_default' parameter to the second call is
39 * IN/OUT as follows:
40 * 1) if asserted on the way in it indicates that the default
41 * values should be returned, not the ones currently set, in
42 * this case 'get_default' will always be asserted on return;
43 * 2) if unasserted on the way in, the current settings are
44 * desired and if still unasserted on return, then the info
45 * returned reflects the current settings, otherwise if
46 * 'get_default' returns asserted, it means that there are no
47 * current settings due to other parameters taking precedence,
48 * and the default ones are being returned instead.
49 */
50
51typedef natural_t task_policy_flavor_t;
52typedef integer_t *task_policy_t;
53
54/*
55 * kern_return_t task_policy_set(
56 * task_t task,
57 * task_policy_flavor_t flavor,
58 * task_policy_t policy_info,
59 * mach_msg_type_number_t count);
60 *
61 * kern_return_t task_policy_get(
62 * task_t task,
63 * task_policy_flavor_t flavor,
64 * task_policy_t policy_info,
65 * mach_msg_type_number_t *count,
66 * boolean_t *get_default);
67 */
68
69/*
70 * Defined flavors.
71 */
72/*
73 * TASK_CATEGORY_POLICY:
74 *
75 * This provides information to the kernel about the role
76 * of the task in the system.
77 *
78 * Parameters:
79 *
80 * role: Enumerated as follows:
81 *
82 * TASK_UNSPECIFIED is the default, since the role is not
83 * inherited from the parent.
84 *
85 * TASK_FOREGROUND_APPLICATION should be assigned when the
86 * task is a normal UI application in the foreground from
87 * the HI point of view.
88 * **N.B. There may be more than one of these at a given time.
89 *
90 * TASK_BACKGROUND_APPLICATION should be assigned when the
91 * task is a normal UI application in the background from
92 * the HI point of view.
93 *
94 * TASK_CONTROL_APPLICATION should be assigned to the unique
95 * UI application which implements the pop-up application dialog.
96 * There can only be one task at a time with this designation,
97 * which is assigned FCFS.
98 *
99 * TASK_GRAPHICS_SERVER should be assigned to the graphics
100 * management (window) server. There can only be one task at
101 * a time with this designation, which is assigned FCFS.
102 */
103
104#define TASK_CATEGORY_POLICY 1
105
106#define TASK_SUPPRESSION_POLICY 3
107#define TASK_POLICY_STATE 4
108#define TASK_BASE_QOS_POLICY 8
109#define TASK_OVERRIDE_QOS_POLICY 9
110#define TASK_BASE_LATENCY_QOS_POLICY 10
111#define TASK_BASE_THROUGHPUT_QOS_POLICY 11
112
113
114enum task_role {
115 TASK_RENICED = -1,
116 TASK_UNSPECIFIED = 0,
117 TASK_FOREGROUND_APPLICATION = 1,
118 TASK_BACKGROUND_APPLICATION = 2,
119 TASK_CONTROL_APPLICATION = 3,
120 TASK_GRAPHICS_SERVER = 4,
121 TASK_THROTTLE_APPLICATION = 5,
122 TASK_NONUI_APPLICATION = 6,
123 TASK_DEFAULT_APPLICATION = 7,
124 TASK_DARWINBG_APPLICATION = 8,
125};
126
127typedef integer_t task_role_t;
128
129struct task_category_policy {
130 task_role_t role;
131};
132
133typedef struct task_category_policy task_category_policy_data_t;
134typedef struct task_category_policy *task_category_policy_t;
135
136#define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) \
137 (sizeof (task_category_policy_data_t) / sizeof (integer_t)))
138
139
140enum task_latency_qos {
141 LATENCY_QOS_TIER_UNSPECIFIED = 0x0,
142 LATENCY_QOS_TIER_0 = ((0xFF << 16) | 1),
143 LATENCY_QOS_TIER_1 = ((0xFF << 16) | 2),
144 LATENCY_QOS_TIER_2 = ((0xFF << 16) | 3),
145 LATENCY_QOS_TIER_3 = ((0xFF << 16) | 4),
146 LATENCY_QOS_TIER_4 = ((0xFF << 16) | 5),
147 LATENCY_QOS_TIER_5 = ((0xFF << 16) | 6)
148};
149typedef integer_t task_latency_qos_t;
150enum task_throughput_qos {
151 THROUGHPUT_QOS_TIER_UNSPECIFIED = 0x0,
152 THROUGHPUT_QOS_TIER_0 = ((0xFE << 16) | 1),
153 THROUGHPUT_QOS_TIER_1 = ((0xFE << 16) | 2),
154 THROUGHPUT_QOS_TIER_2 = ((0xFE << 16) | 3),
155 THROUGHPUT_QOS_TIER_3 = ((0xFE << 16) | 4),
156 THROUGHPUT_QOS_TIER_4 = ((0xFE << 16) | 5),
157 THROUGHPUT_QOS_TIER_5 = ((0xFE << 16) | 6),
158};
159
160#define LATENCY_QOS_LAUNCH_DEFAULT_TIER LATENCY_QOS_TIER_3
161#define THROUGHPUT_QOS_LAUNCH_DEFAULT_TIER THROUGHPUT_QOS_TIER_3
162
163typedef integer_t task_throughput_qos_t;
164
165struct task_qos_policy {
166 task_latency_qos_t task_latency_qos_tier;
167 task_throughput_qos_t task_throughput_qos_tier;
168};
169
170typedef struct task_qos_policy *task_qos_policy_t;
171#define TASK_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
172 (sizeof (struct task_qos_policy) / sizeof (integer_t)))
173
174/* These should be removed - they belong in proc_info.h */
175#define PROC_FLAG_DARWINBG 0x8000 /* process in darwin background */
176#define PROC_FLAG_EXT_DARWINBG 0x10000 /* process in darwin background - external enforcement */
177#define PROC_FLAG_IOS_APPLEDAEMON 0x20000 /* process is apple ios daemon */
178#define PROC_FLAG_IOS_IMPPROMOTION 0x80000 /* process is apple ios daemon */
179#define PROC_FLAG_ADAPTIVE 0x100000 /* Process is adaptive */
180#define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000 /* Process is adaptive, and is currently important */
181#define PROC_FLAG_IMPORTANCE_DONOR 0x400000 /* Process is marked as an importance donor */
182#define PROC_FLAG_SUPPRESSED 0x800000 /* Process is suppressed */
183#define PROC_FLAG_APPLICATION 0x1000000 /* Process is an application */
184#define PROC_FLAG_IOS_APPLICATION PROC_FLAG_APPLICATION /* Process is an application */
185
186
187
188
189#endif /* _MACH_TASK_POLICY_H_ */
lib/libc/include/x86_64-macos-gnu/mach/task_special_ports.h created+132
...@@ -0,0 +1,132 @@
1/*
2 * Copyright (c) 2000-2010 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/task_special_ports.h
60 *
61 * Defines codes for special_purpose task ports. These are NOT
62 * port identifiers - they are only used for the task_get_special_port
63 * and task_set_special_port routines.
64 *
65 */
66
67#ifndef _MACH_TASK_SPECIAL_PORTS_H_
68#define _MACH_TASK_SPECIAL_PORTS_H_
69
70typedef int task_special_port_t;
71
72#define TASK_KERNEL_PORT 1 /* Represents task to the outside
73 * world.*/
74
75#define TASK_HOST_PORT 2 /* The host (priv) port for task. */
76
77#define TASK_NAME_PORT 3 /* the name (unpriv) port for task */
78
79#define TASK_BOOTSTRAP_PORT 4 /* Bootstrap environment for task. */
80
81/*
82 * Evolving and likely to change.
83 */
84
85#define TASK_SEATBELT_PORT 7 /* Seatbelt compiler/DEM port for task. */
86
87/* PORT 8 was the GSSD TASK PORT which transformed to a host port */
88
89#define TASK_ACCESS_PORT 9 /* Permission check for task_for_pid. */
90
91#define TASK_DEBUG_CONTROL_PORT 10 /* debug control port */
92
93#define TASK_RESOURCE_NOTIFY_PORT 11 /* overrides host special RN port */
94
95#define TASK_MAX_SPECIAL_PORT TASK_RESOURCE_NOTIFY_PORT
96
97/*
98 * Definitions for ease of use
99 */
100
101#define task_get_kernel_port(task, port) \
102 (task_get_special_port((task), TASK_KERNEL_PORT, (port)))
103
104#define task_set_kernel_port(task, port) \
105 (task_set_special_port((task), TASK_KERNEL_PORT, (port)))
106
107#define task_get_host_port(task, port) \
108 (task_get_special_port((task), TASK_HOST_PORT, (port)))
109
110#define task_set_host_port(task, port) \
111 (task_set_special_port((task), TASK_HOST_PORT, (port)))
112
113#define task_get_bootstrap_port(task, port) \
114 (task_get_special_port((task), TASK_BOOTSTRAP_PORT, (port)))
115
116#define task_get_debug_control_port(task, port) \
117 (task_get_special_port((task), TASK_DEBUG_CONTROL_PORT, (port)))
118
119#define task_set_bootstrap_port(task, port) \
120 (task_set_special_port((task), TASK_BOOTSTRAP_PORT, (port)))
121
122#define task_get_task_access_port(task, port) \
123 (task_get_special_port((task), TASK_ACCESS_PORT, (port)))
124
125#define task_set_task_access_port(task, port) \
126 (task_set_special_port((task), TASK_ACCESS_PORT, (port)))
127
128#define task_set_task_debug_control_port(task, port) \
129 (task_set_special_port((task), TASK_DEBUG_CONTROL_PORT, (port)))
130
131
132#endif /* _MACH_TASK_SPECIAL_PORTS_H_ */
lib/libc/include/x86_64-macos-gnu/mach/thread_act.h created+1336
...@@ -0,0 +1,1336 @@
1#ifndef _thread_act_user_
2#define _thread_act_user_
3
4/* Module thread_act */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef thread_act_MSG_COUNT
52#define thread_act_MSG_COUNT 28
53#endif /* thread_act_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine thread_terminate */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74__WATCHOS_PROHIBITED
75__TVOS_PROHIBITED
76kern_return_t thread_terminate
77(
78 thread_act_t target_act
79);
80
81/* Routine act_get_state */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87__WATCHOS_PROHIBITED
88__TVOS_PROHIBITED
89kern_return_t act_get_state
90(
91 thread_act_t target_act,
92 int flavor,
93 thread_state_t old_state,
94 mach_msg_type_number_t *old_stateCnt
95);
96
97/* Routine act_set_state */
98#ifdef mig_external
99mig_external
100#else
101extern
102#endif /* mig_external */
103__WATCHOS_PROHIBITED
104__TVOS_PROHIBITED
105kern_return_t act_set_state
106(
107 thread_act_t target_act,
108 int flavor,
109 thread_state_t new_state,
110 mach_msg_type_number_t new_stateCnt
111);
112
113/* Routine thread_get_state */
114#ifdef mig_external
115mig_external
116#else
117extern
118#endif /* mig_external */
119__WATCHOS_PROHIBITED
120kern_return_t thread_get_state
121(
122 thread_act_t target_act,
123 thread_state_flavor_t flavor,
124 thread_state_t old_state,
125 mach_msg_type_number_t *old_stateCnt
126);
127
128/* Routine thread_set_state */
129#ifdef mig_external
130mig_external
131#else
132extern
133#endif /* mig_external */
134__WATCHOS_PROHIBITED
135kern_return_t thread_set_state
136(
137 thread_act_t target_act,
138 thread_state_flavor_t flavor,
139 thread_state_t new_state,
140 mach_msg_type_number_t new_stateCnt
141);
142
143/* Routine thread_suspend */
144#ifdef mig_external
145mig_external
146#else
147extern
148#endif /* mig_external */
149__WATCHOS_PROHIBITED
150kern_return_t thread_suspend
151(
152 thread_act_t target_act
153);
154
155/* Routine thread_resume */
156#ifdef mig_external
157mig_external
158#else
159extern
160#endif /* mig_external */
161__WATCHOS_PROHIBITED
162kern_return_t thread_resume
163(
164 thread_act_t target_act
165);
166
167/* Routine thread_abort */
168#ifdef mig_external
169mig_external
170#else
171extern
172#endif /* mig_external */
173__WATCHOS_PROHIBITED
174kern_return_t thread_abort
175(
176 thread_act_t target_act
177);
178
179/* Routine thread_abort_safely */
180#ifdef mig_external
181mig_external
182#else
183extern
184#endif /* mig_external */
185__WATCHOS_PROHIBITED
186kern_return_t thread_abort_safely
187(
188 thread_act_t target_act
189);
190
191/* Routine thread_depress_abort */
192#ifdef mig_external
193mig_external
194#else
195extern
196#endif /* mig_external */
197__WATCHOS_PROHIBITED
198__TVOS_PROHIBITED
199kern_return_t thread_depress_abort
200(
201 thread_act_t thread
202);
203
204/* Routine thread_get_special_port */
205#ifdef mig_external
206mig_external
207#else
208extern
209#endif /* mig_external */
210__WATCHOS_PROHIBITED
211__TVOS_PROHIBITED
212kern_return_t thread_get_special_port
213(
214 thread_act_t thr_act,
215 int which_port,
216 mach_port_t *special_port
217);
218
219/* Routine thread_set_special_port */
220#ifdef mig_external
221mig_external
222#else
223extern
224#endif /* mig_external */
225__WATCHOS_PROHIBITED
226__TVOS_PROHIBITED
227kern_return_t thread_set_special_port
228(
229 thread_act_t thr_act,
230 int which_port,
231 mach_port_t special_port
232);
233
234/* Routine thread_info */
235#ifdef mig_external
236mig_external
237#else
238extern
239#endif /* mig_external */
240kern_return_t thread_info
241(
242 thread_inspect_t target_act,
243 thread_flavor_t flavor,
244 thread_info_t thread_info_out,
245 mach_msg_type_number_t *thread_info_outCnt
246);
247
248/* Routine thread_set_exception_ports */
249#ifdef mig_external
250mig_external
251#else
252extern
253#endif /* mig_external */
254__WATCHOS_PROHIBITED
255__TVOS_PROHIBITED
256kern_return_t thread_set_exception_ports
257(
258 thread_act_t thread,
259 exception_mask_t exception_mask,
260 mach_port_t new_port,
261 exception_behavior_t behavior,
262 thread_state_flavor_t new_flavor
263);
264
265/* Routine thread_get_exception_ports */
266#ifdef mig_external
267mig_external
268#else
269extern
270#endif /* mig_external */
271__WATCHOS_PROHIBITED
272__TVOS_PROHIBITED
273kern_return_t thread_get_exception_ports
274(
275 thread_inspect_t thread,
276 exception_mask_t exception_mask,
277 exception_mask_array_t masks,
278 mach_msg_type_number_t *masksCnt,
279 exception_handler_array_t old_handlers,
280 exception_behavior_array_t old_behaviors,
281 exception_flavor_array_t old_flavors
282);
283
284/* Routine thread_swap_exception_ports */
285#ifdef mig_external
286mig_external
287#else
288extern
289#endif /* mig_external */
290__WATCHOS_PROHIBITED
291__TVOS_PROHIBITED
292kern_return_t thread_swap_exception_ports
293(
294 thread_act_t thread,
295 exception_mask_t exception_mask,
296 mach_port_t new_port,
297 exception_behavior_t behavior,
298 thread_state_flavor_t new_flavor,
299 exception_mask_array_t masks,
300 mach_msg_type_number_t *masksCnt,
301 exception_handler_array_t old_handlers,
302 exception_behavior_array_t old_behaviors,
303 exception_flavor_array_t old_flavors
304);
305
306/* Routine thread_policy */
307#ifdef mig_external
308mig_external
309#else
310extern
311#endif /* mig_external */
312kern_return_t thread_policy
313(
314 thread_act_t thr_act,
315 policy_t policy,
316 policy_base_t base,
317 mach_msg_type_number_t baseCnt,
318 boolean_t set_limit
319);
320
321/* Routine thread_policy_set */
322#ifdef mig_external
323mig_external
324#else
325extern
326#endif /* mig_external */
327kern_return_t thread_policy_set
328(
329 thread_act_t thread,
330 thread_policy_flavor_t flavor,
331 thread_policy_t policy_info,
332 mach_msg_type_number_t policy_infoCnt
333);
334
335/* Routine thread_policy_get */
336#ifdef mig_external
337mig_external
338#else
339extern
340#endif /* mig_external */
341kern_return_t thread_policy_get
342(
343 thread_inspect_t thread,
344 thread_policy_flavor_t flavor,
345 thread_policy_t policy_info,
346 mach_msg_type_number_t *policy_infoCnt,
347 boolean_t *get_default
348);
349
350/* Routine thread_sample */
351#ifdef mig_external
352mig_external
353#else
354extern
355#endif /* mig_external */
356kern_return_t thread_sample
357(
358 thread_act_t thread,
359 mach_port_t reply
360);
361
362/* Routine etap_trace_thread */
363#ifdef mig_external
364mig_external
365#else
366extern
367#endif /* mig_external */
368kern_return_t etap_trace_thread
369(
370 thread_act_t target_act,
371 boolean_t trace_status
372);
373
374/* Routine thread_assign */
375#ifdef mig_external
376mig_external
377#else
378extern
379#endif /* mig_external */
380kern_return_t thread_assign
381(
382 thread_act_t thread,
383 processor_set_t new_set
384);
385
386/* Routine thread_assign_default */
387#ifdef mig_external
388mig_external
389#else
390extern
391#endif /* mig_external */
392kern_return_t thread_assign_default
393(
394 thread_act_t thread
395);
396
397/* Routine thread_get_assignment */
398#ifdef mig_external
399mig_external
400#else
401extern
402#endif /* mig_external */
403kern_return_t thread_get_assignment
404(
405 thread_act_t thread,
406 processor_set_name_t *assigned_set
407);
408
409/* Routine thread_set_policy */
410#ifdef mig_external
411mig_external
412#else
413extern
414#endif /* mig_external */
415kern_return_t thread_set_policy
416(
417 thread_act_t thr_act,
418 processor_set_t pset,
419 policy_t policy,
420 policy_base_t base,
421 mach_msg_type_number_t baseCnt,
422 policy_limit_t limit,
423 mach_msg_type_number_t limitCnt
424);
425
426/* Routine thread_get_mach_voucher */
427#ifdef mig_external
428mig_external
429#else
430extern
431#endif /* mig_external */
432__WATCHOS_PROHIBITED
433__TVOS_PROHIBITED
434kern_return_t thread_get_mach_voucher
435(
436 thread_act_t thr_act,
437 mach_voucher_selector_t which,
438 ipc_voucher_t *voucher
439);
440
441/* Routine thread_set_mach_voucher */
442#ifdef mig_external
443mig_external
444#else
445extern
446#endif /* mig_external */
447__WATCHOS_PROHIBITED
448__TVOS_PROHIBITED
449kern_return_t thread_set_mach_voucher
450(
451 thread_act_t thr_act,
452 ipc_voucher_t voucher
453);
454
455/* Routine thread_swap_mach_voucher */
456#ifdef mig_external
457mig_external
458#else
459extern
460#endif /* mig_external */
461__WATCHOS_PROHIBITED
462__TVOS_PROHIBITED
463kern_return_t thread_swap_mach_voucher
464(
465 thread_act_t thr_act,
466 ipc_voucher_t new_voucher,
467 ipc_voucher_t *old_voucher
468);
469
470__END_DECLS
471
472/********************** Caution **************************/
473/* The following data types should be used to calculate */
474/* maximum message sizes only. The actual message may be */
475/* smaller, and the position of the arguments within the */
476/* message layout may vary from what is presented here. */
477/* For example, if any of the arguments are variable- */
478/* sized, and less than the maximum is sent, the data */
479/* will be packed tight in the actual message to reduce */
480/* the presence of holes. */
481/********************** Caution **************************/
482
483/* typedefs for all requests */
484
485#ifndef __Request__thread_act_subsystem__defined
486#define __Request__thread_act_subsystem__defined
487
488#ifdef __MigPackStructs
489#pragma pack(push, 4)
490#endif
491 typedef struct {
492 mach_msg_header_t Head;
493 } __Request__thread_terminate_t __attribute__((unused));
494#ifdef __MigPackStructs
495#pragma pack(pop)
496#endif
497
498#ifdef __MigPackStructs
499#pragma pack(push, 4)
500#endif
501 typedef struct {
502 mach_msg_header_t Head;
503 NDR_record_t NDR;
504 int flavor;
505 mach_msg_type_number_t old_stateCnt;
506 } __Request__act_get_state_t __attribute__((unused));
507#ifdef __MigPackStructs
508#pragma pack(pop)
509#endif
510
511#ifdef __MigPackStructs
512#pragma pack(push, 4)
513#endif
514 typedef struct {
515 mach_msg_header_t Head;
516 NDR_record_t NDR;
517 int flavor;
518 mach_msg_type_number_t new_stateCnt;
519 natural_t new_state[614];
520 } __Request__act_set_state_t __attribute__((unused));
521#ifdef __MigPackStructs
522#pragma pack(pop)
523#endif
524
525#ifdef __MigPackStructs
526#pragma pack(push, 4)
527#endif
528 typedef struct {
529 mach_msg_header_t Head;
530 NDR_record_t NDR;
531 thread_state_flavor_t flavor;
532 mach_msg_type_number_t old_stateCnt;
533 } __Request__thread_get_state_t __attribute__((unused));
534#ifdef __MigPackStructs
535#pragma pack(pop)
536#endif
537
538#ifdef __MigPackStructs
539#pragma pack(push, 4)
540#endif
541 typedef struct {
542 mach_msg_header_t Head;
543 NDR_record_t NDR;
544 thread_state_flavor_t flavor;
545 mach_msg_type_number_t new_stateCnt;
546 natural_t new_state[614];
547 } __Request__thread_set_state_t __attribute__((unused));
548#ifdef __MigPackStructs
549#pragma pack(pop)
550#endif
551
552#ifdef __MigPackStructs
553#pragma pack(push, 4)
554#endif
555 typedef struct {
556 mach_msg_header_t Head;
557 } __Request__thread_suspend_t __attribute__((unused));
558#ifdef __MigPackStructs
559#pragma pack(pop)
560#endif
561
562#ifdef __MigPackStructs
563#pragma pack(push, 4)
564#endif
565 typedef struct {
566 mach_msg_header_t Head;
567 } __Request__thread_resume_t __attribute__((unused));
568#ifdef __MigPackStructs
569#pragma pack(pop)
570#endif
571
572#ifdef __MigPackStructs
573#pragma pack(push, 4)
574#endif
575 typedef struct {
576 mach_msg_header_t Head;
577 } __Request__thread_abort_t __attribute__((unused));
578#ifdef __MigPackStructs
579#pragma pack(pop)
580#endif
581
582#ifdef __MigPackStructs
583#pragma pack(push, 4)
584#endif
585 typedef struct {
586 mach_msg_header_t Head;
587 } __Request__thread_abort_safely_t __attribute__((unused));
588#ifdef __MigPackStructs
589#pragma pack(pop)
590#endif
591
592#ifdef __MigPackStructs
593#pragma pack(push, 4)
594#endif
595 typedef struct {
596 mach_msg_header_t Head;
597 } __Request__thread_depress_abort_t __attribute__((unused));
598#ifdef __MigPackStructs
599#pragma pack(pop)
600#endif
601
602#ifdef __MigPackStructs
603#pragma pack(push, 4)
604#endif
605 typedef struct {
606 mach_msg_header_t Head;
607 NDR_record_t NDR;
608 int which_port;
609 } __Request__thread_get_special_port_t __attribute__((unused));
610#ifdef __MigPackStructs
611#pragma pack(pop)
612#endif
613
614#ifdef __MigPackStructs
615#pragma pack(push, 4)
616#endif
617 typedef struct {
618 mach_msg_header_t Head;
619 /* start of the kernel processed data */
620 mach_msg_body_t msgh_body;
621 mach_msg_port_descriptor_t special_port;
622 /* end of the kernel processed data */
623 NDR_record_t NDR;
624 int which_port;
625 } __Request__thread_set_special_port_t __attribute__((unused));
626#ifdef __MigPackStructs
627#pragma pack(pop)
628#endif
629
630#ifdef __MigPackStructs
631#pragma pack(push, 4)
632#endif
633 typedef struct {
634 mach_msg_header_t Head;
635 NDR_record_t NDR;
636 thread_flavor_t flavor;
637 mach_msg_type_number_t thread_info_outCnt;
638 } __Request__thread_info_t __attribute__((unused));
639#ifdef __MigPackStructs
640#pragma pack(pop)
641#endif
642
643#ifdef __MigPackStructs
644#pragma pack(push, 4)
645#endif
646 typedef struct {
647 mach_msg_header_t Head;
648 /* start of the kernel processed data */
649 mach_msg_body_t msgh_body;
650 mach_msg_port_descriptor_t new_port;
651 /* end of the kernel processed data */
652 NDR_record_t NDR;
653 exception_mask_t exception_mask;
654 exception_behavior_t behavior;
655 thread_state_flavor_t new_flavor;
656 } __Request__thread_set_exception_ports_t __attribute__((unused));
657#ifdef __MigPackStructs
658#pragma pack(pop)
659#endif
660
661#ifdef __MigPackStructs
662#pragma pack(push, 4)
663#endif
664 typedef struct {
665 mach_msg_header_t Head;
666 NDR_record_t NDR;
667 exception_mask_t exception_mask;
668 } __Request__thread_get_exception_ports_t __attribute__((unused));
669#ifdef __MigPackStructs
670#pragma pack(pop)
671#endif
672
673#ifdef __MigPackStructs
674#pragma pack(push, 4)
675#endif
676 typedef struct {
677 mach_msg_header_t Head;
678 /* start of the kernel processed data */
679 mach_msg_body_t msgh_body;
680 mach_msg_port_descriptor_t new_port;
681 /* end of the kernel processed data */
682 NDR_record_t NDR;
683 exception_mask_t exception_mask;
684 exception_behavior_t behavior;
685 thread_state_flavor_t new_flavor;
686 } __Request__thread_swap_exception_ports_t __attribute__((unused));
687#ifdef __MigPackStructs
688#pragma pack(pop)
689#endif
690
691#ifdef __MigPackStructs
692#pragma pack(push, 4)
693#endif
694 typedef struct {
695 mach_msg_header_t Head;
696 NDR_record_t NDR;
697 policy_t policy;
698 mach_msg_type_number_t baseCnt;
699 integer_t base[5];
700 boolean_t set_limit;
701 } __Request__thread_policy_t __attribute__((unused));
702#ifdef __MigPackStructs
703#pragma pack(pop)
704#endif
705
706#ifdef __MigPackStructs
707#pragma pack(push, 4)
708#endif
709 typedef struct {
710 mach_msg_header_t Head;
711 NDR_record_t NDR;
712 thread_policy_flavor_t flavor;
713 mach_msg_type_number_t policy_infoCnt;
714 integer_t policy_info[16];
715 } __Request__thread_policy_set_t __attribute__((unused));
716#ifdef __MigPackStructs
717#pragma pack(pop)
718#endif
719
720#ifdef __MigPackStructs
721#pragma pack(push, 4)
722#endif
723 typedef struct {
724 mach_msg_header_t Head;
725 NDR_record_t NDR;
726 thread_policy_flavor_t flavor;
727 mach_msg_type_number_t policy_infoCnt;
728 boolean_t get_default;
729 } __Request__thread_policy_get_t __attribute__((unused));
730#ifdef __MigPackStructs
731#pragma pack(pop)
732#endif
733
734#ifdef __MigPackStructs
735#pragma pack(push, 4)
736#endif
737 typedef struct {
738 mach_msg_header_t Head;
739 /* start of the kernel processed data */
740 mach_msg_body_t msgh_body;
741 mach_msg_port_descriptor_t reply;
742 /* end of the kernel processed data */
743 } __Request__thread_sample_t __attribute__((unused));
744#ifdef __MigPackStructs
745#pragma pack(pop)
746#endif
747
748#ifdef __MigPackStructs
749#pragma pack(push, 4)
750#endif
751 typedef struct {
752 mach_msg_header_t Head;
753 NDR_record_t NDR;
754 boolean_t trace_status;
755 } __Request__etap_trace_thread_t __attribute__((unused));
756#ifdef __MigPackStructs
757#pragma pack(pop)
758#endif
759
760#ifdef __MigPackStructs
761#pragma pack(push, 4)
762#endif
763 typedef struct {
764 mach_msg_header_t Head;
765 /* start of the kernel processed data */
766 mach_msg_body_t msgh_body;
767 mach_msg_port_descriptor_t new_set;
768 /* end of the kernel processed data */
769 } __Request__thread_assign_t __attribute__((unused));
770#ifdef __MigPackStructs
771#pragma pack(pop)
772#endif
773
774#ifdef __MigPackStructs
775#pragma pack(push, 4)
776#endif
777 typedef struct {
778 mach_msg_header_t Head;
779 } __Request__thread_assign_default_t __attribute__((unused));
780#ifdef __MigPackStructs
781#pragma pack(pop)
782#endif
783
784#ifdef __MigPackStructs
785#pragma pack(push, 4)
786#endif
787 typedef struct {
788 mach_msg_header_t Head;
789 } __Request__thread_get_assignment_t __attribute__((unused));
790#ifdef __MigPackStructs
791#pragma pack(pop)
792#endif
793
794#ifdef __MigPackStructs
795#pragma pack(push, 4)
796#endif
797 typedef struct {
798 mach_msg_header_t Head;
799 /* start of the kernel processed data */
800 mach_msg_body_t msgh_body;
801 mach_msg_port_descriptor_t pset;
802 /* end of the kernel processed data */
803 NDR_record_t NDR;
804 policy_t policy;
805 mach_msg_type_number_t baseCnt;
806 integer_t base[5];
807 mach_msg_type_number_t limitCnt;
808 integer_t limit[1];
809 } __Request__thread_set_policy_t __attribute__((unused));
810#ifdef __MigPackStructs
811#pragma pack(pop)
812#endif
813
814#ifdef __MigPackStructs
815#pragma pack(push, 4)
816#endif
817 typedef struct {
818 mach_msg_header_t Head;
819 NDR_record_t NDR;
820 mach_voucher_selector_t which;
821 } __Request__thread_get_mach_voucher_t __attribute__((unused));
822#ifdef __MigPackStructs
823#pragma pack(pop)
824#endif
825
826#ifdef __MigPackStructs
827#pragma pack(push, 4)
828#endif
829 typedef struct {
830 mach_msg_header_t Head;
831 /* start of the kernel processed data */
832 mach_msg_body_t msgh_body;
833 mach_msg_port_descriptor_t voucher;
834 /* end of the kernel processed data */
835 } __Request__thread_set_mach_voucher_t __attribute__((unused));
836#ifdef __MigPackStructs
837#pragma pack(pop)
838#endif
839
840#ifdef __MigPackStructs
841#pragma pack(push, 4)
842#endif
843 typedef struct {
844 mach_msg_header_t Head;
845 /* start of the kernel processed data */
846 mach_msg_body_t msgh_body;
847 mach_msg_port_descriptor_t new_voucher;
848 mach_msg_port_descriptor_t old_voucher;
849 /* end of the kernel processed data */
850 } __Request__thread_swap_mach_voucher_t __attribute__((unused));
851#ifdef __MigPackStructs
852#pragma pack(pop)
853#endif
854#endif /* !__Request__thread_act_subsystem__defined */
855
856/* union of all requests */
857
858#ifndef __RequestUnion__thread_act_subsystem__defined
859#define __RequestUnion__thread_act_subsystem__defined
860union __RequestUnion__thread_act_subsystem {
861 __Request__thread_terminate_t Request_thread_terminate;
862 __Request__act_get_state_t Request_act_get_state;
863 __Request__act_set_state_t Request_act_set_state;
864 __Request__thread_get_state_t Request_thread_get_state;
865 __Request__thread_set_state_t Request_thread_set_state;
866 __Request__thread_suspend_t Request_thread_suspend;
867 __Request__thread_resume_t Request_thread_resume;
868 __Request__thread_abort_t Request_thread_abort;
869 __Request__thread_abort_safely_t Request_thread_abort_safely;
870 __Request__thread_depress_abort_t Request_thread_depress_abort;
871 __Request__thread_get_special_port_t Request_thread_get_special_port;
872 __Request__thread_set_special_port_t Request_thread_set_special_port;
873 __Request__thread_info_t Request_thread_info;
874 __Request__thread_set_exception_ports_t Request_thread_set_exception_ports;
875 __Request__thread_get_exception_ports_t Request_thread_get_exception_ports;
876 __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports;
877 __Request__thread_policy_t Request_thread_policy;
878 __Request__thread_policy_set_t Request_thread_policy_set;
879 __Request__thread_policy_get_t Request_thread_policy_get;
880 __Request__thread_sample_t Request_thread_sample;
881 __Request__etap_trace_thread_t Request_etap_trace_thread;
882 __Request__thread_assign_t Request_thread_assign;
883 __Request__thread_assign_default_t Request_thread_assign_default;
884 __Request__thread_get_assignment_t Request_thread_get_assignment;
885 __Request__thread_set_policy_t Request_thread_set_policy;
886 __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher;
887 __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher;
888 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
889};
890#endif /* !__RequestUnion__thread_act_subsystem__defined */
891/* typedefs for all replies */
892
893#ifndef __Reply__thread_act_subsystem__defined
894#define __Reply__thread_act_subsystem__defined
895
896#ifdef __MigPackStructs
897#pragma pack(push, 4)
898#endif
899 typedef struct {
900 mach_msg_header_t Head;
901 NDR_record_t NDR;
902 kern_return_t RetCode;
903 } __Reply__thread_terminate_t __attribute__((unused));
904#ifdef __MigPackStructs
905#pragma pack(pop)
906#endif
907
908#ifdef __MigPackStructs
909#pragma pack(push, 4)
910#endif
911 typedef struct {
912 mach_msg_header_t Head;
913 NDR_record_t NDR;
914 kern_return_t RetCode;
915 mach_msg_type_number_t old_stateCnt;
916 natural_t old_state[614];
917 } __Reply__act_get_state_t __attribute__((unused));
918#ifdef __MigPackStructs
919#pragma pack(pop)
920#endif
921
922#ifdef __MigPackStructs
923#pragma pack(push, 4)
924#endif
925 typedef struct {
926 mach_msg_header_t Head;
927 NDR_record_t NDR;
928 kern_return_t RetCode;
929 } __Reply__act_set_state_t __attribute__((unused));
930#ifdef __MigPackStructs
931#pragma pack(pop)
932#endif
933
934#ifdef __MigPackStructs
935#pragma pack(push, 4)
936#endif
937 typedef struct {
938 mach_msg_header_t Head;
939 NDR_record_t NDR;
940 kern_return_t RetCode;
941 mach_msg_type_number_t old_stateCnt;
942 natural_t old_state[614];
943 } __Reply__thread_get_state_t __attribute__((unused));
944#ifdef __MigPackStructs
945#pragma pack(pop)
946#endif
947
948#ifdef __MigPackStructs
949#pragma pack(push, 4)
950#endif
951 typedef struct {
952 mach_msg_header_t Head;
953 NDR_record_t NDR;
954 kern_return_t RetCode;
955 } __Reply__thread_set_state_t __attribute__((unused));
956#ifdef __MigPackStructs
957#pragma pack(pop)
958#endif
959
960#ifdef __MigPackStructs
961#pragma pack(push, 4)
962#endif
963 typedef struct {
964 mach_msg_header_t Head;
965 NDR_record_t NDR;
966 kern_return_t RetCode;
967 } __Reply__thread_suspend_t __attribute__((unused));
968#ifdef __MigPackStructs
969#pragma pack(pop)
970#endif
971
972#ifdef __MigPackStructs
973#pragma pack(push, 4)
974#endif
975 typedef struct {
976 mach_msg_header_t Head;
977 NDR_record_t NDR;
978 kern_return_t RetCode;
979 } __Reply__thread_resume_t __attribute__((unused));
980#ifdef __MigPackStructs
981#pragma pack(pop)
982#endif
983
984#ifdef __MigPackStructs
985#pragma pack(push, 4)
986#endif
987 typedef struct {
988 mach_msg_header_t Head;
989 NDR_record_t NDR;
990 kern_return_t RetCode;
991 } __Reply__thread_abort_t __attribute__((unused));
992#ifdef __MigPackStructs
993#pragma pack(pop)
994#endif
995
996#ifdef __MigPackStructs
997#pragma pack(push, 4)
998#endif
999 typedef struct {
1000 mach_msg_header_t Head;
1001 NDR_record_t NDR;
1002 kern_return_t RetCode;
1003 } __Reply__thread_abort_safely_t __attribute__((unused));
1004#ifdef __MigPackStructs
1005#pragma pack(pop)
1006#endif
1007
1008#ifdef __MigPackStructs
1009#pragma pack(push, 4)
1010#endif
1011 typedef struct {
1012 mach_msg_header_t Head;
1013 NDR_record_t NDR;
1014 kern_return_t RetCode;
1015 } __Reply__thread_depress_abort_t __attribute__((unused));
1016#ifdef __MigPackStructs
1017#pragma pack(pop)
1018#endif
1019
1020#ifdef __MigPackStructs
1021#pragma pack(push, 4)
1022#endif
1023 typedef struct {
1024 mach_msg_header_t Head;
1025 /* start of the kernel processed data */
1026 mach_msg_body_t msgh_body;
1027 mach_msg_port_descriptor_t special_port;
1028 /* end of the kernel processed data */
1029 } __Reply__thread_get_special_port_t __attribute__((unused));
1030#ifdef __MigPackStructs
1031#pragma pack(pop)
1032#endif
1033
1034#ifdef __MigPackStructs
1035#pragma pack(push, 4)
1036#endif
1037 typedef struct {
1038 mach_msg_header_t Head;
1039 NDR_record_t NDR;
1040 kern_return_t RetCode;
1041 } __Reply__thread_set_special_port_t __attribute__((unused));
1042#ifdef __MigPackStructs
1043#pragma pack(pop)
1044#endif
1045
1046#ifdef __MigPackStructs
1047#pragma pack(push, 4)
1048#endif
1049 typedef struct {
1050 mach_msg_header_t Head;
1051 NDR_record_t NDR;
1052 kern_return_t RetCode;
1053 mach_msg_type_number_t thread_info_outCnt;
1054 integer_t thread_info_out[32];
1055 } __Reply__thread_info_t __attribute__((unused));
1056#ifdef __MigPackStructs
1057#pragma pack(pop)
1058#endif
1059
1060#ifdef __MigPackStructs
1061#pragma pack(push, 4)
1062#endif
1063 typedef struct {
1064 mach_msg_header_t Head;
1065 NDR_record_t NDR;
1066 kern_return_t RetCode;
1067 } __Reply__thread_set_exception_ports_t __attribute__((unused));
1068#ifdef __MigPackStructs
1069#pragma pack(pop)
1070#endif
1071
1072#ifdef __MigPackStructs
1073#pragma pack(push, 4)
1074#endif
1075 typedef struct {
1076 mach_msg_header_t Head;
1077 /* start of the kernel processed data */
1078 mach_msg_body_t msgh_body;
1079 mach_msg_port_descriptor_t old_handlers[32];
1080 /* end of the kernel processed data */
1081 NDR_record_t NDR;
1082 mach_msg_type_number_t masksCnt;
1083 exception_mask_t masks[32];
1084 exception_behavior_t old_behaviors[32];
1085 thread_state_flavor_t old_flavors[32];
1086 } __Reply__thread_get_exception_ports_t __attribute__((unused));
1087#ifdef __MigPackStructs
1088#pragma pack(pop)
1089#endif
1090
1091#ifdef __MigPackStructs
1092#pragma pack(push, 4)
1093#endif
1094 typedef struct {
1095 mach_msg_header_t Head;
1096 /* start of the kernel processed data */
1097 mach_msg_body_t msgh_body;
1098 mach_msg_port_descriptor_t old_handlers[32];
1099 /* end of the kernel processed data */
1100 NDR_record_t NDR;
1101 mach_msg_type_number_t masksCnt;
1102 exception_mask_t masks[32];
1103 exception_behavior_t old_behaviors[32];
1104 thread_state_flavor_t old_flavors[32];
1105 } __Reply__thread_swap_exception_ports_t __attribute__((unused));
1106#ifdef __MigPackStructs
1107#pragma pack(pop)
1108#endif
1109
1110#ifdef __MigPackStructs
1111#pragma pack(push, 4)
1112#endif
1113 typedef struct {
1114 mach_msg_header_t Head;
1115 NDR_record_t NDR;
1116 kern_return_t RetCode;
1117 } __Reply__thread_policy_t __attribute__((unused));
1118#ifdef __MigPackStructs
1119#pragma pack(pop)
1120#endif
1121
1122#ifdef __MigPackStructs
1123#pragma pack(push, 4)
1124#endif
1125 typedef struct {
1126 mach_msg_header_t Head;
1127 NDR_record_t NDR;
1128 kern_return_t RetCode;
1129 } __Reply__thread_policy_set_t __attribute__((unused));
1130#ifdef __MigPackStructs
1131#pragma pack(pop)
1132#endif
1133
1134#ifdef __MigPackStructs
1135#pragma pack(push, 4)
1136#endif
1137 typedef struct {
1138 mach_msg_header_t Head;
1139 NDR_record_t NDR;
1140 kern_return_t RetCode;
1141 mach_msg_type_number_t policy_infoCnt;
1142 integer_t policy_info[16];
1143 boolean_t get_default;
1144 } __Reply__thread_policy_get_t __attribute__((unused));
1145#ifdef __MigPackStructs
1146#pragma pack(pop)
1147#endif
1148
1149#ifdef __MigPackStructs
1150#pragma pack(push, 4)
1151#endif
1152 typedef struct {
1153 mach_msg_header_t Head;
1154 NDR_record_t NDR;
1155 kern_return_t RetCode;
1156 } __Reply__thread_sample_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 NDR_record_t NDR;
1167 kern_return_t RetCode;
1168 } __Reply__etap_trace_thread_t __attribute__((unused));
1169#ifdef __MigPackStructs
1170#pragma pack(pop)
1171#endif
1172
1173#ifdef __MigPackStructs
1174#pragma pack(push, 4)
1175#endif
1176 typedef struct {
1177 mach_msg_header_t Head;
1178 NDR_record_t NDR;
1179 kern_return_t RetCode;
1180 } __Reply__thread_assign_t __attribute__((unused));
1181#ifdef __MigPackStructs
1182#pragma pack(pop)
1183#endif
1184
1185#ifdef __MigPackStructs
1186#pragma pack(push, 4)
1187#endif
1188 typedef struct {
1189 mach_msg_header_t Head;
1190 NDR_record_t NDR;
1191 kern_return_t RetCode;
1192 } __Reply__thread_assign_default_t __attribute__((unused));
1193#ifdef __MigPackStructs
1194#pragma pack(pop)
1195#endif
1196
1197#ifdef __MigPackStructs
1198#pragma pack(push, 4)
1199#endif
1200 typedef struct {
1201 mach_msg_header_t Head;
1202 /* start of the kernel processed data */
1203 mach_msg_body_t msgh_body;
1204 mach_msg_port_descriptor_t assigned_set;
1205 /* end of the kernel processed data */
1206 } __Reply__thread_get_assignment_t __attribute__((unused));
1207#ifdef __MigPackStructs
1208#pragma pack(pop)
1209#endif
1210
1211#ifdef __MigPackStructs
1212#pragma pack(push, 4)
1213#endif
1214 typedef struct {
1215 mach_msg_header_t Head;
1216 NDR_record_t NDR;
1217 kern_return_t RetCode;
1218 } __Reply__thread_set_policy_t __attribute__((unused));
1219#ifdef __MigPackStructs
1220#pragma pack(pop)
1221#endif
1222
1223#ifdef __MigPackStructs
1224#pragma pack(push, 4)
1225#endif
1226 typedef struct {
1227 mach_msg_header_t Head;
1228 /* start of the kernel processed data */
1229 mach_msg_body_t msgh_body;
1230 mach_msg_port_descriptor_t voucher;
1231 /* end of the kernel processed data */
1232 } __Reply__thread_get_mach_voucher_t __attribute__((unused));
1233#ifdef __MigPackStructs
1234#pragma pack(pop)
1235#endif
1236
1237#ifdef __MigPackStructs
1238#pragma pack(push, 4)
1239#endif
1240 typedef struct {
1241 mach_msg_header_t Head;
1242 NDR_record_t NDR;
1243 kern_return_t RetCode;
1244 } __Reply__thread_set_mach_voucher_t __attribute__((unused));
1245#ifdef __MigPackStructs
1246#pragma pack(pop)
1247#endif
1248
1249#ifdef __MigPackStructs
1250#pragma pack(push, 4)
1251#endif
1252 typedef struct {
1253 mach_msg_header_t Head;
1254 /* start of the kernel processed data */
1255 mach_msg_body_t msgh_body;
1256 mach_msg_port_descriptor_t old_voucher;
1257 /* end of the kernel processed data */
1258 } __Reply__thread_swap_mach_voucher_t __attribute__((unused));
1259#ifdef __MigPackStructs
1260#pragma pack(pop)
1261#endif
1262#endif /* !__Reply__thread_act_subsystem__defined */
1263
1264/* union of all replies */
1265
1266#ifndef __ReplyUnion__thread_act_subsystem__defined
1267#define __ReplyUnion__thread_act_subsystem__defined
1268union __ReplyUnion__thread_act_subsystem {
1269 __Reply__thread_terminate_t Reply_thread_terminate;
1270 __Reply__act_get_state_t Reply_act_get_state;
1271 __Reply__act_set_state_t Reply_act_set_state;
1272 __Reply__thread_get_state_t Reply_thread_get_state;
1273 __Reply__thread_set_state_t Reply_thread_set_state;
1274 __Reply__thread_suspend_t Reply_thread_suspend;
1275 __Reply__thread_resume_t Reply_thread_resume;
1276 __Reply__thread_abort_t Reply_thread_abort;
1277 __Reply__thread_abort_safely_t Reply_thread_abort_safely;
1278 __Reply__thread_depress_abort_t Reply_thread_depress_abort;
1279 __Reply__thread_get_special_port_t Reply_thread_get_special_port;
1280 __Reply__thread_set_special_port_t Reply_thread_set_special_port;
1281 __Reply__thread_info_t Reply_thread_info;
1282 __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports;
1283 __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports;
1284 __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports;
1285 __Reply__thread_policy_t Reply_thread_policy;
1286 __Reply__thread_policy_set_t Reply_thread_policy_set;
1287 __Reply__thread_policy_get_t Reply_thread_policy_get;
1288 __Reply__thread_sample_t Reply_thread_sample;
1289 __Reply__etap_trace_thread_t Reply_etap_trace_thread;
1290 __Reply__thread_assign_t Reply_thread_assign;
1291 __Reply__thread_assign_default_t Reply_thread_assign_default;
1292 __Reply__thread_get_assignment_t Reply_thread_get_assignment;
1293 __Reply__thread_set_policy_t Reply_thread_set_policy;
1294 __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher;
1295 __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher;
1296 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
1297};
1298#endif /* !__RequestUnion__thread_act_subsystem__defined */
1299
1300#ifndef subsystem_to_name_map_thread_act
1301#define subsystem_to_name_map_thread_act \
1302 { "thread_terminate", 3600 },\
1303 { "act_get_state", 3601 },\
1304 { "act_set_state", 3602 },\
1305 { "thread_get_state", 3603 },\
1306 { "thread_set_state", 3604 },\
1307 { "thread_suspend", 3605 },\
1308 { "thread_resume", 3606 },\
1309 { "thread_abort", 3607 },\
1310 { "thread_abort_safely", 3608 },\
1311 { "thread_depress_abort", 3609 },\
1312 { "thread_get_special_port", 3610 },\
1313 { "thread_set_special_port", 3611 },\
1314 { "thread_info", 3612 },\
1315 { "thread_set_exception_ports", 3613 },\
1316 { "thread_get_exception_ports", 3614 },\
1317 { "thread_swap_exception_ports", 3615 },\
1318 { "thread_policy", 3616 },\
1319 { "thread_policy_set", 3617 },\
1320 { "thread_policy_get", 3618 },\
1321 { "thread_sample", 3619 },\
1322 { "etap_trace_thread", 3620 },\
1323 { "thread_assign", 3621 },\
1324 { "thread_assign_default", 3622 },\
1325 { "thread_get_assignment", 3623 },\
1326 { "thread_set_policy", 3624 },\
1327 { "thread_get_mach_voucher", 3625 },\
1328 { "thread_set_mach_voucher", 3626 },\
1329 { "thread_swap_mach_voucher", 3627 }
1330#endif
1331
1332#ifdef __AfterMigUserHeader
1333__AfterMigUserHeader
1334#endif /* __AfterMigUserHeader */
1335
1336#endif /* _thread_act_user_ */
lib/libc/include/x86_64-macos-gnu/mach/thread_info.h created+211
...@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2000-2005, 2015 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/thread_info
60 *
61 * Thread information structure and definitions.
62 *
63 * The defintions in this file are exported to the user. The kernel
64 * will translate its internal data structures to these structures
65 * as appropriate.
66 *
67 */
68
69#ifndef _MACH_THREAD_INFO_H_
70#define _MACH_THREAD_INFO_H_
71
72#include <mach/boolean.h>
73#include <mach/policy.h>
74#include <mach/time_value.h>
75#include <mach/message.h>
76#include <mach/machine/vm_types.h>
77
78/*
79 * Generic information structure to allow for expansion.
80 */
81typedef natural_t thread_flavor_t;
82typedef integer_t *thread_info_t; /* varying array of int */
83
84#define THREAD_INFO_MAX (32) /* maximum array size */
85typedef integer_t thread_info_data_t[THREAD_INFO_MAX];
86
87/*
88 * Currently defined information.
89 */
90#define THREAD_BASIC_INFO 3 /* basic information */
91
92struct thread_basic_info {
93 time_value_t user_time; /* user run time */
94 time_value_t system_time; /* system run time */
95 integer_t cpu_usage; /* scaled cpu usage percentage */
96 policy_t policy; /* scheduling policy in effect */
97 integer_t run_state; /* run state (see below) */
98 integer_t flags; /* various flags (see below) */
99 integer_t suspend_count; /* suspend count for thread */
100 integer_t sleep_time; /* number of seconds that thread
101 * has been sleeping */
102};
103
104typedef struct thread_basic_info thread_basic_info_data_t;
105typedef struct thread_basic_info *thread_basic_info_t;
106#define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
107 (sizeof(thread_basic_info_data_t) / sizeof(natural_t)))
108
109#define THREAD_IDENTIFIER_INFO 4 /* thread id and other information */
110
111struct thread_identifier_info {
112 uint64_t thread_id; /* system-wide unique 64-bit thread id */
113 uint64_t thread_handle; /* handle to be used by libproc */
114 uint64_t dispatch_qaddr; /* libdispatch queue address */
115};
116
117typedef struct thread_identifier_info thread_identifier_info_data_t;
118typedef struct thread_identifier_info *thread_identifier_info_t;
119#define THREAD_IDENTIFIER_INFO_COUNT ((mach_msg_type_number_t) \
120 (sizeof(thread_identifier_info_data_t) / sizeof(natural_t)))
121
122/*
123 * Scale factor for usage field.
124 */
125
126#define TH_USAGE_SCALE 1000
127
128/*
129 * Thread run states (state field).
130 */
131
132#define TH_STATE_RUNNING 1 /* thread is running normally */
133#define TH_STATE_STOPPED 2 /* thread is stopped */
134#define TH_STATE_WAITING 3 /* thread is waiting normally */
135#define TH_STATE_UNINTERRUPTIBLE 4 /* thread is in an uninterruptible
136 * wait */
137#define TH_STATE_HALTED 5 /* thread is halted at a
138 * clean point */
139
140/*
141 * Thread flags (flags field).
142 */
143#define TH_FLAGS_SWAPPED 0x1 /* thread is swapped out */
144#define TH_FLAGS_IDLE 0x2 /* thread is an idle thread */
145#define TH_FLAGS_GLOBAL_FORCED_IDLE 0x4 /* thread performs global forced idle */
146
147/*
148 * Thread extended info (returns same info as proc_pidinfo(...,PROC_PIDTHREADINFO,...)
149 */
150#define THREAD_EXTENDED_INFO 5
151#define MAXTHREADNAMESIZE 64
152struct thread_extended_info { // same as proc_threadinfo (from proc_info.h) & proc_threadinfo_internal (from bsd_taskinfo.h)
153 uint64_t pth_user_time; /* user run time */
154 uint64_t pth_system_time; /* system run time */
155 int32_t pth_cpu_usage; /* scaled cpu usage percentage */
156 int32_t pth_policy; /* scheduling policy in effect */
157 int32_t pth_run_state; /* run state (see below) */
158 int32_t pth_flags; /* various flags (see below) */
159 int32_t pth_sleep_time; /* number of seconds that thread */
160 int32_t pth_curpri; /* cur priority*/
161 int32_t pth_priority; /* priority*/
162 int32_t pth_maxpriority; /* max priority*/
163 char pth_name[MAXTHREADNAMESIZE]; /* thread name, if any */
164};
165typedef struct thread_extended_info thread_extended_info_data_t;
166typedef struct thread_extended_info * thread_extended_info_t;
167#define THREAD_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) \
168 (sizeof(thread_extended_info_data_t) / sizeof (natural_t)))
169
170#define THREAD_DEBUG_INFO_INTERNAL 6 /* for kernel development internal info */
171
172
173#define IO_NUM_PRIORITIES 4
174
175#define UPDATE_IO_STATS(info, size) \
176{ \
177 info.count++; \
178 info.size += size; \
179}
180
181#define UPDATE_IO_STATS_ATOMIC(info, io_size) \
182{ \
183 OSIncrementAtomic64((SInt64 *)&(info.count)); \
184 OSAddAtomic64(io_size, (SInt64 *)&(info.size)); \
185}
186
187struct io_stat_entry {
188 uint64_t count;
189 uint64_t size;
190};
191
192struct io_stat_info {
193 struct io_stat_entry disk_reads;
194 struct io_stat_entry io_priority[IO_NUM_PRIORITIES];
195 struct io_stat_entry paging;
196 struct io_stat_entry metadata;
197 struct io_stat_entry total_io;
198};
199
200typedef struct io_stat_info *io_stat_info_t;
201
202
203/*
204 * Obsolete interfaces.
205 */
206
207#define THREAD_SCHED_TIMESHARE_INFO 10
208#define THREAD_SCHED_RR_INFO 11
209#define THREAD_SCHED_FIFO_INFO 12
210
211#endif /* _MACH_THREAD_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach/thread_policy.h created+266
...@@ -0,0 +1,266 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_THREAD_POLICY_H_
30#define _MACH_THREAD_POLICY_H_
31
32#include <mach/mach_types.h>
33
34/*
35 * These are the calls for accessing the policy parameters
36 * of a particular thread.
37 *
38 * The extra 'get_default' parameter to the second call is
39 * IN/OUT as follows:
40 * 1) if asserted on the way in it indicates that the default
41 * values should be returned, not the ones currently set, in
42 * this case 'get_default' will always be asserted on return;
43 * 2) if unasserted on the way in, the current settings are
44 * desired and if still unasserted on return, then the info
45 * returned reflects the current settings, otherwise if
46 * 'get_default' returns asserted, it means that there are no
47 * current settings due to other parameters taking precedence,
48 * and the default ones are being returned instead.
49 */
50
51typedef natural_t thread_policy_flavor_t;
52typedef integer_t *thread_policy_t;
53
54/*
55 * kern_return_t thread_policy_set(
56 * thread_t thread,
57 * thread_policy_flavor_t flavor,
58 * thread_policy_t policy_info,
59 * mach_msg_type_number_t count);
60 *
61 * kern_return_t thread_policy_get(
62 * thread_t thread,
63 * thread_policy_flavor_t flavor,
64 * thread_policy_t policy_info,
65 * mach_msg_type_number_t *count,
66 * boolean_t *get_default);
67 */
68
69/*
70 * Defined flavors.
71 */
72/*
73 * THREAD_STANDARD_POLICY:
74 *
75 * This is the standard (fair) scheduling mode, assigned to new
76 * threads. The thread will be given processor time in a manner
77 * which apportions approximately equal share to long running
78 * computations.
79 *
80 * Parameters:
81 * [none]
82 */
83
84#define THREAD_STANDARD_POLICY 1
85
86struct thread_standard_policy {
87 natural_t no_data;
88};
89
90typedef struct thread_standard_policy thread_standard_policy_data_t;
91typedef struct thread_standard_policy *thread_standard_policy_t;
92
93#define THREAD_STANDARD_POLICY_COUNT 0
94
95/*
96 * THREAD_EXTENDED_POLICY:
97 *
98 * Extended form of THREAD_STANDARD_POLICY, which supplies a
99 * hint indicating whether this is a long running computation.
100 *
101 * Parameters:
102 *
103 * timeshare: TRUE (the default) results in identical scheduling
104 * behavior as THREAD_STANDARD_POLICY.
105 */
106
107#define THREAD_EXTENDED_POLICY 1
108
109struct thread_extended_policy {
110 boolean_t timeshare;
111};
112
113typedef struct thread_extended_policy thread_extended_policy_data_t;
114typedef struct thread_extended_policy *thread_extended_policy_t;
115
116#define THREAD_EXTENDED_POLICY_COUNT ((mach_msg_type_number_t) \
117 (sizeof (thread_extended_policy_data_t) / sizeof (integer_t)))
118
119/*
120 * THREAD_TIME_CONSTRAINT_POLICY:
121 *
122 * This scheduling mode is for threads which have real time
123 * constraints on their execution.
124 *
125 * Parameters:
126 *
127 * period: This is the nominal amount of time between separate
128 * processing arrivals, specified in absolute time units. A
129 * value of 0 indicates that there is no inherent periodicity in
130 * the computation.
131 *
132 * computation: This is the nominal amount of computation
133 * time needed during a separate processing arrival, specified
134 * in absolute time units.
135 *
136 * constraint: This is the maximum amount of real time that
137 * may elapse from the start of a separate processing arrival
138 * to the end of computation for logically correct functioning,
139 * specified in absolute time units. Must be (>= computation).
140 * Note that latency = (constraint - computation).
141 *
142 * preemptible: This indicates that the computation may be
143 * interrupted, subject to the constraint specified above.
144 */
145
146#define THREAD_TIME_CONSTRAINT_POLICY 2
147
148struct thread_time_constraint_policy {
149 uint32_t period;
150 uint32_t computation;
151 uint32_t constraint;
152 boolean_t preemptible;
153};
154
155typedef struct thread_time_constraint_policy \
156 thread_time_constraint_policy_data_t;
157typedef struct thread_time_constraint_policy \
158 *thread_time_constraint_policy_t;
159
160#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \
161 (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t)))
162
163/*
164 * THREAD_PRECEDENCE_POLICY:
165 *
166 * This may be used to indicate the relative value of the
167 * computation compared to the other threads in the task.
168 *
169 * Parameters:
170 *
171 * importance: The importance is specified as a signed value.
172 */
173
174#define THREAD_PRECEDENCE_POLICY 3
175
176struct thread_precedence_policy {
177 integer_t importance;
178};
179
180typedef struct thread_precedence_policy thread_precedence_policy_data_t;
181typedef struct thread_precedence_policy *thread_precedence_policy_t;
182
183#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \
184 (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t)))
185
186/*
187 * THREAD_AFFINITY_POLICY:
188 *
189 * This policy is experimental.
190 * This may be used to express affinity relationships
191 * between threads in the task. Threads with the same affinity tag will
192 * be scheduled to share an L2 cache if possible. That is, affinity tags
193 * are a hint to the scheduler for thread placement.
194 *
195 * The namespace of affinity tags is generally local to one task. However,
196 * a child task created after the assignment of affinity tags by its parent
197 * will share that namespace. In particular, a family of forked processes
198 * may be created with a shared affinity namespace.
199 *
200 * Parameters:
201 * tag: The affinity set identifier.
202 */
203
204#define THREAD_AFFINITY_POLICY 4
205
206struct thread_affinity_policy {
207 integer_t affinity_tag;
208};
209
210#define THREAD_AFFINITY_TAG_NULL 0
211
212typedef struct thread_affinity_policy thread_affinity_policy_data_t;
213typedef struct thread_affinity_policy *thread_affinity_policy_t;
214
215#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \
216 (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t)))
217
218/*
219 * THREAD_BACKGROUND_POLICY:
220 */
221
222#define THREAD_BACKGROUND_POLICY 5
223
224struct thread_background_policy {
225 integer_t priority;
226};
227
228#define THREAD_BACKGROUND_POLICY_DARWIN_BG 0x1000
229
230typedef struct thread_background_policy thread_background_policy_data_t;
231typedef struct thread_background_policy *thread_background_policy_t;
232
233#define THREAD_BACKGROUND_POLICY_COUNT ((mach_msg_type_number_t) \
234 (sizeof (thread_background_policy_data_t) / sizeof (integer_t)))
235
236
237#define THREAD_LATENCY_QOS_POLICY 7
238typedef integer_t thread_latency_qos_t;
239
240struct thread_latency_qos_policy {
241 thread_latency_qos_t thread_latency_qos_tier;
242};
243
244typedef struct thread_latency_qos_policy thread_latency_qos_policy_data_t;
245typedef struct thread_latency_qos_policy *thread_latency_qos_policy_t;
246
247#define THREAD_LATENCY_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
248 (sizeof (thread_latency_qos_policy_data_t) / sizeof (integer_t)))
249
250#define THREAD_THROUGHPUT_QOS_POLICY 8
251typedef integer_t thread_throughput_qos_t;
252
253struct thread_throughput_qos_policy {
254 thread_throughput_qos_t thread_throughput_qos_tier;
255};
256
257typedef struct thread_throughput_qos_policy thread_throughput_qos_policy_data_t;
258typedef struct thread_throughput_qos_policy *thread_throughput_qos_policy_t;
259
260#define THREAD_THROUGHPUT_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
261 (sizeof (thread_throughput_qos_policy_data_t) / sizeof (integer_t)))
262
263
264
265
266#endif /* _MACH_THREAD_POLICY_H_ */
lib/libc/include/x86_64-macos-gnu/mach/thread_special_ports.h created+83
...@@ -0,0 +1,83 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/thread_special_ports.h
60 *
61 * Defines codes for special_purpose thread ports. These are NOT
62 * port identifiers - they are only used for the thread_get_special_port
63 * and thread_set_special_port routines.
64 *
65 */
66
67#ifndef _MACH_THREAD_SPECIAL_PORTS_H_
68#define _MACH_THREAD_SPECIAL_PORTS_H_
69
70#define THREAD_KERNEL_PORT 1 /* Represents the thread to the outside
71 * world.*/
72
73/*
74 * Definitions for ease of use
75 */
76
77#define thread_get_kernel_port(thread, port) \
78 (thread_get_special_port((thread), THREAD_KERNEL_PORT, (port)))
79
80#define thread_set_kernel_port(thread, port) \
81 (thread_set_special_port((thread), THREAD_KERNEL_PORT, (port)))
82
83#endif /* _MACH_THREAD_SPECIAL_PORTS_H_ */
lib/libc/include/x86_64-macos-gnu/mach/thread_switch.h created+77
...@@ -0,0 +1,77 @@
1/*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_THREAD_SWITCH_H_
60#define _MACH_THREAD_SWITCH_H_
61
62#include <mach/mach_types.h>
63#include <mach/kern_return.h>
64#include <mach/message.h>
65#include <mach/mach_traps.h>
66
67/*
68 * Constant definitions for thread_switch trap.
69 */
70
71#define SWITCH_OPTION_NONE 0
72#define SWITCH_OPTION_DEPRESS 1
73#define SWITCH_OPTION_WAIT 2
74
75#define valid_switch_option(opt) (0 <= (opt) && (opt) <= 5)
76
77#endif /* _MACH_THREAD_SWITCH_H_ */
lib/libc/include/x86_64-macos-gnu/mach/time_value.h created+96
...@@ -0,0 +1,96 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56
57#ifndef _MACH_TIME_VALUE_H_
58#define _MACH_TIME_VALUE_H_
59
60#include <mach/machine/vm_types.h>
61
62/*
63 * Time value returned by kernel.
64 */
65
66struct time_value {
67 integer_t seconds;
68 integer_t microseconds;
69};
70
71typedef struct time_value time_value_t;
72
73/*
74 * Macros to manipulate time values. Assume that time values
75 * are normalized (microseconds <= 999999).
76 */
77#define TIME_MICROS_MAX (1000000)
78
79#define time_value_add_usec(val, micros) { \
80 if (((val)->microseconds += (micros)) \
81 >= TIME_MICROS_MAX) { \
82 (val)->microseconds -= TIME_MICROS_MAX; \
83 (val)->seconds++; \
84 } \
85}
86
87#define time_value_add(result, addend) { \
88 (result)->microseconds += (addend)->microseconds; \
89 (result)->seconds += (addend)->seconds; \
90 if ((result)->microseconds >= TIME_MICROS_MAX) { \
91 (result)->microseconds -= TIME_MICROS_MAX; \
92 (result)->seconds++; \
93 } \
94}
95
96#endif /* _MACH_TIME_VALUE_H_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_attributes.h created+99
...@@ -0,0 +1,99 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/vm_attributes.h
60 * Author: Alessandro Forin
61 *
62 * Virtual memory attributes definitions.
63 *
64 * These definitions are in addition to the machine-independent
65 * ones (e.g. protection), and are only selectively supported
66 * on specific machine architectures.
67 *
68 */
69
70#ifndef _MACH_VM_ATTRIBUTES_H_
71#define _MACH_VM_ATTRIBUTES_H_
72
73/*
74 * Types of machine-dependent attributes
75 */
76typedef unsigned int vm_machine_attribute_t;
77
78#define MATTR_CACHE 1 /* cachability */
79#define MATTR_MIGRATE 2 /* migrability */
80#define MATTR_REPLICATE 4 /* replicability */
81
82/*
83 * Values for the above, e.g. operations on attribute
84 */
85typedef int vm_machine_attribute_val_t;
86
87#define MATTR_VAL_OFF 0 /* (generic) turn attribute off */
88#define MATTR_VAL_ON 1 /* (generic) turn attribute on */
89#define MATTR_VAL_GET 2 /* (generic) return current value */
90
91#define MATTR_VAL_CACHE_FLUSH 6 /* flush from all caches */
92#define MATTR_VAL_DCACHE_FLUSH 7 /* flush from data caches */
93#define MATTR_VAL_ICACHE_FLUSH 8 /* flush from instruction caches */
94#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */
95#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */
96
97#define MATTR_VAL_GET_INFO 10 /* get page info (stats) */
98
99#endif /* _MACH_VM_ATTRIBUTES_H_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_behavior.h created+79
...@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * File: mach/vm_behavior.h
33 *
34 * Virtual memory map behavior definitions.
35 *
36 */
37
38#ifndef _MACH_VM_BEHAVIOR_H_
39#define _MACH_VM_BEHAVIOR_H_
40
41/*
42 * Types defined:
43 *
44 * vm_behavior_t behavior codes.
45 */
46
47typedef int vm_behavior_t;
48
49/*
50 * Enumeration of valid values for vm_behavior_t.
51 * These describe expected page reference behavior for
52 * for a given range of virtual memory. For implementation
53 * details see vm/vm_fault.c
54 */
55
56
57/*
58 * The following behaviors affect the memory region's future behavior
59 * and are stored in the VM map entry data structure.
60 */
61#define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0) /* default */
62#define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1) /* random */
63#define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2) /* forward sequential */
64#define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3) /* reverse sequential */
65
66/*
67 * The following "behaviors" affect the memory region only at the time of the
68 * call and are not stored in the VM map entry.
69 */
70#define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4) /* will need in near future */
71#define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5) /* dont need in near future */
72#define VM_BEHAVIOR_FREE ((vm_behavior_t) 6) /* free memory without write-back */
73#define VM_BEHAVIOR_ZERO_WIRED_PAGES ((vm_behavior_t) 7) /* zero out the wired pages of an entry if it is being deleted without unwiring them first */
74#define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8)
75#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
76#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
77#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11)
78
79#endif /*_MACH_VM_BEHAVIOR_H_*/
lib/libc/include/x86_64-macos-gnu/mach/vm_inherit.h created+89
...@@ -0,0 +1,89 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/vm_inherit.h
60 * Author: Avadis Tevanian, Jr., Michael Wayne Young
61 *
62 * Virtual memory map inheritance definitions.
63 *
64 */
65
66#ifndef _MACH_VM_INHERIT_H_
67#define _MACH_VM_INHERIT_H_
68
69/*
70 * Types defined:
71 *
72 * vm_inherit_t inheritance codes.
73 */
74
75typedef unsigned int vm_inherit_t; /* might want to change this */
76
77/*
78 * Enumeration of valid values for vm_inherit_t.
79 */
80
81#define VM_INHERIT_SHARE ((vm_inherit_t) 0) /* share with child */
82#define VM_INHERIT_COPY ((vm_inherit_t) 1) /* copy into child */
83#define VM_INHERIT_NONE ((vm_inherit_t) 2) /* absent from child */
84#define VM_INHERIT_DONATE_COPY ((vm_inherit_t) 3) /* copy and delete */
85
86#define VM_INHERIT_DEFAULT VM_INHERIT_COPY
87#define VM_INHERIT_LAST_VALID VM_INHERIT_NONE
88
89#endif /* _MACH_VM_INHERIT_H_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_map.h created+1440
...@@ -0,0 +1,1440 @@
1#ifndef _vm_map_user_
2#define _vm_map_user_
3
4/* Module vm_map */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef vm_map_MSG_COUNT
52#define vm_map_MSG_COUNT 32
53#endif /* vm_map_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach_debug/mach_debug_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine vm_region */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t vm_region
76(
77 vm_map_t target_task,
78 vm_address_t *address,
79 vm_size_t *size,
80 vm_region_flavor_t flavor,
81 vm_region_info_t info,
82 mach_msg_type_number_t *infoCnt,
83 mach_port_t *object_name
84);
85
86/* Routine vm_allocate */
87#ifdef mig_external
88mig_external
89#else
90extern
91#endif /* mig_external */
92kern_return_t vm_allocate
93(
94 vm_map_t target_task,
95 vm_address_t *address,
96 vm_size_t size,
97 int flags
98);
99
100/* Routine vm_deallocate */
101#ifdef mig_external
102mig_external
103#else
104extern
105#endif /* mig_external */
106kern_return_t vm_deallocate
107(
108 vm_map_t target_task,
109 vm_address_t address,
110 vm_size_t size
111);
112
113/* Routine vm_protect */
114#ifdef mig_external
115mig_external
116#else
117extern
118#endif /* mig_external */
119kern_return_t vm_protect
120(
121 vm_map_t target_task,
122 vm_address_t address,
123 vm_size_t size,
124 boolean_t set_maximum,
125 vm_prot_t new_protection
126);
127
128/* Routine vm_inherit */
129#ifdef mig_external
130mig_external
131#else
132extern
133#endif /* mig_external */
134kern_return_t vm_inherit
135(
136 vm_map_t target_task,
137 vm_address_t address,
138 vm_size_t size,
139 vm_inherit_t new_inheritance
140);
141
142/* Routine vm_read */
143#ifdef mig_external
144mig_external
145#else
146extern
147#endif /* mig_external */
148kern_return_t vm_read
149(
150 vm_map_t target_task,
151 vm_address_t address,
152 vm_size_t size,
153 vm_offset_t *data,
154 mach_msg_type_number_t *dataCnt
155);
156
157/* Routine vm_read_list */
158#ifdef mig_external
159mig_external
160#else
161extern
162#endif /* mig_external */
163kern_return_t vm_read_list
164(
165 vm_map_t target_task,
166 vm_read_entry_t data_list,
167 natural_t count
168);
169
170/* Routine vm_write */
171#ifdef mig_external
172mig_external
173#else
174extern
175#endif /* mig_external */
176kern_return_t vm_write
177(
178 vm_map_t target_task,
179 vm_address_t address,
180 vm_offset_t data,
181 mach_msg_type_number_t dataCnt
182);
183
184/* Routine vm_copy */
185#ifdef mig_external
186mig_external
187#else
188extern
189#endif /* mig_external */
190kern_return_t vm_copy
191(
192 vm_map_t target_task,
193 vm_address_t source_address,
194 vm_size_t size,
195 vm_address_t dest_address
196);
197
198/* Routine vm_read_overwrite */
199#ifdef mig_external
200mig_external
201#else
202extern
203#endif /* mig_external */
204kern_return_t vm_read_overwrite
205(
206 vm_map_t target_task,
207 vm_address_t address,
208 vm_size_t size,
209 vm_address_t data,
210 vm_size_t *outsize
211);
212
213/* Routine vm_msync */
214#ifdef mig_external
215mig_external
216#else
217extern
218#endif /* mig_external */
219kern_return_t vm_msync
220(
221 vm_map_t target_task,
222 vm_address_t address,
223 vm_size_t size,
224 vm_sync_t sync_flags
225);
226
227/* Routine vm_behavior_set */
228#ifdef mig_external
229mig_external
230#else
231extern
232#endif /* mig_external */
233kern_return_t vm_behavior_set
234(
235 vm_map_t target_task,
236 vm_address_t address,
237 vm_size_t size,
238 vm_behavior_t new_behavior
239);
240
241/* Routine vm_map */
242#ifdef mig_external
243mig_external
244#else
245extern
246#endif /* mig_external */
247kern_return_t vm_map
248(
249 vm_map_t target_task,
250 vm_address_t *address,
251 vm_size_t size,
252 vm_address_t mask,
253 int flags,
254 mem_entry_name_port_t object,
255 vm_offset_t offset,
256 boolean_t copy,
257 vm_prot_t cur_protection,
258 vm_prot_t max_protection,
259 vm_inherit_t inheritance
260);
261
262/* Routine vm_machine_attribute */
263#ifdef mig_external
264mig_external
265#else
266extern
267#endif /* mig_external */
268kern_return_t vm_machine_attribute
269(
270 vm_map_t target_task,
271 vm_address_t address,
272 vm_size_t size,
273 vm_machine_attribute_t attribute,
274 vm_machine_attribute_val_t *value
275);
276
277/* Routine vm_remap */
278#ifdef mig_external
279mig_external
280#else
281extern
282#endif /* mig_external */
283kern_return_t vm_remap
284(
285 vm_map_t target_task,
286 vm_address_t *target_address,
287 vm_size_t size,
288 vm_address_t mask,
289 int flags,
290 vm_map_t src_task,
291 vm_address_t src_address,
292 boolean_t copy,
293 vm_prot_t *cur_protection,
294 vm_prot_t *max_protection,
295 vm_inherit_t inheritance
296);
297
298/* Routine task_wire */
299#ifdef mig_external
300mig_external
301#else
302extern
303#endif /* mig_external */
304__WATCHOS_PROHIBITED
305__TVOS_PROHIBITED
306kern_return_t task_wire
307(
308 vm_map_t target_task,
309 boolean_t must_wire
310);
311
312/* Routine mach_make_memory_entry */
313#ifdef mig_external
314mig_external
315#else
316extern
317#endif /* mig_external */
318kern_return_t mach_make_memory_entry
319(
320 vm_map_t target_task,
321 vm_size_t *size,
322 vm_offset_t offset,
323 vm_prot_t permission,
324 mem_entry_name_port_t *object_handle,
325 mem_entry_name_port_t parent_entry
326);
327
328/* Routine vm_map_page_query */
329#ifdef mig_external
330mig_external
331#else
332extern
333#endif /* mig_external */
334kern_return_t vm_map_page_query
335(
336 vm_map_t target_map,
337 vm_offset_t offset,
338 integer_t *disposition,
339 integer_t *ref_count
340);
341
342/* Routine mach_vm_region_info */
343#ifdef mig_external
344mig_external
345#else
346extern
347#endif /* mig_external */
348kern_return_t mach_vm_region_info
349(
350 vm_map_t task,
351 vm_address_t address,
352 vm_info_region_t *region,
353 vm_info_object_array_t *objects,
354 mach_msg_type_number_t *objectsCnt
355);
356
357/* Routine vm_mapped_pages_info */
358#ifdef mig_external
359mig_external
360#else
361extern
362#endif /* mig_external */
363kern_return_t vm_mapped_pages_info
364(
365 vm_map_t task,
366 page_address_array_t *pages,
367 mach_msg_type_number_t *pagesCnt
368);
369
370/* Routine vm_region_recurse */
371#ifdef mig_external
372mig_external
373#else
374extern
375#endif /* mig_external */
376kern_return_t vm_region_recurse
377(
378 vm_map_t target_task,
379 vm_address_t *address,
380 vm_size_t *size,
381 natural_t *nesting_depth,
382 vm_region_recurse_info_t info,
383 mach_msg_type_number_t *infoCnt
384);
385
386/* Routine vm_region_recurse_64 */
387#ifdef mig_external
388mig_external
389#else
390extern
391#endif /* mig_external */
392kern_return_t vm_region_recurse_64
393(
394 vm_map_t target_task,
395 vm_address_t *address,
396 vm_size_t *size,
397 natural_t *nesting_depth,
398 vm_region_recurse_info_t info,
399 mach_msg_type_number_t *infoCnt
400);
401
402/* Routine mach_vm_region_info_64 */
403#ifdef mig_external
404mig_external
405#else
406extern
407#endif /* mig_external */
408kern_return_t mach_vm_region_info_64
409(
410 vm_map_t task,
411 vm_address_t address,
412 vm_info_region_64_t *region,
413 vm_info_object_array_t *objects,
414 mach_msg_type_number_t *objectsCnt
415);
416
417/* Routine vm_region_64 */
418#ifdef mig_external
419mig_external
420#else
421extern
422#endif /* mig_external */
423kern_return_t vm_region_64
424(
425 vm_map_t target_task,
426 vm_address_t *address,
427 vm_size_t *size,
428 vm_region_flavor_t flavor,
429 vm_region_info_t info,
430 mach_msg_type_number_t *infoCnt,
431 mach_port_t *object_name
432);
433
434/* Routine mach_make_memory_entry_64 */
435#ifdef mig_external
436mig_external
437#else
438extern
439#endif /* mig_external */
440kern_return_t mach_make_memory_entry_64
441(
442 vm_map_t target_task,
443 memory_object_size_t *size,
444 memory_object_offset_t offset,
445 vm_prot_t permission,
446 mach_port_t *object_handle,
447 mem_entry_name_port_t parent_entry
448);
449
450/* Routine vm_map_64 */
451#ifdef mig_external
452mig_external
453#else
454extern
455#endif /* mig_external */
456kern_return_t vm_map_64
457(
458 vm_map_t target_task,
459 vm_address_t *address,
460 vm_size_t size,
461 vm_address_t mask,
462 int flags,
463 mem_entry_name_port_t object,
464 memory_object_offset_t offset,
465 boolean_t copy,
466 vm_prot_t cur_protection,
467 vm_prot_t max_protection,
468 vm_inherit_t inheritance
469);
470
471/* Routine vm_purgable_control */
472#ifdef mig_external
473mig_external
474#else
475extern
476#endif /* mig_external */
477kern_return_t vm_purgable_control
478(
479 vm_map_t target_task,
480 vm_address_t address,
481 vm_purgable_t control,
482 int *state
483);
484
485/* Routine vm_map_exec_lockdown */
486#ifdef mig_external
487mig_external
488#else
489extern
490#endif /* mig_external */
491kern_return_t vm_map_exec_lockdown
492(
493 vm_map_t target_task
494);
495
496__END_DECLS
497
498/********************** Caution **************************/
499/* The following data types should be used to calculate */
500/* maximum message sizes only. The actual message may be */
501/* smaller, and the position of the arguments within the */
502/* message layout may vary from what is presented here. */
503/* For example, if any of the arguments are variable- */
504/* sized, and less than the maximum is sent, the data */
505/* will be packed tight in the actual message to reduce */
506/* the presence of holes. */
507/********************** Caution **************************/
508
509/* typedefs for all requests */
510
511#ifndef __Request__vm_map_subsystem__defined
512#define __Request__vm_map_subsystem__defined
513
514#ifdef __MigPackStructs
515#pragma pack(push, 4)
516#endif
517 typedef struct {
518 mach_msg_header_t Head;
519 NDR_record_t NDR;
520 vm_address_t address;
521 vm_region_flavor_t flavor;
522 mach_msg_type_number_t infoCnt;
523 } __Request__vm_region_t __attribute__((unused));
524#ifdef __MigPackStructs
525#pragma pack(pop)
526#endif
527
528#ifdef __MigPackStructs
529#pragma pack(push, 4)
530#endif
531 typedef struct {
532 mach_msg_header_t Head;
533 NDR_record_t NDR;
534 vm_address_t address;
535 vm_size_t size;
536 int flags;
537 } __Request__vm_allocate_t __attribute__((unused));
538#ifdef __MigPackStructs
539#pragma pack(pop)
540#endif
541
542#ifdef __MigPackStructs
543#pragma pack(push, 4)
544#endif
545 typedef struct {
546 mach_msg_header_t Head;
547 NDR_record_t NDR;
548 vm_address_t address;
549 vm_size_t size;
550 } __Request__vm_deallocate_t __attribute__((unused));
551#ifdef __MigPackStructs
552#pragma pack(pop)
553#endif
554
555#ifdef __MigPackStructs
556#pragma pack(push, 4)
557#endif
558 typedef struct {
559 mach_msg_header_t Head;
560 NDR_record_t NDR;
561 vm_address_t address;
562 vm_size_t size;
563 boolean_t set_maximum;
564 vm_prot_t new_protection;
565 } __Request__vm_protect_t __attribute__((unused));
566#ifdef __MigPackStructs
567#pragma pack(pop)
568#endif
569
570#ifdef __MigPackStructs
571#pragma pack(push, 4)
572#endif
573 typedef struct {
574 mach_msg_header_t Head;
575 NDR_record_t NDR;
576 vm_address_t address;
577 vm_size_t size;
578 vm_inherit_t new_inheritance;
579 } __Request__vm_inherit_t __attribute__((unused));
580#ifdef __MigPackStructs
581#pragma pack(pop)
582#endif
583
584#ifdef __MigPackStructs
585#pragma pack(push, 4)
586#endif
587 typedef struct {
588 mach_msg_header_t Head;
589 NDR_record_t NDR;
590 vm_address_t address;
591 vm_size_t size;
592 } __Request__vm_read_t __attribute__((unused));
593#ifdef __MigPackStructs
594#pragma pack(pop)
595#endif
596
597#ifdef __MigPackStructs
598#pragma pack(push, 4)
599#endif
600 typedef struct {
601 mach_msg_header_t Head;
602 NDR_record_t NDR;
603 vm_read_entry_t data_list;
604 natural_t count;
605 } __Request__vm_read_list_t __attribute__((unused));
606#ifdef __MigPackStructs
607#pragma pack(pop)
608#endif
609
610#ifdef __MigPackStructs
611#pragma pack(push, 4)
612#endif
613 typedef struct {
614 mach_msg_header_t Head;
615 /* start of the kernel processed data */
616 mach_msg_body_t msgh_body;
617 mach_msg_ool_descriptor_t data;
618 /* end of the kernel processed data */
619 NDR_record_t NDR;
620 vm_address_t address;
621 mach_msg_type_number_t dataCnt;
622 } __Request__vm_write_t __attribute__((unused));
623#ifdef __MigPackStructs
624#pragma pack(pop)
625#endif
626
627#ifdef __MigPackStructs
628#pragma pack(push, 4)
629#endif
630 typedef struct {
631 mach_msg_header_t Head;
632 NDR_record_t NDR;
633 vm_address_t source_address;
634 vm_size_t size;
635 vm_address_t dest_address;
636 } __Request__vm_copy_t __attribute__((unused));
637#ifdef __MigPackStructs
638#pragma pack(pop)
639#endif
640
641#ifdef __MigPackStructs
642#pragma pack(push, 4)
643#endif
644 typedef struct {
645 mach_msg_header_t Head;
646 NDR_record_t NDR;
647 vm_address_t address;
648 vm_size_t size;
649 vm_address_t data;
650 } __Request__vm_read_overwrite_t __attribute__((unused));
651#ifdef __MigPackStructs
652#pragma pack(pop)
653#endif
654
655#ifdef __MigPackStructs
656#pragma pack(push, 4)
657#endif
658 typedef struct {
659 mach_msg_header_t Head;
660 NDR_record_t NDR;
661 vm_address_t address;
662 vm_size_t size;
663 vm_sync_t sync_flags;
664 } __Request__vm_msync_t __attribute__((unused));
665#ifdef __MigPackStructs
666#pragma pack(pop)
667#endif
668
669#ifdef __MigPackStructs
670#pragma pack(push, 4)
671#endif
672 typedef struct {
673 mach_msg_header_t Head;
674 NDR_record_t NDR;
675 vm_address_t address;
676 vm_size_t size;
677 vm_behavior_t new_behavior;
678 } __Request__vm_behavior_set_t __attribute__((unused));
679#ifdef __MigPackStructs
680#pragma pack(pop)
681#endif
682
683#ifdef __MigPackStructs
684#pragma pack(push, 4)
685#endif
686 typedef struct {
687 mach_msg_header_t Head;
688 /* start of the kernel processed data */
689 mach_msg_body_t msgh_body;
690 mach_msg_port_descriptor_t object;
691 /* end of the kernel processed data */
692 NDR_record_t NDR;
693 vm_address_t address;
694 vm_size_t size;
695 vm_address_t mask;
696 int flags;
697 vm_offset_t offset;
698 boolean_t copy;
699 vm_prot_t cur_protection;
700 vm_prot_t max_protection;
701 vm_inherit_t inheritance;
702 } __Request__vm_map_t __attribute__((unused));
703#ifdef __MigPackStructs
704#pragma pack(pop)
705#endif
706
707#ifdef __MigPackStructs
708#pragma pack(push, 4)
709#endif
710 typedef struct {
711 mach_msg_header_t Head;
712 NDR_record_t NDR;
713 vm_address_t address;
714 vm_size_t size;
715 vm_machine_attribute_t attribute;
716 vm_machine_attribute_val_t value;
717 } __Request__vm_machine_attribute_t __attribute__((unused));
718#ifdef __MigPackStructs
719#pragma pack(pop)
720#endif
721
722#ifdef __MigPackStructs
723#pragma pack(push, 4)
724#endif
725 typedef struct {
726 mach_msg_header_t Head;
727 /* start of the kernel processed data */
728 mach_msg_body_t msgh_body;
729 mach_msg_port_descriptor_t src_task;
730 /* end of the kernel processed data */
731 NDR_record_t NDR;
732 vm_address_t target_address;
733 vm_size_t size;
734 vm_address_t mask;
735 int flags;
736 vm_address_t src_address;
737 boolean_t copy;
738 vm_inherit_t inheritance;
739 } __Request__vm_remap_t __attribute__((unused));
740#ifdef __MigPackStructs
741#pragma pack(pop)
742#endif
743
744#ifdef __MigPackStructs
745#pragma pack(push, 4)
746#endif
747 typedef struct {
748 mach_msg_header_t Head;
749 NDR_record_t NDR;
750 boolean_t must_wire;
751 } __Request__task_wire_t __attribute__((unused));
752#ifdef __MigPackStructs
753#pragma pack(pop)
754#endif
755
756#ifdef __MigPackStructs
757#pragma pack(push, 4)
758#endif
759 typedef struct {
760 mach_msg_header_t Head;
761 /* start of the kernel processed data */
762 mach_msg_body_t msgh_body;
763 mach_msg_port_descriptor_t parent_entry;
764 /* end of the kernel processed data */
765 NDR_record_t NDR;
766 vm_size_t size;
767 vm_offset_t offset;
768 vm_prot_t permission;
769 } __Request__mach_make_memory_entry_t __attribute__((unused));
770#ifdef __MigPackStructs
771#pragma pack(pop)
772#endif
773
774#ifdef __MigPackStructs
775#pragma pack(push, 4)
776#endif
777 typedef struct {
778 mach_msg_header_t Head;
779 NDR_record_t NDR;
780 vm_offset_t offset;
781 } __Request__vm_map_page_query_t __attribute__((unused));
782#ifdef __MigPackStructs
783#pragma pack(pop)
784#endif
785
786#ifdef __MigPackStructs
787#pragma pack(push, 4)
788#endif
789 typedef struct {
790 mach_msg_header_t Head;
791 NDR_record_t NDR;
792 vm_address_t address;
793 } __Request__mach_vm_region_info_t __attribute__((unused));
794#ifdef __MigPackStructs
795#pragma pack(pop)
796#endif
797
798#ifdef __MigPackStructs
799#pragma pack(push, 4)
800#endif
801 typedef struct {
802 mach_msg_header_t Head;
803 } __Request__vm_mapped_pages_info_t __attribute__((unused));
804#ifdef __MigPackStructs
805#pragma pack(pop)
806#endif
807
808#ifdef __MigPackStructs
809#pragma pack(push, 4)
810#endif
811 typedef struct {
812 mach_msg_header_t Head;
813 NDR_record_t NDR;
814 vm_address_t address;
815 natural_t nesting_depth;
816 mach_msg_type_number_t infoCnt;
817 } __Request__vm_region_recurse_t __attribute__((unused));
818#ifdef __MigPackStructs
819#pragma pack(pop)
820#endif
821
822#ifdef __MigPackStructs
823#pragma pack(push, 4)
824#endif
825 typedef struct {
826 mach_msg_header_t Head;
827 NDR_record_t NDR;
828 vm_address_t address;
829 natural_t nesting_depth;
830 mach_msg_type_number_t infoCnt;
831 } __Request__vm_region_recurse_64_t __attribute__((unused));
832#ifdef __MigPackStructs
833#pragma pack(pop)
834#endif
835
836#ifdef __MigPackStructs
837#pragma pack(push, 4)
838#endif
839 typedef struct {
840 mach_msg_header_t Head;
841 NDR_record_t NDR;
842 vm_address_t address;
843 } __Request__mach_vm_region_info_64_t __attribute__((unused));
844#ifdef __MigPackStructs
845#pragma pack(pop)
846#endif
847
848#ifdef __MigPackStructs
849#pragma pack(push, 4)
850#endif
851 typedef struct {
852 mach_msg_header_t Head;
853 NDR_record_t NDR;
854 vm_address_t address;
855 vm_region_flavor_t flavor;
856 mach_msg_type_number_t infoCnt;
857 } __Request__vm_region_64_t __attribute__((unused));
858#ifdef __MigPackStructs
859#pragma pack(pop)
860#endif
861
862#ifdef __MigPackStructs
863#pragma pack(push, 4)
864#endif
865 typedef struct {
866 mach_msg_header_t Head;
867 /* start of the kernel processed data */
868 mach_msg_body_t msgh_body;
869 mach_msg_port_descriptor_t parent_entry;
870 /* end of the kernel processed data */
871 NDR_record_t NDR;
872 memory_object_size_t size;
873 memory_object_offset_t offset;
874 vm_prot_t permission;
875 } __Request__mach_make_memory_entry_64_t __attribute__((unused));
876#ifdef __MigPackStructs
877#pragma pack(pop)
878#endif
879
880#ifdef __MigPackStructs
881#pragma pack(push, 4)
882#endif
883 typedef struct {
884 mach_msg_header_t Head;
885 /* start of the kernel processed data */
886 mach_msg_body_t msgh_body;
887 mach_msg_port_descriptor_t object;
888 /* end of the kernel processed data */
889 NDR_record_t NDR;
890 vm_address_t address;
891 vm_size_t size;
892 vm_address_t mask;
893 int flags;
894 memory_object_offset_t offset;
895 boolean_t copy;
896 vm_prot_t cur_protection;
897 vm_prot_t max_protection;
898 vm_inherit_t inheritance;
899 } __Request__vm_map_64_t __attribute__((unused));
900#ifdef __MigPackStructs
901#pragma pack(pop)
902#endif
903
904#ifdef __MigPackStructs
905#pragma pack(push, 4)
906#endif
907 typedef struct {
908 mach_msg_header_t Head;
909 NDR_record_t NDR;
910 vm_address_t address;
911 vm_purgable_t control;
912 int state;
913 } __Request__vm_purgable_control_t __attribute__((unused));
914#ifdef __MigPackStructs
915#pragma pack(pop)
916#endif
917
918#ifdef __MigPackStructs
919#pragma pack(push, 4)
920#endif
921 typedef struct {
922 mach_msg_header_t Head;
923 } __Request__vm_map_exec_lockdown_t __attribute__((unused));
924#ifdef __MigPackStructs
925#pragma pack(pop)
926#endif
927#endif /* !__Request__vm_map_subsystem__defined */
928
929/* union of all requests */
930
931#ifndef __RequestUnion__vm_map_subsystem__defined
932#define __RequestUnion__vm_map_subsystem__defined
933union __RequestUnion__vm_map_subsystem {
934 __Request__vm_region_t Request_vm_region;
935 __Request__vm_allocate_t Request_vm_allocate;
936 __Request__vm_deallocate_t Request_vm_deallocate;
937 __Request__vm_protect_t Request_vm_protect;
938 __Request__vm_inherit_t Request_vm_inherit;
939 __Request__vm_read_t Request_vm_read;
940 __Request__vm_read_list_t Request_vm_read_list;
941 __Request__vm_write_t Request_vm_write;
942 __Request__vm_copy_t Request_vm_copy;
943 __Request__vm_read_overwrite_t Request_vm_read_overwrite;
944 __Request__vm_msync_t Request_vm_msync;
945 __Request__vm_behavior_set_t Request_vm_behavior_set;
946 __Request__vm_map_t Request_vm_map;
947 __Request__vm_machine_attribute_t Request_vm_machine_attribute;
948 __Request__vm_remap_t Request_vm_remap;
949 __Request__task_wire_t Request_task_wire;
950 __Request__mach_make_memory_entry_t Request_mach_make_memory_entry;
951 __Request__vm_map_page_query_t Request_vm_map_page_query;
952 __Request__mach_vm_region_info_t Request_mach_vm_region_info;
953 __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info;
954 __Request__vm_region_recurse_t Request_vm_region_recurse;
955 __Request__vm_region_recurse_64_t Request_vm_region_recurse_64;
956 __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64;
957 __Request__vm_region_64_t Request_vm_region_64;
958 __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64;
959 __Request__vm_map_64_t Request_vm_map_64;
960 __Request__vm_purgable_control_t Request_vm_purgable_control;
961 __Request__vm_map_exec_lockdown_t Request_vm_map_exec_lockdown;
962};
963#endif /* !__RequestUnion__vm_map_subsystem__defined */
964/* typedefs for all replies */
965
966#ifndef __Reply__vm_map_subsystem__defined
967#define __Reply__vm_map_subsystem__defined
968
969#ifdef __MigPackStructs
970#pragma pack(push, 4)
971#endif
972 typedef struct {
973 mach_msg_header_t Head;
974 /* start of the kernel processed data */
975 mach_msg_body_t msgh_body;
976 mach_msg_port_descriptor_t object_name;
977 /* end of the kernel processed data */
978 NDR_record_t NDR;
979 vm_address_t address;
980 vm_size_t size;
981 mach_msg_type_number_t infoCnt;
982 int info[10];
983 } __Reply__vm_region_t __attribute__((unused));
984#ifdef __MigPackStructs
985#pragma pack(pop)
986#endif
987
988#ifdef __MigPackStructs
989#pragma pack(push, 4)
990#endif
991 typedef struct {
992 mach_msg_header_t Head;
993 NDR_record_t NDR;
994 kern_return_t RetCode;
995 vm_address_t address;
996 } __Reply__vm_allocate_t __attribute__((unused));
997#ifdef __MigPackStructs
998#pragma pack(pop)
999#endif
1000
1001#ifdef __MigPackStructs
1002#pragma pack(push, 4)
1003#endif
1004 typedef struct {
1005 mach_msg_header_t Head;
1006 NDR_record_t NDR;
1007 kern_return_t RetCode;
1008 } __Reply__vm_deallocate_t __attribute__((unused));
1009#ifdef __MigPackStructs
1010#pragma pack(pop)
1011#endif
1012
1013#ifdef __MigPackStructs
1014#pragma pack(push, 4)
1015#endif
1016 typedef struct {
1017 mach_msg_header_t Head;
1018 NDR_record_t NDR;
1019 kern_return_t RetCode;
1020 } __Reply__vm_protect_t __attribute__((unused));
1021#ifdef __MigPackStructs
1022#pragma pack(pop)
1023#endif
1024
1025#ifdef __MigPackStructs
1026#pragma pack(push, 4)
1027#endif
1028 typedef struct {
1029 mach_msg_header_t Head;
1030 NDR_record_t NDR;
1031 kern_return_t RetCode;
1032 } __Reply__vm_inherit_t __attribute__((unused));
1033#ifdef __MigPackStructs
1034#pragma pack(pop)
1035#endif
1036
1037#ifdef __MigPackStructs
1038#pragma pack(push, 4)
1039#endif
1040 typedef struct {
1041 mach_msg_header_t Head;
1042 /* start of the kernel processed data */
1043 mach_msg_body_t msgh_body;
1044 mach_msg_ool_descriptor_t data;
1045 /* end of the kernel processed data */
1046 NDR_record_t NDR;
1047 mach_msg_type_number_t dataCnt;
1048 } __Reply__vm_read_t __attribute__((unused));
1049#ifdef __MigPackStructs
1050#pragma pack(pop)
1051#endif
1052
1053#ifdef __MigPackStructs
1054#pragma pack(push, 4)
1055#endif
1056 typedef struct {
1057 mach_msg_header_t Head;
1058 NDR_record_t NDR;
1059 kern_return_t RetCode;
1060 vm_read_entry_t data_list;
1061 } __Reply__vm_read_list_t __attribute__((unused));
1062#ifdef __MigPackStructs
1063#pragma pack(pop)
1064#endif
1065
1066#ifdef __MigPackStructs
1067#pragma pack(push, 4)
1068#endif
1069 typedef struct {
1070 mach_msg_header_t Head;
1071 NDR_record_t NDR;
1072 kern_return_t RetCode;
1073 } __Reply__vm_write_t __attribute__((unused));
1074#ifdef __MigPackStructs
1075#pragma pack(pop)
1076#endif
1077
1078#ifdef __MigPackStructs
1079#pragma pack(push, 4)
1080#endif
1081 typedef struct {
1082 mach_msg_header_t Head;
1083 NDR_record_t NDR;
1084 kern_return_t RetCode;
1085 } __Reply__vm_copy_t __attribute__((unused));
1086#ifdef __MigPackStructs
1087#pragma pack(pop)
1088#endif
1089
1090#ifdef __MigPackStructs
1091#pragma pack(push, 4)
1092#endif
1093 typedef struct {
1094 mach_msg_header_t Head;
1095 NDR_record_t NDR;
1096 kern_return_t RetCode;
1097 vm_size_t outsize;
1098 } __Reply__vm_read_overwrite_t __attribute__((unused));
1099#ifdef __MigPackStructs
1100#pragma pack(pop)
1101#endif
1102
1103#ifdef __MigPackStructs
1104#pragma pack(push, 4)
1105#endif
1106 typedef struct {
1107 mach_msg_header_t Head;
1108 NDR_record_t NDR;
1109 kern_return_t RetCode;
1110 } __Reply__vm_msync_t __attribute__((unused));
1111#ifdef __MigPackStructs
1112#pragma pack(pop)
1113#endif
1114
1115#ifdef __MigPackStructs
1116#pragma pack(push, 4)
1117#endif
1118 typedef struct {
1119 mach_msg_header_t Head;
1120 NDR_record_t NDR;
1121 kern_return_t RetCode;
1122 } __Reply__vm_behavior_set_t __attribute__((unused));
1123#ifdef __MigPackStructs
1124#pragma pack(pop)
1125#endif
1126
1127#ifdef __MigPackStructs
1128#pragma pack(push, 4)
1129#endif
1130 typedef struct {
1131 mach_msg_header_t Head;
1132 NDR_record_t NDR;
1133 kern_return_t RetCode;
1134 vm_address_t address;
1135 } __Reply__vm_map_t __attribute__((unused));
1136#ifdef __MigPackStructs
1137#pragma pack(pop)
1138#endif
1139
1140#ifdef __MigPackStructs
1141#pragma pack(push, 4)
1142#endif
1143 typedef struct {
1144 mach_msg_header_t Head;
1145 NDR_record_t NDR;
1146 kern_return_t RetCode;
1147 vm_machine_attribute_val_t value;
1148 } __Reply__vm_machine_attribute_t __attribute__((unused));
1149#ifdef __MigPackStructs
1150#pragma pack(pop)
1151#endif
1152
1153#ifdef __MigPackStructs
1154#pragma pack(push, 4)
1155#endif
1156 typedef struct {
1157 mach_msg_header_t Head;
1158 NDR_record_t NDR;
1159 kern_return_t RetCode;
1160 vm_address_t target_address;
1161 vm_prot_t cur_protection;
1162 vm_prot_t max_protection;
1163 } __Reply__vm_remap_t __attribute__((unused));
1164#ifdef __MigPackStructs
1165#pragma pack(pop)
1166#endif
1167
1168#ifdef __MigPackStructs
1169#pragma pack(push, 4)
1170#endif
1171 typedef struct {
1172 mach_msg_header_t Head;
1173 NDR_record_t NDR;
1174 kern_return_t RetCode;
1175 } __Reply__task_wire_t __attribute__((unused));
1176#ifdef __MigPackStructs
1177#pragma pack(pop)
1178#endif
1179
1180#ifdef __MigPackStructs
1181#pragma pack(push, 4)
1182#endif
1183 typedef struct {
1184 mach_msg_header_t Head;
1185 /* start of the kernel processed data */
1186 mach_msg_body_t msgh_body;
1187 mach_msg_port_descriptor_t object_handle;
1188 /* end of the kernel processed data */
1189 NDR_record_t NDR;
1190 vm_size_t size;
1191 } __Reply__mach_make_memory_entry_t __attribute__((unused));
1192#ifdef __MigPackStructs
1193#pragma pack(pop)
1194#endif
1195
1196#ifdef __MigPackStructs
1197#pragma pack(push, 4)
1198#endif
1199 typedef struct {
1200 mach_msg_header_t Head;
1201 NDR_record_t NDR;
1202 kern_return_t RetCode;
1203 integer_t disposition;
1204 integer_t ref_count;
1205 } __Reply__vm_map_page_query_t __attribute__((unused));
1206#ifdef __MigPackStructs
1207#pragma pack(pop)
1208#endif
1209
1210#ifdef __MigPackStructs
1211#pragma pack(push, 4)
1212#endif
1213 typedef struct {
1214 mach_msg_header_t Head;
1215 /* start of the kernel processed data */
1216 mach_msg_body_t msgh_body;
1217 mach_msg_ool_descriptor_t objects;
1218 /* end of the kernel processed data */
1219 NDR_record_t NDR;
1220 vm_info_region_t region;
1221 mach_msg_type_number_t objectsCnt;
1222 } __Reply__mach_vm_region_info_t __attribute__((unused));
1223#ifdef __MigPackStructs
1224#pragma pack(pop)
1225#endif
1226
1227#ifdef __MigPackStructs
1228#pragma pack(push, 4)
1229#endif
1230 typedef struct {
1231 mach_msg_header_t Head;
1232 /* start of the kernel processed data */
1233 mach_msg_body_t msgh_body;
1234 mach_msg_ool_descriptor_t pages;
1235 /* end of the kernel processed data */
1236 NDR_record_t NDR;
1237 mach_msg_type_number_t pagesCnt;
1238 } __Reply__vm_mapped_pages_info_t __attribute__((unused));
1239#ifdef __MigPackStructs
1240#pragma pack(pop)
1241#endif
1242
1243#ifdef __MigPackStructs
1244#pragma pack(push, 4)
1245#endif
1246 typedef struct {
1247 mach_msg_header_t Head;
1248 NDR_record_t NDR;
1249 kern_return_t RetCode;
1250 vm_address_t address;
1251 vm_size_t size;
1252 natural_t nesting_depth;
1253 mach_msg_type_number_t infoCnt;
1254 int info[19];
1255 } __Reply__vm_region_recurse_t __attribute__((unused));
1256#ifdef __MigPackStructs
1257#pragma pack(pop)
1258#endif
1259
1260#ifdef __MigPackStructs
1261#pragma pack(push, 4)
1262#endif
1263 typedef struct {
1264 mach_msg_header_t Head;
1265 NDR_record_t NDR;
1266 kern_return_t RetCode;
1267 vm_address_t address;
1268 vm_size_t size;
1269 natural_t nesting_depth;
1270 mach_msg_type_number_t infoCnt;
1271 int info[19];
1272 } __Reply__vm_region_recurse_64_t __attribute__((unused));
1273#ifdef __MigPackStructs
1274#pragma pack(pop)
1275#endif
1276
1277#ifdef __MigPackStructs
1278#pragma pack(push, 4)
1279#endif
1280 typedef struct {
1281 mach_msg_header_t Head;
1282 /* start of the kernel processed data */
1283 mach_msg_body_t msgh_body;
1284 mach_msg_ool_descriptor_t objects;
1285 /* end of the kernel processed data */
1286 NDR_record_t NDR;
1287 vm_info_region_64_t region;
1288 mach_msg_type_number_t objectsCnt;
1289 } __Reply__mach_vm_region_info_64_t __attribute__((unused));
1290#ifdef __MigPackStructs
1291#pragma pack(pop)
1292#endif
1293
1294#ifdef __MigPackStructs
1295#pragma pack(push, 4)
1296#endif
1297 typedef struct {
1298 mach_msg_header_t Head;
1299 /* start of the kernel processed data */
1300 mach_msg_body_t msgh_body;
1301 mach_msg_port_descriptor_t object_name;
1302 /* end of the kernel processed data */
1303 NDR_record_t NDR;
1304 vm_address_t address;
1305 vm_size_t size;
1306 mach_msg_type_number_t infoCnt;
1307 int info[10];
1308 } __Reply__vm_region_64_t __attribute__((unused));
1309#ifdef __MigPackStructs
1310#pragma pack(pop)
1311#endif
1312
1313#ifdef __MigPackStructs
1314#pragma pack(push, 4)
1315#endif
1316 typedef struct {
1317 mach_msg_header_t Head;
1318 /* start of the kernel processed data */
1319 mach_msg_body_t msgh_body;
1320 mach_msg_port_descriptor_t object_handle;
1321 /* end of the kernel processed data */
1322 NDR_record_t NDR;
1323 memory_object_size_t size;
1324 } __Reply__mach_make_memory_entry_64_t __attribute__((unused));
1325#ifdef __MigPackStructs
1326#pragma pack(pop)
1327#endif
1328
1329#ifdef __MigPackStructs
1330#pragma pack(push, 4)
1331#endif
1332 typedef struct {
1333 mach_msg_header_t Head;
1334 NDR_record_t NDR;
1335 kern_return_t RetCode;
1336 vm_address_t address;
1337 } __Reply__vm_map_64_t __attribute__((unused));
1338#ifdef __MigPackStructs
1339#pragma pack(pop)
1340#endif
1341
1342#ifdef __MigPackStructs
1343#pragma pack(push, 4)
1344#endif
1345 typedef struct {
1346 mach_msg_header_t Head;
1347 NDR_record_t NDR;
1348 kern_return_t RetCode;
1349 int state;
1350 } __Reply__vm_purgable_control_t __attribute__((unused));
1351#ifdef __MigPackStructs
1352#pragma pack(pop)
1353#endif
1354
1355#ifdef __MigPackStructs
1356#pragma pack(push, 4)
1357#endif
1358 typedef struct {
1359 mach_msg_header_t Head;
1360 NDR_record_t NDR;
1361 kern_return_t RetCode;
1362 } __Reply__vm_map_exec_lockdown_t __attribute__((unused));
1363#ifdef __MigPackStructs
1364#pragma pack(pop)
1365#endif
1366#endif /* !__Reply__vm_map_subsystem__defined */
1367
1368/* union of all replies */
1369
1370#ifndef __ReplyUnion__vm_map_subsystem__defined
1371#define __ReplyUnion__vm_map_subsystem__defined
1372union __ReplyUnion__vm_map_subsystem {
1373 __Reply__vm_region_t Reply_vm_region;
1374 __Reply__vm_allocate_t Reply_vm_allocate;
1375 __Reply__vm_deallocate_t Reply_vm_deallocate;
1376 __Reply__vm_protect_t Reply_vm_protect;
1377 __Reply__vm_inherit_t Reply_vm_inherit;
1378 __Reply__vm_read_t Reply_vm_read;
1379 __Reply__vm_read_list_t Reply_vm_read_list;
1380 __Reply__vm_write_t Reply_vm_write;
1381 __Reply__vm_copy_t Reply_vm_copy;
1382 __Reply__vm_read_overwrite_t Reply_vm_read_overwrite;
1383 __Reply__vm_msync_t Reply_vm_msync;
1384 __Reply__vm_behavior_set_t Reply_vm_behavior_set;
1385 __Reply__vm_map_t Reply_vm_map;
1386 __Reply__vm_machine_attribute_t Reply_vm_machine_attribute;
1387 __Reply__vm_remap_t Reply_vm_remap;
1388 __Reply__task_wire_t Reply_task_wire;
1389 __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry;
1390 __Reply__vm_map_page_query_t Reply_vm_map_page_query;
1391 __Reply__mach_vm_region_info_t Reply_mach_vm_region_info;
1392 __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info;
1393 __Reply__vm_region_recurse_t Reply_vm_region_recurse;
1394 __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64;
1395 __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64;
1396 __Reply__vm_region_64_t Reply_vm_region_64;
1397 __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64;
1398 __Reply__vm_map_64_t Reply_vm_map_64;
1399 __Reply__vm_purgable_control_t Reply_vm_purgable_control;
1400 __Reply__vm_map_exec_lockdown_t Reply_vm_map_exec_lockdown;
1401};
1402#endif /* !__RequestUnion__vm_map_subsystem__defined */
1403
1404#ifndef subsystem_to_name_map_vm_map
1405#define subsystem_to_name_map_vm_map \
1406 { "vm_region", 3800 },\
1407 { "vm_allocate", 3801 },\
1408 { "vm_deallocate", 3802 },\
1409 { "vm_protect", 3803 },\
1410 { "vm_inherit", 3804 },\
1411 { "vm_read", 3805 },\
1412 { "vm_read_list", 3806 },\
1413 { "vm_write", 3807 },\
1414 { "vm_copy", 3808 },\
1415 { "vm_read_overwrite", 3809 },\
1416 { "vm_msync", 3810 },\
1417 { "vm_behavior_set", 3811 },\
1418 { "vm_map", 3812 },\
1419 { "vm_machine_attribute", 3813 },\
1420 { "vm_remap", 3814 },\
1421 { "task_wire", 3815 },\
1422 { "mach_make_memory_entry", 3816 },\
1423 { "vm_map_page_query", 3817 },\
1424 { "mach_vm_region_info", 3818 },\
1425 { "vm_mapped_pages_info", 3819 },\
1426 { "vm_region_recurse", 3821 },\
1427 { "vm_region_recurse_64", 3822 },\
1428 { "mach_vm_region_info_64", 3823 },\
1429 { "vm_region_64", 3824 },\
1430 { "mach_make_memory_entry_64", 3825 },\
1431 { "vm_map_64", 3826 },\
1432 { "vm_purgable_control", 3830 },\
1433 { "vm_map_exec_lockdown", 3831 }
1434#endif
1435
1436#ifdef __AfterMigUserHeader
1437__AfterMigUserHeader
1438#endif /* __AfterMigUserHeader */
1439
1440#endif /* _vm_map_user_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_page_size.h created+68
...@@ -0,0 +1,68 @@
1/*
2 * Copyright (c) 2013 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _VM_PAGE_SIZE_H_
30#define _VM_PAGE_SIZE_H_
31
32#include <Availability.h>
33#include <mach/mach_types.h>
34#include <sys/cdefs.h>
35
36__BEGIN_DECLS
37
38/*
39 * Globally interesting numbers.
40 * These macros assume vm_page_size is a power-of-2.
41 */
42extern vm_size_t vm_page_size;
43extern vm_size_t vm_page_mask;
44extern int vm_page_shift;
45
46/*
47 * These macros assume vm_page_size is a power-of-2.
48 */
49#define trunc_page(x) ((x) & (~(vm_page_size - 1)))
50#define round_page(x) trunc_page((x) + (vm_page_size - 1))
51
52/*
53 * Page-size rounding macros for the fixed-width VM types.
54 */
55#define mach_vm_trunc_page(x) ((mach_vm_offset_t)(x) & ~((signed)vm_page_mask))
56#define mach_vm_round_page(x) (((mach_vm_offset_t)(x) + vm_page_mask) & ~((signed)vm_page_mask))
57
58
59extern vm_size_t vm_kernel_page_size __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
60extern vm_size_t vm_kernel_page_mask __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
61extern int vm_kernel_page_shift __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
62
63#define trunc_page_kernel(x) ((x) & (~vm_kernel_page_mask))
64#define round_page_kernel(x) trunc_page_kernel((x) + vm_kernel_page_mask)
65
66__END_DECLS
67
68#endif
lib/libc/include/x86_64-macos-gnu/mach/vm_purgable.h created+162
...@@ -0,0 +1,162 @@
1/*
2 * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*
30 * Virtual memory map purgeable object definitions.
31 * Objects that will be needed in the future (forward cached objects) should be queued LIFO.
32 * Objects that have been used and are cached for reuse (backward cached) should be queued FIFO.
33 * Every user of purgeable memory is entitled to using the highest volatile group (7).
34 * Only if a client wants some of its objects to definitely be purged earlier, it can put those in
35 * another group. This could be used to make all FIFO objects (in the lower group) go away before
36 * any LIFO objects (in the higher group) go away.
37 * Objects that should not get any chance to stay around can be marked as "obsolete". They will
38 * be emptied before any other objects or pages are reclaimed. Obsolete objects are not emptied
39 * in any particular order.
40 * 'purgeable' is recognized as the correct spelling. For historical reasons, definitions
41 * in this file are spelled 'purgable'.
42 */
43
44#ifndef _MACH_VM_PURGABLE_H_
45#define _MACH_VM_PURGABLE_H_
46
47/*
48 * Types defined:
49 *
50 * vm_purgable_t purgeable object control codes.
51 */
52
53typedef int vm_purgable_t;
54
55/*
56 * Enumeration of valid values for vm_purgable_t.
57 */
58#define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0) /* set state of purgeable object */
59#define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1) /* get state of purgeable object */
60#define VM_PURGABLE_PURGE_ALL ((vm_purgable_t) 2) /* purge all volatile objects now */
61#define VM_PURGABLE_SET_STATE_FROM_KERNEL ((vm_purgable_t) 3) /* set state from kernel */
62
63/*
64 * Purgeable state:
65 *
66 * 31 15 14 13 12 11 10 8 7 6 5 4 3 2 1 0
67 * +-----+--+-----+--+----+-+-+---+---+---+
68 * | |NA|DEBUG| | GRP| |B|ORD| |STA|
69 * +-----+--+-----+--+----+-+-+---+---+---+
70 * " ": unused (i.e. reserved)
71 * STA: purgeable state
72 * see: VM_PURGABLE_NONVOLATILE=0 to VM_PURGABLE_DENY=3
73 * ORD: order
74 * see:VM_VOLATILE_ORDER_*
75 * B: behavior
76 * see: VM_PURGABLE_BEHAVIOR_*
77 * GRP: group
78 * see: VM_VOLATILE_GROUP_*
79 * DEBUG: debug
80 * see: VM_PURGABLE_DEBUG_*
81 * NA: no aging
82 * see: VM_PURGABLE_NO_AGING*
83 */
84
85#define VM_PURGABLE_NO_AGING_SHIFT 16
86#define VM_PURGABLE_NO_AGING_MASK (0x1 << VM_PURGABLE_NO_AGING_SHIFT)
87#define VM_PURGABLE_NO_AGING (0x1 << VM_PURGABLE_NO_AGING_SHIFT)
88
89#define VM_PURGABLE_DEBUG_SHIFT 12
90#define VM_PURGABLE_DEBUG_MASK (0x3 << VM_PURGABLE_DEBUG_SHIFT)
91#define VM_PURGABLE_DEBUG_EMPTY (0x1 << VM_PURGABLE_DEBUG_SHIFT)
92#define VM_PURGABLE_DEBUG_FAULT (0x2 << VM_PURGABLE_DEBUG_SHIFT)
93
94/*
95 * Volatile memory ordering groups (group zero objects are purged before group 1, etc...
96 * It is implementation dependent as to whether these groups are global or per-address space.
97 * (for the moment, they are global).
98 */
99#define VM_VOLATILE_GROUP_SHIFT 8
100#define VM_VOLATILE_GROUP_MASK (7 << VM_VOLATILE_GROUP_SHIFT)
101#define VM_VOLATILE_GROUP_DEFAULT VM_VOLATILE_GROUP_0
102
103#define VM_VOLATILE_GROUP_0 (0 << VM_VOLATILE_GROUP_SHIFT)
104#define VM_VOLATILE_GROUP_1 (1 << VM_VOLATILE_GROUP_SHIFT)
105#define VM_VOLATILE_GROUP_2 (2 << VM_VOLATILE_GROUP_SHIFT)
106#define VM_VOLATILE_GROUP_3 (3 << VM_VOLATILE_GROUP_SHIFT)
107#define VM_VOLATILE_GROUP_4 (4 << VM_VOLATILE_GROUP_SHIFT)
108#define VM_VOLATILE_GROUP_5 (5 << VM_VOLATILE_GROUP_SHIFT)
109#define VM_VOLATILE_GROUP_6 (6 << VM_VOLATILE_GROUP_SHIFT)
110#define VM_VOLATILE_GROUP_7 (7 << VM_VOLATILE_GROUP_SHIFT)
111
112/*
113 * Purgeable behavior
114 * Within the same group, FIFO objects will be emptied before objects that are added later.
115 * LIFO objects will be emptied after objects that are added later.
116 * - Input only, not returned on state queries.
117 */
118#define VM_PURGABLE_BEHAVIOR_SHIFT 6
119#define VM_PURGABLE_BEHAVIOR_MASK (1 << VM_PURGABLE_BEHAVIOR_SHIFT)
120#define VM_PURGABLE_BEHAVIOR_FIFO (0 << VM_PURGABLE_BEHAVIOR_SHIFT)
121#define VM_PURGABLE_BEHAVIOR_LIFO (1 << VM_PURGABLE_BEHAVIOR_SHIFT)
122
123/*
124 * Obsolete object.
125 * Disregard volatile group, and put object into obsolete queue instead, so it is the next object
126 * to be purged.
127 * - Input only, not returned on state queries.
128 */
129#define VM_PURGABLE_ORDERING_SHIFT 5
130#define VM_PURGABLE_ORDERING_MASK (1 << VM_PURGABLE_ORDERING_SHIFT)
131#define VM_PURGABLE_ORDERING_OBSOLETE (1 << VM_PURGABLE_ORDERING_SHIFT)
132#define VM_PURGABLE_ORDERING_NORMAL (0 << VM_PURGABLE_ORDERING_SHIFT)
133
134
135/*
136 * Obsolete parameter - do not use
137 */
138#define VM_VOLATILE_ORDER_SHIFT 4
139#define VM_VOLATILE_ORDER_MASK (1 << VM_VOLATILE_ORDER_SHIFT)
140#define VM_VOLATILE_MAKE_FIRST_IN_GROUP (1 << VM_VOLATILE_ORDER_SHIFT)
141#define VM_VOLATILE_MAKE_LAST_IN_GROUP (0 << VM_VOLATILE_ORDER_SHIFT)
142
143/*
144 * Valid states of a purgeable object.
145 */
146#define VM_PURGABLE_STATE_MIN 0 /* minimum purgeable object state value */
147#define VM_PURGABLE_STATE_MAX 3 /* maximum purgeable object state value */
148#define VM_PURGABLE_STATE_MASK 3 /* mask to separate state from group */
149
150#define VM_PURGABLE_NONVOLATILE 0 /* purgeable object is non-volatile */
151#define VM_PURGABLE_VOLATILE 1 /* purgeable object is volatile */
152#define VM_PURGABLE_EMPTY 2 /* purgeable object is volatile and empty */
153#define VM_PURGABLE_DENY 3 /* (mark) object not purgeable */
154
155#define VM_PURGABLE_ALL_MASKS (VM_PURGABLE_STATE_MASK | \
156 VM_VOLATILE_ORDER_MASK | \
157 VM_PURGABLE_ORDERING_MASK | \
158 VM_PURGABLE_BEHAVIOR_MASK | \
159 VM_VOLATILE_GROUP_MASK | \
160 VM_PURGABLE_DEBUG_MASK | \
161 VM_PURGABLE_NO_AGING_MASK)
162#endif /* _MACH_VM_PURGABLE_H_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_region.h created+349
...@@ -0,0 +1,349 @@
1/*
2 * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * File: mach/vm_region.h
33 *
34 * Define the attributes of a task's memory region
35 *
36 */
37
38#ifndef _MACH_VM_REGION_H_
39#define _MACH_VM_REGION_H_
40
41#include <mach/boolean.h>
42#include <mach/vm_prot.h>
43#include <mach/vm_inherit.h>
44#include <mach/vm_behavior.h>
45#include <mach/vm_types.h>
46#include <mach/message.h>
47#include <mach/machine/vm_param.h>
48#include <mach/machine/vm_types.h>
49#include <mach/memory_object_types.h>
50
51#include <sys/cdefs.h>
52
53#pragma pack(push, 4)
54
55// LP64todo: all the current tools are 32bit, obviously never worked for 64b
56// so probably should be a real 32b ID vs. ptr.
57// Current users just check for equality
58typedef uint32_t vm32_object_id_t;
59
60/*
61 * Types defined:
62 *
63 * vm_region_info_t memory region attributes
64 */
65
66#define VM_REGION_INFO_MAX (1024)
67typedef int *vm_region_info_t;
68typedef int *vm_region_info_64_t;
69typedef int *vm_region_recurse_info_t;
70typedef int *vm_region_recurse_info_64_t;
71typedef int vm_region_flavor_t;
72typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];
73
74#define VM_REGION_BASIC_INFO_64 9
75struct vm_region_basic_info_64 {
76 vm_prot_t protection;
77 vm_prot_t max_protection;
78 vm_inherit_t inheritance;
79 boolean_t shared;
80 boolean_t reserved;
81 memory_object_offset_t offset;
82 vm_behavior_t behavior;
83 unsigned short user_wired_count;
84};
85typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t;
86typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t;
87
88#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) \
89 (sizeof(vm_region_basic_info_data_64_t)/sizeof(int)))
90
91/*
92 * Passing VM_REGION_BASIC_INFO to vm_region_64
93 * automatically converts it to a VM_REGION_BASIC_INFO_64.
94 * Please use that explicitly instead.
95 */
96#define VM_REGION_BASIC_INFO 10
97
98/*
99 * This is the legacy basic info structure. It is
100 * deprecated because it passes only a 32-bit memory object
101 * offset back - too small for many larger objects (e.g. files).
102 */
103struct vm_region_basic_info {
104 vm_prot_t protection;
105 vm_prot_t max_protection;
106 vm_inherit_t inheritance;
107 boolean_t shared;
108 boolean_t reserved;
109 uint32_t offset; /* too small for a real offset */
110 vm_behavior_t behavior;
111 unsigned short user_wired_count;
112};
113
114typedef struct vm_region_basic_info *vm_region_basic_info_t;
115typedef struct vm_region_basic_info vm_region_basic_info_data_t;
116
117#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
118 (sizeof(vm_region_basic_info_data_t)/sizeof(int)))
119
120#define SM_COW 1
121#define SM_PRIVATE 2
122#define SM_EMPTY 3
123#define SM_SHARED 4
124#define SM_TRUESHARED 5
125#define SM_PRIVATE_ALIASED 6
126#define SM_SHARED_ALIASED 7
127#define SM_LARGE_PAGE 8
128
129/*
130 * For submap info, the SM flags above are overlayed when a submap
131 * is encountered. The field denotes whether or not machine level mapping
132 * information is being shared. PTE's etc. When such sharing is taking
133 * place the value returned is SM_TRUESHARED otherwise SM_PRIVATE is passed
134 * back.
135 */
136
137
138
139
140#define VM_REGION_EXTENDED_INFO 13
141struct vm_region_extended_info {
142 vm_prot_t protection;
143 unsigned int user_tag;
144 unsigned int pages_resident;
145 unsigned int pages_shared_now_private;
146 unsigned int pages_swapped_out;
147 unsigned int pages_dirtied;
148 unsigned int ref_count;
149 unsigned short shadow_depth;
150 unsigned char external_pager;
151 unsigned char share_mode;
152 unsigned int pages_reusable;
153};
154typedef struct vm_region_extended_info *vm_region_extended_info_t;
155typedef struct vm_region_extended_info vm_region_extended_info_data_t;
156#define VM_REGION_EXTENDED_INFO_COUNT \
157 ((mach_msg_type_number_t) \
158 (sizeof (vm_region_extended_info_data_t) / sizeof (natural_t)))
159
160
161
162
163#define VM_REGION_TOP_INFO 12
164
165struct vm_region_top_info {
166 unsigned int obj_id;
167 unsigned int ref_count;
168 unsigned int private_pages_resident;
169 unsigned int shared_pages_resident;
170 unsigned char share_mode;
171};
172
173typedef struct vm_region_top_info *vm_region_top_info_t;
174typedef struct vm_region_top_info vm_region_top_info_data_t;
175
176#define VM_REGION_TOP_INFO_COUNT \
177 ((mach_msg_type_number_t) \
178 (sizeof(vm_region_top_info_data_t) / sizeof(natural_t)))
179
180
181
182/*
183 * vm_region_submap_info will return information on a submap or object.
184 * The user supplies a nesting level on the call. When a walk of the
185 * user's map is done and a submap is encountered, the nesting count is
186 * checked. If the nesting count is greater than 1 the submap is entered and
187 * the offset relative to the address in the base map is examined. If the
188 * nesting count is zero, the information on the submap is returned.
189 * The caller may thus learn about a submap and its contents by judicious
190 * choice of the base map address and nesting count. The nesting count
191 * allows penetration of recursively mapped submaps. If a submap is
192 * encountered as a mapped entry of another submap, the caller may bump
193 * the nesting count and call vm_region_recurse again on the target address
194 * range. The "is_submap" field tells the caller whether or not a submap
195 * has been encountered.
196 *
197 * Object only fields are filled in through a walking of the object shadow
198 * chain (where one is present), and a walking of the resident page queue.
199 *
200 */
201
202struct vm_region_submap_info {
203 vm_prot_t protection; /* present access protection */
204 vm_prot_t max_protection; /* max avail through vm_prot */
205 vm_inherit_t inheritance;/* behavior of map/obj on fork */
206 uint32_t offset; /* offset into object/map */
207 unsigned int user_tag; /* user tag on map entry */
208 unsigned int pages_resident; /* only valid for objects */
209 unsigned int pages_shared_now_private; /* only for objects */
210 unsigned int pages_swapped_out; /* only for objects */
211 unsigned int pages_dirtied; /* only for objects */
212 unsigned int ref_count; /* obj/map mappers, etc */
213 unsigned short shadow_depth; /* only for obj */
214 unsigned char external_pager; /* only for obj */
215 unsigned char share_mode; /* see enumeration */
216 boolean_t is_submap; /* submap vs obj */
217 vm_behavior_t behavior; /* access behavior hint */
218 vm32_object_id_t object_id; /* obj/map name, not a handle */
219 unsigned short user_wired_count;
220};
221
222typedef struct vm_region_submap_info *vm_region_submap_info_t;
223typedef struct vm_region_submap_info vm_region_submap_info_data_t;
224
225#define VM_REGION_SUBMAP_INFO_COUNT \
226 ((mach_msg_type_number_t) \
227 (sizeof(vm_region_submap_info_data_t) / sizeof(natural_t)))
228
229struct vm_region_submap_info_64 {
230 vm_prot_t protection; /* present access protection */
231 vm_prot_t max_protection; /* max avail through vm_prot */
232 vm_inherit_t inheritance;/* behavior of map/obj on fork */
233 memory_object_offset_t offset; /* offset into object/map */
234 unsigned int user_tag; /* user tag on map entry */
235 unsigned int pages_resident; /* only valid for objects */
236 unsigned int pages_shared_now_private; /* only for objects */
237 unsigned int pages_swapped_out; /* only for objects */
238 unsigned int pages_dirtied; /* only for objects */
239 unsigned int ref_count; /* obj/map mappers, etc */
240 unsigned short shadow_depth; /* only for obj */
241 unsigned char external_pager; /* only for obj */
242 unsigned char share_mode; /* see enumeration */
243 boolean_t is_submap; /* submap vs obj */
244 vm_behavior_t behavior; /* access behavior hint */
245 vm32_object_id_t object_id; /* obj/map name, not a handle */
246 unsigned short user_wired_count;
247 unsigned int pages_reusable;
248 vm_object_id_t object_id_full;
249};
250
251typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t;
252typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t;
253
254#define VM_REGION_SUBMAP_INFO_V2_SIZE \
255 (sizeof (vm_region_submap_info_data_64_t))
256#define VM_REGION_SUBMAP_INFO_V1_SIZE \
257 (VM_REGION_SUBMAP_INFO_V2_SIZE - \
258 sizeof (vm_object_id_t) /* object_id_full */ )
259#define VM_REGION_SUBMAP_INFO_V0_SIZE \
260 (VM_REGION_SUBMAP_INFO_V1_SIZE - \
261 sizeof (unsigned int) /* pages_reusable */ )
262
263#define VM_REGION_SUBMAP_INFO_V2_COUNT_64 \
264 ((mach_msg_type_number_t) \
265 (VM_REGION_SUBMAP_INFO_V2_SIZE / sizeof (natural_t)))
266#define VM_REGION_SUBMAP_INFO_V1_COUNT_64 \
267 ((mach_msg_type_number_t) \
268 (VM_REGION_SUBMAP_INFO_V1_SIZE / sizeof (natural_t)))
269#define VM_REGION_SUBMAP_INFO_V0_COUNT_64 \
270 ((mach_msg_type_number_t) \
271 (VM_REGION_SUBMAP_INFO_V0_SIZE / sizeof (natural_t)))
272
273/* set this to the latest version */
274#define VM_REGION_SUBMAP_INFO_COUNT_64 VM_REGION_SUBMAP_INFO_V2_COUNT_64
275
276struct vm_region_submap_short_info_64 {
277 vm_prot_t protection; /* present access protection */
278 vm_prot_t max_protection; /* max avail through vm_prot */
279 vm_inherit_t inheritance;/* behavior of map/obj on fork */
280 memory_object_offset_t offset; /* offset into object/map */
281 unsigned int user_tag; /* user tag on map entry */
282 unsigned int ref_count; /* obj/map mappers, etc */
283 unsigned short shadow_depth; /* only for obj */
284 unsigned char external_pager; /* only for obj */
285 unsigned char share_mode; /* see enumeration */
286 boolean_t is_submap; /* submap vs obj */
287 vm_behavior_t behavior; /* access behavior hint */
288 vm32_object_id_t object_id; /* obj/map name, not a handle */
289 unsigned short user_wired_count;
290};
291
292typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t;
293typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t;
294
295#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 \
296 ((mach_msg_type_number_t) \
297 (sizeof (vm_region_submap_short_info_data_64_t) / sizeof (natural_t)))
298
299struct mach_vm_read_entry {
300 mach_vm_address_t address;
301 mach_vm_size_t size;
302};
303
304struct vm_read_entry {
305 vm_address_t address;
306 vm_size_t size;
307};
308
309#ifdef VM32_SUPPORT
310struct vm32_read_entry {
311 vm32_address_t address;
312 vm32_size_t size;
313};
314#endif
315
316
317#define VM_MAP_ENTRY_MAX (256)
318
319typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX];
320typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX];
321#ifdef VM32_SUPPORT
322typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX];
323#endif
324
325#pragma pack(pop)
326
327
328#define VM_PAGE_INFO_MAX
329typedef int *vm_page_info_t;
330typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX];
331typedef int vm_page_info_flavor_t;
332
333#define VM_PAGE_INFO_BASIC 1
334struct vm_page_info_basic {
335 int disposition;
336 int ref_count;
337 vm_object_id_t object_id;
338 memory_object_offset_t offset;
339 int depth;
340 int __pad; /* pad to 64-bit boundary */
341};
342typedef struct vm_page_info_basic *vm_page_info_basic_t;
343typedef struct vm_page_info_basic vm_page_info_basic_data_t;
344
345#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) \
346 (sizeof(vm_page_info_basic_data_t)/sizeof(int)))
347
348
349#endif /*_MACH_VM_REGION_H_*/
lib/libc/include/x86_64-macos-gnu/mach/vm_statistics.h created+523
...@@ -0,0 +1,523 @@
1/*
2 * Copyright (c) 2000-2019 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/vm_statistics.h
60 * Author: Avadis Tevanian, Jr., Michael Wayne Young, David Golub
61 *
62 * Virtual memory statistics structure.
63 *
64 */
65
66#ifndef _MACH_VM_STATISTICS_H_
67#define _MACH_VM_STATISTICS_H_
68
69#include <mach/machine/vm_types.h>
70
71
72/*
73 * vm_statistics
74 *
75 * History:
76 * rev0 - original structure.
77 * rev1 - added purgable info (purgable_count and purges).
78 * rev2 - added speculative_count.
79 *
80 * Note: you cannot add any new fields to this structure. Add them below in
81 * vm_statistics64.
82 */
83
84struct vm_statistics {
85 natural_t free_count; /* # of pages free */
86 natural_t active_count; /* # of pages active */
87 natural_t inactive_count; /* # of pages inactive */
88 natural_t wire_count; /* # of pages wired down */
89 natural_t zero_fill_count; /* # of zero fill pages */
90 natural_t reactivations; /* # of pages reactivated */
91 natural_t pageins; /* # of pageins */
92 natural_t pageouts; /* # of pageouts */
93 natural_t faults; /* # of faults */
94 natural_t cow_faults; /* # of copy-on-writes */
95 natural_t lookups; /* object cache lookups */
96 natural_t hits; /* object cache hits */
97
98 /* added for rev1 */
99 natural_t purgeable_count; /* # of pages purgeable */
100 natural_t purges; /* # of pages purged */
101
102 /* added for rev2 */
103 /*
104 * NB: speculative pages are already accounted for in "free_count",
105 * so "speculative_count" is the number of "free" pages that are
106 * used to hold data that was read speculatively from disk but
107 * haven't actually been used by anyone so far.
108 */
109 natural_t speculative_count; /* # of pages speculative */
110};
111
112/* Used by all architectures */
113typedef struct vm_statistics *vm_statistics_t;
114typedef struct vm_statistics vm_statistics_data_t;
115
116/*
117 * vm_statistics64
118 *
119 * History:
120 * rev0 - original structure.
121 * rev1 - added purgable info (purgable_count and purges).
122 * rev2 - added speculative_count.
123 * ----
124 * rev3 - changed name to vm_statistics64.
125 * changed some fields in structure to 64-bit on
126 * arm, i386 and x86_64 architectures.
127 * rev4 - require 64-bit alignment for efficient access
128 * in the kernel. No change to reported data.
129 *
130 */
131
132struct vm_statistics64 {
133 natural_t free_count; /* # of pages free */
134 natural_t active_count; /* # of pages active */
135 natural_t inactive_count; /* # of pages inactive */
136 natural_t wire_count; /* # of pages wired down */
137 uint64_t zero_fill_count; /* # of zero fill pages */
138 uint64_t reactivations; /* # of pages reactivated */
139 uint64_t pageins; /* # of pageins */
140 uint64_t pageouts; /* # of pageouts */
141 uint64_t faults; /* # of faults */
142 uint64_t cow_faults; /* # of copy-on-writes */
143 uint64_t lookups; /* object cache lookups */
144 uint64_t hits; /* object cache hits */
145 uint64_t purges; /* # of pages purged */
146 natural_t purgeable_count; /* # of pages purgeable */
147 /*
148 * NB: speculative pages are already accounted for in "free_count",
149 * so "speculative_count" is the number of "free" pages that are
150 * used to hold data that was read speculatively from disk but
151 * haven't actually been used by anyone so far.
152 */
153 natural_t speculative_count; /* # of pages speculative */
154
155 /* added for rev1 */
156 uint64_t decompressions; /* # of pages decompressed */
157 uint64_t compressions; /* # of pages compressed */
158 uint64_t swapins; /* # of pages swapped in (via compression segments) */
159 uint64_t swapouts; /* # of pages swapped out (via compression segments) */
160 natural_t compressor_page_count; /* # of pages used by the compressed pager to hold all the compressed data */
161 natural_t throttled_count; /* # of pages throttled */
162 natural_t external_page_count; /* # of pages that are file-backed (non-swap) */
163 natural_t internal_page_count; /* # of pages that are anonymous */
164 uint64_t total_uncompressed_pages_in_compressor; /* # of pages (uncompressed) held within the compressor. */
165} __attribute__((aligned(8)));
166
167typedef struct vm_statistics64 *vm_statistics64_t;
168typedef struct vm_statistics64 vm_statistics64_data_t;
169
170/*
171 * VM_STATISTICS_TRUNCATE_TO_32_BIT
172 *
173 * This is used by host_statistics() to truncate and peg the 64-bit in-kernel values from
174 * vm_statistics64 to the 32-bit values of the older structure above (vm_statistics).
175 */
176#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value)))
177
178/*
179 * vm_extmod_statistics
180 *
181 * Structure to record modifications to a task by an
182 * external agent.
183 *
184 * History:
185 * rev0 - original structure.
186 */
187
188struct vm_extmod_statistics {
189 int64_t task_for_pid_count; /* # of times task port was looked up */
190 int64_t task_for_pid_caller_count; /* # of times this task called task_for_pid */
191 int64_t thread_creation_count; /* # of threads created in task */
192 int64_t thread_creation_caller_count; /* # of threads created by task */
193 int64_t thread_set_state_count; /* # of register state sets in task */
194 int64_t thread_set_state_caller_count; /* # of register state sets by task */
195} __attribute__((aligned(8)));
196
197typedef struct vm_extmod_statistics *vm_extmod_statistics_t;
198typedef struct vm_extmod_statistics vm_extmod_statistics_data_t;
199
200typedef struct vm_purgeable_stat {
201 uint64_t count;
202 uint64_t size;
203}vm_purgeable_stat_t;
204
205struct vm_purgeable_info {
206 vm_purgeable_stat_t fifo_data[8];
207 vm_purgeable_stat_t obsolete_data;
208 vm_purgeable_stat_t lifo_data[8];
209};
210
211typedef struct vm_purgeable_info *vm_purgeable_info_t;
212
213/* included for the vm_map_page_query call */
214
215#define VM_PAGE_QUERY_PAGE_PRESENT 0x1
216#define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2
217#define VM_PAGE_QUERY_PAGE_REF 0x4
218#define VM_PAGE_QUERY_PAGE_DIRTY 0x8
219#define VM_PAGE_QUERY_PAGE_PAGED_OUT 0x10
220#define VM_PAGE_QUERY_PAGE_COPIED 0x20
221#define VM_PAGE_QUERY_PAGE_SPECULATIVE 0x40
222#define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80
223#define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100
224#define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200
225#define VM_PAGE_QUERY_PAGE_CS_NX 0x400
226#define VM_PAGE_QUERY_PAGE_REUSABLE 0x800
227
228
229/*
230 * VM allocation flags:
231 *
232 * VM_FLAGS_FIXED
233 * (really the absence of VM_FLAGS_ANYWHERE)
234 * Allocate new VM region at the specified virtual address, if possible.
235 *
236 * VM_FLAGS_ANYWHERE
237 * Allocate new VM region anywhere it would fit in the address space.
238 *
239 * VM_FLAGS_PURGABLE
240 * Create a purgable VM object for that new VM region.
241 *
242 * VM_FLAGS_4GB_CHUNK
243 * The new VM region will be chunked up into 4GB sized pieces.
244 *
245 * VM_FLAGS_NO_PMAP_CHECK
246 * (for DEBUG kernel config only, ignored for other configs)
247 * Do not check that there is no stale pmap mapping for the new VM region.
248 * This is useful for kernel memory allocations at bootstrap when building
249 * the initial kernel address space while some memory is already in use.
250 *
251 * VM_FLAGS_OVERWRITE
252 * The new VM region can replace existing VM regions if necessary
253 * (to be used in combination with VM_FLAGS_FIXED).
254 *
255 * VM_FLAGS_NO_CACHE
256 * Pages brought in to this VM region are placed on the speculative
257 * queue instead of the active queue. In other words, they are not
258 * cached so that they will be stolen first if memory runs low.
259 */
260
261#define VM_FLAGS_FIXED 0x0000
262#define VM_FLAGS_ANYWHERE 0x0001
263#define VM_FLAGS_PURGABLE 0x0002
264#define VM_FLAGS_4GB_CHUNK 0x0004
265#define VM_FLAGS_RANDOM_ADDR 0x0008
266#define VM_FLAGS_NO_CACHE 0x0010
267#define VM_FLAGS_RESILIENT_CODESIGN 0x0020
268#define VM_FLAGS_RESILIENT_MEDIA 0x0040
269#define VM_FLAGS_OVERWRITE 0x4000 /* delete any existing mappings first */
270/*
271 * VM_FLAGS_SUPERPAGE_MASK
272 * 3 bits that specify whether large pages should be used instead of
273 * base pages (!=0), as well as the requested page size.
274 */
275#define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */
276#define VM_FLAGS_RETURN_DATA_ADDR 0x100000 /* Return address of target data, rather than base of page */
277#define VM_FLAGS_RETURN_4K_DATA_ADDR 0x800000 /* Return 4K aligned address of target data */
278#define VM_FLAGS_ALIAS_MASK 0xFF000000
279#define VM_GET_FLAGS_ALIAS(flags, alias) \
280 (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24
281#define VM_SET_FLAGS_ALIAS(flags, alias) \
282 (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \
283 (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24))
284
285/* These are the flags that we accept from user-space */
286#define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \
287 VM_FLAGS_ANYWHERE | \
288 VM_FLAGS_PURGABLE | \
289 VM_FLAGS_4GB_CHUNK | \
290 VM_FLAGS_RANDOM_ADDR | \
291 VM_FLAGS_NO_CACHE | \
292 VM_FLAGS_OVERWRITE | \
293 VM_FLAGS_SUPERPAGE_MASK | \
294 VM_FLAGS_ALIAS_MASK)
295#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \
296 VM_FLAGS_RETURN_4K_DATA_ADDR | \
297 VM_FLAGS_RETURN_DATA_ADDR)
298#define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \
299 VM_FLAGS_ANYWHERE | \
300 VM_FLAGS_RANDOM_ADDR | \
301 VM_FLAGS_OVERWRITE| \
302 VM_FLAGS_RETURN_DATA_ADDR | \
303 VM_FLAGS_RESILIENT_CODESIGN | \
304 VM_FLAGS_RESILIENT_MEDIA)
305
306#define VM_FLAGS_SUPERPAGE_SHIFT 16
307#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */
308#define SUPERPAGE_SIZE_ANY 1
309#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT)
310#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT)
311#define SUPERPAGE_SIZE_2MB 2
312#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
313
314/*
315 * EXC_GUARD definitions for virtual memory.
316 */
317#define GUARD_TYPE_VIRT_MEMORY 0x5
318
319/* Reasons for exception for virtual memory */
320enum virtual_memory_guard_exception_codes {
321 kGUARD_EXC_DEALLOC_GAP = 1u << 0
322};
323
324
325/* current accounting postmark */
326#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600
327
328/* discrete values: */
329#define VM_LEDGER_TAG_NONE 0x00000000
330#define VM_LEDGER_TAG_DEFAULT 0x00000001
331#define VM_LEDGER_TAG_NETWORK 0x00000002
332#define VM_LEDGER_TAG_MEDIA 0x00000003
333#define VM_LEDGER_TAG_GRAPHICS 0x00000004
334#define VM_LEDGER_TAG_NEURAL 0x00000005
335#define VM_LEDGER_TAG_MAX 0x00000005
336/* individual bits: */
337#define VM_LEDGER_FLAG_NO_FOOTPRINT 0x00000001
338#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT)
339
340
341#define VM_MEMORY_MALLOC 1
342#define VM_MEMORY_MALLOC_SMALL 2
343#define VM_MEMORY_MALLOC_LARGE 3
344#define VM_MEMORY_MALLOC_HUGE 4
345#define VM_MEMORY_SBRK 5// uninteresting -- no one should call
346#define VM_MEMORY_REALLOC 6
347#define VM_MEMORY_MALLOC_TINY 7
348#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8
349#define VM_MEMORY_MALLOC_LARGE_REUSED 9
350
351#define VM_MEMORY_ANALYSIS_TOOL 10
352
353#define VM_MEMORY_MALLOC_NANO 11
354#define VM_MEMORY_MALLOC_MEDIUM 12
355
356#define VM_MEMORY_MACH_MSG 20
357#define VM_MEMORY_IOKIT 21
358#define VM_MEMORY_STACK 30
359#define VM_MEMORY_GUARD 31
360#define VM_MEMORY_SHARED_PMAP 32
361/* memory containing a dylib */
362#define VM_MEMORY_DYLIB 33
363#define VM_MEMORY_OBJC_DISPATCHERS 34
364
365/* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */
366#define VM_MEMORY_UNSHARED_PMAP 35
367
368
369// Placeholders for now -- as we analyze the libraries and find how they
370// use memory, we can make these labels more specific.
371#define VM_MEMORY_APPKIT 40
372#define VM_MEMORY_FOUNDATION 41
373#define VM_MEMORY_COREGRAPHICS 42
374#define VM_MEMORY_CORESERVICES 43
375#define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES
376#define VM_MEMORY_JAVA 44
377#define VM_MEMORY_COREDATA 45
378#define VM_MEMORY_COREDATA_OBJECTIDS 46
379#define VM_MEMORY_ATS 50
380#define VM_MEMORY_LAYERKIT 51
381#define VM_MEMORY_CGIMAGE 52
382#define VM_MEMORY_TCMALLOC 53
383
384/* private raster data (i.e. layers, some images, QGL allocator) */
385#define VM_MEMORY_COREGRAPHICS_DATA 54
386
387/* shared image and font caches */
388#define VM_MEMORY_COREGRAPHICS_SHARED 55
389
390/* Memory used for virtual framebuffers, shadowing buffers, etc... */
391#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56
392
393/* Window backing stores, custom shadow data, and compressed backing stores */
394#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57
395
396/* x-alloc'd memory */
397#define VM_MEMORY_COREGRAPHICS_XALLOC 58
398
399/* catch-all for other uses, such as the read-only shared data page */
400#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
401
402/* memory allocated by the dynamic loader for itself */
403#define VM_MEMORY_DYLD 60
404/* malloc'd memory created by dyld */
405#define VM_MEMORY_DYLD_MALLOC 61
406
407/* Used for sqlite page cache */
408#define VM_MEMORY_SQLITE 62
409
410/* JavaScriptCore heaps */
411#define VM_MEMORY_JAVASCRIPT_CORE 63
412#define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE
413/* memory allocated for the JIT */
414#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
415#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
416
417/* memory allocated for GLSL */
418#define VM_MEMORY_GLSL 66
419
420/* memory allocated for OpenCL.framework */
421#define VM_MEMORY_OPENCL 67
422
423/* memory allocated for QuartzCore.framework */
424#define VM_MEMORY_COREIMAGE 68
425
426/* memory allocated for WebCore Purgeable Buffers */
427#define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69
428
429/* ImageIO memory */
430#define VM_MEMORY_IMAGEIO 70
431
432/* CoreProfile memory */
433#define VM_MEMORY_COREPROFILE 71
434
435/* assetsd / MobileSlideShow memory */
436#define VM_MEMORY_ASSETSD 72
437
438/* libsystem_kernel os_once_alloc */
439#define VM_MEMORY_OS_ALLOC_ONCE 73
440
441/* libdispatch internal allocator */
442#define VM_MEMORY_LIBDISPATCH 74
443
444/* Accelerate.framework image backing stores */
445#define VM_MEMORY_ACCELERATE 75
446
447/* CoreUI image block data */
448#define VM_MEMORY_COREUI 76
449
450/* CoreUI image file */
451#define VM_MEMORY_COREUIFILE 77
452
453/* Genealogy buffers */
454#define VM_MEMORY_GENEALOGY 78
455
456/* RawCamera VM allocated memory */
457#define VM_MEMORY_RAWCAMERA 79
458
459/* corpse info for dead process */
460#define VM_MEMORY_CORPSEINFO 80
461
462/* Apple System Logger (ASL) messages */
463#define VM_MEMORY_ASL 81
464
465/* Swift runtime */
466#define VM_MEMORY_SWIFT_RUNTIME 82
467
468/* Swift metadata */
469#define VM_MEMORY_SWIFT_METADATA 83
470
471/* DHMM data */
472#define VM_MEMORY_DHMM 84
473
474
475/* memory allocated by SceneKit.framework */
476#define VM_MEMORY_SCENEKIT 86
477
478/* memory allocated by skywalk networking */
479#define VM_MEMORY_SKYWALK 87
480
481#define VM_MEMORY_IOSURFACE 88
482
483#define VM_MEMORY_LIBNETWORK 89
484
485#define VM_MEMORY_AUDIO 90
486
487#define VM_MEMORY_VIDEOBITSTREAM 91
488
489/* memory allocated by CoreMedia */
490#define VM_MEMORY_CM_XPC 92
491
492#define VM_MEMORY_CM_RPC 93
493
494#define VM_MEMORY_CM_MEMORYPOOL 94
495
496#define VM_MEMORY_CM_READCACHE 95
497
498#define VM_MEMORY_CM_CRABS 96
499
500/* memory allocated for QuickLookThumbnailing */
501#define VM_MEMORY_QUICKLOOK_THUMBNAILS 97
502
503/* memory allocated by Accounts framework */
504#define VM_MEMORY_ACCOUNTS 98
505
506/* memory allocated by Sanitizer runtime libraries */
507#define VM_MEMORY_SANITIZER 99
508
509/* Differentiate memory needed by GPU drivers and frameworks from generic IOKit allocations */
510#define VM_MEMORY_IOACCELERATOR 100
511
512/* memory allocated by CoreMedia for global image registration of frames */
513#define VM_MEMORY_CM_REGWARP 101
514
515/* Reserve 240-255 for application */
516#define VM_MEMORY_APPLICATION_SPECIFIC_1 240
517#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
518
519#define VM_MAKE_TAG(tag) ((tag) << 24)
520
521
522
523#endif /* _MACH_VM_STATISTICS_H_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_sync.h created+80
...@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 * File: mach/vm_sync.h
58 *
59 * Virtual memory synchronisation definitions.
60 *
61 */
62
63#ifndef _MACH_VM_SYNC_H_
64#define _MACH_VM_SYNC_H_
65
66typedef unsigned vm_sync_t;
67
68/*
69 * Synchronization flags, defined as bits within the vm_sync_t type
70 */
71
72#define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01)
73#define VM_SYNC_SYNCHRONOUS ((vm_sync_t) 0x02)
74#define VM_SYNC_INVALIDATE ((vm_sync_t) 0x04)
75#define VM_SYNC_KILLPAGES ((vm_sync_t) 0x08)
76#define VM_SYNC_DEACTIVATE ((vm_sync_t) 0x10)
77#define VM_SYNC_CONTIGUOUS ((vm_sync_t) 0x20)
78#define VM_SYNC_REUSABLEPAGES ((vm_sync_t) 0x40)
79
80#endif /* _MACH_VM_SYNC_H_ */
lib/libc/include/x86_64-macos-gnu/mach/vm_types.h created+95
...@@ -0,0 +1,95 @@
1/*
2 * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 *
31 */
32#ifndef _MACH_VM_TYPES_H_
33#define _MACH_VM_TYPES_H_
34
35#include <mach/port.h>
36#include <mach/machine/vm_types.h>
37
38#include <stdint.h>
39
40typedef vm_offset_t pointer_t;
41typedef vm_offset_t vm_address_t;
42
43/*
44 * We use addr64_t for 64-bit addresses that are used on both
45 * 32 and 64-bit machines. On PPC, they are passed and returned as
46 * two adjacent 32-bit GPRs. We use addr64_t in places where
47 * common code must be useable both on 32 and 64-bit machines.
48 */
49typedef uint64_t addr64_t; /* Basic effective address */
50
51/*
52 * We use reg64_t for addresses that are 32 bits on a 32-bit
53 * machine, and 64 bits on a 64-bit machine, but are always
54 * passed and returned in a single GPR on PPC. This type
55 * cannot be used in generic 32-bit c, since on a 64-bit
56 * machine the upper half of the register will be ignored
57 * by the c compiler in 32-bit mode. In c, we can only use the
58 * type in prototypes of functions that are written in and called
59 * from assembly language. This type is basically a comment.
60 */
61typedef uint32_t reg64_t;
62
63/*
64 * To minimize the use of 64-bit fields, we keep some physical
65 * addresses (that are page aligned) as 32-bit page numbers.
66 * This limits the physical address space to 16TB of RAM.
67 */
68typedef uint32_t ppnum_t; /* Physical page number */
69#define PPNUM_MAX UINT32_MAX
70
71
72
73typedef mach_port_t vm_map_t;
74
75
76#define VM_MAP_NULL ((vm_map_t) 0)
77
78/*
79 * Evolving definitions, likely to change.
80 */
81
82typedef uint64_t vm_object_offset_t;
83typedef uint64_t vm_object_size_t;
84
85
86
87
88typedef mach_port_t upl_t;
89typedef mach_port_t vm_named_entry_t;
90
91
92#define UPL_NULL ((upl_t) 0)
93#define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0)
94
95#endif /* _MACH_VM_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach_debug/hash_info.h created+75
...@@ -0,0 +1,75 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_DEBUG_HASH_INFO_H_
60#define _MACH_DEBUG_HASH_INFO_H_
61
62#include <mach/machine/vm_types.h> /* natural_t */
63
64/*
65 * Remember to update the mig type definitions
66 * in mach_debug_types.defs when adding/removing fields.
67 */
68
69typedef struct hash_info_bucket {
70 natural_t hib_count; /* number of records in bucket */
71} hash_info_bucket_t;
72
73typedef hash_info_bucket_t *hash_info_bucket_array_t;
74
75#endif /* _MACH_DEBUG_HASH_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach_debug/ipc_info.h created+116
...@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach_debug/ipc_info.h
60 * Author: Rich Draves
61 * Date: March, 1990
62 *
63 * Definitions for the IPC debugging interface.
64 */
65
66#ifndef _MACH_DEBUG_IPC_INFO_H_
67#define _MACH_DEBUG_IPC_INFO_H_
68
69#include <mach/boolean.h>
70#include <mach/port.h>
71#include <mach/machine/vm_types.h>
72
73/*
74 * Remember to update the mig type definitions
75 * in mach_debug_types.defs when adding/removing fields.
76 */
77
78typedef struct ipc_info_space {
79 natural_t iis_genno_mask; /* generation number mask */
80 natural_t iis_table_size; /* size of table */
81 natural_t iis_table_next; /* next possible size of table */
82 natural_t iis_tree_size; /* size of tree (UNUSED) */
83 natural_t iis_tree_small; /* # of small entries in tree (UNUSED) */
84 natural_t iis_tree_hash; /* # of hashed entries in tree (UNUSED) */
85} ipc_info_space_t;
86
87typedef struct ipc_info_space_basic {
88 natural_t iisb_genno_mask; /* generation number mask */
89 natural_t iisb_table_size; /* size of table */
90 natural_t iisb_table_next; /* next possible size of table */
91 natural_t iisb_table_inuse; /* number of entries in use */
92 natural_t iisb_reserved[2]; /* future expansion */
93} ipc_info_space_basic_t;
94
95typedef struct ipc_info_name {
96 mach_port_name_t iin_name; /* port name, including gen number */
97/*boolean_t*/ integer_t iin_collision; /* collision at this entry? */
98 mach_port_type_t iin_type; /* straight port type */
99 mach_port_urefs_t iin_urefs; /* user-references */
100 natural_t iin_object; /* object pointer/identifier */
101 natural_t iin_next; /* marequest/next in free list */
102 natural_t iin_hash; /* hash index */
103} ipc_info_name_t;
104
105typedef ipc_info_name_t *ipc_info_name_array_t;
106
107/* UNUSED */
108typedef struct ipc_info_tree_name {
109 ipc_info_name_t iitn_name;
110 mach_port_name_t iitn_lchild; /* name of left child */
111 mach_port_name_t iitn_rchild; /* name of right child */
112} ipc_info_tree_name_t;
113
114typedef ipc_info_tree_name_t *ipc_info_tree_name_array_t;
115
116#endif /* _MACH_DEBUG_IPC_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach_debug/lockgroup_info.h created+74
...@@ -0,0 +1,74 @@
1/*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * File: mach/lockgroup_info.h
30 *
31 * Definitions for host_lockgroup_info call.
32 */
33
34#ifndef _MACH_DEBUG_LOCKGROUP_INFO_H_
35#define _MACH_DEBUG_LOCKGROUP_INFO_H_
36
37#include <mach/mach_types.h>
38
39#define LOCKGROUP_MAX_NAME 64
40
41#define LOCKGROUP_ATTR_STAT 0x01ULL
42
43typedef struct lockgroup_info {
44 char lockgroup_name[LOCKGROUP_MAX_NAME];
45 uint64_t lockgroup_attr;
46 uint64_t lock_spin_cnt;
47 uint64_t lock_spin_util_cnt;
48 uint64_t lock_spin_held_cnt;
49 uint64_t lock_spin_miss_cnt;
50 uint64_t lock_spin_held_max;
51 uint64_t lock_spin_held_cum;
52 uint64_t lock_mtx_cnt;
53 uint64_t lock_mtx_util_cnt;
54 uint64_t lock_mtx_held_cnt;
55 uint64_t lock_mtx_miss_cnt;
56 uint64_t lock_mtx_wait_cnt;
57 uint64_t lock_mtx_held_max;
58 uint64_t lock_mtx_held_cum;
59 uint64_t lock_mtx_wait_max;
60 uint64_t lock_mtx_wait_cum;
61 uint64_t lock_rw_cnt;
62 uint64_t lock_rw_util_cnt;
63 uint64_t lock_rw_held_cnt;
64 uint64_t lock_rw_miss_cnt;
65 uint64_t lock_rw_wait_cnt;
66 uint64_t lock_rw_held_max;
67 uint64_t lock_rw_held_cum;
68 uint64_t lock_rw_wait_max;
69 uint64_t lock_rw_wait_cum;
70} lockgroup_info_t;
71
72typedef lockgroup_info_t *lockgroup_info_array_t;
73
74#endif /* _MACH_DEBUG_LOCKGROUP_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach_debug/mach_debug_types.h created+95
...@@ -0,0 +1,95 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * Mach kernel debugging interface type declarations
60 */
61
62#ifndef _MACH_DEBUG_MACH_DEBUG_TYPES_H_
63#define _MACH_DEBUG_MACH_DEBUG_TYPES_H_
64
65#include <mach_debug/ipc_info.h>
66#include <mach_debug/vm_info.h>
67#include <mach_debug/zone_info.h>
68#include <mach_debug/page_info.h>
69#include <mach_debug/hash_info.h>
70#include <mach_debug/lockgroup_info.h>
71
72#define MACH_CORE_FILEHEADER_SIGNATURE 0x0063614d20646152ULL
73#define MACH_CORE_FILEHEADER_MAXFILES 16
74#define MACH_CORE_FILEHEADER_NAMELEN 16
75
76typedef char symtab_name_t[32];
77
78struct mach_core_details {
79 uint64_t gzip_offset;
80 uint64_t gzip_length;
81 char core_name[MACH_CORE_FILEHEADER_NAMELEN];
82};
83
84struct mach_core_fileheader {
85 uint64_t signature;
86 uint64_t log_offset;
87 uint64_t log_length;
88 uint64_t num_files;
89 struct mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES];
90};
91
92#define KOBJECT_DESCRIPTION_LENGTH 512
93typedef char kobject_description_t[KOBJECT_DESCRIPTION_LENGTH];
94
95#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
lib/libc/include/x86_64-macos-gnu/mach_debug/page_info.h created+64
...@@ -0,0 +1,64 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58#ifndef MACH_DEBUG_PAGE_INFO_H
59#define MACH_DEBUG_PAGE_INFO_H
60
61#include <mach/machine/vm_types.h>
62
63typedef vm_offset_t *page_address_array_t;
64#endif /* MACH_DEBUG_PAGE_INFO_H */
lib/libc/include/x86_64-macos-gnu/mach_debug/vm_info.h created+149
...@@ -0,0 +1,149 @@
1/*
2 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 * File: mach_debug/vm_info.h
58 * Author: Rich Draves
59 * Date: March, 1990
60 *
61 * Definitions for the VM debugging interface.
62 */
63
64#ifndef _MACH_DEBUG_VM_INFO_H_
65#define _MACH_DEBUG_VM_INFO_H_
66
67#include <mach/boolean.h>
68#include <mach/machine/vm_types.h>
69#include <mach/vm_inherit.h>
70#include <mach/vm_prot.h>
71#include <mach/memory_object_types.h>
72
73#pragma pack(4)
74
75/*
76 * Remember to update the mig type definitions
77 * in mach_debug_types.defs when adding/removing fields.
78 */
79typedef struct mach_vm_info_region {
80 mach_vm_offset_t vir_start; /* start of region */
81 mach_vm_offset_t vir_end; /* end of region */
82 mach_vm_offset_t vir_object; /* the mapped object(kernal addr) */
83 memory_object_offset_t vir_offset; /* offset into object */
84 boolean_t vir_needs_copy; /* does object need to be copied? */
85 vm_prot_t vir_protection; /* protection code */
86 vm_prot_t vir_max_protection; /* maximum protection */
87 vm_inherit_t vir_inheritance; /* inheritance */
88 natural_t vir_wired_count; /* number of times wired */
89 natural_t vir_user_wired_count; /* number of times user has wired */
90} mach_vm_info_region_t;
91
92typedef struct vm_info_region_64 {
93 natural_t vir_start; /* start of region */
94 natural_t vir_end; /* end of region */
95 natural_t vir_object; /* the mapped object */
96 memory_object_offset_t vir_offset; /* offset into object */
97 boolean_t vir_needs_copy; /* does object need to be copied? */
98 vm_prot_t vir_protection; /* protection code */
99 vm_prot_t vir_max_protection; /* maximum protection */
100 vm_inherit_t vir_inheritance; /* inheritance */
101 natural_t vir_wired_count; /* number of times wired */
102 natural_t vir_user_wired_count; /* number of times user has wired */
103} vm_info_region_64_t;
104
105typedef struct vm_info_region {
106 natural_t vir_start; /* start of region */
107 natural_t vir_end; /* end of region */
108 natural_t vir_object; /* the mapped object */
109 natural_t vir_offset; /* offset into object */
110 boolean_t vir_needs_copy; /* does object need to be copied? */
111 vm_prot_t vir_protection; /* protection code */
112 vm_prot_t vir_max_protection; /* maximum protection */
113 vm_inherit_t vir_inheritance; /* inheritance */
114 natural_t vir_wired_count; /* number of times wired */
115 natural_t vir_user_wired_count; /* number of times user has wired */
116} vm_info_region_t;
117
118
119typedef struct vm_info_object {
120 natural_t vio_object; /* this object */
121 natural_t vio_size; /* object size (valid if internal - but too small) */
122 unsigned int vio_ref_count; /* number of references */
123 unsigned int vio_resident_page_count; /* number of resident pages */
124 unsigned int vio_absent_count; /* number requested but not filled */
125 natural_t vio_copy; /* copy object */
126 natural_t vio_shadow; /* shadow object */
127 natural_t vio_shadow_offset; /* offset into shadow object */
128 natural_t vio_paging_offset; /* offset into memory object */
129 memory_object_copy_strategy_t vio_copy_strategy;
130 /* how to handle data copy */
131 vm_offset_t vio_last_alloc; /* offset of last allocation */
132 /* many random attributes */
133 unsigned int vio_paging_in_progress;
134 boolean_t vio_pager_created;
135 boolean_t vio_pager_initialized;
136 boolean_t vio_pager_ready;
137 boolean_t vio_can_persist;
138 boolean_t vio_internal;
139 boolean_t vio_temporary;
140 boolean_t vio_alive;
141 boolean_t vio_purgable;
142 boolean_t vio_purgable_volatile;
143} vm_info_object_t;
144
145typedef vm_info_object_t *vm_info_object_array_t;
146
147#pragma pack()
148
149#endif /* _MACH_DEBUG_VM_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/mach_debug/zone_info.h created+201
...@@ -0,0 +1,201 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_DEBUG_ZONE_INFO_H_
60#define _MACH_DEBUG_ZONE_INFO_H_
61
62#include <mach/boolean.h>
63#include <mach/machine/vm_types.h>
64
65/*
66 * Legacy definitions for host_zone_info(). This interface, and
67 * these definitions have been deprecated in favor of the new
68 * mach_zone_info() inteface and types below.
69 */
70
71#define ZONE_NAME_MAX_LEN 80
72
73typedef struct zone_name {
74 char zn_name[ZONE_NAME_MAX_LEN];
75} zone_name_t;
76
77typedef zone_name_t *zone_name_array_t;
78
79
80typedef struct zone_info {
81 integer_t zi_count; /* Number of elements used now */
82 vm_size_t zi_cur_size; /* current memory utilization */
83 vm_size_t zi_max_size; /* how large can this zone grow */
84 vm_size_t zi_elem_size; /* size of an element */
85 vm_size_t zi_alloc_size; /* size used for more memory */
86 integer_t zi_pageable; /* zone pageable? */
87 integer_t zi_sleepable; /* sleep if empty? */
88 integer_t zi_exhaustible; /* merely return if empty? */
89 integer_t zi_collectable; /* garbage collect elements? */
90} zone_info_t;
91
92typedef zone_info_t *zone_info_array_t;
93
94
95/*
96 * Remember to update the mig type definitions
97 * in mach_debug_types.defs when adding/removing fields.
98 */
99
100#define MACH_ZONE_NAME_MAX_LEN 80
101
102typedef struct mach_zone_name {
103 char mzn_name[ZONE_NAME_MAX_LEN];
104} mach_zone_name_t;
105
106typedef mach_zone_name_t *mach_zone_name_array_t;
107
108typedef struct mach_zone_info_data {
109 uint64_t mzi_count; /* count of elements in use */
110 uint64_t mzi_cur_size; /* current memory utilization */
111 uint64_t mzi_max_size; /* how large can this zone grow */
112 uint64_t mzi_elem_size; /* size of an element */
113 uint64_t mzi_alloc_size; /* size used for more memory */
114 uint64_t mzi_sum_size; /* sum of all allocs (life of zone) */
115 uint64_t mzi_exhaustible; /* merely return if empty? */
116 uint64_t mzi_collectable; /* garbage collect elements? and how much? */
117} mach_zone_info_t;
118
119typedef mach_zone_info_t *mach_zone_info_array_t;
120
121/*
122 * The lowest bit of mzi_collectable indicates whether or not the zone
123 * is collectable by zone_gc(). The higher bits contain the size in bytes
124 * that can be collected.
125 */
126#define GET_MZI_COLLECTABLE_BYTES(val) ((val) >> 1)
127#define GET_MZI_COLLECTABLE_FLAG(val) ((val) & 1)
128
129#define SET_MZI_COLLECTABLE_BYTES(val, size) \
130 (val) = ((val) & 1) | ((size) << 1)
131#define SET_MZI_COLLECTABLE_FLAG(val, flag) \
132 (val) = (flag) ? ((val) | 1) : (val)
133
134typedef struct task_zone_info_data {
135 uint64_t tzi_count; /* count of elements in use */
136 uint64_t tzi_cur_size; /* current memory utilization */
137 uint64_t tzi_max_size; /* how large can this zone grow */
138 uint64_t tzi_elem_size; /* size of an element */
139 uint64_t tzi_alloc_size; /* size used for more memory */
140 uint64_t tzi_sum_size; /* sum of all allocs (life of zone) */
141 uint64_t tzi_exhaustible; /* merely return if empty? */
142 uint64_t tzi_collectable; /* garbage collect elements? */
143 uint64_t tzi_caller_acct; /* charged to caller (or kernel) */
144 uint64_t tzi_task_alloc; /* sum of all allocs by this task */
145 uint64_t tzi_task_free; /* sum of all frees by this task */
146} task_zone_info_t;
147
148typedef task_zone_info_t *task_zone_info_array_t;
149
150#define MACH_MEMORY_INFO_NAME_MAX_LEN 80
151
152typedef struct mach_memory_info {
153 uint64_t flags;
154 uint64_t site;
155 uint64_t size;
156 uint64_t free;
157 uint64_t largest;
158 uint64_t collectable_bytes;
159 uint64_t mapped;
160 uint64_t peak;
161 uint16_t tag;
162 uint16_t zone;
163 uint16_t _resvA[2];
164 uint64_t _resv[3];
165 char name[MACH_MEMORY_INFO_NAME_MAX_LEN];
166} mach_memory_info_t;
167
168typedef mach_memory_info_t *mach_memory_info_array_t;
169
170/*
171 * MAX_ZTRACE_DEPTH configures how deep of a stack trace is taken on each zalloc in the zone of interest. 15
172 * levels is usually enough to get past all the layers of code in kalloc and IOKit and see who the actual
173 * caller is up above these lower levels.
174 *
175 * This is used both for the zone leak detector and the zone corruption log. Make sure this isn't greater than
176 * BTLOG_MAX_DEPTH defined in btlog.h. Also make sure to update the definition of zone_btrecord_t in
177 * mach_debug_types.defs if this changes.
178 */
179
180#define MAX_ZTRACE_DEPTH 15
181
182/*
183 * Opcodes for the btlog operation field:
184 */
185
186#define ZOP_ALLOC 1
187#define ZOP_FREE 0
188
189/*
190 * Structure used to copy out btlog records to userspace, via the MIG call
191 * mach_zone_get_btlog_records().
192 */
193typedef struct zone_btrecord {
194 uint32_t ref_count; /* no. of active references on the record */
195 uint32_t operation_type; /* operation type (alloc/free) */
196 uint64_t bt[MAX_ZTRACE_DEPTH]; /* backtrace */
197} zone_btrecord_t;
198
199typedef zone_btrecord_t *zone_btrecord_array_t;
200
201#endif /* _MACH_DEBUG_ZONE_INFO_H_ */
lib/libc/include/x86_64-macos-gnu/os/availability.h created+165
...@@ -0,0 +1,165 @@
1/*
2 * Copyright (c) 2008-2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * @APPLE_APACHE_LICENSE_HEADER_END@
19 */
20
21#ifndef __OS_AVAILABILITY__
22#define __OS_AVAILABILITY__
23
24/*
25 * API_TO_BE_DEPRECATED is used as a version number in API that will be deprecated
26 * in an upcoming release. This soft deprecation is an intermediate step before formal
27 * deprecation to notify developers about the API before compiler warnings are generated.
28 * You can find all places in your code that use soft deprecated API by redefining the
29 * value of this macro to your current minimum deployment target, for example:
30 * (macOS)
31 * clang -DAPI_TO_BE_DEPRECATED=10.12 <other compiler flags>
32 * (iOS)
33 * clang -DAPI_TO_BE_DEPRECATED=11.0 <other compiler flags>
34 */
35
36#ifndef API_TO_BE_DEPRECATED
37#define API_TO_BE_DEPRECATED 100000
38#endif
39
40#include <AvailabilityInternal.h>
41
42
43
44#if defined(__has_feature) && defined(__has_attribute)
45 #if __has_attribute(availability)
46
47 /*
48 * API Introductions
49 *
50 * Use to specify the release that a particular API became available.
51 *
52 * Platform names:
53 * macos, ios, tvos, watchos
54 *
55 * Examples:
56 * API_AVAILABLE(macos(10.10))
57 * API_AVAILABLE(macos(10.9), ios(10.0))
58 * API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
59 */
60
61 #define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7, __API_AVAILABLE6, __API_AVAILABLE5, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1, 0)(__VA_ARGS__)
62
63 #define API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6, __API_AVAILABLE_BEGIN5, __API_AVAILABLE_BEGIN4, __API_AVAILABLE_BEGIN3, __API_AVAILABLE_BEGIN2, __API_AVAILABLE_BEGIN1, 0)(__VA_ARGS__)
64 #define API_AVAILABLE_END _Pragma("clang attribute pop")
65
66 /*
67 * API Deprecations
68 *
69 * Use to specify the release that a particular API became unavailable.
70 *
71 * Platform names:
72 * macos, ios, tvos, watchos
73 *
74 * Examples:
75 *
76 * API_DEPRECATED("No longer supported", macos(10.4, 10.8))
77 * API_DEPRECATED("No longer supported", macos(10.4, 10.8), ios(2.0, 3.0), watchos(2.0, 3.0), tvos(9.0, 10.0))
78 *
79 * API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
80 * API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
81 */
82
83 #define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7, __API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1, 0)(__VA_ARGS__)
84 #define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7, __API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1, 0)(__VA_ARGS__)
85
86 #define API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_MSG8,__API_DEPRECATED_BEGIN_MSG7, __API_DEPRECATED_BEGIN_MSG6, __API_DEPRECATED_BEGIN_MSG5, __API_DEPRECATED_BEGIN_MSG4, __API_DEPRECATED_BEGIN_MSG3, __API_DEPRECATED_BEGIN_MSG2, __API_DEPRECATED_BEGIN_MSG1, 0)(__VA_ARGS__)
87 #define API_DEPRECATED_END _Pragma("clang attribute pop")
88
89 #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_REP8,__API_DEPRECATED_BEGIN_REP7, __API_DEPRECATED_BEGIN_REP6, __API_DEPRECATED_BEGIN_REP5, __API_DEPRECATED_BEGIN_REP4, __API_DEPRECATED_BEGIN_REP3, __API_DEPRECATED_BEGIN_REP2, __API_DEPRECATED_BEGIN_REP1, 0)(__VA_ARGS__)
90 #define API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
91
92
93 /*
94 * API Unavailability
95 * Use to specify that an API is unavailable for a particular platform.
96 *
97 * Example:
98 * API_UNAVAILABLE(macos)
99 * API_UNAVAILABLE(watchos, tvos)
100 */
101
102 #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
103
104 #define API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6, __API_UNAVAILABLE_BEGIN5, __API_UNAVAILABLE_BEGIN4, __API_UNAVAILABLE_BEGIN3, __API_UNAVAILABLE_BEGIN2, __API_UNAVAILABLE_BEGIN1, 0)(__VA_ARGS__)
105 #define API_UNAVAILABLE_END _Pragma("clang attribute pop")
106 #else
107
108 /*
109 * Evaluate to nothing for compilers that don't support availability.
110 */
111
112 #define API_AVAILABLE(...)
113 #define API_AVAILABLE_BEGIN(...)
114 #define API_AVAILABLE_END
115 #define API_DEPRECATED(...)
116 #define API_DEPRECATED_WITH_REPLACEMENT(...)
117 #define API_DEPRECATED_BEGIN(...)
118 #define API_DEPRECATED_END
119 #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
120 #define API_DEPRECATED_WITH_REPLACEMENT_END
121 #define API_UNAVAILABLE(...)
122 #define API_UNAVAILABLE_BEGIN(...)
123 #define API_UNAVAILABLE_END
124 #endif /* __has_attribute(availability) */
125#else
126
127 /*
128 * Evaluate to nothing for compilers that don't support clang language extensions.
129 */
130
131 #define API_AVAILABLE(...)
132 #define API_AVAILABLE_BEGIN(...)
133 #define API_AVAILABLE_END
134 #define API_DEPRECATED(...)
135 #define API_DEPRECATED_WITH_REPLACEMENT(...)
136 #define API_DEPRECATED_BEGIN(...)
137 #define API_DEPRECATED_END
138 #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
139 #define API_DEPRECATED_WITH_REPLACEMENT_END
140 #define API_UNAVAILABLE(...)
141 #define API_UNAVAILABLE_BEGIN(...)
142 #define API_UNAVAILABLE_END
143#endif /* #if defined(__has_feature) && defined(__has_attribute) */
144
145#if __has_include(<AvailabilityProhibitedInternal.h>)
146 #include <AvailabilityProhibitedInternal.h>
147#endif
148
149/*
150 * If SPI decorations have not been defined elsewhere, disable them.
151 */
152
153#ifndef SPI_AVAILABLE
154 #define SPI_AVAILABLE(...)
155#endif
156
157#ifndef SPI_DEPRECATED
158 #define SPI_DEPRECATED(...)
159#endif
160
161#ifndef SPI_DEPRECATED_WITH_REPLACEMENT
162 #define SPI_DEPRECATED_WITH_REPLACEMENT(...)
163#endif
164
165#endif /* __OS_AVAILABILITY__ */
lib/libc/include/x86_64-macos-gnu/os/base.h created+325
...@@ -0,0 +1,325 @@
1/*
2 * Copyright (c) 2008-2013 Apple Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * @APPLE_APACHE_LICENSE_HEADER_END@
19 */
20
21#ifndef __OS_BASE__
22#define __OS_BASE__
23
24#include <sys/cdefs.h>
25
26#ifndef __has_builtin
27#define __has_builtin(x) 0
28#endif
29#ifndef __has_include
30#define __has_include(x) 0
31#endif
32#ifndef __has_feature
33#define __has_feature(x) 0
34#endif
35#ifndef __has_attribute
36#define __has_attribute(x) 0
37#endif
38#ifndef __has_extension
39#define __has_extension(x) 0
40#endif
41
42#undef OS_INLINE // <sys/_types/_os_inline.h>
43#if __GNUC__
44#define OS_NORETURN __attribute__((__noreturn__))
45#define OS_NOTHROW __attribute__((__nothrow__))
46#define OS_NONNULL1 __attribute__((__nonnull__(1)))
47#define OS_NONNULL2 __attribute__((__nonnull__(2)))
48#define OS_NONNULL3 __attribute__((__nonnull__(3)))
49#define OS_NONNULL4 __attribute__((__nonnull__(4)))
50#define OS_NONNULL5 __attribute__((__nonnull__(5)))
51#define OS_NONNULL6 __attribute__((__nonnull__(6)))
52#define OS_NONNULL7 __attribute__((__nonnull__(7)))
53#define OS_NONNULL8 __attribute__((__nonnull__(8)))
54#define OS_NONNULL9 __attribute__((__nonnull__(9)))
55#define OS_NONNULL10 __attribute__((__nonnull__(10)))
56#define OS_NONNULL11 __attribute__((__nonnull__(11)))
57#define OS_NONNULL12 __attribute__((__nonnull__(12)))
58#define OS_NONNULL13 __attribute__((__nonnull__(13)))
59#define OS_NONNULL14 __attribute__((__nonnull__(14)))
60#define OS_NONNULL15 __attribute__((__nonnull__(15)))
61#define OS_NONNULL_ALL __attribute__((__nonnull__))
62#define OS_SENTINEL __attribute__((__sentinel__))
63#define OS_PURE __attribute__((__pure__))
64#define OS_CONST __attribute__((__const__))
65#define OS_WARN_RESULT __attribute__((__warn_unused_result__))
66#define OS_MALLOC __attribute__((__malloc__))
67#define OS_USED __attribute__((__used__))
68#define OS_UNUSED __attribute__((__unused__))
69#define OS_COLD __attribute__((__cold__))
70#define OS_WEAK __attribute__((__weak__))
71#define OS_WEAK_IMPORT __attribute__((__weak_import__))
72#define OS_NOINLINE __attribute__((__noinline__))
73#define OS_ALWAYS_INLINE __attribute__((__always_inline__))
74#define OS_TRANSPARENT_UNION __attribute__((__transparent_union__))
75#define OS_ALIGNED(n) __attribute__((__aligned__((n))))
76#define OS_FORMAT_PRINTF(x,y) __attribute__((__format__(printf,x,y)))
77#define OS_EXPORT extern __attribute__((__visibility__("default")))
78#define OS_INLINE static __inline__
79#define OS_EXPECT(x, v) __builtin_expect((x), (v))
80#else
81#define OS_NORETURN
82#define OS_NOTHROW
83#define OS_NONNULL1
84#define OS_NONNULL2
85#define OS_NONNULL3
86#define OS_NONNULL4
87#define OS_NONNULL5
88#define OS_NONNULL6
89#define OS_NONNULL7
90#define OS_NONNULL8
91#define OS_NONNULL9
92#define OS_NONNULL10
93#define OS_NONNULL11
94#define OS_NONNULL12
95#define OS_NONNULL13
96#define OS_NONNULL14
97#define OS_NONNULL15
98#define OS_NONNULL_ALL
99#define OS_SENTINEL
100#define OS_PURE
101#define OS_CONST
102#define OS_WARN_RESULT
103#define OS_MALLOC
104#define OS_USED
105#define OS_UNUSED
106#define OS_COLD
107#define OS_WEAK
108#define OS_WEAK_IMPORT
109#define OS_NOINLINE
110#define OS_ALWAYS_INLINE
111#define OS_TRANSPARENT_UNION
112#define OS_ALIGNED(n)
113#define OS_FORMAT_PRINTF(x,y)
114#define OS_EXPORT extern
115#define OS_INLINE static inline
116#define OS_EXPECT(x, v) (x)
117#endif
118
119#if __has_attribute(noescape)
120#define OS_NOESCAPE __attribute__((__noescape__))
121#else
122#define OS_NOESCAPE
123#endif
124
125#if defined(__cplusplus) && defined(__clang__)
126#define OS_FALLTHROUGH [[clang::fallthrough]]
127#else
128#define OS_FALLTHROUGH
129#endif
130
131#if __has_feature(assume_nonnull)
132#define OS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
133#define OS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
134#else
135#define OS_ASSUME_NONNULL_BEGIN
136#define OS_ASSUME_NONNULL_END
137#endif
138
139#if __has_builtin(__builtin_assume)
140#define OS_COMPILER_CAN_ASSUME(expr) __builtin_assume(expr)
141#else
142#define OS_COMPILER_CAN_ASSUME(expr) ((void)(expr))
143#endif
144
145#if __has_extension(attribute_overloadable)
146#define OS_OVERLOADABLE __attribute__((__overloadable__))
147#else
148#define OS_OVERLOADABLE
149#endif
150
151#if __has_attribute(enum_extensibility)
152#define __OS_ENUM_ATTR __attribute__((enum_extensibility(open)))
153#define __OS_ENUM_ATTR_CLOSED __attribute__((enum_extensibility(closed)))
154#else
155#define __OS_ENUM_ATTR
156#define __OS_ENUM_ATTR_CLOSED
157#endif // __has_attribute(enum_extensibility)
158
159#if __has_attribute(flag_enum)
160/*!
161 * Compile with -Wflag-enum and -Wassign-enum to enforce at definition and
162 * assignment, respectively, i.e. -Wflag-enum prevents you from creating new
163 * enumeration values from illegal values within the enum definition, and
164 * -Wassign-enum prevents you from assigning illegal values to a variable of the
165 * enum type.
166 */
167#ifndef __OPEN_SOURCE__
168/*!
169 * @internal
170 * <rdar://problem/37799789>
171 */
172#endif // __OPEN_SOURCE__
173#define __OS_OPTIONS_ATTR __attribute__((flag_enum))
174#else
175#define __OS_OPTIONS_ATTR
176#endif // __has_attribute(flag_enum)
177
178#if __has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum) || \
179 __has_extension(cxx_strong_enums)
180#define OS_ENUM(_name, _type, ...) \
181 typedef enum : _type { __VA_ARGS__ } _name##_t
182#define OS_CLOSED_ENUM(_name, _type, ...) \
183 typedef enum : _type { __VA_ARGS__ } \
184 __OS_ENUM_ATTR_CLOSED _name##_t
185#define OS_OPTIONS(_name, _type, ...) \
186 typedef enum : _type { __VA_ARGS__ } \
187 __OS_ENUM_ATTR __OS_OPTIONS_ATTR _name##_t
188#define OS_CLOSED_OPTIONS(_name, _type, ...) \
189 typedef enum : _type { __VA_ARGS__ } \
190 __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR _name##_t
191#else
192/*!
193 * There is unfortunately no good way in plain C to have both fixed-type enums
194 * and enforcement for clang's enum_extensibility extensions. The primary goal
195 * of these macros is to allow you to define an enum and specify its width in a
196 * single statement, and for plain C that is accomplished by defining an
197 * anonymous enum and then separately typedef'ing the requested type name to the
198 * requested underlying integer type. So the type emitted actually has no
199 * relationship at all to the enum, and therefore while the compiler could
200 * enforce enum extensibility if you used the enum type, it cannot do so if you
201 * use the "_t" type resulting from this expression.
202 *
203 * But we still define a named enum type and decorate it appropriately for you,
204 * so if you really want the enum extensibility enforcement, you can use the
205 * enum type yourself, i.e. when compiling with a C compiler:
206 *
207 * OS_CLOSED_ENUM(my_type, uint64_t,
208 * FOO,
209 * BAR,
210 * BAZ,
211 * );
212 *
213 * my_type_t mt = 98; // legal
214 * enum my_type emt = 98; // illegal
215 *
216 * But be aware that the underlying enum type's width is subject only to the C
217 * language's guarantees -- namely that it will be compatible with int, char,
218 * and unsigned char. It is not safe to rely on the size of this type.
219 *
220 * When compiling in ObjC or C++, both of the above assignments are illegal.
221 */
222#define __OS_ENUM_C_FALLBACK(_name, _type, ...) \
223 typedef _type _name##_t; enum _name { __VA_ARGS__ }
224
225#define OS_ENUM(_name, _type, ...) \
226 typedef _type _name##_t; enum { __VA_ARGS__ }
227#define OS_CLOSED_ENUM(_name, _type, ...) \
228 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
229 __OS_ENUM_ATTR_CLOSED
230#define OS_OPTIONS(_name, _type, ...) \
231 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
232 __OS_ENUM_ATTR __OS_OPTIONS_ATTR
233#define OS_CLOSED_OPTIONS(_name, _type, ...) \
234 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
235 __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR
236#endif // __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums)
237
238#if __has_feature(attribute_availability_swift)
239// equivalent to __SWIFT_UNAVAILABLE from Availability.h
240#define OS_SWIFT_UNAVAILABLE(_msg) \
241 __attribute__((__availability__(swift, unavailable, message=_msg)))
242#else
243#define OS_SWIFT_UNAVAILABLE(_msg)
244#endif
245
246#if __has_attribute(swift_private)
247# define OS_REFINED_FOR_SWIFT __attribute__((__swift_private__))
248#else
249# define OS_REFINED_FOR_SWIFT
250#endif
251
252#if __has_attribute(swift_name)
253# define OS_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name)))
254#else
255# define OS_SWIFT_NAME(_name)
256#endif
257
258#define __OS_STRINGIFY(s) #s
259#define OS_STRINGIFY(s) __OS_STRINGIFY(s)
260#define __OS_CONCAT(x, y) x ## y
261#define OS_CONCAT(x, y) __OS_CONCAT(x, y)
262
263#ifdef __GNUC__
264#define os_prevent_tail_call_optimization() __asm__("")
265#define os_is_compile_time_constant(expr) __builtin_constant_p(expr)
266#define os_compiler_barrier() __asm__ __volatile__("" ::: "memory")
267#else
268#define os_prevent_tail_call_optimization() do { } while (0)
269#define os_is_compile_time_constant(expr) 0
270#define os_compiler_barrier() do { } while (0)
271#endif
272
273#if __has_attribute(not_tail_called)
274#define OS_NOT_TAIL_CALLED __attribute__((__not_tail_called__))
275#else
276#define OS_NOT_TAIL_CALLED
277#endif
278
279typedef void (*os_function_t)(void *_Nullable);
280
281#ifdef __BLOCKS__
282/*!
283 * @typedef os_block_t
284 *
285 * @abstract
286 * Generic type for a block taking no arguments and returning no value.
287 *
288 * @discussion
289 * When not building with Objective-C ARC, a block object allocated on or
290 * copied to the heap must be released with a -[release] message or the
291 * Block_release() function.
292 *
293 * The declaration of a block literal allocates storage on the stack.
294 * Therefore, this is an invalid construct:
295 * <code>
296 * os_block_t block;
297 * if (x) {
298 * block = ^{ printf("true\n"); };
299 * } else {
300 * block = ^{ printf("false\n"); };
301 * }
302 * block(); // unsafe!!!
303 * </code>
304 *
305 * What is happening behind the scenes:
306 * <code>
307 * if (x) {
308 * struct Block __tmp_1 = ...; // setup details
309 * block = &__tmp_1;
310 * } else {
311 * struct Block __tmp_2 = ...; // setup details
312 * block = &__tmp_2;
313 * }
314 * </code>
315 *
316 * As the example demonstrates, the address of a stack variable is escaping the
317 * scope in which it is allocated. That is a classic C bug.
318 *
319 * Instead, the block literal must be copied to the heap with the Block_copy()
320 * function or by sending it a -[copy] message.
321 */
322typedef void (^os_block_t)(void);
323#endif
324
325#endif // __OS_BASE__
lib/libc/include/x86_64-macos-gnu/sys/_types/_fsid_t.h created+32
...@@ -0,0 +1,32 @@
1/*
2 * Copyright (c) 2014 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28#ifndef _FSID_T
29#define _FSID_T
30#include <sys/_types/_int32_t.h> /* int32_t */
31typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */
32#endif /* _FSID_T */
lib/libc/include/x86_64-macos-gnu/sys/_types/_fsobj_id_t.h created+38
...@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2016 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28#ifndef _FSOBJ_ID_T
29#define _FSOBJ_ID_T
30
31#include <sys/_types/_u_int32_t.h> /* u_int32_t */
32
33typedef struct fsobj_id {
34 u_int32_t fid_objno;
35 u_int32_t fid_generation;
36} fsobj_id_t;
37
38#endif /* _FSOBJ_ID_T */
lib/libc/include/x86_64-macos-gnu/sys/attr.h created+579
...@@ -0,0 +1,579 @@
1/*
2 * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*
30 * attr.h - attribute data structures and interfaces
31 *
32 * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved.
33 */
34
35#ifndef _SYS_ATTR_H_
36#define _SYS_ATTR_H_
37
38#include <sys/appleapiopts.h>
39
40#ifdef __APPLE_API_UNSTABLE
41#include <sys/types.h>
42#include <sys/ucred.h>
43#include <sys/time.h>
44#include <sys/cdefs.h>
45
46#define FSOPT_NOFOLLOW 0x00000001
47#define FSOPT_NOINMEMUPDATE 0x00000002
48#define FSOPT_REPORT_FULLSIZE 0x00000004
49/* The following option only valid when requesting ATTR_CMN_RETURNED_ATTRS */
50#define FSOPT_PACK_INVAL_ATTRS 0x00000008
51
52
53#define FSOPT_ATTR_CMN_EXTENDED 0x00000020
54
55/* we currently aren't anywhere near this amount for a valid
56 * fssearchblock.sizeofsearchparams1 or fssearchblock.sizeofsearchparams2
57 * but we put a sanity check in to avoid abuse of the value passed in from
58 * user land.
59 */
60#define SEARCHFS_MAX_SEARCHPARMS 4096
61
62typedef u_int32_t text_encoding_t;
63
64typedef u_int32_t fsobj_type_t;
65
66typedef u_int32_t fsobj_tag_t;
67
68typedef u_int32_t fsfile_type_t;
69
70typedef u_int32_t fsvolid_t;
71
72#include <sys/_types/_fsobj_id_t.h> /* file object id type */
73
74typedef u_int32_t attrgroup_t;
75
76struct attrlist {
77 u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */
78 u_int16_t reserved; /* (to maintain 4-byte alignment) */
79 attrgroup_t commonattr; /* common attribute group */
80 attrgroup_t volattr; /* Volume attribute group */
81 attrgroup_t dirattr; /* directory attribute group */
82 attrgroup_t fileattr; /* file attribute group */
83 attrgroup_t forkattr; /* fork attribute group */
84};
85#define ATTR_BIT_MAP_COUNT 5
86
87typedef struct attribute_set {
88 attrgroup_t commonattr; /* common attribute group */
89 attrgroup_t volattr; /* Volume attribute group */
90 attrgroup_t dirattr; /* directory attribute group */
91 attrgroup_t fileattr; /* file attribute group */
92 attrgroup_t forkattr; /* fork attribute group */
93} attribute_set_t;
94
95typedef struct attrreference {
96 int32_t attr_dataoffset;
97 u_int32_t attr_length;
98} attrreference_t;
99
100/* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */
101
102struct diskextent {
103 u_int32_t startblock; /* first block allocated */
104 u_int32_t blockcount; /* number of blocks allocated */
105};
106
107typedef struct diskextent extentrecord[8];
108
109typedef u_int32_t vol_capabilities_set_t[4];
110
111#define VOL_CAPABILITIES_FORMAT 0
112#define VOL_CAPABILITIES_INTERFACES 1
113#define VOL_CAPABILITIES_RESERVED1 2
114#define VOL_CAPABILITIES_RESERVED2 3
115
116typedef struct vol_capabilities_attr {
117 vol_capabilities_set_t capabilities;
118 vol_capabilities_set_t valid;
119} vol_capabilities_attr_t;
120
121/*
122 * XXX this value needs to be raised - 3893388
123 */
124#define ATTR_MAX_BUFFER 8192
125
126/*
127 * VOL_CAP_FMT_PERSISTENTOBJECTIDS: When set, the volume has object IDs
128 * that are persistent (retain their values even when the volume is
129 * unmounted and remounted), and a file or directory can be looked up
130 * by ID. Volumes that support VolFS and can support Carbon File ID
131 * references should set this bit.
132 *
133 * VOL_CAP_FMT_SYMBOLICLINKS: When set, the volume supports symbolic
134 * links. The symlink(), readlink(), and lstat() calls all use this
135 * symbolic link.
136 *
137 * VOL_CAP_FMT_HARDLINKS: When set, the volume supports hard links.
138 * The link() call creates hard links.
139 *
140 * VOL_CAP_FMT_JOURNAL: When set, the volume is capable of supporting
141 * a journal used to speed recovery in case of unplanned shutdown
142 * (such as a power outage or crash). This bit does not necessarily
143 * mean the volume is actively using a journal for recovery.
144 *
145 * VOL_CAP_FMT_JOURNAL_ACTIVE: When set, the volume is currently using
146 * a journal for use in speeding recovery after an unplanned shutdown.
147 * This bit can be set only if VOL_CAP_FMT_JOURNAL is also set.
148 *
149 * VOL_CAP_FMT_NO_ROOT_TIMES: When set, the volume format does not
150 * store reliable times for the root directory, so you should not
151 * depend on them to detect changes, etc.
152 *
153 * VOL_CAP_FMT_SPARSE_FILES: When set, the volume supports sparse files.
154 * That is, files which can have "holes" that have never been written
155 * to, and are not allocated on disk. Sparse files may have an
156 * allocated size that is less than the file's logical length.
157 *
158 * VOL_CAP_FMT_ZERO_RUNS: For security reasons, parts of a file (runs)
159 * that have never been written to must appear to contain zeroes. When
160 * this bit is set, the volume keeps track of allocated but unwritten
161 * runs of a file so that it can substitute zeroes without actually
162 * writing zeroes to the media. This provides performance similar to
163 * sparse files, but not the space savings.
164 *
165 * VOL_CAP_FMT_CASE_SENSITIVE: When set, file and directory names are
166 * case sensitive (upper and lower case are different). When clear,
167 * an upper case character is equivalent to a lower case character,
168 * and you can't have two names that differ solely in the case of
169 * the characters.
170 *
171 * VOL_CAP_FMT_CASE_PRESERVING: When set, file and directory names
172 * preserve the difference between upper and lower case. If clear,
173 * the volume may change the case of some characters (typically
174 * making them all upper or all lower case). A volume that sets
175 * VOL_CAP_FMT_CASE_SENSITIVE should also set VOL_CAP_FMT_CASE_PRESERVING.
176 *
177 * VOL_CAP_FMT_FAST_STATFS: This bit is used as a hint to upper layers
178 * (especially Carbon) that statfs() is fast enough that its results
179 * need not be cached by those upper layers. A volume that caches
180 * the statfs information in its in-memory structures should set this bit.
181 * A volume that must always read from disk or always perform a network
182 * transaction should not set this bit.
183 *
184 * VOL_CAP_FMT_2TB_FILESIZE: If this bit is set the volume format supports
185 * file sizes larger than 4GB, and potentially up to 2TB; it does not
186 * indicate whether the filesystem supports files larger than that.
187 *
188 * VOL_CAP_FMT_OPENDENYMODES: When set, the volume supports open deny
189 * modes (e.g. "open for read write, deny write"; effectively, mandatory
190 * file locking based on open modes).
191 *
192 * VOL_CAP_FMT_HIDDEN_FILES: When set, the volume supports the UF_HIDDEN
193 * file flag, and the UF_HIDDEN flag is mapped to that volume's native
194 * "hidden" or "invisible" bit (which may be the invisible bit from the
195 * Finder Info extended attribute).
196 *
197 * VOL_CAP_FMT_PATH_FROM_ID: When set, the volume supports the ability
198 * to derive a pathname to the root of the file system given only the
199 * id of an object. This also implies that object ids on this file
200 * system are persistent and not recycled. This is a very specialized
201 * capability and it is assumed that most file systems will not support
202 * it. Its use is for legacy non-posix APIs like ResolveFileIDRef.
203 *
204 * VOL_CAP_FMT_NO_VOLUME_SIZES: When set, the volume does not support
205 * returning values for total data blocks, available blocks, or free blocks
206 * (as in f_blocks, f_bavail, or f_bfree in "struct statfs"). Historically,
207 * those values were set to 0xFFFFFFFF for volumes that did not support them.
208 *
209 * VOL_CAP_FMT_DECMPFS_COMPRESSION: When set, the volume supports transparent
210 * decompression of compressed files using decmpfs.
211 *
212 * VOL_CAP_FMT_64BIT_OBJECT_IDS: When set, the volume uses object IDs that
213 * are 64-bit. This means that ATTR_CMN_FILEID and ATTR_CMN_PARENTID are the
214 * only legitimate attributes for obtaining object IDs from this volume and the
215 * 32-bit fid_objno fields of the fsobj_id_t returned by ATTR_CMN_OBJID,
216 * ATTR_CMN_OBJPERMID, and ATTR_CMN_PAROBJID are undefined.
217 *
218 * VOL_CAP_FMT_DIR_HARDLINKS: When set, the volume supports directory
219 * hard links.
220 *
221 * VOL_CAP_FMT_DOCUMENT_ID: When set, the volume supports document IDs
222 * (an ID which persists across object ID changes) for document revisions.
223 *
224 * VOL_CAP_FMT_WRITE_GENERATION_COUNT: When set, the volume supports write
225 * generation counts (a count of how many times an object has been modified)
226 *
227 * VOL_CAP_FMT_NO_IMMUTABLE_FILES: When set, the volume does not support
228 * setting the UF_IMMUTABLE flag.
229 *
230 * VOL_CAP_FMT_NO_PERMISSIONS: When set, the volume does not support setting
231 * permissions.
232 *
233 * VOL_CAP_FMT_SHARED_SPACE: When set, the volume supports sharing space with
234 * other filesystems i.e. multiple logical filesystems can exist in the same
235 * "partition". An implication of this is that the filesystem which sets
236 * this capability treats waitfor arguments to VFS_SYNC as bit flags.
237 *
238 * VOL_CAP_FMT_VOL_GROUPS: When set, this volume is part of a volume-group
239 * that implies multiple volumes must be mounted in order to boot and root the
240 * operating system. Typically, this means a read-only system volume and a
241 * writable data volume.
242 */
243#define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
244#define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
245#define VOL_CAP_FMT_HARDLINKS 0x00000004
246#define VOL_CAP_FMT_JOURNAL 0x00000008
247#define VOL_CAP_FMT_JOURNAL_ACTIVE 0x00000010
248#define VOL_CAP_FMT_NO_ROOT_TIMES 0x00000020
249#define VOL_CAP_FMT_SPARSE_FILES 0x00000040
250#define VOL_CAP_FMT_ZERO_RUNS 0x00000080
251#define VOL_CAP_FMT_CASE_SENSITIVE 0x00000100
252#define VOL_CAP_FMT_CASE_PRESERVING 0x00000200
253#define VOL_CAP_FMT_FAST_STATFS 0x00000400
254#define VOL_CAP_FMT_2TB_FILESIZE 0x00000800
255#define VOL_CAP_FMT_OPENDENYMODES 0x00001000
256#define VOL_CAP_FMT_HIDDEN_FILES 0x00002000
257#define VOL_CAP_FMT_PATH_FROM_ID 0x00004000
258#define VOL_CAP_FMT_NO_VOLUME_SIZES 0x00008000
259#define VOL_CAP_FMT_DECMPFS_COMPRESSION 0x00010000
260#define VOL_CAP_FMT_64BIT_OBJECT_IDS 0x00020000
261#define VOL_CAP_FMT_DIR_HARDLINKS 0x00040000
262#define VOL_CAP_FMT_DOCUMENT_ID 0x00080000
263#define VOL_CAP_FMT_WRITE_GENERATION_COUNT 0x00100000
264#define VOL_CAP_FMT_NO_IMMUTABLE_FILES 0x00200000
265#define VOL_CAP_FMT_NO_PERMISSIONS 0x00400000
266#define VOL_CAP_FMT_SHARED_SPACE 0x00800000
267#define VOL_CAP_FMT_VOL_GROUPS 0x01000000
268
269/*
270 * VOL_CAP_INT_SEARCHFS: When set, the volume implements the
271 * searchfs() system call (the vnop_searchfs vnode operation).
272 *
273 * VOL_CAP_INT_ATTRLIST: When set, the volume implements the
274 * getattrlist() and setattrlist() system calls (vnop_getattrlist
275 * and vnop_setattrlist vnode operations) for the volume, files,
276 * and directories. The volume may or may not implement the
277 * readdirattr() system call. XXX Is there any minimum set
278 * of attributes that should be supported? To determine the
279 * set of supported attributes, get the ATTR_VOL_ATTRIBUTES
280 * attribute of the volume.
281 *
282 * VOL_CAP_INT_NFSEXPORT: When set, the volume implements exporting
283 * of NFS volumes.
284 *
285 * VOL_CAP_INT_READDIRATTR: When set, the volume implements the
286 * readdirattr() system call (vnop_readdirattr vnode operation).
287 *
288 * VOL_CAP_INT_EXCHANGEDATA: When set, the volume implements the
289 * exchangedata() system call (VNOP_EXCHANGE vnode operation).
290 *
291 * VOL_CAP_INT_COPYFILE: When set, the volume implements the
292 * VOP_COPYFILE vnode operation. (XXX There should be a copyfile()
293 * system call in <unistd.h>.)
294 *
295 * VOL_CAP_INT_ALLOCATE: When set, the volume implements the
296 * VNOP_ALLOCATE vnode operation, which means it implements the
297 * F_PREALLOCATE selector of fcntl(2).
298 *
299 * VOL_CAP_INT_VOL_RENAME: When set, the volume implements the
300 * ATTR_VOL_NAME attribute for both getattrlist() and setattrlist().
301 * The volume can be renamed by setting ATTR_VOL_NAME with setattrlist().
302 *
303 * VOL_CAP_INT_ADVLOCK: When set, the volume implements POSIX style
304 * byte range locks via vnop_advlock (accessible from fcntl(2)).
305 *
306 * VOL_CAP_INT_FLOCK: When set, the volume implements whole-file flock(2)
307 * style locks via vnop_advlock. This includes the O_EXLOCK and O_SHLOCK
308 * flags of the open(2) call.
309 *
310 * VOL_CAP_INT_EXTENDED_SECURITY: When set, the volume implements
311 * extended security (ACLs).
312 *
313 * VOL_CAP_INT_USERACCESS: When set, the volume supports the
314 * ATTR_CMN_USERACCESS attribute (used to get the user's access
315 * mode to the file).
316 *
317 * VOL_CAP_INT_MANLOCK: When set, the volume supports AFP-style
318 * mandatory byte range locks via an ioctl().
319 *
320 * VOL_CAP_INT_EXTENDED_ATTR: When set, the volume implements
321 * native extended attribues.
322 *
323 * VOL_CAP_INT_NAMEDSTREAMS: When set, the volume supports
324 * native named streams.
325 *
326 * VOL_CAP_INT_CLONE: When set, the volume supports clones.
327 *
328 * VOL_CAP_INT_SNAPSHOT: When set, the volume supports snapshots.
329 *
330 * VOL_CAP_INT_RENAME_SWAP: When set, the volume supports swapping
331 * file system objects.
332 *
333 * VOL_CAP_INT_RENAME_EXCL: When set, the volume supports an
334 * exclusive rename operation.
335 *
336 * VOL_CAP_INT_RENAME_OPENFAIL: When set, the volume may fail rename
337 * operations on files that are open.
338 */
339#define VOL_CAP_INT_SEARCHFS 0x00000001
340#define VOL_CAP_INT_ATTRLIST 0x00000002
341#define VOL_CAP_INT_NFSEXPORT 0x00000004
342#define VOL_CAP_INT_READDIRATTR 0x00000008
343#define VOL_CAP_INT_EXCHANGEDATA 0x00000010
344#define VOL_CAP_INT_COPYFILE 0x00000020
345#define VOL_CAP_INT_ALLOCATE 0x00000040
346#define VOL_CAP_INT_VOL_RENAME 0x00000080
347#define VOL_CAP_INT_ADVLOCK 0x00000100
348#define VOL_CAP_INT_FLOCK 0x00000200
349#define VOL_CAP_INT_EXTENDED_SECURITY 0x00000400
350#define VOL_CAP_INT_USERACCESS 0x00000800
351#define VOL_CAP_INT_MANLOCK 0x00001000
352#define VOL_CAP_INT_NAMEDSTREAMS 0x00002000
353#define VOL_CAP_INT_EXTENDED_ATTR 0x00004000
354#define VOL_CAP_INT_CLONE 0x00010000
355#define VOL_CAP_INT_SNAPSHOT 0x00020000
356#define VOL_CAP_INT_RENAME_SWAP 0x00040000
357#define VOL_CAP_INT_RENAME_EXCL 0x00080000
358#define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000
359
360typedef struct vol_attributes_attr {
361 attribute_set_t validattr;
362 attribute_set_t nativeattr;
363} vol_attributes_attr_t;
364
365#define ATTR_CMN_NAME 0x00000001
366#define ATTR_CMN_DEVID 0x00000002
367#define ATTR_CMN_FSID 0x00000004
368#define ATTR_CMN_OBJTYPE 0x00000008
369#define ATTR_CMN_OBJTAG 0x00000010
370#define ATTR_CMN_OBJID 0x00000020
371#define ATTR_CMN_OBJPERMANENTID 0x00000040
372#define ATTR_CMN_PAROBJID 0x00000080
373#define ATTR_CMN_SCRIPT 0x00000100
374#define ATTR_CMN_CRTIME 0x00000200
375#define ATTR_CMN_MODTIME 0x00000400
376#define ATTR_CMN_CHGTIME 0x00000800
377#define ATTR_CMN_ACCTIME 0x00001000
378#define ATTR_CMN_BKUPTIME 0x00002000
379#define ATTR_CMN_FNDRINFO 0x00004000
380#define ATTR_CMN_OWNERID 0x00008000
381#define ATTR_CMN_GRPID 0x00010000
382#define ATTR_CMN_ACCESSMASK 0x00020000
383#define ATTR_CMN_FLAGS 0x00040000
384
385/* The following were defined as: */
386/* #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000 */
387/* #define ATTR_CMN_NAMEDATTRLIST 0x00100000 */
388/* These bits have been salvaged for use as: */
389/* #define ATTR_CMN_GEN_COUNT 0x00080000 */
390/* #define ATTR_CMN_DOCUMENT_ID 0x00100000 */
391/* They can only be used with the FSOPT_ATTR_CMN_EXTENDED */
392/* option flag. */
393
394#define ATTR_CMN_GEN_COUNT 0x00080000
395#define ATTR_CMN_DOCUMENT_ID 0x00100000
396
397#define ATTR_CMN_USERACCESS 0x00200000
398#define ATTR_CMN_EXTENDED_SECURITY 0x00400000
399#define ATTR_CMN_UUID 0x00800000
400#define ATTR_CMN_GRPUUID 0x01000000
401#define ATTR_CMN_FILEID 0x02000000
402#define ATTR_CMN_PARENTID 0x04000000
403#define ATTR_CMN_FULLPATH 0x08000000
404#define ATTR_CMN_ADDEDTIME 0x10000000
405#define ATTR_CMN_ERROR 0x20000000
406#define ATTR_CMN_DATA_PROTECT_FLAGS 0x40000000
407
408/*
409 * ATTR_CMN_RETURNED_ATTRS is only valid with getattrlist(2) and
410 * getattrlistbulk(2). It is always the first attribute in the return buffer.
411 */
412#define ATTR_CMN_RETURNED_ATTRS 0x80000000
413
414#define ATTR_CMN_VALIDMASK 0xFFFFFFFF
415/*
416 * The settable ATTR_CMN_* attributes include the following:
417 * ATTR_CMN_SCRIPT
418 * ATTR_CMN_CRTIME
419 * ATTR_CMN_MODTIME
420 * ATTR_CMN_CHGTIME
421 *
422 * ATTR_CMN_ACCTIME
423 * ATTR_CMN_BKUPTIME
424 * ATTR_CMN_FNDRINFO
425 * ATTR_CMN_OWNERID
426 *
427 * ATTR_CMN_GRPID
428 * ATTR_CMN_ACCESSMASK
429 * ATTR_CMN_FLAGS
430 *
431 * ATTR_CMN_EXTENDED_SECURITY
432 * ATTR_CMN_UUID
433 *
434 * ATTR_CMN_GRPUUID
435 *
436 * ATTR_CMN_DATA_PROTECT_FLAGS
437 */
438#define ATTR_CMN_SETMASK 0x51C7FF00
439#define ATTR_CMN_VOLSETMASK 0x00006700
440
441#define ATTR_VOL_FSTYPE 0x00000001
442#define ATTR_VOL_SIGNATURE 0x00000002
443#define ATTR_VOL_SIZE 0x00000004
444#define ATTR_VOL_SPACEFREE 0x00000008
445#define ATTR_VOL_SPACEAVAIL 0x00000010
446#define ATTR_VOL_MINALLOCATION 0x00000020
447#define ATTR_VOL_ALLOCATIONCLUMP 0x00000040
448#define ATTR_VOL_IOBLOCKSIZE 0x00000080
449#define ATTR_VOL_OBJCOUNT 0x00000100
450#define ATTR_VOL_FILECOUNT 0x00000200
451#define ATTR_VOL_DIRCOUNT 0x00000400
452#define ATTR_VOL_MAXOBJCOUNT 0x00000800
453#define ATTR_VOL_MOUNTPOINT 0x00001000
454#define ATTR_VOL_NAME 0x00002000
455#define ATTR_VOL_MOUNTFLAGS 0x00004000
456#define ATTR_VOL_MOUNTEDDEVICE 0x00008000
457#define ATTR_VOL_ENCODINGSUSED 0x00010000
458#define ATTR_VOL_CAPABILITIES 0x00020000
459#define ATTR_VOL_UUID 0x00040000
460#define ATTR_VOL_QUOTA_SIZE 0x10000000
461#define ATTR_VOL_RESERVED_SIZE 0x20000000
462#define ATTR_VOL_ATTRIBUTES 0x40000000
463#define ATTR_VOL_INFO 0x80000000
464
465#define ATTR_VOL_VALIDMASK 0xF007FFFF
466
467/*
468 * The list of settable ATTR_VOL_* attributes include the following:
469 * ATTR_VOL_NAME
470 * ATTR_VOL_INFO
471 */
472#define ATTR_VOL_SETMASK 0x80002000
473
474
475/* File/directory attributes: */
476#define ATTR_DIR_LINKCOUNT 0x00000001
477#define ATTR_DIR_ENTRYCOUNT 0x00000002
478#define ATTR_DIR_MOUNTSTATUS 0x00000004
479#define ATTR_DIR_ALLOCSIZE 0x00000008
480#define ATTR_DIR_IOBLOCKSIZE 0x00000010
481#define ATTR_DIR_DATALENGTH 0x00000020
482
483/* ATTR_DIR_MOUNTSTATUS Flags: */
484#define DIR_MNTSTATUS_MNTPOINT 0x00000001
485#define DIR_MNTSTATUS_TRIGGER 0x00000002
486
487#define ATTR_DIR_VALIDMASK 0x0000003f
488#define ATTR_DIR_SETMASK 0x00000000
489
490#define ATTR_FILE_LINKCOUNT 0x00000001
491#define ATTR_FILE_TOTALSIZE 0x00000002
492#define ATTR_FILE_ALLOCSIZE 0x00000004
493#define ATTR_FILE_IOBLOCKSIZE 0x00000008
494#define ATTR_FILE_DEVTYPE 0x00000020
495#define ATTR_FILE_FORKCOUNT 0x00000080
496#define ATTR_FILE_FORKLIST 0x00000100
497#define ATTR_FILE_DATALENGTH 0x00000200
498#define ATTR_FILE_DATAALLOCSIZE 0x00000400
499#define ATTR_FILE_RSRCLENGTH 0x00001000
500#define ATTR_FILE_RSRCALLOCSIZE 0x00002000
501
502#define ATTR_FILE_VALIDMASK 0x000037FF
503/*
504 * Settable ATTR_FILE_* attributes include:
505 * ATTR_FILE_DEVTYPE
506 */
507#define ATTR_FILE_SETMASK 0x00000020
508
509/* CMNEXT attributes extend the common attributes, but in the forkattr field */
510#define ATTR_CMNEXT_RELPATH 0x00000004
511#define ATTR_CMNEXT_PRIVATESIZE 0x00000008
512#define ATTR_CMNEXT_LINKID 0x00000010
513#define ATTR_CMNEXT_NOFIRMLINKPATH 0x00000020
514#define ATTR_CMNEXT_REALDEVID 0x00000040
515#define ATTR_CMNEXT_REALFSID 0x00000080
516#define ATTR_CMNEXT_CLONEID 0x00000100
517#define ATTR_CMNEXT_EXT_FLAGS 0x00000200
518
519#define ATTR_CMNEXT_VALIDMASK 0x000003fc
520#define ATTR_CMNEXT_SETMASK 0x00000000
521
522/* Deprecated fork attributes */
523#define ATTR_FORK_TOTALSIZE 0x00000001
524#define ATTR_FORK_ALLOCSIZE 0x00000002
525#define ATTR_FORK_RESERVED 0xffffffff
526
527#define ATTR_FORK_VALIDMASK 0x00000003
528#define ATTR_FORK_SETMASK 0x00000000
529
530/* Obsolete, implemented, not supported */
531#define ATTR_CMN_NAMEDATTRCOUNT 0x00080000
532#define ATTR_CMN_NAMEDATTRLIST 0x00100000
533#define ATTR_FILE_CLUMPSIZE 0x00000010 /* obsolete */
534#define ATTR_FILE_FILETYPE 0x00000040 /* always zero */
535#define ATTR_FILE_DATAEXTENTS 0x00000800 /* obsolete, HFS-specific */
536#define ATTR_FILE_RSRCEXTENTS 0x00004000 /* obsolete, HFS-specific */
537
538/* Required attributes for getattrlistbulk(2) */
539#define ATTR_BULK_REQUIRED (ATTR_CMN_NAME | ATTR_CMN_RETURNED_ATTRS)
540
541/*
542 * Searchfs
543 */
544#define SRCHFS_START 0x00000001
545#define SRCHFS_MATCHPARTIALNAMES 0x00000002
546#define SRCHFS_MATCHDIRS 0x00000004
547#define SRCHFS_MATCHFILES 0x00000008
548#define SRCHFS_SKIPLINKS 0x00000010
549#define SRCHFS_SKIPINVISIBLE 0x00000020
550#define SRCHFS_SKIPPACKAGES 0x00000040
551#define SRCHFS_SKIPINAPPROPRIATE 0x00000080
552
553#define SRCHFS_NEGATEPARAMS 0x80000000
554#define SRCHFS_VALIDOPTIONSMASK 0x800000FF
555
556struct fssearchblock {
557 struct attrlist *returnattrs;
558 void *returnbuffer;
559 size_t returnbuffersize;
560 u_long maxmatches;
561 struct timeval timelimit;
562 void *searchparams1;
563 size_t sizeofsearchparams1;
564 void *searchparams2;
565 size_t sizeofsearchparams2;
566 struct attrlist searchattrs;
567};
568
569
570struct searchstate {
571 uint32_t ss_union_flags; // for SRCHFS_START
572 uint32_t ss_union_layer; // 0 = top
573 u_char ss_fsstate[548]; // fs private
574} __attribute__((packed));
575
576#define FST_EOF (-1) /* end-of-file offset */
577
578#endif /* __APPLE_API_UNSTABLE */
579#endif /* !_SYS_ATTR_H_ */
lib/libc/include/x86_64-macos-gnu/sys/mount.h created+423
...@@ -0,0 +1,423 @@
1/*
2 * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
29/*
30 * Copyright (c) 1989, 1991, 1993
31 * The Regents of the University of California. All rights reserved.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 * must display the following acknowledgement:
43 * This product includes software developed by the University of
44 * California, Berkeley and its contributors.
45 * 4. Neither the name of the University nor the names of its contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 * SUCH DAMAGE.
60 *
61 * @(#)mount.h 8.21 (Berkeley) 5/20/95
62 */
63/*
64 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
65 * support for mandatory and extensible security protections. This notice
66 * is included in support of clause 2.2 (b) of the Apple Public License,
67 * Version 2.0.
68 */
69
70
71#ifndef _SYS_MOUNT_H_
72#define _SYS_MOUNT_H_
73
74#include <sys/appleapiopts.h>
75#include <sys/cdefs.h>
76#include <sys/attr.h> /* needed for vol_capabilities_attr_t */
77#include <os/base.h>
78
79#include <stdint.h>
80#include <sys/ucred.h>
81#include <sys/queue.h> /* XXX needed for user builds */
82#include <Availability.h>
83
84#include <sys/_types/_fsid_t.h> /* file system id type */
85
86/*
87 * file system statistics
88 */
89
90#define MFSNAMELEN 15 /* length of fs type name, not inc. null */
91#define MFSTYPENAMELEN 16 /* length of fs type name including null */
92
93#if __DARWIN_64_BIT_INO_T
94#define MNAMELEN MAXPATHLEN /* length of buffer for returned name */
95#else /* ! __DARWIN_64_BIT_INO_T */
96#define MNAMELEN 90 /* length of buffer for returned name */
97#endif /* __DARWIN_64_BIT_INO_T */
98
99#define MNT_EXT_ROOT_DATA_VOL 0x00000001 /* Data volume of root volume group */
100
101#define __DARWIN_STRUCT_STATFS64 { \
102 uint32_t f_bsize; /* fundamental file system block size */ \
103 int32_t f_iosize; /* optimal transfer block size */ \
104 uint64_t f_blocks; /* total data blocks in file system */ \
105 uint64_t f_bfree; /* free blocks in fs */ \
106 uint64_t f_bavail; /* free blocks avail to non-superuser */ \
107 uint64_t f_files; /* total file nodes in file system */ \
108 uint64_t f_ffree; /* free file nodes in fs */ \
109 fsid_t f_fsid; /* file system id */ \
110 uid_t f_owner; /* user that mounted the filesystem */ \
111 uint32_t f_type; /* type of filesystem */ \
112 uint32_t f_flags; /* copy of mount exported flags */ \
113 uint32_t f_fssubtype; /* fs sub-type (flavor) */ \
114 char f_fstypename[MFSTYPENAMELEN]; /* fs type name */ \
115 char f_mntonname[MAXPATHLEN]; /* directory on which mounted */ \
116 char f_mntfromname[MAXPATHLEN]; /* mounted filesystem */ \
117 uint32_t f_flags_ext; /* extended flags */ \
118 uint32_t f_reserved[7]; /* For future use */ \
119}
120
121#if !__DARWIN_ONLY_64_BIT_INO_T
122
123struct statfs64 __DARWIN_STRUCT_STATFS64;
124
125#endif /* !__DARWIN_ONLY_64_BIT_INO_T */
126
127#if __DARWIN_64_BIT_INO_T
128
129struct statfs __DARWIN_STRUCT_STATFS64;
130
131#else /* !__DARWIN_64_BIT_INO_T */
132
133/*
134 * LP64 - WARNING - must be kept in sync with struct user_statfs in mount_internal.h.
135 */
136struct statfs {
137 short f_otype; /* TEMPORARY SHADOW COPY OF f_type */
138 short f_oflags; /* TEMPORARY SHADOW COPY OF f_flags */
139 long f_bsize; /* fundamental file system block size */
140 long f_iosize; /* optimal transfer block size */
141 long f_blocks; /* total data blocks in file system */
142 long f_bfree; /* free blocks in fs */
143 long f_bavail; /* free blocks avail to non-superuser */
144 long f_files; /* total file nodes in file system */
145 long f_ffree; /* free file nodes in fs */
146 fsid_t f_fsid; /* file system id */
147 uid_t f_owner; /* user that mounted the filesystem */
148 short f_reserved1; /* spare for later */
149 short f_type; /* type of filesystem */
150 long f_flags; /* copy of mount exported flags */
151 long f_reserved2[2]; /* reserved for future use */
152 char f_fstypename[MFSNAMELEN]; /* fs type name */
153 char f_mntonname[MNAMELEN]; /* directory on which mounted */
154 char f_mntfromname[MNAMELEN];/* mounted filesystem */
155 char f_reserved3; /* For alignment */
156 long f_reserved4[4]; /* For future use */
157};
158
159#endif /* __DARWIN_64_BIT_INO_T */
160
161#pragma pack(4)
162
163struct vfsstatfs {
164 uint32_t f_bsize; /* fundamental file system block size */
165 size_t f_iosize; /* optimal transfer block size */
166 uint64_t f_blocks; /* total data blocks in file system */
167 uint64_t f_bfree; /* free blocks in fs */
168 uint64_t f_bavail; /* free blocks avail to non-superuser */
169 uint64_t f_bused; /* free blocks avail to non-superuser */
170 uint64_t f_files; /* total file nodes in file system */
171 uint64_t f_ffree; /* free file nodes in fs */
172 fsid_t f_fsid; /* file system id */
173 uid_t f_owner; /* user that mounted the filesystem */
174 uint64_t f_flags; /* copy of mount exported flags */
175 char f_fstypename[MFSTYPENAMELEN];/* fs type name inclus */
176 char f_mntonname[MAXPATHLEN];/* directory on which mounted */
177 char f_mntfromname[MAXPATHLEN];/* mounted filesystem */
178 uint32_t f_fssubtype; /* fs sub-type (flavor) */
179 void *f_reserved[2]; /* For future use == 0 */
180};
181
182#pragma pack()
183
184
185/*
186 * User specifiable flags.
187 *
188 * Unmount uses MNT_FORCE flag.
189 */
190#define MNT_RDONLY 0x00000001 /* read only filesystem */
191#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
192#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
193#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
194#define MNT_NODEV 0x00000010 /* don't interpret special files */
195#define MNT_UNION 0x00000020 /* union with underlying filesystem */
196#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
197#define MNT_CPROTECT 0x00000080 /* file system supports content protection */
198
199/*
200 * NFS export related mount flags.
201 */
202#define MNT_EXPORTED 0x00000100 /* file system is exported */
203
204/*
205 * Denotes storage which can be removed from the system by the user.
206 */
207
208#define MNT_REMOVABLE 0x00000200
209
210/*
211 * MAC labeled / "quarantined" flag
212 */
213#define MNT_QUARANTINE 0x00000400 /* file system is quarantined */
214
215/*
216 * Flags set by internal operations.
217 */
218#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
219#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
220#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
221#define MNT_DOVOLFS 0x00008000 /* FS supports volfs (deprecated flag in Mac OS X 10.5) */
222
223
224#define MNT_DONTBROWSE 0x00100000 /* file system is not appropriate path to user data */
225#define MNT_IGNORE_OWNERSHIP 0x00200000 /* VFS will ignore ownership information on filesystem objects */
226#define MNT_AUTOMOUNTED 0x00400000 /* filesystem was mounted by automounter */
227#define MNT_JOURNALED 0x00800000 /* filesystem is journaled */
228#define MNT_NOUSERXATTR 0x01000000 /* Don't allow user extended attributes */
229#define MNT_DEFWRITE 0x02000000 /* filesystem should defer writes */
230#define MNT_MULTILABEL 0x04000000 /* MAC support for individual labels */
231#define MNT_NOATIME 0x10000000 /* disable update of file access time */
232#define MNT_SNAPSHOT 0x40000000 /* The mount is a snapshot */
233#define MNT_STRICTATIME 0x80000000 /* enable strict update of file access time */
234
235/* backwards compatibility only */
236#define MNT_UNKNOWNPERMISSIONS MNT_IGNORE_OWNERSHIP
237
238
239/*
240 * XXX I think that this could now become (~(MNT_CMDFLAGS))
241 * but the 'mount' program may need changing to handle this.
242 */
243#define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | \
244 MNT_NOSUID | MNT_NODEV | MNT_UNION | \
245 MNT_ASYNC | MNT_EXPORTED | MNT_QUARANTINE | \
246 MNT_LOCAL | MNT_QUOTA | MNT_REMOVABLE | \
247 MNT_ROOTFS | MNT_DOVOLFS | MNT_DONTBROWSE | \
248 MNT_IGNORE_OWNERSHIP | MNT_AUTOMOUNTED | MNT_JOURNALED | \
249 MNT_NOUSERXATTR | MNT_DEFWRITE | MNT_MULTILABEL | \
250 MNT_NOATIME | MNT_STRICTATIME | MNT_SNAPSHOT | MNT_CPROTECT)
251/*
252 * External filesystem command modifier flags.
253 * Unmount can use the MNT_FORCE flag.
254 * XXX These are not STATES and really should be somewhere else.
255 * External filesystem control flags.
256 */
257#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
258#define MNT_NOBLOCK 0x00020000 /* don't block unmount if not responding */
259#define MNT_RELOAD 0x00040000 /* reload filesystem data */
260#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
261#define MNT_CMDFLAGS (MNT_UPDATE|MNT_NOBLOCK|MNT_RELOAD|MNT_FORCE)
262
263
264
265/*
266 * Sysctl CTL_VFS definitions.
267 *
268 * Second level identifier specifies which filesystem. Second level
269 * identifier VFS_GENERIC returns information about all filesystems.
270 */
271#define VFS_GENERIC 0 /* generic filesystem information */
272#define VFS_NUMMNTOPS 1 /* int: total num of vfs mount/unmount operations */
273/*
274 * Third level identifiers for VFS_GENERIC are given below; third
275 * level identifiers for specific filesystems are given in their
276 * mount specific header files.
277 */
278#define VFS_MAXTYPENUM 1 /* int: highest defined filesystem type */
279#define VFS_CONF 2 /* struct: vfsconf for filesystem given
280 * as next argument */
281
282/*
283 * Flags for various system call interfaces.
284 *
285 * waitfor flags to vfs_sync() and getfsstat()
286 */
287#define MNT_WAIT 1 /* synchronized I/O file integrity completion */
288#define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */
289#define MNT_DWAIT 4 /* synchronized I/O data integrity completion */
290
291
292#if !defined(KERNEL) && !defined(_KERN_SYS_KERNELTYPES_H_) /* also defined in kernel_types.h */
293struct mount;
294typedef struct mount * mount_t;
295struct vnode;
296typedef struct vnode * vnode_t;
297#endif
298
299/* Reserved fields preserve binary compatibility */
300struct vfsconf {
301 uint32_t vfc_reserved1; /* opaque */
302 char vfc_name[MFSNAMELEN]; /* filesystem type name */
303 int vfc_typenum; /* historic filesystem type number */
304 int vfc_refcount; /* number mounted of this type */
305 int vfc_flags; /* permanent flags */
306 uint32_t vfc_reserved2; /* opaque */
307 uint32_t vfc_reserved3; /* opaque */
308};
309
310struct vfsidctl {
311 int vc_vers; /* should be VFSIDCTL_VERS1 (below) */
312 fsid_t vc_fsid; /* fsid to operate on. */
313 void *vc_ptr; /* pointer to data structure. */
314 size_t vc_len; /* sizeof said structure. */
315 u_int32_t vc_spare[12]; /* spare (must be zero). */
316};
317
318
319/* vfsidctl API version. */
320#define VFS_CTL_VERS1 0x01
321
322
323/*
324 * New style VFS sysctls, do not reuse/conflict with the namespace for
325 * private sysctls.
326 */
327#define VFS_CTL_STATFS 0x00010001 /* statfs */
328#define VFS_CTL_UMOUNT 0x00010002 /* unmount */
329#define VFS_CTL_QUERY 0x00010003 /* anything wrong? (vfsquery) */
330#define VFS_CTL_NEWADDR 0x00010004 /* reconnect to new address */
331#define VFS_CTL_TIMEO 0x00010005 /* set timeout for vfs notification */
332#define VFS_CTL_NOLOCKS 0x00010006 /* disable file locking */
333#define VFS_CTL_SADDR 0x00010007 /* get server address */
334#define VFS_CTL_DISC 0x00010008 /* server disconnected */
335#define VFS_CTL_SERVERINFO 0x00010009 /* information about fs server */
336#define VFS_CTL_NSTATUS 0x0001000A /* netfs mount status */
337
338struct vfsquery {
339 u_int32_t vq_flags;
340 u_int32_t vq_spare[31];
341};
342
343struct vfs_server {
344 int32_t vs_minutes; /* minutes until server goes down. */
345 u_int8_t vs_server_name[MAXHOSTNAMELEN * 3]; /* UTF8 server name to display (null terminated) */
346};
347
348/*
349 * NetFS mount status - returned by VFS_CTL_NSTATUS
350 */
351struct netfs_status {
352 u_int32_t ns_status; // Current status of mount (vfsquery flags)
353 char ns_mountopts[512]; // Significant mount options
354 uint32_t ns_waittime; // Time waiting for reply (sec)
355 uint32_t ns_threadcount; // Number of threads blocked on network calls
356 uint64_t ns_threadids[0]; // Thread IDs of those blocked threads
357};
358
359/* vfsquery flags */
360#define VQ_NOTRESP 0x0001 /* server down */
361#define VQ_NEEDAUTH 0x0002 /* server bad auth */
362#define VQ_LOWDISK 0x0004 /* we're low on space */
363#define VQ_MOUNT 0x0008 /* new filesystem arrived */
364#define VQ_UNMOUNT 0x0010 /* filesystem has left */
365#define VQ_DEAD 0x0020 /* filesystem is dead, needs force unmount */
366#define VQ_ASSIST 0x0040 /* filesystem needs assistance from external program */
367#define VQ_NOTRESPLOCK 0x0080 /* server lockd down */
368#define VQ_UPDATE 0x0100 /* filesystem information has changed */
369#define VQ_VERYLOWDISK 0x0200 /* file system has *very* little disk space left */
370#define VQ_SYNCEVENT 0x0400 /* a sync just happened (not set by kernel starting Mac OS X 10.9) */
371#define VQ_SERVEREVENT 0x0800 /* server issued notification/warning */
372#define VQ_QUOTA 0x1000 /* a user quota has been hit */
373#define VQ_NEARLOWDISK 0x2000 /* Above lowdisk and below desired disk space */
374#define VQ_DESIRED_DISK 0x4000 /* the desired disk space */
375#define VQ_FREE_SPACE_CHANGE 0x8000 /* free disk space has significantly changed */
376#define VQ_FLAG10000 0x10000 /* placeholder */
377
378
379
380
381/*
382 * Generic file handle
383 */
384#define NFS_MAX_FH_SIZE NFSV4_MAX_FH_SIZE
385#define NFSV4_MAX_FH_SIZE 128
386#define NFSV3_MAX_FH_SIZE 64
387#define NFSV2_MAX_FH_SIZE 32
388struct fhandle {
389 unsigned int fh_len; /* length of file handle */
390 unsigned char fh_data[NFS_MAX_FH_SIZE]; /* file handle value */
391};
392typedef struct fhandle fhandle_t;
393
394
395__BEGIN_DECLS
396int fhopen(const struct fhandle *, int);
397int fstatfs(int, struct statfs *) __DARWIN_INODE64(fstatfs);
398#if !__DARWIN_ONLY_64_BIT_INO_T
399int fstatfs64(int, struct statfs64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
400#endif /* !__DARWIN_ONLY_64_BIT_INO_T */
401int getfh(const char *, fhandle_t *);
402int getfsstat(struct statfs *, int, int) __DARWIN_INODE64(getfsstat);
403#if !__DARWIN_ONLY_64_BIT_INO_T
404int getfsstat64(struct statfs64 *, int, int) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
405#endif /* !__DARWIN_ONLY_64_BIT_INO_T */
406int getmntinfo(struct statfs **, int) __DARWIN_INODE64(getmntinfo);
407int getmntinfo_r_np(struct statfs **, int) __DARWIN_INODE64(getmntinfo_r_np)
408__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0)
409__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
410#if !__DARWIN_ONLY_64_BIT_INO_T
411int getmntinfo64(struct statfs64 **, int) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
412#endif /* !__DARWIN_ONLY_64_BIT_INO_T */
413int mount(const char *, const char *, int, void *);
414int fmount(const char *, int, int, void *) __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
415int statfs(const char *, struct statfs *) __DARWIN_INODE64(statfs);
416#if !__DARWIN_ONLY_64_BIT_INO_T
417int statfs64(const char *, struct statfs64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
418#endif /* !__DARWIN_ONLY_64_BIT_INO_T */
419int unmount(const char *, int);
420int getvfsbyname(const char *, struct vfsconf *);
421__END_DECLS
422
423#endif /* !_SYS_MOUNT_H_ */
lib/libc/include/x86_64-macos-gnu/sysexits.h created+118
...@@ -0,0 +1,118 @@
1/*
2 * Copyright (c) 1987, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)sysexits.h 8.1 (Berkeley) 6/2/93
34 */
35
36#ifndef _SYSEXITS_H_
37#define _SYSEXITS_H_
38
39/*
40 * SYSEXITS.H -- Exit status codes for system programs.
41 *
42 * This include file attempts to categorize possible error
43 * exit statuses for system programs, notably delivermail
44 * and the Berkeley network.
45 *
46 * Error numbers begin at EX__BASE to reduce the possibility of
47 * clashing with other exit statuses that random programs may
48 * already return. The meaning of the codes is approximately
49 * as follows:
50 *
51 * EX_USAGE -- The command was used incorrectly, e.g., with
52 * the wrong number of arguments, a bad flag, a bad
53 * syntax in a parameter, or whatever.
54 * EX_DATAERR -- The input data was incorrect in some way.
55 * This should only be used for user's data & not
56 * system files.
57 * EX_NOINPUT -- An input file (not a system file) did not
58 * exist or was not readable. This could also include
59 * errors like "No message" to a mailer (if it cared
60 * to catch it).
61 * EX_NOUSER -- The user specified did not exist. This might
62 * be used for mail addresses or remote logins.
63 * EX_NOHOST -- The host specified did not exist. This is used
64 * in mail addresses or network requests.
65 * EX_UNAVAILABLE -- A service is unavailable. This can occur
66 * if a support program or file does not exist. This
67 * can also be used as a catchall message when something
68 * you wanted to do doesn't work, but you don't know
69 * why.
70 * EX_SOFTWARE -- An internal software error has been detected.
71 * This should be limited to non-operating system related
72 * errors as possible.
73 * EX_OSERR -- An operating system error has been detected.
74 * This is intended to be used for such things as "cannot
75 * fork", "cannot create pipe", or the like. It includes
76 * things like getuid returning a user that does not
77 * exist in the passwd file.
78 * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
79 * etc.) does not exist, cannot be opened, or has some
80 * sort of error (e.g., syntax error).
81 * EX_CANTCREAT -- A (user specified) output file cannot be
82 * created.
83 * EX_IOERR -- An error occurred while doing I/O on some file.
84 * EX_TEMPFAIL -- temporary failure, indicating something that
85 * is not really an error. In sendmail, this means
86 * that a mailer (e.g.) could not create a connection,
87 * and the request should be reattempted later.
88 * EX_PROTOCOL -- the remote system returned something that
89 * was "not possible" during a protocol exchange.
90 * EX_NOPERM -- You did not have sufficient permission to
91 * perform the operation. This is not intended for
92 * file system problems, which should use NOINPUT or
93 * CANTCREAT, but rather for higher level permissions.
94 */
95
96#define EX_OK 0 /* successful termination */
97
98#define EX__BASE 64 /* base value for error messages */
99
100#define EX_USAGE 64 /* command line usage error */
101#define EX_DATAERR 65 /* data format error */
102#define EX_NOINPUT 66 /* cannot open input */
103#define EX_NOUSER 67 /* addressee unknown */
104#define EX_NOHOST 68 /* host name unknown */
105#define EX_UNAVAILABLE 69 /* service unavailable */
106#define EX_SOFTWARE 70 /* internal software error */
107#define EX_OSERR 71 /* system error (e.g., can't fork) */
108#define EX_OSFILE 72 /* critical OS file missing */
109#define EX_CANTCREAT 73 /* can't create (user) output file */
110#define EX_IOERR 74 /* input/output error */
111#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
112#define EX_PROTOCOL 76 /* remote error in protocol */
113#define EX_NOPERM 77 /* permission denied */
114#define EX_CONFIG 78 /* configuration error */
115
116#define EX__MAX 78 /* maximum listed value */
117
118#endif /* !_SYSEXITS_H_ */