1module Darwin.Mach.machine [system] { 2 header "mach/machine.h" 3 export * 4 5 #ifdef XNU_KERNEL_PRIVATE 6 // mach/machine/asm.h is in the public SDK for all OSes, but it 7 // includes mach/arm64/asm.h in __arm64__, and that's only public 8 // in macOS. 9 #endif 10 // declares Value macro which can cause problems in other headers 11 explicit module asm { 12 #ifdef XNU_PLATFORM_MacOSX 13 header "mach/machine/asm.h" 14 #endif 15 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 16 header "mach/i386/asm.h" 17 #endif 18 header "mach/arm/asm.h" 19 #ifdef XNU_PLATFORM_MacOSX 20 header "mach/arm64/asm.h" 21 #endif 22 23 export * 24 } 25 26 module _structs { 27 header "mach/machine/_structs.h" 28 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 29 header "mach/i386/_structs.h" 30 #endif 31 header "mach/arm/_structs.h" 32 33 export * 34 } 35 36 module boolean { 37 header "mach/machine/boolean.h" 38 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 39 header "mach/i386/boolean.h" 40 #endif 41 header "mach/arm/boolean.h" 42 43 export * 44 } 45 46 module exception { 47 header "mach/machine/exception.h" 48 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 49 header "mach/i386/exception.h" 50 #endif 51 header "mach/arm/exception.h" 52 53 export * 54 } 55 56 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 57 module fp_reg { 58 header "mach/i386/fp_reg.h" 59 export * 60 } 61 62 #endif 63 module kern_return { 64 header "mach/machine/kern_return.h" 65 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 66 header "mach/i386/kern_return.h" 67 #endif 68 header "mach/arm/kern_return.h" 69 70 export * 71 } 72 73 // ndr_def.h defines a non-external global variable and can only 74 // be included from a single implementation file. 75 explicit module ndr_def { 76 header "mach/machine/ndr_def.h" 77 export * 78 79 #ifdef XNU_KERNEL_PRIVATE 80 // mach/{i386,arm}/ndr_def.h are conceptually a part of mach/machine/ndr_def.h, 81 // and so belong to this module, but need to be excluded or else clang will 82 // attempt to compile {i386,arm}/ndr_def.h independently. And that fails 83 // because {i386,arm}/ndr_def.h can only be included once, which is from 84 // mach/machine/ndr_def.h. 85 #endif 86 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 87 exclude header "mach/i386/ndr_def.h" 88 #endif 89 exclude header "mach/arm/ndr_def.h" 90 } 91 92 module processor_info { 93 header "mach/machine/processor_info.h" 94 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 95 header "mach/i386/processor_info.h" 96 #endif 97 header "mach/arm/processor_info.h" 98 99 export * 100 } 101 102 module rpc { 103 header "mach/machine/rpc.h" 104 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 105 header "mach/i386/rpc.h" 106 #endif 107 header "mach/arm/rpc.h" 108 109 export * 110 } 111 112 #ifdef XNU_KERNEL_PRIVATE 113 // The XNU_PLATFORM_MacOSX headers are in the public SDK for macOS, 114 // but mastered out of the public SDK for the other OSes. 115 #endif 116 #ifdef XNU_PLATFORM_MacOSX 117 module sdt { 118 header "mach/machine/sdt.h" 119 export * 120 } 121 122 #endif 123 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 124 module sdt_isa { 125 #ifdef XNU_PLATFORM_MacOSX 126 header "mach/machine/sdt_isa.h" 127 #endif 128 header "mach/i386/sdt_isa.h" 129 #ifdef XNU_PLATFORM_MacOSX 130 header "mach/arm/sdt_isa.h" 131 #endif 132 133 export * 134 } 135 136 #endif 137 #ifdef XNU_KERNEL_PRIVATE 138 // usr/include/mach/machine/syscall_sw.h and usr/include/mach/i386/syscall_sw.h 139 // are mastered out of all SDKs. 140 #endif 141 module thread_state { 142 header "mach/machine/thread_state.h" 143 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 144 header "mach/i386/thread_state.h" 145 #endif 146 header "mach/arm/thread_state.h" 147 148 export * 149 } 150 151 module thread_status { 152 header "mach/machine/thread_status.h" 153 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 154 header "mach/i386/thread_status.h" 155 #endif 156 header "mach/arm/thread_status.h" 157 158 export * 159 } 160 161 module traps { 162 header "mach/arm/traps.h" 163 export * 164 } 165 166 module vm_param { 167 header "mach/machine/vm_param.h" 168 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 169 header "mach/i386/vm_param.h" 170 #endif 171 header "mach/arm/vm_param.h" 172 173 export * 174 } 175 176 module vm_types { 177 header "mach/machine/vm_types.h" 178 #if defined(XNU_PLATFORM_MacOSX) || defined(XNU_PLATFORM_iPhoneSimulator) || defined(XNU_PLATFORM_AppleTVSimulator) || defined(XNU_PLATFORM_WatchSimulator) 179 header "mach/i386/vm_types.h" 180 #endif 181 header "mach/arm/vm_types.h" 182 183 export * 184 } 185 #ifdef XNU_KERNEL_PRIVATE 186 // mach/machine/asm.h is in the public SDK for all OSes, but it 187 // includes mach/arm64/asm.h in __arm64__, and that's only public 188 // in macOS. 189 #endif 190 #ifndef XNU_PLATFORM_MacOSX 191 192 exclude header "mach/machine/asm.h" 193 #endif 194 #ifdef XNU_KERNEL_PRIVATE 195 // arm/syscall_sw.h is in the public SDK for macOS, but mastered 196 // out of the public SDK for the other OSes. However, it doesn't 197 // compile (missing include?). 198 #endif 199 #ifdef XNU_PLATFORM_MacOSX 200 201 exclude header "mach/arm/syscall_sw.h" 202 #endif 203} 204