Unnamed: 0
int64
0
0
repo_id
stringlengths
5
186
file_path
stringlengths
15
223
content
stringlengths
1
32.8M
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/task_policy.h
/* * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_TASK_POLICY_H_ #define _MACH_TASK_POLICY_H_ #include <mach/mach_types.h> /* * These are the calls for accessing the policy parameters * of a particular task. * * The extra 'get_default' parameter to the second call is * IN/OUT as follows: * 1) if asserted on the way in it indicates that the default * values should be returned, not the ones currently set, in * this case 'get_default' will always be asserted on return; * 2) if unasserted on the way in, the current settings are * desired and if still unasserted on return, then the info * returned reflects the current settings, otherwise if * 'get_default' returns asserted, it means that there are no * current settings due to other parameters taking precedence, * and the default ones are being returned instead. */ typedef natural_t task_policy_flavor_t; typedef integer_t *task_policy_t; /* * kern_return_t task_policy_set( * task_t task, * task_policy_flavor_t flavor, * task_policy_t policy_info, * mach_msg_type_number_t count); * * kern_return_t task_policy_get( * task_t task, * task_policy_flavor_t flavor, * task_policy_t policy_info, * mach_msg_type_number_t *count, * boolean_t *get_default); */ /* * Defined flavors. */ /* * TASK_CATEGORY_POLICY: * * This provides information to the kernel about the role * of the task in the system. * * Parameters: * * role: Enumerated as follows: * * TASK_UNSPECIFIED is the default, since the role is not * inherited from the parent. * * TASK_FOREGROUND_APPLICATION should be assigned when the * task is a normal UI application in the foreground from * the HI point of view. * **N.B. There may be more than one of these at a given time. * * TASK_BACKGROUND_APPLICATION should be assigned when the * task is a normal UI application in the background from * the HI point of view. * * TASK_CONTROL_APPLICATION should be assigned to the unique * UI application which implements the pop-up application dialog. * There can only be one task at a time with this designation, * which is assigned FCFS. * * TASK_GRAPHICS_SERVER should be assigned to the graphics * management (window) server. There can only be one task at * a time with this designation, which is assigned FCFS. */ #define TASK_CATEGORY_POLICY 1 #define TASK_SUPPRESSION_POLICY 3 #define TASK_POLICY_STATE 4 #define TASK_BASE_QOS_POLICY 8 #define TASK_OVERRIDE_QOS_POLICY 9 #define TASK_BASE_LATENCY_QOS_POLICY 10 #define TASK_BASE_THROUGHPUT_QOS_POLICY 11 typedef enum task_role { TASK_RENICED = -1, TASK_UNSPECIFIED = 0, TASK_FOREGROUND_APPLICATION = 1, TASK_BACKGROUND_APPLICATION = 2, TASK_CONTROL_APPLICATION = 3, TASK_GRAPHICS_SERVER = 4, TASK_THROTTLE_APPLICATION = 5, TASK_NONUI_APPLICATION = 6, TASK_DEFAULT_APPLICATION = 7, TASK_DARWINBG_APPLICATION = 8, } task_role_t; struct task_category_policy { task_role_t role; }; typedef struct task_category_policy task_category_policy_data_t; typedef struct task_category_policy *task_category_policy_t; #define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) \ (sizeof (task_category_policy_data_t) / sizeof (integer_t))) enum task_latency_qos { LATENCY_QOS_TIER_UNSPECIFIED = 0x0, LATENCY_QOS_TIER_0 = ((0xFF << 16) | 1), LATENCY_QOS_TIER_1 = ((0xFF << 16) | 2), LATENCY_QOS_TIER_2 = ((0xFF << 16) | 3), LATENCY_QOS_TIER_3 = ((0xFF << 16) | 4), LATENCY_QOS_TIER_4 = ((0xFF << 16) | 5), LATENCY_QOS_TIER_5 = ((0xFF << 16) | 6) }; typedef integer_t task_latency_qos_t; enum task_throughput_qos { THROUGHPUT_QOS_TIER_UNSPECIFIED = 0x0, THROUGHPUT_QOS_TIER_0 = ((0xFE << 16) | 1), THROUGHPUT_QOS_TIER_1 = ((0xFE << 16) | 2), THROUGHPUT_QOS_TIER_2 = ((0xFE << 16) | 3), THROUGHPUT_QOS_TIER_3 = ((0xFE << 16) | 4), THROUGHPUT_QOS_TIER_4 = ((0xFE << 16) | 5), THROUGHPUT_QOS_TIER_5 = ((0xFE << 16) | 6), }; #define LATENCY_QOS_LAUNCH_DEFAULT_TIER LATENCY_QOS_TIER_3 #define THROUGHPUT_QOS_LAUNCH_DEFAULT_TIER THROUGHPUT_QOS_TIER_3 typedef integer_t task_throughput_qos_t; struct task_qos_policy { task_latency_qos_t task_latency_qos_tier; task_throughput_qos_t task_throughput_qos_tier; }; typedef struct task_qos_policy *task_qos_policy_t; #define TASK_QOS_POLICY_COUNT ((mach_msg_type_number_t) \ (sizeof (struct task_qos_policy) / sizeof (integer_t))) /* These should be removed - they belong in proc_info.h */ #define PROC_FLAG_DARWINBG 0x8000 /* process in darwin background */ #define PROC_FLAG_EXT_DARWINBG 0x10000 /* process in darwin background - external enforcement */ #define PROC_FLAG_IOS_APPLEDAEMON 0x20000 /* process is apple ios daemon */ #define PROC_FLAG_IOS_IMPPROMOTION 0x80000 /* process is apple ios daemon */ #define PROC_FLAG_ADAPTIVE 0x100000 /* Process is adaptive */ #define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000 /* Process is adaptive, and is currently important */ #define PROC_FLAG_IMPORTANCE_DONOR 0x400000 /* Process is marked as an importance donor */ #define PROC_FLAG_SUPPRESSED 0x800000 /* Process is suppressed */ #define PROC_FLAG_APPLICATION 0x1000000 /* Process is an application */ #define PROC_FLAG_IOS_APPLICATION PROC_FLAG_APPLICATION /* Process is an application */ #endif /* _MACH_TASK_POLICY_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/vfs_nspace_server.h
#ifndef _vfs_nspace_server_ #define _vfs_nspace_server_ /* Module vfs_nspace */ #include <string.h> #include <mach/ndr.h> #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/notify.h> #include <mach/mach_types.h> #include <mach/message.h> #include <mach/mig_errors.h> #include <mach/port.h> /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ #if defined(__has_include) #if __has_include(<mach/mig_strncpy_zerofill_support.h>) #ifndef USING_MIG_STRNCPY_ZEROFILL #define USING_MIG_STRNCPY_ZEROFILL #endif #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #ifdef __cplusplus extern "C" { #endif extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); #ifdef __cplusplus } #endif #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ #endif /* __has_include */ /* END MIG_STRNCPY_ZEROFILL CODE */ #ifdef AUTOTEST #ifndef FUNCTION_PTR_T #define FUNCTION_PTR_T typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); typedef struct { char *name; function_ptr_t function; } function_table_entry; typedef function_table_entry *function_table_t; #endif /* FUNCTION_PTR_T */ #endif /* AUTOTEST */ #ifndef vfs_nspace_MSG_COUNT #define vfs_nspace_MSG_COUNT 7 #endif /* vfs_nspace_MSG_COUNT */ #include <Availability.h> #include <mach/std_types.h> #include <mach/mig.h> #include <mach/mig.h> #include <mach/mach_types.h> #include <atm/atm_types.h> #ifdef __BeforeMigServerHeader __BeforeMigServerHeader #endif /* __BeforeMigServerHeader */ #ifndef MIG_SERVER_ROUTINE #define MIG_SERVER_ROUTINE #endif /* Routine nspace_handle */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_nspace_handle ( mach_port_t nspace_handler_port, uint32_t pid, vfs_path_t path, int *handler_error ); /* Routine nspace_resolve_cancel */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_nspace_resolve_cancel ( mach_port_t nspace_handler_port, uint32_t req_id ); /* Routine nspace_resolve_path */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_nspace_resolve_path ( mach_port_t nspace_handler_port, uint32_t req_id, uint32_t pid, uint32_t op, nspace_path_t path, int *xxx_rdar44371223 ); /* Routine vfs_resolve_file */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_vfs_resolve_file ( mach_port_t nspace_handler_port, uint32_t req_id, uint32_t pid, uint32_t op, int64_t offset, int64_t size, nspace_path_t path ); /* Routine vfs_resolve_dir */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_vfs_resolve_dir ( mach_port_t nspace_handler_port, uint32_t req_id, uint32_t pid, uint32_t op, nspace_name_t file_name, nspace_path_t path ); /* Routine vfs_resolve_file_with_audit_token */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_vfs_resolve_file_with_audit_token ( mach_port_t nspace_handler_port, uint32_t req_id, uint32_t op, int64_t offset, int64_t size, nspace_path_t path, audit_token_t req_atoken, audit_token_t atoken ); /* Routine vfs_resolve_dir_with_audit_token */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ MIG_SERVER_ROUTINE kern_return_t receive_vfs_resolve_dir_with_audit_token ( mach_port_t nspace_handler_port, uint32_t req_id, uint32_t op, nspace_name_t file_name, nspace_path_t path, audit_token_t req_atoken, audit_token_t atoken ); #ifdef mig_external mig_external #else extern #endif /* mig_external */ boolean_t vfs_nspace_server( mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); #ifdef mig_external mig_external #else extern #endif /* mig_external */ mig_routine_t vfs_nspace_server_routine( mach_msg_header_t *InHeadP); /* Description of this subsystem, for use in direct RPC */ extern const struct receive_vfs_nspace_subsystem { mig_server_routine_t server; /* Server routine */ mach_msg_id_t start; /* Min routine number */ mach_msg_id_t end; /* Max routine number + 1 */ unsigned int maxsize; /* Max msg size */ vm_address_t reserved; /* Reserved */ struct routine_descriptor /*Array of routine descriptors */ routine[7]; } receive_vfs_nspace_subsystem; /* typedefs for all requests */ #ifndef __Request__vfs_nspace_subsystem__defined #define __Request__vfs_nspace_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t pid; vfs_path_t path; } __Request__nspace_handle_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t req_id; } __Request__nspace_resolve_cancel_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t req_id; uint32_t pid; uint32_t op; nspace_path_t path; } __Request__nspace_resolve_path_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t req_id; uint32_t pid; uint32_t op; int64_t offset; int64_t size; nspace_path_t path; } __Request__vfs_resolve_file_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t req_id; uint32_t pid; uint32_t op; nspace_name_t file_name; nspace_path_t path; } __Request__vfs_resolve_dir_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t req_id; uint32_t op; int64_t offset; int64_t size; nspace_path_t path; audit_token_t req_atoken; } __Request__vfs_resolve_file_with_audit_token_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint32_t req_id; uint32_t op; nspace_name_t file_name; nspace_path_t path; audit_token_t req_atoken; } __Request__vfs_resolve_dir_with_audit_token_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Request__vfs_nspace_subsystem__defined */ /* union of all requests */ #ifndef __RequestUnion__receive_vfs_nspace_subsystem__defined #define __RequestUnion__receive_vfs_nspace_subsystem__defined union __RequestUnion__receive_vfs_nspace_subsystem { __Request__nspace_handle_t Request_nspace_handle; __Request__nspace_resolve_cancel_t Request_nspace_resolve_cancel; __Request__nspace_resolve_path_t Request_nspace_resolve_path; __Request__vfs_resolve_file_t Request_vfs_resolve_file; __Request__vfs_resolve_dir_t Request_vfs_resolve_dir; __Request__vfs_resolve_file_with_audit_token_t Request_vfs_resolve_file_with_audit_token; __Request__vfs_resolve_dir_with_audit_token_t Request_vfs_resolve_dir_with_audit_token; }; #endif /* __RequestUnion__receive_vfs_nspace_subsystem__defined */ /* typedefs for all replies */ #ifndef __Reply__vfs_nspace_subsystem__defined #define __Reply__vfs_nspace_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; int handler_error; } __Reply__nspace_handle_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__nspace_resolve_cancel_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; int xxx_rdar44371223; } __Reply__nspace_resolve_path_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__vfs_resolve_file_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__vfs_resolve_dir_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__vfs_resolve_file_with_audit_token_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__vfs_resolve_dir_with_audit_token_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Reply__vfs_nspace_subsystem__defined */ /* union of all replies */ #ifndef __ReplyUnion__receive_vfs_nspace_subsystem__defined #define __ReplyUnion__receive_vfs_nspace_subsystem__defined union __ReplyUnion__receive_vfs_nspace_subsystem { __Reply__nspace_handle_t Reply_nspace_handle; __Reply__nspace_resolve_cancel_t Reply_nspace_resolve_cancel; __Reply__nspace_resolve_path_t Reply_nspace_resolve_path; __Reply__vfs_resolve_file_t Reply_vfs_resolve_file; __Reply__vfs_resolve_dir_t Reply_vfs_resolve_dir; __Reply__vfs_resolve_file_with_audit_token_t Reply_vfs_resolve_file_with_audit_token; __Reply__vfs_resolve_dir_with_audit_token_t Reply_vfs_resolve_dir_with_audit_token; }; #endif /* __ReplyUnion__receive_vfs_nspace_subsystem__defined */ #ifndef subsystem_to_name_map_vfs_nspace #define subsystem_to_name_map_vfs_nspace \ { "nspace_handle", 867800 },\ { "nspace_resolve_cancel", 867801 },\ { "nspace_resolve_path", 867802 },\ { "vfs_resolve_file", 867803 },\ { "vfs_resolve_dir", 867804 },\ { "vfs_resolve_file_with_audit_token", 867805 },\ { "vfs_resolve_dir_with_audit_token", 867806 } #endif #ifdef __AfterMigServerHeader __AfterMigServerHeader #endif /* __AfterMigServerHeader */ #endif /* _vfs_nspace_server_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/processor_set.h
#ifndef _processor_set_user_ #define _processor_set_user_ /* Module processor_set */ #include <string.h> #include <mach/ndr.h> #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/notify.h> #include <mach/mach_types.h> #include <mach/message.h> #include <mach/mig_errors.h> #include <mach/port.h> /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ #if defined(__has_include) #if __has_include(<mach/mig_strncpy_zerofill_support.h>) #ifndef USING_MIG_STRNCPY_ZEROFILL #define USING_MIG_STRNCPY_ZEROFILL #endif #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #ifdef __cplusplus extern "C" { #endif extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); #ifdef __cplusplus } #endif #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ #endif /* __has_include */ /* END MIG_STRNCPY_ZEROFILL CODE */ #ifdef AUTOTEST #ifndef FUNCTION_PTR_T #define FUNCTION_PTR_T typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); typedef struct { char *name; function_ptr_t function; } function_table_entry; typedef function_table_entry *function_table_t; #endif /* FUNCTION_PTR_T */ #endif /* AUTOTEST */ #ifndef processor_set_MSG_COUNT #define processor_set_MSG_COUNT 11 #endif /* processor_set_MSG_COUNT */ #include <Availability.h> #include <mach/std_types.h> #include <mach/mig.h> #include <mach/mig.h> #include <mach/mach_types.h> #ifdef __BeforeMigUserHeader __BeforeMigUserHeader #endif /* __BeforeMigUserHeader */ #include <sys/cdefs.h> __BEGIN_DECLS /* Routine processor_set_statistics */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_statistics ( processor_set_name_t pset, processor_set_flavor_t flavor, processor_set_info_t info_out, mach_msg_type_number_t *info_outCnt ); /* Routine processor_set_destroy */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_destroy ( processor_set_t set ); /* Routine processor_set_max_priority */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_max_priority ( processor_set_t processor_set, int max_priority, boolean_t change_threads ); /* Routine processor_set_policy_enable */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_policy_enable ( processor_set_t processor_set, int policy ); /* Routine processor_set_policy_disable */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_policy_disable ( processor_set_t processor_set, int policy, boolean_t change_threads ); /* Routine processor_set_tasks */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_tasks ( processor_set_t processor_set, task_array_t *task_list, mach_msg_type_number_t *task_listCnt ); /* Routine processor_set_threads */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_threads ( processor_set_t processor_set, thread_act_array_t *thread_list, mach_msg_type_number_t *thread_listCnt ); /* Routine processor_set_policy_control */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_policy_control ( processor_set_t pset, processor_set_flavor_t flavor, processor_set_info_t policy_info, mach_msg_type_number_t policy_infoCnt, boolean_t change ); /* Routine processor_set_stack_usage */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_stack_usage ( processor_set_t pset, unsigned *ltotal, vm_size_t *space, vm_size_t *resident, vm_size_t *maxusage, vm_offset_t *maxstack ); /* Routine processor_set_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_info ( processor_set_name_t set_name, int flavor, host_t *host, processor_set_info_t info_out, mach_msg_type_number_t *info_outCnt ); /* Routine processor_set_tasks_with_flavor */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t processor_set_tasks_with_flavor ( processor_set_t processor_set, mach_task_flavor_t flavor, task_array_t *task_list, mach_msg_type_number_t *task_listCnt ); __END_DECLS /********************** Caution **************************/ /* The following data types should be used to calculate */ /* maximum message sizes only. The actual message may be */ /* smaller, and the position of the arguments within the */ /* message layout may vary from what is presented here. */ /* For example, if any of the arguments are variable- */ /* sized, and less than the maximum is sent, the data */ /* will be packed tight in the actual message to reduce */ /* the presence of holes. */ /********************** Caution **************************/ /* typedefs for all requests */ #ifndef __Request__processor_set_subsystem__defined #define __Request__processor_set_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; processor_set_flavor_t flavor; mach_msg_type_number_t info_outCnt; } __Request__processor_set_statistics_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__processor_set_destroy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int max_priority; boolean_t change_threads; } __Request__processor_set_max_priority_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int policy; } __Request__processor_set_policy_enable_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int policy; boolean_t change_threads; } __Request__processor_set_policy_disable_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__processor_set_tasks_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__processor_set_threads_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; processor_set_flavor_t flavor; mach_msg_type_number_t policy_infoCnt; integer_t policy_info[5]; boolean_t change; } __Request__processor_set_policy_control_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__processor_set_stack_usage_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int flavor; mach_msg_type_number_t info_outCnt; } __Request__processor_set_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; mach_task_flavor_t flavor; } __Request__processor_set_tasks_with_flavor_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Request__processor_set_subsystem__defined */ /* union of all requests */ #ifndef __RequestUnion__processor_set_subsystem__defined #define __RequestUnion__processor_set_subsystem__defined union __RequestUnion__processor_set_subsystem { __Request__processor_set_statistics_t Request_processor_set_statistics; __Request__processor_set_destroy_t Request_processor_set_destroy; __Request__processor_set_max_priority_t Request_processor_set_max_priority; __Request__processor_set_policy_enable_t Request_processor_set_policy_enable; __Request__processor_set_policy_disable_t Request_processor_set_policy_disable; __Request__processor_set_tasks_t Request_processor_set_tasks; __Request__processor_set_threads_t Request_processor_set_threads; __Request__processor_set_policy_control_t Request_processor_set_policy_control; __Request__processor_set_stack_usage_t Request_processor_set_stack_usage; __Request__processor_set_info_t Request_processor_set_info; __Request__processor_set_tasks_with_flavor_t Request_processor_set_tasks_with_flavor; }; #endif /* !__RequestUnion__processor_set_subsystem__defined */ /* typedefs for all replies */ #ifndef __Reply__processor_set_subsystem__defined #define __Reply__processor_set_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t info_outCnt; integer_t info_out[5]; } __Reply__processor_set_statistics_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__processor_set_destroy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__processor_set_max_priority_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__processor_set_policy_enable_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__processor_set_policy_disable_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t task_list; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t task_listCnt; } __Reply__processor_set_tasks_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t thread_list; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t thread_listCnt; } __Reply__processor_set_threads_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__processor_set_policy_control_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; unsigned ltotal; vm_size_t space; vm_size_t resident; vm_size_t maxusage; vm_offset_t maxstack; } __Reply__processor_set_stack_usage_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t host; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t info_outCnt; integer_t info_out[5]; } __Reply__processor_set_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t task_list; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t task_listCnt; } __Reply__processor_set_tasks_with_flavor_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Reply__processor_set_subsystem__defined */ /* union of all replies */ #ifndef __ReplyUnion__processor_set_subsystem__defined #define __ReplyUnion__processor_set_subsystem__defined union __ReplyUnion__processor_set_subsystem { __Reply__processor_set_statistics_t Reply_processor_set_statistics; __Reply__processor_set_destroy_t Reply_processor_set_destroy; __Reply__processor_set_max_priority_t Reply_processor_set_max_priority; __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable; __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable; __Reply__processor_set_tasks_t Reply_processor_set_tasks; __Reply__processor_set_threads_t Reply_processor_set_threads; __Reply__processor_set_policy_control_t Reply_processor_set_policy_control; __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage; __Reply__processor_set_info_t Reply_processor_set_info; __Reply__processor_set_tasks_with_flavor_t Reply_processor_set_tasks_with_flavor; }; #endif /* !__RequestUnion__processor_set_subsystem__defined */ #ifndef subsystem_to_name_map_processor_set #define subsystem_to_name_map_processor_set \ { "processor_set_statistics", 4000 },\ { "processor_set_destroy", 4001 },\ { "processor_set_max_priority", 4002 },\ { "processor_set_policy_enable", 4003 },\ { "processor_set_policy_disable", 4004 },\ { "processor_set_tasks", 4005 },\ { "processor_set_threads", 4006 },\ { "processor_set_policy_control", 4007 },\ { "processor_set_stack_usage", 4008 },\ { "processor_set_info", 4009 },\ { "processor_set_tasks_with_flavor", 4010 } #endif #ifdef __AfterMigUserHeader __AfterMigUserHeader #endif /* __AfterMigUserHeader */ #endif /* _processor_set_user_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/task.h
#ifndef _task_user_ #define _task_user_ /* Module task */ #include <string.h> #include <mach/ndr.h> #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/notify.h> #include <mach/mach_types.h> #include <mach/message.h> #include <mach/mig_errors.h> #include <mach/port.h> /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ #if defined(__has_include) #if __has_include(<mach/mig_strncpy_zerofill_support.h>) #ifndef USING_MIG_STRNCPY_ZEROFILL #define USING_MIG_STRNCPY_ZEROFILL #endif #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #ifdef __cplusplus extern "C" { #endif extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); #ifdef __cplusplus } #endif #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ #endif /* __has_include */ /* END MIG_STRNCPY_ZEROFILL CODE */ #ifdef AUTOTEST #ifndef FUNCTION_PTR_T #define FUNCTION_PTR_T typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); typedef struct { char *name; function_ptr_t function; } function_table_entry; typedef function_table_entry *function_table_t; #endif /* FUNCTION_PTR_T */ #endif /* AUTOTEST */ #ifndef task_MSG_COUNT #define task_MSG_COUNT 63 #endif /* task_MSG_COUNT */ #include <Availability.h> #include <mach/std_types.h> #include <mach/mig.h> #include <mach/mig.h> #include <mach/mach_types.h> #include <mach_debug/mach_debug_types.h> #ifdef __BeforeMigUserHeader __BeforeMigUserHeader #endif /* __BeforeMigUserHeader */ #include <sys/cdefs.h> __BEGIN_DECLS /* Routine task_create */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_create ( task_t target_task, ledger_array_t ledgers, mach_msg_type_number_t ledgersCnt, boolean_t inherit_memory, task_t *child_task ); /* Routine task_terminate */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_terminate ( task_t target_task ); /* Routine task_threads */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_threads ( task_inspect_t target_task, thread_act_array_t *act_list, mach_msg_type_number_t *act_listCnt ); /* Routine mach_ports_register */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t mach_ports_register ( task_t target_task, mach_port_array_t init_port_set, mach_msg_type_number_t init_port_setCnt ); /* Routine mach_ports_lookup */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t mach_ports_lookup ( task_t target_task, mach_port_array_t *init_port_set, mach_msg_type_number_t *init_port_setCnt ); /* Routine task_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_info ( task_name_t target_task, task_flavor_t flavor, task_info_t task_info_out, mach_msg_type_number_t *task_info_outCnt ); /* Routine task_set_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_info ( task_t target_task, task_flavor_t flavor, task_info_t task_info_in, mach_msg_type_number_t task_info_inCnt ); /* Routine task_suspend */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_suspend ( task_read_t target_task ); /* Routine task_resume */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_resume ( task_read_t target_task ); /* Routine task_get_special_port */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_special_port ( task_inspect_t task, int which_port, mach_port_t *special_port ); /* Routine task_set_special_port */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_special_port ( task_t task, int which_port, mach_port_t special_port ); /* Routine thread_create */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t thread_create ( task_t parent_task, thread_act_t *child_act ); /* Routine thread_create_running */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t thread_create_running ( task_t parent_task, thread_state_flavor_t flavor, thread_state_t new_state, mach_msg_type_number_t new_stateCnt, thread_act_t *child_act ); /* Routine task_set_exception_ports */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_exception_ports ( task_t task, exception_mask_t exception_mask, mach_port_t new_port, exception_behavior_t behavior, thread_state_flavor_t new_flavor ); /* Routine task_get_exception_ports */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_exception_ports ( task_t task, exception_mask_t exception_mask, exception_mask_array_t masks, mach_msg_type_number_t *masksCnt, exception_handler_array_t old_handlers, exception_behavior_array_t old_behaviors, exception_flavor_array_t old_flavors ); /* Routine task_swap_exception_ports */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_swap_exception_ports ( task_t task, exception_mask_t exception_mask, mach_port_t new_port, exception_behavior_t behavior, thread_state_flavor_t new_flavor, exception_mask_array_t masks, mach_msg_type_number_t *masksCnt, exception_handler_array_t old_handlers, exception_behavior_array_t old_behaviors, exception_flavor_array_t old_flavors ); /* Routine lock_set_create */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t lock_set_create ( task_t task, lock_set_t *new_lock_set, int n_ulocks, int policy ); /* Routine lock_set_destroy */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t lock_set_destroy ( task_t task, lock_set_t lock_set ); /* Routine semaphore_create */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t semaphore_create ( task_t task, semaphore_t *semaphore, int policy, int value ); /* Routine semaphore_destroy */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t semaphore_destroy ( task_t task, semaphore_t semaphore ); /* Routine task_policy_set */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_policy_set ( task_policy_set_t task, task_policy_flavor_t flavor, task_policy_t policy_info, mach_msg_type_number_t policy_infoCnt ); /* Routine task_policy_get */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_policy_get ( task_policy_get_t task, task_policy_flavor_t flavor, task_policy_t policy_info, mach_msg_type_number_t *policy_infoCnt, boolean_t *get_default ); /* Routine task_sample */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_sample ( task_t task, mach_port_t reply ); /* Routine task_policy */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_policy ( task_t task, policy_t policy, policy_base_t base, mach_msg_type_number_t baseCnt, boolean_t set_limit, boolean_t change ); /* Routine task_set_emulation */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_emulation ( task_t target_port, vm_address_t routine_entry_pt, int routine_number ); /* Routine task_get_emulation_vector */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_emulation_vector ( task_t task, int *vector_start, emulation_vector_t *emulation_vector, mach_msg_type_number_t *emulation_vectorCnt ); /* Routine task_set_emulation_vector */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_emulation_vector ( task_t task, int vector_start, emulation_vector_t emulation_vector, mach_msg_type_number_t emulation_vectorCnt ); /* Routine task_set_ras_pc */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_ras_pc ( task_t target_task, vm_address_t basepc, vm_address_t boundspc ); /* Routine task_zone_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_zone_info ( task_inspect_t target_task, mach_zone_name_array_t *names, mach_msg_type_number_t *namesCnt, task_zone_info_array_t *info, mach_msg_type_number_t *infoCnt ); /* Routine task_assign */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_assign ( task_t task, processor_set_t new_set, boolean_t assign_threads ); /* Routine task_assign_default */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_assign_default ( task_t task, boolean_t assign_threads ); /* Routine task_get_assignment */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_assignment ( task_inspect_t task, processor_set_name_t *assigned_set ); /* Routine task_set_policy */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_policy ( task_t task, processor_set_t pset, policy_t policy, policy_base_t base, mach_msg_type_number_t baseCnt, policy_limit_t limit, mach_msg_type_number_t limitCnt, boolean_t change ); /* Routine task_get_state */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_state ( task_read_t task, thread_state_flavor_t flavor, thread_state_t old_state, mach_msg_type_number_t *old_stateCnt ); /* Routine task_set_state */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_state ( task_t task, thread_state_flavor_t flavor, thread_state_t new_state, mach_msg_type_number_t new_stateCnt ); /* Routine task_set_phys_footprint_limit */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_phys_footprint_limit ( task_t task, int new_limit, int *old_limit ); /* Routine task_suspend2 */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_suspend2 ( task_read_t target_task, task_suspension_token_t *suspend_token ); /* Routine task_resume2 */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_resume2 ( task_suspension_token_t suspend_token ); /* Routine task_purgable_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_purgable_info ( task_inspect_t task, task_purgable_info_t *stats ); /* Routine task_get_mach_voucher */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_mach_voucher ( task_read_t task, mach_voucher_selector_t which, ipc_voucher_t *voucher ); /* Routine task_set_mach_voucher */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_mach_voucher ( task_t task, ipc_voucher_t voucher ); /* Routine task_swap_mach_voucher */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_swap_mach_voucher ( task_t task, ipc_voucher_t new_voucher, ipc_voucher_t *old_voucher ); /* Routine task_generate_corpse */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_generate_corpse ( task_read_t task, mach_port_t *corpse_task_port ); /* Routine task_map_corpse_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_map_corpse_info ( task_t task, task_read_t corspe_task, vm_address_t *kcd_addr_begin, uint32_t *kcd_size ); /* Routine task_register_dyld_image_infos */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_register_dyld_image_infos ( task_t task, dyld_kernel_image_info_array_t dyld_images, mach_msg_type_number_t dyld_imagesCnt ); /* Routine task_unregister_dyld_image_infos */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_unregister_dyld_image_infos ( task_t task, dyld_kernel_image_info_array_t dyld_images, mach_msg_type_number_t dyld_imagesCnt ); /* Routine task_get_dyld_image_infos */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_dyld_image_infos ( task_read_t task, dyld_kernel_image_info_array_t *dyld_images, mach_msg_type_number_t *dyld_imagesCnt ); /* Routine task_register_dyld_shared_cache_image_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_register_dyld_shared_cache_image_info ( task_t task, dyld_kernel_image_info_t dyld_cache_image, boolean_t no_cache, boolean_t private_cache ); /* Routine task_register_dyld_set_dyld_state */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_register_dyld_set_dyld_state ( task_t task, uint8_t dyld_state ); /* Routine task_register_dyld_get_process_state */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_register_dyld_get_process_state ( task_t task, dyld_kernel_process_info_t *dyld_process_state ); /* Routine task_map_corpse_info_64 */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_map_corpse_info_64 ( task_t task, task_read_t corspe_task, mach_vm_address_t *kcd_addr_begin, mach_vm_size_t *kcd_size ); /* Routine task_inspect */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_inspect ( task_inspect_t task, task_inspect_flavor_t flavor, task_inspect_info_t info_out, mach_msg_type_number_t *info_outCnt ); /* Routine task_get_exc_guard_behavior */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_exc_guard_behavior ( task_inspect_t task, task_exc_guard_behavior_t *behavior ); /* Routine task_set_exc_guard_behavior */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_exc_guard_behavior ( task_t task, task_exc_guard_behavior_t behavior ); /* Routine task_create_suid_cred */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_create_suid_cred ( task_t task, suid_cred_path_t path, suid_cred_uid_t uid, suid_cred_t *delegation ); /* Routine mach_task_is_self */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t mach_task_is_self ( task_name_t task, boolean_t *is_self ); /* Routine task_dyld_process_info_notify_register */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_dyld_process_info_notify_register ( task_read_t target_task, mach_port_t notify ); /* Routine task_create_identity_token */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_create_identity_token ( task_t task, task_id_token_t *token ); /* Routine task_identity_token_get_task_port */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_identity_token_get_task_port ( task_id_token_t token, task_flavor_t flavor, mach_port_t *task_port ); /* Routine task_dyld_process_info_notify_deregister */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_dyld_process_info_notify_deregister ( task_read_t target_task, mach_port_name_t notify ); /* Routine task_get_exception_ports_info */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_get_exception_ports_info ( mach_port_t port, exception_mask_t exception_mask, exception_mask_array_t masks, mach_msg_type_number_t *masksCnt, exception_handler_info_array_t old_handlers_info, exception_behavior_array_t old_behaviors, exception_flavor_array_t old_flavors ); /* Routine task_test_sync_upcall */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_test_sync_upcall ( task_t task, mach_port_t port ); /* Routine task_set_corpse_forking_behavior */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t task_set_corpse_forking_behavior ( task_t task, task_corpse_forking_behavior_t behavior ); __END_DECLS /********************** Caution **************************/ /* The following data types should be used to calculate */ /* maximum message sizes only. The actual message may be */ /* smaller, and the position of the arguments within the */ /* message layout may vary from what is presented here. */ /* For example, if any of the arguments are variable- */ /* sized, and less than the maximum is sent, the data */ /* will be packed tight in the actual message to reduce */ /* the presence of holes. */ /********************** Caution **************************/ /* typedefs for all requests */ #ifndef __Request__task_subsystem__defined #define __Request__task_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t ledgers; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t ledgersCnt; boolean_t inherit_memory; } __Request__task_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_terminate_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_threads_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t init_port_set; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t init_port_setCnt; } __Request__mach_ports_register_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__mach_ports_lookup_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_flavor_t flavor; mach_msg_type_number_t task_info_outCnt; } __Request__task_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_flavor_t flavor; mach_msg_type_number_t task_info_inCnt; integer_t task_info_in[87]; } __Request__task_set_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_suspend_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_resume_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int which_port; } __Request__task_get_special_port_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t special_port; /* end of the kernel processed data */ NDR_record_t NDR; int which_port; } __Request__task_set_special_port_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__thread_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; thread_state_flavor_t flavor; mach_msg_type_number_t new_stateCnt; natural_t new_state[1296]; } __Request__thread_create_running_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t new_port; /* end of the kernel processed data */ NDR_record_t NDR; exception_mask_t exception_mask; exception_behavior_t behavior; thread_state_flavor_t new_flavor; } __Request__task_set_exception_ports_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; exception_mask_t exception_mask; } __Request__task_get_exception_ports_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t new_port; /* end of the kernel processed data */ NDR_record_t NDR; exception_mask_t exception_mask; exception_behavior_t behavior; thread_state_flavor_t new_flavor; } __Request__task_swap_exception_ports_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int n_ulocks; int policy; } __Request__lock_set_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t lock_set; /* end of the kernel processed data */ } __Request__lock_set_destroy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int policy; int value; } __Request__semaphore_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t semaphore; /* end of the kernel processed data */ } __Request__semaphore_destroy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_policy_flavor_t flavor; mach_msg_type_number_t policy_infoCnt; integer_t policy_info[16]; } __Request__task_policy_set_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_policy_flavor_t flavor; mach_msg_type_number_t policy_infoCnt; boolean_t get_default; } __Request__task_policy_get_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t reply; /* end of the kernel processed data */ } __Request__task_sample_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; policy_t policy; mach_msg_type_number_t baseCnt; integer_t base[5]; boolean_t set_limit; boolean_t change; } __Request__task_policy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; vm_address_t routine_entry_pt; int routine_number; } __Request__task_set_emulation_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_get_emulation_vector_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_descriptor_t emulation_vector; /* end of the kernel processed data */ NDR_record_t NDR; int vector_start; mach_msg_type_number_t emulation_vectorCnt; } __Request__task_set_emulation_vector_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; vm_address_t basepc; vm_address_t boundspc; } __Request__task_set_ras_pc_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_zone_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t new_set; /* end of the kernel processed data */ NDR_record_t NDR; boolean_t assign_threads; } __Request__task_assign_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; boolean_t assign_threads; } __Request__task_assign_default_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_get_assignment_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t pset; /* end of the kernel processed data */ NDR_record_t NDR; policy_t policy; mach_msg_type_number_t baseCnt; integer_t base[5]; mach_msg_type_number_t limitCnt; integer_t limit[1]; boolean_t change; } __Request__task_set_policy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; thread_state_flavor_t flavor; mach_msg_type_number_t old_stateCnt; } __Request__task_get_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; thread_state_flavor_t flavor; mach_msg_type_number_t new_stateCnt; natural_t new_state[1296]; } __Request__task_set_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; int new_limit; } __Request__task_set_phys_footprint_limit_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_suspend2_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_resume2_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_purgable_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; mach_voucher_selector_t which; } __Request__task_get_mach_voucher_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t voucher; /* end of the kernel processed data */ } __Request__task_set_mach_voucher_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t new_voucher; mach_msg_port_descriptor_t old_voucher; /* end of the kernel processed data */ } __Request__task_swap_mach_voucher_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_generate_corpse_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t corspe_task; /* end of the kernel processed data */ } __Request__task_map_corpse_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_descriptor_t dyld_images; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t dyld_imagesCnt; } __Request__task_register_dyld_image_infos_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_descriptor_t dyld_images; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t dyld_imagesCnt; } __Request__task_unregister_dyld_image_infos_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_get_dyld_image_infos_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; dyld_kernel_image_info_t dyld_cache_image; boolean_t no_cache; boolean_t private_cache; } __Request__task_register_dyld_shared_cache_image_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; uint8_t dyld_state; char dyld_statePad[3]; } __Request__task_register_dyld_set_dyld_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_register_dyld_get_process_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t corspe_task; /* end of the kernel processed data */ } __Request__task_map_corpse_info_64_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_inspect_flavor_t flavor; mach_msg_type_number_t info_outCnt; } __Request__task_inspect_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_get_exc_guard_behavior_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_exc_guard_behavior_t behavior; } __Request__task_set_exc_guard_behavior_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; mach_msg_type_number_t pathOffset; /* MiG doesn't use it */ mach_msg_type_number_t pathCnt; char path[1024]; suid_cred_uid_t uid; } __Request__task_create_suid_cred_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__mach_task_is_self_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t notify; /* end of the kernel processed data */ } __Request__task_dyld_process_info_notify_register_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; } __Request__task_create_identity_token_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_flavor_t flavor; } __Request__task_identity_token_get_task_port_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; mach_port_name_t notify; } __Request__task_dyld_process_info_notify_deregister_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; exception_mask_t exception_mask; } __Request__task_get_exception_ports_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t port; /* end of the kernel processed data */ } __Request__task_test_sync_upcall_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; task_corpse_forking_behavior_t behavior; } __Request__task_set_corpse_forking_behavior_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Request__task_subsystem__defined */ /* union of all requests */ #ifndef __RequestUnion__task_subsystem__defined #define __RequestUnion__task_subsystem__defined union __RequestUnion__task_subsystem { __Request__task_create_t Request_task_create; __Request__task_terminate_t Request_task_terminate; __Request__task_threads_t Request_task_threads; __Request__mach_ports_register_t Request_mach_ports_register; __Request__mach_ports_lookup_t Request_mach_ports_lookup; __Request__task_info_t Request_task_info; __Request__task_set_info_t Request_task_set_info; __Request__task_suspend_t Request_task_suspend; __Request__task_resume_t Request_task_resume; __Request__task_get_special_port_t Request_task_get_special_port; __Request__task_set_special_port_t Request_task_set_special_port; __Request__thread_create_t Request_thread_create; __Request__thread_create_running_t Request_thread_create_running; __Request__task_set_exception_ports_t Request_task_set_exception_ports; __Request__task_get_exception_ports_t Request_task_get_exception_ports; __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; __Request__lock_set_create_t Request_lock_set_create; __Request__lock_set_destroy_t Request_lock_set_destroy; __Request__semaphore_create_t Request_semaphore_create; __Request__semaphore_destroy_t Request_semaphore_destroy; __Request__task_policy_set_t Request_task_policy_set; __Request__task_policy_get_t Request_task_policy_get; __Request__task_sample_t Request_task_sample; __Request__task_policy_t Request_task_policy; __Request__task_set_emulation_t Request_task_set_emulation; __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; __Request__task_set_ras_pc_t Request_task_set_ras_pc; __Request__task_zone_info_t Request_task_zone_info; __Request__task_assign_t Request_task_assign; __Request__task_assign_default_t Request_task_assign_default; __Request__task_get_assignment_t Request_task_get_assignment; __Request__task_set_policy_t Request_task_set_policy; __Request__task_get_state_t Request_task_get_state; __Request__task_set_state_t Request_task_set_state; __Request__task_set_phys_footprint_limit_t Request_task_set_phys_footprint_limit; __Request__task_suspend2_t Request_task_suspend2; __Request__task_resume2_t Request_task_resume2; __Request__task_purgable_info_t Request_task_purgable_info; __Request__task_get_mach_voucher_t Request_task_get_mach_voucher; __Request__task_set_mach_voucher_t Request_task_set_mach_voucher; __Request__task_swap_mach_voucher_t Request_task_swap_mach_voucher; __Request__task_generate_corpse_t Request_task_generate_corpse; __Request__task_map_corpse_info_t Request_task_map_corpse_info; __Request__task_register_dyld_image_infos_t Request_task_register_dyld_image_infos; __Request__task_unregister_dyld_image_infos_t Request_task_unregister_dyld_image_infos; __Request__task_get_dyld_image_infos_t Request_task_get_dyld_image_infos; __Request__task_register_dyld_shared_cache_image_info_t Request_task_register_dyld_shared_cache_image_info; __Request__task_register_dyld_set_dyld_state_t Request_task_register_dyld_set_dyld_state; __Request__task_register_dyld_get_process_state_t Request_task_register_dyld_get_process_state; __Request__task_map_corpse_info_64_t Request_task_map_corpse_info_64; __Request__task_inspect_t Request_task_inspect; __Request__task_get_exc_guard_behavior_t Request_task_get_exc_guard_behavior; __Request__task_set_exc_guard_behavior_t Request_task_set_exc_guard_behavior; __Request__task_create_suid_cred_t Request_task_create_suid_cred; __Request__mach_task_is_self_t Request_mach_task_is_self; __Request__task_dyld_process_info_notify_register_t Request_task_dyld_process_info_notify_register; __Request__task_create_identity_token_t Request_task_create_identity_token; __Request__task_identity_token_get_task_port_t Request_task_identity_token_get_task_port; __Request__task_dyld_process_info_notify_deregister_t Request_task_dyld_process_info_notify_deregister; __Request__task_get_exception_ports_info_t Request_task_get_exception_ports_info; __Request__task_test_sync_upcall_t Request_task_test_sync_upcall; __Request__task_set_corpse_forking_behavior_t Request_task_set_corpse_forking_behavior; }; #endif /* !__RequestUnion__task_subsystem__defined */ /* typedefs for all replies */ #ifndef __Reply__task_subsystem__defined #define __Reply__task_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t child_task; /* end of the kernel processed data */ } __Reply__task_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_terminate_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t act_list; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t act_listCnt; } __Reply__task_threads_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__mach_ports_register_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_ports_descriptor_t init_port_set; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t init_port_setCnt; } __Reply__mach_ports_lookup_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t task_info_outCnt; integer_t task_info_out[87]; } __Reply__task_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_suspend_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_resume_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t special_port; /* end of the kernel processed data */ } __Reply__task_get_special_port_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_special_port_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t child_act; /* end of the kernel processed data */ } __Reply__thread_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t child_act; /* end of the kernel processed data */ } __Reply__thread_create_running_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_exception_ports_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t old_handlers[32]; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t masksCnt; exception_mask_t masks[32]; exception_behavior_t old_behaviors[32]; thread_state_flavor_t old_flavors[32]; } __Reply__task_get_exception_ports_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t old_handlers[32]; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t masksCnt; exception_mask_t masks[32]; exception_behavior_t old_behaviors[32]; thread_state_flavor_t old_flavors[32]; } __Reply__task_swap_exception_ports_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t new_lock_set; /* end of the kernel processed data */ } __Reply__lock_set_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__lock_set_destroy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t semaphore; /* end of the kernel processed data */ } __Reply__semaphore_create_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__semaphore_destroy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_policy_set_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t policy_infoCnt; integer_t policy_info[16]; boolean_t get_default; } __Reply__task_policy_get_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_sample_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_policy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_emulation_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_descriptor_t emulation_vector; /* end of the kernel processed data */ NDR_record_t NDR; int vector_start; mach_msg_type_number_t emulation_vectorCnt; } __Reply__task_get_emulation_vector_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_emulation_vector_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_ras_pc_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_descriptor_t names; mach_msg_ool_descriptor_t info; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t namesCnt; mach_msg_type_number_t infoCnt; } __Reply__task_zone_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_assign_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_assign_default_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t assigned_set; /* end of the kernel processed data */ } __Reply__task_get_assignment_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_policy_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t old_stateCnt; natural_t old_state[1296]; } __Reply__task_get_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; int old_limit; } __Reply__task_set_phys_footprint_limit_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t suspend_token; /* end of the kernel processed data */ } __Reply__task_suspend2_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_resume2_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; task_purgable_info_t stats; } __Reply__task_purgable_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t voucher; /* end of the kernel processed data */ } __Reply__task_get_mach_voucher_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_mach_voucher_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t old_voucher; /* end of the kernel processed data */ } __Reply__task_swap_mach_voucher_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t corpse_task_port; /* end of the kernel processed data */ } __Reply__task_generate_corpse_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; vm_address_t kcd_addr_begin; uint32_t kcd_size; } __Reply__task_map_corpse_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_register_dyld_image_infos_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_unregister_dyld_image_infos_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_ool_descriptor_t dyld_images; /* end of the kernel processed data */ NDR_record_t NDR; mach_msg_type_number_t dyld_imagesCnt; } __Reply__task_get_dyld_image_infos_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_register_dyld_shared_cache_image_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_register_dyld_set_dyld_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; dyld_kernel_process_info_t dyld_process_state; } __Reply__task_register_dyld_get_process_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_vm_address_t kcd_addr_begin; mach_vm_size_t kcd_size; } __Reply__task_map_corpse_info_64_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t info_outCnt; integer_t info_out[4]; } __Reply__task_inspect_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; task_exc_guard_behavior_t behavior; } __Reply__task_get_exc_guard_behavior_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_exc_guard_behavior_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t delegation; /* end of the kernel processed data */ } __Reply__task_create_suid_cred_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; boolean_t is_self; } __Reply__mach_task_is_self_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_dyld_process_info_notify_register_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t token; /* end of the kernel processed data */ } __Reply__task_create_identity_token_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; /* start of the kernel processed data */ mach_msg_body_t msgh_body; mach_msg_port_descriptor_t task_port; /* end of the kernel processed data */ } __Reply__task_identity_token_get_task_port_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_dyld_process_info_notify_deregister_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t masksCnt; exception_mask_t masks[32]; exception_handler_info_t old_handlers_info[32]; exception_behavior_t old_behaviors[32]; thread_state_flavor_t old_flavors[32]; } __Reply__task_get_exception_ports_info_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_test_sync_upcall_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__task_set_corpse_forking_behavior_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Reply__task_subsystem__defined */ /* union of all replies */ #ifndef __ReplyUnion__task_subsystem__defined #define __ReplyUnion__task_subsystem__defined union __ReplyUnion__task_subsystem { __Reply__task_create_t Reply_task_create; __Reply__task_terminate_t Reply_task_terminate; __Reply__task_threads_t Reply_task_threads; __Reply__mach_ports_register_t Reply_mach_ports_register; __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; __Reply__task_info_t Reply_task_info; __Reply__task_set_info_t Reply_task_set_info; __Reply__task_suspend_t Reply_task_suspend; __Reply__task_resume_t Reply_task_resume; __Reply__task_get_special_port_t Reply_task_get_special_port; __Reply__task_set_special_port_t Reply_task_set_special_port; __Reply__thread_create_t Reply_thread_create; __Reply__thread_create_running_t Reply_thread_create_running; __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; __Reply__lock_set_create_t Reply_lock_set_create; __Reply__lock_set_destroy_t Reply_lock_set_destroy; __Reply__semaphore_create_t Reply_semaphore_create; __Reply__semaphore_destroy_t Reply_semaphore_destroy; __Reply__task_policy_set_t Reply_task_policy_set; __Reply__task_policy_get_t Reply_task_policy_get; __Reply__task_sample_t Reply_task_sample; __Reply__task_policy_t Reply_task_policy; __Reply__task_set_emulation_t Reply_task_set_emulation; __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; __Reply__task_zone_info_t Reply_task_zone_info; __Reply__task_assign_t Reply_task_assign; __Reply__task_assign_default_t Reply_task_assign_default; __Reply__task_get_assignment_t Reply_task_get_assignment; __Reply__task_set_policy_t Reply_task_set_policy; __Reply__task_get_state_t Reply_task_get_state; __Reply__task_set_state_t Reply_task_set_state; __Reply__task_set_phys_footprint_limit_t Reply_task_set_phys_footprint_limit; __Reply__task_suspend2_t Reply_task_suspend2; __Reply__task_resume2_t Reply_task_resume2; __Reply__task_purgable_info_t Reply_task_purgable_info; __Reply__task_get_mach_voucher_t Reply_task_get_mach_voucher; __Reply__task_set_mach_voucher_t Reply_task_set_mach_voucher; __Reply__task_swap_mach_voucher_t Reply_task_swap_mach_voucher; __Reply__task_generate_corpse_t Reply_task_generate_corpse; __Reply__task_map_corpse_info_t Reply_task_map_corpse_info; __Reply__task_register_dyld_image_infos_t Reply_task_register_dyld_image_infos; __Reply__task_unregister_dyld_image_infos_t Reply_task_unregister_dyld_image_infos; __Reply__task_get_dyld_image_infos_t Reply_task_get_dyld_image_infos; __Reply__task_register_dyld_shared_cache_image_info_t Reply_task_register_dyld_shared_cache_image_info; __Reply__task_register_dyld_set_dyld_state_t Reply_task_register_dyld_set_dyld_state; __Reply__task_register_dyld_get_process_state_t Reply_task_register_dyld_get_process_state; __Reply__task_map_corpse_info_64_t Reply_task_map_corpse_info_64; __Reply__task_inspect_t Reply_task_inspect; __Reply__task_get_exc_guard_behavior_t Reply_task_get_exc_guard_behavior; __Reply__task_set_exc_guard_behavior_t Reply_task_set_exc_guard_behavior; __Reply__task_create_suid_cred_t Reply_task_create_suid_cred; __Reply__mach_task_is_self_t Reply_mach_task_is_self; __Reply__task_dyld_process_info_notify_register_t Reply_task_dyld_process_info_notify_register; __Reply__task_create_identity_token_t Reply_task_create_identity_token; __Reply__task_identity_token_get_task_port_t Reply_task_identity_token_get_task_port; __Reply__task_dyld_process_info_notify_deregister_t Reply_task_dyld_process_info_notify_deregister; __Reply__task_get_exception_ports_info_t Reply_task_get_exception_ports_info; __Reply__task_test_sync_upcall_t Reply_task_test_sync_upcall; __Reply__task_set_corpse_forking_behavior_t Reply_task_set_corpse_forking_behavior; }; #endif /* !__RequestUnion__task_subsystem__defined */ #ifndef subsystem_to_name_map_task #define subsystem_to_name_map_task \ { "task_create", 3400 },\ { "task_terminate", 3401 },\ { "task_threads", 3402 },\ { "mach_ports_register", 3403 },\ { "mach_ports_lookup", 3404 },\ { "task_info", 3405 },\ { "task_set_info", 3406 },\ { "task_suspend", 3407 },\ { "task_resume", 3408 },\ { "task_get_special_port", 3409 },\ { "task_set_special_port", 3410 },\ { "thread_create", 3411 },\ { "thread_create_running", 3412 },\ { "task_set_exception_ports", 3413 },\ { "task_get_exception_ports", 3414 },\ { "task_swap_exception_ports", 3415 },\ { "lock_set_create", 3416 },\ { "lock_set_destroy", 3417 },\ { "semaphore_create", 3418 },\ { "semaphore_destroy", 3419 },\ { "task_policy_set", 3420 },\ { "task_policy_get", 3421 },\ { "task_sample", 3422 },\ { "task_policy", 3423 },\ { "task_set_emulation", 3424 },\ { "task_get_emulation_vector", 3425 },\ { "task_set_emulation_vector", 3426 },\ { "task_set_ras_pc", 3427 },\ { "task_zone_info", 3428 },\ { "task_assign", 3429 },\ { "task_assign_default", 3430 },\ { "task_get_assignment", 3431 },\ { "task_set_policy", 3432 },\ { "task_get_state", 3433 },\ { "task_set_state", 3434 },\ { "task_set_phys_footprint_limit", 3435 },\ { "task_suspend2", 3436 },\ { "task_resume2", 3437 },\ { "task_purgable_info", 3438 },\ { "task_get_mach_voucher", 3439 },\ { "task_set_mach_voucher", 3440 },\ { "task_swap_mach_voucher", 3441 },\ { "task_generate_corpse", 3442 },\ { "task_map_corpse_info", 3443 },\ { "task_register_dyld_image_infos", 3444 },\ { "task_unregister_dyld_image_infos", 3445 },\ { "task_get_dyld_image_infos", 3446 },\ { "task_register_dyld_shared_cache_image_info", 3447 },\ { "task_register_dyld_set_dyld_state", 3448 },\ { "task_register_dyld_get_process_state", 3449 },\ { "task_map_corpse_info_64", 3450 },\ { "task_inspect", 3451 },\ { "task_get_exc_guard_behavior", 3452 },\ { "task_set_exc_guard_behavior", 3453 },\ { "task_create_suid_cred", 3454 },\ { "mach_task_is_self", 3455 },\ { "task_dyld_process_info_notify_register", 3456 },\ { "task_create_identity_token", 3457 },\ { "task_identity_token_get_task_port", 3458 },\ { "task_dyld_process_info_notify_deregister", 3459 },\ { "task_get_exception_ports_info", 3460 },\ { "task_test_sync_upcall", 3461 },\ { "task_set_corpse_forking_behavior", 3462 } #endif #ifdef __AfterMigUserHeader __AfterMigUserHeader #endif /* __AfterMigUserHeader */ #endif /* _task_user_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/clock_priv.h
#ifndef _clock_priv_user_ #define _clock_priv_user_ /* Module clock_priv */ #include <string.h> #include <mach/ndr.h> #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/notify.h> #include <mach/mach_types.h> #include <mach/message.h> #include <mach/mig_errors.h> #include <mach/port.h> /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ #if defined(__has_include) #if __has_include(<mach/mig_strncpy_zerofill_support.h>) #ifndef USING_MIG_STRNCPY_ZEROFILL #define USING_MIG_STRNCPY_ZEROFILL #endif #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ #ifdef __cplusplus extern "C" { #endif extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); #ifdef __cplusplus } #endif #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ #endif /* __has_include */ /* END MIG_STRNCPY_ZEROFILL CODE */ #ifdef AUTOTEST #ifndef FUNCTION_PTR_T #define FUNCTION_PTR_T typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); typedef struct { char *name; function_ptr_t function; } function_table_entry; typedef function_table_entry *function_table_t; #endif /* FUNCTION_PTR_T */ #endif /* AUTOTEST */ #ifndef clock_priv_MSG_COUNT #define clock_priv_MSG_COUNT 2 #endif /* clock_priv_MSG_COUNT */ #include <Availability.h> #include <mach/std_types.h> #include <mach/mig.h> #include <mach/mig.h> #include <mach/mach_types.h> #include <mach/mach_types.h> #ifdef __BeforeMigUserHeader __BeforeMigUserHeader #endif /* __BeforeMigUserHeader */ #include <sys/cdefs.h> __BEGIN_DECLS /* Routine clock_set_time */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t clock_set_time ( clock_ctrl_t clock_ctrl, mach_timespec_t new_time ); /* Routine clock_set_attributes */ #ifdef mig_external mig_external #else extern #endif /* mig_external */ kern_return_t clock_set_attributes ( clock_ctrl_t clock_ctrl, clock_flavor_t flavor, clock_attr_t clock_attr, mach_msg_type_number_t clock_attrCnt ); __END_DECLS /********************** Caution **************************/ /* The following data types should be used to calculate */ /* maximum message sizes only. The actual message may be */ /* smaller, and the position of the arguments within the */ /* message layout may vary from what is presented here. */ /* For example, if any of the arguments are variable- */ /* sized, and less than the maximum is sent, the data */ /* will be packed tight in the actual message to reduce */ /* the presence of holes. */ /********************** Caution **************************/ /* typedefs for all requests */ #ifndef __Request__clock_priv_subsystem__defined #define __Request__clock_priv_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; mach_timespec_t new_time; } __Request__clock_set_time_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; clock_flavor_t flavor; mach_msg_type_number_t clock_attrCnt; int clock_attr[1]; } __Request__clock_set_attributes_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Request__clock_priv_subsystem__defined */ /* union of all requests */ #ifndef __RequestUnion__clock_priv_subsystem__defined #define __RequestUnion__clock_priv_subsystem__defined union __RequestUnion__clock_priv_subsystem { __Request__clock_set_time_t Request_clock_set_time; __Request__clock_set_attributes_t Request_clock_set_attributes; }; #endif /* !__RequestUnion__clock_priv_subsystem__defined */ /* typedefs for all replies */ #ifndef __Reply__clock_priv_subsystem__defined #define __Reply__clock_priv_subsystem__defined #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__clock_set_time_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #ifdef __MigPackStructs #pragma pack(push, 4) #endif typedef struct { mach_msg_header_t Head; NDR_record_t NDR; kern_return_t RetCode; } __Reply__clock_set_attributes_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) #endif #endif /* !__Reply__clock_priv_subsystem__defined */ /* union of all replies */ #ifndef __ReplyUnion__clock_priv_subsystem__defined #define __ReplyUnion__clock_priv_subsystem__defined union __ReplyUnion__clock_priv_subsystem { __Reply__clock_set_time_t Reply_clock_set_time; __Reply__clock_set_attributes_t Reply_clock_set_attributes; }; #endif /* !__RequestUnion__clock_priv_subsystem__defined */ #ifndef subsystem_to_name_map_clock_priv #define subsystem_to_name_map_clock_priv \ { "clock_set_time", 1200 },\ { "clock_set_attributes", 1201 } #endif #ifdef __AfterMigUserHeader __AfterMigUserHeader #endif /* __AfterMigUserHeader */ #endif /* _clock_priv_user_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/vm_behavior.h
/* * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * File: mach/vm_behavior.h * * Virtual memory map behavior definitions. * */ #ifndef _MACH_VM_BEHAVIOR_H_ #define _MACH_VM_BEHAVIOR_H_ /* * Types defined: * * vm_behavior_t behavior codes. */ typedef int vm_behavior_t; /* * Enumeration of valid values for vm_behavior_t. * These describe expected page reference behavior for * for a given range of virtual memory. For implementation * details see vm/vm_fault.c */ /* * The following behaviors affect the memory region's future behavior * and are stored in the VM map entry data structure. */ #define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0) /* default */ #define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1) /* random */ #define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2) /* forward sequential */ #define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3) /* reverse sequential */ /* * The following "behaviors" affect the memory region only at the time of the * call and are not stored in the VM map entry. */ #define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4) /* will need in near future */ #define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5) /* dont need in near future */ #define VM_BEHAVIOR_FREE ((vm_behavior_t) 6) /* free memory without write-back */ #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 */ #define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8) #define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9) #define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10) #define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11) #endif /*_MACH_VM_BEHAVIOR_H_*/
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/_structs.h
/* * Copyright (c) 2017 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE__STRUCTS_H_ #define _MACH_MACHINE__STRUCTS_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/_structs.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/_structs.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE__STRUCTS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/sdt_isa.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_SDT_ISA_H_ #define _MACH_MACHINE_SDT_ISA_H_ #if defined (__i386__) || defined(__x86_64__) #include <mach/i386/sdt_isa.h> #elif defined (__arm__) || defined (__arm64__) #include <mach/arm/sdt_isa.h> #else #error architecture not supported #endif #endif /* _BSD_MACHINE_SDT_ISA_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/thread_status.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_THREAD_STATUS_H_ #define _MACH_MACHINE_THREAD_STATUS_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/thread_status.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/thread_status.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_THREAD_STATUS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/sdt.h
/* * Copyright (c) 2007-2019 Apple Inc. All rights reserved. */ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _MACH_MACHINE_SYS_SDT_H #define _MACH_MACHINE_SYS_SDT_H #include <mach/machine/sdt_isa.h> #if CONFIG_DTRACE /* * The following macros are used to create static probes. The argument types * should be no greater than uintptr_t in size each. The behavior of larger * types is undefined. */ #define DTRACE_PROBE(provider, name) { \ DTRACE_CALL0ARGS(provider, name) \ } #define DTRACE_PROBE1(provider, name, arg0) { \ uintptr_t __dtrace_args[ARG1_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ DTRACE_CALL1ARG(provider, name) \ } #define DTRACE_PROBE2(provider, name, arg0, arg1) { \ uintptr_t __dtrace_args[ARGS2_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ DTRACE_CALL2ARGS(provider, name) \ } #define DTRACE_PROBE3(provider, name, arg0, arg1, arg2) { \ uintptr_t __dtrace_args[ARGS3_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ DTRACE_CALL3ARGS(provider, name) \ } #define DTRACE_PROBE4(provider, name, arg0, arg1, arg2, arg3) { \ uintptr_t __dtrace_args[ARGS4_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ DTRACE_CALL4ARGS(provider, name) \ } #define DTRACE_PROBE5(provider, name, arg0, arg1, arg2, arg3, arg4) { \ uintptr_t __dtrace_args[ARGS5_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ __dtrace_args[4] = (uintptr_t)(arg4); \ DTRACE_CALL5ARGS(provider, name) \ } #define DTRACE_PROBE6(provider, name, arg0, arg1, arg2, arg3, arg4, arg5) { \ uintptr_t __dtrace_args[ARGS6_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ __dtrace_args[4] = (uintptr_t)(arg4); \ __dtrace_args[5] = (uintptr_t)(arg5); \ DTRACE_CALL6ARGS(provider, name) \ } #define DTRACE_PROBE7(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6) { \ uintptr_t __dtrace_args[ARGS7_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ __dtrace_args[4] = (uintptr_t)(arg4); \ __dtrace_args[5] = (uintptr_t)(arg5); \ __dtrace_args[6] = (uintptr_t)(arg6); \ DTRACE_CALL7ARGS(provider, name) \ } #define DTRACE_PROBE8(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \ uintptr_t __dtrace_args[ARGS8_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ __dtrace_args[4] = (uintptr_t)(arg4); \ __dtrace_args[5] = (uintptr_t)(arg5); \ __dtrace_args[6] = (uintptr_t)(arg6); \ __dtrace_args[7] = (uintptr_t)(arg7); \ DTRACE_CALL8ARGS(provider, name) \ } #define DTRACE_PROBE9(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \ uintptr_t __dtrace_args[ARGS9_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ __dtrace_args[4] = (uintptr_t)(arg4); \ __dtrace_args[5] = (uintptr_t)(arg5); \ __dtrace_args[6] = (uintptr_t)(arg6); \ __dtrace_args[7] = (uintptr_t)(arg7); \ __dtrace_args[8] = (uintptr_t)(arg8); \ DTRACE_CALL9ARGS(provider, name) \ } #define DTRACE_PROBE10(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { \ uintptr_t __dtrace_args[ARGS10_EXTENT] __attribute__ ((aligned (16))); \ __dtrace_args[0] = (uintptr_t)(arg0); \ __dtrace_args[1] = (uintptr_t)(arg1); \ __dtrace_args[2] = (uintptr_t)(arg2); \ __dtrace_args[3] = (uintptr_t)(arg3); \ __dtrace_args[4] = (uintptr_t)(arg4); \ __dtrace_args[5] = (uintptr_t)(arg5); \ __dtrace_args[6] = (uintptr_t)(arg6); \ __dtrace_args[7] = (uintptr_t)(arg7); \ __dtrace_args[8] = (uintptr_t)(arg8); \ __dtrace_args[9] = (uintptr_t)(arg9); \ DTRACE_CALL10ARGS(provider, name) \ } #else #define DTRACE_PROBE(provider, name) do {} while(0) #define DTRACE_PROBE1(provider, name, arg0) do {} while(0) #define DTRACE_PROBE2(provider, name, arg0, arg1) do {} while(0) #define DTRACE_PROBE3(provider, name, arg0, arg1, arg2) do {} while(0) #define DTRACE_PROBE4(provider, name, arg0, arg1, arg2, arg3) do {} while(0) #define DTRACE_PROBE5(provider, name, arg0, arg1, arg2, arg3, arg4) do {} while(0) #define DTRACE_PROBE6(provider, name, arg0, arg1, arg2, arg3, arg4, arg5) do {} while(0) #define DTRACE_PROBE7(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6) do {} while(0) #define DTRACE_PROBE8(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) do {} while(0) #define DTRACE_PROBE9(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) do {} while(0) #define DTRACE_PROBE10(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) do {} while(0) #endif /* CONFIG_DTRACE */ #define DTRACE_SCHED(name) \ DTRACE_PROBE(__sched_, name); #define DTRACE_SCHED1(name, type1, arg1) \ DTRACE_PROBE1(__sched_, name, arg1); #define DTRACE_SCHED2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__sched_, name, arg1, arg2); #define DTRACE_SCHED3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__sched_, name, arg1, arg2, arg3); #define DTRACE_SCHED4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__sched_, name, arg1, arg2, arg3, arg4); #define DTRACE_SCHED5(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5) \ DTRACE_PROBE5(__sched_, name, arg1, arg2, arg3, arg4, arg5, arg6); #define DTRACE_SCHED6(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__sched_, name, arg1, arg2, arg3, arg4, arg5, arg6); #define DTRACE_PROC(name) \ DTRACE_PROBE(__proc_, name); #define DTRACE_PROC1(name, type1, arg1) \ DTRACE_PROBE1(__proc_, name, arg1); #define DTRACE_PROC2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__proc_, name, arg1, arg2); #define DTRACE_PROC3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__proc_, name, arg1, arg2, arg3); #define DTRACE_PROC4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__proc_, name, arg1, arg2, arg3, arg4); #define DTRACE_IO(name) \ DTRACE_PROBE(__io_, name); #define DTRACE_IO1(name, type1, arg1) \ DTRACE_PROBE1(__io_, name, arg1); #define DTRACE_IO2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__io_, name, arg1, arg2); #define DTRACE_IO3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__io_, name, arg1, arg2, arg3); #define DTRACE_IO4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__io_, name, arg1, arg2, arg3, arg4); #define DTRACE_INT5(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5) \ DTRACE_PROBE5(__sdt_, name, arg1, arg2, arg3, arg4, arg5); #define DTRACE_MEMORYSTATUS2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__sdt_, name, arg1, arg2); #define DTRACE_MEMORYSTATUS3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__sdt_, name, arg1, arg2, arg3); #define DTRACE_MEMORYSTATUS4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ DTRACE_PROBE4(__sdt_, name, arg1, arg2, arg3, arg4); #define DTRACE_MEMORYSTATUS6(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__vminfo_, name, arg1, arg2, arg3, arg4, arg5, arg6) #define DTRACE_TMR3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__sdt_, name, arg1, arg2, arg3); #define DTRACE_TMR4(name, type1, arg1, arg2, arg3, arg4) \ DTRACE_PROBE4(__sdt_, name, arg1, arg2, arg3, arg4); #define DTRACE_TMR5(name, type1, arg1, type2, arg2, type3, arg3, arg4, arg5) \ DTRACE_PROBE5(__sdt_, name, arg1, arg2, arg3, arg4, arg5); #define DTRACE_TMR6(name, type1, arg1, type2, arg2, type3, arg3, arg4, arg5, arg6) \ DTRACE_PROBE6(__sdt_, name, arg1, arg2, arg3, arg4, arg5, arg6); #define DTRACE_TMR7(name, type1, arg1, type2, arg2, type3, arg3, arg4, arg5, arg6, arg7) \ DTRACE_PROBE7(__sdt_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7); #define DTRACE_PHYSLAT3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__sdt_, name, arg1, arg2, arg3); #define DTRACE_PHYSLAT4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ DTRACE_PROBE4(__sdt_, name, arg1, arg2, arg3, arg4); #define DTRACE_PHYSLAT5(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \ DTRACE_PROBE5(__sdt_, name, arg1, arg2, arg3, arg4, arg5); #define DTRACE_VM(name) \ DTRACE_PROBE(__vminfo_, name) #define DTRACE_VM1(name, type1, arg1) \ DTRACE_PROBE1(__vminfo_, name, arg1) #define DTRACE_VM2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__vminfo_, name, arg1, arg2) #define DTRACE_VM3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__vminfo_, name, arg1, arg2, arg3) #define DTRACE_VM4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__vminfo_, name, arg1, arg2, arg3, arg4) #define DTRACE_VM5(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5) \ DTRACE_PROBE5(__vminfo_, name, arg1, arg2, arg3, arg4, arg5) #define DTRACE_VM6(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__vminfo_, name, arg1, arg2, arg3, arg4, arg5, arg6) #define DTRACE_VM7(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5, type6, arg6, type7, arg7) \ DTRACE_PROBE7(__vminfo_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define DTRACE_VM8(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5, type6, arg6, type7, arg7, type8, arg8) \ DTRACE_PROBE8(__vminfo_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define DTRACE_IP(name) \ DTRACE_PROBE(__ip_, name) #define DTRACE_IP1(name, type1, arg1) \ DTRACE_PROBE1(__ip_, name, arg1) #define DTRACE_IP2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__ip_, name, arg1, arg2) #define DTRACE_IP3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__ip_, name, arg1, arg2, arg3) #define DTRACE_IP4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__ip_, name, arg1, arg2, arg3, arg4) #define DTRACE_IP5(name, typ1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5) \ DTRACE_PROBE5(__ip_, name, arg1, arg2, arg3, arg4, arg5) #define DTRACE_IP6(name, type1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__ip_, name, arg1, arg2, arg3, arg4, arg5, arg6) #define DTRACE_IP7(name, type1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5, type6, arg6, type7, arg7) \ DTRACE_PROBE7(__ip_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define DTRACE_ROUTE(name) \ DTRACE_PROBE(__route_, name) #define DTRACE_ROUTE1(name, type1, arg1) \ DTRACE_PROBE1(__route_, name, arg1) #define DTRACE_ROUTE2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__route_, name, arg1, arg2) #define DTRACE_ROUTE3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__route_, name, arg1, arg2, arg3) #define DTRACE_ROUTE4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__route_, name, arg1, arg2, arg3, arg4) #define DTRACE_ROUTE5(name, typ1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5) \ DTRACE_PROBE5(__route_, name, arg1, arg2, arg3, arg4, arg5) #define DTRACE_ROUTE6(name, type1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__route_, name, arg1, arg2, arg3, arg4, arg5, arg6) #define DTRACE_ROUTE7(name, type1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5, type6, arg6, type7, arg7) \ DTRACE_PROBE7(__route_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define DTRACE_TCP(name) \ DTRACE_PROBE(__tcp_, name) #define DTRACE_TCP1(name, type1, arg1) \ DTRACE_PROBE1(__tcp_, name, arg1) #define DTRACE_TCP2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__tcp_, name, arg1, arg2) #define DTRACE_TCP3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__tcp_, name, arg1, arg2, arg3) #define DTRACE_TCP4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__tcp_, name, arg1, arg2, arg3, arg4) #define DTRACE_TCP5(name, typ1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5) \ DTRACE_PROBE5(__tcp_, name, arg1, arg2, arg3, arg4, arg5) #define DTRACE_MPTCP(name) \ DTRACE_PROBE(__mptcp_, name) #define DTRACE_MPTCP1(name, type1, arg1) \ DTRACE_PROBE1(__mptcp_, name, arg1) #define DTRACE_MPTCP2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__mptcp_, name, arg1, arg2) #define DTRACE_MPTCP3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__mptcp_, name, arg1, arg2, arg3) #define DTRACE_MPTCP4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__mptcp_, name, arg1, arg2, arg3, arg4) #define DTRACE_MPTCP5(name, typ1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5) \ DTRACE_PROBE5(__mptcp_, name, arg1, arg2, arg3, arg4, arg5) #define DTRACE_MPTCP6(name, typ1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__mptcp_, name, arg1, arg2, arg3, arg4, arg5, arg6) #define DTRACE_MPTCP7(name, typ1, arg1, type2, arg2, type3, arg3, \ type4, arg4, type5, arg5, type6, arg6, \ type7, arg7) \ DTRACE_PROBE7(__mptcp_, name, arg1, arg2, arg3, arg4, arg5, \ arg6, arg7) #define DTRACE_FSINFO(name, type, vp) \ DTRACE_PROBE1(__fsinfo_, name, vp) #define DTRACE_FSINFO_IO(name, type1, vp, type2, size) \ DTRACE_PROBE2(__fsinfo_, name, vp, size) #define DTRACE_BOOST(name) \ DTRACE_PROBE(__boost_, name); #define DTRACE_BOOST1(name, type1, arg1) \ DTRACE_PROBE1(__boost_, name, arg1); #define DTRACE_BOOST2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__boost_, name, arg1, arg2); #define DTRACE_BOOST3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__boost_, name, arg1, arg2, arg3); #define DTRACE_BOOST4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__boost_, name, arg1, arg2, arg3, arg4); #define DTRACE_BOOST5(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5) \ DTRACE_PROBE5(__boost_, name, arg1, arg2, arg3, arg4, arg5); #define DTRACE_BOOST6(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5, type6, arg6) \ DTRACE_PROBE6(__boost_, name, arg1, arg2, arg3, arg4, arg5, arg6); #if KASAN #define DTRACE_KASAN(name) \ DTRACE_PROBE(__kasan_, name); #define DTRACE_KASAN1(name, type1, arg1) \ DTRACE_PROBE1(__kasan_, name, arg1); #define DTRACE_KASAN2(name, type1, arg1, type2, arg2) \ DTRACE_PROBE2(__kasan_, name, arg1, arg2); #define DTRACE_KASAN3(name, type1, arg1, type2, arg2, type3, arg3) \ DTRACE_PROBE3(__kasan_, name, arg1, arg2, arg3); #define DTRACE_KASAN4(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4) \ DTRACE_PROBE4(__kasan_, name, arg1, arg2, arg3, arg4); #define DTRACE_KASAN5(name, type1, arg1, type2, arg2, \ type3, arg3, type4, arg4, type5, arg5) \ DTRACE_PROBE5(__kasan_, name, arg1, arg2, arg3, arg4, arg5); #endif /* KASAN */ #endif /* _MACH_MACHINE_SYS_SDT_H */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/vm_param.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_VM_PARAM_H_ #define _MACH_MACHINE_VM_PARAM_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/vm_param.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/vm_param.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_VM_PARAM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/rpc.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_RPC_H_ #define _MACH_MACHINE_RPC_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/rpc.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/rpc.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_RPC_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/thread_state.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_THREAD_STATE_H_ #define _MACH_MACHINE_THREAD_STATE_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/thread_state.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/thread_state.h" #else #error architecture not supported #endif /* Size of maximum exported thread state in 32-bit words */ #define THREAD_STATE_MAX 1296 #endif /* _MACH_MACHINE_THREAD_STATE_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/exception.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_EXCEPTION_H_ #define _MACH_MACHINE_EXCEPTION_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/exception.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/exception.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_EXCEPTION_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/kern_return.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_KERN_RETURN_H_ #define _MACH_MACHINE_KERN_RETURN_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/kern_return.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/kern_return.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_KERN_RETURN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/asm.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_ASM_H #define _MACH_MACHINE_ASM_H #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/asm.h" #elif defined (__arm__) #include "mach/arm/asm.h" #elif defined(__arm64__) #include "mach/arm64/asm.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_ASM_H */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/vm_types.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_VM_TYPES_H_ #define _MACH_MACHINE_VM_TYPES_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/vm_types.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/vm_types.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_VM_TYPES_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/boolean.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_BOOLEAN_H_ #define _MACH_MACHINE_BOOLEAN_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/boolean.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/boolean.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_BOOLEAN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/processor_info.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_PROCESSOR_INFO_H_ #define _MACH_MACHINE_PROCESSOR_INFO_H_ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/processor_info.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/processor_info.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_PROCESSOR_INFO_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/machine/ndr_def.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_MACHINE_NDR_DEF_H #define _MACH_MACHINE_NDR_DEF_H #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/ndr_def.h" #elif defined (__arm__) || defined (__arm64__) #include "mach/arm/ndr_def.h" #else #error architecture not supported #endif #endif /* _MACH_MACHINE_NDR_DEF_H */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm64/asm.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ #ifndef _ARM_ASM_H_ #define _ARM_ASM_H_ #ifdef __arm64__ #include <arm/arch.h> /* There is another definition of ALIGN for .c sources */ #ifdef __ASSEMBLER__ #define ALIGN 2 #endif /* ASSEMBLER */ #ifndef FALIGN #define FALIGN ALIGN #endif #define LB(x,n) n #if __STDC__ #ifndef __NO_UNDERSCORES__ #define LCL(x) L ## x #define EXT(x) _ ## x #define LEXT(x) _ ## x ## : #else #define LCL(x) .L ## x #define EXT(x) x #define LEXT(x) x ## : #endif #define LBc(x,n) n ## : #define LBb(x,n) n ## b #define LBf(x,n) n ## f #else /* __STDC__ */ #ifndef __NO_UNDERSCORES__ #define LCL(x) L/**/x #define EXT(x) _/**/x #define LEXT(x) _/**/x/**/: #else /* __NO_UNDERSCORES__ */ #define LCL(x) .L/**/x #define EXT(x) x #define LEXT(x) x/**/: #endif /* __NO_UNDERSCORES__ */ #define LBc(x,n) n/**/: #define LBb(x,n) n/**/b #define LBf(x,n) n/**/f #endif /* __STDC__ */ #define String .asciz #define Value .word #define Times(a,b) (a*b) #define Divide(a,b) (a/b) #ifdef __ASSEMBLER__ #if MACH_KDB #include <ddb/stab.h> /* * This pseudo-assembler line is added so that there will be at least * one N_SO entry in the symbol stable to define the current file name. */ #endif /* MACH_KDB */ /* * Multiline macros must use .macro syntax for now, * as there is no ARM64 statement separator. */ .macro ENTRY .align FALIGN .globl _$0 _$0 : .endmacro .macro ENTRY2 .align FALIGN .globl _$0 .globl _$1 _$0 : _$1 : .endmacro .macro READ_THREAD mrs $0, TPIDR_EL1 .endmacro .macro BRANCH_EXTERN b _$0 .endmacro .macro CALL_EXTERN bl _$0 .endmacro .macro MOV64 movk $0, #((($1) >> 48) & 0x000000000000FFFF), lsl #48 movk $0, #((($1) >> 32) & 0x000000000000FFFF), lsl #32 movk $0, #((($1) >> 16) & 0x000000000000FFFF), lsl #16 movk $0, #((($1) >> 00) & 0x000000000000FFFF), lsl #00 .endmacro .macro MOV32 movz $0, #((($1) >> 16) & 0x000000000000FFFF), lsl #16 movk $0, #((($1) >> 00) & 0x000000000000FFFF), lsl #00 .endmacro .macro ARM64_STACK_PROLOG #if __has_feature(ptrauth_returns) pacibsp #endif .endmacro .macro ARM64_STACK_EPILOG #if __has_feature(ptrauth_returns) retab #else ret #endif .endmacro #define PUSH_FRAME \ stp fp, lr, [sp, #-16]! %% \ mov fp, sp %% #define POP_FRAME \ mov sp, fp %% \ ldp fp, lr, [sp], #16 %% #define EXT(x) _ ## x #else /* NOT __ASSEMBLER__ */ /* These defines are here for .c files that wish to reference global symbols * within __asm__ statements. */ #ifndef __NO_UNDERSCORES__ #define CC_SYM_PREFIX "_" #else #define CC_SYM_PREFIX "" #endif /* __NO_UNDERSCORES__ */ #endif /* __ASSEMBLER__ */ #ifdef __ASSEMBLER__ # define BRANCH_EXTERN(x) b EXT(x) #endif /* __ASSEMBLER__ */ #endif /* __arm64__ */ #endif /* _ARM_ASM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/fp_reg.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1992-1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ #ifndef _I386_FP_SAVE_H_ #define _I386_FP_SAVE_H_ #if defined (__i386__) || defined (__x86_64__) /* * Control register */ #define FPC_IE 0x0001 /* enable invalid operation * exception */ #define FPC_IM FPC_IE #define FPC_DE 0x0002 /* enable denormalized operation * exception */ #define FPC_DM FPC_DE #define FPC_ZE 0x0004 /* enable zero-divide exception */ #define FPC_ZM FPC_ZE #define FPC_OE 0x0008 /* enable overflow exception */ #define FPC_OM FPC_OE #define FPC_UE 0x0010 /* enable underflow exception */ #define FPC_PE 0x0020 /* enable precision exception */ #define FPC_PC 0x0300 /* precision control: */ #define FPC_PC_24 0x0000 /* 24 bits */ #define FPC_PC_53 0x0200 /* 53 bits */ #define FPC_PC_64 0x0300 /* 64 bits */ #define FPC_RC 0x0c00 /* rounding control: */ #define FPC_RC_RN 0x0000 /* round to nearest or even */ #define FPC_RC_RD 0x0400 /* round down */ #define FPC_RC_RU 0x0800 /* round up */ #define FPC_RC_CHOP 0x0c00 /* chop */ #define FPC_IC 0x1000 /* infinity control (obsolete) */ #define FPC_IC_PROJ 0x0000 /* projective infinity */ #define FPC_IC_AFF 0x1000 /* affine infinity (std) */ /* * Status register */ #define FPS_IE 0x0001 /* invalid operation */ #define FPS_DE 0x0002 /* denormalized operand */ #define FPS_ZE 0x0004 /* divide by zero */ #define FPS_OE 0x0008 /* overflow */ #define FPS_UE 0x0010 /* underflow */ #define FPS_PE 0x0020 /* precision */ #define FPS_SF 0x0040 /* stack flag */ #define FPS_ES 0x0080 /* error summary */ #define FPS_C0 0x0100 /* condition code bit 0 */ #define FPS_C1 0x0200 /* condition code bit 1 */ #define FPS_C2 0x0400 /* condition code bit 2 */ #define FPS_TOS 0x3800 /* top-of-stack pointer */ #define FPS_TOS_SHIFT 11 #define FPS_C3 0x4000 /* condition code bit 3 */ #define FPS_BUSY 0x8000 /* FPU busy */ /* * Kind of floating-point support provided by kernel. */ #define FP_NO 0 /* no floating point */ #define FP_SOFT 1 /* software FP emulator */ #define FP_287 2 /* 80287 */ #define FP_387 3 /* 80387 or 80486 */ #define FP_FXSR 4 /* Fast save/restore SIMD Extension */ #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _I386_FP_SAVE_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/_structs.h
/* * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ #ifndef _MACH_I386__STRUCTS_H_ #define _MACH_I386__STRUCTS_H_ #if defined (__i386__) || defined (__x86_64__) #include <sys/cdefs.h> /* __DARWIN_UNIX03 */ #include <machine/types.h> /* __uint8_t */ /* * i386 is the structure that is exported to user threads for * use in status/mutate calls. This structure should never change. * */ #if __DARWIN_UNIX03 #define _STRUCT_X86_THREAD_STATE32 struct __darwin_i386_thread_state _STRUCT_X86_THREAD_STATE32 { unsigned int __eax; unsigned int __ebx; unsigned int __ecx; unsigned int __edx; unsigned int __edi; unsigned int __esi; unsigned int __ebp; unsigned int __esp; unsigned int __ss; unsigned int __eflags; unsigned int __eip; unsigned int __cs; unsigned int __ds; unsigned int __es; unsigned int __fs; unsigned int __gs; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_THREAD_STATE32 struct i386_thread_state _STRUCT_X86_THREAD_STATE32 { unsigned int eax; unsigned int ebx; unsigned int ecx; unsigned int edx; unsigned int edi; unsigned int esi; unsigned int ebp; unsigned int esp; unsigned int ss; unsigned int eflags; unsigned int eip; unsigned int cs; unsigned int ds; unsigned int es; unsigned int fs; unsigned int gs; }; #endif /* !__DARWIN_UNIX03 */ /* This structure should be double-word aligned for performance */ #if __DARWIN_UNIX03 #define _STRUCT_FP_CONTROL struct __darwin_fp_control _STRUCT_FP_CONTROL { unsigned short __invalid :1, __denorm :1, __zdiv :1, __ovrfl :1, __undfl :1, __precis :1, :2, __pc :2, #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define FP_PREC_24B 0 #define FP_PREC_53B 2 #define FP_PREC_64B 3 #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ __rc :2, #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define FP_RND_NEAR 0 #define FP_RND_DOWN 1 #define FP_RND_UP 2 #define FP_CHOP 3 #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ /*inf*/ :1, :3; }; typedef _STRUCT_FP_CONTROL __darwin_fp_control_t; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_FP_CONTROL struct fp_control _STRUCT_FP_CONTROL { unsigned short invalid :1, denorm :1, zdiv :1, ovrfl :1, undfl :1, precis :1, :2, pc :2, #define FP_PREC_24B 0 #define FP_PREC_53B 2 #define FP_PREC_64B 3 rc :2, #define FP_RND_NEAR 0 #define FP_RND_DOWN 1 #define FP_RND_UP 2 #define FP_CHOP 3 /*inf*/ :1, :3; }; typedef _STRUCT_FP_CONTROL fp_control_t; #endif /* !__DARWIN_UNIX03 */ /* * Status word. */ #if __DARWIN_UNIX03 #define _STRUCT_FP_STATUS struct __darwin_fp_status _STRUCT_FP_STATUS { unsigned short __invalid :1, __denorm :1, __zdiv :1, __ovrfl :1, __undfl :1, __precis :1, __stkflt :1, __errsumm :1, __c0 :1, __c1 :1, __c2 :1, __tos :3, __c3 :1, __busy :1; }; typedef _STRUCT_FP_STATUS __darwin_fp_status_t; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_FP_STATUS struct fp_status _STRUCT_FP_STATUS { unsigned short invalid :1, denorm :1, zdiv :1, ovrfl :1, undfl :1, precis :1, stkflt :1, errsumm :1, c0 :1, c1 :1, c2 :1, tos :3, c3 :1, busy :1; }; typedef _STRUCT_FP_STATUS fp_status_t; #endif /* !__DARWIN_UNIX03 */ /* defn of 80bit x87 FPU or MMX register */ #if __DARWIN_UNIX03 #define _STRUCT_MMST_REG struct __darwin_mmst_reg _STRUCT_MMST_REG { char __mmst_reg[10]; char __mmst_rsrv[6]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_MMST_REG struct mmst_reg _STRUCT_MMST_REG { char mmst_reg[10]; char mmst_rsrv[6]; }; #endif /* !__DARWIN_UNIX03 */ /* defn of 128 bit XMM regs */ #if __DARWIN_UNIX03 #define _STRUCT_XMM_REG struct __darwin_xmm_reg _STRUCT_XMM_REG { char __xmm_reg[16]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_XMM_REG struct xmm_reg _STRUCT_XMM_REG { char xmm_reg[16]; }; #endif /* !__DARWIN_UNIX03 */ /* defn of 256 bit YMM regs */ #if __DARWIN_UNIX03 #define _STRUCT_YMM_REG struct __darwin_ymm_reg _STRUCT_YMM_REG { char __ymm_reg[32]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_YMM_REG struct ymm_reg _STRUCT_YMM_REG { char ymm_reg[32]; }; #endif /* !__DARWIN_UNIX03 */ /* defn of 512 bit ZMM regs */ #if __DARWIN_UNIX03 #define _STRUCT_ZMM_REG struct __darwin_zmm_reg _STRUCT_ZMM_REG { char __zmm_reg[64]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ZMM_REG struct zmm_reg _STRUCT_ZMM_REG { char zmm_reg[64]; }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_OPMASK_REG struct __darwin_opmask_reg _STRUCT_OPMASK_REG { char __opmask_reg[8]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_OPMASK_REG struct opmask_reg _STRUCT_OPMASK_REG { char opmask_reg[8]; }; #endif /* !__DARWIN_UNIX03 */ /* * Floating point state. */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define FP_STATE_BYTES 512 /* number of chars worth of data from fpu_fcw */ #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ #if __DARWIN_UNIX03 #define _STRUCT_X86_FLOAT_STATE32 struct __darwin_i386_float_state _STRUCT_X86_FLOAT_STATE32 { int __fpu_reserved[2]; _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ __uint8_t __fpu_ftw; /* x87 FPU tag word */ __uint8_t __fpu_rsrv1; /* reserved */ __uint16_t __fpu_fop; /* x87 FPU Opcode */ __uint32_t __fpu_ip; /* x87 FPU Instruction Pointer offset */ __uint16_t __fpu_cs; /* x87 FPU Instruction Pointer Selector */ __uint16_t __fpu_rsrv2; /* reserved */ __uint32_t __fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ __uint16_t __fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ __uint16_t __fpu_rsrv3; /* reserved */ __uint32_t __fpu_mxcsr; /* MXCSR Register state */ __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ char __fpu_rsrv4[14*16]; /* reserved */ int __fpu_reserved1; }; #define _STRUCT_X86_AVX_STATE32 struct __darwin_i386_avx_state _STRUCT_X86_AVX_STATE32 { int __fpu_reserved[2]; _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ __uint8_t __fpu_ftw; /* x87 FPU tag word */ __uint8_t __fpu_rsrv1; /* reserved */ __uint16_t __fpu_fop; /* x87 FPU Opcode */ __uint32_t __fpu_ip; /* x87 FPU Instruction Pointer offset */ __uint16_t __fpu_cs; /* x87 FPU Instruction Pointer Selector */ __uint16_t __fpu_rsrv2; /* reserved */ __uint32_t __fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ __uint16_t __fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ __uint16_t __fpu_rsrv3; /* reserved */ __uint32_t __fpu_mxcsr; /* MXCSR Register state */ __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ char __fpu_rsrv4[14*16]; /* reserved */ int __fpu_reserved1; char __avx_reserved1[64]; _STRUCT_XMM_REG __fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG __fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG __fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG __fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG __fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG __fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG __fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG __fpu_ymmh7; /* YMMH 7 */ }; #define _STRUCT_X86_AVX512_STATE32 struct __darwin_i386_avx512_state _STRUCT_X86_AVX512_STATE32 { int __fpu_reserved[2]; _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ __uint8_t __fpu_ftw; /* x87 FPU tag word */ __uint8_t __fpu_rsrv1; /* reserved */ __uint16_t __fpu_fop; /* x87 FPU Opcode */ __uint32_t __fpu_ip; /* x87 FPU Instruction Pointer offset */ __uint16_t __fpu_cs; /* x87 FPU Instruction Pointer Selector */ __uint16_t __fpu_rsrv2; /* reserved */ __uint32_t __fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ __uint16_t __fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ __uint16_t __fpu_rsrv3; /* reserved */ __uint32_t __fpu_mxcsr; /* MXCSR Register state */ __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ char __fpu_rsrv4[14*16]; /* reserved */ int __fpu_reserved1; char __avx_reserved1[64]; _STRUCT_XMM_REG __fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG __fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG __fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG __fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG __fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG __fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG __fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG __fpu_ymmh7; /* YMMH 7 */ _STRUCT_OPMASK_REG __fpu_k0; /* K0 */ _STRUCT_OPMASK_REG __fpu_k1; /* K1 */ _STRUCT_OPMASK_REG __fpu_k2; /* K2 */ _STRUCT_OPMASK_REG __fpu_k3; /* K3 */ _STRUCT_OPMASK_REG __fpu_k4; /* K4 */ _STRUCT_OPMASK_REG __fpu_k5; /* K5 */ _STRUCT_OPMASK_REG __fpu_k6; /* K6 */ _STRUCT_OPMASK_REG __fpu_k7; /* K7 */ _STRUCT_YMM_REG __fpu_zmmh0; /* ZMMH 0 */ _STRUCT_YMM_REG __fpu_zmmh1; /* ZMMH 1 */ _STRUCT_YMM_REG __fpu_zmmh2; /* ZMMH 2 */ _STRUCT_YMM_REG __fpu_zmmh3; /* ZMMH 3 */ _STRUCT_YMM_REG __fpu_zmmh4; /* ZMMH 4 */ _STRUCT_YMM_REG __fpu_zmmh5; /* ZMMH 5 */ _STRUCT_YMM_REG __fpu_zmmh6; /* ZMMH 6 */ _STRUCT_YMM_REG __fpu_zmmh7; /* ZMMH 7 */ }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_FLOAT_STATE32 struct i386_float_state _STRUCT_X86_FLOAT_STATE32 { int fpu_reserved[2]; _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ __uint8_t fpu_ftw; /* x87 FPU tag word */ __uint8_t fpu_rsrv1; /* reserved */ __uint16_t fpu_fop; /* x87 FPU Opcode */ __uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ __uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ __uint16_t fpu_rsrv2; /* reserved */ __uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ __uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ __uint16_t fpu_rsrv3; /* reserved */ __uint32_t fpu_mxcsr; /* MXCSR Register state */ __uint32_t fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ char fpu_rsrv4[14*16]; /* reserved */ int fpu_reserved1; }; #define _STRUCT_X86_AVX_STATE32 struct i386_avx_state _STRUCT_X86_AVX_STATE32 { int fpu_reserved[2]; _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ __uint8_t fpu_ftw; /* x87 FPU tag word */ __uint8_t fpu_rsrv1; /* reserved */ __uint16_t fpu_fop; /* x87 FPU Opcode */ __uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ __uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ __uint16_t fpu_rsrv2; /* reserved */ __uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ __uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ __uint16_t fpu_rsrv3; /* reserved */ __uint32_t fpu_mxcsr; /* MXCSR Register state */ __uint32_t fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ char fpu_rsrv4[14*16]; /* reserved */ int fpu_reserved1; char avx_reserved1[64]; _STRUCT_XMM_REG fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG fpu_ymmh7; /* YMMH 7 */ }; #define _STRUCT_X86_AVX512_STATE32 struct i386_avx512_state _STRUCT_X86_AVX512_STATE32 { int fpu_reserved[2]; _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ __uint8_t fpu_ftw; /* x87 FPU tag word */ __uint8_t fpu_rsrv1; /* reserved */ __uint16_t fpu_fop; /* x87 FPU Opcode */ __uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ __uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ __uint16_t fpu_rsrv2; /* reserved */ __uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ __uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ __uint16_t fpu_rsrv3; /* reserved */ __uint32_t fpu_mxcsr; /* MXCSR Register state */ __uint32_t fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ char fpu_rsrv4[14*16]; /* reserved */ int fpu_reserved1; char avx_reserved1[64]; _STRUCT_XMM_REG fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG fpu_ymmh7; /* YMMH 7 */ _STRUCT_OPMASK_REG fpu_k0; /* K0 */ _STRUCT_OPMASK_REG fpu_k1; /* K1 */ _STRUCT_OPMASK_REG fpu_k2; /* K2 */ _STRUCT_OPMASK_REG fpu_k3; /* K3 */ _STRUCT_OPMASK_REG fpu_k4; /* K4 */ _STRUCT_OPMASK_REG fpu_k5; /* K5 */ _STRUCT_OPMASK_REG fpu_k6; /* K6 */ _STRUCT_OPMASK_REG fpu_k7; /* K7 */ _STRUCT_YMM_REG fpu_zmmh0; /* ZMMH 0 */ _STRUCT_YMM_REG fpu_zmmh1; /* ZMMH 1 */ _STRUCT_YMM_REG fpu_zmmh2; /* ZMMH 2 */ _STRUCT_YMM_REG fpu_zmmh3; /* ZMMH 3 */ _STRUCT_YMM_REG fpu_zmmh4; /* ZMMH 4 */ _STRUCT_YMM_REG fpu_zmmh5; /* ZMMH 5 */ _STRUCT_YMM_REG fpu_zmmh6; /* ZMMH 6 */ _STRUCT_YMM_REG fpu_zmmh7; /* ZMMH 7 */ }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_X86_EXCEPTION_STATE32 struct __darwin_i386_exception_state _STRUCT_X86_EXCEPTION_STATE32 { __uint16_t __trapno; __uint16_t __cpu; __uint32_t __err; __uint32_t __faultvaddr; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_EXCEPTION_STATE32 struct i386_exception_state _STRUCT_X86_EXCEPTION_STATE32 { __uint16_t trapno; __uint16_t cpu; __uint32_t err; __uint32_t faultvaddr; }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_X86_DEBUG_STATE32 struct __darwin_x86_debug_state32 _STRUCT_X86_DEBUG_STATE32 { unsigned int __dr0; unsigned int __dr1; unsigned int __dr2; unsigned int __dr3; unsigned int __dr4; unsigned int __dr5; unsigned int __dr6; unsigned int __dr7; }; #define _STRUCT_X86_INSTRUCTION_STATE struct __x86_instruction_state _STRUCT_X86_INSTRUCTION_STATE { int __insn_stream_valid_bytes; int __insn_offset; int __out_of_synch; /* * non-zero when the cacheline that includes the insn_offset * is replaced in the insn_bytes array due to a mismatch * detected when comparing it with the same cacheline in memory */ #define _X86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4) __uint8_t __insn_bytes[_X86_INSTRUCTION_STATE_MAX_INSN_BYTES]; #define _X86_INSTRUCTION_STATE_CACHELINE_SIZE 64 __uint8_t __insn_cacheline[_X86_INSTRUCTION_STATE_CACHELINE_SIZE]; }; #define _STRUCT_LAST_BRANCH_RECORD struct __last_branch_record _STRUCT_LAST_BRANCH_RECORD { __uint64_t __from_ip; __uint64_t __to_ip; __uint32_t __mispredict : 1, __tsx_abort : 1, __in_tsx : 1, __cycle_count: 16, __reserved : 13; }; #define _STRUCT_LAST_BRANCH_STATE struct __last_branch_state _STRUCT_LAST_BRANCH_STATE { int __lbr_count; __uint32_t __lbr_supported_tsx : 1, __lbr_supported_cycle_count : 1, __reserved : 30; #define __LASTBRANCH_MAX 32 _STRUCT_LAST_BRANCH_RECORD __lbrs[__LASTBRANCH_MAX]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_DEBUG_STATE32 struct x86_debug_state32 _STRUCT_X86_DEBUG_STATE32 { unsigned int dr0; unsigned int dr1; unsigned int dr2; unsigned int dr3; unsigned int dr4; unsigned int dr5; unsigned int dr6; unsigned int dr7; }; #define _STRUCT_X86_INSTRUCTION_STATE struct __x86_instruction_state _STRUCT_X86_INSTRUCTION_STATE { int insn_stream_valid_bytes; int insn_offset; int out_of_synch; /* * non-zero when the cacheline that includes the insn_offset * is replaced in the insn_bytes array due to a mismatch * detected when comparing it with the same cacheline in memory */ #define x86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4) __uint8_t insn_bytes[x86_INSTRUCTION_STATE_MAX_INSN_BYTES]; #define x86_INSTRUCTION_STATE_CACHELINE_SIZE 64 __uint8_t insn_cacheline[x86_INSTRUCTION_STATE_CACHELINE_SIZE]; }; #define _STRUCT_LAST_BRANCH_RECORD struct __last_branch_record _STRUCT_LAST_BRANCH_RECORD { __uint64_t from_ip; __uint64_t to_ip; __uint32_t mispredict : 1, tsx_abort : 1, in_tsx : 1, cycle_count: 16, reserved : 13; }; #define _STRUCT_LAST_BRANCH_STATE struct __last_branch_state _STRUCT_LAST_BRANCH_STATE { int lbr_count; __uint32_t lbr_supported_tsx : 1, lbr_supported_cycle_count : 1, reserved : 30; #define __LASTBRANCH_MAX 32 _STRUCT_LAST_BRANCH_RECORD lbrs[__LASTBRANCH_MAX]; }; #endif /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_PAGEIN_STATE struct __x86_pagein_state _STRUCT_X86_PAGEIN_STATE { int __pagein_error; }; /* * 64 bit versions of the above */ #if __DARWIN_UNIX03 #define _STRUCT_X86_THREAD_STATE64 struct __darwin_x86_thread_state64 _STRUCT_X86_THREAD_STATE64 { __uint64_t __rax; __uint64_t __rbx; __uint64_t __rcx; __uint64_t __rdx; __uint64_t __rdi; __uint64_t __rsi; __uint64_t __rbp; __uint64_t __rsp; __uint64_t __r8; __uint64_t __r9; __uint64_t __r10; __uint64_t __r11; __uint64_t __r12; __uint64_t __r13; __uint64_t __r14; __uint64_t __r15; __uint64_t __rip; __uint64_t __rflags; __uint64_t __cs; __uint64_t __fs; __uint64_t __gs; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_THREAD_STATE64 struct x86_thread_state64 _STRUCT_X86_THREAD_STATE64 { __uint64_t rax; __uint64_t rbx; __uint64_t rcx; __uint64_t rdx; __uint64_t rdi; __uint64_t rsi; __uint64_t rbp; __uint64_t rsp; __uint64_t r8; __uint64_t r9; __uint64_t r10; __uint64_t r11; __uint64_t r12; __uint64_t r13; __uint64_t r14; __uint64_t r15; __uint64_t rip; __uint64_t rflags; __uint64_t cs; __uint64_t fs; __uint64_t gs; }; #endif /* !__DARWIN_UNIX03 */ /* * 64 bit versions of the above (complete) */ #if __DARWIN_UNIX03 #define _STRUCT_X86_THREAD_FULL_STATE64 struct __darwin_x86_thread_full_state64 _STRUCT_X86_THREAD_FULL_STATE64 { _STRUCT_X86_THREAD_STATE64 __ss64; __uint64_t __ds; __uint64_t __es; __uint64_t __ss; __uint64_t __gsbase; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_THREAD_FULL_STATE64 struct x86_thread_full_state64 _STRUCT_X86_THREAD_FULL_STATE64 { _STRUCT_X86_THREAD_STATE64 ss64; __uint64_t ds; __uint64_t es; __uint64_t ss; __uint64_t gsbase; }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_X86_FLOAT_STATE64 struct __darwin_x86_float_state64 _STRUCT_X86_FLOAT_STATE64 { int __fpu_reserved[2]; _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ __uint8_t __fpu_ftw; /* x87 FPU tag word */ __uint8_t __fpu_rsrv1; /* reserved */ __uint16_t __fpu_fop; /* x87 FPU Opcode */ /* x87 FPU Instruction Pointer */ __uint32_t __fpu_ip; /* offset */ __uint16_t __fpu_cs; /* Selector */ __uint16_t __fpu_rsrv2; /* reserved */ /* x87 FPU Instruction Operand(Data) Pointer */ __uint32_t __fpu_dp; /* offset */ __uint16_t __fpu_ds; /* Selector */ __uint16_t __fpu_rsrv3; /* reserved */ __uint32_t __fpu_mxcsr; /* MXCSR Register state */ __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ _STRUCT_XMM_REG __fpu_xmm8; /* XMM 8 */ _STRUCT_XMM_REG __fpu_xmm9; /* XMM 9 */ _STRUCT_XMM_REG __fpu_xmm10; /* XMM 10 */ _STRUCT_XMM_REG __fpu_xmm11; /* XMM 11 */ _STRUCT_XMM_REG __fpu_xmm12; /* XMM 12 */ _STRUCT_XMM_REG __fpu_xmm13; /* XMM 13 */ _STRUCT_XMM_REG __fpu_xmm14; /* XMM 14 */ _STRUCT_XMM_REG __fpu_xmm15; /* XMM 15 */ char __fpu_rsrv4[6*16]; /* reserved */ int __fpu_reserved1; }; #define _STRUCT_X86_AVX_STATE64 struct __darwin_x86_avx_state64 _STRUCT_X86_AVX_STATE64 { int __fpu_reserved[2]; _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ __uint8_t __fpu_ftw; /* x87 FPU tag word */ __uint8_t __fpu_rsrv1; /* reserved */ __uint16_t __fpu_fop; /* x87 FPU Opcode */ /* x87 FPU Instruction Pointer */ __uint32_t __fpu_ip; /* offset */ __uint16_t __fpu_cs; /* Selector */ __uint16_t __fpu_rsrv2; /* reserved */ /* x87 FPU Instruction Operand(Data) Pointer */ __uint32_t __fpu_dp; /* offset */ __uint16_t __fpu_ds; /* Selector */ __uint16_t __fpu_rsrv3; /* reserved */ __uint32_t __fpu_mxcsr; /* MXCSR Register state */ __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ _STRUCT_XMM_REG __fpu_xmm8; /* XMM 8 */ _STRUCT_XMM_REG __fpu_xmm9; /* XMM 9 */ _STRUCT_XMM_REG __fpu_xmm10; /* XMM 10 */ _STRUCT_XMM_REG __fpu_xmm11; /* XMM 11 */ _STRUCT_XMM_REG __fpu_xmm12; /* XMM 12 */ _STRUCT_XMM_REG __fpu_xmm13; /* XMM 13 */ _STRUCT_XMM_REG __fpu_xmm14; /* XMM 14 */ _STRUCT_XMM_REG __fpu_xmm15; /* XMM 15 */ char __fpu_rsrv4[6*16]; /* reserved */ int __fpu_reserved1; char __avx_reserved1[64]; _STRUCT_XMM_REG __fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG __fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG __fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG __fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG __fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG __fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG __fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG __fpu_ymmh7; /* YMMH 7 */ _STRUCT_XMM_REG __fpu_ymmh8; /* YMMH 8 */ _STRUCT_XMM_REG __fpu_ymmh9; /* YMMH 9 */ _STRUCT_XMM_REG __fpu_ymmh10; /* YMMH 10 */ _STRUCT_XMM_REG __fpu_ymmh11; /* YMMH 11 */ _STRUCT_XMM_REG __fpu_ymmh12; /* YMMH 12 */ _STRUCT_XMM_REG __fpu_ymmh13; /* YMMH 13 */ _STRUCT_XMM_REG __fpu_ymmh14; /* YMMH 14 */ _STRUCT_XMM_REG __fpu_ymmh15; /* YMMH 15 */ }; #define _STRUCT_X86_AVX512_STATE64 struct __darwin_x86_avx512_state64 _STRUCT_X86_AVX512_STATE64 { int __fpu_reserved[2]; _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ __uint8_t __fpu_ftw; /* x87 FPU tag word */ __uint8_t __fpu_rsrv1; /* reserved */ __uint16_t __fpu_fop; /* x87 FPU Opcode */ /* x87 FPU Instruction Pointer */ __uint32_t __fpu_ip; /* offset */ __uint16_t __fpu_cs; /* Selector */ __uint16_t __fpu_rsrv2; /* reserved */ /* x87 FPU Instruction Operand(Data) Pointer */ __uint32_t __fpu_dp; /* offset */ __uint16_t __fpu_ds; /* Selector */ __uint16_t __fpu_rsrv3; /* reserved */ __uint32_t __fpu_mxcsr; /* MXCSR Register state */ __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ _STRUCT_XMM_REG __fpu_xmm8; /* XMM 8 */ _STRUCT_XMM_REG __fpu_xmm9; /* XMM 9 */ _STRUCT_XMM_REG __fpu_xmm10; /* XMM 10 */ _STRUCT_XMM_REG __fpu_xmm11; /* XMM 11 */ _STRUCT_XMM_REG __fpu_xmm12; /* XMM 12 */ _STRUCT_XMM_REG __fpu_xmm13; /* XMM 13 */ _STRUCT_XMM_REG __fpu_xmm14; /* XMM 14 */ _STRUCT_XMM_REG __fpu_xmm15; /* XMM 15 */ char __fpu_rsrv4[6*16]; /* reserved */ int __fpu_reserved1; char __avx_reserved1[64]; _STRUCT_XMM_REG __fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG __fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG __fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG __fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG __fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG __fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG __fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG __fpu_ymmh7; /* YMMH 7 */ _STRUCT_XMM_REG __fpu_ymmh8; /* YMMH 8 */ _STRUCT_XMM_REG __fpu_ymmh9; /* YMMH 9 */ _STRUCT_XMM_REG __fpu_ymmh10; /* YMMH 10 */ _STRUCT_XMM_REG __fpu_ymmh11; /* YMMH 11 */ _STRUCT_XMM_REG __fpu_ymmh12; /* YMMH 12 */ _STRUCT_XMM_REG __fpu_ymmh13; /* YMMH 13 */ _STRUCT_XMM_REG __fpu_ymmh14; /* YMMH 14 */ _STRUCT_XMM_REG __fpu_ymmh15; /* YMMH 15 */ _STRUCT_OPMASK_REG __fpu_k0; /* K0 */ _STRUCT_OPMASK_REG __fpu_k1; /* K1 */ _STRUCT_OPMASK_REG __fpu_k2; /* K2 */ _STRUCT_OPMASK_REG __fpu_k3; /* K3 */ _STRUCT_OPMASK_REG __fpu_k4; /* K4 */ _STRUCT_OPMASK_REG __fpu_k5; /* K5 */ _STRUCT_OPMASK_REG __fpu_k6; /* K6 */ _STRUCT_OPMASK_REG __fpu_k7; /* K7 */ _STRUCT_YMM_REG __fpu_zmmh0; /* ZMMH 0 */ _STRUCT_YMM_REG __fpu_zmmh1; /* ZMMH 1 */ _STRUCT_YMM_REG __fpu_zmmh2; /* ZMMH 2 */ _STRUCT_YMM_REG __fpu_zmmh3; /* ZMMH 3 */ _STRUCT_YMM_REG __fpu_zmmh4; /* ZMMH 4 */ _STRUCT_YMM_REG __fpu_zmmh5; /* ZMMH 5 */ _STRUCT_YMM_REG __fpu_zmmh6; /* ZMMH 6 */ _STRUCT_YMM_REG __fpu_zmmh7; /* ZMMH 7 */ _STRUCT_YMM_REG __fpu_zmmh8; /* ZMMH 8 */ _STRUCT_YMM_REG __fpu_zmmh9; /* ZMMH 9 */ _STRUCT_YMM_REG __fpu_zmmh10; /* ZMMH 10 */ _STRUCT_YMM_REG __fpu_zmmh11; /* ZMMH 11 */ _STRUCT_YMM_REG __fpu_zmmh12; /* ZMMH 12 */ _STRUCT_YMM_REG __fpu_zmmh13; /* ZMMH 13 */ _STRUCT_YMM_REG __fpu_zmmh14; /* ZMMH 14 */ _STRUCT_YMM_REG __fpu_zmmh15; /* ZMMH 15 */ _STRUCT_ZMM_REG __fpu_zmm16; /* ZMM 16 */ _STRUCT_ZMM_REG __fpu_zmm17; /* ZMM 17 */ _STRUCT_ZMM_REG __fpu_zmm18; /* ZMM 18 */ _STRUCT_ZMM_REG __fpu_zmm19; /* ZMM 19 */ _STRUCT_ZMM_REG __fpu_zmm20; /* ZMM 20 */ _STRUCT_ZMM_REG __fpu_zmm21; /* ZMM 21 */ _STRUCT_ZMM_REG __fpu_zmm22; /* ZMM 22 */ _STRUCT_ZMM_REG __fpu_zmm23; /* ZMM 23 */ _STRUCT_ZMM_REG __fpu_zmm24; /* ZMM 24 */ _STRUCT_ZMM_REG __fpu_zmm25; /* ZMM 25 */ _STRUCT_ZMM_REG __fpu_zmm26; /* ZMM 26 */ _STRUCT_ZMM_REG __fpu_zmm27; /* ZMM 27 */ _STRUCT_ZMM_REG __fpu_zmm28; /* ZMM 28 */ _STRUCT_ZMM_REG __fpu_zmm29; /* ZMM 29 */ _STRUCT_ZMM_REG __fpu_zmm30; /* ZMM 30 */ _STRUCT_ZMM_REG __fpu_zmm31; /* ZMM 31 */ }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_FLOAT_STATE64 struct x86_float_state64 _STRUCT_X86_FLOAT_STATE64 { int fpu_reserved[2]; _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ __uint8_t fpu_ftw; /* x87 FPU tag word */ __uint8_t fpu_rsrv1; /* reserved */ __uint16_t fpu_fop; /* x87 FPU Opcode */ /* x87 FPU Instruction Pointer */ __uint32_t fpu_ip; /* offset */ __uint16_t fpu_cs; /* Selector */ __uint16_t fpu_rsrv2; /* reserved */ /* x87 FPU Instruction Operand(Data) Pointer */ __uint32_t fpu_dp; /* offset */ __uint16_t fpu_ds; /* Selector */ __uint16_t fpu_rsrv3; /* reserved */ __uint32_t fpu_mxcsr; /* MXCSR Register state */ __uint32_t fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ _STRUCT_XMM_REG fpu_xmm8; /* XMM 8 */ _STRUCT_XMM_REG fpu_xmm9; /* XMM 9 */ _STRUCT_XMM_REG fpu_xmm10; /* XMM 10 */ _STRUCT_XMM_REG fpu_xmm11; /* XMM 11 */ _STRUCT_XMM_REG fpu_xmm12; /* XMM 12 */ _STRUCT_XMM_REG fpu_xmm13; /* XMM 13 */ _STRUCT_XMM_REG fpu_xmm14; /* XMM 14 */ _STRUCT_XMM_REG fpu_xmm15; /* XMM 15 */ char fpu_rsrv4[6*16]; /* reserved */ int fpu_reserved1; }; #define _STRUCT_X86_AVX_STATE64 struct x86_avx_state64 _STRUCT_X86_AVX_STATE64 { int fpu_reserved[2]; _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ __uint8_t fpu_ftw; /* x87 FPU tag word */ __uint8_t fpu_rsrv1; /* reserved */ __uint16_t fpu_fop; /* x87 FPU Opcode */ /* x87 FPU Instruction Pointer */ __uint32_t fpu_ip; /* offset */ __uint16_t fpu_cs; /* Selector */ __uint16_t fpu_rsrv2; /* reserved */ /* x87 FPU Instruction Operand(Data) Pointer */ __uint32_t fpu_dp; /* offset */ __uint16_t fpu_ds; /* Selector */ __uint16_t fpu_rsrv3; /* reserved */ __uint32_t fpu_mxcsr; /* MXCSR Register state */ __uint32_t fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ _STRUCT_XMM_REG fpu_xmm8; /* XMM 8 */ _STRUCT_XMM_REG fpu_xmm9; /* XMM 9 */ _STRUCT_XMM_REG fpu_xmm10; /* XMM 10 */ _STRUCT_XMM_REG fpu_xmm11; /* XMM 11 */ _STRUCT_XMM_REG fpu_xmm12; /* XMM 12 */ _STRUCT_XMM_REG fpu_xmm13; /* XMM 13 */ _STRUCT_XMM_REG fpu_xmm14; /* XMM 14 */ _STRUCT_XMM_REG fpu_xmm15; /* XMM 15 */ char fpu_rsrv4[6*16]; /* reserved */ int fpu_reserved1; char avx_reserved1[64]; _STRUCT_XMM_REG fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG fpu_ymmh7; /* YMMH 7 */ _STRUCT_XMM_REG fpu_ymmh8; /* YMMH 8 */ _STRUCT_XMM_REG fpu_ymmh9; /* YMMH 9 */ _STRUCT_XMM_REG fpu_ymmh10; /* YMMH 10 */ _STRUCT_XMM_REG fpu_ymmh11; /* YMMH 11 */ _STRUCT_XMM_REG fpu_ymmh12; /* YMMH 12 */ _STRUCT_XMM_REG fpu_ymmh13; /* YMMH 13 */ _STRUCT_XMM_REG fpu_ymmh14; /* YMMH 14 */ _STRUCT_XMM_REG fpu_ymmh15; /* YMMH 15 */ }; #define _STRUCT_X86_AVX512_STATE64 struct x86_avx512_state64 _STRUCT_X86_AVX512_STATE64 { int fpu_reserved[2]; _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ __uint8_t fpu_ftw; /* x87 FPU tag word */ __uint8_t fpu_rsrv1; /* reserved */ __uint16_t fpu_fop; /* x87 FPU Opcode */ /* x87 FPU Instruction Pointer */ __uint32_t fpu_ip; /* offset */ __uint16_t fpu_cs; /* Selector */ __uint16_t fpu_rsrv2; /* reserved */ /* x87 FPU Instruction Operand(Data) Pointer */ __uint32_t fpu_dp; /* offset */ __uint16_t fpu_ds; /* Selector */ __uint16_t fpu_rsrv3; /* reserved */ __uint32_t fpu_mxcsr; /* MXCSR Register state */ __uint32_t fpu_mxcsrmask; /* MXCSR mask */ _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ _STRUCT_XMM_REG fpu_xmm8; /* XMM 8 */ _STRUCT_XMM_REG fpu_xmm9; /* XMM 9 */ _STRUCT_XMM_REG fpu_xmm10; /* XMM 10 */ _STRUCT_XMM_REG fpu_xmm11; /* XMM 11 */ _STRUCT_XMM_REG fpu_xmm12; /* XMM 12 */ _STRUCT_XMM_REG fpu_xmm13; /* XMM 13 */ _STRUCT_XMM_REG fpu_xmm14; /* XMM 14 */ _STRUCT_XMM_REG fpu_xmm15; /* XMM 15 */ char fpu_rsrv4[6*16]; /* reserved */ int fpu_reserved1; char avx_reserved1[64]; _STRUCT_XMM_REG fpu_ymmh0; /* YMMH 0 */ _STRUCT_XMM_REG fpu_ymmh1; /* YMMH 1 */ _STRUCT_XMM_REG fpu_ymmh2; /* YMMH 2 */ _STRUCT_XMM_REG fpu_ymmh3; /* YMMH 3 */ _STRUCT_XMM_REG fpu_ymmh4; /* YMMH 4 */ _STRUCT_XMM_REG fpu_ymmh5; /* YMMH 5 */ _STRUCT_XMM_REG fpu_ymmh6; /* YMMH 6 */ _STRUCT_XMM_REG fpu_ymmh7; /* YMMH 7 */ _STRUCT_XMM_REG fpu_ymmh8; /* YMMH 8 */ _STRUCT_XMM_REG fpu_ymmh9; /* YMMH 9 */ _STRUCT_XMM_REG fpu_ymmh10; /* YMMH 10 */ _STRUCT_XMM_REG fpu_ymmh11; /* YMMH 11 */ _STRUCT_XMM_REG fpu_ymmh12; /* YMMH 12 */ _STRUCT_XMM_REG fpu_ymmh13; /* YMMH 13 */ _STRUCT_XMM_REG fpu_ymmh14; /* YMMH 14 */ _STRUCT_XMM_REG fpu_ymmh15; /* YMMH 15 */ _STRUCT_OPMASK_REG fpu_k0; /* K0 */ _STRUCT_OPMASK_REG fpu_k1; /* K1 */ _STRUCT_OPMASK_REG fpu_k2; /* K2 */ _STRUCT_OPMASK_REG fpu_k3; /* K3 */ _STRUCT_OPMASK_REG fpu_k4; /* K4 */ _STRUCT_OPMASK_REG fpu_k5; /* K5 */ _STRUCT_OPMASK_REG fpu_k6; /* K6 */ _STRUCT_OPMASK_REG fpu_k7; /* K7 */ _STRUCT_YMM_REG fpu_zmmh0; /* ZMMH 0 */ _STRUCT_YMM_REG fpu_zmmh1; /* ZMMH 1 */ _STRUCT_YMM_REG fpu_zmmh2; /* ZMMH 2 */ _STRUCT_YMM_REG fpu_zmmh3; /* ZMMH 3 */ _STRUCT_YMM_REG fpu_zmmh4; /* ZMMH 4 */ _STRUCT_YMM_REG fpu_zmmh5; /* ZMMH 5 */ _STRUCT_YMM_REG fpu_zmmh6; /* ZMMH 6 */ _STRUCT_YMM_REG fpu_zmmh7; /* ZMMH 7 */ _STRUCT_YMM_REG fpu_zmmh8; /* ZMMH 8 */ _STRUCT_YMM_REG fpu_zmmh9; /* ZMMH 9 */ _STRUCT_YMM_REG fpu_zmmh10; /* ZMMH 10 */ _STRUCT_YMM_REG fpu_zmmh11; /* ZMMH 11 */ _STRUCT_YMM_REG fpu_zmmh12; /* ZMMH 12 */ _STRUCT_YMM_REG fpu_zmmh13; /* ZMMH 13 */ _STRUCT_YMM_REG fpu_zmmh14; /* ZMMH 14 */ _STRUCT_YMM_REG fpu_zmmh15; /* ZMMH 15 */ _STRUCT_ZMM_REG fpu_zmm16; /* ZMM 16 */ _STRUCT_ZMM_REG fpu_zmm17; /* ZMM 17 */ _STRUCT_ZMM_REG fpu_zmm18; /* ZMM 18 */ _STRUCT_ZMM_REG fpu_zmm19; /* ZMM 19 */ _STRUCT_ZMM_REG fpu_zmm20; /* ZMM 20 */ _STRUCT_ZMM_REG fpu_zmm21; /* ZMM 21 */ _STRUCT_ZMM_REG fpu_zmm22; /* ZMM 22 */ _STRUCT_ZMM_REG fpu_zmm23; /* ZMM 23 */ _STRUCT_ZMM_REG fpu_zmm24; /* ZMM 24 */ _STRUCT_ZMM_REG fpu_zmm25; /* ZMM 25 */ _STRUCT_ZMM_REG fpu_zmm26; /* ZMM 26 */ _STRUCT_ZMM_REG fpu_zmm27; /* ZMM 27 */ _STRUCT_ZMM_REG fpu_zmm28; /* ZMM 28 */ _STRUCT_ZMM_REG fpu_zmm29; /* ZMM 29 */ _STRUCT_ZMM_REG fpu_zmm30; /* ZMM 30 */ _STRUCT_ZMM_REG fpu_zmm31; /* ZMM 31 */ }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_X86_EXCEPTION_STATE64 struct __darwin_x86_exception_state64 _STRUCT_X86_EXCEPTION_STATE64 { __uint16_t __trapno; __uint16_t __cpu; __uint32_t __err; __uint64_t __faultvaddr; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_EXCEPTION_STATE64 struct x86_exception_state64 _STRUCT_X86_EXCEPTION_STATE64 { __uint16_t trapno; __uint16_t cpu; __uint32_t err; __uint64_t faultvaddr; }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_X86_DEBUG_STATE64 struct __darwin_x86_debug_state64 _STRUCT_X86_DEBUG_STATE64 { __uint64_t __dr0; __uint64_t __dr1; __uint64_t __dr2; __uint64_t __dr3; __uint64_t __dr4; __uint64_t __dr5; __uint64_t __dr6; __uint64_t __dr7; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_DEBUG_STATE64 struct x86_debug_state64 _STRUCT_X86_DEBUG_STATE64 { __uint64_t dr0; __uint64_t dr1; __uint64_t dr2; __uint64_t dr3; __uint64_t dr4; __uint64_t dr5; __uint64_t dr6; __uint64_t dr7; }; #endif /* !__DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_X86_CPMU_STATE64 struct __darwin_x86_cpmu_state64 _STRUCT_X86_CPMU_STATE64 { __uint64_t __ctrs[16]; }; #else /* __DARWIN_UNIX03 */ #define _STRUCT_X86_CPMU_STATE64 struct x86_cpmu_state64 _STRUCT_X86_CPMU_STATE64 { __uint64_t ctrs[16]; }; #endif /* !__DARWIN_UNIX03 */ #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386__STRUCTS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/sdt_isa.h
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _MACH_I386_SDT_ISA_H #define _MACH_I386_SDT_ISA_H #if defined (__i386__) || defined (__x86_64__) /* * Only define when testing. This makes the calls into actual calls to * test functions. */ /* #define DTRACE_CALL_TEST */ #define DTRACE_STRINGIFY(s) #s #define DTRACE_TOSTRING(s) DTRACE_STRINGIFY(s) /* * For the kernel, set an explicit global label so the symbol can be located */ #ifdef __x86_64__ #define DTRACE_LABEL(p, n) \ ".pushsection __DATA, __sdt_cstring, cstring_literals\n\t" \ "1: .ascii \"" DTRACE_STRINGIFY(p##___) "\\0\"\n\t" \ "2: .ascii \"" DTRACE_STRINGIFY(n) "\\0\"\n\t" \ ".popsection" "\n\t" \ ".pushsection __DATA, __sdt, regular, live_support\n\t" \ ".p2align 3\n\t" \ "l3_%=:\n\t" \ ".quad 4f" "\n\t" \ ".quad 1b" "\n\t" \ ".quad 2b" "\n\t" \ ".popsection" "\n\t" \ "4:" #else #define DTRACE_LABEL(p, n) \ ".pushsection __DATA, __sdt_cstring, cstring_literals\n\t" \ "1: .ascii \"" DATA_STRINGIFY(p##___) "\\0\"\n\t" \ "2: .ascii \"" DATA_STRINGIFY(n) "\\0\"\n\t" \ ".popsection" "\n\t" \ ".pushsection __DATA, __sdt, regular, live_support\n\t" \ ".p2align 3\n\t" \ "l3_%=:\n\t" \ ".long 4f""\n\t" \ ".long 1b""\n\t" \ ".long 2b""\n\t" \ ".popsection" "\n\t" \ "4:" #endif #ifdef DTRACE_CALL_TEST #define DTRACE_CALL(p, n) \ DTRACE_LABEL(p,n) \ DTRACE_CALL_INSN(p,n) #else #define DTRACE_CALL(p, n) \ DTRACE_LABEL(p,n) \ DTRACE_NOPS #endif #ifdef __x86_64__ #define DTRACE_NOPS \ "nop" "\n\t" \ "nop" "\n\t" \ "nop" "\n\t" #define DTRACE_CALL_INSN(p, n) \ "call _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" #define ARG1_EXTENT 1 #define ARGS2_EXTENT 2 #define ARGS3_EXTENT 3 #define ARGS4_EXTENT 4 #define ARGS5_EXTENT 5 #define ARGS6_EXTENT 6 #define ARGS7_EXTENT 7 #define ARGS8_EXTENT 8 #define ARGS9_EXTENT 9 #define ARGS10_EXTENT 10 #define DTRACE_CALL0ARGS(provider, name) \ asm volatile ( \ DTRACE_CALL(provider, name) \ : \ : \ ); #define DTRACE_CALL1ARG(provider, name) \ asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "rdi" \ ); #define DTRACE_CALL2ARGS(provider, name) \ asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi" \ ); #define DTRACE_CALL3ARGS(provider, name) \ asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ "movq\t0x10(%0),%%rdx" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi", "rdx" \ ); #define DTRACE_CALL4ARGS(provider, name) \ asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ "movq\t0x10(%0),%%rdx" "\n\t" \ "movq\t0x18(%0),%%rcx" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi", "rdx", "rcx" \ ); #define DTRACE_CALL5ARGS(provider, name) \ asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ "movq\t0x10(%0),%%rdx" "\n\t" \ "movq\t0x18(%0),%%rcx" "\n\t" \ "movq\t0x20(%0),%%r8" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi", "rdx", "rcx", "r8" \ ); #define DTRACE_CALL6ARGS(provider, name) \ asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ "movq\t0x10(%0),%%rdx" "\n\t" \ "movq\t0x18(%0),%%rcx" "\n\t" \ "movq\t0x20(%0),%%r8" "\n\t" \ "movq\t0x28(%0),%%r9" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9" \ ); #define DTRACE_CALL7ARGS(provider, name) \ asm volatile ("subq\t$0x8,%%rsp" "\n\t" \ "movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ "movq\t0x10(%0),%%rdx" "\n\t" \ "movq\t0x18(%0),%%rcx" "\n\t" \ "movq\t0x20(%0),%%r8" "\n\t" \ "movq\t0x28(%0),%%r9" "\n\t" \ "movq\t0x30(%0),%%rax" "\n\t" \ "movq\t%%rax,0x0(%%rsp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addq\t$0x8,%%rsp" "\n\t" \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "rax" \ ); #define DTRACE_CALL8ARGS(provider, name) \ asm volatile ("subq\t$0x10,%%rsp" "\n\t" \ "movq\t0x0(%0),%%rdi" "\n\t" \ "movq\t0x8(%0),%%rsi" "\n\t" \ "movq\t0x10(%0),%%rdx" "\n\t" \ "movq\t0x18(%0),%%rcx" "\n\t" \ "movq\t0x20(%0),%%r8" "\n\t" \ "movq\t0x28(%0),%%r9" "\n\t" \ "movq\t0x30(%0),%%rax" "\n\t" \ "movq\t%%rax,0x0(%%rsp)" "\n\t" \ "movq\t0x38(%0),%%rax" "\n\t" \ "movq\t%%rax,0x8(%%rsp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addq\t$0x10,%%rsp" "\n\t" \ : \ : "r" (__dtrace_args) \ : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "rax" \ ); #endif // __x86_64__ #ifdef __i386__ #define DTRACE_NOPS \ "nop" "\n\t" \ "leal 0(%%esi), %%esi" "\n\t" #define DTRACE_CALL_INSN(p, n) \ "call _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" #define ARG1_EXTENT 1 #define ARGS2_EXTENT 2 #define ARGS3_EXTENT 4 #define ARGS4_EXTENT 4 #define ARGS5_EXTENT 8 #define ARGS6_EXTENT 8 #define ARGS7_EXTENT 8 #define ARGS8_EXTENT 8 #define ARGS9_EXTENT 12 #define ARGS10_EXTENT 12 /* * Because this code is used in the kernel, we must not touch any floating point * or specialized registers. This leaves the following registers: * * eax ; volatile, safe to use * ebx ; PIC register, gcc error when used * ecx ; volatile, safe to use * edx ; volatile, safe to use * esi ; non-volatile, otherwise safe to use * edi ; non-volatile, otherwise safe to use * * Using any of the non volatile register causes a spill to stack which is almost * certainly a net performance loss. Also, note that the array ref (__dtrace_args) * consumes one free register. If all three of the volatile regs are used for load/store, * the compiler will spill a register to hold the array ref. * * The end result is that we only pipeline two loads/stores at a time. Blech. */ #define DTRACE_CALL0ARGS(provider, name) \ asm volatile ( \ DTRACE_CALL(provider, name) \ "# eat trailing nl +tabfrom DTRACE_CALL" \ : \ : \ ); #define DTRACE_CALL1ARG(provider, name) \ asm volatile ("subl\t$0x10,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x10,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax" \ ); #define DTRACE_CALL2ARGS(provider, name) \ asm volatile ("subl\t$0x10,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x10,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL3ARGS(provider, name) \ asm volatile ("subl\t$0x10,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x10,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL4ARGS(provider, name) \ asm volatile ("subl\t$0x10,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x10,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL5ARGS(provider, name) \ asm volatile ("subl\t$0x20,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ "movl\t0x10(%0),%%eax" "\n\t" \ "movl\t%%eax,0x10(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x20,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL6ARGS(provider, name) \ asm volatile ("subl\t$0x20,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ "movl\t0x10(%0),%%eax" "\n\t" \ "movl\t0x14(%0),%%edx" "\n\t" \ "movl\t%%eax,0x10(%%esp)" "\n\t" \ "movl\t%%edx,0x14(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x20,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL7ARGS(provider, name) \ asm volatile ("subl\t$0x20,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ "movl\t0x10(%0),%%eax" "\n\t" \ "movl\t0x14(%0),%%edx" "\n\t" \ "movl\t%%eax,0x10(%%esp)" "\n\t" \ "movl\t%%edx,0x14(%%esp)" "\n\t" \ "movl\t0x18(%0),%%eax" "\n\t" \ "movl\t%%eax,0x18(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x20,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL8ARGS(provider, name) \ asm volatile ("subl\t$0x20,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ "movl\t0x10(%0),%%eax" "\n\t" \ "movl\t0x14(%0),%%edx" "\n\t" \ "movl\t%%eax,0x10(%%esp)" "\n\t" \ "movl\t%%edx,0x14(%%esp)" "\n\t" \ "movl\t0x18(%0),%%eax" "\n\t" \ "movl\t0x1C(%0),%%edx" "\n\t" \ "movl\t%%eax,0x18(%%esp)" "\n\t" \ "movl\t%%edx,0x1C(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x20,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL9ARGS(provider, name) \ asm volatile ("subl\t$0x30,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ "movl\t0x10(%0),%%eax" "\n\t" \ "movl\t0x14(%0),%%edx" "\n\t" \ "movl\t%%eax,0x10(%%esp)" "\n\t" \ "movl\t%%edx,0x14(%%esp)" "\n\t" \ "movl\t0x18(%0),%%eax" "\n\t" \ "movl\t0x1C(%0),%%edx" "\n\t" \ "movl\t%%eax,0x18(%%esp)" "\n\t" \ "movl\t%%edx,0x1C(%%esp)" "\n\t" \ "movl\t0x20(%0),%%eax" "\n\t" \ "movl\t%%eax,0x20(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x30,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #define DTRACE_CALL10ARGS(provider, name) \ asm volatile ("subl\t$0x30,%%esp" "\n\t" \ "movl\t0x0(%0),%%eax" "\n\t" \ "movl\t0x4(%0),%%edx" "\n\t" \ "movl\t%%eax,0x0(%%esp)" "\n\t" \ "movl\t%%edx,0x4(%%esp)" "\n\t" \ "movl\t0x8(%0),%%eax" "\n\t" \ "movl\t0xC(%0),%%edx" "\n\t" \ "movl\t%%eax,0x8(%%esp)" "\n\t" \ "movl\t%%edx,0xC(%%esp)" "\n\t" \ "movl\t0x10(%0),%%eax" "\n\t" \ "movl\t0x14(%0),%%edx" "\n\t" \ "movl\t%%eax,0x10(%%esp)" "\n\t" \ "movl\t%%edx,0x14(%%esp)" "\n\t" \ "movl\t0x18(%0),%%eax" "\n\t" \ "movl\t0x1C(%0),%%edx" "\n\t" \ "movl\t%%eax,0x18(%%esp)" "\n\t" \ "movl\t%%edx,0x1C(%%esp)" "\n\t" \ "movl\t0x20(%0),%%eax" "\n\t" \ "movl\t0x24(%0),%%edx" "\n\t" \ "movl\t%%eax,0x20(%%esp)" "\n\t" \ "movl\t%%edx,0x24(%%esp)" "\n\t" \ DTRACE_CALL(provider, name) \ "addl\t$0x30,%%esp" \ : \ : "r" (__dtrace_args) \ : "memory", "eax", "edx" \ ); #endif // __i386__ #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_SDT_ISA_H */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/thread_status.h
/* * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: thread_status.h * Author: Avadis Tevanian, Jr. * Date: 1985 * * This file contains the structure definitions for the thread * state as applied to I386 processors. */ #ifndef _MACH_I386_THREAD_STATUS_H_ #define _MACH_I386_THREAD_STATUS_H_ #if defined (__i386__) || defined (__x86_64__) #include <mach/machine/_structs.h> #include <mach/machine/thread_state.h> #include <mach/message.h> #include <mach/i386/fp_reg.h> #include <i386/eflags.h> /* * the i386_xxxx form is kept for legacy purposes since these types * are externally known... eventually they should be deprecated. * our internal implementation has moved to the following naming convention * * x86_xxxx32 names are used to deal with 32 bit states * x86_xxxx64 names are used to deal with 64 bit states * x86_xxxx names are used to deal with either 32 or 64 bit states * via a self-describing mechanism */ /* * these are the legacy names which should be deprecated in the future * they are externally known which is the only reason we don't just get * rid of them */ #define i386_THREAD_STATE 1 #define i386_FLOAT_STATE 2 #define i386_EXCEPTION_STATE 3 /* * THREAD_STATE_FLAVOR_LIST 0 * these are the supported flavors */ #define x86_THREAD_STATE32 1 #define x86_FLOAT_STATE32 2 #define x86_EXCEPTION_STATE32 3 #define x86_THREAD_STATE64 4 #define x86_FLOAT_STATE64 5 #define x86_EXCEPTION_STATE64 6 #define x86_THREAD_STATE 7 #define x86_FLOAT_STATE 8 #define x86_EXCEPTION_STATE 9 #define x86_DEBUG_STATE32 10 #define x86_DEBUG_STATE64 11 #define x86_DEBUG_STATE 12 #define THREAD_STATE_NONE 13 /* 14 and 15 are used for the internal x86_SAVED_STATE flavours */ /* Arrange for flavors to take sequential values, 32-bit, 64-bit, non-specific */ #define x86_AVX_STATE32 16 #define x86_AVX_STATE64 (x86_AVX_STATE32 + 1) #define x86_AVX_STATE (x86_AVX_STATE32 + 2) #define x86_AVX512_STATE32 19 #define x86_AVX512_STATE64 (x86_AVX512_STATE32 + 1) #define x86_AVX512_STATE (x86_AVX512_STATE32 + 2) #define x86_PAGEIN_STATE 22 #define x86_THREAD_FULL_STATE64 23 #define x86_INSTRUCTION_STATE 24 #define x86_LAST_BRANCH_STATE 25 /* * Largest state on this machine: * (be sure mach/machine/thread_state.h matches!) */ #define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX /* * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed * an exception flavor will return if that is a defined flavor for that * platform. The macro must be manually updated to include all of the valid * exception flavors as defined above. */ #define VALID_THREAD_STATE_FLAVOR(x) \ ((x == x86_THREAD_STATE32) || \ (x == x86_FLOAT_STATE32) || \ (x == x86_EXCEPTION_STATE32) || \ (x == x86_DEBUG_STATE32) || \ (x == x86_THREAD_STATE64) || \ (x == x86_THREAD_FULL_STATE64) || \ (x == x86_FLOAT_STATE64) || \ (x == x86_EXCEPTION_STATE64) || \ (x == x86_DEBUG_STATE64) || \ (x == x86_THREAD_STATE) || \ (x == x86_FLOAT_STATE) || \ (x == x86_EXCEPTION_STATE) || \ (x == x86_DEBUG_STATE) || \ (x == x86_AVX_STATE32) || \ (x == x86_AVX_STATE64) || \ (x == x86_AVX_STATE) || \ (x == x86_AVX512_STATE32) || \ (x == x86_AVX512_STATE64) || \ (x == x86_AVX512_STATE) || \ (x == x86_PAGEIN_STATE) || \ (x == x86_INSTRUCTION_STATE) || \ (x == x86_LAST_BRANCH_STATE) || \ (x == THREAD_STATE_NONE)) struct x86_state_hdr { uint32_t flavor; uint32_t count; }; typedef struct x86_state_hdr x86_state_hdr_t; /* * Default segment register values. */ #define USER_CODE_SELECTOR 0x0017 #define USER_DATA_SELECTOR 0x001f #define KERN_CODE_SELECTOR 0x0008 #define KERN_DATA_SELECTOR 0x0010 /* * to be deprecated in the future */ typedef _STRUCT_X86_THREAD_STATE32 i386_thread_state_t; #define i386_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ ( sizeof (i386_thread_state_t) / sizeof (int) )) typedef _STRUCT_X86_THREAD_STATE32 x86_thread_state32_t; #define x86_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_thread_state32_t) / sizeof (int) )) /* * to be deprecated in the future */ typedef _STRUCT_X86_FLOAT_STATE32 i386_float_state_t; #define i386_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof(i386_float_state_t)/sizeof(unsigned int))) typedef _STRUCT_X86_FLOAT_STATE32 x86_float_state32_t; #define x86_FLOAT_STATE32_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_float_state32_t)/sizeof(unsigned int))) typedef _STRUCT_X86_AVX_STATE32 x86_avx_state32_t; #define x86_AVX_STATE32_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_avx_state32_t)/sizeof(unsigned int))) typedef _STRUCT_X86_AVX512_STATE32 x86_avx512_state32_t; #define x86_AVX512_STATE32_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_avx512_state32_t)/sizeof(unsigned int))) /* * to be deprecated in the future */ typedef _STRUCT_X86_EXCEPTION_STATE32 i386_exception_state_t; #define i386_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ ( sizeof (i386_exception_state_t) / sizeof (int) )) typedef _STRUCT_X86_EXCEPTION_STATE32 x86_exception_state32_t; #define x86_EXCEPTION_STATE32_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_exception_state32_t) / sizeof (int) )) #define I386_EXCEPTION_STATE_COUNT i386_EXCEPTION_STATE_COUNT typedef _STRUCT_X86_DEBUG_STATE32 x86_debug_state32_t; #define x86_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_debug_state32_t) / sizeof (int) )) #define X86_DEBUG_STATE32_COUNT x86_DEBUG_STATE32_COUNT typedef _STRUCT_X86_THREAD_STATE64 x86_thread_state64_t; #define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_thread_state64_t) / sizeof (int) )) typedef _STRUCT_X86_THREAD_FULL_STATE64 x86_thread_full_state64_t; #define x86_THREAD_FULL_STATE64_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_thread_full_state64_t) / sizeof (int) )) typedef _STRUCT_X86_FLOAT_STATE64 x86_float_state64_t; #define x86_FLOAT_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_float_state64_t)/sizeof(unsigned int))) typedef _STRUCT_X86_AVX_STATE64 x86_avx_state64_t; #define x86_AVX_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_avx_state64_t)/sizeof(unsigned int))) typedef _STRUCT_X86_AVX512_STATE64 x86_avx512_state64_t; #define x86_AVX512_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_avx512_state64_t)/sizeof(unsigned int))) typedef _STRUCT_X86_EXCEPTION_STATE64 x86_exception_state64_t; #define x86_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_exception_state64_t) / sizeof (int) )) #define X86_EXCEPTION_STATE64_COUNT x86_EXCEPTION_STATE64_COUNT typedef _STRUCT_X86_DEBUG_STATE64 x86_debug_state64_t; #define x86_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_debug_state64_t) / sizeof (int) )) #define X86_DEBUG_STATE64_COUNT x86_DEBUG_STATE64_COUNT typedef _STRUCT_X86_PAGEIN_STATE x86_pagein_state_t; #define x86_PAGEIN_STATE_COUNT \ ((mach_msg_type_number_t)(sizeof(x86_pagein_state_t) / sizeof(int))) #define X86_PAGEIN_STATE_COUNT x86_PAGEIN_STATE_COUNT typedef _STRUCT_X86_INSTRUCTION_STATE x86_instruction_state_t; #define x86_INSTRUCTION_STATE_COUNT \ ((mach_msg_type_number_t)(sizeof(x86_instruction_state_t) / sizeof(int))) #define X86_INSTRUCTION_STATE_COUNT x86_INSTRUCTION_STATE_COUNT typedef _STRUCT_LAST_BRANCH_STATE last_branch_state_t; #define x86_LAST_BRANCH_STATE_COUNT \ ((mach_msg_type_number_t)(sizeof(last_branch_state_t) / sizeof(int))) #define X86_LAST_BRANCH_STATE_COUNT x86_LAST_BRANCH_STATE_COUNT /* * Combined thread, float and exception states */ struct x86_thread_state { x86_state_hdr_t tsh; union { x86_thread_state32_t ts32; x86_thread_state64_t ts64; } uts; }; struct x86_float_state { x86_state_hdr_t fsh; union { x86_float_state32_t fs32; x86_float_state64_t fs64; } ufs; }; struct x86_exception_state { x86_state_hdr_t esh; union { x86_exception_state32_t es32; x86_exception_state64_t es64; } ues; }; struct x86_debug_state { x86_state_hdr_t dsh; union { x86_debug_state32_t ds32; x86_debug_state64_t ds64; } uds; }; struct x86_avx_state { x86_state_hdr_t ash; union { x86_avx_state32_t as32; x86_avx_state64_t as64; } ufs; }; struct x86_avx512_state { x86_state_hdr_t ash; union { x86_avx512_state32_t as32; x86_avx512_state64_t as64; } ufs; }; typedef struct x86_thread_state x86_thread_state_t; #define x86_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ ( sizeof (x86_thread_state_t) / sizeof (int) )) typedef struct x86_float_state x86_float_state_t; #define x86_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_float_state_t)/sizeof(unsigned int))) typedef struct x86_exception_state x86_exception_state_t; #define x86_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_exception_state_t)/sizeof(unsigned int))) typedef struct x86_debug_state x86_debug_state_t; #define x86_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_debug_state_t)/sizeof(unsigned int))) typedef struct x86_avx_state x86_avx_state_t; #define x86_AVX_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_avx_state_t)/sizeof(unsigned int))) typedef struct x86_avx512_state x86_avx512_state_t; #define x86_AVX512_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof(x86_avx512_state_t)/sizeof(unsigned int))) /* * Machine-independent way for servers and Mach's exception mechanism to * choose the most efficient state flavor for exception RPC's: */ #define MACHINE_THREAD_STATE x86_THREAD_STATE #define MACHINE_THREAD_STATE_COUNT x86_THREAD_STATE_COUNT #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_THREAD_STATUS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/vm_param.h
/* * Copyright (c) 2000-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* * Copyright (c) 1994 The University of Utah and * the Computer Systems Laboratory at the University of Utah (CSL). * All rights reserved. * * Permission to use, copy, modify and distribute this software is hereby * granted provided that (1) source code retains these copyright, permission, * and disclaimer notices, and (2) redistributions including binaries * reproduce the notices in supporting documentation, and (3) all advertising * materials mentioning features or use of this software display the following * acknowledgement: ``This product includes software developed by the * Computer Systems Laboratory at the University of Utah.'' * * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * CSL requests users of this software to return to [email protected] any * improvements that they make and grant CSL redistribution rights. * */ /* * File: vm_param.h * Author: Avadis Tevanian, Jr. * Date: 1985 * * I386 machine dependent virtual memory parameters. * Most of the declarations are preceeded by I386_ (or i386_) * which is OK because only I386 specific code will be using * them. */ #ifndef _MACH_I386_VM_PARAM_H_ #define _MACH_I386_VM_PARAM_H_ #if defined (__i386__) || defined (__x86_64__) #define BYTE_SIZE 8 /* byte size in bits */ #define I386_PGBYTES 4096 /* bytes per 80386 page */ #define I386_PGSHIFT 12 /* bitshift for pages */ #define PAGE_SIZE I386_PGBYTES #define PAGE_SHIFT I386_PGSHIFT #define PAGE_MASK (PAGE_SIZE - 1) #define PAGE_MAX_SHIFT PAGE_SHIFT #define PAGE_MAX_SIZE PAGE_SIZE #define PAGE_MAX_MASK PAGE_MASK #define PAGE_MIN_SHIFT PAGE_SHIFT #define PAGE_MIN_SIZE PAGE_SIZE #define PAGE_MIN_MASK PAGE_MASK #define I386_LPGBYTES 2*1024*1024 /* bytes per large page */ #define I386_LPGSHIFT 21 /* bitshift for large pages */ #define I386_LPGMASK (I386_LPGBYTES-1) /* * Convert bytes to pages and convert pages to bytes. * No rounding is used. */ #define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT)) #define machine_btop(x) i386_btop(x) #define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT) #define machine_ptob(x) i386_ptob(x) /* * Round off or truncate to the nearest page. These will work * for either addresses or counts. (i.e. 1 byte rounds to 1 page * bytes. */ #define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \ ~(I386_PGBYTES-1)) #define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1)) #define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) /* * Default top of user stack, grows down from here. * Address chosen to be 1G (3rd level page table entry) below SHARED_REGION_BASE_X86_64 * minus additional 1Meg (1/2 1st level page table coverage) to allow a redzone after it. */ #define VM_USRSTACK64 ((user_addr_t) (0x00007FF7C0000000ull - (1024 * 1024))) /* * XXX TODO: Obsolete? */ #define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) #define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) #define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) /* * the end of the usable user address space , for now about 47 bits. * the 64 bit commpage is past the end of this */ #define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL) /* * canonical end of user address space for limits checking */ #define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL) /* system-wide values */ #define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) #define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) /* process-relative values (all 32-bit legacy only for now) */ #define VM_MIN_ADDRESS ((vm_offset_t) 0) #define VM_USRSTACK32 ((vm_offset_t) 0xC0000000) /* ASLR slides stack down by up to 1 MB */ #define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000) #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_VM_PARAM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/rpc.h
/* * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ #ifndef _MACH_I386_RPC_H_ #define _MACH_I386_RPC_H_ #if defined (__i386__) || defined (__x86_64__) #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_RPC_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/thread_state.h
/* * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ #ifndef _MACH_I386_THREAD_STATE_H_ #define _MACH_I386_THREAD_STATE_H_ #if defined (__i386__) || defined (__x86_64__) /* Size of maximum exported thread state in 32-bit words */ #define I386_THREAD_STATE_MAX (614) /* Size of biggest state possible */ #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_THREAD_STATE_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/exception.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ #ifndef _MACH_I386_EXCEPTION_H_ #define _MACH_I386_EXCEPTION_H_ #if defined (__i386__) || defined (__x86_64__) /* * No machine dependent types for the 80386 */ #define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */ /* * Codes and subcodes for 80386 exceptions. */ #define EXCEPTION_CODE_MAX 2 /* currently code and subcode */ /* * EXC_BAD_INSTRUCTION */ #define EXC_I386_INVOP 1 /* * EXC_ARITHMETIC */ #define EXC_I386_DIV 1 #define EXC_I386_INTO 2 #define EXC_I386_NOEXT 3 #define EXC_I386_EXTOVR 4 #define EXC_I386_EXTERR 5 #define EXC_I386_EMERR 6 #define EXC_I386_BOUND 7 #define EXC_I386_SSEEXTERR 8 /* * EXC_SOFTWARE * Note: 0x10000-0x10003 in use for unix signal */ /* * EXC_BAD_ACCESS */ /* * EXC_BREAKPOINT */ #define EXC_I386_SGL 1 #define EXC_I386_BPT 2 #define EXC_I386_DIVERR 0 /* divide by 0 eprror */ #define EXC_I386_SGLSTP 1 /* single step */ #define EXC_I386_NMIFLT 2 /* NMI */ #define EXC_I386_BPTFLT 3 /* breakpoint fault */ #define EXC_I386_INTOFLT 4 /* INTO overflow fault */ #define EXC_I386_BOUNDFLT 5 /* BOUND instruction fault */ #define EXC_I386_INVOPFLT 6 /* invalid opcode fault */ #define EXC_I386_NOEXTFLT 7 /* extension not available fault*/ #define EXC_I386_DBLFLT 8 /* double fault */ #define EXC_I386_EXTOVRFLT 9 /* extension overrun fault */ #define EXC_I386_INVTSSFLT 10 /* invalid TSS fault */ #define EXC_I386_SEGNPFLT 11 /* segment not present fault */ #define EXC_I386_STKFLT 12 /* stack fault */ #define EXC_I386_GPFLT 13 /* general protection fault */ #define EXC_I386_PGFLT 14 /* page fault */ #define EXC_I386_EXTERRFLT 16 /* extension error fault */ #define EXC_I386_ALIGNFLT 17 /* Alignment fault */ #define EXC_I386_ENDPERR 33 /* emulated extension error flt */ #define EXC_I386_ENOEXTFLT 32 /* emulated ext not present */ /* * machine dependent exception masks */ #define EXC_MASK_MACHINE 0 #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_EXCEPTION_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/kern_return.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: kern_return.h * Author: Avadis Tevanian, Jr., Michael Wayne Young * Date: 1985 * * Machine-dependent kernel return definitions. */ #ifndef _MACH_I386_KERN_RETURN_H_ #define _MACH_I386_KERN_RETURN_H_ #if defined (__i386__) || defined (__x86_64__) #ifndef ASSEMBLER typedef int kern_return_t; #endif /* ASSEMBLER */ #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_KERN_RETURN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/asm.h
/* * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ #ifndef _I386_ASM_H_ #define _I386_ASM_H_ #if defined (__i386__) || defined (__x86_64__) #if defined(__i386__) #define S_PC (%esp) #define S_ARG0 4(%esp) #define S_ARG1 8(%esp) #define S_ARG2 12(%esp) #define S_ARG3 16(%esp) #define S_ARG4 20(%esp) #define FRAME pushl %ebp; movl %esp, %ebp #define EMARF leave #define B_LINK (%ebp) #define B_PC 4(%ebp) #define B_ARG0 8(%ebp) #define B_ARG1 12(%ebp) #define B_ARG2 16(%ebp) #define B_ARG3 20(%ebp) #elif defined(__x86_64__) #define S_PC (%rsp) #define FRAME pushq %rbp; movq %rsp, %rbp #define EMARF leave #define B_LINK (%rbp) #define B_PC 8(%rbp) #else #error unsupported architecture #endif /* There is another definition of ALIGN for .c sources */ #ifdef __ASSEMBLER__ #define ALIGN 4,0x90 #endif /* __ASSEMBLER__ */ #ifndef FALIGN #define FALIGN ALIGN #endif #define LB(x,n) n #if __STDC__ #ifndef __NO_UNDERSCORES__ #define LCL(x) L ## x #define EXT(x) _ ## x #define LEXT(x) _ ## x ## : #else #define LCL(x) .L ## x #define EXT(x) x #define LEXT(x) x ## : #endif #define LBc(x,n) n ## : #define LBb(x,n) n ## b #define LBf(x,n) n ## f #else /* __STDC__ */ #ifndef __NO_UNDERSCORES__ #define LCL(x) L/**/x #define EXT(x) _/**/x #define LEXT(x) _/**/x/**/: #else /* __NO_UNDERSCORES__ */ #define LCL(x) .L/**/x #define EXT(x) x #define LEXT(x) x/**/: #endif /* __NO_UNDERSCORES__ */ #define LBc(x,n) n/**/: #define LBb(x,n) n/**/b #define LBf(x,n) n/**/f #endif /* __STDC__ */ #define SVC .byte 0x9a; .long 0; .word 0x7 #define RPC_SVC .byte 0x9a; .long 0; .word 0xf #define String .asciz #define Value .word #define Times(a,b) (a*b) #define Divide(a,b) (a/b) #define INB inb %dx, %al #define OUTB outb %al, %dx #define INL inl %dx, %eax #define OUTL outl %eax, %dx #define data16 .byte 0x66 #define addr16 .byte 0x67 #define MCOUNT #if defined(__SHARED__) #define MCOUNT ; .data;\ .align ALIGN;\ LBc(x, 8) .long 0;\ .text;\ Gpush;\ Gload;\ leal Gotoff(LBb(x,8)),%edx;\ Egaddr(%eax,_mcount_ptr);\ Gpop;\ call *(%eax); #endif /* __SHARED__ */ #ifdef __ELF__ #define ELF_FUNC(x) .type x,@function #define ELF_DATA(x) .type x,@object #define ELF_SIZE(x,s) .size x,s #else #define ELF_FUNC(x) #define ELF_DATA(x) #define ELF_SIZE(x,s) #endif #define Entry(x) .globl EXT(x); ELF_FUNC(EXT(x)); .align FALIGN; LEXT(x) #define ENTRY(x) Entry(x) MCOUNT #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ ELF_FUNC(EXT(x)); ELF_FUNC(EXT(y)); \ .align FALIGN; LEXT(x); LEXT(y) \ MCOUNT #if __STDC__ #define ASENTRY(x) .globl x; .align FALIGN; x ## : ELF_FUNC(x) MCOUNT #else #define ASENTRY(x) .globl x; .align FALIGN; x: ELF_FUNC(x) MCOUNT #endif /* __STDC__ */ #define DATA(x) .globl EXT(x); ELF_DATA(EXT(x)); .align ALIGN; LEXT(x) #define End(x) ELF_SIZE(x,.-x) #define END(x) End(EXT(x)) #define ENDDATA(x) END(x) #define Enddata(x) End(x) /* * ELF shared library accessor macros. * Gpush saves the %ebx register used for the GOT address * Gpop pops %ebx if we need a GOT * Gload loads %ebx with the GOT address if shared libraries are used * Gcall calls an external function. * Gotoff allows you to reference local labels. * Gotoff2 allows you to reference local labels with an index reg. * Gotoff3 allows you to reference local labels with an index reg & size. * Gaddr loads up a register with an address of an external item. * Gstack is the number of bytes that Gpush pushes on the stack. * * Varients of the above with E or L prefixes do EXT(name) or LCL(name) * respectively. */ #ifndef __SHARED__ #define Gpush #define Gpop #define Gload #define Gcall(func) call func #define Gotoff(lab) lab #define Gotoff2(l,r) l(r) #define Gotoff3(l,r,s) l(,r,s) #define Gaddr(to,lab) movl $lab,to #define Gcmp(lab,reg) cmpl $lab,reg #define Gmemload(lab,reg) movl lab,reg #define Gmemstore(reg,lab,tmp) movl reg,lab #define Gstack 0 #else #ifdef __ELF__ /* ELF shared libraries */ #define Gpush pushl %ebx #define Gpop popl %ebx #define Gload call 9f; 9: popl %ebx; addl $_GLOBAL_OFFSET_TABLE_+[.-9b],%ebx #define Gcall(func) call EXT(func)@PLT #define Gotoff(lab) lab@GOTOFF(%ebx) #define Gotoff2(l,r) l@GOTOFF(%ebx,r) #define Gotoff3(l,r,s) l@GOTOFF(%ebx,r,s) #define Gaddr(to,lab) movl lab@GOT(%ebx),to #define Gcmp(lab,reg) cmpl reg,lab@GOT(%ebx) #define Gmemload(lab,reg) movl lab@GOT(%ebx),reg; movl (reg),reg #define Gmemstore(reg,lab,tmp) movl lab@GOT(%ebx),tmp; movl reg,(tmp) #define Gstack 4 #else /* ROSE shared libraries */ #define Gpush #define Gpop #define Gload #define Gcall(func) call *9f; .data; .align ALIGN; 9: .long func; .text #define Gotoff(lab) lab #define Gotoff2(l,r) l(r) #define Gotoff3(l,r,s) l(,r,s) #define Gaddr(to,lab) movl 9f,to; .data; .align ALIGN; 9: .long lab; .text #define Gcmp(lab,reg) cmpl reg,9f; .data; .align ALIGN; 9: .long lab; .text #define Gmemload(lab,reg) movl 9f,reg; movl (reg),reg; .data; .align ALIGN; 9: .long lab; .text #define Gmemstore(reg,lab,tmp) movl 9f,tmp; movl reg,(tmp); .data; .align ALIGN; 9: .long lab; .text #define Gstack 0 #endif /* __ELF__ */ #endif /* __SHARED__ */ /* Egotoff is not provided, since external symbols should not use @GOTOFF relocations. */ #define Egcall(func) Gcall(EXT(func)) #define Egaddr(to,lab) Gaddr(to,EXT(lab)) #define Egcmp(lab,reg) Gcmp(EXT(lab),reg) #define Egmemload(lab,reg) Gmemload(EXT(lab),reg) #define Egmemstore(reg,lab,tmp) Gmemstore(reg,EXT(lab),tmp) #define Lgotoff(lab) Gotoff(LCL(lab)) #define Lgotoff2(l,r) Gotoff2(LCL(l),r) #define Lgotoff3(l,r,s) Gotoff3(LCL(l),r,s) #define Lgcmp(lab,reg) Gcmp(LCL(lab),reg) #define Lgmemload(lab,reg) movl Lgotoff(lab),reg #define Lgmemstore(reg,lab,tmp) movl reg,Lgotoff(lab) #ifndef __ASSEMBLER__ /* These defines are here for .c files that wish to reference global symbols * within __asm__ statements. */ #ifndef __NO_UNDERSCORES__ #define CC_SYM_PREFIX "_" #else #define CC_SYM_PREFIX "" #endif /* __NO_UNDERSCORES__ */ #endif /* __ASSEMBLER__ */ /* * The following macros make calls into C code. * They dynamically align the stack to 16 bytes. */ #if defined(__i386__) /* * Arguments are moved (not pushed) onto the correctly aligned stack. * NOTE: ESI is destroyed in the process, and hence cannot * be directly used as a parameter. Users of this macro must * independently preserve ESI (a non-volatile) if the routine is * intended to be called from C, for instance. */ #define CCALL(fn) \ movl %esp, %esi ;\ andl $0xFFFFFFF0, %esp ;\ call EXT(fn) ;\ movl %esi, %esp #define CCALL1(fn, arg1) \ movl %esp, %esi ;\ subl $4, %esp ;\ andl $0xFFFFFFF0, %esp ;\ movl arg1, (%esp) ;\ call EXT(fn) ;\ movl %esi, %esp #define CCALL2(fn, arg1, arg2) \ movl %esp, %esi ;\ subl $8, %esp ;\ andl $0xFFFFFFF0, %esp ;\ movl arg2, 4(%esp) ;\ movl arg1, (%esp) ;\ call EXT(fn) ;\ movl %esi, %esp /* This variant exists to permit adjustment of the stack by "dtrace" */ #define CCALL1WITHSP(fn, arg1) \ movl %esp, %esi ;\ subl $12, %esp ;\ andl $0xFFFFFFF0, %esp ;\ movl %esi, 8(%esp) ;\ leal 8(%esp), %esi ;\ movl %esi, 4(%esp) ;\ movl arg1, (%esp) ;\ call EXT(fn) ;\ movl 8(%esp), %esp /* * CCALL5 is used for callee functions with 3 arguments but * where arg2 (a3:a2) and arg3 (a5:a4) are 64-bit values. */ #define CCALL5(fn, a1, a2, a3, a4, a5) \ movl %esp, %esi ;\ subl $20, %esp ;\ andl $0xFFFFFFF0, %esp ;\ movl a5, 16(%esp) ;\ movl a4, 12(%esp) ;\ movl a3, 8(%esp) ;\ movl a2, 4(%esp) ;\ movl a1, (%esp) ;\ call EXT(fn) ;\ movl %esi, %esp #elif defined(__x86_64__) /* This variant exists to permit adjustment of the stack by "dtrace" */ #define CCALLWITHSP(fn) \ mov %rsp, %r12 ;\ sub $8, %rsp ;\ and $0xFFFFFFFFFFFFFFF0, %rsp ;\ mov %r12, (%rsp) ;\ leaq (%rsp), %rsi ;\ call EXT(fn) ;\ mov (%rsp), %rsp #define CCALL(fn) \ mov %rsp, %r12 ;\ and $0xFFFFFFFFFFFFFFF0, %rsp ;\ call EXT(fn) ;\ mov %r12, %rsp #define CCALL1(fn, arg1) \ mov arg1, %rdi ;\ CCALL(fn) #define CCALL2(fn, arg1, arg2) \ mov arg1, %rdi ;\ mov arg2, %rsi ;\ CCALL(fn) #define CCALL3(fn, arg1, arg2, arg3) \ mov arg1, %rdi ;\ mov arg2, %rsi ;\ mov arg3, %rdx ;\ CCALL(fn) #else #error unsupported architecture #endif #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _I386_ASM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/vm_types.h
/* * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: vm_types.h * Author: Avadis Tevanian, Jr. * Date: 1985 * * Header file for VM data types. I386 version. */ #ifndef _MACH_I386_VM_TYPES_H_ #define _MACH_I386_VM_TYPES_H_ #if defined (__i386__) || defined (__x86_64__) #ifndef ASSEMBLER #include <i386/_types.h> #include <stdint.h> #include <sys/cdefs.h> /* * natural_t and integer_t are Mach's legacy types for machine- * independent integer types (unsigned, and signed, respectively). * Their original purpose was to define other types in a machine/ * compiler independent way. * * They also had an implicit "same size as pointer" characteristic * to them (i.e. Mach's traditional types are very ILP32 or ILP64 * centric). We support x86 ABIs that do not follow either of * these models (specifically LP64). Therefore, we had to make a * choice between making these types scale with pointers or stay * tied to integers. Because their use is predominantly tied to * to the size of an integer, we are keeping that association and * breaking free from pointer size guarantees. * * New use of these types is discouraged. */ typedef __darwin_natural_t natural_t; typedef int integer_t; /* * A vm_offset_t is a type-neutral pointer, * e.g. an offset into a virtual memory space. */ #ifdef __LP64__ typedef uintptr_t vm_offset_t __kernel_ptr_semantics; #else /* __LP64__ */ typedef natural_t vm_offset_t __kernel_ptr_semantics; #endif /* __LP64__ */ /* * A vm_size_t is the proper type for e.g. * expressing the difference between two * vm_offset_t entities. */ #ifdef __LP64__ typedef uintptr_t vm_size_t; #else /* __LP64__ */ typedef natural_t vm_size_t; #endif /* __LP64__ */ /* * This new type is independent of a particular vm map's * implementation size - and represents appropriate types * for all possible maps. This is used for interfaces * where the size of the map is not known - or we don't * want to have to distinguish. */ typedef uint64_t mach_vm_address_t __kernel_ptr_semantics; typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics; typedef uint64_t mach_vm_size_t; typedef uint64_t vm_map_offset_t __kernel_ptr_semantics; typedef uint64_t vm_map_address_t __kernel_ptr_semantics; typedef uint64_t vm_map_size_t; typedef mach_vm_address_t mach_port_context_t; #endif /* ASSEMBLER */ /* * If composing messages by hand (please do not) */ #define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_VM_TYPES_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/boolean.h
/* * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: boolean.h * * Boolean type, for I386. */ #ifndef _MACH_I386_BOOLEAN_H_ #define _MACH_I386_BOOLEAN_H_ #if defined (__i386__) || defined (__x86_64__) typedef int boolean_t; #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_BOOLEAN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/processor_info.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * File: mach/i386/processor_info.h * * Data structure definitions for i386 specific processor control */ #ifndef _MACH_I386_PROCESSOR_INFO_H_ #define _MACH_I386_PROCESSOR_INFO_H_ #if defined (__i386__) || defined (__x86_64__) #endif /* defined (__i386__) || defined (__x86_64__) */ #endif /* _MACH_I386_PROCESSOR_INFO_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/i386/ndr_def.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* NDR record for Intel x86s */ #include <mach/ndr.h> NDR_record_t NDR_record = { 0, /* mig_reserved */ 0, /* mig_reserved */ 0, /* mig_reserved */ NDR_PROTOCOL_2_0, NDR_INT_LITTLE_ENDIAN, NDR_CHAR_ASCII, NDR_FLOAT_IEEE, 0, };
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/_structs.h
/* * Copyright (c) 2004-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ #ifndef _MACH_ARM__STRUCTS_H_ #define _MACH_ARM__STRUCTS_H_ #if defined (__arm__) || defined (__arm64__) #include <sys/cdefs.h> /* __DARWIN_UNIX03 */ #include <machine/types.h> /* __uint32_t */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_EXCEPTION_STATE struct __darwin_arm_exception_state _STRUCT_ARM_EXCEPTION_STATE { __uint32_t __exception; /* number of arm exception taken */ __uint32_t __fsr; /* Fault status */ __uint32_t __far; /* Virtual Fault Address */ }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_EXCEPTION_STATE struct arm_exception_state _STRUCT_ARM_EXCEPTION_STATE { __uint32_t exception; /* number of arm exception taken */ __uint32_t fsr; /* Fault status */ __uint32_t far; /* Virtual Fault Address */ }; #endif /* __DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_EXCEPTION_STATE64 struct __darwin_arm_exception_state64 _STRUCT_ARM_EXCEPTION_STATE64 { __uint64_t __far; /* Virtual Fault Address */ __uint32_t __esr; /* Exception syndrome */ __uint32_t __exception; /* number of arm exception taken */ }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64 _STRUCT_ARM_EXCEPTION_STATE64 { __uint64_t far; /* Virtual Fault Address */ __uint32_t esr; /* Exception syndrome */ __uint32_t exception; /* number of arm exception taken */ }; #endif /* __DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_THREAD_STATE struct __darwin_arm_thread_state _STRUCT_ARM_THREAD_STATE { __uint32_t __r[13]; /* General purpose register r0-r12 */ __uint32_t __sp; /* Stack pointer r13 */ __uint32_t __lr; /* Link register r14 */ __uint32_t __pc; /* Program counter r15 */ __uint32_t __cpsr; /* Current program status register */ }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_THREAD_STATE struct arm_thread_state _STRUCT_ARM_THREAD_STATE { __uint32_t r[13]; /* General purpose register r0-r12 */ __uint32_t sp; /* Stack pointer r13 */ __uint32_t lr; /* Link register r14 */ __uint32_t pc; /* Program counter r15 */ __uint32_t cpsr; /* Current program status register */ }; #endif /* __DARWIN_UNIX03 */ #define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0 #define __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH 0x1 #define __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR 0x2 #define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64 _STRUCT_ARM_THREAD_STATE64 { __uint64_t x[29]; /* General purpose registers x0-x28 */ __uint64_t fp; /* Frame pointer x29 */ __uint64_t lr; /* Link register x30 */ __uint64_t sp; /* Stack pointer x31 */ __uint64_t pc; /* Program counter */ __uint32_t cpsr; /* Current program status register */ __uint32_t flags; /* Flags describing structure format */ }; #if __DARWIN_UNIX03 #define _STRUCT_ARM_VFP_STATE struct __darwin_arm_vfp_state _STRUCT_ARM_VFP_STATE { __uint32_t __r[64]; __uint32_t __fpscr; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_VFP_STATE struct arm_vfp_state _STRUCT_ARM_VFP_STATE { __uint32_t r[64]; __uint32_t fpscr; }; #endif /* __DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_NEON_STATE64 struct __darwin_arm_neon_state64 #define _STRUCT_ARM_NEON_STATE struct __darwin_arm_neon_state #if defined(__arm64__) _STRUCT_ARM_NEON_STATE64 { __uint128_t __v[32]; __uint32_t __fpsr; __uint32_t __fpcr; }; _STRUCT_ARM_NEON_STATE { __uint128_t __v[16]; __uint32_t __fpsr; __uint32_t __fpcr; }; #elif defined(__arm__) /* * No 128-bit intrinsic for ARM; leave it opaque for now. */ _STRUCT_ARM_NEON_STATE64 { char opaque[(32 * 16) + (2 * sizeof(__uint32_t))]; } __attribute__((aligned(16))); _STRUCT_ARM_NEON_STATE { char opaque[(16 * 16) + (2 * sizeof(__uint32_t))]; } __attribute__((aligned(16))); #else #error Unknown architecture. #endif #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64 #define _STRUCT_ARM_NEON_STATE struct arm_neon_state #if defined(__arm64__) _STRUCT_ARM_NEON_STATE64 { __uint128_t q[32]; uint32_t fpsr; uint32_t fpcr; }; _STRUCT_ARM_NEON_STATE { __uint128_t q[16]; uint32_t fpsr; uint32_t fpcr; }; #elif defined(__arm__) /* * No 128-bit intrinsic for ARM; leave it opaque for now. */ _STRUCT_ARM_NEON_STATE64 { char opaque[(32 * 16) + (2 * sizeof(__uint32_t))]; } __attribute__((aligned(16))); _STRUCT_ARM_NEON_STATE { char opaque[(16 * 16) + (2 * sizeof(__uint32_t))]; } __attribute__((aligned(16))); #else #error Unknown architecture. #endif #endif /* __DARWIN_UNIX03 */ #define _STRUCT_ARM_PAGEIN_STATE struct __arm_pagein_state _STRUCT_ARM_PAGEIN_STATE { int __pagein_error; }; /* * Debug State */ #if defined(__arm__) /* Old-fashioned debug state is only for ARM */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_DEBUG_STATE struct __darwin_arm_debug_state _STRUCT_ARM_DEBUG_STATE { __uint32_t __bvr[16]; __uint32_t __bcr[16]; __uint32_t __wvr[16]; __uint32_t __wcr[16]; }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_DEBUG_STATE struct arm_debug_state _STRUCT_ARM_DEBUG_STATE { __uint32_t bvr[16]; __uint32_t bcr[16]; __uint32_t wvr[16]; __uint32_t wcr[16]; }; #endif /* __DARWIN_UNIX03 */ #elif defined(__arm64__) /* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_LEGACY_DEBUG_STATE struct __arm_legacy_debug_state _STRUCT_ARM_LEGACY_DEBUG_STATE { __uint32_t __bvr[16]; __uint32_t __bcr[16]; __uint32_t __wvr[16]; __uint32_t __wcr[16]; }; #else /* __DARWIN_UNIX03 */ #define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state _STRUCT_ARM_LEGACY_DEBUG_STATE { __uint32_t bvr[16]; __uint32_t bcr[16]; __uint32_t wvr[16]; __uint32_t wcr[16]; }; #endif /* __DARWIN_UNIX03 */ #else #error unknown architecture #endif #if __DARWIN_UNIX03 #define _STRUCT_ARM_DEBUG_STATE32 struct __darwin_arm_debug_state32 _STRUCT_ARM_DEBUG_STATE32 { __uint32_t __bvr[16]; __uint32_t __bcr[16]; __uint32_t __wvr[16]; __uint32_t __wcr[16]; __uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ }; #define _STRUCT_ARM_DEBUG_STATE64 struct __darwin_arm_debug_state64 _STRUCT_ARM_DEBUG_STATE64 { __uint64_t __bvr[16]; __uint64_t __bcr[16]; __uint64_t __wvr[16]; __uint64_t __wcr[16]; __uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ }; #else /* !__DARWIN_UNIX03 */ #define _STRUCT_ARM_DEBUG_STATE32 struct arm_debug_state32 _STRUCT_ARM_DEBUG_STATE32 { __uint32_t bvr[16]; __uint32_t bcr[16]; __uint32_t wvr[16]; __uint32_t wcr[16]; __uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ }; #define _STRUCT_ARM_DEBUG_STATE64 struct arm_debug_state64 _STRUCT_ARM_DEBUG_STATE64 { __uint64_t bvr[16]; __uint64_t bcr[16]; __uint64_t wvr[16]; __uint64_t wcr[16]; __uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ }; #endif /* __DARWIN_UNIX03 */ #if __DARWIN_UNIX03 #define _STRUCT_ARM_CPMU_STATE64 struct __darwin_arm_cpmu_state64 _STRUCT_ARM_CPMU_STATE64 { __uint64_t __ctrs[16]; }; #else /* __DARWIN_UNIX03 */ #define _STRUCT_ARM_CPMU_STATE64 struct arm_cpmu_state64 _STRUCT_ARM_CPMU_STATE64 { __uint64_t ctrs[16]; }; #endif /* !__DARWIN_UNIX03 */ #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM__STRUCTS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/sdt_isa.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. */ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _MACH_ARM_SDT_ISA_H #define _MACH_ARM_SDT_ISA_H #if defined (__arm__) || defined (__arm64__) /* * Only define when testing. This makes the calls into actual calls to * test functions. */ /* #define DTRACE_CALL_TEST */ #define DTRACE_STRINGIFY(s) #s #define DTRACE_TOSTRING(s) DTRACE_STRINGIFY(s) /* * For the kernel, set an explicit global label so the symbol can be located */ #if defined(__arm__) #define DTRACE_LABEL(p, n) \ ".pushsection __DATA, __sdt_cstring, cstring_literals\n\t" \ "1: .ascii \"" DTRACE_STRINGIFY(p##___) "\\0\"\n\t" \ "2: .ascii \"" DTRACE_STRINGIFY(n) "\\0\"\n\t" \ ".popsection" "\n\t" \ ".pushsection __DATA, __sdt, regular, live_support\n\t" \ ".p2align 2\n\t" \ "l3_%=:\n\t" \ ".long 4f""\n\t" \ ".long 1b""\n\t" \ ".long 2b""\n\t" \ ".popsection" "\n\t" \ "4:" #elif defined(__arm64__) #if (__SIZEOF_POINTER__ == 8) #define DTRACE_LABEL(p, n) \ ".pushsection __DATA, __sdt_cstring, cstring_literals\n\t" \ "1: .ascii \"" DTRACE_STRINGIFY(p##___) "\\0\"\n\t" \ "2: .ascii \"" DTRACE_STRINGIFY(n) "\\0\"\n\t" \ ".popsection" "\n\t" \ ".pushsection __DATA, __sdt, regular, live_support\n\t" \ ".p2align 3\n\t" \ "l3_%=:\n\t" \ ".quad 4f""\n\t" \ ".quad 1b""\n\t" \ ".quad 2b""\n\t" \ ".popsection" "\n\t" \ "4:" #else /* Not supported on arm64_32 */ #define DTRACE_LABEL(p, n) #endif /* __SIZEOF_POINTER__ == 8 */ #else #error "Unsupported architecture for SDT probes" #endif /* __arm__ */ #ifdef DTRACE_CALL_TEST #define DTRACE_CALL(p, n) \ DTRACE_LABEL(p,n) \ DTRACE_CALL_INSN(p,n) #else /* !DTRACE_CALL_TEST */ #define DTRACE_CALL(p, n) \ DTRACE_LABEL(p,n) \ DTRACE_NOPS #endif /* !DTRACE_CALL_TEST */ #if defined(__arm__) #define DTRACE_NOPS \ "nop" "\n\t" #define DTRACE_CALL_INSN(p, n) \ "blx _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" #ifdef __thumb__ #define DTRACE_ALLOC_STACK(n) \ "sub sp, #" #n "\n\t" #define DTRACE_DEALLOC_STACK(n) \ "add sp, #" #n "\n\t" #else #define DTRACE_ALLOC_STACK(n) \ "sub sp, sp, #" #n "\n\t" #define DTRACE_DEALLOC_STACK(n) \ "add sp, sp, #" #n "\n\t" #endif #define ARG1_EXTENT 1 #define ARGS2_EXTENT 2 #define ARGS3_EXTENT 3 #define ARGS4_EXTENT 4 #define ARGS5_EXTENT 5 #define ARGS6_EXTENT 6 #define ARGS7_EXTENT 7 #define ARGS8_EXTENT 8 #define ARGS9_EXTENT 9 #define ARGS10_EXTENT 10 #define DTRACE_CALL0ARGS(provider, name) \ asm volatile ( \ DTRACE_CALL(provider, name) \ "# eat trailing nl+tab from DTRACE_CALL" \ : \ : \ ); #define DTRACE_CALL1ARG(provider, name) \ asm volatile ("ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "l" (__dtrace_args) \ : "memory", "r0" \ ); #define DTRACE_CALL2ARGS(provider, name) \ asm volatile ("ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1" \ ); #define DTRACE_CALL3ARGS(provider, name) \ asm volatile ("ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2" \ ); #define DTRACE_CALL4ARGS(provider, name) \ asm volatile ("ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); /* * One of our ARM32 ABIs (armv7k) mandates that the stack be aligned to 16 bytes. * We currently apply this constraint to all ARM32 DTRACE_CALL macros; hence the * macros below will overallocate for some ABIs. */ #define DTRACE_CALL5ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(16) \ "ldr r0, [%0, #16]" "\n\t" \ "str r0, [sp]" "\n\t" \ "ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(16) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); #define DTRACE_CALL6ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(16) \ "ldr r1, [%0, #20]" "\n\t" \ "ldr r0, [%0, #16]" "\n\t" \ "str r1, [sp, #4]" "\n\t" \ "str r0, [sp]" "\n\t" \ "ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(16) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); #define DTRACE_CALL7ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(16) \ "ldr r2, [%0, #24]" "\n\t" \ "ldr r1, [%0, #20]" "\n\t" \ "ldr r0, [%0, #16]" "\n\t" \ "str r2, [sp, #8]" "\n\t" \ "str r1, [sp, #4]" "\n\t" \ "str r0, [sp]" "\n\t" \ "ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(16) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); #define DTRACE_CALL8ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(16) \ "ldr r3, [%0, #28]" "\n\t" \ "ldr r2, [%0, #24]" "\n\t" \ "ldr r1, [%0, #20]" "\n\t" \ "ldr r0, [%0, #16]" "\n\t" \ "str r3, [sp, #12]" "\n\t" \ "str r2, [sp, #8]" "\n\t" \ "str r1, [sp, #4]" "\n\t" \ "str r0, [sp]" "\n\t" \ "ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(16) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); #define DTRACE_CALL9ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(32) \ "ldr r0, [%0, #32]" "\n\t" \ "str r0, [sp, #16]" "\n\t" \ "ldr r3, [%0, #28]" "\n\t" \ "ldr r2, [%0, #24]" "\n\t" \ "ldr r1, [%0, #20]" "\n\t" \ "ldr r0, [%0, #16]" "\n\t" \ "str r3, [sp, #12]" "\n\t" \ "str r2, [sp, #8]" "\n\t" \ "str r1, [sp, #4]" "\n\t" \ "str r0, [sp]" "\n\t" \ "ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(32) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); #define DTRACE_CALL10ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(32) \ "ldr r1, [%0, #36]" "\n\t" \ "ldr r0, [%0, #32]" "\n\t" \ "str r1, [sp, #20]" "\n\t" \ "str r0, [sp, #16]" "\n\t" \ "ldr r3, [%0, #28]" "\n\t" \ "ldr r2, [%0, #24]" "\n\t" \ "ldr r1, [%0, #20]" "\n\t" \ "ldr r0, [%0, #16]" "\n\t" \ "str r3, [sp, #12]" "\n\t" \ "str r2, [sp, #8]" "\n\t" \ "str r1, [sp, #4]" "\n\t" \ "str r0, [sp]" "\n\t" \ "ldr r3, [%0, #12]" "\n\t" \ "ldr r2, [%0, #8]" "\n\t" \ "ldr r1, [%0, #4]" "\n\t" \ "ldr r0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(32) \ : \ : "l" (__dtrace_args) \ : "memory", "r0", "r1", "r2", "r3" \ ); #elif defined(__arm64__) #define DTRACE_NOPS \ "nop" "\n\t" #define DTRACE_CALL_INSN(p, n) \ "bl _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" #define DTRACE_ALLOC_STACK(n) \ "sub sp, sp, #" #n "\n\t" #define DTRACE_DEALLOC_STACK(n) \ "add sp, sp, #" #n "\n\t" #define ARG1_EXTENT 1 #define ARGS2_EXTENT 2 #define ARGS3_EXTENT 3 #define ARGS4_EXTENT 4 #define ARGS5_EXTENT 5 #define ARGS6_EXTENT 6 #define ARGS7_EXTENT 7 #define ARGS8_EXTENT 8 #define ARGS9_EXTENT 9 #define ARGS10_EXTENT 10 #define DTRACE_CALL0ARGS(provider, name) \ asm volatile ( \ DTRACE_CALL(provider, name) \ "# eat trailing nl+tab from DTRACE_CALL" \ : \ : \ ); #define DTRACE_CALL1ARG(provider, name) \ asm volatile ("ldr x0, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0" \ ); #define DTRACE_CALL2ARGS(provider, name) \ asm volatile ("ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1" \ ); #define DTRACE_CALL3ARGS(provider, name) \ asm volatile ("ldr x2, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2" \ ); #define DTRACE_CALL4ARGS(provider, name) \ asm volatile ("ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3" \ ); #define DTRACE_CALL5ARGS(provider, name) \ asm volatile ("ldr x4, [%0, #32]" "\n\t" \ "ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3", "x4" \ ); #define DTRACE_CALL6ARGS(provider, name) \ asm volatile ("ldp x4, x5, [%0, #32]" "\n\t" \ "ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3", "x4", "x5" \ ); #define DTRACE_CALL7ARGS(provider, name) \ asm volatile ("ldr x6, [%0, #48]" "\n\t" \ "ldp x4, x5, [%0, #32]" "\n\t" \ "ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3", "x4", "x5", "x6" \ ); #define DTRACE_CALL8ARGS(provider, name) \ asm volatile ("ldp x6, x7, [%0, #48]" "\n\t" \ "ldp x4, x5, [%0, #32]" "\n\t" \ "ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" \ ); /* Keep stack 16 byte aligned per ABI requirements */ #define DTRACE_CALL9ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(16) \ "ldr x0, [%0, #64]" "\n\t" \ "str x0, [sp]" "\n\t" \ "ldp x6, x7, [%0, #48]" "\n\t" \ "ldp x4, x5, [%0, #32]" "\n\t" \ "ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(16) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" \ ); #define DTRACE_CALL10ARGS(provider, name) \ asm volatile ( \ DTRACE_ALLOC_STACK(16) \ "ldp x0, x1, [%0, #64]" "\n\t" \ "stp x0, x1, [sp]" "\n\t" \ "ldp x6, x7, [%0, #48]" "\n\t" \ "ldp x4, x5, [%0, #32]" "\n\t" \ "ldp x2, x3, [%0, #16]" "\n\t" \ "ldp x0, x1, [%0]" "\n\t" \ DTRACE_CALL(provider, name) \ DTRACE_DEALLOC_STACK(16) \ : \ : "r" (__dtrace_args) \ : "memory", "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" \ ); #endif /* __arm__ */ #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_SDT_ISA_H */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/thread_status.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * FILE_ID: thread_status.h */ #ifndef _ARM_THREAD_STATUS_H_ #define _ARM_THREAD_STATUS_H_ #if defined (__arm__) || defined (__arm64__) #include <mach/machine/_structs.h> #include <mach/machine/thread_state.h> #include <mach/message.h> #include <mach/vm_types.h> /* * Support for determining the state of a thread */ /* * Flavors */ #define ARM_THREAD_STATE 1 #define ARM_UNIFIED_THREAD_STATE ARM_THREAD_STATE #define ARM_VFP_STATE 2 #define ARM_EXCEPTION_STATE 3 #define ARM_DEBUG_STATE 4 /* pre-armv8 */ #define THREAD_STATE_NONE 5 #define ARM_THREAD_STATE64 6 #define ARM_EXCEPTION_STATE64 7 // ARM_THREAD_STATE_LAST 8 /* legacy */ #define ARM_THREAD_STATE32 9 /* API */ #define ARM_DEBUG_STATE32 14 #define ARM_DEBUG_STATE64 15 #define ARM_NEON_STATE 16 #define ARM_NEON_STATE64 17 #define ARM_CPMU_STATE64 18 #define ARM_PAGEIN_STATE 27 #ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID #define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0 #endif #define VALID_THREAD_STATE_FLAVOR(x) \ ((x == ARM_THREAD_STATE) || \ (x == ARM_VFP_STATE) || \ (x == ARM_EXCEPTION_STATE) || \ (x == ARM_DEBUG_STATE) || \ (x == THREAD_STATE_NONE) || \ (x == ARM_THREAD_STATE32) || \ (x == ARM_THREAD_STATE64) || \ (x == ARM_EXCEPTION_STATE64) || \ (x == ARM_NEON_STATE) || \ (x == ARM_NEON_STATE64) || \ (x == ARM_DEBUG_STATE32) || \ (x == ARM_DEBUG_STATE64) || \ (x == ARM_PAGEIN_STATE) || \ (ARM_STATE_FLAVOR_IS_OTHER_VALID(x))) struct arm_state_hdr { uint32_t flavor; uint32_t count; }; typedef struct arm_state_hdr arm_state_hdr_t; typedef _STRUCT_ARM_THREAD_STATE arm_thread_state_t; typedef _STRUCT_ARM_THREAD_STATE arm_thread_state32_t; typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t; struct arm_unified_thread_state { arm_state_hdr_t ash; union { arm_thread_state32_t ts_32; arm_thread_state64_t ts_64; } uts; }; #define ts_32 uts.ts_32 #define ts_64 uts.ts_64 typedef struct arm_unified_thread_state arm_unified_thread_state_t; #define ARM_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_thread_state_t)/sizeof(uint32_t))) #define ARM_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_thread_state32_t)/sizeof(uint32_t))) #define ARM_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_thread_state64_t)/sizeof(uint32_t))) #define ARM_UNIFIED_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_unified_thread_state_t)/sizeof(uint32_t))) typedef _STRUCT_ARM_VFP_STATE arm_vfp_state_t; typedef _STRUCT_ARM_NEON_STATE arm_neon_state_t; typedef _STRUCT_ARM_NEON_STATE arm_neon_state32_t; typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t; typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t; typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t; typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t; typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t; typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t; typedef _STRUCT_ARM_PAGEIN_STATE arm_pagein_state_t; /* * Otherwise not ARM64 kernel and we must preserve legacy ARM definitions of * arm_debug_state for binary compatability of userland consumers of this file. */ #if defined(__arm__) typedef _STRUCT_ARM_DEBUG_STATE arm_debug_state_t; #elif defined(__arm64__) typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t; #else /* defined(__arm__) */ #error Undefined architecture #endif /* defined(__arm__) */ #define ARM_VFP_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_vfp_state_t)/sizeof(uint32_t))) #define ARM_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_exception_state_t)/sizeof(uint32_t))) #define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_exception_state64_t)/sizeof(uint32_t))) #define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_debug_state_t)/sizeof(uint32_t))) #define ARM_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_debug_state32_t)/sizeof(uint32_t))) #define ARM_PAGEIN_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_pagein_state_t)/sizeof(uint32_t))) #define ARM_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_debug_state64_t)/sizeof(uint32_t))) #define ARM_NEON_STATE_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_neon_state_t)/sizeof(uint32_t))) #define ARM_NEON_STATE64_COUNT ((mach_msg_type_number_t) \ (sizeof (arm_neon_state64_t)/sizeof(uint32_t))) #define MACHINE_THREAD_STATE ARM_THREAD_STATE #define MACHINE_THREAD_STATE_COUNT ARM_UNIFIED_THREAD_STATE_COUNT /* * Largest state on this machine: */ #define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _ARM_THREAD_STATUS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/vm_param.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * FILE_ID: vm_param.h */ /* * ARM machine dependent virtual memory parameters. */ #ifndef _MACH_ARM_VM_PARAM_H_ #define _MACH_ARM_VM_PARAM_H_ #if defined (__arm__) || defined (__arm64__) #define BYTE_SIZE 8 /* byte size in bits */ #ifndef __ASSEMBLER__ #ifdef __arm__ #define PAGE_SHIFT_CONST 12 #elif defined(__arm64__) extern int PAGE_SHIFT_CONST; #else #error Unsupported arch #endif #define PAGE_SHIFT PAGE_SHIFT_CONST #define PAGE_SIZE (1 << PAGE_SHIFT) #define PAGE_MASK (PAGE_SIZE-1) #define VM_PAGE_SIZE PAGE_SIZE #define machine_ptob(x) ((x) << PAGE_SHIFT) /* * Defined for the purpose of testing the pmap advertised page * size; this does not necessarily match the hardware page size. */ #define TEST_PAGE_SIZE_16K ((PAGE_SHIFT_CONST == 14)) #define TEST_PAGE_SIZE_4K ((PAGE_SHIFT_CONST == 12)) #endif /* !__ASSEMBLER__ */ #define PAGE_MAX_SHIFT 14 #define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT) #define PAGE_MAX_MASK (PAGE_MAX_SIZE-1) #define PAGE_MIN_SHIFT 12 #define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT) #define PAGE_MIN_MASK (PAGE_MIN_SIZE-1) #define VM_MAX_PAGE_ADDRESS MACH_VM_MAX_ADDRESS #ifndef __ASSEMBLER__ #if defined (__arm__) #define VM_MIN_ADDRESS ((vm_address_t) 0x00000000) #define VM_MAX_ADDRESS ((vm_address_t) 0x80000000) /* system-wide values */ #define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) #define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_ADDRESS) #elif defined (__arm64__) #define VM_MIN_ADDRESS ((vm_address_t) 0x0000000000000000ULL) #define VM_MAX_ADDRESS ((vm_address_t) 0x0000000080000000ULL) /* system-wide values */ #define MACH_VM_MIN_ADDRESS_RAW 0x0ULL #define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL #define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW) #define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW) #define MACH_VM_MIN_GPU_CARVEOUT_ADDRESS_RAW 0x0000001000000000ULL #define MACH_VM_MAX_GPU_CARVEOUT_ADDRESS_RAW 0x0000007000000000ULL #define MACH_VM_MIN_GPU_CARVEOUT_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_GPU_CARVEOUT_ADDRESS_RAW) #define MACH_VM_MAX_GPU_CARVEOUT_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_GPU_CARVEOUT_ADDRESS_RAW) #else /* defined(__arm64__) */ #error architecture not supported #endif #define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS #define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS #if defined (__arm__) #define VM_KERNEL_POINTER_SIGNIFICANT_BITS 31 #define VM_MIN_KERNEL_ADDRESS ((vm_address_t) 0x80000000) #define VM_MAX_KERNEL_ADDRESS ((vm_address_t) 0xFFFEFFFF) #define VM_HIGH_KERNEL_WINDOW ((vm_address_t) 0xFFFE0000) #elif defined (__arm64__) /* * The minimum and maximum kernel address; some configurations may * constrain the address space further. */ #define TiB(x) ((0ULL + (x)) << 40) #define GiB(x) ((0ULL + (x)) << 30) // Inform kexts about largest possible kernel address space #define VM_MIN_KERNEL_ADDRESS ((vm_address_t) (0ULL - TiB(2))) #define VM_MAX_KERNEL_ADDRESS ((vm_address_t) 0xfffffffbffffffffULL) #else #error architecture not supported #endif #define VM_MIN_KERNEL_AND_KEXT_ADDRESS VM_MIN_KERNEL_ADDRESS #if defined (__arm64__) /* Top-Byte-Ignore */ #define TBI_MASK 0xff00000000000000ULL #define tbi_clear(addr) ((typeof (addr))(((uintptr_t)(addr)) &~ (TBI_MASK))) #define tbi_fill(addr) ((typeof (addr))(((uintptr_t)(addr)) | (TBI_MASK))) #endif /* __arm64__ */ #if CONFIG_KERNEL_TBI /* * 'strip' in PAC sense, therefore replacing the stripped bits sign extending * the sign bit. */ #define VM_KERNEL_TBI_FILL(_v) (tbi_fill(_v)) #define VM_KERNEL_TBI_CLEAR(_v) (tbi_clear(_v)) #define VM_KERNEL_STRIP_TBI(_v) (VM_KERNEL_TBI_FILL(_v)) #else /* CONFIG_KERNEL_TBI */ #define VM_KERNEL_TBI_FILL(_v) (_v) #define VM_KERNEL_TBI_CLEAR(_v) (_v) #define VM_KERNEL_STRIP_TBI(_v) (_v) #endif /* CONFIG_KERNE_TBI */ #if __has_feature(ptrauth_calls) #include <ptrauth.h> #define VM_KERNEL_STRIP_PAC(_v) (ptrauth_strip((void *)(uintptr_t)(_v), ptrauth_key_asia)) #else /* !ptrauth_calls */ #define VM_KERNEL_STRIP_PAC(_v) (_v) #endif /* ptrauth_calls */ #define VM_KERNEL_STRIP_PTR(_va) ((VM_KERNEL_STRIP_TBI(VM_KERNEL_STRIP_PAC(_va)))) #define VM_KERNEL_STRIP_UPTR(_va) ((vm_address_t)VM_KERNEL_STRIP_PTR((uintptr_t)(_va))) #define VM_KERNEL_ADDRESS(_va) \ ((VM_KERNEL_STRIP_UPTR(_va) >= VM_MIN_KERNEL_ADDRESS) && \ (VM_KERNEL_STRIP_UPTR(_va) <= VM_MAX_KERNEL_ADDRESS)) #endif /* !__ASSEMBLER__ */ #define SWI_SYSCALL 0x80 #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_VM_PARAM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/rpc.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ #ifndef _MACH_ARM_RPC_H_ #define _MACH_ARM_RPC_H_ #if defined (__arm__) || defined (__arm64__) #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_RPC_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/thread_state.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ #ifndef _MACH_ARM_THREAD_STATE_H_ #define _MACH_ARM_THREAD_STATE_H_ #if defined (__arm__) || defined (__arm64__) /* Size of maximum exported thread state in words */ #define ARM_THREAD_STATE_MAX (1296) /* Size of biggest state possible */ #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_THREAD_STATE_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/exception.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_ARM_EXCEPTION_H_ #define _MACH_ARM_EXCEPTION_H_ #if defined (__arm__) || defined (__arm64__) #define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */ #define EXC_MASK_MACHINE 0 #define EXCEPTION_CODE_MAX 2 /* code and subcode */ /* * Trap numbers as defined by the hardware exception vectors. */ /* * EXC_BAD_INSTRUCTION */ #define EXC_ARM_UNDEFINED 1 /* Undefined */ /* * EXC_ARITHMETIC */ #define EXC_ARM_FP_UNDEFINED 0 /* Undefined Floating Point Exception */ #define EXC_ARM_FP_IO 1 /* Invalid Floating Point Operation */ #define EXC_ARM_FP_DZ 2 /* Floating Point Divide by Zero */ #define EXC_ARM_FP_OF 3 /* Floating Point Overflow */ #define EXC_ARM_FP_UF 4 /* Floating Point Underflow */ #define EXC_ARM_FP_IX 5 /* Inexact Floating Point Result */ #define EXC_ARM_FP_ID 6 /* Floating Point Denormal Input */ /* * EXC_BAD_ACCESS * Note: do not conflict with kern_return_t values returned by vm_fault */ #define EXC_ARM_DA_ALIGN 0x101 /* Alignment Fault */ #define EXC_ARM_DA_DEBUG 0x102 /* Debug (watch/break) Fault */ #define EXC_ARM_SP_ALIGN 0x103 /* SP Alignment Fault */ #define EXC_ARM_SWP 0x104 /* SWP instruction */ #define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */ /* * EXC_BREAKPOINT */ #define EXC_ARM_BREAKPOINT 1 /* breakpoint trap */ #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_EXCEPTION_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/kern_return.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: kern_return.h * Author: Avadis Tevanian, Jr., Michael Wayne Young * Date: 1985 * * Machine-dependent kernel return definitions. */ #ifndef _MACH_ARM_KERN_RETURN_H_ #define _MACH_ARM_KERN_RETURN_H_ #if defined (__arm__) || defined (__arm64__) #ifndef ASSEMBLER typedef int kern_return_t; #endif /* ASSEMBLER */ #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_KERN_RETURN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/asm.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ #ifndef _ARM_ASM_H_ #define _ARM_ASM_H_ #if defined (__arm__) || defined (__arm64__) #include <arm/arch.h> #define FRAME pushl %ebp; movl %esp, %ebp #define EMARF leave /* There is another definition of ALIGN for .c sources */ #ifdef ASSEMBLER #define ALIGN 2 #endif /* ASSEMBLER */ #ifndef FALIGN #define FALIGN ALIGN #endif #define LB(x,n) n #if __STDC__ #ifndef __NO_UNDERSCORES__ #define LCL(x) L ## x #define EXT(x) _ ## x #define LEXT(x) _ ## x ## : #else #define LCL(x) .L ## x #define EXT(x) x #define LEXT(x) x ## : #endif #define LBc(x,n) n ## : #define LBb(x,n) n ## b #define LBf(x,n) n ## f #else /* __STDC__ */ #ifndef __NO_UNDERSCORES__ #define LCL(x) L/**/x #define EXT(x) _/**/x #define LEXT(x) _/**/x/**/: #else /* __NO_UNDERSCORES__ */ #define LCL(x) .L/**/x #define EXT(x) x #define LEXT(x) x/**/: #endif /* __NO_UNDERSCORES__ */ #define LBc(x,n) n/**/: #define LBb(x,n) n/**/b #define LBf(x,n) n/**/f #endif /* __STDC__ */ #define String .asciz #define Value .word #define Times(a,b) (a*b) #define Divide(a,b) (a/b) #if 0 /* TOTOJK */ #ifdef __ELF__ #define ELF_FUNC(x) .type x,@function #define ELF_DATA(x) .type x,@object #define ELF_SIZE(x,s) .size x,s #else #define ELF_FUNC(x) #define ELF_DATA(x) #define ELF_SIZE(x,s) #endif #else #define ELF_FUNC(x) #define ELF_DATA(x) #define ELF_SIZE(x,s) #endif /* TODOJK */ #define Entry(x) .globl EXT(x); ELF_FUNC(EXT(x)); .align FALIGN; LEXT(x) #define ENTRY(x) Entry(x) MCOUNT #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ ELF_FUNC(EXT(x)); ELF_FUNC(EXT(y)); \ .align FALIGN; LEXT(x); LEXT(y) \ MCOUNT #if __STDC__ #define ASENTRY(x) .globl x; .align FALIGN; x ## : ELF_FUNC(x) MCOUNT #else #define ASENTRY(x) .globl x; .align FALIGN; x: ELF_FUNC(x) MCOUNT #endif /* __STDC__ */ #define DATA(x) .globl EXT(x); ELF_DATA(EXT(x)); .align ALIGN; LEXT(x) #define End(x) ELF_SIZE(x,.-x) #define END(x) End(EXT(x)) #define ENDDATA(x) END(x) #define Enddata(x) End(x) #ifdef ASSEMBLER #define MCOUNT #else /* NOT ASSEMBLER */ /* These defines are here for .c files that wish to reference global symbols * within __asm__ statements. */ #ifndef __NO_UNDERSCORES__ #define CC_SYM_PREFIX "_" #else #define CC_SYM_PREFIX "" #endif /* __NO_UNDERSCORES__ */ #endif /* ASSEMBLER */ #ifdef ASSEMBLER #if defined (_ARM_ARCH_4T) # define RET bx lr # define RETeq bxeq lr # define RETne bxne lr # ifdef __STDC__ # define RETc(c) bx##c lr # else # define RETc(c) bx/**/c lr # endif #else # define RET mov pc, lr # define RETeq moveq pc, lr # define RETne movne pc, lr # ifdef __STDC__ # define RETc(c) mov##c pc, lr # else # define RETc(c) mov/**/c pc, lr # endif #endif #if defined (__thumb__) /* Provide a PI mechanism for thumb branching. */ # define BRANCH_EXTERN(x) ldr pc, [pc, #-4] ; \ .long EXT(x) #else # define BRANCH_EXTERN(x) b EXT(x) #endif /* * arg0: Register for thread pointer */ .macro READ_THREAD mrc p15, 0, $0, c13, c0, 4 /* Read TPIDRPRW */ .endmacro /* Macros for loading up addresses that are external to the .s file. * LOAD_ADDR: loads the address for (label) into (reg). Not safe for * loading to the PC. * LOAD_ADDR_PC: Variant for loading to the PC; load the address of (label) * into the pc. * LOAD_ADDR_GEN_DEF: The general definition needed to support loading * a label address. * * Usage: For any label accessed, we require one (and only one) instance * of LOAD_ADDR_GEN_DEF(label). * * Example: * LOAD_ADDR(r0, arm_init) * LOAD_ADDR(lr, arm_init_cpu) * LOAD_ADDR_PC(arm_init) * ... * * LOAD_ADDR_GEN_DEF(arm_init) * LOAD_ADDR_GEN_DEF(arm_init_cpu) */ #if SLIDABLE /* Definitions for a position dependent kernel using non-lazy pointers. */ /* TODO: Make this work with thumb .s files. */ #define PC_INC 0x8 /* We need wrapper macros in order to ensure that __LINE__ is expanded. * * There is some small potential for duplicate labels here, but because * we do not export the generated labels, it should not be an issue. */ #define GLUE_LABEL_GUTS(label, tag) L_##label##_##tag##_glue #define GLUE_LABEL(label, tag) GLUE_LABEL_GUTS(label, tag) #define LOAD_ADDR(reg, label) \ movw reg, :lower16:(label##$non_lazy_ptr - (GLUE_LABEL(label, __LINE__) + PC_INC)) ; \ movt reg, :upper16:(label##$non_lazy_ptr - (GLUE_LABEL(label, __LINE__) + PC_INC)) ; \ GLUE_LABEL(label, __LINE__): ; \ ldr reg, [pc, reg] /* Designed with the understanding that directly branching to thumb code * is unreliable; this should allow for dealing with __thumb__ in * assembly; the non-thumb variant still needs to provide the glue label * to avoid failing to build on undefined symbols. * * TODO: Make this actually use a scratch register; this macro is convenient * for translating (ldr pc, [?]) to a slidable format without the risk of * clobbering registers, but it is also wasteful. */ #if defined(__thumb__) #define LOAD_ADDR_PC(label) \ stmfd sp!, { r0 } ; \ stmfd sp!, { r0 } ; \ LOAD_ADDR(r0, label) ; \ str r0, [sp, #4] ; \ ldmfd sp!, { r0 } ; \ ldmfd sp!, { pc } #else #define LOAD_ADDR_PC(label) \ b EXT(label) #endif #define LOAD_ADDR_GEN_DEF(label) \ .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers ; \ .align 2 ; \ label##$non_lazy_ptr: ; \ .indirect_symbol EXT(label) ; \ .long 0 #else /* !SLIDABLE */ /* Definitions for a position dependent kernel */ #define LOAD_ADDR(reg, label) \ ldr reg, L_##label #if defined(__thumb__) #define LOAD_ADDR_PC(label) \ ldr pc, L_##label #else #define LOAD_ADDR_PC(label) \ b EXT(label) #endif #define LOAD_ADDR_GEN_DEF(label) \ .text ; \ .align 2 ; \ L_##label: ; \ .long EXT(label) #endif /* SLIDABLE */ /* The linker can deal with branching from ARM to thumb in unconditional * branches, but not in conditional branches. To support this in our * assembly (which allows us to build xnu without -mno-thumb), use the * following macros for branching conditionally to external symbols. * These macros are used just like the corresponding conditional branch * instructions. */ #define SHIM_LABEL_GUTS(line_num) L_cond_extern_##line_num##_shim #define SHIM_LABEL(line_num) SHIM_LABEL_GUTS(line_num) #define COND_EXTERN_BEQ(label) \ bne SHIM_LABEL(__LINE__) ; \ b EXT(label) ; \ SHIM_LABEL(__LINE__): #define COND_EXTERN_BLNE(label) \ beq SHIM_LABEL(__LINE__) ; \ bl EXT(label) ; \ SHIM_LABEL(__LINE__): #define COND_EXTERN_BLGT(label) \ ble SHIM_LABEL(__LINE__) ; \ bl EXT(label) ; \ SHIM_LABEL(__LINE__): #endif /* ASSEMBLER */ #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _ARM_ASM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/vm_types.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: vm_types.h * Author: Avadis Tevanian, Jr. * Date: 1985 * * Header file for VM data types. ARM version. */ #ifndef _MACH_ARM_VM_TYPES_H_ #define _MACH_ARM_VM_TYPES_H_ #if defined (__arm__) || defined (__arm64__) #ifndef ASSEMBLER #include <arm/_types.h> #include <stdint.h> #include <Availability.h> #include <sys/cdefs.h> /* * natural_t and integer_t are Mach's legacy types for machine- * independent integer types (unsigned, and signed, respectively). * Their original purpose was to define other types in a machine/ * compiler independent way. * * They also had an implicit "same size as pointer" characteristic * to them (i.e. Mach's traditional types are very ILP32 or ILP64 * centric). We will likely support x86 ABIs that do not follow * either ofthese models (specifically LP64). Therefore, we had to * make a choice between making these types scale with pointers or stay * tied to integers. Because their use is predominantly tied to * to the size of an integer, we are keeping that association and * breaking free from pointer size guarantees. * * New use of these types is discouraged. */ typedef __darwin_natural_t natural_t; typedef int integer_t; /* * A vm_offset_t is a type-neutral pointer, * e.g. an offset into a virtual memory space. */ #ifdef __LP64__ typedef uintptr_t vm_offset_t __kernel_ptr_semantics; typedef uintptr_t vm_size_t; typedef uint64_t mach_vm_address_t __kernel_ptr_semantics; typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics; typedef uint64_t mach_vm_size_t; typedef uint64_t vm_map_offset_t __kernel_ptr_semantics; typedef uint64_t vm_map_address_t __kernel_ptr_semantics; typedef uint64_t vm_map_size_t; #else typedef natural_t vm_offset_t __kernel_ptr_semantics; /* * A vm_size_t is the proper type for e.g. * expressing the difference between two * vm_offset_t entities. */ typedef natural_t vm_size_t; /* * This new type is independent of a particular vm map's * implementation size - and represents appropriate types * for all possible maps. This is used for interfaces * where the size of the map is not known - or we don't * want to have to distinguish. */ #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0) typedef uint32_t mach_vm_address_t; typedef uint32_t mach_vm_offset_t; typedef uint32_t mach_vm_size_t; #else typedef uint64_t mach_vm_address_t __kernel_ptr_semantics; typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics; typedef uint64_t mach_vm_size_t; #endif typedef uint32_t vm_map_offset_t __kernel_ptr_semantics; typedef uint32_t vm_map_address_t __kernel_ptr_semantics; typedef uint32_t vm_map_size_t; #endif /* __LP64__ */ typedef uint32_t vm32_offset_t; typedef uint32_t vm32_address_t; typedef uint32_t vm32_size_t; typedef vm_offset_t mach_port_context_t; #endif /* ASSEMBLER */ /* * If composing messages by hand (please do not) */ #define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_VM_TYPES_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/boolean.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: boolean.h * * Boolean type, for ARM. */ #ifndef _MACH_ARM_BOOLEAN_H_ #define _MACH_ARM_BOOLEAN_H_ #if defined (__arm__) || defined (__arm64__) typedef int boolean_t; #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_BOOLEAN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/traps.h
/* * Copyright (c) 2019 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_ARM_TRAPS_H_ #define _MACH_ARM_TRAPS_H_ #if defined (__arm__) || defined (__arm64__) #pragma once #define MACH_ARM_TRAP_ABSTIME -3 #define MACH_ARM_TRAP_CONTTIME -4 #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_TRAPS_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/processor_info.h
/* * Copyright (c) 2007-2018 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACH_ARM_PROCESSOR_INFO_H_ #define _MACH_ARM_PROCESSOR_INFO_H_ #if defined (__arm__) || defined (__arm64__) #define PROCESSOR_CPU_STAT 0x10000003 /* Low-level CPU statistics */ #define PROCESSOR_CPU_STAT64 0x10000004 /* Low-level CPU statistics, in full 64-bit */ #include <stdint.h> /* uint32_t, uint64_t */ struct processor_cpu_stat { uint32_t irq_ex_cnt; uint32_t ipi_cnt; uint32_t timer_cnt; uint32_t undef_ex_cnt; uint32_t unaligned_cnt; uint32_t vfp_cnt; uint32_t vfp_shortv_cnt; uint32_t data_ex_cnt; uint32_t instr_ex_cnt; }; typedef struct processor_cpu_stat processor_cpu_stat_data_t; typedef struct processor_cpu_stat *processor_cpu_stat_t; #define PROCESSOR_CPU_STAT_COUNT ((mach_msg_type_number_t) \ (sizeof(processor_cpu_stat_data_t) / sizeof(natural_t))) struct processor_cpu_stat64 { uint64_t irq_ex_cnt; uint64_t ipi_cnt; uint64_t timer_cnt; uint64_t undef_ex_cnt; uint64_t unaligned_cnt; uint64_t vfp_cnt; uint64_t vfp_shortv_cnt; uint64_t data_ex_cnt; uint64_t instr_ex_cnt; uint64_t pmi_cnt; } __attribute__((packed, aligned(4))); typedef struct processor_cpu_stat64 processor_cpu_stat64_data_t; typedef struct processor_cpu_stat64 *processor_cpu_stat64_t; #define PROCESSOR_CPU_STAT64_COUNT ((mach_msg_type_number_t) \ (sizeof(processor_cpu_stat64_data_t) / sizeof(integer_t))) #endif /* defined (__arm__) || defined (__arm64__) */ #endif /* _MACH_ARM_PROCESSOR_INFO_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/syscall_sw.h
/* * Copyright (c) 2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * FILE_ID: syscall_sw.h */ #ifndef _MACH_ARM_SYSCALL_SW_H_ #define _MACH_ARM_SYSCALL_SW_H_ #if defined(__arm__) #include <mach/machine/vm_param.h> #include <architecture/arm/asm_help.h> /* 0 to 4 args are already loaded in r0-r3 */ #define _kernel_trap_0to4(trap_name, trap_number) \ mov r12, # ## trap_number /* load syscall number */ ; \ swi #SWI_SYSCALL ; \ bx lr /* return */ ; #define _kernel_trap_5(trap_name, trap_number) \ mov ip, sp /* save pointer to args */ ; \ stmfd sp!, { r4-r5 } /* save r4-r5, keep stack 64-bit aligned */; \ ldr r4, [ ip ] /* load arg 5 */ ; \ mov r12, # ## trap_number /* load syscall number */ ; \ swi #SWI_SYSCALL ; \ ldmfd sp!, { r4-r5 } /* restore r4-r5 */ ;\ bx lr /* return */ ; #define _kernel_trap_6to9(trap_name, trap_number, save_regs, arg_regs) \ mov ip, sp /* save pointer to args */ ; \ stmfd sp!, { save_regs } /* callee saved regs */; \ ldmia ip, { arg_regs } /* load arg registers (above r0-r3) */ ;\ mov r12, # ## trap_number /* load syscall number */ ; \ swi #SWI_SYSCALL ; \ ldmfd sp!, { save_regs } /* restore callee saved regs */ ;\ bx lr /* return */ ; #define COMMA , /* For the armv7k ABI, the alignment requirements may add padding. So we * let the kernel figure it out and push extra on the stack to avoid un-needed * copy-ins. We are relying on arguments that aren't in registers starting * 32 bytes from sp. */ #if __BIGGEST_ALIGNMENT__ > 4 #define _kernel_trap_0(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_1(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_2(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_3(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_4(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r5, r4-r5) #undef _kernel_trap_5 #define _kernel_trap_5(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r5, r4-r5) #define _kernel_trap_6(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r6 COMMA r8, r4-r6 COMMA r8) #define _kernel_trap_7(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r6 COMMA r8, r4-r6 COMMA r8) #define _kernel_trap_8(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r6 COMMA r8, r4-r6 COMMA r8) #define _kernel_trap_9(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r6 COMMA r8, r4-r6 COMMA r8) #else // !(__BIGGEST_ALIGNMENT__ > 4) #define _kernel_trap_0(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_1(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_2(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_3(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) #define _kernel_trap_4(trap_name, trap_number) _kernel_trap_0to4(trap_name, trap_number) /* _kernel_trap_5 defined above */ #define _kernel_trap_6(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r5, r4-r5) /* need to save r8 not just for alignment but because mach_msg_trap overwrites the eighth argument */ #define _kernel_trap_7(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r6 COMMA r8, r4-r6) #define _kernel_trap_8(trap_name, trap_number) _kernel_trap_6to9(trap_name, trap_number, r4-r6 COMMA r8, r4-r6 COMMA r8) /* there is only one nine-argument trap (mach_msg_overwrite_trap) and it doesn't use the ninth argument */ #define _kernel_trap_9(trap_name, trap_number) _kernel_trap_8(trap_name, trap_number) #endif // __BIGGEST_ALIGNMENT__ > 4 /* select the appropriate trap macro based off the number of args */ #define kernel_trap(trap_name, trap_number, num_args) \ LEAF(_##trap_name, 0) \ _kernel_trap_##num_args(trap_name, trap_number) #elif defined(__arm64__) #include <mach/machine/vm_param.h> #define kernel_trap(trap_name, trap_number, num_args) \ .globl _##trap_name %% \ .text %% \ .align 2 %% \ _##trap_name: %% \ mov x16, #(trap_number) %% \ svc #SWI_SYSCALL %% \ ret #else #error Unsupported architecture #endif #endif /* _MACH_ARM_SYSCALL_SW_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach/arm/ndr_def.h
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* NDR record for Intel x86s */ #include <mach/ndr.h> NDR_record_t NDR_record = { 0, /* mig_reserved */ 0, /* mig_reserved */ 0, /* mig_reserved */ NDR_PROTOCOL_2_0, NDR_INT_LITTLE_ENDIAN, NDR_CHAR_ASCII, NDR_FLOAT_IEEE, 0, };
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/ipc/ipc_types.h
/* * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Define Basic IPC types available to callers. * These are not intended to be used directly, but * are used to define other types available through * port.h and mach_types.h for in-kernel entities. */ #ifndef _IPC_IPC_TYPES_H_ #define _IPC_IPC_TYPES_H_ #include <mach/port.h> #include <mach/message.h> #include <mach/mach_types.h> struct ipc_object; typedef struct ipc_object *ipc_object_t; #define IPC_OBJECT_NULL ((ipc_object_t) 0) #define IPC_OBJECT_DEAD ((ipc_object_t)~0) #define IPC_OBJECT_VALID(io) (((io) != IPC_OBJECT_NULL) && \ ((io) != IPC_OBJECT_DEAD)) #endif /* _IPC_IPC_TYPES_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach-o/fat.h
/* * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #ifndef _MACH_O_FAT_H_ #define _MACH_O_FAT_H_ /* * This header file describes the structures of the file format for "fat" * architecture specific file (wrapper design). At the begining of the file * there is one fat_header structure followed by a number of fat_arch * structures. For each architecture in the file, specified by a pair of * cputype and cpusubtype, the fat_header describes the file offset, file * size and alignment in the file of the architecture specific member. * The padded bytes in the file to place each member on it's specific alignment * are defined to be read as zeros and can be left as "holes" if the file system * can support them as long as they read as zeros. * * All structures defined here are always written and read to/from disk * in big-endian order. */ /* * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types * and contains the constants for the possible values of these types. */ #include <stdint.h> #include <mach/machine.h> #include <architecture/byte_order.h> #define FAT_MAGIC 0xcafebabe #define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */ struct fat_header { uint32_t magic; /* FAT_MAGIC */ uint32_t nfat_arch; /* number of structs that follow */ }; struct fat_arch { cpu_type_t cputype; /* cpu specifier (int) */ cpu_subtype_t cpusubtype; /* machine specifier (int) */ uint32_t offset; /* file offset to this object file */ uint32_t size; /* size of this object file */ uint32_t align; /* alignment as a power of 2 */ }; #endif /* _MACH_O_FAT_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach-o/nlist.h
/* * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #ifndef _MACHO_NLIST_H_ #define _MACHO_NLIST_H_ /* $NetBSD: nlist.h,v 1.5 1994/10/26 00:56:11 cgd Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)nlist.h 8.2 (Berkeley) 1/21/94 */ #include <stdint.h> /* * Format of a symbol table entry of a Mach-O file for 32-bit architectures. * Modified from the BSD format. The modifications from the original format * were changing n_other (an unused field) to n_sect and the addition of the * N_SECT type. These modifications are required to support symbols in a larger * number of sections not just the three sections (text, data and bss) in a BSD * file. */ struct nlist { union { #ifndef __LP64__ char *n_name; /* for use when in-core */ #endif uint32_t n_strx; /* index into the string table */ } n_un; uint8_t n_type; /* type flag, see below */ uint8_t n_sect; /* section number or NO_SECT */ int16_t n_desc; /* see <mach-o/stab.h> */ uint32_t n_value; /* value of this symbol (or stab offset) */ }; /* * This is the symbol table entry structure for 64-bit architectures. */ struct nlist_64 { union { uint32_t n_strx; /* index into the string table */ } n_un; uint8_t n_type; /* type flag, see below */ uint8_t n_sect; /* section number or NO_SECT */ uint16_t n_desc; /* see <mach-o/stab.h> */ uint64_t n_value; /* value of this symbol (or stab offset) */ }; /* * Symbols with a index into the string table of zero (n_un.n_strx == 0) are * defined to have a null, "", name. Therefore all string indexes to non null * names must not have a zero string index. This is bit historical information * that has never been well documented. */ /* * The n_type field really contains four fields: * unsigned char N_STAB:3, * N_PEXT:1, * N_TYPE:3, * N_EXT:1; * which are used via the following masks. */ #define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ #define N_PEXT 0x10 /* private external symbol bit */ #define N_TYPE 0x0e /* mask for the type bits */ #define N_EXT 0x01 /* external symbol bit, set for external symbols */ /* * Only symbolic debugging entries have some of the N_STAB bits set and if any * of these bits are set then it is a symbolic debugging entry (a stab). In * which case then the values of the n_type field (the entire field) are given * in <mach-o/stab.h> */ /* * Values for N_TYPE bits of the n_type field. */ #define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */ #define N_ABS 0x2 /* absolute, n_sect == NO_SECT */ #define N_SECT 0xe /* defined in section number n_sect */ #define N_PBUD 0xc /* prebound undefined (defined in a dylib) */ #define N_INDR 0xa /* indirect */ /* * If the type is N_INDR then the symbol is defined to be the same as another * symbol. In this case the n_value field is an index into the string table * of the other symbol's name. When the other symbol is defined then they both * take on the defined type and value. */ /* * If the type is N_SECT then the n_sect field contains an ordinal of the * section the symbol is defined in. The sections are numbered from 1 and * refer to sections in order they appear in the load commands for the file * they are in. This means the same ordinal may very well refer to different * sections in different files. * * The n_value field for all symbol table entries (including N_STAB's) gets * updated by the link editor based on the value of it's n_sect field and where * the section n_sect references gets relocated. If the value of the n_sect * field is NO_SECT then it's n_value field is not changed by the link editor. */ #define NO_SECT 0 /* symbol is not in any section */ #define MAX_SECT 255 /* 1 thru 255 inclusive */ /* * Common symbols are represented by undefined (N_UNDF) external (N_EXT) types * who's values (n_value) are non-zero. In which case the value of the n_value * field is the size (in bytes) of the common symbol. The n_sect field is set * to NO_SECT. The alignment of a common symbol may be set as a power of 2 * between 2^1 and 2^15 as part of the n_desc field using the macros below. If * the alignment is not set (a value of zero) then natural alignment based on * the size is used. */ #define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f) #define SET_COMM_ALIGN(n_desc,align) \ (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8)) /* * To support the lazy binding of undefined symbols in the dynamic link-editor, * the undefined symbols in the symbol table (the nlist structures) are marked * with the indication if the undefined reference is a lazy reference or * non-lazy reference. If both a non-lazy reference and a lazy reference is * made to the same symbol the non-lazy reference takes precedence. A reference * is lazy only when all references to that symbol are made through a symbol * pointer in a lazy symbol pointer section. * * The implementation of marking nlist structures in the symbol table for * undefined symbols will be to use some of the bits of the n_desc field as a * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field * of an nlist structure for an undefined symbol to determine the type of * undefined reference (lazy or non-lazy). * * The constants for the REFERENCE FLAGS are propagated to the reference table * in a shared library file. In that case the constant for a defined symbol, * REFERENCE_FLAG_DEFINED, is also used. */ /* Reference type bits of the n_desc field of undefined symbols */ #define REFERENCE_TYPE 0x7 /* types of references */ #define REFERENCE_FLAG_UNDEFINED_NON_LAZY 0 #define REFERENCE_FLAG_UNDEFINED_LAZY 1 #define REFERENCE_FLAG_DEFINED 2 #define REFERENCE_FLAG_PRIVATE_DEFINED 3 #define REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4 #define REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5 /* * To simplify stripping of objects that use are used with the dynamic link * editor, the static link editor marks the symbols defined an object that are * referenced by a dynamicly bound object (dynamic shared libraries, bundles). * With this marking strip knows not to strip these symbols. */ #define REFERENCED_DYNAMICALLY 0x0010 /* * For images created by the static link editor with the -twolevel_namespace * option in effect the flags field of the mach header is marked with * MH_TWOLEVEL. And the binding of the undefined references of the image are * determined by the static link editor. Which library an undefined symbol is * bound to is recorded by the static linker in the high 8 bits of the n_desc * field using the SET_LIBRARY_ORDINAL macro below. The ordinal recorded * references the libraries listed in the Mach-O's LC_LOAD_DYLIB, * LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_LOAD_UPWARD_DYLIB, and * LC_LAZY_LOAD_DYLIB, etc. load commands in the order they appear in the * headers. The library ordinals start from 1. * For a dynamic library that is built as a two-level namespace image the * undefined references from module defined in another use the same nlist struct * an in that case SELF_LIBRARY_ORDINAL is used as the library ordinal. For * defined symbols in all images they also must have the library ordinal set to * SELF_LIBRARY_ORDINAL. The EXECUTABLE_ORDINAL refers to the executable * image for references from plugins that refer to the executable that loads * them. * * The DYNAMIC_LOOKUP_ORDINAL is for undefined symbols in a two-level namespace * image that are looked up by the dynamic linker with flat namespace semantics. * This ordinal was added as a feature in Mac OS X 10.3 by reducing the * value of MAX_LIBRARY_ORDINAL by one. So it is legal for existing binaries * or binaries built with older tools to have 0xfe (254) dynamic libraries. In * this case the ordinal value 0xfe (254) must be treated as a library ordinal * for compatibility. */ #define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff) #define SET_LIBRARY_ORDINAL(n_desc,ordinal) \ (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8)) #define SELF_LIBRARY_ORDINAL 0x0 #define MAX_LIBRARY_ORDINAL 0xfd #define DYNAMIC_LOOKUP_ORDINAL 0xfe #define EXECUTABLE_ORDINAL 0xff /* * The bit 0x0020 of the n_desc field is used for two non-overlapping purposes * and has two different symbolic names, N_NO_DEAD_STRIP and N_DESC_DISCARDED. */ /* * The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a * relocatable .o file (MH_OBJECT filetype). And is used to indicate to the * static link editor it is never to dead strip the symbol. */ #define N_NO_DEAD_STRIP 0x0020 /* symbol is not to be dead stripped */ /* * The N_DESC_DISCARDED bit of the n_desc field never appears in linked image. * But is used in very rare cases by the dynamic link editor to mark an in * memory symbol as discared and longer used for linking. */ #define N_DESC_DISCARDED 0x0020 /* symbol is discarded */ /* * The N_WEAK_REF bit of the n_desc field indicates to the dynamic linker that * the undefined symbol is allowed to be missing and is to have the address of * zero when missing. */ #define N_WEAK_REF 0x0040 /* symbol is weak referenced */ /* * The N_WEAK_DEF bit of the n_desc field indicates to the static and dynamic * linkers that the symbol definition is weak, allowing a non-weak symbol to * also be used which causes the weak definition to be discared. Currently this * is only supported for symbols in coalesed sections. */ #define N_WEAK_DEF 0x0080 /* coalesed symbol is a weak definition */ /* * The N_REF_TO_WEAK bit of the n_desc field indicates to the dynamic linker * that the undefined symbol should be resolved using flat namespace searching. */ #define N_REF_TO_WEAK 0x0080 /* reference to a weak symbol */ /* * The N_ARM_THUMB_DEF bit of the n_desc field indicates that the symbol is * a defintion of a Thumb function. */ #define N_ARM_THUMB_DEF 0x0008 /* symbol is a Thumb function (ARM) */ /* * The N_SYMBOL_RESOLVER bit of the n_desc field indicates that the * that the function is actually a resolver function and should * be called to get the address of the real function to use. * This bit is only available in .o files (MH_OBJECT filetype) */ #define N_SYMBOL_RESOLVER 0x0100 /* * The N_ALT_ENTRY bit of the n_desc field indicates that the * symbol is pinned to the previous content. */ #define N_ALT_ENTRY 0x0200 #ifndef __STRICT_BSD__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * The function nlist(3) from the C library. */ extern int nlist (const char *filename, struct nlist *list); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __STRICT_BSD__ */ #endif /* _MACHO_LIST_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach-o/fixup-chains.h
/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*- * * Copyright (c) 2018 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #ifndef __MACH_O_FIXUP_CHAINS__ #define __MACH_O_FIXUP_CHAINS__ 5 #include <stdint.h> //#define LC_DYLD_EXPORTS_TRIE 0x80000033 // used with linkedit_data_command //#define LC_DYLD_CHAINED_FIXUPS 0x80000034 // used with linkedit_data_command, payload is dyld_chained_fixups_header // header of the LC_DYLD_CHAINED_FIXUPS payload struct dyld_chained_fixups_header { uint32_t fixups_version; // 0 uint32_t starts_offset; // offset of dyld_chained_starts_in_image in chain_data uint32_t imports_offset; // offset of imports table in chain_data uint32_t symbols_offset; // offset of symbol strings in chain_data uint32_t imports_count; // number of imported symbol names uint32_t imports_format; // DYLD_CHAINED_IMPORT* uint32_t symbols_format; // 0 => uncompressed, 1 => zlib compressed }; // This struct is embedded in LC_DYLD_CHAINED_FIXUPS payload struct dyld_chained_starts_in_image { uint32_t seg_count; uint32_t seg_info_offset[1]; // each entry is offset into this struct for that segment // followed by pool of dyld_chain_starts_in_segment data }; // This struct is embedded in dyld_chain_starts_in_image // and passed down to the kernel for page-in linking struct dyld_chained_starts_in_segment { uint32_t size; // size of this (amount kernel needs to copy) uint16_t page_size; // 0x1000 or 0x4000 uint16_t pointer_format; // DYLD_CHAINED_PTR_* uint64_t segment_offset; // offset in memory to start of segment uint32_t max_valid_pointer; // for 32-bit OS, any value beyond this is not a pointer uint16_t page_count; // how many pages are in array uint16_t page_start[1]; // each entry is offset in each page of first element in chain // or DYLD_CHAINED_PTR_START_NONE if no fixups on page // uint16_t chain_starts[1]; // some 32-bit formats may require multiple starts per page. // for those, if high bit is set in page_starts[], then it // is index into chain_starts[] which is a list of starts // the last of which has the high bit set }; enum { DYLD_CHAINED_PTR_START_NONE = 0xFFFF, // used in page_start[] to denote a page with no fixups DYLD_CHAINED_PTR_START_MULTI = 0x8000, // used in page_start[] to denote a page which has multiple starts DYLD_CHAINED_PTR_START_LAST = 0x8000, // used in chain_starts[] to denote last start in list for page }; // This struct is embedded in __TEXT,__chain_starts section in firmware struct dyld_chained_starts_offsets { uint32_t pointer_format; // DYLD_CHAINED_PTR_32_FIRMWARE uint32_t starts_count; // number of starts in array uint32_t chain_starts[1]; // array chain start offsets }; // values for dyld_chained_starts_in_segment.pointer_format enum { DYLD_CHAINED_PTR_ARM64E = 1, // stride 8, unauth target is vmaddr DYLD_CHAINED_PTR_64 = 2, // target is vmaddr DYLD_CHAINED_PTR_32 = 3, DYLD_CHAINED_PTR_32_CACHE = 4, DYLD_CHAINED_PTR_32_FIRMWARE = 5, DYLD_CHAINED_PTR_64_OFFSET = 6, // target is vm offset DYLD_CHAINED_PTR_ARM64E_OFFSET = 7, // old name DYLD_CHAINED_PTR_ARM64E_KERNEL = 7, // stride 4, unauth target is vm offset DYLD_CHAINED_PTR_64_KERNEL_CACHE = 8, DYLD_CHAINED_PTR_ARM64E_USERLAND = 9, // stride 8, unauth target is vm offset DYLD_CHAINED_PTR_ARM64E_FIRMWARE = 10, // stride 4, unauth target is vmaddr DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE = 11, // stride 1, x86_64 kernel caches }; // DYLD_CHAINED_PTR_ARM64E struct dyld_chained_ptr_arm64e_rebase { uint64_t target : 43, high8 : 8, next : 11, // 4 or 8-byte stide bind : 1, // == 0 auth : 1; // == 0 }; // DYLD_CHAINED_PTR_ARM64E struct dyld_chained_ptr_arm64e_bind { uint64_t ordinal : 16, zero : 16, addend : 19, // +/-256K next : 11, // 4 or 8-byte stide bind : 1, // == 1 auth : 1; // == 0 }; // DYLD_CHAINED_PTR_ARM64E struct dyld_chained_ptr_arm64e_auth_rebase { uint64_t target : 32, // runtimeOffset diversity : 16, addrDiv : 1, key : 2, next : 11, // 4 or 8-byte stide bind : 1, // == 0 auth : 1; // == 1 }; // DYLD_CHAINED_PTR_ARM64E struct dyld_chained_ptr_arm64e_auth_bind { uint64_t ordinal : 16, zero : 16, diversity : 16, addrDiv : 1, key : 2, next : 11, // 4 or 8-byte stide bind : 1, // == 1 auth : 1; // == 1 }; // DYLD_CHAINED_PTR_64/DYLD_CHAINED_PTR_64_OFFSET struct dyld_chained_ptr_64_rebase { uint64_t target : 36, // 64GB max image size (DYLD_CHAINED_PTR_64 => vmAddr, DYLD_CHAINED_PTR_64_OFFSET => runtimeOffset) high8 : 8, // top 8 bits set to this (DYLD_CHAINED_PTR_64 => after slide added, DYLD_CHAINED_PTR_64_OFFSET => before slide added) reserved : 7, // all zeros next : 12, // 4-byte stride bind : 1; // == 0 }; // DYLD_CHAINED_PTR_64 struct dyld_chained_ptr_64_bind { uint64_t ordinal : 24, addend : 8, // 0 thru 255 reserved : 19, // all zeros next : 12, // 4-byte stride bind : 1; // == 1 }; // DYLD_CHAINED_PTR_64_KERNEL_CACHE, DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE struct dyld_chained_ptr_64_kernel_cache_rebase { uint64_t target : 30, // basePointers[cacheLevel] + target cacheLevel : 2, // what level of cache to bind to (indexes a mach_header array) diversity : 16, addrDiv : 1, key : 2, next : 12, // 1 or 4-byte stide isAuth : 1; // 0 -> not authenticated. 1 -> authenticated }; // DYLD_CHAINED_PTR_32 // Note: for DYLD_CHAINED_PTR_32 some non-pointer values are co-opted into the chain // as out of range rebases. If an entry in the chain is > max_valid_pointer, then it // is not a pointer. To restore the value, subtract off the bias, which is // (64MB+max_valid_pointer)/2. struct dyld_chained_ptr_32_rebase { uint32_t target : 26, // vmaddr, 64MB max image size next : 5, // 4-byte stride bind : 1; // == 0 }; // DYLD_CHAINED_PTR_32 struct dyld_chained_ptr_32_bind { uint32_t ordinal : 20, addend : 6, // 0 thru 63 next : 5, // 4-byte stride bind : 1; // == 1 }; // DYLD_CHAINED_PTR_32_CACHE struct dyld_chained_ptr_32_cache_rebase { uint32_t target : 30, // 1GB max dyld cache TEXT and DATA next : 2; // 4-byte stride }; // DYLD_CHAINED_PTR_32_FIRMWARE struct dyld_chained_ptr_32_firmware_rebase { uint32_t target : 26, // 64MB max firmware TEXT and DATA next : 6; // 4-byte stride }; // values for dyld_chained_fixups_header.imports_format enum { DYLD_CHAINED_IMPORT = 1, DYLD_CHAINED_IMPORT_ADDEND = 2, DYLD_CHAINED_IMPORT_ADDEND64 = 3, }; // DYLD_CHAINED_IMPORT struct dyld_chained_import { uint32_t lib_ordinal : 8, weak_import : 1, name_offset : 23; }; // DYLD_CHAINED_IMPORT_ADDEND struct dyld_chained_import_addend { uint32_t lib_ordinal : 8, weak_import : 1, name_offset : 23; int32_t addend; }; // DYLD_CHAINED_IMPORT_ADDEND64 struct dyld_chained_import_addend64 { uint64_t lib_ordinal : 16, weak_import : 1, reserved : 15, name_offset : 32; uint64_t addend; }; #endif // __MACH_O_FIXUP_CHAINS__
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach-o/loader.h
/* * Copyright (c) 1999-2019 Apple Inc. All Rights Reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #ifndef _MACHO_LOADER_H_ #define _MACHO_LOADER_H_ /* * This file describes the format of mach object files. */ #include <stdint.h> /* * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types * and contains the constants for the possible values of these types. */ #include <mach/machine.h> /* * <mach/vm_prot.h> is needed here for the vm_prot_t type and contains the * constants that are or'ed together for the possible values of this type. */ #include <mach/vm_prot.h> /* * <machine/thread_status.h> is expected to define the flavors of the thread * states and the structures of those flavors for each machine. */ #include <mach/machine/thread_status.h> #include <architecture/byte_order.h> /* * The 32-bit mach header appears at the very beginning of the object file for * 32-bit architectures. */ struct mach_header { uint32_t magic; /* mach magic number identifier */ cpu_type_t cputype; /* cpu specifier */ cpu_subtype_t cpusubtype; /* machine specifier */ uint32_t filetype; /* type of file */ uint32_t ncmds; /* number of load commands */ uint32_t sizeofcmds; /* the size of all the load commands */ uint32_t flags; /* flags */ }; /* Constant for the magic field of the mach_header (32-bit architectures) */ #define MH_MAGIC 0xfeedface /* the mach magic number */ #define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */ /* * The 64-bit mach header appears at the very beginning of object files for * 64-bit architectures. */ struct mach_header_64 { uint32_t magic; /* mach magic number identifier */ cpu_type_t cputype; /* cpu specifier */ cpu_subtype_t cpusubtype; /* machine specifier */ uint32_t filetype; /* type of file */ uint32_t ncmds; /* number of load commands */ uint32_t sizeofcmds; /* the size of all the load commands */ uint32_t flags; /* flags */ uint32_t reserved; /* reserved */ }; /* Constant for the magic field of the mach_header_64 (64-bit architectures) */ #define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */ #define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ /* * The layout of the file depends on the filetype. For all but the MH_OBJECT * file type the segments are padded out and aligned on a segment alignment * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB, * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part * of their first segment. * * The file type MH_OBJECT is a compact format intended as output of the * assembler and input (and possibly output) of the link editor (the .o * format). All sections are in one unnamed segment with no segment padding. * This format is used as an executable format when the file is so small the * segment padding greatly increases its size. * * The file type MH_PRELOAD is an executable format intended for things that * are not executed under the kernel (proms, stand alones, kernels, etc). The * format can be executed under the kernel but may demand paged it and not * preload it before execution. * * A core file is in MH_CORE format and can be any in an arbritray legal * Mach-O file. * * Constants for the filetype field of the mach_header */ #define MH_OBJECT 0x1 /* relocatable object file */ #define MH_EXECUTE 0x2 /* demand paged executable file */ #define MH_FVMLIB 0x3 /* fixed VM shared library file */ #define MH_CORE 0x4 /* core file */ #define MH_PRELOAD 0x5 /* preloaded executable file */ #define MH_DYLIB 0x6 /* dynamically bound shared library */ #define MH_DYLINKER 0x7 /* dynamic link editor */ #define MH_BUNDLE 0x8 /* dynamically bound bundle file */ #define MH_DYLIB_STUB 0x9 /* shared library stub for static */ /* linking only, no section contents */ #define MH_DSYM 0xa /* companion file with only debug */ /* sections */ #define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */ #define MH_FILESET 0xc /* set of mach-o's */ /* Constants for the flags field of the mach_header */ #define MH_NOUNDEFS 0x1 /* the object file has no undefined references */ #define MH_INCRLINK 0x2 /* the object file is the output of an incremental link against a base file and can't be link edited again */ #define MH_DYLDLINK 0x4 /* the object file is input for the dynamic linker and can't be staticly link edited again */ #define MH_BINDATLOAD 0x8 /* the object file's undefined references are bound by the dynamic linker when loaded. */ #define MH_PREBOUND 0x10 /* the file has its dynamic undefined references prebound. */ #define MH_SPLIT_SEGS 0x20 /* the file has its read-only and read-write segments split */ #define MH_LAZY_INIT 0x40 /* the shared library init routine is to be run lazily via catching memory faults to its writeable segments (obsolete) */ #define MH_TWOLEVEL 0x80 /* the image is using two-level name space bindings */ #define MH_FORCE_FLAT 0x100 /* the executable is forcing all images to use flat name space bindings */ #define MH_NOMULTIDEFS 0x200 /* this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used. */ #define MH_NOFIXPREBINDING 0x400 /* do not have dyld notify the prebinding agent about this executable */ #define MH_PREBINDABLE 0x800 /* the binary is not prebound but can have its prebinding redone. only used when MH_PREBOUND is not set. */ #define MH_ALLMODSBOUND 0x1000 /* indicates that this binary binds to all two-level namespace modules of its dependent libraries. only used when MH_PREBINDABLE and MH_TWOLEVEL are both set. */ #define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into sub-sections via symbols for dead code stripping */ #define MH_CANONICAL 0x4000 /* the binary has been canonicalized via the unprebind operation */ #define MH_WEAK_DEFINES 0x8000 /* the final linked image contains external weak symbols */ #define MH_BINDS_TO_WEAK 0x10000 /* the final linked image uses weak symbols */ #define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks in the task will be given stack execution privilege. Only used in MH_EXECUTE filetypes. */ #define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary declares it is safe for use in processes with uid zero */ #define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary declares it is safe for use in processes when issetugid() is true */ #define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib, the static linker does not need to examine dependent dylibs to see if any are re-exported */ #define MH_PIE 0x200000 /* When this bit is set, the OS will load the main executable at a random address. Only used in MH_EXECUTE filetypes. */ #define MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When linking against a dylib that has this bit set, the static linker will automatically not create a LC_LOAD_DYLIB load command to the dylib if no symbols are being referenced from the dylib. */ #define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type S_THREAD_LOCAL_VARIABLES */ #define MH_NO_HEAP_EXECUTION 0x1000000 /* When this bit is set, the OS will run the main executable with a non-executable heap even on platforms (e.g. i386) that don't require it. Only used in MH_EXECUTE filetypes. */ #define MH_APP_EXTENSION_SAFE 0x02000000 /* The code was linked for use in an application extension. */ #define MH_NLIST_OUTOFSYNC_WITH_DYLDINFO 0x04000000 /* The external symbols listed in the nlist symbol table do not include all the symbols listed in the dyld info. */ #define MH_SIM_SUPPORT 0x08000000 /* Allow LC_MIN_VERSION_MACOS and LC_BUILD_VERSION load commands with the platforms macOS, iOSMac, iOSSimulator, tvOSSimulator and watchOSSimulator. */ #define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit is set, the dylib is part of the dyld shared cache, rather than loose in the filesystem. */ /* * The load commands directly follow the mach_header. The total size of all * of the commands is given by the sizeofcmds field in the mach_header. All * load commands must have as their first two fields cmd and cmdsize. The cmd * field is filled in with a constant for that command type. Each command type * has a structure specifically for it. The cmdsize field is the size in bytes * of the particular load command structure plus anything that follows it that * is a part of the load command (i.e. section structures, strings, etc.). To * advance to the next load command the cmdsize can be added to the offset or * pointer of the current load command. The cmdsize for 32-bit architectures * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple * of 8 bytes (these are forever the maximum alignment of any load commands). * The padded bytes must be zero. All tables in the object file must also * follow these rules so the file can be memory mapped. Otherwise the pointers * to these tables will not work well or at all on some machines. With all * padding zeroed like objects will compare byte for byte. */ struct load_command { uint32_t cmd; /* type of load command */ uint32_t cmdsize; /* total size of command in bytes */ }; /* * After MacOS X 10.1 when a new load command is added that is required to be * understood by the dynamic linker for the image to execute properly the * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic * linker sees such a load command it it does not understand will issue a * "unknown load command required for execution" error and refuse to use the * image. Other load commands without this bit that are not understood will * simply be ignored. */ #define LC_REQ_DYLD 0x80000000 /* Constants for the cmd field of all load commands, the type */ #define LC_SEGMENT 0x1 /* segment of this file to be mapped */ #define LC_SYMTAB 0x2 /* link-edit stab symbol table info */ #define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */ #define LC_THREAD 0x4 /* thread */ #define LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */ #define LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */ #define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */ #define LC_IDENT 0x8 /* object identification info (obsolete) */ #define LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */ #define LC_PREPAGE 0xa /* prepage command (internal use) */ #define LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */ #define LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */ #define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */ #define LC_LOAD_DYLINKER 0xe /* load a dynamic linker */ #define LC_ID_DYLINKER 0xf /* dynamic linker identification */ #define LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */ /* linked shared library */ #define LC_ROUTINES 0x11 /* image routines */ #define LC_SUB_FRAMEWORK 0x12 /* sub framework */ #define LC_SUB_UMBRELLA 0x13 /* sub umbrella */ #define LC_SUB_CLIENT 0x14 /* sub client */ #define LC_SUB_LIBRARY 0x15 /* sub library */ #define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */ #define LC_PREBIND_CKSUM 0x17 /* prebind checksum */ /* * load a dynamically linked shared library that is allowed to be missing * (all symbols are weak imported). */ #define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #define LC_SEGMENT_64 0x19 /* 64-bit segment of this file to be mapped */ #define LC_ROUTINES_64 0x1a /* 64-bit image routines */ #define LC_UUID 0x1b /* the uuid */ #define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */ #define LC_CODE_SIGNATURE 0x1d /* local of code signature */ #define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */ #define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */ #define LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */ #define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */ #define LC_DYLD_INFO 0x22 /* compressed dyld information */ #define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */ #define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */ #define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */ #define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */ #define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ #define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat like environment variable */ #define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */ #define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */ #define LC_SOURCE_VERSION 0x2A /* source version used to build binary */ #define LC_DYLIB_CODE_SIGN_DRS 0x2B /* Code signing DRs copied from linked dylibs */ #define LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */ #define LC_LINKER_OPTION 0x2D /* linker options in MH_OBJECT files */ #define LC_LINKER_OPTIMIZATION_HINT 0x2E /* optimization hints in MH_OBJECT files */ #define LC_VERSION_MIN_TVOS 0x2F /* build for AppleTV min OS version */ #define LC_VERSION_MIN_WATCHOS 0x30 /* build for Watch min OS version */ #define LC_NOTE 0x31 /* arbitrary data included within a Mach-O file */ #define LC_BUILD_VERSION 0x32 /* build for platform min OS version */ #define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) /* used with linkedit_data_command, payload is trie */ #define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) /* used with linkedit_data_command */ #define LC_FILESET_ENTRY (0x35 | LC_REQ_DYLD) /* used with fileset_entry_command */ /* * A variable length string in a load command is represented by an lc_str * union. The strings are stored just after the load command structure and * the offset is from the start of the load command structure. The size * of the string is reflected in the cmdsize field of the load command. * Once again any padded bytes to bring the cmdsize field to a multiple * of 4 bytes must be zero. */ union lc_str { uint32_t offset; /* offset to the string */ #ifndef __LP64__ char *ptr; /* pointer to the string */ #endif }; /* * The segment load command indicates that a part of this file is to be * mapped into the task's address space. The size of this segment in memory, * vmsize, maybe equal to or larger than the amount to map from this file, * filesize. The file is mapped starting at fileoff to the beginning of * the segment in memory, vmaddr. The rest of the memory of the segment, * if any, is allocated zero fill on demand. The segment's maximum virtual * memory protection and initial virtual memory protection are specified * by the maxprot and initprot fields. If the segment has sections then the * section structures directly follow the segment command and their size is * reflected in cmdsize. */ struct segment_command { /* for 32-bit architectures */ uint32_t cmd; /* LC_SEGMENT */ uint32_t cmdsize; /* includes sizeof section structs */ char segname[16]; /* segment name */ uint32_t vmaddr; /* memory address of this segment */ uint32_t vmsize; /* memory size of this segment */ uint32_t fileoff; /* file offset of this segment */ uint32_t filesize; /* amount to map from the file */ vm_prot_t maxprot; /* maximum VM protection */ vm_prot_t initprot; /* initial VM protection */ uint32_t nsects; /* number of sections in segment */ uint32_t flags; /* flags */ }; /* * The 64-bit segment load command indicates that a part of this file is to be * mapped into a 64-bit task's address space. If the 64-bit segment has * sections then section_64 structures directly follow the 64-bit segment * command and their size is reflected in cmdsize. */ struct segment_command_64 { /* for 64-bit architectures */ uint32_t cmd; /* LC_SEGMENT_64 */ uint32_t cmdsize; /* includes sizeof section_64 structs */ char segname[16]; /* segment name */ uint64_t vmaddr; /* memory address of this segment */ uint64_t vmsize; /* memory size of this segment */ uint64_t fileoff; /* file offset of this segment */ uint64_t filesize; /* amount to map from the file */ vm_prot_t maxprot; /* maximum VM protection */ vm_prot_t initprot; /* initial VM protection */ uint32_t nsects; /* number of sections in segment */ uint32_t flags; /* flags */ }; /* Constants for the flags field of the segment_command */ #define SG_HIGHVM 0x1 /* the file contents for this segment is for the high part of the VM space, the low part is zero filled (for stacks in core files) */ #define SG_FVMLIB 0x2 /* this segment is the VM that is allocated by a fixed VM library, for overlap checking in the link editor */ #define SG_NORELOC 0x4 /* this segment has nothing that was relocated in it and nothing relocated to it, that is it maybe safely replaced without relocation*/ #define SG_PROTECTED_VERSION_1 0x8 /* This segment is protected. If the segment starts at file offset 0, the first page of the segment is not protected. All other pages of the segment are protected. */ #define SG_READ_ONLY 0x10 /* This segment is made read-only after fixups */ /* * A segment is made up of zero or more sections. Non-MH_OBJECT files have * all of their segments with the proper sections in each, and padded to the * specified segment alignment when produced by the link editor. The first * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header * and load commands of the object file before its first section. The zero * fill sections are always last in their segment (in all formats). This * allows the zeroed segment padding to be mapped into memory where zero fill * sections might be. The gigabyte zero fill sections, those with the section * type S_GB_ZEROFILL, can only be in a segment with sections of this type. * These segments are then placed after all other segments. * * The MH_OBJECT format has all of its sections in one segment for * compactness. There is no padding to a specified segment boundary and the * mach_header and load commands are not part of the segment. * * Sections with the same section name, sectname, going into the same segment, * segname, are combined by the link editor. The resulting section is aligned * to the maximum alignment of the combined sections and is the new section's * alignment. The combined sections are aligned to their original alignment in * the combined section. Any padded bytes to get the specified alignment are * zeroed. * * The format of the relocation entries referenced by the reloff and nreloc * fields of the section structure for mach object files is described in the * header file <reloc.h>. */ struct section { /* for 32-bit architectures */ char sectname[16]; /* name of this section */ char segname[16]; /* segment this section goes in */ uint32_t addr; /* memory address of this section */ uint32_t size; /* size in bytes of this section */ uint32_t offset; /* file offset of this section */ uint32_t align; /* section alignment (power of 2) */ uint32_t reloff; /* file offset of relocation entries */ uint32_t nreloc; /* number of relocation entries */ uint32_t flags; /* flags (section type and attributes)*/ uint32_t reserved1; /* reserved (for offset or index) */ uint32_t reserved2; /* reserved (for count or sizeof) */ }; struct section_64 { /* for 64-bit architectures */ char sectname[16]; /* name of this section */ char segname[16]; /* segment this section goes in */ uint64_t addr; /* memory address of this section */ uint64_t size; /* size in bytes of this section */ uint32_t offset; /* file offset of this section */ uint32_t align; /* section alignment (power of 2) */ uint32_t reloff; /* file offset of relocation entries */ uint32_t nreloc; /* number of relocation entries */ uint32_t flags; /* flags (section type and attributes)*/ uint32_t reserved1; /* reserved (for offset or index) */ uint32_t reserved2; /* reserved (for count or sizeof) */ uint32_t reserved3; /* reserved */ }; /* * The flags field of a section structure is separated into two parts a section * type and section attributes. The section types are mutually exclusive (it * can only have one type) but the section attributes are not (it may have more * than one attribute). */ #define SECTION_TYPE 0x000000ff /* 256 section types */ #define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */ /* Constants for the type of a section */ #define S_REGULAR 0x0 /* regular section */ #define S_ZEROFILL 0x1 /* zero fill on demand section */ #define S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/ #define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */ #define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */ #define S_LITERAL_POINTERS 0x5 /* section with only pointers to */ /* literals */ /* * For the two types of symbol pointers sections and the symbol stubs section * they have indirect symbol table entries. For each of the entries in the * section the indirect symbol table entries, in corresponding order in the * indirect symbol table, start at the index stored in the reserved1 field * of the section structure. Since the indirect symbol table entries * correspond to the entries in the section the number of indirect symbol table * entries is inferred from the size of the section divided by the size of the * entries in the section. For symbol pointers sections the size of the entries * in the section is 4 bytes and for symbol stubs sections the byte size of the * stubs is stored in the reserved2 field of the section structure. */ #define S_NON_LAZY_SYMBOL_POINTERS 0x6 /* section with only non-lazy symbol pointers */ #define S_LAZY_SYMBOL_POINTERS 0x7 /* section with only lazy symbol pointers */ #define S_SYMBOL_STUBS 0x8 /* section with only symbol stubs, byte size of stub in the reserved2 field */ #define S_MOD_INIT_FUNC_POINTERS 0x9 /* section with only function pointers for initialization*/ #define S_MOD_TERM_FUNC_POINTERS 0xa /* section with only function pointers for termination */ #define S_COALESCED 0xb /* section contains symbols that are to be coalesced */ #define S_GB_ZEROFILL 0xc /* zero fill on demand section (that can be larger than 4 gigabytes) */ #define S_INTERPOSING 0xd /* section with only pairs of function pointers for interposing */ #define S_16BYTE_LITERALS 0xe /* section with only 16 byte literals */ #define S_DTRACE_DOF 0xf /* section contains DTrace Object Format */ #define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 /* section with only lazy symbol pointers to lazy loaded dylibs */ /* * Section types to support thread local variables */ #define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial values for TLVs */ #define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial values for TLVs */ #define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */ #define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV descriptors */ #define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call to initialize TLV values */ #define S_INIT_FUNC_OFFSETS 0x16 /* 32-bit offsets to initializers */ /* * Constants for the section attributes part of the flags field of a section * structure. */ #define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */ #define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* section contains only true machine instructions */ #define S_ATTR_NO_TOC 0x40000000 /* section contains coalesced symbols that are not to be in a ranlib table of contents */ #define S_ATTR_STRIP_STATIC_SYMS 0x20000000 /* ok to strip static symbols in this section in files with the MH_DYLDLINK flag */ #define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */ #define S_ATTR_LIVE_SUPPORT 0x08000000 /* blocks are live if they reference live blocks */ #define S_ATTR_SELF_MODIFYING_CODE 0x04000000 /* Used with i386 code stubs written on by dyld */ /* * If a segment contains any sections marked with S_ATTR_DEBUG then all * sections in that segment must have this attribute. No section other than * a section marked with this attribute may reference the contents of this * section. A section with this attribute may contain no symbols and must have * a section type S_REGULAR. The static linker will not copy section contents * from sections with this attribute into its output file. These sections * generally contain DWARF debugging info. */ #define S_ATTR_DEBUG 0x02000000 /* a debug section */ #define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */ #define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* section contains some machine instructions */ #define S_ATTR_EXT_RELOC 0x00000200 /* section has external relocation entries */ #define S_ATTR_LOC_RELOC 0x00000100 /* section has local relocation entries */ /* * The names of segments and sections in them are mostly meaningless to the * link-editor. But there are few things to support traditional UNIX * executables that require the link-editor and assembler to use some names * agreed upon by convention. * * The initial protection of the "__TEXT" segment has write protection turned * off (not writeable). * * The link-editor will allocate common symbols at the end of the "__common" * section in the "__DATA" segment. It will create the section and segment * if needed. */ /* The currently known segment names and the section names in those segments */ #define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */ /* protections and catches NULL */ /* references for MH_EXECUTE files */ #define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */ #define SECT_TEXT "__text" /* the real text part of the text */ /* section no headers, and no padding */ #define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */ /* section */ #define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */ /* fvmlib initialization */ /* section */ #define SEG_DATA "__DATA" /* the tradition UNIX data segment */ #define SECT_DATA "__data" /* the real initialized data section */ /* no padding, no bss overlap */ #define SECT_BSS "__bss" /* the real uninitialized data section*/ /* no padding */ #define SECT_COMMON "__common" /* the section common symbols are */ /* allocated in by the link editor */ #define SEG_OBJC "__OBJC" /* objective-C runtime segment */ #define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */ #define SECT_OBJC_MODULES "__module_info" /* module information */ #define SECT_OBJC_STRINGS "__selector_strs" /* string table */ #define SECT_OBJC_REFS "__selector_refs" /* string table */ #define SEG_ICON "__ICON" /* the icon segment */ #define SECT_ICON_HEADER "__header" /* the icon headers */ #define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */ #define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */ /* created and maintained by the link */ /* editor. Created with -seglinkedit */ /* option to ld(1) for MH_EXECUTE and */ /* FVMLIB file types only */ #define SEG_LINKINFO "__LINKINFO" /* the segment overlapping with linkedit */ /* containing linking information */ #define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */ #define SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */ /* modifing code stubs that has read, */ /* write and execute permissions */ /* * Fixed virtual memory shared libraries are identified by two things. The * target pathname (the name of the library as found for execution), and the * minor version number. The address of where the headers are loaded is in * header_addr. (THIS IS OBSOLETE and no longer supported). */ struct fvmlib { union lc_str name; /* library's target pathname */ uint32_t minor_version; /* library's minor version number */ uint32_t header_addr; /* library's header address */ }; /* * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header) * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library. * An object that uses a fixed virtual shared library also contains a * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses. * (THIS IS OBSOLETE and no longer supported). */ struct fvmlib_command { uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */ uint32_t cmdsize; /* includes pathname string */ struct fvmlib fvmlib; /* the library identification */ }; /* * Dynamicly linked shared libraries are identified by two things. The * pathname (the name of the library as found for execution), and the * compatibility version number. The pathname must match and the compatibility * number in the user of the library must be greater than or equal to the * library being used. The time stamp is used to record the time a library was * built and copied into user so it can be use to determined if the library used * at runtime is exactly the same as used to built the program. */ struct dylib { union lc_str name; /* library's path name */ uint32_t timestamp; /* library's build time stamp */ uint32_t current_version; /* library's current version number */ uint32_t compatibility_version; /* library's compatibility vers number*/ }; /* * A dynamically linked shared library (filetype == MH_DYLIB in the mach header) * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library. * An object that uses a dynamically linked shared library also contains a * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or * LC_REEXPORT_DYLIB) for each library it uses. */ struct dylib_command { uint32_t cmd; /* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB, LC_REEXPORT_DYLIB */ uint32_t cmdsize; /* includes pathname string */ struct dylib dylib; /* the library identification */ }; /* * A dynamically linked shared library may be a subframework of an umbrella * framework. If so it will be linked with "-umbrella umbrella_name" where * Where "umbrella_name" is the name of the umbrella framework. A subframework * can only be linked against by its umbrella framework or other subframeworks * that are part of the same umbrella framework. Otherwise the static link * editor produces an error and states to link against the umbrella framework. * The name of the umbrella framework for subframeworks is recorded in the * following structure. */ struct sub_framework_command { uint32_t cmd; /* LC_SUB_FRAMEWORK */ uint32_t cmdsize; /* includes umbrella string */ union lc_str umbrella; /* the umbrella framework name */ }; /* * For dynamically linked shared libraries that are subframework of an umbrella * framework they can allow clients other than the umbrella framework or other * subframeworks in the same umbrella framework. To do this the subframework * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load * command is created for each -allowable_client flag. The client_name is * usually a framework name. It can also be a name used for bundles clients * where the bundle is built with "-client_name client_name". */ struct sub_client_command { uint32_t cmd; /* LC_SUB_CLIENT */ uint32_t cmdsize; /* includes client string */ union lc_str client; /* the client name */ }; /* * A dynamically linked shared library may be a sub_umbrella of an umbrella * framework. If so it will be linked with "-sub_umbrella umbrella_name" where * Where "umbrella_name" is the name of the sub_umbrella framework. When * staticly linking when -twolevel_namespace is in effect a twolevel namespace * umbrella framework will only cause its subframeworks and those frameworks * listed as sub_umbrella frameworks to be implicited linked in. Any other * dependent dynamic libraries will not be linked it when -twolevel_namespace * is in effect. The primary library recorded by the static linker when * resolving a symbol in these libraries will be the umbrella framework. * Zero or more sub_umbrella frameworks may be use by an umbrella framework. * The name of a sub_umbrella framework is recorded in the following structure. */ struct sub_umbrella_command { uint32_t cmd; /* LC_SUB_UMBRELLA */ uint32_t cmdsize; /* includes sub_umbrella string */ union lc_str sub_umbrella; /* the sub_umbrella framework name */ }; /* * A dynamically linked shared library may be a sub_library of another shared * library. If so it will be linked with "-sub_library library_name" where * Where "library_name" is the name of the sub_library shared library. When * staticly linking when -twolevel_namespace is in effect a twolevel namespace * shared library will only cause its subframeworks and those frameworks * listed as sub_umbrella frameworks and libraries listed as sub_libraries to * be implicited linked in. Any other dependent dynamic libraries will not be * linked it when -twolevel_namespace is in effect. The primary library * recorded by the static linker when resolving a symbol in these libraries * will be the umbrella framework (or dynamic library). Zero or more sub_library * shared libraries may be use by an umbrella framework or (or dynamic library). * The name of a sub_library framework is recorded in the following structure. * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc". */ struct sub_library_command { uint32_t cmd; /* LC_SUB_LIBRARY */ uint32_t cmdsize; /* includes sub_library string */ union lc_str sub_library; /* the sub_library name */ }; /* * A program (filetype == MH_EXECUTE) that is * prebound to its dynamic libraries has one of these for each library that * the static linker used in prebinding. It contains a bit vector for the * modules in the library. The bits indicate which modules are bound (1) and * which are not (0) from the library. The bit for module 0 is the low bit * of the first byte. So the bit for the Nth module is: * (linked_modules[N/8] >> N%8) & 1 */ struct prebound_dylib_command { uint32_t cmd; /* LC_PREBOUND_DYLIB */ uint32_t cmdsize; /* includes strings */ union lc_str name; /* library's path name */ uint32_t nmodules; /* number of modules in library */ union lc_str linked_modules; /* bit vector of linked modules */ }; /* * A program that uses a dynamic linker contains a dylinker_command to identify * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER). * A file can have at most one of these. * This struct is also used for the LC_DYLD_ENVIRONMENT load command and * contains string for dyld to treat like environment variable. */ struct dylinker_command { uint32_t cmd; /* LC_ID_DYLINKER, LC_LOAD_DYLINKER or LC_DYLD_ENVIRONMENT */ uint32_t cmdsize; /* includes pathname string */ union lc_str name; /* dynamic linker's path name */ }; /* * Thread commands contain machine-specific data structures suitable for * use in the thread state primitives. The machine specific data structures * follow the struct thread_command as follows. * Each flavor of machine specific data structure is preceded by an uint32_t * constant for the flavor of that data structure, an uint32_t that is the * count of uint32_t's of the size of the state data structure and then * the state data structure follows. This triple may be repeated for many * flavors. The constants for the flavors, counts and state data structure * definitions are expected to be in the header file <machine/thread_status.h>. * These machine specific data structures sizes must be multiples of * 4 bytes. The cmdsize reflects the total size of the thread_command * and all of the sizes of the constants for the flavors, counts and state * data structures. * * For executable objects that are unix processes there will be one * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor. * This is the same as a LC_THREAD, except that a stack is automatically * created (based on the shell's limit for the stack size). Command arguments * and environment variables are copied onto that stack. */ struct thread_command { uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */ uint32_t cmdsize; /* total size of this command */ /* uint32_t flavor flavor of thread state */ /* uint32_t count count of uint32_t's in thread state */ /* struct XXX_thread_state state thread state for this flavor */ /* ... */ }; /* * The routines command contains the address of the dynamic shared library * initialization routine and an index into the module table for the module * that defines the routine. Before any modules are used from the library the * dynamic linker fully binds the module that defines the initialization routine * and then calls it. This gets called before any module initialization * routines (used for C++ static constructors) in the library. */ struct routines_command { /* for 32-bit architectures */ uint32_t cmd; /* LC_ROUTINES */ uint32_t cmdsize; /* total size of this command */ uint32_t init_address; /* address of initialization routine */ uint32_t init_module; /* index into the module table that */ /* the init routine is defined in */ uint32_t reserved1; uint32_t reserved2; uint32_t reserved3; uint32_t reserved4; uint32_t reserved5; uint32_t reserved6; }; /* * The 64-bit routines command. Same use as above. */ struct routines_command_64 { /* for 64-bit architectures */ uint32_t cmd; /* LC_ROUTINES_64 */ uint32_t cmdsize; /* total size of this command */ uint64_t init_address; /* address of initialization routine */ uint64_t init_module; /* index into the module table that */ /* the init routine is defined in */ uint64_t reserved1; uint64_t reserved2; uint64_t reserved3; uint64_t reserved4; uint64_t reserved5; uint64_t reserved6; }; /* * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD * "stab" style symbol table information as described in the header files * <nlist.h> and <stab.h>. */ struct symtab_command { uint32_t cmd; /* LC_SYMTAB */ uint32_t cmdsize; /* sizeof(struct symtab_command) */ uint32_t symoff; /* symbol table offset */ uint32_t nsyms; /* number of symbol table entries */ uint32_t stroff; /* string table offset */ uint32_t strsize; /* string table size in bytes */ }; /* * This is the second set of the symbolic information which is used to support * the data structures for the dynamically link editor. * * The original set of symbolic information in the symtab_command which contains * the symbol and string tables must also be present when this load command is * present. When this load command is present the symbol table is organized * into three groups of symbols: * local symbols (static and debugging symbols) - grouped by module * defined external symbols - grouped by module (sorted by name if not lib) * undefined external symbols (sorted by name if MH_BINDATLOAD is not set, * and in order the were seen by the static * linker if MH_BINDATLOAD is set) * In this load command there are offsets and counts to each of the three groups * of symbols. * * This load command contains a the offsets and sizes of the following new * symbolic information tables: * table of contents * module table * reference symbol table * indirect symbol table * The first three tables above (the table of contents, module table and * reference symbol table) are only present if the file is a dynamically linked * shared library. For executable and object modules, which are files * containing only one module, the information that would be in these three * tables is determined as follows: * table of contents - the defined external symbols are sorted by name * module table - the file contains only one module so everything in the * file is part of the module. * reference symbol table - is the defined and undefined external symbols * * For dynamically linked shared library files this load command also contains * offsets and sizes to the pool of relocation entries for all sections * separated into two groups: * external relocation entries * local relocation entries * For executable and object modules the relocation entries continue to hang * off the section structures. */ struct dysymtab_command { uint32_t cmd; /* LC_DYSYMTAB */ uint32_t cmdsize; /* sizeof(struct dysymtab_command) */ /* * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command * are grouped into the following three groups: * local symbols (further grouped by the module they are from) * defined external symbols (further grouped by the module they are from) * undefined symbols * * The local symbols are used only for debugging. The dynamic binding * process may have to use them to indicate to the debugger the local * symbols for a module that is being bound. * * The last two groups are used by the dynamic binding process to do the * binding (indirectly through the module table and the reference symbol * table when this is a dynamically linked shared library file). */ uint32_t ilocalsym; /* index to local symbols */ uint32_t nlocalsym; /* number of local symbols */ uint32_t iextdefsym;/* index to externally defined symbols */ uint32_t nextdefsym;/* number of externally defined symbols */ uint32_t iundefsym; /* index to undefined symbols */ uint32_t nundefsym; /* number of undefined symbols */ /* * For the for the dynamic binding process to find which module a symbol * is defined in the table of contents is used (analogous to the ranlib * structure in an archive) which maps defined external symbols to modules * they are defined in. This exists only in a dynamically linked shared * library file. For executable and object modules the defined external * symbols are sorted by name and is use as the table of contents. */ uint32_t tocoff; /* file offset to table of contents */ uint32_t ntoc; /* number of entries in table of contents */ /* * To support dynamic binding of "modules" (whole object files) the symbol * table must reflect the modules that the file was created from. This is * done by having a module table that has indexes and counts into the merged * tables for each module. The module structure that these two entries * refer to is described below. This exists only in a dynamically linked * shared library file. For executable and object modules the file only * contains one module so everything in the file belongs to the module. */ uint32_t modtaboff; /* file offset to module table */ uint32_t nmodtab; /* number of module table entries */ /* * To support dynamic module binding the module structure for each module * indicates the external references (defined and undefined) each module * makes. For each module there is an offset and a count into the * reference symbol table for the symbols that the module references. * This exists only in a dynamically linked shared library file. For * executable and object modules the defined external symbols and the * undefined external symbols indicates the external references. */ uint32_t extrefsymoff; /* offset to referenced symbol table */ uint32_t nextrefsyms; /* number of referenced symbol table entries */ /* * The sections that contain "symbol pointers" and "routine stubs" have * indexes and (implied counts based on the size of the section and fixed * size of the entry) into the "indirect symbol" table for each pointer * and stub. For every section of these two types the index into the * indirect symbol table is stored in the section header in the field * reserved1. An indirect symbol table entry is simply a 32bit index into * the symbol table to the symbol that the pointer or stub is referring to. * The indirect symbol table is ordered to match the entries in the section. */ uint32_t indirectsymoff; /* file offset to the indirect symbol table */ uint32_t nindirectsyms; /* number of indirect symbol table entries */ /* * To support relocating an individual module in a library file quickly the * external relocation entries for each module in the library need to be * accessed efficiently. Since the relocation entries can't be accessed * through the section headers for a library file they are separated into * groups of local and external entries further grouped by module. In this * case the presents of this load command who's extreloff, nextrel, * locreloff and nlocrel fields are non-zero indicates that the relocation * entries of non-merged sections are not referenced through the section * structures (and the reloff and nreloc fields in the section headers are * set to zero). * * Since the relocation entries are not accessed through the section headers * this requires the r_address field to be something other than a section * offset to identify the item to be relocated. In this case r_address is * set to the offset from the vmaddr of the first LC_SEGMENT command. * For MH_SPLIT_SEGS images r_address is set to the the offset from the * vmaddr of the first read-write LC_SEGMENT command. * * The relocation entries are grouped by module and the module table * entries have indexes and counts into them for the group of external * relocation entries for that the module. * * For sections that are merged across modules there must not be any * remaining external relocation entries for them (for merged sections * remaining relocation entries must be local). */ uint32_t extreloff; /* offset to external relocation entries */ uint32_t nextrel; /* number of external relocation entries */ /* * All the local relocation entries are grouped together (they are not * grouped by their module since they are only used if the object is moved * from it staticly link edited address). */ uint32_t locreloff; /* offset to local relocation entries */ uint32_t nlocrel; /* number of local relocation entries */ }; /* * An indirect symbol table entry is simply a 32bit index into the symbol table * to the symbol that the pointer or stub is refering to. Unless it is for a * non-lazy symbol pointer section for a defined symbol which strip(1) as * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. */ #define INDIRECT_SYMBOL_LOCAL 0x80000000 #define INDIRECT_SYMBOL_ABS 0x40000000 /* a table of contents entry */ struct dylib_table_of_contents { uint32_t symbol_index; /* the defined external symbol (index into the symbol table) */ uint32_t module_index; /* index into the module table this symbol is defined in */ }; /* a module table entry */ struct dylib_module { uint32_t module_name; /* the module name (index into string table) */ uint32_t iextdefsym; /* index into externally defined symbols */ uint32_t nextdefsym; /* number of externally defined symbols */ uint32_t irefsym; /* index into reference symbol table */ uint32_t nrefsym; /* number of reference symbol table entries */ uint32_t ilocalsym; /* index into symbols for local symbols */ uint32_t nlocalsym; /* number of local symbols */ uint32_t iextrel; /* index into external relocation entries */ uint32_t nextrel; /* number of external relocation entries */ uint32_t iinit_iterm; /* low 16 bits are the index into the init section, high 16 bits are the index into the term section */ uint32_t ninit_nterm; /* low 16 bits are the number of init section entries, high 16 bits are the number of term section entries */ uint32_t /* for this module address of the start of */ objc_module_info_addr; /* the (__OBJC,__module_info) section */ uint32_t /* for this module size of */ objc_module_info_size; /* the (__OBJC,__module_info) section */ }; /* a 64-bit module table entry */ struct dylib_module_64 { uint32_t module_name; /* the module name (index into string table) */ uint32_t iextdefsym; /* index into externally defined symbols */ uint32_t nextdefsym; /* number of externally defined symbols */ uint32_t irefsym; /* index into reference symbol table */ uint32_t nrefsym; /* number of reference symbol table entries */ uint32_t ilocalsym; /* index into symbols for local symbols */ uint32_t nlocalsym; /* number of local symbols */ uint32_t iextrel; /* index into external relocation entries */ uint32_t nextrel; /* number of external relocation entries */ uint32_t iinit_iterm; /* low 16 bits are the index into the init section, high 16 bits are the index into the term section */ uint32_t ninit_nterm; /* low 16 bits are the number of init section entries, high 16 bits are the number of term section entries */ uint32_t /* for this module size of */ objc_module_info_size; /* the (__OBJC,__module_info) section */ uint64_t /* for this module address of the start of */ objc_module_info_addr; /* the (__OBJC,__module_info) section */ }; /* * The entries in the reference symbol table are used when loading the module * (both by the static and dynamic link editors) and if the module is unloaded * or replaced. Therefore all external symbols (defined and undefined) are * listed in the module's reference table. The flags describe the type of * reference that is being made. The constants for the flags are defined in * <mach-o/nlist.h> as they are also used for symbol table entries. */ struct dylib_reference { uint32_t isym:24, /* index into the symbol table */ flags:8; /* flags to indicate the type of reference */ }; /* * The twolevel_hints_command contains the offset and number of hints in the * two-level namespace lookup hints table. */ struct twolevel_hints_command { uint32_t cmd; /* LC_TWOLEVEL_HINTS */ uint32_t cmdsize; /* sizeof(struct twolevel_hints_command) */ uint32_t offset; /* offset to the hint table */ uint32_t nhints; /* number of hints in the hint table */ }; /* * The entries in the two-level namespace lookup hints table are twolevel_hint * structs. These provide hints to the dynamic link editor where to start * looking for an undefined symbol in a two-level namespace image. The * isub_image field is an index into the sub-images (sub-frameworks and * sub-umbrellas list) that made up the two-level image that the undefined * symbol was found in when it was built by the static link editor. If * isub-image is 0 the the symbol is expected to be defined in library and not * in the sub-images. If isub-image is non-zero it is an index into the array * of sub-images for the umbrella with the first index in the sub-images being * 1. The array of sub-images is the ordered list of sub-images of the umbrella * that would be searched for a symbol that has the umbrella recorded as its * primary library. The table of contents index is an index into the * library's table of contents. This is used as the starting point of the * binary search or a directed linear search. */ struct twolevel_hint { uint32_t isub_image:8, /* index into the sub images */ itoc:24; /* index into the table of contents */ }; /* * The prebind_cksum_command contains the value of the original check sum for * prebound files or zero. When a prebound file is first created or modified * for other than updating its prebinding information the value of the check sum * is set to zero. When the file has it prebinding re-done and if the value of * the check sum is zero the original check sum is calculated and stored in * cksum field of this load command in the output file. If when the prebinding * is re-done and the cksum field is non-zero it is left unchanged from the * input file. */ struct prebind_cksum_command { uint32_t cmd; /* LC_PREBIND_CKSUM */ uint32_t cmdsize; /* sizeof(struct prebind_cksum_command) */ uint32_t cksum; /* the check sum or zero */ }; /* * The uuid load command contains a single 128-bit unique random number that * identifies an object produced by the static link editor. */ struct uuid_command { uint32_t cmd; /* LC_UUID */ uint32_t cmdsize; /* sizeof(struct uuid_command) */ uint8_t uuid[16]; /* the 128-bit uuid */ }; /* * The rpath_command contains a path which at runtime should be added to * the current run path used to find @rpath prefixed dylibs. */ struct rpath_command { uint32_t cmd; /* LC_RPATH */ uint32_t cmdsize; /* includes string */ union lc_str path; /* path to add to run path */ }; /* * The linkedit_data_command contains the offsets and sizes of a blob * of data in the __LINKEDIT segment. */ struct linkedit_data_command { uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, LC_FUNCTION_STARTS, LC_DATA_IN_CODE, LC_DYLIB_CODE_SIGN_DRS, LC_LINKER_OPTIMIZATION_HINT, LC_DYLD_EXPORTS_TRIE, or LC_DYLD_CHAINED_FIXUPS. */ uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */ uint32_t dataoff; /* file offset of data in __LINKEDIT segment */ uint32_t datasize; /* file size of data in __LINKEDIT segment */ }; struct fileset_entry_command { uint32_t cmd; /* LC_FILESET_ENTRY */ uint32_t cmdsize; /* includes id string */ uint64_t vmaddr; /* memory address of the dylib */ uint64_t fileoff; /* file offset of the dylib */ union lc_str entry_id; /* contained entry id */ uint32_t reserved; /* entry_id is 32-bits long, so this is the reserved padding */ }; /* * The encryption_info_command contains the file offset and size of an * of an encrypted segment. */ struct encryption_info_command { uint32_t cmd; /* LC_ENCRYPTION_INFO */ uint32_t cmdsize; /* sizeof(struct encryption_info_command) */ uint32_t cryptoff; /* file offset of encrypted range */ uint32_t cryptsize; /* file size of encrypted range */ uint32_t cryptid; /* which enryption system, 0 means not-encrypted yet */ }; /* * The encryption_info_command_64 contains the file offset and size of an * of an encrypted segment (for use in x86_64 targets). */ struct encryption_info_command_64 { uint32_t cmd; /* LC_ENCRYPTION_INFO_64 */ uint32_t cmdsize; /* sizeof(struct encryption_info_command_64) */ uint32_t cryptoff; /* file offset of encrypted range */ uint32_t cryptsize; /* file size of encrypted range */ uint32_t cryptid; /* which enryption system, 0 means not-encrypted yet */ uint32_t pad; /* padding to make this struct's size a multiple of 8 bytes */ }; /* * The version_min_command contains the min OS version on which this * binary was built to run. */ struct version_min_command { uint32_t cmd; /* LC_VERSION_MIN_MACOSX or LC_VERSION_MIN_IPHONEOS or LC_VERSION_MIN_WATCHOS or LC_VERSION_MIN_TVOS */ uint32_t cmdsize; /* sizeof(struct min_version_command) */ uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ }; /* * The build_version_command contains the min OS version on which this * binary was built to run for its platform. The list of known platforms and * tool values following it. */ struct build_version_command { uint32_t cmd; /* LC_BUILD_VERSION */ uint32_t cmdsize; /* sizeof(struct build_version_command) plus */ /* ntools * sizeof(struct build_tool_version) */ uint32_t platform; /* platform */ uint32_t minos; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ uint32_t ntools; /* number of tool entries following this */ }; struct build_tool_version { uint32_t tool; /* enum for the tool */ uint32_t version; /* version number of the tool */ }; /* Known values for the platform field above. */ #define PLATFORM_MACOS 1 #define PLATFORM_IOS 2 #define PLATFORM_TVOS 3 #define PLATFORM_WATCHOS 4 #define PLATFORM_BRIDGEOS 5 #define PLATFORM_MACCATALYST 6 #define PLATFORM_IOSSIMULATOR 7 #define PLATFORM_TVOSSIMULATOR 8 #define PLATFORM_WATCHOSSIMULATOR 9 #define PLATFORM_DRIVERKIT 10 #define PLATFORM_MAX PLATFORM_DRIVERKIT /* Addition of simulated platfrom also needs to update proc_is_simulated() */ /* Known values for the tool field above. */ #define TOOL_CLANG 1 #define TOOL_SWIFT 2 #define TOOL_LD 3 /* * The dyld_info_command contains the file offsets and sizes of * the new compressed form of the information dyld needs to * load the image. This information is used by dyld on Mac OS X * 10.6 and later. All information pointed to by this command * is encoded using byte streams, so no endian swapping is needed * to interpret it. */ struct dyld_info_command { uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */ uint32_t cmdsize; /* sizeof(struct dyld_info_command) */ /* * Dyld rebases an image whenever dyld loads it at an address different * from its preferred address. The rebase information is a stream * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_. * Conceptually the rebase information is a table of tuples: * <seg-index, seg-offset, type> * The opcodes are a compressed way to encode the table by only * encoding when a column changes. In addition simple patterns * like "every n'th offset for m times" can be encoded in a few * bytes. */ uint32_t rebase_off; /* file offset to rebase info */ uint32_t rebase_size; /* size of rebase info */ /* * Dyld binds an image during the loading process, if the image * requires any pointers to be initialized to symbols in other images. * The bind information is a stream of byte sized * opcodes whose symbolic names start with BIND_OPCODE_. * Conceptually the bind information is a table of tuples: * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend> * The opcodes are a compressed way to encode the table by only * encoding when a column changes. In addition simple patterns * like for runs of pointers initialzed to the same value can be * encoded in a few bytes. */ uint32_t bind_off; /* file offset to binding info */ uint32_t bind_size; /* size of binding info */ /* * Some C++ programs require dyld to unique symbols so that all * images in the process use the same copy of some code/data. * This step is done after binding. The content of the weak_bind * info is an opcode stream like the bind_info. But it is sorted * alphabetically by symbol name. This enable dyld to walk * all images with weak binding information in order and look * for collisions. If there are no collisions, dyld does * no updating. That means that some fixups are also encoded * in the bind_info. For instance, all calls to "operator new" * are first bound to libstdc++.dylib using the information * in bind_info. Then if some image overrides operator new * that is detected when the weak_bind information is processed * and the call to operator new is then rebound. */ uint32_t weak_bind_off; /* file offset to weak binding info */ uint32_t weak_bind_size; /* size of weak binding info */ /* * Some uses of external symbols do not need to be bound immediately. * Instead they can be lazily bound on first use. The lazy_bind * are contains a stream of BIND opcodes to bind all lazy symbols. * Normal use is that dyld ignores the lazy_bind section when * loading an image. Instead the static linker arranged for the * lazy pointer to initially point to a helper function which * pushes the offset into the lazy_bind area for the symbol * needing to be bound, then jumps to dyld which simply adds * the offset to lazy_bind_off to get the information on what * to bind. */ uint32_t lazy_bind_off; /* file offset to lazy binding info */ uint32_t lazy_bind_size; /* size of lazy binding infs */ /* * The symbols exported by a dylib are encoded in a trie. This * is a compact representation that factors out common prefixes. * It also reduces LINKEDIT pages in RAM because it encodes all * information (name, address, flags) in one small, contiguous range. * The export area is a stream of nodes. The first node sequentially * is the start node for the trie. * * Nodes for a symbol start with a uleb128 that is the length of * the exported symbol information for the string so far. * If there is no exported symbol, the node starts with a zero byte. * If there is exported info, it follows the length. * * First is a uleb128 containing flags. Normally, it is followed by * a uleb128 encoded offset which is location of the content named * by the symbol from the mach_header for the image. If the flags * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is * a uleb128 encoded library ordinal, then a zero terminated * UTF8 string. If the string is zero length, then the symbol * is re-export from the specified dylib with the same name. * If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following * the flags is two uleb128s: the stub offset and the resolver offset. * The stub is used by non-lazy pointers. The resolver is used * by lazy pointers and must be called to get the actual address to use. * * After the optional exported symbol information is a byte of * how many edges (0-255) that this node has leaving it, * followed by each edge. * Each edge is a zero terminated UTF8 of the addition chars * in the symbol, followed by a uleb128 offset for the node that * edge points to. * */ uint32_t export_off; /* file offset to lazy binding info */ uint32_t export_size; /* size of lazy binding infs */ }; /* * The following are used to encode rebasing information */ #define REBASE_TYPE_POINTER 1 #define REBASE_TYPE_TEXT_ABSOLUTE32 2 #define REBASE_TYPE_TEXT_PCREL32 3 #define REBASE_OPCODE_MASK 0xF0 #define REBASE_IMMEDIATE_MASK 0x0F #define REBASE_OPCODE_DONE 0x00 #define REBASE_OPCODE_SET_TYPE_IMM 0x10 #define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20 #define REBASE_OPCODE_ADD_ADDR_ULEB 0x30 #define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40 #define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50 #define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60 #define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70 #define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80 /* * The following are used to encode binding information */ #define BIND_TYPE_POINTER 1 #define BIND_TYPE_TEXT_ABSOLUTE32 2 #define BIND_TYPE_TEXT_PCREL32 3 #define BIND_SPECIAL_DYLIB_SELF 0 #define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 #define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 #define BIND_SPECIAL_DYLIB_WEAK_LOOKUP -3 #define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1 #define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8 #define BIND_OPCODE_MASK 0xF0 #define BIND_IMMEDIATE_MASK 0x0F #define BIND_OPCODE_DONE 0x00 #define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10 #define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20 #define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30 #define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40 #define BIND_OPCODE_SET_TYPE_IMM 0x50 #define BIND_OPCODE_SET_ADDEND_SLEB 0x60 #define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70 #define BIND_OPCODE_ADD_ADDR_ULEB 0x80 #define BIND_OPCODE_DO_BIND 0x90 #define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0 #define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0 #define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0 #define BIND_OPCODE_THREADED 0xD0 #define BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB 0x00 #define BIND_SUBOPCODE_THREADED_APPLY 0x01 /* * The following are used on the flags byte of a terminal node * in the export information. */ #define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03 #define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00 #define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01 #define EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE 0x02 #define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04 #define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08 #define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10 /* * The linker_option_command contains linker options embedded in object files. */ struct linker_option_command { uint32_t cmd; /* LC_LINKER_OPTION only used in MH_OBJECT filetypes */ uint32_t cmdsize; uint32_t count; /* number of strings */ /* concatenation of zero terminated UTF8 strings. Zero filled at end to align */ }; /* * The symseg_command contains the offset and size of the GNU style * symbol table information as described in the header file <symseg.h>. * The symbol roots of the symbol segments must also be aligned properly * in the file. So the requirement of keeping the offsets aligned to a * multiple of a 4 bytes translates to the length field of the symbol * roots also being a multiple of a long. Also the padding must again be * zeroed. (THIS IS OBSOLETE and no longer supported). */ struct symseg_command { uint32_t cmd; /* LC_SYMSEG */ uint32_t cmdsize; /* sizeof(struct symseg_command) */ uint32_t offset; /* symbol segment offset */ uint32_t size; /* symbol segment size in bytes */ }; /* * The ident_command contains a free format string table following the * ident_command structure. The strings are null terminated and the size of * the command is padded out with zero bytes to a multiple of 4 bytes/ * (THIS IS OBSOLETE and no longer supported). */ struct ident_command { uint32_t cmd; /* LC_IDENT */ uint32_t cmdsize; /* strings that follow this command */ }; /* * The fvmfile_command contains a reference to a file to be loaded at the * specified virtual address. (Presently, this command is reserved for * internal use. The kernel ignores this command when loading a program into * memory). */ struct fvmfile_command { uint32_t cmd; /* LC_FVMFILE */ uint32_t cmdsize; /* includes pathname string */ union lc_str name; /* files pathname */ uint32_t header_addr; /* files virtual address */ }; /* * The entry_point_command is a replacement for thread_command. * It is used for main executables to specify the location (file offset) * of main(). If -stack_size was used at link time, the stacksize * field will contain the stack size need for the main thread. */ struct entry_point_command { uint32_t cmd; /* LC_MAIN only used in MH_EXECUTE filetypes */ uint32_t cmdsize; /* 24 */ uint64_t entryoff; /* file (__TEXT) offset of main() */ uint64_t stacksize;/* if not zero, initial stack size */ }; /* * The source_version_command is an optional load command containing * the version of the sources used to build the binary. */ struct source_version_command { uint32_t cmd; /* LC_SOURCE_VERSION */ uint32_t cmdsize; /* 16 */ uint64_t version; /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */ }; /* * The LC_DATA_IN_CODE load commands uses a linkedit_data_command * to point to an array of data_in_code_entry entries. Each entry * describes a range of data in a code section. */ struct data_in_code_entry { uint32_t offset; /* from mach_header to start of data range*/ uint16_t length; /* number of bytes in data range */ uint16_t kind; /* a DICE_KIND_* value */ }; #define DICE_KIND_DATA 0x0001 #define DICE_KIND_JUMP_TABLE8 0x0002 #define DICE_KIND_JUMP_TABLE16 0x0003 #define DICE_KIND_JUMP_TABLE32 0x0004 #define DICE_KIND_ABS_JUMP_TABLE32 0x0005 /* * Sections of type S_THREAD_LOCAL_VARIABLES contain an array * of tlv_descriptor structures. */ struct tlv_descriptor { void* (*thunk)(struct tlv_descriptor*); unsigned long key; unsigned long offset; }; /* * LC_NOTE commands describe a region of arbitrary data included in a Mach-O * file. Its initial use is to record extra data in MH_CORE files. */ struct note_command { uint32_t cmd; /* LC_NOTE */ uint32_t cmdsize; /* sizeof(struct note_command) */ char data_owner[16]; /* owner name for this LC_NOTE */ uint64_t offset; /* file offset of this data */ uint64_t size; /* length of data region */ }; #endif /* _MACHO_LOADER_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/mach-o/reloc.h
/* * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ /* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */ /* * Copyright (c) 1993 Christopher G. Demetriou * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _MACHO_RELOC_H_ #define _MACHO_RELOC_H_ #include <stdint.h> /* * Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD * format. The modifications from the original format were changing the value * of the r_symbolnum field for "local" (r_extern == 0) relocation entries. * This modification is required to support symbols in an arbitrary number of * sections not just the three sections (text, data and bss) in a 4.3BSD file. * Also the last 4 bits have had the r_type tag added to them. */ struct relocation_info { int32_t r_address; /* offset in the section to what is being relocated */ uint32_t r_symbolnum:24, /* symbol index if r_extern == 1 or section ordinal if r_extern == 0 */ r_pcrel:1, /* was relocated pc relative already */ r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ r_extern:1, /* does not include value of sym referenced */ r_type:4; /* if not 0, machine specific relocation type */ }; #define R_ABS 0 /* absolute relocation type for Mach-O files */ /* * The r_address is not really the address as it's name indicates but an offset. * In 4.3BSD a.out objects this offset is from the start of the "segment" for * which relocation entry is for (text or data). For Mach-O object files it is * also an offset but from the start of the "section" for which the relocation * entry is for. See comments in <mach-o/loader.h> about the r_address feild * in images for used with the dynamic linker. * * In 4.3BSD a.out objects if r_extern is zero then r_symbolnum is an ordinal * for the segment the symbol being relocated is in. These ordinals are the * symbol types N_TEXT, N_DATA, N_BSS or N_ABS. In Mach-O object files these * ordinals refer to the sections in the object file in the order their section * structures appear in the headers of the object file they are in. The first * section has the ordinal 1, the second 2, and so on. This means that the * same ordinal in two different object files could refer to two different * sections. And further could have still different ordinals when combined * by the link-editor. The value R_ABS is used for relocation entries for * absolute symbols which need no further relocation. */ /* * For RISC machines some of the references are split across two instructions * and the instruction does not contain the complete value of the reference. * In these cases a second, or paired relocation entry, follows each of these * relocation entries, using a PAIR r_type, which contains the other part of the * reference not contained in the instruction. This other part is stored in the * pair's r_address field. The exact number of bits of the other part of the * reference store in the r_address field is dependent on the particular * relocation type for the particular architecture. */ /* * To make scattered loading by the link editor work correctly "local" * relocation entries can't be used when the item to be relocated is the value * of a symbol plus an offset (where the resulting expresion is outside the * block the link editor is moving, a blocks are divided at symbol addresses). * In this case. where the item is a symbol value plus offset, the link editor * needs to know more than just the section the symbol was defined. What is * needed is the actual value of the symbol without the offset so it can do the * relocation correctly based on where the value of the symbol got relocated to * not the value of the expression (with the offset added to the symbol value). * So for the NeXT 2.0 release no "local" relocation entries are ever used when * there is a non-zero offset added to a symbol. The "external" and "local" * relocation entries remain unchanged. * * The implemention is quite messy given the compatibility with the existing * relocation entry format. The ASSUMPTION is that a section will never be * bigger than 2**24 - 1 (0x00ffffff or 16,777,215) bytes. This assumption * allows the r_address (which is really an offset) to fit in 24 bits and high * bit of the r_address field in the relocation_info structure to indicate * it is really a scattered_relocation_info structure. Since these are only * used in places where "local" relocation entries are used and not where * "external" relocation entries are used the r_extern field has been removed. * * For scattered loading to work on a RISC machine where some of the references * are split across two instructions the link editor needs to be assured that * each reference has a unique 32 bit reference (that more than one reference is * NOT sharing the same high 16 bits for example) so it move each referenced * item independent of each other. Some compilers guarantees this but the * compilers don't so scattered loading can be done on those that do guarantee * this. */ #if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) /* * The reason for the ifdef's of __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are that * when stattered relocation entries were added the mistake of using a mask * against a structure that is made up of bit fields was used. To make this * design work this structure must be laid out in memory the same way so the * mask can be applied can check the same bit each time (r_scattered). */ #endif /* defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) */ #define R_SCATTERED 0x80000000 /* mask to be applied to the r_address field of a relocation_info structure to tell that is is really a scattered_relocation_info stucture */ struct scattered_relocation_info { #ifdef __BIG_ENDIAN__ uint32_t r_scattered:1, /* 1=scattered, 0=non-scattered (see above) */ r_pcrel:1, /* was relocated pc relative already */ r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ r_type:4, /* if not 0, machine specific relocation type */ r_address:24; /* offset in the section to what is being relocated */ int32_t r_value; /* the value the item to be relocated is refering to (without any offset added) */ #endif /* __BIG_ENDIAN__ */ #ifdef __LITTLE_ENDIAN__ uint32_t r_address:24, /* offset in the section to what is being relocated */ r_type:4, /* if not 0, machine specific relocation type */ r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ r_pcrel:1, /* was relocated pc relative already */ r_scattered:1; /* 1=scattered, 0=non-scattered (see above) */ int32_t r_value; /* the value the item to be relocated is refering to (without any offset added) */ #endif /* __LITTLE_ENDIAN__ */ }; /* * Relocation types used in a generic implementation. Relocation entries for * normal things use the generic relocation as discribed above and their r_type * is GENERIC_RELOC_VANILLA (a value of zero). * * Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support * the difference of two symbols defined in different sections. That is the * expression "symbol1 - symbol2 + constant" is a relocatable expression when * both symbols are defined in some section. For this type of relocation the * both relocations entries are scattered relocation entries. The value of * symbol1 is stored in the first relocation entry's r_value field and the * value of symbol2 is stored in the pair's r_value field. * * A special case for a prebound lazy pointer is needed to beable to set the * value of the lazy pointer back to its non-prebound state. This is done * using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation * entry where the r_value feild is the value of the lazy pointer not prebound. */ enum reloc_type_generic { GENERIC_RELOC_VANILLA, /* generic relocation as discribed above */ GENERIC_RELOC_PAIR, /* Only follows a GENERIC_RELOC_SECTDIFF */ GENERIC_RELOC_SECTDIFF, GENERIC_RELOC_PB_LA_PTR, /* prebound lazy pointer */ GENERIC_RELOC_LOCAL_SECTDIFF, GENERIC_RELOC_TLV /* thread local variables */ }; #endif /* _MACHO_RELOC_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/if_ether.h
/* * Copyright (c) 2000-2011 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 * $FreeBSD: src/sys/netinet/if_ether.h,v 1.24 1999/12/29 04:40:58 peter Exp $ */ #ifndef _NETINET_IF_ETHER_H_ #define _NETINET_IF_ETHER_H_ #include <sys/appleapiopts.h> #include <net/ethernet.h> #include <netinet/in.h> #include <net/if_arp.h> #define ea_byte ether_addr_octet /* * Macro to map an IP multicast address to an Ethernet multicast address. * The high-order 25 bits of the Ethernet address are statically assigned, * and the low-order 23 bits are taken from the low end of the IP address. */ #define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \ /* struct in_addr *ipaddr; */ \ /* u_char enaddr[ETHER_ADDR_LEN]; */ \ { \ (enaddr)[0] = 0x01; \ (enaddr)[1] = 0x00; \ (enaddr)[2] = 0x5e; \ (enaddr)[3] = ((const u_char *)ipaddr)[1] & 0x7f; \ (enaddr)[4] = ((const u_char *)ipaddr)[2]; \ (enaddr)[5] = ((const u_char *)ipaddr)[3]; \ } /* * Macro to map an IP6 multicast address to an Ethernet multicast address. * The high-order 16 bits of the Ethernet address are statically assigned, * and the low-order 32 bits are taken from the low end of the IP6 address. */ #define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \ /* struct in6_addr *ip6addr; */ \ /* u_char enaddr[ETHER_ADDR_LEN]; */ \ { \ (enaddr)[0] = 0x33; \ (enaddr)[1] = 0x33; \ (enaddr)[2] = ((const u_char *)ip6addr)[12]; \ (enaddr)[3] = ((const u_char *)ip6addr)[13]; \ (enaddr)[4] = ((const u_char *)ip6addr)[14]; \ (enaddr)[5] = ((const u_char *)ip6addr)[15]; \ } /* * Ethernet Address Resolution Protocol. * * See RFC 826 for protocol description. Structure below is adapted * to resolving internet addresses. Field names used correspond to * RFC 826. */ struct ether_arp { struct arphdr ea_hdr; /* fixed-size header */ u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */ u_char arp_spa[4]; /* sender protocol address */ u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */ u_char arp_tpa[4]; /* target protocol address */ }; #define arp_hrd ea_hdr.ar_hrd #define arp_pro ea_hdr.ar_pro #define arp_hln ea_hdr.ar_hln #define arp_pln ea_hdr.ar_pln #define arp_op ea_hdr.ar_op struct sockaddr_inarp { u_char sin_len; u_char sin_family; u_short sin_port; struct in_addr sin_addr; struct in_addr sin_srcaddr; u_short sin_tos; u_short sin_other; #define SIN_PROXY 0x1 #define SIN_ROUTER 0x2 }; /* * IP and ethernet specific routing flags */ #define RTF_USETRAILERS RTF_PROTO1 /* use trailers */ #define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */ #endif /* _NETINET_IF_ETHER_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/bootp.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Bootstrap Protocol (BOOTP). RFC 951. */ /* * HISTORY * * 14 May 1992 ? at NeXT * Added correct padding to struct nextvend. This is * needed for the i386 due to alignment differences wrt * the m68k. Also adjusted the size of the array fields * because the NeXT vendor area was overflowing the bootp * packet. */ #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/udp.h> #define iaddr_t struct in_addr struct bootp { u_char bp_op; /* packet opcode type */ #define BOOTREQUEST 1 #define BOOTREPLY 2 u_char bp_htype; /* hardware addr type */ u_char bp_hlen; /* hardware addr length */ u_char bp_hops; /* gateway hops */ u_int32_t bp_xid; /* transaction ID */ u_short bp_secs; /* seconds since boot began */ u_short bp_unused; iaddr_t bp_ciaddr; /* client IP address */ iaddr_t bp_yiaddr; /* 'your' IP address */ iaddr_t bp_siaddr; /* server IP address */ iaddr_t bp_giaddr; /* gateway IP address */ u_char bp_chaddr[16]; /* client hardware address */ u_char bp_sname[64]; /* server host name */ u_char bp_file[128]; /* boot file name */ u_char bp_vend[64]; /* vendor-specific area */ }; /* * UDP port numbers, server and client. */ #define IPPORT_BOOTPS 67 #define IPPORT_BOOTPC 68 /* * "vendor" data permitted for Stanford boot clients. */ struct vend { u_char v_magic[4]; /* magic number */ u_int32_t v_flags; /* flags/opcodes, etc. */ u_char v_unused[56]; /* currently unused */ }; #define VM_STANFORD "STAN" /* v_magic for Stanford */ /* v_flags values */ #define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */ #define VF_HELP 2 /* help me, I'm not registered */ #define NVMAXTEXT 55 /* don't change this, it just fits RFC951 */ struct nextvend { u_char nv_magic[4]; /* Magic number for vendor specificity */ u_char nv_version; /* NeXT protocol version */ /* * Round the beginning * of the union to a 16 * bit boundary due to * struct/union alignment * on the m68k. */ unsigned short :0; union { u_char NV0[58]; struct { u_char NV1_opcode; /* opcode - Version 1 */ u_char NV1_xid; /* transcation id */ u_char NV1_text[NVMAXTEXT]; /* text */ u_char NV1_null; /* null terminator */ } NV1; } nv_U; }; #define nv_unused nv_U.NV0 #define nv_opcode nv_U.NV1.NV1_opcode #define nv_xid nv_U.NV1.NV1_xid #define nv_text nv_U.NV1.NV1_text #define nv_null nv_U.NV1.NV1_null /* Magic number */ #define VM_NEXT "NeXT" /* v_magic for NeXT, Inc. */ /* Opcodes */ #define BPOP_OK 0 #define BPOP_QUERY 1 #define BPOP_QUERY_NE 2 #define BPOP_ERROR 3 struct bootp_packet { struct ip bp_ip; struct udphdr bp_udp; struct bootp bp_bootp; }; #define BOOTP_PKTSIZE (sizeof (struct bootp_packet)) /* backoffs must be masks */ #define BOOTP_MIN_BACKOFF 0x7ff /* 2.048 sec */ #define BOOTP_MAX_BACKOFF 0xffff /* 65.535 sec */ #define BOOTP_RETRY 6 /* # retries */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/in_systm.h
/* * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in_systm.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $ */ #ifndef _NETINET_IN_SYSTM_H_ #define _NETINET_IN_SYSTM_H_ #include <sys/appleapiopts.h> #include <sys/_types.h> /* * Miscellaneous internetwork * definitions for kernel. */ /* * Network types. * * Internally the system keeps counters in the headers with the bytes * swapped so that VAX instructions will work on them. It reverses * the bytes before transmission at each protocol level. The n_ types * represent the types with the bytes in ``high-ender'' order. */ typedef __uint16_t n_short; /* short as received from the net */ typedef __uint32_t n_long; /* long as received from the net */ typedef __uint32_t n_time; /* ms since 00:00 GMT, byte rev */ #endif /* _NETINET_IN_SYSTM_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/in_pcb.h
/* * Copyright (c) 2000-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.32.2.4 2001/08/13 16:26:17 ume Exp $ */ /* * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce * support for mandatory and extensible security protections. This notice * is included in support of clause 2.2 (b) of the Apple Public License, * Version 2.0. */ #ifndef _NETINET_IN_PCB_H_ #define _NETINET_IN_PCB_H_ #include <sys/appleapiopts.h> #include <netinet/in.h> #include <sys/socketvar.h> #include <sys/types.h> #include <sys/queue.h> #if IPSEC #include <netinet6/ipsec.h> /* for IPSEC */ #endif /* IPSEC */ #if NECP #include <net/necp.h> #endif typedef u_quad_t inp_gen_t; /* * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet. * So, AF_INET6 null laddr is also used as AF_INET null laddr, by utilizing * the following structure. */ struct in_addr_4in6 { u_int32_t ia46_pad32[3]; struct in_addr ia46_addr4; }; /* * Interface exported to userland by various protocols which use * inpcbs. Hack alert -- only define if struct xsocket is in scope. */ #pragma pack(4) #if defined(__LP64__) struct _inpcb_list_entry { u_int32_t le_next; u_int32_t le_prev; }; #define _INPCB_PTR(x) u_int32_t #define _INPCB_LIST_ENTRY(x) struct _inpcb_list_entry #else /* !__LP64__ */ #define _INPCB_PTR(x) x #define _INPCB_LIST_ENTRY(x) LIST_ENTRY(x) #endif /* !__LP64__ */ struct inpcbinfo; struct inpcbport; struct mbuf; struct ip6_pktopts; struct ip6_moptions; struct icmp6_filter; struct inpcbpolicy; struct inpcb { _INPCB_LIST_ENTRY(inpcb) inp_hash; /* hash list */ struct in_addr reserved1; /* reserved */ struct in_addr reserved2; /* reserved */ u_short inp_fport; /* foreign port */ u_short inp_lport; /* local port */ _INPCB_LIST_ENTRY(inpcb) inp_list; /* list for all peer PCBs */ _INPCB_PTR(caddr_t) inp_ppcb; /* per-protocol pcb */ _INPCB_PTR(struct inpcbinfo *) inp_pcbinfo; /* PCB list info */ _INPCB_PTR(void *) inp_socket; /* back pointer to socket */ u_char nat_owner; /* Used to NAT TCP/UDP traffic */ u_int32_t nat_cookie; /* Cookie stored and returned to NAT */ _INPCB_LIST_ENTRY(inpcb) inp_portlist; /* this PCB's local port list */ _INPCB_PTR(struct inpcbport *) inp_phd; /* head of this list */ inp_gen_t inp_gencnt; /* generation count of this instance */ int inp_flags; /* generic IP/datagram flags */ u_int32_t inp_flow; u_char inp_vflag; u_char inp_ip_ttl; /* time to live proto */ u_char inp_ip_p; /* protocol proto */ /* protocol dependent part */ union { /* foreign host table entry */ struct in_addr_4in6 inp46_foreign; struct in6_addr inp6_foreign; } inp_dependfaddr; union { /* local host table entry */ struct in_addr_4in6 inp46_local; struct in6_addr inp6_local; } inp_dependladdr; union { /* placeholder for routing entry */ u_char inp4_route[20]; u_char inp6_route[32]; } inp_dependroute; struct { /* type of service proto */ u_char inp4_ip_tos; /* IP options */ _INPCB_PTR(struct mbuf *) inp4_options; /* IP multicast options */ _INPCB_PTR(struct ip_moptions *) inp4_moptions; } inp_depend4; struct { /* IP options */ _INPCB_PTR(struct mbuf *) inp6_options; u_int8_t inp6_hlim; u_int8_t unused_uint8_1; ushort unused_uint16_1; /* IP6 options for outgoing packets */ _INPCB_PTR(struct ip6_pktopts *) inp6_outputopts; /* IP multicast options */ _INPCB_PTR(struct ip6_moptions *) inp6_moptions; /* ICMPv6 code type filter */ _INPCB_PTR(struct icmp6_filter *) inp6_icmp6filt; /* IPV6_CHECKSUM setsockopt */ int inp6_cksum; u_short inp6_ifindex; short inp6_hops; } inp_depend6; int hash_element; /* Array index of pcb's hash list */ _INPCB_PTR(caddr_t) inp_saved_ppcb; /* pointer while cached */ _INPCB_PTR(struct inpcbpolicy *) inp_sp; u_int32_t reserved[3]; /* reserved */ }; struct xinpcb { u_int32_t xi_len; /* length of this structure */ struct inpcb xi_inp; struct xsocket xi_socket; u_quad_t xi_alignment_hack; }; struct inpcb64_list_entry { u_int64_t le_next; u_int64_t le_prev; }; struct xinpcb64 { u_int64_t xi_len; /* length of this structure */ u_int64_t xi_inpp; u_short inp_fport; /* foreign port */ u_short inp_lport; /* local port */ struct inpcb64_list_entry inp_list; /* list for all PCBs */ u_int64_t inp_ppcb; /* ptr to per-protocol PCB */ u_int64_t inp_pcbinfo; /* PCB list info */ struct inpcb64_list_entry inp_portlist; /* this PCB's local port list */ u_int64_t inp_phd; /* head of this list */ inp_gen_t inp_gencnt; /* current generation count */ int inp_flags; /* generic IP/datagram flags */ u_int32_t inp_flow; u_char inp_vflag; u_char inp_ip_ttl; /* time to live */ u_char inp_ip_p; /* protocol */ union { /* foreign host table entry */ struct in_addr_4in6 inp46_foreign; struct in6_addr inp6_foreign; } inp_dependfaddr; union { /* local host table entry */ struct in_addr_4in6 inp46_local; struct in6_addr inp6_local; } inp_dependladdr; struct { u_char inp4_ip_tos; /* type of service */ } inp_depend4; struct { u_int8_t inp6_hlim; int inp6_cksum; u_short inp6_ifindex; short inp6_hops; } inp_depend6; struct xsocket64 xi_socket; u_quad_t xi_alignment_hack; }; struct xinpgen { u_int32_t xig_len; /* length of this structure */ u_int xig_count; /* number of PCBs at this time */ inp_gen_t xig_gen; /* generation count at this time */ so_gen_t xig_sogen; /* current socket generation count */ }; #pragma pack() /* * These defines are for use with the inpcb. */ #define INP_IPV4 0x1 #define INP_IPV6 0x2 #define INP_V4MAPPEDV6 0x4 #define inp_faddr inp_dependfaddr.inp46_foreign.ia46_addr4 #define inp_laddr inp_dependladdr.inp46_local.ia46_addr4 #define in6p_faddr inp_dependfaddr.inp6_foreign #define in6p_laddr inp_dependladdr.inp6_local /* * Flags for inp_flags. * * Some of these are publicly defined for legacy reasons, as they are * (unfortunately) used by certain applications to determine, at compile * time, whether or not the OS supports certain features. */ #define INP_ANONPORT 0x00000040 /* port chosen for user */ #define IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ #define IN6P_BINDV6ONLY 0x01000000 /* do not grab IPv4 traffic */ #endif /* !_NETINET_IN_PCB_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/ip_icmp.h
/* * Copyright (c) 2008-2018 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/ip_icmp.h,v 1.16 1999/12/29 04:41:01 peter Exp $ */ #ifndef _NETINET_IP_ICMP_H_ #define _NETINET_IP_ICMP_H_ #include <sys/appleapiopts.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> #include <sys/types.h> /* * Interface Control Message Protocol Definitions. * Per RFC 792, September 1981. */ /* * Internal of an ICMP Router Advertisement */ struct icmp_ra_addr { u_int32_t ira_addr; u_int32_t ira_preference; }; /* * Structure of an icmp header. */ struct icmp { u_char icmp_type; /* type of message, see below */ u_char icmp_code; /* type sub code */ u_short icmp_cksum; /* ones complement cksum of struct */ union { u_char ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { n_short icd_id; n_short icd_seq; } ih_idseq; int ih_void; /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ struct ih_pmtu { n_short ipm_void; n_short ipm_nextmtu; } ih_pmtu; struct ih_rtradv { u_char irt_num_addrs; u_char irt_wpa; u_int16_t irt_lifetime; } ih_rtradv; } icmp_hun; #define icmp_pptr icmp_hun.ih_pptr #define icmp_gwaddr icmp_hun.ih_gwaddr #define icmp_id icmp_hun.ih_idseq.icd_id #define icmp_seq icmp_hun.ih_idseq.icd_seq #define icmp_void icmp_hun.ih_void #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime union { struct id_ts { n_time its_otime; n_time its_rtime; n_time its_ttime; } id_ts; struct id_ip { struct ip idi_ip; /* options and then 64 bits of data */ } id_ip; struct icmp_ra_addr id_radv; u_int32_t id_mask; char id_data[1]; } icmp_dun; #define icmp_otime icmp_dun.id_ts.its_otime #define icmp_rtime icmp_dun.id_ts.its_rtime #define icmp_ttime icmp_dun.id_ts.its_ttime #define icmp_ip icmp_dun.id_ip.idi_ip #define icmp_radv icmp_dun.id_radv #define icmp_mask icmp_dun.id_mask #define icmp_data icmp_dun.id_data }; /* * Lower bounds on packet lengths for various types. * For the error advice packets must first insure that the * packet is large enough to contain the returned ip header. * Only then can we do the check to see if 64 bits of packet * data have been returned, since we need to check the returned * ip header length. */ #define ICMP_MINLEN 8 /* abs minimum */ #define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ #define ICMP_MASKLEN 12 /* address mask */ #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ #ifndef _IP_VHL #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) /* N.B.: must separately check that ip_hl >= 5 */ #else #define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8) /* N.B.: must separately check that header length >= 5 */ #endif /* * Definition of type and code field values. */ #define ICMP_ECHOREPLY 0 /* echo reply */ #define ICMP_UNREACH 3 /* dest unreachable, codes: */ #define ICMP_UNREACH_NET 0 /* bad net */ #define ICMP_UNREACH_HOST 1 /* bad host */ #define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ #define ICMP_UNREACH_PORT 3 /* bad port */ #define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ #define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ #define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ #define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ #define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ #define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ #define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ #define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ #define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ #define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */ #define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */ #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */ #define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ #define ICMP_REDIRECT 5 /* shorter route, codes: */ #define ICMP_REDIRECT_NET 0 /* for network */ #define ICMP_REDIRECT_HOST 1 /* for host */ #define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ #define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ #define ICMP_ALTHOSTADDR 6 /* alternate host address */ #define ICMP_ECHO 8 /* echo service */ #define ICMP_ROUTERADVERT 9 /* router advertisement */ #define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */ #define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */ #define ICMP_ROUTERSOLICIT 10 /* router solicitation */ #define ICMP_TIMXCEED 11 /* time exceeded, code: */ #define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ #define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ #define ICMP_PARAMPROB 12 /* ip header bad */ #define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */ #define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ #define ICMP_PARAMPROB_LENGTH 2 /* bad length */ #define ICMP_TSTAMP 13 /* timestamp request */ #define ICMP_TSTAMPREPLY 14 /* timestamp reply */ #define ICMP_IREQ 15 /* information request */ #define ICMP_IREQREPLY 16 /* information reply */ #define ICMP_MASKREQ 17 /* address mask request */ #define ICMP_MASKREPLY 18 /* address mask reply */ #define ICMP_TRACEROUTE 30 /* traceroute */ #define ICMP_DATACONVERR 31 /* data conversion error */ #define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ #define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ #define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ #define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */ #define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ #define ICMP_SKIP 39 /* SKIP */ #define ICMP_PHOTURIS 40 /* Photuris */ #define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */ #define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */ #define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ #define ICMP_MAXTYPE 40 #define ICMP_INFOTYPE(type) \ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) #define ICMP_ERRORTYPE(type) \ ((type) == ICMP_UNREACH || (type) == ICMP_SOURCEQUENCH || \ (type) == ICMP_REDIRECT || (type) == ICMP_TIMXCEED || \ (type) == ICMP_PARAMPROB) #endif /* _NETINET_IP_ICMP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/igmp_var.h
/* * Copyright (c) 2000-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1988 Stephen Deering. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Stephen Deering of Stanford University. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: @(#)igmp_var.h 8.1 (Berkeley) 7/19/93 */ #ifndef _NETINET_IGMP_VAR_H_ #define _NETINET_IGMP_VAR_H_ #include <sys/appleapiopts.h> #include <stdint.h> #include <sys/types.h> /* * Internet Group Management Protocol (IGMP), * implementation-specific definitions. * * Written by Steve Deering, Stanford, May 1988. * * MULTICAST Revision: 3.5.1.3 */ struct igmpstat_v3 { /* * Structure header (to insulate ABI changes). */ uint32_t igps_version; /* version of this structure */ uint32_t igps_len; /* length of this structure */ /* * Message statistics. */ uint64_t igps_rcv_total; /* total IGMP messages received */ uint64_t igps_rcv_tooshort; /* received with too few bytes */ uint64_t igps_rcv_badttl; /* received with ttl other than 1 */ uint64_t igps_rcv_badsum; /* received with bad checksum */ /* * Query statistics. */ uint64_t igps_rcv_v1v2_queries; /* received IGMPv1/IGMPv2 queries */ uint64_t igps_rcv_v3_queries; /* received IGMPv3 queries */ uint64_t igps_rcv_badqueries; /* received invalid queries */ uint64_t igps_rcv_gen_queries; /* received general queries */ uint64_t igps_rcv_group_queries;/* received group queries */ uint64_t igps_rcv_gsr_queries; /* received group-source queries */ uint64_t igps_drop_gsr_queries; /* dropped group-source queries */ /* * Report statistics. */ uint64_t igps_rcv_reports; /* received membership reports */ uint64_t igps_rcv_badreports; /* received invalid reports */ uint64_t igps_rcv_ourreports; /* received reports for our groups */ uint64_t igps_rcv_nora; /* received w/o Router Alert option */ uint64_t igps_snd_reports; /* sent membership reports */ /* * Padding for future additions. */ uint64_t __igps_pad[4]; } __attribute__((aligned(8))); /* * Old IGMPv2 stat structure for backward compatibility * */ struct igmpstat { u_int igps_rcv_total; /* total IGMP messages received */ u_int igps_rcv_tooshort; /* received with too few bytes */ u_int igps_rcv_badsum; /* received with bad checksum */ u_int igps_rcv_queries; /* received membership queries */ u_int igps_rcv_badqueries; /* received invalid queries */ u_int igps_rcv_reports; /* received membership reports */ u_int igps_rcv_badreports; /* received invalid reports */ u_int igps_rcv_ourreports; /* received reports for our groups */ u_int igps_snd_reports; /* sent membership reports */ }; #define IGPS_VERSION_3 3 #define IGPS_VERSION3_LEN 168 /* * Names for IGMP sysctl objects */ #define IGMPCTL_STATS 1 /* statistics (read-only) */ #define IGMPCTL_MAXID 2 #endif
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/icmp_var.h
/* * Copyright (c) 2000-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/icmp_var.h,v 1.15.2.1 2001/02/24 21:35:18 bmilekic Exp $ */ #ifndef _NETINET_ICMP_VAR_H_ #define _NETINET_ICMP_VAR_H_ #include <sys/appleapiopts.h> #include <netinet/ip_icmp.h> #include <sys/types.h> /* * Variables related to this implementation * of the internet control message protocol. */ struct icmpstat { /* statistics related to icmp packets generated */ u_int32_t icps_error; /* # of calls to icmp_error */ u_int32_t icps_oldshort; /* no error 'cuz old ip too short */ u_int32_t icps_oldicmp; /* no error 'cuz old was icmp */ u_int32_t icps_outhist[ICMP_MAXTYPE + 1]; /* statistics related to input messages processed */ u_int32_t icps_badcode; /* icmp_code out of range */ u_int32_t icps_tooshort; /* packet < ICMP_MINLEN */ u_int32_t icps_checksum; /* bad checksum */ u_int32_t icps_badlen; /* calculated bound mismatch */ u_int32_t icps_reflect; /* number of responses */ u_int32_t icps_inhist[ICMP_MAXTYPE + 1]; u_int32_t icps_bmcastecho;/* b/mcast echo requests dropped */ u_int32_t icps_bmcasttstamp; /* b/mcast tstamp requests dropped */ }; /* * Names for ICMP sysctl objects */ #define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */ #define ICMPCTL_STATS 2 /* statistics (read-only) */ #define ICMPCTL_ICMPLIM 3 #define ICMPCTL_TIMESTAMP 4 /* allow replies to time stamp requests */ #define ICMPCTL_ICMPLIM_INCR 5 #define ICMPCTL_MAXID 6 #endif /* _NETINET_ICMP_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/udp.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)udp.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_UDP_H_ #define _NETINET_UDP_H_ #include <sys/appleapiopts.h> #include <sys/types.h> /* u_short */ /* * Udp protocol header. * Per RFC 768, September, 1981. */ struct udphdr { u_short uh_sport; /* source port */ u_short uh_dport; /* destination port */ u_short uh_ulen; /* udp length */ u_short uh_sum; /* udp checksum */ }; /* * User-settable options (used with setsockopt). */ #define UDP_NOCKSUM 0x01 /* don't checksum outbound payloads */ #endif /* _NETINET_UDP_H */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/in_arp.h
/* * Copyright (c) 2009-2013 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _NETINET_IN_ARP_H_ #define _NETINET_IN_ARP_H_ #include <sys/kernel_types.h> struct sockaddr; struct sockaddr_dl; struct sockaddr_in; /*! * @function inet_arp_lookup * @discussion This function will check the routing table for a cached * arp entry or trigger an arp query to resolve the ip address to a * link-layer address. * * Arp entries are stored in the routing table. This function will * lookup the ip destination in the routing table. If the * destination requires forwarding to a gateway, the route of the * gateway will be looked up. The route entry is inspected to * determine if the link layer destination address is known. If * unknown, the arp generation function for IP attached to the * interface is called to create an arp request packet. * @param interface The interface the packet is being sent on. * @param ip_dest The ip destination of the packet. * @param ll_dest On output, the link-layer destination. * @param ll_dest_len The length of the buffer for ll_dest. * @param hint Any routing hint passed down from the protocol. * @param packet The packet being transmitted. * @result May return an error such as EHOSTDOWN or ENETUNREACH. If * this function returns EJUSTRETURN, the packet has been queued * and will be sent when an arp response is received. If any other * value is returned, the caller is responsible for disposing of * the packet. */ extern errno_t inet_arp_lookup(ifnet_t interface, const struct sockaddr_in *ip_dest, struct sockaddr_dl *ll_dest, size_t ll_dest_len, route_t hint, mbuf_t packet); /*! * @function inet_arp_handle_input * @discussion This function should be called by code that handles * inbound arp packets. The caller should parse the ARP packet to * pull out the operation and the relevant addresses. If a response * is required, the proto_media_send_arp function will be called. * * This function will lookup the sender in the routing table and * add an arp entry if necessary. Any queued packets waiting for * the arp resolution will also be transmitted. * @param interface The interface the packet was received on. * @param arp_op The arp operation, ARPOP_REQUEST or ARPOP_REPLY * @param sender_hw The sender hardware address from the arp payload. * @param sender_ip The sender IP address from the arp payload. * @param target_ip The target IP address from the arp payload. * @result 0 on success or an errno error value on failure. */ extern errno_t inet_arp_handle_input(ifnet_t ifp, u_int16_t arpop, const struct sockaddr_dl *sender_hw, const struct sockaddr_in *sender_ip, const struct sockaddr_in *target_ip); /*! * @function inet_arp_init_ifaddr * @discussion This function should be called in two places, when an IP * address is added and when the hardware address changes. This * function will setup the ifaddr_t for use with the IP ARP * functions. This function will also trigger the transmission of a * gratuitous ARP packet. * * When the SIOCSIFADDR ioctl is handled, the data parameter will * be an ifaddr_t. If this is an IP address, inet_arp_init_ifaddr * should be called. This is usually performed in the protocol * attachment's ioctl handler. * * When the event handler for the protocol attachment receives a * KEV_DL_LINK_ADDRESS_CHANGED event, the event handler should call * inet_arp_init_ifaddr for each interface ip address. * * For an example, see bsd/net/ether_inet_pr_module.c in xnu. * Search for inet_arp_init_ifaddr. * @param interface The interface the packet was received on. * @param ipaddr The ip interface address. */ extern void inet_arp_init_ifaddr(ifnet_t interface, ifaddr_t ipaddr); #endif /* _NETINET_IN_ARP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/igmp.h
/* * Copyright (c) 2010 Apple, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1988 Stephen Deering. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Stephen Deering of Stanford University. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)igmp.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/igmp.h,v 1.10 1999/08/28 00:49:15 peter Exp $ */ #ifndef _NETINET_IGMP_H_ #define _NETINET_IGMP_H_ #include <sys/appleapiopts.h> #include <netinet/in.h> #include <sys/types.h> /* * Internet Group Management Protocol (IGMP) definitions. * * Written by Steve Deering, Stanford, May 1988. * * MULTICAST Revision: 3.5.1.2 */ /* Minimum length of any IGMP protocol message. */ #define IGMP_MINLEN 8 /* * IGMPv1/v2 query and host report format. */ struct igmp { u_char igmp_type; /* version & type of IGMP message */ u_char igmp_code; /* subtype for routing msgs */ u_short igmp_cksum; /* IP-style checksum */ struct in_addr igmp_group; /* group address being reported */ }; /* (zero for queries) */ /* * IGMP v3 query format. */ struct igmpv3 { u_char igmp_type; /* version & type of IGMP message */ u_char igmp_code; /* subtype for routing msgs */ u_short igmp_cksum; /* IP-style checksum */ struct in_addr igmp_group; /* group address being reported */ /* (zero for queries) */ u_char igmp_misc; /* reserved/suppress/robustness */ u_char igmp_qqi; /* querier's query interval */ u_short igmp_numsrc; /* number of sources */ /*struct in_addr igmp_sources[1];*/ /* source addresses */ }; #define IGMP_V3_QUERY_MINLEN 12 #define IGMP_V3_QUERY_MAX_SRCS 366 /* From RFC 3376, section 4.1.8 */ #define IGMP_EXP(x) (((x) >> 4) & 0x07) #define IGMP_MANT(x) ((x) & 0x0f) #define IGMP_QRESV(x) (((x) >> 4) & 0x0f) #define IGMP_SFLAG(x) (((x) >> 3) & 0x01) #define IGMP_QRV(x) ((x) & 0x07) struct igmp_grouprec { u_char ig_type; /* record type */ u_char ig_datalen; /* length of auxiliary data */ u_short ig_numsrc; /* number of sources */ struct in_addr ig_group; /* group address being reported */ /*struct in_addr ig_sources[1];*/ /* source addresses */ }; #define IGMP_GRPREC_HDRLEN 8 /* * IGMPv3 host membership report header. */ struct igmp_report { u_char ir_type; /* IGMP_v3_HOST_MEMBERSHIP_REPORT */ u_char ir_rsv1; /* must be zero */ u_short ir_cksum; /* checksum */ u_short ir_rsv2; /* must be zero */ u_short ir_numgrps; /* number of group records */ /*struct igmp_grouprec ir_groups[1];*/ /* group records */ }; #define IGMP_V3_REPORT_MINLEN 8 #define IGMP_V3_REPORT_MAXRECS 65535 /* * Message types, including version number. */ #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* membership query */ #define IGMP_v1_HOST_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */ #define IGMP_DVMRP 0x13 /* DVMRP routing message */ #define IGMP_PIM 0x14 /* PIMv1 message (historic) */ #define IGMP_v2_HOST_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */ #define IGMP_HOST_LEAVE_MESSAGE 0x17 /* Leave-group message */ #define IGMP_MTRACE_REPLY 0x1e /* mtrace(8) reply */ #define IGMP_MTRACE_QUERY 0x1f /* mtrace(8) probe */ #define IGMP_v3_HOST_MEMBERSHIP_REPORT 0x22 /* Ver. 3 membership report */ /* * IGMPv3 report modes. */ #define IGMP_DO_NOTHING 0 /* don't send a record */ #define IGMP_MODE_IS_INCLUDE 1 /* MODE_IN */ #define IGMP_MODE_IS_EXCLUDE 2 /* MODE_EX */ #define IGMP_CHANGE_TO_INCLUDE_MODE 3 /* TO_IN */ #define IGMP_CHANGE_TO_EXCLUDE_MODE 4 /* TO_EX */ #define IGMP_ALLOW_NEW_SOURCES 5 /* ALLOW_NEW */ #define IGMP_BLOCK_OLD_SOURCES 6 /* BLOCK_OLD */ /* * IGMPv3 query types. */ #define IGMP_V3_GENERAL_QUERY 1 #define IGMP_V3_GROUP_QUERY 2 #define IGMP_V3_GROUP_SOURCE_QUERY 3 /* * Maximum report interval for IGMP v1/v2 host membership reports [RFC 1112] */ #define IGMP_V1V2_MAX_RI 10 #define IGMP_MAX_HOST_REPORT_DELAY IGMP_V1V2_MAX_RI /* * IGMP_TIMER_SCALE denotes that the igmp code field specifies * time in tenths of a second. */ #define IGMP_TIMER_SCALE 10 #endif /* _NETINET_IGMP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/tcp_seq.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95 * $FreeBSD: src/sys/netinet/tcp_seq.h,v 1.11.2.5 2001/08/22 00:59:12 silby Exp $ */ #ifndef _NETINET_TCP_SEQ_H_ #define _NETINET_TCP_SEQ_H_ #include <sys/appleapiopts.h> /* * TCP sequence numbers are 32 bit integers operated * on with modular arithmetic. These macros can be * used to compare such integers. */ #define SEQ_LT(a, b) ((int)((a)-(b)) < 0) #define SEQ_LEQ(a, b) ((int)((a)-(b)) <= 0) #define SEQ_GT(a, b) ((int)((a)-(b)) > 0) #define SEQ_GEQ(a, b) ((int)((a)-(b)) >= 0) #define SEQ_MIN(a, b) ((SEQ_LT(a, b)) ? (a) : (b)) #define SEQ_MAX(a, b) ((SEQ_GT(a, b)) ? (a) : (b)) /* for modulo comparisons of timestamps */ #define TSTMP_LT(a, b) ((int)((a)-(b)) < 0) #define TSTMP_GT(a, b) ((int)((a)-(b)) > 0) #define TSTMP_LEQ(a, b) ((int)((a)-(b)) <= 0) #define TSTMP_GEQ(a, b) ((int)((a)-(b)) >= 0) /* * TCP connection counts are 32 bit integers operated * on with modular arithmetic. These macros can be * used to compare such integers. */ #define CC_LT(a, b) ((int)((a)-(b)) < 0) #define CC_LEQ(a, b) ((int)((a)-(b)) <= 0) #define CC_GT(a, b) ((int)((a)-(b)) > 0) #define CC_GEQ(a, b) ((int)((a)-(b)) >= 0) /* Macro to increment a CC: skip 0 which has a special meaning */ #define CC_INC(c) (++(c) == 0 ? ++(c) : (c)) #endif /* _NETINET_TCP_SEQ_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/ip.h
/* * Copyright (c) 2000-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip.h 8.2 (Berkeley) 6/1/94 * $FreeBSD: src/sys/netinet/ip.h,v 1.17 1999/12/22 19:13:20 shin Exp $ */ #ifndef _NETINET_IP_H_ #define _NETINET_IP_H_ #include <sys/appleapiopts.h> #include <sys/types.h> /* XXX temporary hack to get u_ types */ #include <netinet/in.h> #include <netinet/in_systm.h> /* * Definitions for internet protocol version 4. * Per RFC 791, September 1981. */ #define IPVERSION 4 /* * Structure of an internet header, naked of options. */ struct ip { #ifdef _IP_VHL u_char ip_vhl; /* version << 4 | header length >> 2 */ #else #if BYTE_ORDER == LITTLE_ENDIAN u_int ip_hl:4, /* header length */ ip_v:4; /* version */ #endif #if BYTE_ORDER == BIG_ENDIAN u_int ip_v:4, /* version */ ip_hl:4; /* header length */ #endif #endif /* not _IP_VHL */ u_char ip_tos; /* type of service */ u_short ip_len; /* total length */ u_short ip_id; /* identification */ u_short ip_off; /* fragment offset field */ #define IP_RF 0x8000 /* reserved fragment flag */ #define IP_DF 0x4000 /* dont fragment flag */ #define IP_MF 0x2000 /* more fragments flag */ #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ u_char ip_ttl; /* time to live */ u_char ip_p; /* protocol */ u_short ip_sum; /* checksum */ struct in_addr ip_src, ip_dst; /* source and dest address */ }; #ifdef _IP_VHL #define IP_MAKE_VHL(v, hl) ((uint8_t)((v) << 4 | (hl))) #define IP_VHL_HL(vhl) ((vhl) & 0x0f) #define IP_VHL_V(vhl) ((vhl) >> 4) #define IP_VHL_BORING 0x45 #endif #define IP_MAXPACKET 65535 /* maximum packet size */ /* * Definitions for IP type of service (ip_tos) */ #define IPTOS_LOWDELAY 0x10 #define IPTOS_THROUGHPUT 0x08 #define IPTOS_RELIABILITY 0x04 #define IPTOS_MINCOST 0x02 #if 1 /* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */ #define IPTOS_CE 0x01 #define IPTOS_ECT 0x02 #endif #define IPTOS_DSCP_SHIFT 2 /* * ECN (Explicit Congestion Notification) codepoints in RFC3168 * mapped to the lower 2 bits of the TOS field. */ #define IPTOS_ECN_NOTECT 0x00 /* not-ECT */ #define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */ #define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */ #define IPTOS_ECN_CE 0x03 /* congestion experienced */ #define IPTOS_ECN_MASK 0x03 /* ECN field mask */ /* * Definitions for IP precedence (also in ip_tos) (hopefully unused) */ #define IPTOS_PREC_NETCONTROL 0xe0 #define IPTOS_PREC_INTERNETCONTROL 0xc0 #define IPTOS_PREC_CRITIC_ECP 0xa0 #define IPTOS_PREC_FLASHOVERRIDE 0x80 #define IPTOS_PREC_FLASH 0x60 #define IPTOS_PREC_IMMEDIATE 0x40 #define IPTOS_PREC_PRIORITY 0x20 #define IPTOS_PREC_ROUTINE 0x00 /* * Definitions for options. */ #define IPOPT_COPIED(o) ((o)&0x80) #define IPOPT_CLASS(o) ((o)&0x60) #define IPOPT_NUMBER(o) ((o)&0x1f) #define IPOPT_CONTROL 0x00 #define IPOPT_RESERVED1 0x20 #define IPOPT_DEBMEAS 0x40 #define IPOPT_RESERVED2 0x60 #define IPOPT_EOL 0 /* end of option list */ #define IPOPT_NOP 1 /* no operation */ #define IPOPT_RR 7 /* record packet route */ #define IPOPT_TS 68 /* timestamp */ #define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ #define IPOPT_LSRR 131 /* loose source route */ #define IPOPT_SATID 136 /* satnet id */ #define IPOPT_SSRR 137 /* strict source route */ #define IPOPT_RA 148 /* router alert */ /* * Offsets to fields in options other than EOL and NOP. */ #define IPOPT_OPTVAL 0 /* option ID */ #define IPOPT_OLEN 1 /* option length */ #define IPOPT_OFFSET 2 /* offset within option */ #define IPOPT_MINOFF 4 /* min value of above */ /* * Time stamp option structure. */ struct ip_timestamp { u_char ipt_code; /* IPOPT_TS */ u_char ipt_len; /* size of structure (variable) */ u_char ipt_ptr; /* index of current entry */ #if BYTE_ORDER == LITTLE_ENDIAN u_int ipt_flg:4, /* flags, see below */ ipt_oflw:4; /* overflow counter */ #endif #if BYTE_ORDER == BIG_ENDIAN u_int ipt_oflw:4, /* overflow counter */ ipt_flg:4; /* flags, see below */ #endif union ipt_timestamp { n_long ipt_time[1]; struct ipt_ta { struct in_addr ipt_addr; n_long ipt_time; } ipt_ta[1]; } ipt_timestamp; }; /* flag bits for ipt_flg */ #define IPOPT_TS_TSONLY 0 /* timestamps only */ #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ #define IPOPT_TS_PRESPEC 3 /* specified modules only */ /* bits for security (not byte swapped) */ #define IPOPT_SECUR_UNCLASS 0x0000 #define IPOPT_SECUR_CONFID 0xf135 #define IPOPT_SECUR_EFTO 0x789a #define IPOPT_SECUR_MMMM 0xbc4d #define IPOPT_SECUR_RESTR 0xaf13 #define IPOPT_SECUR_SECRET 0xd788 #define IPOPT_SECUR_TOPSECRET 0x6bc5 /* * Internet implementation parameters. */ #define MAXTTL 255 /* maximum time to live (seconds) */ #define IPDEFTTL 64 /* default ttl, from RFC 1340 */ #define IPFRAGTTL 30 /* time to live for frags (seconds) */ #define IPTTLDEC 1 /* subtracted when forwarding */ #define IP_MSS 576 /* default maximum segment size */ #endif
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/kpi_ipfilter.h
/* * Copyright (c) 2008-2021 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /*! * @header kpi_ipfilter.h * This header defines an API to attach IP filters. IP filters may be * attached to intercept either IPv4 or IPv6 packets. The filters can * intercept all IP packets in to and out of the host regardless of * interface. */ #ifndef __KPI_IPFILTER__ #define __KPI_IPFILTER__ #include <Availability.h> #define __NKE_API_DEPRECATED __API_DEPRECATED("Network Kernel Extension KPI is deprecated", macos(10.4, 10.15)) /* * ipf_pktopts * * Options for outgoing packets. The options need to be preserved when * re-injecting a packet. */ struct ipf_pktopts { u_int32_t ippo_flags; ifnet_t ippo_mcast_ifnet; int ippo_mcast_loop; u_int8_t ippo_mcast_ttl; }; #define IPPOF_MCAST_OPTS 0x1 typedef struct ipf_pktopts *ipf_pktopts_t; __BEGIN_DECLS /*! * @typedef ipf_input_func * * @discussion ipf_input_func is used to filter incoming ip packets. * The IP filter is called for packets from all interfaces. The * filter is called between when the general IP processing is * handled and when the packet is passed up to the next layer * protocol such as udp or tcp. In the case of encapsulation, such * as UDP in ESP (IPsec), your filter will be called once for ESP * and then again for UDP. This will give your filter an * opportunity to process the ESP header as well as the decrypted * packet. Offset and protocol are used to determine where in the * packet processing is currently occuring. If you're only * interested in TCP or UDP packets, just return 0 if protocol * doesn't match TCP or UDP. * @param cookie The cookie specified when your filter was attached. * @param data The reassembled ip packet, data will start at the ip * header. * @param offset An offset to the next header * (udp/tcp/icmp/esp/etc...). * @param protocol The protocol type (udp/tcp/icmp/etc...) of the IP packet * @result Return: * 0 - The caller will continue with normal processing of the * packet. * EJUSTRETURN - The caller will stop processing the packet, * the packet will not be freed. * Anything Else - The caller will free the packet and stop * processing. */ typedef errno_t (*ipf_input_func)(void *cookie, mbuf_t *data, int offset, u_int8_t protocol); /*! * @typedef ipf_output_func * * @discussion ipf_output_func is used to filter outbound ip packets. * The IP filter is called for packets to all interfaces. The * filter is called before fragmentation and IPsec processing. If * you need to change the destination IP address, call * ipf_inject_output and return EJUSTRETURN. * @param cookie The cookie specified when your filter was attached. * @param data The ip packet, will contain an IP header followed by the * rest of the IP packet. * @result Return: * 0 - The caller will continue with normal processing of the * packet. * EJUSTRETURN - The caller will stop processing the packet, * the packet will not be freed. * Anything Else - The caller will free the packet and stop * processing. */ typedef errno_t (*ipf_output_func)(void *cookie, mbuf_t *data, ipf_pktopts_t options); /*! * @typedef ipf_detach_func * * @discussion ipf_detach_func is called to notify your filter that it * has been detached. * @param cookie The cookie specified when your filter was attached. */ typedef void (*ipf_detach_func)(void *cookie); /*! * @typedef ipf_filter * @discussion This structure is used to define an IP filter for * use with the ipf_addv4 or ipf_addv6 function. * @field cookie A kext defined cookie that will be passed to all * filter functions. * @field name A filter name used for debugging purposes. * @field ipf_input The filter function to handle inbound packets. * @field ipf_output The filter function to handle outbound packets. * @field ipf_detach The filter function to notify of a detach. */ struct ipf_filter { void *cookie; const char *name; ipf_input_func ipf_input; ipf_output_func ipf_output; ipf_detach_func ipf_detach; }; struct opaque_ipfilter; typedef struct opaque_ipfilter *ipfilter_t; /*! * @function ipf_addv4 * @discussion Attaches an IPv4 ip filter. * @param filter A structure defining the filter. * @param filter_ref A reference to the filter used to detach it. * @result 0 on success otherwise the errno error. */ extern errno_t ipf_addv4(const struct ipf_filter *filter, ipfilter_t *filter_ref) __NKE_API_DEPRECATED; /*! * @function ipf_addv6 * @discussion Attaches an IPv6 ip filter. * @param filter A structure defining the filter. * @param filter_ref A reference to the filter used to detach it. * @result 0 on success otherwise the errno error. */ extern errno_t ipf_addv6(const struct ipf_filter *filter, ipfilter_t *filter_ref) __NKE_API_DEPRECATED; /*! * @function ipf_remove * @discussion Detaches an IPv4 or IPv6 filter. * @param filter_ref The reference to the filter returned from ipf_addv4 or * ipf_addv6. * @result 0 on success otherwise the errno error. */ extern errno_t ipf_remove(ipfilter_t filter_ref) __NKE_API_DEPRECATED; /*! * @function ipf_inject_input * @discussion Inject an IP packet as though it had just been * reassembled in ip_input. When re-injecting a packet intercepted * by the filter's ipf_input function, an IP filter can pass its * reference to avoid processing the packet twice. This also * prevents ip filters installed before this filter from * getting a chance to process the packet. If the filter modified * the packet, it should not specify the filter ref to give other * filters a chance to process the new packet. * * Caller is responsible for freeing mbuf chain in the event that * ipf_inject_input returns an error. * @param data The complete IPv4 or IPv6 packet, receive interface must * be set. * @param filter_ref The reference to the filter injecting the data * @result 0 on success otherwise the errno error. */ extern errno_t ipf_inject_input(mbuf_t data, ipfilter_t filter_ref) __NKE_API_DEPRECATED; /*! * @function ipf_inject_output * @discussion Inject an IP packet as though it had just been sent to * ip_output. When re-injecting a packet intercepted by the * filter's ipf_output function, an IP filter can pass its * reference to avoid processing the packet twice. This also * prevents ip filters installed before this filter from getting a * chance to process the packet. If the filter modified the packet, * it should not specify the filter ref to give other filters a * chance to process the new packet. * @param data The complete IPv4 or IPv6 packet. * @param filter_ref The reference to the filter injecting the data * @param options Output options for the packet * @result 0 on success otherwise the errno error. ipf_inject_output * will always free the mbuf. */ extern errno_t ipf_inject_output(mbuf_t data, ipfilter_t filter_ref, ipf_pktopts_t options) __NKE_API_DEPRECATED; __END_DECLS #undef __NKE_API_DEPRECATED #endif /* __KPI_IPFILTER__ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/ip6.h
/* * Copyright (c) 2000-2019 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $*/ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_IP6_H_ #define _NETINET_IP6_H_ #include <sys/appleapiopts.h> #include <sys/types.h> #include <netinet/in.h> /* * Definition for internet protocol version 6. * RFC 2460 */ struct ip6_hdr { union { struct ip6_hdrctl { u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */ u_int16_t ip6_un1_plen; /* payload length */ u_int8_t ip6_un1_nxt; /* next header */ u_int8_t ip6_un1_hlim; /* hop limit */ } ip6_un1; u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ } ip6_ctlun; struct in6_addr ip6_src; /* source address */ struct in6_addr ip6_dst; /* destination address */ } __attribute__((__packed__)); #define ip6_vfc ip6_ctlun.ip6_un2_vfc #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim #define IPV6_VERSION 0x60 #define IPV6_VERSION_MASK 0xf0 #if BYTE_ORDER == BIG_ENDIAN #define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */ #define IPV6_FLOW_ECN_MASK 0x00300000 /* the 2 ECN bits */ #else #if BYTE_ORDER == LITTLE_ENDIAN #define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ #define IPV6_FLOW_ECN_MASK 0x00003000 /* the 2 ECN bits */ #endif /* LITTLE_ENDIAN */ #endif #if 1 /* ECN bits proposed by Sally Floyd */ #define IP6TOS_CE 0x01 /* congestion experienced */ #define IP6TOS_ECT 0x02 /* ECN-capable transport */ #endif /* * To access the 6 bits of the DSCP value in the 32 bits ip6_flow field */ #define IP6FLOW_DSCP_MASK 0x0fc00000 #define IP6FLOW_DSCP_SHIFT 22 /* * Extension Headers */ struct ip6_ext { u_int8_t ip6e_nxt; u_int8_t ip6e_len; } __attribute__((__packed__)); /* Hop-by-Hop options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ struct ip6_hbh { u_int8_t ip6h_nxt; /* next header */ u_int8_t ip6h_len; /* length in units of 8 octets */ /* followed by options */ } __attribute__((__packed__)); /* Destination options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ struct ip6_dest { u_int8_t ip6d_nxt; /* next header */ u_int8_t ip6d_len; /* length in units of 8 octets */ /* followed by options */ } __attribute__((__packed__)); /* Option types and related macros */ #define IP6OPT_PAD1 0x00 /* 00 0 00000 */ #define IP6OPT_PADN 0x01 /* 00 0 00001 */ #define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ #define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */ #define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */ #define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */ #define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 (RFC3542, recommended) */ #define IP6OPT_RTALERT_LEN 4 #define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ #define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ #define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ #define IP6OPT_MINLEN 2 #define IP6OPT_EID 0x8a /* 10 0 01010 */ #define IP6OPT_TYPE(o) ((o) & 0xC0) #define IP6OPT_TYPE_SKIP 0x00 #define IP6OPT_TYPE_DISCARD 0x40 #define IP6OPT_TYPE_FORCEICMP 0x80 #define IP6OPT_TYPE_ICMP 0xC0 #define IP6OPT_MUTABLE 0x20 /* IPv6 options: common part */ struct ip6_opt { u_int8_t ip6o_type; u_int8_t ip6o_len; } __attribute__((__packed__)); /* Jumbo Payload Option */ struct ip6_opt_jumbo { u_int8_t ip6oj_type; u_int8_t ip6oj_len; u_int8_t ip6oj_jumbo_len[4]; } __attribute__((__packed__)); #define IP6OPT_JUMBO_LEN 6 /* NSAP Address Option */ struct ip6_opt_nsap { u_int8_t ip6on_type; u_int8_t ip6on_len; u_int8_t ip6on_src_nsap_len; u_int8_t ip6on_dst_nsap_len; /* followed by source NSAP */ /* followed by destination NSAP */ }__attribute__((__packed__)); /* Tunnel Limit Option */ struct ip6_opt_tunnel { u_int8_t ip6ot_type; u_int8_t ip6ot_len; u_int8_t ip6ot_encap_limit; }__attribute__((__packed__)); /* Router Alert Option */ struct ip6_opt_router { u_int8_t ip6or_type; u_int8_t ip6or_len; u_int8_t ip6or_value[2]; }__attribute__((__packed__)); /* Router alert values (in network byte order) */ #if BYTE_ORDER == BIG_ENDIAN #define IP6_ALERT_MLD 0x0000 #define IP6_ALERT_RSVP 0x0001 #define IP6_ALERT_AN 0x0002 #else #if BYTE_ORDER == LITTLE_ENDIAN #define IP6_ALERT_MLD 0x0000 #define IP6_ALERT_RSVP 0x0100 #define IP6_ALERT_AN 0x0200 #endif /* LITTLE_ENDIAN */ #endif /* Routing header */ struct ip6_rthdr { u_int8_t ip6r_nxt; /* next header */ u_int8_t ip6r_len; /* length in units of 8 octets */ u_int8_t ip6r_type; /* routing type */ u_int8_t ip6r_segleft; /* segments left */ /* followed by routing type specific data */ } __attribute__((__packed__)); /* Type 0 Routing header, deprecated by RFC 5095. */ struct ip6_rthdr0 { u_int8_t ip6r0_nxt; /* next header */ u_int8_t ip6r0_len; /* length in units of 8 octets */ u_int8_t ip6r0_type; /* always zero */ u_int8_t ip6r0_segleft; /* segments left */ u_int32_t ip6r0_reserved; /* reserved field */ /* followed by up to 127 struct in6_addr */ } __attribute__((__packed__)); /* Fragment header */ struct ip6_frag { u_int8_t ip6f_nxt; /* next header */ u_int8_t ip6f_reserved; /* reserved field */ u_int16_t ip6f_offlg; /* offset, reserved, and flag */ u_int32_t ip6f_ident; /* identification */ } __attribute__((__packed__)); #if BYTE_ORDER == BIG_ENDIAN #define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ #define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ #define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */ #endif /* BYTE_ORDER == LITTLE_ENDIAN */ /* * Internet implementation parameters. */ #define IPV6_MAXHLIM 255 /* maximum hoplimit */ #define IPV6_DEFHLIM 64 /* default hlim */ #define IPV6_FRAGTTL 60 /* ttl for fragment packets (seconds) */ #define IPV6_HLIMDEC 1 /* subtracted when forwarding */ #define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */ #define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/ #define IPV6_MAXOPTHDR 2048 /* max option header size, 256 64-bit words */ #endif /* !_NETINET_IP6_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/tcp_timer.h
/* * Copyright (c) 2000-2014 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/tcp_timer.h,v 1.18 1999/12/29 04:41:03 peter Exp $ */ #ifndef _NETINET_TCP_TIMER_H_ #define _NETINET_TCP_TIMER_H_ #include <sys/appleapiopts.h> /* Keep the external definition the same for binary compatibility */ #define TCPT_NTIMERS_EXT 4 /* * Definitions of the TCP timers. * * The TCPT_PTO timer is used for probing for a tail loss in a send window. * If this probe gets acknowledged using SACK, it will allow the connection * to enter fast-recovery instead of hitting a retransmit timeout. A probe * timeout will send the last unacknowledged segment to generate more acks * with SACK information which can be used for fast-retransmiting the lost * packets. This will fire in the order of 10ms. * * The TCPT_REXMT timer is used to force retransmissions. * The TCP has the TCPT_REXMT timer set whenever segments * have been sent for which ACKs are expected but not yet * received. If an ACK is received which advances tp->snd_una, * then the retransmit timer is cleared (if there are no more * outstanding segments) or reset to the base value (if there * are more ACKs expected). Whenever the retransmit timer goes off, * we retransmit one unacknowledged segment, and do a backoff * on the retransmit timer. * * The TCPT_DELACK timer is used for transmitting delayed acknowledgements * if an acknowledgement was delayed in anticipation of a new segment. * * The TCPT_PERSIST timer is used to keep window size information * flowing even if the window goes shut. If all previous transmissions * have been acknowledged(so that there are no retransmissions in progress), * and the window is too small to bother sending anything, then we start * the TCPT_PERSIST timer. When it expires, if the window is nonzero, * we go to transmit state. Otherwise, at intervals send a single byte * into the peer's window to force him to update our window information. * We do this at most as often as TCPT_PERSMIN time intervals, * but no more frequently than the current estimate of round-trip * packet time. The TCPT_PERSIST timer is cleared whenever we receive * a window update from the peer. * * The TCPT_KEEP timer is used to keep connections alive. If an * connection is idle (no segments received) for TCPTV_KEEP_INIT amount * of time, but not yet established, then we drop the connection. * Once the connection is established, if the connection is idle for * TCPTV_KEEP_IDLE time (and keepalives have been enabled on the socket), * we begin to probe the connection. We force the peer to send us a * segment by sending: * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK> * This segment is (deliberately) outside the window, and should elicit * an ack segment in response from the peer. If, despite the TCPT_KEEP * initiated segments we cannot elicit a response from a peer in * TCPT_MAXIDLE amount of time probing, then we drop the connection. * * The TCPT_2MSL timer is used for keeping the conenction in Time-wait state * before fully closing it so that the connection 4-tuple can be reused. */ #define TCPT_REXMT 0 /* retransmit */ #define TCPT_PERSIST 1 /* retransmit persistence */ #define TCPT_KEEP 2 /* keep alive */ #define TCPT_2MSL 3 /* 2*msl quiet time timer */ #define TCPT_DELACK 4 /* delayed ack timer */ #if MPTCP #define TCPT_JACK_RXMT 5 /* retransmit timer for join ack */ #define TCPT_MAX 5 #else /* MPTCP */ #define TCPT_MAX 4 #endif /* !MPTCP */ #define TCPT_NONE (TCPT_MAX + 1) #define TCPT_NTIMERS (TCPT_MAX + 1) #endif /* !_NETINET_TCP_TIMER_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/in.h
/* * Copyright (c) 2000-2018 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in.h 8.3 (Berkeley) 1/3/94 * $FreeBSD: src/sys/netinet/in.h,v 1.48.2.2 2001/04/21 14:53:06 ume Exp $ */ #ifndef _NETINET_IN_H_ #define _NETINET_IN_H_ #include <sys/appleapiopts.h> #include <stdint.h> /* uint(8|16|32)_t */ #include <sys/_types/_in_addr_t.h> #include <sys/_types/_in_port_t.h> /* * POSIX 1003.1-2003 * "Inclusion of the <netinet/in.h> header may also make visible all * symbols from <inttypes.h> and <sys/socket.h>". */ #include <sys/socket.h> /* * The following two #includes insure htonl and family are defined */ #include <machine/endian.h> #include <sys/_endian.h> /* * Constants and structures defined by the internet system, * Per RFC 790, September 1981, and numerous additions. */ /* * Protocols (RFC 1700) */ #define IPPROTO_IP 0 /* dummy for IP */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ #define IPPROTO_ICMP 1 /* control message protocol */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPPROTO_IGMP 2 /* group mgmt protocol */ #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ #define IPPROTO_IPV4 4 /* IPv4 encapsulation */ #define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ #define IPPROTO_TCP 6 /* tcp */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPPROTO_ST 7 /* Stream protocol II */ #define IPPROTO_EGP 8 /* exterior gateway protocol */ #define IPPROTO_PIGP 9 /* private interior gateway */ #define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ #define IPPROTO_NVPII 11 /* network voice protocol*/ #define IPPROTO_PUP 12 /* pup */ #define IPPROTO_ARGUS 13 /* Argus */ #define IPPROTO_EMCON 14 /* EMCON */ #define IPPROTO_XNET 15 /* Cross Net Debugger */ #define IPPROTO_CHAOS 16 /* Chaos*/ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ #define IPPROTO_UDP 17 /* user datagram protocol */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPPROTO_MUX 18 /* Multiplexing */ #define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ #define IPPROTO_HMP 20 /* Host Monitoring */ #define IPPROTO_PRM 21 /* Packet Radio Measurement */ #define IPPROTO_IDP 22 /* xns idp */ #define IPPROTO_TRUNK1 23 /* Trunk-1 */ #define IPPROTO_TRUNK2 24 /* Trunk-2 */ #define IPPROTO_LEAF1 25 /* Leaf-1 */ #define IPPROTO_LEAF2 26 /* Leaf-2 */ #define IPPROTO_RDP 27 /* Reliable Data */ #define IPPROTO_IRTP 28 /* Reliable Transaction */ #define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ #define IPPROTO_BLT 30 /* Bulk Data Transfer */ #define IPPROTO_NSP 31 /* Network Services */ #define IPPROTO_INP 32 /* Merit Internodal */ #define IPPROTO_SEP 33 /* Sequential Exchange */ #define IPPROTO_3PC 34 /* Third Party Connect */ #define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ #define IPPROTO_XTP 36 /* XTP */ #define IPPROTO_DDP 37 /* Datagram Delivery */ #define IPPROTO_CMTP 38 /* Control Message Transport */ #define IPPROTO_TPXX 39 /* TP++ Transport */ #define IPPROTO_IL 40 /* IL transport protocol */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ #define IPPROTO_IPV6 41 /* IP6 header */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPPROTO_SDRP 42 /* Source Demand Routing */ #define IPPROTO_ROUTING 43 /* IP6 routing header */ #define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ #define IPPROTO_IDRP 45 /* InterDomain Routing*/ #define IPPROTO_RSVP 46 /* resource reservation */ #define IPPROTO_GRE 47 /* General Routing Encap. */ #define IPPROTO_MHRP 48 /* Mobile Host Routing */ #define IPPROTO_BHA 49 /* BHA */ #define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ #define IPPROTO_AH 51 /* IP6 Auth Header */ #define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ #define IPPROTO_SWIPE 53 /* IP with encryption */ #define IPPROTO_NHRP 54 /* Next Hop Resolution */ /* 55-57: Unassigned */ #define IPPROTO_ICMPV6 58 /* ICMP6 */ #define IPPROTO_NONE 59 /* IP6 no next header */ #define IPPROTO_DSTOPTS 60 /* IP6 destination option */ #define IPPROTO_AHIP 61 /* any host internal protocol */ #define IPPROTO_CFTP 62 /* CFTP */ #define IPPROTO_HELLO 63 /* "hello" routing protocol */ #define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ #define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ #define IPPROTO_RVD 66 /* Remote Virtual Disk */ #define IPPROTO_IPPC 67 /* Pluribus Packet Core */ #define IPPROTO_ADFS 68 /* Any distributed FS */ #define IPPROTO_SATMON 69 /* Satnet Monitoring */ #define IPPROTO_VISA 70 /* VISA Protocol */ #define IPPROTO_IPCV 71 /* Packet Core Utility */ #define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ #define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ #define IPPROTO_WSN 74 /* Wang Span Network */ #define IPPROTO_PVP 75 /* Packet Video Protocol */ #define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ #define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ #define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ #define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ #define IPPROTO_EON 80 /* ISO cnlp */ #define IPPROTO_VMTP 81 /* VMTP */ #define IPPROTO_SVMTP 82 /* Secure VMTP */ #define IPPROTO_VINES 83 /* Banyon VINES */ #define IPPROTO_TTP 84 /* TTP */ #define IPPROTO_IGP 85 /* NSFNET-IGP */ #define IPPROTO_DGP 86 /* dissimilar gateway prot. */ #define IPPROTO_TCF 87 /* TCF */ #define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ #define IPPROTO_OSPFIGP 89 /* OSPFIGP */ #define IPPROTO_SRPC 90 /* Strite RPC protocol */ #define IPPROTO_LARP 91 /* Locus Address Resoloution */ #define IPPROTO_MTP 92 /* Multicast Transport */ #define IPPROTO_AX25 93 /* AX.25 Frames */ #define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ #define IPPROTO_MICP 95 /* Mobile Int.ing control */ #define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ #define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ #define IPPROTO_ENCAP 98 /* encapsulation header */ #define IPPROTO_APES 99 /* any private encr. scheme */ #define IPPROTO_GMTP 100 /* GMTP*/ /* 101-252: Partly Unassigned */ #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ #define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ #define IPPROTO_PGM 113 /* PGM */ #define IPPROTO_SCTP 132 /* SCTP */ /* 253-254: Experimentation and testing; 255: Reserved (RFC3692) */ /* BSD Private, local use, namespace incursion */ #define IPPROTO_DIVERT 254 /* divert pseudo-protocol */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ #define IPPROTO_RAW 255 /* raw IP packet */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPPROTO_MAX 256 /* last return value of *_input(), meaning "all job for this pkt is done". */ #define IPPROTO_DONE 257 #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * Local port number conventions: * * When a user does a bind(2) or connect(2) with a port number of zero, * a non-conflicting local port address is chosen. * The default range is IPPORT_RESERVED through * IPPORT_USERRESERVED, although that is settable by sysctl. * * A user may set the IPPROTO_IP option IP_PORTRANGE to change this * default assignment range. * * The value IP_PORTRANGE_DEFAULT causes the default behavior. * * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers * into the "high" range. These are reserved for client outbound connections * which do not want to be filtered by any firewalls. * * The value IP_PORTRANGE_LOW changes the range to the "low" are * that is (by convention) restricted to privileged processes. This * convention is based on "vouchsafe" principles only. It is only secure * if you trust the remote host to restrict these ports. * * The default range of ports and the high range can be changed by * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto) * * Changing those values has bad security implications if you are * using a a stateless firewall that is allowing packets outside of that * range in order to allow transparent outgoing connections. * * Such a firewall configuration will generally depend on the use of these * default values. If you change them, you may find your Security * Administrator looking for you with a heavy object. * * For a slightly more orthodox text view on this: * * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers * * port numbers are divided into three ranges: * * 0 - 1023 Well Known Ports * 1024 - 49151 Registered Ports * 49152 - 65535 Dynamic and/or Private Ports * */ #define __DARWIN_IPPORT_RESERVED 1024 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* * Ports < IPPORT_RESERVED are reserved for * privileged processes (e.g. root). (IP_PORTRANGE_LOW) * Ports > IPPORT_USERRESERVED are reserved * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT) */ #ifndef IPPORT_RESERVED #define IPPORT_RESERVED __DARWIN_IPPORT_RESERVED #endif #define IPPORT_USERRESERVED 5000 /* * Default local port range to use by setting IP_PORTRANGE_HIGH */ #define IPPORT_HIFIRSTAUTO 49152 #define IPPORT_HILASTAUTO 65535 /* * Scanning for a free reserved port return a value below IPPORT_RESERVED, * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was * 512, but that conflicts with some well-known-services that firewalls may * have a fit if we use. */ #define IPPORT_RESERVEDSTART 600 #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ /* * Internet address (a structure for historical reasons) */ struct in_addr { in_addr_t s_addr; }; /* * Definitions of bits in internet address integers. * On subnets, the decomposition of addresses to host and net parts * is done according to subnet mask, not the masks here. */ #define INADDR_ANY (u_int32_t)0x00000000 #define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) #define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 #define IN_CLASSA_HOST 0x00ffffff #define IN_CLASSA_MAX 128 #define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) #define IN_CLASSB_NET 0xffff0000 #define IN_CLASSB_NSHIFT 16 #define IN_CLASSB_HOST 0x0000ffff #define IN_CLASSB_MAX 65536 #define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) #define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 #define IN_CLASSC_HOST 0x000000ff #define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ #define IN_MULTICAST(i) IN_CLASSD(i) #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) #define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) #define INADDR_LOOPBACK (u_int32_t)0x7f000001 #define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ #define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ #define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ #define INADDR_ALLRPTS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22, IGMPv3 */ #define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */ #define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */ #define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */ #define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ #ifdef __APPLE__ #define IN_LINKLOCALNETNUM (u_int32_t)0xA9FE0000 /* 169.254.0.0 */ #define IN_LINKLOCAL(i) (((u_int32_t)(i) & IN_CLASSB_NET) == IN_LINKLOCALNETNUM) #define IN_LOOPBACK(i) (((u_int32_t)(i) & 0xff000000) == 0x7f000000) #define IN_ZERONET(i) (((u_int32_t)(i) & 0xff000000) == 0) #define IN_PRIVATE(i) ((((u_int32_t)(i) & 0xff000000) == 0x0a000000) || \ (((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \ (((u_int32_t)(i) & 0xffff0000) == 0xc0a80000)) #define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000) #define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i)) #endif /* __APPLE__ */ #define IN_LOOPBACKNET 127 /* official! */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ /* * Socket address, internet style. */ struct sockaddr_in { __uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; }; #define IN_ARE_ADDR_EQUAL(a, b) \ (bcmp(&(a)->s_addr, &(b)->s_addr, \ sizeof (struct in_addr)) == 0) #define INET_ADDRSTRLEN 16 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* * Structure used to describe IP options. * Used to store options internally, to pass them to a process, * or to restore options retrieved earlier. * The ip_dst is used for the first-hop gateway when using a source route * (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* first hop, 0 w/o src rt */ char ip_opts[40]; /* actually variable in size */ }; /* * Options for use with [gs]etsockopt at the IP level. * First word of comment is data type; bool is stored in int. */ #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ #define IP_HDRINCL 2 /* int; header is included with data */ #define IP_TOS 3 /* int; IP type of service and preced. */ #define IP_TTL 4 /* int; IP time to live */ #define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ #define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ #define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ #define IP_RETOPTS 8 /* ip_opts; set/get IP options */ #define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */ #define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ #define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ #define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ #define IP_RSVP_ON 15 /* enable RSVP in kernel */ #define IP_RSVP_OFF 16 /* disable RSVP in kernel */ #define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ #define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ #define IP_PORTRANGE 19 /* int; range to choose for unspec port */ #define IP_RECVIF 20 /* bool; receive reception if w/dgram */ /* for IPSEC */ #define IP_IPSEC_POLICY 21 /* int; set/get security policy */ #define IP_FAITH 22 /* deprecated */ #ifdef __APPLE__ #define IP_STRIPHDR 23 /* bool: drop receive of raw IP header */ #endif #define IP_RECVTTL 24 /* bool; receive reception TTL w/dgram */ #define IP_BOUND_IF 25 /* int; set/get bound interface */ #define IP_PKTINFO 26 /* get pktinfo on recv socket, set src on sent dgram */ #define IP_RECVPKTINFO IP_PKTINFO /* receive pktinfo w/dgram */ #define IP_RECVTOS 27 /* bool; receive IP TOS w/dgram */ #define IP_DONTFRAG 28 /* don't fragment packet */ #define IP_FW_ADD 40 /* add a firewall rule to chain */ #define IP_FW_DEL 41 /* delete a firewall rule from chain */ #define IP_FW_FLUSH 42 /* flush firewall rule chain */ #define IP_FW_ZERO 43 /* clear single/all firewall counter(s) */ #define IP_FW_GET 44 /* get entire firewall rule chain */ #define IP_FW_RESETLOG 45 /* reset logging counters */ /* These older firewall socket option codes are maintained for backward compatibility. */ #define IP_OLD_FW_ADD 50 /* add a firewall rule to chain */ #define IP_OLD_FW_DEL 51 /* delete a firewall rule from chain */ #define IP_OLD_FW_FLUSH 52 /* flush firewall rule chain */ #define IP_OLD_FW_ZERO 53 /* clear single/all firewall counter(s) */ #define IP_OLD_FW_GET 54 /* get entire firewall rule chain */ #define IP_NAT__XXX 55 /* set/get NAT opts XXX Deprecated, do not use */ #define IP_OLD_FW_RESETLOG 56 /* reset logging counters */ #define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ #define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ #define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ #define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ #define IP_TRAFFIC_MGT_BACKGROUND 65 /* int*; get background IO flags; set background IO */ #define IP_MULTICAST_IFINDEX 66 /* int*; set/get IP multicast i/f index */ /* IPv4 Source Filter Multicast API [RFC3678] */ #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ #define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ #define IP_BLOCK_SOURCE 72 /* block a source */ #define IP_UNBLOCK_SOURCE 73 /* unblock a source */ /* The following option is private; do not use it from user applications. */ #define IP_MSFILTER 74 /* set/get filter list */ /* Protocol Independent Multicast API [RFC3678] */ #define MCAST_JOIN_GROUP 80 /* join an any-source group */ #define MCAST_LEAVE_GROUP 81 /* leave all sources for group */ #define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ #define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ #define MCAST_BLOCK_SOURCE 84 /* block a source */ #define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ /* * Defaults and limits for options */ #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* * The imo_membership vector for each socket is now dynamically allocated at * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized * according to a power-of-two increment. */ #define IP_MIN_MEMBERSHIPS 31 #define IP_MAX_MEMBERSHIPS 4095 /* * Default resource limits for IPv4 multicast source filtering. * These may be modified by sysctl. */ #define IP_MAX_GROUP_SRC_FILTER 512 /* sources per group */ #define IP_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ #define IP_MAX_SOCK_MUTE_FILTER 128 /* XXX no longer used */ /* * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */ struct ip_mreq { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ }; /* * Modified argument structure for IP_MULTICAST_IF, obtained from Linux. * This is used to specify an interface index for multicast sends, as * the IPv4 legacy APIs do not support this (unless IP_SENDIF is available). */ struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_address; /* local IP address of interface */ int imr_ifindex; /* Interface index; cast to uint32_t */ }; #pragma pack(4) /* * Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678] */ struct ip_mreq_source { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_sourceaddr; /* IP address of source */ struct in_addr imr_interface; /* local IP address of interface */ }; /* * Argument structures for Protocol-Independent Multicast Source * Filter APIs. [RFC3678] */ struct group_req { uint32_t gr_interface; /* interface index */ struct sockaddr_storage gr_group; /* group address */ }; struct group_source_req { uint32_t gsr_interface; /* interface index */ struct sockaddr_storage gsr_group; /* group address */ struct sockaddr_storage gsr_source; /* source address */ }; #ifndef __MSFILTERREQ_DEFINED #define __MSFILTERREQ_DEFINED /* * The following structure is private; do not use it from user applications. * It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between * the RFC 3678 libc functions and the kernel. */ struct __msfilterreq { uint32_t msfr_ifindex; /* interface index */ uint32_t msfr_fmode; /* filter mode for group */ uint32_t msfr_nsrcs; /* # of sources in msfr_srcs */ uint32_t __msfr_align; struct sockaddr_storage msfr_group; /* group address */ struct sockaddr_storage *msfr_srcs; }; #endif /* __MSFILTERREQ_DEFINED */ #pragma pack() struct sockaddr; /* * Filter modes; also used to represent per-socket filter mode internally. */ #define MCAST_UNDEFINED 0 /* fmode: not yet defined */ #define MCAST_INCLUDE 1 /* fmode: include these source(s) */ #define MCAST_EXCLUDE 2 /* fmode: exclude these source(s) */ /* * Argument for IP_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */ #define IP_PORTRANGE_DEFAULT 0 /* default range */ #define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ #define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ /* * IP_PKTINFO: Packet information (equivalent to RFC2292 sec 5 for IPv4) * This structure is used for * * 1) Receiving ancilliary data about the datagram if IP_PKTINFO sockopt is * set on the socket. In this case ipi_ifindex will contain the interface * index the datagram was received on, ipi_addr is the IP address the * datagram was received to. * * 2) Sending a datagram using a specific interface or IP source address. * if ipi_ifindex is set to non-zero when in_pktinfo is passed as * ancilliary data of type IP_PKTINFO, this will be used as the source * interface to send the datagram from. If ipi_ifindex is null, ip_spec_dst * will be used for the source address. * * Note: if IP_BOUND_IF is set on the socket, ipi_ifindex in the ancillary * IP_PKTINFO option silently overrides the bound interface when it is * specified during send time. */ struct in_pktinfo { unsigned int ipi_ifindex; /* send/recv interface index */ struct in_addr ipi_spec_dst; /* Local address */ struct in_addr ipi_addr; /* IP Header dst address */ }; /* * Definitions for inet sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */ #define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ /* * Names for IP sysctl objects */ #define IPCTL_FORWARDING 1 /* act as router */ #define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ #define IPCTL_DEFTTL 3 /* default TTL */ #ifdef notyet #define IPCTL_DEFMTU 4 /* default MTU */ #endif #define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ #define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ #define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ #define IPCTL_SOURCEROUTE 8 /* may perform source routes */ #define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ #define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ #define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ #define IPCTL_STATS 12 /* ipstat structure */ #define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ #define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ #define IPCTL_KEEPFAITH 15 /* deprecated */ #define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ #define IPCTL_MAXID 17 #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ /* INET6 stuff */ #define __KAME_NETINET_IN_H_INCLUDED_ #include <netinet6/in6.h> #undef __KAME_NETINET_IN_H_INCLUDED_ #define MAX_IPv4_STR_LEN 16 #define MAX_IPv6_STR_LEN 64 extern int inet_aton(const char *, struct in_addr *); /* in libkern */ extern const char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern*/ #endif /* _NETINET_IN_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/tcp_var.h
/* * Copyright (c) 2000-2021 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95 * $FreeBSD: src/sys/netinet/tcp_var.h,v 1.56.2.8 2001/08/22 00:59:13 silby Exp $ */ #ifndef _NETINET_TCP_VAR_H_ #define _NETINET_TCP_VAR_H_ #include <sys/types.h> #include <sys/appleapiopts.h> #include <sys/queue.h> #include <netinet/in_pcb.h> #include <netinet/tcp.h> #include <netinet/tcp_timer.h> #if defined(__LP64__) #define _TCPCB_PTR(x) u_int32_t #define _TCPCB_LIST_HEAD(name, type) \ struct name { \ u_int32_t lh_first; \ } #else #define _TCPCB_PTR(x) x #define _TCPCB_LIST_HEAD(name, type) LIST_HEAD(name, type) #endif struct tseg_qent; _TCPCB_LIST_HEAD(tsegqe_head, tseg_qent); struct tcpcb { struct tsegqe_head t_segq; int t_dupacks; /* consecutive dup acks recd */ u_int32_t unused; /* unused now: was t_template */ int t_timer[TCPT_NTIMERS_EXT]; /* tcp timers */ _TCPCB_PTR(struct inpcb *) t_inpcb; /* back pointer to internet pcb */ int t_state; /* state of this connection */ u_int t_flags; #define TF_ACKNOW 0x00001 /* ack peer immediately */ #define TF_DELACK 0x00002 /* ack, but try to delay it */ #define TF_NODELAY 0x00004 /* don't delay packets to coalesce */ #define TF_NOOPT 0x00008 /* don't use tcp options */ #define TF_SENTFIN 0x00010 /* have sent FIN */ #define TF_REQ_SCALE 0x00020 /* have/will request window scaling */ #define TF_RCVD_SCALE 0x00040 /* other side has requested scaling */ #define TF_REQ_TSTMP 0x00080 /* have/will request timestamps */ #define TF_RCVD_TSTMP 0x00100 /* a timestamp was received in SYN */ #define TF_SACK_PERMIT 0x00200 /* other side said I could SACK */ #define TF_NEEDSYN 0x00400 /* send SYN (implicit state) - unused but needed for backwards compatibility */ #define TF_NEEDFIN 0x00800 /* send FIN (implicit state) */ #define TF_NOPUSH 0x01000 /* don't push */ #define TF_REQ_CC 0x02000 /* have/will request CC */ #define TF_RCVD_CC 0x04000 /* a CC was received in SYN */ #define TF_SENDCCNEW 0x08000 /* Not implemented */ #define TF_MORETOCOME 0x10000 /* More data to be appended to sock */ #define TF_LQ_OVERFLOW 0x20000 /* listen queue overflow */ #define TF_RXWIN0SENT 0x40000 /* sent a receiver win 0 in response */ #define TF_SLOWLINK 0x80000 /* route is a on a modem speed link */ int t_force; /* 1 if forcing out a byte */ tcp_seq snd_una; /* send unacknowledged */ tcp_seq snd_max; /* highest sequence number sent; * used to recognize retransmits */ tcp_seq snd_nxt; /* send next */ tcp_seq snd_up; /* send urgent pointer */ tcp_seq snd_wl1; /* window update seg seq number */ tcp_seq snd_wl2; /* window update seg ack number */ tcp_seq iss; /* initial send sequence number */ tcp_seq irs; /* initial receive sequence number */ tcp_seq rcv_nxt; /* receive next */ tcp_seq rcv_adv; /* advertised window */ u_int32_t rcv_wnd; /* receive window */ tcp_seq rcv_up; /* receive urgent pointer */ u_int32_t snd_wnd; /* send window */ u_int32_t snd_cwnd; /* congestion-controlled window */ u_int32_t snd_ssthresh; /* snd_cwnd size threshold for * for slow start exponential to * linear switch */ u_int t_maxopd; /* mss plus options */ u_int32_t t_rcvtime; /* time at which a packet was received */ u_int32_t t_starttime; /* time connection was established */ int t_rtttime; /* round trip time */ tcp_seq t_rtseq; /* sequence number being timed */ int t_rxtcur; /* current retransmit value (ticks) */ u_int t_maxseg; /* maximum segment size */ int t_srtt; /* smoothed round-trip time */ int t_rttvar; /* variance in round-trip time */ int t_rxtshift; /* log(2) of rexmt exp. backoff */ u_int t_rttmin; /* minimum rtt allowed */ u_int32_t t_rttupdated; /* number of times rtt sampled */ u_int32_t max_sndwnd; /* largest window peer has offered */ int t_softerror; /* possible error not yet reported */ /* out-of-band data */ char t_oobflags; /* have some */ char t_iobc; /* input character */ #define TCPOOB_HAVEDATA 0x01 #define TCPOOB_HADDATA 0x02 /* RFC 1323 variables */ u_char snd_scale; /* window scaling for send window */ u_char rcv_scale; /* window scaling for recv window */ u_char request_r_scale; /* pending window scaling */ u_char requested_s_scale; u_int32_t ts_recent; /* timestamp echo data */ u_int32_t ts_recent_age; /* when last updated */ tcp_seq last_ack_sent; /* RFC 1644 variables */ tcp_cc cc_send; /* send connection count */ tcp_cc cc_recv; /* receive connection count */ tcp_seq snd_recover; /* for use in fast recovery */ /* experimental */ u_int32_t snd_cwnd_prev; /* cwnd prior to retransmit */ u_int32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ u_int32_t t_badrxtwin; /* window for retransmit recovery */ }; #define tcps_ecn_setup tcps_ecn_client_success #define tcps_sent_cwr tcps_ecn_recv_ece #define tcps_sent_ece tcps_ecn_sent_ece /* * TCP statistics. * Many of these should be kept per connection, * but that's inconvenient at the moment. */ struct tcpstat { u_int32_t tcps_connattempt; /* connections initiated */ u_int32_t tcps_accepts; /* connections accepted */ u_int32_t tcps_connects; /* connections established */ u_int32_t tcps_drops; /* connections dropped */ u_int32_t tcps_conndrops; /* embryonic connections dropped */ u_int32_t tcps_closed; /* conn. closed (includes drops) */ u_int32_t tcps_segstimed; /* segs where we tried to get rtt */ u_int32_t tcps_rttupdated; /* times we succeeded */ u_int32_t tcps_delack; /* delayed acks sent */ u_int32_t tcps_timeoutdrop; /* conn. dropped in rxmt timeout */ u_int32_t tcps_rexmttimeo; /* retransmit timeouts */ u_int32_t tcps_persisttimeo; /* persist timeouts */ u_int32_t tcps_keeptimeo; /* keepalive timeouts */ u_int32_t tcps_keepprobe; /* keepalive probes sent */ u_int32_t tcps_keepdrops; /* connections dropped in keepalive */ u_int32_t tcps_sndtotal; /* total packets sent */ u_int32_t tcps_sndpack; /* data packets sent */ u_int32_t tcps_sndbyte; /* data bytes sent */ u_int32_t tcps_sndrexmitpack; /* data packets retransmitted */ u_int32_t tcps_sndrexmitbyte; /* data bytes retransmitted */ u_int32_t tcps_sndacks; /* ack-only packets sent */ u_int32_t tcps_sndprobe; /* window probes sent */ u_int32_t tcps_sndurg; /* packets sent with URG only */ u_int32_t tcps_sndwinup; /* window update-only packets sent */ u_int32_t tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */ u_int32_t tcps_rcvtotal; /* total packets received */ u_int32_t tcps_rcvpack; /* packets received in sequence */ u_int32_t tcps_rcvbyte; /* bytes received in sequence */ u_int32_t tcps_rcvbadsum; /* packets received with ccksum errs */ u_int32_t tcps_rcvbadoff; /* packets received with bad offset */ u_int32_t tcps_rcvmemdrop; /* packets dropped for lack of memory */ u_int32_t tcps_rcvshort; /* packets received too short */ u_int32_t tcps_rcvduppack; /* duplicate-only packets received */ u_int32_t tcps_rcvdupbyte; /* duplicate-only bytes received */ u_int32_t tcps_rcvpartduppack; /* packets with some duplicate data */ u_int32_t tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */ u_int32_t tcps_rcvoopack; /* out-of-order packets received */ u_int32_t tcps_rcvoobyte; /* out-of-order bytes received */ u_int32_t tcps_rcvpackafterwin; /* packets with data after window */ u_int32_t tcps_rcvbyteafterwin; /* bytes rcvd after window */ u_int32_t tcps_rcvafterclose; /* packets rcvd after "close" */ u_int32_t tcps_rcvwinprobe; /* rcvd window probe packets */ u_int32_t tcps_rcvdupack; /* rcvd duplicate acks */ u_int32_t tcps_rcvacktoomuch; /* rcvd acks for unsent data */ u_int32_t tcps_rcvackpack; /* rcvd ack packets */ u_int32_t tcps_rcvackbyte; /* bytes acked by rcvd acks */ u_int32_t tcps_rcvwinupd; /* rcvd window update packets */ u_int32_t tcps_pawsdrop; /* segments dropped due to PAWS */ u_int32_t tcps_predack; /* times hdr predict ok for acks */ u_int32_t tcps_preddat; /* times hdr predict ok for data pkts */ u_int32_t tcps_pcbcachemiss; u_int32_t tcps_cachedrtt; /* times cached RTT in route updated */ u_int32_t tcps_cachedrttvar; /* times cached rttvar updated */ u_int32_t tcps_cachedssthresh; /* times cached ssthresh updated */ u_int32_t tcps_usedrtt; /* times RTT initialized from route */ u_int32_t tcps_usedrttvar; /* times RTTVAR initialized from rt */ u_int32_t tcps_usedssthresh; /* times ssthresh initialized from rt*/ u_int32_t tcps_persistdrop; /* timeout in persist state */ u_int32_t tcps_badsyn; /* bogus SYN, e.g. premature ACK */ u_int32_t tcps_mturesent; /* resends due to MTU discovery */ u_int32_t tcps_listendrop; /* listen queue overflows */ u_int32_t tcps_synchallenge; /* challenge ACK due to bad SYN */ u_int32_t tcps_rstchallenge; /* challenge ACK due to bad RST */ /* new stats from FreeBSD 5.4 sync up */ u_int32_t tcps_minmssdrops; /* average minmss too low drops */ u_int32_t tcps_sndrexmitbad; /* unnecessary packet retransmissions */ u_int32_t tcps_badrst; /* ignored RSTs in the window */ u_int32_t tcps_sc_added; /* entry added to syncache */ u_int32_t tcps_sc_retransmitted; /* syncache entry was retransmitted */ u_int32_t tcps_sc_dupsyn; /* duplicate SYN packet */ u_int32_t tcps_sc_dropped; /* could not reply to packet */ u_int32_t tcps_sc_completed; /* successful extraction of entry */ u_int32_t tcps_sc_bucketoverflow; /* syncache per-bucket limit hit */ u_int32_t tcps_sc_cacheoverflow; /* syncache cache limit hit */ u_int32_t tcps_sc_reset; /* RST removed entry from syncache */ u_int32_t tcps_sc_stale; /* timed out or listen socket gone */ u_int32_t tcps_sc_aborted; /* syncache entry aborted */ u_int32_t tcps_sc_badack; /* removed due to bad ACK */ u_int32_t tcps_sc_unreach; /* ICMP unreachable received */ u_int32_t tcps_sc_zonefail; /* zalloc() failed */ u_int32_t tcps_sc_sendcookie; /* SYN cookie sent */ u_int32_t tcps_sc_recvcookie; /* SYN cookie received */ u_int32_t tcps_hc_added; /* entry added to hostcache */ u_int32_t tcps_hc_bucketoverflow; /* hostcache per bucket limit hit */ /* SACK related stats */ u_int32_t tcps_sack_recovery_episode; /* SACK recovery episodes */ u_int32_t tcps_sack_rexmits; /* SACK rexmit segments */ u_int32_t tcps_sack_rexmit_bytes; /* SACK rexmit bytes */ u_int32_t tcps_sack_rcv_blocks; /* SACK blocks (options) received */ u_int32_t tcps_sack_send_blocks; /* SACK blocks (options) sent */ u_int32_t tcps_sack_sboverflow; /* SACK sendblock overflow */ u_int32_t tcps_bg_rcvtotal; /* total background packets received */ u_int32_t tcps_rxtfindrop; /* drop conn after retransmitting FIN */ u_int32_t tcps_fcholdpacket; /* packets withheld because of flow control */ u_int32_t tcps_limited_txt; /* Limited transmit used */ u_int32_t tcps_early_rexmt; /* Early retransmit used */ u_int32_t tcps_sack_ackadv; /* Cumulative ack advanced along with sack */ /* Checksum related stats */ u_int32_t tcps_rcv_swcsum; /* tcp swcksum (inbound), packets */ u_int32_t tcps_rcv_swcsum_bytes; /* tcp swcksum (inbound), bytes */ u_int32_t tcps_rcv6_swcsum; /* tcp6 swcksum (inbound), packets */ u_int32_t tcps_rcv6_swcsum_bytes; /* tcp6 swcksum (inbound), bytes */ u_int32_t tcps_snd_swcsum; /* tcp swcksum (outbound), packets */ u_int32_t tcps_snd_swcsum_bytes; /* tcp swcksum (outbound), bytes */ u_int32_t tcps_snd6_swcsum; /* tcp6 swcksum (outbound), packets */ u_int32_t tcps_snd6_swcsum_bytes; /* tcp6 swcksum (outbound), bytes */ u_int32_t tcps_unused_1; u_int32_t tcps_unused_2; u_int32_t tcps_unused_3; /* MPTCP Related stats */ u_int32_t tcps_invalid_mpcap; /* Invalid MPTCP capable opts */ u_int32_t tcps_invalid_joins; /* Invalid MPTCP joins */ u_int32_t tcps_mpcap_fallback; /* TCP fallback in primary */ u_int32_t tcps_join_fallback; /* No MPTCP in secondary */ u_int32_t tcps_estab_fallback; /* DSS option dropped */ u_int32_t tcps_invalid_opt; /* Catchall error stat */ u_int32_t tcps_mp_outofwin; /* Packet lies outside the * shared recv window */ u_int32_t tcps_mp_reducedwin; /* Reduced subflow window */ u_int32_t tcps_mp_badcsum; /* Bad DSS csum */ u_int32_t tcps_mp_oodata; /* Out of order data */ u_int32_t tcps_mp_switches; /* number of subflow switch */ u_int32_t tcps_mp_rcvtotal; /* number of rcvd packets */ u_int32_t tcps_mp_rcvbytes; /* number of bytes received */ u_int32_t tcps_mp_sndpacks; /* number of data packs sent */ u_int32_t tcps_mp_sndbytes; /* number of bytes sent */ u_int32_t tcps_join_rxmts; /* join ack retransmits */ u_int32_t tcps_tailloss_rto; /* RTO due to tail loss */ u_int32_t tcps_reordered_pkts; /* packets reorderd */ u_int32_t tcps_recovered_pkts; /* recovered after loss */ u_int32_t tcps_pto; /* probe timeout */ u_int32_t tcps_rto_after_pto; /* RTO after a probe */ u_int32_t tcps_tlp_recovery; /* TLP induced fast recovery */ u_int32_t tcps_tlp_recoverlastpkt; /* TLP recoverd last pkt */ u_int32_t tcps_ecn_client_success; /* client-side connection negotiated ECN */ u_int32_t tcps_ecn_recv_ece; /* ECE received, sent CWR */ u_int32_t tcps_ecn_sent_ece; /* Sent ECE notification */ u_int32_t tcps_detect_reordering; /* Detect pkt reordering */ u_int32_t tcps_delay_recovery; /* Delay fast recovery */ u_int32_t tcps_avoid_rxmt; /* Retransmission was avoided */ u_int32_t tcps_unnecessary_rxmt; /* Retransmission was not needed */ u_int32_t tcps_nostretchack; /* disabled stretch ack algorithm on a connection */ u_int32_t tcps_rescue_rxmt; /* SACK rescue retransmit */ u_int32_t tcps_pto_in_recovery; /* rescue retransmit in fast recovery */ u_int32_t tcps_pmtudbh_reverted; /* PMTU Blackhole detection, segment size reverted */ /* DSACK related statistics */ u_int32_t tcps_dsack_disable; /* DSACK disabled due to n/w duplication */ u_int32_t tcps_dsack_ackloss; /* ignore DSACK due to ack loss */ u_int32_t tcps_dsack_badrexmt; /* DSACK based bad rexmt recovery */ u_int32_t tcps_dsack_sent; /* Sent DSACK notification */ u_int32_t tcps_dsack_recvd; /* Received a valid DSACK option */ u_int32_t tcps_dsack_recvd_old; /* Received an out of window DSACK option */ /* MPTCP Subflow selection stats */ u_int32_t tcps_mp_sel_symtomsd; /* By symptomsd */ u_int32_t tcps_mp_sel_rtt; /* By RTT comparison */ u_int32_t tcps_mp_sel_rto; /* By RTO comparison */ u_int32_t tcps_mp_sel_peer; /* By peer's output pattern */ u_int32_t tcps_mp_num_probes; /* Number of probes sent */ u_int32_t tcps_mp_verdowngrade; /* MPTCP version downgrade */ u_int32_t tcps_drop_after_sleep; /* drop after long AP sleep */ u_int32_t tcps_probe_if; /* probe packets after interface availability */ u_int32_t tcps_probe_if_conflict; /* Can't send probe packets for interface */ u_int32_t tcps_ecn_client_setup; /* Attempted ECN setup from client side */ u_int32_t tcps_ecn_server_setup; /* Attempted ECN setup from server side */ u_int32_t tcps_ecn_server_success; /* server-side connection negotiated ECN */ u_int32_t tcps_ecn_lost_synack; /* Lost SYN-ACK with ECN setup */ u_int32_t tcps_ecn_lost_syn; /* Lost SYN with ECN setup */ u_int32_t tcps_ecn_not_supported; /* Server did not support ECN setup */ u_int32_t tcps_ecn_recv_ce; /* Received CE from the network */ u_int32_t tcps_ecn_conn_recv_ce; /* Number of connections received CE atleast once */ u_int32_t tcps_ecn_conn_recv_ece; /* Number of connections received ECE atleast once */ u_int32_t tcps_ecn_conn_plnoce; /* Number of connections that received no CE and sufferred packet loss */ u_int32_t tcps_ecn_conn_pl_ce; /* Number of connections that received CE and sufferred packet loss */ u_int32_t tcps_ecn_conn_nopl_ce; /* Number of connections that received CE and sufferred no packet loss */ u_int32_t tcps_ecn_fallback_synloss; /* Number of times we did fall back due to SYN-Loss */ u_int32_t tcps_ecn_fallback_reorder; /* Number of times we fallback because we detected the PAWS-issue */ u_int32_t tcps_ecn_fallback_ce; /* Number of times we fallback because we received too many CEs */ /* TFO-related statistics */ u_int32_t tcps_tfo_syn_data_rcv; /* Received a SYN+data with valid cookie */ u_int32_t tcps_tfo_cookie_req_rcv;/* Received a TFO cookie-request */ u_int32_t tcps_tfo_cookie_sent; /* Offered a TFO-cookie to the client */ u_int32_t tcps_tfo_cookie_invalid;/* Received an invalid TFO-cookie */ u_int32_t tcps_tfo_cookie_req; /* Cookie requested with the SYN */ u_int32_t tcps_tfo_cookie_rcv; /* Cookie received in a SYN/ACK */ u_int32_t tcps_tfo_syn_data_sent; /* SYN+data+cookie sent */ u_int32_t tcps_tfo_syn_data_acked;/* SYN+data has been acknowledged */ u_int32_t tcps_tfo_syn_loss; /* SYN+TFO has been lost and we fallback */ u_int32_t tcps_tfo_blackhole; /* TFO got blackholed by a middlebox. */ u_int32_t tcps_tfo_cookie_wrong; /* TFO-cookie we sent was wrong */ u_int32_t tcps_tfo_no_cookie_rcv; /* We asked for a cookie but didn't get one */ u_int32_t tcps_tfo_heuristics_disable; /* TFO got disabled due to heuristics */ u_int32_t tcps_tfo_sndblackhole; /* TFO got blackholed in the sending direction */ u_int32_t tcps_mss_to_default; /* Change MSS to default using link status report */ u_int32_t tcps_mss_to_medium; /* Change MSS to medium using link status report */ u_int32_t tcps_mss_to_low; /* Change MSS to low using link status report */ u_int32_t tcps_ecn_fallback_droprst; /* ECN fallback caused by connection drop due to RST */ u_int32_t tcps_ecn_fallback_droprxmt; /* ECN fallback due to drop after multiple retransmits */ u_int32_t tcps_ecn_fallback_synrst; /* ECN fallback due to rst after syn */ u_int32_t tcps_mptcp_rcvmemdrop; /* MPTCP packets dropped for lack of memory */ u_int32_t tcps_mptcp_rcvduppack; /* MPTCP duplicate-only packets received */ u_int32_t tcps_mptcp_rcvpackafterwin; /* MPTCP packets with data after window */ /* TCP timer statistics */ u_int32_t tcps_timer_drift_le_1_ms; /* Timer drift less or equal to 1 ms */ u_int32_t tcps_timer_drift_le_10_ms; /* Timer drift less or equal to 10 ms */ u_int32_t tcps_timer_drift_le_20_ms; /* Timer drift less or equal to 20 ms */ u_int32_t tcps_timer_drift_le_50_ms; /* Timer drift less or equal to 50 ms */ u_int32_t tcps_timer_drift_le_100_ms; /* Timer drift less or equal to 100 ms */ u_int32_t tcps_timer_drift_le_200_ms; /* Timer drift less or equal to 200 ms */ u_int32_t tcps_timer_drift_le_500_ms; /* Timer drift less or equal to 500 ms */ u_int32_t tcps_timer_drift_le_1000_ms; /* Timer drift less or equal to 1000 ms */ u_int32_t tcps_timer_drift_gt_1000_ms; /* Timer drift greater than 1000 ms */ u_int32_t tcps_mptcp_handover_attempt; /* Total number of MPTCP-attempts using handover mode */ u_int32_t tcps_mptcp_interactive_attempt; /* Total number of MPTCP-attempts using interactive mode */ u_int32_t tcps_mptcp_aggregate_attempt; /* Total number of MPTCP-attempts using aggregate mode */ u_int32_t tcps_mptcp_fp_handover_attempt; /* Same as previous three but only for first-party apps */ u_int32_t tcps_mptcp_fp_interactive_attempt; u_int32_t tcps_mptcp_fp_aggregate_attempt; u_int32_t tcps_mptcp_heuristic_fallback; /* Total number of MPTCP-connections that fell back due to heuristics */ u_int32_t tcps_mptcp_fp_heuristic_fallback; /* Same as previous but for first-party apps */ u_int32_t tcps_mptcp_handover_success_wifi; /* Total number of successfull handover-mode connections that *started* on WiFi */ u_int32_t tcps_mptcp_handover_success_cell; /* Total number of successfull handover-mode connections that *started* on Cell */ u_int32_t tcps_mptcp_interactive_success; /* Total number of interactive-mode connections that negotiated MPTCP */ u_int32_t tcps_mptcp_aggregate_success; /* Same as previous but for aggregate */ u_int32_t tcps_mptcp_fp_handover_success_wifi; /* Same as previous four, but for first-party apps */ u_int32_t tcps_mptcp_fp_handover_success_cell; u_int32_t tcps_mptcp_fp_interactive_success; u_int32_t tcps_mptcp_fp_aggregate_success; u_int32_t tcps_mptcp_handover_cell_from_wifi; /* Total number of connections that use cell in handover-mode (coming from WiFi) */ u_int32_t tcps_mptcp_handover_wifi_from_cell; /* Total number of connections that use WiFi in handover-mode (coming from cell) */ u_int32_t tcps_mptcp_interactive_cell_from_wifi; /* Total number of connections that use cell in interactive mode (coming from WiFi) */ u_int64_t tcps_mptcp_handover_cell_bytes; /* Total number of bytes sent on cell in handover-mode (on new subflows, ignoring initial one) */ u_int64_t tcps_mptcp_interactive_cell_bytes; /* Same as previous but for interactive */ u_int64_t tcps_mptcp_aggregate_cell_bytes; u_int64_t tcps_mptcp_handover_all_bytes; /* Total number of bytes sent in handover */ u_int64_t tcps_mptcp_interactive_all_bytes; u_int64_t tcps_mptcp_aggregate_all_bytes; u_int32_t tcps_mptcp_back_to_wifi; /* Total number of connections that succeed to move traffic away from cell (when starting on cell) */ u_int32_t tcps_mptcp_wifi_proxy; /* Total number of new subflows that fell back to regular TCP on cell */ u_int32_t tcps_mptcp_cell_proxy; /* Total number of new subflows that fell back to regular TCP on WiFi */ /* TCP offload statistics */ u_int32_t tcps_ka_offload_drops; /* Keep alive drops for timeout reported by firmware */ u_int32_t tcps_mptcp_triggered_cell; /* Total number of times an MPTCP-connection triggered cell bringup */ u_int32_t tcps_fin_timeout_drops; }; struct tcpstat_local { u_int64_t badformat; u_int64_t unspecv6; u_int64_t synfin; u_int64_t badformatipsec; u_int64_t noconnnolist; u_int64_t noconnlist; u_int64_t listbadsyn; u_int64_t icmp6unreach; u_int64_t deprecate6; u_int64_t ooopacket; u_int64_t rstinsynrcv; u_int64_t dospacket; u_int64_t cleanup; u_int64_t synwindow; }; #pragma pack(4) /* * TCB structure exported to user-land via sysctl(3). * Evil hack: declare only if in_pcb.h and sys/socketvar.h have been * included. Not all of our clients do. */ struct xtcpcb { u_int32_t xt_len; struct inpcb xt_inp; struct tcpcb xt_tp; struct xsocket xt_socket; u_quad_t xt_alignment_hack; }; struct xtcpcb64 { u_int32_t xt_len; struct xinpcb64 xt_inpcb; u_int64_t t_segq; int t_dupacks; /* consecutive dup acks recd */ int t_timer[TCPT_NTIMERS_EXT]; /* tcp timers */ int t_state; /* state of this connection */ u_int t_flags; int t_force; /* 1 if forcing out a byte */ tcp_seq snd_una; /* send unacknowledged */ tcp_seq snd_max; /* highest sequence number sent; * used to recognize retransmits */ tcp_seq snd_nxt; /* send next */ tcp_seq snd_up; /* send urgent pointer */ tcp_seq snd_wl1; /* window update seg seq number */ tcp_seq snd_wl2; /* window update seg ack number */ tcp_seq iss; /* initial send sequence number */ tcp_seq irs; /* initial receive sequence number */ tcp_seq rcv_nxt; /* receive next */ tcp_seq rcv_adv; /* advertised window */ u_int32_t rcv_wnd; /* receive window */ tcp_seq rcv_up; /* receive urgent pointer */ u_int32_t snd_wnd; /* send window */ u_int32_t snd_cwnd; /* congestion-controlled window */ u_int32_t snd_ssthresh; /* snd_cwnd size threshold for * for slow start exponential to * linear switch */ u_int t_maxopd; /* mss plus options */ u_int32_t t_rcvtime; /* time at which a packet was received */ u_int32_t t_starttime; /* time connection was established */ int t_rtttime; /* round trip time */ tcp_seq t_rtseq; /* sequence number being timed */ int t_rxtcur; /* current retransmit value (ticks) */ u_int t_maxseg; /* maximum segment size */ int t_srtt; /* smoothed round-trip time */ int t_rttvar; /* variance in round-trip time */ int t_rxtshift; /* log(2) of rexmt exp. backoff */ u_int t_rttmin; /* minimum rtt allowed */ u_int32_t t_rttupdated; /* number of times rtt sampled */ u_int32_t max_sndwnd; /* largest window peer has offered */ int t_softerror; /* possible error not yet reported */ /* out-of-band data */ char t_oobflags; /* have some */ char t_iobc; /* input character */ /* RFC 1323 variables */ u_char snd_scale; /* window scaling for send window */ u_char rcv_scale; /* window scaling for recv window */ u_char request_r_scale; /* pending window scaling */ u_char requested_s_scale; u_int32_t ts_recent; /* timestamp echo data */ u_int32_t ts_recent_age; /* when last updated */ tcp_seq last_ack_sent; /* RFC 1644 variables */ tcp_cc cc_send; /* send connection count */ tcp_cc cc_recv; /* receive connection count */ tcp_seq snd_recover; /* for use in fast recovery */ /* experimental */ u_int32_t snd_cwnd_prev; /* cwnd prior to retransmit */ u_int32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ u_int32_t t_badrxtwin; /* window for retransmit recovery */ u_quad_t xt_alignment_hack; }; #pragma pack() /* * Names for TCP sysctl objects */ #define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */ #define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */ #define TCPCTL_MSSDFLT 3 /* MSS default */ #define TCPCTL_STATS 4 /* statistics (read-only) */ #define TCPCTL_RTTDFLT 5 /* default RTT estimate */ #define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */ #define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ #define TCPCTL_SENDSPACE 8 /* send buffer space */ #define TCPCTL_RECVSPACE 9 /* receive buffer space */ #define TCPCTL_KEEPINIT 10 /* timeout for establishing syn */ #define TCPCTL_PCBLIST 11 /* list of all outstanding PCBs */ #define TCPCTL_DELACKTIME 12 /* time before sending delayed ACK */ #define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */ #define TCPCTL_MAXID 14 #endif /* _NETINET_TCP_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/tcp.h
/* * Copyright (c) 2000-2018 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $ */ #ifndef _NETINET_TCP_H_ #define _NETINET_TCP_H_ #include <sys/appleapiopts.h> #include <machine/endian.h> #include <machine/types.h> /* __uint32_t */ #include <sys/types.h> #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) typedef __uint32_t tcp_seq; typedef __uint32_t tcp_cc; /* connection count per rfc1644 */ #define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */ #define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */ /* * TCP header. * Per RFC 793, September, 1981. */ struct tcphdr { unsigned short th_sport; /* source port */ unsigned short th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ #if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN unsigned int th_x2:4, /* (unused) */ th_off:4; /* data offset */ #endif #if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN unsigned int th_off:4, /* data offset */ th_x2:4; /* (unused) */ #endif unsigned char th_flags; #define TH_FIN 0x01 #define TH_SYN 0x02 #define TH_RST 0x04 #define TH_PUSH 0x08 #define TH_ACK 0x10 #define TH_URG 0x20 #define TH_ECE 0x40 #define TH_CWR 0x80 #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR) #define TH_ACCEPT (TH_FIN|TH_SYN|TH_RST|TH_ACK) unsigned short th_win; /* window */ unsigned short th_sum; /* checksum */ unsigned short th_urp; /* urgent pointer */ }; #define TCPOPT_EOL 0 #define TCPOPT_NOP 1 #define TCPOPT_MAXSEG 2 #define TCPOLEN_MAXSEG 4 #define TCPOPT_WINDOW 3 #define TCPOLEN_WINDOW 3 #define TCPOPT_SACK_PERMITTED 4 /* Experimental */ #define TCPOLEN_SACK_PERMITTED 2 #define TCPOPT_SACK 5 /* Experimental */ #define TCPOLEN_SACK 8 /* len of sack block */ #define TCPOPT_TIMESTAMP 8 #define TCPOLEN_TIMESTAMP 10 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ #define TCPOPT_TSTAMP_HDR \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) #define MAX_TCPOPTLEN 40 /* Absolute maximum TCP options len */ #define TCPOPT_CC 11 /* CC options: RFC-1644 */ #define TCPOPT_CCNEW 12 #define TCPOPT_CCECHO 13 #define TCPOLEN_CC 6 #define TCPOLEN_CC_APPA (TCPOLEN_CC+2) #define TCPOPT_CC_HDR(ccopt) \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) #define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */ #define TCPOLEN_SIGNATURE 18 #if MPTCP #define TCPOPT_MULTIPATH 30 #endif #define TCPOPT_FASTOPEN 34 #define TCPOLEN_FASTOPEN_REQ 2 /* Option definitions */ #define TCPOPT_SACK_PERMIT_HDR \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK_PERMITTED<<8|TCPOLEN_SACK_PERMITTED) #define TCPOPT_SACK_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK<<8) /* Miscellaneous constants */ #define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at sender side */ /* * A SACK option that specifies n blocks will have a length of (8*n + 2) * bytes, so the 40 bytes available for TCP options can specify a * maximum of 4 blocks. */ #define TCP_MAX_SACK 4 /* MAX # SACKs sent in any segment */ /* * Default maximum segment size for TCP. * With an IP MTU of 576, this is 536, * but 512 is probably more convenient. * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). */ #define TCP_MSS 512 /* * TCP_MINMSS is defined to be 216 which is fine for the smallest * link MTU (256 bytes, SLIP interface) in the Internet. * However it is very unlikely to come across such low MTU interfaces * these days (anno dato 2004). * Probably it can be set to 512 without ill effects. But we play safe. * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. * Setting this to "0" disables the minmss check. */ #define TCP_MINMSS 216 /* * Default maximum segment size for TCP6. * With an IP6 MSS of 1280, this is 1220, * but 1024 is probably more convenient. (xxx kazu in doubt) * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)) */ #define TCP6_MSS 1024 #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ #define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) /* max space left for options */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * User-settable options (used with setsockopt). */ #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define TCP_MAXSEG 0x02 /* set maximum segment size */ #define TCP_NOPUSH 0x04 /* don't push last block of write */ #define TCP_NOOPT 0x08 /* don't use TCP options */ #define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */ #define TCP_CONNECTIONTIMEOUT 0x20 /* connection timeout */ #define PERSIST_TIMEOUT 0x40 /* time after which a connection in * persist timeout will terminate. * see draft-ananth-tcpm-persist-02.txt */ #define TCP_RXT_CONNDROPTIME 0x80 /* time after which tcp retransmissions will be * stopped and the connection will be dropped */ #define TCP_RXT_FINDROP 0x100 /* when this option is set, drop a connection * after retransmitting the FIN 3 times. It will * prevent holding too many mbufs in socket * buffer queues. */ #define TCP_KEEPINTVL 0x101 /* interval between keepalives */ #define TCP_KEEPCNT 0x102 /* number of keepalives before close */ #define TCP_SENDMOREACKS 0x103 /* always ack every other packet */ #define TCP_ENABLE_ECN 0x104 /* Enable ECN on a connection */ #define TCP_FASTOPEN 0x105 /* Enable/Disable TCP Fastopen on this socket */ #define TCP_CONNECTION_INFO 0x106 /* State of TCP connection */ #define TCP_NOTSENT_LOWAT 0x201 /* Low water mark for TCP unsent data */ struct tcp_connection_info { u_int8_t tcpi_state; /* connection state */ u_int8_t tcpi_snd_wscale; /* Window scale for send window */ u_int8_t tcpi_rcv_wscale; /* Window scale for receive window */ u_int8_t __pad1; u_int32_t tcpi_options; /* TCP options supported */ #define TCPCI_OPT_TIMESTAMPS 0x00000001 /* Timestamps enabled */ #define TCPCI_OPT_SACK 0x00000002 /* SACK enabled */ #define TCPCI_OPT_WSCALE 0x00000004 /* Window scaling enabled */ #define TCPCI_OPT_ECN 0x00000008 /* ECN enabled */ u_int32_t tcpi_flags; /* flags */ #define TCPCI_FLAG_LOSSRECOVERY 0x00000001 #define TCPCI_FLAG_REORDERING_DETECTED 0x00000002 u_int32_t tcpi_rto; /* retransmit timeout in ms */ u_int32_t tcpi_maxseg; /* maximum segment size supported */ u_int32_t tcpi_snd_ssthresh; /* slow start threshold in bytes */ u_int32_t tcpi_snd_cwnd; /* send congestion window in bytes */ u_int32_t tcpi_snd_wnd; /* send widnow in bytes */ u_int32_t tcpi_snd_sbbytes; /* bytes in send socket buffer, including in-flight data */ u_int32_t tcpi_rcv_wnd; /* receive window in bytes*/ u_int32_t tcpi_rttcur; /* most recent RTT in ms */ u_int32_t tcpi_srtt; /* average RTT in ms */ u_int32_t tcpi_rttvar; /* RTT variance */ u_int32_t tcpi_tfo_cookie_req:1, /* Cookie requested? */ tcpi_tfo_cookie_rcv:1, /* Cookie received? */ tcpi_tfo_syn_loss:1, /* Fallback to reg. TCP after SYN-loss */ tcpi_tfo_syn_data_sent:1, /* SYN+data has been sent out */ tcpi_tfo_syn_data_acked:1, /* SYN+data has been fully acknowledged */ tcpi_tfo_syn_data_rcv:1, /* Server received SYN+data with a valid cookie */ tcpi_tfo_cookie_req_rcv:1, /* Server received cookie-request */ tcpi_tfo_cookie_sent:1, /* Server announced cookie */ tcpi_tfo_cookie_invalid:1, /* Server received an invalid cookie */ tcpi_tfo_cookie_wrong:1, /* Our sent cookie was wrong */ tcpi_tfo_no_cookie_rcv:1, /* We did not receive a cookie upon our request */ tcpi_tfo_heuristics_disable:1, /* TFO-heuristics disabled it */ tcpi_tfo_send_blackhole:1, /* A sending-blackhole got detected */ tcpi_tfo_recv_blackhole:1, /* A receiver-blackhole got detected */ tcpi_tfo_onebyte_proxy:1, /* A proxy acknowledges all but one byte of the SYN */ __pad2:17; u_int64_t tcpi_txpackets __attribute__((aligned(8))); u_int64_t tcpi_txbytes __attribute__((aligned(8))); u_int64_t tcpi_txretransmitbytes __attribute__((aligned(8))); u_int64_t tcpi_rxpackets __attribute__((aligned(8))); u_int64_t tcpi_rxbytes __attribute__((aligned(8))); u_int64_t tcpi_rxoutoforderbytes __attribute__((aligned(8))); u_int64_t tcpi_txretransmitpackets __attribute__((aligned(8))); }; #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #endif
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/ip_var.h
/* * Copyright (c) 2000-2021 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip_var.h 8.2 (Berkeley) 1/9/95 */ /* * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce * support for mandatory and extensible security protections. This notice * is included in support of clause 2.2 (b) of the Apple Public License, * Version 2.0. */ #ifndef _NETINET_IP_VAR_H_ #define _NETINET_IP_VAR_H_ #include <sys/appleapiopts.h> #include <netinet/in.h> #include <sys/types.h> /* * Overlay for ip header used by other protocols (tcp, udp). */ struct ipovly { u_char ih_x1[9]; /* (unused) */ u_char ih_pr; /* protocol */ u_short ih_len; /* protocol length */ struct in_addr ih_src; /* source internet address */ struct in_addr ih_dst; /* destination internet address */ }; #define MAX_IPOPTLEN 40 struct ipstat { u_int32_t ips_total; /* total packets received */ u_int32_t ips_badsum; /* checksum bad */ u_int32_t ips_tooshort; /* packet too short */ u_int32_t ips_toosmall; /* not enough data */ u_int32_t ips_badhlen; /* ip header length < data size */ u_int32_t ips_badlen; /* ip length < ip header length */ u_int32_t ips_fragments; /* fragments received */ u_int32_t ips_fragdropped; /* frags dropped (dups, out of space) */ u_int32_t ips_fragtimeout; /* fragments timed out */ u_int32_t ips_forward; /* packets forwarded */ u_int32_t ips_fastforward; /* packets fast forwarded */ u_int32_t ips_cantforward; /* packets rcvd for unreachable dest */ u_int32_t ips_redirectsent; /* packets forwarded on same net */ u_int32_t ips_noproto; /* unknown or unsupported protocol */ u_int32_t ips_delivered; /* datagrams delivered to upper level */ u_int32_t ips_localout; /* total ip packets generated here */ u_int32_t ips_odropped; /* lost packets due to nobufs, etc. */ u_int32_t ips_reassembled; /* total packets reassembled ok */ u_int32_t ips_fragmented; /* datagrams successfully fragmented */ u_int32_t ips_ofragments; /* output fragments created */ u_int32_t ips_cantfrag; /* don't fragment flag was set, etc. */ u_int32_t ips_badoptions; /* error in option processing */ u_int32_t ips_noroute; /* packets discarded due to no route */ u_int32_t ips_badvers; /* ip version != 4 */ u_int32_t ips_rawout; /* total raw ip packets generated */ u_int32_t ips_toolong; /* ip length > max ip packet size */ u_int32_t ips_notmember; /* multicasts for unregistered grps */ u_int32_t ips_nogif; /* no match gif found */ u_int32_t ips_badaddr; /* invalid address on header */ u_int32_t ips_pktdropcntrl; /* pkt dropped, no mbufs for ctl data */ u_int32_t ips_rcv_swcsum; /* ip hdr swcksum (inbound), packets */ u_int32_t ips_rcv_swcsum_bytes; /* ip hdr swcksum (inbound), bytes */ u_int32_t ips_snd_swcsum; /* ip hdr swcksum (outbound), packets */ u_int32_t ips_snd_swcsum_bytes; /* ip hdr swcksum (outbound), bytes */ u_int32_t ips_adj; /* total packets trimmed/adjusted */ u_int32_t ips_adj_hwcsum_clr; /* hwcksum discarded during adj */ u_int32_t ips_rxc_collisions; /* rx chaining collisions */ u_int32_t ips_rxc_chained; /* rx chains */ u_int32_t ips_rxc_notchain; /* rx bypassed chaining */ u_int32_t ips_rxc_chainsz_gt2; /* rx chain size greater than 2 */ u_int32_t ips_rxc_chainsz_gt4; /* rx chain size greater than 4 */ u_int32_t ips_rxc_notlist; /* count of pkts through ip_input */ u_int32_t ips_raw_sappend_fail; /* sock append failed */ u_int32_t ips_necp_policy_drop; /* NECP policy related drop */ u_int32_t ips_rcv_if_weak_match; /* packets whose receive interface that passed the Weak ES address check */ u_int32_t ips_rcv_if_no_match; /* packets whose receive interface did not pass the address check */ }; struct ip_linklocal_stat { u_int32_t iplls_in_total; u_int32_t iplls_in_badttl; u_int32_t iplls_out_total; u_int32_t iplls_out_badttl; }; #endif /* !_NETINET_IP_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/icmp6.h
/* * Copyright (c) 2000-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_ICMP6_H_ #define _NETINET_ICMP6_H_ #include <netinet/in.h> #include <sys/appleapiopts.h> #include <sys/types.h> #define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr) * - sizeof(struct icmp6_hdr) */ struct icmp6_hdr { u_int8_t icmp6_type; /* type field */ u_int8_t icmp6_code; /* code field */ u_int16_t icmp6_cksum; /* checksum field */ union { u_int32_t icmp6_un_data32[1]; /* type-specific field */ u_int16_t icmp6_un_data16[2]; /* type-specific field */ u_int8_t icmp6_un_data8[4]; /* type-specific field */ } icmp6_dataun; } __attribute__((__packed__)); #define icmp6_data32 icmp6_dataun.icmp6_un_data32 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 #define icmp6_data8 icmp6_dataun.icmp6_un_data8 #define icmp6_pptr icmp6_data32[0] /* parameter prob */ #define icmp6_mtu icmp6_data32[0] /* packet too big */ #define icmp6_id icmp6_data16[0] /* echo request/reply */ #define icmp6_seq icmp6_data16[1] /* echo request/reply */ #define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */ #define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */ #define ICMP6_PACKET_TOO_BIG 2 /* packet too big */ #define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */ #define ICMP6_PARAM_PROB 4 /* ip6 header bad */ #define ICMP6_ECHO_REQUEST 128 /* echo service */ #define ICMP6_ECHO_REPLY 129 /* echo reply */ #define MLD_LISTENER_QUERY 130 /* multicast listener query */ #define MLD_LISTENER_REPORT 131 /* multicast listener report */ #define MLD_LISTENER_DONE 132 /* multicast listener done */ #define MLD_LISTENER_REDUCTION MLD_LISTENER_DONE /* RFC3542 definition */ /* RFC2292 decls */ #define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */ #define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */ #define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */ #define ND_ROUTER_SOLICIT 133 /* router solicitation */ #define ND_ROUTER_ADVERT 134 /* router advertisement */ #define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */ #define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */ #define ND_REDIRECT 137 /* redirect */ #define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */ #define ICMP6_WRUREQUEST 139 /* who are you request */ #define ICMP6_WRUREPLY 140 /* who are you reply */ #define ICMP6_FQDN_QUERY 139 /* FQDN query */ #define ICMP6_FQDN_REPLY 140 /* FQDN reply */ #define ICMP6_NI_QUERY 139 /* node information request */ #define ICMP6_NI_REPLY 140 /* node information reply */ #define MLDV2_LISTENER_REPORT 143 /* RFC3810 listener report */ /* The definitions below are experimental. TBA */ #define MLD_MTRACE_RESP 200 /* mtrace resp (to sender) */ #define MLD_MTRACE 201 /* mtrace messages */ #define ICMP6_MAXTYPE 201 #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ #define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ #define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */ #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ #define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ #define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ #define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ #define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */ #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */ #define ICMP6_PARAMPROB_FIRSTFRAG_INCOMP_HDR 3 /* first fragment has incomplete IPv6 Header Chain */ #define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */ #define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */ #define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */ #define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */ #define ICMP6_NI_SUCCESS 0 /* node information successful reply */ #define ICMP6_NI_REFUSED 1 /* node information request is refused */ #define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */ #define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */ #define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */ #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ /* Used in kernel only */ #define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */ #define ND_REDIRECT_ROUTER 1 /* redirect to a better router */ /* * Multicast Listener Discovery */ struct mld_hdr { struct icmp6_hdr mld_icmp6_hdr; struct in6_addr mld_addr; /* multicast address */ } __attribute__((__packed__)); /* definitions to provide backward compatibility to old KAME applications */ /* shortcut macro definitions */ #define mld_type mld_icmp6_hdr.icmp6_type #define mld_code mld_icmp6_hdr.icmp6_code #define mld_cksum mld_icmp6_hdr.icmp6_cksum #define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0] #define mld_reserved mld_icmp6_hdr.icmp6_data16[1] #define mld_v2_reserved mld_icmp6_hdr.icmp6_data16[0] #define mld_v2_numrecs mld_icmp6_hdr.icmp6_data16[1] #define ICMP6_ERRORTYPE(type) \ ((type) == ICMP6_DST_UNREACH || (type) == ICMP6_PACKET_TOO_BIG || \ (type) == ICMP6_TIME_EXCEEDED || (type) == ICMP6_PARAM_PROB) /* * Neighbor Discovery */ struct nd_router_solicit { /* router solicitation */ struct icmp6_hdr nd_rs_hdr; /* could be followed by options */ }__attribute__((__packed__)); #define nd_rs_type nd_rs_hdr.icmp6_type #define nd_rs_code nd_rs_hdr.icmp6_code #define nd_rs_cksum nd_rs_hdr.icmp6_cksum #define nd_rs_reserved nd_rs_hdr.icmp6_data32[0] struct nd_router_advert { /* router advertisement */ struct icmp6_hdr nd_ra_hdr; u_int32_t nd_ra_reachable; /* reachable time */ u_int32_t nd_ra_retransmit; /* retransmit timer */ /* could be followed by options */ } __attribute__((__packed__)); #define nd_ra_type nd_ra_hdr.icmp6_type #define nd_ra_code nd_ra_hdr.icmp6_code #define nd_ra_cksum nd_ra_hdr.icmp6_cksum #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] #define ND_RA_FLAG_MANAGED 0x80 #define ND_RA_FLAG_OTHER 0x40 #define ND_RA_FLAG_HA 0x20 /* Router preference values based on RFC 4191 */ #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ #define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */ #define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */ #define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */ #define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */ #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] struct nd_neighbor_solicit { /* neighbor solicitation */ struct icmp6_hdr nd_ns_hdr; struct in6_addr nd_ns_target; /*target address */ /* could be followed by options */ }__attribute__((__packed__)); #define nd_ns_type nd_ns_hdr.icmp6_type #define nd_ns_code nd_ns_hdr.icmp6_code #define nd_ns_cksum nd_ns_hdr.icmp6_cksum #define nd_ns_reserved nd_ns_hdr.icmp6_data32[0] struct nd_neighbor_advert { /* neighbor advertisement */ struct icmp6_hdr nd_na_hdr; struct in6_addr nd_na_target; /* target address */ /* could be followed by options */ }__attribute__((__packed__)); #define nd_na_type nd_na_hdr.icmp6_type #define nd_na_code nd_na_hdr.icmp6_code #define nd_na_cksum nd_na_hdr.icmp6_cksum #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] #if BYTE_ORDER == BIG_ENDIAN #define ND_NA_FLAG_ROUTER 0x80000000 #define ND_NA_FLAG_SOLICITED 0x40000000 #define ND_NA_FLAG_OVERRIDE 0x20000000 #else #if BYTE_ORDER == LITTLE_ENDIAN #define ND_NA_FLAG_ROUTER 0x80 #define ND_NA_FLAG_SOLICITED 0x40 #define ND_NA_FLAG_OVERRIDE 0x20 #endif #endif struct nd_redirect { /* redirect */ struct icmp6_hdr nd_rd_hdr; struct in6_addr nd_rd_target; /* target address */ struct in6_addr nd_rd_dst; /* destination address */ /* could be followed by options */ }__attribute__((__packed__)); #define nd_rd_type nd_rd_hdr.icmp6_type #define nd_rd_code nd_rd_hdr.icmp6_code #define nd_rd_cksum nd_rd_hdr.icmp6_cksum #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] struct nd_opt_hdr { /* Neighbor discovery option header */ u_int8_t nd_opt_type; u_int8_t nd_opt_len; /* followed by option specific data*/ }__attribute__((__packed__)); #define ND_OPT_SOURCE_LINKADDR 1 #define ND_OPT_TARGET_LINKADDR 2 #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_OPT_NONCE 14 /* RFC 3971 */ #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ #define ND_OPT_RDNSS 25 /* RFC 6106 */ #define ND_OPT_DNSSL 31 /* RFC 6106 */ #define ND_OPT_CAPTIVE_PORTAL 37 /* RFC 7710 */ #define ND_OPT_PREF64 38 /* RFC 8781 */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; u_int8_t nd_opt_pi_len; u_int8_t nd_opt_pi_prefix_len; u_int8_t nd_opt_pi_flags_reserved; u_int32_t nd_opt_pi_valid_time; u_int32_t nd_opt_pi_preferred_time; u_int32_t nd_opt_pi_reserved2; struct in6_addr nd_opt_pi_prefix; }__attribute__((__packed__)); #define ND_OPT_PI_FLAG_ONLINK 0x80 #define ND_OPT_PI_FLAG_AUTO 0x40 #define ND_OPT_NONCE_LEN ((1 * 8) - 2) #if ((ND_OPT_NONCE_LEN + 2) % 8) != 0 #error "(ND_OPT_NONCE_LEN + 2) must be a multiple of 8." #endif struct nd_opt_nonce { /* nonce option */ u_int8_t nd_opt_nonce_type; u_int8_t nd_opt_nonce_len; u_int8_t nd_opt_nonce[ND_OPT_NONCE_LEN]; } __attribute__((__packed__)); struct nd_opt_rd_hdr { /* redirected header */ u_int8_t nd_opt_rh_type; u_int8_t nd_opt_rh_len; u_int16_t nd_opt_rh_reserved1; u_int32_t nd_opt_rh_reserved2; /* followed by IP header and data */ } __attribute__((__packed__)); struct nd_opt_mtu { /* MTU option */ u_int8_t nd_opt_mtu_type; u_int8_t nd_opt_mtu_len; u_int16_t nd_opt_mtu_reserved; u_int32_t nd_opt_mtu_mtu; }__attribute__((__packed__)); struct nd_opt_route_info { /* route info */ u_int8_t nd_opt_rti_type; u_int8_t nd_opt_rti_len; u_int8_t nd_opt_rti_prefixlen; u_int8_t nd_opt_rti_flags; u_int32_t nd_opt_rti_lifetime; /* prefix follows */ }__attribute__((__packed__)); struct nd_opt_rdnss { /* recursive domain name system servers */ u_int8_t nd_opt_rdnss_type; u_int8_t nd_opt_rdnss_len; u_int16_t nd_opt_rdnss_reserved; u_int32_t nd_opt_rdnss_lifetime; struct in6_addr nd_opt_rdnss_addr[1]; } __attribute__((__packed__)); struct nd_opt_dnssl { /* domain name search list */ u_int8_t nd_opt_dnssl_type; u_int8_t nd_opt_dnssl_len; u_int16_t nd_opt_dnssl_reserved; u_int32_t nd_opt_dnssl_lifetime; u_int8_t nd_opt_dnssl_domains[8]; } __attribute__((__packed__)); /* * PREF64 (NAT64 prefix) RFC 8781 */ struct nd_opt_pref64 { /* NAT64 prefix */ u_int8_t nd_opt_pref64_type; u_int8_t nd_opt_pref64_len; u_int16_t nd_opt_pref64_scaled_lifetime_plc; u_int32_t nd_opt_pref64_prefix[3]; } __attribute__((__packed__)); #define ND_OPT_PREF64_SCALED_LIFETIME_MASK 0xfff8 #define ND_OPT_PREF64_PLC_MASK 0x0007 #define ND_OPT_PREF64_LIFETIME_MAX 65528 #define ND_OPT_PREF64_PLC_32 5 #define ND_OPT_PREF64_PLC_40 4 #define ND_OPT_PREF64_PLC_48 3 #define ND_OPT_PREF64_PLC_56 2 #define ND_OPT_PREF64_PLC_64 1 #define ND_OPT_PREF64_PLC_96 0 /* * icmp6 namelookup */ struct icmp6_namelookup { struct icmp6_hdr icmp6_nl_hdr; u_int8_t icmp6_nl_nonce[8]; int32_t icmp6_nl_ttl; #if 0 u_int8_t icmp6_nl_len; u_int8_t icmp6_nl_name[3]; #endif /* could be followed by options */ }__attribute__((__packed__)); /* * icmp6 node information */ struct icmp6_nodeinfo { struct icmp6_hdr icmp6_ni_hdr; u_int8_t icmp6_ni_nonce[8]; /* could be followed by reply data */ }__attribute__((__packed__)); #define ni_type icmp6_ni_hdr.icmp6_type #define ni_code icmp6_ni_hdr.icmp6_code #define ni_cksum icmp6_ni_hdr.icmp6_cksum #define ni_qtype icmp6_ni_hdr.icmp6_data16[0] #define ni_flags icmp6_ni_hdr.icmp6_data16[1] #define NI_QTYPE_NOOP 0 /* NOOP */ #define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */ #define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */ #define NI_QTYPE_DNSNAME 2 /* DNS Name */ #define NI_QTYPE_NODEADDR 3 /* Node Addresses */ #define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ #if BYTE_ORDER == BIG_ENDIAN #define NI_SUPTYPE_FLAG_COMPRESS 0x1 #define NI_FQDN_FLAG_VALIDTTL 0x1 #elif BYTE_ORDER == LITTLE_ENDIAN #define NI_SUPTYPE_FLAG_COMPRESS 0x0100 #define NI_FQDN_FLAG_VALIDTTL 0x0100 #endif #ifdef NAME_LOOKUPS_04 #if BYTE_ORDER == BIG_ENDIAN #define NI_NODEADDR_FLAG_LINKLOCAL 0x1 #define NI_NODEADDR_FLAG_SITELOCAL 0x2 #define NI_NODEADDR_FLAG_GLOBAL 0x4 #define NI_NODEADDR_FLAG_ALL 0x8 #define NI_NODEADDR_FLAG_TRUNCATE 0x10 #define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */ #elif BYTE_ORDER == LITTLE_ENDIAN #define NI_NODEADDR_FLAG_LINKLOCAL 0x0100 #define NI_NODEADDR_FLAG_SITELOCAL 0x0200 #define NI_NODEADDR_FLAG_GLOBAL 0x0400 #define NI_NODEADDR_FLAG_ALL 0x0800 #define NI_NODEADDR_FLAG_TRUNCATE 0x1000 #define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */ #endif #else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */ #if BYTE_ORDER == BIG_ENDIAN #define NI_NODEADDR_FLAG_TRUNCATE 0x1 #define NI_NODEADDR_FLAG_ALL 0x2 #define NI_NODEADDR_FLAG_COMPAT 0x4 #define NI_NODEADDR_FLAG_LINKLOCAL 0x8 #define NI_NODEADDR_FLAG_SITELOCAL 0x10 #define NI_NODEADDR_FLAG_GLOBAL 0x20 #define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */ #elif BYTE_ORDER == LITTLE_ENDIAN #define NI_NODEADDR_FLAG_TRUNCATE 0x0100 #define NI_NODEADDR_FLAG_ALL 0x0200 #define NI_NODEADDR_FLAG_COMPAT 0x0400 #define NI_NODEADDR_FLAG_LINKLOCAL 0x0800 #define NI_NODEADDR_FLAG_SITELOCAL 0x1000 #define NI_NODEADDR_FLAG_GLOBAL 0x2000 #define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */ #endif #endif struct ni_reply_fqdn { u_int32_t ni_fqdn_ttl; /* TTL */ u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */ u_int8_t ni_fqdn_name[3]; /* XXX: alignment */ }__attribute__((__packed__)); /* * Router Renumbering. as router-renum-08.txt */ struct icmp6_router_renum { /* router renumbering header */ struct icmp6_hdr rr_hdr; u_int8_t rr_segnum; u_int8_t rr_flags; u_int16_t rr_maxdelay; u_int32_t rr_reserved; } __attribute__((__packed__)); #define ICMP6_RR_FLAGS_TEST 0x80 #define ICMP6_RR_FLAGS_REQRESULT 0x40 #define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 #define ICMP6_RR_FLAGS_SPECSITE 0x10 #define ICMP6_RR_FLAGS_PREVDONE 0x08 #define rr_type rr_hdr.icmp6_type #define rr_code rr_hdr.icmp6_code #define rr_cksum rr_hdr.icmp6_cksum #define rr_seqnum rr_hdr.icmp6_data32[0] struct rr_pco_match { /* match prefix part */ u_int8_t rpm_code; u_int8_t rpm_len; u_int8_t rpm_ordinal; u_int8_t rpm_matchlen; u_int8_t rpm_minlen; u_int8_t rpm_maxlen; u_int16_t rpm_reserved; struct in6_addr rpm_prefix; } __attribute__((__packed__)); #define RPM_PCO_ADD 1 #define RPM_PCO_CHANGE 2 #define RPM_PCO_SETGLOBAL 3 #define RPM_PCO_MAX 4 struct rr_pco_use { /* use prefix part */ u_int8_t rpu_uselen; u_int8_t rpu_keeplen; u_int8_t rpu_ramask; u_int8_t rpu_raflags; u_int32_t rpu_vltime; u_int32_t rpu_pltime; u_int32_t rpu_flags; struct in6_addr rpu_prefix; } __attribute__((__packed__)); #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40 #if BYTE_ORDER == BIG_ENDIAN #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000 #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000 #elif BYTE_ORDER == LITTLE_ENDIAN #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80 #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40 #endif struct rr_result { /* router renumbering result message */ u_int16_t rrr_flags; u_int8_t rrr_ordinal; u_int8_t rrr_matchedlen; u_int32_t rrr_ifid; struct in6_addr rrr_prefix; } __attribute__((__packed__)); #if BYTE_ORDER == BIG_ENDIAN #define ICMP6_RR_RESULT_FLAGS_OOB 0x0002 #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001 #elif BYTE_ORDER == LITTLE_ENDIAN #define ICMP6_RR_RESULT_FLAGS_OOB 0x0200 #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100 #endif /* * icmp6 filter structures. */ struct icmp6_filter { u_int32_t icmp6_filt[8]; }; #define ICMP6_FILTER_SETPASSALL(filterp) \ do { \ int i; u_char *ptr; \ ptr = (u_char *)filterp; \ for (i = 0; i < sizeof(struct icmp6_filter); i++) \ ptr[i] = 0xff; \ } while (0) #define ICMP6_FILTER_SETBLOCKALL(filterp) \ bzero(filterp, sizeof(struct icmp6_filter)) #define ICMP6_FILTER_SETPASS(type, filterp) \ (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))) #define ICMP6_FILTER_SETBLOCK(type, filterp) \ (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))) #define ICMP6_FILTER_WILLPASS(type, filterp) \ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) #define ICMP6_FILTER_WILLBLOCK(type, filterp) \ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) /* * Variables related to this implementation * of the internet control message protocol version 6. */ struct icmp6errstat { u_quad_t icp6errs_dst_unreach_noroute; u_quad_t icp6errs_dst_unreach_admin; u_quad_t icp6errs_dst_unreach_beyondscope; u_quad_t icp6errs_dst_unreach_addr; u_quad_t icp6errs_dst_unreach_noport; u_quad_t icp6errs_packet_too_big; u_quad_t icp6errs_time_exceed_transit; u_quad_t icp6errs_time_exceed_reassembly; u_quad_t icp6errs_paramprob_header; u_quad_t icp6errs_paramprob_nextheader; u_quad_t icp6errs_paramprob_option; u_quad_t icp6errs_redirect; /* we regard redirect as an error here */ u_quad_t icp6errs_unknown; }; struct icmp6stat { /* statistics related to icmp6 packets generated */ u_quad_t icp6s_error; /* # of calls to icmp6_error */ u_quad_t icp6s_canterror; /* no error 'cuz old was icmp */ u_quad_t icp6s_toofreq; /* no error 'cuz rate limitation */ u_quad_t icp6s_outhist[256]; /* statistics related to input message processed */ u_quad_t icp6s_badcode; /* icmp6_code out of range */ u_quad_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */ u_quad_t icp6s_checksum; /* bad checksum */ u_quad_t icp6s_badlen; /* calculated bound mismatch */ u_quad_t icp6s_reflect; /* number of responses */ u_quad_t icp6s_inhist[256]; u_quad_t icp6s_nd_toomanyopt; /* too many ND options */ struct icmp6errstat icp6s_outerrhist; #define icp6s_odst_unreach_noroute \ icp6s_outerrhist.icp6errs_dst_unreach_noroute #define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin #define icp6s_odst_unreach_beyondscope \ icp6s_outerrhist.icp6errs_dst_unreach_beyondscope #define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr #define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport #define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big #define icp6s_otime_exceed_transit \ icp6s_outerrhist.icp6errs_time_exceed_transit #define icp6s_otime_exceed_reassembly \ icp6s_outerrhist.icp6errs_time_exceed_reassembly #define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header #define icp6s_oparamprob_nextheader \ icp6s_outerrhist.icp6errs_paramprob_nextheader #define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option #define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect #define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown u_quad_t icp6s_pmtuchg; /* path MTU changes */ u_quad_t icp6s_nd_badopt; /* bad ND options */ u_quad_t icp6s_badns; /* bad neighbor solicitation */ u_quad_t icp6s_badna; /* bad neighbor advertisement */ u_quad_t icp6s_badrs; /* bad router advertisement */ u_quad_t icp6s_badra; /* bad router advertisement */ u_quad_t icp6s_badredirect; /* bad redirect message */ u_quad_t icp6s_rfc6980_drop; /* NDP packet dropped based on RFC 6980 */ u_quad_t icp6s_badpkttoobig; /* bad packet too big */ }; /* * Names for ICMP sysctl objects */ #define ICMPV6CTL_STATS 1 #define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */ #define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */ #if 0 /*obsoleted*/ #define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */ #endif #define ICMPV6CTL_ND6_PRUNE 6 #define ICMPV6CTL_ND6_DELAY 8 #define ICMPV6CTL_ND6_UMAXTRIES 9 #define ICMPV6CTL_ND6_MMAXTRIES 10 #define ICMPV6CTL_ND6_USELOOPBACK 11 /*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */ #define ICMPV6CTL_NODEINFO 13 #define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */ #define ICMPV6CTL_ND6_MAXNUDHINT 15 #define ICMPV6CTL_MTUDISC_HIWAT 16 #define ICMPV6CTL_MTUDISC_LOWAT 17 #define ICMPV6CTL_ND6_DEBUG 18 #define ICMPV6CTL_ND6_DRLIST 19 #define ICMPV6CTL_ND6_PRLIST 20 #define ICMPV6CTL_MLD_MAXSRCFILTER 21 #define ICMPV6CTL_MLD_SOMAXSRC 22 #define ICMPV6CTL_MLD_VERSION 23 #define ICMPV6CTL_ND6_MAXQLEN 24 #define ICMPV6CTL_ND6_ACCEPT_6TO4 25 #define ICMPV6CTL_ND6_OPTIMISTIC_DAD 26 /* RFC 4429 */ #define ICMPV6CTL_ERRPPSLIMIT_RANDOM_INCR 27 #define ICMPV6CTL_MAXID 28 #endif /* !_NETINET_ICMP6_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/udp_var.h
/* * Copyright (c) 2008-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_UDP_VAR_H_ #define _NETINET_UDP_VAR_H_ #include <sys/appleapiopts.h> #include <sys/sysctl.h> #include <netinet/ip_var.h> #include <netinet/udp.h> /* * UDP kernel structures and variables. */ struct udpiphdr { struct ipovly ui_i; /* overlaid ip structure */ struct udphdr ui_u; /* udp header */ }; #define ui_x1 ui_i.ih_x1 #define ui_pr ui_i.ih_pr #define ui_len ui_i.ih_len #define ui_src ui_i.ih_src #define ui_dst ui_i.ih_dst #define ui_sport ui_u.uh_sport #define ui_dport ui_u.uh_dport #define ui_ulen ui_u.uh_ulen #define ui_sum ui_u.uh_sum #define ui_next ui_i.ih_next #define ui_prev ui_i.ih_prev struct udpstat { /* input statistics: */ u_int32_t udps_ipackets; /* total input packets */ u_int32_t udps_hdrops; /* packet shorter than header */ u_int32_t udps_badsum; /* checksum error */ u_int32_t udps_badlen; /* data length larger than packet */ u_int32_t udps_noport; /* no socket on port */ u_int32_t udps_noportbcast; /* of above, arrived as broadcast */ u_int32_t udps_fullsock; /* not delivered, input socket full */ u_int32_t udpps_pcbcachemiss; /* input packets missing pcb cache */ u_int32_t udpps_pcbhashmiss; /* input packets not for hashed pcb */ /* output statistics: */ u_int32_t udps_opackets; /* total output packets */ u_int32_t udps_fastout; /* output packets on fast path */ u_int32_t udps_nosum; /* no checksum */ u_int32_t udps_noportmcast; /* of no socket on port, multicast */ u_int32_t udps_filtermcast; /* blocked by multicast filter */ /* checksum statistics: */ u_int32_t udps_rcv_swcsum; /* udp swcksum (inbound), packets */ u_int32_t udps_rcv_swcsum_bytes; /* udp swcksum (inbound), bytes */ u_int32_t udps_rcv6_swcsum; /* udp6 swcksum (inbound), packets */ u_int32_t udps_rcv6_swcsum_bytes; /* udp6 swcksum (inbound), bytes */ u_int32_t udps_snd_swcsum; /* udp swcksum (outbound), packets */ u_int32_t udps_snd_swcsum_bytes; /* udp swcksum (outbound), bytes */ u_int32_t udps_snd6_swcsum; /* udp6 swcksum (outbound), packets */ u_int32_t udps_snd6_swcsum_bytes; /* udp6 swcksum (outbound), bytes */ }; /* * Names for UDP sysctl objects */ #define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ #define UDPCTL_STATS 2 /* statistics (read-only) */ #define UDPCTL_MAXDGRAM 3 /* max datagram size */ #define UDPCTL_RECVSPACE 4 /* default receive buffer space */ #define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ #define UDPCTL_MAXID 6 #endif /* _NETINET_UDP_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/in_var.h
/* * Copyright (c) 2000-2019 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1985, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in_var.h 8.2 (Berkeley) 1/9/95 */ #ifndef _NETINET_IN_VAR_H_ #define _NETINET_IN_VAR_H_ #include <sys/appleapiopts.h> #include <sys/queue.h> #include <sys/kern_event.h> #include <net/if_var.h> #include <net/net_kev.h> #include <netinet/in.h> struct in_aliasreq { char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ struct sockaddr_in ifra_addr; struct sockaddr_in ifra_broadaddr; #define ifra_dstaddr ifra_broadaddr struct sockaddr_in ifra_mask; }; /* * Event data, inet style. */ struct kev_in_data { struct net_event_data link_data; struct in_addr ia_addr; /* interface address */ u_int32_t ia_net; /* network number of interface */ u_int32_t ia_netmask; /* mask of net part */ u_int32_t ia_subnet; /* subnet number, including net */ u_int32_t ia_subnetmask; /* mask of subnet part */ struct in_addr ia_netbroadcast; /* to recognize net broadcasts */ struct in_addr ia_dstaddr; }; struct kev_in_collision { struct net_event_data link_data; /* link where ARP was received on */ struct in_addr ia_ipaddr; /* conflicting IP address */ u_char hw_len; /* length of hardware address */ u_char hw_addr[0]; /* variable length hardware address */ }; struct kev_in_arpfailure { struct net_event_data link_data; /* link where ARP is being sent */ }; struct kev_in_arpalive { struct net_event_data link_data; /* link where ARP was received */ }; #ifdef __APPLE_API_PRIVATE struct kev_in_portinuse { u_int16_t port; /* conflicting port number in host order */ u_int32_t req_pid; /* PID port requestor */ u_int32_t reserved[2]; }; #endif /* __APPLE_API_PRIVATE */ /* INET6 stuff */ #include <netinet6/in6_var.h> #endif /* _NETINET_IN_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/tcpip.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcpip.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/tcpip.h,v 1.8 1999/08/28 00:49:34 peter Exp $ */ #ifndef _NETINET_TCPIP_H_ #define _NETINET_TCPIP_H_ #include <sys/appleapiopts.h> #include <netinet/ip_var.h> #include <netinet/tcp.h> /* * Tcp+ip header, after ip options removed. */ struct tcpiphdr { struct ipovly ti_i; /* overlaid ip structure */ struct tcphdr ti_t; /* tcp header */ }; #ifdef notyet /* * Tcp+ip header, after ip options removed but including TCP options. */ struct full_tcpiphdr { struct ipovly ti_i; /* overlaid ip structure */ struct tcphdr ti_t; /* tcp header */ char ti_o[TCP_MAXOLEN]; /* space for tcp options */ }; #endif /* notyet */ #define ti_x1 ti_i.ih_x1 #define ti_pr ti_i.ih_pr #define ti_len ti_i.ih_len #define ti_src ti_i.ih_src #define ti_dst ti_i.ih_dst #define ti_sport ti_t.th_sport #define ti_dport ti_t.th_dport #define ti_seq ti_t.th_seq #define ti_ack ti_t.th_ack #define ti_x2 ti_t.th_x2 #define ti_off ti_t.th_off #define ti_flags ti_t.th_flags #define ti_win ti_t.th_win #define ti_sum ti_t.th_sum #define ti_urp ti_t.th_urp #endif
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet/tcp_fsm.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/tcp_fsm.h,v 1.14 1999/11/07 04:18:30 jlemon Exp $ */ #ifndef _NETINET_TCP_FSM_H_ #define _NETINET_TCP_FSM_H_ #include <sys/appleapiopts.h> /* * TCP FSM state definitions. * Per RFC793, September, 1981. */ #define TCP_NSTATES 11 #define TCPS_CLOSED 0 /* closed */ #define TCPS_LISTEN 1 /* listening for connection */ #define TCPS_SYN_SENT 2 /* active, have sent syn */ #define TCPS_SYN_RECEIVED 3 /* have send and received syn */ /* states < TCPS_ESTABLISHED are those where connections not established */ #define TCPS_ESTABLISHED 4 /* established */ #define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */ /* states > TCPS_CLOSE_WAIT are those where user has closed */ #define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */ #define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */ #define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */ /* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */ #define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */ #define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */ /* for KAME src sync over BSD*'s */ #define TCP6_NSTATES TCP_NSTATES #define TCP6S_CLOSED TCPS_CLOSED #define TCP6S_LISTEN TCPS_LISTEN #define TCP6S_SYN_SENT TCPS_SYN_SENT #define TCP6S_SYN_RECEIVED TCPS_SYN_RECEIVED #define TCP6S_ESTABLISHED TCPS_ESTABLISHED #define TCP6S_CLOSE_WAIT TCPS_CLOSE_WAIT #define TCP6S_FIN_WAIT_1 TCPS_FIN_WAIT_1 #define TCP6S_CLOSING TCPS_CLOSING #define TCP6S_LAST_ACK TCPS_LAST_ACK #define TCP6S_FIN_WAIT_2 TCPS_FIN_WAIT_2 #define TCP6S_TIME_WAIT TCPS_TIME_WAIT #define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) #define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED) #define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) #define TCPS_HAVERCVDFIN2(s) ((s) == TCPS_CLOSE_WAIT || \ (s) == TCPS_CLOSING || \ (s) == TCPS_LAST_ACK || \ (s) == TCPS_TIME_WAIT) #if KPROF #endif #ifdef TCPSTATES char *tcpstates[] = { "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING", "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT" }; #endif #endif
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/AppleDSP/OSvKernDSPLib.h
#ifndef __OSvKernDSPLib__ #define __OSvKernDSPLib__ #if PRAGMA_ONCE #pragma once #endif #ifdef __cplusplus extern "C" { #endif /* * OSvKernDSPLib.h * * Created by Paul Chang on Fri Mar 26 2004. * Copyright 2004 Apple Computer. All rights reserved. * */ #include <sys/types.h> #include <stdint.h> typedef __darwin_ptrdiff_t ptrdiff_t; typedef unsigned int vUInt32 __attribute__((__vector_size__(16))); typedef signed int vSInt32 __attribute__((__vector_size__(16))); typedef unsigned char vUInt8 __attribute__((__vector_size__(16))); // Types for 24 bit data typedef struct { uint8_t bytes[3];} vDSP_uint24; typedef struct { uint8_t bytes[3];} vDSP_int24; void vDSP_conv( const float vDSP_signal[], ptrdiff_t vDSP_signalStride, const float vDSP_filter[], ptrdiff_t vDSP_strideFilter, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_lenResult, size_t vDSP_lenFilter, char *temp); void vDSP_deq22( float vDSP_input1[], ptrdiff_t vDSP_stride1, float vDSP_input2[], float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_maxmgv( const float vDSP_input1[], ptrdiff_t vDSP_stride1, float vDSP_result[], size_t vDSP_size); void vDSP_rmsqv( const float vDSP_input1[], ptrdiff_t vDSP_stride1, float vDSP_result[], size_t vDSP_size); void vDSP_svesq( const float vDSP_input1[], ptrdiff_t vDSP_stride1, float vDSP_result[], size_t vDSP_size); void vDSP_svs( const float vDSP_input1[], ptrdiff_t vDSP_stride1, float vDSP_result[], size_t vDSP_size); void vDSP_vabs( const float vDSP_input1[], ptrdiff_t vDSP_stride1, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_vadd( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], ptrdiff_t vDSP_stride2, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_vdiv( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], ptrdiff_t vDSP_stride2, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_vfix32(float const *vDSP_input1, ptrdiff_t vDSP_stride1, int *vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vfix16(float const *vDSP_input1, ptrdiff_t vDSP_stride1, int16_t *vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vflt32(int const *vDSP_input1, ptrdiff_t vDSP_stride1, float *vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vflt16(int16_t const *vDSP_input1, ptrdiff_t vDSP_stride1, float *vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vsmfix24( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], vDSP_int24* vDSP_input3, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vsmfixu24( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], vDSP_uint24* vDSP_input3, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vflt24( const vDSP_int24* vDSP_input1, ptrdiff_t vDSP_stride1, float* vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vfltu24( const vDSP_uint24* vDSP_input1, ptrdiff_t vDSP_stride1, float* vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size); void vDSP_vma( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], ptrdiff_t vDSP_stride2, const float vDSP_input3[], ptrdiff_t vDSP_stride3, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_vmul( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], ptrdiff_t vDSP_stride2, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_vsmul( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); void vDSP_vsub( const float vDSP_input1[], ptrdiff_t vDSP_stride1, const float vDSP_input2[], ptrdiff_t vDSP_stride2, float vDSP_result[], ptrdiff_t vDSP_strideResult, size_t vDSP_size); typedef struct vDSP_biquad_SetupStruct *vDSP_biquad_Setup; typedef int IIRChannel; enum { vDSP_IIRStereo = 0, // = vDSP_IIRMonoLeft && vDSP_IIRMonoRight vDSP_IIRMonoLeft = 1, vDSP_IIRMonoRight = 2 }; vDSP_biquad_Setup vDSP_biquad2_CreateSetup(const double*, const size_t, const IIRChannel); void vDSP_biquad2_DestroySetup(vDSP_biquad_Setup); void vDSP_biquad2(const struct vDSP_biquad_SetupStruct*, const float*, float*, size_t); void vDSP_biquad2_ResetState(vDSP_biquad_Setup); void vDSP_biquad2_CopyState(vDSP_biquad_Setup, vDSP_biquad_Setup); //----------------------------------- // vBasicOps //// Routines from vMul.c. vSInt32 vS64FullMulOdd( vSInt32 vA, vSInt32 vB); vUInt32 vU64FullMulOdd( vUInt32 vA, vUInt32 vB); //// Routines from vSub.c. vUInt32 vU128Sub( vUInt32 vA, vUInt32 vB); vUInt32 vU128SubS( vUInt32 vA, vUInt32 vB); vSInt32 vS128Sub( vSInt32 vA, vSInt32 vB); vSInt32 vS128SubS( vSInt32 vA, vSInt32 vB); //// Routines from vAdd.c. vUInt32 vU128Add( vUInt32 vA, vUInt32 vB); vUInt32 vU128AddS( vUInt32 vA, vUInt32 vB); vSInt32 vS128Add( vSInt32 vA, vSInt32 vB); vSInt32 vS128AddS( vSInt32 vA, vSInt32 vB); //// Routines from vShift.c. vUInt32 vLL128Shift( vUInt32 vA, vUInt8 vShiftFactor); vUInt32 vLR128Shift( vUInt32 vA, vUInt8 vShiftFactor); vUInt32 vA128Shift( vUInt32 vA, vUInt8 vShiftFactor); // vBasicOps //----------------------------------- extern float expf(float); extern float logf(float); extern float log10f(float); extern float sqrtf(float); extern float sinf(float); extern float cosf(float); extern float __sinpif(float); extern float __cospif(float); void vvexpf (float * /* y */, const float * /* x */, const int * /* n */); #ifdef __cplusplus } #endif #endif // __OSvKernDSPLib__
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/ipsec.h
/* $FreeBSD: src/sys/netinet6/ipsec.h,v 1.4.2.2 2001/07/03 11:01:54 ume Exp $ */ /* $KAME: ipsec.h,v 1.44 2001/03/23 08:08:47 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * IPsec controller part. */ #ifndef _NETINET6_IPSEC_H_ #define _NETINET6_IPSEC_H_ #include <sys/cdefs.h> #include <sys/appleapiopts.h> #include <net/pfkeyv2.h> #include <uuid/uuid.h> /* according to IANA assignment, port 0x0000 and proto 0xff are reserved. */ #define IPSEC_PORT_ANY 0 #define IPSEC_ULPROTO_ANY 255 #define IPSEC_PROTO_ANY 255 /* mode of security protocol */ /* NOTE: DON'T use IPSEC_MODE_ANY at SPD. It's only use in SAD */ #define IPSEC_MODE_ANY 0 /* i.e. wildcard. */ #define IPSEC_MODE_TRANSPORT 1 #define IPSEC_MODE_TUNNEL 2 /* * Direction of security policy. * NOTE: Since INVALID is used just as flag. * The other are used for loop counter too. */ #define IPSEC_DIR_ANY 0 #define IPSEC_DIR_INBOUND 1 #define IPSEC_DIR_OUTBOUND 2 #define IPSEC_DIR_MAX 3 #define IPSEC_DIR_INVALID 4 /* Policy level */ /* * IPSEC, ENTRUST and BYPASS are allowed for setsockopt() in PCB, * DISCARD, IPSEC and NONE are allowed for setkey() in SPD. * DISCARD and NONE are allowed for system default. */ #define IPSEC_POLICY_DISCARD 0 /* discarding packet */ #define IPSEC_POLICY_NONE 1 /* through IPsec engine */ #define IPSEC_POLICY_IPSEC 2 /* do IPsec */ #define IPSEC_POLICY_ENTRUST 3 /* consulting SPD if present. */ #define IPSEC_POLICY_BYPASS 4 /* only for privileged socket. */ #define IPSEC_POLICY_GENERATE 5 /* same as discard - IKE daemon can override with generated policy */ /* Security protocol level */ #define IPSEC_LEVEL_DEFAULT 0 /* reference to system default */ #define IPSEC_LEVEL_USE 1 /* use SA if present. */ #define IPSEC_LEVEL_REQUIRE 2 /* require SA. */ #define IPSEC_LEVEL_UNIQUE 3 /* unique SA. */ #define IPSEC_MANUAL_REQID_MAX 0x3fff /* * if security policy level == unique, this id * indicate to a relative SA for use, else is * zero. * 1 - 0x3fff are reserved for manual keying. * 0 are reserved for above reason. Others is * for kernel use. * Note that this id doesn't identify SA * by only itself. */ #define IPSEC_REPLAYWSIZE 32 /* statistics for ipsec processing */ struct ipsecstat { u_quad_t in_success __attribute__ ((aligned(8))); /* succeeded inbound process */ u_quad_t in_polvio __attribute__ ((aligned(8))); /* security policy violation for inbound process */ u_quad_t in_nosa __attribute__ ((aligned(8))); /* inbound SA is unavailable */ u_quad_t in_inval __attribute__ ((aligned(8))); /* inbound processing failed due to EINVAL */ u_quad_t in_nomem __attribute__ ((aligned(8))); /* inbound processing failed due to ENOBUFS */ u_quad_t in_badspi __attribute__ ((aligned(8))); /* failed getting a SPI */ u_quad_t in_ahreplay __attribute__ ((aligned(8))); /* AH replay check failed */ u_quad_t in_espreplay __attribute__ ((aligned(8))); /* ESP replay check failed */ u_quad_t in_ahauthsucc __attribute__ ((aligned(8))); /* AH authentication success */ u_quad_t in_ahauthfail __attribute__ ((aligned(8))); /* AH authentication failure */ u_quad_t in_espauthsucc __attribute__ ((aligned(8))); /* ESP authentication success */ u_quad_t in_espauthfail __attribute__ ((aligned(8))); /* ESP authentication failure */ u_quad_t in_esphist[256] __attribute__ ((aligned(8))); u_quad_t in_ahhist[256] __attribute__ ((aligned(8))); u_quad_t in_comphist[256] __attribute__ ((aligned(8))); u_quad_t out_success __attribute__ ((aligned(8))); /* succeeded outbound process */ u_quad_t out_polvio __attribute__ ((aligned(8))); /* security policy violation for outbound process */ u_quad_t out_nosa __attribute__ ((aligned(8))); /* outbound SA is unavailable */ u_quad_t out_inval __attribute__ ((aligned(8))); /* outbound process failed due to EINVAL */ u_quad_t out_nomem __attribute__ ((aligned(8))); /* inbound processing failed due to ENOBUFS */ u_quad_t out_noroute __attribute__ ((aligned(8))); /* there is no route */ u_quad_t out_esphist[256] __attribute__ ((aligned(8))); u_quad_t out_ahhist[256] __attribute__ ((aligned(8))); u_quad_t out_comphist[256] __attribute__ ((aligned(8))); }; #define IPSEC_MAX_WAKE_PKT_LEN 100 struct ipsec_wake_pkt_info { u_int8_t wake_pkt[IPSEC_MAX_WAKE_PKT_LEN]; uuid_string_t wake_uuid; u_int32_t wake_pkt_spi; u_int32_t wake_pkt_seq; u_int16_t wake_pkt_len; }; struct ipsec_wake_pkt_event_data { uuid_string_t wake_uuid; }; #endif /* _NETINET6_IPSEC_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/in6_var.h
/* * Copyright (c) 2000-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1985, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in_var.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET6_IN6_VAR_H_ #define _NETINET6_IN6_VAR_H_ #include <sys/appleapiopts.h> #include <net/if_var.h> #include <net/net_kev.h> #include <netinet/in.h> #include <netinet6/scope6_var.h> #include <sys/kern_event.h> #include <net/ethernet.h> /* * pltime/vltime are just for future reference (required to implements 2 * hour rule for hosts). they should never be modified by nd6_timeout or * anywhere else. * userland -> kernel: accept pltime/vltime * kernel -> userland: throw up everything * in kernel: modify preferred/expire only */ struct in6_addrlifetime { time_t ia6t_expire; /* valid lifetime expiration time */ time_t ia6t_preferred; /* preferred lifetime expiration time */ u_int32_t ia6t_vltime; /* valid lifetime */ u_int32_t ia6t_pltime; /* prefix lifetime */ }; /* control structure to manage address selection policy */ struct in6_addrpolicy { struct sockaddr_in6 addr; /* prefix address */ struct sockaddr_in6 addrmask; /* prefix mask */ int preced; /* precedence */ int label; /* matching label */ u_quad_t use; /* statistics */ }; /* * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12). */ struct in6_ifstat { u_quad_t ifs6_in_receive; /* # of total input datagram */ u_quad_t ifs6_in_hdrerr; /* # of datagrams with invalid hdr */ u_quad_t ifs6_in_toobig; /* # of datagrams exceeded MTU */ u_quad_t ifs6_in_noroute; /* # of datagrams with no route */ u_quad_t ifs6_in_addrerr; /* # of datagrams with invalid dst */ u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */ /* NOTE: increment on final dst if */ u_quad_t ifs6_in_truncated; /* # of truncated datagrams */ u_quad_t ifs6_in_discard; /* # of discarded datagrams */ /* NOTE: fragment timeout is not here */ u_quad_t ifs6_in_deliver; /* # of datagrams delivered to ULP */ /* NOTE: increment on final dst if */ u_quad_t ifs6_out_forward; /* # of datagrams forwarded */ /* NOTE: increment on outgoing if */ u_quad_t ifs6_out_request; /* # of outgoing datagrams from ULP */ /* NOTE: does not include forwrads */ u_quad_t ifs6_out_discard; /* # of discarded datagrams */ u_quad_t ifs6_out_fragok; /* # of datagrams fragmented */ u_quad_t ifs6_out_fragfail; /* # of datagrams failed on fragment */ u_quad_t ifs6_out_fragcreat; /* # of fragment datagrams */ /* NOTE: this is # after fragment */ u_quad_t ifs6_reass_reqd; /* # of incoming fragmented packets */ /* NOTE: increment on final dst if */ u_quad_t ifs6_reass_ok; /* # of reassembled packets */ /* NOTE: this is # after reass */ /* NOTE: increment on final dst if */ u_quad_t ifs6_atmfrag_rcvd; /* # of atomic fragments received */ u_quad_t ifs6_reass_fail; /* # of reass failures */ /* NOTE: may not be packet count */ /* NOTE: increment on final dst if */ u_quad_t ifs6_in_mcast; /* # of inbound multicast datagrams */ u_quad_t ifs6_out_mcast; /* # of outbound multicast datagrams */ u_quad_t ifs6_cantfoward_icmp6; /* # of ICMPv6 packets received for unreachable dest */ u_quad_t ifs6_addr_expiry_cnt; /* # of address expiry events (excluding privacy addresses) */ u_quad_t ifs6_pfx_expiry_cnt; /* # of prefix expiry events */ u_quad_t ifs6_defrtr_expiry_cnt; /* # of default router expiry events */ }; /* * ICMPv6 interface statistics, as defined in RFC2466 Ipv6IfIcmpEntry. * XXX: I'm not sure if this file is the right place for this structure... */ struct icmp6_ifstat { /* * Input statistics */ /* ipv6IfIcmpInMsgs, total # of input messages */ u_quad_t ifs6_in_msg; /* ipv6IfIcmpInErrors, # of input error messages */ u_quad_t ifs6_in_error; /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */ u_quad_t ifs6_in_dstunreach; /* ipv6IfIcmpInAdminProhibs, # of input admin. prohibited errs */ u_quad_t ifs6_in_adminprohib; /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */ u_quad_t ifs6_in_timeexceed; /* ipv6IfIcmpInParmProblems, # of input parameter problem errors */ u_quad_t ifs6_in_paramprob; /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */ u_quad_t ifs6_in_pkttoobig; /* ipv6IfIcmpInEchos, # of input echo requests */ u_quad_t ifs6_in_echo; /* ipv6IfIcmpInEchoReplies, # of input echo replies */ u_quad_t ifs6_in_echoreply; /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */ u_quad_t ifs6_in_routersolicit; /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */ u_quad_t ifs6_in_routeradvert; /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */ u_quad_t ifs6_in_neighborsolicit; /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advs. */ u_quad_t ifs6_in_neighboradvert; /* ipv6IfIcmpInRedirects, # of input redirects */ u_quad_t ifs6_in_redirect; /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */ u_quad_t ifs6_in_mldquery; /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */ u_quad_t ifs6_in_mldreport; /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */ u_quad_t ifs6_in_mlddone; /* * Output statistics. We should solve unresolved routing problem... */ /* ipv6IfIcmpOutMsgs, total # of output messages */ u_quad_t ifs6_out_msg; /* ipv6IfIcmpOutErrors, # of output error messages */ u_quad_t ifs6_out_error; /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */ u_quad_t ifs6_out_dstunreach; /* ipv6IfIcmpOutAdminProhibs, # of output admin. prohibited errs */ u_quad_t ifs6_out_adminprohib; /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */ u_quad_t ifs6_out_timeexceed; /* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */ u_quad_t ifs6_out_paramprob; /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */ u_quad_t ifs6_out_pkttoobig; /* ipv6IfIcmpOutEchos, # of output echo requests */ u_quad_t ifs6_out_echo; /* ipv6IfIcmpOutEchoReplies, # of output echo replies */ u_quad_t ifs6_out_echoreply; /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */ u_quad_t ifs6_out_routersolicit; /* ipv6IfIcmpOutRouterAdvertisements, # of output router advs. */ u_quad_t ifs6_out_routeradvert; /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */ u_quad_t ifs6_out_neighborsolicit; /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advs. */ u_quad_t ifs6_out_neighboradvert; /* ipv6IfIcmpOutRedirects, # of output redirects */ u_quad_t ifs6_out_redirect; /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */ u_quad_t ifs6_out_mldquery; /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */ u_quad_t ifs6_out_mldreport; /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */ u_quad_t ifs6_out_mlddone; }; struct in6_ifreq { char ifr_name[IFNAMSIZ]; union { struct sockaddr_in6 ifru_addr; struct sockaddr_in6 ifru_dstaddr; int ifru_flags; int ifru_flags6; int ifru_metric; int ifru_intval; caddr_t ifru_data; struct in6_addrlifetime ifru_lifetime; struct in6_ifstat ifru_stat; struct icmp6_ifstat ifru_icmp6stat; u_int32_t ifru_scope_id[SCOPE6_ID_MAX]; } ifr_ifru; }; struct in6_aliasreq { char ifra_name[IFNAMSIZ]; struct sockaddr_in6 ifra_addr; struct sockaddr_in6 ifra_dstaddr; struct sockaddr_in6 ifra_prefixmask; int ifra_flags; struct in6_addrlifetime ifra_lifetime; }; /* prefix type macro */ #define IN6_PREFIX_ND 1 #define IN6_PREFIX_RR 2 /* * prefix related flags passed between kernel(NDP related part) and * user land command(ifconfig) and daemon(rtadvd). */ struct in6_prflags { struct prf_ra { u_char onlink : 1; u_char autonomous : 1; u_char reserved : 6; } prf_ra; u_char prf_reserved1; u_short prf_reserved2; /* want to put this on 4byte offset */ struct prf_rr { u_char decrvalid : 1; u_char decrprefd : 1; u_char reserved : 6; } prf_rr; u_char prf_reserved3; u_short prf_reserved4; }; struct in6_prefixreq { char ipr_name[IFNAMSIZ]; u_char ipr_origin; u_char ipr_plen; u_int32_t ipr_vltime; u_int32_t ipr_pltime; struct in6_prflags ipr_flags; struct sockaddr_in6 ipr_prefix; }; #define PR_ORIG_RA 0 #define PR_ORIG_RR 1 #define PR_ORIG_STATIC 2 #define PR_ORIG_KERNEL 3 #define ipr_raf_onlink ipr_flags.prf_ra.onlink #define ipr_raf_auto ipr_flags.prf_ra.autonomous #define ipr_statef_onlink ipr_flags.prf_state.onlink #define ipr_rrf_decrvalid ipr_flags.prf_rr.decrvalid #define ipr_rrf_decrprefd ipr_flags.prf_rr.decrprefd struct in6_rrenumreq { char irr_name[IFNAMSIZ]; u_char irr_origin; u_char irr_m_len; /* match len for matchprefix */ u_char irr_m_minlen; /* minlen for matching prefix */ u_char irr_m_maxlen; /* maxlen for matching prefix */ u_char irr_u_uselen; /* uselen for adding prefix */ u_char irr_u_keeplen; /* keeplen from matching prefix */ struct irr_raflagmask { u_char onlink : 1; u_char autonomous : 1; u_char reserved : 6; } irr_raflagmask; u_int32_t irr_vltime; u_int32_t irr_pltime; struct in6_prflags irr_flags; struct sockaddr_in6 irr_matchprefix; struct sockaddr_in6 irr_useprefix; }; #define irr_raf_mask_onlink irr_raflagmask.onlink #define irr_raf_mask_auto irr_raflagmask.autonomous #define irr_raf_mask_reserved irr_raflagmask.reserved #define irr_raf_onlink irr_flags.prf_ra.onlink #define irr_raf_auto irr_flags.prf_ra.autonomous #define irr_statef_onlink irr_flags.prf_state.onlink #define irr_rrf irr_flags.prf_rr #define irr_rrf_decrvalid irr_flags.prf_rr.decrvalid #define irr_rrf_decrprefd irr_flags.prf_rr.decrprefd /* * Event data, inet6 style. */ struct kev_in6_addrlifetime { u_int32_t ia6t_expire; u_int32_t ia6t_preferred; u_int32_t ia6t_vltime; u_int32_t ia6t_pltime; }; struct kev_in6_data { struct net_event_data link_data; struct sockaddr_in6 ia_addr; /* interface address */ struct sockaddr_in6 ia_net; /* network number of interface */ struct sockaddr_in6 ia_dstaddr; /* space for destination addr */ struct sockaddr_in6 ia_prefixmask; /* prefix mask */ u_int32_t ia_plen; /* prefix length */ u_int32_t ia6_flags; /* address flags from in6_ifaddr */ struct kev_in6_addrlifetime ia_lifetime; /* address life info */ uint8_t ia_mac[ETHER_ADDR_LEN]; }; #define SIOCSIFADDR_IN6 _IOW('i', 12, struct in6_ifreq) #define SIOCGIFADDR_IN6 _IOWR('i', 33, struct in6_ifreq) /* * SIOCSxxx ioctls should be unused (see comments in in6.c), but * we do not shift numbers for binary compatibility. */ #define SIOCSIFDSTADDR_IN6 _IOW('i', 14, struct in6_ifreq) #define SIOCSIFNETMASK_IN6 _IOW('i', 22, struct in6_ifreq) #define SIOCGIFDSTADDR_IN6 _IOWR('i', 34, struct in6_ifreq) #define SIOCGIFNETMASK_IN6 _IOWR('i', 37, struct in6_ifreq) #define SIOCDIFADDR_IN6 _IOW('i', 25, struct in6_ifreq) #define SIOCAIFADDR_IN6 _IOW('i', 26, struct in6_aliasreq) #define SIOCSIFPHYADDR_IN6 _IOW('i', 62, struct in6_aliasreq) #define SIOCGIFPSRCADDR_IN6 _IOWR('i', 63, struct in6_ifreq) #define SIOCGIFPDSTADDR_IN6 _IOWR('i', 64, struct in6_ifreq) #define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) #define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist) #define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_prlist) #define OSIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ondireq) #define SIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq) #define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq) #define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo) #define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq) #define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) #define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) #define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) #define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) #define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) #define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq) #define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq) #define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ /* N.B.: These 3 ioctls are deprecated and won't work */ #define SIOCSSCOPE6 _IOW('i', 88, struct in6_ifreq) #define SIOCGSCOPE6 _IOWR('i', 89, struct in6_ifreq) #define SIOCGSCOPE6DEF _IOWR('i', 90, struct in6_ifreq) #define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ #define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */ #define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */ #define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */ /* change */ #define SIOCCIFPREFIX_IN6 _IOW('i', 104, struct in6_rrenumreq) /* set global */ #define SIOCSGIFPREFIX_IN6 _IOW('i', 105, struct in6_rrenumreq) /* * multicast routing, get s/g pkt cnt, pkt cnt per interface. */ #define SIOCGETSGCNT_IN6 _IOWR('u', 28, struct sioc_sg_req6) #define SIOCGETMIFCNT_IN6 _IOWR('u', 107, struct sioc_mif_req6) #define SIOCAADDRCTL_POLICY _IOW('u', 108, struct in6_addrpolicy) #define SIOCDADDRCTL_POLICY _IOW('u', 109, struct in6_addrpolicy) #define IN6_IFF_ANYCAST 0x0001 /* anycast address */ #define IN6_IFF_TENTATIVE 0x0002 /* tentative address */ #define IN6_IFF_DUPLICATED 0x0004 /* DAD detected duplicate */ #define IN6_IFF_DETACHED 0x0008 /* XXX Obsolete. May be detached from the link */ #define IN6_IFF_DEPRECATED 0x0010 /* deprecated address */ /* don't perform DAD on this address (used only at first SIOC* call) */ #define IN6_IFF_NODAD 0x0020 #define IN6_IFF_AUTOCONF 0x0040 /* autoconfigurable address. */ #define IN6_IFF_TEMPORARY 0x0080 /* temporary (anonymous) address. */ #define IN6_IFF_DYNAMIC 0x0100 /* assigned by DHCPv6 service */ #define IN6_IFF_OPTIMISTIC 0x0200 /* optimistic DAD, i.e. RFC 4429 */ #define IN6_IFF_SECURED 0x0400 /* cryptographically generated */ #define IN6_IFF_CLAT46 0x1000 /* Address reserved for CLAT46 */ #define IN6_IFF_NOPFX 0x8000 /* Depreciated. Don't use. */ /* Duplicate Address Detection [DAD] in progress. */ #define IN6_IFF_DADPROGRESS (IN6_IFF_TENTATIVE|IN6_IFF_OPTIMISTIC) /* do not input/output */ #define IN6_IFF_NOTREADY (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED) /* SLAAC/DHCPv6 address */ #define IN6_IFF_NOTMANUAL (IN6_IFF_AUTOCONF|IN6_IFF_DYNAMIC) #define IN6_ARE_SCOPE_CMP(a, b) ((a) - (b)) #define IN6_ARE_SCOPE_EQUAL(a, b) ((a) == (b)) #endif /* _NETINET6_IN6_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/ipcomp.h
/* $FreeBSD: src/sys/netinet6/ipcomp.h,v 1.1.2.2 2001/07/03 11:01:54 ume Exp $ */ /* $KAME: ipcomp.h,v 1.8 2000/09/26 07:55:14 itojun Exp $ */ /* * Copyright (C) 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * RFC2393 IP payload compression protocol (IPComp). */ #ifndef _NETINET6_IPCOMP_H_ #define _NETINET6_IPCOMP_H_ #include <sys/appleapiopts.h> #include <netinet6/ipsec.h> struct ipcomp { u_int8_t comp_nxt; /* Next Header */ u_int8_t comp_flags; /* reserved, must be zero */ u_int16_t comp_cpi; /* Compression parameter index */ }; /* well-known algorithm number (in CPI), from RFC2409 */ #define IPCOMP_OUI 1 /* vendor specific */ #define IPCOMP_DEFLATE 2 /* RFC2394 */ #define IPCOMP_LZS 3 /* RFC2395 */ #define IPCOMP_MAX 4 #define IPCOMP_CPI_NEGOTIATE_MIN 256 #endif /* _NETINET6_IPCOMP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/ah.h
/* $FreeBSD: src/sys/netinet6/ah.h,v 1.3.2.2 2001/07/03 11:01:49 ume Exp $ */ /* $KAME: ah.h,v 1.13 2000/10/18 21:28:00 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * RFC1826/2402 authentication header. */ #ifndef _NETINET6_AH_H_ #define _NETINET6_AH_H_ #include <sys/appleapiopts.h> #include <sys/types.h> struct ah { u_int8_t ah_nxt; /* Next Header */ u_int8_t ah_len; /* Length of data, in 32bit */ u_int16_t ah_reserve; /* Reserved for future use */ u_int32_t ah_spi; /* Security parameter index */ /* variable size, 32bit bound*/ /* Authentication data */ }; struct newah { u_int8_t ah_nxt; /* Next Header */ u_int8_t ah_len; /* Length of data + 1, in 32bit */ u_int16_t ah_reserve; /* Reserved for future use */ u_int32_t ah_spi; /* Security parameter index */ u_int32_t ah_seq; /* Sequence number field */ /* variable size, 32bit bound*/ /* Authentication data */ }; #endif /* _NETINET6_AH_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/in6.h
/* * Copyright (c) 2008-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in.h 8.3 (Berkeley) 1/3/94 */ #ifndef __KAME_NETINET_IN_H_INCLUDED_ #error "do not include netinet6/in6.h directly, include netinet/in.h. " \ " see RFC2553" #endif #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ #include <sys/appleapiopts.h> #include <sys/_types.h> #include <sys/_types/_sa_family_t.h> /* * Identification of the network protocol stack * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE * has the table of implementation/integration differences. */ #define __KAME__ #define __KAME_VERSION "2009/apple-darwin" #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* * Local port number conventions: * * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), * unless a kernel is compiled with IPNOPRIVPORTS defined. * * When a user does a bind(2) or connect(2) with a port number of zero, * a non-conflicting local port address is chosen. * * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although * that is settable by sysctl(3); net.inet.ip.anonportmin and * net.inet.ip.anonportmax respectively. * * A user may set the IPPROTO_IP option IP_PORTRANGE to change this * default assignment range. * * The value IP_PORTRANGE_DEFAULT causes the default behavior. * * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, * and exists only for FreeBSD compatibility purposes. * * The value IP_PORTRANGE_LOW changes the range to the "low" are * that is (by convention) restricted to privileged processes. * This convention is based on "vouchsafe" principles only. * It is only secure if you trust the remote host to restrict these ports. * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. */ #define IPV6PORT_RESERVED 1024 #define IPV6PORT_ANONMIN 49152 #define IPV6PORT_ANONMAX 65535 #define IPV6PORT_RESERVEDMIN 600 #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * IPv6 address */ typedef struct in6_addr { union { __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; __uint32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ } in6_addr_t; #define s6_addr __u6_addr.__u6_addr8 #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32 #define INET6_ADDRSTRLEN 46 /* * Socket address for IPv6 */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define SIN6_LEN #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ struct sockaddr_in6 { __uint8_t sin6_len; /* length of this struct(sa_family_t) */ sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ in_port_t sin6_port; /* Transport layer port # (in_port_t) */ __uint32_t sin6_flowinfo; /* IP6 flow information */ struct in6_addr sin6_addr; /* IP6 address */ __uint32_t sin6_scope_id; /* scope zone index */ }; /* * Local definition for masks */ #define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} #define IN6MASK7 {{{ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK8 {{{ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK16 {{{ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} /* * Macros started with IPV6_ADDR is KAME local */ #if BYTE_ORDER == BIG_ENDIAN #define IPV6_ADDR_INT32_ONE 1 #define IPV6_ADDR_INT32_TWO 2 #define IPV6_ADDR_INT32_MNL 0xff010000 #define IPV6_ADDR_INT32_MLL 0xff020000 #define IPV6_ADDR_INT32_SMP 0x0000ffff #define IPV6_ADDR_INT16_ULL 0xfe80 #define IPV6_ADDR_INT16_USL 0xfec0 #define IPV6_ADDR_INT16_MLL 0xff02 #elif BYTE_ORDER == LITTLE_ENDIAN #define IPV6_ADDR_INT32_ONE 0x01000000 #define IPV6_ADDR_INT32_TWO 0x02000000 #define IPV6_ADDR_INT32_MNL 0x000001ff #define IPV6_ADDR_INT32_MLL 0x000002ff #define IPV6_ADDR_INT32_SMP 0xffff0000 #define IPV6_ADDR_INT16_ULL 0x80fe #define IPV6_ADDR_INT16_USL 0xc0fe #define IPV6_ADDR_INT16_MLL 0x02ff #endif /* * Definition of some useful macros to handle IP6 addresses */ #define IN6ADDR_ANY_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_LOOPBACK_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} #define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}} #define IN6ADDR_V4MAPPED_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_MULTICAST_PREFIX IN6MASK8 #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) extern const struct in6_addr in6addr_nodelocal_allnodes; extern const struct in6_addr in6addr_linklocal_allnodes; extern const struct in6_addr in6addr_linklocal_allrouters; extern const struct in6_addr in6addr_linklocal_allv2routers; #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * Equality * NOTE: Some of kernel programming environment (for example, openbsd/sparc) * does not supply memcmp(). For userland memcmp() is preferred as it is * in ANSI standard. */ #define IN6_ARE_ADDR_EQUAL(a, b) \ (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], \ sizeof (struct in6_addr)) == 0) /* see if two addresses are equal in a scope-conscious manner. */ #define SA6_ARE_ADDR_EQUAL(a, b) \ (((a)->sin6_scope_id == 0 || (b)->sin6_scope_id == 0 || \ ((a)->sin6_scope_id == (b)->sin6_scope_id)) && \ (bcmp(&(a)->sin6_addr, &(b)->sin6_addr, sizeof (struct in6_addr)) == 0)) /* * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == \ ntohl(0x0000ffff))) /* * 6to4 */ #define IN6_IS_ADDR_6TO4(x) (ntohs((x)->s6_addr16[0]) == 0x2002) /* * KAME Scope Values */ #define IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 #define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define IPV6_ADDR_SCOPE_GLOBAL 0x0e /* * Unicast Scope * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). */ #define IN6_IS_ADDR_LINKLOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) /* * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) #define IPV6_ADDR_MC_FLAGS(a) ((a)->s6_addr[1] & 0xf0) #define IPV6_ADDR_MC_FLAGS_TRANSIENT 0x10 #define IPV6_ADDR_MC_FLAGS_PREFIX 0x20 #define IPV6_ADDR_MC_FLAGS_UNICAST_BASED (IPV6_ADDR_MC_FLAGS_TRANSIENT | IPV6_ADDR_MC_FLAGS_PREFIX) #define IN6_IS_ADDR_UNICAST_BASED_MULTICAST(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_FLAGS(a) == IPV6_ADDR_MC_FLAGS_UNICAST_BASED)) /* * Unique Local IPv6 Unicast Addresses (per RFC 4193) */ #define IN6_IS_ADDR_UNIQUE_LOCAL(a) \ (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd)) #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) /* * Multicast Scope */ #define IN6_IS_ADDR_MC_UNICAST_BASED_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_FLAGS(a) == IPV6_ADDR_MC_FLAGS_UNICAST_BASED) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_INTFACELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_FLAGS(a) != IPV6_ADDR_MC_FLAGS_UNICAST_BASED) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL)) /* * KAME Scope */ #define IN6_IS_SCOPE_LINKLOCAL(a) \ ((IN6_IS_ADDR_LINKLOCAL(a)) || \ (IN6_IS_ADDR_MC_LINKLOCAL(a))) #define IN6_IS_SCOPE_EMBED(a) \ ((IN6_IS_ADDR_LINKLOCAL(a)) || \ (IN6_IS_ADDR_MC_LINKLOCAL(a)) || \ (IN6_IS_ADDR_MC_INTFACELOCAL(a))) #define IFA6_IS_DEPRECATED(a, t) \ ((a)->ia6_lifetime.ia6ti_preferred != 0 && \ (a)->ia6_lifetime.ia6ti_preferred < (t)) #define IFA6_IS_INVALID(a, t) \ ((a)->ia6_lifetime.ia6ti_expire != 0 && \ (a)->ia6_lifetime.ia6ti_expire < (t)) /* * Options for use with [gs]etsockopt at the IPV6 level. * First word of comment is data type; bool is stored in int. */ /* no hdrincl */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* * RFC 3542 define the following socket options in a manner incompatible * with RFC 2292: * IPV6_PKTINFO * IPV6_HOPLIMIT * IPV6_NEXTHOP * IPV6_HOPOPTS * IPV6_DSTOPTS * IPV6_RTHDR * * To use the new IPv6 Sockets options introduced by RFC 3542 * the constant __APPLE_USE_RFC_3542 must be defined before * including <netinet/in.h> * * To use the old IPv6 Sockets options from RFC 2292 * the constant __APPLE_USE_RFC_2292 must be defined before * including <netinet/in.h> * * Note that eventually RFC 3542 is going to be the * default and RFC 2292 will be obsolete. */ #if defined(__APPLE_USE_RFC_3542) && defined(__APPLE_USE_RFC_2292) #error "__APPLE_USE_RFC_3542 and __APPLE_USE_RFC_2292 cannot be both defined" #endif #if 0 /* the followings are relic in IPv4 and hence are disabled */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ #endif /* 0 */ #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 mcast loopback */ #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* ip6_rthdr: routing header */ /* buf/cmsghdr; set/get IPv6 options [obsoleted by RFC3542] */ #define IPV6_2292PKTOPTIONS 25 #ifdef __APPLE_USE_RFC_2292 #define IPV6_PKTINFO IPV6_2292PKTINFO #define IPV6_HOPLIMIT IPV6_2292HOPLIMIT #define IPV6_NEXTHOP IPV6_2292NEXTHOP #define IPV6_HOPOPTS IPV6_2292HOPOPTS #define IPV6_DSTOPTS IPV6_2292DSTOPTS #define IPV6_RTHDR IPV6_2292RTHDR #define IPV6_PKTOPTIONS IPV6_2292PKTOPTIONS #endif /* __APPLE_USE_RFC_2292 */ #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #if 1 /* IPSEC */ #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ #endif /* 1 */ #define IPV6_FAITH 29 /* deprecated */ #if 1 /* IPV6FIREWALL */ #define IPV6_FW_ADD 30 /* add a firewall rule to chain */ #define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ #define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ #define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ #define IPV6_FW_GET 34 /* get entire firewall rule chain */ #endif /* 1 */ /* * APPLE: NOTE the value of those 2 options is kept unchanged from * previous version of darwin/OS X for binary compatibility reasons * and differ from FreeBSD (values 57 and 61). See below. */ #define IPV6_RECVTCLASS 35 /* bool; recv traffic class values */ #define IPV6_TCLASS 36 /* int; send traffic class value */ #ifdef __APPLE_USE_RFC_3542 /* new socket options introduced in RFC3542 */ /* * ip6_dest; send dst option before rthdr * APPLE: Value purposely different than FreeBSD (35) to avoid * collision with definition of IPV6_RECVTCLASS in previous * darwin implementations */ #define IPV6_RTHDRDSTOPTS 57 /* * bool; recv if, dst addr * APPLE: Value purposely different than FreeBSD(36) to avoid * collision with definition of IPV6_TCLASS in previous * darwin implementations */ #define IPV6_RECVPKTINFO 61 #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ /* * mtuinfo; get the current path MTU (sopt), 4 bytes int; * MTU notification (cmsg) */ #define IPV6_PATHMTU 44 #if 0 /* obsoleted during 2292bis -> 3542 */ /* no data; ND reachability confirm (cmsg only/not in of RFC3542) */ #define IPV6_REACHCONF 45 #endif /* more new socket options introduced in RFC3542 */ #define IPV6_3542PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_3542HOPLIMIT 47 /* int; send hop limit */ #define IPV6_3542NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_3542HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_3542DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_3542RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_PKTINFO IPV6_3542PKTINFO #define IPV6_HOPLIMIT IPV6_3542HOPLIMIT #define IPV6_NEXTHOP IPV6_3542NEXTHOP #define IPV6_HOPOPTS IPV6_3542HOPOPTS #define IPV6_DSTOPTS IPV6_3542DSTOPTS #define IPV6_RTHDR IPV6_3542RTHDR #define IPV6_AUTOFLOWLABEL 59 /* bool; attach flowlabel automagically */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ /* int; prefer temporary addresses as the source address. */ #define IPV6_PREFER_TEMPADDR 63 /* * The following option is private; do not use it from user applications. * It is deliberately defined to the same value as IP_MSFILTER. */ #define IPV6_MSFILTER 74 /* struct __msfilterreq; */ #endif /* __APPLE_USE_RFC_3542 */ #define IPV6_BOUND_IF 125 /* int; set/get bound interface */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. */ #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ /* * Defaults and limits for options */ #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* * The im6o_membership vector for each socket is now dynamically allocated at * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized * according to a power-of-two increment. */ #define IPV6_MIN_MEMBERSHIPS 31 #define IPV6_MAX_MEMBERSHIPS 4095 /* * Default resource limits for IPv6 multicast source filtering. * These may be modified by sysctl. */ #define IPV6_MAX_GROUP_SRC_FILTER 512 /* sources per group */ #define IPV6_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ /* * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; /* * IPV6_2292PKTINFO: Packet information(RFC2292 sec 5) */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; /* * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* * Argument for IPV6_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */ #define IPV6_PORTRANGE_DEFAULT 0 /* default range */ #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ /* * Definitions for inet6 sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */ #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ /* * Names for IP sysctl objects */ #define IPV6CTL_FORWARDING 1 /* act as router */ #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ #ifdef notyet #define IPV6CTL_DEFMTU 4 /* default MTU */ #endif #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ #define IPV6CTL_STATS 6 /* stats */ #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ #define IPV6CTL_ACCEPT_RTADV 12 #define IPV6CTL_KEEPFAITH 13 /* deprecated */ #define IPV6CTL_LOG_INTERVAL 14 #define IPV6CTL_HDRNESTLIMIT 15 #define IPV6CTL_DAD_COUNT 16 #define IPV6CTL_AUTO_FLOWLABEL 17 #define IPV6CTL_DEFMCASTHLIM 18 #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ #define IPV6CTL_KAME_VERSION 20 #define IPV6CTL_USE_DEPRECATED 21 /* use deprec addr (RFC2462 5.5.4) */ #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ #if 0 /* obsolete */ #define IPV6CTL_MAPPED_ADDR 23 #endif #define IPV6CTL_V6ONLY 24 #define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ #define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ #define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ #define IPV6CTL_USETEMPADDR 32 /* use temporary addresses [RFC 4941] */ #define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ #define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ #define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ #define IPV6CTL_PREFER_TEMPADDR 37 /* prefer temporary addr as src */ #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ #define IPV6CTL_MAXFRAGS 41 /* max fragments */ #define IPV6CTL_MCAST_PMTU 44 /* enable pMTU discovery for mcast? */ #define IPV6CTL_NEIGHBORGCTHRESH 46 #define IPV6CTL_MAXIFPREFIXES 47 #define IPV6CTL_MAXIFDEFROUTERS 48 #define IPV6CTL_MAXDYNROUTES 49 #define ICMPV6CTL_ND6_ONLINKNSRFC4861 50 #define IPV6CTL_ULA_USETEMPADDR 51 /* New entries should be added here from current IPV6CTL_MAXID value. */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6CTL_MAXID 51 #endif /* PLATFORM_DriverKit */ #endif /* !_NETINET6_IN6_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/scope6_var.h
/* * Copyright (c) 2009-2015 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (C) 2000 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _NETINET6_SCOPE6_VAR_H_ #define _NETINET6_SCOPE6_VAR_H_ #include <sys/appleapiopts.h> /* * 16 is correspondent to 4bit multicast scope field. * i.e. from node-local to global with some reserved/unassigned types. */ #define SCOPE6_ID_MAX 16 #endif /* _NETINET6_SCOPE6_VAR_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/nd6.h
/* * Copyright (c) 2000-2020 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _NETINET6_ND6_H_ #define _NETINET6_ND6_H_ #include <sys/appleapiopts.h> #include <net/net_kev.h> /* see net/route.h, or net/if_inarp.h */ #ifndef RTF_ANNOUNCE #define RTF_ANNOUNCE RTF_PROTO2 #endif #include <sys/queue.h> #define ND6_LLINFO_PURGE -3 #define ND6_LLINFO_NOSTATE -2 /* * We don't need the WAITDELETE state any more, but we keep the definition * in a comment line instead of removing it. This is necessary to avoid * unintentionally reusing the value for another purpose, which might * affect backward compatibility with old applications. * (20000711 [email protected]) */ /* #define ND6_LLINFO_WAITDELETE -1 */ #define ND6_LLINFO_INCOMPLETE 0 #define ND6_LLINFO_REACHABLE 1 #define ND6_LLINFO_STALE 2 #define ND6_LLINFO_DELAY 3 #define ND6_LLINFO_PROBE 4 struct nd_ifinfo { u_int32_t linkmtu; /* LinkMTU */ u_int32_t maxmtu; /* Upper bound of LinkMTU */ u_int32_t basereachable; /* BaseReachableTime */ u_int32_t reachable; /* Reachable Time */ u_int32_t retrans; /* Retrans Timer */ u_int32_t flags; /* Flags */ int recalctm; /* BaseReacable re-calculation timer */ u_int8_t chlim; /* CurHopLimit */ u_int8_t receivedra; /* the following 3 members are for privacy extension for addrconf */ u_int8_t randomseed0[8]; /* upper 64 bits of SHA1 digest */ u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */ u_int8_t randomid[8]; /* current random ID */ }; #define ND6_IFF_PERFORMNUD 0x1 #define ND6_IFF_PROXY_PREFIXES 0x20 #define ND6_IFF_IGNORE_NA 0x40 #define ND6_IFF_REPLICATED 0x100 /* sleep proxy registered */ #define ND6_IFF_DAD 0x200 /* Perform DAD on the interface */ extern int dad_enhanced; #define ND6_DAD_ENHANCED_DEFAULT 1 struct in6_nbrinfo { char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ struct in6_addr addr; /* IPv6 address of the neighbor */ long asked; /* # of queries already sent for this addr */ int isrouter; /* if it acts as a router */ int state; /* reachability state */ int expire; /* lifetime for NDP state transition */ }; #define DRLSTSIZ 10 #define PRLSTSIZ 10 struct in6_drlist { char ifname[IFNAMSIZ]; struct { struct in6_addr rtaddr; u_char flags; u_short rtlifetime; u_long expire; u_short if_index; } defrouter[DRLSTSIZ]; }; /* valid values for stateflags */ #define NDDRF_INSTALLED 0x01 /* installed in the routing table */ #define NDDRF_IFSCOPE 0x02 /* installed as a scoped route */ #define NDDRF_STATIC 0x04 /* for internal use only */ #define NDDRF_MAPPED 0x08 /* Default router addr is mapped to a different one for routing */ #define NDDRF_INELIGIBLE 0x10 /* Default router entry is ineligible for default router selection */ struct in6_defrouter { struct sockaddr_in6 rtaddr; u_char flags; u_char stateflags; u_short rtlifetime; u_long expire; u_short if_index; }; struct in6_prlist { char ifname[IFNAMSIZ]; struct { struct in6_addr prefix; struct prf_ra raflags; u_char prefixlen; u_char origin; u_long vltime; u_long pltime; u_long expire; u_short if_index; u_short advrtrs; /* number of advertisement routers */ struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ } prefix[PRLSTSIZ]; }; struct in6_prefix { struct sockaddr_in6 prefix; struct prf_ra raflags; u_char prefixlen; u_char origin; u_long vltime; u_long pltime; u_long expire; u_int32_t flags; int refcnt; u_short if_index; u_short advrtrs; /* number of advertisement routers */ /* struct sockaddr_in6 advrtr[] */ }; struct in6_ondireq { char ifname[IFNAMSIZ]; struct { u_int32_t linkmtu; /* LinkMTU */ u_int32_t maxmtu; /* Upper bound of LinkMTU */ u_int32_t basereachable; /* BaseReachableTime */ u_int32_t reachable; /* Reachable Time */ u_int32_t retrans; /* Retrans Timer */ u_int32_t flags; /* Flags */ int recalctm; /* BaseReacable re-calculation timer */ u_int8_t chlim; /* CurHopLimit */ /* Number of routers learned on the interface */ u_int8_t receivedra; /* * The current collision count value * being used for secure address generation. */ u_int8_t collision_count; } ndi; }; struct in6_ndireq { char ifname[IFNAMSIZ]; struct nd_ifinfo ndi; }; struct in6_ndifreq { char ifname[IFNAMSIZ]; u_long ifindex; }; #define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */ #define RTR_SOLICITATION_INTERVAL 4 /* 4sec */ /* Prefix status */ #define NDPRF_ONLINK 0x1 #define NDPRF_DETACHED 0x2 #define NDPRF_STATIC 0x100 #define NDPRF_IFSCOPE 0x1000 #define NDPRF_PRPROXY 0x2000 /* protocol constants */ #define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */ #define RTR_SOLICITATION_INTERVAL 4 /* 4sec */ #define MAX_RTR_SOLICITATIONS 3 #define ND6_INFINITE_LIFETIME 0xffffffff #define ND6_MAX_LIFETIME 0x7fffffff /* * @function nd6_lookup_ipv6 * @discussion This function will check the routing table for a cached * neighbor discovery entry or trigger an neighbor discovery query * to resolve the IPv6 address to a link-layer address. * nd entries are stored in the routing table. This function will * lookup the IPv6 destination in the routing table. If the * destination requires forwarding to a gateway, the route of the * gateway will be looked up. The route entry is inspected to * determine if the link layer destination address is known. If * unknown, neighbor discovery will be used to resolve the entry. * @param interface The interface the packet is being sent on. * @param ip6_dest The IPv6 destination of the packet. * @param ll_dest On output, the link-layer destination. * @param ll_dest_len The length of the buffer for ll_dest. * @param hint Any routing hint passed down from the protocol. * @param packet The packet being transmitted. * @result May return an error such as EHOSTDOWN or ENETUNREACH. If * this function returns EJUSTRETURN, the packet has been queued * and will be sent when the address is resolved. If any other * value is returned, the caller is responsible for disposing of * the packet. */ extern errno_t nd6_lookup_ipv6(ifnet_t interface, const struct sockaddr_in6 *ip6_dest, struct sockaddr_dl *ll_dest, size_t ll_dest_len, route_t hint, mbuf_t packet); /* nd6_send.c */ #endif /* _NETINET6_ND6_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/raw_ip6.h
/* * Copyright (c) 2008-2013 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* $FreeBSD: src/sys/netinet6/raw_ip6.h,v 1.1.2.1 2001/07/03 11:01:55 ume Exp $ */ /* $KAME: raw_ip6.h,v 1.2 2001/05/27 13:28:35 itojun Exp $ */ /* * Copyright (C) 2001 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _NETINET6_RAW_IP6_H_ #define _NETINET6_RAW_IP6_H_ #include <sys/appleapiopts.h> #include <sys/types.h> /* * ICMPv6 stat is counted separately. see netinet/icmp6.h */ struct rip6stat { u_quad_t rip6s_ipackets; /* total input packets */ u_quad_t rip6s_isum; /* input checksum computations */ u_quad_t rip6s_badsum; /* of above, checksum error */ u_quad_t rip6s_nosock; /* no matching socket */ u_quad_t rip6s_nosockmcast; /* of above, arrived as multicast */ u_quad_t rip6s_fullsock; /* not delivered, input socket full */ u_quad_t rip6s_opackets; /* total output packets */ }; #endif /* _NETINET6_RAW_IP6_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/netinet6/esp.h
/* * Copyright (c) 2008-2013 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* $FreeBSD: src/sys/netinet6/esp.h,v 1.2.2.2 2001/07/03 11:01:49 ume Exp $ */ /* $KAME: esp.h,v 1.16 2000/10/18 21:28:00 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * RFC1827/2406 Encapsulated Security Payload. */ #ifndef _NETINET6_ESP_H_ #define _NETINET6_ESP_H_ #include <sys/appleapiopts.h> #include <sys/types.h> struct esp { u_int32_t esp_spi; /* ESP */ /*variable size, 32bit bound*/ /* Initialization Vector */ /*variable size*/ /* Payload data */ /*variable size*/ /* padding */ /*8bit*/ /* pad size */ /*8bit*/ /* next header */ /*8bit*/ /* next header */ /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */ }; struct newesp { u_int32_t esp_spi; /* ESP */ u_int32_t esp_seq; /* Sequence number */ /*variable size*/ /* (IV and) Payload data */ /*variable size*/ /* padding */ /*8bit*/ /* pad size */ /*8bit*/ /* next header */ /*8bit*/ /* next header */ /*variable size, 32bit bound*/ /* Authentication data */ }; struct esptail { u_int8_t esp_padlen; /* pad length */ u_int8_t esp_nxt; /* Next header */ /*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/ }; #endif /* _NETINET6_ESP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/BluetoothDriverKit/BluetoothDriverKit.h
// // BluetoothDriverKit.h // BluetoothDriverKit // // Created by Ravi Parupudi on 12/8/20. // #ifndef BluetoothDriverKit_h #define BluetoothDriverKit_h //! Project version number for BluetoothDriverKit. //FOUNDATION_EXPORT double BluetoothDriverKitVersionNumber; //! Project version string for BluetoothDriverKit. //FOUNDATION_EXPORT const unsigned char BluetoothDriverKitVersionString[]; #include <BluetoothDriverKit/IOBluetoothHIDChannel.h> #endif
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/byte_order.h
/* * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights * Reserved. This file contains Original Code and/or Modifications of * Original Code as defined in and that are subject to the Apple Public * Source License Version 1.0 (the 'License'). You may not use this file * except in compliance with the License. Please obtain a copy of the * License at http://www.apple.com/publicsource and read it before using * this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the * License for the specific language governing rights and limitations * under the License." * * @APPLE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1992 NeXT Computer, Inc. * * Byte ordering conversion. * */ #ifndef _ARCHITECTURE_BYTE_ORDER_H_ #define _ARCHITECTURE_BYTE_ORDER_H_ #include <libkern/OSByteOrder.h> typedef unsigned long NXSwappedFloat; typedef unsigned long long NXSwappedDouble; static __inline__ unsigned short NXSwapShort( unsigned short inv ) { return (unsigned short)OSSwapInt16((uint16_t)inv); } static __inline__ unsigned int NXSwapInt( unsigned int inv ) { return (unsigned int)OSSwapInt32((uint32_t)inv); } static __inline__ unsigned long NXSwapLong( unsigned long inv ) { return (unsigned long)OSSwapInt32((uint32_t)inv); } static __inline__ unsigned long long NXSwapLongLong( unsigned long long inv ) { return (unsigned long long)OSSwapInt64((uint64_t)inv); } static __inline__ NXSwappedFloat NXConvertHostFloatToSwapped(float x) { union fconv { float number; NXSwappedFloat sf; } u; u.number = x; return u.sf; } static __inline__ float NXConvertSwappedFloatToHost(NXSwappedFloat x) { union fconv { float number; NXSwappedFloat sf; } u; u.sf = x; return u.number; } static __inline__ NXSwappedDouble NXConvertHostDoubleToSwapped(double x) { union dconv { double number; NXSwappedDouble sd; } u; u.number = x; return u.sd; } static __inline__ double NXConvertSwappedDoubleToHost(NXSwappedDouble x) { union dconv { double number; NXSwappedDouble sd; } u; u.sd = x; return u.number; } static __inline__ NXSwappedFloat NXSwapFloat(NXSwappedFloat x) { return (NXSwappedFloat)OSSwapInt32((uint32_t)x); } static __inline__ NXSwappedDouble NXSwapDouble(NXSwappedDouble x) { return (NXSwappedDouble)OSSwapInt64((uint64_t)x); } /* * Identify the byte order * of the current host. */ enum NXByteOrder { NX_UnknownByteOrder, NX_LittleEndian, NX_BigEndian }; static __inline__ enum NXByteOrder NXHostByteOrder(void) { #if defined(__LITTLE_ENDIAN__) return NX_LittleEndian; #elif defined(__BIG_ENDIAN__) return NX_BigEndian; #else return NX_UnknownByteOrder; #endif } static __inline__ unsigned short NXSwapBigShortToHost( unsigned short x ) { return (unsigned short)OSSwapBigToHostInt16((uint16_t)x); } static __inline__ unsigned int NXSwapBigIntToHost( unsigned int x ) { return (unsigned int)OSSwapBigToHostInt32((uint32_t)x); } static __inline__ unsigned long NXSwapBigLongToHost( unsigned long x ) { return (unsigned long)OSSwapBigToHostInt32((uint32_t)x); } static __inline__ unsigned long long NXSwapBigLongLongToHost( unsigned long long x ) { return (unsigned long long)OSSwapBigToHostInt64((uint64_t)x); } static __inline__ double NXSwapBigDoubleToHost( NXSwappedDouble x ) { return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapBigToHostInt64((uint64_t)x)); } static __inline__ float NXSwapBigFloatToHost( NXSwappedFloat x ) { return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapBigToHostInt32((uint32_t)x)); } static __inline__ unsigned short NXSwapHostShortToBig( unsigned short x ) { return (unsigned short)OSSwapHostToBigInt16((uint16_t)x); } static __inline__ unsigned int NXSwapHostIntToBig( unsigned int x ) { return (unsigned int)OSSwapHostToBigInt32((uint32_t)x); } static __inline__ unsigned long NXSwapHostLongToBig( unsigned long x ) { return (unsigned long)OSSwapHostToBigInt32((uint32_t)x); } static __inline__ unsigned long long NXSwapHostLongLongToBig( unsigned long long x ) { return (unsigned long long)OSSwapHostToBigInt64((uint64_t)x); } static __inline__ NXSwappedDouble NXSwapHostDoubleToBig( double x ) { return (NXSwappedDouble)OSSwapHostToBigInt64((uint64_t)NXConvertHostDoubleToSwapped(x)); } static __inline__ NXSwappedFloat NXSwapHostFloatToBig( float x ) { return (NXSwappedFloat)OSSwapHostToBigInt32((uint32_t)NXConvertHostFloatToSwapped(x)); } static __inline__ unsigned short NXSwapLittleShortToHost( unsigned short x ) { return (unsigned short)OSSwapLittleToHostInt16((uint16_t)x); } static __inline__ unsigned int NXSwapLittleIntToHost( unsigned int x ) { return (unsigned int)OSSwapLittleToHostInt32((uint32_t)x); } static __inline__ unsigned long NXSwapLittleLongToHost( unsigned long x ) { return (unsigned long)OSSwapLittleToHostInt32((uint32_t)x); } static __inline__ unsigned long long NXSwapLittleLongLongToHost( unsigned long long x ) { return (unsigned long long)OSSwapLittleToHostInt64((uint64_t)x); } static __inline__ double NXSwapLittleDoubleToHost( NXSwappedDouble x ) { return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapLittleToHostInt64((uint64_t)x)); } static __inline__ float NXSwapLittleFloatToHost( NXSwappedFloat x ) { return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapLittleToHostInt32((uint32_t)x)); } static __inline__ unsigned short NXSwapHostShortToLittle( unsigned short x ) { return (unsigned short)OSSwapHostToLittleInt16((uint16_t)x); } static __inline__ unsigned int NXSwapHostIntToLittle( unsigned int x ) { return (unsigned int)OSSwapHostToLittleInt32((uint32_t)x); } static __inline__ unsigned long NXSwapHostLongToLittle( unsigned long x ) { return (unsigned long)OSSwapHostToLittleInt32((uint32_t)x); } static __inline__ unsigned long long NXSwapHostLongLongToLittle( unsigned long long x ) { return (unsigned long long)OSSwapHostToLittleInt64((uint64_t)x); } static __inline__ NXSwappedDouble NXSwapHostDoubleToLittle( double x ) { return (NXSwappedDouble)OSSwapHostToLittleInt64((uint64_t)NXConvertHostDoubleToSwapped(x)); } static __inline__ NXSwappedFloat NXSwapHostFloatToLittle( float x ) { return (NXSwappedFloat)OSSwapHostToLittleInt32((uint32_t)NXConvertHostFloatToSwapped(x)); } #endif /* _ARCHITECTURE_BYTE_ORDER_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/tss.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1992 NeXT Computer, Inc. * * Intel386 Family: Task State Segment. * * HISTORY * * 29 March 1992 ? at NeXT * Created. */ #include <architecture/i386/sel.h> /* * Task State segment. */ typedef struct tss { sel_t oldtss; unsigned int :0; unsigned int esp0; sel_t ss0; unsigned int :0; unsigned int esp1; sel_t ss1; unsigned int :0; unsigned int esp2; sel_t ss2; unsigned int :0; unsigned int cr3; unsigned int eip; unsigned int eflags; unsigned int eax; unsigned int ecx; unsigned int edx; unsigned int ebx; unsigned int esp; unsigned int ebp; unsigned int esi; unsigned int edi; sel_t es; unsigned int :0; sel_t cs; unsigned int :0; sel_t ss; unsigned int :0; sel_t ds; unsigned int :0; sel_t fs; unsigned int :0; sel_t gs; unsigned int :0; sel_t ldt; unsigned int :0; unsigned int t :1, :15, io_bmap :16; } tss_t; #define TSS_SIZE(n) (sizeof (struct tss) + (n)) /* * Task State segment descriptor. */ typedef struct tss_desc { unsigned short limit00; unsigned short base00; unsigned char base16; unsigned char type :5, #define DESC_TSS 0x09 dpl :2, present :1; unsigned char limit16 :4, :3, granular:1; unsigned char base24; } tss_desc_t; /* * Task gate descriptor. */ typedef struct task_gate { unsigned short :16; sel_t tss; unsigned int :8, type :5, #define DESC_TASK_GATE 0x05 dpl :2, present :1, :0; } task_gate_t;
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/cpu.h
/* * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1992 NeXT Computer, Inc. * * Intel386 Family: Special processor registers. * * HISTORY * * 5 April 1992 ? at NeXT * Created. */ /* * Control register 0 */ typedef struct _cr0 { unsigned int pe :1, mp :1, em :1, ts :1, :1, ne :1, :10, wp :1, :1, am :1, :10, nw :1, cd :1, pg :1; } cr0_t;
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/table.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1992 NeXT Computer, Inc. * * Intel386 Family: Descriptor tables. * * HISTORY * * 30 March 1992 ? at NeXT * Created. */ #include <architecture/i386/desc.h> #include <architecture/i386/tss.h> /* * A totally generic descriptor * table entry. */ typedef union dt_entry { code_desc_t code; data_desc_t data; ldt_desc_t ldt; tss_desc_t task_state; call_gate_t call_gate; trap_gate_t trap_gate; intr_gate_t intr_gate; task_gate_t task_gate; } dt_entry_t; #define DESC_TBL_MAX 8192 /* * Global descriptor table. */ typedef union gdt_entry { code_desc_t code; data_desc_t data; ldt_desc_t ldt; call_gate_t call_gate; task_gate_t task_gate; tss_desc_t task_state; } gdt_entry_t; typedef gdt_entry_t gdt_t; /* * Interrupt descriptor table. */ typedef union idt_entry { trap_gate_t trap_gate; intr_gate_t intr_gate; task_gate_t task_gate; } idt_entry_t; typedef idt_entry_t idt_t; /* * Local descriptor table. */ typedef union ldt_entry { code_desc_t code; data_desc_t data; call_gate_t call_gate; task_gate_t task_gate; } ldt_entry_t; typedef ldt_entry_t ldt_t;
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/io.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1992 NeXT Computer, Inc. * * Intel 386 Family: IO space defines. * * HISTORY * * 11 August 1992 ? at NeXT * Created. */ typedef unsigned short io_addr_t; typedef unsigned short io_len_t;
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/reg_help.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. * * File: architecture/i386/reg_help.h * Author: Mike DeMoney, NeXT Computer, Inc. * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. * * This header file defines cpp macros useful for defining * machine register and doing machine-level operations. * * HISTORY * 10-Mar-92 Bruce Martin ([email protected]) * Adapted to i386 * 23-Jan-91 Mike DeMoney ([email protected]) * Created. */ #ifndef _ARCH_I386_REG_HELP_H_ #define _ARCH_I386_REG_HELP_H_ /* Bitfield definition aid */ #define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) #define BIT_WIDTH(pos) (1) /* mostly to record the position */ /* Mask creation */ #define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) #define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) #define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) /* Register addresses */ #if __ASSEMBLER__ # define REG_ADDR(type, addr) (addr) #else /* __ASSEMBLER__ */ # define REG_ADDR(type, addr) (*(volatile type *)(addr)) #endif /* __ASSEMBLER__ */ /* Cast a register to be an unsigned */ #define CONTENTS(foo) (*(unsigned *) &(foo)) /* Stack pointer must always be a multiple of 4 */ #define STACK_INCR 4 #define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) /* STRINGIFY -- perform all possible substitutions, then stringify */ #define __STR(x) #x /* just a helper macro */ #define STRINGIFY(x) __STR(x) /* * REG_PAIR_DEF -- define a register pair * Register pairs are appropriately aligned to allow access via * ld.d and st.d. * * Usage: * struct foo { * REG_PAIR_DEF( * bar_t *, barp, * afu_t, afu * ); * }; * * Access to individual entries of the pair is via the REG_PAIR * macro (below). */ #define REG_PAIR_DEF(type0, name0, type1, name1) \ struct { \ type0 name0 __attribute__(( aligned(8) )); \ type1 name1; \ } name0##_##name1 /* * REG_PAIR -- Macro to define names for accessing individual registers * of register pairs. * * Usage: * arg0 is first element of pair * arg1 is second element of pair * arg2 is desired element of pair * eg: * #define foo_barp REG_PAIR(barp, afu, afu) */ #define REG_PAIR(name0, name1, the_name) \ name0##_##name1.the_name #endif /* _ARCH_I386_REG_HELP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/asm_help.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. * * File: architecture/i386/asm_help.h * Author: Mike DeMoney, NeXT Computer, Inc. * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. * * This header file defines macros useful when writing assembly code * for the Intel i386 family processors. * * HISTORY * 10-Mar-92 Bruce Martin ([email protected]) * Adapted to i386 * 23-Jan-91 Mike DeMoney ([email protected]) * Created. */ #ifndef _ARCH_I386_ASM_HELP_H_ #define _ARCH_I386_ASM_HELP_H_ #include <architecture/i386/reg_help.h> #ifdef __ASSEMBLER__ #define ALIGN \ .align 2, 0x90 /* Note that ROUND_TO_STACK rounds to Intel's stack alignment requirement, * but it is not sufficient for the Apple ABI which requires a 16-byte * aligned stack. Various parts of the OS depend on this requirement, * including dyld. */ #define ROUND_TO_STACK(len) \ (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) #ifdef notdef #define CALL_MCOUNT \ pushl %ebp ;\ movl %esp, %ebp ;\ .data ;\ 1: .long 0 ;\ .text ;\ lea 9b,%edx ;\ call mcount ;\ popl %ebp ; #else #define CALL_MCOUNT #endif /* * Prologue for functions that may call other functions. Saves * registers and sets up a C frame. */ #define NESTED_FUNCTION_PROLOGUE(localvarsize) \ .set __framesize,ROUND_TO_STACK(localvarsize) ;\ .set __nested_function, 1 ;\ CALL_MCOUNT \ .if __framesize ;\ pushl %ebp ;\ movl %esp, %ebp ;\ subl $__framesize, %esp ;\ .endif ;\ pushl %edi ;\ pushl %esi ;\ pushl %ebx /* * Prologue for functions that do not call other functions. Does not * save registers (this is the functions responsibility). Does set * up a C frame. */ #define LEAF_FUNCTION_PROLOGUE(localvarsize) \ .set __framesize,ROUND_TO_STACK(localvarsize) ;\ .set __nested_function, 0 ;\ CALL_MCOUNT \ .if __framesize ;\ pushl %ebp ;\ movl %esp, %ebp ;\ subl $__framesize, %esp ;\ .endif /* * Prologue for any function. * * We assume that all Leaf functions will be responsible for saving any * local registers they clobber. */ #define FUNCTION_EPILOGUE \ .if __nested_function ;\ popl %ebx ;\ popl %esi ;\ popl %edi ;\ .endif ;\ .if __framesize ;\ movl %ebp, %esp ;\ popl %ebp ;\ .endif ;\ ret /* * Macros for declaring procedures * * Use of these macros allows ctags to have a predictable way * to find various types of declarations. They also simplify * inserting appropriate symbol table information. * * NOTE: these simple stubs will be replaced with more * complicated versions once we know what the linker and gdb * will require as far as register use masks and frame declarations. * These macros may also be ifdef'ed in the future to contain profiling * code. * */ /* * TEXT -- declare start of text segment */ #define TEXT \ .text /* * DATA -- declare start of data segment */ #define DATA \ .data /* * LEAF -- declare global leaf procedure * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only * be jumped to. (A leaf may do an align.) Use a LABEL() if you * need control to flow into the label. */ #define LEAF(name, localvarsize) \ .globl name ;\ ALIGN ;\ name: ;\ LEAF_FUNCTION_PROLOGUE(localvarsize) /* * X_LEAF -- declare alternate global label for leaf */ #define X_LEAF(name, value) \ .globl name ;\ .set name,value /* * P_LEAF -- declare private leaf procedure */ #define P_LEAF(name, localvarsize) \ ALIGN ;\ name: ;\ LEAF_FUNCTION_PROLOGUE(localvarsize) /* * LABEL -- declare a global code label * MUST be used (rather than LEAF, NESTED, etc) if control * "flows into" the label. */ #define LABEL(name) \ .globl name ;\ name: /* * NESTED -- declare procedure that invokes other procedures */ #define NESTED(name, localvarsize) \ .globl name ;\ ALIGN ;\ name: ;\ NESTED_FUNCTION_PROLOGUE(localvarsize) /* * X_NESTED -- declare alternate global label for nested proc */ #define X_NESTED(name, value) \ .globl name ;\ .set name,value /* * P_NESTED -- declare private nested procedure */ #define P_NESTED(name, localvarsize) \ ALIGN ;\ name: ;\ NESTED_FUNCTION_PROLOGUE(localvarsize) /* * END -- mark end of procedure */ #define END(name) \ FUNCTION_EPILOGUE /* * Storage definition macros * The main purpose of these is to allow an easy handle for ctags */ /* * IMPORT -- import symbol */ #define IMPORT(name) \ .reference name /* * ABS -- declare global absolute symbol */ #define ABS(name, value) \ .globl name ;\ .set name,value /* * P_ABS -- declare private absolute symbol */ #define P_ABS(name, value) \ .set name,value /* * EXPORT -- declare global label for data */ #define EXPORT(name) \ .globl name ;\ name: /* * BSS -- declare global zero'ed storage */ #define BSS(name,size) \ .comm name,size /* * P_BSS -- declare private zero'ed storage */ #define P_BSS(name,size) \ .lcomm name,size /* * dynamic/PIC macros for routines which reference external symbols */ #if defined(__DYNAMIC__) #define PICIFY(var) \ call 1f ; \ 1: ; \ popl %edx ; \ movl L ## var ## $non_lazy_ptr-1b(%edx),%edx #define CALL_EXTERN_AGAIN(func) \ PICIFY(func) ; \ call %edx #define NON_LAZY_STUB(var) \ .non_lazy_symbol_pointer ; \ L ## var ## $non_lazy_ptr: ; \ .indirect_symbol var ; \ .long 0 ; \ .text #define CALL_EXTERN(func) \ CALL_EXTERN_AGAIN(func) ; \ NON_LAZY_STUB(func) #define BRANCH_EXTERN(func) \ PICIFY(func) ; \ jmp %edx ; \ NON_LAZY_STUB(func) #define PUSH_EXTERN(var) \ PICIFY(var) ; \ movl (%edx),%edx ; \ pushl %edx ; \ NON_LAZY_STUB(var) #define REG_TO_EXTERN(reg, var) \ PICIFY(var) ; \ movl reg, (%edx) ; \ NON_LAZY_STUB(var) #define EXTERN_TO_REG(var, reg) \ call 1f ; \ 1: ; \ popl %edx ; \ movl L ## var ##$non_lazy_ptr-1b(%edx),reg ; \ NON_LAZY_STUB(var) #else #define BRANCH_EXTERN(func) jmp func #define PUSH_EXTERN(var) pushl var #define CALL_EXTERN(func) call func #define CALL_EXTERN_AGAIN(func) call func #define REG_TO_EXTERN(reg, var) movl reg, var #define EXTERN_TO_REG(var, reg) movl $ ## var, reg #endif #endif /* __ASSEMBLER__ */ #endif /* _ARCH_I386_ASM_HELP_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/pio.h
/* * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or [email protected] * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ #ifndef _ARCH_I386_PIO_H_ #define _ARCH_I386_PIO_H_ typedef unsigned short i386_ioport_t; #if defined(__GNUC__) static __inline__ unsigned int inl( i386_ioport_t port) { unsigned int datum; __asm__ volatile("inl %w1, %0" : "=a" (datum) : "Nd" (port)); return(datum); } static __inline__ unsigned short inw( i386_ioport_t port) { unsigned short datum; __asm__ volatile("inw %w1, %w0" : "=a" (datum) : "Nd" (port)); return(datum); } static __inline__ unsigned char inb( i386_ioport_t port) { unsigned char datum; __asm__ volatile("inb %w1, %b0" : "=a" (datum) : "Nd" (port)); return(datum); } static __inline__ void outl( i386_ioport_t port, unsigned int datum) { __asm__ volatile("outl %0, %w1" : : "a" (datum), "Nd" (port)); } static __inline__ void outw( i386_ioport_t port, unsigned short datum) { __asm__ volatile("outw %w0, %w1" : : "a" (datum), "Nd" (port)); } static __inline__ void outb( i386_ioport_t port, unsigned char datum) { __asm__ volatile("outb %b0, %w1" : : "a" (datum), "Nd" (port)); } #endif /* defined(__GNUC__) */ #endif /* _ARCH_I386_PIO_H_ */
0
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture
repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/architecture/i386/sel.h
/* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1992 NeXT Computer, Inc. * * Intel386 Family: Segment selector. * * HISTORY * * 29 March 1992 ? at NeXT * Created. */ /* * Segment selector. */ #ifndef __XNU_ARCH_I386_SEL_H #define __XNU_ARCH_I386_SEL_H typedef struct sel { unsigned short rpl :2, #define KERN_PRIV 0 #define USER_PRIV 3 ti :1, #define SEL_GDT 0 #define SEL_LDT 1 index :13; } sel_t; #define NULL_SEL ((sel_t) { 0, 0, 0 } ) #endif /* __XNU_ARCH_I386_SEL_H */