| author | |
| committer | |
| log | 0bc9fd5e8e6a45fd54c3c755bd022ce7f82d8e00 |
| tree | 9f2ac0b61100de0c6da63ccaa98ee71e49a1afef |
| parent | 83a1523b1a4da821a18e1ad4ee48210412d011cb |
| parent | db2ac8ae493ef118bfcb15710ea0e268de500e73 |
| signature |
macOS libc headers: add POSIX headers357 files changed, 101502 insertions(+), 201 deletions(-)
lib/libc/include/x86_64-macos-gnu/AssertMacros.h created+1441| ... | @@ -0,0 +1,1441 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2002-2017 by Apple Inc.. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | |||
| 25 | /* | ||
| 26 | 	File: AssertMacros.h | ||
| 27 | |||
| 28 | 	Contains: This file defines structured error handling and assertion macros for | ||
| 29 | 				programming in C. Originally used in QuickDraw GX and later enhanced. | ||
| 30 | 				These macros are used throughout Apple's software. | ||
| 31 | 	 | ||
| 32 | 				New code may not want to begin adopting these macros and instead use | ||
| 33 | 				existing language functionality. | ||
| 34 | 	 | ||
| 35 | 				See "Living In an Exceptional World" by Sean Parent | ||
| 36 | 				(develop, The Apple Technical Journal, Issue 11, August/September 1992) | ||
| 37 | 				<http://developer.apple.com/dev/techsupport/develop/issue11toc.shtml> or | ||
| 38 | 				<http://www.mactech.com/articles/develop/issue_11/Parent_final.html> | ||
| 39 | 				for the methodology behind these error handling and assertion macros. | ||
| 40 | 	 | ||
| 41 | 	Bugs?: For bug reports, consult the following page on | ||
| 42 | 				the World Wide Web: | ||
| 43 | |||
| 44 | 	 http://developer.apple.com/bugreporter/ | ||
| 45 | */ | ||
| 46 | #ifndef __ASSERTMACROS__ | ||
| 47 | #define __ASSERTMACROS__ | ||
| 48 | |||
| 49 | #ifdef DEBUG_ASSERT_CONFIG_INCLUDE | ||
| 50 | #include DEBUG_ASSERT_CONFIG_INCLUDE | ||
| 51 | #endif | ||
| 52 | |||
| 53 | /* | ||
| 54 | * Macro overview: | ||
| 55 | * | ||
| 56 | * check(assertion) | ||
| 57 | * In production builds, pre-processed away | ||
| 58 | * In debug builds, if assertion evaluates to false, calls DEBUG_ASSERT_MESSAGE | ||
| 59 | * | ||
| 60 | * verify(assertion) | ||
| 61 | * In production builds, evaluates assertion and does nothing | ||
| 62 | * In debug builds, if assertion evaluates to false, calls DEBUG_ASSERT_MESSAGE | ||
| 63 | * | ||
| 64 | * require(assertion, exceptionLabel) | ||
| 65 | * In production builds, if the assertion expression evaluates to false, goto exceptionLabel | ||
| 66 | * In debug builds, if the assertion expression evaluates to false, calls DEBUG_ASSERT_MESSAGE | ||
| 67 | * and jumps to exceptionLabel | ||
| 68 | * | ||
| 69 | * In addition the following suffixes are available: | ||
| 70 | * | ||
| 71 | * _noerr Adds "!= 0" to assertion. Useful for asserting and OSStatus or OSErr is noErr (zero) | ||
| 72 | * _action Adds statement to be executued if assertion fails | ||
| 73 | * _quiet Suppress call to DEBUG_ASSERT_MESSAGE | ||
| 74 | * _string Allows you to add explanitory message to DEBUG_ASSERT_MESSAGE | ||
| 75 | * | ||
| 76 | * For instance, require_noerr_string(resultCode, label, msg) will do nothing if | ||
| 77 | * resultCode is zero, otherwise it will call DEBUG_ASSERT_MESSAGE with msg | ||
| 78 | * and jump to label. | ||
| 79 | * | ||
| 80 | * Configuration: | ||
| 81 | * | ||
| 82 | * By default all macros generate "production code" (i.e non-debug). If | ||
| 83 | * DEBUG_ASSERT_PRODUCTION_CODE is defined to zero or DEBUG is defined to non-zero | ||
| 84 | * while this header is included, the macros will generated debug code. | ||
| 85 | * | ||
| 86 | * If DEBUG_ASSERT_COMPONENT_NAME_STRING is defined, all debug messages will | ||
| 87 | * be prefixed with it. | ||
| 88 | * | ||
| 89 | * By default, all messages write to stderr. If you would like to write a custom | ||
| 90 | * error message formater, defined DEBUG_ASSERT_MESSAGE to your function name. | ||
| 91 | * | ||
| 92 | * Each individual macro will only be defined if it is not already defined, so | ||
| 93 | * you can redefine their behavior singly by providing your own definition before | ||
| 94 | * this file is included. | ||
| 95 | * | ||
| 96 | * If you define __ASSERTMACROS__ before this file is included, then nothing in | ||
| 97 | * this file will take effect. | ||
| 98 | * | ||
| 99 | * Prior to Mac OS X 10.6 the macro names used in this file conflicted with some | ||
| 100 | * user code, including libraries in boost and the proposed C++ standards efforts, | ||
| 101 | * and there was no way for a client of this header to resolve this conflict. Because | ||
| 102 | * of this, most of the macros have been changed so that they are prefixed with | ||
| 103 | * __ and contain at least one capital letter, which should alleviate the current | ||
| 104 | * and future conflicts. However, to allow current sources to continue to compile, | ||
| 105 | * compatibility macros are defined at the end with the old names. A tops script | ||
| 106 | * at the end of this file will convert all of the old macro names used in a directory | ||
| 107 | * to the new names. Clients are recommended to migrate over to these new macros as | ||
| 108 | * they update their sources because a future release of Mac OS X will remove the | ||
| 109 | * old macro definitions ( without the double-underscore prefix ). Clients who | ||
| 110 | * want to compile without the old macro definitions can define the macro | ||
| 111 | * __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES to 0 before this file is | ||
| 112 | * included. | ||
| 113 | */ | ||
| 114 | |||
| 115 | |||
| 116 | /* | ||
| 117 | * Before including this file, #define DEBUG_ASSERT_COMPONENT_NAME_STRING to | ||
| 118 | * a C-string containing the name of your client. This string will be passed to | ||
| 119 | * the DEBUG_ASSERT_MESSAGE macro for inclusion in any assertion messages. | ||
| 120 | * | ||
| 121 | * If you do not define DEBUG_ASSERT_COMPONENT_NAME_STRING, the default | ||
| 122 | * DEBUG_ASSERT_COMPONENT_NAME_STRING value, an empty string, will be used by | ||
| 123 | * the assertion macros. | ||
| 124 | */ | ||
| 125 | #ifndef DEBUG_ASSERT_COMPONENT_NAME_STRING | ||
| 126 | #define DEBUG_ASSERT_COMPONENT_NAME_STRING "" | ||
| 127 | #endif | ||
| 128 | |||
| 129 | |||
| 130 | /* | ||
| 131 | * To activate the additional assertion code and messages for non-production builds, | ||
| 132 | * #define DEBUG_ASSERT_PRODUCTION_CODE to zero before including this file. | ||
| 133 | * | ||
| 134 | * If you do not define DEBUG_ASSERT_PRODUCTION_CODE, the default value 1 will be used | ||
| 135 | * (production code = no assertion code and no messages). | ||
| 136 | */ | ||
| 137 | #ifndef DEBUG_ASSERT_PRODUCTION_CODE | ||
| 138 | #define DEBUG_ASSERT_PRODUCTION_CODE !DEBUG | ||
| 139 | #endif | ||
| 140 | |||
| 141 | |||
| 142 | /* | ||
| 143 | * DEBUG_ASSERT_MESSAGE(component, assertion, label, error, file, line, errorCode) | ||
| 144 | * | ||
| 145 | * Summary: | ||
| 146 | * All assertion messages are routed through this macro. If you wish to use your | ||
| 147 | * own routine to display assertion messages, you can override DEBUG_ASSERT_MESSAGE | ||
| 148 | * by #defining DEBUG_ASSERT_MESSAGE before including this file. | ||
| 149 | * | ||
| 150 | * Parameters: | ||
| 151 | * | ||
| 152 | * componentNameString: | ||
| 153 | * A pointer to a string constant containing the name of the | ||
| 154 | * component this code is part of. This must be a string constant | ||
| 155 | * (and not a string variable or NULL) because the preprocessor | ||
| 156 | * concatenates it with other string constants. | ||
| 157 | * | ||
| 158 | * assertionString: | ||
| 159 | * A pointer to a string constant containing the assertion. | ||
| 160 | * This must be a string constant (and not a string variable or | ||
| 161 | * NULL) because the Preprocessor concatenates it with other | ||
| 162 | * string constants. | ||
| 163 | * | ||
| 164 | * exceptionLabelString: | ||
| 165 | * A pointer to a string containing the exceptionLabel, or NULL. | ||
| 166 | * | ||
| 167 | * errorString: | ||
| 168 | * A pointer to the error string, or NULL. DEBUG_ASSERT_MESSAGE macros | ||
| 169 | * must not attempt to concatenate this string with constant | ||
| 170 | * character strings. | ||
| 171 | * | ||
| 172 | * fileName: | ||
| 173 | * A pointer to the fileName or pathname (generated by the | ||
| 174 | * preprocessor __FILE__ identifier), or NULL. | ||
| 175 | * | ||
| 176 | * lineNumber: | ||
| 177 | * The line number in the file (generated by the preprocessor | ||
| 178 | * __LINE__ identifier), or 0 (zero). | ||
| 179 | * | ||
| 180 | * errorCode: | ||
| 181 | * A value associated with the assertion, or 0. | ||
| 182 | * | ||
| 183 | * Here is an example of a DEBUG_ASSERT_MESSAGE macro and a routine which displays | ||
| 184 | * assertion messsages: | ||
| 185 | * | ||
| 186 | * #define DEBUG_ASSERT_COMPONENT_NAME_STRING "MyCoolProgram" | ||
| 187 | * | ||
| 188 | * #define DEBUG_ASSERT_MESSAGE(componentNameString, assertionString, \ | ||
| 189 | * exceptionLabelString, errorString, fileName, lineNumber, errorCode) \ | ||
| 190 | * MyProgramDebugAssert(componentNameString, assertionString, \ | ||
| 191 | * exceptionLabelString, errorString, fileName, lineNumber, errorCode) | ||
| 192 | * | ||
| 193 | * static void | ||
| 194 | * MyProgramDebugAssert(const char *componentNameString, const char *assertionString, | ||
| 195 | * const char *exceptionLabelString, const char *errorString, | ||
| 196 | * const char *fileName, long lineNumber, int errorCode) | ||
| 197 | * { | ||
| 198 | * if ( (assertionString != NULL) && (*assertionString != '\0') ) | ||
| 199 | * fprintf(stderr, "Assertion failed: %s: %s\n", componentNameString, assertionString); | ||
| 200 | * else | ||
| 201 | * fprintf(stderr, "Check failed: %s:\n", componentNameString); | ||
| 202 | * if ( exceptionLabelString != NULL ) | ||
| 203 | * fprintf(stderr, " %s\n", exceptionLabelString); | ||
| 204 | * if ( errorString != NULL ) | ||
| 205 | * fprintf(stderr, " %s\n", errorString); | ||
| 206 | * if ( fileName != NULL ) | ||
| 207 | * fprintf(stderr, " file: %s\n", fileName); | ||
| 208 | * if ( lineNumber != 0 ) | ||
| 209 | * fprintf(stderr, " line: %ld\n", lineNumber); | ||
| 210 | * if ( errorCode != 0 ) | ||
| 211 | * fprintf(stderr, " error: %d\n", errorCode); | ||
| 212 | * } | ||
| 213 | * | ||
| 214 | * If you do not define DEBUG_ASSERT_MESSAGE, a simple printf to stderr will be used. | ||
| 215 | */ | ||
| 216 | #ifndef DEBUG_ASSERT_MESSAGE | ||
| 217 | #ifdef KERNEL | ||
| 218 | #include <libkern/libkern.h> | ||
| 219 | #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \ | ||
| 220 | printf( "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value)); | ||
| 221 | #else | ||
| 222 | #include <stdio.h> | ||
| 223 | #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \ | ||
| 224 | fprintf(stderr, "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value)); | ||
| 225 | #endif | ||
| 226 | #endif | ||
| 227 | |||
| 228 | |||
| 229 | |||
| 230 | |||
| 231 | |||
| 232 | /* | ||
| 233 | * __Debug_String(message) | ||
| 234 | * | ||
| 235 | * Summary: | ||
| 236 | * Production builds: does nothing and produces no code. | ||
| 237 | * | ||
| 238 | * Non-production builds: call DEBUG_ASSERT_MESSAGE. | ||
| 239 | * | ||
| 240 | * Parameters: | ||
| 241 | * | ||
| 242 | * message: | ||
| 243 | * The C string to display. | ||
| 244 | * | ||
| 245 | */ | ||
| 246 | #ifndef __Debug_String | ||
| 247 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 248 | 	 #define __Debug_String(message) | ||
| 249 | 	#else | ||
| 250 | 	 #define __Debug_String(message) \ | ||
| 251 | 		 do \ | ||
| 252 | 		 { \ | ||
| 253 | 			 DEBUG_ASSERT_MESSAGE( \ | ||
| 254 | 				 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 255 | 				 "", \ | ||
| 256 | 				 0, \ | ||
| 257 | 				 message, \ | ||
| 258 | 				 __FILE__, \ | ||
| 259 | 				 __LINE__, \ | ||
| 260 | 				 0); \ | ||
| 261 | 		 } while ( 0 ) | ||
| 262 | 	#endif | ||
| 263 | #endif | ||
| 264 | |||
| 265 | /* | ||
| 266 | * __Check(assertion) | ||
| 267 | * | ||
| 268 | * Summary: | ||
| 269 | * Production builds: does nothing and produces no code. | ||
| 270 | * | ||
| 271 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 272 | * call DEBUG_ASSERT_MESSAGE. | ||
| 273 | * | ||
| 274 | * Parameters: | ||
| 275 | * | ||
| 276 | * assertion: | ||
| 277 | * The assertion expression. | ||
| 278 | */ | ||
| 279 | #ifndef __Check | ||
| 280 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 281 | 	 #define __Check(assertion) | ||
| 282 | 	#else | ||
| 283 | 	 #define __Check(assertion) \ | ||
| 284 | 		 do \ | ||
| 285 | 		 { \ | ||
| 286 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 287 | 			 { \ | ||
| 288 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 289 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 290 | 					 #assertion, 0, 0, __FILE__, __LINE__, 0 ); \ | ||
| 291 | 			 } \ | ||
| 292 | 		 } while ( 0 ) | ||
| 293 | 	#endif | ||
| 294 | #endif | ||
| 295 | |||
| 296 | #ifndef __nCheck | ||
| 297 | 	#define __nCheck(assertion) __Check(!(assertion)) | ||
| 298 | #endif | ||
| 299 | |||
| 300 | /* | ||
| 301 | * __Check_String(assertion, message) | ||
| 302 | * | ||
| 303 | * Summary: | ||
| 304 | * Production builds: does nothing and produces no code. | ||
| 305 | * | ||
| 306 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 307 | * call DEBUG_ASSERT_MESSAGE. | ||
| 308 | * | ||
| 309 | * Parameters: | ||
| 310 | * | ||
| 311 | * assertion: | ||
| 312 | * The assertion expression. | ||
| 313 | * | ||
| 314 | * message: | ||
| 315 | * The C string to display. | ||
| 316 | */ | ||
| 317 | #ifndef __Check_String | ||
| 318 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 319 | 	 #define __Check_String(assertion, message) | ||
| 320 | 	#else | ||
| 321 | 	 #define __Check_String(assertion, message) \ | ||
| 322 | 		 do \ | ||
| 323 | 		 { \ | ||
| 324 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 325 | 			 { \ | ||
| 326 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 327 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 328 | 					 #assertion, 0, message, __FILE__, __LINE__, 0 ); \ | ||
| 329 | 			 } \ | ||
| 330 | 		 } while ( 0 ) | ||
| 331 | 	#endif | ||
| 332 | #endif | ||
| 333 | |||
| 334 | #ifndef __nCheck_String | ||
| 335 | 	#define __nCheck_String(assertion, message) __Check_String(!(assertion), message) | ||
| 336 | #endif | ||
| 337 | |||
| 338 | /* | ||
| 339 | * __Check_noErr(errorCode) | ||
| 340 | * | ||
| 341 | * Summary: | ||
| 342 | * Production builds: does nothing and produces no code. | ||
| 343 | * | ||
| 344 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 345 | * call DEBUG_ASSERT_MESSAGE. | ||
| 346 | * | ||
| 347 | * Parameters: | ||
| 348 | * | ||
| 349 | * errorCode: | ||
| 350 | * The errorCode expression to compare with 0. | ||
| 351 | */ | ||
| 352 | #ifndef __Check_noErr | ||
| 353 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 354 | 	 #define __Check_noErr(errorCode) | ||
| 355 | 	#else | ||
| 356 | 	 #define __Check_noErr(errorCode) \ | ||
| 357 | 		 do \ | ||
| 358 | 		 { \ | ||
| 359 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 360 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 361 | 			 { \ | ||
| 362 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 363 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 364 | 					 #errorCode " == 0 ", 0, 0, __FILE__, __LINE__, evalOnceErrorCode ); \ | ||
| 365 | 			 } \ | ||
| 366 | 		 } while ( 0 ) | ||
| 367 | 	#endif | ||
| 368 | #endif | ||
| 369 | |||
| 370 | /* | ||
| 371 | * __Check_noErr_String(errorCode, message) | ||
| 372 | * | ||
| 373 | * Summary: | ||
| 374 | * Production builds: check_noerr_string() does nothing and produces | ||
| 375 | * no code. | ||
| 376 | * | ||
| 377 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 378 | * call DEBUG_ASSERT_MESSAGE. | ||
| 379 | * | ||
| 380 | * Parameters: | ||
| 381 | * | ||
| 382 | * errorCode: | ||
| 383 | * The errorCode expression to compare to 0. | ||
| 384 | * | ||
| 385 | * message: | ||
| 386 | * The C string to display. | ||
| 387 | */ | ||
| 388 | #ifndef __Check_noErr_String | ||
| 389 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 390 | 	 #define __Check_noErr_String(errorCode, message) | ||
| 391 | 	#else | ||
| 392 | 	 #define __Check_noErr_String(errorCode, message) \ | ||
| 393 | 		 do \ | ||
| 394 | 		 { \ | ||
| 395 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 396 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 397 | 			 { \ | ||
| 398 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 399 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 400 | 					 #errorCode " == 0 ", 0, message, __FILE__, __LINE__, evalOnceErrorCode ); \ | ||
| 401 | 			 } \ | ||
| 402 | 		 } while ( 0 ) | ||
| 403 | 	#endif | ||
| 404 | #endif | ||
| 405 | |||
| 406 | /* | ||
| 407 | * __Verify(assertion) | ||
| 408 | * | ||
| 409 | * Summary: | ||
| 410 | * Production builds: evaluate the assertion expression, but ignore | ||
| 411 | * the result. | ||
| 412 | * | ||
| 413 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 414 | * call DEBUG_ASSERT_MESSAGE. | ||
| 415 | * | ||
| 416 | * Parameters: | ||
| 417 | * | ||
| 418 | * assertion: | ||
| 419 | * The assertion expression. | ||
| 420 | */ | ||
| 421 | #ifndef __Verify | ||
| 422 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 423 | 	 #define __Verify(assertion) \ | ||
| 424 | 		 do \ | ||
| 425 | 		 { \ | ||
| 426 | 			 if ( !(assertion) ) \ | ||
| 427 | 			 { \ | ||
| 428 | 			 } \ | ||
| 429 | 		 } while ( 0 ) | ||
| 430 | 	#else | ||
| 431 | 	 #define __Verify(assertion) \ | ||
| 432 | 		 do \ | ||
| 433 | 		 { \ | ||
| 434 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 435 | 			 { \ | ||
| 436 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 437 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 438 | 					 #assertion, 0, 0, __FILE__, __LINE__, 0 ); \ | ||
| 439 | 			 } \ | ||
| 440 | 		 } while ( 0 ) | ||
| 441 | 	#endif | ||
| 442 | #endif | ||
| 443 | |||
| 444 | #ifndef __nVerify | ||
| 445 | 	#define __nVerify(assertion)	__Verify(!(assertion)) | ||
| 446 | #endif | ||
| 447 | |||
| 448 | /* | ||
| 449 | * __Verify_String(assertion, message) | ||
| 450 | * | ||
| 451 | * Summary: | ||
| 452 | * Production builds: evaluate the assertion expression, but ignore | ||
| 453 | * the result. | ||
| 454 | * | ||
| 455 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 456 | * call DEBUG_ASSERT_MESSAGE. | ||
| 457 | * | ||
| 458 | * Parameters: | ||
| 459 | * | ||
| 460 | * assertion: | ||
| 461 | * The assertion expression. | ||
| 462 | * | ||
| 463 | * message: | ||
| 464 | * The C string to display. | ||
| 465 | */ | ||
| 466 | #ifndef __Verify_String | ||
| 467 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 468 | 	 #define __Verify_String(assertion, message) \ | ||
| 469 | 		 do \ | ||
| 470 | 		 { \ | ||
| 471 | 			 if ( !(assertion) ) \ | ||
| 472 | 			 { \ | ||
| 473 | 			 } \ | ||
| 474 | 		 } while ( 0 ) | ||
| 475 | 	#else | ||
| 476 | 	 #define __Verify_String(assertion, message) \ | ||
| 477 | 		 do \ | ||
| 478 | 		 { \ | ||
| 479 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 480 | 			 { \ | ||
| 481 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 482 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 483 | 					 #assertion, 0, message, __FILE__, __LINE__, 0 ); \ | ||
| 484 | 			 } \ | ||
| 485 | 		 } while ( 0 ) | ||
| 486 | 	#endif | ||
| 487 | #endif | ||
| 488 | |||
| 489 | #ifndef __nVerify_String | ||
| 490 | 	#define __nVerify_String(assertion, message) __Verify_String(!(assertion), message) | ||
| 491 | #endif | ||
| 492 | |||
| 493 | /* | ||
| 494 | * __Verify_noErr(errorCode) | ||
| 495 | * | ||
| 496 | * Summary: | ||
| 497 | * Production builds: evaluate the errorCode expression, but ignore | ||
| 498 | * the result. | ||
| 499 | * | ||
| 500 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 501 | * call DEBUG_ASSERT_MESSAGE. | ||
| 502 | * | ||
| 503 | * Parameters: | ||
| 504 | * | ||
| 505 | * errorCode: | ||
| 506 | * The expression to compare to 0. | ||
| 507 | */ | ||
| 508 | #ifndef __Verify_noErr | ||
| 509 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 510 | 	 #define __Verify_noErr(errorCode) \ | ||
| 511 | 		 do \ | ||
| 512 | 		 { \ | ||
| 513 | 			 if ( 0 != (errorCode) ) \ | ||
| 514 | 			 { \ | ||
| 515 | 			 } \ | ||
| 516 | 		 } while ( 0 ) | ||
| 517 | 	#else | ||
| 518 | 	 #define __Verify_noErr(errorCode) \ | ||
| 519 | 		 do \ | ||
| 520 | 		 { \ | ||
| 521 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 522 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 523 | 			 { \ | ||
| 524 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 525 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 526 | 					 #errorCode " == 0 ", 0, 0, __FILE__, __LINE__, evalOnceErrorCode ); \ | ||
| 527 | 			 } \ | ||
| 528 | 		 } while ( 0 ) | ||
| 529 | 	#endif | ||
| 530 | #endif | ||
| 531 | |||
| 532 | /* | ||
| 533 | * __Verify_noErr_String(errorCode, message) | ||
| 534 | * | ||
| 535 | * Summary: | ||
| 536 | * Production builds: evaluate the errorCode expression, but ignore | ||
| 537 | * the result. | ||
| 538 | * | ||
| 539 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 540 | * call DEBUG_ASSERT_MESSAGE. | ||
| 541 | * | ||
| 542 | * Parameters: | ||
| 543 | * | ||
| 544 | * errorCode: | ||
| 545 | * The expression to compare to 0. | ||
| 546 | * | ||
| 547 | * message: | ||
| 548 | * The C string to display. | ||
| 549 | */ | ||
| 550 | #ifndef __Verify_noErr_String | ||
| 551 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 552 | 	 #define __Verify_noErr_String(errorCode, message) \ | ||
| 553 | 		 do \ | ||
| 554 | 		 { \ | ||
| 555 | 			 if ( 0 != (errorCode) ) \ | ||
| 556 | 			 { \ | ||
| 557 | 			 } \ | ||
| 558 | 		 } while ( 0 ) | ||
| 559 | 	#else | ||
| 560 | 	 #define __Verify_noErr_String(errorCode, message) \ | ||
| 561 | 		 do \ | ||
| 562 | 		 { \ | ||
| 563 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 564 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 565 | 			 { \ | ||
| 566 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 567 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 568 | 					 #errorCode " == 0 ", 0, message, __FILE__, __LINE__, evalOnceErrorCode ); \ | ||
| 569 | 			 } \ | ||
| 570 | 		 } while ( 0 ) | ||
| 571 | 	#endif | ||
| 572 | #endif | ||
| 573 | |||
| 574 | /* | ||
| 575 | * __Verify_noErr_Action(errorCode, action) | ||
| 576 | * | ||
| 577 | * Summary: | ||
| 578 | * Production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 579 | * execute the action statement or compound statement (block). | ||
| 580 | * | ||
| 581 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 582 | * call DEBUG_ASSERT_MESSAGE and then execute the action statement or compound | ||
| 583 | * statement (block). | ||
| 584 | * | ||
| 585 | * Parameters: | ||
| 586 | * | ||
| 587 | * errorCode: | ||
| 588 | * The expression to compare to 0. | ||
| 589 | * | ||
| 590 | * action: | ||
| 591 | * The statement or compound statement (block). | ||
| 592 | */ | ||
| 593 | #ifndef __Verify_noErr_Action | ||
| 594 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 595 | 	 #define __Verify_noErr_Action(errorCode, action) \ | ||
| 596 | 		 if ( 0 != (errorCode) ) { \ | ||
| 597 | 			 action; \ | ||
| 598 | 		 } \ | ||
| 599 | 		 else do {} while (0) | ||
| 600 | 	#else | ||
| 601 | 	 #define __Verify_noErr_Action(errorCode, action) \ | ||
| 602 | do { \ | ||
| 603 | 		 long evalOnceErrorCode = (errorCode); \ | ||
| 604 | 		 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) { \ | ||
| 605 | 			 DEBUG_ASSERT_MESSAGE( \ | ||
| 606 | 				 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 607 | 				 #errorCode " == 0 ", 0, 0, __FILE__, __LINE__, evalOnceErrorCode ); \ | ||
| 608 | 			 action; \ | ||
| 609 | 		 } \ | ||
| 610 | 	 } while (0) | ||
| 611 | 	#endif | ||
| 612 | #endif | ||
| 613 | |||
| 614 | /* | ||
| 615 | * __Verify_Action(assertion, action) | ||
| 616 | * | ||
| 617 | * Summary: | ||
| 618 | * Production builds: if the assertion expression evaluates to false, | ||
| 619 | * then execute the action statement or compound statement (block). | ||
| 620 | * | ||
| 621 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 622 | * call DEBUG_ASSERT_MESSAGE and then execute the action statement or compound | ||
| 623 | * statement (block). | ||
| 624 | * | ||
| 625 | * Parameters: | ||
| 626 | * | ||
| 627 | * assertion: | ||
| 628 | * The assertion expression. | ||
| 629 | * | ||
| 630 | * action: | ||
| 631 | * The statement or compound statement (block). | ||
| 632 | */ | ||
| 633 | #ifndef __Verify_Action | ||
| 634 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 635 | 	 #define __Verify_Action(assertion, action) \ | ||
| 636 | 		 if ( __builtin_expect(!(assertion), 0) ) { \ | ||
| 637 | 			action; \ | ||
| 638 | 		 } \ | ||
| 639 | 		 else do {} while (0) | ||
| 640 | 	#else | ||
| 641 | 	 #define __Verify_Action(assertion, action) \ | ||
| 642 | 		 if ( __builtin_expect(!(assertion), 0) ) { \ | ||
| 643 | 			 DEBUG_ASSERT_MESSAGE( \ | ||
| 644 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 645 | 					 #assertion, 0, 0, __FILE__, __LINE__, 0 ); \ | ||
| 646 | 			 action; \ | ||
| 647 | 		 } \ | ||
| 648 | 		 else do {} while (0) | ||
| 649 | 	#endif | ||
| 650 | #endif | ||
| 651 | |||
| 652 | /* | ||
| 653 | * __Require(assertion, exceptionLabel) | ||
| 654 | * | ||
| 655 | * Summary: | ||
| 656 | * Production builds: if the assertion expression evaluates to false, | ||
| 657 | * goto exceptionLabel. | ||
| 658 | * | ||
| 659 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 660 | * call DEBUG_ASSERT_MESSAGE and then goto exceptionLabel. | ||
| 661 | * | ||
| 662 | * Parameters: | ||
| 663 | * | ||
| 664 | * assertion: | ||
| 665 | * The assertion expression. | ||
| 666 | * | ||
| 667 | * exceptionLabel: | ||
| 668 | * The label. | ||
| 669 | */ | ||
| 670 | #ifndef __Require | ||
| 671 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 672 | 	 #define __Require(assertion, exceptionLabel) \ | ||
| 673 | 		 do \ | ||
| 674 | 		 { \ | ||
| 675 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 676 | 			 { \ | ||
| 677 | 				 goto exceptionLabel; \ | ||
| 678 | 			 } \ | ||
| 679 | 		 } while ( 0 ) | ||
| 680 | 	#else | ||
| 681 | 	 #define __Require(assertion, exceptionLabel) \ | ||
| 682 | 		 do \ | ||
| 683 | 		 { \ | ||
| 684 | 			 if ( __builtin_expect(!(assertion), 0) ) { \ | ||
| 685 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 686 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 687 | 					 #assertion, #exceptionLabel, 0, __FILE__, __LINE__, 0); \ | ||
| 688 | 				 goto exceptionLabel; \ | ||
| 689 | 			 } \ | ||
| 690 | 		 } while ( 0 ) | ||
| 691 | 	#endif | ||
| 692 | #endif | ||
| 693 | |||
| 694 | #ifndef __nRequire | ||
| 695 | 	#define __nRequire(assertion, exceptionLabel) __Require(!(assertion), exceptionLabel) | ||
| 696 | #endif | ||
| 697 | |||
| 698 | /* | ||
| 699 | * __Require_Action(assertion, exceptionLabel, action) | ||
| 700 | * | ||
| 701 | * Summary: | ||
| 702 | * Production builds: if the assertion expression evaluates to false, | ||
| 703 | * execute the action statement or compound statement (block) and then | ||
| 704 | * goto exceptionLabel. | ||
| 705 | * | ||
| 706 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 707 | * call DEBUG_ASSERT_MESSAGE, execute the action statement or compound | ||
| 708 | * statement (block), and then goto exceptionLabel. | ||
| 709 | * | ||
| 710 | * Parameters: | ||
| 711 | * | ||
| 712 | * assertion: | ||
| 713 | * The assertion expression. | ||
| 714 | * | ||
| 715 | * exceptionLabel: | ||
| 716 | * The label. | ||
| 717 | * | ||
| 718 | * action: | ||
| 719 | * The statement or compound statement (block). | ||
| 720 | */ | ||
| 721 | #ifndef __Require_Action | ||
| 722 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 723 | 	 #define __Require_Action(assertion, exceptionLabel, action) \ | ||
| 724 | 		 do \ | ||
| 725 | 		 { \ | ||
| 726 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 727 | 			 { \ | ||
| 728 | 				 { \ | ||
| 729 | 					 action; \ | ||
| 730 | 				 } \ | ||
| 731 | 				 goto exceptionLabel; \ | ||
| 732 | 			 } \ | ||
| 733 | 		 } while ( 0 ) | ||
| 734 | 	#else | ||
| 735 | 	 #define __Require_Action(assertion, exceptionLabel, action) \ | ||
| 736 | 		 do \ | ||
| 737 | 		 { \ | ||
| 738 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 739 | 			 { \ | ||
| 740 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 741 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 742 | 					 #assertion, #exceptionLabel, 0, __FILE__, __LINE__, 0); \ | ||
| 743 | 				 { \ | ||
| 744 | 					 action; \ | ||
| 745 | 				 } \ | ||
| 746 | 				 goto exceptionLabel; \ | ||
| 747 | 			 } \ | ||
| 748 | 		 } while ( 0 ) | ||
| 749 | 	#endif | ||
| 750 | #endif | ||
| 751 | |||
| 752 | #ifndef __nRequire_Action | ||
| 753 | 	#define __nRequire_Action(assertion, exceptionLabel, action) \ | ||
| 754 | 	__Require_Action(!(assertion), exceptionLabel, action) | ||
| 755 | #endif | ||
| 756 | |||
| 757 | /* | ||
| 758 | * __Require_Quiet(assertion, exceptionLabel) | ||
| 759 | * | ||
| 760 | * Summary: | ||
| 761 | * If the assertion expression evaluates to false, goto exceptionLabel. | ||
| 762 | * | ||
| 763 | * Parameters: | ||
| 764 | * | ||
| 765 | * assertion: | ||
| 766 | * The assertion expression. | ||
| 767 | * | ||
| 768 | * exceptionLabel: | ||
| 769 | * The label. | ||
| 770 | */ | ||
| 771 | #ifndef __Require_Quiet | ||
| 772 | 	#define __Require_Quiet(assertion, exceptionLabel) \ | ||
| 773 | 	 do \ | ||
| 774 | 	 { \ | ||
| 775 | 		 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 776 | 		 { \ | ||
| 777 | 			 goto exceptionLabel; \ | ||
| 778 | 		 } \ | ||
| 779 | 	 } while ( 0 ) | ||
| 780 | #endif | ||
| 781 | |||
| 782 | #ifndef __nRequire_Quiet | ||
| 783 | 	#define __nRequire_Quiet(assertion, exceptionLabel) __Require_Quiet(!(assertion), exceptionLabel) | ||
| 784 | #endif | ||
| 785 | |||
| 786 | /* | ||
| 787 | * __Require_Action_Quiet(assertion, exceptionLabel, action) | ||
| 788 | * | ||
| 789 | * Summary: | ||
| 790 | * If the assertion expression evaluates to false, execute the action | ||
| 791 | * statement or compound statement (block), and goto exceptionLabel. | ||
| 792 | * | ||
| 793 | * Parameters: | ||
| 794 | * | ||
| 795 | * assertion: | ||
| 796 | * The assertion expression. | ||
| 797 | * | ||
| 798 | * exceptionLabel: | ||
| 799 | * The label. | ||
| 800 | * | ||
| 801 | * action: | ||
| 802 | * The statement or compound statement (block). | ||
| 803 | */ | ||
| 804 | #ifndef __Require_Action_Quiet | ||
| 805 | 	#define __Require_Action_Quiet(assertion, exceptionLabel, action) \ | ||
| 806 | 	 do \ | ||
| 807 | 	 { \ | ||
| 808 | 		 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 809 | 		 { \ | ||
| 810 | 			 { \ | ||
| 811 | 				 action; \ | ||
| 812 | 			 } \ | ||
| 813 | 			 goto exceptionLabel; \ | ||
| 814 | 		 } \ | ||
| 815 | 	 } while ( 0 ) | ||
| 816 | #endif | ||
| 817 | |||
| 818 | #ifndef __nRequire_Action_Quiet | ||
| 819 | 	#define __nRequire_Action_Quiet(assertion, exceptionLabel, action) \ | ||
| 820 | 		__Require_Action_Quiet(!(assertion), exceptionLabel, action) | ||
| 821 | #endif | ||
| 822 | |||
| 823 | /* | ||
| 824 | * __Require_String(assertion, exceptionLabel, message) | ||
| 825 | * | ||
| 826 | * Summary: | ||
| 827 | * Production builds: if the assertion expression evaluates to false, | ||
| 828 | * goto exceptionLabel. | ||
| 829 | * | ||
| 830 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 831 | * call DEBUG_ASSERT_MESSAGE, and then goto exceptionLabel. | ||
| 832 | * | ||
| 833 | * Parameters: | ||
| 834 | * | ||
| 835 | * assertion: | ||
| 836 | * The assertion expression. | ||
| 837 | * | ||
| 838 | * exceptionLabel: | ||
| 839 | * The label. | ||
| 840 | * | ||
| 841 | * message: | ||
| 842 | * The C string to display. | ||
| 843 | */ | ||
| 844 | #ifndef __Require_String | ||
| 845 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 846 | 	 #define __Require_String(assertion, exceptionLabel, message) \ | ||
| 847 | 		 do \ | ||
| 848 | 		 { \ | ||
| 849 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 850 | 			 { \ | ||
| 851 | 				 goto exceptionLabel; \ | ||
| 852 | 			 } \ | ||
| 853 | 		 } while ( 0 ) | ||
| 854 | 	#else | ||
| 855 | 	 #define __Require_String(assertion, exceptionLabel, message) \ | ||
| 856 | 		 do \ | ||
| 857 | 		 { \ | ||
| 858 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 859 | 			 { \ | ||
| 860 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 861 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 862 | 					 #assertion, #exceptionLabel, message, __FILE__, __LINE__, 0); \ | ||
| 863 | 				 goto exceptionLabel; \ | ||
| 864 | 			 } \ | ||
| 865 | 		 } while ( 0 ) | ||
| 866 | 	#endif | ||
| 867 | #endif | ||
| 868 | |||
| 869 | #ifndef __nRequire_String | ||
| 870 | 	#define __nRequire_String(assertion, exceptionLabel, string) \ | ||
| 871 | 		__Require_String(!(assertion), exceptionLabel, string) | ||
| 872 | #endif | ||
| 873 | |||
| 874 | /* | ||
| 875 | * __Require_Action_String(assertion, exceptionLabel, action, message) | ||
| 876 | * | ||
| 877 | * Summary: | ||
| 878 | * Production builds: if the assertion expression evaluates to false, | ||
| 879 | * execute the action statement or compound statement (block), and then | ||
| 880 | * goto exceptionLabel. | ||
| 881 | * | ||
| 882 | * Non-production builds: if the assertion expression evaluates to false, | ||
| 883 | * call DEBUG_ASSERT_MESSAGE, execute the action statement or compound | ||
| 884 | * statement (block), and then goto exceptionLabel. | ||
| 885 | * | ||
| 886 | * Parameters: | ||
| 887 | * | ||
| 888 | * assertion: | ||
| 889 | * The assertion expression. | ||
| 890 | * | ||
| 891 | * exceptionLabel: | ||
| 892 | * The label. | ||
| 893 | * | ||
| 894 | * action: | ||
| 895 | * The statement or compound statement (block). | ||
| 896 | * | ||
| 897 | * message: | ||
| 898 | * The C string to display. | ||
| 899 | */ | ||
| 900 | #ifndef __Require_Action_String | ||
| 901 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 902 | 	 #define __Require_Action_String(assertion, exceptionLabel, action, message) \ | ||
| 903 | 		 do \ | ||
| 904 | 		 { \ | ||
| 905 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 906 | 			 { \ | ||
| 907 | 				 { \ | ||
| 908 | 					 action; \ | ||
| 909 | 				 } \ | ||
| 910 | 				 goto exceptionLabel; \ | ||
| 911 | 			 } \ | ||
| 912 | 		 } while ( 0 ) | ||
| 913 | 	#else | ||
| 914 | 	 #define __Require_Action_String(assertion, exceptionLabel, action, message) \ | ||
| 915 | 		 do \ | ||
| 916 | 		 { \ | ||
| 917 | 			 if ( __builtin_expect(!(assertion), 0) ) \ | ||
| 918 | 			 { \ | ||
| 919 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 920 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 921 | 					 #assertion, #exceptionLabel, message, __FILE__, __LINE__, 0); \ | ||
| 922 | 				 { \ | ||
| 923 | 					 action; \ | ||
| 924 | 				 } \ | ||
| 925 | 				 goto exceptionLabel; \ | ||
| 926 | 			 } \ | ||
| 927 | 		 } while ( 0 ) | ||
| 928 | 	#endif | ||
| 929 | #endif | ||
| 930 | |||
| 931 | #ifndef __nRequire_Action_String | ||
| 932 | 	#define __nRequire_Action_String(assertion, exceptionLabel, action, message) \ | ||
| 933 | 		__Require_Action_String(!(assertion), exceptionLabel, action, message) | ||
| 934 | #endif | ||
| 935 | |||
| 936 | /* | ||
| 937 | * __Require_noErr(errorCode, exceptionLabel) | ||
| 938 | * | ||
| 939 | * Summary: | ||
| 940 | * Production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 941 | * goto exceptionLabel. | ||
| 942 | * | ||
| 943 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 944 | * call DEBUG_ASSERT_MESSAGE and then goto exceptionLabel. | ||
| 945 | * | ||
| 946 | * Parameters: | ||
| 947 | * | ||
| 948 | * errorCode: | ||
| 949 | * The expression to compare to 0. | ||
| 950 | * | ||
| 951 | * exceptionLabel: | ||
| 952 | * The label. | ||
| 953 | */ | ||
| 954 | #ifndef __Require_noErr | ||
| 955 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 956 | 	 #define __Require_noErr(errorCode, exceptionLabel) \ | ||
| 957 | 		 do \ | ||
| 958 | 		 { \ | ||
| 959 | 			 if ( __builtin_expect(0 != (errorCode), 0) ) \ | ||
| 960 | 			 { \ | ||
| 961 | 				 goto exceptionLabel; \ | ||
| 962 | 			 } \ | ||
| 963 | 		 } while ( 0 ) | ||
| 964 | 	#else | ||
| 965 | 	 #define __Require_noErr(errorCode, exceptionLabel) \ | ||
| 966 | 		 do \ | ||
| 967 | 		 { \ | ||
| 968 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 969 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 970 | 			 { \ | ||
| 971 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 972 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 973 | 					 #errorCode " == 0 ", #exceptionLabel, 0, __FILE__, __LINE__, evalOnceErrorCode); \ | ||
| 974 | 				 goto exceptionLabel; \ | ||
| 975 | 			 } \ | ||
| 976 | 		 } while ( 0 ) | ||
| 977 | 	#endif | ||
| 978 | #endif | ||
| 979 | |||
| 980 | /* | ||
| 981 | * __Require_noErr_Action(errorCode, exceptionLabel, action) | ||
| 982 | * | ||
| 983 | * Summary: | ||
| 984 | * Production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 985 | * execute the action statement or compound statement (block) and | ||
| 986 | * goto exceptionLabel. | ||
| 987 | * | ||
| 988 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 989 | * call DEBUG_ASSERT_MESSAGE, execute the action statement or | ||
| 990 | * compound statement (block), and then goto exceptionLabel. | ||
| 991 | * | ||
| 992 | * Parameters: | ||
| 993 | * | ||
| 994 | * errorCode: | ||
| 995 | * The expression to compare to 0. | ||
| 996 | * | ||
| 997 | * exceptionLabel: | ||
| 998 | * The label. | ||
| 999 | * | ||
| 1000 | * action: | ||
| 1001 | * The statement or compound statement (block). | ||
| 1002 | */ | ||
| 1003 | #ifndef __Require_noErr_Action | ||
| 1004 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 1005 | 	 #define __Require_noErr_Action(errorCode, exceptionLabel, action) \ | ||
| 1006 | 		 do \ | ||
| 1007 | 		 { \ | ||
| 1008 | 			 if ( __builtin_expect(0 != (errorCode), 0) ) \ | ||
| 1009 | 			 { \ | ||
| 1010 | 				 { \ | ||
| 1011 | 					 action; \ | ||
| 1012 | 				 } \ | ||
| 1013 | 				 goto exceptionLabel; \ | ||
| 1014 | 			 } \ | ||
| 1015 | 		 } while ( 0 ) | ||
| 1016 | 	#else | ||
| 1017 | 	 #define __Require_noErr_Action(errorCode, exceptionLabel, action) \ | ||
| 1018 | 		 do \ | ||
| 1019 | 		 { \ | ||
| 1020 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 1021 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 1022 | 			 { \ | ||
| 1023 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 1024 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 1025 | 					 #errorCode " == 0 ", #exceptionLabel, 0, __FILE__, __LINE__, evalOnceErrorCode); \ | ||
| 1026 | 				 { \ | ||
| 1027 | 					 action; \ | ||
| 1028 | 				 } \ | ||
| 1029 | 				 goto exceptionLabel; \ | ||
| 1030 | 			 } \ | ||
| 1031 | 		 } while ( 0 ) | ||
| 1032 | 	#endif | ||
| 1033 | #endif | ||
| 1034 | |||
| 1035 | /* | ||
| 1036 | * __Require_noErr_Quiet(errorCode, exceptionLabel) | ||
| 1037 | * | ||
| 1038 | * Summary: | ||
| 1039 | * If the errorCode expression does not equal 0 (noErr), | ||
| 1040 | * goto exceptionLabel. | ||
| 1041 | * | ||
| 1042 | * Parameters: | ||
| 1043 | * | ||
| 1044 | * errorCode: | ||
| 1045 | * The expression to compare to 0. | ||
| 1046 | * | ||
| 1047 | * exceptionLabel: | ||
| 1048 | * The label. | ||
| 1049 | */ | ||
| 1050 | #ifndef __Require_noErr_Quiet | ||
| 1051 | 	#define __Require_noErr_Quiet(errorCode, exceptionLabel) \ | ||
| 1052 | 	 do \ | ||
| 1053 | 	 { \ | ||
| 1054 | 		 if ( __builtin_expect(0 != (errorCode), 0) ) \ | ||
| 1055 | 		 { \ | ||
| 1056 | 			 goto exceptionLabel; \ | ||
| 1057 | 		 } \ | ||
| 1058 | 	 } while ( 0 ) | ||
| 1059 | #endif | ||
| 1060 | |||
| 1061 | /* | ||
| 1062 | * __Require_noErr_Action_Quiet(errorCode, exceptionLabel, action) | ||
| 1063 | * | ||
| 1064 | * Summary: | ||
| 1065 | * If the errorCode expression does not equal 0 (noErr), | ||
| 1066 | * execute the action statement or compound statement (block) and | ||
| 1067 | * goto exceptionLabel. | ||
| 1068 | * | ||
| 1069 | * Parameters: | ||
| 1070 | * | ||
| 1071 | * errorCode: | ||
| 1072 | * The expression to compare to 0. | ||
| 1073 | * | ||
| 1074 | * exceptionLabel: | ||
| 1075 | * The label. | ||
| 1076 | * | ||
| 1077 | * action: | ||
| 1078 | * The statement or compound statement (block). | ||
| 1079 | */ | ||
| 1080 | #ifndef __Require_noErr_Action_Quiet | ||
| 1081 | 	#define __Require_noErr_Action_Quiet(errorCode, exceptionLabel, action) \ | ||
| 1082 | 	 do \ | ||
| 1083 | 	 { \ | ||
| 1084 | 		 if ( __builtin_expect(0 != (errorCode), 0) ) \ | ||
| 1085 | 		 { \ | ||
| 1086 | 			 { \ | ||
| 1087 | 				 action; \ | ||
| 1088 | 			 } \ | ||
| 1089 | 			 goto exceptionLabel; \ | ||
| 1090 | 		 } \ | ||
| 1091 | 	 } while ( 0 ) | ||
| 1092 | #endif | ||
| 1093 | |||
| 1094 | /* | ||
| 1095 | * __Require_noErr_String(errorCode, exceptionLabel, message) | ||
| 1096 | * | ||
| 1097 | * Summary: | ||
| 1098 | * Production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 1099 | * goto exceptionLabel. | ||
| 1100 | * | ||
| 1101 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 1102 | * call DEBUG_ASSERT_MESSAGE, and then goto exceptionLabel. | ||
| 1103 | * | ||
| 1104 | * Parameters: | ||
| 1105 | * | ||
| 1106 | * errorCode: | ||
| 1107 | * The expression to compare to 0. | ||
| 1108 | * | ||
| 1109 | * exceptionLabel: | ||
| 1110 | * The label. | ||
| 1111 | * | ||
| 1112 | * message: | ||
| 1113 | * The C string to display. | ||
| 1114 | */ | ||
| 1115 | #ifndef __Require_noErr_String | ||
| 1116 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 1117 | 	 #define __Require_noErr_String(errorCode, exceptionLabel, message) \ | ||
| 1118 | 		 do \ | ||
| 1119 | 		 { \ | ||
| 1120 | 			 if ( __builtin_expect(0 != (errorCode), 0) ) \ | ||
| 1121 | 			 { \ | ||
| 1122 | 				 goto exceptionLabel; \ | ||
| 1123 | 			 } \ | ||
| 1124 | 		 } while ( 0 ) | ||
| 1125 | 	#else | ||
| 1126 | 	 #define __Require_noErr_String(errorCode, exceptionLabel, message) \ | ||
| 1127 | 		 do \ | ||
| 1128 | 		 { \ | ||
| 1129 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 1130 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 1131 | 			 { \ | ||
| 1132 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 1133 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 1134 | 					 #errorCode " == 0 ", #exceptionLabel, message, __FILE__, __LINE__, evalOnceErrorCode); \ | ||
| 1135 | 				 goto exceptionLabel; \ | ||
| 1136 | 			 } \ | ||
| 1137 | 		 } while ( 0 ) | ||
| 1138 | 	#endif | ||
| 1139 | #endif | ||
| 1140 | |||
| 1141 | /* | ||
| 1142 | * __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) | ||
| 1143 | * | ||
| 1144 | * Summary: | ||
| 1145 | * Production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 1146 | * execute the action statement or compound statement (block) and | ||
| 1147 | * goto exceptionLabel. | ||
| 1148 | * | ||
| 1149 | * Non-production builds: if the errorCode expression does not equal 0 (noErr), | ||
| 1150 | * call DEBUG_ASSERT_MESSAGE, execute the action statement or compound | ||
| 1151 | * statement (block), and then goto exceptionLabel. | ||
| 1152 | * | ||
| 1153 | * Parameters: | ||
| 1154 | * | ||
| 1155 | * errorCode: | ||
| 1156 | * The expression to compare to 0. | ||
| 1157 | * | ||
| 1158 | * exceptionLabel: | ||
| 1159 | * The label. | ||
| 1160 | * | ||
| 1161 | * action: | ||
| 1162 | * The statement or compound statement (block). | ||
| 1163 | * | ||
| 1164 | * message: | ||
| 1165 | * The C string to display. | ||
| 1166 | */ | ||
| 1167 | #ifndef __Require_noErr_Action_String | ||
| 1168 | 	#if DEBUG_ASSERT_PRODUCTION_CODE | ||
| 1169 | 	 #define __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) \ | ||
| 1170 | 		 do \ | ||
| 1171 | 		 { \ | ||
| 1172 | 			 if ( __builtin_expect(0 != (errorCode), 0) ) \ | ||
| 1173 | 			 { \ | ||
| 1174 | 				 { \ | ||
| 1175 | 					 action; \ | ||
| 1176 | 				 } \ | ||
| 1177 | 				 goto exceptionLabel; \ | ||
| 1178 | 			 } \ | ||
| 1179 | 		 } while ( 0 ) | ||
| 1180 | 	#else | ||
| 1181 | 	 #define __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) \ | ||
| 1182 | 		 do \ | ||
| 1183 | 		 { \ | ||
| 1184 | 			 long evalOnceErrorCode = (errorCode); \ | ||
| 1185 | 			 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \ | ||
| 1186 | 			 { \ | ||
| 1187 | 				 DEBUG_ASSERT_MESSAGE( \ | ||
| 1188 | 					 DEBUG_ASSERT_COMPONENT_NAME_STRING, \ | ||
| 1189 | 					 #errorCode " == 0 ", #exceptionLabel, message, __FILE__, __LINE__, evalOnceErrorCode); \ | ||
| 1190 | 				 { \ | ||
| 1191 | 					 action; \ | ||
| 1192 | 				 } \ | ||
| 1193 | 				 goto exceptionLabel; \ | ||
| 1194 | 			 } \ | ||
| 1195 | 		 } while ( 0 ) | ||
| 1196 | 	#endif | ||
| 1197 | #endif | ||
| 1198 | |||
| 1199 | /* | ||
| 1200 | * __Check_Compile_Time(expr) | ||
| 1201 | * | ||
| 1202 | * Summary: | ||
| 1203 | * any build: if the expression is not true, generated a compile time error. | ||
| 1204 | * | ||
| 1205 | * Parameters: | ||
| 1206 | * | ||
| 1207 | * expr: | ||
| 1208 | * The compile time expression that should evaluate to non-zero. | ||
| 1209 | * | ||
| 1210 | * Discussion: | ||
| 1211 | * This declares an array with a size that is determined by a compile-time expression. | ||
| 1212 | * If false, it declares a negatively sized array, which generates a compile-time error. | ||
| 1213 | * | ||
| 1214 | * Examples: | ||
| 1215 | * __Check_Compile_Time( sizeof( int ) == 4 ); | ||
| 1216 | * __Check_Compile_Time( offsetof( MyStruct, myField ) == 4 ); | ||
| 1217 | * __Check_Compile_Time( ( kMyBufferSize % 512 ) == 0 ); | ||
| 1218 | * | ||
| 1219 | * Note: This only works with compile-time expressions. | ||
| 1220 | * Note: This only works in places where extern declarations are allowed (e.g. global scope). | ||
| 1221 | */ | ||
| 1222 | #ifndef __Check_Compile_Time | ||
| 1223 | #ifdef __GNUC__ | ||
| 1224 | #if (__cplusplus >= 201103L) | ||
| 1225 | #define __Check_Compile_Time( expr ) static_assert( expr , "__Check_Compile_Time") | ||
| 1226 | #elif (__STDC_VERSION__ >= 201112L) | ||
| 1227 | #define __Check_Compile_Time( expr ) _Static_assert( expr , "__Check_Compile_Time") | ||
| 1228 | #else | ||
| 1229 | #define __Check_Compile_Time( expr ) \ | ||
| 1230 | extern int compile_time_assert_failed[ ( expr ) ? 1 : -1 ] __attribute__( ( unused ) ) | ||
| 1231 | #endif | ||
| 1232 | #else | ||
| 1233 | #define __Check_Compile_Time( expr ) \ | ||
| 1234 | extern int compile_time_assert_failed[ ( expr ) ? 1 : -1 ] | ||
| 1235 | #endif | ||
| 1236 | #endif | ||
| 1237 | |||
| 1238 | /* | ||
| 1239 | *	For time immemorial, Mac OS X has defined version of most of these macros without the __ prefix, which | ||
| 1240 | *	could collide with similarly named functions or macros in user code, including new functionality in | ||
| 1241 | *	Boost and the C++ standard library. | ||
| 1242 | * | ||
| 1243 | * macOS High Sierra and iOS 11 will now require that clients move to the new macros as defined above. | ||
| 1244 | * | ||
| 1245 | * If you would like to enable the macros for use within your own project, you can define the | ||
| 1246 | * __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES macro via an Xcode Build Configuration. | ||
| 1247 | * See "Add a build configuration (xcconfig) file" in Xcode Help. | ||
| 1248 | * | ||
| 1249 | * To aid users of these macros in converting their sources, the following tops script will convert usages | ||
| 1250 | * of the old macros into the new equivalents. To do so, in Terminal go into the directory containing the | ||
| 1251 | * sources to be converted and run this command. | ||
| 1252 | * | ||
| 1253 | find -E . -regex '.*\.(c|cc|cp|cpp|m|mm|h)' -print0 | xargs -0 tops -verbose \ | ||
| 1254 | replace "check(<b args>)" with "__Check(<args>)" \ | ||
| 1255 | replace "check_noerr(<b args>)" with "__Check_noErr(<args>)" \ | ||
| 1256 | replace "check_noerr_string(<b args>)" with "__Check_noErr_String(<args>)" \ | ||
| 1257 | replace "check_string(<b args>)" with "__Check_String(<args>)" \ | ||
| 1258 | replace "require(<b args>)" with "__Require(<args>)" \ | ||
| 1259 | replace "require_action(<b args>)" with "__Require_Action(<args>)" \ | ||
| 1260 | replace "require_action_string(<b args>)" with "__Require_Action_String(<args>)" \ | ||
| 1261 | replace "require_noerr(<b args>)" with "__Require_noErr(<args>)" \ | ||
| 1262 | replace "require_noerr_action(<b args>)" with "__Require_noErr_Action(<args>)" \ | ||
| 1263 | replace "require_noerr_action_string(<b args>)" with "__Require_noErr_Action_String(<args>)" \ | ||
| 1264 | replace "require_noerr_string(<b args>)" with "__Require_noErr_String(<args>)" \ | ||
| 1265 | replace "require_string(<b args>)" with "__Require_String(<args>)" \ | ||
| 1266 | replace "verify(<b args>)" with "__Verify(<args>)" \ | ||
| 1267 | replace "verify_action(<b args>)" with "__Verify_Action(<args>)" \ | ||
| 1268 | replace "verify_noerr(<b args>)" with "__Verify_noErr(<args>)" \ | ||
| 1269 | replace "verify_noerr_action(<b args>)" with "__Verify_noErr_Action(<args>)" \ | ||
| 1270 | replace "verify_noerr_string(<b args>)" with "__Verify_noErr_String(<args>)" \ | ||
| 1271 | replace "verify_string(<b args>)" with "__Verify_String(<args>)" \ | ||
| 1272 | replace "ncheck(<b args>)" with "__nCheck(<args>)" \ | ||
| 1273 | replace "ncheck_string(<b args>)" with "__nCheck_String(<args>)" \ | ||
| 1274 | replace "nrequire(<b args>)" with "__nRequire(<args>)" \ | ||
| 1275 | replace "nrequire_action(<b args>)" with "__nRequire_Action(<args>)" \ | ||
| 1276 | replace "nrequire_action_quiet(<b args>)" with "__nRequire_Action_Quiet(<args>)" \ | ||
| 1277 | replace "nrequire_action_string(<b args>)" with "__nRequire_Action_String(<args>)" \ | ||
| 1278 | replace "nrequire_quiet(<b args>)" with "__nRequire_Quiet(<args>)" \ | ||
| 1279 | replace "nrequire_string(<b args>)" with "__nRequire_String(<args>)" \ | ||
| 1280 | replace "nverify(<b args>)" with "__nVerify(<args>)" \ | ||
| 1281 | replace "nverify_string(<b args>)" with "__nVerify_String(<args>)" \ | ||
| 1282 | replace "require_action_quiet(<b args>)" with "__Require_Action_Quiet(<args>)" \ | ||
| 1283 | replace "require_noerr_action_quiet(<b args>)" with "__Require_noErr_Action_Quiet(<args>)" \ | ||
| 1284 | replace "require_noerr_quiet(<b args>)" with "__Require_noErr_Quiet(<args>)" \ | ||
| 1285 | replace "require_quiet(<b args>)" with "__Require_Quiet(<args>)" \ | ||
| 1286 | replace "check_compile_time(<b args>)" with "__Check_Compile_Time(<args>)" \ | ||
| 1287 | replace "debug_string(<b args>)" with "__Debug_String(<args>)" | ||
| 1288 | * | ||
| 1289 | */ | ||
| 1290 | |||
| 1291 | #ifndef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES | ||
| 1292 | #if __has_include(<AssertMacrosInternal.h>) | ||
| 1293 | #include <AssertMacrosInternal.h> | ||
| 1294 | #else | ||
| 1295 | /* In macOS High Sierra and iOS 11, if we haven't set this yet, it now defaults to off. */ | ||
| 1296 | #define	__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES	0 | ||
| 1297 | #endif | ||
| 1298 | #endif | ||
| 1299 | |||
| 1300 | #if	__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES | ||
| 1301 | |||
| 1302 | 	#ifndef check | ||
| 1303 | 	#define check(assertion) __Check(assertion) | ||
| 1304 | 	#endif | ||
| 1305 | |||
| 1306 | 	#ifndef check_noerr | ||
| 1307 | 	#define check_noerr(errorCode) __Check_noErr(errorCode) | ||
| 1308 | 	#endif | ||
| 1309 | |||
| 1310 | 	#ifndef check_noerr_string | ||
| 1311 | 		#define check_noerr_string(errorCode, message) __Check_noErr_String(errorCode, message) | ||
| 1312 | 	#endif | ||
| 1313 | |||
| 1314 | 	#ifndef check_string | ||
| 1315 | 		#define check_string(assertion, message) __Check_String(assertion, message) | ||
| 1316 | 	#endif | ||
| 1317 | |||
| 1318 | 	#ifndef require | ||
| 1319 | 		#define require(assertion, exceptionLabel) __Require(assertion, exceptionLabel) | ||
| 1320 | 	#endif | ||
| 1321 | |||
| 1322 | 	#ifndef require_action | ||
| 1323 | 		#define require_action(assertion, exceptionLabel, action) __Require_Action(assertion, exceptionLabel, action) | ||
| 1324 | 	#endif | ||
| 1325 | |||
| 1326 | 	#ifndef require_action_string | ||
| 1327 | 		#define require_action_string(assertion, exceptionLabel, action, message) __Require_Action_String(assertion, exceptionLabel, action, message) | ||
| 1328 | 	#endif | ||
| 1329 | |||
| 1330 | 	#ifndef require_noerr | ||
| 1331 | 		#define require_noerr(errorCode, exceptionLabel) __Require_noErr(errorCode, exceptionLabel) | ||
| 1332 | 	#endif | ||
| 1333 | |||
| 1334 | 	#ifndef require_noerr_action | ||
| 1335 | 		#define require_noerr_action(errorCode, exceptionLabel, action) __Require_noErr_Action(errorCode, exceptionLabel, action) | ||
| 1336 | 	#endif | ||
| 1337 | |||
| 1338 | 	#ifndef require_noerr_action_string | ||
| 1339 | 		#define require_noerr_action_string(errorCode, exceptionLabel, action, message) __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) | ||
| 1340 | 	#endif | ||
| 1341 | |||
| 1342 | 	#ifndef require_noerr_string | ||
| 1343 | 		#define require_noerr_string(errorCode, exceptionLabel, message) __Require_noErr_String(errorCode, exceptionLabel, message) | ||
| 1344 | 	#endif | ||
| 1345 | |||
| 1346 | 	#ifndef require_string | ||
| 1347 | 		#define require_string(assertion, exceptionLabel, message) __Require_String(assertion, exceptionLabel, message) | ||
| 1348 | 	#endif | ||
| 1349 | |||
| 1350 | 	#ifndef verify | ||
| 1351 | 		#define verify(assertion) __Verify(assertion) | ||
| 1352 | 	#endif | ||
| 1353 | |||
| 1354 | 	#ifndef verify_action | ||
| 1355 | 		#define verify_action(assertion, action) __Verify_Action(assertion, action) | ||
| 1356 | 	#endif | ||
| 1357 | |||
| 1358 | 	#ifndef verify_noerr | ||
| 1359 | 		#define verify_noerr(errorCode) __Verify_noErr(errorCode) | ||
| 1360 | 	#endif | ||
| 1361 | |||
| 1362 | 	#ifndef verify_noerr_action | ||
| 1363 | 		#define verify_noerr_action(errorCode, action) __Verify_noErr_Action(errorCode, action) | ||
| 1364 | 	#endif | ||
| 1365 | |||
| 1366 | 	#ifndef verify_noerr_string | ||
| 1367 | 		#define verify_noerr_string(errorCode, message) __Verify_noErr_String(errorCode, message) | ||
| 1368 | 	#endif | ||
| 1369 | |||
| 1370 | 	#ifndef verify_string | ||
| 1371 | 		#define verify_string(assertion, message) __Verify_String(assertion, message) | ||
| 1372 | 	#endif | ||
| 1373 | |||
| 1374 | 	#ifndef ncheck | ||
| 1375 | 		#define ncheck(assertion) __nCheck(assertion) | ||
| 1376 | 	#endif | ||
| 1377 | |||
| 1378 | 	#ifndef ncheck_string | ||
| 1379 | 		#define ncheck_string(assertion, message) __nCheck_String(assertion, message) | ||
| 1380 | 	#endif | ||
| 1381 | |||
| 1382 | 	#ifndef nrequire | ||
| 1383 | 		#define nrequire(assertion, exceptionLabel) __nRequire(assertion, exceptionLabel) | ||
| 1384 | 	#endif | ||
| 1385 | |||
| 1386 | 	#ifndef nrequire_action | ||
| 1387 | 		#define nrequire_action(assertion, exceptionLabel, action) __nRequire_Action(assertion, exceptionLabel, action) | ||
| 1388 | 	#endif | ||
| 1389 | |||
| 1390 | 	#ifndef nrequire_action_quiet | ||
| 1391 | 		#define nrequire_action_quiet(assertion, exceptionLabel, action) __nRequire_Action_Quiet(assertion, exceptionLabel, action) | ||
| 1392 | 	#endif | ||
| 1393 | |||
| 1394 | 	#ifndef nrequire_action_string | ||
| 1395 | 		#define nrequire_action_string(assertion, exceptionLabel, action, message) __nRequire_Action_String(assertion, exceptionLabel, action, message) | ||
| 1396 | 	#endif | ||
| 1397 | |||
| 1398 | 	#ifndef nrequire_quiet | ||
| 1399 | 		#define nrequire_quiet(assertion, exceptionLabel) __nRequire_Quiet(assertion, exceptionLabel) | ||
| 1400 | 	#endif | ||
| 1401 | |||
| 1402 | 	#ifndef nrequire_string | ||
| 1403 | 		#define nrequire_string(assertion, exceptionLabel, string) __nRequire_String(assertion, exceptionLabel, string) | ||
| 1404 | 	#endif | ||
| 1405 | |||
| 1406 | 	#ifndef nverify | ||
| 1407 | 		#define nverify(assertion) __nVerify(assertion) | ||
| 1408 | 	#endif | ||
| 1409 | |||
| 1410 | 	#ifndef nverify_string | ||
| 1411 | 		#define nverify_string(assertion, message) __nVerify_String(assertion, message) | ||
| 1412 | 	#endif | ||
| 1413 | |||
| 1414 | 	#ifndef require_action_quiet | ||
| 1415 | 		#define require_action_quiet(assertion, exceptionLabel, action) __Require_Action_Quiet(assertion, exceptionLabel, action) | ||
| 1416 | 	#endif | ||
| 1417 | |||
| 1418 | 	#ifndef require_noerr_action_quiet | ||
| 1419 | 		#define require_noerr_action_quiet(errorCode, exceptionLabel, action) __Require_noErr_Action_Quiet(errorCode, exceptionLabel, action) | ||
| 1420 | 	#endif | ||
| 1421 | |||
| 1422 | 	#ifndef require_noerr_quiet | ||
| 1423 | 		#define require_noerr_quiet(errorCode, exceptionLabel) __Require_noErr_Quiet(errorCode, exceptionLabel) | ||
| 1424 | 	#endif | ||
| 1425 | |||
| 1426 | 	#ifndef require_quiet | ||
| 1427 | 		#define require_quiet(assertion, exceptionLabel) __Require_Quiet(assertion, exceptionLabel) | ||
| 1428 | 	#endif | ||
| 1429 | |||
| 1430 | 	#ifndef check_compile_time | ||
| 1431 | 		#define check_compile_time( expr ) __Check_Compile_Time( expr ) | ||
| 1432 | 	#endif | ||
| 1433 | |||
| 1434 | 	#ifndef debug_string | ||
| 1435 | 		#define debug_string(message) __Debug_String(message) | ||
| 1436 | 	#endif | ||
| 1437 | 	 | ||
| 1438 | #endif	/* ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES */ | ||
| 1439 | |||
| 1440 | |||
| 1441 | #endif /* __ASSERTMACROS__ */ | ||
lib/libc/include/x86_64-macos-gnu/Availability.h+1-124| ... | @@ -132,130 +132,7 @@ | ... | @@ -132,130 +132,7 @@ |
| 132 | #define __API_TO_BE_DEPRECATED 100000 | 132 | #define __API_TO_BE_DEPRECATED 100000 |
| 133 | #endif | 133 | #endif |
| 134 | 134 | ||
| 135 | #ifndef __MAC_10_0 | 135 | #include <AvailabilityVersions.h> |
| 136 | #define __MAC_10_0 1000 | ||
| 137 | #define __MAC_10_1 1010 | ||
| 138 | #define __MAC_10_2 1020 | ||
| 139 | #define __MAC_10_3 1030 | ||
| 140 | #define __MAC_10_4 1040 | ||
| 141 | #define __MAC_10_5 1050 | ||
| 142 | #define __MAC_10_6 1060 | ||
| 143 | #define __MAC_10_7 1070 | ||
| 144 | #define __MAC_10_8 1080 | ||
| 145 | #define __MAC_10_9 1090 | ||
| 146 | #define __MAC_10_10 101000 | ||
| 147 | #define __MAC_10_10_2 101002 | ||
| 148 | #define __MAC_10_10_3 101003 | ||
| 149 | #define __MAC_10_11 101100 | ||
| 150 | #define __MAC_10_11_2 101102 | ||
| 151 | #define __MAC_10_11_3 101103 | ||
| 152 | #define __MAC_10_11_4 101104 | ||
| 153 | #define __MAC_10_12 101200 | ||
| 154 | #define __MAC_10_12_1 101201 | ||
| 155 | #define __MAC_10_12_2 101202 | ||
| 156 | #define __MAC_10_12_4 101204 | ||
| 157 | #define __MAC_10_13 101300 | ||
| 158 | #define __MAC_10_13_1 101301 | ||
| 159 | #define __MAC_10_13_2 101302 | ||
| 160 | #define __MAC_10_13_4 101304 | ||
| 161 | #define __MAC_10_14 101400 | ||
| 162 | #define __MAC_10_14_1 101401 | ||
| 163 | #define __MAC_10_14_4 101404 | ||
| 164 | #define __MAC_10_15 101500 | ||
| 165 | #define __MAC_10_15_1 101501 | ||
| 166 | #define __MAC_10_15_4 101504 | ||
| 167 | /* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */ | ||
| 168 | |||
| 169 | #define __IPHONE_2_0 20000 | ||
| 170 | #define __IPHONE_2_1 20100 | ||
| 171 | #define __IPHONE_2_2 20200 | ||
| 172 | #define __IPHONE_3_0 30000 | ||
| 173 | #define __IPHONE_3_1 30100 | ||
| 174 | #define __IPHONE_3_2 30200 | ||
| 175 | #define __IPHONE_4_0 40000 | ||
| 176 | #define __IPHONE_4_1 40100 | ||
| 177 | #define __IPHONE_4_2 40200 | ||
| 178 | #define __IPHONE_4_3 40300 | ||
| 179 | #define __IPHONE_5_0 50000 | ||
| 180 | #define __IPHONE_5_1 50100 | ||
| 181 | #define __IPHONE_6_0 60000 | ||
| 182 | #define __IPHONE_6_1 60100 | ||
| 183 | #define __IPHONE_7_0 70000 | ||
| 184 | #define __IPHONE_7_1 70100 | ||
| 185 | #define __IPHONE_8_0 80000 | ||
| 186 | #define __IPHONE_8_1 80100 | ||
| 187 | #define __IPHONE_8_2 80200 | ||
| 188 | #define __IPHONE_8_3 80300 | ||
| 189 | #define __IPHONE_8_4 80400 | ||
| 190 | #define __IPHONE_9_0 90000 | ||
| 191 | #define __IPHONE_9_1 90100 | ||
| 192 | #define __IPHONE_9_2 90200 | ||
| 193 | #define __IPHONE_9_3 90300 | ||
| 194 | #define __IPHONE_10_0 100000 | ||
| 195 | #define __IPHONE_10_1 100100 | ||
| 196 | #define __IPHONE_10_2 100200 | ||
| 197 | #define __IPHONE_10_3 100300 | ||
| 198 | #define __IPHONE_11_0 110000 | ||
| 199 | #define __IPHONE_11_1 110100 | ||
| 200 | #define __IPHONE_11_2 110200 | ||
| 201 | #define __IPHONE_11_3 110300 | ||
| 202 | #define __IPHONE_11_4 110400 | ||
| 203 | #define __IPHONE_12_0 120000 | ||
| 204 | #define __IPHONE_12_1 120100 | ||
| 205 | #define __IPHONE_12_2 120200 | ||
| 206 | #define __IPHONE_12_3 120300 | ||
| 207 | #define __IPHONE_13_0 130000 | ||
| 208 | #define __IPHONE_13_1 130100 | ||
| 209 | #define __IPHONE_13_2 130200 | ||
| 210 | #define __IPHONE_13_3 130300 | ||
| 211 | #define __IPHONE_13_4 130400 | ||
| 212 | #define __IPHONE_13_5 130500 | ||
| 213 | #define __IPHONE_13_6 130600 | ||
| 214 | /* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */ | ||
| 215 | |||
| 216 | #define __TVOS_9_0 90000 | ||
| 217 | #define __TVOS_9_1 90100 | ||
| 218 | #define __TVOS_9_2 90200 | ||
| 219 | #define __TVOS_10_0 100000 | ||
| 220 | #define __TVOS_10_0_1 100001 | ||
| 221 | #define __TVOS_10_1 100100 | ||
| 222 | #define __TVOS_10_2 100200 | ||
| 223 | #define __TVOS_11_0 110000 | ||
| 224 | #define __TVOS_11_1 110100 | ||
| 225 | #define __TVOS_11_2 110200 | ||
| 226 | #define __TVOS_11_3 110300 | ||
| 227 | #define __TVOS_11_4 110400 | ||
| 228 | #define __TVOS_12_0 120000 | ||
| 229 | #define __TVOS_12_1 120100 | ||
| 230 | #define __TVOS_12_2 120200 | ||
| 231 | #define __TVOS_12_3 120300 | ||
| 232 | #define __TVOS_13_0 130000 | ||
| 233 | #define __TVOS_13_2 130200 | ||
| 234 | #define __TVOS_13_3 130300 | ||
| 235 | #define __TVOS_13_4 130400 | ||
| 236 | |||
| 237 | #define __WATCHOS_1_0 10000 | ||
| 238 | #define __WATCHOS_2_0 20000 | ||
| 239 | #define __WATCHOS_2_1 20100 | ||
| 240 | #define __WATCHOS_2_2 20200 | ||
| 241 | #define __WATCHOS_3_0 30000 | ||
| 242 | #define __WATCHOS_3_1 30100 | ||
| 243 | #define __WATCHOS_3_1_1 30101 | ||
| 244 | #define __WATCHOS_3_2 30200 | ||
| 245 | #define __WATCHOS_4_0 40000 | ||
| 246 | #define __WATCHOS_4_1 40100 | ||
| 247 | #define __WATCHOS_4_2 40200 | ||
| 248 | #define __WATCHOS_4_3 40300 | ||
| 249 | #define __WATCHOS_5_0 50000 | ||
| 250 | #define __WATCHOS_5_1 50100 | ||
| 251 | #define __WATCHOS_5_2 50200 | ||
| 252 | #define __WATCHOS_6_0 60000 | ||
| 253 | #define __WATCHOS_6_1 60100 | ||
| 254 | #define __WATCHOS_6_2 60200 | ||
| 255 | |||
| 256 | #define __DRIVERKIT_19_0 190000 | ||
| 257 | #endif /* __MAC_10_0 */ | ||
| 258 | |||
| 259 | #include <AvailabilityInternal.h> | 136 | #include <AvailabilityInternal.h> |
| 260 | 137 | ||
| 261 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED | 138 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED |
lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h+9-6| ... | @@ -45,6 +45,9 @@ | ... | @@ -45,6 +45,9 @@ |
| 45 | #ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ | 45 | #ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ |
| 46 | /* compiler sets __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ when -miphoneos-version-min is used */ | 46 | /* compiler sets __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ when -miphoneos-version-min is used */ |
| 47 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ | 47 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ |
| 48 | /* set to 1 when RC_FALLBACK_PLATFORM=iphoneos */ | ||
| 49 | #elif 0 | ||
| 50 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_14_0 | ||
| 48 | #endif | 51 | #endif |
| 49 | #endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */ | 52 | #endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */ |
| 50 | 53 | ||
| ... | @@ -52,7 +55,7 @@ | ... | @@ -52,7 +55,7 @@ |
| 52 | #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ | 55 | #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ |
| 53 | /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */ | 56 | /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */ |
| 54 | #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ | 57 | #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ |
| 55 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_13_0 | 58 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_14_2 |
| 56 | /* for compatibility with existing code. New code should use platform specific checks */ | 59 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 57 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 | 60 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 |
| 58 | #endif | 61 | #endif |
| ... | @@ -62,7 +65,7 @@ | ... | @@ -62,7 +65,7 @@ |
| 62 | #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ | 65 | #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ |
| 63 | /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */ | 66 | /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */ |
| 64 | #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ | 67 | #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ |
| 65 | #define __WATCH_OS_VERSION_MAX_ALLOWED 60000 | 68 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_7_1 |
| 66 | /* for compatibility with existing code. New code should use platform specific checks */ | 69 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 67 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 | 70 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 |
| 68 | #endif | 71 | #endif |
| ... | @@ -72,7 +75,7 @@ | ... | @@ -72,7 +75,7 @@ |
| 72 | #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ | 75 | #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ |
| 73 | 76 | ||
| 74 | #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ | 77 | #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ |
| 75 | #define __BRIDGE_OS_VERSION_MAX_ALLOWED 20000 | 78 | #define __BRIDGE_OS_VERSION_MAX_ALLOWED 50000 |
| 76 | /* for compatibility with existing code. New code should use platform specific checks */ | 79 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 77 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000 | 80 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000 |
| 78 | #endif | 81 | #endif |
| ... | @@ -87,14 +90,14 @@ | ... | @@ -87,14 +90,14 @@ |
| 87 | #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED | 90 | #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED |
| 88 | /* make sure a default max version is set */ | 91 | /* make sure a default max version is set */ |
| 89 | #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED | 92 | #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED |
| 90 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_10_15 | 93 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_11_0 |
| 91 | #endif | 94 | #endif |
| 92 | #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */ | 95 | #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */ |
| 93 | 96 | ||
| 94 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED | 97 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED |
| 95 | /* make sure a default max version is set */ | 98 | /* make sure a default max version is set */ |
| 96 | #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED | 99 | #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED |
| 97 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_13_0 | 100 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_14_2 |
| 98 | #endif | 101 | #endif |
| 99 | /* make sure a valid min is set */ | 102 | /* make sure a valid min is set */ |
| 100 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0 | 103 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0 |
| ... | @@ -2887,7 +2890,7 @@ | ... | @@ -2887,7 +2890,7 @@ |
| 2887 | #if __has_builtin(__is_target_environment) | 2890 | #if __has_builtin(__is_target_environment) |
| 2888 | #if __has_builtin(__is_target_variant_os) | 2891 | #if __has_builtin(__is_target_variant_os) |
| 2889 | #if __has_builtin(__is_target_variant_environment) | 2892 | #if __has_builtin(__is_target_variant_environment) |
| 2890 | #if (__is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)) | 2893 | #if ((__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)) |
| 2891 | #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0))) | 2894 | #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0))) |
| 2892 | #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable))) | 2895 | #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable))) |
| 2893 | #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,unavailable))) | 2896 | #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,unavailable))) |
lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h created+4015| ... | @@ -0,0 +1,4015 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2001-2010 by Apple Inc.. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | File: AvailabilityMacros.h | ||
| 26 | |||
| 27 | More Info: See the SDK Compatibility Guide | ||
| 28 | |||
| 29 | Contains: Autoconfiguration of AVAILABLE_ macros for Mac OS X | ||
| 30 | |||
| 31 | This header enables a developer to specify build time | ||
| 32 | constraints on what Mac OS X versions the resulting | ||
| 33 | application will be run. There are two bounds a developer | ||
| 34 | can specify: | ||
| 35 | |||
| 36 | MAC_OS_X_VERSION_MIN_REQUIRED | ||
| 37 | MAC_OS_X_VERSION_MAX_ALLOWED | ||
| 38 | |||
| 39 | The lower bound controls which calls to OS functions will | ||
| 40 | be weak-importing (allowed to be unresolved at launch time). | ||
| 41 | The upper bound controls which OS functionality, if used, | ||
| 42 | will result in a compiler error because that functionality is | ||
| 43 | not available on any OS in the specifed range. | ||
| 44 | |||
| 45 | For example, suppose an application is compiled with: | ||
| 46 | |||
| 47 | MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_2 | ||
| 48 | MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_3 | ||
| 49 | |||
| 50 | and an OS header contains: | ||
| 51 | |||
| 52 | extern void funcA(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; | ||
| 53 | extern void funcB(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2; | ||
| 54 | extern void funcC(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3; | ||
| 55 | extern void funcD(void) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER; | ||
| 56 | extern void funcE(void) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; | ||
| 57 | extern void funcF(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; | ||
| 58 | extern void funcG(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; | ||
| 59 | |||
| 60 | typedef long TypeA DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER; | ||
| 61 | typedef long TypeB DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER; | ||
| 62 | typedef long TypeC DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER; | ||
| 63 | typedef long TypeD DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER; | ||
| 64 | typedef long TypeE DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER; | ||
| 65 | |||
| 66 | Any application code which uses these declarations will get the following: | ||
| 67 | |||
| 68 | compile link run | ||
| 69 | ------- ------ ------- | ||
| 70 | funcA: normal normal normal | ||
| 71 | funcB: warning normal normal | ||
| 72 | funcC: normal normal normal | ||
| 73 | funcD: normal normal normal | ||
| 74 | funcE: normal normal normal | ||
| 75 | funcF: normal weak on 10.3 normal, on 10.2 (&funcF == NULL) | ||
| 76 | funcG: error error n/a | ||
| 77 | typeA: warning | ||
| 78 | typeB: warning | ||
| 79 | typeC: warning | ||
| 80 | typeD: normal | ||
| 81 | typeE: normal | ||
| 82 | |||
| 83 | |||
| 84 | */ | ||
| 85 | #ifndef __AVAILABILITYMACROS__ | ||
| 86 | #define __AVAILABILITYMACROS__ | ||
| 87 | |||
| 88 | /* | ||
| 89 | * Set up standard Mac OS X versions | ||
| 90 | */ | ||
| 91 | #define MAC_OS_X_VERSION_10_0 1000 | ||
| 92 | #define MAC_OS_X_VERSION_10_1 1010 | ||
| 93 | #define MAC_OS_X_VERSION_10_2 1020 | ||
| 94 | #define MAC_OS_X_VERSION_10_3 1030 | ||
| 95 | #define MAC_OS_X_VERSION_10_4 1040 | ||
| 96 | #define MAC_OS_X_VERSION_10_5 1050 | ||
| 97 | #define MAC_OS_X_VERSION_10_6 1060 | ||
| 98 | #define MAC_OS_X_VERSION_10_7 1070 | ||
| 99 | #define MAC_OS_X_VERSION_10_8 1080 | ||
| 100 | #define MAC_OS_X_VERSION_10_9 1090 | ||
| 101 | #define MAC_OS_X_VERSION_10_10 101000 | ||
| 102 | #define MAC_OS_X_VERSION_10_10_2 101002 | ||
| 103 | #define MAC_OS_X_VERSION_10_10_3 101003 | ||
| 104 | #define MAC_OS_X_VERSION_10_11 101100 | ||
| 105 | #define MAC_OS_X_VERSION_10_11_2 101102 | ||
| 106 | #define MAC_OS_X_VERSION_10_11_3 101103 | ||
| 107 | #define MAC_OS_X_VERSION_10_11_4 101104 | ||
| 108 | #define MAC_OS_X_VERSION_10_12 101200 | ||
| 109 | #define MAC_OS_X_VERSION_10_12_1 101201 | ||
| 110 | #define MAC_OS_X_VERSION_10_12_2 101202 | ||
| 111 | #define MAC_OS_X_VERSION_10_12_4 101204 | ||
| 112 | #define MAC_OS_X_VERSION_10_13 101300 | ||
| 113 | #define MAC_OS_X_VERSION_10_13_1 101301 | ||
| 114 | #define MAC_OS_X_VERSION_10_13_2 101302 | ||
| 115 | #define MAC_OS_X_VERSION_10_13_4 101304 | ||
| 116 | #define MAC_OS_X_VERSION_10_14 101400 | ||
| 117 | #define MAC_OS_X_VERSION_10_14_1 101401 | ||
| 118 | #define MAC_OS_X_VERSION_10_14_4 101404 | ||
| 119 | #define MAC_OS_X_VERSION_10_15 101500 | ||
| 120 | #define MAC_OS_VERSION_11_0 110000 | ||
| 121 | |||
| 122 | /* | ||
| 123 | * If min OS not specified, assume 10.4 for intel | ||
| 124 | * Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable | ||
| 125 | */ | ||
| 126 | #ifndef MAC_OS_X_VERSION_MIN_REQUIRED | ||
| 127 | #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ | ||
| 128 | #if (__i386__ || __x86_64__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < MAC_OS_X_VERSION_10_4) | ||
| 129 | #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid. | ||
| 130 | #endif | ||
| 131 | #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ | ||
| 132 | #else | ||
| 133 | #if __i386__ || __x86_64__ | ||
| 134 | #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 | ||
| 135 | #elif __arm__ || __arm64__ | ||
| 136 | #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5 | ||
| 137 | #else | ||
| 138 | #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1 | ||
| 139 | #endif | ||
| 140 | #endif | ||
| 141 | #endif | ||
| 142 | |||
| 143 | /* | ||
| 144 | * if max OS not specified, assume larger of (10.15, min) | ||
| 145 | */ | ||
| 146 | #ifndef MAC_OS_X_VERSION_MAX_ALLOWED | ||
| 147 | #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_11_0 | ||
| 148 | #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED | ||
| 149 | #else | ||
| 150 | #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_11_0 | ||
| 151 | #endif | ||
| 152 | #endif | ||
| 153 | |||
| 154 | /* | ||
| 155 | * Error on bad values | ||
| 156 | */ | ||
| 157 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED | ||
| 158 | #error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED | ||
| 159 | #endif | ||
| 160 | #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0 | ||
| 161 | #error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0 | ||
| 162 | #endif | ||
| 163 | |||
| 164 | /* | ||
| 165 | * only certain compilers support __attribute__((weak_import)) | ||
| 166 | */ | ||
| 167 | #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) | ||
| 168 | #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import)) | ||
| 169 | #elif defined(__MWERKS__) && (__MWERKS__ >= 0x3205) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) && !defined(__INTEL__) | ||
| 170 | #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import)) | ||
| 171 | #else | ||
| 172 | #define WEAK_IMPORT_ATTRIBUTE | ||
| 173 | #endif | ||
| 174 | |||
| 175 | /* | ||
| 176 | * only certain compilers support __attribute__((deprecated)) | ||
| 177 | */ | ||
| 178 | #if defined(__has_feature) && defined(__has_attribute) | ||
| 179 | #if __has_attribute(deprecated) | ||
| 180 | #define DEPRECATED_ATTRIBUTE __attribute__((deprecated)) | ||
| 181 | #if __has_feature(attribute_deprecated_with_message) | ||
| 182 | #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s))) | ||
| 183 | #else | ||
| 184 | #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated)) | ||
| 185 | #endif | ||
| 186 | #else | ||
| 187 | #define DEPRECATED_ATTRIBUTE | ||
| 188 | #define DEPRECATED_MSG_ATTRIBUTE(s) | ||
| 189 | #endif | ||
| 190 | #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) | ||
| 191 | #define DEPRECATED_ATTRIBUTE __attribute__((deprecated)) | ||
| 192 | #if (__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) | ||
| 193 | #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s))) | ||
| 194 | #else | ||
| 195 | #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated)) | ||
| 196 | #endif | ||
| 197 | #else | ||
| 198 | #define DEPRECATED_ATTRIBUTE | ||
| 199 | #define DEPRECATED_MSG_ATTRIBUTE(s) | ||
| 200 | #endif | ||
| 201 | |||
| 202 | /* | ||
| 203 | * only certain compilers support __attribute__((unavailable)) | ||
| 204 | */ | ||
| 205 | #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) | ||
| 206 | #define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable)) | ||
| 207 | #else | ||
| 208 | #define UNAVAILABLE_ATTRIBUTE | ||
| 209 | #endif | ||
| 210 | |||
| 211 | |||
| 212 | /* | ||
| 213 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 214 | * | ||
| 215 | * Used on functions introduced in Mac OS X 10.0 | ||
| 216 | */ | ||
| 217 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 218 | |||
| 219 | /* | ||
| 220 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED | ||
| 221 | * | ||
| 222 | * Used on functions introduced in Mac OS X 10.0, | ||
| 223 | * and deprecated in Mac OS X 10.0 | ||
| 224 | */ | ||
| 225 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 226 | |||
| 227 | /* | ||
| 228 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 229 | * | ||
| 230 | * Used on types deprecated in Mac OS X 10.0 | ||
| 231 | */ | ||
| 232 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 233 | |||
| 234 | #ifndef __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 235 | 	#ifdef __has_attribute | ||
| 236 | 		#if __has_attribute(availability) | ||
| 237 | 			#include <Availability.h> | ||
| 238 | 			#define __AVAILABILITY_MACROS_USES_AVAILABILITY 1 | ||
| 239 | 		#endif | ||
| 240 | 	#endif | ||
| 241 | #endif | ||
| 242 | |||
| 243 | #if TARGET_OS_OSX | ||
| 244 | #define __IPHONE_COMPAT_VERSION __IPHONE_NA | ||
| 245 | #elif TARGET_OS_MACCATALYST | ||
| 246 | #define __IPHONE_COMPAT_VERSION __IPHONE_NA | ||
| 247 | #else | ||
| 248 | #define __IPHONE_COMPAT_VERSION __IPHONE_4_0 | ||
| 249 | #endif | ||
| 250 | |||
| 251 | /* | ||
| 252 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 253 | * | ||
| 254 | * Used on declarations introduced in Mac OS X 10.1 | ||
| 255 | */ | ||
| 256 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 257 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_COMPAT_VERSION) | ||
| 258 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1 | ||
| 259 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 260 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1 | ||
| 261 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 262 | #else | ||
| 263 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 264 | #endif | ||
| 265 | |||
| 266 | /* | ||
| 267 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED | ||
| 268 | * | ||
| 269 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 270 | * and deprecated in Mac OS X 10.1 | ||
| 271 | */ | ||
| 272 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 273 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 274 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1 | ||
| 275 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 276 | #else | ||
| 277 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 278 | #endif | ||
| 279 | |||
| 280 | /* | ||
| 281 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 | ||
| 282 | * | ||
| 283 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 284 | * but later deprecated in Mac OS X 10.1 | ||
| 285 | */ | ||
| 286 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 287 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 288 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1 | ||
| 289 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE | ||
| 290 | #else | ||
| 291 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 292 | #endif | ||
| 293 | |||
| 294 | /* | ||
| 295 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 296 | * | ||
| 297 | * Used on declarations introduced in Mac OS X 10.2 | ||
| 298 | */ | ||
| 299 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 300 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_COMPAT_VERSION) | ||
| 301 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2 | ||
| 302 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 303 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2 | ||
| 304 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 305 | #else | ||
| 306 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 307 | #endif | ||
| 308 | |||
| 309 | /* | ||
| 310 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED | ||
| 311 | * | ||
| 312 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 313 | * and deprecated in Mac OS X 10.2 | ||
| 314 | */ | ||
| 315 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 316 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 317 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 | ||
| 318 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 319 | #else | ||
| 320 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 321 | #endif | ||
| 322 | |||
| 323 | /* | ||
| 324 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 | ||
| 325 | * | ||
| 326 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 327 | * but later deprecated in Mac OS X 10.2 | ||
| 328 | */ | ||
| 329 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 330 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 331 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 | ||
| 332 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE | ||
| 333 | #else | ||
| 334 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 335 | #endif | ||
| 336 | |||
| 337 | /* | ||
| 338 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 | ||
| 339 | * | ||
| 340 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 341 | * but later deprecated in Mac OS X 10.2 | ||
| 342 | */ | ||
| 343 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 344 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 345 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 | ||
| 346 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE | ||
| 347 | #else | ||
| 348 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 349 | #endif | ||
| 350 | |||
| 351 | /* | ||
| 352 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 353 | * | ||
| 354 | * Used on declarations introduced in Mac OS X 10.3 | ||
| 355 | */ | ||
| 356 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 357 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_COMPAT_VERSION) | ||
| 358 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3 | ||
| 359 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 360 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 | ||
| 361 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 362 | #else | ||
| 363 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 364 | #endif | ||
| 365 | |||
| 366 | /* | ||
| 367 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED | ||
| 368 | * | ||
| 369 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 370 | * and deprecated in Mac OS X 10.3 | ||
| 371 | */ | ||
| 372 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 373 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 374 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 | ||
| 375 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 376 | #else | ||
| 377 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 378 | #endif | ||
| 379 | |||
| 380 | /* | ||
| 381 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 | ||
| 382 | * | ||
| 383 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 384 | * but later deprecated in Mac OS X 10.3 | ||
| 385 | */ | ||
| 386 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 387 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 388 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 | ||
| 389 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE | ||
| 390 | #else | ||
| 391 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 392 | #endif | ||
| 393 | |||
| 394 | /* | ||
| 395 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 | ||
| 396 | * | ||
| 397 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 398 | * but later deprecated in Mac OS X 10.3 | ||
| 399 | */ | ||
| 400 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 401 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 402 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 | ||
| 403 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE | ||
| 404 | #else | ||
| 405 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 406 | #endif | ||
| 407 | |||
| 408 | /* | ||
| 409 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 | ||
| 410 | * | ||
| 411 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 412 | * but later deprecated in Mac OS X 10.3 | ||
| 413 | */ | ||
| 414 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 415 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 416 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 | ||
| 417 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE | ||
| 418 | #else | ||
| 419 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 420 | #endif | ||
| 421 | |||
| 422 | /* | ||
| 423 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 424 | * | ||
| 425 | * Used on declarations introduced in Mac OS X 10.4 | ||
| 426 | */ | ||
| 427 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 428 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_COMPAT_VERSION) | ||
| 429 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4 | ||
| 430 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 431 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 | ||
| 432 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 433 | #else | ||
| 434 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 435 | #endif | ||
| 436 | |||
| 437 | /* | ||
| 438 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED | ||
| 439 | * | ||
| 440 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 441 | * and deprecated in Mac OS X 10.4 | ||
| 442 | */ | ||
| 443 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 444 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 445 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 | ||
| 446 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 447 | #else | ||
| 448 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 449 | #endif | ||
| 450 | |||
| 451 | /* | ||
| 452 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 | ||
| 453 | * | ||
| 454 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 455 | * but later deprecated in Mac OS X 10.4 | ||
| 456 | */ | ||
| 457 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 458 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 459 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 | ||
| 460 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE | ||
| 461 | #else | ||
| 462 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 463 | #endif | ||
| 464 | |||
| 465 | /* | ||
| 466 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 | ||
| 467 | * | ||
| 468 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 469 | * but later deprecated in Mac OS X 10.4 | ||
| 470 | */ | ||
| 471 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 472 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 473 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 | ||
| 474 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE | ||
| 475 | #else | ||
| 476 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 477 | #endif | ||
| 478 | |||
| 479 | /* | ||
| 480 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 | ||
| 481 | * | ||
| 482 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 483 | * but later deprecated in Mac OS X 10.4 | ||
| 484 | */ | ||
| 485 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 486 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 487 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 | ||
| 488 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE | ||
| 489 | #else | ||
| 490 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 491 | #endif | ||
| 492 | |||
| 493 | /* | ||
| 494 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 | ||
| 495 | * | ||
| 496 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 497 | * but later deprecated in Mac OS X 10.4 | ||
| 498 | */ | ||
| 499 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 500 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 501 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 | ||
| 502 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE | ||
| 503 | #else | ||
| 504 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 505 | #endif | ||
| 506 | |||
| 507 | /* | ||
| 508 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 509 | * | ||
| 510 | * Used on declarations introduced in Mac OS X 10.5 | ||
| 511 | */ | ||
| 512 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 513 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_COMPAT_VERSION) | ||
| 514 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 | ||
| 515 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 516 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 | ||
| 517 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 518 | #else | ||
| 519 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 520 | #endif | ||
| 521 | |||
| 522 | /* | ||
| 523 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED | ||
| 524 | * | ||
| 525 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 526 | * and deprecated in Mac OS X 10.5 | ||
| 527 | */ | ||
| 528 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 529 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 530 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 531 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 532 | #else | ||
| 533 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 534 | #endif | ||
| 535 | |||
| 536 | /* | ||
| 537 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 | ||
| 538 | * | ||
| 539 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 540 | * but later deprecated in Mac OS X 10.5 | ||
| 541 | */ | ||
| 542 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 543 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 544 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 545 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE | ||
| 546 | #else | ||
| 547 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 548 | #endif | ||
| 549 | |||
| 550 | /* | ||
| 551 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 | ||
| 552 | * | ||
| 553 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 554 | * but later deprecated in Mac OS X 10.5 | ||
| 555 | */ | ||
| 556 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 557 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 558 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 559 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE | ||
| 560 | #else | ||
| 561 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 562 | #endif | ||
| 563 | |||
| 564 | /* | ||
| 565 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 | ||
| 566 | * | ||
| 567 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 568 | * but later deprecated in Mac OS X 10.5 | ||
| 569 | */ | ||
| 570 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 571 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 572 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 573 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE | ||
| 574 | #else | ||
| 575 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 576 | #endif | ||
| 577 | |||
| 578 | /* | ||
| 579 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 | ||
| 580 | * | ||
| 581 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 582 | * but later deprecated in Mac OS X 10.5 | ||
| 583 | */ | ||
| 584 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 585 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 586 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 587 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE | ||
| 588 | #else | ||
| 589 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 590 | #endif | ||
| 591 | |||
| 592 | /* | ||
| 593 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 | ||
| 594 | * | ||
| 595 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 596 | * but later deprecated in Mac OS X 10.5 | ||
| 597 | */ | ||
| 598 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 599 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 600 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 601 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE | ||
| 602 | #else | ||
| 603 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 604 | #endif | ||
| 605 | |||
| 606 | /* | ||
| 607 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 608 | * | ||
| 609 | * Used on declarations introduced in Mac OS X 10.6 | ||
| 610 | */ | ||
| 611 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 612 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_COMPAT_VERSION) | ||
| 613 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 | ||
| 614 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 615 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 | ||
| 616 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 617 | #else | ||
| 618 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 619 | #endif | ||
| 620 | |||
| 621 | /* | ||
| 622 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED | ||
| 623 | * | ||
| 624 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 625 | * and deprecated in Mac OS X 10.6 | ||
| 626 | */ | ||
| 627 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 628 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 629 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 630 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 631 | #else | ||
| 632 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 633 | #endif | ||
| 634 | |||
| 635 | /* | ||
| 636 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 | ||
| 637 | * | ||
| 638 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 639 | * but later deprecated in Mac OS X 10.6 | ||
| 640 | */ | ||
| 641 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 642 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 643 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 644 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE | ||
| 645 | #else | ||
| 646 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 647 | #endif | ||
| 648 | |||
| 649 | /* | ||
| 650 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 | ||
| 651 | * | ||
| 652 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 653 | * but later deprecated in Mac OS X 10.6 | ||
| 654 | */ | ||
| 655 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 656 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 657 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 658 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE | ||
| 659 | #else | ||
| 660 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 661 | #endif | ||
| 662 | |||
| 663 | /* | ||
| 664 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 | ||
| 665 | * | ||
| 666 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 667 | * but later deprecated in Mac OS X 10.6 | ||
| 668 | */ | ||
| 669 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 670 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 671 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 672 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE | ||
| 673 | #else | ||
| 674 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 675 | #endif | ||
| 676 | |||
| 677 | /* | ||
| 678 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 | ||
| 679 | * | ||
| 680 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 681 | * but later deprecated in Mac OS X 10.6 | ||
| 682 | */ | ||
| 683 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 684 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 685 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 686 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE | ||
| 687 | #else | ||
| 688 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 689 | #endif | ||
| 690 | |||
| 691 | /* | ||
| 692 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 | ||
| 693 | * | ||
| 694 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 695 | * but later deprecated in Mac OS X 10.6 | ||
| 696 | */ | ||
| 697 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 698 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 699 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 700 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE | ||
| 701 | #else | ||
| 702 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 703 | #endif | ||
| 704 | |||
| 705 | /* | ||
| 706 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 | ||
| 707 | * | ||
| 708 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 709 | * but later deprecated in Mac OS X 10.6 | ||
| 710 | */ | ||
| 711 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 712 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 713 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 714 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE | ||
| 715 | #else | ||
| 716 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 717 | #endif | ||
| 718 | |||
| 719 | /* | ||
| 720 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 721 | * | ||
| 722 | * Used on declarations introduced in Mac OS X 10.7 | ||
| 723 | */ | ||
| 724 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 725 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_COMPAT_VERSION) | ||
| 726 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | ||
| 727 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 728 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 | ||
| 729 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 730 | #else | ||
| 731 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 732 | #endif | ||
| 733 | |||
| 734 | /* | ||
| 735 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED | ||
| 736 | * | ||
| 737 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 738 | * and deprecated in Mac OS X 10.7 | ||
| 739 | */ | ||
| 740 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 741 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 742 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 743 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 744 | #else | ||
| 745 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 746 | #endif | ||
| 747 | |||
| 748 | /* | ||
| 749 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 750 | * | ||
| 751 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 752 | * but later deprecated in Mac OS X 10.7 | ||
| 753 | */ | ||
| 754 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 755 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 756 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 757 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 758 | #else | ||
| 759 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 760 | #endif | ||
| 761 | |||
| 762 | /* | ||
| 763 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 764 | * | ||
| 765 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 766 | * but later deprecated in Mac OS X 10.7 | ||
| 767 | */ | ||
| 768 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 769 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 770 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 771 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 772 | #else | ||
| 773 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 774 | #endif | ||
| 775 | |||
| 776 | /* | ||
| 777 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 778 | * | ||
| 779 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 780 | * but later deprecated in Mac OS X 10.7 | ||
| 781 | */ | ||
| 782 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 783 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 784 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 785 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 786 | #else | ||
| 787 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 788 | #endif | ||
| 789 | |||
| 790 | /* | ||
| 791 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 792 | * | ||
| 793 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 794 | * but later deprecated in Mac OS X 10.7 | ||
| 795 | */ | ||
| 796 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 797 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 798 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 799 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 800 | #else | ||
| 801 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 802 | #endif | ||
| 803 | |||
| 804 | /* | ||
| 805 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 806 | * | ||
| 807 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 808 | * but later deprecated in Mac OS X 10.7 | ||
| 809 | */ | ||
| 810 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 811 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 812 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 813 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 814 | #else | ||
| 815 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 816 | #endif | ||
| 817 | |||
| 818 | /* | ||
| 819 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 820 | * | ||
| 821 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 822 | * but later deprecated in Mac OS X 10.7 | ||
| 823 | */ | ||
| 824 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 825 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 826 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 827 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 828 | #else | ||
| 829 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 830 | #endif | ||
| 831 | |||
| 832 | /* | ||
| 833 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 | ||
| 834 | * | ||
| 835 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 836 | * but later deprecated in Mac OS X 10.7 | ||
| 837 | */ | ||
| 838 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 839 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 840 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 841 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE | ||
| 842 | #else | ||
| 843 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 844 | #endif | ||
| 845 | |||
| 846 | /* | ||
| 847 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 | ||
| 848 | * | ||
| 849 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 850 | * but later deprecated in Mac OS X 10.13 | ||
| 851 | */ | ||
| 852 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 853 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_13, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 854 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 855 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 DEPRECATED_ATTRIBUTE | ||
| 856 | #else | ||
| 857 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 858 | #endif | ||
| 859 | |||
| 860 | /* | ||
| 861 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 862 | * | ||
| 863 | * Used on declarations introduced in Mac OS X 10.8 | ||
| 864 | */ | ||
| 865 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 866 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_COMPAT_VERSION) | ||
| 867 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 | ||
| 868 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 869 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 | ||
| 870 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 871 | #else | ||
| 872 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 873 | #endif | ||
| 874 | |||
| 875 | /* | ||
| 876 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED | ||
| 877 | * | ||
| 878 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 879 | * and deprecated in Mac OS X 10.8 | ||
| 880 | */ | ||
| 881 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 882 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 883 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 884 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 885 | #else | ||
| 886 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 887 | #endif | ||
| 888 | |||
| 889 | /* | ||
| 890 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 891 | * | ||
| 892 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 893 | * but later deprecated in Mac OS X 10.8 | ||
| 894 | */ | ||
| 895 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 896 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 897 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 898 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 899 | #else | ||
| 900 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 901 | #endif | ||
| 902 | |||
| 903 | /* | ||
| 904 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 905 | * | ||
| 906 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 907 | * but later deprecated in Mac OS X 10.8 | ||
| 908 | */ | ||
| 909 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 910 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 911 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 912 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 913 | #else | ||
| 914 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 915 | #endif | ||
| 916 | |||
| 917 | /* | ||
| 918 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 919 | * | ||
| 920 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 921 | * but later deprecated in Mac OS X 10.8 | ||
| 922 | */ | ||
| 923 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 924 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 925 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 926 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 927 | #else | ||
| 928 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 929 | #endif | ||
| 930 | |||
| 931 | /* | ||
| 932 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 933 | * | ||
| 934 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 935 | * but later deprecated in Mac OS X 10.8 | ||
| 936 | */ | ||
| 937 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 938 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 939 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 940 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 941 | #else | ||
| 942 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 943 | #endif | ||
| 944 | |||
| 945 | /* | ||
| 946 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 947 | * | ||
| 948 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 949 | * but later deprecated in Mac OS X 10.8 | ||
| 950 | */ | ||
| 951 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 952 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 953 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 954 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 955 | #else | ||
| 956 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 957 | #endif | ||
| 958 | |||
| 959 | /* | ||
| 960 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 961 | * | ||
| 962 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 963 | * but later deprecated in Mac OS X 10.8 | ||
| 964 | */ | ||
| 965 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 966 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 967 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 968 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 969 | #else | ||
| 970 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 971 | #endif | ||
| 972 | |||
| 973 | /* | ||
| 974 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 975 | * | ||
| 976 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 977 | * but later deprecated in Mac OS X 10.8 | ||
| 978 | */ | ||
| 979 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 980 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 981 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 982 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 983 | #else | ||
| 984 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 985 | #endif | ||
| 986 | |||
| 987 | /* | ||
| 988 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 | ||
| 989 | * | ||
| 990 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 991 | * but later deprecated in Mac OS X 10.8 | ||
| 992 | */ | ||
| 993 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 994 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 995 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 996 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE | ||
| 997 | #else | ||
| 998 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 999 | #endif | ||
| 1000 | |||
| 1001 | /* | ||
| 1002 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1003 | * | ||
| 1004 | * Used on declarations introduced in Mac OS X 10.9 | ||
| 1005 | */ | ||
| 1006 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1007 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_COMPAT_VERSION) | ||
| 1008 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 | ||
| 1009 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 1010 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9 | ||
| 1011 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 1012 | #else | ||
| 1013 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1014 | #endif | ||
| 1015 | |||
| 1016 | /* | ||
| 1017 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED | ||
| 1018 | * | ||
| 1019 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 1020 | * and deprecated in Mac OS X 10.9 | ||
| 1021 | */ | ||
| 1022 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1023 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1024 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1025 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 1026 | #else | ||
| 1027 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1028 | #endif | ||
| 1029 | |||
| 1030 | /* | ||
| 1031 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1032 | * | ||
| 1033 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 1034 | * but later deprecated in Mac OS X 10.9 | ||
| 1035 | */ | ||
| 1036 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1037 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1038 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1039 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1040 | #else | ||
| 1041 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 1042 | #endif | ||
| 1043 | |||
| 1044 | /* | ||
| 1045 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1046 | * | ||
| 1047 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 1048 | * but later deprecated in Mac OS X 10.9 | ||
| 1049 | */ | ||
| 1050 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1051 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1052 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1053 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1054 | #else | ||
| 1055 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 1056 | #endif | ||
| 1057 | |||
| 1058 | /* | ||
| 1059 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1060 | * | ||
| 1061 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 1062 | * but later deprecated in Mac OS X 10.9 | ||
| 1063 | */ | ||
| 1064 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1065 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1066 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1067 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1068 | #else | ||
| 1069 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 1070 | #endif | ||
| 1071 | |||
| 1072 | /* | ||
| 1073 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1074 | * | ||
| 1075 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 1076 | * but later deprecated in Mac OS X 10.9 | ||
| 1077 | */ | ||
| 1078 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1079 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1080 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1081 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1082 | #else | ||
| 1083 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 1084 | #endif | ||
| 1085 | |||
| 1086 | /* | ||
| 1087 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1088 | * | ||
| 1089 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 1090 | * but later deprecated in Mac OS X 10.9 | ||
| 1091 | */ | ||
| 1092 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1093 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1094 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1095 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1096 | #else | ||
| 1097 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 1098 | #endif | ||
| 1099 | |||
| 1100 | /* | ||
| 1101 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1102 | * | ||
| 1103 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 1104 | * but later deprecated in Mac OS X 10.9 | ||
| 1105 | */ | ||
| 1106 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1107 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1108 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1109 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1110 | #else | ||
| 1111 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 1112 | #endif | ||
| 1113 | |||
| 1114 | /* | ||
| 1115 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1116 | * | ||
| 1117 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 1118 | * but later deprecated in Mac OS X 10.9 | ||
| 1119 | */ | ||
| 1120 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1121 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1122 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1123 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1124 | #else | ||
| 1125 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 1126 | #endif | ||
| 1127 | |||
| 1128 | /* | ||
| 1129 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1130 | * | ||
| 1131 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 1132 | * but later deprecated in Mac OS X 10.9 | ||
| 1133 | */ | ||
| 1134 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1135 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1136 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1137 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1138 | #else | ||
| 1139 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 1140 | #endif | ||
| 1141 | |||
| 1142 | /* | ||
| 1143 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 | ||
| 1144 | * | ||
| 1145 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 1146 | * but later deprecated in Mac OS X 10.9 | ||
| 1147 | */ | ||
| 1148 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1149 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1150 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 1151 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE | ||
| 1152 | #else | ||
| 1153 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 1154 | #endif | ||
| 1155 | |||
| 1156 | /* | ||
| 1157 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 1158 | * | ||
| 1159 | * Used on declarations introduced in Mac OS X 10.10 | ||
| 1160 | */ | ||
| 1161 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1162 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_COMPAT_VERSION) | ||
| 1163 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10 | ||
| 1164 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 1165 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10 | ||
| 1166 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 1167 | #else | ||
| 1168 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 1169 | #endif | ||
| 1170 | |||
| 1171 | /* | ||
| 1172 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED | ||
| 1173 | * | ||
| 1174 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 1175 | * and deprecated in Mac OS X 10.10 | ||
| 1176 | */ | ||
| 1177 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1178 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1179 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1180 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 1181 | #else | ||
| 1182 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 1183 | #endif | ||
| 1184 | |||
| 1185 | /* | ||
| 1186 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1187 | * | ||
| 1188 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 1189 | * but later deprecated in Mac OS X 10.10 | ||
| 1190 | */ | ||
| 1191 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1192 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1193 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1194 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1195 | #else | ||
| 1196 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 1197 | #endif | ||
| 1198 | |||
| 1199 | /* | ||
| 1200 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1201 | * | ||
| 1202 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 1203 | * but later deprecated in Mac OS X 10.10 | ||
| 1204 | */ | ||
| 1205 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1206 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1207 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1208 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1209 | #else | ||
| 1210 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 1211 | #endif | ||
| 1212 | |||
| 1213 | /* | ||
| 1214 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1215 | * | ||
| 1216 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 1217 | * but later deprecated in Mac OS X 10.10 | ||
| 1218 | */ | ||
| 1219 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1220 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1221 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1222 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1223 | #else | ||
| 1224 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 1225 | #endif | ||
| 1226 | |||
| 1227 | /* | ||
| 1228 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1229 | * | ||
| 1230 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 1231 | * but later deprecated in Mac OS X 10.10 | ||
| 1232 | */ | ||
| 1233 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1234 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1235 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1236 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1237 | #else | ||
| 1238 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 1239 | #endif | ||
| 1240 | |||
| 1241 | /* | ||
| 1242 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1243 | * | ||
| 1244 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 1245 | * but later deprecated in Mac OS X 10.10 | ||
| 1246 | */ | ||
| 1247 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1248 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1249 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1250 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1251 | #else | ||
| 1252 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 1253 | #endif | ||
| 1254 | |||
| 1255 | /* | ||
| 1256 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1257 | * | ||
| 1258 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 1259 | * but later deprecated in Mac OS X 10.10 | ||
| 1260 | */ | ||
| 1261 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1262 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1263 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1264 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1265 | #else | ||
| 1266 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 1267 | #endif | ||
| 1268 | |||
| 1269 | /* | ||
| 1270 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1271 | * | ||
| 1272 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 1273 | * but later deprecated in Mac OS X 10.10 | ||
| 1274 | */ | ||
| 1275 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1276 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1277 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1278 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1279 | #else | ||
| 1280 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 1281 | #endif | ||
| 1282 | |||
| 1283 | /* | ||
| 1284 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1285 | * | ||
| 1286 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 1287 | * but later deprecated in Mac OS X 10.10 | ||
| 1288 | */ | ||
| 1289 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1290 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1291 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1292 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1293 | #else | ||
| 1294 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 1295 | #endif | ||
| 1296 | |||
| 1297 | /* | ||
| 1298 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1299 | * | ||
| 1300 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 1301 | * but later deprecated in Mac OS X 10.10 | ||
| 1302 | */ | ||
| 1303 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1304 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1305 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1306 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1307 | #else | ||
| 1308 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 1309 | #endif | ||
| 1310 | |||
| 1311 | /* | ||
| 1312 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 | ||
| 1313 | * | ||
| 1314 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 1315 | * but later deprecated in Mac OS X 10.10 | ||
| 1316 | */ | ||
| 1317 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1318 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1319 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 1320 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE | ||
| 1321 | #else | ||
| 1322 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1323 | #endif | ||
| 1324 | |||
| 1325 | /* | ||
| 1326 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 1327 | * | ||
| 1328 | * Used on declarations introduced in Mac OS X 10.10.2 | ||
| 1329 | */ | ||
| 1330 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1331 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_COMPAT_VERSION) | ||
| 1332 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_2 | ||
| 1333 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 1334 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_2 | ||
| 1335 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 1336 | #else | ||
| 1337 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 1338 | #endif | ||
| 1339 | |||
| 1340 | /* | ||
| 1341 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED | ||
| 1342 | * | ||
| 1343 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 1344 | * and deprecated in Mac OS X 10.10.2 | ||
| 1345 | */ | ||
| 1346 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1347 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1348 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1349 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 1350 | #else | ||
| 1351 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 1352 | #endif | ||
| 1353 | |||
| 1354 | /* | ||
| 1355 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1356 | * | ||
| 1357 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 1358 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1359 | */ | ||
| 1360 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1361 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1362 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1363 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1364 | #else | ||
| 1365 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 1366 | #endif | ||
| 1367 | |||
| 1368 | /* | ||
| 1369 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1370 | * | ||
| 1371 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 1372 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1373 | */ | ||
| 1374 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1375 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1376 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1377 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1378 | #else | ||
| 1379 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 1380 | #endif | ||
| 1381 | |||
| 1382 | /* | ||
| 1383 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1384 | * | ||
| 1385 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 1386 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1387 | */ | ||
| 1388 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1389 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1390 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1391 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1392 | #else | ||
| 1393 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 1394 | #endif | ||
| 1395 | |||
| 1396 | /* | ||
| 1397 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1398 | * | ||
| 1399 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 1400 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1401 | */ | ||
| 1402 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1403 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1404 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1405 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1406 | #else | ||
| 1407 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 1408 | #endif | ||
| 1409 | |||
| 1410 | /* | ||
| 1411 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1412 | * | ||
| 1413 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 1414 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1415 | */ | ||
| 1416 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1417 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1418 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1419 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1420 | #else | ||
| 1421 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 1422 | #endif | ||
| 1423 | |||
| 1424 | /* | ||
| 1425 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1426 | * | ||
| 1427 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 1428 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1429 | */ | ||
| 1430 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1431 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1432 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1433 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1434 | #else | ||
| 1435 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 1436 | #endif | ||
| 1437 | |||
| 1438 | /* | ||
| 1439 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1440 | * | ||
| 1441 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 1442 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1443 | */ | ||
| 1444 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1445 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1446 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1447 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1448 | #else | ||
| 1449 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 1450 | #endif | ||
| 1451 | |||
| 1452 | /* | ||
| 1453 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1454 | * | ||
| 1455 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 1456 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1457 | */ | ||
| 1458 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1459 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1460 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1461 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1462 | #else | ||
| 1463 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 1464 | #endif | ||
| 1465 | |||
| 1466 | /* | ||
| 1467 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1468 | * | ||
| 1469 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 1470 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1471 | */ | ||
| 1472 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1473 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1474 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1475 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1476 | #else | ||
| 1477 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 1478 | #endif | ||
| 1479 | |||
| 1480 | /* | ||
| 1481 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1482 | * | ||
| 1483 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 1484 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1485 | */ | ||
| 1486 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1487 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1488 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1489 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1490 | #else | ||
| 1491 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1492 | #endif | ||
| 1493 | |||
| 1494 | /* | ||
| 1495 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 | ||
| 1496 | * | ||
| 1497 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 1498 | * but later deprecated in Mac OS X 10.10.2 | ||
| 1499 | */ | ||
| 1500 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1501 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1502 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2 | ||
| 1503 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE | ||
| 1504 | #else | ||
| 1505 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 1506 | #endif | ||
| 1507 | |||
| 1508 | /* | ||
| 1509 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 1510 | * | ||
| 1511 | * Used on declarations introduced in Mac OS X 10.10.3 | ||
| 1512 | */ | ||
| 1513 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1514 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_3, __IPHONE_COMPAT_VERSION) | ||
| 1515 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_3 | ||
| 1516 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 1517 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_3 | ||
| 1518 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 1519 | #else | ||
| 1520 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 1521 | #endif | ||
| 1522 | |||
| 1523 | /* | ||
| 1524 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED | ||
| 1525 | * | ||
| 1526 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 1527 | * and deprecated in Mac OS X 10.10.3 | ||
| 1528 | */ | ||
| 1529 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1530 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1531 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1532 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 1533 | #else | ||
| 1534 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 1535 | #endif | ||
| 1536 | |||
| 1537 | /* | ||
| 1538 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1539 | * | ||
| 1540 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 1541 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1542 | */ | ||
| 1543 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1544 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1545 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1546 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1547 | #else | ||
| 1548 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 1549 | #endif | ||
| 1550 | |||
| 1551 | /* | ||
| 1552 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1553 | * | ||
| 1554 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 1555 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1556 | */ | ||
| 1557 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1558 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1559 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1560 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1561 | #else | ||
| 1562 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 1563 | #endif | ||
| 1564 | |||
| 1565 | /* | ||
| 1566 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1567 | * | ||
| 1568 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 1569 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1570 | */ | ||
| 1571 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1572 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1573 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1574 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1575 | #else | ||
| 1576 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 1577 | #endif | ||
| 1578 | |||
| 1579 | /* | ||
| 1580 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1581 | * | ||
| 1582 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 1583 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1584 | */ | ||
| 1585 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1586 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1587 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1588 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1589 | #else | ||
| 1590 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 1591 | #endif | ||
| 1592 | |||
| 1593 | /* | ||
| 1594 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1595 | * | ||
| 1596 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 1597 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1598 | */ | ||
| 1599 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1600 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1601 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1602 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1603 | #else | ||
| 1604 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 1605 | #endif | ||
| 1606 | |||
| 1607 | /* | ||
| 1608 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1609 | * | ||
| 1610 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 1611 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1612 | */ | ||
| 1613 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1614 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1615 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1616 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1617 | #else | ||
| 1618 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 1619 | #endif | ||
| 1620 | |||
| 1621 | /* | ||
| 1622 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1623 | * | ||
| 1624 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 1625 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1626 | */ | ||
| 1627 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1628 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1629 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1630 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1631 | #else | ||
| 1632 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 1633 | #endif | ||
| 1634 | |||
| 1635 | /* | ||
| 1636 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1637 | * | ||
| 1638 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 1639 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1640 | */ | ||
| 1641 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1642 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1643 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1644 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1645 | #else | ||
| 1646 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 1647 | #endif | ||
| 1648 | |||
| 1649 | /* | ||
| 1650 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1651 | * | ||
| 1652 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 1653 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1654 | */ | ||
| 1655 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1656 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1657 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1658 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1659 | #else | ||
| 1660 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 1661 | #endif | ||
| 1662 | |||
| 1663 | /* | ||
| 1664 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1665 | * | ||
| 1666 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 1667 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1668 | */ | ||
| 1669 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1670 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1671 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1672 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1673 | #else | ||
| 1674 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1675 | #endif | ||
| 1676 | |||
| 1677 | /* | ||
| 1678 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1679 | * | ||
| 1680 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 1681 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1682 | */ | ||
| 1683 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1684 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1685 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1686 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1687 | #else | ||
| 1688 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 1689 | #endif | ||
| 1690 | |||
| 1691 | /* | ||
| 1692 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 | ||
| 1693 | * | ||
| 1694 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 1695 | * but later deprecated in Mac OS X 10.10.3 | ||
| 1696 | */ | ||
| 1697 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1698 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1699 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3 | ||
| 1700 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE | ||
| 1701 | #else | ||
| 1702 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 1703 | #endif | ||
| 1704 | |||
| 1705 | /* | ||
| 1706 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 1707 | * | ||
| 1708 | * Used on declarations introduced in Mac OS X 10.11 | ||
| 1709 | */ | ||
| 1710 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1711 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_COMPAT_VERSION) | ||
| 1712 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11 | ||
| 1713 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 1714 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11 | ||
| 1715 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 1716 | #else | ||
| 1717 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 1718 | #endif | ||
| 1719 | |||
| 1720 | /* | ||
| 1721 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED | ||
| 1722 | * | ||
| 1723 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 1724 | * and deprecated in Mac OS X 10.11 | ||
| 1725 | */ | ||
| 1726 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1727 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1728 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1729 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 1730 | #else | ||
| 1731 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 1732 | #endif | ||
| 1733 | |||
| 1734 | /* | ||
| 1735 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1736 | * | ||
| 1737 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 1738 | * but later deprecated in Mac OS X 10.11 | ||
| 1739 | */ | ||
| 1740 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1741 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1742 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1743 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1744 | #else | ||
| 1745 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 1746 | #endif | ||
| 1747 | |||
| 1748 | /* | ||
| 1749 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1750 | * | ||
| 1751 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 1752 | * but later deprecated in Mac OS X 10.11 | ||
| 1753 | */ | ||
| 1754 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1755 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1756 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1757 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1758 | #else | ||
| 1759 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 1760 | #endif | ||
| 1761 | |||
| 1762 | /* | ||
| 1763 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1764 | * | ||
| 1765 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 1766 | * but later deprecated in Mac OS X 10.11 | ||
| 1767 | */ | ||
| 1768 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1769 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1770 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1771 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1772 | #else | ||
| 1773 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 1774 | #endif | ||
| 1775 | |||
| 1776 | /* | ||
| 1777 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1778 | * | ||
| 1779 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 1780 | * but later deprecated in Mac OS X 10.11 | ||
| 1781 | */ | ||
| 1782 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1783 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1784 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1785 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1786 | #else | ||
| 1787 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 1788 | #endif | ||
| 1789 | |||
| 1790 | /* | ||
| 1791 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1792 | * | ||
| 1793 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 1794 | * but later deprecated in Mac OS X 10.11 | ||
| 1795 | */ | ||
| 1796 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1797 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1798 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1799 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1800 | #else | ||
| 1801 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 1802 | #endif | ||
| 1803 | |||
| 1804 | /* | ||
| 1805 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1806 | * | ||
| 1807 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 1808 | * but later deprecated in Mac OS X 10.11 | ||
| 1809 | */ | ||
| 1810 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1811 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1812 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1813 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1814 | #else | ||
| 1815 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 1816 | #endif | ||
| 1817 | |||
| 1818 | /* | ||
| 1819 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1820 | * | ||
| 1821 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 1822 | * but later deprecated in Mac OS X 10.11 | ||
| 1823 | */ | ||
| 1824 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1825 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1826 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1827 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1828 | #else | ||
| 1829 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 1830 | #endif | ||
| 1831 | |||
| 1832 | /* | ||
| 1833 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1834 | * | ||
| 1835 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 1836 | * but later deprecated in Mac OS X 10.11 | ||
| 1837 | */ | ||
| 1838 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1839 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1840 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1841 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1842 | #else | ||
| 1843 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 1844 | #endif | ||
| 1845 | |||
| 1846 | /* | ||
| 1847 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1848 | * | ||
| 1849 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 1850 | * but later deprecated in Mac OS X 10.11 | ||
| 1851 | */ | ||
| 1852 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1853 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1854 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1855 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1856 | #else | ||
| 1857 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 1858 | #endif | ||
| 1859 | |||
| 1860 | /* | ||
| 1861 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1862 | * | ||
| 1863 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 1864 | * but later deprecated in Mac OS X 10.11 | ||
| 1865 | */ | ||
| 1866 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1867 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1868 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1869 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1870 | #else | ||
| 1871 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 1872 | #endif | ||
| 1873 | |||
| 1874 | /* | ||
| 1875 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1876 | * | ||
| 1877 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 1878 | * but later deprecated in Mac OS X 10.11 | ||
| 1879 | */ | ||
| 1880 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1881 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1882 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1883 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1884 | #else | ||
| 1885 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 1886 | #endif | ||
| 1887 | |||
| 1888 | /* | ||
| 1889 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1890 | * | ||
| 1891 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 1892 | * but later deprecated in Mac OS X 10.11 | ||
| 1893 | */ | ||
| 1894 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1895 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1896 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1897 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1898 | #else | ||
| 1899 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 1900 | #endif | ||
| 1901 | |||
| 1902 | /* | ||
| 1903 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 | ||
| 1904 | * | ||
| 1905 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 1906 | * but later deprecated in Mac OS X 10.11 | ||
| 1907 | */ | ||
| 1908 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1909 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1910 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 1911 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE | ||
| 1912 | #else | ||
| 1913 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 1914 | #endif | ||
| 1915 | |||
| 1916 | /* | ||
| 1917 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 1918 | * | ||
| 1919 | * Used on declarations introduced in Mac OS X 10.11.2 | ||
| 1920 | */ | ||
| 1921 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1922 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_2, __IPHONE_COMPAT_VERSION) | ||
| 1923 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_2 | ||
| 1924 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 1925 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_2 | ||
| 1926 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 1927 | #else | ||
| 1928 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 1929 | #endif | ||
| 1930 | |||
| 1931 | /* | ||
| 1932 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED | ||
| 1933 | * | ||
| 1934 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 1935 | * and deprecated in Mac OS X 10.11.2 | ||
| 1936 | */ | ||
| 1937 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1938 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1939 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 1940 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 1941 | #else | ||
| 1942 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 1943 | #endif | ||
| 1944 | |||
| 1945 | /* | ||
| 1946 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 1947 | * | ||
| 1948 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 1949 | * but later deprecated in Mac OS X 10.11.2 | ||
| 1950 | */ | ||
| 1951 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1952 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1953 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 1954 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 1955 | #else | ||
| 1956 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 1957 | #endif | ||
| 1958 | |||
| 1959 | /* | ||
| 1960 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 1961 | * | ||
| 1962 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 1963 | * but later deprecated in Mac OS X 10.11.2 | ||
| 1964 | */ | ||
| 1965 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1966 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1967 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 1968 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 1969 | #else | ||
| 1970 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 1971 | #endif | ||
| 1972 | |||
| 1973 | /* | ||
| 1974 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 1975 | * | ||
| 1976 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 1977 | * but later deprecated in Mac OS X 10.11.2 | ||
| 1978 | */ | ||
| 1979 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1980 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1981 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 1982 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 1983 | #else | ||
| 1984 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 1985 | #endif | ||
| 1986 | |||
| 1987 | /* | ||
| 1988 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 1989 | * | ||
| 1990 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 1991 | * but later deprecated in Mac OS X 10.11.2 | ||
| 1992 | */ | ||
| 1993 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 1994 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 1995 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 1996 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 1997 | #else | ||
| 1998 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 1999 | #endif | ||
| 2000 | |||
| 2001 | /* | ||
| 2002 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2003 | * | ||
| 2004 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 2005 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2006 | */ | ||
| 2007 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2008 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2009 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2010 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2011 | #else | ||
| 2012 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 2013 | #endif | ||
| 2014 | |||
| 2015 | /* | ||
| 2016 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2017 | * | ||
| 2018 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 2019 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2020 | */ | ||
| 2021 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2022 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2023 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2024 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2025 | #else | ||
| 2026 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 2027 | #endif | ||
| 2028 | |||
| 2029 | /* | ||
| 2030 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2031 | * | ||
| 2032 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 2033 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2034 | */ | ||
| 2035 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2036 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2037 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2038 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2039 | #else | ||
| 2040 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 2041 | #endif | ||
| 2042 | |||
| 2043 | /* | ||
| 2044 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2045 | * | ||
| 2046 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 2047 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2048 | */ | ||
| 2049 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2050 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2051 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2052 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2053 | #else | ||
| 2054 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 2055 | #endif | ||
| 2056 | |||
| 2057 | /* | ||
| 2058 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2059 | * | ||
| 2060 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 2061 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2062 | */ | ||
| 2063 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2064 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2065 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2066 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2067 | #else | ||
| 2068 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 2069 | #endif | ||
| 2070 | |||
| 2071 | /* | ||
| 2072 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2073 | * | ||
| 2074 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 2075 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2076 | */ | ||
| 2077 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2078 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2079 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2080 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2081 | #else | ||
| 2082 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 2083 | #endif | ||
| 2084 | |||
| 2085 | /* | ||
| 2086 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2087 | * | ||
| 2088 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 2089 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2090 | */ | ||
| 2091 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2092 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2093 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2094 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2095 | #else | ||
| 2096 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 2097 | #endif | ||
| 2098 | |||
| 2099 | /* | ||
| 2100 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2101 | * | ||
| 2102 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 2103 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2104 | */ | ||
| 2105 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2106 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2107 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2108 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2109 | #else | ||
| 2110 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 2111 | #endif | ||
| 2112 | |||
| 2113 | /* | ||
| 2114 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2115 | * | ||
| 2116 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 2117 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2118 | */ | ||
| 2119 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2120 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2121 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2122 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2123 | #else | ||
| 2124 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 2125 | #endif | ||
| 2126 | |||
| 2127 | /* | ||
| 2128 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 | ||
| 2129 | * | ||
| 2130 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 2131 | * but later deprecated in Mac OS X 10.11.2 | ||
| 2132 | */ | ||
| 2133 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2134 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_11_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2135 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2 | ||
| 2136 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE | ||
| 2137 | #else | ||
| 2138 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 2139 | #endif | ||
| 2140 | |||
| 2141 | /* | ||
| 2142 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 2143 | * | ||
| 2144 | * Used on declarations introduced in Mac OS X 10.11.3 | ||
| 2145 | */ | ||
| 2146 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2147 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_3, __IPHONE_COMPAT_VERSION) | ||
| 2148 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_3 | ||
| 2149 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 2150 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_3 | ||
| 2151 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 2152 | #else | ||
| 2153 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 2154 | #endif | ||
| 2155 | |||
| 2156 | /* | ||
| 2157 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED | ||
| 2158 | * | ||
| 2159 | * Used on declarations introduced in Mac OS X 10.11.3, | ||
| 2160 | * and deprecated in Mac OS X 10.11.3 | ||
| 2161 | */ | ||
| 2162 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2163 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_3, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2164 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2165 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 2166 | #else | ||
| 2167 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 2168 | #endif | ||
| 2169 | |||
| 2170 | /* | ||
| 2171 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2172 | * | ||
| 2173 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 2174 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2175 | */ | ||
| 2176 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2177 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2178 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2179 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2180 | #else | ||
| 2181 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 2182 | #endif | ||
| 2183 | |||
| 2184 | /* | ||
| 2185 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2186 | * | ||
| 2187 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 2188 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2189 | */ | ||
| 2190 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2191 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2192 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2193 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2194 | #else | ||
| 2195 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 2196 | #endif | ||
| 2197 | |||
| 2198 | /* | ||
| 2199 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2200 | * | ||
| 2201 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 2202 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2203 | */ | ||
| 2204 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2205 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2206 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2207 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2208 | #else | ||
| 2209 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 2210 | #endif | ||
| 2211 | |||
| 2212 | /* | ||
| 2213 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2214 | * | ||
| 2215 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 2216 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2217 | */ | ||
| 2218 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2219 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2220 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2221 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2222 | #else | ||
| 2223 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 2224 | #endif | ||
| 2225 | |||
| 2226 | /* | ||
| 2227 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2228 | * | ||
| 2229 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 2230 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2231 | */ | ||
| 2232 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2233 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2234 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2235 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2236 | #else | ||
| 2237 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 2238 | #endif | ||
| 2239 | |||
| 2240 | /* | ||
| 2241 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2242 | * | ||
| 2243 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 2244 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2245 | */ | ||
| 2246 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2247 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2248 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2249 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2250 | #else | ||
| 2251 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 2252 | #endif | ||
| 2253 | |||
| 2254 | /* | ||
| 2255 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2256 | * | ||
| 2257 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 2258 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2259 | */ | ||
| 2260 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2261 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2262 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2263 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2264 | #else | ||
| 2265 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 2266 | #endif | ||
| 2267 | |||
| 2268 | /* | ||
| 2269 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2270 | * | ||
| 2271 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 2272 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2273 | */ | ||
| 2274 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2275 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2276 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2277 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2278 | #else | ||
| 2279 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 2280 | #endif | ||
| 2281 | |||
| 2282 | /* | ||
| 2283 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2284 | * | ||
| 2285 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 2286 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2287 | */ | ||
| 2288 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2289 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2290 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2291 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2292 | #else | ||
| 2293 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 2294 | #endif | ||
| 2295 | |||
| 2296 | /* | ||
| 2297 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2298 | * | ||
| 2299 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 2300 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2301 | */ | ||
| 2302 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2303 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2304 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2305 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2306 | #else | ||
| 2307 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 2308 | #endif | ||
| 2309 | |||
| 2310 | /* | ||
| 2311 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2312 | * | ||
| 2313 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 2314 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2315 | */ | ||
| 2316 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2317 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2318 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2319 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2320 | #else | ||
| 2321 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 2322 | #endif | ||
| 2323 | |||
| 2324 | /* | ||
| 2325 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2326 | * | ||
| 2327 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 2328 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2329 | */ | ||
| 2330 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2331 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2332 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2333 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2334 | #else | ||
| 2335 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 2336 | #endif | ||
| 2337 | |||
| 2338 | /* | ||
| 2339 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2340 | * | ||
| 2341 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 2342 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2343 | */ | ||
| 2344 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2345 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2346 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2347 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2348 | #else | ||
| 2349 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 2350 | #endif | ||
| 2351 | |||
| 2352 | /* | ||
| 2353 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2354 | * | ||
| 2355 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 2356 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2357 | */ | ||
| 2358 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2359 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2360 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2361 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2362 | #else | ||
| 2363 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 2364 | #endif | ||
| 2365 | |||
| 2366 | /* | ||
| 2367 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 | ||
| 2368 | * | ||
| 2369 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 2370 | * but later deprecated in Mac OS X 10.11.3 | ||
| 2371 | */ | ||
| 2372 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2373 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_11_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2374 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3 | ||
| 2375 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE | ||
| 2376 | #else | ||
| 2377 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 2378 | #endif | ||
| 2379 | |||
| 2380 | /* | ||
| 2381 | * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 2382 | * | ||
| 2383 | * Used on declarations introduced in Mac OS X 10.11.4 | ||
| 2384 | */ | ||
| 2385 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2386 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_4, __IPHONE_COMPAT_VERSION) | ||
| 2387 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_4 | ||
| 2388 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 2389 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_4 | ||
| 2390 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 2391 | #else | ||
| 2392 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 2393 | #endif | ||
| 2394 | |||
| 2395 | /* | ||
| 2396 | * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED | ||
| 2397 | * | ||
| 2398 | * Used on declarations introduced in Mac OS X 10.11.4, | ||
| 2399 | * and deprecated in Mac OS X 10.11.4 | ||
| 2400 | */ | ||
| 2401 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2402 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_4, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2403 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2404 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 2405 | #else | ||
| 2406 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 2407 | #endif | ||
| 2408 | |||
| 2409 | /* | ||
| 2410 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2411 | * | ||
| 2412 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 2413 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2414 | */ | ||
| 2415 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2416 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2417 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2418 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2419 | #else | ||
| 2420 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 2421 | #endif | ||
| 2422 | |||
| 2423 | /* | ||
| 2424 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2425 | * | ||
| 2426 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 2427 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2428 | */ | ||
| 2429 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2430 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2431 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2432 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2433 | #else | ||
| 2434 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 2435 | #endif | ||
| 2436 | |||
| 2437 | /* | ||
| 2438 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2439 | * | ||
| 2440 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 2441 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2442 | */ | ||
| 2443 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2444 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2445 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2446 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2447 | #else | ||
| 2448 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 2449 | #endif | ||
| 2450 | |||
| 2451 | /* | ||
| 2452 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2453 | * | ||
| 2454 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 2455 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2456 | */ | ||
| 2457 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2458 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2459 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2460 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2461 | #else | ||
| 2462 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 2463 | #endif | ||
| 2464 | |||
| 2465 | /* | ||
| 2466 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2467 | * | ||
| 2468 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 2469 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2470 | */ | ||
| 2471 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2472 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2473 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2474 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2475 | #else | ||
| 2476 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 2477 | #endif | ||
| 2478 | |||
| 2479 | /* | ||
| 2480 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2481 | * | ||
| 2482 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 2483 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2484 | */ | ||
| 2485 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2486 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2487 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2488 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2489 | #else | ||
| 2490 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 2491 | #endif | ||
| 2492 | |||
| 2493 | /* | ||
| 2494 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2495 | * | ||
| 2496 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 2497 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2498 | */ | ||
| 2499 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2500 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2501 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2502 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2503 | #else | ||
| 2504 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 2505 | #endif | ||
| 2506 | |||
| 2507 | /* | ||
| 2508 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2509 | * | ||
| 2510 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 2511 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2512 | */ | ||
| 2513 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2514 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2515 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2516 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2517 | #else | ||
| 2518 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 2519 | #endif | ||
| 2520 | |||
| 2521 | /* | ||
| 2522 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2523 | * | ||
| 2524 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 2525 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2526 | */ | ||
| 2527 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2528 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2529 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2530 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2531 | #else | ||
| 2532 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 2533 | #endif | ||
| 2534 | |||
| 2535 | /* | ||
| 2536 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2537 | * | ||
| 2538 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 2539 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2540 | */ | ||
| 2541 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2542 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2543 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2544 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2545 | #else | ||
| 2546 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 2547 | #endif | ||
| 2548 | |||
| 2549 | /* | ||
| 2550 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2551 | * | ||
| 2552 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 2553 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2554 | */ | ||
| 2555 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2556 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2557 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2558 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2559 | #else | ||
| 2560 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 2561 | #endif | ||
| 2562 | |||
| 2563 | /* | ||
| 2564 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2565 | * | ||
| 2566 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 2567 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2568 | */ | ||
| 2569 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2570 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2571 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2572 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2573 | #else | ||
| 2574 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 2575 | #endif | ||
| 2576 | |||
| 2577 | /* | ||
| 2578 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2579 | * | ||
| 2580 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 2581 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2582 | */ | ||
| 2583 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2584 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2585 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2586 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2587 | #else | ||
| 2588 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 2589 | #endif | ||
| 2590 | |||
| 2591 | /* | ||
| 2592 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2593 | * | ||
| 2594 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 2595 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2596 | */ | ||
| 2597 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2598 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2599 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2600 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2601 | #else | ||
| 2602 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 2603 | #endif | ||
| 2604 | |||
| 2605 | /* | ||
| 2606 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2607 | * | ||
| 2608 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 2609 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2610 | */ | ||
| 2611 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2612 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2613 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2614 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2615 | #else | ||
| 2616 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 2617 | #endif | ||
| 2618 | |||
| 2619 | /* | ||
| 2620 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 | ||
| 2621 | * | ||
| 2622 | * Used on declarations introduced in Mac OS X 10.11.3, | ||
| 2623 | * but later deprecated in Mac OS X 10.11.4 | ||
| 2624 | */ | ||
| 2625 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2626 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_3, __MAC_10_11_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2627 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4 | ||
| 2628 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE | ||
| 2629 | #else | ||
| 2630 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 2631 | #endif | ||
| 2632 | |||
| 2633 | /* | ||
| 2634 | * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 2635 | * | ||
| 2636 | * Used on declarations introduced in Mac OS X 10.12 | ||
| 2637 | */ | ||
| 2638 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2639 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_COMPAT_VERSION) | ||
| 2640 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 | ||
| 2641 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 2642 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 | ||
| 2643 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 2644 | #else | ||
| 2645 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 2646 | #endif | ||
| 2647 | |||
| 2648 | /* | ||
| 2649 | * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED | ||
| 2650 | * | ||
| 2651 | * Used on declarations introduced in Mac OS X 10.12, | ||
| 2652 | * and deprecated in Mac OS X 10.12 | ||
| 2653 | */ | ||
| 2654 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2655 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2656 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2657 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 2658 | #else | ||
| 2659 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 2660 | #endif | ||
| 2661 | |||
| 2662 | /* | ||
| 2663 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2664 | * | ||
| 2665 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 2666 | * but later deprecated in Mac OS X 10.12 | ||
| 2667 | */ | ||
| 2668 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2669 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2670 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2671 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2672 | #else | ||
| 2673 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 2674 | #endif | ||
| 2675 | |||
| 2676 | /* | ||
| 2677 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2678 | * | ||
| 2679 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 2680 | * but later deprecated in Mac OS X 10.12 | ||
| 2681 | */ | ||
| 2682 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2683 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2684 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2685 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2686 | #else | ||
| 2687 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 2688 | #endif | ||
| 2689 | |||
| 2690 | /* | ||
| 2691 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2692 | * | ||
| 2693 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 2694 | * but later deprecated in Mac OS X 10.12 | ||
| 2695 | */ | ||
| 2696 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2697 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2698 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2699 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2700 | #else | ||
| 2701 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 2702 | #endif | ||
| 2703 | |||
| 2704 | /* | ||
| 2705 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2706 | * | ||
| 2707 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 2708 | * but later deprecated in Mac OS X 10.12 | ||
| 2709 | */ | ||
| 2710 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2711 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2712 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2713 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2714 | #else | ||
| 2715 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 2716 | #endif | ||
| 2717 | |||
| 2718 | /* | ||
| 2719 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2720 | * | ||
| 2721 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 2722 | * but later deprecated in Mac OS X 10.12 | ||
| 2723 | */ | ||
| 2724 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2725 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2726 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2727 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2728 | #else | ||
| 2729 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 2730 | #endif | ||
| 2731 | |||
| 2732 | /* | ||
| 2733 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2734 | * | ||
| 2735 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 2736 | * but later deprecated in Mac OS X 10.12 | ||
| 2737 | */ | ||
| 2738 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2739 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2740 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2741 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2742 | #else | ||
| 2743 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 2744 | #endif | ||
| 2745 | |||
| 2746 | /* | ||
| 2747 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2748 | * | ||
| 2749 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 2750 | * but later deprecated in Mac OS X 10.12 | ||
| 2751 | */ | ||
| 2752 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2753 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2754 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2755 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2756 | #else | ||
| 2757 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 2758 | #endif | ||
| 2759 | |||
| 2760 | /* | ||
| 2761 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2762 | * | ||
| 2763 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 2764 | * but later deprecated in Mac OS X 10.12 | ||
| 2765 | */ | ||
| 2766 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2767 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2768 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2769 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2770 | #else | ||
| 2771 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 2772 | #endif | ||
| 2773 | |||
| 2774 | /* | ||
| 2775 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2776 | * | ||
| 2777 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 2778 | * but later deprecated in Mac OS X 10.12 | ||
| 2779 | */ | ||
| 2780 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2781 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2782 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2783 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2784 | #else | ||
| 2785 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 2786 | #endif | ||
| 2787 | |||
| 2788 | /* | ||
| 2789 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2790 | * | ||
| 2791 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 2792 | * but later deprecated in Mac OS X 10.12 | ||
| 2793 | */ | ||
| 2794 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2795 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2796 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2797 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2798 | #else | ||
| 2799 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 2800 | #endif | ||
| 2801 | |||
| 2802 | /* | ||
| 2803 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2804 | * | ||
| 2805 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 2806 | * but later deprecated in Mac OS X 10.12 | ||
| 2807 | */ | ||
| 2808 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2809 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2810 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2811 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2812 | #else | ||
| 2813 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 2814 | #endif | ||
| 2815 | |||
| 2816 | /* | ||
| 2817 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2818 | * | ||
| 2819 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 2820 | * but later deprecated in Mac OS X 10.12 | ||
| 2821 | */ | ||
| 2822 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2823 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2824 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2825 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2826 | #else | ||
| 2827 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 2828 | #endif | ||
| 2829 | |||
| 2830 | /* | ||
| 2831 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2832 | * | ||
| 2833 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 2834 | * but later deprecated in Mac OS X 10.12 | ||
| 2835 | */ | ||
| 2836 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2837 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2838 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2839 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2840 | #else | ||
| 2841 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 2842 | #endif | ||
| 2843 | |||
| 2844 | /* | ||
| 2845 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2846 | * | ||
| 2847 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 2848 | * but later deprecated in Mac OS X 10.12 | ||
| 2849 | */ | ||
| 2850 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2851 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2852 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2853 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2854 | #else | ||
| 2855 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 2856 | #endif | ||
| 2857 | |||
| 2858 | /* | ||
| 2859 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2860 | * | ||
| 2861 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 2862 | * but later deprecated in Mac OS X 10.12 | ||
| 2863 | */ | ||
| 2864 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2865 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2866 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2867 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2868 | #else | ||
| 2869 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 2870 | #endif | ||
| 2871 | |||
| 2872 | /* | ||
| 2873 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2874 | * | ||
| 2875 | * Used on declarations introduced in Mac OS X 10.11.3, | ||
| 2876 | * but later deprecated in Mac OS X 10.12 | ||
| 2877 | */ | ||
| 2878 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2879 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_3, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2880 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2881 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2882 | #else | ||
| 2883 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 2884 | #endif | ||
| 2885 | |||
| 2886 | /* | ||
| 2887 | * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 | ||
| 2888 | * | ||
| 2889 | * Used on declarations introduced in Mac OS X 10.11.4, | ||
| 2890 | * but later deprecated in Mac OS X 10.12 | ||
| 2891 | */ | ||
| 2892 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2893 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_4, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2894 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 2895 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE | ||
| 2896 | #else | ||
| 2897 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 2898 | #endif | ||
| 2899 | |||
| 2900 | /* | ||
| 2901 | * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER | ||
| 2902 | * | ||
| 2903 | * Used on declarations introduced in Mac OS X 10.12.1 | ||
| 2904 | */ | ||
| 2905 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2906 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_1, __IPHONE_COMPAT_VERSION) | ||
| 2907 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_1 | ||
| 2908 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 2909 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1 | ||
| 2910 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 2911 | #else | ||
| 2912 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER | ||
| 2913 | #endif | ||
| 2914 | |||
| 2915 | /* | ||
| 2916 | * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED | ||
| 2917 | * | ||
| 2918 | * Used on declarations introduced in Mac OS X 10.12.1, | ||
| 2919 | * and deprecated in Mac OS X 10.12.1 | ||
| 2920 | */ | ||
| 2921 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2922 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12_1, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2923 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 2924 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 2925 | #else | ||
| 2926 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER | ||
| 2927 | #endif | ||
| 2928 | |||
| 2929 | /* | ||
| 2930 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 2931 | * | ||
| 2932 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 2933 | * but later deprecated in Mac OS X 10.12.1 | ||
| 2934 | */ | ||
| 2935 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2936 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2937 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 2938 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 2939 | #else | ||
| 2940 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 2941 | #endif | ||
| 2942 | |||
| 2943 | /* | ||
| 2944 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 2945 | * | ||
| 2946 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 2947 | * but later deprecated in Mac OS X 10.12.1 | ||
| 2948 | */ | ||
| 2949 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2950 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2951 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 2952 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 2953 | #else | ||
| 2954 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 2955 | #endif | ||
| 2956 | |||
| 2957 | /* | ||
| 2958 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 2959 | * | ||
| 2960 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 2961 | * but later deprecated in Mac OS X 10.12.1 | ||
| 2962 | */ | ||
| 2963 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2964 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2965 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 2966 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 2967 | #else | ||
| 2968 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 2969 | #endif | ||
| 2970 | |||
| 2971 | /* | ||
| 2972 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 2973 | * | ||
| 2974 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 2975 | * but later deprecated in Mac OS X 10.12.1 | ||
| 2976 | */ | ||
| 2977 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2978 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2979 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 2980 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 2981 | #else | ||
| 2982 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 2983 | #endif | ||
| 2984 | |||
| 2985 | /* | ||
| 2986 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 2987 | * | ||
| 2988 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 2989 | * but later deprecated in Mac OS X 10.12.1 | ||
| 2990 | */ | ||
| 2991 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 2992 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 2993 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 2994 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 2995 | #else | ||
| 2996 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 2997 | #endif | ||
| 2998 | |||
| 2999 | /* | ||
| 3000 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3001 | * | ||
| 3002 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 3003 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3004 | */ | ||
| 3005 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3006 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3007 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3008 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3009 | #else | ||
| 3010 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 3011 | #endif | ||
| 3012 | |||
| 3013 | /* | ||
| 3014 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3015 | * | ||
| 3016 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 3017 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3018 | */ | ||
| 3019 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3020 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3021 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3022 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3023 | #else | ||
| 3024 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 3025 | #endif | ||
| 3026 | |||
| 3027 | /* | ||
| 3028 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3029 | * | ||
| 3030 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 3031 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3032 | */ | ||
| 3033 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3034 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3035 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3036 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3037 | #else | ||
| 3038 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 3039 | #endif | ||
| 3040 | |||
| 3041 | /* | ||
| 3042 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3043 | * | ||
| 3044 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 3045 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3046 | */ | ||
| 3047 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3048 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3049 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3050 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3051 | #else | ||
| 3052 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 3053 | #endif | ||
| 3054 | |||
| 3055 | /* | ||
| 3056 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3057 | * | ||
| 3058 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 3059 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3060 | */ | ||
| 3061 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3062 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3063 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3064 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3065 | #else | ||
| 3066 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 3067 | #endif | ||
| 3068 | |||
| 3069 | /* | ||
| 3070 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3071 | * | ||
| 3072 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 3073 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3074 | */ | ||
| 3075 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3076 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3077 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3078 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3079 | #else | ||
| 3080 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 3081 | #endif | ||
| 3082 | |||
| 3083 | /* | ||
| 3084 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3085 | * | ||
| 3086 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 3087 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3088 | */ | ||
| 3089 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3090 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3091 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3092 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3093 | #else | ||
| 3094 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 3095 | #endif | ||
| 3096 | |||
| 3097 | /* | ||
| 3098 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3099 | * | ||
| 3100 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 3101 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3102 | */ | ||
| 3103 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3104 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3105 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3106 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3107 | #else | ||
| 3108 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 3109 | #endif | ||
| 3110 | |||
| 3111 | /* | ||
| 3112 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3113 | * | ||
| 3114 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 3115 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3116 | */ | ||
| 3117 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3118 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3119 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3120 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3121 | #else | ||
| 3122 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 3123 | #endif | ||
| 3124 | |||
| 3125 | /* | ||
| 3126 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3127 | * | ||
| 3128 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 3129 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3130 | */ | ||
| 3131 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3132 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3133 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3134 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3135 | #else | ||
| 3136 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 3137 | #endif | ||
| 3138 | |||
| 3139 | /* | ||
| 3140 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3141 | * | ||
| 3142 | * Used on declarations introduced in Mac OS X 10.11.3, | ||
| 3143 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3144 | */ | ||
| 3145 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3146 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_3, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3147 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3148 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3149 | #else | ||
| 3150 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 3151 | #endif | ||
| 3152 | |||
| 3153 | /* | ||
| 3154 | * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3155 | * | ||
| 3156 | * Used on declarations introduced in Mac OS X 10.11.4, | ||
| 3157 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3158 | */ | ||
| 3159 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3160 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_4, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3161 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3162 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3163 | #else | ||
| 3164 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 3165 | #endif | ||
| 3166 | |||
| 3167 | /* | ||
| 3168 | * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 | ||
| 3169 | * | ||
| 3170 | * Used on declarations introduced in Mac OS X 10.12, | ||
| 3171 | * but later deprecated in Mac OS X 10.12.1 | ||
| 3172 | */ | ||
| 3173 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3174 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_12_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3175 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1 | ||
| 3176 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE | ||
| 3177 | #else | ||
| 3178 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 3179 | #endif | ||
| 3180 | |||
| 3181 | /* | ||
| 3182 | * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER | ||
| 3183 | * | ||
| 3184 | * Used on declarations introduced in Mac OS X 10.12.2 | ||
| 3185 | */ | ||
| 3186 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3187 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_2, __IPHONE_COMPAT_VERSION) | ||
| 3188 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_2 | ||
| 3189 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 3190 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_2 | ||
| 3191 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 3192 | #else | ||
| 3193 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER | ||
| 3194 | #endif | ||
| 3195 | |||
| 3196 | /* | ||
| 3197 | * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED | ||
| 3198 | * | ||
| 3199 | * Used on declarations introduced in Mac OS X 10.12.2, | ||
| 3200 | * and deprecated in Mac OS X 10.12.2 | ||
| 3201 | */ | ||
| 3202 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3203 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12_2, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3204 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3205 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 3206 | #else | ||
| 3207 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER | ||
| 3208 | #endif | ||
| 3209 | |||
| 3210 | /* | ||
| 3211 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3212 | * | ||
| 3213 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 3214 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3215 | */ | ||
| 3216 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3217 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3218 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3219 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3220 | #else | ||
| 3221 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 3222 | #endif | ||
| 3223 | |||
| 3224 | /* | ||
| 3225 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3226 | * | ||
| 3227 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 3228 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3229 | */ | ||
| 3230 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3231 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3232 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3233 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3234 | #else | ||
| 3235 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 3236 | #endif | ||
| 3237 | |||
| 3238 | /* | ||
| 3239 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3240 | * | ||
| 3241 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 3242 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3243 | */ | ||
| 3244 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3245 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3246 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3247 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3248 | #else | ||
| 3249 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 3250 | #endif | ||
| 3251 | |||
| 3252 | /* | ||
| 3253 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3254 | * | ||
| 3255 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 3256 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3257 | */ | ||
| 3258 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3259 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3260 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3261 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3262 | #else | ||
| 3263 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 3264 | #endif | ||
| 3265 | |||
| 3266 | /* | ||
| 3267 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3268 | * | ||
| 3269 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 3270 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3271 | */ | ||
| 3272 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3273 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3274 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3275 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3276 | #else | ||
| 3277 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 3278 | #endif | ||
| 3279 | |||
| 3280 | /* | ||
| 3281 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3282 | * | ||
| 3283 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 3284 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3285 | */ | ||
| 3286 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3287 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3288 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3289 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3290 | #else | ||
| 3291 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 3292 | #endif | ||
| 3293 | |||
| 3294 | /* | ||
| 3295 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3296 | * | ||
| 3297 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 3298 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3299 | */ | ||
| 3300 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3301 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3302 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3303 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3304 | #else | ||
| 3305 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 3306 | #endif | ||
| 3307 | |||
| 3308 | /* | ||
| 3309 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3310 | * | ||
| 3311 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 3312 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3313 | */ | ||
| 3314 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3315 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3316 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3317 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3318 | #else | ||
| 3319 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 3320 | #endif | ||
| 3321 | |||
| 3322 | /* | ||
| 3323 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3324 | * | ||
| 3325 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 3326 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3327 | */ | ||
| 3328 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3329 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3330 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3331 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3332 | #else | ||
| 3333 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 3334 | #endif | ||
| 3335 | |||
| 3336 | /* | ||
| 3337 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3338 | * | ||
| 3339 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 3340 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3341 | */ | ||
| 3342 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3343 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3344 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3345 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3346 | #else | ||
| 3347 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 3348 | #endif | ||
| 3349 | |||
| 3350 | /* | ||
| 3351 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3352 | * | ||
| 3353 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 3354 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3355 | */ | ||
| 3356 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3357 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3358 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3359 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3360 | #else | ||
| 3361 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 3362 | #endif | ||
| 3363 | |||
| 3364 | /* | ||
| 3365 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3366 | * | ||
| 3367 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 3368 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3369 | */ | ||
| 3370 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3371 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3372 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3373 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3374 | #else | ||
| 3375 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 3376 | #endif | ||
| 3377 | |||
| 3378 | /* | ||
| 3379 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3380 | * | ||
| 3381 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 3382 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3383 | */ | ||
| 3384 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3385 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3386 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3387 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3388 | #else | ||
| 3389 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 3390 | #endif | ||
| 3391 | |||
| 3392 | /* | ||
| 3393 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3394 | * | ||
| 3395 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 3396 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3397 | */ | ||
| 3398 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3399 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3400 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3401 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3402 | #else | ||
| 3403 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 3404 | #endif | ||
| 3405 | |||
| 3406 | /* | ||
| 3407 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3408 | * | ||
| 3409 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 3410 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3411 | */ | ||
| 3412 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3413 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3414 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3415 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3416 | #else | ||
| 3417 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 3418 | #endif | ||
| 3419 | |||
| 3420 | /* | ||
| 3421 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3422 | * | ||
| 3423 | * Used on declarations introduced in Mac OS X 10.11.3, | ||
| 3424 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3425 | */ | ||
| 3426 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3427 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_3, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3428 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3429 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3430 | #else | ||
| 3431 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 3432 | #endif | ||
| 3433 | |||
| 3434 | /* | ||
| 3435 | * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3436 | * | ||
| 3437 | * Used on declarations introduced in Mac OS X 10.11.4, | ||
| 3438 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3439 | */ | ||
| 3440 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3441 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_4, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3442 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3443 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3444 | #else | ||
| 3445 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 3446 | #endif | ||
| 3447 | |||
| 3448 | /* | ||
| 3449 | * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3450 | * | ||
| 3451 | * Used on declarations introduced in Mac OS X 10.12, | ||
| 3452 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3453 | */ | ||
| 3454 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3455 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3456 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3457 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3458 | #else | ||
| 3459 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 3460 | #endif | ||
| 3461 | |||
| 3462 | /* | ||
| 3463 | * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 | ||
| 3464 | * | ||
| 3465 | * Used on declarations introduced in Mac OS X 10.12.1, | ||
| 3466 | * but later deprecated in Mac OS X 10.12.2 | ||
| 3467 | */ | ||
| 3468 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3469 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12_1, __MAC_10_12_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3470 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2 | ||
| 3471 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE | ||
| 3472 | #else | ||
| 3473 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER | ||
| 3474 | #endif | ||
| 3475 | |||
| 3476 | /* | ||
| 3477 | * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER | ||
| 3478 | * | ||
| 3479 | * Used on declarations introduced in Mac OS X 10.12.4 | ||
| 3480 | */ | ||
| 3481 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3482 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_4, __IPHONE_COMPAT_VERSION) | ||
| 3483 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_4 | ||
| 3484 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 3485 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_4 | ||
| 3486 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 3487 | #else | ||
| 3488 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER | ||
| 3489 | #endif | ||
| 3490 | |||
| 3491 | /* | ||
| 3492 | * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED | ||
| 3493 | * | ||
| 3494 | * Used on declarations introduced in Mac OS X 10.12.4, | ||
| 3495 | * and deprecated in Mac OS X 10.12.4 | ||
| 3496 | */ | ||
| 3497 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3498 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12_4, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3499 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3500 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE | ||
| 3501 | #else | ||
| 3502 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER | ||
| 3503 | #endif | ||
| 3504 | |||
| 3505 | /* | ||
| 3506 | * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3507 | * | ||
| 3508 | * Used on declarations introduced in Mac OS X 10.0, | ||
| 3509 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3510 | */ | ||
| 3511 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3512 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3513 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3514 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3515 | #else | ||
| 3516 | #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER | ||
| 3517 | #endif | ||
| 3518 | |||
| 3519 | /* | ||
| 3520 | * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3521 | * | ||
| 3522 | * Used on declarations introduced in Mac OS X 10.1, | ||
| 3523 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3524 | */ | ||
| 3525 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3526 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3527 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3528 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3529 | #else | ||
| 3530 | #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 3531 | #endif | ||
| 3532 | |||
| 3533 | /* | ||
| 3534 | * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3535 | * | ||
| 3536 | * Used on declarations introduced in Mac OS X 10.2, | ||
| 3537 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3538 | */ | ||
| 3539 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3540 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3541 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3542 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3543 | #else | ||
| 3544 | #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 3545 | #endif | ||
| 3546 | |||
| 3547 | /* | ||
| 3548 | * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3549 | * | ||
| 3550 | * Used on declarations introduced in Mac OS X 10.3, | ||
| 3551 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3552 | */ | ||
| 3553 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3554 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3555 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3556 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3557 | #else | ||
| 3558 | #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 3559 | #endif | ||
| 3560 | |||
| 3561 | /* | ||
| 3562 | * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3563 | * | ||
| 3564 | * Used on declarations introduced in Mac OS X 10.4, | ||
| 3565 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3566 | */ | ||
| 3567 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3568 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3569 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3570 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3571 | #else | ||
| 3572 | #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 3573 | #endif | ||
| 3574 | |||
| 3575 | /* | ||
| 3576 | * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3577 | * | ||
| 3578 | * Used on declarations introduced in Mac OS X 10.5, | ||
| 3579 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3580 | */ | ||
| 3581 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3582 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3583 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3584 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3585 | #else | ||
| 3586 | #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 3587 | #endif | ||
| 3588 | |||
| 3589 | /* | ||
| 3590 | * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3591 | * | ||
| 3592 | * Used on declarations introduced in Mac OS X 10.6, | ||
| 3593 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3594 | */ | ||
| 3595 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3596 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3597 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3598 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3599 | #else | ||
| 3600 | #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 3601 | #endif | ||
| 3602 | |||
| 3603 | /* | ||
| 3604 | * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3605 | * | ||
| 3606 | * Used on declarations introduced in Mac OS X 10.7, | ||
| 3607 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3608 | */ | ||
| 3609 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3610 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3611 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3612 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3613 | #else | ||
| 3614 | #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 3615 | #endif | ||
| 3616 | |||
| 3617 | /* | ||
| 3618 | * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3619 | * | ||
| 3620 | * Used on declarations introduced in Mac OS X 10.8, | ||
| 3621 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3622 | */ | ||
| 3623 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3624 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_8, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3625 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3626 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3627 | #else | ||
| 3628 | #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 3629 | #endif | ||
| 3630 | |||
| 3631 | /* | ||
| 3632 | * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3633 | * | ||
| 3634 | * Used on declarations introduced in Mac OS X 10.9, | ||
| 3635 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3636 | */ | ||
| 3637 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3638 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_9, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3639 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3640 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3641 | #else | ||
| 3642 | #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 3643 | #endif | ||
| 3644 | |||
| 3645 | /* | ||
| 3646 | * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3647 | * | ||
| 3648 | * Used on declarations introduced in Mac OS X 10.10, | ||
| 3649 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3650 | */ | ||
| 3651 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3652 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3653 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3654 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3655 | #else | ||
| 3656 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 3657 | #endif | ||
| 3658 | |||
| 3659 | /* | ||
| 3660 | * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3661 | * | ||
| 3662 | * Used on declarations introduced in Mac OS X 10.10.2, | ||
| 3663 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3664 | */ | ||
| 3665 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3666 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_2, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3667 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3668 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3669 | #else | ||
| 3670 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER | ||
| 3671 | #endif | ||
| 3672 | |||
| 3673 | /* | ||
| 3674 | * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3675 | * | ||
| 3676 | * Used on declarations introduced in Mac OS X 10.10.3, | ||
| 3677 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3678 | */ | ||
| 3679 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3680 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_10_3, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3681 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3682 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3683 | #else | ||
| 3684 | #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER | ||
| 3685 | #endif | ||
| 3686 | |||
| 3687 | /* | ||
| 3688 | * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3689 | * | ||
| 3690 | * Used on declarations introduced in Mac OS X 10.11, | ||
| 3691 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3692 | */ | ||
| 3693 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3694 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3695 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3696 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3697 | #else | ||
| 3698 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 3699 | #endif | ||
| 3700 | |||
| 3701 | /* | ||
| 3702 | * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3703 | * | ||
| 3704 | * Used on declarations introduced in Mac OS X 10.11.2, | ||
| 3705 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3706 | */ | ||
| 3707 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3708 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_2, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3709 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3710 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3711 | #else | ||
| 3712 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER | ||
| 3713 | #endif | ||
| 3714 | |||
| 3715 | /* | ||
| 3716 | * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3717 | * | ||
| 3718 | * Used on declarations introduced in Mac OS X 10.11.3, | ||
| 3719 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3720 | */ | ||
| 3721 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3722 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_3, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3723 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3724 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3725 | #else | ||
| 3726 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER | ||
| 3727 | #endif | ||
| 3728 | |||
| 3729 | /* | ||
| 3730 | * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3731 | * | ||
| 3732 | * Used on declarations introduced in Mac OS X 10.11.4, | ||
| 3733 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3734 | */ | ||
| 3735 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3736 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_11_4, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3737 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3738 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3739 | #else | ||
| 3740 | #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER | ||
| 3741 | #endif | ||
| 3742 | |||
| 3743 | /* | ||
| 3744 | * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3745 | * | ||
| 3746 | * Used on declarations introduced in Mac OS X 10.12, | ||
| 3747 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3748 | */ | ||
| 3749 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3750 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3751 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3752 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3753 | #else | ||
| 3754 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 3755 | #endif | ||
| 3756 | |||
| 3757 | /* | ||
| 3758 | * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3759 | * | ||
| 3760 | * Used on declarations introduced in Mac OS X 10.12.1, | ||
| 3761 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3762 | */ | ||
| 3763 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3764 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12_1, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3765 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3766 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3767 | #else | ||
| 3768 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER | ||
| 3769 | #endif | ||
| 3770 | |||
| 3771 | /* | ||
| 3772 | * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 | ||
| 3773 | * | ||
| 3774 | * Used on declarations introduced in Mac OS X 10.12.2, | ||
| 3775 | * but later deprecated in Mac OS X 10.12.4 | ||
| 3776 | */ | ||
| 3777 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3778 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12_2, __MAC_10_12_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3779 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4 | ||
| 3780 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE | ||
| 3781 | #else | ||
| 3782 | #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER | ||
| 3783 | #endif | ||
| 3784 | |||
| 3785 | /* | ||
| 3786 | * AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER | ||
| 3787 | * | ||
| 3788 | * Used on declarations introduced in Mac OS X 10.13 | ||
| 3789 | */ | ||
| 3790 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3791 | #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_COMPAT_VERSION) | ||
| 3792 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13 | ||
| 3793 | #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 3794 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13 | ||
| 3795 | #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 3796 | #else | ||
| 3797 | #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER | ||
| 3798 | #endif | ||
| 3799 | |||
| 3800 | /* | ||
| 3801 | * AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER | ||
| 3802 | * | ||
| 3803 | * Used on declarations introduced in Mac OS X 10.14 | ||
| 3804 | */ | ||
| 3805 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3806 | #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_14, __IPHONE_COMPAT_VERSION) | ||
| 3807 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_14 | ||
| 3808 | #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 3809 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 | ||
| 3810 | #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 3811 | #else | ||
| 3812 | #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER | ||
| 3813 | #endif | ||
| 3814 | |||
| 3815 | /* | ||
| 3816 | * AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER | ||
| 3817 | * | ||
| 3818 | * Used on declarations introduced in Mac OS X 10.15 | ||
| 3819 | */ | ||
| 3820 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3821 | #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_15, __IPHONE_COMPAT_VERSION) | ||
| 3822 | #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_15 | ||
| 3823 | #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER UNAVAILABLE_ATTRIBUTE | ||
| 3824 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15 | ||
| 3825 | #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER WEAK_IMPORT_ATTRIBUTE | ||
| 3826 | #else | ||
| 3827 | #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER | ||
| 3828 | #endif | ||
| 3829 | |||
| 3830 | /* | ||
| 3831 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 3832 | * | ||
| 3833 | * Used on types deprecated in Mac OS X 10.1 | ||
| 3834 | */ | ||
| 3835 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3836 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_1, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3837 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1 | ||
| 3838 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3839 | #else | ||
| 3840 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER | ||
| 3841 | #endif | ||
| 3842 | |||
| 3843 | /* | ||
| 3844 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 3845 | * | ||
| 3846 | * Used on types deprecated in Mac OS X 10.2 | ||
| 3847 | */ | ||
| 3848 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3849 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_2, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3850 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 | ||
| 3851 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3852 | #else | ||
| 3853 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER | ||
| 3854 | #endif | ||
| 3855 | |||
| 3856 | /* | ||
| 3857 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 3858 | * | ||
| 3859 | * Used on types deprecated in Mac OS X 10.3 | ||
| 3860 | */ | ||
| 3861 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3862 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_3, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3863 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 | ||
| 3864 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3865 | #else | ||
| 3866 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER | ||
| 3867 | #endif | ||
| 3868 | |||
| 3869 | /* | ||
| 3870 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 3871 | * | ||
| 3872 | * Used on types deprecated in Mac OS X 10.4 | ||
| 3873 | */ | ||
| 3874 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3875 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3876 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 | ||
| 3877 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3878 | #else | ||
| 3879 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER | ||
| 3880 | #endif | ||
| 3881 | |||
| 3882 | |||
| 3883 | /* | ||
| 3884 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 3885 | * | ||
| 3886 | * Used on types deprecated in Mac OS X 10.5 | ||
| 3887 | */ | ||
| 3888 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3889 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3890 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 | ||
| 3891 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3892 | #else | ||
| 3893 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER | ||
| 3894 | #endif | ||
| 3895 | |||
| 3896 | /* | ||
| 3897 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 3898 | * | ||
| 3899 | * Used on types deprecated in Mac OS X 10.6 | ||
| 3900 | */ | ||
| 3901 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3902 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3903 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 | ||
| 3904 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3905 | #else | ||
| 3906 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER | ||
| 3907 | #endif | ||
| 3908 | |||
| 3909 | /* | ||
| 3910 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 3911 | * | ||
| 3912 | * Used on types deprecated in Mac OS X 10.7 | ||
| 3913 | */ | ||
| 3914 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3915 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_7, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3916 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 | ||
| 3917 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3918 | #else | ||
| 3919 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER | ||
| 3920 | #endif | ||
| 3921 | |||
| 3922 | /* | ||
| 3923 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 3924 | * | ||
| 3925 | * Used on types deprecated in Mac OS X 10.8 | ||
| 3926 | */ | ||
| 3927 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3928 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3929 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 | ||
| 3930 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3931 | #else | ||
| 3932 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER | ||
| 3933 | #endif | ||
| 3934 | |||
| 3935 | /* | ||
| 3936 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 3937 | * | ||
| 3938 | * Used on types deprecated in Mac OS X 10.9 | ||
| 3939 | */ | ||
| 3940 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3941 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3942 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 | ||
| 3943 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3944 | #else | ||
| 3945 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER | ||
| 3946 | #endif | ||
| 3947 | |||
| 3948 | /* | ||
| 3949 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 3950 | * | ||
| 3951 | * Used on types deprecated in Mac OS X 10.10 | ||
| 3952 | */ | ||
| 3953 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3954 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_10, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3955 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 | ||
| 3956 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3957 | #else | ||
| 3958 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER | ||
| 3959 | #endif | ||
| 3960 | |||
| 3961 | /* | ||
| 3962 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 3963 | * | ||
| 3964 | * Used on types deprecated in Mac OS X 10.11 | ||
| 3965 | */ | ||
| 3966 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3967 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_11, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3968 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 | ||
| 3969 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3970 | #else | ||
| 3971 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER | ||
| 3972 | #endif | ||
| 3973 | |||
| 3974 | /* | ||
| 3975 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 3976 | * | ||
| 3977 | * Used on types deprecated in Mac OS X 10.12 | ||
| 3978 | */ | ||
| 3979 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3980 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_12, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3981 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 3982 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3983 | #else | ||
| 3984 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER | ||
| 3985 | #endif | ||
| 3986 | |||
| 3987 | /* | ||
| 3988 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER | ||
| 3989 | * | ||
| 3990 | * Used on types deprecated in Mac OS X 10.13 | ||
| 3991 | */ | ||
| 3992 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 3993 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_13, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 3994 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 | ||
| 3995 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 3996 | #else | ||
| 3997 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER | ||
| 3998 | #endif | ||
| 3999 | |||
| 4000 | /* | ||
| 4001 | * DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER | ||
| 4002 | * | ||
| 4003 | * Used on types deprecated in Mac OS X 10.14.4 | ||
| 4004 | */ | ||
| 4005 | #if __AVAILABILITY_MACROS_USES_AVAILABILITY | ||
| 4006 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_14_4, __IPHONE_COMPAT_VERSION, __IPHONE_COMPAT_VERSION) | ||
| 4007 | #elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14_4 | ||
| 4008 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER DEPRECATED_ATTRIBUTE | ||
| 4009 | #else | ||
| 4010 | #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER | ||
| 4011 | #endif | ||
| 4012 | |||
| 4013 | #endif /* __AVAILABILITYMACROS__ */ | ||
| 4014 | |||
| 4015 | |||
lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h created+208| ... | @@ -0,0 +1,208 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2019 by Apple Inc.. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __AVAILABILITY_VERSIONS__ | ||
| 25 | #define __AVAILABILITY_VERSIONS__ | ||
| 26 | |||
| 27 | #define __MAC_10_0 1000 | ||
| 28 | #define __MAC_10_1 1010 | ||
| 29 | #define __MAC_10_2 1020 | ||
| 30 | #define __MAC_10_3 1030 | ||
| 31 | #define __MAC_10_4 1040 | ||
| 32 | #define __MAC_10_5 1050 | ||
| 33 | #define __MAC_10_6 1060 | ||
| 34 | #define __MAC_10_7 1070 | ||
| 35 | #define __MAC_10_8 1080 | ||
| 36 | #define __MAC_10_9 1090 | ||
| 37 | #define __MAC_10_10 101000 | ||
| 38 | #define __MAC_10_10_2 101002 | ||
| 39 | #define __MAC_10_10_3 101003 | ||
| 40 | #define __MAC_10_11 101100 | ||
| 41 | #define __MAC_10_11_2 101102 | ||
| 42 | #define __MAC_10_11_3 101103 | ||
| 43 | #define __MAC_10_11_4 101104 | ||
| 44 | #define __MAC_10_12 101200 | ||
| 45 | #define __MAC_10_12_1 101201 | ||
| 46 | #define __MAC_10_12_2 101202 | ||
| 47 | #define __MAC_10_12_4 101204 | ||
| 48 | #define __MAC_10_13 101300 | ||
| 49 | #define __MAC_10_13_1 101301 | ||
| 50 | #define __MAC_10_13_2 101302 | ||
| 51 | #define __MAC_10_13_4 101304 | ||
| 52 | #define __MAC_10_14 101400 | ||
| 53 | #define __MAC_10_14_1 101401 | ||
| 54 | #define __MAC_10_14_4 101404 | ||
| 55 | #define __MAC_10_14_6 101406 | ||
| 56 | #define __MAC_10_15 101500 | ||
| 57 | #define __MAC_10_15_1 101501 | ||
| 58 | #define __MAC_10_15_4 101504 | ||
| 59 | #define __MAC_10_16 101600 | ||
| 60 | #define __MAC_11_0 110000 | ||
| 61 | /* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ | ||
| 62 | |||
| 63 | #define __IPHONE_2_0 20000 | ||
| 64 | #define __IPHONE_2_1 20100 | ||
| 65 | #define __IPHONE_2_2 20200 | ||
| 66 | #define __IPHONE_3_0 30000 | ||
| 67 | #define __IPHONE_3_1 30100 | ||
| 68 | #define __IPHONE_3_2 30200 | ||
| 69 | #define __IPHONE_4_0 40000 | ||
| 70 | #define __IPHONE_4_1 40100 | ||
| 71 | #define __IPHONE_4_2 40200 | ||
| 72 | #define __IPHONE_4_3 40300 | ||
| 73 | #define __IPHONE_5_0 50000 | ||
| 74 | #define __IPHONE_5_1 50100 | ||
| 75 | #define __IPHONE_6_0 60000 | ||
| 76 | #define __IPHONE_6_1 60100 | ||
| 77 | #define __IPHONE_7_0 70000 | ||
| 78 | #define __IPHONE_7_1 70100 | ||
| 79 | #define __IPHONE_8_0 80000 | ||
| 80 | #define __IPHONE_8_1 80100 | ||
| 81 | #define __IPHONE_8_2 80200 | ||
| 82 | #define __IPHONE_8_3 80300 | ||
| 83 | #define __IPHONE_8_4 80400 | ||
| 84 | #define __IPHONE_9_0 90000 | ||
| 85 | #define __IPHONE_9_1 90100 | ||
| 86 | #define __IPHONE_9_2 90200 | ||
| 87 | #define __IPHONE_9_3 90300 | ||
| 88 | #define __IPHONE_10_0 100000 | ||
| 89 | #define __IPHONE_10_1 100100 | ||
| 90 | #define __IPHONE_10_2 100200 | ||
| 91 | #define __IPHONE_10_3 100300 | ||
| 92 | #define __IPHONE_11_0 110000 | ||
| 93 | #define __IPHONE_11_1 110100 | ||
| 94 | #define __IPHONE_11_2 110200 | ||
| 95 | #define __IPHONE_11_3 110300 | ||
| 96 | #define __IPHONE_11_4 110400 | ||
| 97 | #define __IPHONE_12_0 120000 | ||
| 98 | #define __IPHONE_12_1 120100 | ||
| 99 | #define __IPHONE_12_2 120200 | ||
| 100 | #define __IPHONE_12_3 120300 | ||
| 101 | #define __IPHONE_12_4 120400 | ||
| 102 | #define __IPHONE_13_0 130000 | ||
| 103 | #define __IPHONE_13_1 130100 | ||
| 104 | #define __IPHONE_13_2 130200 | ||
| 105 | #define __IPHONE_13_3 130300 | ||
| 106 | #define __IPHONE_13_4 130400 | ||
| 107 | #define __IPHONE_13_5 130500 | ||
| 108 | #define __IPHONE_13_6 130600 | ||
| 109 | #define __IPHONE_13_7 130700 | ||
| 110 | #define __IPHONE_14_0 140000 | ||
| 111 | #define __IPHONE_14_1 140100 | ||
| 112 | #define __IPHONE_14_2 140200 | ||
| 113 | /* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ | ||
| 114 | |||
| 115 | #define __TVOS_9_0 90000 | ||
| 116 | #define __TVOS_9_1 90100 | ||
| 117 | #define __TVOS_9_2 90200 | ||
| 118 | #define __TVOS_10_0 100000 | ||
| 119 | #define __TVOS_10_0_1 100001 | ||
| 120 | #define __TVOS_10_1 100100 | ||
| 121 | #define __TVOS_10_2 100200 | ||
| 122 | #define __TVOS_11_0 110000 | ||
| 123 | #define __TVOS_11_1 110100 | ||
| 124 | #define __TVOS_11_2 110200 | ||
| 125 | #define __TVOS_11_3 110300 | ||
| 126 | #define __TVOS_11_4 110400 | ||
| 127 | #define __TVOS_12_0 120000 | ||
| 128 | #define __TVOS_12_1 120100 | ||
| 129 | #define __TVOS_12_2 120200 | ||
| 130 | #define __TVOS_12_3 120300 | ||
| 131 | #define __TVOS_12_4 120400 | ||
| 132 | #define __TVOS_13_0 130000 | ||
| 133 | #define __TVOS_13_2 130200 | ||
| 134 | #define __TVOS_13_3 130300 | ||
| 135 | #define __TVOS_13_4 130400 | ||
| 136 | #define __TVOS_14_0 140000 | ||
| 137 | #define __TVOS_14_1 140100 | ||
| 138 | #define __TVOS_14_2 140200 | ||
| 139 | |||
| 140 | #define __WATCHOS_1_0 10000 | ||
| 141 | #define __WATCHOS_2_0 20000 | ||
| 142 | #define __WATCHOS_2_1 20100 | ||
| 143 | #define __WATCHOS_2_2 20200 | ||
| 144 | #define __WATCHOS_3_0 30000 | ||
| 145 | #define __WATCHOS_3_1 30100 | ||
| 146 | #define __WATCHOS_3_1_1 30101 | ||
| 147 | #define __WATCHOS_3_2 30200 | ||
| 148 | #define __WATCHOS_4_0 40000 | ||
| 149 | #define __WATCHOS_4_1 40100 | ||
| 150 | #define __WATCHOS_4_2 40200 | ||
| 151 | #define __WATCHOS_4_3 40300 | ||
| 152 | #define __WATCHOS_5_0 50000 | ||
| 153 | #define __WATCHOS_5_1 50100 | ||
| 154 | #define __WATCHOS_5_2 50200 | ||
| 155 | #define __WATCHOS_5_3 50300 | ||
| 156 | #define __WATCHOS_6_0 60000 | ||
| 157 | #define __WATCHOS_6_1 60100 | ||
| 158 | #define __WATCHOS_6_2 60200 | ||
| 159 | #define __WATCHOS_7_0 70000 | ||
| 160 | #define __WATCHOS_7_1 70100 | ||
| 161 | |||
| 162 | /* | ||
| 163 | * Set up standard Mac OS X versions | ||
| 164 | */ | ||
| 165 | |||
| 166 | #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) | ||
| 167 | |||
| 168 | #define MAC_OS_X_VERSION_10_0 1000 | ||
| 169 | #define MAC_OS_X_VERSION_10_1 1010 | ||
| 170 | #define MAC_OS_X_VERSION_10_2 1020 | ||
| 171 | #define MAC_OS_X_VERSION_10_3 1030 | ||
| 172 | #define MAC_OS_X_VERSION_10_4 1040 | ||
| 173 | #define MAC_OS_X_VERSION_10_5 1050 | ||
| 174 | #define MAC_OS_X_VERSION_10_6 1060 | ||
| 175 | #define MAC_OS_X_VERSION_10_7 1070 | ||
| 176 | #define MAC_OS_X_VERSION_10_8 1080 | ||
| 177 | #define MAC_OS_X_VERSION_10_9 1090 | ||
| 178 | #define MAC_OS_X_VERSION_10_10 101000 | ||
| 179 | #define MAC_OS_X_VERSION_10_10_2 101002 | ||
| 180 | #define MAC_OS_X_VERSION_10_10_3 101003 | ||
| 181 | #define MAC_OS_X_VERSION_10_11 101100 | ||
| 182 | #define MAC_OS_X_VERSION_10_11_2 101102 | ||
| 183 | #define MAC_OS_X_VERSION_10_11_3 101103 | ||
| 184 | #define MAC_OS_X_VERSION_10_11_4 101104 | ||
| 185 | #define MAC_OS_X_VERSION_10_12 101200 | ||
| 186 | #define MAC_OS_X_VERSION_10_12_1 101201 | ||
| 187 | #define MAC_OS_X_VERSION_10_12_2 101202 | ||
| 188 | #define MAC_OS_X_VERSION_10_12_4 101204 | ||
| 189 | #define MAC_OS_X_VERSION_10_13 101300 | ||
| 190 | #define MAC_OS_X_VERSION_10_13_1 101301 | ||
| 191 | #define MAC_OS_X_VERSION_10_13_2 101302 | ||
| 192 | #define MAC_OS_X_VERSION_10_13_4 101304 | ||
| 193 | #define MAC_OS_X_VERSION_10_14 101400 | ||
| 194 | #define MAC_OS_X_VERSION_10_14_1 101401 | ||
| 195 | #define MAC_OS_X_VERSION_10_14_4 101404 | ||
| 196 | #define MAC_OS_X_VERSION_10_14_6 101406 | ||
| 197 | #define MAC_OS_X_VERSION_10_15 101500 | ||
| 198 | #define MAC_OS_X_VERSION_10_15_1 101501 | ||
| 199 | #define MAC_OS_X_VERSION_10_16 101600 | ||
| 200 | #define MAC_OS_VERSION_11_0 110000 | ||
| 201 | |||
| 202 | #endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */ | ||
| 203 | |||
| 204 | #define __DRIVERKIT_19_0 190000 | ||
| 205 | #define __DRIVERKIT_20_0 200000 | ||
| 206 | |||
| 207 | #endif /* __AVAILABILITY_VERSIONS__ */ | ||
| 208 | |||
lib/libc/include/x86_64-macos-gnu/Block.h created+64| ... | @@ -0,0 +1,64 @@ | ||
| 1 | /* | ||
| 2 | * Block.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2008-2010 Apple Inc. All rights reserved. | ||
| 5 | * | ||
| 6 | * @APPLE_LLVM_LICENSE_HEADER@ | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef _Block_H_ | ||
| 11 | #define _Block_H_ | ||
| 12 | |||
| 13 | #if !defined(BLOCK_EXPORT) | ||
| 14 | # if defined(__cplusplus) | ||
| 15 | # define BLOCK_EXPORT extern "C" | ||
| 16 | # else | ||
| 17 | # define BLOCK_EXPORT extern | ||
| 18 | # endif | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #include <Availability.h> | ||
| 22 | #include <TargetConditionals.h> | ||
| 23 | |||
| 24 | #if __cplusplus | ||
| 25 | extern "C" { | ||
| 26 | #endif | ||
| 27 | |||
| 28 | // Create a heap based copy of a Block or simply add a reference to an existing one. | ||
| 29 | // This must be paired with Block_release to recover memory, even when running | ||
| 30 | // under Objective-C Garbage Collection. | ||
| 31 | BLOCK_EXPORT void *_Block_copy(const void *aBlock) | ||
| 32 | __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 33 | |||
| 34 | // Lose the reference, and if heap based and last reference, recover the memory | ||
| 35 | BLOCK_EXPORT void _Block_release(const void *aBlock) | ||
| 36 | __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 37 | |||
| 38 | |||
| 39 | // Used by the compiler. Do not call this function yourself. | ||
| 40 | BLOCK_EXPORT void _Block_object_assign(void *, const void *, const int) | ||
| 41 | __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 42 | |||
| 43 | // Used by the compiler. Do not call this function yourself. | ||
| 44 | BLOCK_EXPORT void _Block_object_dispose(const void *, const int) | ||
| 45 | __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 46 | |||
| 47 | // Used by the compiler. Do not use these variables yourself. | ||
| 48 | BLOCK_EXPORT void * _NSConcreteGlobalBlock[32] | ||
| 49 | __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 50 | BLOCK_EXPORT void * _NSConcreteStackBlock[32] | ||
| 51 | __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 52 | |||
| 53 | |||
| 54 | #if __cplusplus | ||
| 55 | } | ||
| 56 | #endif | ||
| 57 | |||
| 58 | // Type correct macros | ||
| 59 | |||
| 60 | #define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__))) | ||
| 61 | #define Block_release(...) _Block_release((const void *)(__VA_ARGS__)) | ||
| 62 | |||
| 63 | |||
| 64 | #endif | ||
lib/libc/include/x86_64-macos-gnu/ConditionalMacros.h created+619| ... | @@ -0,0 +1,619 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1993-2011 by Apple Inc.. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | File: ConditionalMacros.h | ||
| 26 | |||
| 27 | Contains: Set up for compiler independent conditionals | ||
| 28 | |||
| 29 | Version: CarbonCore-769~1 | ||
| 30 | |||
| 31 | Bugs?: For bug reports, consult the following page on | ||
| 32 | the World Wide Web: | ||
| 33 | |||
| 34 | http://developer.apple.com/bugreporter/ | ||
| 35 | |||
| 36 | */ | ||
| 37 | #ifndef __CONDITIONALMACROS__ | ||
| 38 | #define __CONDITIONALMACROS__ | ||
| 39 | |||
| 40 | #include <Availability.h> | ||
| 41 | /**************************************************************************************************** | ||
| 42 | UNIVERSAL_INTERFACES_VERSION | ||
| 43 | |||
| 44 | 0x0400 --> version 4.0 (Mac OS X only) | ||
| 45 | 0x0335 --> version 3.4 | ||
| 46 | 0x0331 --> version 3.3.1 | ||
| 47 | 0x0330 --> version 3.3 | ||
| 48 | 0x0320 --> version 3.2 | ||
| 49 | 0x0310 --> version 3.1 | ||
| 50 | 0x0301 --> version 3.0.1 | ||
| 51 | 0x0300 --> version 3.0 | ||
| 52 | 0x0210 --> version 2.1 | ||
| 53 | This conditional did not exist prior to version 2.1 | ||
| 54 | ****************************************************************************************************/ | ||
| 55 | #define UNIVERSAL_INTERFACES_VERSION 0x0400 | ||
| 56 | /**************************************************************************************************** | ||
| 57 | |||
| 58 | All TARGET_* condtionals are set up by TargetConditionals.h | ||
| 59 | |||
| 60 | ****************************************************************************************************/ | ||
| 61 | #include <TargetConditionals.h> | ||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | /**************************************************************************************************** | ||
| 67 | |||
| 68 | PRAGMA_* | ||
| 69 | These conditionals specify whether the compiler supports particular #pragma's | ||
| 70 | |||
| 71 | PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset | ||
| 72 | PRAGMA_ONCE - Compiler supports: #pragma once | ||
| 73 | PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset | ||
| 74 | PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n) | ||
| 75 | PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop) | ||
| 76 | PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums) | ||
| 77 | PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset | ||
| 78 | PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset | ||
| 79 | |||
| 80 | |||
| 81 | FOUR_CHAR_CODE | ||
| 82 | This conditional is deprecated. It was used to work around a bug in one obscure compiler that did not pack multiple characters in single quotes rationally. | ||
| 83 | It was never intended for endian swapping. | ||
| 84 | |||
| 85 | FOUR_CHAR_CODE('abcd') - Convert a four-char-code to the correct 32-bit value | ||
| 86 | |||
| 87 | |||
| 88 | TYPE_* | ||
| 89 | These conditionals specify whether the compiler supports particular types. | ||
| 90 | |||
| 91 | TYPE_LONGLONG - Compiler supports "long long" 64-bit integers | ||
| 92 | TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point | ||
| 93 | TYPE_LONGDOUBLE_IS_DOUBLE - Compiler implements "long double" same as "double" | ||
| 94 | |||
| 95 | |||
| 96 | FUNCTION_* | ||
| 97 | These conditionals specify whether the compiler supports particular language extensions | ||
| 98 | to function prototypes and definitions. | ||
| 99 | |||
| 100 | FUNCTION_PASCAL - Compiler supports "pascal void Foo()" | ||
| 101 | FUNCTION_DECLSPEC - Compiler supports "__declspec(xxx) void Foo()" | ||
| 102 | FUNCTION_WIN32CC - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()" | ||
| 103 | |||
| 104 | ****************************************************************************************************/ | ||
| 105 | |||
| 106 | #if defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__) || defined(__MACOS_CLASSIC__)) | ||
| 107 | /* | ||
| 108 | gcc based compilers used on Mac OS X | ||
| 109 | */ | ||
| 110 | #define PRAGMA_IMPORT 0 | ||
| 111 | #define PRAGMA_ONCE 0 | ||
| 112 | |||
| 113 | #if __GNUC__ >= 4 | ||
| 114 | #define PRAGMA_STRUCT_PACK 1 | ||
| 115 | #define PRAGMA_STRUCT_PACKPUSH 1 | ||
| 116 | #else | ||
| 117 | #define PRAGMA_STRUCT_PACK 0 | ||
| 118 | #define PRAGMA_STRUCT_PACKPUSH 0 | ||
| 119 | #endif | ||
| 120 | |||
| 121 | #if __LP64__ || __arm64__ || __ARM_ARCH_7K | ||
| 122 | #define PRAGMA_STRUCT_ALIGN 0 | ||
| 123 | #else | ||
| 124 | #define PRAGMA_STRUCT_ALIGN 1 | ||
| 125 | #endif | ||
| 126 | |||
| 127 | #define PRAGMA_ENUM_PACK 0 | ||
| 128 | #define PRAGMA_ENUM_ALWAYSINT 0 | ||
| 129 | #define PRAGMA_ENUM_OPTIONS 0 | ||
| 130 | #define FOUR_CHAR_CODE(x) (x) | ||
| 131 | |||
| 132 | #define TYPE_EXTENDED 0 | ||
| 133 | |||
| 134 | #ifdef __ppc__ | ||
| 135 | #ifdef __LONG_DOUBLE_128__ | ||
| 136 | #define TYPE_LONGDOUBLE_IS_DOUBLE 0 | ||
| 137 | #else | ||
| 138 | #define TYPE_LONGDOUBLE_IS_DOUBLE 1 | ||
| 139 | #endif | ||
| 140 | #else | ||
| 141 | #define TYPE_LONGDOUBLE_IS_DOUBLE 0 | ||
| 142 | #endif | ||
| 143 | |||
| 144 | #define TYPE_LONGLONG 1 | ||
| 145 | |||
| 146 | #define FUNCTION_PASCAL 0 | ||
| 147 | #define FUNCTION_DECLSPEC 0 | ||
| 148 | #define FUNCTION_WIN32CC 0 | ||
| 149 | |||
| 150 | #ifdef __MACOS_CLASSIC__ | ||
| 151 | #ifndef TARGET_API_MAC_CARBON /* gcc cfm cross compiler assumes you're building Carbon code */ | ||
| 152 | #define TARGET_API_MAC_CARBON 1 | ||
| 153 | #endif | ||
| 154 | #endif | ||
| 155 | |||
| 156 | |||
| 157 | |||
| 158 | #elif defined(__MWERKS__) | ||
| 159 | /* | ||
| 160 | CodeWarrior compiler from Metrowerks/Motorola | ||
| 161 | */ | ||
| 162 | #define PRAGMA_ONCE 1 | ||
| 163 | #define PRAGMA_IMPORT 0 | ||
| 164 | #define PRAGMA_STRUCT_ALIGN 1 | ||
| 165 | #define PRAGMA_STRUCT_PACK 1 | ||
| 166 | #define PRAGMA_STRUCT_PACKPUSH 0 | ||
| 167 | #define PRAGMA_ENUM_PACK 0 | ||
| 168 | #define PRAGMA_ENUM_ALWAYSINT 1 | ||
| 169 | #define PRAGMA_ENUM_OPTIONS 0 | ||
| 170 | #if __option(enumsalwaysint) && __option(ANSI_strict) | ||
| 171 | #define FOUR_CHAR_CODE(x) ((long)(x)) /* otherwise compiler will complain about values with high bit set */ | ||
| 172 | #else | ||
| 173 | #define FOUR_CHAR_CODE(x) (x) | ||
| 174 | #endif | ||
| 175 | #define FUNCTION_PASCAL 1 | ||
| 176 | #define FUNCTION_DECLSPEC 1 | ||
| 177 | #define FUNCTION_WIN32CC 0 | ||
| 178 | |||
| 179 | #if __option(longlong) | ||
| 180 | #define TYPE_LONGLONG 1 | ||
| 181 | #else | ||
| 182 | #define TYPE_LONGLONG 0 | ||
| 183 | #endif | ||
| 184 | #define TYPE_EXTENDED 0 | ||
| 185 | #define TYPE_LONGDOUBLE_IS_DOUBLE 1 | ||
| 186 | |||
| 187 | |||
| 188 | |||
| 189 | #else | ||
| 190 | /* | ||
| 191 | Unknown compiler, perhaps set up from the command line | ||
| 192 | */ | ||
| 193 | #error unknown compiler | ||
| 194 | #ifndef PRAGMA_IMPORT | ||
| 195 | #define PRAGMA_IMPORT 0 | ||
| 196 | #endif | ||
| 197 | #ifndef PRAGMA_STRUCT_ALIGN | ||
| 198 | #define PRAGMA_STRUCT_ALIGN 0 | ||
| 199 | #endif | ||
| 200 | #ifndef PRAGMA_ONCE | ||
| 201 | #define PRAGMA_ONCE 0 | ||
| 202 | #endif | ||
| 203 | #ifndef PRAGMA_STRUCT_PACK | ||
| 204 | #define PRAGMA_STRUCT_PACK 0 | ||
| 205 | #endif | ||
| 206 | #ifndef PRAGMA_STRUCT_PACKPUSH | ||
| 207 | #define PRAGMA_STRUCT_PACKPUSH 0 | ||
| 208 | #endif | ||
| 209 | #ifndef PRAGMA_ENUM_PACK | ||
| 210 | #define PRAGMA_ENUM_PACK 0 | ||
| 211 | #endif | ||
| 212 | #ifndef PRAGMA_ENUM_ALWAYSINT | ||
| 213 | #define PRAGMA_ENUM_ALWAYSINT 0 | ||
| 214 | #endif | ||
| 215 | #ifndef PRAGMA_ENUM_OPTIONS | ||
| 216 | #define PRAGMA_ENUM_OPTIONS 0 | ||
| 217 | #endif | ||
| 218 | #ifndef FOUR_CHAR_CODE | ||
| 219 | #define FOUR_CHAR_CODE(x) (x) | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #ifndef TYPE_LONGDOUBLE_IS_DOUBLE | ||
| 223 | #define TYPE_LONGDOUBLE_IS_DOUBLE 1 | ||
| 224 | #endif | ||
| 225 | #ifndef TYPE_EXTENDED | ||
| 226 | #define TYPE_EXTENDED 0 | ||
| 227 | #endif | ||
| 228 | #ifndef TYPE_LONGLONG | ||
| 229 | #define TYPE_LONGLONG 0 | ||
| 230 | #endif | ||
| 231 | #ifndef FUNCTION_PASCAL | ||
| 232 | #define FUNCTION_PASCAL 0 | ||
| 233 | #endif | ||
| 234 | #ifndef FUNCTION_DECLSPEC | ||
| 235 | #define FUNCTION_DECLSPEC 0 | ||
| 236 | #endif | ||
| 237 | #ifndef FUNCTION_WIN32CC | ||
| 238 | #define FUNCTION_WIN32CC 0 | ||
| 239 | #endif | ||
| 240 | #endif | ||
| 241 | |||
| 242 | |||
| 243 | |||
| 244 | |||
| 245 | /**************************************************************************************************** | ||
| 246 | |||
| 247 | Under MacOS, the classic 68k runtime has two calling conventions: pascal or C | ||
| 248 | Under Win32, there are two calling conventions: __cdecl or __stdcall | ||
| 249 | Headers and implementation files can use the following macros to make their | ||
| 250 | source more portable by hiding the calling convention details: | ||
| 251 | |||
| 252 | EXTERN_API* | ||
| 253 | These macros are used to specify the calling convention on a function prototype. | ||
| 254 | |||
| 255 | EXTERN_API - Classic 68k: pascal, Win32: __cdecl | ||
| 256 | EXTERN_API_C - Classic 68k: C, Win32: __cdecl | ||
| 257 | EXTERN_API_STDCALL - Classic 68k: pascal, Win32: __stdcall | ||
| 258 | EXTERN_API_C_STDCALL - Classic 68k: C, Win32: __stdcall | ||
| 259 | |||
| 260 | |||
| 261 | DEFINE_API* | ||
| 262 | These macros are used to specify the calling convention on a function definition. | ||
| 263 | |||
| 264 | DEFINE_API - Classic 68k: pascal, Win32: __cdecl | ||
| 265 | DEFINE_API_C - Classic 68k: C, Win32: __cdecl | ||
| 266 | DEFINE_API_STDCALL - Classic 68k: pascal, Win32: __stdcall | ||
| 267 | DEFINE_API_C_STDCALL - Classic 68k: C, Win32: __stdcall | ||
| 268 | |||
| 269 | |||
| 270 | CALLBACK_API* | ||
| 271 | These macros are used to specify the calling convention of a function pointer. | ||
| 272 | |||
| 273 | CALLBACK_API - Classic 68k: pascal, Win32: __stdcall | ||
| 274 | CALLBACK_API_C - Classic 68k: C, Win32: __stdcall | ||
| 275 | CALLBACK_API_STDCALL - Classic 68k: pascal, Win32: __cdecl | ||
| 276 | CALLBACK_API_C_STDCALL - Classic 68k: C, Win32: __cdecl | ||
| 277 | |||
| 278 | ****************************************************************************************************/ | ||
| 279 | |||
| 280 | #if FUNCTION_PASCAL && !FUNCTION_DECLSPEC && !FUNCTION_WIN32CC | ||
| 281 | /* compiler supports pascal keyword only */ | ||
| 282 | #define EXTERN_API(_type) extern pascal _type | ||
| 283 | #define EXTERN_API_C(_type) extern _type | ||
| 284 | #define EXTERN_API_STDCALL(_type) extern pascal _type | ||
| 285 | #define EXTERN_API_C_STDCALL(_type) extern _type | ||
| 286 | |||
| 287 | #define DEFINE_API(_type) pascal _type | ||
| 288 | #define DEFINE_API_C(_type) _type | ||
| 289 | #define DEFINE_API_STDCALL(_type) pascal _type | ||
| 290 | #define DEFINE_API_C_STDCALL(_type) _type | ||
| 291 | |||
| 292 | #define CALLBACK_API(_type, _name) pascal _type (*_name) | ||
| 293 | #define CALLBACK_API_C(_type, _name) _type (*_name) | ||
| 294 | #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name) | ||
| 295 | #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name) | ||
| 296 | |||
| 297 | #elif FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC | ||
| 298 | /* compiler supports pascal and __declspec() */ | ||
| 299 | #define EXTERN_API(_type) extern pascal __declspec(dllimport) _type | ||
| 300 | #define EXTERN_API_C(_type) extern __declspec(dllimport) _type | ||
| 301 | #define EXTERN_API_STDCALL(_type) extern pascal __declspec(dllimport) _type | ||
| 302 | #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type | ||
| 303 | |||
| 304 | #define DEFINE_API(_type) pascal __declspec(dllexport) _type | ||
| 305 | #define DEFINE_API_C(_type) __declspec(dllexport) _type | ||
| 306 | #define DEFINE_API_STDCALL(_type) pascal __declspec(dllexport) _type | ||
| 307 | #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type | ||
| 308 | |||
| 309 | #define CALLBACK_API(_type, _name) pascal _type (*_name) | ||
| 310 | #define CALLBACK_API_C(_type, _name) _type (*_name) | ||
| 311 | #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name) | ||
| 312 | #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name) | ||
| 313 | |||
| 314 | #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC | ||
| 315 | /* compiler supports __declspec() */ | ||
| 316 | #define EXTERN_API(_type) extern __declspec(dllimport) _type | ||
| 317 | #define EXTERN_API_C(_type) extern __declspec(dllimport) _type | ||
| 318 | #define EXTERN_API_STDCALL(_type) extern __declspec(dllimport) _type | ||
| 319 | #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type | ||
| 320 | |||
| 321 | #define DEFINE_API(_type) __declspec(dllexport) _type | ||
| 322 | #define DEFINE_API_C(_type) __declspec(dllexport) _type | ||
| 323 | #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type | ||
| 324 | #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type | ||
| 325 | |||
| 326 | #define CALLBACK_API(_type, _name) _type ( * _name) | ||
| 327 | #define CALLBACK_API_C(_type, _name) _type ( * _name) | ||
| 328 | #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name) | ||
| 329 | #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name) | ||
| 330 | |||
| 331 | #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && FUNCTION_WIN32CC | ||
| 332 | /* compiler supports __declspec() and __cdecl */ | ||
| 333 | #define EXTERN_API(_type) __declspec(dllimport) _type __cdecl | ||
| 334 | #define EXTERN_API_C(_type) __declspec(dllimport) _type __cdecl | ||
| 335 | #define EXTERN_API_STDCALL(_type) __declspec(dllimport) _type __stdcall | ||
| 336 | #define EXTERN_API_C_STDCALL(_type) __declspec(dllimport) _type __stdcall | ||
| 337 | |||
| 338 | #define DEFINE_API(_type) __declspec(dllexport) _type __cdecl | ||
| 339 | #define DEFINE_API_C(_type) __declspec(dllexport) _type __cdecl | ||
| 340 | #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type __stdcall | ||
| 341 | #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type __stdcall | ||
| 342 | |||
| 343 | #define CALLBACK_API(_type, _name) _type (__cdecl * _name) | ||
| 344 | #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name) | ||
| 345 | #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name) | ||
| 346 | #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name) | ||
| 347 | |||
| 348 | #elif !FUNCTION_PASCAL && !FUNCTION_DECLSPEC && FUNCTION_WIN32CC | ||
| 349 | /* compiler supports __cdecl */ | ||
| 350 | #define EXTERN_API(_type) _type __cdecl | ||
| 351 | #define EXTERN_API_C(_type) _type __cdecl | ||
| 352 | #define EXTERN_API_STDCALL(_type) _type __stdcall | ||
| 353 | #define EXTERN_API_C_STDCALL(_type) _type __stdcall | ||
| 354 | |||
| 355 | #define DEFINE_API(_type) _type __cdecl | ||
| 356 | #define DEFINE_API_C(_type) _type __cdecl | ||
| 357 | #define DEFINE_API_STDCALL(_type) _type __stdcall | ||
| 358 | #define DEFINE_API_C_STDCALL(_type) _type __stdcall | ||
| 359 | |||
| 360 | #define CALLBACK_API(_type, _name) _type (__cdecl * _name) | ||
| 361 | #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name) | ||
| 362 | #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name) | ||
| 363 | #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name) | ||
| 364 | |||
| 365 | #else | ||
| 366 | /* compiler supports no extensions */ | ||
| 367 | #define EXTERN_API(_type) extern _type | ||
| 368 | #define EXTERN_API_C(_type) extern _type | ||
| 369 | #define EXTERN_API_STDCALL(_type) extern _type | ||
| 370 | #define EXTERN_API_C_STDCALL(_type) extern _type | ||
| 371 | |||
| 372 | #define DEFINE_API(_type) _type | ||
| 373 | #define DEFINE_API_C(_type) _type | ||
| 374 | #define DEFINE_API_STDCALL(_type) _type | ||
| 375 | #define DEFINE_API_C_STDCALL(_type) _type | ||
| 376 | |||
| 377 | #define CALLBACK_API(_type, _name) _type ( * _name) | ||
| 378 | #define CALLBACK_API_C(_type, _name) _type ( * _name) | ||
| 379 | #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name) | ||
| 380 | #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name) | ||
| 381 | #undef pascal | ||
| 382 | #define pascal | ||
| 383 | #endif | ||
| 384 | |||
| 385 | /**************************************************************************************************** | ||
| 386 | |||
| 387 | Set up TARGET_API_*_* values | ||
| 388 | |||
| 389 | ****************************************************************************************************/ | ||
| 390 | #if !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) | ||
| 391 | /* No TARGET_API_MAC_* predefined on command line */ | ||
| 392 | #if TARGET_RT_MAC_MACHO | ||
| 393 | /* Looks like MachO style compiler */ | ||
| 394 | #define TARGET_API_MAC_OS8 0 | ||
| 395 | #define TARGET_API_MAC_CARBON 1 | ||
| 396 | #define TARGET_API_MAC_OSX 1 | ||
| 397 | #elif defined(TARGET_CARBON) && TARGET_CARBON | ||
| 398 | /* grandfather in use of TARGET_CARBON */ | ||
| 399 | #define TARGET_API_MAC_OS8 0 | ||
| 400 | #define TARGET_API_MAC_CARBON 1 | ||
| 401 | #define TARGET_API_MAC_OSX 0 | ||
| 402 | #elif TARGET_CPU_PPC && TARGET_RT_MAC_CFM | ||
| 403 | /* Looks like CFM style PPC compiler */ | ||
| 404 | #define TARGET_API_MAC_OS8 1 | ||
| 405 | #define TARGET_API_MAC_CARBON 0 | ||
| 406 | #define TARGET_API_MAC_OSX 0 | ||
| 407 | #else | ||
| 408 | /* 68k or some other compiler */ | ||
| 409 | #define TARGET_API_MAC_OS8 1 | ||
| 410 | #define TARGET_API_MAC_CARBON 0 | ||
| 411 | #define TARGET_API_MAC_OSX 0 | ||
| 412 | #endif /* */ | ||
| 413 | |||
| 414 | #else | ||
| 415 | #ifndef TARGET_API_MAC_OS8 | ||
| 416 | #define TARGET_API_MAC_OS8 0 | ||
| 417 | #endif /* !defined(TARGET_API_MAC_OS8) */ | ||
| 418 | |||
| 419 | #ifndef TARGET_API_MAC_OSX | ||
| 420 | #define TARGET_API_MAC_OSX TARGET_RT_MAC_MACHO | ||
| 421 | #endif /* !defined(TARGET_API_MAC_OSX) */ | ||
| 422 | |||
| 423 | #ifndef TARGET_API_MAC_CARBON | ||
| 424 | #define TARGET_API_MAC_CARBON TARGET_API_MAC_OSX | ||
| 425 | #endif /* !defined(TARGET_API_MAC_CARBON) */ | ||
| 426 | |||
| 427 | #endif /* !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) */ | ||
| 428 | |||
| 429 | #if TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX | ||
| 430 | #error TARGET_API_MAC_OS8 and TARGET_API_MAC_OSX are mutually exclusive | ||
| 431 | #endif /* TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX */ | ||
| 432 | |||
| 433 | #if !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX | ||
| 434 | #error At least one of TARGET_API_MAC_* must be true | ||
| 435 | #endif /* !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX */ | ||
| 436 | |||
| 437 | /* Support source code still using TARGET_CARBON */ | ||
| 438 | #ifndef TARGET_CARBON | ||
| 439 | #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 | ||
| 440 | #define TARGET_CARBON 1 | ||
| 441 | #else | ||
| 442 | #define TARGET_CARBON 0 | ||
| 443 | #endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */ | ||
| 444 | |||
| 445 | #endif /* !defined(TARGET_CARBON) */ | ||
| 446 | |||
| 447 | /**************************************************************************************************** | ||
| 448 | Backward compatibility for clients expecting 2.x version on ConditionalMacros.h | ||
| 449 | |||
| 450 | GENERATINGPOWERPC - Compiler is generating PowerPC instructions | ||
| 451 | GENERATING68K - Compiler is generating 68k family instructions | ||
| 452 | GENERATING68881 - Compiler is generating mc68881 floating point instructions | ||
| 453 | GENERATINGCFM - Code being generated assumes CFM calling conventions | ||
| 454 | CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's | ||
| 455 | PRAGMA_ALIGN_SUPPORTED - Compiler supports: #pragma options align=mac68k/power/reset | ||
| 456 | PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset | ||
| 457 | CGLUESUPPORTED - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings | ||
| 458 | |||
| 459 | ****************************************************************************************************/ | ||
| 460 | #if !TARGET_API_MAC_CARBON | ||
| 461 | #define GENERATINGPOWERPC TARGET_CPU_PPC | ||
| 462 | #define GENERATING68K 0 | ||
| 463 | #define GENERATING68881 TARGET_RT_MAC_68881 | ||
| 464 | #define GENERATINGCFM TARGET_RT_MAC_CFM | ||
| 465 | #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM | ||
| 466 | #ifndef CGLUESUPPORTED | ||
| 467 | #define CGLUESUPPORTED 0 | ||
| 468 | #endif /* !defined(CGLUESUPPORTED) */ | ||
| 469 | |||
| 470 | #ifndef OLDROUTINELOCATIONS | ||
| 471 | #define OLDROUTINELOCATIONS 0 | ||
| 472 | #endif /* !defined(OLDROUTINELOCATIONS) */ | ||
| 473 | |||
| 474 | #define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN | ||
| 475 | #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT | ||
| 476 | #else | ||
| 477 | /* Carbon code should not use old conditionals */ | ||
| 478 | #define PRAGMA_ALIGN_SUPPORTED ..PRAGMA_ALIGN_SUPPORTED_is_obsolete.. | ||
| 479 | #define GENERATINGPOWERPC ..GENERATINGPOWERPC_is_obsolete.. | ||
| 480 | #define GENERATING68K ..GENERATING68K_is_obsolete.. | ||
| 481 | #define GENERATING68881 ..GENERATING68881_is_obsolete.. | ||
| 482 | #define GENERATINGCFM ..GENERATINGCFM_is_obsolete.. | ||
| 483 | #define CFMSYSTEMCALLS ..CFMSYSTEMCALLS_is_obsolete.. | ||
| 484 | #endif /* !TARGET_API_MAC_CARBON */ | ||
| 485 | |||
| 486 | |||
| 487 | |||
| 488 | /**************************************************************************************************** | ||
| 489 | |||
| 490 | OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code. | ||
| 491 | (e.g. DisposPtr instead of DisposePtr). The names of system routine | ||
| 492 | are now more sensitive to change because CFM binds by name. In the | ||
| 493 | past, system routine names were compiled out to just an A-Trap. | ||
| 494 | Macros have been added that each map an old name to its new name. | ||
| 495 | This allows old routine names to be used in existing source files, | ||
| 496 | but the macros only work if OLDROUTINENAMES is true. This support | ||
| 497 | will be removed in the near future. Thus, all source code should | ||
| 498 | be changed to use the new names! You can set OLDROUTINENAMES to false | ||
| 499 | to see if your code has any old names left in it. | ||
| 500 | |||
| 501 | ****************************************************************************************************/ | ||
| 502 | #ifndef OLDROUTINENAMES | ||
| 503 | #define OLDROUTINENAMES 0 | ||
| 504 | #endif /* !defined(OLDROUTINENAMES) */ | ||
| 505 | |||
| 506 | |||
| 507 | |||
| 508 | /**************************************************************************************************** | ||
| 509 | The following macros isolate the use of 68K inlines in function prototypes. | ||
| 510 | On the Mac OS under the Classic 68K runtime, function prototypes were followed | ||
| 511 | by a list of 68K opcodes which the compiler inserted in the generated code instead | ||
| 512 | of a JSR. Under Classic 68K on the Mac OS, this macro will put the opcodes | ||
| 513 | in the right syntax. For all other OS's and runtimes the macro suppress the opcodes. | ||
| 514 | Example: | ||
| 515 | |||
| 516 | EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect) | ||
| 517 | ONEWORDINLINE(0xA8F6); | ||
| 518 | |||
| 519 | ****************************************************************************************************/ | ||
| 520 | |||
| 521 | #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM | ||
| 522 | #define ONEWORDINLINE(w1) = w1 | ||
| 523 | #define TWOWORDINLINE(w1,w2) = {w1,w2} | ||
| 524 | #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3} | ||
| 525 | #define FOURWORDINLINE(w1,w2,w3,w4) = {w1,w2,w3,w4} | ||
| 526 | #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5} | ||
| 527 | #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) = {w1,w2,w3,w4,w5,w6} | ||
| 528 | #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) = {w1,w2,w3,w4,w5,w6,w7} | ||
| 529 | #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) = {w1,w2,w3,w4,w5,w6,w7,w8} | ||
| 530 | #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) = {w1,w2,w3,w4,w5,w6,w7,w8,w9} | ||
| 531 | #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10} | ||
| 532 | #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11} | ||
| 533 | #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12} | ||
| 534 | #else | ||
| 535 | #define ONEWORDINLINE(w1) | ||
| 536 | #define TWOWORDINLINE(w1,w2) | ||
| 537 | #define THREEWORDINLINE(w1,w2,w3) | ||
| 538 | #define FOURWORDINLINE(w1,w2,w3,w4) | ||
| 539 | #define FIVEWORDINLINE(w1,w2,w3,w4,w5) | ||
| 540 | #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) | ||
| 541 | #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) | ||
| 542 | #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) | ||
| 543 | #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) | ||
| 544 | #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) | ||
| 545 | #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) | ||
| 546 | #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12) | ||
| 547 | #endif | ||
| 548 | |||
| 549 | |||
| 550 | /**************************************************************************************************** | ||
| 551 | |||
| 552 | TARGET_CARBON - default: false. Switches all of the above as described. Overrides all others | ||
| 553 | - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by | ||
| 554 | ConditionalMacros, and should not be set manually. | ||
| 555 | |||
| 556 | If you wish to do development for pre-Carbon Systems, you can set the following: | ||
| 557 | |||
| 558 | OPAQUE_TOOLBOX_STRUCTS - default: false. True for Carbon builds, hides struct fields. | ||
| 559 | OPAQUE_UPP_TYPES - default: false. True for Carbon builds, UPP types are unique and opaque. | ||
| 560 | ACCESSOR_CALLS_ARE_FUNCTIONS - default: false. True for Carbon builds, enables accessor functions. | ||
| 561 | CALL_NOT_IN_CARBON - default: true. False for Carbon builds, hides calls not supported in Carbon. | ||
| 562 | |||
| 563 | Specifically, if you are building a non-Carbon application (one that links against InterfaceLib) | ||
| 564 | but you wish to use some of the accessor functions, you can set ACCESSOR_CALLS_ARE_FUNCTIONS to 1 | ||
| 565 | and link with CarbonAccessors.o, which implements just the accessor functions. This will help you | ||
| 566 | preserve source compatibility between your Carbon and non-Carbon application targets. | ||
| 567 | |||
| 568 | MIXEDMODE_CALLS_ARE_FUNCTIONS - deprecated. | ||
| 569 | |||
| 570 | ****************************************************************************************************/ | ||
| 571 | #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 | ||
| 572 | #ifndef OPAQUE_TOOLBOX_STRUCTS | ||
| 573 | #define OPAQUE_TOOLBOX_STRUCTS 1 | ||
| 574 | #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */ | ||
| 575 | |||
| 576 | #ifndef OPAQUE_UPP_TYPES | ||
| 577 | #define OPAQUE_UPP_TYPES 1 | ||
| 578 | #endif /* !defined(OPAQUE_UPP_TYPES) */ | ||
| 579 | |||
| 580 | #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS | ||
| 581 | #define ACCESSOR_CALLS_ARE_FUNCTIONS 1 | ||
| 582 | #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */ | ||
| 583 | |||
| 584 | #ifndef CALL_NOT_IN_CARBON | ||
| 585 | #define CALL_NOT_IN_CARBON 0 | ||
| 586 | #endif /* !defined(CALL_NOT_IN_CARBON) */ | ||
| 587 | |||
| 588 | #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS | ||
| 589 | #define MIXEDMODE_CALLS_ARE_FUNCTIONS 1 | ||
| 590 | #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */ | ||
| 591 | |||
| 592 | #else | ||
| 593 | #ifndef OPAQUE_TOOLBOX_STRUCTS | ||
| 594 | #define OPAQUE_TOOLBOX_STRUCTS 0 | ||
| 595 | #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */ | ||
| 596 | |||
| 597 | #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS | ||
| 598 | #define ACCESSOR_CALLS_ARE_FUNCTIONS 0 | ||
| 599 | #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */ | ||
| 600 | |||
| 601 | /* | ||
| 602 | * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS | ||
| 603 | * set to false, but not the other way around, so make sure the defines are not set this way. | ||
| 604 | */ | ||
| 605 | #ifndef CALL_NOT_IN_CARBON | ||
| 606 | #define CALL_NOT_IN_CARBON 1 | ||
| 607 | #endif /* !defined(CALL_NOT_IN_CARBON) */ | ||
| 608 | |||
| 609 | #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS | ||
| 610 | #define MIXEDMODE_CALLS_ARE_FUNCTIONS 0 | ||
| 611 | #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */ | ||
| 612 | |||
| 613 | #endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */ | ||
| 614 | |||
| 615 | |||
| 616 | |||
| 617 | |||
| 618 | #endif /* __CONDITIONALMACROS__ */ | ||
| 619 | |||
lib/libc/include/x86_64-macos-gnu/MacTypes.h created+808| ... | @@ -0,0 +1,808 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1985-2011 by Apple Inc.. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | File: MacTypes.h | ||
| 26 | |||
| 27 | Contains: Basic Macintosh data types. | ||
| 28 | |||
| 29 | Version: CarbonCore-769~1 | ||
| 30 | |||
| 31 | Bugs?: For bug reports, consult the following page on | ||
| 32 | the World Wide Web: | ||
| 33 | |||
| 34 | http://developer.apple.com/bugreporter/ | ||
| 35 | |||
| 36 | */ | ||
| 37 | #ifndef __MACTYPES__ | ||
| 38 | #define __MACTYPES__ | ||
| 39 | |||
| 40 | #ifndef __CONDITIONALMACROS__ | ||
| 41 | #include <ConditionalMacros.h> | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #include <stdbool.h> | ||
| 45 | |||
| 46 | #include <sys/types.h> | ||
| 47 | |||
| 48 | #include <Availability.h> | ||
| 49 | |||
| 50 | #if PRAGMA_ONCE | ||
| 51 | #pragma once | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #ifdef __cplusplus | ||
| 55 | extern "C" { | ||
| 56 | #endif | ||
| 57 | |||
| 58 | #pragma pack(push, 2) | ||
| 59 | |||
| 60 | |||
| 61 | /* | ||
| 62 | CarbonCore Deprecation flags. | ||
| 63 | |||
| 64 | Certain Carbon API functions are deprecated in 10.3 and later | ||
| 65 | systems. These will produce a warning when compiling on 10.3. | ||
| 66 | |||
| 67 | Other functions and constants do not produce meaningful | ||
| 68 | results when building Carbon for Mac OS X. For these | ||
| 69 | functions, no-op macros are provided, but only when the | ||
| 70 | ALLOW_OBSOLETE_CARBON flag is defined to be 0: eg | ||
| 71 | -DALLOW_OBSOLETE_CARBON=0. | ||
| 72 | */ | ||
| 73 | |||
| 74 | #if ! defined(ALLOW_OBSOLETE_CARBON) || ! ALLOW_OBSOLETE_CARBON | ||
| 75 | |||
| 76 | #define ALLOW_OBSOLETE_CARBON_MACMEMORY 0 | ||
| 77 | #define ALLOW_OBSOLETE_CARBON_OSUTILS 0 | ||
| 78 | |||
| 79 | #else | ||
| 80 | |||
| 81 | #define ALLOW_OBSOLETE_CARBON_MACMEMORY 1 /* Removes obsolete constants; turns HLock/HUnlock into no-op macros */ | ||
| 82 | #define ALLOW_OBSOLETE_CARBON_OSUTILS 1 /* Removes obsolete structures */ | ||
| 83 | |||
| 84 | #endif | ||
| 85 | |||
| 86 | #ifndef NULL | ||
| 87 | #define NULL __DARWIN_NULL | ||
| 88 | #endif /* ! NULL */ | ||
| 89 | #ifndef nil | ||
| 90 | #if defined(__has_feature) | ||
| 91 | #if __has_feature(cxx_nullptr) | ||
| 92 | #define nil nullptr | ||
| 93 | #else | ||
| 94 | #define nil __DARWIN_NULL | ||
| 95 | #endif | ||
| 96 | #else | ||
| 97 | #define nil __DARWIN_NULL | ||
| 98 | #endif | ||
| 99 | #endif | ||
| 100 | |||
| 101 | /******************************************************************************** | ||
| 102 | |||
| 103 | Base integer types for all target OS's and CPU's | ||
| 104 | |||
| 105 | UInt8 8-bit unsigned integer | ||
| 106 | SInt8 8-bit signed integer | ||
| 107 | UInt16 16-bit unsigned integer | ||
| 108 | SInt16 16-bit signed integer | ||
| 109 | UInt32 32-bit unsigned integer | ||
| 110 | SInt32 32-bit signed integer | ||
| 111 | UInt64 64-bit unsigned integer | ||
| 112 | SInt64 64-bit signed integer | ||
| 113 | |||
| 114 | *********************************************************************************/ | ||
| 115 | typedef unsigned char UInt8; | ||
| 116 | typedef signed char SInt8; | ||
| 117 | typedef unsigned short UInt16; | ||
| 118 | typedef signed short SInt16; | ||
| 119 | |||
| 120 | #if __LP64__ | ||
| 121 | typedef unsigned int UInt32; | ||
| 122 | typedef signed int SInt32; | ||
| 123 | #else | ||
| 124 | typedef unsigned long UInt32; | ||
| 125 | typedef signed long SInt32; | ||
| 126 | #endif | ||
| 127 | |||
| 128 | /* avoid redeclaration if libkern/OSTypes.h */ | ||
| 129 | #ifndef _OS_OSTYPES_H | ||
| 130 | #if TARGET_RT_BIG_ENDIAN | ||
| 131 | struct wide { | ||
| 132 | SInt32 hi; | ||
| 133 | UInt32 lo; | ||
| 134 | }; | ||
| 135 | typedef struct wide wide; | ||
| 136 | struct UnsignedWide { | ||
| 137 | UInt32 hi; | ||
| 138 | UInt32 lo; | ||
| 139 | }; | ||
| 140 | typedef struct UnsignedWide UnsignedWide; | ||
| 141 | #else | ||
| 142 | struct wide { | ||
| 143 | UInt32 lo; | ||
| 144 | SInt32 hi; | ||
| 145 | }; | ||
| 146 | typedef struct wide wide; | ||
| 147 | struct UnsignedWide { | ||
| 148 | UInt32 lo; | ||
| 149 | UInt32 hi; | ||
| 150 | }; | ||
| 151 | typedef struct UnsignedWide UnsignedWide; | ||
| 152 | #endif /* TARGET_RT_BIG_ENDIAN */ | ||
| 153 | |||
| 154 | #endif | ||
| 155 | |||
| 156 | #if TYPE_LONGLONG | ||
| 157 | /* | ||
| 158 | Note: wide and UnsignedWide must always be structs for source code | ||
| 159 | compatibility. On the other hand UInt64 and SInt64 can be | ||
| 160 | either a struct or a long long, depending on the compiler. | ||
| 161 | |||
| 162 | If you use UInt64 and SInt64 you should do all operations on | ||
| 163 | those data types through the functions/macros in Math64.h. | ||
| 164 | This will assure that your code compiles with compilers that | ||
| 165 | support long long and those that don't. | ||
| 166 | |||
| 167 | The MS Visual C/C++ compiler uses __int64 instead of long long. | ||
| 168 | */ | ||
| 169 | #if defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86) | ||
| 170 | typedef signed __int64 SInt64; | ||
| 171 | typedef unsigned __int64 UInt64; | ||
| 172 | #else | ||
| 173 | typedef signed long long SInt64; | ||
| 174 | typedef unsigned long long UInt64; | ||
| 175 | #endif | ||
| 176 | #else | ||
| 177 | |||
| 178 | |||
| 179 | typedef wide SInt64; | ||
| 180 | typedef UnsignedWide UInt64; | ||
| 181 | #endif /* TYPE_LONGLONG */ | ||
| 182 | |||
| 183 | /******************************************************************************** | ||
| 184 | |||
| 185 | Base fixed point types | ||
| 186 | |||
| 187 | Fixed 16-bit signed integer plus 16-bit fraction | ||
| 188 | UnsignedFixed 16-bit unsigned integer plus 16-bit fraction | ||
| 189 | Fract 2-bit signed integer plus 30-bit fraction | ||
| 190 | ShortFixed 8-bit signed integer plus 8-bit fraction | ||
| 191 | |||
| 192 | *********************************************************************************/ | ||
| 193 | typedef SInt32 Fixed; | ||
| 194 | typedef Fixed * FixedPtr; | ||
| 195 | typedef SInt32 Fract; | ||
| 196 | typedef Fract * FractPtr; | ||
| 197 | typedef UInt32 UnsignedFixed; | ||
| 198 | typedef UnsignedFixed * UnsignedFixedPtr; | ||
| 199 | typedef short ShortFixed; | ||
| 200 | typedef ShortFixed * ShortFixedPtr; | ||
| 201 | |||
| 202 | |||
| 203 | /******************************************************************************** | ||
| 204 | |||
| 205 | Base floating point types | ||
| 206 | |||
| 207 | Float32 32 bit IEEE float: 1 sign bit, 8 exponent bits, 23 fraction bits | ||
| 208 | Float64 64 bit IEEE float: 1 sign bit, 11 exponent bits, 52 fraction bits | ||
| 209 | Float80 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits | ||
| 210 | Float96 96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits | ||
| 211 | |||
| 212 | Note: These are fixed size floating point types, useful when writing a floating | ||
| 213 | point value to disk. If your compiler does not support a particular size | ||
| 214 | float, a struct is used instead. | ||
| 215 | Use one of the NCEG types (e.g. double_t) or an ANSI C type (e.g. double) if | ||
| 216 | you want a floating point representation that is natural for any given | ||
| 217 | compiler, but might be a different size on different compilers. | ||
| 218 | |||
| 219 | *********************************************************************************/ | ||
| 220 | typedef float Float32; | ||
| 221 | typedef double Float64; | ||
| 222 | struct Float80 { | ||
| 223 | SInt16 exp; | ||
| 224 | UInt16 man[4]; | ||
| 225 | }; | ||
| 226 | typedef struct Float80 Float80; | ||
| 227 | |||
| 228 | struct Float96 { | ||
| 229 | SInt16 exp[2]; /* the second 16-bits are undefined */ | ||
| 230 | UInt16 man[4]; | ||
| 231 | }; | ||
| 232 | typedef struct Float96 Float96; | ||
| 233 | struct Float32Point { | ||
| 234 | Float32 x; | ||
| 235 | Float32 y; | ||
| 236 | }; | ||
| 237 | typedef struct Float32Point Float32Point; | ||
| 238 | |||
| 239 | /******************************************************************************** | ||
| 240 | |||
| 241 | MacOS Memory Manager types | ||
| 242 | |||
| 243 | Ptr Pointer to a non-relocatable block | ||
| 244 | Handle Pointer to a master pointer to a relocatable block | ||
| 245 | Size The number of bytes in a block (signed for historical reasons) | ||
| 246 | |||
| 247 | *********************************************************************************/ | ||
| 248 | typedef char * Ptr; | ||
| 249 | typedef Ptr * Handle; | ||
| 250 | typedef long Size; | ||
| 251 | |||
| 252 | /******************************************************************************** | ||
| 253 | |||
| 254 | Higher level basic types | ||
| 255 | |||
| 256 | OSErr 16-bit result error code | ||
| 257 | OSStatus 32-bit result error code | ||
| 258 | LogicalAddress Address in the clients virtual address space | ||
| 259 | ConstLogicalAddress Address in the clients virtual address space that will only be read | ||
| 260 | PhysicalAddress Real address as used on the hardware bus | ||
| 261 | BytePtr Pointer to an array of bytes | ||
| 262 | ByteCount The size of an array of bytes | ||
| 263 | ByteOffset An offset into an array of bytes | ||
| 264 | ItemCount 32-bit iteration count | ||
| 265 | OptionBits Standard 32-bit set of bit flags | ||
| 266 | PBVersion ? | ||
| 267 | Duration 32-bit millisecond timer for drivers | ||
| 268 | AbsoluteTime 64-bit clock | ||
| 269 | ScriptCode A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding | ||
| 270 | LangCode A particular language (e.g. English), as represented using a particular ScriptCode | ||
| 271 | RegionCode Designates a language as used in a particular region (e.g. British vs American | ||
| 272 | English) together with other region-dependent characteristics (e.g. date format) | ||
| 273 | FourCharCode A 32-bit value made by packing four 1 byte characters together | ||
| 274 | OSType A FourCharCode used in the OS and file system (e.g. creator) | ||
| 275 | ResType A FourCharCode used to tag resources (e.g. 'DLOG') | ||
| 276 | |||
| 277 | *********************************************************************************/ | ||
| 278 | typedef SInt16 OSErr; | ||
| 279 | typedef SInt32 OSStatus; | ||
| 280 | typedef void * LogicalAddress; | ||
| 281 | typedef const void * ConstLogicalAddress; | ||
| 282 | typedef void * PhysicalAddress; | ||
| 283 | typedef UInt8 * BytePtr; | ||
| 284 | typedef unsigned long ByteCount; | ||
| 285 | typedef unsigned long ByteOffset; | ||
| 286 | typedef SInt32 Duration; | ||
| 287 | typedef UnsignedWide AbsoluteTime; | ||
| 288 | typedef UInt32 OptionBits; | ||
| 289 | typedef unsigned long ItemCount; | ||
| 290 | typedef UInt32 PBVersion; | ||
| 291 | typedef SInt16 ScriptCode; | ||
| 292 | typedef SInt16 LangCode; | ||
| 293 | typedef SInt16 RegionCode; | ||
| 294 | typedef UInt32 FourCharCode; | ||
| 295 | typedef FourCharCode OSType; | ||
| 296 | typedef FourCharCode ResType; | ||
| 297 | typedef OSType * OSTypePtr; | ||
| 298 | typedef ResType * ResTypePtr; | ||
| 299 | /******************************************************************************** | ||
| 300 | |||
| 301 | Boolean types and values | ||
| 302 | |||
| 303 | Boolean Mac OS historic type, sizeof(Boolean)==1 | ||
| 304 | bool Defined in stdbool.h, ISO C/C++ standard type | ||
| 305 | false Now defined in stdbool.h | ||
| 306 | true Now defined in stdbool.h | ||
| 307 | |||
| 308 | *********************************************************************************/ | ||
| 309 | typedef unsigned char Boolean; | ||
| 310 | /******************************************************************************** | ||
| 311 | |||
| 312 | Function Pointer Types | ||
| 313 | |||
| 314 | ProcPtr Generic pointer to a function | ||
| 315 | Register68kProcPtr Pointer to a 68K function that expects parameters in registers | ||
| 316 | UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor | ||
| 317 | |||
| 318 | ProcHandle Pointer to a ProcPtr | ||
| 319 | UniversalProcHandle Pointer to a UniversalProcPtr | ||
| 320 | |||
| 321 | *********************************************************************************/ | ||
| 322 | typedef CALLBACK_API_C( long , ProcPtr )(void); | ||
| 323 | typedef CALLBACK_API( void , Register68kProcPtr )(void); | ||
| 324 | #if TARGET_RT_MAC_CFM | ||
| 325 | /* The RoutineDescriptor structure is defined in MixedMode.h */ | ||
| 326 | typedef struct RoutineDescriptor *UniversalProcPtr; | ||
| 327 | #else | ||
| 328 | typedef ProcPtr UniversalProcPtr; | ||
| 329 | #endif /* TARGET_RT_MAC_CFM */ | ||
| 330 | |||
| 331 | typedef ProcPtr * ProcHandle; | ||
| 332 | typedef UniversalProcPtr * UniversalProcHandle; | ||
| 333 | /******************************************************************************** | ||
| 334 | |||
| 335 | RefCon Types | ||
| 336 | |||
| 337 | For access to private data in callbacks, etc.; refcons are generally | ||
| 338 | used as a pointer to something, but in the 32-bit world refcons in | ||
| 339 | different APIs have had various types: pointer, unsigned scalar, and | ||
| 340 | signed scalar. The RefCon types defined here support the current 32-bit | ||
| 341 | usage but provide normalization to pointer types for 64-bit. | ||
| 342 | |||
| 343 | PRefCon is preferred for new APIs; URefCon and SRefCon are primarily | ||
| 344 | for compatibility with existing APIs. | ||
| 345 | |||
| 346 | *********************************************************************************/ | ||
| 347 | typedef void * PRefCon; | ||
| 348 | #if __LP64__ | ||
| 349 | typedef void * URefCon; | ||
| 350 | typedef void * SRefCon; | ||
| 351 | #else | ||
| 352 | typedef UInt32 URefCon; | ||
| 353 | typedef SInt32 SRefCon; | ||
| 354 | #endif /* __LP64__ */ | ||
| 355 | |||
| 356 | /******************************************************************************** | ||
| 357 | |||
| 358 | Common Constants | ||
| 359 | |||
| 360 | noErr OSErr: function performed properly - no error | ||
| 361 | kNilOptions OptionBits: all flags false | ||
| 362 | kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's | ||
| 363 | kVariableLengthArray array bounds: variable length array | ||
| 364 | |||
| 365 | Note: kVariableLengthArray was used in array bounds to specify a variable length array, | ||
| 366 | usually the last field in a struct. Now that the C language supports | ||
| 367 | 		 the concept of flexible array members, you can instead use: | ||
| 368 | 		 | ||
| 369 | 		struct BarList | ||
| 370 | 		{ | ||
| 371 | 			short	listLength; | ||
| 372 | 			Bar		elements[]; | ||
| 373 | 		}; | ||
| 374 | |||
| 375 | 		However, this changes the semantics somewhat, as sizeof( BarList ) contains | ||
| 376 | 		no space for any of the elements, so to allocate a list with space for | ||
| 377 | 		the count elements | ||
| 378 | |||
| 379 | 		struct BarList* l = (struct BarList*) malloc( sizeof(BarList) + count * sizeof(Bar) ); | ||
| 380 | |||
| 381 | *********************************************************************************/ | ||
| 382 | enum { | ||
| 383 | noErr = 0 | ||
| 384 | }; | ||
| 385 | |||
| 386 | enum { | ||
| 387 | kNilOptions = 0 | ||
| 388 | }; | ||
| 389 | |||
| 390 | #define kInvalidID 0 | ||
| 391 | enum { | ||
| 392 | kVariableLengthArray | ||
| 393 | #ifdef __has_extension | ||
| 394 | #if __has_extension(enumerator_attributes) | ||
| 395 | 		__attribute__((deprecated)) | ||
| 396 | 	#endif | ||
| 397 | #endif | ||
| 398 | = 1 | ||
| 399 | }; | ||
| 400 | |||
| 401 | enum { | ||
| 402 | kUnknownType = 0x3F3F3F3F /* "????" QuickTime 3.0: default unknown ResType or OSType */ | ||
| 403 | }; | ||
| 404 | |||
| 405 | |||
| 406 | |||
| 407 | /******************************************************************************** | ||
| 408 | |||
| 409 | String Types and Unicode Types | ||
| 410 | |||
| 411 | UnicodeScalarValue, A complete Unicode character in UTF-32 format, with | ||
| 412 | UTF32Char values from 0 through 0x10FFFF (excluding the surrogate | ||
| 413 | range 0xD800-0xDFFF and certain disallowed values). | ||
| 414 | |||
| 415 | UniChar, A 16-bit Unicode code value in the default UTF-16 format. | ||
| 416 | UTF16Char UnicodeScalarValues 0-0xFFFF are expressed in UTF-16 | ||
| 417 | format using a single UTF16Char with the same value. | ||
| 418 | UnicodeScalarValues 0x10000-0x10FFFF are expressed in | ||
| 419 | UTF-16 format using a pair of UTF16Chars - one in the | ||
| 420 | high surrogate range (0xD800-0xDBFF) followed by one in | ||
| 421 | the low surrogate range (0xDC00-0xDFFF). All of the | ||
| 422 | characters defined in Unicode versions through 3.0 are | ||
| 423 | in the range 0-0xFFFF and can be expressed using a single | ||
| 424 | UTF16Char, thus the term "Unicode character" generally | ||
| 425 | refers to a UniChar = UTF16Char. | ||
| 426 | |||
| 427 | UTF8Char An 8-bit code value in UTF-8 format. UnicodeScalarValues | ||
| 428 | 0-0x7F are expressed in UTF-8 format using one UTF8Char | ||
| 429 | with the same value. UnicodeScalarValues above 0x7F are | ||
| 430 | expressed in UTF-8 format using 2-4 UTF8Chars, all with | ||
| 431 | values in the range 0x80-0xF4 (UnicodeScalarValues | ||
| 432 | 0x100-0xFFFF use two or three UTF8Chars, | ||
| 433 | UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars). | ||
| 434 | |||
| 435 | UniCharCount A count of UTF-16 code values in an array or buffer. | ||
| 436 | |||
| 437 | StrNNN Pascal string holding up to NNN bytes | ||
| 438 | StringPtr Pointer to a pascal string | ||
| 439 | StringHandle Pointer to a StringPtr | ||
| 440 | ConstStringPtr Pointer to a read-only pascal string | ||
| 441 | ConstStrNNNParam For function parameters only - means string is const | ||
| 442 | |||
| 443 | CStringPtr Pointer to a C string (in C: char*) | ||
| 444 | ConstCStringPtr Pointer to a read-only C string (in C: const char*) | ||
| 445 | |||
| 446 | Note: The length of a pascal string is stored as the first byte. | ||
| 447 | A pascal string does not have a termination byte. | ||
| 448 | A pascal string can hold at most 255 bytes of data. | ||
| 449 | The first character in a pascal string is offset one byte from the start of the string. | ||
| 450 | |||
| 451 | A C string is terminated with a byte of value zero. | ||
| 452 | A C string has no length limitation. | ||
| 453 | The first character in a C string is the zeroth byte of the string. | ||
| 454 | |||
| 455 | |||
| 456 | *********************************************************************************/ | ||
| 457 | typedef UInt32 UnicodeScalarValue; | ||
| 458 | typedef UInt32 UTF32Char; | ||
| 459 | typedef UInt16 UniChar; | ||
| 460 | typedef UInt16 UTF16Char; | ||
| 461 | typedef UInt8 UTF8Char; | ||
| 462 | typedef UniChar * UniCharPtr; | ||
| 463 | typedef unsigned long UniCharCount; | ||
| 464 | typedef UniCharCount * UniCharCountPtr; | ||
| 465 | typedef unsigned char Str255[256]; | ||
| 466 | typedef unsigned char Str63[64]; | ||
| 467 | typedef unsigned char Str32[33]; | ||
| 468 | typedef unsigned char Str31[32]; | ||
| 469 | typedef unsigned char Str27[28]; | ||
| 470 | typedef unsigned char Str15[16]; | ||
| 471 | /* | ||
| 472 | The type Str32 is used in many AppleTalk based data structures. | ||
| 473 | It holds up to 32 one byte chars. The problem is that with the | ||
| 474 | length byte it is 33 bytes long. This can cause weird alignment | ||
| 475 | problems in structures. To fix this the type "Str32Field" has | ||
| 476 | been created. It should only be used to hold 32 chars, but | ||
| 477 | it is 34 bytes long so that there are no alignment problems. | ||
| 478 | */ | ||
| 479 | typedef unsigned char Str32Field[34]; | ||
| 480 | /* | ||
| 481 | QuickTime 3.0: | ||
| 482 | The type StrFileName is used to make MacOS structs work | ||
| 483 | cross-platform. For example FSSpec or SFReply previously | ||
| 484 | contained a Str63 field. They now contain a StrFileName | ||
| 485 | field which is the same when targeting the MacOS but is | ||
| 486 | a 256 char buffer for Win32 and unix, allowing them to | ||
| 487 | contain long file names. | ||
| 488 | */ | ||
| 489 | typedef Str63 StrFileName; | ||
| 490 | typedef unsigned char * StringPtr; | ||
| 491 | typedef StringPtr * StringHandle; | ||
| 492 | typedef const unsigned char * ConstStringPtr; | ||
| 493 | typedef const unsigned char * ConstStr255Param; | ||
| 494 | typedef const unsigned char * ConstStr63Param; | ||
| 495 | typedef const unsigned char * ConstStr32Param; | ||
| 496 | typedef const unsigned char * ConstStr31Param; | ||
| 497 | typedef const unsigned char * ConstStr27Param; | ||
| 498 | typedef const unsigned char * ConstStr15Param; | ||
| 499 | typedef ConstStr63Param ConstStrFileNameParam; | ||
| 500 | #ifdef __cplusplus | ||
| 501 | inline unsigned char StrLength(ConstStr255Param string) { return (*string); } | ||
| 502 | #else | ||
| 503 | #define StrLength(string) (*(const unsigned char *)(string)) | ||
| 504 | #endif /* defined(__cplusplus) */ | ||
| 505 | |||
| 506 | #if OLDROUTINENAMES | ||
| 507 | #define Length(string) StrLength(string) | ||
| 508 | #endif /* OLDROUTINENAMES */ | ||
| 509 | |||
| 510 | /******************************************************************************** | ||
| 511 | |||
| 512 | Process Manager type ProcessSerialNumber (previously in Processes.h) | ||
| 513 | |||
| 514 | *********************************************************************************/ | ||
| 515 | /* type for unique process identifier */ | ||
| 516 | struct ProcessSerialNumber { | ||
| 517 | UInt32 highLongOfPSN; | ||
| 518 | UInt32 lowLongOfPSN; | ||
| 519 | }; | ||
| 520 | typedef struct ProcessSerialNumber ProcessSerialNumber; | ||
| 521 | typedef ProcessSerialNumber * ProcessSerialNumberPtr; | ||
| 522 | /******************************************************************************** | ||
| 523 | |||
| 524 | Quickdraw Types | ||
| 525 | |||
| 526 | Point 2D Quickdraw coordinate, range: -32K to +32K | ||
| 527 | Rect Rectangular Quickdraw area | ||
| 528 | Style Quickdraw font rendering styles | ||
| 529 | StyleParameter Style when used as a parameter (historical 68K convention) | ||
| 530 | StyleField Style when used as a field (historical 68K convention) | ||
| 531 | CharParameter Char when used as a parameter (historical 68K convention) | ||
| 532 | |||
| 533 | Note: The original Macintosh toolbox in 68K Pascal defined Style as a SET. | ||
| 534 | Both Style and CHAR occupy 8-bits in packed records or 16-bits when | ||
| 535 | used as fields in non-packed records or as parameters. | ||
| 536 | |||
| 537 | *********************************************************************************/ | ||
| 538 | struct Point { | ||
| 539 | short v; | ||
| 540 | short h; | ||
| 541 | }; | ||
| 542 | typedef struct Point Point; | ||
| 543 | typedef Point * PointPtr; | ||
| 544 | struct Rect { | ||
| 545 | short top; | ||
| 546 | short left; | ||
| 547 | short bottom; | ||
| 548 | short right; | ||
| 549 | }; | ||
| 550 | typedef struct Rect Rect; | ||
| 551 | typedef Rect * RectPtr; | ||
| 552 | struct FixedPoint { | ||
| 553 | Fixed x; | ||
| 554 | Fixed y; | ||
| 555 | }; | ||
| 556 | typedef struct FixedPoint FixedPoint; | ||
| 557 | struct FixedRect { | ||
| 558 | Fixed left; | ||
| 559 | Fixed top; | ||
| 560 | Fixed right; | ||
| 561 | Fixed bottom; | ||
| 562 | }; | ||
| 563 | typedef struct FixedRect FixedRect; | ||
| 564 | |||
| 565 | typedef short CharParameter; | ||
| 566 | enum { | ||
| 567 | normal = 0, | ||
| 568 | bold = 1, | ||
| 569 | italic = 2, | ||
| 570 | underline = 4, | ||
| 571 | outline = 8, | ||
| 572 | shadow = 0x10, | ||
| 573 | condense = 0x20, | ||
| 574 | extend = 0x40 | ||
| 575 | }; | ||
| 576 | |||
| 577 | typedef unsigned char Style; | ||
| 578 | typedef short StyleParameter; | ||
| 579 | typedef Style StyleField; | ||
| 580 | |||
| 581 | |||
| 582 | /******************************************************************************** | ||
| 583 | |||
| 584 | QuickTime TimeBase types (previously in Movies.h) | ||
| 585 | |||
| 586 | TimeValue Count of units | ||
| 587 | TimeScale Units per second | ||
| 588 | CompTimeValue 64-bit count of units (always a struct) | ||
| 589 | TimeValue64 64-bit count of units (long long or struct) | ||
| 590 | TimeBase An opaque reference to a time base | ||
| 591 | TimeRecord Package of TimeBase, duration, and scale | ||
| 592 | |||
| 593 | *********************************************************************************/ | ||
| 594 | typedef SInt32 TimeValue; | ||
| 595 | typedef SInt32 TimeScale; | ||
| 596 | typedef wide CompTimeValue; | ||
| 597 | typedef SInt64 TimeValue64; | ||
| 598 | typedef struct TimeBaseRecord* TimeBase; | ||
| 599 | struct TimeRecord { | ||
| 600 | CompTimeValue value; /* units (duration or absolute) */ | ||
| 601 | TimeScale scale; /* units per second */ | ||
| 602 | TimeBase base; /* refernce to the time base */ | ||
| 603 | }; | ||
| 604 | typedef struct TimeRecord TimeRecord; | ||
| 605 | |||
| 606 | /******************************************************************************** | ||
| 607 | |||
| 608 | THINK C base objects | ||
| 609 | |||
| 610 | HandleObject Root class for handle based THINK C++ objects | ||
| 611 | PascalObject Root class for pascal style objects in THINK C++ | ||
| 612 | |||
| 613 | *********************************************************************************/ | ||
| 614 | #if defined(__SC__) && !defined(__STDC__) && defined(__cplusplus) | ||
| 615 | class __machdl HandleObject {}; | ||
| 616 | #if TARGET_CPU_68K | ||
| 617 | class __pasobj PascalObject {}; | ||
| 618 | #endif | ||
| 619 | #endif | ||
| 620 | |||
| 621 | |||
| 622 | /******************************************************************************** | ||
| 623 | |||
| 624 | MacOS versioning structures | ||
| 625 | |||
| 626 | VersRec Contents of a 'vers' resource | ||
| 627 | VersRecPtr Pointer to a VersRecPtr | ||
| 628 | VersRecHndl Resource Handle containing a VersRec | ||
| 629 | NumVersion Packed BCD version representation (e.g. "4.2.1a3" is 0x04214003) | ||
| 630 | UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor | ||
| 631 | |||
| 632 | ProcHandle Pointer to a ProcPtr | ||
| 633 | UniversalProcHandle Pointer to a UniversalProcPtr | ||
| 634 | |||
| 635 | *********************************************************************************/ | ||
| 636 | #if TARGET_RT_BIG_ENDIAN | ||
| 637 | struct NumVersion { | ||
| 638 | /* Numeric version part of 'vers' resource */ | ||
| 639 | UInt8 majorRev; /*1st part of version number in BCD*/ | ||
| 640 | UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ | ||
| 641 | UInt8 stage; /*stage code: dev, alpha, beta, final*/ | ||
| 642 | UInt8 nonRelRev; /*revision level of non-released version*/ | ||
| 643 | }; | ||
| 644 | typedef struct NumVersion NumVersion; | ||
| 645 | #else | ||
| 646 | struct NumVersion { | ||
| 647 | /* Numeric version part of 'vers' resource accessable in little endian format */ | ||
| 648 | UInt8 nonRelRev; /*revision level of non-released version*/ | ||
| 649 | UInt8 stage; /*stage code: dev, alpha, beta, final*/ | ||
| 650 | UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ | ||
| 651 | UInt8 majorRev; /*1st part of version number in BCD*/ | ||
| 652 | }; | ||
| 653 | typedef struct NumVersion NumVersion; | ||
| 654 | #endif /* TARGET_RT_BIG_ENDIAN */ | ||
| 655 | |||
| 656 | enum { | ||
| 657 | /* Version Release Stage Codes */ | ||
| 658 | developStage = 0x20, | ||
| 659 | alphaStage = 0x40, | ||
| 660 | betaStage = 0x60, | ||
| 661 | finalStage = 0x80 | ||
| 662 | }; | ||
| 663 | |||
| 664 | union NumVersionVariant { | ||
| 665 | /* NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value */ | ||
| 666 | NumVersion parts; | ||
| 667 | UInt32 whole; | ||
| 668 | }; | ||
| 669 | typedef union NumVersionVariant NumVersionVariant; | ||
| 670 | typedef NumVersionVariant * NumVersionVariantPtr; | ||
| 671 | typedef NumVersionVariantPtr * NumVersionVariantHandle; | ||
| 672 | struct VersRec { | ||
| 673 | /* 'vers' resource format */ | ||
| 674 | NumVersion numericVersion; /*encoded version number*/ | ||
| 675 | short countryCode; /*country code from intl utilities*/ | ||
| 676 | Str255 shortVersion; /*version number string - worst case*/ | ||
| 677 | Str255 reserved; /*longMessage string packed after shortVersion*/ | ||
| 678 | }; | ||
| 679 | typedef struct VersRec VersRec; | ||
| 680 | typedef VersRec * VersRecPtr; | ||
| 681 | typedef VersRecPtr * VersRecHndl; | ||
| 682 | /********************************************************************************* | ||
| 683 | |||
| 684 | Old names for types | ||
| 685 | |||
| 686 | *********************************************************************************/ | ||
| 687 | typedef UInt8 Byte; | ||
| 688 | typedef SInt8 SignedByte; | ||
| 689 | typedef wide * WidePtr; | ||
| 690 | typedef UnsignedWide * UnsignedWidePtr; | ||
| 691 | typedef Float80 extended80; | ||
| 692 | typedef Float96 extended96; | ||
| 693 | typedef SInt8 VHSelect; | ||
| 694 | /********************************************************************************* | ||
| 695 | |||
| 696 | Debugger functions | ||
| 697 | |||
| 698 | *********************************************************************************/ | ||
| 699 | /* | ||
| 700 | * Debugger() | ||
| 701 | * | ||
| 702 | * Availability: | ||
| 703 | * Mac OS X: in version 10.0 and later in CoreServices.framework | ||
| 704 | * CarbonLib: in CarbonLib 1.0 and later | ||
| 705 | * Non-Carbon CFM: in InterfaceLib 7.1 and later | ||
| 706 | */ | ||
| 707 | extern void | ||
| 708 | Debugger(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); | ||
| 709 | |||
| 710 | |||
| 711 | /* | ||
| 712 | * DebugStr() | ||
| 713 | * | ||
| 714 | * Availability: | ||
| 715 | * Mac OS X: in version 10.0 and later in CoreServices.framework | ||
| 716 | * CarbonLib: in CarbonLib 1.0 and later | ||
| 717 | * Non-Carbon CFM: in InterfaceLib 7.1 and later | ||
| 718 | */ | ||
| 719 | extern void | ||
| 720 | DebugStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); | ||
| 721 | |||
| 722 | |||
| 723 | /* | ||
| 724 | * debugstr() | ||
| 725 | * | ||
| 726 | * Availability: | ||
| 727 | * Mac OS X: not available | ||
| 728 | * CarbonLib: not available | ||
| 729 | * Non-Carbon CFM: in InterfaceLib 7.1 and later | ||
| 730 | */ | ||
| 731 | |||
| 732 | |||
| 733 | #if TARGET_CPU_PPC | ||
| 734 | /* Only for Mac OS native drivers */ | ||
| 735 | /* | ||
| 736 | * SysDebug() | ||
| 737 | * | ||
| 738 | * Availability: | ||
| 739 | * Mac OS X: not available | ||
| 740 | * CarbonLib: not available | ||
| 741 | * Non-Carbon CFM: in DriverServicesLib 1.0 and later | ||
| 742 | */ | ||
| 743 | |||
| 744 | |||
| 745 | /* | ||
| 746 | * SysDebugStr() | ||
| 747 | * | ||
| 748 | * Availability: | ||
| 749 | * Mac OS X: not available | ||
| 750 | * CarbonLib: not available | ||
| 751 | * Non-Carbon CFM: in DriverServicesLib 1.0 and later | ||
| 752 | */ | ||
| 753 | |||
| 754 | |||
| 755 | #endif /* TARGET_CPU_PPC */ | ||
| 756 | |||
| 757 | /* SADE break points */ | ||
| 758 | /* | ||
| 759 | * SysBreak() | ||
| 760 | * | ||
| 761 | * Availability: | ||
| 762 | * Mac OS X: in version 10.0 and later in CoreServices.framework | ||
| 763 | * CarbonLib: in CarbonLib 1.0 and later | ||
| 764 | * Non-Carbon CFM: in InterfaceLib 7.1 and later | ||
| 765 | */ | ||
| 766 | extern void | ||
| 767 | SysBreak(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); | ||
| 768 | |||
| 769 | |||
| 770 | /* | ||
| 771 | * SysBreakStr() | ||
| 772 | * | ||
| 773 | * Availability: | ||
| 774 | * Mac OS X: in version 10.0 and later in CoreServices.framework | ||
| 775 | * CarbonLib: in CarbonLib 1.0 and later | ||
| 776 | * Non-Carbon CFM: in InterfaceLib 7.1 and later | ||
| 777 | */ | ||
| 778 | extern void | ||
| 779 | SysBreakStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); | ||
| 780 | |||
| 781 | |||
| 782 | /* | ||
| 783 | * SysBreakFunc() | ||
| 784 | * | ||
| 785 | * Availability: | ||
| 786 | * Mac OS X: in version 10.0 and later in CoreServices.framework | ||
| 787 | * CarbonLib: in CarbonLib 1.0 and later | ||
| 788 | * Non-Carbon CFM: in InterfaceLib 7.1 and later | ||
| 789 | */ | ||
| 790 | extern void | ||
| 791 | SysBreakFunc(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); | ||
| 792 | |||
| 793 | |||
| 794 | /* old names for Debugger and DebugStr */ | ||
| 795 | #if OLDROUTINENAMES && TARGET_CPU_68K | ||
| 796 | #define Debugger68k() Debugger() | ||
| 797 | #define DebugStr68k(s) DebugStr(s) | ||
| 798 | #endif | ||
| 799 | |||
| 800 | |||
| 801 | #pragma pack(pop) | ||
| 802 | |||
| 803 | #ifdef __cplusplus | ||
| 804 | } | ||
| 805 | #endif | ||
| 806 | |||
| 807 | #endif /* __MACTYPES__ */ | ||
| 808 | |||
lib/libc/include/x86_64-macos-gnu/TargetConditionals.h created+508| ... | @@ -0,0 +1,508 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2014 by Apple Inc.. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | File: TargetConditionals.h | ||
| 26 | |||
| 27 | Contains: Autoconfiguration of TARGET_ conditionals for Mac OS X and iPhone | ||
| 28 | |||
| 29 | Note: TargetConditionals.h in 3.4 Universal Interfaces works | ||
| 30 | with all compilers. This header only recognizes compilers | ||
| 31 | known to run on Mac OS X. | ||
| 32 | |||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef __TARGETCONDITIONALS__ | ||
| 36 | #define __TARGETCONDITIONALS__ | ||
| 37 | |||
| 38 | /* | ||
| 39 | * | ||
| 40 | * TARGET_CPU_* | ||
| 41 | * These conditionals specify which microprocessor instruction set is being | ||
| 42 | * generated. At most one of these is true, the rest are false. | ||
| 43 | * | ||
| 44 | * TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode | ||
| 45 | * TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode | ||
| 46 | * TARGET_CPU_68K - Compiler is generating 680x0 instructions | ||
| 47 | * TARGET_CPU_X86 - Compiler is generating x86 instructions for 32-bit mode | ||
| 48 | * TARGET_CPU_X86_64 - Compiler is generating x86 instructions for 64-bit mode | ||
| 49 | * TARGET_CPU_ARM - Compiler is generating ARM instructions for 32-bit mode | ||
| 50 | * TARGET_CPU_ARM64 - Compiler is generating ARM instructions for 64-bit mode | ||
| 51 | * TARGET_CPU_MIPS - Compiler is generating MIPS instructions | ||
| 52 | * TARGET_CPU_SPARC - Compiler is generating Sparc instructions | ||
| 53 | * TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions | ||
| 54 | * | ||
| 55 | * | ||
| 56 | * TARGET_OS_* | ||
| 57 | * These conditionals specify in which Operating System the generated code will | ||
| 58 | * run. Indention is used to show which conditionals are evolutionary subclasses. | ||
| 59 | * | ||
| 60 | * The MAC/WIN32/UNIX conditionals are mutually exclusive. | ||
| 61 | * The IOS/TV/WATCH conditionals are mutually exclusive. | ||
| 62 | * | ||
| 63 | * | ||
| 64 | * TARGET_OS_WIN32 - Generated code will run under 32-bit Windows | ||
| 65 | * TARGET_OS_UNIX - Generated code will run under some Unix (not OSX) | ||
| 66 | * TARGET_OS_MAC - Generated code will run under Mac OS X variant | ||
| 67 | * TARGET_OS_OSX - Generated code will run under OS X devices | ||
| 68 | * TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator | ||
| 69 | * TARGET_OS_IOS - Generated code will run under iOS | ||
| 70 | * TARGET_OS_TV - Generated code will run under Apple TV OS | ||
| 71 | * TARGET_OS_WATCH - Generated code will run under Apple Watch OS | ||
| 72 | * TARGET_OS_BRIDGE - Generated code will run under Bridge devices | ||
| 73 | * TARGET_OS_MACCATALYST - Generated code will run under macOS | ||
| 74 | * TARGET_OS_SIMULATOR - Generated code will run under a simulator | ||
| 75 | * | ||
| 76 | * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead | ||
| 77 | * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR | ||
| 78 | * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH | ||
| 79 | * | ||
| 80 | * +---------------------------------------------------------------------+ | ||
| 81 | * | TARGET_OS_MAC | | ||
| 82 | * | +---+ +-----------------------------------------------+ +---------+ | | ||
| 83 | * | | | | TARGET_OS_IPHONE | | | | | ||
| 84 | * | | | | +---------------+ +----+ +-------+ +--------+ | | | | | ||
| 85 | * | | | | | IOS | | | | | | | | | | | | ||
| 86 | * | |OSX| | |+-------------+| | TV | | WATCH | | BRIDGE | | |DRIVERKIT| | | ||
| 87 | * | | | | || MACCATALYST || | | | | | | | | | | | ||
| 88 | * | | | | |+-------------+| | | | | | | | | | | | ||
| 89 | * | | | | +---------------+ +----+ +-------+ +--------+ | | | | | ||
| 90 | * | +---+ +-----------------------------------------------+ +---------+ | | ||
| 91 | * +---------------------------------------------------------------------+ | ||
| 92 | * | ||
| 93 | * TARGET_RT_* | ||
| 94 | * These conditionals specify in which runtime the generated code will | ||
| 95 | * run. This is needed when the OS and CPU support more than one runtime | ||
| 96 | * (e.g. Mac OS X supports CFM and mach-o). | ||
| 97 | * | ||
| 98 | * TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers | ||
| 99 | * TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers | ||
| 100 | * TARGET_RT_64_BIT - Generated code uses 64-bit pointers | ||
| 101 | * TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used | ||
| 102 | * TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used | ||
| 103 | */ | ||
| 104 | |||
| 105 | /* | ||
| 106 | * TARGET_OS conditionals can be enabled via clang preprocessor extensions: | ||
| 107 | * | ||
| 108 | * __is_target_arch | ||
| 109 | * __is_target_vendor | ||
| 110 | * __is_target_os | ||
| 111 | * __is_target_environment | ||
| 112 | * | ||
| 113 | * “-target=x86_64-apple-ios12-macabi” | ||
| 114 | * TARGET_OS_MAC=1 | ||
| 115 | * TARGET_OS_IPHONE=1 | ||
| 116 | * TARGET_OS_IOS=1 | ||
| 117 | * TARGET_OS_MACCATALYST=1 | ||
| 118 | * | ||
| 119 | * “-target=x86_64-apple-ios12-simulator” | ||
| 120 | * TARGET_OS_MAC=1 | ||
| 121 | * TARGET_OS_IPHONE=1 | ||
| 122 | * TARGET_OS_IOS=1 | ||
| 123 | * TARGET_OS_SIMULATOR=1 | ||
| 124 | * | ||
| 125 | * DYNAMIC_TARGETS_ENABLED indicates that the core TARGET_OS macros were enabled via clang preprocessor extensions. | ||
| 126 | * If this value is not set, the macro enablements will fall back to the static behavior. | ||
| 127 | * It is disabled by default. | ||
| 128 | */ | ||
| 129 | |||
| 130 | #if defined(__has_builtin) | ||
| 131 | #if __has_builtin(__is_target_arch) | ||
| 132 | #if __has_builtin(__is_target_vendor) | ||
| 133 | #if __has_builtin(__is_target_os) | ||
| 134 | #if __has_builtin(__is_target_environment) | ||
| 135 | |||
| 136 | /* “-target=x86_64-apple-ios12-macabi” */ | ||
| 137 | /* “-target=arm64-apple-ios12-macabi” */ | ||
| 138 | /* “-target=arm64e-apple-ios12-macabi” */ | ||
| 139 | #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi) | ||
| 140 | #define TARGET_OS_OSX 0 | ||
| 141 | #define TARGET_OS_IPHONE 1 | ||
| 142 | #define TARGET_OS_IOS 1 | ||
| 143 | #define TARGET_OS_WATCH 0 | ||
| 144 | |||
| 145 | #define TARGET_OS_TV 0 | ||
| 146 | #define TARGET_OS_SIMULATOR 0 | ||
| 147 | #define TARGET_OS_EMBEDDED 0 | ||
| 148 | #define TARGET_OS_RTKIT 0 | ||
| 149 | #define TARGET_OS_MACCATALYST 1 | ||
| 150 | #define TARGET_OS_MACCATALYST 1 | ||
| 151 | #ifndef TARGET_OS_UIKITFORMAC | ||
| 152 | #define TARGET_OS_UIKITFORMAC 1 | ||
| 153 | #endif | ||
| 154 | #define TARGET_OS_DRIVERKIT 0 | ||
| 155 | #define DYNAMIC_TARGETS_ENABLED 1 | ||
| 156 | #endif | ||
| 157 | |||
| 158 | /* “-target=x86_64-apple-ios12-simulator” */ | ||
| 159 | #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator) | ||
| 160 | #define TARGET_OS_OSX 0 | ||
| 161 | #define TARGET_OS_IPHONE 1 | ||
| 162 | #define TARGET_OS_IOS 1 | ||
| 163 | #define TARGET_OS_WATCH 0 | ||
| 164 | |||
| 165 | #define TARGET_OS_TV 0 | ||
| 166 | #define TARGET_OS_SIMULATOR 1 | ||
| 167 | #define TARGET_OS_EMBEDDED 0 | ||
| 168 | #define TARGET_OS_RTKIT 0 | ||
| 169 | #define TARGET_OS_MACCATALYST 0 | ||
| 170 | #define TARGET_OS_MACCATALYST 0 | ||
| 171 | #ifndef TARGET_OS_UIKITFORMAC | ||
| 172 | #define TARGET_OS_UIKITFORMAC 0 | ||
| 173 | #endif | ||
| 174 | #define TARGET_OS_DRIVERKIT 0 | ||
| 175 | #define DYNAMIC_TARGETS_ENABLED 1 | ||
| 176 | #endif | ||
| 177 | |||
| 178 | /* -target=x86_64-apple-driverkit19.0 */ | ||
| 179 | /* -target=arm64-apple-driverkit19.0 */ | ||
| 180 | /* -target=arm64e-apple-driverkit19.0 */ | ||
| 181 | #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(driverkit) | ||
| 182 | #define TARGET_OS_OSX 0 | ||
| 183 | #define TARGET_OS_IPHONE 0 | ||
| 184 | #define TARGET_OS_IOS 0 | ||
| 185 | #define TARGET_OS_WATCH 0 | ||
| 186 | |||
| 187 | #define TARGET_OS_TV 0 | ||
| 188 | #define TARGET_OS_SIMULATOR 0 | ||
| 189 | #define TARGET_OS_EMBEDDED 0 | ||
| 190 | #define TARGET_OS_RTKIT 0 | ||
| 191 | #define TARGET_OS_MACCATALYST 0 | ||
| 192 | #define TARGET_OS_MACCATALYST 0 | ||
| 193 | #ifndef TARGET_OS_UIKITFORMAC | ||
| 194 | #define TARGET_OS_UIKITFORMAC 0 | ||
| 195 | #endif | ||
| 196 | #define TARGET_OS_DRIVERKIT 1 | ||
| 197 | #define DYNAMIC_TARGETS_ENABLED 1 | ||
| 198 | #endif | ||
| 199 | |||
| 200 | #endif /* #if __has_builtin(__is_target_environment) */ | ||
| 201 | #endif /* #if __has_builtin(__is_target_os) */ | ||
| 202 | #endif /* #if __has_builtin(__is_target_vendor) */ | ||
| 203 | #endif /* #if __has_builtin(__is_target_arch) */ | ||
| 204 | #endif /* #if defined(__has_builtin) */ | ||
| 205 | |||
| 206 | |||
| 207 | #ifndef DYNAMIC_TARGETS_ENABLED | ||
| 208 | #define DYNAMIC_TARGETS_ENABLED 0 | ||
| 209 | #endif /* DYNAMIC_TARGETS_ENABLED */ | ||
| 210 | |||
| 211 | /* | ||
| 212 | * gcc based compiler used on Mac OS X | ||
| 213 | */ | ||
| 214 | #if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) ) | ||
| 215 | #define TARGET_OS_MAC 1 | ||
| 216 | #define TARGET_OS_WIN32 0 | ||
| 217 | #define TARGET_OS_UNIX 0 | ||
| 218 | |||
| 219 | #if !DYNAMIC_TARGETS_ENABLED | ||
| 220 | #define TARGET_OS_OSX 1 | ||
| 221 | #define TARGET_OS_IPHONE 0 | ||
| 222 | #define TARGET_OS_IOS 0 | ||
| 223 | #define TARGET_OS_WATCH 0 | ||
| 224 | |||
| 225 | #define TARGET_OS_TV 0 | ||
| 226 | #define TARGET_OS_MACCATALYST 0 | ||
| 227 | #define TARGET_OS_MACCATALYST 0 | ||
| 228 | #ifndef TARGET_OS_UIKITFORMAC | ||
| 229 | #define TARGET_OS_UIKITFORMAC 0 | ||
| 230 | #endif | ||
| 231 | #define TARGET_OS_SIMULATOR 0 | ||
| 232 | #define TARGET_OS_EMBEDDED 0 | ||
| 233 | #define TARGET_OS_RTKIT 0 | ||
| 234 | #define TARGET_OS_DRIVERKIT 0 | ||
| 235 | #endif | ||
| 236 | |||
| 237 | #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */ | ||
| 238 | #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */ | ||
| 239 | |||
| 240 | #define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST)) | ||
| 241 | #if defined(__ppc__) | ||
| 242 | #define TARGET_CPU_PPC 1 | ||
| 243 | #define TARGET_CPU_PPC64 0 | ||
| 244 | #define TARGET_CPU_68K 0 | ||
| 245 | #define TARGET_CPU_X86 0 | ||
| 246 | #define TARGET_CPU_X86_64 0 | ||
| 247 | #define TARGET_CPU_ARM 0 | ||
| 248 | #define TARGET_CPU_ARM64 0 | ||
| 249 | #define TARGET_CPU_MIPS 0 | ||
| 250 | #define TARGET_CPU_SPARC 0 | ||
| 251 | #define TARGET_CPU_ALPHA 0 | ||
| 252 | #define TARGET_RT_LITTLE_ENDIAN 0 | ||
| 253 | #define TARGET_RT_BIG_ENDIAN 1 | ||
| 254 | #define TARGET_RT_64_BIT 0 | ||
| 255 | #ifdef __MACOS_CLASSIC__ | ||
| 256 | #define TARGET_RT_MAC_CFM 1 | ||
| 257 | #define TARGET_RT_MAC_MACHO 0 | ||
| 258 | #else | ||
| 259 | #define TARGET_RT_MAC_CFM 0 | ||
| 260 | #define TARGET_RT_MAC_MACHO 1 | ||
| 261 | #endif | ||
| 262 | #elif defined(__ppc64__) | ||
| 263 | #define TARGET_CPU_PPC 0 | ||
| 264 | #define TARGET_CPU_PPC64 1 | ||
| 265 | #define TARGET_CPU_68K 0 | ||
| 266 | #define TARGET_CPU_X86 0 | ||
| 267 | #define TARGET_CPU_X86_64 0 | ||
| 268 | #define TARGET_CPU_ARM 0 | ||
| 269 | #define TARGET_CPU_ARM64 0 | ||
| 270 | #define TARGET_CPU_MIPS 0 | ||
| 271 | #define TARGET_CPU_SPARC 0 | ||
| 272 | #define TARGET_CPU_ALPHA 0 | ||
| 273 | #define TARGET_RT_LITTLE_ENDIAN 0 | ||
| 274 | #define TARGET_RT_BIG_ENDIAN 1 | ||
| 275 | #define TARGET_RT_64_BIT 1 | ||
| 276 | #define TARGET_RT_MAC_CFM 0 | ||
| 277 | #define TARGET_RT_MAC_MACHO 1 | ||
| 278 | #elif defined(__i386__) | ||
| 279 | #define TARGET_CPU_PPC 0 | ||
| 280 | #define TARGET_CPU_PPC64 0 | ||
| 281 | #define TARGET_CPU_68K 0 | ||
| 282 | #define TARGET_CPU_X86 1 | ||
| 283 | #define TARGET_CPU_X86_64 0 | ||
| 284 | #define TARGET_CPU_ARM 0 | ||
| 285 | #define TARGET_CPU_ARM64 0 | ||
| 286 | #define TARGET_CPU_MIPS 0 | ||
| 287 | #define TARGET_CPU_SPARC 0 | ||
| 288 | #define TARGET_CPU_ALPHA 0 | ||
| 289 | #define TARGET_RT_MAC_CFM 0 | ||
| 290 | #define TARGET_RT_MAC_MACHO 1 | ||
| 291 | #define TARGET_RT_LITTLE_ENDIAN 1 | ||
| 292 | #define TARGET_RT_BIG_ENDIAN 0 | ||
| 293 | #define TARGET_RT_64_BIT 0 | ||
| 294 | #elif defined(__x86_64__) | ||
| 295 | #define TARGET_CPU_PPC 0 | ||
| 296 | #define TARGET_CPU_PPC64 0 | ||
| 297 | #define TARGET_CPU_68K 0 | ||
| 298 | #define TARGET_CPU_X86 0 | ||
| 299 | #define TARGET_CPU_X86_64 1 | ||
| 300 | #define TARGET_CPU_ARM 0 | ||
| 301 | #define TARGET_CPU_ARM64 0 | ||
| 302 | #define TARGET_CPU_MIPS 0 | ||
| 303 | #define TARGET_CPU_SPARC 0 | ||
| 304 | #define TARGET_CPU_ALPHA 0 | ||
| 305 | #define TARGET_RT_MAC_CFM 0 | ||
| 306 | #define TARGET_RT_MAC_MACHO 1 | ||
| 307 | #define TARGET_RT_LITTLE_ENDIAN 1 | ||
| 308 | #define TARGET_RT_BIG_ENDIAN 0 | ||
| 309 | #define TARGET_RT_64_BIT 1 | ||
| 310 | #elif defined(__arm__) | ||
| 311 | #define TARGET_CPU_PPC 0 | ||
| 312 | #define TARGET_CPU_PPC64 0 | ||
| 313 | #define TARGET_CPU_68K 0 | ||
| 314 | #define TARGET_CPU_X86 0 | ||
| 315 | #define TARGET_CPU_X86_64 0 | ||
| 316 | #define TARGET_CPU_ARM 1 | ||
| 317 | #define TARGET_CPU_ARM64 0 | ||
| 318 | #define TARGET_CPU_MIPS 0 | ||
| 319 | #define TARGET_CPU_SPARC 0 | ||
| 320 | #define TARGET_CPU_ALPHA 0 | ||
| 321 | #define TARGET_RT_MAC_CFM 0 | ||
| 322 | #define TARGET_RT_MAC_MACHO 1 | ||
| 323 | #define TARGET_RT_LITTLE_ENDIAN 1 | ||
| 324 | #define TARGET_RT_BIG_ENDIAN 0 | ||
| 325 | #define TARGET_RT_64_BIT 0 | ||
| 326 | #elif defined(__arm64__) | ||
| 327 | #define TARGET_CPU_PPC 0 | ||
| 328 | #define TARGET_CPU_PPC64 0 | ||
| 329 | #define TARGET_CPU_68K 0 | ||
| 330 | #define TARGET_CPU_X86 0 | ||
| 331 | #define TARGET_CPU_X86_64 0 | ||
| 332 | #define TARGET_CPU_ARM 0 | ||
| 333 | #define TARGET_CPU_ARM64 1 | ||
| 334 | #define TARGET_CPU_MIPS 0 | ||
| 335 | #define TARGET_CPU_SPARC 0 | ||
| 336 | #define TARGET_CPU_ALPHA 0 | ||
| 337 | #define TARGET_RT_MAC_CFM 0 | ||
| 338 | #define TARGET_RT_MAC_MACHO 1 | ||
| 339 | #define TARGET_RT_LITTLE_ENDIAN 1 | ||
| 340 | #define TARGET_RT_BIG_ENDIAN 0 | ||
| 341 | #if __LP64__ | ||
| 342 | #define TARGET_RT_64_BIT 1 | ||
| 343 | #else | ||
| 344 | #define TARGET_RT_64_BIT 0 | ||
| 345 | #endif | ||
| 346 | #else | ||
| 347 | #error unrecognized GNU C compiler | ||
| 348 | #endif | ||
| 349 | |||
| 350 | |||
| 351 | |||
| 352 | /* | ||
| 353 | * CodeWarrior compiler from Metrowerks/Motorola | ||
| 354 | */ | ||
| 355 | #elif defined(__MWERKS__) | ||
| 356 | #define TARGET_OS_MAC 1 | ||
| 357 | #define TARGET_OS_WIN32 0 | ||
| 358 | #define TARGET_OS_UNIX 0 | ||
| 359 | #define TARGET_OS_EMBEDDED 0 | ||
| 360 | #if defined(__POWERPC__) | ||
| 361 | #define TARGET_CPU_PPC 1 | ||
| 362 | #define TARGET_CPU_PPC64 0 | ||
| 363 | #define TARGET_CPU_68K 0 | ||
| 364 | #define TARGET_CPU_X86 0 | ||
| 365 | #define TARGET_CPU_MIPS 0 | ||
| 366 | #define TARGET_CPU_SPARC 0 | ||
| 367 | #define TARGET_CPU_ALPHA 0 | ||
| 368 | #define TARGET_RT_LITTLE_ENDIAN 0 | ||
| 369 | #define TARGET_RT_BIG_ENDIAN 1 | ||
| 370 | #elif defined(__INTEL__) | ||
| 371 | #define TARGET_CPU_PPC 0 | ||
| 372 | #define TARGET_CPU_PPC64 0 | ||
| 373 | #define TARGET_CPU_68K 0 | ||
| 374 | #define TARGET_CPU_X86 1 | ||
| 375 | #define TARGET_CPU_MIPS 0 | ||
| 376 | #define TARGET_CPU_SPARC 0 | ||
| 377 | #define TARGET_CPU_ALPHA 0 | ||
| 378 | #define TARGET_RT_LITTLE_ENDIAN 1 | ||
| 379 | #define TARGET_RT_BIG_ENDIAN 0 | ||
| 380 | #else | ||
| 381 | #error unknown Metrowerks CPU type | ||
| 382 | #endif | ||
| 383 | #define TARGET_RT_64_BIT 0 | ||
| 384 | #ifdef __MACH__ | ||
| 385 | #define TARGET_RT_MAC_CFM 0 | ||
| 386 | #define TARGET_RT_MAC_MACHO 1 | ||
| 387 | #else | ||
| 388 | #define TARGET_RT_MAC_CFM 1 | ||
| 389 | #define TARGET_RT_MAC_MACHO 0 | ||
| 390 | #endif | ||
| 391 | |||
| 392 | /* | ||
| 393 | * unknown compiler | ||
| 394 | */ | ||
| 395 | #else | ||
| 396 | #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC | ||
| 397 | #define TARGET_CPU_PPC64 0 | ||
| 398 | #define TARGET_CPU_68K 0 | ||
| 399 | #define TARGET_CPU_X86 0 | ||
| 400 | #define TARGET_CPU_X86_64 0 | ||
| 401 | #define TARGET_CPU_ARM 0 | ||
| 402 | #define TARGET_CPU_ARM64 0 | ||
| 403 | #define TARGET_CPU_MIPS 0 | ||
| 404 | #define TARGET_CPU_SPARC 0 | ||
| 405 | #define TARGET_CPU_ALPHA 0 | ||
| 406 | #elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64 | ||
| 407 | #define TARGET_CPU_PPC 0 | ||
| 408 | #define TARGET_CPU_68K 0 | ||
| 409 | #define TARGET_CPU_X86 0 | ||
| 410 | #define TARGET_CPU_X86_64 0 | ||
| 411 | #define TARGET_CPU_ARM 0 | ||
| 412 | #define TARGET_CPU_ARM64 0 | ||
| 413 | #define TARGET_CPU_MIPS 0 | ||
| 414 | #define TARGET_CPU_SPARC 0 | ||
| 415 | #define TARGET_CPU_ALPHA 0 | ||
| 416 | #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86 | ||
| 417 | #define TARGET_CPU_PPC 0 | ||
| 418 | #define TARGET_CPU_PPC64 0 | ||
| 419 | #define TARGET_CPU_X86_64 0 | ||
| 420 | #define TARGET_CPU_68K 0 | ||
| 421 | #define TARGET_CPU_ARM 0 | ||
| 422 | #define TARGET_CPU_ARM64 0 | ||
| 423 | #define TARGET_CPU_MIPS 0 | ||
| 424 | #define TARGET_CPU_SPARC 0 | ||
| 425 | #define TARGET_CPU_ALPHA 0 | ||
| 426 | #elif defined(TARGET_CPU_X86_64) && TARGET_CPU_X86_64 | ||
| 427 | #define TARGET_CPU_PPC 0 | ||
| 428 | #define TARGET_CPU_PPC64 0 | ||
| 429 | #define TARGET_CPU_X86 0 | ||
| 430 | #define TARGET_CPU_68K 0 | ||
| 431 | #define TARGET_CPU_ARM 0 | ||
| 432 | #define TARGET_CPU_ARM64 0 | ||
| 433 | #define TARGET_CPU_MIPS 0 | ||
| 434 | #define TARGET_CPU_SPARC 0 | ||
| 435 | #define TARGET_CPU_ALPHA 0 | ||
| 436 | #elif defined(TARGET_CPU_ARM) && TARGET_CPU_ARM | ||
| 437 | #define TARGET_CPU_PPC 0 | ||
| 438 | #define TARGET_CPU_PPC64 0 | ||
| 439 | #define TARGET_CPU_X86 0 | ||
| 440 | #define TARGET_CPU_X86_64 0 | ||
| 441 | #define TARGET_CPU_68K 0 | ||
| 442 | #define TARGET_CPU_ARM64 0 | ||
| 443 | #define TARGET_CPU_MIPS 0 | ||
| 444 | #define TARGET_CPU_SPARC 0 | ||
| 445 | #define TARGET_CPU_ALPHA 0 | ||
| 446 | #elif defined(TARGET_CPU_ARM64) && TARGET_CPU_ARM64 | ||
| 447 | #define TARGET_CPU_PPC 0 | ||
| 448 | #define TARGET_CPU_PPC64 0 | ||
| 449 | #define TARGET_CPU_X86 0 | ||
| 450 | #define TARGET_CPU_X86_64 0 | ||
| 451 | #define TARGET_CPU_68K 0 | ||
| 452 | #define TARGET_CPU_ARM 0 | ||
| 453 | #define TARGET_CPU_MIPS 0 | ||
| 454 | #define TARGET_CPU_SPARC 0 | ||
| 455 | #define TARGET_CPU_ALPHA 0 | ||
| 456 | #else | ||
| 457 | /* | ||
| 458 | NOTE: If your compiler errors out here then support for your compiler | ||
| 459 | has not yet been added to TargetConditionals.h. | ||
| 460 | |||
| 461 | TargetConditionals.h is designed to be plug-and-play. It auto detects | ||
| 462 | which compiler is being run and configures the TARGET_ conditionals | ||
| 463 | appropriately. | ||
| 464 | |||
| 465 | The short term work around is to set the TARGET_CPU_ and TARGET_OS_ | ||
| 466 | on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1) | ||
| 467 | |||
| 468 | The long term solution is to add a new case to this file which | ||
| 469 | auto detects your compiler and sets up the TARGET_ conditionals. | ||
| 470 | Then submit the changes to Apple Computer. | ||
| 471 | */ | ||
| 472 | #error TargetConditionals.h: unknown compiler (see comment above) | ||
| 473 | #define TARGET_CPU_PPC 0 | ||
| 474 | #define TARGET_CPU_68K 0 | ||
| 475 | #define TARGET_CPU_X86 0 | ||
| 476 | #define TARGET_CPU_ARM 0 | ||
| 477 | #define TARGET_CPU_ARM64 0 | ||
| 478 | #define TARGET_CPU_MIPS 0 | ||
| 479 | #define TARGET_CPU_SPARC 0 | ||
| 480 | #define TARGET_CPU_ALPHA 0 | ||
| 481 | #endif | ||
| 482 | #define TARGET_OS_MAC 1 | ||
| 483 | #define TARGET_OS_WIN32 0 | ||
| 484 | #define TARGET_OS_UNIX 0 | ||
| 485 | #define TARGET_OS_EMBEDDED 0 | ||
| 486 | #if TARGET_CPU_PPC || TARGET_CPU_PPC64 | ||
| 487 | #define TARGET_RT_BIG_ENDIAN 1 | ||
| 488 | #define TARGET_RT_LITTLE_ENDIAN 0 | ||
| 489 | #else | ||
| 490 | #define TARGET_RT_BIG_ENDIAN 0 | ||
| 491 | #define TARGET_RT_LITTLE_ENDIAN 1 | ||
| 492 | #endif | ||
| 493 | #if TARGET_CPU_PPC64 || TARGET_CPU_X86_64 | ||
| 494 | #define TARGET_RT_64_BIT 1 | ||
| 495 | #else | ||
| 496 | #define TARGET_RT_64_BIT 0 | ||
| 497 | #endif | ||
| 498 | #ifdef __MACH__ | ||
| 499 | #define TARGET_RT_MAC_MACHO 1 | ||
| 500 | #define TARGET_RT_MAC_CFM 0 | ||
| 501 | #else | ||
| 502 | #define TARGET_RT_MAC_MACHO 0 | ||
| 503 | #define TARGET_RT_MAC_CFM 1 | ||
| 504 | #endif | ||
| 505 | |||
| 506 | #endif | ||
| 507 | |||
| 508 | #endif /* __TARGETCONDITIONALS__ */ | ||
lib/libc/include/x86_64-macos-gnu/_ctermid.h+9-1| ... | @@ -1,5 +1,5 @@ | ... | @@ -1,5 +1,5 @@ |
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. | 2 | * Copyright (c) 2000, 2002-2006, 2008-2010, 2012, 2020 Apple Inc. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * @APPLE_LICENSE_HEADER_START@ | 4 | * @APPLE_LICENSE_HEADER_START@ |
| 5 | * | 5 | * |
| ... | @@ -23,5 +23,13 @@ | ... | @@ -23,5 +23,13 @@ |
| 23 | 23 | ||
| 24 | #ifndef _CTERMID_H_ | 24 | #ifndef _CTERMID_H_ |
| 25 | #define _CTERMID_H_ | 25 | #define _CTERMID_H_ |
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | |||
| 29 | __BEGIN_DECLS | ||
| 30 | |||
| 26 | char *ctermid(char *); | 31 | char *ctermid(char *); |
| 32 | |||
| 33 | __END_DECLS | ||
| 34 | |||
| 27 | #endif | 35 | #endif |
lib/libc/include/x86_64-macos-gnu/_regex.h created+121| ... | @@ -0,0 +1,121 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2011 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | * Copyright (c) 2001-2009 Ville Laurikari <vl@iki.fi> | ||
| 25 | * All rights reserved. | ||
| 26 | * | ||
| 27 | * Redistribution and use in source and binary forms, with or without | ||
| 28 | * modification, are permitted provided that the following conditions | ||
| 29 | * are met: | ||
| 30 | * | ||
| 31 | * 1. Redistributions of source code must retain the above copyright | ||
| 32 | * notice, this list of conditions and the following disclaimer. | ||
| 33 | * | ||
| 34 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 35 | * notice, this list of conditions and the following disclaimer in the | ||
| 36 | * documentation and/or other materials provided with the distribution. | ||
| 37 | * | ||
| 38 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS | ||
| 39 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 40 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 41 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 42 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 43 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 44 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 45 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 46 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 47 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 48 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 49 | */ | ||
| 50 | /*- | ||
| 51 | * Copyright (c) 1992 Henry Spencer. | ||
| 52 | * Copyright (c) 1992, 1993 | ||
| 53 | *	The Regents of the University of California. All rights reserved. | ||
| 54 | * | ||
| 55 | * This code is derived from software contributed to Berkeley by | ||
| 56 | * Henry Spencer of the University of Toronto. | ||
| 57 | * | ||
| 58 | * Redistribution and use in source and binary forms, with or without | ||
| 59 | * modification, are permitted provided that the following conditions | ||
| 60 | * are met: | ||
| 61 | * 1. Redistributions of source code must retain the above copyright | ||
| 62 | * notice, this list of conditions and the following disclaimer. | ||
| 63 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 64 | * notice, this list of conditions and the following disclaimer in the | ||
| 65 | * documentation and/or other materials provided with the distribution. | ||
| 66 | * 3. All advertising materials mentioning features or use of this software | ||
| 67 | * must display the following acknowledgement: | ||
| 68 | *	This product includes software developed by the University of | ||
| 69 | *	California, Berkeley and its contributors. | ||
| 70 | * 4. Neither the name of the University nor the names of its contributors | ||
| 71 | * may be used to endorse or promote products derived from this software | ||
| 72 | * without specific prior written permission. | ||
| 73 | * | ||
| 74 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 75 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 76 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 77 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 78 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 79 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 80 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 81 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 82 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 83 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 84 | * SUCH DAMAGE. | ||
| 85 | * | ||
| 86 | *	@(#)regex.h	8.2 (Berkeley) 1/3/94 | ||
| 87 | */ | ||
| 88 | |||
| 89 | /* | ||
| 90 | * Common header for regex.h and xlocale/_regex.h | ||
| 91 | */ | ||
| 92 | |||
| 93 | #ifndef __REGEX_H_ | ||
| 94 | #define	__REGEX_H_ | ||
| 95 | |||
| 96 | #include <_types.h> | ||
| 97 | #include <Availability.h> | ||
| 98 | #include <sys/_types/_size_t.h> | ||
| 99 | |||
| 100 | /*********/ | ||
| 101 | /* types */ | ||
| 102 | /*********/ | ||
| 103 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 104 | #include <sys/_types/_wchar_t.h> | ||
| 105 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 106 | |||
| 107 | typedef __darwin_off_t regoff_t; | ||
| 108 | |||
| 109 | typedef struct { | ||
| 110 | 	int re_magic; | ||
| 111 | 	size_t re_nsub;		/* number of parenthesized subexpressions */ | ||
| 112 | 	const char *re_endp;	/* end pointer for REG_PEND */ | ||
| 113 | 	struct re_guts *re_g;	/* none of your business :-) */ | ||
| 114 | } regex_t; | ||
| 115 | |||
| 116 | typedef struct { | ||
| 117 | 	regoff_t rm_so;		/* start of match */ | ||
| 118 | 	regoff_t rm_eo;		/* end of match */ | ||
| 119 | } regmatch_t; | ||
| 120 | |||
| 121 | #endif /* !__REGEX_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/_types/_nl_item.h created+33| ... | @@ -0,0 +1,33 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _NL_ITEM | ||
| 30 | #define _NL_ITEM | ||
| 31 | #include <_types.h> | ||
| 32 | typedef __darwin_nl_item nl_item; | ||
| 33 | #endif /* _NL_ITEM */ | ||
| \ No newline at end of file | |||
lib/libc/include/x86_64-macos-gnu/_xlocale.h created+37| ... | @@ -0,0 +1,37 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __XLOCALE_H_ | ||
| 25 | #define __XLOCALE_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | |||
| 29 | struct _xlocale; /* forward reference */ | ||
| 30 | typedef struct _xlocale *		locale_t; | ||
| 31 | |||
| 32 | __BEGIN_DECLS | ||
| 33 | int		___mb_cur_max(void); | ||
| 34 | int		___mb_cur_max_l(locale_t); | ||
| 35 | __END_DECLS | ||
| 36 | |||
| 37 | #endif /* __XLOCALE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/aio.h created+37| ... | @@ -0,0 +1,37 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | *	File:	aio.h | ||
| 25 | *	Author:	Umesh Vaishampayan [umeshv@apple.com] | ||
| 26 | *			05-Feb-2003	umeshv	Created. | ||
| 27 | * | ||
| 28 | *	Header file for POSIX Asynchronous IO APIs | ||
| 29 | * | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _AIO_H_ | ||
| 33 | #define	_AIO_H_ | ||
| 34 | |||
| 35 | #include <sys/aio.h> | ||
| 36 | |||
| 37 | #endif /* _AIO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/architecture/byte_order.h created+381| ... | @@ -0,0 +1,381 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | * Copyright (c) 1992 NeXT Computer, Inc. | ||
| 25 | * | ||
| 26 | * Byte ordering conversion. | ||
| 27 | * | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef	_ARCHITECTURE_BYTE_ORDER_H_ | ||
| 31 | #define _ARCHITECTURE_BYTE_ORDER_H_ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Please note that the byte ordering functions in this file are deprecated. | ||
| 35 | * A replacement API exists in libkern/OSByteOrder.h | ||
| 36 | */ | ||
| 37 | |||
| 38 | #include <libkern/OSByteOrder.h> | ||
| 39 | |||
| 40 | typedef unsigned long NXSwappedFloat; | ||
| 41 | typedef unsigned long long NXSwappedDouble; | ||
| 42 | |||
| 43 | static __inline__ __attribute__((deprecated)) | ||
| 44 | unsigned short | ||
| 45 | NXSwapShort( | ||
| 46 | unsigned short inv | ||
| 47 | ) | ||
| 48 | { | ||
| 49 | return (unsigned short)OSSwapInt16((uint16_t)inv); | ||
| 50 | } | ||
| 51 | |||
| 52 | static __inline__ __attribute__((deprecated)) | ||
| 53 | unsigned int | ||
| 54 | NXSwapInt( | ||
| 55 | unsigned int inv | ||
| 56 | ) | ||
| 57 | { | ||
| 58 | return (unsigned int)OSSwapInt32((uint32_t)inv); | ||
| 59 | } | ||
| 60 | |||
| 61 | static __inline__ __attribute__((deprecated)) | ||
| 62 | unsigned long | ||
| 63 | NXSwapLong( | ||
| 64 | unsigned long inv | ||
| 65 | ) | ||
| 66 | { | ||
| 67 | return (unsigned long)OSSwapInt32((uint32_t)inv); | ||
| 68 | } | ||
| 69 | |||
| 70 | static __inline__ __attribute__((deprecated)) | ||
| 71 | unsigned long long | ||
| 72 | NXSwapLongLong( | ||
| 73 | unsigned long long inv | ||
| 74 | ) | ||
| 75 | { | ||
| 76 | return (unsigned long long)OSSwapInt64((uint64_t)inv); | ||
| 77 | } | ||
| 78 | |||
| 79 | static __inline__ __attribute__((deprecated)) | ||
| 80 | NXSwappedFloat | ||
| 81 | NXConvertHostFloatToSwapped(float x) | ||
| 82 | { | ||
| 83 | union fconv { | ||
| 84 | float number; | ||
| 85 | NXSwappedFloat sf; | ||
| 86 | } u; | ||
| 87 | u.number = x; | ||
| 88 | return u.sf; | ||
| 89 | } | ||
| 90 | |||
| 91 | static __inline__ __attribute__((deprecated)) | ||
| 92 | float | ||
| 93 | NXConvertSwappedFloatToHost(NXSwappedFloat x) | ||
| 94 | { | ||
| 95 | union fconv { | ||
| 96 | float number; | ||
| 97 | NXSwappedFloat sf; | ||
| 98 | } u; | ||
| 99 | u.sf = x; | ||
| 100 | return u.number; | ||
| 101 | } | ||
| 102 | |||
| 103 | static __inline__ __attribute__((deprecated)) | ||
| 104 | NXSwappedDouble | ||
| 105 | NXConvertHostDoubleToSwapped(double x) | ||
| 106 | { | ||
| 107 | union dconv { | ||
| 108 | double number; | ||
| 109 | NXSwappedDouble sd; | ||
| 110 | } u; | ||
| 111 | u.number = x; | ||
| 112 | return u.sd; | ||
| 113 | } | ||
| 114 | |||
| 115 | static __inline__ __attribute__((deprecated)) | ||
| 116 | double | ||
| 117 | NXConvertSwappedDoubleToHost(NXSwappedDouble x) | ||
| 118 | { | ||
| 119 | union dconv { | ||
| 120 | double number; | ||
| 121 | NXSwappedDouble sd; | ||
| 122 | } u; | ||
| 123 | u.sd = x; | ||
| 124 | return u.number; | ||
| 125 | } | ||
| 126 | |||
| 127 | static __inline__ __attribute__((deprecated)) | ||
| 128 | NXSwappedFloat | ||
| 129 | NXSwapFloat(NXSwappedFloat x) | ||
| 130 | { | ||
| 131 | return (NXSwappedFloat)OSSwapInt32((uint32_t)x); | ||
| 132 | } | ||
| 133 | |||
| 134 | static __inline__ __attribute__((deprecated)) | ||
| 135 | NXSwappedDouble | ||
| 136 | NXSwapDouble(NXSwappedDouble x) | ||
| 137 | { | ||
| 138 | return (NXSwappedDouble)OSSwapInt64((uint64_t)x); | ||
| 139 | } | ||
| 140 | |||
| 141 | /* | ||
| 142 | * Identify the byte order | ||
| 143 | * of the current host. | ||
| 144 | */ | ||
| 145 | |||
| 146 | enum NXByteOrder { | ||
| 147 | NX_UnknownByteOrder, | ||
| 148 | NX_LittleEndian, | ||
| 149 | NX_BigEndian | ||
| 150 | }; | ||
| 151 | |||
| 152 | static __inline__ | ||
| 153 | enum NXByteOrder | ||
| 154 | NXHostByteOrder(void) | ||
| 155 | { | ||
| 156 | #if defined(__LITTLE_ENDIAN__) | ||
| 157 | return NX_LittleEndian; | ||
| 158 | #elif defined(__BIG_ENDIAN__) | ||
| 159 | return NX_BigEndian; | ||
| 160 | #else | ||
| 161 | return NX_UnknownByteOrder; | ||
| 162 | #endif | ||
| 163 | } | ||
| 164 | |||
| 165 | static __inline__ __attribute__((deprecated)) | ||
| 166 | unsigned short | ||
| 167 | NXSwapBigShortToHost( | ||
| 168 | unsigned short	x | ||
| 169 | ) | ||
| 170 | { | ||
| 171 | return (unsigned short)OSSwapBigToHostInt16((uint16_t)x); | ||
| 172 | } | ||
| 173 | |||
| 174 | static __inline__ __attribute__((deprecated)) | ||
| 175 | unsigned int | ||
| 176 | NXSwapBigIntToHost( | ||
| 177 | unsigned int	x | ||
| 178 | ) | ||
| 179 | { | ||
| 180 | return (unsigned int)OSSwapBigToHostInt32((uint32_t)x); | ||
| 181 | } | ||
| 182 | |||
| 183 | static __inline__ __attribute__((deprecated)) | ||
| 184 | unsigned long | ||
| 185 | NXSwapBigLongToHost( | ||
| 186 | unsigned long	x | ||
| 187 | ) | ||
| 188 | { | ||
| 189 | return (unsigned long)OSSwapBigToHostInt32((uint32_t)x); | ||
| 190 | } | ||
| 191 | |||
| 192 | static __inline__ __attribute__((deprecated)) | ||
| 193 | unsigned long long | ||
| 194 | NXSwapBigLongLongToHost( | ||
| 195 | unsigned long long	x | ||
| 196 | ) | ||
| 197 | { | ||
| 198 | return (unsigned long long)OSSwapBigToHostInt64((uint64_t)x); | ||
| 199 | } | ||
| 200 | |||
| 201 | static __inline__ __attribute__((deprecated)) | ||
| 202 | double | ||
| 203 | NXSwapBigDoubleToHost( | ||
| 204 | NXSwappedDouble	x | ||
| 205 | ) | ||
| 206 | { | ||
| 207 | return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapBigToHostInt64((uint64_t)x)); | ||
| 208 | } | ||
| 209 | |||
| 210 | static __inline__ __attribute__((deprecated)) | ||
| 211 | float | ||
| 212 | NXSwapBigFloatToHost( | ||
| 213 | NXSwappedFloat	x | ||
| 214 | ) | ||
| 215 | { | ||
| 216 | return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapBigToHostInt32((uint32_t)x)); | ||
| 217 | } | ||
| 218 | |||
| 219 | static __inline__ __attribute__((deprecated)) | ||
| 220 | unsigned short | ||
| 221 | NXSwapHostShortToBig( | ||
| 222 | unsigned short	x | ||
| 223 | ) | ||
| 224 | { | ||
| 225 | return (unsigned short)OSSwapHostToBigInt16((uint16_t)x); | ||
| 226 | } | ||
| 227 | |||
| 228 | static __inline__ __attribute__((deprecated)) | ||
| 229 | unsigned int | ||
| 230 | NXSwapHostIntToBig( | ||
| 231 | unsigned int	x | ||
| 232 | ) | ||
| 233 | { | ||
| 234 | return (unsigned int)OSSwapHostToBigInt32((uint32_t)x); | ||
| 235 | } | ||
| 236 | |||
| 237 | static __inline__ __attribute__((deprecated)) | ||
| 238 | unsigned long | ||
| 239 | NXSwapHostLongToBig( | ||
| 240 | unsigned long	x | ||
| 241 | ) | ||
| 242 | { | ||
| 243 | return (unsigned long)OSSwapHostToBigInt32((uint32_t)x); | ||
| 244 | } | ||
| 245 | |||
| 246 | static __inline__ __attribute__((deprecated)) | ||
| 247 | unsigned long long | ||
| 248 | NXSwapHostLongLongToBig( | ||
| 249 | unsigned long long	x | ||
| 250 | ) | ||
| 251 | { | ||
| 252 | return (unsigned long long)OSSwapHostToBigInt64((uint64_t)x); | ||
| 253 | } | ||
| 254 | |||
| 255 | static __inline__ __attribute__((deprecated)) | ||
| 256 | NXSwappedDouble | ||
| 257 | NXSwapHostDoubleToBig( | ||
| 258 | double	x | ||
| 259 | ) | ||
| 260 | { | ||
| 261 | return (NXSwappedDouble)OSSwapHostToBigInt64((uint64_t)NXConvertHostDoubleToSwapped(x)); | ||
| 262 | } | ||
| 263 | |||
| 264 | static __inline__ __attribute__((deprecated)) | ||
| 265 | NXSwappedFloat | ||
| 266 | NXSwapHostFloatToBig( | ||
| 267 | float	x | ||
| 268 | ) | ||
| 269 | { | ||
| 270 | return (NXSwappedFloat)OSSwapHostToBigInt32((uint32_t)NXConvertHostFloatToSwapped(x)); | ||
| 271 | } | ||
| 272 | |||
| 273 | static __inline__ __attribute__((deprecated)) | ||
| 274 | unsigned short | ||
| 275 | NXSwapLittleShortToHost( | ||
| 276 | unsigned short	x | ||
| 277 | ) | ||
| 278 | { | ||
| 279 | return (unsigned short)OSSwapLittleToHostInt16((uint16_t)x); | ||
| 280 | } | ||
| 281 | |||
| 282 | static __inline__ __attribute__((deprecated)) | ||
| 283 | unsigned int | ||
| 284 | NXSwapLittleIntToHost( | ||
| 285 | unsigned int	x | ||
| 286 | ) | ||
| 287 | { | ||
| 288 | return (unsigned int)OSSwapLittleToHostInt32((uint32_t)x); | ||
| 289 | } | ||
| 290 | |||
| 291 | static __inline__ __attribute__((deprecated)) | ||
| 292 | unsigned long | ||
| 293 | NXSwapLittleLongToHost( | ||
| 294 | unsigned long	x | ||
| 295 | ) | ||
| 296 | { | ||
| 297 | return (unsigned long)OSSwapLittleToHostInt32((uint32_t)x); | ||
| 298 | } | ||
| 299 | |||
| 300 | static __inline__ __attribute__((deprecated)) | ||
| 301 | unsigned long long | ||
| 302 | NXSwapLittleLongLongToHost( | ||
| 303 | unsigned long long	x | ||
| 304 | ) | ||
| 305 | { | ||
| 306 | return (unsigned long long)OSSwapLittleToHostInt64((uint64_t)x); | ||
| 307 | } | ||
| 308 | |||
| 309 | static __inline__ __attribute__((deprecated)) | ||
| 310 | double | ||
| 311 | NXSwapLittleDoubleToHost( | ||
| 312 | NXSwappedDouble	x | ||
| 313 | ) | ||
| 314 | { | ||
| 315 | return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapLittleToHostInt64((uint64_t)x)); | ||
| 316 | } | ||
| 317 | |||
| 318 | static __inline__ __attribute__((deprecated)) | ||
| 319 | float | ||
| 320 | NXSwapLittleFloatToHost( | ||
| 321 | NXSwappedFloat	x | ||
| 322 | ) | ||
| 323 | { | ||
| 324 | return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapLittleToHostInt32((uint32_t)x)); | ||
| 325 | } | ||
| 326 | |||
| 327 | static __inline__ __attribute__((deprecated)) | ||
| 328 | unsigned short | ||
| 329 | NXSwapHostShortToLittle( | ||
| 330 | unsigned short	x | ||
| 331 | ) | ||
| 332 | { | ||
| 333 | return (unsigned short)OSSwapHostToLittleInt16((uint16_t)x); | ||
| 334 | } | ||
| 335 | |||
| 336 | static __inline__ __attribute__((deprecated)) | ||
| 337 | unsigned int | ||
| 338 | NXSwapHostIntToLittle( | ||
| 339 | unsigned int	x | ||
| 340 | ) | ||
| 341 | { | ||
| 342 | return (unsigned int)OSSwapHostToLittleInt32((uint32_t)x); | ||
| 343 | } | ||
| 344 | |||
| 345 | static __inline__ __attribute__((deprecated)) | ||
| 346 | unsigned long | ||
| 347 | NXSwapHostLongToLittle( | ||
| 348 | unsigned long	x | ||
| 349 | ) | ||
| 350 | { | ||
| 351 | return (unsigned long)OSSwapHostToLittleInt32((uint32_t)x); | ||
| 352 | } | ||
| 353 | |||
| 354 | static __inline__ __attribute__((deprecated)) | ||
| 355 | unsigned long long | ||
| 356 | NXSwapHostLongLongToLittle( | ||
| 357 | unsigned long long	x | ||
| 358 | ) | ||
| 359 | { | ||
| 360 | return (unsigned long long)OSSwapHostToLittleInt64((uint64_t)x); | ||
| 361 | } | ||
| 362 | |||
| 363 | static __inline__ __attribute__((deprecated)) | ||
| 364 | NXSwappedDouble | ||
| 365 | NXSwapHostDoubleToLittle( | ||
| 366 | double	x | ||
| 367 | ) | ||
| 368 | { | ||
| 369 | return (NXSwappedDouble)OSSwapHostToLittleInt64((uint64_t)NXConvertHostDoubleToSwapped(x)); | ||
| 370 | } | ||
| 371 | |||
| 372 | static __inline__ __attribute__((deprecated)) | ||
| 373 | NXSwappedFloat | ||
| 374 | NXSwapHostFloatToLittle( | ||
| 375 | float	x | ||
| 376 | ) | ||
| 377 | { | ||
| 378 | return (NXSwappedFloat)OSSwapHostToLittleInt32((uint32_t)NXConvertHostFloatToSwapped(x)); | ||
| 379 | } | ||
| 380 | |||
| 381 | #endif	/* _ARCHITECTURE_BYTE_ORDER_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/arpa/inet.h created+97| ... | @@ -0,0 +1,97 @@ | ||
| 1 | /* | ||
| 2 | * ++Copyright++ 1983, 1993 | ||
| 3 | * - | ||
| 4 | * Copyright (c) 1983, 1993 | ||
| 5 | * The Regents of the University of California. All rights reserved. | ||
| 6 | * | ||
| 7 | * Redistribution and use in source and binary forms, with or without | ||
| 8 | * modification, are permitted provided that the following conditions | ||
| 9 | * are met: | ||
| 10 | * 1. Redistributions of source code must retain the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer. | ||
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer in the | ||
| 14 | * documentation and/or other materials provided with the distribution. | ||
| 15 | * 3. All advertising materials mentioning features or use of this software | ||
| 16 | * must display the following acknowledgement: | ||
| 17 | * 	This product includes software developed by the University of | ||
| 18 | * 	California, Berkeley and its contributors. | ||
| 19 | * 4. Neither the name of the University nor the names of its contributors | ||
| 20 | * may be used to endorse or promote products derived from this software | ||
| 21 | * without specific prior written permission. | ||
| 22 | * | ||
| 23 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 24 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 33 | * SUCH DAMAGE. | ||
| 34 | * - | ||
| 35 | * Portions Copyright (c) 1993 by Digital Equipment Corporation. | ||
| 36 | * | ||
| 37 | * Permission to use, copy, modify, and distribute this software for any | ||
| 38 | * purpose with or without fee is hereby granted, provided that the above | ||
| 39 | * copyright notice and this permission notice appear in all copies, and that | ||
| 40 | * the name of Digital Equipment Corporation not be used in advertising or | ||
| 41 | * publicity pertaining to distribution of the document or software without | ||
| 42 | * specific, written prior permission. | ||
| 43 | * | ||
| 44 | * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL | ||
| 45 | * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES | ||
| 46 | * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT | ||
| 47 | * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | ||
| 48 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR | ||
| 49 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS | ||
| 50 | * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | ||
| 51 | * SOFTWARE. | ||
| 52 | * - | ||
| 53 | * --Copyright-- | ||
| 54 | */ | ||
| 55 | |||
| 56 | /* | ||
| 57 | *	@(#)inet.h	8.1 (Berkeley) 6/2/93 | ||
| 58 | *	$Id: inet.h,v 1.10 2006/02/01 18:09:47 majka Exp $ | ||
| 59 | */ | ||
| 60 | |||
| 61 | #ifndef _ARPA_INET_H_ | ||
| 62 | #define	_ARPA_INET_H_ | ||
| 63 | |||
| 64 | /* External definitions for functions in inet(3), addr2ascii(3) */ | ||
| 65 | |||
| 66 | #include <sys/cdefs.h> | ||
| 67 | #include <sys/_types.h> | ||
| 68 | #include <stdint.h>		/* uint32_t uint16_t */ | ||
| 69 | #include <machine/endian.h>	/* htonl() and family if (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 70 | #include <sys/_endian.h>	/* htonl() and family if (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 71 | #include <netinet/in.h>		/* in_addr */ | ||
| 72 | |||
| 73 | __BEGIN_DECLS | ||
| 74 | |||
| 75 | in_addr_t	 inet_addr(const char *); | ||
| 76 | char		*inet_ntoa(struct in_addr); | ||
| 77 | const char	*inet_ntop(int, const void *, char *, socklen_t); | ||
| 78 | int		 inet_pton(int, const char *, void *); | ||
| 79 | |||
| 80 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 81 | int		 ascii2addr(int, const char *, void *); | ||
| 82 | char		*addr2ascii(int, const void *, int, char *); | ||
| 83 | int		 inet_aton(const char *, struct in_addr *); | ||
| 84 | in_addr_t	 inet_lnaof(struct in_addr); | ||
| 85 | struct in_addr	 inet_makeaddr(in_addr_t, in_addr_t); | ||
| 86 | in_addr_t	 inet_netof(struct in_addr); | ||
| 87 | in_addr_t	 inet_network(const char *); | ||
| 88 | char		*inet_net_ntop(int, const void *, int, char *, __darwin_size_t); | ||
| 89 | int		 inet_net_pton(int, const char *, void *, __darwin_size_t); | ||
| 90 | char	 	*inet_neta(in_addr_t, char *, __darwin_size_t); | ||
| 91 | unsigned int	 inet_nsap_addr(const char *, unsigned char *, int); | ||
| 92 | char	*inet_nsap_ntoa(int, const unsigned char *, char *); | ||
| 93 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 94 | |||
| 95 | __END_DECLS | ||
| 96 | |||
| 97 | #endif /* !_ARPA_INET_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/bsm/audit.h created+391| ... | @@ -0,0 +1,391 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 2005-2009 Apple Inc. | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * 3. Neither the name of Apple Inc. ("Apple") nor the names of | ||
| 15 | * its contributors may be used to endorse or promote products derived | ||
| 16 | * from this software without specific prior written permission. | ||
| 17 | * | ||
| 18 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | ||
| 19 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 21 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
| 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
| 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 28 | * | ||
| 29 | * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 $ | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _BSM_AUDIT_H | ||
| 33 | #define _BSM_AUDIT_H | ||
| 34 | |||
| 35 | #include <sys/param.h> | ||
| 36 | #include <sys/types.h> | ||
| 37 | |||
| 38 | #define AUDIT_RECORD_MAGIC 0x828a0f1b | ||
| 39 | #define MAX_AUDIT_RECORDS 20 | ||
| 40 | #define MAXAUDITDATA (0x8000 - 1) | ||
| 41 | #define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA | ||
| 42 | #define MIN_AUDIT_FILE_SIZE (512 * 1024) | ||
| 43 | |||
| 44 | /* | ||
| 45 | * Minimum noumber of free blocks on the filesystem containing the audit | ||
| 46 | * log necessary to avoid a hard log rotation. DO NOT SET THIS VALUE TO 0 | ||
| 47 | * as the kernel does an unsigned compare, plus we want to leave a few blocks | ||
| 48 | * free so userspace can terminate the log, etc. | ||
| 49 | */ | ||
| 50 | #define AUDIT_HARD_LIMIT_FREE_BLOCKS 4 | ||
| 51 | |||
| 52 | /* | ||
| 53 | * Triggers for the audit daemon. | ||
| 54 | */ | ||
| 55 | #define AUDIT_TRIGGER_MIN 1 | ||
| 56 | #define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */ | ||
| 57 | #define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */ | ||
| 58 | #define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */ | ||
| 59 | #define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */ | ||
| 60 | #define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */ | ||
| 61 | #define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests rotate. */ | ||
| 62 | #define AUDIT_TRIGGER_INITIALIZE 7 /* User initialize of auditd. */ | ||
| 63 | #define AUDIT_TRIGGER_EXPIRE_TRAILS 8 /* User expiration of trails. */ | ||
| 64 | #define AUDIT_TRIGGER_MAX 8 | ||
| 65 | |||
| 66 | /* | ||
| 67 | * The special device filename (FreeBSD). | ||
| 68 | */ | ||
| 69 | #define AUDITDEV_FILENAME "audit" | ||
| 70 | #define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME) | ||
| 71 | |||
| 72 | /* | ||
| 73 | * Pre-defined audit IDs | ||
| 74 | */ | ||
| 75 | #define AU_DEFAUDITID (uid_t)(-1) | ||
| 76 | #define AU_DEFAUDITSID 0 | ||
| 77 | #define AU_ASSIGN_ASID -1 | ||
| 78 | |||
| 79 | /* | ||
| 80 | * IPC types. | ||
| 81 | */ | ||
| 82 | #define AT_IPC_MSG ((unsigned char)1) /* Message IPC id. */ | ||
| 83 | #define AT_IPC_SEM ((unsigned char)2) /* Semaphore IPC id. */ | ||
| 84 | #define AT_IPC_SHM ((unsigned char)3) /* Shared mem IPC id. */ | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Audit conditions. | ||
| 88 | */ | ||
| 89 | #define AUC_UNSET 0 | ||
| 90 | #define AUC_AUDITING 1 | ||
| 91 | #define AUC_NOAUDIT 2 | ||
| 92 | #define AUC_DISABLED -1 | ||
| 93 | |||
| 94 | /* | ||
| 95 | * auditon(2) commands. | ||
| 96 | */ | ||
| 97 | #define A_OLDGETPOLICY 2 | ||
| 98 | #define A_OLDSETPOLICY 3 | ||
| 99 | #define A_GETKMASK 4 | ||
| 100 | #define A_SETKMASK 5 | ||
| 101 | #define A_OLDGETQCTRL 6 | ||
| 102 | #define A_OLDSETQCTRL 7 | ||
| 103 | #define A_GETCWD 8 | ||
| 104 | #define A_GETCAR 9 | ||
| 105 | #define A_GETSTAT 12 | ||
| 106 | #define A_SETSTAT 13 | ||
| 107 | #define A_SETUMASK 14 | ||
| 108 | #define A_SETSMASK 15 | ||
| 109 | #define A_OLDGETCOND 20 | ||
| 110 | #define A_OLDSETCOND 21 | ||
| 111 | #define A_GETCLASS 22 | ||
| 112 | #define A_SETCLASS 23 | ||
| 113 | #define A_GETPINFO 24 | ||
| 114 | #define A_SETPMASK 25 | ||
| 115 | #define A_SETFSIZE 26 | ||
| 116 | #define A_GETFSIZE 27 | ||
| 117 | #define A_GETPINFO_ADDR 28 | ||
| 118 | #define A_GETKAUDIT 29 | ||
| 119 | #define A_SETKAUDIT 30 | ||
| 120 | #define A_SENDTRIGGER 31 | ||
| 121 | #define A_GETSINFO_ADDR 32 | ||
| 122 | #define A_GETPOLICY 33 | ||
| 123 | #define A_SETPOLICY 34 | ||
| 124 | #define A_GETQCTRL 35 | ||
| 125 | #define A_SETQCTRL 36 | ||
| 126 | #define A_GETCOND 37 | ||
| 127 | #define A_SETCOND 38 | ||
| 128 | #define A_GETSFLAGS 39 | ||
| 129 | #define A_SETSFLAGS 40 | ||
| 130 | #define A_GETCTLMODE 41 | ||
| 131 | #define A_SETCTLMODE 42 | ||
| 132 | #define A_GETEXPAFTER 43 | ||
| 133 | #define A_SETEXPAFTER 44 | ||
| 134 | |||
| 135 | /* | ||
| 136 | * Audit policy controls. | ||
| 137 | */ | ||
| 138 | #define AUDIT_CNT 0x0001 | ||
| 139 | #define AUDIT_AHLT 0x0002 | ||
| 140 | #define AUDIT_ARGV 0x0004 | ||
| 141 | #define AUDIT_ARGE 0x0008 | ||
| 142 | #define AUDIT_SEQ 0x0010 | ||
| 143 | #define AUDIT_WINDATA 0x0020 | ||
| 144 | #define AUDIT_USER 0x0040 | ||
| 145 | #define AUDIT_GROUP 0x0080 | ||
| 146 | #define AUDIT_TRAIL 0x0100 | ||
| 147 | #define AUDIT_PATH 0x0200 | ||
| 148 | #define AUDIT_SCNT 0x0400 | ||
| 149 | #define AUDIT_PUBLIC 0x0800 | ||
| 150 | #define AUDIT_ZONENAME 0x1000 | ||
| 151 | #define AUDIT_PERZONE 0x2000 | ||
| 152 | |||
| 153 | /* | ||
| 154 | * Default audit queue control parameters. | ||
| 155 | */ | ||
| 156 | #define AQ_HIWATER 100 | ||
| 157 | #define AQ_MAXHIGH 10000 | ||
| 158 | #define AQ_LOWATER 10 | ||
| 159 | #define AQ_BUFSZ MAXAUDITDATA | ||
| 160 | #define AQ_MAXBUFSZ 1048576 | ||
| 161 | |||
| 162 | /* | ||
| 163 | * Default minimum percentage free space on file system. | ||
| 164 | */ | ||
| 165 | #define AU_FS_MINFREE 20 | ||
| 166 | |||
| 167 | /* | ||
| 168 | * Type definitions used indicating the length of variable length addresses | ||
| 169 | * in tokens containing addresses, such as header fields. | ||
| 170 | */ | ||
| 171 | #define AU_IPv4 4 | ||
| 172 | #define AU_IPv6 16 | ||
| 173 | |||
| 174 | /* | ||
| 175 | * Reserved audit class mask indicating which classes are unable to have | ||
| 176 | * events added or removed by unentitled processes. | ||
| 177 | */ | ||
| 178 | #define AU_CLASS_MASK_RESERVED 0x10000000 | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Audit control modes | ||
| 182 | */ | ||
| 183 | #define AUDIT_CTLMODE_NORMAL ((unsigned char)1) | ||
| 184 | #define AUDIT_CTLMODE_EXTERNAL ((unsigned char)2) | ||
| 185 | |||
| 186 | /* | ||
| 187 | * Audit file expire_after op modes | ||
| 188 | */ | ||
| 189 | #define AUDIT_EXPIRE_OP_AND ((unsigned char)0) | ||
| 190 | #define AUDIT_EXPIRE_OP_OR ((unsigned char)1) | ||
| 191 | |||
| 192 | __BEGIN_DECLS | ||
| 193 | |||
| 194 | typedef uid_t au_id_t; | ||
| 195 | typedef pid_t au_asid_t; | ||
| 196 | typedef u_int16_t au_event_t; | ||
| 197 | typedef u_int16_t au_emod_t; | ||
| 198 | typedef u_int32_t au_class_t; | ||
| 199 | typedef u_int64_t au_asflgs_t __attribute__ ((aligned(8))); | ||
| 200 | typedef unsigned char au_ctlmode_t; | ||
| 201 | |||
| 202 | struct au_tid { | ||
| 203 | 	dev_t port; | ||
| 204 | 	u_int32_t machine; | ||
| 205 | }; | ||
| 206 | typedef struct au_tid au_tid_t; | ||
| 207 | |||
| 208 | struct au_tid_addr { | ||
| 209 | 	dev_t at_port; | ||
| 210 | 	u_int32_t at_type; | ||
| 211 | 	u_int32_t at_addr[4]; | ||
| 212 | }; | ||
| 213 | typedef struct au_tid_addr au_tid_addr_t; | ||
| 214 | |||
| 215 | struct au_mask { | ||
| 216 | 	unsigned int am_success; /* Success bits. */ | ||
| 217 | 	unsigned int am_failure; /* Failure bits. */ | ||
| 218 | }; | ||
| 219 | typedef struct au_mask au_mask_t; | ||
| 220 | |||
| 221 | struct auditinfo { | ||
| 222 | 	au_id_t ai_auid; /* Audit user ID. */ | ||
| 223 | 	au_mask_t ai_mask; /* Audit masks. */ | ||
| 224 | 	au_tid_t ai_termid; /* Terminal ID. */ | ||
| 225 | 	au_asid_t ai_asid; /* Audit session ID. */ | ||
| 226 | }; | ||
| 227 | typedef struct auditinfo auditinfo_t; | ||
| 228 | |||
| 229 | struct auditinfo_addr { | ||
| 230 | 	au_id_t ai_auid; /* Audit user ID. */ | ||
| 231 | 	au_mask_t ai_mask; /* Audit masks. */ | ||
| 232 | 	au_tid_addr_t ai_termid; /* Terminal ID. */ | ||
| 233 | 	au_asid_t ai_asid; /* Audit session ID. */ | ||
| 234 | 	au_asflgs_t ai_flags; /* Audit session flags. */ | ||
| 235 | }; | ||
| 236 | typedef struct auditinfo_addr auditinfo_addr_t; | ||
| 237 | |||
| 238 | struct auditpinfo { | ||
| 239 | 	pid_t ap_pid; /* ID of target process. */ | ||
| 240 | 	au_id_t ap_auid; /* Audit user ID. */ | ||
| 241 | 	au_mask_t ap_mask; /* Audit masks. */ | ||
| 242 | 	au_tid_t ap_termid; /* Terminal ID. */ | ||
| 243 | 	au_asid_t ap_asid; /* Audit session ID. */ | ||
| 244 | }; | ||
| 245 | typedef struct auditpinfo auditpinfo_t; | ||
| 246 | |||
| 247 | struct auditpinfo_addr { | ||
| 248 | 	pid_t ap_pid; /* ID of target process. */ | ||
| 249 | 	au_id_t ap_auid; /* Audit user ID. */ | ||
| 250 | 	au_mask_t ap_mask; /* Audit masks. */ | ||
| 251 | 	au_tid_addr_t ap_termid; /* Terminal ID. */ | ||
| 252 | 	au_asid_t ap_asid; /* Audit session ID. */ | ||
| 253 | 	au_asflgs_t ap_flags; /* Audit session flags. */ | ||
| 254 | }; | ||
| 255 | typedef struct auditpinfo_addr auditpinfo_addr_t; | ||
| 256 | |||
| 257 | struct au_session { | ||
| 258 | 	auditinfo_addr_t *as_aia_p; /* Ptr to full audit info. */ | ||
| 259 | 	au_mask_t as_mask; /* Process Audit Masks. */ | ||
| 260 | }; | ||
| 261 | typedef struct au_session au_session_t; | ||
| 262 | |||
| 263 | struct au_expire_after { | ||
| 264 | 	time_t age; /* Age after which trail files should be expired */ | ||
| 265 | 	size_t size; /* Aggregate trail size when files should be expired */ | ||
| 266 | 	unsigned char op_type; /* Operator used with the above values to determine when files should be expired */ | ||
| 267 | }; | ||
| 268 | typedef struct au_expire_after au_expire_after_t; | ||
| 269 | |||
| 270 | /* | ||
| 271 | * Contents of token_t are opaque outside of libbsm. | ||
| 272 | */ | ||
| 273 | typedef struct au_token token_t; | ||
| 274 | |||
| 275 | /* | ||
| 276 | * Kernel audit queue control parameters: | ||
| 277 | * Default:		Maximum: | ||
| 278 | * aq_hiwater:	AQ_HIWATER (100)	AQ_MAXHIGH (10000) | ||
| 279 | * aq_lowater:	AQ_LOWATER (10)		<aq_hiwater | ||
| 280 | * aq_bufsz:	AQ_BUFSZ (32767)	AQ_MAXBUFSZ (1048576) | ||
| 281 | * aq_delay:	20			20000 (not used) | ||
| 282 | */ | ||
| 283 | struct au_qctrl { | ||
| 284 | 	int aq_hiwater; /* Max # of audit recs in queue when */ | ||
| 285 | 	 /* threads with new ARs get blocked. */ | ||
| 286 | |||
| 287 | 	int aq_lowater; /* # of audit recs in queue when */ | ||
| 288 | 	 /* blocked threads get unblocked. */ | ||
| 289 | |||
| 290 | 	int aq_bufsz; /* Max size of audit record for audit(2). */ | ||
| 291 | 	int aq_delay; /* Queue delay (not used). */ | ||
| 292 | 	int aq_minfree; /* Minimum filesystem percent free space. */ | ||
| 293 | }; | ||
| 294 | typedef struct au_qctrl au_qctrl_t; | ||
| 295 | |||
| 296 | /* | ||
| 297 | * Structure for the audit statistics. | ||
| 298 | */ | ||
| 299 | struct audit_stat { | ||
| 300 | 	unsigned int as_version; | ||
| 301 | 	unsigned int as_numevent; | ||
| 302 | 	int as_generated; | ||
| 303 | 	int as_nonattrib; | ||
| 304 | 	int as_kernel; | ||
| 305 | 	int as_audit; | ||
| 306 | 	int as_auditctl; | ||
| 307 | 	int as_enqueue; | ||
| 308 | 	int as_written; | ||
| 309 | 	int as_wblocked; | ||
| 310 | 	int as_rblocked; | ||
| 311 | 	int as_dropped; | ||
| 312 | 	int as_totalsize; | ||
| 313 | 	unsigned int as_memused; | ||
| 314 | }; | ||
| 315 | typedef struct audit_stat au_stat_t; | ||
| 316 | |||
| 317 | /* | ||
| 318 | * Structure for the audit file statistics. | ||
| 319 | */ | ||
| 320 | struct audit_fstat { | ||
| 321 | 	u_int64_t af_filesz; | ||
| 322 | 	u_int64_t af_currsz; | ||
| 323 | }; | ||
| 324 | typedef struct audit_fstat au_fstat_t; | ||
| 325 | |||
| 326 | /* | ||
| 327 | * Audit to event class mapping. | ||
| 328 | */ | ||
| 329 | struct au_evclass_map { | ||
| 330 | 	au_event_t ec_number; | ||
| 331 | 	au_class_t ec_class; | ||
| 332 | }; | ||
| 333 | typedef struct au_evclass_map au_evclass_map_t; | ||
| 334 | |||
| 335 | |||
| 336 | #if !defined(_KERNEL) && !defined(KERNEL) | ||
| 337 | #include <Availability.h> | ||
| 338 | #define __AUDIT_API_DEPRECATED __API_DEPRECATED("audit is deprecated", macos(10.4, 11.0)) | ||
| 339 | #else | ||
| 340 | #define __AUDIT_API_DEPRECATED | ||
| 341 | #endif | ||
| 342 | |||
| 343 | /* | ||
| 344 | * Audit system calls. | ||
| 345 | */ | ||
| 346 | #if !defined(_KERNEL) && !defined(KERNEL) | ||
| 347 | int audit(const void *, int) | ||
| 348 | __AUDIT_API_DEPRECATED; | ||
| 349 | int auditon(int, void *, int) | ||
| 350 | __AUDIT_API_DEPRECATED; | ||
| 351 | int auditctl(const char *) | ||
| 352 | __AUDIT_API_DEPRECATED; | ||
| 353 | int getauid(au_id_t *); | ||
| 354 | int setauid(const au_id_t *); | ||
| 355 | int getaudit_addr(struct auditinfo_addr *, int); | ||
| 356 | int setaudit_addr(const struct auditinfo_addr *, int); | ||
| 357 | |||
| 358 | #if defined(__APPLE__) | ||
| 359 | #include <Availability.h> | ||
| 360 | |||
| 361 | /* | ||
| 362 | * getaudit()/setaudit() are deprecated and have been replaced with | ||
| 363 | * wrappers to the getaudit_addr()/setaudit_addr() syscalls above. | ||
| 364 | */ | ||
| 365 | |||
| 366 | int getaudit(struct auditinfo *) | ||
| 367 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, | ||
| 368 | __IPHONE_2_0, __IPHONE_6_0); | ||
| 369 | int setaudit(const struct auditinfo *) | ||
| 370 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, | ||
| 371 | __IPHONE_2_0, __IPHONE_6_0); | ||
| 372 | #else | ||
| 373 | |||
| 374 | int getaudit(struct auditinfo *) | ||
| 375 | __AUDIT_API_DEPRECATED; | ||
| 376 | int setaudit(const struct auditinfo *) | ||
| 377 | __AUDIT_API_DEPRECATED; | ||
| 378 | #endif /* !__APPLE__ */ | ||
| 379 | |||
| 380 | #ifdef __APPLE_API_PRIVATE | ||
| 381 | #include <mach/port.h> | ||
| 382 | mach_port_name_t audit_session_self(void); | ||
| 383 | au_asid_t audit_session_join(mach_port_name_t port); | ||
| 384 | int audit_session_port(au_asid_t asid, mach_port_name_t *portname); | ||
| 385 | #endif /* __APPLE_API_PRIVATE */ | ||
| 386 | |||
| 387 | #endif /* defined(_KERNEL) || defined(KERNEL) */ | ||
| 388 | |||
| 389 | __END_DECLS | ||
| 390 | |||
| 391 | #endif /* !_BSM_AUDIT_H */ | ||
lib/libc/include/x86_64-macos-gnu/copyfile.h created+133| ... | @@ -0,0 +1,133 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2019 Apple, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #ifndef _COPYFILE_H_ /* version 0.1 */ | ||
| 24 | #define _COPYFILE_H_ | ||
| 25 | |||
| 26 | /* | ||
| 27 | * This API facilitates the copying of files and their associated | ||
| 28 | * metadata. There are several open source projects that need | ||
| 29 | * modifications to support preserving extended attributes and ACLs | ||
| 30 | * and this API collapses several hundred lines of modifications into | ||
| 31 | * one or two calls. | ||
| 32 | */ | ||
| 33 | |||
| 34 | /* private */ | ||
| 35 | #include <sys/cdefs.h> | ||
| 36 | #include <stdint.h> | ||
| 37 | |||
| 38 | __BEGIN_DECLS | ||
| 39 | struct _copyfile_state; | ||
| 40 | typedef struct _copyfile_state * copyfile_state_t; | ||
| 41 | typedef uint32_t copyfile_flags_t; | ||
| 42 | |||
| 43 | /* public */ | ||
| 44 | |||
| 45 | /* receives: | ||
| 46 | * from	path to source file system object | ||
| 47 | * to		path to destination file system object | ||
| 48 | * state	opaque blob for future extensibility | ||
| 49 | *		Must be NULL in current implementation | ||
| 50 | * flags	(described below) | ||
| 51 | * returns: | ||
| 52 | * int	negative for error | ||
| 53 | */ | ||
| 54 | |||
| 55 | int copyfile(const char *from, const char *to, copyfile_state_t state, copyfile_flags_t flags); | ||
| 56 | int fcopyfile(int from_fd, int to_fd, copyfile_state_t, copyfile_flags_t flags); | ||
| 57 | |||
| 58 | int copyfile_state_free(copyfile_state_t); | ||
| 59 | copyfile_state_t copyfile_state_alloc(void); | ||
| 60 | |||
| 61 | |||
| 62 | int copyfile_state_get(copyfile_state_t s, uint32_t flag, void * dst); | ||
| 63 | int copyfile_state_set(copyfile_state_t s, uint32_t flag, const void * src); | ||
| 64 | |||
| 65 | typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *, const char *, void *); | ||
| 66 | |||
| 67 | #define COPYFILE_STATE_SRC_FD		1 | ||
| 68 | #define COPYFILE_STATE_SRC_FILENAME	2 | ||
| 69 | #define COPYFILE_STATE_DST_FD		3 | ||
| 70 | #define COPYFILE_STATE_DST_FILENAME	4 | ||
| 71 | #define COPYFILE_STATE_QUARANTINE	5 | ||
| 72 | #define	COPYFILE_STATE_STATUS_CB	6 | ||
| 73 | #define	COPYFILE_STATE_STATUS_CTX	7 | ||
| 74 | #define	COPYFILE_STATE_COPIED		8 | ||
| 75 | #define	COPYFILE_STATE_XATTRNAME	9 | ||
| 76 | #define	COPYFILE_STATE_WAS_CLONED	10 | ||
| 77 | |||
| 78 | |||
| 79 | #define	COPYFILE_DISABLE_VAR	"COPYFILE_DISABLE" | ||
| 80 | |||
| 81 | /* flags for copyfile */ | ||
| 82 | |||
| 83 | #define COPYFILE_ACL	 (1<<0) | ||
| 84 | #define COPYFILE_STAT	 (1<<1) | ||
| 85 | #define COPYFILE_XATTR	 (1<<2) | ||
| 86 | #define COPYFILE_DATA	 (1<<3) | ||
| 87 | |||
| 88 | #define COPYFILE_SECURITY (COPYFILE_STAT | COPYFILE_ACL) | ||
| 89 | #define COPYFILE_METADATA (COPYFILE_SECURITY | COPYFILE_XATTR) | ||
| 90 | #define COPYFILE_ALL	 (COPYFILE_METADATA | COPYFILE_DATA) | ||
| 91 | |||
| 92 | #define	COPYFILE_RECURSIVE	(1<<15)	/* Descend into hierarchies */ | ||
| 93 | #define COPYFILE_CHECK		(1<<16) /* return flags for xattr or acls if set */ | ||
| 94 | #define COPYFILE_EXCL		(1<<17) /* fail if destination exists */ | ||
| 95 | #define COPYFILE_NOFOLLOW_SRC	(1<<18) /* don't follow if source is a symlink */ | ||
| 96 | #define COPYFILE_NOFOLLOW_DST	(1<<19) /* don't follow if dst is a symlink */ | ||
| 97 | #define COPYFILE_MOVE		(1<<20) /* unlink src after copy */ | ||
| 98 | #define COPYFILE_UNLINK		(1<<21) /* unlink dst before copy */ | ||
| 99 | #define COPYFILE_NOFOLLOW	(COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST) | ||
| 100 | |||
| 101 | #define COPYFILE_PACK		(1<<22) | ||
| 102 | #define COPYFILE_UNPACK		(1<<23) | ||
| 103 | |||
| 104 | #define COPYFILE_CLONE		(1<<24) | ||
| 105 | #define COPYFILE_CLONE_FORCE	(1<<25) | ||
| 106 | |||
| 107 | #define COPYFILE_RUN_IN_PLACE	(1<<26) | ||
| 108 | |||
| 109 | #define COPYFILE_DATA_SPARSE	(1<<27) | ||
| 110 | |||
| 111 | #define COPYFILE_PRESERVE_DST_TRACKED	(1<<28) | ||
| 112 | |||
| 113 | #define COPYFILE_VERBOSE	(1<<30) | ||
| 114 | |||
| 115 | #define	COPYFILE_RECURSE_ERROR	0 | ||
| 116 | #define	COPYFILE_RECURSE_FILE	1 | ||
| 117 | #define	COPYFILE_RECURSE_DIR	2 | ||
| 118 | #define	COPYFILE_RECURSE_DIR_CLEANUP	3 | ||
| 119 | #define	COPYFILE_COPY_DATA	4 | ||
| 120 | #define	COPYFILE_COPY_XATTR	5 | ||
| 121 | |||
| 122 | #define	COPYFILE_START		1 | ||
| 123 | #define	COPYFILE_FINISH		2 | ||
| 124 | #define	COPYFILE_ERR		3 | ||
| 125 | #define	COPYFILE_PROGRESS	4 | ||
| 126 | |||
| 127 | #define	COPYFILE_CONTINUE	0 | ||
| 128 | #define	COPYFILE_SKIP	1 | ||
| 129 | #define	COPYFILE_QUIT	2 | ||
| 130 | |||
| 131 | __END_DECLS | ||
| 132 | |||
| 133 | #endif /* _COPYFILE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/cpio.h created+55| ... | @@ -0,0 +1,55 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer in the | ||
| 12 | * documentation and/or other materials provided with the distribution. | ||
| 13 | * | ||
| 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 24 | * SUCH DAMAGE. | ||
| 25 | * | ||
| 26 | * $FreeBSD: src/include/cpio.h,v 1.1 2002/08/01 07:18:38 mike Exp $ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _CPIO_H_ | ||
| 30 | #define	_CPIO_H_ | ||
| 31 | |||
| 32 | #define	C_ISSOCK 0140000	/* Socket. */ | ||
| 33 | #define	C_ISLNK	0120000		/* Symbolic link. */ | ||
| 34 | #define	C_ISCTG	0110000		/* Reserved. */ | ||
| 35 | #define	C_ISREG	0100000		/* Regular file. */ | ||
| 36 | #define	C_ISBLK	0060000		/* Block special. */ | ||
| 37 | #define	C_ISDIR	0040000		/* Directory. */ | ||
| 38 | #define	C_ISCHR	0020000		/* Character special. */ | ||
| 39 | #define	C_ISFIFO 0010000	/* FIFO. */ | ||
| 40 | #define	C_ISUID	0004000		/* Set user ID. */ | ||
| 41 | #define	C_ISGID	0002000		/* Set group ID. */ | ||
| 42 | #define	C_ISVTX	0001000		/* On directories, restricted deletion flag. */ | ||
| 43 | #define	C_IRUSR	0000400		/* Read by owner. */ | ||
| 44 | #define	C_IWUSR	0000200		/* Write by owner. */ | ||
| 45 | #define	C_IXUSR	0000100		/* Execute by owner. */ | ||
| 46 | #define	C_IRGRP	0000040		/* Read by group. */ | ||
| 47 | #define	C_IWGRP	0000020		/* Write by group. */ | ||
| 48 | #define	C_IXGRP	0000010		/* Execute by group. */ | ||
| 49 | #define	C_IROTH	0000004		/* Read by others. */ | ||
| 50 | #define	C_IWOTH	0000002		/* Write by others. */ | ||
| 51 | #define	C_IXOTH	0000001		/* Execute by others. */ | ||
| 52 | |||
| 53 | #define	MAGIC	"070707" | ||
| 54 | |||
| 55 | #endif /* _CPIO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/crt_externs.h created+47| ... | @@ -0,0 +1,47 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved | ||
| 25 | */ | ||
| 26 | |||
| 27 | /* | ||
| 28 | ** Prototypes for the functions to get environment information in | ||
| 29 | ** the world of dynamic libraries. Lifted from .c file of same name. | ||
| 30 | ** Fri Jun 23 12:56:47 PDT 1995 | ||
| 31 | ** AOF (afreier@next.com) | ||
| 32 | */ | ||
| 33 | |||
| 34 | #include <sys/cdefs.h> | ||
| 35 | |||
| 36 | __BEGIN_DECLS | ||
| 37 | extern char ***_NSGetArgv(void); | ||
| 38 | extern int *_NSGetArgc(void); | ||
| 39 | extern char ***_NSGetEnviron(void); | ||
| 40 | extern char **_NSGetProgname(void); | ||
| 41 | #ifdef __LP64__ | ||
| 42 | extern struct mach_header_64 * | ||
| 43 | #else /* !__LP64__ */ | ||
| 44 | extern struct mach_header * | ||
| 45 | #endif /* __LP64__ */ | ||
| 46 | 				_NSGetMachExecuteHeader(void); | ||
| 47 | __END_DECLS | ||
lib/libc/include/x86_64-macos-gnu/device/device_types.h created+118| ... | @@ -0,0 +1,118 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	Author: David B. Golub, Carnegie Mellon University | ||
| 60 | *	Date: 3/89 | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef DEVICE_TYPES_H | ||
| 64 | #define DEVICE_TYPES_H | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Types for device interface. | ||
| 68 | */ | ||
| 69 | #include <mach/std_types.h> | ||
| 70 | #include <mach/mach_types.h> | ||
| 71 | #include <mach/message.h> | ||
| 72 | #include <mach/port.h> | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | /* | ||
| 77 | * IO buffer - out-of-line array of characters. | ||
| 78 | */ | ||
| 79 | typedef char * io_buf_ptr_t; | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Some types for IOKit. | ||
| 83 | */ | ||
| 84 | |||
| 85 | #ifdef IOKIT | ||
| 86 | |||
| 87 | /* must match device_types.defs */ | ||
| 88 | typedef char io_name_t[128]; | ||
| 89 | typedef char io_string_t[512]; | ||
| 90 | typedef char io_string_inband_t[4096]; | ||
| 91 | typedef char io_struct_inband_t[4096]; | ||
| 92 | |||
| 93 | #if __LP64__ | ||
| 94 | typedef uint64_t io_user_scalar_t; | ||
| 95 | typedef uint64_t io_user_reference_t; | ||
| 96 | typedef io_user_scalar_t io_scalar_inband_t[16]; | ||
| 97 | typedef io_user_reference_t io_async_ref_t[8]; | ||
| 98 | typedef io_user_scalar_t io_scalar_inband64_t[16]; | ||
| 99 | typedef io_user_reference_t io_async_ref64_t[8]; | ||
| 100 | #else | ||
| 101 | typedef int io_user_scalar_t; | ||
| 102 | typedef natural_t io_user_reference_t; | ||
| 103 | typedef io_user_scalar_t io_scalar_inband_t[16]; | ||
| 104 | typedef io_user_reference_t io_async_ref_t[8]; | ||
| 105 | typedef uint64_t io_scalar_inband64_t[16]; | ||
| 106 | typedef uint64_t io_async_ref64_t[8]; | ||
| 107 | #endif // __LP64__ | ||
| 108 | |||
| 109 | |||
| 110 | #ifndef __IOKIT_PORTS_DEFINED__ | ||
| 111 | #define __IOKIT_PORTS_DEFINED__ | ||
| 112 | typedef mach_port_t io_object_t; | ||
| 113 | #endif /* __IOKIT_PORTS_DEFINED__ */ | ||
| 114 | |||
| 115 | |||
| 116 | #endif /* IOKIT */ | ||
| 117 | |||
| 118 | #endif /* DEVICE_TYPES_H */ | ||
lib/libc/include/x86_64-macos-gnu/dirent.h created+191| ... | @@ -0,0 +1,191 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2002-2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1989, 1993 | ||
| 25 | *	The Regents of the University of California. All rights reserved. | ||
| 26 | * | ||
| 27 | * Redistribution and use in source and binary forms, with or without | ||
| 28 | * modification, are permitted provided that the following conditions | ||
| 29 | * are met: | ||
| 30 | * 1. Redistributions of source code must retain the above copyright | ||
| 31 | * notice, this list of conditions and the following disclaimer. | ||
| 32 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 33 | * notice, this list of conditions and the following disclaimer in the | ||
| 34 | * documentation and/or other materials provided with the distribution. | ||
| 35 | * 3. All advertising materials mentioning features or use of this software | ||
| 36 | * must display the following acknowledgement: | ||
| 37 | *	This product includes software developed by the University of | ||
| 38 | *	California, Berkeley and its contributors. | ||
| 39 | * 4. Neither the name of the University nor the names of its contributors | ||
| 40 | * may be used to endorse or promote products derived from this software | ||
| 41 | * without specific prior written permission. | ||
| 42 | * | ||
| 43 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 44 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 45 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 46 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 47 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 48 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 49 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 50 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 51 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 52 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 53 | * SUCH DAMAGE. | ||
| 54 | * | ||
| 55 | *	@(#)dirent.h	8.2 (Berkeley) 7/28/94 | ||
| 56 | */ | ||
| 57 | |||
| 58 | #ifndef _DIRENT_H_ | ||
| 59 | #define _DIRENT_H_ | ||
| 60 | |||
| 61 | /* | ||
| 62 | * The kernel defines the format of directory entries | ||
| 63 | */ | ||
| 64 | #include <_types.h> | ||
| 65 | #include <sys/dirent.h> | ||
| 66 | #include <sys/cdefs.h> | ||
| 67 | #include <Availability.h> | ||
| 68 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_mutex_t */ | ||
| 69 | |||
| 70 | struct _telldir;		/* forward reference */ | ||
| 71 | |||
| 72 | /* structure describing an open directory. */ | ||
| 73 | typedef struct { | ||
| 74 | 	int	__dd_fd;	/* file descriptor associated with directory */ | ||
| 75 | 	long	__dd_loc;	/* offset in current buffer */ | ||
| 76 | 	long	__dd_size;	/* amount of data returned */ | ||
| 77 | 	char	*__dd_buf;	/* data buffer */ | ||
| 78 | 	int	__dd_len;	/* size of data buffer */ | ||
| 79 | 	long	__dd_seek;	/* magic cookie returned */ | ||
| 80 | 	__unused long	__padding; /* (__dd_rewind space left for bincompat) */ | ||
| 81 | 	int	__dd_flags;	/* flags for readdir */ | ||
| 82 | 	__darwin_pthread_mutex_t __dd_lock; /* for thread locking */ | ||
| 83 | 	struct _telldir *__dd_td; /* telldir position recording */ | ||
| 84 | } DIR; | ||
| 85 | |||
| 86 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 87 | |||
| 88 | /* definitions for library routines operating on directories. */ | ||
| 89 | #define	DIRBLKSIZ	1024 | ||
| 90 | |||
| 91 | /* flags for opendir2 */ | ||
| 92 | #define DTF_HIDEW	0x0001	/* hide whiteout entries */ | ||
| 93 | #define DTF_NODUP	0x0002	/* don't return duplicate names */ | ||
| 94 | #define DTF_REWIND	0x0004	/* rewind after reading union stack */ | ||
| 95 | #define __DTF_READALL	0x0008	/* everything has been read */ | ||
| 96 | #define __DTF_SKIPREAD 0x0010 /* assume internal buffer is populated */ | ||
| 97 | #define __DTF_ATEND 0x0020 /* there's nothing more to read in the kernel */ | ||
| 98 | |||
| 99 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 100 | |||
| 101 | #ifndef KERNEL | ||
| 102 | |||
| 103 | __BEGIN_DECLS | ||
| 104 | |||
| 105 | int closedir(DIR *) __DARWIN_ALIAS(closedir); | ||
| 106 | |||
| 107 | DIR *opendir(const char *) __DARWIN_ALIAS_I(opendir); | ||
| 108 | |||
| 109 | struct dirent *readdir(DIR *) __DARWIN_INODE64(readdir); | ||
| 110 | int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r); | ||
| 111 | |||
| 112 | void rewinddir(DIR *) __DARWIN_ALIAS_I(rewinddir); | ||
| 113 | |||
| 114 | void seekdir(DIR *, long) __DARWIN_ALIAS_I(seekdir); | ||
| 115 | |||
| 116 | long telldir(DIR *) __DARWIN_ALIAS_I(telldir); | ||
| 117 | |||
| 118 | __END_DECLS | ||
| 119 | |||
| 120 | |||
| 121 | /* Additional functionality provided by: | ||
| 122 | * POSIX.1-2008 | ||
| 123 | */ | ||
| 124 | |||
| 125 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 126 | __BEGIN_DECLS | ||
| 127 | |||
| 128 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) | ||
| 129 | DIR *fdopendir(int) __DARWIN_ALIAS_I(fdopendir); | ||
| 130 | |||
| 131 | int alphasort(const struct dirent **, const struct dirent **) __DARWIN_INODE64(alphasort); | ||
| 132 | |||
| 133 | #if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0) | ||
| 134 | #include <errno.h> | ||
| 135 | #include <stdlib.h> | ||
| 136 | #define dirfd(dirp) ({ \ | ||
| 137 | DIR *_dirp = (dirp); \ | ||
| 138 | int ret = -1; \ | ||
| 139 | if (_dirp == NULL || _dirp->__dd_fd < 0) \ | ||
| 140 | errno = EINVAL; \ | ||
| 141 | else \ | ||
| 142 | ret = _dirp->__dd_fd; \ | ||
| 143 | ret; \ | ||
| 144 | }) | ||
| 145 | #else | ||
| 146 | int dirfd(DIR *dirp) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 147 | #endif | ||
| 148 | |||
| 149 | int scandir(const char *, struct dirent ***, | ||
| 150 | int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)) __DARWIN_INODE64(scandir); | ||
| 151 | #ifdef __BLOCKS__ | ||
| 152 | #if __has_attribute(noescape) | ||
| 153 | #define __scandir_noescape __attribute__((__noescape__)) | ||
| 154 | #else | ||
| 155 | #define __scandir_noescape | ||
| 156 | #endif | ||
| 157 | |||
| 158 | int scandir_b(const char *, struct dirent ***, | ||
| 159 | int (^)(const struct dirent *) __scandir_noescape, | ||
| 160 | int (^)(const struct dirent **, const struct dirent **) __scandir_noescape) | ||
| 161 | __DARWIN_INODE64(scandir_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 162 | #endif /* __BLOCKS__ */ | ||
| 163 | |||
| 164 | __END_DECLS | ||
| 165 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 166 | |||
| 167 | |||
| 168 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 169 | __BEGIN_DECLS | ||
| 170 | |||
| 171 | int getdirentries(int, char *, int, long *) | ||
| 172 | |||
| 173 | #if __DARWIN_64_BIT_INO_T | ||
| 174 | /* | ||
| 175 | * getdirentries() doesn't work when 64-bit inodes is in effect, so we | ||
| 176 | * generate a link error. | ||
| 177 | */ | ||
| 178 | 						__asm("_getdirentries_is_not_available_when_64_bit_inodes_are_in_effect") | ||
| 179 | #else /* !__DARWIN_64_BIT_INO_T */ | ||
| 180 | 						__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_6, __IPHONE_2_0,__IPHONE_2_0) | ||
| 181 | #endif /* __DARWIN_64_BIT_INO_T */ | ||
| 182 | ; | ||
| 183 | |||
| 184 | DIR *__opendir2(const char *, int) __DARWIN_ALIAS_I(__opendir2); | ||
| 185 | |||
| 186 | __END_DECLS | ||
| 187 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 188 | |||
| 189 | #endif /* !KERNEL */ | ||
| 190 | |||
| 191 | #endif /* !_DIRENT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/dispatch/base.h created+306| ... | @@ -0,0 +1,306 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_BASE__ | ||
| 22 | #define __DISPATCH_BASE__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #ifndef __has_builtin | ||
| 29 | #define __has_builtin(x) 0 | ||
| 30 | #endif | ||
| 31 | #ifndef __has_include | ||
| 32 | #define __has_include(x) 0 | ||
| 33 | #endif | ||
| 34 | #ifndef __has_feature | ||
| 35 | #define __has_feature(x) 0 | ||
| 36 | #endif | ||
| 37 | #ifndef __has_attribute | ||
| 38 | #define __has_attribute(x) 0 | ||
| 39 | #endif | ||
| 40 | #ifndef __has_extension | ||
| 41 | #define __has_extension(x) 0 | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #if __GNUC__ | ||
| 45 | #define DISPATCH_NORETURN __attribute__((__noreturn__)) | ||
| 46 | #define DISPATCH_NOTHROW __attribute__((__nothrow__)) | ||
| 47 | #define DISPATCH_NONNULL1 __attribute__((__nonnull__(1))) | ||
| 48 | #define DISPATCH_NONNULL2 __attribute__((__nonnull__(2))) | ||
| 49 | #define DISPATCH_NONNULL3 __attribute__((__nonnull__(3))) | ||
| 50 | #define DISPATCH_NONNULL4 __attribute__((__nonnull__(4))) | ||
| 51 | #define DISPATCH_NONNULL5 __attribute__((__nonnull__(5))) | ||
| 52 | #define DISPATCH_NONNULL6 __attribute__((__nonnull__(6))) | ||
| 53 | #define DISPATCH_NONNULL7 __attribute__((__nonnull__(7))) | ||
| 54 | #if __clang__ && __clang_major__ < 3 | ||
| 55 | // rdar://problem/6857843 | ||
| 56 | #define DISPATCH_NONNULL_ALL | ||
| 57 | #else | ||
| 58 | #define DISPATCH_NONNULL_ALL __attribute__((__nonnull__)) | ||
| 59 | #endif | ||
| 60 | #define DISPATCH_SENTINEL __attribute__((__sentinel__)) | ||
| 61 | #define DISPATCH_PURE __attribute__((__pure__)) | ||
| 62 | #define DISPATCH_CONST __attribute__((__const__)) | ||
| 63 | #define DISPATCH_WARN_RESULT __attribute__((__warn_unused_result__)) | ||
| 64 | #define DISPATCH_MALLOC __attribute__((__malloc__)) | ||
| 65 | #define DISPATCH_ALWAYS_INLINE __attribute__((__always_inline__)) | ||
| 66 | #define DISPATCH_UNAVAILABLE __attribute__((__unavailable__)) | ||
| 67 | #define DISPATCH_UNAVAILABLE_MSG(msg) __attribute__((__unavailable__(msg))) | ||
| 68 | #elif defined(_MSC_VER) | ||
| 69 | #define DISPATCH_NORETURN __declspec(noreturn) | ||
| 70 | #define DISPATCH_NOTHROW __declspec(nothrow) | ||
| 71 | #define DISPATCH_NONNULL1 | ||
| 72 | #define DISPATCH_NONNULL2 | ||
| 73 | #define DISPATCH_NONNULL3 | ||
| 74 | #define DISPATCH_NONNULL4 | ||
| 75 | #define DISPATCH_NONNULL5 | ||
| 76 | #define DISPATCH_NONNULL6 | ||
| 77 | #define DISPATCH_NONNULL7 | ||
| 78 | #define DISPATCH_NONNULL_ALL | ||
| 79 | #define DISPATCH_SENTINEL | ||
| 80 | #define DISPATCH_PURE | ||
| 81 | #define DISPATCH_CONST | ||
| 82 | #if (_MSC_VER >= 1700) | ||
| 83 | #define DISPATCH_WARN_RESULT _Check_return_ | ||
| 84 | #else | ||
| 85 | #define DISPATCH_WARN_RESULT | ||
| 86 | #endif | ||
| 87 | #define DISPATCH_MALLOC | ||
| 88 | #define DISPATCH_ALWAYS_INLINE __forceinline | ||
| 89 | #define DISPATCH_UNAVAILABLE | ||
| 90 | #define DISPATCH_UNAVAILABLE_MSG(msg) | ||
| 91 | #else | ||
| 92 | /*! @parseOnly */ | ||
| 93 | #define DISPATCH_NORETURN | ||
| 94 | /*! @parseOnly */ | ||
| 95 | #define DISPATCH_NOTHROW | ||
| 96 | /*! @parseOnly */ | ||
| 97 | #define DISPATCH_NONNULL1 | ||
| 98 | /*! @parseOnly */ | ||
| 99 | #define DISPATCH_NONNULL2 | ||
| 100 | /*! @parseOnly */ | ||
| 101 | #define DISPATCH_NONNULL3 | ||
| 102 | /*! @parseOnly */ | ||
| 103 | #define DISPATCH_NONNULL4 | ||
| 104 | /*! @parseOnly */ | ||
| 105 | #define DISPATCH_NONNULL5 | ||
| 106 | /*! @parseOnly */ | ||
| 107 | #define DISPATCH_NONNULL6 | ||
| 108 | /*! @parseOnly */ | ||
| 109 | #define DISPATCH_NONNULL7 | ||
| 110 | /*! @parseOnly */ | ||
| 111 | #define DISPATCH_NONNULL_ALL | ||
| 112 | /*! @parseOnly */ | ||
| 113 | #define DISPATCH_SENTINEL | ||
| 114 | /*! @parseOnly */ | ||
| 115 | #define DISPATCH_PURE | ||
| 116 | /*! @parseOnly */ | ||
| 117 | #define DISPATCH_CONST | ||
| 118 | /*! @parseOnly */ | ||
| 119 | #define DISPATCH_WARN_RESULT | ||
| 120 | /*! @parseOnly */ | ||
| 121 | #define DISPATCH_MALLOC | ||
| 122 | /*! @parseOnly */ | ||
| 123 | #define DISPATCH_ALWAYS_INLINE | ||
| 124 | /*! @parseOnly */ | ||
| 125 | #define DISPATCH_UNAVAILABLE | ||
| 126 | /*! @parseOnly */ | ||
| 127 | #define DISPATCH_UNAVAILABLE_MSG(msg) | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #define DISPATCH_LINUX_UNAVAILABLE() | ||
| 131 | |||
| 132 | #ifdef __FreeBSD__ | ||
| 133 | #define DISPATCH_FREEBSD_UNAVAILABLE() \ | ||
| 134 | 		DISPATCH_UNAVAILABLE_MSG( \ | ||
| 135 | 		"This interface is unavailable on FreeBSD systems") | ||
| 136 | #else | ||
| 137 | #define DISPATCH_FREEBSD_UNAVAILABLE() | ||
| 138 | #endif | ||
| 139 | |||
| 140 | #ifndef DISPATCH_ALIAS_V2 | ||
| 141 | #if TARGET_OS_MAC | ||
| 142 | #define DISPATCH_ALIAS_V2(sym)	 __asm__("_" #sym "$V2") | ||
| 143 | #else | ||
| 144 | #define DISPATCH_ALIAS_V2(sym) | ||
| 145 | #endif | ||
| 146 | #endif | ||
| 147 | |||
| 148 | #if defined(_WIN32) | ||
| 149 | #if defined(__cplusplus) | ||
| 150 | #define DISPATCH_EXPORT extern "C" __declspec(dllimport) | ||
| 151 | #else | ||
| 152 | #define DISPATCH_EXPORT extern __declspec(dllimport) | ||
| 153 | #endif | ||
| 154 | #elif __GNUC__ | ||
| 155 | #define DISPATCH_EXPORT extern __attribute__((visibility("default"))) | ||
| 156 | #else | ||
| 157 | #define DISPATCH_EXPORT extern | ||
| 158 | #endif | ||
| 159 | |||
| 160 | #if __GNUC__ | ||
| 161 | #define DISPATCH_INLINE static __inline__ | ||
| 162 | #else | ||
| 163 | #define DISPATCH_INLINE static inline | ||
| 164 | #endif | ||
| 165 | |||
| 166 | #if __GNUC__ | ||
| 167 | #define DISPATCH_EXPECT(x, v) __builtin_expect((x), (v)) | ||
| 168 | #define dispatch_compiler_barrier() __asm__ __volatile__("" ::: "memory") | ||
| 169 | #else | ||
| 170 | #define DISPATCH_EXPECT(x, v) (x) | ||
| 171 | #define dispatch_compiler_barrier() do { } while (0) | ||
| 172 | #endif | ||
| 173 | |||
| 174 | #if __has_attribute(not_tail_called) | ||
| 175 | #define DISPATCH_NOT_TAIL_CALLED __attribute__((__not_tail_called__)) | ||
| 176 | #else | ||
| 177 | #define DISPATCH_NOT_TAIL_CALLED | ||
| 178 | #endif | ||
| 179 | |||
| 180 | #if __has_builtin(__builtin_assume) | ||
| 181 | #define DISPATCH_COMPILER_CAN_ASSUME(expr) __builtin_assume(expr) | ||
| 182 | #else | ||
| 183 | #define DISPATCH_COMPILER_CAN_ASSUME(expr) ((void)(expr)) | ||
| 184 | #endif | ||
| 185 | |||
| 186 | #if __has_attribute(noescape) | ||
| 187 | #define DISPATCH_NOESCAPE __attribute__((__noescape__)) | ||
| 188 | #else | ||
| 189 | #define DISPATCH_NOESCAPE | ||
| 190 | #endif | ||
| 191 | |||
| 192 | #if __has_attribute(cold) | ||
| 193 | #define DISPATCH_COLD __attribute__((__cold__)) | ||
| 194 | #else | ||
| 195 | #define DISPATCH_COLD | ||
| 196 | #endif | ||
| 197 | |||
| 198 | #if __has_feature(assume_nonnull) | ||
| 199 | #define DISPATCH_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") | ||
| 200 | #define DISPATCH_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") | ||
| 201 | #else | ||
| 202 | #define DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 203 | #define DISPATCH_ASSUME_NONNULL_END | ||
| 204 | #endif | ||
| 205 | |||
| 206 | #if !__has_feature(nullability) | ||
| 207 | #ifndef _Nullable | ||
| 208 | #define _Nullable | ||
| 209 | #endif | ||
| 210 | #ifndef _Nonnull | ||
| 211 | #define _Nonnull | ||
| 212 | #endif | ||
| 213 | #ifndef _Null_unspecified | ||
| 214 | #define _Null_unspecified | ||
| 215 | #endif | ||
| 216 | #endif | ||
| 217 | |||
| 218 | #ifndef DISPATCH_RETURNS_RETAINED_BLOCK | ||
| 219 | #if __has_attribute(ns_returns_retained) | ||
| 220 | #define DISPATCH_RETURNS_RETAINED_BLOCK __attribute__((__ns_returns_retained__)) | ||
| 221 | #else | ||
| 222 | #define DISPATCH_RETURNS_RETAINED_BLOCK | ||
| 223 | #endif | ||
| 224 | #endif | ||
| 225 | |||
| 226 | #if __has_attribute(enum_extensibility) | ||
| 227 | #define __DISPATCH_ENUM_ATTR __attribute__((__enum_extensibility__(open))) | ||
| 228 | #define __DISPATCH_ENUM_ATTR_CLOSED __attribute__((__enum_extensibility__(closed))) | ||
| 229 | #else | ||
| 230 | #define __DISPATCH_ENUM_ATTR | ||
| 231 | #define __DISPATCH_ENUM_ATTR_CLOSED | ||
| 232 | #endif // __has_attribute(enum_extensibility) | ||
| 233 | |||
| 234 | #if __has_attribute(flag_enum) | ||
| 235 | #define __DISPATCH_OPTIONS_ATTR __attribute__((__flag_enum__)) | ||
| 236 | #else | ||
| 237 | #define __DISPATCH_OPTIONS_ATTR | ||
| 238 | #endif // __has_attribute(flag_enum) | ||
| 239 | |||
| 240 | |||
| 241 | #if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) || \ | ||
| 242 | 		__has_extension(cxx_fixed_enum) || defined(_WIN32) | ||
| 243 | #define DISPATCH_ENUM(name, type, ...) \ | ||
| 244 | 		typedef enum : type { __VA_ARGS__ } __DISPATCH_ENUM_ATTR name##_t | ||
| 245 | #define DISPATCH_OPTIONS(name, type, ...) \ | ||
| 246 | 		typedef enum : type { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR name##_t | ||
| 247 | #else | ||
| 248 | #define DISPATCH_ENUM(name, type, ...) \ | ||
| 249 | 		enum { __VA_ARGS__ } __DISPATCH_ENUM_ATTR; typedef type name##_t | ||
| 250 | #define DISPATCH_OPTIONS(name, type, ...) \ | ||
| 251 | 		enum { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR; typedef type name##_t | ||
| 252 | #endif // __has_feature(objc_fixed_enum) ... | ||
| 253 | |||
| 254 | |||
| 255 | |||
| 256 | #if __has_feature(enumerator_attributes) | ||
| 257 | #define DISPATCH_ENUM_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__) | ||
| 258 | #define DISPATCH_ENUM_API_DEPRECATED(...) API_DEPRECATED(__VA_ARGS__) | ||
| 259 | #define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...) \ | ||
| 260 | 		API_DEPRECATED_WITH_REPLACEMENT(__VA_ARGS__) | ||
| 261 | #else | ||
| 262 | #define DISPATCH_ENUM_API_AVAILABLE(...) | ||
| 263 | #define DISPATCH_ENUM_API_DEPRECATED(...) | ||
| 264 | #define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...) | ||
| 265 | #endif | ||
| 266 | |||
| 267 | #ifdef __swift__ | ||
| 268 | #define DISPATCH_SWIFT3_OVERLAY 1 | ||
| 269 | #else // __swift__ | ||
| 270 | #define DISPATCH_SWIFT3_OVERLAY 0 | ||
| 271 | #endif // __swift__ | ||
| 272 | |||
| 273 | #if __has_feature(attribute_availability_swift) | ||
| 274 | #define DISPATCH_SWIFT_UNAVAILABLE(_msg) \ | ||
| 275 | 		__attribute__((__availability__(swift, unavailable, message=_msg))) | ||
| 276 | #else | ||
| 277 | #define DISPATCH_SWIFT_UNAVAILABLE(_msg) | ||
| 278 | #endif | ||
| 279 | |||
| 280 | #if DISPATCH_SWIFT3_OVERLAY | ||
| 281 | #define DISPATCH_SWIFT3_UNAVAILABLE(_msg) DISPATCH_SWIFT_UNAVAILABLE(_msg) | ||
| 282 | #else | ||
| 283 | #define DISPATCH_SWIFT3_UNAVAILABLE(_msg) | ||
| 284 | #endif | ||
| 285 | |||
| 286 | #if __has_attribute(swift_private) | ||
| 287 | #define DISPATCH_REFINED_FOR_SWIFT __attribute__((__swift_private__)) | ||
| 288 | #else | ||
| 289 | #define DISPATCH_REFINED_FOR_SWIFT | ||
| 290 | #endif | ||
| 291 | |||
| 292 | #if __has_attribute(swift_name) | ||
| 293 | #define DISPATCH_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name))) | ||
| 294 | #else | ||
| 295 | #define DISPATCH_SWIFT_NAME(_name) | ||
| 296 | #endif | ||
| 297 | |||
| 298 | #ifndef __cplusplus | ||
| 299 | #define DISPATCH_TRANSPARENT_UNION __attribute__((__transparent_union__)) | ||
| 300 | #else | ||
| 301 | #define DISPATCH_TRANSPARENT_UNION | ||
| 302 | #endif | ||
| 303 | |||
| 304 | typedef void (*dispatch_function_t)(void *_Nullable); | ||
| 305 | |||
| 306 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/block.h created+428| ... | @@ -0,0 +1,428 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_BLOCK__ | ||
| 22 | #define __DISPATCH_BLOCK__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #ifdef __BLOCKS__ | ||
| 30 | |||
| 31 | /*! | ||
| 32 | * @group Dispatch block objects | ||
| 33 | */ | ||
| 34 | |||
| 35 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 36 | |||
| 37 | __BEGIN_DECLS | ||
| 38 | |||
| 39 | /*! | ||
| 40 | * @typedef dispatch_block_flags_t | ||
| 41 | * Flags to pass to the dispatch_block_create* functions. | ||
| 42 | * | ||
| 43 | * @const DISPATCH_BLOCK_BARRIER | ||
| 44 | * Flag indicating that a dispatch block object should act as a barrier block | ||
| 45 | * when submitted to a DISPATCH_QUEUE_CONCURRENT queue. | ||
| 46 | * See dispatch_barrier_async() for details. | ||
| 47 | * This flag has no effect when the dispatch block object is invoked directly. | ||
| 48 | * | ||
| 49 | * @const DISPATCH_BLOCK_DETACHED | ||
| 50 | * Flag indicating that a dispatch block object should execute disassociated | ||
| 51 | * from current execution context attributes such as os_activity_t | ||
| 52 | * and properties of the current IPC request (if any). With regard to QoS class, | ||
| 53 | * the behavior is the same as for DISPATCH_BLOCK_NO_QOS. If invoked directly, | ||
| 54 | * the block object will remove the other attributes from the calling thread for | ||
| 55 | * the duration of the block body (before applying attributes assigned to the | ||
| 56 | * block object, if any). If submitted to a queue, the block object will be | ||
| 57 | * executed with the attributes of the queue (or any attributes specifically | ||
| 58 | * assigned to the block object). | ||
| 59 | * | ||
| 60 | * @const DISPATCH_BLOCK_ASSIGN_CURRENT | ||
| 61 | * Flag indicating that a dispatch block object should be assigned the execution | ||
| 62 | * context attributes that are current at the time the block object is created. | ||
| 63 | * This applies to attributes such as QOS class, os_activity_t and properties of | ||
| 64 | * the current IPC request (if any). If invoked directly, the block object will | ||
| 65 | * apply these attributes to the calling thread for the duration of the block | ||
| 66 | * body. If the block object is submitted to a queue, this flag replaces the | ||
| 67 | * default behavior of associating the submitted block instance with the | ||
| 68 | * execution context attributes that are current at the time of submission. | ||
| 69 | * If a specific QOS class is assigned with DISPATCH_BLOCK_NO_QOS_CLASS or | ||
| 70 | * dispatch_block_create_with_qos_class(), that QOS class takes precedence over | ||
| 71 | * the QOS class assignment indicated by this flag. | ||
| 72 | * | ||
| 73 | * @const DISPATCH_BLOCK_NO_QOS_CLASS | ||
| 74 | * Flag indicating that a dispatch block object should be not be assigned a QOS | ||
| 75 | * class. If invoked directly, the block object will be executed with the QOS | ||
| 76 | * class of the calling thread. If the block object is submitted to a queue, | ||
| 77 | * this replaces the default behavior of associating the submitted block | ||
| 78 | * instance with the QOS class current at the time of submission. | ||
| 79 | * This flag is ignored if a specific QOS class is assigned with | ||
| 80 | * dispatch_block_create_with_qos_class(). | ||
| 81 | * | ||
| 82 | * @const DISPATCH_BLOCK_INHERIT_QOS_CLASS | ||
| 83 | * Flag indicating that execution of a dispatch block object submitted to a | ||
| 84 | * queue should prefer the QOS class assigned to the queue over the QOS class | ||
| 85 | * assigned to the block (resp. associated with the block at the time of | ||
| 86 | * submission). The latter will only be used if the queue in question does not | ||
| 87 | * have an assigned QOS class, as long as doing so does not result in a QOS | ||
| 88 | * class lower than the QOS class inherited from the queue's target queue. | ||
| 89 | * This flag is the default when a dispatch block object is submitted to a queue | ||
| 90 | * for asynchronous execution and has no effect when the dispatch block object | ||
| 91 | * is invoked directly. It is ignored if DISPATCH_BLOCK_ENFORCE_QOS_CLASS is | ||
| 92 | * also passed. | ||
| 93 | * | ||
| 94 | * @const DISPATCH_BLOCK_ENFORCE_QOS_CLASS | ||
| 95 | * Flag indicating that execution of a dispatch block object submitted to a | ||
| 96 | * queue should prefer the QOS class assigned to the block (resp. associated | ||
| 97 | * with the block at the time of submission) over the QOS class assigned to the | ||
| 98 | * queue, as long as doing so will not result in a lower QOS class. | ||
| 99 | * This flag is the default when a dispatch block object is submitted to a queue | ||
| 100 | * for synchronous execution or when the dispatch block object is invoked | ||
| 101 | * directly. | ||
| 102 | */ | ||
| 103 | DISPATCH_OPTIONS(dispatch_block_flags, unsigned long, | ||
| 104 | 	DISPATCH_BLOCK_BARRIER | ||
| 105 | 			DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x1, | ||
| 106 | 	DISPATCH_BLOCK_DETACHED | ||
| 107 | 			DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x2, | ||
| 108 | 	DISPATCH_BLOCK_ASSIGN_CURRENT | ||
| 109 | 			DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x4, | ||
| 110 | 	DISPATCH_BLOCK_NO_QOS_CLASS | ||
| 111 | 			DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x8, | ||
| 112 | 	DISPATCH_BLOCK_INHERIT_QOS_CLASS | ||
| 113 | 			DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x10, | ||
| 114 | 	DISPATCH_BLOCK_ENFORCE_QOS_CLASS | ||
| 115 | 			DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x20, | ||
| 116 | ); | ||
| 117 | |||
| 118 | /*! | ||
| 119 | * @function dispatch_block_create | ||
| 120 | * | ||
| 121 | * @abstract | ||
| 122 | * Create a new dispatch block object on the heap from an existing block and | ||
| 123 | * the given flags. | ||
| 124 | * | ||
| 125 | * @discussion | ||
| 126 | * The provided block is Block_copy'ed to the heap and retained by the newly | ||
| 127 | * created dispatch block object. | ||
| 128 | * | ||
| 129 | * The returned dispatch block object is intended to be submitted to a dispatch | ||
| 130 | * queue with dispatch_async() and related functions, but may also be invoked | ||
| 131 | * directly. Both operations can be performed an arbitrary number of times but | ||
| 132 | * only the first completed execution of a dispatch block object can be waited | ||
| 133 | * on with dispatch_block_wait() or observed with dispatch_block_notify(). | ||
| 134 | * | ||
| 135 | * If the returned dispatch block object is submitted to a dispatch queue, the | ||
| 136 | * submitted block instance will be associated with the QOS class current at the | ||
| 137 | * time of submission, unless one of the following flags assigned a specific QOS | ||
| 138 | * class (or no QOS class) at the time of block creation: | ||
| 139 | * - DISPATCH_BLOCK_ASSIGN_CURRENT | ||
| 140 | * - DISPATCH_BLOCK_NO_QOS_CLASS | ||
| 141 | * - DISPATCH_BLOCK_DETACHED | ||
| 142 | * The QOS class the block object will be executed with also depends on the QOS | ||
| 143 | * class assigned to the queue and which of the following flags was specified or | ||
| 144 | * defaulted to: | ||
| 145 | * - DISPATCH_BLOCK_INHERIT_QOS_CLASS (default for asynchronous execution) | ||
| 146 | * - DISPATCH_BLOCK_ENFORCE_QOS_CLASS (default for synchronous execution) | ||
| 147 | * See description of dispatch_block_flags_t for details. | ||
| 148 | * | ||
| 149 | * If the returned dispatch block object is submitted directly to a serial queue | ||
| 150 | * and is configured to execute with a specific QOS class, the system will make | ||
| 151 | * a best effort to apply the necessary QOS overrides to ensure that blocks | ||
| 152 | * submitted earlier to the serial queue are executed at that same QOS class or | ||
| 153 | * higher. | ||
| 154 | * | ||
| 155 | * @param flags | ||
| 156 | * Configuration flags for the block object. | ||
| 157 | * Passing a value that is not a bitwise OR of flags from dispatch_block_flags_t | ||
| 158 | * results in NULL being returned. | ||
| 159 | * | ||
| 160 | * @param block | ||
| 161 | * The block to create the dispatch block object from. | ||
| 162 | * | ||
| 163 | * @result | ||
| 164 | * The newly created dispatch block object, or NULL. | ||
| 165 | * When not building with Objective-C ARC, must be released with a -[release] | ||
| 166 | * message or the Block_release() function. | ||
| 167 | */ | ||
| 168 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 169 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_RETURNS_RETAINED_BLOCK | ||
| 170 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 171 | dispatch_block_t | ||
| 172 | dispatch_block_create(dispatch_block_flags_t flags, dispatch_block_t block); | ||
| 173 | |||
| 174 | /*! | ||
| 175 | * @function dispatch_block_create_with_qos_class | ||
| 176 | * | ||
| 177 | * @abstract | ||
| 178 | * Create a new dispatch block object on the heap from an existing block and | ||
| 179 | * the given flags, and assign it the specified QOS class and relative priority. | ||
| 180 | * | ||
| 181 | * @discussion | ||
| 182 | * The provided block is Block_copy'ed to the heap and retained by the newly | ||
| 183 | * created dispatch block object. | ||
| 184 | * | ||
| 185 | * The returned dispatch block object is intended to be submitted to a dispatch | ||
| 186 | * queue with dispatch_async() and related functions, but may also be invoked | ||
| 187 | * directly. Both operations can be performed an arbitrary number of times but | ||
| 188 | * only the first completed execution of a dispatch block object can be waited | ||
| 189 | * on with dispatch_block_wait() or observed with dispatch_block_notify(). | ||
| 190 | * | ||
| 191 | * If invoked directly, the returned dispatch block object will be executed with | ||
| 192 | * the assigned QOS class as long as that does not result in a lower QOS class | ||
| 193 | * than what is current on the calling thread. | ||
| 194 | * | ||
| 195 | * If the returned dispatch block object is submitted to a dispatch queue, the | ||
| 196 | * QOS class it will be executed with depends on the QOS class assigned to the | ||
| 197 | * block, the QOS class assigned to the queue and which of the following flags | ||
| 198 | * was specified or defaulted to: | ||
| 199 | * - DISPATCH_BLOCK_INHERIT_QOS_CLASS: default for asynchronous execution | ||
| 200 | * - DISPATCH_BLOCK_ENFORCE_QOS_CLASS: default for synchronous execution | ||
| 201 | * See description of dispatch_block_flags_t for details. | ||
| 202 | * | ||
| 203 | * If the returned dispatch block object is submitted directly to a serial queue | ||
| 204 | * and is configured to execute with a specific QOS class, the system will make | ||
| 205 | * a best effort to apply the necessary QOS overrides to ensure that blocks | ||
| 206 | * submitted earlier to the serial queue are executed at that same QOS class or | ||
| 207 | * higher. | ||
| 208 | * | ||
| 209 | * @param flags | ||
| 210 | * Configuration flags for the new block object. | ||
| 211 | * Passing a value that is not a bitwise OR of flags from dispatch_block_flags_t | ||
| 212 | * results in NULL being returned. | ||
| 213 | * | ||
| 214 | * @param qos_class | ||
| 215 | * A QOS class value: | ||
| 216 | * - QOS_CLASS_USER_INTERACTIVE | ||
| 217 | * - QOS_CLASS_USER_INITIATED | ||
| 218 | * - QOS_CLASS_DEFAULT | ||
| 219 | * - QOS_CLASS_UTILITY | ||
| 220 | * - QOS_CLASS_BACKGROUND | ||
| 221 | * - QOS_CLASS_UNSPECIFIED | ||
| 222 | * Passing QOS_CLASS_UNSPECIFIED is equivalent to specifying the | ||
| 223 | * DISPATCH_BLOCK_NO_QOS_CLASS flag. Passing any other value results in NULL | ||
| 224 | * being returned. | ||
| 225 | * | ||
| 226 | * @param relative_priority | ||
| 227 | * A relative priority within the QOS class. This value is a negative | ||
| 228 | * offset from the maximum supported scheduler priority for the given class. | ||
| 229 | * Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY | ||
| 230 | * results in NULL being returned. | ||
| 231 | * | ||
| 232 | * @param block | ||
| 233 | * The block to create the dispatch block object from. | ||
| 234 | * | ||
| 235 | * @result | ||
| 236 | * The newly created dispatch block object, or NULL. | ||
| 237 | * When not building with Objective-C ARC, must be released with a -[release] | ||
| 238 | * message or the Block_release() function. | ||
| 239 | */ | ||
| 240 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 241 | DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_RETURNS_RETAINED_BLOCK | ||
| 242 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 243 | dispatch_block_t | ||
| 244 | dispatch_block_create_with_qos_class(dispatch_block_flags_t flags, | ||
| 245 | 		dispatch_qos_class_t qos_class, int relative_priority, | ||
| 246 | 		dispatch_block_t block); | ||
| 247 | |||
| 248 | /*! | ||
| 249 | * @function dispatch_block_perform | ||
| 250 | * | ||
| 251 | * @abstract | ||
| 252 | * Create, synchronously execute and release a dispatch block object from the | ||
| 253 | * specified block and flags. | ||
| 254 | * | ||
| 255 | * @discussion | ||
| 256 | * Behaves identically to the sequence | ||
| 257 | * <code> | ||
| 258 | * dispatch_block_t b = dispatch_block_create(flags, block); | ||
| 259 | * b(); | ||
| 260 | * Block_release(b); | ||
| 261 | * </code> | ||
| 262 | * but may be implemented more efficiently internally by not requiring a copy | ||
| 263 | * to the heap of the specified block or the allocation of a new block object. | ||
| 264 | * | ||
| 265 | * @param flags | ||
| 266 | * Configuration flags for the temporary block object. | ||
| 267 | * The result of passing a value that is not a bitwise OR of flags from | ||
| 268 | * dispatch_block_flags_t is undefined. | ||
| 269 | * | ||
| 270 | * @param block | ||
| 271 | * The block to create the temporary block object from. | ||
| 272 | */ | ||
| 273 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 274 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW | ||
| 275 | void | ||
| 276 | dispatch_block_perform(dispatch_block_flags_t flags, | ||
| 277 | 		DISPATCH_NOESCAPE dispatch_block_t block); | ||
| 278 | |||
| 279 | /*! | ||
| 280 | * @function dispatch_block_wait | ||
| 281 | * | ||
| 282 | * @abstract | ||
| 283 | * Wait synchronously until execution of the specified dispatch block object has | ||
| 284 | * completed or until the specified timeout has elapsed. | ||
| 285 | * | ||
| 286 | * @discussion | ||
| 287 | * This function will return immediately if execution of the block object has | ||
| 288 | * already completed. | ||
| 289 | * | ||
| 290 | * It is not possible to wait for multiple executions of the same block object | ||
| 291 | * with this interface; use dispatch_group_wait() for that purpose. A single | ||
| 292 | * dispatch block object may either be waited on once and executed once, | ||
| 293 | * or it may be executed any number of times. The behavior of any other | ||
| 294 | * combination is undefined. Submission to a dispatch queue counts as an | ||
| 295 | * execution, even if cancellation (dispatch_block_cancel) means the block's | ||
| 296 | * code never runs. | ||
| 297 | * | ||
| 298 | * The result of calling this function from multiple threads simultaneously | ||
| 299 | * with the same dispatch block object is undefined, but note that doing so | ||
| 300 | * would violate the rules described in the previous paragraph. | ||
| 301 | * | ||
| 302 | * If this function returns indicating that the specified timeout has elapsed, | ||
| 303 | * then that invocation does not count as the one allowed wait. | ||
| 304 | * | ||
| 305 | * If at the time this function is called, the specified dispatch block object | ||
| 306 | * has been submitted directly to a serial queue, the system will make a best | ||
| 307 | * effort to apply the necessary QOS overrides to ensure that the block and any | ||
| 308 | * blocks submitted earlier to that serial queue are executed at the QOS class | ||
| 309 | * (or higher) of the thread calling dispatch_block_wait(). | ||
| 310 | * | ||
| 311 | * @param block | ||
| 312 | * The dispatch block object to wait on. | ||
| 313 | * The result of passing NULL or a block object not returned by one of the | ||
| 314 | * dispatch_block_create* functions is undefined. | ||
| 315 | * | ||
| 316 | * @param timeout | ||
| 317 | * When to timeout (see dispatch_time). As a convenience, there are the | ||
| 318 | * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants. | ||
| 319 | * | ||
| 320 | * @result | ||
| 321 | * Returns zero on success (the dispatch block object completed within the | ||
| 322 | * specified timeout) or non-zero on error (i.e. timed out). | ||
| 323 | */ | ||
| 324 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 325 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 326 | intptr_t | ||
| 327 | dispatch_block_wait(dispatch_block_t block, dispatch_time_t timeout); | ||
| 328 | |||
| 329 | /*! | ||
| 330 | * @function dispatch_block_notify | ||
| 331 | * | ||
| 332 | * @abstract | ||
| 333 | * Schedule a notification block to be submitted to a queue when the execution | ||
| 334 | * of a specified dispatch block object has completed. | ||
| 335 | * | ||
| 336 | * @discussion | ||
| 337 | * This function will submit the notification block immediately if execution of | ||
| 338 | * the observed block object has already completed. | ||
| 339 | * | ||
| 340 | * It is not possible to be notified of multiple executions of the same block | ||
| 341 | * object with this interface, use dispatch_group_notify() for that purpose. | ||
| 342 | * | ||
| 343 | * A single dispatch block object may either be observed one or more times | ||
| 344 | * and executed once, or it may be executed any number of times. The behavior | ||
| 345 | * of any other combination is undefined. Submission to a dispatch queue | ||
| 346 | * counts as an execution, even if cancellation (dispatch_block_cancel) means | ||
| 347 | * the block's code never runs. | ||
| 348 | * | ||
| 349 | * If multiple notification blocks are scheduled for a single block object, | ||
| 350 | * there is no defined order in which the notification blocks will be submitted | ||
| 351 | * to their associated queues. | ||
| 352 | * | ||
| 353 | * @param block | ||
| 354 | * The dispatch block object to observe. | ||
| 355 | * The result of passing NULL or a block object not returned by one of the | ||
| 356 | * dispatch_block_create* functions is undefined. | ||
| 357 | * | ||
| 358 | * @param queue | ||
| 359 | * The queue to which the supplied notification block will be submitted when | ||
| 360 | * the observed block completes. | ||
| 361 | * | ||
| 362 | * @param notification_block | ||
| 363 | * The notification block to submit when the observed block object completes. | ||
| 364 | */ | ||
| 365 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 366 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 367 | void | ||
| 368 | dispatch_block_notify(dispatch_block_t block, dispatch_queue_t queue, | ||
| 369 | 		dispatch_block_t notification_block); | ||
| 370 | |||
| 371 | /*! | ||
| 372 | * @function dispatch_block_cancel | ||
| 373 | * | ||
| 374 | * @abstract | ||
| 375 | * Asynchronously cancel the specified dispatch block object. | ||
| 376 | * | ||
| 377 | * @discussion | ||
| 378 | * Cancellation causes any future execution of the dispatch block object to | ||
| 379 | * return immediately, but does not affect any execution of the block object | ||
| 380 | * that is already in progress. | ||
| 381 | * | ||
| 382 | * Release of any resources associated with the block object will be delayed | ||
| 383 | * until execution of the block object is next attempted (or any execution | ||
| 384 | * already in progress completes). | ||
| 385 | * | ||
| 386 | * NOTE: care needs to be taken to ensure that a block object that may be | ||
| 387 | * canceled does not capture any resources that require execution of the | ||
| 388 | * block body in order to be released (e.g. memory allocated with | ||
| 389 | * malloc(3) that the block body calls free(3) on). Such resources will | ||
| 390 | * be leaked if the block body is never executed due to cancellation. | ||
| 391 | * | ||
| 392 | * @param block | ||
| 393 | * The dispatch block object to cancel. | ||
| 394 | * The result of passing NULL or a block object not returned by one of the | ||
| 395 | * dispatch_block_create* functions is undefined. | ||
| 396 | */ | ||
| 397 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 398 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 399 | void | ||
| 400 | dispatch_block_cancel(dispatch_block_t block); | ||
| 401 | |||
| 402 | /*! | ||
| 403 | * @function dispatch_block_testcancel | ||
| 404 | * | ||
| 405 | * @abstract | ||
| 406 | * Tests whether the given dispatch block object has been canceled. | ||
| 407 | * | ||
| 408 | * @param block | ||
| 409 | * The dispatch block object to test. | ||
| 410 | * The result of passing NULL or a block object not returned by one of the | ||
| 411 | * dispatch_block_create* functions is undefined. | ||
| 412 | * | ||
| 413 | * @result | ||
| 414 | * Non-zero if canceled and zero if not canceled. | ||
| 415 | */ | ||
| 416 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 417 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE | ||
| 418 | DISPATCH_NOTHROW | ||
| 419 | intptr_t | ||
| 420 | dispatch_block_testcancel(dispatch_block_t block); | ||
| 421 | |||
| 422 | __END_DECLS | ||
| 423 | |||
| 424 | DISPATCH_ASSUME_NONNULL_END | ||
| 425 | |||
| 426 | #endif // __BLOCKS__ | ||
| 427 | |||
| 428 | #endif // __DISPATCH_BLOCK__ | ||
lib/libc/include/x86_64-macos-gnu/dispatch/data.h created+278| ... | @@ -0,0 +1,278 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2009-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_DATA__ | ||
| 22 | #define __DISPATCH_DATA__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | |||
| 33 | /*! @header | ||
| 34 | * Dispatch data objects describe contiguous or sparse regions of memory that | ||
| 35 | * may be managed by the system or by the application. | ||
| 36 | * Dispatch data objects are immutable, any direct access to memory regions | ||
| 37 | * represented by dispatch objects must not modify that memory. | ||
| 38 | */ | ||
| 39 | |||
| 40 | /*! | ||
| 41 | * @typedef dispatch_data_t | ||
| 42 | * A dispatch object representing memory regions. | ||
| 43 | */ | ||
| 44 | DISPATCH_DATA_DECL(dispatch_data); | ||
| 45 | |||
| 46 | /*! | ||
| 47 | * @var dispatch_data_empty | ||
| 48 | * @discussion The singleton dispatch data object representing a zero-length | ||
| 49 | * memory region. | ||
| 50 | */ | ||
| 51 | #define dispatch_data_empty \ | ||
| 52 | 		DISPATCH_GLOBAL_OBJECT(dispatch_data_t, _dispatch_data_empty) | ||
| 53 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 54 | DISPATCH_EXPORT struct dispatch_data_s _dispatch_data_empty; | ||
| 55 | |||
| 56 | /*! | ||
| 57 | * @const DISPATCH_DATA_DESTRUCTOR_DEFAULT | ||
| 58 | * @discussion The default destructor for dispatch data objects. | ||
| 59 | * Used at data object creation to indicate that the supplied buffer should | ||
| 60 | * be copied into internal storage managed by the system. | ||
| 61 | */ | ||
| 62 | #define DISPATCH_DATA_DESTRUCTOR_DEFAULT NULL | ||
| 63 | |||
| 64 | #ifdef __BLOCKS__ | ||
| 65 | /*! @parseOnly */ | ||
| 66 | #define DISPATCH_DATA_DESTRUCTOR_TYPE_DECL(name) \ | ||
| 67 | 	DISPATCH_EXPORT const dispatch_block_t _dispatch_data_destructor_##name | ||
| 68 | #else | ||
| 69 | #define DISPATCH_DATA_DESTRUCTOR_TYPE_DECL(name) \ | ||
| 70 | 	DISPATCH_EXPORT const dispatch_function_t \ | ||
| 71 | 	_dispatch_data_destructor_##name | ||
| 72 | #endif /* __BLOCKS__ */ | ||
| 73 | |||
| 74 | /*! | ||
| 75 | * @const DISPATCH_DATA_DESTRUCTOR_FREE | ||
| 76 | * @discussion The destructor for dispatch data objects created from a malloc'd | ||
| 77 | * buffer. Used at data object creation to indicate that the supplied buffer | ||
| 78 | * was allocated by the malloc() family and should be destroyed with free(3). | ||
| 79 | */ | ||
| 80 | #define DISPATCH_DATA_DESTRUCTOR_FREE (_dispatch_data_destructor_free) | ||
| 81 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 82 | DISPATCH_DATA_DESTRUCTOR_TYPE_DECL(free); | ||
| 83 | |||
| 84 | /*! | ||
| 85 | * @const DISPATCH_DATA_DESTRUCTOR_MUNMAP | ||
| 86 | * @discussion The destructor for dispatch data objects that have been created | ||
| 87 | * from buffers that require deallocation with munmap(2). | ||
| 88 | */ | ||
| 89 | #define DISPATCH_DATA_DESTRUCTOR_MUNMAP (_dispatch_data_destructor_munmap) | ||
| 90 | API_AVAILABLE(macos(10.9), ios(7.0)) | ||
| 91 | DISPATCH_DATA_DESTRUCTOR_TYPE_DECL(munmap); | ||
| 92 | |||
| 93 | #ifdef __BLOCKS__ | ||
| 94 | /*! | ||
| 95 | * @function dispatch_data_create | ||
| 96 | * Creates a dispatch data object from the given contiguous buffer of memory. If | ||
| 97 | * a non-default destructor is provided, ownership of the buffer remains with | ||
| 98 | * the caller (i.e. the bytes will not be copied). The last release of the data | ||
| 99 | * object will result in the invocation of the specified destructor on the | ||
| 100 | * specified queue to free the buffer. | ||
| 101 | * | ||
| 102 | * If the DISPATCH_DATA_DESTRUCTOR_FREE destructor is provided the buffer will | ||
| 103 | * be freed via free(3) and the queue argument ignored. | ||
| 104 | * | ||
| 105 | * If the DISPATCH_DATA_DESTRUCTOR_DEFAULT destructor is provided, data object | ||
| 106 | * creation will copy the buffer into internal memory managed by the system. | ||
| 107 | * | ||
| 108 | * @param buffer	A contiguous buffer of data. | ||
| 109 | * @param size		The size of the contiguous buffer of data. | ||
| 110 | * @param queue		The queue to which the destructor should be submitted. | ||
| 111 | * @param destructor	The destructor responsible for freeing the data when it | ||
| 112 | *			is no longer needed. | ||
| 113 | * @result		A newly created dispatch data object. | ||
| 114 | */ | ||
| 115 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 116 | DISPATCH_EXPORT DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 117 | dispatch_data_t | ||
| 118 | dispatch_data_create(const void *buffer, | ||
| 119 | 	size_t size, | ||
| 120 | 	dispatch_queue_t _Nullable queue, | ||
| 121 | 	dispatch_block_t _Nullable destructor); | ||
| 122 | #endif /* __BLOCKS__ */ | ||
| 123 | |||
| 124 | /*! | ||
| 125 | * @function dispatch_data_get_size | ||
| 126 | * Returns the logical size of the memory region(s) represented by the specified | ||
| 127 | * dispatch data object. | ||
| 128 | * | ||
| 129 | * @param data	The dispatch data object to query. | ||
| 130 | * @result	The number of bytes represented by the data object. | ||
| 131 | */ | ||
| 132 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 133 | DISPATCH_EXPORT DISPATCH_PURE DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 134 | size_t | ||
| 135 | dispatch_data_get_size(dispatch_data_t data); | ||
| 136 | |||
| 137 | /*! | ||
| 138 | * @function dispatch_data_create_map | ||
| 139 | * Maps the memory represented by the specified dispatch data object as a single | ||
| 140 | * contiguous memory region and returns a new data object representing it. | ||
| 141 | * If non-NULL references to a pointer and a size variable are provided, they | ||
| 142 | * are filled with the location and extent of that region. These allow direct | ||
| 143 | * read access to the represented memory, but are only valid until the returned | ||
| 144 | * object is released. Under ARC, if that object is held in a variable with | ||
| 145 | * automatic storage, care needs to be taken to ensure that it is not released | ||
| 146 | * by the compiler before memory access via the pointer has been completed. | ||
| 147 | * | ||
| 148 | * @param data		The dispatch data object to map. | ||
| 149 | * @param buffer_ptr	A pointer to a pointer variable to be filled with the | ||
| 150 | *			location of the mapped contiguous memory region, or | ||
| 151 | *			NULL. | ||
| 152 | * @param size_ptr	A pointer to a size_t variable to be filled with the | ||
| 153 | *			size of the mapped contiguous memory region, or NULL. | ||
| 154 | * @result		A newly created dispatch data object. | ||
| 155 | */ | ||
| 156 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 157 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_RETURNS_RETAINED | ||
| 158 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 159 | dispatch_data_t | ||
| 160 | dispatch_data_create_map(dispatch_data_t data, | ||
| 161 | 	const void *_Nullable *_Nullable buffer_ptr, | ||
| 162 | 	size_t *_Nullable size_ptr); | ||
| 163 | |||
| 164 | /*! | ||
| 165 | * @function dispatch_data_create_concat | ||
| 166 | * Returns a new dispatch data object representing the concatenation of the | ||
| 167 | * specified data objects. Those objects may be released by the application | ||
| 168 | * after the call returns (however, the system might not deallocate the memory | ||
| 169 | * region(s) described by them until the newly created object has also been | ||
| 170 | * released). | ||
| 171 | * | ||
| 172 | * @param data1	The data object representing the region(s) of memory to place | ||
| 173 | *		at the beginning of the newly created object. | ||
| 174 | * @param data2	The data object representing the region(s) of memory to place | ||
| 175 | *		at the end of the newly created object. | ||
| 176 | * @result	A newly created object representing the concatenation of the | ||
| 177 | *		data1 and data2 objects. | ||
| 178 | */ | ||
| 179 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 180 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_RETURNS_RETAINED | ||
| 181 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 182 | dispatch_data_t | ||
| 183 | dispatch_data_create_concat(dispatch_data_t data1, dispatch_data_t data2); | ||
| 184 | |||
| 185 | /*! | ||
| 186 | * @function dispatch_data_create_subrange | ||
| 187 | * Returns a new dispatch data object representing a subrange of the specified | ||
| 188 | * data object, which may be released by the application after the call returns | ||
| 189 | * (however, the system might not deallocate the memory region(s) described by | ||
| 190 | * that object until the newly created object has also been released). | ||
| 191 | * | ||
| 192 | * @param data		The data object representing the region(s) of memory to | ||
| 193 | *			create a subrange of. | ||
| 194 | * @param offset	The offset into the data object where the subrange | ||
| 195 | *			starts. | ||
| 196 | * @param length	The length of the range. | ||
| 197 | * @result		A newly created object representing the specified | ||
| 198 | *			subrange of the data object. | ||
| 199 | */ | ||
| 200 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 201 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_RETURNS_RETAINED | ||
| 202 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 203 | dispatch_data_t | ||
| 204 | dispatch_data_create_subrange(dispatch_data_t data, | ||
| 205 | 	size_t offset, | ||
| 206 | 	size_t length); | ||
| 207 | |||
| 208 | #ifdef __BLOCKS__ | ||
| 209 | /*! | ||
| 210 | * @typedef dispatch_data_applier_t | ||
| 211 | * A block to be invoked for every contiguous memory region in a data object. | ||
| 212 | * | ||
| 213 | * @param region	A data object representing the current region. | ||
| 214 | * @param offset	The logical offset of the current region to the start | ||
| 215 | *			of the data object. | ||
| 216 | * @param buffer	The location of the memory for the current region. | ||
| 217 | * @param size		The size of the memory for the current region. | ||
| 218 | * @result		A Boolean indicating whether traversal should continue. | ||
| 219 | */ | ||
| 220 | typedef bool (^dispatch_data_applier_t)(dispatch_data_t region, | ||
| 221 | 	size_t offset, | ||
| 222 | 	const void *buffer, | ||
| 223 | 	size_t size); | ||
| 224 | |||
| 225 | /*! | ||
| 226 | * @function dispatch_data_apply | ||
| 227 | * Traverse the memory regions represented by the specified dispatch data object | ||
| 228 | * in logical order and invoke the specified block once for every contiguous | ||
| 229 | * memory region encountered. | ||
| 230 | * | ||
| 231 | * Each invocation of the block is passed a data object representing the current | ||
| 232 | * region and its logical offset, along with the memory location and extent of | ||
| 233 | * the region. These allow direct read access to the memory region, but are only | ||
| 234 | * valid until the passed-in region object is released. Note that the region | ||
| 235 | * object is released by the system when the block returns, it is the | ||
| 236 | * responsibility of the application to retain it if the region object or the | ||
| 237 | * associated memory location are needed after the block returns. | ||
| 238 | * | ||
| 239 | * @param data		The data object to traverse. | ||
| 240 | * @param applier	The block to be invoked for every contiguous memory | ||
| 241 | *			region in the data object. | ||
| 242 | * @result		A Boolean indicating whether traversal completed | ||
| 243 | *			successfully. | ||
| 244 | */ | ||
| 245 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 246 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 247 | bool | ||
| 248 | dispatch_data_apply(dispatch_data_t data, | ||
| 249 | 	DISPATCH_NOESCAPE dispatch_data_applier_t applier); | ||
| 250 | #endif /* __BLOCKS__ */ | ||
| 251 | |||
| 252 | /*! | ||
| 253 | * @function dispatch_data_copy_region | ||
| 254 | * Finds the contiguous memory region containing the specified location among | ||
| 255 | * the regions represented by the specified object and returns a copy of the | ||
| 256 | * internal dispatch data object representing that region along with its logical | ||
| 257 | * offset in the specified object. | ||
| 258 | * | ||
| 259 | * @param data		The dispatch data object to query. | ||
| 260 | * @param location	The logical position in the data object to query. | ||
| 261 | * @param offset_ptr	A pointer to a size_t variable to be filled with the | ||
| 262 | *			logical offset of the returned region object to the | ||
| 263 | *			start of the queried data object. | ||
| 264 | * @result		A newly created dispatch data object. | ||
| 265 | */ | ||
| 266 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 267 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_RETURNS_RETAINED | ||
| 268 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 269 | dispatch_data_t | ||
| 270 | dispatch_data_copy_region(dispatch_data_t data, | ||
| 271 | 	size_t location, | ||
| 272 | 	size_t *offset_ptr); | ||
| 273 | |||
| 274 | __END_DECLS | ||
| 275 | |||
| 276 | DISPATCH_ASSUME_NONNULL_END | ||
| 277 | |||
| 278 | #endif /* __DISPATCH_DATA__ */ | ||
lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h created+80| ... | @@ -0,0 +1,80 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_PUBLIC__ | ||
| 22 | #define __DISPATCH_PUBLIC__ | ||
| 23 | |||
| 24 | #ifdef __APPLE__ | ||
| 25 | #include <Availability.h> | ||
| 26 | #include <os/availability.h> | ||
| 27 | #include <TargetConditionals.h> | ||
| 28 | #include <os/base.h> | ||
| 29 | #elif defined(_WIN32) | ||
| 30 | #include <os/generic_win_base.h> | ||
| 31 | #elif defined(__unix__) | ||
| 32 | #include <os/generic_unix_base.h> | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #include <sys/types.h> | ||
| 36 | #include <stddef.h> | ||
| 37 | #include <stdint.h> | ||
| 38 | #include <stdbool.h> | ||
| 39 | #include <stdarg.h> | ||
| 40 | #include <string.h> | ||
| 41 | #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) | ||
| 42 | #include <unistd.h> | ||
| 43 | #endif | ||
| 44 | #include <fcntl.h> | ||
| 45 | #if defined(_WIN32) | ||
| 46 | #include <time.h> | ||
| 47 | #endif | ||
| 48 | |||
| 49 | #if (defined(__linux__) || defined(__FreeBSD__)) && defined(__has_feature) | ||
| 50 | #if __has_feature(modules) | ||
| 51 | #if !defined(__arm__) | ||
| 52 | #include <stdio.h> // for off_t (to match Glibc.modulemap) | ||
| 53 | #endif | ||
| 54 | #endif | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #define DISPATCH_API_VERSION 20181008 | ||
| 58 | |||
| 59 | #ifndef __DISPATCH_INDIRECT__ | ||
| 60 | #define __DISPATCH_INDIRECT__ | ||
| 61 | #endif | ||
| 62 | |||
| 63 | #include <os/object.h> | ||
| 64 | #include <os/workgroup.h> | ||
| 65 | #include <dispatch/base.h> | ||
| 66 | #include <dispatch/time.h> | ||
| 67 | #include <dispatch/object.h> | ||
| 68 | #include <dispatch/queue.h> | ||
| 69 | #include <dispatch/block.h> | ||
| 70 | #include <dispatch/source.h> | ||
| 71 | #include <dispatch/group.h> | ||
| 72 | #include <dispatch/semaphore.h> | ||
| 73 | #include <dispatch/once.h> | ||
| 74 | #include <dispatch/data.h> | ||
| 75 | #include <dispatch/io.h> | ||
| 76 | #include <dispatch/workloop.h> | ||
| 77 | |||
| 78 | #undef __DISPATCH_INDIRECT__ | ||
| 79 | |||
| 80 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/group.h created+279| ... | @@ -0,0 +1,279 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_GROUP__ | ||
| 22 | #define __DISPATCH_GROUP__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | /*! | ||
| 32 | * @typedef dispatch_group_t | ||
| 33 | * @abstract | ||
| 34 | * A group of blocks submitted to queues for asynchronous invocation. | ||
| 35 | */ | ||
| 36 | DISPATCH_DECL(dispatch_group); | ||
| 37 | |||
| 38 | __BEGIN_DECLS | ||
| 39 | |||
| 40 | /*! | ||
| 41 | * @function dispatch_group_create | ||
| 42 | * | ||
| 43 | * @abstract | ||
| 44 | * Creates new group with which blocks may be associated. | ||
| 45 | * | ||
| 46 | * @discussion | ||
| 47 | * This function creates a new group with which blocks may be associated. | ||
| 48 | * The dispatch group may be used to wait for the completion of the blocks it | ||
| 49 | * references. The group object memory is freed with dispatch_release(). | ||
| 50 | * | ||
| 51 | * @result | ||
| 52 | * The newly created group, or NULL on failure. | ||
| 53 | */ | ||
| 54 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 55 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 56 | DISPATCH_NOTHROW | ||
| 57 | dispatch_group_t | ||
| 58 | dispatch_group_create(void); | ||
| 59 | |||
| 60 | /*! | ||
| 61 | * @function dispatch_group_async | ||
| 62 | * | ||
| 63 | * @abstract | ||
| 64 | * Submits a block to a dispatch queue and associates the block with the given | ||
| 65 | * dispatch group. | ||
| 66 | * | ||
| 67 | * @discussion | ||
| 68 | * Submits a block to a dispatch queue and associates the block with the given | ||
| 69 | * dispatch group. The dispatch group may be used to wait for the completion | ||
| 70 | * of the blocks it references. | ||
| 71 | * | ||
| 72 | * @param group | ||
| 73 | * A dispatch group to associate with the submitted block. | ||
| 74 | * The result of passing NULL in this parameter is undefined. | ||
| 75 | * | ||
| 76 | * @param queue | ||
| 77 | * The dispatch queue to which the block will be submitted for asynchronous | ||
| 78 | * invocation. | ||
| 79 | * | ||
| 80 | * @param block | ||
| 81 | * The block to perform asynchronously. | ||
| 82 | */ | ||
| 83 | #ifdef __BLOCKS__ | ||
| 84 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 85 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 86 | void | ||
| 87 | dispatch_group_async(dispatch_group_t group, | ||
| 88 | 	dispatch_queue_t queue, | ||
| 89 | 	dispatch_block_t block); | ||
| 90 | #endif /* __BLOCKS__ */ | ||
| 91 | |||
| 92 | /*! | ||
| 93 | * @function dispatch_group_async_f | ||
| 94 | * | ||
| 95 | * @abstract | ||
| 96 | * Submits a function to a dispatch queue and associates the block with the | ||
| 97 | * given dispatch group. | ||
| 98 | * | ||
| 99 | * @discussion | ||
| 100 | * See dispatch_group_async() for details. | ||
| 101 | * | ||
| 102 | * @param group | ||
| 103 | * A dispatch group to associate with the submitted function. | ||
| 104 | * The result of passing NULL in this parameter is undefined. | ||
| 105 | * | ||
| 106 | * @param queue | ||
| 107 | * The dispatch queue to which the function will be submitted for asynchronous | ||
| 108 | * invocation. | ||
| 109 | * | ||
| 110 | * @param context | ||
| 111 | * The application-defined context parameter to pass to the function. | ||
| 112 | * | ||
| 113 | * @param work | ||
| 114 | * The application-defined function to invoke on the target queue. The first | ||
| 115 | * parameter passed to this function is the context provided to | ||
| 116 | * dispatch_group_async_f(). | ||
| 117 | */ | ||
| 118 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 119 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL2 DISPATCH_NONNULL4 | ||
| 120 | DISPATCH_NOTHROW | ||
| 121 | void | ||
| 122 | dispatch_group_async_f(dispatch_group_t group, | ||
| 123 | 	dispatch_queue_t queue, | ||
| 124 | 	void *_Nullable context, | ||
| 125 | 	dispatch_function_t work); | ||
| 126 | |||
| 127 | /*! | ||
| 128 | * @function dispatch_group_wait | ||
| 129 | * | ||
| 130 | * @abstract | ||
| 131 | * Wait synchronously until all the blocks associated with a group have | ||
| 132 | * completed or until the specified timeout has elapsed. | ||
| 133 | * | ||
| 134 | * @discussion | ||
| 135 | * This function waits for the completion of the blocks associated with the | ||
| 136 | * given dispatch group, and returns after all blocks have completed or when | ||
| 137 | * the specified timeout has elapsed. | ||
| 138 | * | ||
| 139 | * This function will return immediately if there are no blocks associated | ||
| 140 | * with the dispatch group (i.e. the group is empty). | ||
| 141 | * | ||
| 142 | * The result of calling this function from multiple threads simultaneously | ||
| 143 | * with the same dispatch group is undefined. | ||
| 144 | * | ||
| 145 | * After the successful return of this function, the dispatch group is empty. | ||
| 146 | * It may either be released with dispatch_release() or re-used for additional | ||
| 147 | * blocks. See dispatch_group_async() for more information. | ||
| 148 | * | ||
| 149 | * @param group | ||
| 150 | * The dispatch group to wait on. | ||
| 151 | * The result of passing NULL in this parameter is undefined. | ||
| 152 | * | ||
| 153 | * @param timeout | ||
| 154 | * When to timeout (see dispatch_time). As a convenience, there are the | ||
| 155 | * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants. | ||
| 156 | * | ||
| 157 | * @result | ||
| 158 | * Returns zero on success (all blocks associated with the group completed | ||
| 159 | * within the specified timeout) or non-zero on error (i.e. timed out). | ||
| 160 | */ | ||
| 161 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 162 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 163 | intptr_t | ||
| 164 | dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout); | ||
| 165 | |||
| 166 | /*! | ||
| 167 | * @function dispatch_group_notify | ||
| 168 | * | ||
| 169 | * @abstract | ||
| 170 | * Schedule a block to be submitted to a queue when all the blocks associated | ||
| 171 | * with a group have completed. | ||
| 172 | * | ||
| 173 | * @discussion | ||
| 174 | * This function schedules a notification block to be submitted to the specified | ||
| 175 | * queue once all blocks associated with the dispatch group have completed. | ||
| 176 | * | ||
| 177 | * If no blocks are associated with the dispatch group (i.e. the group is empty) | ||
| 178 | * then the notification block will be submitted immediately. | ||
| 179 | * | ||
| 180 | * The group will be empty at the time the notification block is submitted to | ||
| 181 | * the target queue. The group may either be released with dispatch_release() | ||
| 182 | * or reused for additional operations. | ||
| 183 | * See dispatch_group_async() for more information. | ||
| 184 | * | ||
| 185 | * @param group | ||
| 186 | * The dispatch group to observe. | ||
| 187 | * The result of passing NULL in this parameter is undefined. | ||
| 188 | * | ||
| 189 | * @param queue | ||
| 190 | * The queue to which the supplied block will be submitted when the group | ||
| 191 | * completes. | ||
| 192 | * | ||
| 193 | * @param block | ||
| 194 | * The block to submit when the group completes. | ||
| 195 | */ | ||
| 196 | #ifdef __BLOCKS__ | ||
| 197 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 198 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 199 | void | ||
| 200 | dispatch_group_notify(dispatch_group_t group, | ||
| 201 | 	dispatch_queue_t queue, | ||
| 202 | 	dispatch_block_t block); | ||
| 203 | #endif /* __BLOCKS__ */ | ||
| 204 | |||
| 205 | /*! | ||
| 206 | * @function dispatch_group_notify_f | ||
| 207 | * | ||
| 208 | * @abstract | ||
| 209 | * Schedule a function to be submitted to a queue when all the blocks | ||
| 210 | * associated with a group have completed. | ||
| 211 | * | ||
| 212 | * @discussion | ||
| 213 | * See dispatch_group_notify() for details. | ||
| 214 | * | ||
| 215 | * @param group | ||
| 216 | * The dispatch group to observe. | ||
| 217 | * The result of passing NULL in this parameter is undefined. | ||
| 218 | * | ||
| 219 | * @param context | ||
| 220 | * The application-defined context parameter to pass to the function. | ||
| 221 | * | ||
| 222 | * @param work | ||
| 223 | * The application-defined function to invoke on the target queue. The first | ||
| 224 | * parameter passed to this function is the context provided to | ||
| 225 | * dispatch_group_notify_f(). | ||
| 226 | */ | ||
| 227 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 228 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL2 DISPATCH_NONNULL4 | ||
| 229 | DISPATCH_NOTHROW | ||
| 230 | void | ||
| 231 | dispatch_group_notify_f(dispatch_group_t group, | ||
| 232 | 	dispatch_queue_t queue, | ||
| 233 | 	void *_Nullable context, | ||
| 234 | 	dispatch_function_t work); | ||
| 235 | |||
| 236 | /*! | ||
| 237 | * @function dispatch_group_enter | ||
| 238 | * | ||
| 239 | * @abstract | ||
| 240 | * Manually indicate a block has entered the group | ||
| 241 | * | ||
| 242 | * @discussion | ||
| 243 | * Calling this function indicates another block has joined the group through | ||
| 244 | * a means other than dispatch_group_async(). Calls to this function must be | ||
| 245 | * balanced with dispatch_group_leave(). | ||
| 246 | * | ||
| 247 | * @param group | ||
| 248 | * The dispatch group to update. | ||
| 249 | * The result of passing NULL in this parameter is undefined. | ||
| 250 | */ | ||
| 251 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 252 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 253 | void | ||
| 254 | dispatch_group_enter(dispatch_group_t group); | ||
| 255 | |||
| 256 | /*! | ||
| 257 | * @function dispatch_group_leave | ||
| 258 | * | ||
| 259 | * @abstract | ||
| 260 | * Manually indicate a block in the group has completed | ||
| 261 | * | ||
| 262 | * @discussion | ||
| 263 | * Calling this function indicates block has completed and left the dispatch | ||
| 264 | * group by a means other than dispatch_group_async(). | ||
| 265 | * | ||
| 266 | * @param group | ||
| 267 | * The dispatch group to update. | ||
| 268 | * The result of passing NULL in this parameter is undefined. | ||
| 269 | */ | ||
| 270 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 271 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 272 | void | ||
| 273 | dispatch_group_leave(dispatch_group_t group); | ||
| 274 | |||
| 275 | __END_DECLS | ||
| 276 | |||
| 277 | DISPATCH_ASSUME_NONNULL_END | ||
| 278 | |||
| 279 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/io.h created+597| ... | @@ -0,0 +1,597 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2009-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_IO__ | ||
| 22 | #define __DISPATCH_IO__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | |||
| 33 | /*! @header | ||
| 34 | * Dispatch I/O provides both stream and random access asynchronous read and | ||
| 35 | * write operations on file descriptors. One or more dispatch I/O channels may | ||
| 36 | * be created from a file descriptor as either the DISPATCH_IO_STREAM type or | ||
| 37 | * DISPATCH_IO_RANDOM type. Once a channel has been created the application may | ||
| 38 | * schedule asynchronous read and write operations. | ||
| 39 | * | ||
| 40 | * The application may set policies on the dispatch I/O channel to indicate the | ||
| 41 | * desired frequency of I/O handlers for long-running operations. | ||
| 42 | * | ||
| 43 | * Dispatch I/O also provides a memory management model for I/O buffers that | ||
| 44 | * avoids unnecessary copying of data when pipelined between channels. Dispatch | ||
| 45 | * I/O monitors the overall memory pressure and I/O access patterns for the | ||
| 46 | * application to optimize resource utilization. | ||
| 47 | */ | ||
| 48 | |||
| 49 | /*! | ||
| 50 | * @typedef dispatch_fd_t | ||
| 51 | * Native file descriptor type for the platform. | ||
| 52 | */ | ||
| 53 | #if defined(_WIN32) | ||
| 54 | typedef intptr_t dispatch_fd_t; | ||
| 55 | #else | ||
| 56 | typedef int dispatch_fd_t; | ||
| 57 | #endif | ||
| 58 | |||
| 59 | /*! | ||
| 60 | * @functiongroup Dispatch I/O Convenience API | ||
| 61 | * Convenience wrappers around the dispatch I/O channel API, with simpler | ||
| 62 | * callback handler semantics and no explicit management of channel objects. | ||
| 63 | * File descriptors passed to the convenience API are treated as streams, and | ||
| 64 | * scheduling multiple operations on one file descriptor via the convenience API | ||
| 65 | * may incur more overhead than by using the dispatch I/O channel API directly. | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifdef __BLOCKS__ | ||
| 69 | /*! | ||
| 70 | * @function dispatch_read | ||
| 71 | * Schedule a read operation for asynchronous execution on the specified file | ||
| 72 | * descriptor. The specified handler is enqueued with the data read from the | ||
| 73 | * file descriptor when the operation has completed or an error occurs. | ||
| 74 | * | ||
| 75 | * The data object passed to the handler will be automatically released by the | ||
| 76 | * system when the handler returns. It is the responsibility of the application | ||
| 77 | * to retain, concatenate or copy the data object if it is needed after the | ||
| 78 | * handler returns. | ||
| 79 | * | ||
| 80 | * The data object passed to the handler will only contain as much data as is | ||
| 81 | * currently available from the file descriptor (up to the specified length). | ||
| 82 | * | ||
| 83 | * If an unrecoverable error occurs on the file descriptor, the handler will be | ||
| 84 | * enqueued with the appropriate error code along with a data object of any data | ||
| 85 | * that could be read successfully. | ||
| 86 | * | ||
| 87 | * An invocation of the handler with an error code of zero and an empty data | ||
| 88 | * object indicates that EOF was reached. | ||
| 89 | * | ||
| 90 | * The system takes control of the file descriptor until the handler is | ||
| 91 | * enqueued, and during this time file descriptor flags such as O_NONBLOCK will | ||
| 92 | * be modified by the system on behalf of the application. It is an error for | ||
| 93 | * the application to modify a file descriptor directly while it is under the | ||
| 94 | * control of the system, but it may create additional dispatch I/O convenience | ||
| 95 | * operations or dispatch I/O channels associated with that file descriptor. | ||
| 96 | * | ||
| 97 | * @param fd		The file descriptor from which to read the data. | ||
| 98 | * @param length	The length of data to read from the file descriptor, | ||
| 99 | *			or SIZE_MAX to indicate that all of the data currently | ||
| 100 | *			available from the file descriptor should be read. | ||
| 101 | * @param queue		The dispatch queue to which the handler should be | ||
| 102 | *			submitted. | ||
| 103 | * @param handler	The handler to enqueue when data is ready to be | ||
| 104 | *			delivered. | ||
| 105 | *		param data	The data read from the file descriptor. | ||
| 106 | *		param error	An errno condition for the read operation or | ||
| 107 | *				zero if the read was successful. | ||
| 108 | */ | ||
| 109 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 110 | DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NONNULL4 DISPATCH_NOTHROW | ||
| 111 | void | ||
| 112 | dispatch_read(dispatch_fd_t fd, | ||
| 113 | 	size_t length, | ||
| 114 | 	dispatch_queue_t queue, | ||
| 115 | 	void (^handler)(dispatch_data_t data, int error)); | ||
| 116 | |||
| 117 | /*! | ||
| 118 | * @function dispatch_write | ||
| 119 | * Schedule a write operation for asynchronous execution on the specified file | ||
| 120 | * descriptor. The specified handler is enqueued when the operation has | ||
| 121 | * completed or an error occurs. | ||
| 122 | * | ||
| 123 | * If an unrecoverable error occurs on the file descriptor, the handler will be | ||
| 124 | * enqueued with the appropriate error code along with the data that could not | ||
| 125 | * be successfully written. | ||
| 126 | * | ||
| 127 | * An invocation of the handler with an error code of zero indicates that the | ||
| 128 | * data was fully written to the channel. | ||
| 129 | * | ||
| 130 | * The system takes control of the file descriptor until the handler is | ||
| 131 | * enqueued, and during this time file descriptor flags such as O_NONBLOCK will | ||
| 132 | * be modified by the system on behalf of the application. It is an error for | ||
| 133 | * the application to modify a file descriptor directly while it is under the | ||
| 134 | * control of the system, but it may create additional dispatch I/O convenience | ||
| 135 | * operations or dispatch I/O channels associated with that file descriptor. | ||
| 136 | * | ||
| 137 | * @param fd		The file descriptor to which to write the data. | ||
| 138 | * @param data		The data object to write to the file descriptor. | ||
| 139 | * @param queue		The dispatch queue to which the handler should be | ||
| 140 | *			submitted. | ||
| 141 | * @param handler	The handler to enqueue when the data has been written. | ||
| 142 | *		param data	The data that could not be written to the I/O | ||
| 143 | *				channel, or NULL. | ||
| 144 | *		param error	An errno condition for the write operation or | ||
| 145 | *				zero if the write was successful. | ||
| 146 | */ | ||
| 147 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 148 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL3 DISPATCH_NONNULL4 | ||
| 149 | DISPATCH_NOTHROW | ||
| 150 | void | ||
| 151 | dispatch_write(dispatch_fd_t fd, | ||
| 152 | 	dispatch_data_t data, | ||
| 153 | 	dispatch_queue_t queue, | ||
| 154 | 	void (^handler)(dispatch_data_t _Nullable data, int error)); | ||
| 155 | #endif /* __BLOCKS__ */ | ||
| 156 | |||
| 157 | /*! | ||
| 158 | * @functiongroup Dispatch I/O Channel API | ||
| 159 | */ | ||
| 160 | |||
| 161 | /*! | ||
| 162 | * @typedef dispatch_io_t | ||
| 163 | * A dispatch I/O channel represents the asynchronous I/O policy applied to a | ||
| 164 | * file descriptor. I/O channels are first class dispatch objects and may be | ||
| 165 | * retained and released, suspended and resumed, etc. | ||
| 166 | */ | ||
| 167 | DISPATCH_DECL(dispatch_io); | ||
| 168 | |||
| 169 | /*! | ||
| 170 | * @typedef dispatch_io_type_t | ||
| 171 | * The type of a dispatch I/O channel: | ||
| 172 | * | ||
| 173 | * @const DISPATCH_IO_STREAM	A dispatch I/O channel representing a stream of | ||
| 174 | * bytes. Read and write operations on a channel of this type are performed | ||
| 175 | * serially (in order of creation) and read/write data at the file pointer | ||
| 176 | * position that is current at the time the operation starts executing. | ||
| 177 | * Operations of different type (read vs. write) may be performed simultaneously. | ||
| 178 | * Offsets passed to operations on a channel of this type are ignored. | ||
| 179 | * | ||
| 180 | * @const DISPATCH_IO_RANDOM	A dispatch I/O channel representing a random | ||
| 181 | * access file. Read and write operations on a channel of this type may be | ||
| 182 | * performed concurrently and read/write data at the specified offset. Offsets | ||
| 183 | * are interpreted relative to the file pointer position current at the time the | ||
| 184 | * I/O channel is created. Attempting to create a channel of this type for a | ||
| 185 | * file descriptor that is not seekable will result in an error. | ||
| 186 | */ | ||
| 187 | #define DISPATCH_IO_STREAM 0 | ||
| 188 | #define DISPATCH_IO_RANDOM 1 | ||
| 189 | |||
| 190 | typedef unsigned long dispatch_io_type_t; | ||
| 191 | |||
| 192 | #ifdef __BLOCKS__ | ||
| 193 | /*! | ||
| 194 | * @function dispatch_io_create | ||
| 195 | * Create a dispatch I/O channel associated with a file descriptor. The system | ||
| 196 | * takes control of the file descriptor until the channel is closed, an error | ||
| 197 | * occurs on the file descriptor or all references to the channel are released. | ||
| 198 | * At that time the specified cleanup handler will be enqueued and control over | ||
| 199 | * the file descriptor relinquished. | ||
| 200 | * | ||
| 201 | * While a file descriptor is under the control of a dispatch I/O channel, file | ||
| 202 | * descriptor flags such as O_NONBLOCK will be modified by the system on behalf | ||
| 203 | * of the application. It is an error for the application to modify a file | ||
| 204 | * descriptor directly while it is under the control of a dispatch I/O channel, | ||
| 205 | * but it may create additional channels associated with that file descriptor. | ||
| 206 | * | ||
| 207 | * @param type	The desired type of I/O channel (DISPATCH_IO_STREAM | ||
| 208 | *		or DISPATCH_IO_RANDOM). | ||
| 209 | * @param fd	The file descriptor to associate with the I/O channel. | ||
| 210 | * @param queue	The dispatch queue to which the handler should be submitted. | ||
| 211 | * @param cleanup_handler	The handler to enqueue when the system | ||
| 212 | *				relinquishes control over the file descriptor. | ||
| 213 | *	param error		An errno condition if control is relinquished | ||
| 214 | *				because channel creation failed, zero otherwise. | ||
| 215 | * @result	The newly created dispatch I/O channel or NULL if an error | ||
| 216 | *		occurred (invalid type specified). | ||
| 217 | */ | ||
| 218 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 219 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 220 | DISPATCH_NOTHROW | ||
| 221 | dispatch_io_t | ||
| 222 | dispatch_io_create(dispatch_io_type_t type, | ||
| 223 | 	dispatch_fd_t fd, | ||
| 224 | 	dispatch_queue_t queue, | ||
| 225 | 	void (^cleanup_handler)(int error)); | ||
| 226 | |||
| 227 | /*! | ||
| 228 | * @function dispatch_io_create_with_path | ||
| 229 | * Create a dispatch I/O channel associated with a path name. The specified | ||
| 230 | * path, oflag and mode parameters will be passed to open(2) when the first I/O | ||
| 231 | * operation on the channel is ready to execute and the resulting file | ||
| 232 | * descriptor will remain open and under the control of the system until the | ||
| 233 | * channel is closed, an error occurs on the file descriptor or all references | ||
| 234 | * to the channel are released. At that time the file descriptor will be closed | ||
| 235 | * and the specified cleanup handler will be enqueued. | ||
| 236 | * | ||
| 237 | * @param type	The desired type of I/O channel (DISPATCH_IO_STREAM | ||
| 238 | *		or DISPATCH_IO_RANDOM). | ||
| 239 | * @param path	The absolute path to associate with the I/O channel. | ||
| 240 | * @param oflag	The flags to pass to open(2) when opening the file at | ||
| 241 | *		path. | ||
| 242 | * @param mode	The mode to pass to open(2) when creating the file at | ||
| 243 | *		path (i.e. with flag O_CREAT), zero otherwise. | ||
| 244 | * @param queue	The dispatch queue to which the handler should be | ||
| 245 | *		submitted. | ||
| 246 | * @param cleanup_handler	The handler to enqueue when the system | ||
| 247 | *				has closed the file at path. | ||
| 248 | *	param error		An errno condition if control is relinquished | ||
| 249 | *				because channel creation or opening of the | ||
| 250 | *				specified file failed, zero otherwise. | ||
| 251 | * @result	The newly created dispatch I/O channel or NULL if an error | ||
| 252 | *		occurred (invalid type or non-absolute path specified). | ||
| 253 | */ | ||
| 254 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 255 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED | ||
| 256 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 257 | dispatch_io_t | ||
| 258 | dispatch_io_create_with_path(dispatch_io_type_t type, | ||
| 259 | 	const char *path, int oflag, mode_t mode, | ||
| 260 | 	dispatch_queue_t queue, | ||
| 261 | 	void (^cleanup_handler)(int error)); | ||
| 262 | |||
| 263 | /*! | ||
| 264 | * @function dispatch_io_create_with_io | ||
| 265 | * Create a new dispatch I/O channel from an existing dispatch I/O channel. | ||
| 266 | * The new channel inherits the file descriptor or path name associated with | ||
| 267 | * the existing channel, but not its channel type or policies. | ||
| 268 | * | ||
| 269 | * If the existing channel is associated with a file descriptor, control by the | ||
| 270 | * system over that file descriptor is extended until the new channel is also | ||
| 271 | * closed, an error occurs on the file descriptor, or all references to both | ||
| 272 | * channels are released. At that time the specified cleanup handler will be | ||
| 273 | * enqueued and control over the file descriptor relinquished. | ||
| 274 | * | ||
| 275 | * While a file descriptor is under the control of a dispatch I/O channel, file | ||
| 276 | * descriptor flags such as O_NONBLOCK will be modified by the system on behalf | ||
| 277 | * of the application. It is an error for the application to modify a file | ||
| 278 | * descriptor directly while it is under the control of a dispatch I/O channel, | ||
| 279 | * but it may create additional channels associated with that file descriptor. | ||
| 280 | * | ||
| 281 | * @param type	The desired type of I/O channel (DISPATCH_IO_STREAM | ||
| 282 | *		or DISPATCH_IO_RANDOM). | ||
| 283 | * @param io	The existing channel to create the new I/O channel from. | ||
| 284 | * @param queue	The dispatch queue to which the handler should be submitted. | ||
| 285 | * @param cleanup_handler	The handler to enqueue when the system | ||
| 286 | *				relinquishes control over the file descriptor | ||
| 287 | *				(resp. closes the file at path) associated with | ||
| 288 | *				the existing channel. | ||
| 289 | *	param error		An errno condition if control is relinquished | ||
| 290 | *				because channel creation failed, zero otherwise. | ||
| 291 | * @result	The newly created dispatch I/O channel or NULL if an error | ||
| 292 | *		occurred (invalid type specified). | ||
| 293 | */ | ||
| 294 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 295 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED | ||
| 296 | DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 297 | dispatch_io_t | ||
| 298 | dispatch_io_create_with_io(dispatch_io_type_t type, | ||
| 299 | 	dispatch_io_t io, | ||
| 300 | 	dispatch_queue_t queue, | ||
| 301 | 	void (^cleanup_handler)(int error)); | ||
| 302 | |||
| 303 | /*! | ||
| 304 | * @typedef dispatch_io_handler_t | ||
| 305 | * The prototype of I/O handler blocks for dispatch I/O operations. | ||
| 306 | * | ||
| 307 | * @param done		A flag indicating whether the operation is complete. | ||
| 308 | * @param data		The data object to be handled. | ||
| 309 | * @param error		An errno condition for the operation. | ||
| 310 | */ | ||
| 311 | typedef void (^dispatch_io_handler_t)(bool done, dispatch_data_t _Nullable data, | ||
| 312 | 		int error); | ||
| 313 | |||
| 314 | /*! | ||
| 315 | * @function dispatch_io_read | ||
| 316 | * Schedule a read operation for asynchronous execution on the specified I/O | ||
| 317 | * channel. The I/O handler is enqueued one or more times depending on the | ||
| 318 | * general load of the system and the policy specified on the I/O channel. | ||
| 319 | * | ||
| 320 | * Any data read from the channel is described by the dispatch data object | ||
| 321 | * passed to the I/O handler. This object will be automatically released by the | ||
| 322 | * system when the I/O handler returns. It is the responsibility of the | ||
| 323 | * application to retain, concatenate or copy the data object if it is needed | ||
| 324 | * after the I/O handler returns. | ||
| 325 | * | ||
| 326 | * Dispatch I/O handlers are not reentrant. The system will ensure that no new | ||
| 327 | * I/O handler instance is invoked until the previously enqueued handler block | ||
| 328 | * has returned. | ||
| 329 | * | ||
| 330 | * An invocation of the I/O handler with the done flag set indicates that the | ||
| 331 | * read operation is complete and that the handler will not be enqueued again. | ||
| 332 | * | ||
| 333 | * If an unrecoverable error occurs on the I/O channel's underlying file | ||
| 334 | * descriptor, the I/O handler will be enqueued with the done flag set, the | ||
| 335 | * appropriate error code and a NULL data object. | ||
| 336 | * | ||
| 337 | * An invocation of the I/O handler with the done flag set, an error code of | ||
| 338 | * zero and an empty data object indicates that EOF was reached. | ||
| 339 | * | ||
| 340 | * @param channel	The dispatch I/O channel from which to read the data. | ||
| 341 | * @param offset	The offset relative to the channel position from which | ||
| 342 | *			to start reading (only for DISPATCH_IO_RANDOM). | ||
| 343 | * @param length	The length of data to read from the I/O channel, or | ||
| 344 | *			SIZE_MAX to indicate that data should be read until EOF | ||
| 345 | *			is reached. | ||
| 346 | * @param queue		The dispatch queue to which the I/O handler should be | ||
| 347 | *			submitted. | ||
| 348 | * @param io_handler	The I/O handler to enqueue when data is ready to be | ||
| 349 | *			delivered. | ||
| 350 | *	param done	A flag indicating whether the operation is complete. | ||
| 351 | *	param data	An object with the data most recently read from the | ||
| 352 | *			I/O channel as part of this read operation, or NULL. | ||
| 353 | *	param error	An errno condition for the read operation or zero if | ||
| 354 | *			the read was successful. | ||
| 355 | */ | ||
| 356 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 357 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL4 DISPATCH_NONNULL5 | ||
| 358 | DISPATCH_NOTHROW | ||
| 359 | void | ||
| 360 | dispatch_io_read(dispatch_io_t channel, | ||
| 361 | 	off_t offset, | ||
| 362 | 	size_t length, | ||
| 363 | 	dispatch_queue_t queue, | ||
| 364 | 	dispatch_io_handler_t io_handler); | ||
| 365 | |||
| 366 | /*! | ||
| 367 | * @function dispatch_io_write | ||
| 368 | * Schedule a write operation for asynchronous execution on the specified I/O | ||
| 369 | * channel. The I/O handler is enqueued one or more times depending on the | ||
| 370 | * general load of the system and the policy specified on the I/O channel. | ||
| 371 | * | ||
| 372 | * Any data remaining to be written to the I/O channel is described by the | ||
| 373 | * dispatch data object passed to the I/O handler. This object will be | ||
| 374 | * automatically released by the system when the I/O handler returns. It is the | ||
| 375 | * responsibility of the application to retain, concatenate or copy the data | ||
| 376 | * object if it is needed after the I/O handler returns. | ||
| 377 | * | ||
| 378 | * Dispatch I/O handlers are not reentrant. The system will ensure that no new | ||
| 379 | * I/O handler instance is invoked until the previously enqueued handler block | ||
| 380 | * has returned. | ||
| 381 | * | ||
| 382 | * An invocation of the I/O handler with the done flag set indicates that the | ||
| 383 | * write operation is complete and that the handler will not be enqueued again. | ||
| 384 | * | ||
| 385 | * If an unrecoverable error occurs on the I/O channel's underlying file | ||
| 386 | * descriptor, the I/O handler will be enqueued with the done flag set, the | ||
| 387 | * appropriate error code and an object containing the data that could not be | ||
| 388 | * written. | ||
| 389 | * | ||
| 390 | * An invocation of the I/O handler with the done flag set and an error code of | ||
| 391 | * zero indicates that the data was fully written to the channel. | ||
| 392 | * | ||
| 393 | * @param channel	The dispatch I/O channel on which to write the data. | ||
| 394 | * @param offset	The offset relative to the channel position from which | ||
| 395 | *			to start writing (only for DISPATCH_IO_RANDOM). | ||
| 396 | * @param data		The data to write to the I/O channel. The data object | ||
| 397 | *			will be retained by the system until the write operation | ||
| 398 | *			is complete. | ||
| 399 | * @param queue		The dispatch queue to which the I/O handler should be | ||
| 400 | *			submitted. | ||
| 401 | * @param io_handler	The I/O handler to enqueue when data has been delivered. | ||
| 402 | *	param done	A flag indicating whether the operation is complete. | ||
| 403 | *	param data	An object of the data remaining to be | ||
| 404 | *			written to the I/O channel as part of this write | ||
| 405 | *			operation, or NULL. | ||
| 406 | *	param error	An errno condition for the write operation or zero | ||
| 407 | *			if the write was successful. | ||
| 408 | */ | ||
| 409 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 410 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NONNULL4 | ||
| 411 | DISPATCH_NONNULL5 DISPATCH_NOTHROW | ||
| 412 | void | ||
| 413 | dispatch_io_write(dispatch_io_t channel, | ||
| 414 | 	off_t offset, | ||
| 415 | 	dispatch_data_t data, | ||
| 416 | 	dispatch_queue_t queue, | ||
| 417 | 	dispatch_io_handler_t io_handler); | ||
| 418 | #endif /* __BLOCKS__ */ | ||
| 419 | |||
| 420 | /*! | ||
| 421 | * @typedef dispatch_io_close_flags_t | ||
| 422 | * The type of flags you can set on a dispatch_io_close() call | ||
| 423 | * | ||
| 424 | * @const DISPATCH_IO_STOP	Stop outstanding operations on a channel when | ||
| 425 | *				the channel is closed. | ||
| 426 | */ | ||
| 427 | #define DISPATCH_IO_STOP 0x1 | ||
| 428 | |||
| 429 | typedef unsigned long dispatch_io_close_flags_t; | ||
| 430 | |||
| 431 | /*! | ||
| 432 | * @function dispatch_io_close | ||
| 433 | * Close the specified I/O channel to new read or write operations; scheduling | ||
| 434 | * operations on a closed channel results in their handler returning an error. | ||
| 435 | * | ||
| 436 | * If the DISPATCH_IO_STOP flag is provided, the system will make a best effort | ||
| 437 | * to interrupt any outstanding read and write operations on the I/O channel, | ||
| 438 | * otherwise those operations will run to completion normally. | ||
| 439 | * Partial results of read and write operations may be returned even after a | ||
| 440 | * channel is closed with the DISPATCH_IO_STOP flag. | ||
| 441 | * The final invocation of an I/O handler of an interrupted operation will be | ||
| 442 | * passed an ECANCELED error code, as will the I/O handler of an operation | ||
| 443 | * scheduled on a closed channel. | ||
| 444 | * | ||
| 445 | * @param channel	The dispatch I/O channel to close. | ||
| 446 | * @param flags		The flags for the close operation. | ||
| 447 | */ | ||
| 448 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 449 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 450 | void | ||
| 451 | dispatch_io_close(dispatch_io_t channel, dispatch_io_close_flags_t flags); | ||
| 452 | |||
| 453 | #ifdef __BLOCKS__ | ||
| 454 | /*! | ||
| 455 | * @function dispatch_io_barrier | ||
| 456 | * Schedule a barrier operation on the specified I/O channel; all previously | ||
| 457 | * scheduled operations on the channel will complete before the provided | ||
| 458 | * barrier block is enqueued onto the global queue determined by the channel's | ||
| 459 | * target queue, and no subsequently scheduled operations will start until the | ||
| 460 | * barrier block has returned. | ||
| 461 | * | ||
| 462 | * If multiple channels are associated with the same file descriptor, a barrier | ||
| 463 | * operation scheduled on any of these channels will act as a barrier across all | ||
| 464 | * channels in question, i.e. all previously scheduled operations on any of the | ||
| 465 | * channels will complete before the barrier block is enqueued, and no | ||
| 466 | * operations subsequently scheduled on any of the channels will start until the | ||
| 467 | * barrier block has returned. | ||
| 468 | * | ||
| 469 | * While the barrier block is running, it may safely operate on the channel's | ||
| 470 | * underlying file descriptor with fsync(2), lseek(2) etc. (but not close(2)). | ||
| 471 | * | ||
| 472 | * @param channel	The dispatch I/O channel to schedule the barrier on. | ||
| 473 | * @param barrier	The barrier block. | ||
| 474 | */ | ||
| 475 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 476 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 477 | void | ||
| 478 | dispatch_io_barrier(dispatch_io_t channel, dispatch_block_t barrier); | ||
| 479 | #endif /* __BLOCKS__ */ | ||
| 480 | |||
| 481 | /*! | ||
| 482 | * @function dispatch_io_get_descriptor | ||
| 483 | * Returns the file descriptor underlying a dispatch I/O channel. | ||
| 484 | * | ||
| 485 | * Will return -1 for a channel closed with dispatch_io_close() and for a | ||
| 486 | * channel associated with a path name that has not yet been open(2)ed. | ||
| 487 | * | ||
| 488 | * If called from a barrier block scheduled on a channel associated with a path | ||
| 489 | * name that has not yet been open(2)ed, this will trigger the channel open(2) | ||
| 490 | * operation and return the resulting file descriptor. | ||
| 491 | * | ||
| 492 | * @param channel	The dispatch I/O channel to query. | ||
| 493 | * @result		The file descriptor underlying the channel, or -1. | ||
| 494 | */ | ||
| 495 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 496 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 497 | dispatch_fd_t | ||
| 498 | dispatch_io_get_descriptor(dispatch_io_t channel); | ||
| 499 | |||
| 500 | /*! | ||
| 501 | * @function dispatch_io_set_high_water | ||
| 502 | * Set a high water mark on the I/O channel for all operations. | ||
| 503 | * | ||
| 504 | * The system will make a best effort to enqueue I/O handlers with partial | ||
| 505 | * results as soon the number of bytes processed by an operation (i.e. read or | ||
| 506 | * written) reaches the high water mark. | ||
| 507 | * | ||
| 508 | * The size of data objects passed to I/O handlers for this channel will never | ||
| 509 | * exceed the specified high water mark. | ||
| 510 | * | ||
| 511 | * The default value for the high water mark is unlimited (i.e. SIZE_MAX). | ||
| 512 | * | ||
| 513 | * @param channel	The dispatch I/O channel on which to set the policy. | ||
| 514 | * @param high_water	The number of bytes to use as a high water mark. | ||
| 515 | */ | ||
| 516 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 517 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 518 | void | ||
| 519 | dispatch_io_set_high_water(dispatch_io_t channel, size_t high_water); | ||
| 520 | |||
| 521 | /*! | ||
| 522 | * @function dispatch_io_set_low_water | ||
| 523 | * Set a low water mark on the I/O channel for all operations. | ||
| 524 | * | ||
| 525 | * The system will process (i.e. read or write) at least the low water mark | ||
| 526 | * number of bytes for an operation before enqueueing I/O handlers with partial | ||
| 527 | * results. | ||
| 528 | * | ||
| 529 | * The size of data objects passed to intermediate I/O handler invocations for | ||
| 530 | * this channel (i.e. excluding the final invocation) will never be smaller than | ||
| 531 | * the specified low water mark, except if the channel has an interval with the | ||
| 532 | * DISPATCH_IO_STRICT_INTERVAL flag set or if EOF or an error was encountered. | ||
| 533 | * | ||
| 534 | * I/O handlers should be prepared to receive amounts of data significantly | ||
| 535 | * larger than the low water mark in general. If an I/O handler requires | ||
| 536 | * intermediate results of fixed size, set both the low and and the high water | ||
| 537 | * mark to that size. | ||
| 538 | * | ||
| 539 | * The default value for the low water mark is unspecified, but must be assumed | ||
| 540 | * to be such that intermediate handler invocations may occur. | ||
| 541 | * If I/O handler invocations with partial results are not desired, set the | ||
| 542 | * low water mark to SIZE_MAX. | ||
| 543 | * | ||
| 544 | * @param channel	The dispatch I/O channel on which to set the policy. | ||
| 545 | * @param low_water	The number of bytes to use as a low water mark. | ||
| 546 | */ | ||
| 547 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 548 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 549 | void | ||
| 550 | dispatch_io_set_low_water(dispatch_io_t channel, size_t low_water); | ||
| 551 | |||
| 552 | /*! | ||
| 553 | * @typedef dispatch_io_interval_flags_t | ||
| 554 | * Type of flags to set on dispatch_io_set_interval() | ||
| 555 | * | ||
| 556 | * @const DISPATCH_IO_STRICT_INTERVAL	Enqueue I/O handlers at a channel's | ||
| 557 | * interval setting even if the amount of data ready to be delivered is inferior | ||
| 558 | * to the low water mark (or zero). | ||
| 559 | */ | ||
| 560 | #define DISPATCH_IO_STRICT_INTERVAL 0x1 | ||
| 561 | |||
| 562 | typedef unsigned long dispatch_io_interval_flags_t; | ||
| 563 | |||
| 564 | /*! | ||
| 565 | * @function dispatch_io_set_interval | ||
| 566 | * Set a nanosecond interval at which I/O handlers are to be enqueued on the | ||
| 567 | * I/O channel for all operations. | ||
| 568 | * | ||
| 569 | * This allows an application to receive periodic feedback on the progress of | ||
| 570 | * read and write operations, e.g. for the purposes of displaying progress bars. | ||
| 571 | * | ||
| 572 | * If the amount of data ready to be delivered to an I/O handler at the interval | ||
| 573 | * is inferior to the channel low water mark, the handler will only be enqueued | ||
| 574 | * if the DISPATCH_IO_STRICT_INTERVAL flag is set. | ||
| 575 | * | ||
| 576 | * Note that the system may defer enqueueing interval I/O handlers by a small | ||
| 577 | * unspecified amount of leeway in order to align with other system activity for | ||
| 578 | * improved system performance or power consumption. | ||
| 579 | * | ||
| 580 | * @param channel	The dispatch I/O channel on which to set the policy. | ||
| 581 | * @param interval	The interval in nanoseconds at which delivery of the I/O | ||
| 582 | *					handler is desired. | ||
| 583 | * @param flags		Flags indicating desired data delivery behavior at | ||
| 584 | *					interval time. | ||
| 585 | */ | ||
| 586 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 587 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 588 | void | ||
| 589 | dispatch_io_set_interval(dispatch_io_t channel, | ||
| 590 | 	uint64_t interval, | ||
| 591 | 	dispatch_io_interval_flags_t flags); | ||
| 592 | |||
| 593 | __END_DECLS | ||
| 594 | |||
| 595 | DISPATCH_ASSUME_NONNULL_END | ||
| 596 | |||
| 597 | #endif /* __DISPATCH_IO__ */ | ||
lib/libc/include/x86_64-macos-gnu/dispatch/object.h created+606| ... | @@ -0,0 +1,606 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_OBJECT__ | ||
| 22 | #define __DISPATCH_OBJECT__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #if __has_include(<sys/qos.h>) | ||
| 30 | #include <sys/qos.h> | ||
| 31 | #endif | ||
| 32 | |||
| 33 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 34 | |||
| 35 | /*! | ||
| 36 | * @typedef dispatch_object_t | ||
| 37 | * | ||
| 38 | * @abstract | ||
| 39 | * Abstract base type for all dispatch objects. | ||
| 40 | * The details of the type definition are language-specific. | ||
| 41 | * | ||
| 42 | * @discussion | ||
| 43 | * Dispatch objects are reference counted via calls to dispatch_retain() and | ||
| 44 | * dispatch_release(). | ||
| 45 | */ | ||
| 46 | |||
| 47 | #if OS_OBJECT_USE_OBJC | ||
| 48 | /* | ||
| 49 | * By default, dispatch objects are declared as Objective-C types when building | ||
| 50 | * with an Objective-C compiler. This allows them to participate in ARC, in RR | ||
| 51 | * management by the Blocks runtime and in leaks checking by the static | ||
| 52 | * analyzer, and enables them to be added to Cocoa collections. | ||
| 53 | * See <os/object.h> for details. | ||
| 54 | */ | ||
| 55 | OS_OBJECT_DECL_CLASS(dispatch_object); | ||
| 56 | |||
| 57 | #if OS_OBJECT_SWIFT3 | ||
| 58 | #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, dispatch_object) | ||
| 59 | #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, base) | ||
| 60 | #else // OS_OBJECT_SWIFT3 | ||
| 61 | #define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS(name, dispatch_object) | ||
| 62 | #define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS(name, base) | ||
| 63 | |||
| 64 | DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 65 | void | ||
| 66 | _dispatch_object_validate(dispatch_object_t object) | ||
| 67 | { | ||
| 68 | 	void *isa = *(void *volatile*)(OS_OBJECT_BRIDGE void*)object; | ||
| 69 | 	(void)isa; | ||
| 70 | } | ||
| 71 | #endif // OS_OBJECT_SWIFT3 | ||
| 72 | |||
| 73 | #define DISPATCH_GLOBAL_OBJECT(type, object) ((OS_OBJECT_BRIDGE type)&(object)) | ||
| 74 | #define DISPATCH_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED | ||
| 75 | #elif defined(__cplusplus) && !defined(__DISPATCH_BUILDING_DISPATCH__) | ||
| 76 | /* | ||
| 77 | * Dispatch objects are NOT C++ objects. Nevertheless, we can at least keep C++ | ||
| 78 | * aware of type compatibility. | ||
| 79 | */ | ||
| 80 | typedef struct dispatch_object_s { | ||
| 81 | private: | ||
| 82 | 	dispatch_object_s(); | ||
| 83 | 	~dispatch_object_s(); | ||
| 84 | 	dispatch_object_s(const dispatch_object_s &); | ||
| 85 | 	void operator=(const dispatch_object_s &); | ||
| 86 | } *dispatch_object_t; | ||
| 87 | #define DISPATCH_DECL(name) \ | ||
| 88 | 		typedef struct name##_s : public dispatch_object_s {} *name##_t | ||
| 89 | #define DISPATCH_DECL_SUBCLASS(name, base) \ | ||
| 90 | 		typedef struct name##_s : public base##_s {} *name##_t | ||
| 91 | #define DISPATCH_GLOBAL_OBJECT(type, object) (static_cast<type>(&(object))) | ||
| 92 | #define DISPATCH_RETURNS_RETAINED | ||
| 93 | #else /* Plain C */ | ||
| 94 | typedef union { | ||
| 95 | 	struct _os_object_s *_os_obj; | ||
| 96 | 	struct dispatch_object_s *_do; | ||
| 97 | 	struct dispatch_queue_s *_dq; | ||
| 98 | 	struct dispatch_queue_attr_s *_dqa; | ||
| 99 | 	struct dispatch_group_s *_dg; | ||
| 100 | 	struct dispatch_source_s *_ds; | ||
| 101 | 	struct dispatch_channel_s *_dch; | ||
| 102 | 	struct dispatch_mach_s *_dm; | ||
| 103 | 	struct dispatch_mach_msg_s *_dmsg; | ||
| 104 | 	struct dispatch_semaphore_s *_dsema; | ||
| 105 | 	struct dispatch_data_s *_ddata; | ||
| 106 | 	struct dispatch_io_s *_dchannel; | ||
| 107 | } dispatch_object_t DISPATCH_TRANSPARENT_UNION; | ||
| 108 | #define DISPATCH_DECL(name) typedef struct name##_s *name##_t | ||
| 109 | #define DISPATCH_DECL_SUBCLASS(name, base) typedef base##_t name##_t | ||
| 110 | #define DISPATCH_GLOBAL_OBJECT(type, object) ((type)&(object)) | ||
| 111 | #define DISPATCH_RETURNS_RETAINED | ||
| 112 | #endif | ||
| 113 | |||
| 114 | #if OS_OBJECT_SWIFT3 && OS_OBJECT_USE_OBJC | ||
| 115 | #define DISPATCH_SOURCE_TYPE_DECL(name) \ | ||
| 116 | 		DISPATCH_EXPORT struct dispatch_source_type_s \ | ||
| 117 | 				_dispatch_source_type_##name; \ | ||
| 118 | 		OS_OBJECT_DECL_PROTOCOL(dispatch_source_##name, <OS_dispatch_source>); \ | ||
| 119 | 		OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL( \ | ||
| 120 | 				dispatch_source, dispatch_source_##name) | ||
| 121 | #define DISPATCH_SOURCE_DECL(name) \ | ||
| 122 | 		DISPATCH_DECL(name); \ | ||
| 123 | 		OS_OBJECT_DECL_PROTOCOL(name, <NSObject>); \ | ||
| 124 | 		OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, name) | ||
| 125 | #ifndef DISPATCH_DATA_DECL | ||
| 126 | #define DISPATCH_DATA_DECL(name) OS_OBJECT_DECL_SWIFT(name) | ||
| 127 | #endif // DISPATCH_DATA_DECL | ||
| 128 | #else | ||
| 129 | #define DISPATCH_SOURCE_DECL(name) \ | ||
| 130 | 		DISPATCH_DECL(name); | ||
| 131 | #define DISPATCH_DATA_DECL(name) DISPATCH_DECL(name) | ||
| 132 | #define DISPATCH_SOURCE_TYPE_DECL(name) \ | ||
| 133 | 		DISPATCH_EXPORT const struct dispatch_source_type_s \ | ||
| 134 | 		_dispatch_source_type_##name | ||
| 135 | #endif | ||
| 136 | |||
| 137 | #ifdef __BLOCKS__ | ||
| 138 | /*! | ||
| 139 | * @typedef dispatch_block_t | ||
| 140 | * | ||
| 141 | * @abstract | ||
| 142 | * The type of blocks submitted to dispatch queues, which take no arguments | ||
| 143 | * and have no return value. | ||
| 144 | * | ||
| 145 | * @discussion | ||
| 146 | * When not building with Objective-C ARC, a block object allocated on or | ||
| 147 | * copied to the heap must be released with a -[release] message or the | ||
| 148 | * Block_release() function. | ||
| 149 | * | ||
| 150 | * The declaration of a block literal allocates storage on the stack. | ||
| 151 | * Therefore, this is an invalid construct: | ||
| 152 | * <code> | ||
| 153 | * dispatch_block_t block; | ||
| 154 | * if (x) { | ||
| 155 | * block = ^{ printf("true\n"); }; | ||
| 156 | * } else { | ||
| 157 | * block = ^{ printf("false\n"); }; | ||
| 158 | * } | ||
| 159 | * block(); // unsafe!!! | ||
| 160 | * </code> | ||
| 161 | * | ||
| 162 | * What is happening behind the scenes: | ||
| 163 | * <code> | ||
| 164 | * if (x) { | ||
| 165 | * struct Block __tmp_1 = ...; // setup details | ||
| 166 | * block = &__tmp_1; | ||
| 167 | * } else { | ||
| 168 | * struct Block __tmp_2 = ...; // setup details | ||
| 169 | * block = &__tmp_2; | ||
| 170 | * } | ||
| 171 | * </code> | ||
| 172 | * | ||
| 173 | * As the example demonstrates, the address of a stack variable is escaping the | ||
| 174 | * scope in which it is allocated. That is a classic C bug. | ||
| 175 | * | ||
| 176 | * Instead, the block literal must be copied to the heap with the Block_copy() | ||
| 177 | * function or by sending it a -[copy] message. | ||
| 178 | */ | ||
| 179 | typedef void (^dispatch_block_t)(void); | ||
| 180 | #endif // __BLOCKS__ | ||
| 181 | |||
| 182 | __BEGIN_DECLS | ||
| 183 | |||
| 184 | /*! | ||
| 185 | * @typedef dispatch_qos_class_t | ||
| 186 | * Alias for qos_class_t type. | ||
| 187 | */ | ||
| 188 | #if __has_include(<sys/qos.h>) | ||
| 189 | typedef qos_class_t dispatch_qos_class_t; | ||
| 190 | #else | ||
| 191 | typedef unsigned int dispatch_qos_class_t; | ||
| 192 | #endif | ||
| 193 | |||
| 194 | /*! | ||
| 195 | * @function dispatch_retain | ||
| 196 | * | ||
| 197 | * @abstract | ||
| 198 | * Increment the reference count of a dispatch object. | ||
| 199 | * | ||
| 200 | * @discussion | ||
| 201 | * Calls to dispatch_retain() must be balanced with calls to | ||
| 202 | * dispatch_release(). | ||
| 203 | * | ||
| 204 | * @param object | ||
| 205 | * The object to retain. | ||
| 206 | * The result of passing NULL in this parameter is undefined. | ||
| 207 | */ | ||
| 208 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 209 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 210 | DISPATCH_SWIFT_UNAVAILABLE("Can't be used with ARC") | ||
| 211 | void | ||
| 212 | dispatch_retain(dispatch_object_t object); | ||
| 213 | #if OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 214 | #undef dispatch_retain | ||
| 215 | #define dispatch_retain(object) \ | ||
| 216 | 		__extension__({ dispatch_object_t _o = (object); \ | ||
| 217 | 		_dispatch_object_validate(_o); (void)[_o retain]; }) | ||
| 218 | #endif | ||
| 219 | |||
| 220 | /*! | ||
| 221 | * @function dispatch_release | ||
| 222 | * | ||
| 223 | * @abstract | ||
| 224 | * Decrement the reference count of a dispatch object. | ||
| 225 | * | ||
| 226 | * @discussion | ||
| 227 | * A dispatch object is asynchronously deallocated once all references are | ||
| 228 | * released (i.e. the reference count becomes zero). The system does not | ||
| 229 | * guarantee that a given client is the last or only reference to a given | ||
| 230 | * object. | ||
| 231 | * | ||
| 232 | * @param object | ||
| 233 | * The object to release. | ||
| 234 | * The result of passing NULL in this parameter is undefined. | ||
| 235 | */ | ||
| 236 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 237 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 238 | DISPATCH_SWIFT_UNAVAILABLE("Can't be used with ARC") | ||
| 239 | void | ||
| 240 | dispatch_release(dispatch_object_t object); | ||
| 241 | #if OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 242 | #undef dispatch_release | ||
| 243 | #define dispatch_release(object) \ | ||
| 244 | 		__extension__({ dispatch_object_t _o = (object); \ | ||
| 245 | 		_dispatch_object_validate(_o); [_o release]; }) | ||
| 246 | #endif | ||
| 247 | |||
| 248 | /*! | ||
| 249 | * @function dispatch_get_context | ||
| 250 | * | ||
| 251 | * @abstract | ||
| 252 | * Returns the application defined context of the object. | ||
| 253 | * | ||
| 254 | * @param object | ||
| 255 | * The result of passing NULL in this parameter is undefined. | ||
| 256 | * | ||
| 257 | * @result | ||
| 258 | * The context of the object; may be NULL. | ||
| 259 | */ | ||
| 260 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 261 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_PURE DISPATCH_WARN_RESULT | ||
| 262 | DISPATCH_NOTHROW | ||
| 263 | void *_Nullable | ||
| 264 | dispatch_get_context(dispatch_object_t object); | ||
| 265 | |||
| 266 | /*! | ||
| 267 | * @function dispatch_set_context | ||
| 268 | * | ||
| 269 | * @abstract | ||
| 270 | * Associates an application defined context with the object. | ||
| 271 | * | ||
| 272 | * @param object | ||
| 273 | * The result of passing NULL in this parameter is undefined. | ||
| 274 | * | ||
| 275 | * @param context | ||
| 276 | * The new client defined context for the object. This may be NULL. | ||
| 277 | * | ||
| 278 | */ | ||
| 279 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 280 | DISPATCH_EXPORT DISPATCH_NOTHROW | ||
| 281 | void | ||
| 282 | dispatch_set_context(dispatch_object_t object, void *_Nullable context); | ||
| 283 | |||
| 284 | /*! | ||
| 285 | * @function dispatch_set_finalizer_f | ||
| 286 | * | ||
| 287 | * @abstract | ||
| 288 | * Set the finalizer function for a dispatch object. | ||
| 289 | * | ||
| 290 | * @param object | ||
| 291 | * The dispatch object to modify. | ||
| 292 | * The result of passing NULL in this parameter is undefined. | ||
| 293 | * | ||
| 294 | * @param finalizer | ||
| 295 | * The finalizer function pointer. | ||
| 296 | * | ||
| 297 | * @discussion | ||
| 298 | * A dispatch object's finalizer will be invoked on the object's target queue | ||
| 299 | * after all references to the object have been released. This finalizer may be | ||
| 300 | * used by the application to release any resources associated with the object, | ||
| 301 | * such as freeing the object's context. | ||
| 302 | * The context parameter passed to the finalizer function is the current | ||
| 303 | * context of the dispatch object at the time the finalizer call is made. | ||
| 304 | */ | ||
| 305 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 306 | DISPATCH_EXPORT DISPATCH_NOTHROW | ||
| 307 | void | ||
| 308 | dispatch_set_finalizer_f(dispatch_object_t object, | ||
| 309 | 		dispatch_function_t _Nullable finalizer); | ||
| 310 | |||
| 311 | /*! | ||
| 312 | * @function dispatch_activate | ||
| 313 | * | ||
| 314 | * @abstract | ||
| 315 | * Activates the specified dispatch object. | ||
| 316 | * | ||
| 317 | * @discussion | ||
| 318 | * Dispatch objects such as queues and sources may be created in an inactive | ||
| 319 | * state. Objects in this state have to be activated before any blocks | ||
| 320 | * associated with them will be invoked. | ||
| 321 | * | ||
| 322 | * The target queue of inactive objects can be changed using | ||
| 323 | * dispatch_set_target_queue(). Change of target queue is no longer permitted | ||
| 324 | * once an initially inactive object has been activated. | ||
| 325 | * | ||
| 326 | * Calling dispatch_activate() on an active object has no effect. | ||
| 327 | * Releasing the last reference count on an inactive object is undefined. | ||
| 328 | * | ||
| 329 | * @param object | ||
| 330 | * The object to be activated. | ||
| 331 | * The result of passing NULL in this parameter is undefined. | ||
| 332 | */ | ||
| 333 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 334 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 335 | void | ||
| 336 | dispatch_activate(dispatch_object_t object); | ||
| 337 | |||
| 338 | /*! | ||
| 339 | * @function dispatch_suspend | ||
| 340 | * | ||
| 341 | * @abstract | ||
| 342 | * Suspends the invocation of blocks on a dispatch object. | ||
| 343 | * | ||
| 344 | * @discussion | ||
| 345 | * A suspended object will not invoke any blocks associated with it. The | ||
| 346 | * suspension of an object will occur after any running block associated with | ||
| 347 | * the object completes. | ||
| 348 | * | ||
| 349 | * Calls to dispatch_suspend() must be balanced with calls | ||
| 350 | * to dispatch_resume(). | ||
| 351 | * | ||
| 352 | * @param object | ||
| 353 | * The object to be suspended. | ||
| 354 | * The result of passing NULL in this parameter is undefined. | ||
| 355 | */ | ||
| 356 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 357 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 358 | void | ||
| 359 | dispatch_suspend(dispatch_object_t object); | ||
| 360 | |||
| 361 | /*! | ||
| 362 | * @function dispatch_resume | ||
| 363 | * | ||
| 364 | * @abstract | ||
| 365 | * Resumes the invocation of blocks on a dispatch object. | ||
| 366 | * | ||
| 367 | * @discussion | ||
| 368 | * Dispatch objects can be suspended with dispatch_suspend(), which increments | ||
| 369 | * an internal suspension count. dispatch_resume() is the inverse operation, | ||
| 370 | * and consumes suspension counts. When the last suspension count is consumed, | ||
| 371 | * blocks associated with the object will be invoked again. | ||
| 372 | * | ||
| 373 | * For backward compatibility reasons, dispatch_resume() on an inactive and not | ||
| 374 | * otherwise suspended dispatch source object has the same effect as calling | ||
| 375 | * dispatch_activate(). For new code, using dispatch_activate() is preferred. | ||
| 376 | * | ||
| 377 | * If the specified object has zero suspension count and is not an inactive | ||
| 378 | * source, this function will result in an assertion and the process being | ||
| 379 | * terminated. | ||
| 380 | * | ||
| 381 | * @param object | ||
| 382 | * The object to be resumed. | ||
| 383 | * The result of passing NULL in this parameter is undefined. | ||
| 384 | */ | ||
| 385 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 386 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 387 | void | ||
| 388 | dispatch_resume(dispatch_object_t object); | ||
| 389 | |||
| 390 | /*! | ||
| 391 | * @function dispatch_set_qos_class_floor | ||
| 392 | * | ||
| 393 | * @abstract | ||
| 394 | * Sets the QOS class floor on a dispatch queue, source or workloop. | ||
| 395 | * | ||
| 396 | * @discussion | ||
| 397 | * The QOS class of workitems submitted to this object asynchronously will be | ||
| 398 | * elevated to at least the specified QOS class floor. The QOS of the workitem | ||
| 399 | * will be used if higher than the floor even when the workitem has been created | ||
| 400 | * without "ENFORCE" semantics. | ||
| 401 | * | ||
| 402 | * Setting the QOS class floor is equivalent to the QOS effects of configuring | ||
| 403 | * a queue whose target queue has a QoS class set to the same value. | ||
| 404 | * | ||
| 405 | * @param object | ||
| 406 | * A dispatch queue, workloop, or source to configure. | ||
| 407 | * The object must be inactive. | ||
| 408 | * | ||
| 409 | * Passing another object type or an object that has been activated is undefined | ||
| 410 | * and will cause the process to be terminated. | ||
| 411 | * | ||
| 412 | * @param qos_class | ||
| 413 | * A QOS class value: | ||
| 414 | * - QOS_CLASS_USER_INTERACTIVE | ||
| 415 | * - QOS_CLASS_USER_INITIATED | ||
| 416 | * - QOS_CLASS_DEFAULT | ||
| 417 | * - QOS_CLASS_UTILITY | ||
| 418 | * - QOS_CLASS_BACKGROUND | ||
| 419 | * Passing any other value is undefined. | ||
| 420 | * | ||
| 421 | * @param relative_priority | ||
| 422 | * A relative priority within the QOS class. This value is a negative | ||
| 423 | * offset from the maximum supported scheduler priority for the given class. | ||
| 424 | * Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY | ||
| 425 | * is undefined. | ||
| 426 | */ | ||
| 427 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 428 | DISPATCH_EXPORT DISPATCH_NOTHROW | ||
| 429 | void | ||
| 430 | dispatch_set_qos_class_floor(dispatch_object_t object, | ||
| 431 | 		dispatch_qos_class_t qos_class, int relative_priority); | ||
| 432 | |||
| 433 | #ifdef __BLOCKS__ | ||
| 434 | /*! | ||
| 435 | * @function dispatch_wait | ||
| 436 | * | ||
| 437 | * @abstract | ||
| 438 | * Wait synchronously for an object or until the specified timeout has elapsed. | ||
| 439 | * | ||
| 440 | * @discussion | ||
| 441 | * Type-generic macro that maps to dispatch_block_wait, dispatch_group_wait or | ||
| 442 | * dispatch_semaphore_wait, depending on the type of the first argument. | ||
| 443 | * See documentation for these functions for more details. | ||
| 444 | * This function is unavailable for any other object type. | ||
| 445 | * | ||
| 446 | * @param object | ||
| 447 | * The object to wait on. | ||
| 448 | * The result of passing NULL in this parameter is undefined. | ||
| 449 | * | ||
| 450 | * @param timeout | ||
| 451 | * When to timeout (see dispatch_time). As a convenience, there are the | ||
| 452 | * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants. | ||
| 453 | * | ||
| 454 | * @result | ||
| 455 | * Returns zero on success or non-zero on error (i.e. timed out). | ||
| 456 | */ | ||
| 457 | DISPATCH_UNAVAILABLE | ||
| 458 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 459 | intptr_t | ||
| 460 | dispatch_wait(void *object, dispatch_time_t timeout); | ||
| 461 | #if __has_extension(c_generic_selections) | ||
| 462 | #define dispatch_wait(object, timeout) \ | ||
| 463 | 		_Generic((object), \ | ||
| 464 | 			dispatch_block_t:dispatch_block_wait, \ | ||
| 465 | 			dispatch_group_t:dispatch_group_wait, \ | ||
| 466 | 			dispatch_semaphore_t:dispatch_semaphore_wait \ | ||
| 467 | 		)((object),(timeout)) | ||
| 468 | #endif | ||
| 469 | |||
| 470 | /*! | ||
| 471 | * @function dispatch_notify | ||
| 472 | * | ||
| 473 | * @abstract | ||
| 474 | * Schedule a notification block to be submitted to a queue when the execution | ||
| 475 | * of a specified object has completed. | ||
| 476 | * | ||
| 477 | * @discussion | ||
| 478 | * Type-generic macro that maps to dispatch_block_notify or | ||
| 479 | * dispatch_group_notify, depending on the type of the first argument. | ||
| 480 | * See documentation for these functions for more details. | ||
| 481 | * This function is unavailable for any other object type. | ||
| 482 | * | ||
| 483 | * @param object | ||
| 484 | * The object to observe. | ||
| 485 | * The result of passing NULL in this parameter is undefined. | ||
| 486 | * | ||
| 487 | * @param queue | ||
| 488 | * The queue to which the supplied notification block will be submitted when | ||
| 489 | * the observed object completes. | ||
| 490 | * | ||
| 491 | * @param notification_block | ||
| 492 | * The block to submit when the observed object completes. | ||
| 493 | */ | ||
| 494 | DISPATCH_UNAVAILABLE | ||
| 495 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 496 | void | ||
| 497 | dispatch_notify(void *object, dispatch_object_t queue, | ||
| 498 | 		dispatch_block_t notification_block); | ||
| 499 | #if __has_extension(c_generic_selections) | ||
| 500 | #define dispatch_notify(object, queue, notification_block) \ | ||
| 501 | 		_Generic((object), \ | ||
| 502 | 			dispatch_block_t:dispatch_block_notify, \ | ||
| 503 | 			dispatch_group_t:dispatch_group_notify \ | ||
| 504 | 		)((object),(queue), (notification_block)) | ||
| 505 | #endif | ||
| 506 | |||
| 507 | /*! | ||
| 508 | * @function dispatch_cancel | ||
| 509 | * | ||
| 510 | * @abstract | ||
| 511 | * Cancel the specified object. | ||
| 512 | * | ||
| 513 | * @discussion | ||
| 514 | * Type-generic macro that maps to dispatch_block_cancel or | ||
| 515 | * dispatch_source_cancel, depending on the type of the first argument. | ||
| 516 | * See documentation for these functions for more details. | ||
| 517 | * This function is unavailable for any other object type. | ||
| 518 | * | ||
| 519 | * @param object | ||
| 520 | * The object to cancel. | ||
| 521 | * The result of passing NULL in this parameter is undefined. | ||
| 522 | */ | ||
| 523 | DISPATCH_UNAVAILABLE | ||
| 524 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 525 | void | ||
| 526 | dispatch_cancel(void *object); | ||
| 527 | #if __has_extension(c_generic_selections) | ||
| 528 | #define dispatch_cancel(object) \ | ||
| 529 | 		_Generic((object), \ | ||
| 530 | 			dispatch_block_t:dispatch_block_cancel, \ | ||
| 531 | 			dispatch_source_t:dispatch_source_cancel \ | ||
| 532 | 		)((object)) | ||
| 533 | #endif | ||
| 534 | |||
| 535 | /*! | ||
| 536 | * @function dispatch_testcancel | ||
| 537 | * | ||
| 538 | * @abstract | ||
| 539 | * Test whether the specified object has been canceled | ||
| 540 | * | ||
| 541 | * @discussion | ||
| 542 | * Type-generic macro that maps to dispatch_block_testcancel or | ||
| 543 | * dispatch_source_testcancel, depending on the type of the first argument. | ||
| 544 | * See documentation for these functions for more details. | ||
| 545 | * This function is unavailable for any other object type. | ||
| 546 | * | ||
| 547 | * @param object | ||
| 548 | * The object to test. | ||
| 549 | * The result of passing NULL in this parameter is undefined. | ||
| 550 | * | ||
| 551 | * @result | ||
| 552 | * Non-zero if canceled and zero if not canceled. | ||
| 553 | */ | ||
| 554 | DISPATCH_UNAVAILABLE | ||
| 555 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE | ||
| 556 | DISPATCH_NOTHROW | ||
| 557 | intptr_t | ||
| 558 | dispatch_testcancel(void *object); | ||
| 559 | #if __has_extension(c_generic_selections) | ||
| 560 | #define dispatch_testcancel(object) \ | ||
| 561 | 		_Generic((object), \ | ||
| 562 | 			dispatch_block_t:dispatch_block_testcancel, \ | ||
| 563 | 			dispatch_source_t:dispatch_source_testcancel \ | ||
| 564 | 		)((object)) | ||
| 565 | #endif | ||
| 566 | #endif // __BLOCKS__ | ||
| 567 | |||
| 568 | /*! | ||
| 569 | * @function dispatch_debug | ||
| 570 | * | ||
| 571 | * @abstract | ||
| 572 | * Programmatically log debug information about a dispatch object. | ||
| 573 | * | ||
| 574 | * @discussion | ||
| 575 | * Programmatically log debug information about a dispatch object. By default, | ||
| 576 | * the log output is sent to syslog at notice level. In the debug version of | ||
| 577 | * the library, the log output is sent to a file in /var/tmp. | ||
| 578 | * The log output destination can be configured via the LIBDISPATCH_LOG | ||
| 579 | * environment variable, valid values are: YES, NO, syslog, stderr, file. | ||
| 580 | * | ||
| 581 | * This function is deprecated and will be removed in a future release. | ||
| 582 | * Objective-C callers may use -debugDescription instead. | ||
| 583 | * | ||
| 584 | * @param object | ||
| 585 | * The object to introspect. | ||
| 586 | * | ||
| 587 | * @param message | ||
| 588 | * The message to log above and beyond the introspection. | ||
| 589 | */ | ||
| 590 | API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0)) | ||
| 591 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW DISPATCH_COLD | ||
| 592 | __attribute__((__format__(printf,2,3))) | ||
| 593 | void | ||
| 594 | dispatch_debug(dispatch_object_t object, const char *message, ...); | ||
| 595 | |||
| 596 | API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0)) | ||
| 597 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW DISPATCH_COLD | ||
| 598 | __attribute__((__format__(printf,2,0))) | ||
| 599 | void | ||
| 600 | dispatch_debugv(dispatch_object_t object, const char *message, va_list ap); | ||
| 601 | |||
| 602 | __END_DECLS | ||
| 603 | |||
| 604 | DISPATCH_ASSUME_NONNULL_END | ||
| 605 | |||
| 606 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/once.h created+125| ... | @@ -0,0 +1,125 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2010 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_ONCE__ | ||
| 22 | #define __DISPATCH_ONCE__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | |||
| 33 | /*! | ||
| 34 | * @typedef dispatch_once_t | ||
| 35 | * | ||
| 36 | * @abstract | ||
| 37 | * A predicate for use with dispatch_once(). It must be initialized to zero. | ||
| 38 | * Note: static and global variables default to zero. | ||
| 39 | */ | ||
| 40 | DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead") | ||
| 41 | typedef intptr_t dispatch_once_t; | ||
| 42 | |||
| 43 | #if defined(__x86_64__) || defined(__i386__) || defined(__s390x__) | ||
| 44 | #define DISPATCH_ONCE_INLINE_FASTPATH 1 | ||
| 45 | #elif defined(__APPLE__) | ||
| 46 | #define DISPATCH_ONCE_INLINE_FASTPATH 1 | ||
| 47 | #else | ||
| 48 | #define DISPATCH_ONCE_INLINE_FASTPATH 0 | ||
| 49 | #endif | ||
| 50 | |||
| 51 | /*! | ||
| 52 | * @function dispatch_once | ||
| 53 | * | ||
| 54 | * @abstract | ||
| 55 | * Execute a block once and only once. | ||
| 56 | * | ||
| 57 | * @param predicate | ||
| 58 | * A pointer to a dispatch_once_t that is used to test whether the block has | ||
| 59 | * completed or not. | ||
| 60 | * | ||
| 61 | * @param block | ||
| 62 | * The block to execute once. | ||
| 63 | * | ||
| 64 | * @discussion | ||
| 65 | * Always call dispatch_once() before using or testing any variables that are | ||
| 66 | * initialized by the block. | ||
| 67 | */ | ||
| 68 | #ifdef __BLOCKS__ | ||
| 69 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 70 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 71 | DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead") | ||
| 72 | void | ||
| 73 | dispatch_once(dispatch_once_t *predicate, | ||
| 74 | 		DISPATCH_NOESCAPE dispatch_block_t block); | ||
| 75 | |||
| 76 | #if DISPATCH_ONCE_INLINE_FASTPATH | ||
| 77 | DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 78 | DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead") | ||
| 79 | void | ||
| 80 | _dispatch_once(dispatch_once_t *predicate, | ||
| 81 | 		DISPATCH_NOESCAPE dispatch_block_t block) | ||
| 82 | { | ||
| 83 | 	if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) { | ||
| 84 | 		dispatch_once(predicate, block); | ||
| 85 | 	} else { | ||
| 86 | 		dispatch_compiler_barrier(); | ||
| 87 | 	} | ||
| 88 | 	DISPATCH_COMPILER_CAN_ASSUME(*predicate == ~0l); | ||
| 89 | } | ||
| 90 | #undef dispatch_once | ||
| 91 | #define dispatch_once _dispatch_once | ||
| 92 | #endif | ||
| 93 | #endif // DISPATCH_ONCE_INLINE_FASTPATH | ||
| 94 | |||
| 95 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 96 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 97 | DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead") | ||
| 98 | void | ||
| 99 | dispatch_once_f(dispatch_once_t *predicate, void *_Nullable context, | ||
| 100 | 		dispatch_function_t function); | ||
| 101 | |||
| 102 | #if DISPATCH_ONCE_INLINE_FASTPATH | ||
| 103 | DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL1 DISPATCH_NONNULL3 | ||
| 104 | DISPATCH_NOTHROW | ||
| 105 | DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead") | ||
| 106 | void | ||
| 107 | _dispatch_once_f(dispatch_once_t *predicate, void *_Nullable context, | ||
| 108 | 		dispatch_function_t function) | ||
| 109 | { | ||
| 110 | 	if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) { | ||
| 111 | 		dispatch_once_f(predicate, context, function); | ||
| 112 | 	} else { | ||
| 113 | 		dispatch_compiler_barrier(); | ||
| 114 | 	} | ||
| 115 | 	DISPATCH_COMPILER_CAN_ASSUME(*predicate == ~0l); | ||
| 116 | } | ||
| 117 | #undef dispatch_once_f | ||
| 118 | #define dispatch_once_f _dispatch_once_f | ||
| 119 | #endif // DISPATCH_ONCE_INLINE_FASTPATH | ||
| 120 | |||
| 121 | __END_DECLS | ||
| 122 | |||
| 123 | DISPATCH_ASSUME_NONNULL_END | ||
| 124 | |||
| 125 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/queue.h created+1674| ... | @@ -0,0 +1,1674 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_QUEUE__ | ||
| 22 | #define __DISPATCH_QUEUE__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | /*! | ||
| 32 | * @header | ||
| 33 | * | ||
| 34 | * Dispatch is an abstract model for expressing concurrency via simple but | ||
| 35 | * powerful API. | ||
| 36 | * | ||
| 37 | * At the core, dispatch provides serial FIFO queues to which blocks may be | ||
| 38 | * submitted. Blocks submitted to these dispatch queues are invoked on a pool | ||
| 39 | * of threads fully managed by the system. No guarantee is made regarding | ||
| 40 | * which thread a block will be invoked on; however, it is guaranteed that only | ||
| 41 | * one block submitted to the FIFO dispatch queue will be invoked at a time. | ||
| 42 | * | ||
| 43 | * When multiple queues have blocks to be processed, the system is free to | ||
| 44 | * allocate additional threads to invoke the blocks concurrently. When the | ||
| 45 | * queues become empty, these threads are automatically released. | ||
| 46 | */ | ||
| 47 | |||
| 48 | /*! | ||
| 49 | * @typedef dispatch_queue_t | ||
| 50 | * | ||
| 51 | * @abstract | ||
| 52 | * Dispatch queues invoke workitems submitted to them. | ||
| 53 | * | ||
| 54 | * @discussion | ||
| 55 | * Dispatch queues come in many flavors, the most common one being the dispatch | ||
| 56 | * serial queue (See dispatch_queue_serial_t). | ||
| 57 | * | ||
| 58 | * The system manages a pool of threads which process dispatch queues and invoke | ||
| 59 | * workitems submitted to them. | ||
| 60 | * | ||
| 61 | * Conceptually a dispatch queue may have its own thread of execution, and | ||
| 62 | * interaction between queues is highly asynchronous. | ||
| 63 | * | ||
| 64 | * Dispatch queues are reference counted via calls to dispatch_retain() and | ||
| 65 | * dispatch_release(). Pending workitems submitted to a queue also hold a | ||
| 66 | * reference to the queue until they have finished. Once all references to a | ||
| 67 | * queue have been released, the queue will be deallocated by the system. | ||
| 68 | */ | ||
| 69 | DISPATCH_DECL(dispatch_queue); | ||
| 70 | |||
| 71 | /*! | ||
| 72 | * @typedef dispatch_queue_global_t | ||
| 73 | * | ||
| 74 | * @abstract | ||
| 75 | * Dispatch global concurrent queues are an abstraction around the system thread | ||
| 76 | * pool which invokes workitems that are submitted to dispatch queues. | ||
| 77 | * | ||
| 78 | * @discussion | ||
| 79 | * Dispatch global concurrent queues provide buckets of priorities on top of the | ||
| 80 | * thread pool the system manages. The system will decide how many threads | ||
| 81 | * to allocate to this pool depending on demand and system load. In particular, | ||
| 82 | * the system tries to maintain a good level of concurrency for this resource, | ||
| 83 | * and will create new threads when too many existing worker threads block in | ||
| 84 | * system calls. | ||
| 85 | * | ||
| 86 | * The global concurrent queues are a shared resource and as such it is the | ||
| 87 | * responsiblity of every user of this resource to not submit an unbounded | ||
| 88 | * amount of work to this pool, especially work that may block, as this can | ||
| 89 | * cause the system to spawn very large numbers of threads (aka. thread | ||
| 90 | * explosion). | ||
| 91 | * | ||
| 92 | * Work items submitted to the global concurrent queues have no ordering | ||
| 93 | * guarantee with respect to the order of submission, and workitems submitted | ||
| 94 | * to these queues may be invoked concurrently. | ||
| 95 | * | ||
| 96 | * Dispatch global concurrent queues are well-known global objects that are | ||
| 97 | * returned by dispatch_get_global_queue(). These objects cannot be modified. | ||
| 98 | * Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., | ||
| 99 | * will have no effect when used with queues of this type. | ||
| 100 | */ | ||
| 101 | DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue); | ||
| 102 | |||
| 103 | /*! | ||
| 104 | * @typedef dispatch_queue_serial_t | ||
| 105 | * | ||
| 106 | * @abstract | ||
| 107 | * Dispatch serial queues invoke workitems submitted to them serially in FIFO | ||
| 108 | * order. | ||
| 109 | * | ||
| 110 | * @discussion | ||
| 111 | * Dispatch serial queues are lightweight objects to which workitems may be | ||
| 112 | * submitted to be invoked in FIFO order. A serial queue will only invoke one | ||
| 113 | * workitem at a time, but independent serial queues may each invoke their work | ||
| 114 | * items concurrently with respect to each other. | ||
| 115 | * | ||
| 116 | * Serial queues can target each other (See dispatch_set_target_queue()). The | ||
| 117 | * serial queue at the bottom of a queue hierarchy provides an exclusion | ||
| 118 | * context: at most one workitem submitted to any of the queues in such | ||
| 119 | * a hiearchy will run at any given time. | ||
| 120 | * | ||
| 121 | * Such hierarchies provide a natural construct to organize an application | ||
| 122 | * subsystem around. | ||
| 123 | * | ||
| 124 | * Serial queues are created by passing a dispatch queue attribute derived from | ||
| 125 | * DISPATCH_QUEUE_SERIAL to dispatch_queue_create_with_target(). | ||
| 126 | */ | ||
| 127 | DISPATCH_DECL_SUBCLASS(dispatch_queue_serial, dispatch_queue); | ||
| 128 | |||
| 129 | /*! | ||
| 130 | * @typedef dispatch_queue_main_t | ||
| 131 | * | ||
| 132 | * @abstract | ||
| 133 | * The type of the default queue that is bound to the main thread. | ||
| 134 | * | ||
| 135 | * @discussion | ||
| 136 | * The main queue is a serial queue (See dispatch_queue_serial_t) which is bound | ||
| 137 | * to the main thread of an application. | ||
| 138 | * | ||
| 139 | * In order to invoke workitems submitted to the main queue, the application | ||
| 140 | * must call dispatch_main(), NSApplicationMain(), or use a CFRunLoop on the | ||
| 141 | * main thread. | ||
| 142 | * | ||
| 143 | * The main queue is a well known global object that is made automatically on | ||
| 144 | * behalf of the main thread during process initialization and is returned by | ||
| 145 | * dispatch_get_main_queue(). This object cannot be modified. Calls to | ||
| 146 | * dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will | ||
| 147 | * have no effect when used on the main queue. | ||
| 148 | */ | ||
| 149 | DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial); | ||
| 150 | |||
| 151 | /*! | ||
| 152 | * @typedef dispatch_queue_concurrent_t | ||
| 153 | * | ||
| 154 | * @abstract | ||
| 155 | * Dispatch concurrent queues invoke workitems submitted to them concurrently, | ||
| 156 | * and admit a notion of barrier workitems. | ||
| 157 | * | ||
| 158 | * @discussion | ||
| 159 | * Dispatch concurrent queues are lightweight objects to which regular and | ||
| 160 | * barrier workitems may be submited. Barrier workitems are invoked in | ||
| 161 | * exclusion of any other kind of workitem in FIFO order. | ||
| 162 | * | ||
| 163 | * Regular workitems can be invoked concurrently for the same concurrent queue, | ||
| 164 | * in any order. However, regular workitems will not be invoked before any | ||
| 165 | * barrier workitem submited ahead of them has been invoked. | ||
| 166 | * | ||
| 167 | * In other words, if a serial queue is equivalent to a mutex in the Dispatch | ||
| 168 | * world, a concurrent queue is equivalent to a reader-writer lock, where | ||
| 169 | * regular items are readers and barriers are writers. | ||
| 170 | * | ||
| 171 | * Concurrent queues are created by passing a dispatch queue attribute derived | ||
| 172 | * from DISPATCH_QUEUE_CONCURRENT to dispatch_queue_create_with_target(). | ||
| 173 | * | ||
| 174 | * Caveat: | ||
| 175 | * Dispatch concurrent queues at this time do not implement priority inversion | ||
| 176 | * avoidance when lower priority regular workitems (readers) are being invoked | ||
| 177 | * and are preventing a higher priority barrier (writer) from being invoked. | ||
| 178 | */ | ||
| 179 | DISPATCH_DECL_SUBCLASS(dispatch_queue_concurrent, dispatch_queue); | ||
| 180 | |||
| 181 | __BEGIN_DECLS | ||
| 182 | |||
| 183 | /*! | ||
| 184 | * @function dispatch_async | ||
| 185 | * | ||
| 186 | * @abstract | ||
| 187 | * Submits a block for asynchronous execution on a dispatch queue. | ||
| 188 | * | ||
| 189 | * @discussion | ||
| 190 | * The dispatch_async() function is the fundamental mechanism for submitting | ||
| 191 | * blocks to a dispatch queue. | ||
| 192 | * | ||
| 193 | * Calls to dispatch_async() always return immediately after the block has | ||
| 194 | * been submitted, and never wait for the block to be invoked. | ||
| 195 | * | ||
| 196 | * The target queue determines whether the block will be invoked serially or | ||
| 197 | * concurrently with respect to other blocks submitted to that same queue. | ||
| 198 | * Serial queues are processed concurrently with respect to each other. | ||
| 199 | * | ||
| 200 | * @param queue | ||
| 201 | * The target dispatch queue to which the block is submitted. | ||
| 202 | * The system will hold a reference on the target queue until the block | ||
| 203 | * has finished. | ||
| 204 | * The result of passing NULL in this parameter is undefined. | ||
| 205 | * | ||
| 206 | * @param block | ||
| 207 | * The block to submit to the target dispatch queue. This function performs | ||
| 208 | * Block_copy() and Block_release() on behalf of callers. | ||
| 209 | * The result of passing NULL in this parameter is undefined. | ||
| 210 | */ | ||
| 211 | #ifdef __BLOCKS__ | ||
| 212 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 213 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 214 | void | ||
| 215 | dispatch_async(dispatch_queue_t queue, dispatch_block_t block); | ||
| 216 | #endif | ||
| 217 | |||
| 218 | /*! | ||
| 219 | * @function dispatch_async_f | ||
| 220 | * | ||
| 221 | * @abstract | ||
| 222 | * Submits a function for asynchronous execution on a dispatch queue. | ||
| 223 | * | ||
| 224 | * @discussion | ||
| 225 | * See dispatch_async() for details. | ||
| 226 | * | ||
| 227 | * @param queue | ||
| 228 | * The target dispatch queue to which the function is submitted. | ||
| 229 | * The system will hold a reference on the target queue until the function | ||
| 230 | * has returned. | ||
| 231 | * The result of passing NULL in this parameter is undefined. | ||
| 232 | * | ||
| 233 | * @param context | ||
| 234 | * The application-defined context parameter to pass to the function. | ||
| 235 | * | ||
| 236 | * @param work | ||
| 237 | * The application-defined function to invoke on the target queue. The first | ||
| 238 | * parameter passed to this function is the context provided to | ||
| 239 | * dispatch_async_f(). | ||
| 240 | * The result of passing NULL in this parameter is undefined. | ||
| 241 | */ | ||
| 242 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 243 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 244 | void | ||
| 245 | dispatch_async_f(dispatch_queue_t queue, | ||
| 246 | 		void *_Nullable context, dispatch_function_t work); | ||
| 247 | |||
| 248 | /*! | ||
| 249 | * @function dispatch_sync | ||
| 250 | * | ||
| 251 | * @abstract | ||
| 252 | * Submits a block for synchronous execution on a dispatch queue. | ||
| 253 | * | ||
| 254 | * @discussion | ||
| 255 | * Submits a workitem to a dispatch queue like dispatch_async(), however | ||
| 256 | * dispatch_sync() will not return until the workitem has finished. | ||
| 257 | * | ||
| 258 | * Work items submitted to a queue with dispatch_sync() do not observe certain | ||
| 259 | * queue attributes of that queue when invoked (such as autorelease frequency | ||
| 260 | * and QOS class). | ||
| 261 | * | ||
| 262 | * Calls to dispatch_sync() targeting the current queue will result | ||
| 263 | * in dead-lock. Use of dispatch_sync() is also subject to the same | ||
| 264 | * multi-party dead-lock problems that may result from the use of a mutex. | ||
| 265 | * Use of dispatch_async() is preferred. | ||
| 266 | * | ||
| 267 | * Unlike dispatch_async(), no retain is performed on the target queue. Because | ||
| 268 | * calls to this function are synchronous, the dispatch_sync() "borrows" the | ||
| 269 | * reference of the caller. | ||
| 270 | * | ||
| 271 | * As an optimization, dispatch_sync() invokes the workitem on the thread which | ||
| 272 | * submitted the workitem, except when the passed queue is the main queue or | ||
| 273 | * a queue targetting it (See dispatch_queue_main_t, | ||
| 274 | * dispatch_set_target_queue()). | ||
| 275 | * | ||
| 276 | * @param queue | ||
| 277 | * The target dispatch queue to which the block is submitted. | ||
| 278 | * The result of passing NULL in this parameter is undefined. | ||
| 279 | * | ||
| 280 | * @param block | ||
| 281 | * The block to be invoked on the target dispatch queue. | ||
| 282 | * The result of passing NULL in this parameter is undefined. | ||
| 283 | */ | ||
| 284 | #ifdef __BLOCKS__ | ||
| 285 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 286 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 287 | void | ||
| 288 | dispatch_sync(dispatch_queue_t queue, DISPATCH_NOESCAPE dispatch_block_t block); | ||
| 289 | #endif | ||
| 290 | |||
| 291 | /*! | ||
| 292 | * @function dispatch_sync_f | ||
| 293 | * | ||
| 294 | * @abstract | ||
| 295 | * Submits a function for synchronous execution on a dispatch queue. | ||
| 296 | * | ||
| 297 | * @discussion | ||
| 298 | * See dispatch_sync() for details. | ||
| 299 | * | ||
| 300 | * @param queue | ||
| 301 | * The target dispatch queue to which the function is submitted. | ||
| 302 | * The result of passing NULL in this parameter is undefined. | ||
| 303 | * | ||
| 304 | * @param context | ||
| 305 | * The application-defined context parameter to pass to the function. | ||
| 306 | * | ||
| 307 | * @param work | ||
| 308 | * The application-defined function to invoke on the target queue. The first | ||
| 309 | * parameter passed to this function is the context provided to | ||
| 310 | * dispatch_sync_f(). | ||
| 311 | * The result of passing NULL in this parameter is undefined. | ||
| 312 | */ | ||
| 313 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 314 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 315 | void | ||
| 316 | dispatch_sync_f(dispatch_queue_t queue, | ||
| 317 | 		void *_Nullable context, dispatch_function_t work); | ||
| 318 | |||
| 319 | /*! | ||
| 320 | * @function dispatch_async_and_wait | ||
| 321 | * | ||
| 322 | * @abstract | ||
| 323 | * Submits a block for synchronous execution on a dispatch queue. | ||
| 324 | * | ||
| 325 | * @discussion | ||
| 326 | * Submits a workitem to a dispatch queue like dispatch_async(), however | ||
| 327 | * dispatch_async_and_wait() will not return until the workitem has finished. | ||
| 328 | * | ||
| 329 | * Like functions of the dispatch_sync family, dispatch_async_and_wait() is | ||
| 330 | * subject to dead-lock (See dispatch_sync() for details). | ||
| 331 | * | ||
| 332 | * However, dispatch_async_and_wait() differs from functions of the | ||
| 333 | * dispatch_sync family in two fundamental ways: how it respects queue | ||
| 334 | * attributes and how it chooses the execution context invoking the workitem. | ||
| 335 | * | ||
| 336 | * <b>Differences with dispatch_sync()</b> | ||
| 337 | * | ||
| 338 | * Work items submitted to a queue with dispatch_async_and_wait() observe all | ||
| 339 | * queue attributes of that queue when invoked (inluding autorelease frequency | ||
| 340 | * or QOS class). | ||
| 341 | * | ||
| 342 | * When the runtime has brought up a thread to invoke the asynchronous workitems | ||
| 343 | * already submitted to the specified queue, that servicing thread will also be | ||
| 344 | * used to execute synchronous work submitted to the queue with | ||
| 345 | * dispatch_async_and_wait(). | ||
| 346 | * | ||
| 347 | * However, if the runtime has not brought up a thread to service the specified | ||
| 348 | * queue (because it has no workitems enqueued, or only synchronous workitems), | ||
| 349 | * then dispatch_async_and_wait() will invoke the workitem on the calling thread, | ||
| 350 | * similar to the behaviour of functions in the dispatch_sync family. | ||
| 351 | * | ||
| 352 | * As an exception, if the queue the work is submitted to doesn't target | ||
| 353 | * a global concurrent queue (for example because it targets the main queue), | ||
| 354 | * then the workitem will never be invoked by the thread calling | ||
| 355 | * dispatch_async_and_wait(). | ||
| 356 | * | ||
| 357 | * In other words, dispatch_async_and_wait() is similar to submitting | ||
| 358 | * a dispatch_block_create()d workitem to a queue and then waiting on it, as | ||
| 359 | * shown in the code example below. However, dispatch_async_and_wait() is | ||
| 360 | * significantly more efficient when a new thread is not required to execute | ||
| 361 | * the workitem (as it will use the stack of the submitting thread instead of | ||
| 362 | * requiring heap allocations). | ||
| 363 | * | ||
| 364 | * <code> | ||
| 365 | * dispatch_block_t b = dispatch_block_create(0, block); | ||
| 366 | * dispatch_async(queue, b); | ||
| 367 | * dispatch_block_wait(b, DISPATCH_TIME_FOREVER); | ||
| 368 | * Block_release(b); | ||
| 369 | * </code> | ||
| 370 | * | ||
| 371 | * @param queue | ||
| 372 | * The target dispatch queue to which the block is submitted. | ||
| 373 | * The result of passing NULL in this parameter is undefined. | ||
| 374 | * | ||
| 375 | * @param block | ||
| 376 | * The block to be invoked on the target dispatch queue. | ||
| 377 | * The result of passing NULL in this parameter is undefined. | ||
| 378 | */ | ||
| 379 | #ifdef __BLOCKS__ | ||
| 380 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 381 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 382 | void | ||
| 383 | dispatch_async_and_wait(dispatch_queue_t queue, | ||
| 384 | 		DISPATCH_NOESCAPE dispatch_block_t block); | ||
| 385 | #endif | ||
| 386 | |||
| 387 | /*! | ||
| 388 | * @function dispatch_async_and_wait_f | ||
| 389 | * | ||
| 390 | * @abstract | ||
| 391 | * Submits a function for synchronous execution on a dispatch queue. | ||
| 392 | * | ||
| 393 | * @discussion | ||
| 394 | * See dispatch_async_and_wait() for details. | ||
| 395 | * | ||
| 396 | * @param queue | ||
| 397 | * The target dispatch queue to which the function is submitted. | ||
| 398 | * The result of passing NULL in this parameter is undefined. | ||
| 399 | * | ||
| 400 | * @param context | ||
| 401 | * The application-defined context parameter to pass to the function. | ||
| 402 | * | ||
| 403 | * @param work | ||
| 404 | * The application-defined function to invoke on the target queue. The first | ||
| 405 | * parameter passed to this function is the context provided to | ||
| 406 | * dispatch_async_and_wait_f(). | ||
| 407 | * The result of passing NULL in this parameter is undefined. | ||
| 408 | */ | ||
| 409 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 410 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 411 | void | ||
| 412 | dispatch_async_and_wait_f(dispatch_queue_t queue, | ||
| 413 | 		void *_Nullable context, dispatch_function_t work); | ||
| 414 | |||
| 415 | |||
| 416 | #if defined(__APPLE__) && \ | ||
| 417 | 		(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \ | ||
| 418 | 		__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0) || \ | ||
| 419 | 		(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ | ||
| 420 | 		__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9) | ||
| 421 | #define DISPATCH_APPLY_AUTO_AVAILABLE 0 | ||
| 422 | #define DISPATCH_APPLY_QUEUE_ARG_NULLABILITY _Nonnull | ||
| 423 | #else | ||
| 424 | #define DISPATCH_APPLY_AUTO_AVAILABLE 1 | ||
| 425 | #define DISPATCH_APPLY_QUEUE_ARG_NULLABILITY _Nullable | ||
| 426 | #endif | ||
| 427 | |||
| 428 | /*! | ||
| 429 | * @constant DISPATCH_APPLY_AUTO | ||
| 430 | * | ||
| 431 | * @abstract | ||
| 432 | * Constant to pass to dispatch_apply() or dispatch_apply_f() to request that | ||
| 433 | * the system automatically use worker threads that match the configuration of | ||
| 434 | * the current thread as closely as possible. | ||
| 435 | * | ||
| 436 | * @discussion | ||
| 437 | * When submitting a block for parallel invocation, passing this constant as the | ||
| 438 | * queue argument will automatically use the global concurrent queue that | ||
| 439 | * matches the Quality of Service of the caller most closely. | ||
| 440 | * | ||
| 441 | * No assumptions should be made about which global concurrent queue will | ||
| 442 | * actually be used. | ||
| 443 | * | ||
| 444 | * Using this constant deploys backward to macOS 10.9, iOS 7.0 and any tvOS or | ||
| 445 | * watchOS version. | ||
| 446 | */ | ||
| 447 | #if DISPATCH_APPLY_AUTO_AVAILABLE | ||
| 448 | #define DISPATCH_APPLY_AUTO ((dispatch_queue_t _Nonnull)0) | ||
| 449 | #endif | ||
| 450 | |||
| 451 | /*! | ||
| 452 | * @function dispatch_apply | ||
| 453 | * | ||
| 454 | * @abstract | ||
| 455 | * Submits a block to a dispatch queue for parallel invocation. | ||
| 456 | * | ||
| 457 | * @discussion | ||
| 458 | * Submits a block to a dispatch queue for parallel invocation. This function | ||
| 459 | * waits for the task block to complete before returning. If the specified queue | ||
| 460 | * is concurrent, the block may be invoked concurrently, and it must therefore | ||
| 461 | * be reentrant safe. | ||
| 462 | * | ||
| 463 | * Each invocation of the block will be passed the current index of iteration. | ||
| 464 | * | ||
| 465 | * @param iterations | ||
| 466 | * The number of iterations to perform. | ||
| 467 | * | ||
| 468 | * @param queue | ||
| 469 | * The dispatch queue to which the block is submitted. | ||
| 470 | * The preferred value to pass is DISPATCH_APPLY_AUTO to automatically use | ||
| 471 | * a queue appropriate for the calling thread. | ||
| 472 | * | ||
| 473 | * @param block | ||
| 474 | * The block to be invoked the specified number of iterations. | ||
| 475 | * The result of passing NULL in this parameter is undefined. | ||
| 476 | */ | ||
| 477 | #ifdef __BLOCKS__ | ||
| 478 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 479 | DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 480 | void | ||
| 481 | dispatch_apply(size_t iterations, | ||
| 482 | 		dispatch_queue_t DISPATCH_APPLY_QUEUE_ARG_NULLABILITY queue, | ||
| 483 | 		DISPATCH_NOESCAPE void (^block)(size_t)); | ||
| 484 | #endif | ||
| 485 | |||
| 486 | /*! | ||
| 487 | * @function dispatch_apply_f | ||
| 488 | * | ||
| 489 | * @abstract | ||
| 490 | * Submits a function to a dispatch queue for parallel invocation. | ||
| 491 | * | ||
| 492 | * @discussion | ||
| 493 | * See dispatch_apply() for details. | ||
| 494 | * | ||
| 495 | * @param iterations | ||
| 496 | * The number of iterations to perform. | ||
| 497 | * | ||
| 498 | * @param queue | ||
| 499 | * The dispatch queue to which the function is submitted. | ||
| 500 | * The preferred value to pass is DISPATCH_APPLY_AUTO to automatically use | ||
| 501 | * a queue appropriate for the calling thread. | ||
| 502 | * | ||
| 503 | * @param context | ||
| 504 | * The application-defined context parameter to pass to the function. | ||
| 505 | * | ||
| 506 | * @param work | ||
| 507 | * The application-defined function to invoke on the specified queue. The first | ||
| 508 | * parameter passed to this function is the context provided to | ||
| 509 | * dispatch_apply_f(). The second parameter passed to this function is the | ||
| 510 | * current index of iteration. | ||
| 511 | * The result of passing NULL in this parameter is undefined. | ||
| 512 | */ | ||
| 513 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 514 | DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_NOTHROW | ||
| 515 | void | ||
| 516 | dispatch_apply_f(size_t iterations, | ||
| 517 | 		dispatch_queue_t DISPATCH_APPLY_QUEUE_ARG_NULLABILITY queue, | ||
| 518 | 		void *_Nullable context, void (*work)(void *_Nullable, size_t)); | ||
| 519 | |||
| 520 | /*! | ||
| 521 | * @function dispatch_get_current_queue | ||
| 522 | * | ||
| 523 | * @abstract | ||
| 524 | * Returns the queue on which the currently executing block is running. | ||
| 525 | * | ||
| 526 | * @discussion | ||
| 527 | * Returns the queue on which the currently executing block is running. | ||
| 528 | * | ||
| 529 | * When dispatch_get_current_queue() is called outside of the context of a | ||
| 530 | * submitted block, it will return the default concurrent queue. | ||
| 531 | * | ||
| 532 | * Recommended for debugging and logging purposes only: | ||
| 533 | * The code must not make any assumptions about the queue returned, unless it | ||
| 534 | * is one of the global queues or a queue the code has itself created. | ||
| 535 | * The code must not assume that synchronous execution onto a queue is safe | ||
| 536 | * from deadlock if that queue is not the one returned by | ||
| 537 | * dispatch_get_current_queue(). | ||
| 538 | * | ||
| 539 | * When dispatch_get_current_queue() is called on the main thread, it may | ||
| 540 | * or may not return the same value as dispatch_get_main_queue(). Comparing | ||
| 541 | * the two is not a valid way to test whether code is executing on the | ||
| 542 | * main thread (see dispatch_assert_queue() and dispatch_assert_queue_not()). | ||
| 543 | * | ||
| 544 | * This function is deprecated and will be removed in a future release. | ||
| 545 | * | ||
| 546 | * @result | ||
| 547 | * Returns the current queue. | ||
| 548 | */ | ||
| 549 | API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0)) | ||
| 550 | DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 551 | dispatch_queue_t | ||
| 552 | dispatch_get_current_queue(void); | ||
| 553 | |||
| 554 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 555 | DISPATCH_EXPORT | ||
| 556 | struct dispatch_queue_s _dispatch_main_q; | ||
| 557 | |||
| 558 | /*! | ||
| 559 | * @function dispatch_get_main_queue | ||
| 560 | * | ||
| 561 | * @abstract | ||
| 562 | * Returns the default queue that is bound to the main thread. | ||
| 563 | * | ||
| 564 | * @discussion | ||
| 565 | * In order to invoke blocks submitted to the main queue, the application must | ||
| 566 | * call dispatch_main(), NSApplicationMain(), or use a CFRunLoop on the main | ||
| 567 | * thread. | ||
| 568 | * | ||
| 569 | * The main queue is meant to be used in application context to interact with | ||
| 570 | * the main thread and the main runloop. | ||
| 571 | * | ||
| 572 | * Because the main queue doesn't behave entirely like a regular serial queue, | ||
| 573 | * it may have unwanted side-effects when used in processes that are not UI apps | ||
| 574 | * (daemons). For such processes, the main queue should be avoided. | ||
| 575 | * | ||
| 576 | * @see dispatch_queue_main_t | ||
| 577 | * | ||
| 578 | * @result | ||
| 579 | * Returns the main queue. This queue is created automatically on behalf of | ||
| 580 | * the main thread before main() is called. | ||
| 581 | */ | ||
| 582 | DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_CONST DISPATCH_NOTHROW | ||
| 583 | dispatch_queue_main_t | ||
| 584 | dispatch_get_main_queue(void) | ||
| 585 | { | ||
| 586 | 	return DISPATCH_GLOBAL_OBJECT(dispatch_queue_main_t, _dispatch_main_q); | ||
| 587 | } | ||
| 588 | |||
| 589 | /*! | ||
| 590 | * @typedef dispatch_queue_priority_t | ||
| 591 | * Type of dispatch_queue_priority | ||
| 592 | * | ||
| 593 | * @constant DISPATCH_QUEUE_PRIORITY_HIGH | ||
| 594 | * Items dispatched to the queue will run at high priority, | ||
| 595 | * i.e. the queue will be scheduled for execution before | ||
| 596 | * any default priority or low priority queue. | ||
| 597 | * | ||
| 598 | * @constant DISPATCH_QUEUE_PRIORITY_DEFAULT | ||
| 599 | * Items dispatched to the queue will run at the default | ||
| 600 | * priority, i.e. the queue will be scheduled for execution | ||
| 601 | * after all high priority queues have been scheduled, but | ||
| 602 | * before any low priority queues have been scheduled. | ||
| 603 | * | ||
| 604 | * @constant DISPATCH_QUEUE_PRIORITY_LOW | ||
| 605 | * Items dispatched to the queue will run at low priority, | ||
| 606 | * i.e. the queue will be scheduled for execution after all | ||
| 607 | * default priority and high priority queues have been | ||
| 608 | * scheduled. | ||
| 609 | * | ||
| 610 | * @constant DISPATCH_QUEUE_PRIORITY_BACKGROUND | ||
| 611 | * Items dispatched to the queue will run at background priority, i.e. the queue | ||
| 612 | * will be scheduled for execution after all higher priority queues have been | ||
| 613 | * scheduled and the system will run items on this queue on a thread with | ||
| 614 | * background status as per setpriority(2) (i.e. disk I/O is throttled and the | ||
| 615 | * thread's scheduling priority is set to lowest value). | ||
| 616 | */ | ||
| 617 | #define DISPATCH_QUEUE_PRIORITY_HIGH 2 | ||
| 618 | #define DISPATCH_QUEUE_PRIORITY_DEFAULT 0 | ||
| 619 | #define DISPATCH_QUEUE_PRIORITY_LOW (-2) | ||
| 620 | #define DISPATCH_QUEUE_PRIORITY_BACKGROUND INT16_MIN | ||
| 621 | |||
| 622 | typedef long dispatch_queue_priority_t; | ||
| 623 | |||
| 624 | /*! | ||
| 625 | * @function dispatch_get_global_queue | ||
| 626 | * | ||
| 627 | * @abstract | ||
| 628 | * Returns a well-known global concurrent queue of a given quality of service | ||
| 629 | * class. | ||
| 630 | * | ||
| 631 | * @discussion | ||
| 632 | * See dispatch_queue_global_t. | ||
| 633 | * | ||
| 634 | * @param identifier | ||
| 635 | * A quality of service class defined in qos_class_t or a priority defined in | ||
| 636 | * dispatch_queue_priority_t. | ||
| 637 | * | ||
| 638 | * It is recommended to use quality of service class values to identify the | ||
| 639 | * well-known global concurrent queues: | ||
| 640 | * - QOS_CLASS_USER_INTERACTIVE | ||
| 641 | * - QOS_CLASS_USER_INITIATED | ||
| 642 | * - QOS_CLASS_DEFAULT | ||
| 643 | * - QOS_CLASS_UTILITY | ||
| 644 | * - QOS_CLASS_BACKGROUND | ||
| 645 | * | ||
| 646 | * The global concurrent queues may still be identified by their priority, | ||
| 647 | * which map to the following QOS classes: | ||
| 648 | * - DISPATCH_QUEUE_PRIORITY_HIGH: QOS_CLASS_USER_INITIATED | ||
| 649 | * - DISPATCH_QUEUE_PRIORITY_DEFAULT: QOS_CLASS_DEFAULT | ||
| 650 | * - DISPATCH_QUEUE_PRIORITY_LOW: QOS_CLASS_UTILITY | ||
| 651 | * - DISPATCH_QUEUE_PRIORITY_BACKGROUND: QOS_CLASS_BACKGROUND | ||
| 652 | * | ||
| 653 | * @param flags | ||
| 654 | * Reserved for future use. Passing any value other than zero may result in | ||
| 655 | * a NULL return value. | ||
| 656 | * | ||
| 657 | * @result | ||
| 658 | * Returns the requested global queue or NULL if the requested global queue | ||
| 659 | * does not exist. | ||
| 660 | */ | ||
| 661 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 662 | DISPATCH_EXPORT DISPATCH_CONST DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 663 | dispatch_queue_global_t | ||
| 664 | dispatch_get_global_queue(intptr_t identifier, uintptr_t flags); | ||
| 665 | |||
| 666 | /*! | ||
| 667 | * @typedef dispatch_queue_attr_t | ||
| 668 | * | ||
| 669 | * @abstract | ||
| 670 | * Attribute for dispatch queues. | ||
| 671 | */ | ||
| 672 | DISPATCH_DECL(dispatch_queue_attr); | ||
| 673 | |||
| 674 | /*! | ||
| 675 | * @const DISPATCH_QUEUE_SERIAL | ||
| 676 | * | ||
| 677 | * @discussion | ||
| 678 | * An attribute that can be used to create a dispatch queue that invokes blocks | ||
| 679 | * serially in FIFO order. | ||
| 680 | * | ||
| 681 | * See dispatch_queue_serial_t. | ||
| 682 | */ | ||
| 683 | #define DISPATCH_QUEUE_SERIAL NULL | ||
| 684 | |||
| 685 | /*! | ||
| 686 | * @const DISPATCH_QUEUE_SERIAL_INACTIVE | ||
| 687 | * | ||
| 688 | * @discussion | ||
| 689 | * An attribute that can be used to create a dispatch queue that invokes blocks | ||
| 690 | * serially in FIFO order, and that is initially inactive. | ||
| 691 | * | ||
| 692 | * See dispatch_queue_attr_make_initially_inactive(). | ||
| 693 | */ | ||
| 694 | #define DISPATCH_QUEUE_SERIAL_INACTIVE \ | ||
| 695 | 		dispatch_queue_attr_make_initially_inactive(DISPATCH_QUEUE_SERIAL) | ||
| 696 | |||
| 697 | /*! | ||
| 698 | * @const DISPATCH_QUEUE_CONCURRENT | ||
| 699 | * | ||
| 700 | * @discussion | ||
| 701 | * An attribute that can be used to create a dispatch queue that may invoke | ||
| 702 | * blocks concurrently and supports barrier blocks submitted with the dispatch | ||
| 703 | * barrier API. | ||
| 704 | * | ||
| 705 | * See dispatch_queue_concurrent_t. | ||
| 706 | */ | ||
| 707 | #define DISPATCH_QUEUE_CONCURRENT \ | ||
| 708 | 		DISPATCH_GLOBAL_OBJECT(dispatch_queue_attr_t, \ | ||
| 709 | 		_dispatch_queue_attr_concurrent) | ||
| 710 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 711 | DISPATCH_EXPORT | ||
| 712 | struct dispatch_queue_attr_s _dispatch_queue_attr_concurrent; | ||
| 713 | |||
| 714 | /*! | ||
| 715 | * @const DISPATCH_QUEUE_CONCURRENT_INACTIVE | ||
| 716 | * | ||
| 717 | * @discussion | ||
| 718 | * An attribute that can be used to create a dispatch queue that may invoke | ||
| 719 | * blocks concurrently and supports barrier blocks submitted with the dispatch | ||
| 720 | * barrier API, and that is initially inactive. | ||
| 721 | * | ||
| 722 | * See dispatch_queue_attr_make_initially_inactive(). | ||
| 723 | */ | ||
| 724 | #define DISPATCH_QUEUE_CONCURRENT_INACTIVE \ | ||
| 725 | 		dispatch_queue_attr_make_initially_inactive(DISPATCH_QUEUE_CONCURRENT) | ||
| 726 | |||
| 727 | /*! | ||
| 728 | * @function dispatch_queue_attr_make_initially_inactive | ||
| 729 | * | ||
| 730 | * @abstract | ||
| 731 | * Returns an attribute value which may be provided to dispatch_queue_create() | ||
| 732 | * or dispatch_queue_create_with_target(), in order to make the created queue | ||
| 733 | * initially inactive. | ||
| 734 | * | ||
| 735 | * @discussion | ||
| 736 | * Dispatch queues may be created in an inactive state. Queues in this state | ||
| 737 | * have to be activated before any blocks associated with them will be invoked. | ||
| 738 | * | ||
| 739 | * A queue in inactive state cannot be deallocated, dispatch_activate() must be | ||
| 740 | * called before the last reference to a queue created with this attribute is | ||
| 741 | * released. | ||
| 742 | * | ||
| 743 | * The target queue of a queue in inactive state can be changed using | ||
| 744 | * dispatch_set_target_queue(). Change of target queue is no longer permitted | ||
| 745 | * once an initially inactive queue has been activated. | ||
| 746 | * | ||
| 747 | * @param attr | ||
| 748 | * A queue attribute value to be combined with the initially inactive attribute. | ||
| 749 | * | ||
| 750 | * @return | ||
| 751 | * Returns an attribute value which may be provided to dispatch_queue_create() | ||
| 752 | * and dispatch_queue_create_with_target(). | ||
| 753 | * The new value combines the attributes specified by the 'attr' parameter with | ||
| 754 | * the initially inactive attribute. | ||
| 755 | */ | ||
| 756 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 757 | DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW | ||
| 758 | dispatch_queue_attr_t | ||
| 759 | dispatch_queue_attr_make_initially_inactive( | ||
| 760 | 		dispatch_queue_attr_t _Nullable attr); | ||
| 761 | |||
| 762 | /*! | ||
| 763 | * @const DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL | ||
| 764 | * | ||
| 765 | * @discussion | ||
| 766 | * A dispatch queue created with this attribute invokes blocks serially in FIFO | ||
| 767 | * order, and surrounds execution of any block submitted asynchronously to it | ||
| 768 | * with the equivalent of a individual Objective-C <code>@autoreleasepool</code> | ||
| 769 | * scope. | ||
| 770 | * | ||
| 771 | * See dispatch_queue_attr_make_with_autorelease_frequency(). | ||
| 772 | */ | ||
| 773 | #define DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL \ | ||
| 774 | 		dispatch_queue_attr_make_with_autorelease_frequency(\ | ||
| 775 | 				DISPATCH_QUEUE_SERIAL, DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM) | ||
| 776 | |||
| 777 | /*! | ||
| 778 | * @const DISPATCH_QUEUE_CONCURRENT_WITH_AUTORELEASE_POOL | ||
| 779 | * | ||
| 780 | * @discussion | ||
| 781 | * A dispatch queue created with this attribute may invokes blocks concurrently | ||
| 782 | * and supports barrier blocks submitted with the dispatch barrier API. It also | ||
| 783 | * surrounds execution of any block submitted asynchronously to it with the | ||
| 784 | * equivalent of a individual Objective-C <code>@autoreleasepool</code> | ||
| 785 | * | ||
| 786 | * See dispatch_queue_attr_make_with_autorelease_frequency(). | ||
| 787 | */ | ||
| 788 | #define DISPATCH_QUEUE_CONCURRENT_WITH_AUTORELEASE_POOL \ | ||
| 789 | 		dispatch_queue_attr_make_with_autorelease_frequency(\ | ||
| 790 | 				DISPATCH_QUEUE_CONCURRENT, DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM) | ||
| 791 | |||
| 792 | /*! | ||
| 793 | * @typedef dispatch_autorelease_frequency_t | ||
| 794 | * Values to pass to the dispatch_queue_attr_make_with_autorelease_frequency() | ||
| 795 | * function. | ||
| 796 | * | ||
| 797 | * @const DISPATCH_AUTORELEASE_FREQUENCY_INHERIT | ||
| 798 | * Dispatch queues with this autorelease frequency inherit the behavior from | ||
| 799 | * their target queue. This is the default behavior for manually created queues. | ||
| 800 | * | ||
| 801 | * @const DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM | ||
| 802 | * Dispatch queues with this autorelease frequency push and pop an autorelease | ||
| 803 | * pool around the execution of every block that was submitted to it | ||
| 804 | * asynchronously. | ||
| 805 | * @see dispatch_queue_attr_make_with_autorelease_frequency(). | ||
| 806 | * | ||
| 807 | * @const DISPATCH_AUTORELEASE_FREQUENCY_NEVER | ||
| 808 | * Dispatch queues with this autorelease frequency never set up an individual | ||
| 809 | * autorelease pool around the execution of a block that is submitted to it | ||
| 810 | * asynchronously. This is the behavior of the global concurrent queues. | ||
| 811 | */ | ||
| 812 | DISPATCH_ENUM(dispatch_autorelease_frequency, unsigned long, | ||
| 813 | 	DISPATCH_AUTORELEASE_FREQUENCY_INHERIT DISPATCH_ENUM_API_AVAILABLE( | ||
| 814 | 			macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 0, | ||
| 815 | 	DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM DISPATCH_ENUM_API_AVAILABLE( | ||
| 816 | 			macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 1, | ||
| 817 | 	DISPATCH_AUTORELEASE_FREQUENCY_NEVER DISPATCH_ENUM_API_AVAILABLE( | ||
| 818 | 			macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 2, | ||
| 819 | ); | ||
| 820 | |||
| 821 | /*! | ||
| 822 | * @function dispatch_queue_attr_make_with_autorelease_frequency | ||
| 823 | * | ||
| 824 | * @abstract | ||
| 825 | * Returns a dispatch queue attribute value with the autorelease frequency | ||
| 826 | * set to the specified value. | ||
| 827 | * | ||
| 828 | * @discussion | ||
| 829 | * When a queue uses the per-workitem autorelease frequency (either directly | ||
| 830 | * or inherithed from its target queue), any block submitted asynchronously to | ||
| 831 | * this queue (via dispatch_async(), dispatch_barrier_async(), | ||
| 832 | * dispatch_group_notify(), etc...) is executed as if surrounded by a individual | ||
| 833 | * Objective-C <code>@autoreleasepool</code> scope. | ||
| 834 | * | ||
| 835 | * Autorelease frequency has no effect on blocks that are submitted | ||
| 836 | * synchronously to a queue (via dispatch_sync(), dispatch_barrier_sync()). | ||
| 837 | * | ||
| 838 | * The global concurrent queues have the DISPATCH_AUTORELEASE_FREQUENCY_NEVER | ||
| 839 | * behavior. Manually created dispatch queues use | ||
| 840 | * DISPATCH_AUTORELEASE_FREQUENCY_INHERIT by default. | ||
| 841 | * | ||
| 842 | * Queues created with this attribute cannot change target queues after having | ||
| 843 | * been activated. See dispatch_set_target_queue() and dispatch_activate(). | ||
| 844 | * | ||
| 845 | * @param attr | ||
| 846 | * A queue attribute value to be combined with the specified autorelease | ||
| 847 | * frequency or NULL. | ||
| 848 | * | ||
| 849 | * @param frequency | ||
| 850 | * The requested autorelease frequency. | ||
| 851 | * | ||
| 852 | * @return | ||
| 853 | * Returns an attribute value which may be provided to dispatch_queue_create() | ||
| 854 | * or NULL if an invalid autorelease frequency was requested. | ||
| 855 | * This new value combines the attributes specified by the 'attr' parameter and | ||
| 856 | * the chosen autorelease frequency. | ||
| 857 | */ | ||
| 858 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 859 | DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW | ||
| 860 | dispatch_queue_attr_t | ||
| 861 | dispatch_queue_attr_make_with_autorelease_frequency( | ||
| 862 | 		dispatch_queue_attr_t _Nullable attr, | ||
| 863 | 		dispatch_autorelease_frequency_t frequency); | ||
| 864 | |||
| 865 | /*! | ||
| 866 | * @function dispatch_queue_attr_make_with_qos_class | ||
| 867 | * | ||
| 868 | * @abstract | ||
| 869 | * Returns an attribute value which may be provided to dispatch_queue_create() | ||
| 870 | * or dispatch_queue_create_with_target(), in order to assign a QOS class and | ||
| 871 | * relative priority to the queue. | ||
| 872 | * | ||
| 873 | * @discussion | ||
| 874 | * When specified in this manner, the QOS class and relative priority take | ||
| 875 | * precedence over those inherited from the dispatch queue's target queue (if | ||
| 876 | * any) as long that does not result in a lower QOS class and relative priority. | ||
| 877 | * | ||
| 878 | * The global queue priorities map to the following QOS classes: | ||
| 879 | * - DISPATCH_QUEUE_PRIORITY_HIGH: QOS_CLASS_USER_INITIATED | ||
| 880 | * - DISPATCH_QUEUE_PRIORITY_DEFAULT: QOS_CLASS_DEFAULT | ||
| 881 | * - DISPATCH_QUEUE_PRIORITY_LOW: QOS_CLASS_UTILITY | ||
| 882 | * - DISPATCH_QUEUE_PRIORITY_BACKGROUND: QOS_CLASS_BACKGROUND | ||
| 883 | * | ||
| 884 | * Example: | ||
| 885 | * <code> | ||
| 886 | *	dispatch_queue_t queue; | ||
| 887 | *	dispatch_queue_attr_t attr; | ||
| 888 | *	attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, | ||
| 889 | *			QOS_CLASS_UTILITY, 0); | ||
| 890 | *	queue = dispatch_queue_create("com.example.myqueue", attr); | ||
| 891 | * </code> | ||
| 892 | * | ||
| 893 | * The QOS class and relative priority set this way on a queue have no effect on | ||
| 894 | * blocks that are submitted synchronously to a queue (via dispatch_sync(), | ||
| 895 | * dispatch_barrier_sync()). | ||
| 896 | * | ||
| 897 | * @param attr | ||
| 898 | * A queue attribute value to be combined with the QOS class, or NULL. | ||
| 899 | * | ||
| 900 | * @param qos_class | ||
| 901 | * A QOS class value: | ||
| 902 | * - QOS_CLASS_USER_INTERACTIVE | ||
| 903 | * - QOS_CLASS_USER_INITIATED | ||
| 904 | * - QOS_CLASS_DEFAULT | ||
| 905 | * - QOS_CLASS_UTILITY | ||
| 906 | * - QOS_CLASS_BACKGROUND | ||
| 907 | * Passing any other value results in NULL being returned. | ||
| 908 | * | ||
| 909 | * @param relative_priority | ||
| 910 | * A relative priority within the QOS class. This value is a negative | ||
| 911 | * offset from the maximum supported scheduler priority for the given class. | ||
| 912 | * Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY | ||
| 913 | * results in NULL being returned. | ||
| 914 | * | ||
| 915 | * @return | ||
| 916 | * Returns an attribute value which may be provided to dispatch_queue_create() | ||
| 917 | * and dispatch_queue_create_with_target(), or NULL if an invalid QOS class was | ||
| 918 | * requested. | ||
| 919 | * The new value combines the attributes specified by the 'attr' parameter and | ||
| 920 | * the new QOS class and relative priority. | ||
| 921 | */ | ||
| 922 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 923 | DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW | ||
| 924 | dispatch_queue_attr_t | ||
| 925 | dispatch_queue_attr_make_with_qos_class(dispatch_queue_attr_t _Nullable attr, | ||
| 926 | 		dispatch_qos_class_t qos_class, int relative_priority); | ||
| 927 | |||
| 928 | /*! | ||
| 929 | * @const DISPATCH_TARGET_QUEUE_DEFAULT | ||
| 930 | * @discussion Constant to pass to the dispatch_queue_create_with_target(), | ||
| 931 | * dispatch_set_target_queue() and dispatch_source_create() functions to | ||
| 932 | * indicate that the default target queue for the object type in question | ||
| 933 | * should be used. | ||
| 934 | */ | ||
| 935 | #define DISPATCH_TARGET_QUEUE_DEFAULT NULL | ||
| 936 | |||
| 937 | /*! | ||
| 938 | * @function dispatch_queue_create_with_target | ||
| 939 | * | ||
| 940 | * @abstract | ||
| 941 | * Creates a new dispatch queue with a specified target queue. | ||
| 942 | * | ||
| 943 | * @discussion | ||
| 944 | * Dispatch queues created with the DISPATCH_QUEUE_SERIAL or a NULL attribute | ||
| 945 | * invoke blocks serially in FIFO order. | ||
| 946 | * | ||
| 947 | * Dispatch queues created with the DISPATCH_QUEUE_CONCURRENT attribute may | ||
| 948 | * invoke blocks concurrently (similarly to the global concurrent queues, but | ||
| 949 | * potentially with more overhead), and support barrier blocks submitted with | ||
| 950 | * the dispatch barrier API, which e.g. enables the implementation of efficient | ||
| 951 | * reader-writer schemes. | ||
| 952 | * | ||
| 953 | * When a dispatch queue is no longer needed, it should be released with | ||
| 954 | * dispatch_release(). Note that any pending blocks submitted asynchronously to | ||
| 955 | * a queue will hold a reference to that queue. Therefore a queue will not be | ||
| 956 | * deallocated until all pending blocks have finished. | ||
| 957 | * | ||
| 958 | * When using a dispatch queue attribute @a attr specifying a QoS class (derived | ||
| 959 | * from the result of dispatch_queue_attr_make_with_qos_class()), passing the | ||
| 960 | * result of dispatch_get_global_queue() in @a target will ignore the QoS class | ||
| 961 | * of that global queue and will use the global queue with the QoS class | ||
| 962 | * specified by attr instead. | ||
| 963 | * | ||
| 964 | * Queues created with dispatch_queue_create_with_target() cannot have their | ||
| 965 | * target queue changed, unless created inactive (See | ||
| 966 | * dispatch_queue_attr_make_initially_inactive()), in which case the target | ||
| 967 | * queue can be changed until the newly created queue is activated with | ||
| 968 | * dispatch_activate(). | ||
| 969 | * | ||
| 970 | * @param label | ||
| 971 | * A string label to attach to the queue. | ||
| 972 | * This parameter is optional and may be NULL. | ||
| 973 | * | ||
| 974 | * @param attr | ||
| 975 | * A predefined attribute such as DISPATCH_QUEUE_SERIAL, | ||
| 976 | * DISPATCH_QUEUE_CONCURRENT, or the result of a call to | ||
| 977 | * a dispatch_queue_attr_make_with_* function. | ||
| 978 | * | ||
| 979 | * @param target | ||
| 980 | * The target queue for the newly created queue. The target queue is retained. | ||
| 981 | * If this parameter is DISPATCH_TARGET_QUEUE_DEFAULT, sets the queue's target | ||
| 982 | * queue to the default target queue for the given queue type. | ||
| 983 | * | ||
| 984 | * @result | ||
| 985 | * The newly created dispatch queue. | ||
| 986 | */ | ||
| 987 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 988 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 989 | DISPATCH_NOTHROW | ||
| 990 | dispatch_queue_t | ||
| 991 | dispatch_queue_create_with_target(const char *_Nullable label, | ||
| 992 | 		dispatch_queue_attr_t _Nullable attr, dispatch_queue_t _Nullable target) | ||
| 993 | 		DISPATCH_ALIAS_V2(dispatch_queue_create_with_target); | ||
| 994 | |||
| 995 | /*! | ||
| 996 | * @function dispatch_queue_create | ||
| 997 | * | ||
| 998 | * @abstract | ||
| 999 | * Creates a new dispatch queue to which blocks may be submitted. | ||
| 1000 | * | ||
| 1001 | * @discussion | ||
| 1002 | * Dispatch queues created with the DISPATCH_QUEUE_SERIAL or a NULL attribute | ||
| 1003 | * invoke blocks serially in FIFO order. | ||
| 1004 | * | ||
| 1005 | * Dispatch queues created with the DISPATCH_QUEUE_CONCURRENT attribute may | ||
| 1006 | * invoke blocks concurrently (similarly to the global concurrent queues, but | ||
| 1007 | * potentially with more overhead), and support barrier blocks submitted with | ||
| 1008 | * the dispatch barrier API, which e.g. enables the implementation of efficient | ||
| 1009 | * reader-writer schemes. | ||
| 1010 | * | ||
| 1011 | * When a dispatch queue is no longer needed, it should be released with | ||
| 1012 | * dispatch_release(). Note that any pending blocks submitted asynchronously to | ||
| 1013 | * a queue will hold a reference to that queue. Therefore a queue will not be | ||
| 1014 | * deallocated until all pending blocks have finished. | ||
| 1015 | * | ||
| 1016 | * Passing the result of the dispatch_queue_attr_make_with_qos_class() function | ||
| 1017 | * to the attr parameter of this function allows a quality of service class and | ||
| 1018 | * relative priority to be specified for the newly created queue. | ||
| 1019 | * The quality of service class so specified takes precedence over the quality | ||
| 1020 | * of service class of the newly created dispatch queue's target queue (if any) | ||
| 1021 | * as long that does not result in a lower QOS class and relative priority. | ||
| 1022 | * | ||
| 1023 | * When no quality of service class is specified, the target queue of a newly | ||
| 1024 | * created dispatch queue is the default priority global concurrent queue. | ||
| 1025 | * | ||
| 1026 | * @param label | ||
| 1027 | * A string label to attach to the queue. | ||
| 1028 | * This parameter is optional and may be NULL. | ||
| 1029 | * | ||
| 1030 | * @param attr | ||
| 1031 | * A predefined attribute such as DISPATCH_QUEUE_SERIAL, | ||
| 1032 | * DISPATCH_QUEUE_CONCURRENT, or the result of a call to | ||
| 1033 | * a dispatch_queue_attr_make_with_* function. | ||
| 1034 | * | ||
| 1035 | * @result | ||
| 1036 | * The newly created dispatch queue. | ||
| 1037 | */ | ||
| 1038 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 1039 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 1040 | DISPATCH_NOTHROW | ||
| 1041 | dispatch_queue_t | ||
| 1042 | dispatch_queue_create(const char *_Nullable label, | ||
| 1043 | 		dispatch_queue_attr_t _Nullable attr); | ||
| 1044 | |||
| 1045 | /*! | ||
| 1046 | * @const DISPATCH_CURRENT_QUEUE_LABEL | ||
| 1047 | * @discussion Constant to pass to the dispatch_queue_get_label() function to | ||
| 1048 | * retrieve the label of the current queue. | ||
| 1049 | */ | ||
| 1050 | #define DISPATCH_CURRENT_QUEUE_LABEL NULL | ||
| 1051 | |||
| 1052 | /*! | ||
| 1053 | * @function dispatch_queue_get_label | ||
| 1054 | * | ||
| 1055 | * @abstract | ||
| 1056 | * Returns the label of the given queue, as specified when the queue was | ||
| 1057 | * created, or the empty string if a NULL label was specified. | ||
| 1058 | * | ||
| 1059 | * Passing DISPATCH_CURRENT_QUEUE_LABEL will return the label of the current | ||
| 1060 | * queue. | ||
| 1061 | * | ||
| 1062 | * @param queue | ||
| 1063 | * The queue to query, or DISPATCH_CURRENT_QUEUE_LABEL. | ||
| 1064 | * | ||
| 1065 | * @result | ||
| 1066 | * The label of the queue. | ||
| 1067 | */ | ||
| 1068 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 1069 | DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 1070 | const char * | ||
| 1071 | dispatch_queue_get_label(dispatch_queue_t _Nullable queue); | ||
| 1072 | |||
| 1073 | /*! | ||
| 1074 | * @function dispatch_queue_get_qos_class | ||
| 1075 | * | ||
| 1076 | * @abstract | ||
| 1077 | * Returns the QOS class and relative priority of the given queue. | ||
| 1078 | * | ||
| 1079 | * @discussion | ||
| 1080 | * If the given queue was created with an attribute value returned from | ||
| 1081 | * dispatch_queue_attr_make_with_qos_class(), this function returns the QOS | ||
| 1082 | * class and relative priority specified at that time; for any other attribute | ||
| 1083 | * value it returns a QOS class of QOS_CLASS_UNSPECIFIED and a relative | ||
| 1084 | * priority of 0. | ||
| 1085 | * | ||
| 1086 | * If the given queue is one of the global queues, this function returns its | ||
| 1087 | * assigned QOS class value as documented under dispatch_get_global_queue() and | ||
| 1088 | * a relative priority of 0; in the case of the main queue it returns the QOS | ||
| 1089 | * value provided by qos_class_main() and a relative priority of 0. | ||
| 1090 | * | ||
| 1091 | * @param queue | ||
| 1092 | * The queue to query. | ||
| 1093 | * | ||
| 1094 | * @param relative_priority_ptr | ||
| 1095 | * A pointer to an int variable to be filled with the relative priority offset | ||
| 1096 | * within the QOS class, or NULL. | ||
| 1097 | * | ||
| 1098 | * @return | ||
| 1099 | * A QOS class value: | ||
| 1100 | *	- QOS_CLASS_USER_INTERACTIVE | ||
| 1101 | *	- QOS_CLASS_USER_INITIATED | ||
| 1102 | *	- QOS_CLASS_DEFAULT | ||
| 1103 | *	- QOS_CLASS_UTILITY | ||
| 1104 | *	- QOS_CLASS_BACKGROUND | ||
| 1105 | *	- QOS_CLASS_UNSPECIFIED | ||
| 1106 | */ | ||
| 1107 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 1108 | DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 1109 | dispatch_qos_class_t | ||
| 1110 | dispatch_queue_get_qos_class(dispatch_queue_t queue, | ||
| 1111 | 		int *_Nullable relative_priority_ptr); | ||
| 1112 | |||
| 1113 | /*! | ||
| 1114 | * @function dispatch_set_target_queue | ||
| 1115 | * | ||
| 1116 | * @abstract | ||
| 1117 | * Sets the target queue for the given object. | ||
| 1118 | * | ||
| 1119 | * @discussion | ||
| 1120 | * An object's target queue is responsible for processing the object. | ||
| 1121 | * | ||
| 1122 | * When no quality of service class and relative priority is specified for a | ||
| 1123 | * dispatch queue at the time of creation, a dispatch queue's quality of service | ||
| 1124 | * class is inherited from its target queue. The dispatch_get_global_queue() | ||
| 1125 | * function may be used to obtain a target queue of a specific quality of | ||
| 1126 | * service class, however the use of dispatch_queue_attr_make_with_qos_class() | ||
| 1127 | * is recommended instead. | ||
| 1128 | * | ||
| 1129 | * Blocks submitted to a serial queue whose target queue is another serial | ||
| 1130 | * queue will not be invoked concurrently with blocks submitted to the target | ||
| 1131 | * queue or to any other queue with that same target queue. | ||
| 1132 | * | ||
| 1133 | * The result of introducing a cycle into the hierarchy of target queues is | ||
| 1134 | * undefined. | ||
| 1135 | * | ||
| 1136 | * A dispatch source's target queue specifies where its event handler and | ||
| 1137 | * cancellation handler blocks will be submitted. | ||
| 1138 | * | ||
| 1139 | * A dispatch I/O channel's target queue specifies where where its I/O | ||
| 1140 | * operations are executed. If the channel's target queue's priority is set to | ||
| 1141 | * DISPATCH_QUEUE_PRIORITY_BACKGROUND, then the I/O operations performed by | ||
| 1142 | * dispatch_io_read() or dispatch_io_write() on that queue will be | ||
| 1143 | * throttled when there is I/O contention. | ||
| 1144 | * | ||
| 1145 | * For all other dispatch object types, the only function of the target queue | ||
| 1146 | * is to determine where an object's finalizer function is invoked. | ||
| 1147 | * | ||
| 1148 | * In general, changing the target queue of an object is an asynchronous | ||
| 1149 | * operation that doesn't take effect immediately, and doesn't affect blocks | ||
| 1150 | * already associated with the specified object. | ||
| 1151 | * | ||
| 1152 | * However, if an object is inactive at the time dispatch_set_target_queue() is | ||
| 1153 | * called, then the target queue change takes effect immediately, and will | ||
| 1154 | * affect blocks already associated with the specified object. After an | ||
| 1155 | * initially inactive object has been activated, calling | ||
| 1156 | * dispatch_set_target_queue() results in an assertion and the process being | ||
| 1157 | * terminated. | ||
| 1158 | * | ||
| 1159 | * If a dispatch queue is active and targeted by other dispatch objects, | ||
| 1160 | * changing its target queue results in undefined behavior. | ||
| 1161 | * | ||
| 1162 | * @param object | ||
| 1163 | * The object to modify. | ||
| 1164 | * The result of passing NULL in this parameter is undefined. | ||
| 1165 | * | ||
| 1166 | * @param queue | ||
| 1167 | * The new target queue for the object. The queue is retained, and the | ||
| 1168 | * previous target queue, if any, is released. | ||
| 1169 | * If queue is DISPATCH_TARGET_QUEUE_DEFAULT, set the object's target queue | ||
| 1170 | * to the default target queue for the given object type. | ||
| 1171 | */ | ||
| 1172 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 1173 | DISPATCH_EXPORT DISPATCH_NOTHROW | ||
| 1174 | void | ||
| 1175 | dispatch_set_target_queue(dispatch_object_t object, | ||
| 1176 | 		dispatch_queue_t _Nullable queue); | ||
| 1177 | |||
| 1178 | /*! | ||
| 1179 | * @function dispatch_main | ||
| 1180 | * | ||
| 1181 | * @abstract | ||
| 1182 | * Execute blocks submitted to the main queue. | ||
| 1183 | * | ||
| 1184 | * @discussion | ||
| 1185 | * This function "parks" the main thread and waits for blocks to be submitted | ||
| 1186 | * to the main queue. This function never returns. | ||
| 1187 | * | ||
| 1188 | * Applications that call NSApplicationMain() or CFRunLoopRun() on the | ||
| 1189 | * main thread do not need to call dispatch_main(). | ||
| 1190 | */ | ||
| 1191 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 1192 | DISPATCH_EXPORT DISPATCH_NOTHROW DISPATCH_NORETURN | ||
| 1193 | void | ||
| 1194 | dispatch_main(void); | ||
| 1195 | |||
| 1196 | /*! | ||
| 1197 | * @function dispatch_after | ||
| 1198 | * | ||
| 1199 | * @abstract | ||
| 1200 | * Schedule a block for execution on a given queue at a specified time. | ||
| 1201 | * | ||
| 1202 | * @discussion | ||
| 1203 | * Passing DISPATCH_TIME_NOW as the "when" parameter is supported, but not as | ||
| 1204 | * optimal as calling dispatch_async() instead. Passing DISPATCH_TIME_FOREVER | ||
| 1205 | * is undefined. | ||
| 1206 | * | ||
| 1207 | * @param when | ||
| 1208 | * A temporal milestone returned by dispatch_time() or dispatch_walltime(). | ||
| 1209 | * | ||
| 1210 | * @param queue | ||
| 1211 | * A queue to which the given block will be submitted at the specified time. | ||
| 1212 | * The result of passing NULL in this parameter is undefined. | ||
| 1213 | * | ||
| 1214 | * @param block | ||
| 1215 | * The block of code to execute. | ||
| 1216 | * The result of passing NULL in this parameter is undefined. | ||
| 1217 | */ | ||
| 1218 | #ifdef __BLOCKS__ | ||
| 1219 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 1220 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 1221 | void | ||
| 1222 | dispatch_after(dispatch_time_t when, dispatch_queue_t queue, | ||
| 1223 | 		dispatch_block_t block); | ||
| 1224 | #endif | ||
| 1225 | |||
| 1226 | /*! | ||
| 1227 | * @function dispatch_after_f | ||
| 1228 | * | ||
| 1229 | * @abstract | ||
| 1230 | * Schedule a function for execution on a given queue at a specified time. | ||
| 1231 | * | ||
| 1232 | * @discussion | ||
| 1233 | * See dispatch_after() for details. | ||
| 1234 | * | ||
| 1235 | * @param when | ||
| 1236 | * A temporal milestone returned by dispatch_time() or dispatch_walltime(). | ||
| 1237 | * | ||
| 1238 | * @param queue | ||
| 1239 | * A queue to which the given function will be submitted at the specified time. | ||
| 1240 | * The result of passing NULL in this parameter is undefined. | ||
| 1241 | * | ||
| 1242 | * @param context | ||
| 1243 | * The application-defined context parameter to pass to the function. | ||
| 1244 | * | ||
| 1245 | * @param work | ||
| 1246 | * The application-defined function to invoke on the target queue. The first | ||
| 1247 | * parameter passed to this function is the context provided to | ||
| 1248 | * dispatch_after_f(). | ||
| 1249 | * The result of passing NULL in this parameter is undefined. | ||
| 1250 | */ | ||
| 1251 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 1252 | DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL4 DISPATCH_NOTHROW | ||
| 1253 | void | ||
| 1254 | dispatch_after_f(dispatch_time_t when, dispatch_queue_t queue, | ||
| 1255 | 		void *_Nullable context, dispatch_function_t work); | ||
| 1256 | |||
| 1257 | /*! | ||
| 1258 | * @functiongroup Dispatch Barrier API | ||
| 1259 | * The dispatch barrier API is a mechanism for submitting barrier blocks to a | ||
| 1260 | * dispatch queue, analogous to the dispatch_async()/dispatch_sync() API. | ||
| 1261 | * It enables the implementation of efficient reader/writer schemes. | ||
| 1262 | * Barrier blocks only behave specially when submitted to queues created with | ||
| 1263 | * the DISPATCH_QUEUE_CONCURRENT attribute; on such a queue, a barrier block | ||
| 1264 | * will not run until all blocks submitted to the queue earlier have completed, | ||
| 1265 | * and any blocks submitted to the queue after a barrier block will not run | ||
| 1266 | * until the barrier block has completed. | ||
| 1267 | * When submitted to a a global queue or to a queue not created with the | ||
| 1268 | * DISPATCH_QUEUE_CONCURRENT attribute, barrier blocks behave identically to | ||
| 1269 | * blocks submitted with the dispatch_async()/dispatch_sync() API. | ||
| 1270 | */ | ||
| 1271 | |||
| 1272 | /*! | ||
| 1273 | * @function dispatch_barrier_async | ||
| 1274 | * | ||
| 1275 | * @abstract | ||
| 1276 | * Submits a barrier block for asynchronous execution on a dispatch queue. | ||
| 1277 | * | ||
| 1278 | * @discussion | ||
| 1279 | * Submits a block to a dispatch queue like dispatch_async(), but marks that | ||
| 1280 | * block as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT queues). | ||
| 1281 | * | ||
| 1282 | * See dispatch_async() for details and "Dispatch Barrier API" for a description | ||
| 1283 | * of the barrier semantics. | ||
| 1284 | * | ||
| 1285 | * @param queue | ||
| 1286 | * The target dispatch queue to which the block is submitted. | ||
| 1287 | * The system will hold a reference on the target queue until the block | ||
| 1288 | * has finished. | ||
| 1289 | * The result of passing NULL in this parameter is undefined. | ||
| 1290 | * | ||
| 1291 | * @param block | ||
| 1292 | * The block to submit to the target dispatch queue. This function performs | ||
| 1293 | * Block_copy() and Block_release() on behalf of callers. | ||
| 1294 | * The result of passing NULL in this parameter is undefined. | ||
| 1295 | */ | ||
| 1296 | #ifdef __BLOCKS__ | ||
| 1297 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 1298 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 1299 | void | ||
| 1300 | dispatch_barrier_async(dispatch_queue_t queue, dispatch_block_t block); | ||
| 1301 | #endif | ||
| 1302 | |||
| 1303 | /*! | ||
| 1304 | * @function dispatch_barrier_async_f | ||
| 1305 | * | ||
| 1306 | * @abstract | ||
| 1307 | * Submits a barrier function for asynchronous execution on a dispatch queue. | ||
| 1308 | * | ||
| 1309 | * @discussion | ||
| 1310 | * Submits a function to a dispatch queue like dispatch_async_f(), but marks | ||
| 1311 | * that function as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT | ||
| 1312 | * queues). | ||
| 1313 | * | ||
| 1314 | * See dispatch_async_f() for details and "Dispatch Barrier API" for a | ||
| 1315 | * description of the barrier semantics. | ||
| 1316 | * | ||
| 1317 | * @param queue | ||
| 1318 | * The target dispatch queue to which the function is submitted. | ||
| 1319 | * The system will hold a reference on the target queue until the function | ||
| 1320 | * has returned. | ||
| 1321 | * The result of passing NULL in this parameter is undefined. | ||
| 1322 | * | ||
| 1323 | * @param context | ||
| 1324 | * The application-defined context parameter to pass to the function. | ||
| 1325 | * | ||
| 1326 | * @param work | ||
| 1327 | * The application-defined function to invoke on the target queue. The first | ||
| 1328 | * parameter passed to this function is the context provided to | ||
| 1329 | * dispatch_barrier_async_f(). | ||
| 1330 | * The result of passing NULL in this parameter is undefined. | ||
| 1331 | */ | ||
| 1332 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 1333 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 1334 | void | ||
| 1335 | dispatch_barrier_async_f(dispatch_queue_t queue, | ||
| 1336 | 		void *_Nullable context, dispatch_function_t work); | ||
| 1337 | |||
| 1338 | /*! | ||
| 1339 | * @function dispatch_barrier_sync | ||
| 1340 | * | ||
| 1341 | * @abstract | ||
| 1342 | * Submits a barrier block for synchronous execution on a dispatch queue. | ||
| 1343 | * | ||
| 1344 | * @discussion | ||
| 1345 | * Submits a block to a dispatch queue like dispatch_sync(), but marks that | ||
| 1346 | * block as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT queues). | ||
| 1347 | * | ||
| 1348 | * See dispatch_sync() for details and "Dispatch Barrier API" for a description | ||
| 1349 | * of the barrier semantics. | ||
| 1350 | * | ||
| 1351 | * @param queue | ||
| 1352 | * The target dispatch queue to which the block is submitted. | ||
| 1353 | * The result of passing NULL in this parameter is undefined. | ||
| 1354 | * | ||
| 1355 | * @param block | ||
| 1356 | * The block to be invoked on the target dispatch queue. | ||
| 1357 | * The result of passing NULL in this parameter is undefined. | ||
| 1358 | */ | ||
| 1359 | #ifdef __BLOCKS__ | ||
| 1360 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 1361 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 1362 | void | ||
| 1363 | dispatch_barrier_sync(dispatch_queue_t queue, | ||
| 1364 | 		DISPATCH_NOESCAPE dispatch_block_t block); | ||
| 1365 | #endif | ||
| 1366 | |||
| 1367 | /*! | ||
| 1368 | * @function dispatch_barrier_sync_f | ||
| 1369 | * | ||
| 1370 | * @abstract | ||
| 1371 | * Submits a barrier function for synchronous execution on a dispatch queue. | ||
| 1372 | * | ||
| 1373 | * @discussion | ||
| 1374 | * Submits a function to a dispatch queue like dispatch_sync_f(), but marks that | ||
| 1375 | * fuction as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT queues). | ||
| 1376 | * | ||
| 1377 | * See dispatch_sync_f() for details. | ||
| 1378 | * | ||
| 1379 | * @param queue | ||
| 1380 | * The target dispatch queue to which the function is submitted. | ||
| 1381 | * The result of passing NULL in this parameter is undefined. | ||
| 1382 | * | ||
| 1383 | * @param context | ||
| 1384 | * The application-defined context parameter to pass to the function. | ||
| 1385 | * | ||
| 1386 | * @param work | ||
| 1387 | * The application-defined function to invoke on the target queue. The first | ||
| 1388 | * parameter passed to this function is the context provided to | ||
| 1389 | * dispatch_barrier_sync_f(). | ||
| 1390 | * The result of passing NULL in this parameter is undefined. | ||
| 1391 | */ | ||
| 1392 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 1393 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 1394 | void | ||
| 1395 | dispatch_barrier_sync_f(dispatch_queue_t queue, | ||
| 1396 | 		void *_Nullable context, dispatch_function_t work); | ||
| 1397 | |||
| 1398 | /*! | ||
| 1399 | * @function dispatch_barrier_async_and_wait | ||
| 1400 | * | ||
| 1401 | * @abstract | ||
| 1402 | * Submits a block for synchronous execution on a dispatch queue. | ||
| 1403 | * | ||
| 1404 | * @discussion | ||
| 1405 | * Submits a block to a dispatch queue like dispatch_async_and_wait(), but marks | ||
| 1406 | * that block as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT | ||
| 1407 | * queues). | ||
| 1408 | * | ||
| 1409 | * See "Dispatch Barrier API" for a description of the barrier semantics. | ||
| 1410 | * | ||
| 1411 | * @param queue | ||
| 1412 | * The target dispatch queue to which the block is submitted. | ||
| 1413 | * The result of passing NULL in this parameter is undefined. | ||
| 1414 | * | ||
| 1415 | * @param work | ||
| 1416 | * The application-defined block to invoke on the target queue. | ||
| 1417 | * The result of passing NULL in this parameter is undefined. | ||
| 1418 | */ | ||
| 1419 | #ifdef __BLOCKS__ | ||
| 1420 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 1421 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 1422 | void | ||
| 1423 | dispatch_barrier_async_and_wait(dispatch_queue_t queue, | ||
| 1424 | 		DISPATCH_NOESCAPE dispatch_block_t block); | ||
| 1425 | #endif | ||
| 1426 | |||
| 1427 | /*! | ||
| 1428 | * @function dispatch_barrier_async_and_wait_f | ||
| 1429 | * | ||
| 1430 | * @abstract | ||
| 1431 | * Submits a function for synchronous execution on a dispatch queue. | ||
| 1432 | * | ||
| 1433 | * @discussion | ||
| 1434 | * Submits a function to a dispatch queue like dispatch_async_and_wait_f(), but | ||
| 1435 | * marks that function as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT | ||
| 1436 | * queues). | ||
| 1437 | * | ||
| 1438 | * See "Dispatch Barrier API" for a description of the barrier semantics. | ||
| 1439 | * | ||
| 1440 | * @param queue | ||
| 1441 | * The target dispatch queue to which the function is submitted. | ||
| 1442 | * The result of passing NULL in this parameter is undefined. | ||
| 1443 | * | ||
| 1444 | * @param context | ||
| 1445 | * The application-defined context parameter to pass to the function. | ||
| 1446 | * | ||
| 1447 | * @param work | ||
| 1448 | * The application-defined function to invoke on the target queue. The first | ||
| 1449 | * parameter passed to this function is the context provided to | ||
| 1450 | * dispatch_barrier_async_and_wait_f(). | ||
| 1451 | * The result of passing NULL in this parameter is undefined. | ||
| 1452 | */ | ||
| 1453 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 1454 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW | ||
| 1455 | void | ||
| 1456 | dispatch_barrier_async_and_wait_f(dispatch_queue_t queue, | ||
| 1457 | 		void *_Nullable context, dispatch_function_t work); | ||
| 1458 | |||
| 1459 | /*! | ||
| 1460 | * @functiongroup Dispatch queue-specific contexts | ||
| 1461 | * This API allows different subsystems to associate context to a shared queue | ||
| 1462 | * without risk of collision and to retrieve that context from blocks executing | ||
| 1463 | * on that queue or any of its child queues in the target queue hierarchy. | ||
| 1464 | */ | ||
| 1465 | |||
| 1466 | /*! | ||
| 1467 | * @function dispatch_queue_set_specific | ||
| 1468 | * | ||
| 1469 | * @abstract | ||
| 1470 | * Associates a subsystem-specific context with a dispatch queue, for a key | ||
| 1471 | * unique to the subsystem. | ||
| 1472 | * | ||
| 1473 | * @discussion | ||
| 1474 | * The specified destructor will be invoked with the context on the default | ||
| 1475 | * priority global concurrent queue when a new context is set for the same key, | ||
| 1476 | * or after all references to the queue have been released. | ||
| 1477 | * | ||
| 1478 | * @param queue | ||
| 1479 | * The dispatch queue to modify. | ||
| 1480 | * The result of passing NULL in this parameter is undefined. | ||
| 1481 | * | ||
| 1482 | * @param key | ||
| 1483 | * The key to set the context for, typically a pointer to a static variable | ||
| 1484 | * specific to the subsystem. Keys are only compared as pointers and never | ||
| 1485 | * dereferenced. Passing a string constant directly is not recommended. | ||
| 1486 | * The NULL key is reserved and attempts to set a context for it are ignored. | ||
| 1487 | * | ||
| 1488 | * @param context | ||
| 1489 | * The new subsystem-specific context for the object. This may be NULL. | ||
| 1490 | * | ||
| 1491 | * @param destructor | ||
| 1492 | * The destructor function pointer. This may be NULL and is ignored if context | ||
| 1493 | * is NULL. | ||
| 1494 | */ | ||
| 1495 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 1496 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 1497 | void | ||
| 1498 | dispatch_queue_set_specific(dispatch_queue_t queue, const void *key, | ||
| 1499 | 		void *_Nullable context, dispatch_function_t _Nullable destructor); | ||
| 1500 | |||
| 1501 | /*! | ||
| 1502 | * @function dispatch_queue_get_specific | ||
| 1503 | * | ||
| 1504 | * @abstract | ||
| 1505 | * Returns the subsystem-specific context associated with a dispatch queue, for | ||
| 1506 | * a key unique to the subsystem. | ||
| 1507 | * | ||
| 1508 | * @discussion | ||
| 1509 | * Returns the context for the specified key if it has been set on the specified | ||
| 1510 | * queue. | ||
| 1511 | * | ||
| 1512 | * @param queue | ||
| 1513 | * The dispatch queue to query. | ||
| 1514 | * The result of passing NULL in this parameter is undefined. | ||
| 1515 | * | ||
| 1516 | * @param key | ||
| 1517 | * The key to get the context for, typically a pointer to a static variable | ||
| 1518 | * specific to the subsystem. Keys are only compared as pointers and never | ||
| 1519 | * dereferenced. Passing a string constant directly is not recommended. | ||
| 1520 | * | ||
| 1521 | * @result | ||
| 1522 | * The context for the specified key or NULL if no context was found. | ||
| 1523 | */ | ||
| 1524 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 1525 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_PURE DISPATCH_WARN_RESULT | ||
| 1526 | DISPATCH_NOTHROW | ||
| 1527 | void *_Nullable | ||
| 1528 | dispatch_queue_get_specific(dispatch_queue_t queue, const void *key); | ||
| 1529 | |||
| 1530 | /*! | ||
| 1531 | * @function dispatch_get_specific | ||
| 1532 | * | ||
| 1533 | * @abstract | ||
| 1534 | * Returns the current subsystem-specific context for a key unique to the | ||
| 1535 | * subsystem. | ||
| 1536 | * | ||
| 1537 | * @discussion | ||
| 1538 | * When called from a block executing on a queue, returns the context for the | ||
| 1539 | * specified key if it has been set on the queue, otherwise returns the result | ||
| 1540 | * of dispatch_get_specific() executed on the queue's target queue or NULL | ||
| 1541 | * if the current queue is a global concurrent queue. | ||
| 1542 | * | ||
| 1543 | * @param key | ||
| 1544 | * The key to get the context for, typically a pointer to a static variable | ||
| 1545 | * specific to the subsystem. Keys are only compared as pointers and never | ||
| 1546 | * dereferenced. Passing a string constant directly is not recommended. | ||
| 1547 | * | ||
| 1548 | * @result | ||
| 1549 | * The context for the specified key or NULL if no context was found. | ||
| 1550 | */ | ||
| 1551 | API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 1552 | DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 1553 | void *_Nullable | ||
| 1554 | dispatch_get_specific(const void *key); | ||
| 1555 | |||
| 1556 | /*! | ||
| 1557 | * @functiongroup Dispatch assertion API | ||
| 1558 | * | ||
| 1559 | * This API asserts at runtime that code is executing in (or out of) the context | ||
| 1560 | * of a given queue. It can be used to check that a block accessing a resource | ||
| 1561 | * does so from the proper queue protecting the resource. It also can be used | ||
| 1562 | * to verify that a block that could cause a deadlock if run on a given queue | ||
| 1563 | * never executes on that queue. | ||
| 1564 | */ | ||
| 1565 | |||
| 1566 | /*! | ||
| 1567 | * @function dispatch_assert_queue | ||
| 1568 | * | ||
| 1569 | * @abstract | ||
| 1570 | * Verifies that the current block is executing on a given dispatch queue. | ||
| 1571 | * | ||
| 1572 | * @discussion | ||
| 1573 | * Some code expects to be run on a specific dispatch queue. This function | ||
| 1574 | * verifies that that expectation is true. | ||
| 1575 | * | ||
| 1576 | * If the currently executing block was submitted to the specified queue or to | ||
| 1577 | * any queue targeting it (see dispatch_set_target_queue()), this function | ||
| 1578 | * returns. | ||
| 1579 | * | ||
| 1580 | * If the currently executing block was submitted with a synchronous API | ||
| 1581 | * (dispatch_sync(), dispatch_barrier_sync(), ...), the context of the | ||
| 1582 | * submitting block is also evaluated (recursively). | ||
| 1583 | * If a synchronously submitting block is found that was itself submitted to | ||
| 1584 | * the specified queue or to any queue targeting it, this function returns. | ||
| 1585 | * | ||
| 1586 | * Otherwise this function asserts: it logs an explanation to the system log and | ||
| 1587 | * terminates the application. | ||
| 1588 | * | ||
| 1589 | * Passing the result of dispatch_get_main_queue() to this function verifies | ||
| 1590 | * that the current block was submitted to the main queue, or to a queue | ||
| 1591 | * targeting it, or is running on the main thread (in any context). | ||
| 1592 | * | ||
| 1593 | * When dispatch_assert_queue() is called outside of the context of a | ||
| 1594 | * submitted block (for example from the context of a thread created manually | ||
| 1595 | * with pthread_create()) then this function will also assert and terminate | ||
| 1596 | * the application. | ||
| 1597 | * | ||
| 1598 | * The variant dispatch_assert_queue_debug() is compiled out when the | ||
| 1599 | * preprocessor macro NDEBUG is defined. (See also assert(3)). | ||
| 1600 | * | ||
| 1601 | * @param queue | ||
| 1602 | * The dispatch queue that the current block is expected to run on. | ||
| 1603 | * The result of passing NULL in this parameter is undefined. | ||
| 1604 | */ | ||
| 1605 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 1606 | DISPATCH_EXPORT DISPATCH_NONNULL1 | ||
| 1607 | void | ||
| 1608 | dispatch_assert_queue(dispatch_queue_t queue) | ||
| 1609 | 		DISPATCH_ALIAS_V2(dispatch_assert_queue); | ||
| 1610 | |||
| 1611 | /*! | ||
| 1612 | * @function dispatch_assert_queue_barrier | ||
| 1613 | * | ||
| 1614 | * @abstract | ||
| 1615 | * Verifies that the current block is executing on a given dispatch queue, | ||
| 1616 | * and that the block acts as a barrier on that queue. | ||
| 1617 | * | ||
| 1618 | * @discussion | ||
| 1619 | * This behaves exactly like dispatch_assert_queue(), with the additional check | ||
| 1620 | * that the current block acts as a barrier on the specified queue, which is | ||
| 1621 | * always true if the specified queue is serial (see DISPATCH_BLOCK_BARRIER or | ||
| 1622 | * dispatch_barrier_async() for details). | ||
| 1623 | * | ||
| 1624 | * The variant dispatch_assert_queue_barrier_debug() is compiled out when the | ||
| 1625 | * preprocessor macro NDEBUG is defined. (See also assert()). | ||
| 1626 | * | ||
| 1627 | * @param queue | ||
| 1628 | * The dispatch queue that the current block is expected to run as a barrier on. | ||
| 1629 | * The result of passing NULL in this parameter is undefined. | ||
| 1630 | */ | ||
| 1631 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 1632 | DISPATCH_EXPORT DISPATCH_NONNULL1 | ||
| 1633 | void | ||
| 1634 | dispatch_assert_queue_barrier(dispatch_queue_t queue); | ||
| 1635 | |||
| 1636 | /*! | ||
| 1637 | * @function dispatch_assert_queue_not | ||
| 1638 | * | ||
| 1639 | * @abstract | ||
| 1640 | * Verifies that the current block is not executing on a given dispatch queue. | ||
| 1641 | * | ||
| 1642 | * @discussion | ||
| 1643 | * This function is the equivalent of dispatch_assert_queue() with the test for | ||
| 1644 | * equality inverted. That means that it will terminate the application when | ||
| 1645 | * dispatch_assert_queue() would return, and vice-versa. See discussion there. | ||
| 1646 | * | ||
| 1647 | * The variant dispatch_assert_queue_not_debug() is compiled out when the | ||
| 1648 | * preprocessor macro NDEBUG is defined. (See also assert(3)). | ||
| 1649 | * | ||
| 1650 | * @param queue | ||
| 1651 | * The dispatch queue that the current block is expected not to run on. | ||
| 1652 | * The result of passing NULL in this parameter is undefined. | ||
| 1653 | */ | ||
| 1654 | API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 1655 | DISPATCH_EXPORT DISPATCH_NONNULL1 | ||
| 1656 | void | ||
| 1657 | dispatch_assert_queue_not(dispatch_queue_t queue) | ||
| 1658 | 		DISPATCH_ALIAS_V2(dispatch_assert_queue_not); | ||
| 1659 | |||
| 1660 | #ifdef NDEBUG | ||
| 1661 | #define dispatch_assert_queue_debug(q) ((void)(0 && (q))) | ||
| 1662 | #define dispatch_assert_queue_barrier_debug(q) ((void)(0 && (q))) | ||
| 1663 | #define dispatch_assert_queue_not_debug(q) ((void)(0 && (q))) | ||
| 1664 | #else | ||
| 1665 | #define dispatch_assert_queue_debug(q) dispatch_assert_queue(q) | ||
| 1666 | #define dispatch_assert_queue_barrier_debug(q) dispatch_assert_queue_barrier(q) | ||
| 1667 | #define dispatch_assert_queue_not_debug(q) dispatch_assert_queue_not(q) | ||
| 1668 | #endif | ||
| 1669 | |||
| 1670 | __END_DECLS | ||
| 1671 | |||
| 1672 | DISPATCH_ASSUME_NONNULL_END | ||
| 1673 | |||
| 1674 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h created+117| ... | @@ -0,0 +1,117 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_SEMAPHORE__ | ||
| 22 | #define __DISPATCH_SEMAPHORE__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | /*! | ||
| 32 | * @typedef dispatch_semaphore_t | ||
| 33 | * | ||
| 34 | * @abstract | ||
| 35 | * A counting semaphore. | ||
| 36 | */ | ||
| 37 | DISPATCH_DECL(dispatch_semaphore); | ||
| 38 | |||
| 39 | __BEGIN_DECLS | ||
| 40 | |||
| 41 | /*! | ||
| 42 | * @function dispatch_semaphore_create | ||
| 43 | * | ||
| 44 | * @abstract | ||
| 45 | * Creates new counting semaphore with an initial value. | ||
| 46 | * | ||
| 47 | * @discussion | ||
| 48 | * Passing zero for the value is useful for when two threads need to reconcile | ||
| 49 | * the completion of a particular event. Passing a value greater than zero is | ||
| 50 | * useful for managing a finite pool of resources, where the pool size is equal | ||
| 51 | * to the value. | ||
| 52 | * | ||
| 53 | * @param value | ||
| 54 | * The starting value for the semaphore. Passing a value less than zero will | ||
| 55 | * cause NULL to be returned. | ||
| 56 | * | ||
| 57 | * @result | ||
| 58 | * The newly created semaphore, or NULL on failure. | ||
| 59 | */ | ||
| 60 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 61 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 62 | DISPATCH_NOTHROW | ||
| 63 | dispatch_semaphore_t | ||
| 64 | dispatch_semaphore_create(intptr_t value); | ||
| 65 | |||
| 66 | /*! | ||
| 67 | * @function dispatch_semaphore_wait | ||
| 68 | * | ||
| 69 | * @abstract | ||
| 70 | * Wait (decrement) for a semaphore. | ||
| 71 | * | ||
| 72 | * @discussion | ||
| 73 | * Decrement the counting semaphore. If the resulting value is less than zero, | ||
| 74 | * this function waits for a signal to occur before returning. | ||
| 75 | * | ||
| 76 | * @param dsema | ||
| 77 | * The semaphore. The result of passing NULL in this parameter is undefined. | ||
| 78 | * | ||
| 79 | * @param timeout | ||
| 80 | * When to timeout (see dispatch_time). As a convenience, there are the | ||
| 81 | * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants. | ||
| 82 | * | ||
| 83 | * @result | ||
| 84 | * Returns zero on success, or non-zero if the timeout occurred. | ||
| 85 | */ | ||
| 86 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 87 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 88 | intptr_t | ||
| 89 | dispatch_semaphore_wait(dispatch_semaphore_t dsema, dispatch_time_t timeout); | ||
| 90 | |||
| 91 | /*! | ||
| 92 | * @function dispatch_semaphore_signal | ||
| 93 | * | ||
| 94 | * @abstract | ||
| 95 | * Signal (increment) a semaphore. | ||
| 96 | * | ||
| 97 | * @discussion | ||
| 98 | * Increment the counting semaphore. If the previous value was less than zero, | ||
| 99 | * this function wakes a waiting thread before returning. | ||
| 100 | * | ||
| 101 | * @param dsema The counting semaphore. | ||
| 102 | * The result of passing NULL in this parameter is undefined. | ||
| 103 | * | ||
| 104 | * @result | ||
| 105 | * This function returns non-zero if a thread is woken. Otherwise, zero is | ||
| 106 | * returned. | ||
| 107 | */ | ||
| 108 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 109 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 110 | intptr_t | ||
| 111 | dispatch_semaphore_signal(dispatch_semaphore_t dsema); | ||
| 112 | |||
| 113 | __END_DECLS | ||
| 114 | |||
| 115 | DISPATCH_ASSUME_NONNULL_END | ||
| 116 | |||
| 117 | #endif /* __DISPATCH_SEMAPHORE__ */ | ||
lib/libc/include/x86_64-macos-gnu/dispatch/source.h created+780| ... | @@ -0,0 +1,780 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_SOURCE__ | ||
| 22 | #define __DISPATCH_SOURCE__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #if TARGET_OS_MAC | ||
| 30 | #include <mach/port.h> | ||
| 31 | #include <mach/message.h> | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #if !defined(_WIN32) | ||
| 35 | #include <sys/signal.h> | ||
| 36 | #endif | ||
| 37 | |||
| 38 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 39 | |||
| 40 | /*! | ||
| 41 | * @header | ||
| 42 | * The dispatch framework provides a suite of interfaces for monitoring low- | ||
| 43 | * level system objects (file descriptors, Mach ports, signals, VFS nodes, etc.) | ||
| 44 | * for activity and automatically submitting event handler blocks to dispatch | ||
| 45 | * queues when such activity occurs. | ||
| 46 | * | ||
| 47 | * This suite of interfaces is known as the Dispatch Source API. | ||
| 48 | */ | ||
| 49 | |||
| 50 | /*! | ||
| 51 | * @typedef dispatch_source_t | ||
| 52 | * | ||
| 53 | * @abstract | ||
| 54 | * Dispatch sources are used to automatically submit event handler blocks to | ||
| 55 | * dispatch queues in response to external events. | ||
| 56 | */ | ||
| 57 | DISPATCH_SOURCE_DECL(dispatch_source); | ||
| 58 | |||
| 59 | __BEGIN_DECLS | ||
| 60 | |||
| 61 | /*! | ||
| 62 | * @typedef dispatch_source_type_t | ||
| 63 | * | ||
| 64 | * @abstract | ||
| 65 | * Constants of this type represent the class of low-level system object that | ||
| 66 | * is being monitored by the dispatch source. Constants of this type are | ||
| 67 | * passed as a parameter to dispatch_source_create() and determine how the | ||
| 68 | * handle argument is interpreted (i.e. as a file descriptor, mach port, | ||
| 69 | * signal number, process identifier, etc.), and how the mask argument is | ||
| 70 | * interpreted. | ||
| 71 | */ | ||
| 72 | typedef const struct dispatch_source_type_s *dispatch_source_type_t; | ||
| 73 | |||
| 74 | /*! | ||
| 75 | * @const DISPATCH_SOURCE_TYPE_DATA_ADD | ||
| 76 | * @discussion A dispatch source that coalesces data obtained via calls to | ||
| 77 | * dispatch_source_merge_data(). An ADD is used to coalesce the data. | ||
| 78 | * The handle is unused (pass zero for now). | ||
| 79 | * The mask is unused (pass zero for now). | ||
| 80 | */ | ||
| 81 | #define DISPATCH_SOURCE_TYPE_DATA_ADD (&_dispatch_source_type_data_add) | ||
| 82 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 83 | DISPATCH_SOURCE_TYPE_DECL(data_add); | ||
| 84 | |||
| 85 | /*! | ||
| 86 | * @const DISPATCH_SOURCE_TYPE_DATA_OR | ||
| 87 | * @discussion A dispatch source that coalesces data obtained via calls to | ||
| 88 | * dispatch_source_merge_data(). A bitwise OR is used to coalesce the data. | ||
| 89 | * The handle is unused (pass zero for now). | ||
| 90 | * The mask is unused (pass zero for now). | ||
| 91 | */ | ||
| 92 | #define DISPATCH_SOURCE_TYPE_DATA_OR (&_dispatch_source_type_data_or) | ||
| 93 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 94 | DISPATCH_SOURCE_TYPE_DECL(data_or); | ||
| 95 | |||
| 96 | /*! | ||
| 97 | * @const DISPATCH_SOURCE_TYPE_DATA_REPLACE | ||
| 98 | * @discussion A dispatch source that tracks data obtained via calls to | ||
| 99 | * dispatch_source_merge_data(). Newly obtained data values replace existing | ||
| 100 | * data values not yet delivered to the source handler | ||
| 101 | * | ||
| 102 | * A data value of zero will cause the source handler to not be invoked. | ||
| 103 | * | ||
| 104 | * The handle is unused (pass zero for now). | ||
| 105 | * The mask is unused (pass zero for now). | ||
| 106 | */ | ||
| 107 | #define DISPATCH_SOURCE_TYPE_DATA_REPLACE (&_dispatch_source_type_data_replace) | ||
| 108 | API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) | ||
| 109 | DISPATCH_SOURCE_TYPE_DECL(data_replace); | ||
| 110 | |||
| 111 | /*! | ||
| 112 | * @const DISPATCH_SOURCE_TYPE_MACH_SEND | ||
| 113 | * @discussion A dispatch source that monitors a Mach port for dead name | ||
| 114 | * notifications (send right no longer has any corresponding receive right). | ||
| 115 | * The handle is a Mach port with a send or send-once right (mach_port_t). | ||
| 116 | * The mask is a mask of desired events from dispatch_source_mach_send_flags_t. | ||
| 117 | */ | ||
| 118 | #define DISPATCH_SOURCE_TYPE_MACH_SEND (&_dispatch_source_type_mach_send) | ||
| 119 | API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE() | ||
| 120 | DISPATCH_SOURCE_TYPE_DECL(mach_send); | ||
| 121 | |||
| 122 | /*! | ||
| 123 | * @const DISPATCH_SOURCE_TYPE_MACH_RECV | ||
| 124 | * @discussion A dispatch source that monitors a Mach port for pending messages. | ||
| 125 | * The handle is a Mach port with a receive right (mach_port_t). | ||
| 126 | * The mask is a mask of desired events from dispatch_source_mach_recv_flags_t, | ||
| 127 | * but no flags are currently defined (pass zero for now). | ||
| 128 | */ | ||
| 129 | #define DISPATCH_SOURCE_TYPE_MACH_RECV (&_dispatch_source_type_mach_recv) | ||
| 130 | API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE() | ||
| 131 | DISPATCH_SOURCE_TYPE_DECL(mach_recv); | ||
| 132 | |||
| 133 | /*! | ||
| 134 | * @const DISPATCH_SOURCE_TYPE_MEMORYPRESSURE | ||
| 135 | * @discussion A dispatch source that monitors the system for changes in | ||
| 136 | * memory pressure condition. | ||
| 137 | * The handle is unused (pass zero for now). | ||
| 138 | * The mask is a mask of desired events from | ||
| 139 | * dispatch_source_memorypressure_flags_t. | ||
| 140 | */ | ||
| 141 | #define DISPATCH_SOURCE_TYPE_MEMORYPRESSURE \ | ||
| 142 | 		(&_dispatch_source_type_memorypressure) | ||
| 143 | API_AVAILABLE(macos(10.9), ios(8.0)) DISPATCH_LINUX_UNAVAILABLE() | ||
| 144 | DISPATCH_SOURCE_TYPE_DECL(memorypressure); | ||
| 145 | |||
| 146 | /*! | ||
| 147 | * @const DISPATCH_SOURCE_TYPE_PROC | ||
| 148 | * @discussion A dispatch source that monitors an external process for events | ||
| 149 | * defined by dispatch_source_proc_flags_t. | ||
| 150 | * The handle is a process identifier (pid_t). | ||
| 151 | * The mask is a mask of desired events from dispatch_source_proc_flags_t. | ||
| 152 | */ | ||
| 153 | #define DISPATCH_SOURCE_TYPE_PROC (&_dispatch_source_type_proc) | ||
| 154 | API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE() | ||
| 155 | DISPATCH_SOURCE_TYPE_DECL(proc); | ||
| 156 | |||
| 157 | /*! | ||
| 158 | * @const DISPATCH_SOURCE_TYPE_READ | ||
| 159 | * @discussion A dispatch source that monitors a file descriptor for pending | ||
| 160 | * bytes available to be read. | ||
| 161 | * The handle is a file descriptor (int). | ||
| 162 | * The mask is unused (pass zero for now). | ||
| 163 | */ | ||
| 164 | #define DISPATCH_SOURCE_TYPE_READ (&_dispatch_source_type_read) | ||
| 165 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 166 | DISPATCH_SOURCE_TYPE_DECL(read); | ||
| 167 | |||
| 168 | /*! | ||
| 169 | * @const DISPATCH_SOURCE_TYPE_SIGNAL | ||
| 170 | * @discussion A dispatch source that monitors the current process for signals. | ||
| 171 | * The handle is a signal number (int). | ||
| 172 | * The mask is unused (pass zero for now). | ||
| 173 | */ | ||
| 174 | #define DISPATCH_SOURCE_TYPE_SIGNAL (&_dispatch_source_type_signal) | ||
| 175 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 176 | DISPATCH_SOURCE_TYPE_DECL(signal); | ||
| 177 | |||
| 178 | /*! | ||
| 179 | * @const DISPATCH_SOURCE_TYPE_TIMER | ||
| 180 | * @discussion A dispatch source that submits the event handler block based | ||
| 181 | * on a timer. | ||
| 182 | * The handle is unused (pass zero for now). | ||
| 183 | * The mask specifies which flags from dispatch_source_timer_flags_t to apply. | ||
| 184 | */ | ||
| 185 | #define DISPATCH_SOURCE_TYPE_TIMER (&_dispatch_source_type_timer) | ||
| 186 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 187 | DISPATCH_SOURCE_TYPE_DECL(timer); | ||
| 188 | |||
| 189 | /*! | ||
| 190 | * @const DISPATCH_SOURCE_TYPE_VNODE | ||
| 191 | * @discussion A dispatch source that monitors a file descriptor for events | ||
| 192 | * defined by dispatch_source_vnode_flags_t. | ||
| 193 | * The handle is a file descriptor (int). | ||
| 194 | * The mask is a mask of desired events from dispatch_source_vnode_flags_t. | ||
| 195 | */ | ||
| 196 | #define DISPATCH_SOURCE_TYPE_VNODE (&_dispatch_source_type_vnode) | ||
| 197 | API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE() | ||
| 198 | DISPATCH_SOURCE_TYPE_DECL(vnode); | ||
| 199 | |||
| 200 | /*! | ||
| 201 | * @const DISPATCH_SOURCE_TYPE_WRITE | ||
| 202 | * @discussion A dispatch source that monitors a file descriptor for available | ||
| 203 | * buffer space to write bytes. | ||
| 204 | * The handle is a file descriptor (int). | ||
| 205 | * The mask is unused (pass zero for now). | ||
| 206 | */ | ||
| 207 | #define DISPATCH_SOURCE_TYPE_WRITE (&_dispatch_source_type_write) | ||
| 208 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 209 | DISPATCH_SOURCE_TYPE_DECL(write); | ||
| 210 | |||
| 211 | /*! | ||
| 212 | * @typedef dispatch_source_mach_send_flags_t | ||
| 213 | * Type of dispatch_source_mach_send flags | ||
| 214 | * | ||
| 215 | * @constant DISPATCH_MACH_SEND_DEAD | ||
| 216 | * The receive right corresponding to the given send right was destroyed. | ||
| 217 | */ | ||
| 218 | #define DISPATCH_MACH_SEND_DEAD	0x1 | ||
| 219 | |||
| 220 | typedef unsigned long dispatch_source_mach_send_flags_t; | ||
| 221 | |||
| 222 | /*! | ||
| 223 | * @typedef dispatch_source_mach_recv_flags_t | ||
| 224 | * Type of dispatch_source_mach_recv flags | ||
| 225 | */ | ||
| 226 | typedef unsigned long dispatch_source_mach_recv_flags_t; | ||
| 227 | |||
| 228 | /*! | ||
| 229 | * @typedef dispatch_source_memorypressure_flags_t | ||
| 230 | * Type of dispatch_source_memorypressure flags | ||
| 231 | * | ||
| 232 | * @constant DISPATCH_MEMORYPRESSURE_NORMAL | ||
| 233 | * The system memory pressure condition has returned to normal. | ||
| 234 | * | ||
| 235 | * @constant DISPATCH_MEMORYPRESSURE_WARN | ||
| 236 | * The system memory pressure condition has changed to warning. | ||
| 237 | * | ||
| 238 | * @constant DISPATCH_MEMORYPRESSURE_CRITICAL | ||
| 239 | * The system memory pressure condition has changed to critical. | ||
| 240 | * | ||
| 241 | * @discussion | ||
| 242 | * Elevated memory pressure is a system-wide condition that applications | ||
| 243 | * registered for this source should react to by changing their future memory | ||
| 244 | * use behavior, e.g. by reducing cache sizes of newly initiated operations | ||
| 245 | * until memory pressure returns back to normal. | ||
| 246 | * NOTE: applications should NOT traverse and discard existing caches for past | ||
| 247 | * operations when the system memory pressure enters an elevated state, as that | ||
| 248 | * is likely to trigger VM operations that will further aggravate system memory | ||
| 249 | * pressure. | ||
| 250 | */ | ||
| 251 | |||
| 252 | #define DISPATCH_MEMORYPRESSURE_NORMAL		0x01 | ||
| 253 | #define DISPATCH_MEMORYPRESSURE_WARN		0x02 | ||
| 254 | #define DISPATCH_MEMORYPRESSURE_CRITICAL	0x04 | ||
| 255 | |||
| 256 | typedef unsigned long dispatch_source_memorypressure_flags_t; | ||
| 257 | |||
| 258 | /*! | ||
| 259 | * @typedef dispatch_source_proc_flags_t | ||
| 260 | * Type of dispatch_source_proc flags | ||
| 261 | * | ||
| 262 | * @constant DISPATCH_PROC_EXIT | ||
| 263 | * The process has exited (perhaps cleanly, perhaps not). | ||
| 264 | * | ||
| 265 | * @constant DISPATCH_PROC_FORK | ||
| 266 | * The process has created one or more child processes. | ||
| 267 | * | ||
| 268 | * @constant DISPATCH_PROC_EXEC | ||
| 269 | * The process has become another executable image via | ||
| 270 | * exec*() or posix_spawn*(). | ||
| 271 | * | ||
| 272 | * @constant DISPATCH_PROC_SIGNAL | ||
| 273 | * A Unix signal was delivered to the process. | ||
| 274 | */ | ||
| 275 | #define DISPATCH_PROC_EXIT		0x80000000 | ||
| 276 | #define DISPATCH_PROC_FORK		0x40000000 | ||
| 277 | #define DISPATCH_PROC_EXEC		0x20000000 | ||
| 278 | #define DISPATCH_PROC_SIGNAL	0x08000000 | ||
| 279 | |||
| 280 | typedef unsigned long dispatch_source_proc_flags_t; | ||
| 281 | |||
| 282 | /*! | ||
| 283 | * @typedef dispatch_source_vnode_flags_t | ||
| 284 | * Type of dispatch_source_vnode flags | ||
| 285 | * | ||
| 286 | * @constant DISPATCH_VNODE_DELETE | ||
| 287 | * The filesystem object was deleted from the namespace. | ||
| 288 | * | ||
| 289 | * @constant DISPATCH_VNODE_WRITE | ||
| 290 | * The filesystem object data changed. | ||
| 291 | * | ||
| 292 | * @constant DISPATCH_VNODE_EXTEND | ||
| 293 | * The filesystem object changed in size. | ||
| 294 | * | ||
| 295 | * @constant DISPATCH_VNODE_ATTRIB | ||
| 296 | * The filesystem object metadata changed. | ||
| 297 | * | ||
| 298 | * @constant DISPATCH_VNODE_LINK | ||
| 299 | * The filesystem object link count changed. | ||
| 300 | * | ||
| 301 | * @constant DISPATCH_VNODE_RENAME | ||
| 302 | * The filesystem object was renamed in the namespace. | ||
| 303 | * | ||
| 304 | * @constant DISPATCH_VNODE_REVOKE | ||
| 305 | * The filesystem object was revoked. | ||
| 306 | * | ||
| 307 | * @constant DISPATCH_VNODE_FUNLOCK | ||
| 308 | * The filesystem object was unlocked. | ||
| 309 | */ | ||
| 310 | |||
| 311 | #define DISPATCH_VNODE_DELETE	0x1 | ||
| 312 | #define DISPATCH_VNODE_WRITE	0x2 | ||
| 313 | #define DISPATCH_VNODE_EXTEND	0x4 | ||
| 314 | #define DISPATCH_VNODE_ATTRIB	0x8 | ||
| 315 | #define DISPATCH_VNODE_LINK		0x10 | ||
| 316 | #define DISPATCH_VNODE_RENAME	0x20 | ||
| 317 | #define DISPATCH_VNODE_REVOKE	0x40 | ||
| 318 | #define DISPATCH_VNODE_FUNLOCK	0x100 | ||
| 319 | |||
| 320 | typedef unsigned long dispatch_source_vnode_flags_t; | ||
| 321 | |||
| 322 | /*! | ||
| 323 | * @typedef dispatch_source_timer_flags_t | ||
| 324 | * Type of dispatch_source_timer flags | ||
| 325 | * | ||
| 326 | * @constant DISPATCH_TIMER_STRICT | ||
| 327 | * Specifies that the system should make a best effort to strictly observe the | ||
| 328 | * leeway value specified for the timer via dispatch_source_set_timer(), even | ||
| 329 | * if that value is smaller than the default leeway value that would be applied | ||
| 330 | * to the timer otherwise. A minimal amount of leeway will be applied to the | ||
| 331 | * timer even if this flag is specified. | ||
| 332 | * | ||
| 333 | * CAUTION: Use of this flag may override power-saving techniques employed by | ||
| 334 | * the system and cause higher power consumption, so it must be used with care | ||
| 335 | * and only when absolutely necessary. | ||
| 336 | */ | ||
| 337 | |||
| 338 | #define DISPATCH_TIMER_STRICT 0x1 | ||
| 339 | |||
| 340 | typedef unsigned long dispatch_source_timer_flags_t; | ||
| 341 | |||
| 342 | /*! | ||
| 343 | * @function dispatch_source_create | ||
| 344 | * | ||
| 345 | * @abstract | ||
| 346 | * Creates a new dispatch source to monitor low-level system objects and auto- | ||
| 347 | * matically submit a handler block to a dispatch queue in response to events. | ||
| 348 | * | ||
| 349 | * @discussion | ||
| 350 | * Dispatch sources are not reentrant. Any events received while the dispatch | ||
| 351 | * source is suspended or while the event handler block is currently executing | ||
| 352 | * will be coalesced and delivered after the dispatch source is resumed or the | ||
| 353 | * event handler block has returned. | ||
| 354 | * | ||
| 355 | * Dispatch sources are created in an inactive state. After creating the | ||
| 356 | * source and setting any desired attributes (i.e. the handler, context, etc.), | ||
| 357 | * a call must be made to dispatch_activate() in order to begin event delivery. | ||
| 358 | * | ||
| 359 | * Calling dispatch_set_target_queue() on a source once it has been activated | ||
| 360 | * is not allowed (see dispatch_activate() and dispatch_set_target_queue()). | ||
| 361 | * | ||
| 362 | * For backward compatibility reasons, dispatch_resume() on an inactive, | ||
| 363 | * and not otherwise suspended source has the same effect as calling | ||
| 364 | * dispatch_activate(). For new code, using dispatch_activate() is preferred. | ||
| 365 | * | ||
| 366 | * @param type | ||
| 367 | * Declares the type of the dispatch source. Must be one of the defined | ||
| 368 | * dispatch_source_type_t constants. | ||
| 369 | * | ||
| 370 | * @param handle | ||
| 371 | * The underlying system handle to monitor. The interpretation of this argument | ||
| 372 | * is determined by the constant provided in the type parameter. | ||
| 373 | * | ||
| 374 | * @param mask | ||
| 375 | * A mask of flags specifying which events are desired. The interpretation of | ||
| 376 | * this argument is determined by the constant provided in the type parameter. | ||
| 377 | * | ||
| 378 | * @param queue | ||
| 379 | * The dispatch queue to which the event handler block will be submitted. | ||
| 380 | * If queue is DISPATCH_TARGET_QUEUE_DEFAULT, the source will submit the event | ||
| 381 | * handler block to the default priority global queue. | ||
| 382 | * | ||
| 383 | * @result | ||
| 384 | * The newly created dispatch source. Or NULL if invalid arguments are passed. | ||
| 385 | */ | ||
| 386 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 387 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 388 | DISPATCH_NOTHROW | ||
| 389 | dispatch_source_t | ||
| 390 | dispatch_source_create(dispatch_source_type_t type, | ||
| 391 | 	uintptr_t handle, | ||
| 392 | 	uintptr_t mask, | ||
| 393 | 	dispatch_queue_t _Nullable queue); | ||
| 394 | |||
| 395 | /*! | ||
| 396 | * @function dispatch_source_set_event_handler | ||
| 397 | * | ||
| 398 | * @abstract | ||
| 399 | * Sets the event handler block for the given dispatch source. | ||
| 400 | * | ||
| 401 | * @param source | ||
| 402 | * The dispatch source to modify. | ||
| 403 | * The result of passing NULL in this parameter is undefined. | ||
| 404 | * | ||
| 405 | * @param handler | ||
| 406 | * The event handler block to submit to the source's target queue. | ||
| 407 | */ | ||
| 408 | #ifdef __BLOCKS__ | ||
| 409 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 410 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 411 | void | ||
| 412 | dispatch_source_set_event_handler(dispatch_source_t source, | ||
| 413 | 	dispatch_block_t _Nullable handler); | ||
| 414 | #endif /* __BLOCKS__ */ | ||
| 415 | |||
| 416 | /*! | ||
| 417 | * @function dispatch_source_set_event_handler_f | ||
| 418 | * | ||
| 419 | * @abstract | ||
| 420 | * Sets the event handler function for the given dispatch source. | ||
| 421 | * | ||
| 422 | * @param source | ||
| 423 | * The dispatch source to modify. | ||
| 424 | * The result of passing NULL in this parameter is undefined. | ||
| 425 | * | ||
| 426 | * @param handler | ||
| 427 | * The event handler function to submit to the source's target queue. | ||
| 428 | * The context parameter passed to the event handler function is the context of | ||
| 429 | * the dispatch source current at the time the event handler was set. | ||
| 430 | */ | ||
| 431 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 432 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 433 | void | ||
| 434 | dispatch_source_set_event_handler_f(dispatch_source_t source, | ||
| 435 | 	dispatch_function_t _Nullable handler); | ||
| 436 | |||
| 437 | /*! | ||
| 438 | * @function dispatch_source_set_cancel_handler | ||
| 439 | * | ||
| 440 | * @abstract | ||
| 441 | * Sets the cancellation handler block for the given dispatch source. | ||
| 442 | * | ||
| 443 | * @discussion | ||
| 444 | * The cancellation handler (if specified) will be submitted to the source's | ||
| 445 | * target queue in response to a call to dispatch_source_cancel() once the | ||
| 446 | * system has released all references to the source's underlying handle and | ||
| 447 | * the source's event handler block has returned. | ||
| 448 | * | ||
| 449 | * IMPORTANT: | ||
| 450 | * Source cancellation and a cancellation handler are required for file | ||
| 451 | * descriptor and mach port based sources in order to safely close the | ||
| 452 | * descriptor or destroy the port. | ||
| 453 | * Closing the descriptor or port before the cancellation handler is invoked may | ||
| 454 | * result in a race condition. If a new descriptor is allocated with the same | ||
| 455 | * value as the recently closed descriptor while the source's event handler is | ||
| 456 | * still running, the event handler may read/write data to the wrong descriptor. | ||
| 457 | * | ||
| 458 | * @param source | ||
| 459 | * The dispatch source to modify. | ||
| 460 | * The result of passing NULL in this parameter is undefined. | ||
| 461 | * | ||
| 462 | * @param handler | ||
| 463 | * The cancellation handler block to submit to the source's target queue. | ||
| 464 | */ | ||
| 465 | #ifdef __BLOCKS__ | ||
| 466 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 467 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 468 | void | ||
| 469 | dispatch_source_set_cancel_handler(dispatch_source_t source, | ||
| 470 | 	dispatch_block_t _Nullable handler); | ||
| 471 | #endif /* __BLOCKS__ */ | ||
| 472 | |||
| 473 | /*! | ||
| 474 | * @function dispatch_source_set_cancel_handler_f | ||
| 475 | * | ||
| 476 | * @abstract | ||
| 477 | * Sets the cancellation handler function for the given dispatch source. | ||
| 478 | * | ||
| 479 | * @discussion | ||
| 480 | * See dispatch_source_set_cancel_handler() for more details. | ||
| 481 | * | ||
| 482 | * @param source | ||
| 483 | * The dispatch source to modify. | ||
| 484 | * The result of passing NULL in this parameter is undefined. | ||
| 485 | * | ||
| 486 | * @param handler | ||
| 487 | * The cancellation handler function to submit to the source's target queue. | ||
| 488 | * The context parameter passed to the event handler function is the current | ||
| 489 | * context of the dispatch source at the time the handler call is made. | ||
| 490 | */ | ||
| 491 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 492 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 493 | void | ||
| 494 | dispatch_source_set_cancel_handler_f(dispatch_source_t source, | ||
| 495 | 	dispatch_function_t _Nullable handler); | ||
| 496 | |||
| 497 | /*! | ||
| 498 | * @function dispatch_source_cancel | ||
| 499 | * | ||
| 500 | * @abstract | ||
| 501 | * Asynchronously cancel the dispatch source, preventing any further invocation | ||
| 502 | * of its event handler block. | ||
| 503 | * | ||
| 504 | * @discussion | ||
| 505 | * Cancellation prevents any further invocation of the event handler block for | ||
| 506 | * the specified dispatch source, but does not interrupt an event handler | ||
| 507 | * block that is already in progress. | ||
| 508 | * | ||
| 509 | * The cancellation handler is submitted to the source's target queue once the | ||
| 510 | * the source's event handler has finished, indicating it is now safe to close | ||
| 511 | * the source's handle (i.e. file descriptor or mach port). | ||
| 512 | * | ||
| 513 | * See dispatch_source_set_cancel_handler() for more information. | ||
| 514 | * | ||
| 515 | * @param source | ||
| 516 | * The dispatch source to be canceled. | ||
| 517 | * The result of passing NULL in this parameter is undefined. | ||
| 518 | */ | ||
| 519 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 520 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 521 | void | ||
| 522 | dispatch_source_cancel(dispatch_source_t source); | ||
| 523 | |||
| 524 | /*! | ||
| 525 | * @function dispatch_source_testcancel | ||
| 526 | * | ||
| 527 | * @abstract | ||
| 528 | * Tests whether the given dispatch source has been canceled. | ||
| 529 | * | ||
| 530 | * @param source | ||
| 531 | * The dispatch source to be tested. | ||
| 532 | * The result of passing NULL in this parameter is undefined. | ||
| 533 | * | ||
| 534 | * @result | ||
| 535 | * Non-zero if canceled and zero if not canceled. | ||
| 536 | */ | ||
| 537 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 538 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE | ||
| 539 | DISPATCH_NOTHROW | ||
| 540 | intptr_t | ||
| 541 | dispatch_source_testcancel(dispatch_source_t source); | ||
| 542 | |||
| 543 | /*! | ||
| 544 | * @function dispatch_source_get_handle | ||
| 545 | * | ||
| 546 | * @abstract | ||
| 547 | * Returns the underlying system handle associated with this dispatch source. | ||
| 548 | * | ||
| 549 | * @param source | ||
| 550 | * The result of passing NULL in this parameter is undefined. | ||
| 551 | * | ||
| 552 | * @result | ||
| 553 | * The return value should be interpreted according to the type of the dispatch | ||
| 554 | * source, and may be one of the following handles: | ||
| 555 | * | ||
| 556 | * DISPATCH_SOURCE_TYPE_DATA_ADD: n/a | ||
| 557 | * DISPATCH_SOURCE_TYPE_DATA_OR: n/a | ||
| 558 | * DISPATCH_SOURCE_TYPE_DATA_REPLACE: n/a | ||
| 559 | * DISPATCH_SOURCE_TYPE_MACH_SEND: mach port (mach_port_t) | ||
| 560 | * DISPATCH_SOURCE_TYPE_MACH_RECV: mach port (mach_port_t) | ||
| 561 | * DISPATCH_SOURCE_TYPE_MEMORYPRESSURE n/a | ||
| 562 | * DISPATCH_SOURCE_TYPE_PROC: process identifier (pid_t) | ||
| 563 | * DISPATCH_SOURCE_TYPE_READ: file descriptor (int) | ||
| 564 | * DISPATCH_SOURCE_TYPE_SIGNAL: signal number (int) | ||
| 565 | * DISPATCH_SOURCE_TYPE_TIMER: n/a | ||
| 566 | * DISPATCH_SOURCE_TYPE_VNODE: file descriptor (int) | ||
| 567 | * DISPATCH_SOURCE_TYPE_WRITE: file descriptor (int) | ||
| 568 | */ | ||
| 569 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 570 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE | ||
| 571 | DISPATCH_NOTHROW | ||
| 572 | uintptr_t | ||
| 573 | dispatch_source_get_handle(dispatch_source_t source); | ||
| 574 | |||
| 575 | /*! | ||
| 576 | * @function dispatch_source_get_mask | ||
| 577 | * | ||
| 578 | * @abstract | ||
| 579 | * Returns the mask of events monitored by the dispatch source. | ||
| 580 | * | ||
| 581 | * @param source | ||
| 582 | * The result of passing NULL in this parameter is undefined. | ||
| 583 | * | ||
| 584 | * @result | ||
| 585 | * The return value should be interpreted according to the type of the dispatch | ||
| 586 | * source, and may be one of the following flag sets: | ||
| 587 | * | ||
| 588 | * DISPATCH_SOURCE_TYPE_DATA_ADD: n/a | ||
| 589 | * DISPATCH_SOURCE_TYPE_DATA_OR: n/a | ||
| 590 | * DISPATCH_SOURCE_TYPE_DATA_REPLACE: n/a | ||
| 591 | * DISPATCH_SOURCE_TYPE_MACH_SEND: dispatch_source_mach_send_flags_t | ||
| 592 | * DISPATCH_SOURCE_TYPE_MACH_RECV: dispatch_source_mach_recv_flags_t | ||
| 593 | * DISPATCH_SOURCE_TYPE_MEMORYPRESSURE dispatch_source_memorypressure_flags_t | ||
| 594 | * DISPATCH_SOURCE_TYPE_PROC: dispatch_source_proc_flags_t | ||
| 595 | * DISPATCH_SOURCE_TYPE_READ: n/a | ||
| 596 | * DISPATCH_SOURCE_TYPE_SIGNAL: n/a | ||
| 597 | * DISPATCH_SOURCE_TYPE_TIMER: dispatch_source_timer_flags_t | ||
| 598 | * DISPATCH_SOURCE_TYPE_VNODE: dispatch_source_vnode_flags_t | ||
| 599 | * DISPATCH_SOURCE_TYPE_WRITE: n/a | ||
| 600 | */ | ||
| 601 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 602 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE | ||
| 603 | DISPATCH_NOTHROW | ||
| 604 | uintptr_t | ||
| 605 | dispatch_source_get_mask(dispatch_source_t source); | ||
| 606 | |||
| 607 | /*! | ||
| 608 | * @function dispatch_source_get_data | ||
| 609 | * | ||
| 610 | * @abstract | ||
| 611 | * Returns pending data for the dispatch source. | ||
| 612 | * | ||
| 613 | * @discussion | ||
| 614 | * This function is intended to be called from within the event handler block. | ||
| 615 | * The result of calling this function outside of the event handler callback is | ||
| 616 | * undefined. | ||
| 617 | * | ||
| 618 | * @param source | ||
| 619 | * The result of passing NULL in this parameter is undefined. | ||
| 620 | * | ||
| 621 | * @result | ||
| 622 | * The return value should be interpreted according to the type of the dispatch | ||
| 623 | * source, and may be one of the following: | ||
| 624 | * | ||
| 625 | * DISPATCH_SOURCE_TYPE_DATA_ADD: application defined data | ||
| 626 | * DISPATCH_SOURCE_TYPE_DATA_OR: application defined data | ||
| 627 | * DISPATCH_SOURCE_TYPE_DATA_REPLACE: application defined data | ||
| 628 | * DISPATCH_SOURCE_TYPE_MACH_SEND: dispatch_source_mach_send_flags_t | ||
| 629 | * DISPATCH_SOURCE_TYPE_MACH_RECV: dispatch_source_mach_recv_flags_t | ||
| 630 | * DISPATCH_SOURCE_TYPE_MEMORYPRESSURE dispatch_source_memorypressure_flags_t | ||
| 631 | * DISPATCH_SOURCE_TYPE_PROC: dispatch_source_proc_flags_t | ||
| 632 | * DISPATCH_SOURCE_TYPE_READ: estimated bytes available to read | ||
| 633 | * DISPATCH_SOURCE_TYPE_SIGNAL: number of signals delivered since | ||
| 634 | * the last handler invocation | ||
| 635 | * DISPATCH_SOURCE_TYPE_TIMER: number of times the timer has fired | ||
| 636 | * since the last handler invocation | ||
| 637 | * DISPATCH_SOURCE_TYPE_VNODE: dispatch_source_vnode_flags_t | ||
| 638 | * DISPATCH_SOURCE_TYPE_WRITE: estimated buffer space available | ||
| 639 | */ | ||
| 640 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 641 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE | ||
| 642 | DISPATCH_NOTHROW | ||
| 643 | uintptr_t | ||
| 644 | dispatch_source_get_data(dispatch_source_t source); | ||
| 645 | |||
| 646 | /*! | ||
| 647 | * @function dispatch_source_merge_data | ||
| 648 | * | ||
| 649 | * @abstract | ||
| 650 | * Merges data into a dispatch source of type DISPATCH_SOURCE_TYPE_DATA_ADD, | ||
| 651 | * DISPATCH_SOURCE_TYPE_DATA_OR or DISPATCH_SOURCE_TYPE_DATA_REPLACE, | ||
| 652 | * and submits its event handler block to its target queue. | ||
| 653 | * | ||
| 654 | * @param source | ||
| 655 | * The result of passing NULL in this parameter is undefined. | ||
| 656 | * | ||
| 657 | * @param value | ||
| 658 | * The value to coalesce with the pending data using a logical OR or an ADD | ||
| 659 | * as specified by the dispatch source type. A value of zero has no effect | ||
| 660 | * and will not result in the submission of the event handler block. | ||
| 661 | */ | ||
| 662 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 663 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 664 | void | ||
| 665 | dispatch_source_merge_data(dispatch_source_t source, uintptr_t value); | ||
| 666 | |||
| 667 | /*! | ||
| 668 | * @function dispatch_source_set_timer | ||
| 669 | * | ||
| 670 | * @abstract | ||
| 671 | * Sets a start time, interval, and leeway value for a timer source. | ||
| 672 | * | ||
| 673 | * @discussion | ||
| 674 | * Once this function returns, any pending source data accumulated for the | ||
| 675 | * previous timer values has been cleared; the next fire of the timer will | ||
| 676 | * occur at 'start', and every 'interval' nanoseconds thereafter until the | ||
| 677 | * timer source is canceled. | ||
| 678 | * | ||
| 679 | * Any fire of the timer may be delayed by the system in order to improve power | ||
| 680 | * consumption and system performance. The upper limit to the allowable delay | ||
| 681 | * may be configured with the 'leeway' argument, the lower limit is under the | ||
| 682 | * control of the system. | ||
| 683 | * | ||
| 684 | * For the initial timer fire at 'start', the upper limit to the allowable | ||
| 685 | * delay is set to 'leeway' nanoseconds. For the subsequent timer fires at | ||
| 686 | * 'start' + N * 'interval', the upper limit is MIN('leeway','interval'/2). | ||
| 687 | * | ||
| 688 | * The lower limit to the allowable delay may vary with process state such as | ||
| 689 | * visibility of application UI. If the specified timer source was created with | ||
| 690 | * a mask of DISPATCH_TIMER_STRICT, the system will make a best effort to | ||
| 691 | * strictly observe the provided 'leeway' value even if it is smaller than the | ||
| 692 | * current lower limit. Note that a minimal amount of delay is to be expected | ||
| 693 | * even if this flag is specified. | ||
| 694 | * | ||
| 695 | * The 'start' argument also determines which clock will be used for the timer: | ||
| 696 | * If 'start' is DISPATCH_TIME_NOW or was created with dispatch_time(3), the | ||
| 697 | * timer is based on up time (which is obtained from mach_absolute_time() on | ||
| 698 | * Apple platforms). If 'start' was created with dispatch_walltime(3), the | ||
| 699 | * timer is based on gettimeofday(3). | ||
| 700 | * | ||
| 701 | * Calling this function has no effect if the timer source has already been | ||
| 702 | * canceled. | ||
| 703 | * | ||
| 704 | * @param start | ||
| 705 | * The start time of the timer. See dispatch_time() and dispatch_walltime() | ||
| 706 | * for more information. | ||
| 707 | * | ||
| 708 | * @param interval | ||
| 709 | * The nanosecond interval for the timer. Use DISPATCH_TIME_FOREVER for a | ||
| 710 | * one-shot timer. | ||
| 711 | * | ||
| 712 | * @param leeway | ||
| 713 | * The nanosecond leeway for the timer. | ||
| 714 | */ | ||
| 715 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 716 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 717 | void | ||
| 718 | dispatch_source_set_timer(dispatch_source_t source, | ||
| 719 | 	dispatch_time_t start, | ||
| 720 | 	uint64_t interval, | ||
| 721 | 	uint64_t leeway); | ||
| 722 | |||
| 723 | /*! | ||
| 724 | * @function dispatch_source_set_registration_handler | ||
| 725 | * | ||
| 726 | * @abstract | ||
| 727 | * Sets the registration handler block for the given dispatch source. | ||
| 728 | * | ||
| 729 | * @discussion | ||
| 730 | * The registration handler (if specified) will be submitted to the source's | ||
| 731 | * target queue once the corresponding kevent() has been registered with the | ||
| 732 | * system, following the initial dispatch_resume() of the source. | ||
| 733 | * | ||
| 734 | * If a source is already registered when the registration handler is set, the | ||
| 735 | * registration handler will be invoked immediately. | ||
| 736 | * | ||
| 737 | * @param source | ||
| 738 | * The dispatch source to modify. | ||
| 739 | * The result of passing NULL in this parameter is undefined. | ||
| 740 | * | ||
| 741 | * @param handler | ||
| 742 | * The registration handler block to submit to the source's target queue. | ||
| 743 | */ | ||
| 744 | #ifdef __BLOCKS__ | ||
| 745 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 746 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 747 | void | ||
| 748 | dispatch_source_set_registration_handler(dispatch_source_t source, | ||
| 749 | 	dispatch_block_t _Nullable handler); | ||
| 750 | #endif /* __BLOCKS__ */ | ||
| 751 | |||
| 752 | /*! | ||
| 753 | * @function dispatch_source_set_registration_handler_f | ||
| 754 | * | ||
| 755 | * @abstract | ||
| 756 | * Sets the registration handler function for the given dispatch source. | ||
| 757 | * | ||
| 758 | * @discussion | ||
| 759 | * See dispatch_source_set_registration_handler() for more details. | ||
| 760 | * | ||
| 761 | * @param source | ||
| 762 | * The dispatch source to modify. | ||
| 763 | * The result of passing NULL in this parameter is undefined. | ||
| 764 | * | ||
| 765 | * @param handler | ||
| 766 | * The registration handler function to submit to the source's target queue. | ||
| 767 | * The context parameter passed to the registration handler function is the | ||
| 768 | * current context of the dispatch source at the time the handler call is made. | ||
| 769 | */ | ||
| 770 | API_AVAILABLE(macos(10.7), ios(4.3)) | ||
| 771 | DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW | ||
| 772 | void | ||
| 773 | dispatch_source_set_registration_handler_f(dispatch_source_t source, | ||
| 774 | 	dispatch_function_t _Nullable handler); | ||
| 775 | |||
| 776 | __END_DECLS | ||
| 777 | |||
| 778 | DISPATCH_ASSUME_NONNULL_END | ||
| 779 | |||
| 780 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/time.h created+136| ... | @@ -0,0 +1,136 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2011 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_TIME__ | ||
| 22 | #define __DISPATCH_TIME__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #include <stdint.h> | ||
| 30 | |||
| 31 | // <rdar://problem/6368156&7563559> | ||
| 32 | #if TARGET_OS_MAC | ||
| 33 | #include <mach/clock_types.h> | ||
| 34 | #endif | ||
| 35 | |||
| 36 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 37 | |||
| 38 | #ifdef NSEC_PER_SEC | ||
| 39 | #undef NSEC_PER_SEC | ||
| 40 | #endif | ||
| 41 | #ifdef USEC_PER_SEC | ||
| 42 | #undef USEC_PER_SEC | ||
| 43 | #endif | ||
| 44 | #ifdef NSEC_PER_USEC | ||
| 45 | #undef NSEC_PER_USEC | ||
| 46 | #endif | ||
| 47 | #ifdef NSEC_PER_MSEC | ||
| 48 | #undef NSEC_PER_MSEC | ||
| 49 | #endif | ||
| 50 | #define NSEC_PER_SEC 1000000000ull | ||
| 51 | #define NSEC_PER_MSEC 1000000ull | ||
| 52 | #define USEC_PER_SEC 1000000ull | ||
| 53 | #define NSEC_PER_USEC 1000ull | ||
| 54 | |||
| 55 | __BEGIN_DECLS | ||
| 56 | |||
| 57 | struct timespec; | ||
| 58 | |||
| 59 | /*! | ||
| 60 | * @typedef dispatch_time_t | ||
| 61 | * | ||
| 62 | * @abstract | ||
| 63 | * A somewhat abstract representation of time; where zero means "now" and | ||
| 64 | * DISPATCH_TIME_FOREVER means "infinity" and every value in between is an | ||
| 65 | * opaque encoding. | ||
| 66 | */ | ||
| 67 | typedef uint64_t dispatch_time_t; | ||
| 68 | |||
| 69 | enum { | ||
| 70 | 	DISPATCH_WALLTIME_NOW DISPATCH_ENUM_API_AVAILABLE | ||
| 71 | 			(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))	= ~1ull, | ||
| 72 | }; | ||
| 73 | |||
| 74 | #define DISPATCH_TIME_NOW (0ull) | ||
| 75 | #define DISPATCH_TIME_FOREVER (~0ull) | ||
| 76 | |||
| 77 | /*! | ||
| 78 | * @function dispatch_time | ||
| 79 | * | ||
| 80 | * @abstract | ||
| 81 | * Create a dispatch_time_t relative to the current value of the default or | ||
| 82 | * wall time clock, or modify an existing dispatch_time_t. | ||
| 83 | * | ||
| 84 | * @discussion | ||
| 85 | * On Apple platforms, the default clock is based on mach_absolute_time(). | ||
| 86 | * | ||
| 87 | * @param when | ||
| 88 | * An optional dispatch_time_t to add nanoseconds to. If DISPATCH_TIME_NOW is | ||
| 89 | * passed, then dispatch_time() will use the default clock (which is based on | ||
| 90 | * mach_absolute_time() on Apple platforms). If DISPATCH_WALLTIME_NOW is used, | ||
| 91 | * dispatch_time() will use the value returned by gettimeofday(3). | ||
| 92 | * dispatch_time(DISPATCH_WALLTIME_NOW, delta) is equivalent to | ||
| 93 | * dispatch_walltime(NULL, delta). | ||
| 94 | * | ||
| 95 | * @param delta | ||
| 96 | * Nanoseconds to add. | ||
| 97 | * | ||
| 98 | * @result | ||
| 99 | * A new dispatch_time_t. | ||
| 100 | */ | ||
| 101 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 102 | DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 103 | dispatch_time_t | ||
| 104 | dispatch_time(dispatch_time_t when, int64_t delta); | ||
| 105 | |||
| 106 | /*! | ||
| 107 | * @function dispatch_walltime | ||
| 108 | * | ||
| 109 | * @abstract | ||
| 110 | * Create a dispatch_time_t using the wall clock. | ||
| 111 | * | ||
| 112 | * @discussion | ||
| 113 | * On Mac OS X the wall clock is based on gettimeofday(3). | ||
| 114 | * | ||
| 115 | * @param when | ||
| 116 | * A struct timespec to add time to. If NULL is passed, then | ||
| 117 | * dispatch_walltime() will use the result of gettimeofday(3). | ||
| 118 | * dispatch_walltime(NULL, delta) returns the same value as | ||
| 119 | * dispatch_time(DISPATCH_WALLTIME_NOW, delta). | ||
| 120 | * | ||
| 121 | * @param delta | ||
| 122 | * Nanoseconds to add. | ||
| 123 | * | ||
| 124 | * @result | ||
| 125 | * A new dispatch_time_t. | ||
| 126 | */ | ||
| 127 | API_AVAILABLE(macos(10.6), ios(4.0)) | ||
| 128 | DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NOTHROW | ||
| 129 | dispatch_time_t | ||
| 130 | dispatch_walltime(const struct timespec *_Nullable when, int64_t delta); | ||
| 131 | |||
| 132 | __END_DECLS | ||
| 133 | |||
| 134 | DISPATCH_ASSUME_NONNULL_END | ||
| 135 | |||
| 136 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h created+163| ... | @@ -0,0 +1,163 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017-2019 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __DISPATCH_WORKLOOP__ | ||
| 22 | #define __DISPATCH_WORKLOOP__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_INDIRECT__ | ||
| 25 | #error "Please #include <dispatch/dispatch.h> instead of this file directly." | ||
| 26 | #include <dispatch/base.h> // for HeaderDoc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | DISPATCH_ASSUME_NONNULL_BEGIN | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | |||
| 33 | /*! | ||
| 34 | * @typedef dispatch_workloop_t | ||
| 35 | * | ||
| 36 | * @abstract | ||
| 37 | * Dispatch workloops invoke workitems submitted to them in priority order. | ||
| 38 | * | ||
| 39 | * @discussion | ||
| 40 | * A dispatch workloop is a flavor of dispatch_queue_t that is a priority | ||
| 41 | * ordered queue (using the QOS class of the submitted workitems as the | ||
| 42 | * ordering). | ||
| 43 | * | ||
| 44 | * Between each workitem invocation, the workloop will evaluate whether higher | ||
| 45 | * priority workitems have since been submitted, either directly to the | ||
| 46 | * workloop or to any queues that target the workloop, and execute these first. | ||
| 47 | * | ||
| 48 | * Serial queues targeting a workloop maintain FIFO execution of their | ||
| 49 | * workitems. However, the workloop may reorder workitems submitted to | ||
| 50 | * independent serial queues targeting it with respect to each other, | ||
| 51 | * based on their priorities, while preserving FIFO execution with respect to | ||
| 52 | * each serial queue. | ||
| 53 | * | ||
| 54 | * A dispatch workloop is a "subclass" of dispatch_queue_t which can be passed | ||
| 55 | * to all APIs accepting a dispatch queue, except for functions from the | ||
| 56 | * dispatch_sync() family. dispatch_async_and_wait() must be used for workloop | ||
| 57 | * objects. Functions from the dispatch_sync() family on queues targeting | ||
| 58 | * a workloop are still permitted but discouraged for performance reasons. | ||
| 59 | */ | ||
| 60 | DISPATCH_DECL_SUBCLASS(dispatch_workloop, dispatch_queue); | ||
| 61 | |||
| 62 | /*! | ||
| 63 | * @function dispatch_workloop_create | ||
| 64 | * | ||
| 65 | * @abstract | ||
| 66 | * Creates a new dispatch workloop to which workitems may be submitted. | ||
| 67 | * | ||
| 68 | * @param label | ||
| 69 | * A string label to attach to the workloop. | ||
| 70 | * | ||
| 71 | * @result | ||
| 72 | * The newly created dispatch workloop. | ||
| 73 | */ | ||
| 74 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 75 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 76 | DISPATCH_NOTHROW | ||
| 77 | dispatch_workloop_t | ||
| 78 | dispatch_workloop_create(const char *_Nullable label); | ||
| 79 | |||
| 80 | /*! | ||
| 81 | * @function dispatch_workloop_create_inactive | ||
| 82 | * | ||
| 83 | * @abstract | ||
| 84 | * Creates a new inactive dispatch workloop that can be setup and then | ||
| 85 | * activated. | ||
| 86 | * | ||
| 87 | * @discussion | ||
| 88 | * Creating an inactive workloop allows for it to receive further configuration | ||
| 89 | * before it is activated, and workitems can be submitted to it. | ||
| 90 | * | ||
| 91 | * Submitting workitems to an inactive workloop is undefined and will cause the | ||
| 92 | * process to be terminated. | ||
| 93 | * | ||
| 94 | * @param label | ||
| 95 | * A string label to attach to the workloop. | ||
| 96 | * | ||
| 97 | * @result | ||
| 98 | * The newly created dispatch workloop. | ||
| 99 | */ | ||
| 100 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 101 | DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT | ||
| 102 | DISPATCH_NOTHROW | ||
| 103 | dispatch_workloop_t | ||
| 104 | dispatch_workloop_create_inactive(const char *_Nullable label); | ||
| 105 | |||
| 106 | /*! | ||
| 107 | * @function dispatch_workloop_set_autorelease_frequency | ||
| 108 | * | ||
| 109 | * @abstract | ||
| 110 | * Sets the autorelease frequency of the workloop. | ||
| 111 | * | ||
| 112 | * @discussion | ||
| 113 | * See dispatch_queue_attr_make_with_autorelease_frequency(). | ||
| 114 | * The default policy for a workloop is | ||
| 115 | * DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM. | ||
| 116 | * | ||
| 117 | * @param workloop | ||
| 118 | * The dispatch workloop to modify. | ||
| 119 | * | ||
| 120 | * This workloop must be inactive, passing an activated object is undefined | ||
| 121 | * and will cause the process to be terminated. | ||
| 122 | * | ||
| 123 | * @param frequency | ||
| 124 | * The requested autorelease frequency. | ||
| 125 | */ | ||
| 126 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 127 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 128 | void | ||
| 129 | dispatch_workloop_set_autorelease_frequency(dispatch_workloop_t workloop, | ||
| 130 | 		dispatch_autorelease_frequency_t frequency); | ||
| 131 | |||
| 132 | /*! | ||
| 133 | * @function dispatch_workloop_set_os_workgroup | ||
| 134 | * | ||
| 135 | * @abstract | ||
| 136 | * Associates an os_workgroup_t with the specified dispatch workloop. | ||
| 137 | * | ||
| 138 | * The worker thread will be a member of the specified os_workgroup_t while executing | ||
| 139 | * work items submitted to the workloop. | ||
| 140 | * | ||
| 141 | * @param workloop | ||
| 142 | * The dispatch workloop to modify. | ||
| 143 | * | ||
| 144 | * This workloop must be inactive, passing an activated object is undefined | ||
| 145 | * and will cause the process to be terminated. | ||
| 146 | * | ||
| 147 | * @param workgroup | ||
| 148 | * The workgroup to associate with this workloop. | ||
| 149 | * | ||
| 150 | * The workgroup specified is retained and the previously associated workgroup | ||
| 151 | * (if any) is released. | ||
| 152 | */ | ||
| 153 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 154 | DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW | ||
| 155 | void | ||
| 156 | dispatch_workloop_set_os_workgroup(dispatch_workloop_t workloop, | ||
| 157 | 		os_workgroup_t workgroup); | ||
| 158 | |||
| 159 | __END_DECLS | ||
| 160 | |||
| 161 | DISPATCH_ASSUME_NONNULL_END | ||
| 162 | |||
| 163 | #endif | ||
lib/libc/include/x86_64-macos-gnu/dlfcn.h created+97| ... | @@ -0,0 +1,97 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | Based on the dlcompat work done by: | ||
| 26 | 		Jorge Acereda <jacereda@users.sourceforge.net> & | ||
| 27 | 		Peter O'Gorman <ogorman@users.sourceforge.net> | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef _DLFCN_H_ | ||
| 31 | #define _DLFCN_H_ | ||
| 32 | |||
| 33 | #ifdef __cplusplus | ||
| 34 | extern "C" { | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #include <sys/cdefs.h> | ||
| 38 | |||
| 39 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 40 | #include <stdbool.h> | ||
| 41 | #include <Availability.h> | ||
| 42 | |||
| 43 | #ifdef __DRIVERKIT_19_0 | ||
| 44 | #define __DYLDDL_DRIVERKIT_UNAVAILABLE __API_UNAVAILABLE(driverkit) | ||
| 45 | #else | ||
| 46 | #define __DYLDDL_DRIVERKIT_UNAVAILABLE | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Structure filled in by dladdr(). | ||
| 51 | */ | ||
| 52 | typedef struct dl_info { | ||
| 53 | const char *dli_fname; /* Pathname of shared object */ | ||
| 54 | void *dli_fbase; /* Base address of shared object */ | ||
| 55 | const char *dli_sname; /* Name of nearest symbol */ | ||
| 56 | void *dli_saddr; /* Address of nearest symbol */ | ||
| 57 | } Dl_info; | ||
| 58 | |||
| 59 | extern int dladdr(const void *, Dl_info *); | ||
| 60 | #else | ||
| 61 | #define __DYLDDL_DRIVERKIT_UNAVAILABLE | ||
| 62 | #endif /* not POSIX */ | ||
| 63 | |||
| 64 | extern int dlclose(void * __handle) __DYLDDL_DRIVERKIT_UNAVAILABLE; | ||
| 65 | extern char * dlerror(void) __DYLDDL_DRIVERKIT_UNAVAILABLE; | ||
| 66 | extern void * dlopen(const char * __path, int __mode) __DYLDDL_DRIVERKIT_UNAVAILABLE; | ||
| 67 | extern void * dlsym(void * __handle, const char * __symbol) __DYLDDL_DRIVERKIT_UNAVAILABLE; | ||
| 68 | |||
| 69 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 70 | extern bool dlopen_preflight(const char* __path) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) __DYLDDL_DRIVERKIT_UNAVAILABLE; | ||
| 71 | #endif /* not POSIX */ | ||
| 72 | |||
| 73 | |||
| 74 | #define RTLD_LAZY	0x1 | ||
| 75 | #define RTLD_NOW	0x2 | ||
| 76 | #define RTLD_LOCAL	0x4 | ||
| 77 | #define RTLD_GLOBAL	0x8 | ||
| 78 | |||
| 79 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 80 | #define RTLD_NOLOAD	0x10 | ||
| 81 | #define RTLD_NODELETE	0x80 | ||
| 82 | #define RTLD_FIRST	0x100	/* Mac OS X 10.5 and later */ | ||
| 83 | |||
| 84 | /* | ||
| 85 | * Special handle arguments for dlsym(). | ||
| 86 | */ | ||
| 87 | #define	RTLD_NEXT	((void *) -1)	/* Search subsequent objects. */ | ||
| 88 | #define	RTLD_DEFAULT	((void *) -2)	/* Use default search algorithm. */ | ||
| 89 | #define	RTLD_SELF	((void *) -3)	/* Search this and subsequent objects (Mac OS X 10.5 and later) */ | ||
| 90 | #define	RTLD_MAIN_ONLY	((void *) -5)	/* Search main executable only (Mac OS X 10.5 and later) */ | ||
| 91 | #endif /* not POSIX */ | ||
| 92 | |||
| 93 | #ifdef __cplusplus | ||
| 94 | } | ||
| 95 | #endif | ||
| 96 | |||
| 97 | #endif /* _DLFCN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/execinfo.h created+63| ... | @@ -0,0 +1,63 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #ifndef _EXECINFO_H_ | ||
| 24 | #define _EXECINFO_H_ 1 | ||
| 25 | |||
| 26 | #include <sys/cdefs.h> | ||
| 27 | #include <Availability.h> | ||
| 28 | #include <os/base.h> | ||
| 29 | #include <os/availability.h> | ||
| 30 | #include <stdint.h> | ||
| 31 | #include <uuid/uuid.h> | ||
| 32 | |||
| 33 | __BEGIN_DECLS | ||
| 34 | |||
| 35 | int backtrace(void**,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 36 | |||
| 37 | API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 38 | OS_EXPORT | ||
| 39 | int backtrace_from_fp(void *startfp, void **array, int size); | ||
| 40 | |||
| 41 | char** backtrace_symbols(void* const*,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 42 | void backtrace_symbols_fd(void* const*,int,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 43 | |||
| 44 | struct image_offset { | ||
| 45 | 	/* | ||
| 46 | 	 * The UUID of the image. | ||
| 47 | 	 */ | ||
| 48 | 	uuid_t uuid; | ||
| 49 | |||
| 50 | 	/* | ||
| 51 | 	 * The offset is relative to the __TEXT section of the image. | ||
| 52 | 	 */ | ||
| 53 | 	uint32_t offset; | ||
| 54 | }; | ||
| 55 | |||
| 56 | API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | ||
| 57 | OS_EXPORT | ||
| 58 | void backtrace_image_offsets(void* const* array, | ||
| 59 | 		struct image_offset *image_offsets, int size); | ||
| 60 | |||
| 61 | __END_DECLS | ||
| 62 | |||
| 63 | #endif /* !_EXECINFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/fcntl.h created+23| ... | @@ -0,0 +1,23 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #include <sys/fcntl.h> | ||
lib/libc/include/x86_64-macos-gnu/fmtmsg.h created+73| ... | @@ -0,0 +1,73 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer in the | ||
| 12 | * documentation and/or other materials provided with the distribution. | ||
| 13 | * | ||
| 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 24 | * SUCH DAMAGE. | ||
| 25 | * | ||
| 26 | * $FreeBSD: src/include/fmtmsg.h,v 1.2 2002/08/05 16:37:05 mike Exp $ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _FMTMSG_H_ | ||
| 30 | #define	_FMTMSG_H_ | ||
| 31 | |||
| 32 | /* Source of condition is... */ | ||
| 33 | #define	MM_HARD		0x0001	/* ...hardware. */ | ||
| 34 | #define	MM_SOFT		0x0002	/* ...software. */ | ||
| 35 | #define	MM_FIRM		0x0004	/* ...fireware. */ | ||
| 36 | |||
| 37 | /* Condition detected by... */ | ||
| 38 | #define	MM_APPL		0x0010	/* ...application. */ | ||
| 39 | #define	MM_UTIL		0x0020	/* ...utility. */ | ||
| 40 | #define	MM_OPSYS	0x0040	/* ...operating system. */ | ||
| 41 | |||
| 42 | /* Display on... */ | ||
| 43 | #define	MM_PRINT	0x0100	/* ...standard error. */ | ||
| 44 | #define	MM_CONSOLE	0x0200	/* ...system console. */ | ||
| 45 | |||
| 46 | #define	MM_RECOVER	0x1000	/* Recoverable error. */ | ||
| 47 | #define	MM_NRECOV	0x2000	/* Non-recoverable error. */ | ||
| 48 | |||
| 49 | /* Severity levels. */ | ||
| 50 | #define	MM_NOSEV	0	/* No severity level provided. */ | ||
| 51 | #define	MM_HALT		1	/* Error causing application to halt. */ | ||
| 52 | #define	MM_ERROR	2	/* Non-fault fault. */ | ||
| 53 | #define	MM_WARNING	3	/* Unusual non-error condition. */ | ||
| 54 | #define	MM_INFO		4	/* Informative message. */ | ||
| 55 | |||
| 56 | /* Null options. */ | ||
| 57 | #define	MM_NULLLBL	(char *)0 | ||
| 58 | #define	MM_NULLSEV	0 | ||
| 59 | #define	MM_NULLMC	0L | ||
| 60 | #define	MM_NULLTXT	(char *)0 | ||
| 61 | #define	MM_NULLACT	(char *)0 | ||
| 62 | #define	MM_NULLTAG	(char *)0 | ||
| 63 | |||
| 64 | /* Return values. */ | ||
| 65 | #define	MM_OK		0	/* Success. */ | ||
| 66 | #define	MM_NOMSG	1	/* Failed to output to stderr. */ | ||
| 67 | #define	MM_NOCON	2	/* Failed to output to console. */ | ||
| 68 | #define	MM_NOTOK	3	/* Failed to output anything. */ | ||
| 69 | |||
| 70 | int	fmtmsg(long, const char *, int, const char *, const char *, | ||
| 71 | 	 const char *); | ||
| 72 | |||
| 73 | #endif /* !_FMTMSG_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/fnmatch.h created+82| ... | @@ -0,0 +1,82 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1992, 1993 | ||
| 25 | *	The Regents of the University of California. All rights reserved. | ||
| 26 | * | ||
| 27 | * Redistribution and use in source and binary forms, with or without | ||
| 28 | * modification, are permitted provided that the following conditions | ||
| 29 | * are met: | ||
| 30 | * 1. Redistributions of source code must retain the above copyright | ||
| 31 | * notice, this list of conditions and the following disclaimer. | ||
| 32 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 33 | * notice, this list of conditions and the following disclaimer in the | ||
| 34 | * documentation and/or other materials provided with the distribution. | ||
| 35 | * 3. All advertising materials mentioning features or use of this software | ||
| 36 | * must display the following acknowledgement: | ||
| 37 | *	This product includes software developed by the University of | ||
| 38 | *	California, Berkeley and its contributors. | ||
| 39 | * 4. Neither the name of the University nor the names of its contributors | ||
| 40 | * may be used to endorse or promote products derived from this software | ||
| 41 | * without specific prior written permission. | ||
| 42 | * | ||
| 43 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 44 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 45 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 46 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 47 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 48 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 49 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 50 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 51 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 52 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 53 | * SUCH DAMAGE. | ||
| 54 | * | ||
| 55 | *	@(#)fnmatch.h	8.1 (Berkeley) 6/2/93 | ||
| 56 | */ | ||
| 57 | |||
| 58 | #ifndef	_FNMATCH_H_ | ||
| 59 | #define	_FNMATCH_H_ | ||
| 60 | |||
| 61 | #include <sys/cdefs.h> | ||
| 62 | |||
| 63 | #define	FNM_NOMATCH	1	/* Match failed. */ | ||
| 64 | |||
| 65 | #define	FNM_NOESCAPE	0x01	/* Disable backslash escaping. */ | ||
| 66 | #define	FNM_PATHNAME	0x02	/* Slash must be matched by slash. */ | ||
| 67 | #define	FNM_PERIOD	0x04	/* Period must be matched by period. */ | ||
| 68 | |||
| 69 | #define	FNM_NOSYS	(-1)	/* Reserved. */ | ||
| 70 | |||
| 71 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 72 | #define	FNM_LEADING_DIR	0x08	/* Ignore /<tail> after Imatch. */ | ||
| 73 | #define	FNM_CASEFOLD	0x10	/* Case insensitive search. */ | ||
| 74 | #define	FNM_IGNORECASE	FNM_CASEFOLD | ||
| 75 | #define	FNM_FILE_NAME	FNM_PATHNAME | ||
| 76 | #endif | ||
| 77 | |||
| 78 | __BEGIN_DECLS | ||
| 79 | int	 fnmatch(const char *, const char *, int) __DARWIN_ALIAS(fnmatch); | ||
| 80 | __END_DECLS | ||
| 81 | |||
| 82 | #endif /* !_FNMATCH_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/ftw.h created+60| ... | @@ -0,0 +1,60 @@ | ||
| 1 | /*	$OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp $	*/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com> | ||
| 5 | * | ||
| 6 | * Permission to use, copy, modify, and distribute this software for any | ||
| 7 | * purpose with or without fee is hereby granted, provided that the above | ||
| 8 | * copyright notice and this permission notice appear in all copies. | ||
| 9 | * | ||
| 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 17 | * | ||
| 18 | * Sponsored in part by the Defense Advanced Research Projects | ||
| 19 | * Agency (DARPA) and Air Force Research Laboratory, Air Force | ||
| 20 | * Materiel Command, USAF, under agreement number F39502-99-1-0512. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef	_FTW_H | ||
| 24 | #define	_FTW_H | ||
| 25 | |||
| 26 | #include <sys/stat.h> | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Valid flags for the 3rd argument to the function that is passed as the | ||
| 30 | * second argument to ftw(3) and nftw(3). Say it three times fast! | ||
| 31 | */ | ||
| 32 | #define	FTW_F		0	/* File. */ | ||
| 33 | #define	FTW_D		1	/* Directory. */ | ||
| 34 | #define	FTW_DNR		2	/* Directory without read permission. */ | ||
| 35 | #define	FTW_DP		3	/* Directory with subdirectories visited. */ | ||
| 36 | #define	FTW_NS		4	/* Unknown type; stat() failed. */ | ||
| 37 | #define	FTW_SL		5	/* Symbolic link. */ | ||
| 38 | #define	FTW_SLN		6	/* Sym link that names a nonexistent file. */ | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Flags for use as the 4th argument to nftw(3). These may be ORed together. | ||
| 42 | */ | ||
| 43 | #define	FTW_PHYS	0x01	/* Physical walk, don't follow sym links. */ | ||
| 44 | #define	FTW_MOUNT	0x02	/* The walk does not cross a mount point. */ | ||
| 45 | #define	FTW_DEPTH	0x04	/* Subdirs visited before the dir itself. */ | ||
| 46 | #define	FTW_CHDIR	0x08	/* Change to a directory before reading it. */ | ||
| 47 | |||
| 48 | struct FTW { | ||
| 49 | 	int base; | ||
| 50 | 	int level; | ||
| 51 | }; | ||
| 52 | |||
| 53 | __BEGIN_DECLS | ||
| 54 | int	ftw(const char *, int (*)(const char *, const struct stat *, int), int) | ||
| 55 | 	__DARWIN_ALIAS_I(ftw); | ||
| 56 | int	nftw(const char *, int (*)(const char *, const struct stat *, int, | ||
| 57 | 	 struct FTW *), int, int) __DARWIN_ALIAS_I(nftw); | ||
| 58 | __END_DECLS | ||
| 59 | |||
| 60 | #endif	/* !_FTW_H */ | ||
lib/libc/include/x86_64-macos-gnu/gethostuuid.h created+42| ... | @@ -0,0 +1,42 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef __GETHOSTUUID_H | ||
| 30 | #define __GETHOSTUUID_H | ||
| 31 | |||
| 32 | #include <sys/_types/_timespec.h> | ||
| 33 | #include <sys/_types/_uuid_t.h> | ||
| 34 | #include <Availability.h> | ||
| 35 | |||
| 36 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0) | ||
| 37 | int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0, "gethostuuid() is no longer supported"); | ||
| 38 | #else | ||
| 39 | int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA); | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #endif /* __GETHOSTUUID_H */ | ||
lib/libc/include/x86_64-macos-gnu/glob.h created+130| ... | @@ -0,0 +1,130 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1989, 1993 | ||
| 3 | *	The Regents of the University of California. All rights reserved. | ||
| 4 | * | ||
| 5 | * This code is derived from software contributed to Berkeley by | ||
| 6 | * Guido van Rossum. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. Neither the name of the University nor the names of its contributors | ||
| 17 | * may be used to endorse or promote products derived from this software | ||
| 18 | * without specific prior written permission. | ||
| 19 | * | ||
| 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 30 | * SUCH DAMAGE. | ||
| 31 | * | ||
| 32 | *	@(#)glob.h	8.1 (Berkeley) 6/2/93 | ||
| 33 | * $FreeBSD: /repoman/r/ncvs/src/include/glob.h,v 1.7 2002/07/17 04:58:09 mikeh Exp $ | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef _GLOB_H_ | ||
| 37 | #define	_GLOB_H_ | ||
| 38 | |||
| 39 | #include <_types.h> | ||
| 40 | #include <sys/cdefs.h> | ||
| 41 | #include <Availability.h> | ||
| 42 | #include <sys/_types/_size_t.h> | ||
| 43 | |||
| 44 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 45 | struct dirent; | ||
| 46 | struct stat; | ||
| 47 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 48 | typedef struct { | ||
| 49 | 	size_t gl_pathc;	/* Count of total paths so far. */ | ||
| 50 | 	int gl_matchc;		/* Count of paths matching pattern. */ | ||
| 51 | 	size_t gl_offs;		/* Reserved at beginning of gl_pathv. */ | ||
| 52 | 	int gl_flags;		/* Copy of flags parameter to glob. */ | ||
| 53 | 	char **gl_pathv;	/* List of paths matching pattern. */ | ||
| 54 | 				/* Copy of errfunc parameter to glob. */ | ||
| 55 | #ifdef __BLOCKS__ | ||
| 56 | 	union { | ||
| 57 | #endif /* __BLOCKS__ */ | ||
| 58 | 		int (*gl_errfunc)(const char *, int); | ||
| 59 | #ifdef __BLOCKS__ | ||
| 60 | 		int (^gl_errblk)(const char *, int); | ||
| 61 | 	}; | ||
| 62 | #endif /* __BLOCKS__ */ | ||
| 63 | |||
| 64 | 	/* | ||
| 65 | 	 * Alternate filesystem access methods for glob; replacement | ||
| 66 | 	 * versions of closedir(3), readdir(3), opendir(3), stat(2) | ||
| 67 | 	 * and lstat(2). | ||
| 68 | 	 */ | ||
| 69 | 	void (*gl_closedir)(void *); | ||
| 70 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 71 | 	struct dirent *(*gl_readdir)(void *); | ||
| 72 | #else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 73 | 	void *(*gl_readdir)(void *); | ||
| 74 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 75 | 	void *(*gl_opendir)(const char *); | ||
| 76 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 77 | 	int (*gl_lstat)(const char *, struct stat *); | ||
| 78 | 	int (*gl_stat)(const char *, struct stat *); | ||
| 79 | #else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 80 | 	int (*gl_lstat)(const char *, void *); | ||
| 81 | 	int (*gl_stat)(const char *, void *); | ||
| 82 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 83 | } glob_t; | ||
| 84 | |||
| 85 | /* Believed to have been introduced in 1003.2-1992 */ | ||
| 86 | #define	GLOB_APPEND	0x0001	/* Append to output from previous call. */ | ||
| 87 | #define	GLOB_DOOFFS	0x0002	/* Use gl_offs. */ | ||
| 88 | #define	GLOB_ERR	0x0004	/* Return on error. */ | ||
| 89 | #define	GLOB_MARK	0x0008	/* Append / to matching directories. */ | ||
| 90 | #define	GLOB_NOCHECK	0x0010	/* Return pattern itself if nothing matches. */ | ||
| 91 | #define	GLOB_NOSORT	0x0020	/* Don't sort. */ | ||
| 92 | #define	GLOB_NOESCAPE	0x2000	/* Disable backslash escaping. */ | ||
| 93 | |||
| 94 | /* Error values returned by glob(3) */ | ||
| 95 | #define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */ | ||
| 96 | #define	GLOB_ABORTED	(-2)	/* Unignored error. */ | ||
| 97 | #define	GLOB_NOMATCH	(-3)	/* No match and GLOB_NOCHECK was not set. */ | ||
| 98 | #define	GLOB_NOSYS	(-4)	/* Obsolete: source comptability only. */ | ||
| 99 | |||
| 100 | #define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */ | ||
| 101 | #define	GLOB_BRACE	0x0080	/* Expand braces ala csh. */ | ||
| 102 | #define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */ | ||
| 103 | #define	GLOB_NOMAGIC	0x0200	/* GLOB_NOCHECK without magic chars (csh). */ | ||
| 104 | #define	GLOB_QUOTE	0x0400	/* Quote special chars with \. */ | ||
| 105 | #define	GLOB_TILDE	0x0800	/* Expand tilde names from the passwd file. */ | ||
| 106 | #define	GLOB_LIMIT	0x1000	/* limit number of returned paths */ | ||
| 107 | #ifdef __BLOCKS__ | ||
| 108 | #define	_GLOB_ERR_BLOCK	0x80000000 /* (internal) error callback is a block */ | ||
| 109 | #endif /* __BLOCKS__ */ | ||
| 110 | |||
| 111 | /* source compatibility, these are the old names */ | ||
| 112 | #define GLOB_MAXPATH	GLOB_LIMIT | ||
| 113 | #define	GLOB_ABEND	GLOB_ABORTED | ||
| 114 | |||
| 115 | __BEGIN_DECLS | ||
| 116 | int	glob(const char * __restrict, int, int (*)(const char *, int), | ||
| 117 | 	 glob_t * __restrict) __DARWIN_INODE64(glob); | ||
| 118 | #ifdef __BLOCKS__ | ||
| 119 | #if __has_attribute(noescape) | ||
| 120 | #define __glob_noescape __attribute__((__noescape__)) | ||
| 121 | #else | ||
| 122 | #define __glob_noescape | ||
| 123 | #endif | ||
| 124 | int	glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape, | ||
| 125 | 	 glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 126 | #endif /* __BLOCKS__ */ | ||
| 127 | void	globfree(glob_t *); | ||
| 128 | __END_DECLS | ||
| 129 | |||
| 130 | #endif /* !_GLOB_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/grp.h created+93| ... | @@ -0,0 +1,93 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 1989, 1993 | ||
| 3 | *	The Regents of the University of California. All rights reserved. | ||
| 4 | * (c) UNIX System Laboratories, Inc. | ||
| 5 | * All or some portions of this file are derived from material licensed | ||
| 6 | * to the University of California by American Telephone and Telegraph | ||
| 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 8 | * the permission of UNIX System Laboratories, Inc. | ||
| 9 | * | ||
| 10 | * Redistribution and use in source and binary forms, with or without | ||
| 11 | * modification, are permitted provided that the following conditions | ||
| 12 | * are met: | ||
| 13 | * 1. Redistributions of source code must retain the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer. | ||
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | * notice, this list of conditions and the following disclaimer in the | ||
| 17 | * documentation and/or other materials provided with the distribution. | ||
| 18 | * 3. All advertising materials mentioning features or use of this software | ||
| 19 | * must display the following acknowledgement: | ||
| 20 | *	This product includes software developed by the University of | ||
| 21 | *	California, Berkeley and its contributors. | ||
| 22 | * 4. Neither the name of the University nor the names of its contributors | ||
| 23 | * may be used to endorse or promote products derived from this software | ||
| 24 | * without specific prior written permission. | ||
| 25 | * | ||
| 26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 36 | * SUCH DAMAGE. | ||
| 37 | * | ||
| 38 | *	@(#)grp.h	8.2 (Berkeley) 1/21/94 | ||
| 39 | */ | ||
| 40 | /* Portions copyright (c) 2000-2018 Apple Inc. All rights reserved. */ | ||
| 41 | |||
| 42 | #ifndef _GRP_H_ | ||
| 43 | #define	_GRP_H_ | ||
| 44 | |||
| 45 | #include <_types.h> | ||
| 46 | #include <sys/_types/_gid_t.h>	/* [XBD] */ | ||
| 47 | #include <sys/_types/_size_t.h> /* SUSv4 */ | ||
| 48 | |||
| 49 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 50 | #define	_PATH_GROUP		"/etc/group" | ||
| 51 | #endif | ||
| 52 | |||
| 53 | struct group { | ||
| 54 | 	char	*gr_name;		/* [XBD] group name */ | ||
| 55 | 	char	*gr_passwd;		/* [???] group password */ | ||
| 56 | 	gid_t	gr_gid;			/* [XBD] group id */ | ||
| 57 | 	char	**gr_mem;		/* [XBD] group members */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | #include <sys/cdefs.h> | ||
| 61 | |||
| 62 | __BEGIN_DECLS | ||
| 63 | /* [XBD] */ | ||
| 64 | struct group *getgrgid(gid_t); | ||
| 65 | struct group *getgrnam(const char *); | ||
| 66 | /* [TSF] */ | ||
| 67 | int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); | ||
| 68 | int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); | ||
| 69 | /* [XSI] */ | ||
| 70 | struct group *getgrent(void); | ||
| 71 | void setgrent(void); | ||
| 72 | void endgrent(void); | ||
| 73 | __END_DECLS | ||
| 74 | |||
| 75 | #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) | ||
| 76 | #include <uuid/uuid.h> | ||
| 77 | __BEGIN_DECLS | ||
| 78 | char *group_from_gid(gid_t, int); | ||
| 79 | struct group *getgruuid(uuid_t); | ||
| 80 | int getgruuid_r(uuid_t, struct group *, char *, size_t, struct group **); | ||
| 81 | __END_DECLS | ||
| 82 | #endif | ||
| 83 | |||
| 84 | #if !defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 85 | __BEGIN_DECLS | ||
| 86 | #if (!defined(LIBINFO_INSTALL_API) || !LIBINFO_INSTALL_API) | ||
| 87 | void setgrfile(const char *); | ||
| 88 | #endif | ||
| 89 | int setgroupent(int); | ||
| 90 | __END_DECLS | ||
| 91 | #endif | ||
| 92 | |||
| 93 | #endif /* !_GRP_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/hfs/hfs_format.h created+818| ... | @@ -0,0 +1,818 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2015 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef __HFS_FORMAT__ | ||
| 29 | #define __HFS_FORMAT__ | ||
| 30 | |||
| 31 | #include <sys/types.h> | ||
| 32 | #include <sys/appleapiopts.h> | ||
| 33 | #include "hfs_unistr.h" | ||
| 34 | |||
| 35 | /* | ||
| 36 | * hfs_format.h | ||
| 37 | * | ||
| 38 | * This file describes the on-disk format for HFS and HFS Plus volumes. | ||
| 39 | * | ||
| 40 | * Note: Starting 10.9, definition of struct HFSUniStr255 exists in hfs_unitstr.h | ||
| 41 | * | ||
| 42 | */ | ||
| 43 | |||
| 44 | #ifdef __cplusplus | ||
| 45 | extern "C" { | ||
| 46 | #endif | ||
| 47 | |||
| 48 | /* some on-disk hfs structures have 68K alignment (misaligned) */ | ||
| 49 | |||
| 50 | /* Signatures used to differentiate between HFS and HFS Plus volumes */ | ||
| 51 | enum { | ||
| 52 | 	kHFSSigWord		= 0x4244,	/* 'BD' in ASCII */ | ||
| 53 | 	kHFSPlusSigWord		= 0x482B,	/* 'H+' in ASCII */ | ||
| 54 | 	kHFSXSigWord		= 0x4858,	/* 'HX' in ASCII */ | ||
| 55 | |||
| 56 | 	kHFSPlusVersion		= 0x0004,	/* 'H+' volumes are version 4 only */ | ||
| 57 | 	kHFSXVersion		= 0x0005,	/* 'HX' volumes start with version 5 */ | ||
| 58 | |||
| 59 | 	kHFSPlusMountVersion	= 0x31302E30,	/* '10.0' for Mac OS X */ | ||
| 60 | 	kHFSJMountVersion	= 0x4846534a,	/* 'HFSJ' for journaled HFS+ on OS X */ | ||
| 61 | 	kFSKMountVersion	= 0x46534b21	/* 'FSK!' for failed journal replay */ | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | #ifdef __APPLE_API_PRIVATE | ||
| 66 | /* | ||
| 67 | * Mac OS X has two special directories on HFS+ volumes for hardlinked files | ||
| 68 | * and hardlinked directories as well as for open-unlinked files. | ||
| 69 | * | ||
| 70 | * These directories and their contents are not exported from the filesystem | ||
| 71 | * under Mac OS X. | ||
| 72 | */ | ||
| 73 | #define HFSPLUSMETADATAFOLDER "\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80HFS+ Private Data" | ||
| 74 | #define HFSPLUS_DIR_METADATA_FOLDER ".HFS+ Private Directory Data\xd" | ||
| 75 | |||
| 76 | /* | ||
| 77 | * Files in the "HFS+ Private Data" folder have one of the following prefixes | ||
| 78 | * followed by a decimal number (no leading zeros) for the file ID. | ||
| 79 | * | ||
| 80 | * Note: Earlier version of Mac OS X used a 32 bit random number for the link | ||
| 81 | * ref number instead of the file id. | ||
| 82 | * | ||
| 83 | * e.g. iNode7182000 and temp3296 | ||
| 84 | */ | ||
| 85 | #define HFS_INODE_PREFIX	"iNode" | ||
| 86 | #define HFS_DELETE_PREFIX	"temp" | ||
| 87 | |||
| 88 | /* | ||
| 89 | * Files in the ".HFS+ Private Directory Data" folder have the following | ||
| 90 | * prefix followed by a decimal number (no leading zeros) for the file ID. | ||
| 91 | * | ||
| 92 | * e.g. dir_555 | ||
| 93 | */ | ||
| 94 | #define HFS_DIRINODE_PREFIX	"dir_" | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Hardlink inodes save the head of the link chain in | ||
| 98 | * an extended attribute named FIRST_LINK_XATTR_NAME. | ||
| 99 | * The attribute data is the decimal value in ASCII | ||
| 100 | * of the cnid for the first link in the chain. | ||
| 101 | * | ||
| 102 | * This extended attribute is private (i.e. its not | ||
| 103 | * exported in the getxattr/listxattr POSIX APIs). | ||
| 104 | */ | ||
| 105 | #define FIRST_LINK_XATTR_NAME	"com.apple.system.hfs.firstlink" | ||
| 106 | #define FIRST_LINK_XATTR_REC_SIZE (sizeof(HFSPlusAttrData) - 2 + 12) | ||
| 107 | |||
| 108 | /* | ||
| 109 | * The name space ID for generating an HFS volume UUID | ||
| 110 | * | ||
| 111 | * B3E20F39-F292-11D6-97A4-00306543ECAC | ||
| 112 | */ | ||
| 113 | #define HFS_UUID_NAMESPACE_ID "\xB3\xE2\x0F\x39\xF2\x92\x11\xD6\x97\xA4\x00\x30\x65\x43\xEC\xAC" | ||
| 114 | |||
| 115 | #endif /* __APPLE_API_PRIVATE */ | ||
| 116 | |||
| 117 | /* | ||
| 118 | * Indirect link files (hard links) have the following type/creator. | ||
| 119 | */ | ||
| 120 | enum { | ||
| 121 | 	kHardLinkFileType = 0x686C6E6B, /* 'hlnk' */ | ||
| 122 | 	kHFSPlusCreator = 0x6866732B /* 'hfs+' */ | ||
| 123 | }; | ||
| 124 | |||
| 125 | |||
| 126 | /* | ||
| 127 | *	File type and creator for symbolic links | ||
| 128 | */ | ||
| 129 | enum { | ||
| 130 | kSymLinkFileType = 0x736C6E6B, /* 'slnk' */ | ||
| 131 | kSymLinkCreator = 0x72686170 /* 'rhap' */ | ||
| 132 | }; | ||
| 133 | |||
| 134 | |||
| 135 | enum { | ||
| 136 | 	kHFSMaxVolumeNameChars		= 27, | ||
| 137 | 	kHFSMaxFileNameChars		= 31, | ||
| 138 | 	kHFSPlusMaxFileNameChars	= 255 | ||
| 139 | }; | ||
| 140 | |||
| 141 | |||
| 142 | /* Extent overflow file data structures */ | ||
| 143 | |||
| 144 | /* HFS Extent key */ | ||
| 145 | struct HFSExtentKey { | ||
| 146 | 	u_int8_t 	keyLength;	/* length of key, excluding this field */ | ||
| 147 | 	u_int8_t 	forkType;	/* 0 = data fork, FF = resource fork */ | ||
| 148 | 	u_int32_t 	fileID;		/* file ID */ | ||
| 149 | 	u_int16_t 	startBlock;	/* first file allocation block number in this extent */ | ||
| 150 | } __attribute__((aligned(2), packed)); | ||
| 151 | typedef struct HFSExtentKey HFSExtentKey; | ||
| 152 | |||
| 153 | /* HFS Plus Extent key */ | ||
| 154 | struct HFSPlusExtentKey { | ||
| 155 | 	u_int16_t 	keyLength;		/* length of key, excluding this field */ | ||
| 156 | 	u_int8_t 	forkType;		/* 0 = data fork, FF = resource fork */ | ||
| 157 | 	u_int8_t 	pad;			/* make the other fields align on 32-bit boundary */ | ||
| 158 | 	u_int32_t 	fileID;			/* file ID */ | ||
| 159 | 	u_int32_t 	startBlock;		/* first file allocation block number in this extent */ | ||
| 160 | } __attribute__((aligned(2), packed)); | ||
| 161 | typedef struct HFSPlusExtentKey HFSPlusExtentKey; | ||
| 162 | |||
| 163 | /* Number of extent descriptors per extent record */ | ||
| 164 | enum { | ||
| 165 | 	kHFSExtentDensity	= 3, | ||
| 166 | 	kHFSPlusExtentDensity	= 8 | ||
| 167 | }; | ||
| 168 | |||
| 169 | /* HFS extent descriptor */ | ||
| 170 | struct HFSExtentDescriptor { | ||
| 171 | 	u_int16_t 	startBlock;		/* first allocation block */ | ||
| 172 | 	u_int16_t 	blockCount;		/* number of allocation blocks */ | ||
| 173 | } __attribute__((aligned(2), packed)); | ||
| 174 | typedef struct HFSExtentDescriptor HFSExtentDescriptor; | ||
| 175 | |||
| 176 | /* HFS Plus extent descriptor */ | ||
| 177 | struct HFSPlusExtentDescriptor { | ||
| 178 | 	u_int32_t 	startBlock;		/* first allocation block */ | ||
| 179 | 	u_int32_t 	blockCount;		/* number of allocation blocks */ | ||
| 180 | } __attribute__((aligned(2), packed)); | ||
| 181 | typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor; | ||
| 182 | |||
| 183 | /* HFS extent record */ | ||
| 184 | typedef HFSExtentDescriptor HFSExtentRecord[3]; | ||
| 185 | |||
| 186 | /* HFS Plus extent record */ | ||
| 187 | typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; | ||
| 188 | |||
| 189 | |||
| 190 | /* Finder information */ | ||
| 191 | struct FndrFileInfo { | ||
| 192 | 	u_int32_t 	fdType;		/* file type */ | ||
| 193 | 	u_int32_t 	fdCreator;	/* file creator */ | ||
| 194 | 	u_int16_t 	fdFlags;	/* Finder flags */ | ||
| 195 | 	struct { | ||
| 196 | 	 int16_t	v;		/* file's location */ | ||
| 197 | 	 int16_t	h; | ||
| 198 | 	} fdLocation; | ||
| 199 | 	int16_t 	opaque; | ||
| 200 | } __attribute__((aligned(2), packed)); | ||
| 201 | typedef struct FndrFileInfo FndrFileInfo; | ||
| 202 | |||
| 203 | struct FndrDirInfo { | ||
| 204 | 	struct {			/* folder's window rectangle */ | ||
| 205 | 	 int16_t	top; | ||
| 206 | 	 int16_t	left; | ||
| 207 | 	 int16_t	bottom; | ||
| 208 | 	 int16_t	right; | ||
| 209 | 	} frRect; | ||
| 210 | 	unsigned short 	frFlags;	/* Finder flags */ | ||
| 211 | 	struct { | ||
| 212 | 	 u_int16_t	v;		/* folder's location */ | ||
| 213 | 	 u_int16_t	h; | ||
| 214 | 	} frLocation; | ||
| 215 | 	int16_t 	opaque; | ||
| 216 | } __attribute__((aligned(2), packed)); | ||
| 217 | typedef struct FndrDirInfo FndrDirInfo; | ||
| 218 | |||
| 219 | struct FndrOpaqueInfo { | ||
| 220 | 	int8_t opaque[16]; | ||
| 221 | } __attribute__((aligned(2), packed)); | ||
| 222 | typedef struct FndrOpaqueInfo FndrOpaqueInfo; | ||
| 223 | |||
| 224 | struct FndrExtendedDirInfo { | ||
| 225 | 	u_int32_t document_id; | ||
| 226 | 	u_int32_t date_added; | ||
| 227 | 	u_int16_t extended_flags; | ||
| 228 | 	u_int16_t reserved3; | ||
| 229 | 	u_int32_t write_gen_counter; | ||
| 230 | } __attribute__((aligned(2), packed)); | ||
| 231 | |||
| 232 | struct FndrExtendedFileInfo { | ||
| 233 | 	u_int32_t document_id; | ||
| 234 | 	u_int32_t date_added; | ||
| 235 | 	u_int16_t extended_flags; | ||
| 236 | 	u_int16_t reserved2; | ||
| 237 | 	u_int32_t write_gen_counter; | ||
| 238 | } __attribute__((aligned(2), packed)); | ||
| 239 | |||
| 240 | /* HFS Plus Fork data info - 80 bytes */ | ||
| 241 | struct HFSPlusForkData { | ||
| 242 | 	u_int64_t 		logicalSize;	/* fork's logical size in bytes */ | ||
| 243 | 	u_int32_t 		clumpSize;	/* fork's clump size in bytes */ | ||
| 244 | 	u_int32_t 		totalBlocks;	/* total blocks used by this fork */ | ||
| 245 | 	HFSPlusExtentRecord 	extents;	/* initial set of extents */ | ||
| 246 | } __attribute__((aligned(2), packed)); | ||
| 247 | typedef struct HFSPlusForkData HFSPlusForkData; | ||
| 248 | |||
| 249 | |||
| 250 | /* Mac OS X has 16 bytes worth of "BSD" info. | ||
| 251 | * | ||
| 252 | * Note: Mac OS 9 implementations and applications | ||
| 253 | * should preserve, but not change, this information. | ||
| 254 | */ | ||
| 255 | struct HFSPlusBSDInfo { | ||
| 256 | 	u_int32_t 	ownerID;	/* user-id of owner or hard link chain previous link */ | ||
| 257 | 	u_int32_t 	groupID;	/* group-id of owner or hard link chain next link */ | ||
| 258 | 	u_int8_t 	adminFlags;	/* super-user changeable flags */ | ||
| 259 | 	u_int8_t 	ownerFlags;	/* owner changeable flags */ | ||
| 260 | 	u_int16_t 	fileMode;	/* file type and permission bits */ | ||
| 261 | 	union { | ||
| 262 | 	 u_int32_t	iNodeNum;	/* indirect node number (hard links only) */ | ||
| 263 | 	 u_int32_t	linkCount;	/* links that refer to this indirect node */ | ||
| 264 | 	 u_int32_t	rawDevice;	/* special file device (FBLK and FCHR only) */ | ||
| 265 | 	} special; | ||
| 266 | } __attribute__((aligned(2), packed)); | ||
| 267 | typedef struct HFSPlusBSDInfo HFSPlusBSDInfo; | ||
| 268 | |||
| 269 | /* | ||
| 270 | * Hardlink "links" resolve to an inode | ||
| 271 | * and the actual uid/gid comes from that | ||
| 272 | * inode. | ||
| 273 | * | ||
| 274 | * We repurpose the links's uid/gid fields | ||
| 275 | * for the hardlink link chain. The chain | ||
| 276 | * consists of a doubly linked list of file | ||
| 277 | * ids. | ||
| 278 | */ | ||
| 279 | |||
| 280 | #define hl_firstLinkID reserved1 /* Valid only if HasLinkChain flag is set (indirect nodes only) */ | ||
| 281 | |||
| 282 | #define hl_prevLinkID bsdInfo.ownerID /* Valid only if HasLinkChain flag is set */ | ||
| 283 | #define hl_nextLinkID bsdInfo.groupID /* Valid only if HasLinkChain flag is set */ | ||
| 284 | |||
| 285 | #define hl_linkReference bsdInfo.special.iNodeNum | ||
| 286 | #define hl_linkCount bsdInfo.special.linkCount | ||
| 287 | |||
| 288 | |||
| 289 | /* Catalog file data structures */ | ||
| 290 | |||
| 291 | enum { | ||
| 292 | 	kHFSRootParentID		= 1,	/* Parent ID of the root folder */ | ||
| 293 | 	kHFSRootFolderID		= 2,	/* Folder ID of the root folder */ | ||
| 294 | 	kHFSExtentsFileID		= 3,	/* File ID of the extents file */ | ||
| 295 | 	kHFSCatalogFileID		= 4,	/* File ID of the catalog file */ | ||
| 296 | 	kHFSBadBlockFileID		= 5,	/* File ID of the bad allocation block file */ | ||
| 297 | 	kHFSAllocationFileID		= 6,	/* File ID of the allocation file (HFS Plus only) */ | ||
| 298 | 	kHFSStartupFileID		= 7,	/* File ID of the startup file (HFS Plus only) */ | ||
| 299 | 	kHFSAttributesFileID		= 8,	/* File ID of the attribute file (HFS Plus only) */ | ||
| 300 | 	kHFSAttributeDataFileID = 13,	/* Used in Mac OS X runtime for extent based attributes */ | ||
| 301 | 	 /* kHFSAttributeDataFileID is never stored on disk. */ | ||
| 302 | 	kHFSRepairCatalogFileID		= 14,	/* Used when rebuilding Catalog B-tree */ | ||
| 303 | 	kHFSBogusExtentFileID		= 15,	/* Used for exchanging extents in extents file */ | ||
| 304 | 	kHFSFirstUserCatalogNodeID	= 16 | ||
| 305 | }; | ||
| 306 | |||
| 307 | /* HFS catalog key */ | ||
| 308 | struct HFSCatalogKey { | ||
| 309 | 	u_int8_t 	keyLength;		/* key length (in bytes) */ | ||
| 310 | 	u_int8_t 	reserved;		/* reserved (set to zero) */ | ||
| 311 | 	u_int32_t 	parentID;		/* parent folder ID */ | ||
| 312 | 	u_int8_t 	nodeName[kHFSMaxFileNameChars + 1]; /* catalog node name */ | ||
| 313 | } __attribute__((aligned(2), packed)); | ||
| 314 | typedef struct HFSCatalogKey HFSCatalogKey; | ||
| 315 | |||
| 316 | /* HFS Plus catalog key */ | ||
| 317 | struct HFSPlusCatalogKey { | ||
| 318 | 	u_int16_t 		keyLength;	/* key length (in bytes) */ | ||
| 319 | 	u_int32_t 		parentID;	/* parent folder ID */ | ||
| 320 | 	HFSUniStr255 		nodeName;	/* catalog node name */ | ||
| 321 | } __attribute__((aligned(2), packed)); | ||
| 322 | typedef struct HFSPlusCatalogKey HFSPlusCatalogKey; | ||
| 323 | |||
| 324 | /* Catalog record types */ | ||
| 325 | enum { | ||
| 326 | 	/* HFS Catalog Records */ | ||
| 327 | 	kHFSFolderRecord		= 0x0100,	/* Folder record */ | ||
| 328 | 	kHFSFileRecord			= 0x0200,	/* File record */ | ||
| 329 | 	kHFSFolderThreadRecord		= 0x0300,	/* Folder thread record */ | ||
| 330 | 	kHFSFileThreadRecord		= 0x0400,	/* File thread record */ | ||
| 331 | |||
| 332 | 	/* HFS Plus Catalog Records */ | ||
| 333 | 	kHFSPlusFolderRecord		= 1,		/* Folder record */ | ||
| 334 | 	kHFSPlusFileRecord		= 2,		/* File record */ | ||
| 335 | 	kHFSPlusFolderThreadRecord	= 3,		/* Folder thread record */ | ||
| 336 | 	kHFSPlusFileThreadRecord	= 4		/* File thread record */ | ||
| 337 | }; | ||
| 338 | |||
| 339 | |||
| 340 | /* Catalog file record flags */ | ||
| 341 | enum { | ||
| 342 | 	kHFSFileLockedBit	= 0x0000,	/* file is locked and cannot be written to */ | ||
| 343 | 	kHFSFileLockedMask	= 0x0001, | ||
| 344 | |||
| 345 | 	kHFSThreadExistsBit	= 0x0001,	/* a file thread record exists for this file */ | ||
| 346 | 	kHFSThreadExistsMask	= 0x0002, | ||
| 347 | |||
| 348 | 	kHFSHasAttributesBit	= 0x0002,	/* object has extended attributes */ | ||
| 349 | 	kHFSHasAttributesMask	= 0x0004, | ||
| 350 | |||
| 351 | 	kHFSHasSecurityBit	= 0x0003,	/* object has security data (ACLs) */ | ||
| 352 | 	kHFSHasSecurityMask	= 0x0008, | ||
| 353 | |||
| 354 | 	kHFSHasFolderCountBit	= 0x0004,	/* only for HFSX, folder maintains a separate sub-folder count */ | ||
| 355 | 	kHFSHasFolderCountMask	= 0x0010,	/* (sum of folder records and directory hard links) */ | ||
| 356 | |||
| 357 | 	kHFSHasLinkChainBit	= 0x0005,	/* has hardlink chain (inode or link) */ | ||
| 358 | 	kHFSHasLinkChainMask	= 0x0020, | ||
| 359 | |||
| 360 | 	kHFSHasChildLinkBit	= 0x0006,	/* folder has a child that's a dir link */ | ||
| 361 | 	kHFSHasChildLinkMask	= 0x0040, | ||
| 362 | |||
| 363 | 	kHFSHasDateAddedBit = 0x0007,	/* File/Folder has the date-added stored in the finder info. */ | ||
| 364 | 	kHFSHasDateAddedMask = 0x0080, | ||
| 365 | |||
| 366 | 	kHFSFastDevPinnedBit = 0x0008, /* this file has been pinned to the fast-device by the hot-file code on cooperative fusion */ | ||
| 367 | 	kHFSFastDevPinnedMask = 0x0100, | ||
| 368 | |||
| 369 | 	kHFSDoNotFastDevPinBit = 0x0009, /* this file can not be pinned to the fast-device */ | ||
| 370 | 	kHFSDoNotFastDevPinMask = 0x0200, | ||
| 371 | |||
| 372 | 	kHFSFastDevCandidateBit = 0x000a, /* this item is a potential candidate for fast-dev pinning (as are any of its descendents */ | ||
| 373 | 	kHFSFastDevCandidateMask = 0x0400, | ||
| 374 | |||
| 375 | 	kHFSAutoCandidateBit = 0x000b, /* this item was automatically marked as a fast-dev candidate by the kernel */ | ||
| 376 | 	kHFSAutoCandidateMask = 0x0800 | ||
| 377 | |||
| 378 | 	// There are only 4 flag bits remaining: 0x1000, 0x2000, 0x4000, 0x8000 | ||
| 379 | |||
| 380 | }; | ||
| 381 | |||
| 382 | |||
| 383 | /* HFS catalog folder record - 70 bytes */ | ||
| 384 | struct HFSCatalogFolder { | ||
| 385 | 	int16_t 		recordType;		/* == kHFSFolderRecord */ | ||
| 386 | 	u_int16_t 		flags;			/* folder flags */ | ||
| 387 | 	u_int16_t 		valence;		/* folder valence */ | ||
| 388 | 	u_int32_t		folderID;		/* folder ID */ | ||
| 389 | 	u_int32_t 		createDate;		/* date and time of creation */ | ||
| 390 | 	u_int32_t 		modifyDate;		/* date and time of last modification */ | ||
| 391 | 	u_int32_t 		backupDate;		/* date and time of last backup */ | ||
| 392 | 	FndrDirInfo 		userInfo;		/* Finder information */ | ||
| 393 | 	FndrOpaqueInfo		finderInfo;		/* additional Finder information */ | ||
| 394 | 	u_int32_t 		reserved[4];		/* reserved - initialized as zero */ | ||
| 395 | } __attribute__((aligned(2), packed)); | ||
| 396 | typedef struct HFSCatalogFolder HFSCatalogFolder; | ||
| 397 | |||
| 398 | /* HFS Plus catalog folder record - 88 bytes */ | ||
| 399 | struct HFSPlusCatalogFolder { | ||
| 400 | 	int16_t 		recordType;		/* == kHFSPlusFolderRecord */ | ||
| 401 | 	u_int16_t 		flags;			/* file flags */ | ||
| 402 | 	u_int32_t 		valence;		/* folder's item count */ | ||
| 403 | 	u_int32_t 		folderID;		/* folder ID */ | ||
| 404 | 	u_int32_t 		createDate;		/* date and time of creation */ | ||
| 405 | 	u_int32_t 		contentModDate;		/* date and time of last content modification */ | ||
| 406 | 	u_int32_t 		attributeModDate;	/* date and time of last attribute modification */ | ||
| 407 | 	u_int32_t 		accessDate;		/* date and time of last access (MacOS X only) */ | ||
| 408 | 	u_int32_t 		backupDate;		/* date and time of last backup */ | ||
| 409 | 	HFSPlusBSDInfo		bsdInfo;		/* permissions (for MacOS X) */ | ||
| 410 | 	FndrDirInfo 		userInfo;		/* Finder information */ | ||
| 411 | 	FndrOpaqueInfo	 	finderInfo;		/* additional Finder information */ | ||
| 412 | 	u_int32_t 		textEncoding;		/* hint for name conversions */ | ||
| 413 | 	u_int32_t 		folderCount;		/* number of enclosed folders, active when HasFolderCount is set */ | ||
| 414 | } __attribute__((aligned(2), packed)); | ||
| 415 | typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder; | ||
| 416 | |||
| 417 | /* HFS catalog file record - 102 bytes */ | ||
| 418 | struct HFSCatalogFile { | ||
| 419 | 	int16_t 		recordType;		/* == kHFSFileRecord */ | ||
| 420 | 	u_int8_t 		flags;			/* file flags */ | ||
| 421 | 	int8_t 			fileType;		/* file type (unused ?) */ | ||
| 422 | 	FndrFileInfo 		userInfo;		/* Finder information */ | ||
| 423 | 	u_int32_t 		fileID;			/* file ID */ | ||
| 424 | 	u_int16_t 		dataStartBlock;		/* not used - set to zero */ | ||
| 425 | 	int32_t 		dataLogicalSize;	/* logical EOF of data fork */ | ||
| 426 | 	int32_t 		dataPhysicalSize;	/* physical EOF of data fork */ | ||
| 427 | 	u_int16_t		rsrcStartBlock;		/* not used - set to zero */ | ||
| 428 | 	int32_t			rsrcLogicalSize;	/* logical EOF of resource fork */ | ||
| 429 | 	int32_t			rsrcPhysicalSize;	/* physical EOF of resource fork */ | ||
| 430 | 	u_int32_t		createDate;		/* date and time of creation */ | ||
| 431 | 	u_int32_t		modifyDate;		/* date and time of last modification */ | ||
| 432 | 	u_int32_t		backupDate;		/* date and time of last backup */ | ||
| 433 | 	FndrOpaqueInfo		finderInfo;		/* additional Finder information */ | ||
| 434 | 	u_int16_t		clumpSize;		/* file clump size (not used) */ | ||
| 435 | 	HFSExtentRecord		dataExtents;		/* first data fork extent record */ | ||
| 436 | 	HFSExtentRecord		rsrcExtents;		/* first resource fork extent record */ | ||
| 437 | 	u_int32_t		reserved;		/* reserved - initialized as zero */ | ||
| 438 | } __attribute__((aligned(2), packed)); | ||
| 439 | typedef struct HFSCatalogFile HFSCatalogFile; | ||
| 440 | |||
| 441 | /* HFS Plus catalog file record - 248 bytes */ | ||
| 442 | struct HFSPlusCatalogFile { | ||
| 443 | 	int16_t 		recordType;		/* == kHFSPlusFileRecord */ | ||
| 444 | 	u_int16_t 		flags;			/* file flags */ | ||
| 445 | 	u_int32_t 		reserved1;		/* reserved - initialized as zero */ | ||
| 446 | 	u_int32_t 		fileID;			/* file ID */ | ||
| 447 | 	u_int32_t 		createDate;		/* date and time of creation */ | ||
| 448 | 	u_int32_t 		contentModDate;		/* date and time of last content modification */ | ||
| 449 | 	u_int32_t 		attributeModDate;	/* date and time of last attribute modification */ | ||
| 450 | 	u_int32_t 		accessDate;		/* date and time of last access (MacOS X only) */ | ||
| 451 | 	u_int32_t 		backupDate;		/* date and time of last backup */ | ||
| 452 | 	HFSPlusBSDInfo 		bsdInfo;		/* permissions (for MacOS X) */ | ||
| 453 | 	FndrFileInfo 		userInfo;		/* Finder information */ | ||
| 454 | 	FndrOpaqueInfo	 	finderInfo;		/* additional Finder information */ | ||
| 455 | 	u_int32_t 		textEncoding;		/* hint for name conversions */ | ||
| 456 | 	u_int32_t 		reserved2;		/* reserved - initialized as zero */ | ||
| 457 | |||
| 458 | 	/* Note: these start on double long (64 bit) boundary */ | ||
| 459 | 	HFSPlusForkData 	dataFork;		/* size and block data for data fork */ | ||
| 460 | 	HFSPlusForkData 	resourceFork;		/* size and block data for resource fork */ | ||
| 461 | } __attribute__((aligned(2), packed)); | ||
| 462 | typedef struct HFSPlusCatalogFile HFSPlusCatalogFile; | ||
| 463 | |||
| 464 | /* HFS catalog thread record - 46 bytes */ | ||
| 465 | struct HFSCatalogThread { | ||
| 466 | 	int16_t 	recordType;		/* == kHFSFolderThreadRecord or kHFSFileThreadRecord */ | ||
| 467 | 	int32_t 	reserved[2];		/* reserved - initialized as zero */ | ||
| 468 | 	u_int32_t 	parentID;		/* parent ID for this catalog node */ | ||
| 469 | 	u_int8_t 	nodeName[kHFSMaxFileNameChars + 1]; /* name of this catalog node */ | ||
| 470 | } __attribute__((aligned(2), packed)); | ||
| 471 | typedef struct HFSCatalogThread HFSCatalogThread; | ||
| 472 | |||
| 473 | /* HFS Plus catalog thread record -- 264 bytes */ | ||
| 474 | struct HFSPlusCatalogThread { | ||
| 475 | 	int16_t 	recordType;		/* == kHFSPlusFolderThreadRecord or kHFSPlusFileThreadRecord */ | ||
| 476 | 	int16_t 	reserved;		/* reserved - initialized as zero */ | ||
| 477 | 	u_int32_t 	parentID;		/* parent ID for this catalog node */ | ||
| 478 | 	HFSUniStr255 	nodeName;		/* name of this catalog node (variable length) */ | ||
| 479 | } __attribute__((aligned(2), packed)); | ||
| 480 | typedef struct HFSPlusCatalogThread HFSPlusCatalogThread; | ||
| 481 | |||
| 482 | #ifdef __APPLE_API_UNSTABLE | ||
| 483 | /* | ||
| 484 | * 	These are the types of records in the attribute B-tree. The values were | ||
| 485 | * 	chosen so that they wouldn't conflict with the catalog record types. | ||
| 486 | */ | ||
| 487 | enum { | ||
| 488 | 	kHFSPlusAttrInlineData	= 0x10, /* attributes whose data fits in a b-tree node */ | ||
| 489 | 	kHFSPlusAttrForkData	= 0x20, /* extent based attributes (data lives in extents) */ | ||
| 490 | 	kHFSPlusAttrExtents	= 0x30 /* overflow extents for large attributes */ | ||
| 491 | }; | ||
| 492 | |||
| 493 | |||
| 494 | /* | ||
| 495 | * 	HFSPlusAttrForkData | ||
| 496 | * 	For larger attributes, whose value is stored in allocation blocks. | ||
| 497 | * 	If the attribute has more than 8 extents, there will be additional | ||
| 498 | * 	records (of type HFSPlusAttrExtents) for this attribute. | ||
| 499 | */ | ||
| 500 | struct HFSPlusAttrForkData { | ||
| 501 | 	u_int32_t 	recordType;		/* == kHFSPlusAttrForkData*/ | ||
| 502 | 	u_int32_t 	reserved; | ||
| 503 | 	HFSPlusForkData theFork;		/* size and first extents of value*/ | ||
| 504 | } __attribute__((aligned(2), packed)); | ||
| 505 | typedef struct HFSPlusAttrForkData HFSPlusAttrForkData; | ||
| 506 | |||
| 507 | /* | ||
| 508 | * 	HFSPlusAttrExtents | ||
| 509 | * 	This record contains information about overflow extents for large, | ||
| 510 | * 	fragmented attributes. | ||
| 511 | */ | ||
| 512 | struct HFSPlusAttrExtents { | ||
| 513 | 	u_int32_t 		recordType;	/* == kHFSPlusAttrExtents*/ | ||
| 514 | 	u_int32_t 		reserved; | ||
| 515 | 	HFSPlusExtentRecord	extents;	/* additional extents*/ | ||
| 516 | } __attribute__((aligned(2), packed)); | ||
| 517 | typedef struct HFSPlusAttrExtents HFSPlusAttrExtents; | ||
| 518 | |||
| 519 | /* | ||
| 520 | * Atrributes B-tree Data Record | ||
| 521 | * | ||
| 522 | * For small attributes, whose entire value is stored | ||
| 523 | * within a single B-tree record. | ||
| 524 | */ | ||
| 525 | struct HFSPlusAttrData { | ||
| 526 | 	u_int32_t recordType; /* == kHFSPlusAttrInlineData */ | ||
| 527 | 	u_int32_t reserved[2]; | ||
| 528 | 	u_int32_t attrSize; /* size of attribute data in bytes */ | ||
| 529 | 	u_int8_t attrData[2]; /* variable length */ | ||
| 530 | } __attribute__((aligned(2), packed)); | ||
| 531 | typedef struct HFSPlusAttrData HFSPlusAttrData; | ||
| 532 | |||
| 533 | |||
| 534 | /* HFSPlusAttrInlineData is obsolete use HFSPlusAttrData instead */ | ||
| 535 | struct HFSPlusAttrInlineData { | ||
| 536 | 	u_int32_t 	recordType; | ||
| 537 | 	u_int32_t 	reserved; | ||
| 538 | 	u_int32_t 	logicalSize; | ||
| 539 | 	u_int8_t 	userData[2]; | ||
| 540 | } __attribute__((aligned(2), packed)); | ||
| 541 | typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData; | ||
| 542 | |||
| 543 | |||
| 544 | /* A generic Attribute Record */ | ||
| 545 | union HFSPlusAttrRecord { | ||
| 546 | 	u_int32_t 		recordType; | ||
| 547 | 	HFSPlusAttrInlineData 	inlineData; /* NOT USED */ | ||
| 548 | 	HFSPlusAttrData 	attrData; | ||
| 549 | 	HFSPlusAttrForkData 	forkData; | ||
| 550 | 	HFSPlusAttrExtents 	overflowExtents; | ||
| 551 | }; | ||
| 552 | typedef union HFSPlusAttrRecord HFSPlusAttrRecord; | ||
| 553 | |||
| 554 | /* Attribute key */ | ||
| 555 | enum { kHFSMaxAttrNameLen = 127 }; | ||
| 556 | struct HFSPlusAttrKey { | ||
| 557 | 	u_int16_t keyLength; /* key length (in bytes) */ | ||
| 558 | 	u_int16_t pad;	 /* set to zero */ | ||
| 559 | 	u_int32_t fileID; /* file associated with attribute */ | ||
| 560 | 	u_int32_t startBlock; /* first allocation block number for extents */ | ||
| 561 | 	u_int16_t attrNameLen; /* number of unicode characters */ | ||
| 562 | 	u_int16_t attrName[kHFSMaxAttrNameLen]; /* attribute name (Unicode) */ | ||
| 563 | } __attribute__((aligned(2), packed)); | ||
| 564 | typedef struct HFSPlusAttrKey HFSPlusAttrKey; | ||
| 565 | |||
| 566 | #define kHFSPlusAttrKeyMaximumLength (sizeof(HFSPlusAttrKey) - sizeof(u_int16_t)) | ||
| 567 | #define kHFSPlusAttrKeyMinimumLength (kHFSPlusAttrKeyMaximumLength - kHFSMaxAttrNameLen*sizeof(u_int16_t)) | ||
| 568 | |||
| 569 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 570 | |||
| 571 | |||
| 572 | /* Key and node lengths */ | ||
| 573 | enum { | ||
| 574 | 	kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(u_int16_t), | ||
| 575 | 	kHFSExtentKeyMaximumLength	= sizeof(HFSExtentKey) - sizeof(u_int8_t), | ||
| 576 | 	kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(u_int16_t), | ||
| 577 | 	kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(u_int16_t), | ||
| 578 | 	kHFSCatalogKeyMaximumLength	= sizeof(HFSCatalogKey) - sizeof(u_int8_t), | ||
| 579 | 	kHFSCatalogKeyMinimumLength	= kHFSCatalogKeyMaximumLength - (kHFSMaxFileNameChars + 1) + sizeof(u_int8_t), | ||
| 580 | 	kHFSPlusCatalogMinNodeSize	= 4096, | ||
| 581 | 	kHFSPlusExtentMinNodeSize	= 512, | ||
| 582 | 	kHFSPlusAttrMinNodeSize		= 4096 | ||
| 583 | }; | ||
| 584 | |||
| 585 | /* HFS and HFS Plus volume attribute bits */ | ||
| 586 | enum { | ||
| 587 | 	/* Bits 0-6 are reserved (always cleared by MountVol call) */ | ||
| 588 | 	kHFSVolumeHardwareLockBit	= 7,		/* volume is locked by hardware */ | ||
| 589 | 	kHFSVolumeUnmountedBit		= 8,		/* volume was successfully unmounted */ | ||
| 590 | 	kHFSVolumeSparedBlocksBit	= 9,		/* volume has bad blocks spared */ | ||
| 591 | 	kHFSVolumeNoCacheRequiredBit = 10,		/* don't cache volume blocks (i.e. RAM or ROM disk) */ | ||
| 592 | 	kHFSBootVolumeInconsistentBit = 11,		/* boot volume is inconsistent (System 7.6 and later) */ | ||
| 593 | 	kHFSCatalogNodeIDsReusedBit = 12, | ||
| 594 | 	kHFSVolumeJournaledBit = 13,			/* this volume has a journal on it */ | ||
| 595 | 	kHFSVolumeInconsistentBit = 14,			/* serious inconsistencies detected at runtime */ | ||
| 596 | 	kHFSVolumeSoftwareLockBit	= 15,		/* volume is locked by software */ | ||
| 597 | 	/* | ||
| 598 | 	 * HFS only has 16 bits of attributes in the MDB, but HFS Plus has 32 bits. | ||
| 599 | 	 * Therefore, bits 16-31 can only be used on HFS Plus. | ||
| 600 | 	 */ | ||
| 601 | 	kHFSUnusedNodeFixBit = 31,				/* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */ | ||
| 602 | 	kHFSContentProtectionBit = 30,			/* Volume has per-file content protection */ | ||
| 603 | |||
| 604 | 	/*** Keep these in sync with the bits above ! ****/ | ||
| 605 | 	kHFSVolumeHardwareLockMask		= 0x00000080, | ||
| 606 | 	kHFSVolumeUnmountedMask			= 0x00000100, | ||
| 607 | 	kHFSVolumeSparedBlocksMask		= 0x00000200, | ||
| 608 | 	kHFSVolumeNoCacheRequiredMask 	= 0x00000400, | ||
| 609 | 	kHFSBootVolumeInconsistentMask	= 0x00000800, | ||
| 610 | 	kHFSCatalogNodeIDsReusedMask 	= 0x00001000, | ||
| 611 | 	kHFSVolumeJournaledMask			= 0x00002000, | ||
| 612 | 	kHFSVolumeInconsistentMask 		= 0x00004000, | ||
| 613 | 	kHFSVolumeSoftwareLockMask		= 0x00008000, | ||
| 614 | 	 | ||
| 615 | 	/* Bits 16-31 are allocated from high to low */ | ||
| 616 | |||
| 617 | 	kHFSContentProtectionMask 		= 0x40000000, | ||
| 618 | 	kHFSUnusedNodeFixMask 			= 0x80000000, | ||
| 619 | 	 | ||
| 620 | 	kHFSMDBAttributesMask			= 0x8380 | ||
| 621 | }; | ||
| 622 | |||
| 623 | enum { | ||
| 624 | 	kHFSUnusedNodesFixDate = 0xc5ef2480		/* March 25, 2009 */ | ||
| 625 | }; | ||
| 626 | |||
| 627 | /* HFS Master Directory Block - 162 bytes */ | ||
| 628 | /* Stored at sector #2 (3rd sector) and second-to-last sector. */ | ||
| 629 | struct HFSMasterDirectoryBlock { | ||
| 630 | 	u_int16_t 		drSigWord;	/* == kHFSSigWord */ | ||
| 631 | 	u_int32_t 		drCrDate;	/* date and time of volume creation */ | ||
| 632 | 	u_int32_t 		drLsMod;	/* date and time of last modification */ | ||
| 633 | 	u_int16_t 		drAtrb;		/* volume attributes */ | ||
| 634 | 	u_int16_t 		drNmFls;	/* number of files in root folder */ | ||
| 635 | 	u_int16_t 		drVBMSt;	/* first block of volume bitmap */ | ||
| 636 | 	u_int16_t 		drAllocPtr;	/* start of next allocation search */ | ||
| 637 | 	u_int16_t 		drNmAlBlks;	/* number of allocation blocks in volume */ | ||
| 638 | 	u_int32_t 		drAlBlkSiz;	/* size (in bytes) of allocation blocks */ | ||
| 639 | 	u_int32_t 		drClpSiz;	/* default clump size */ | ||
| 640 | 	u_int16_t 		drAlBlSt;	/* first allocation block in volume */ | ||
| 641 | 	u_int32_t 		drNxtCNID;	/* next unused catalog node ID */ | ||
| 642 | 	u_int16_t 		drFreeBks;	/* number of unused allocation blocks */ | ||
| 643 | 	u_int8_t 		drVN[kHFSMaxVolumeNameChars + 1]; /* volume name */ | ||
| 644 | 	u_int32_t 		drVolBkUp;	/* date and time of last backup */ | ||
| 645 | 	u_int16_t 		drVSeqNum;	/* volume backup sequence number */ | ||
| 646 | 	u_int32_t 		drWrCnt;	/* volume write count */ | ||
| 647 | 	u_int32_t 		drXTClpSiz;	/* clump size for extents overflow file */ | ||
| 648 | 	u_int32_t 		drCTClpSiz;	/* clump size for catalog file */ | ||
| 649 | 	u_int16_t 		drNmRtDirs;	/* number of directories in root folder */ | ||
| 650 | 	u_int32_t 		drFilCnt;	/* number of files in volume */ | ||
| 651 | 	u_int32_t 		drDirCnt;	/* number of directories in volume */ | ||
| 652 | 	u_int32_t 		drFndrInfo[8];	/* information used by the Finder */ | ||
| 653 | 	u_int16_t 		drEmbedSigWord;	/* embedded volume signature (formerly drVCSize) */ | ||
| 654 | 	HFSExtentDescriptor	drEmbedExtent;	/* embedded volume location and size (formerly drVBMCSize and drCtlCSize) */ | ||
| 655 | 	u_int32_t		drXTFlSize;	/* size of extents overflow file */ | ||
| 656 | 	HFSExtentRecord		drXTExtRec;	/* extent record for extents overflow file */ | ||
| 657 | 	u_int32_t 		drCTFlSize;	/* size of catalog file */ | ||
| 658 | 	HFSExtentRecord 	drCTExtRec;	/* extent record for catalog file */ | ||
| 659 | } __attribute__((aligned(2), packed)); | ||
| 660 | typedef struct HFSMasterDirectoryBlock	HFSMasterDirectoryBlock; | ||
| 661 | |||
| 662 | |||
| 663 | #ifdef __APPLE_API_UNSTABLE | ||
| 664 | #define SET_HFS_TEXT_ENCODING(hint) \ | ||
| 665 | 	(0x656e6300 | ((hint) & 0xff)) | ||
| 666 | #define GET_HFS_TEXT_ENCODING(hint) \ | ||
| 667 | 	(((hint) & 0xffffff00) == 0x656e6300 ? (hint) & 0x000000ff : 0xffffffffU) | ||
| 668 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 669 | |||
| 670 | |||
| 671 | /* HFS Plus Volume Header - 512 bytes */ | ||
| 672 | /* Stored at sector #2 (3rd sector) and second-to-last sector. */ | ||
| 673 | struct HFSPlusVolumeHeader { | ||
| 674 | 	u_int16_t 	signature;		/* == kHFSPlusSigWord */ | ||
| 675 | 	u_int16_t 	version;		/* == kHFSPlusVersion */ | ||
| 676 | 	u_int32_t 	attributes;		/* volume attributes */ | ||
| 677 | 	u_int32_t 	lastMountedVersion;	/* implementation version which last mounted volume */ | ||
| 678 | 	u_int32_t 	journalInfoBlock;	/* block addr of journal info (if volume is journaled, zero otherwise) */ | ||
| 679 | |||
| 680 | 	u_int32_t 	createDate;		/* date and time of volume creation */ | ||
| 681 | 	u_int32_t 	modifyDate;		/* date and time of last modification */ | ||
| 682 | 	u_int32_t 	backupDate;		/* date and time of last backup */ | ||
| 683 | 	u_int32_t 	checkedDate;		/* date and time of last disk check */ | ||
| 684 | |||
| 685 | 	u_int32_t 	fileCount;		/* number of files in volume */ | ||
| 686 | 	u_int32_t 	folderCount;		/* number of directories in volume */ | ||
| 687 | |||
| 688 | 	u_int32_t 	blockSize;		/* size (in bytes) of allocation blocks */ | ||
| 689 | 	u_int32_t 	totalBlocks;		/* number of allocation blocks in volume (includes this header and VBM*/ | ||
| 690 | 	u_int32_t 	freeBlocks;		/* number of unused allocation blocks */ | ||
| 691 | |||
| 692 | 	u_int32_t 	nextAllocation;		/* start of next allocation search */ | ||
| 693 | 	u_int32_t 	rsrcClumpSize;		/* default resource fork clump size */ | ||
| 694 | 	u_int32_t 	dataClumpSize;		/* default data fork clump size */ | ||
| 695 | 	u_int32_t 	nextCatalogID;		/* next unused catalog node ID */ | ||
| 696 | |||
| 697 | 	u_int32_t 	writeCount;		/* volume write count */ | ||
| 698 | 	u_int64_t 	encodingsBitmap;	/* which encodings have been use on this volume */ | ||
| 699 | |||
| 700 | 	u_int8_t 	finderInfo[32];		/* information used by the Finder */ | ||
| 701 | |||
| 702 | 	HFSPlusForkData	 allocationFile;	/* allocation bitmap file */ | ||
| 703 | 	HFSPlusForkData extentsFile;		/* extents B-tree file */ | ||
| 704 | 	HFSPlusForkData catalogFile;		/* catalog B-tree file */ | ||
| 705 | 	HFSPlusForkData attributesFile;	/* extended attributes B-tree file */ | ||
| 706 | 	HFSPlusForkData	 startupFile;		/* boot file (secondary loader) */ | ||
| 707 | } __attribute__((aligned(2), packed)); | ||
| 708 | typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader; | ||
| 709 | |||
| 710 | |||
| 711 | /* B-tree structures */ | ||
| 712 | |||
| 713 | enum BTreeKeyLimits{ | ||
| 714 | 	kMaxKeyLength	= 520 | ||
| 715 | }; | ||
| 716 | |||
| 717 | union BTreeKey{ | ||
| 718 | 	u_int8_t	length8; | ||
| 719 | 	u_int16_t	length16; | ||
| 720 | 	u_int8_t	rawData [kMaxKeyLength+2]; | ||
| 721 | }; | ||
| 722 | typedef union BTreeKey BTreeKey; | ||
| 723 | |||
| 724 | /* BTNodeDescriptor -- Every B-tree node starts with these fields. */ | ||
| 725 | struct BTNodeDescriptor { | ||
| 726 | 	u_int32_t	fLink;			/* next node at this level*/ | ||
| 727 | 	u_int32_t 	bLink;			/* previous node at this level*/ | ||
| 728 | 	int8_t 		kind;			/* kind of node (leaf, index, header, map)*/ | ||
| 729 | 	u_int8_t 	height;			/* zero for header, map; child is one more than parent*/ | ||
| 730 | 	u_int16_t 	numRecords;		/* number of records in this node*/ | ||
| 731 | 	u_int16_t 	reserved;		/* reserved - initialized as zero */ | ||
| 732 | } __attribute__((aligned(2), packed)); | ||
| 733 | typedef struct BTNodeDescriptor BTNodeDescriptor; | ||
| 734 | |||
| 735 | /* Constants for BTNodeDescriptor kind */ | ||
| 736 | enum { | ||
| 737 | 	kBTLeafNode	= -1, | ||
| 738 | 	kBTIndexNode	= 0, | ||
| 739 | 	kBTHeaderNode	= 1, | ||
| 740 | 	kBTMapNode	= 2 | ||
| 741 | }; | ||
| 742 | |||
| 743 | /* BTHeaderRec -- The first record of a B-tree header node */ | ||
| 744 | struct BTHeaderRec { | ||
| 745 | 	u_int16_t	treeDepth;		/* maximum height (usually leaf nodes) */ | ||
| 746 | 	u_int32_t 	rootNode;		/* node number of root node */ | ||
| 747 | 	u_int32_t 	leafRecords;		/* number of leaf records in all leaf nodes */ | ||
| 748 | 	u_int32_t 	firstLeafNode;		/* node number of first leaf node */ | ||
| 749 | 	u_int32_t 	lastLeafNode;		/* node number of last leaf node */ | ||
| 750 | 	u_int16_t 	nodeSize;		/* size of a node, in bytes */ | ||
| 751 | 	u_int16_t 	maxKeyLength;		/* reserved */ | ||
| 752 | 	u_int32_t 	totalNodes;		/* total number of nodes in tree */ | ||
| 753 | 	u_int32_t 	freeNodes;		/* number of unused (free) nodes in tree */ | ||
| 754 | 	u_int16_t 	reserved1;		/* unused */ | ||
| 755 | 	u_int32_t 	clumpSize;		/* reserved */ | ||
| 756 | 	u_int8_t 	btreeType;		/* reserved */ | ||
| 757 | 	u_int8_t 	keyCompareType;		/* Key string Comparison Type */ | ||
| 758 | 	u_int32_t 	attributes;		/* persistent attributes about the tree */ | ||
| 759 | 	u_int32_t 	reserved3[16];		/* reserved */ | ||
| 760 | } __attribute__((aligned(2), packed)); | ||
| 761 | typedef struct BTHeaderRec BTHeaderRec; | ||
| 762 | |||
| 763 | /* Constants for BTHeaderRec attributes */ | ||
| 764 | enum { | ||
| 765 | 	kBTBadCloseMask		 = 0x00000001,	/* reserved */ | ||
| 766 | 	kBTBigKeysMask		 = 0x00000002,	/* key length field is 16 bits */ | ||
| 767 | 	kBTVariableIndexKeysMask = 0x00000004	/* keys in index nodes are variable length */ | ||
| 768 | }; | ||
| 769 | |||
| 770 | |||
| 771 | /* Catalog Key Name Comparison Type */ | ||
| 772 | enum { | ||
| 773 | 	kHFSCaseFolding = 0xCF, /* case folding (case-insensitive) */ | ||
| 774 | 	kHFSBinaryCompare = 0xBC /* binary compare (case-sensitive) */ | ||
| 775 | }; | ||
| 776 | |||
| 777 | #include <uuid/uuid.h> | ||
| 778 | |||
| 779 | /* JournalInfoBlock - Structure that describes where our journal lives */ | ||
| 780 | |||
| 781 | // the original size of the reserved field in the JournalInfoBlock was | ||
| 782 | // 32*sizeof(u_int32_t). To keep the total size of the structure the | ||
| 783 | // same we subtract the size of new fields (currently: ext_jnl_uuid and | ||
| 784 | // machine_uuid). If you add additional fields, place them before the | ||
| 785 | // reserved field and subtract their size in this macro. | ||
| 786 | // | ||
| 787 | #define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48) | ||
| 788 | |||
| 789 | struct JournalInfoBlock { | ||
| 790 | 	u_int32_t	flags; | ||
| 791 | 	u_int32_t device_signature[8]; // signature used to locate our device. | ||
| 792 | 	u_int64_t offset; // byte offset to the journal on the device | ||
| 793 | 	u_int64_t size; // size in bytes of the journal | ||
| 794 | 	uuid_string_t ext_jnl_uuid; | ||
| 795 | 	char machine_serial_num[48]; | ||
| 796 | 	char 	reserved[JIB_RESERVED_SIZE]; | ||
| 797 | } __attribute__((aligned(2), packed)); | ||
| 798 | typedef struct JournalInfoBlock JournalInfoBlock; | ||
| 799 | |||
| 800 | enum { | ||
| 801 | kJIJournalInFSMask = 0x00000001, | ||
| 802 | kJIJournalOnOtherDeviceMask = 0x00000002, | ||
| 803 | kJIJournalNeedInitMask = 0x00000004 | ||
| 804 | }; | ||
| 805 | |||
| 806 | // | ||
| 807 | // This the content type uuid for "external journal" GPT | ||
| 808 | // partitions. Each instance of a partition also has a | ||
| 809 | // uuid that uniquely identifies that instance. | ||
| 810 | // | ||
| 811 | #define EXTJNL_CONTENT_TYPE_UUID "4A6F7572-6E61-11AA-AA11-00306543ECAC" | ||
| 812 | |||
| 813 | |||
| 814 | #ifdef __cplusplus | ||
| 815 | } | ||
| 816 | #endif | ||
| 817 | |||
| 818 | #endif /* __HFS_FORMAT__ */ | ||
lib/libc/include/x86_64-macos-gnu/hfs/hfs_unistr.h created+64| ... | @@ -0,0 +1,64 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef __HFS_UNISTR__ | ||
| 30 | #define __HFS_UNISTR__ | ||
| 31 | |||
| 32 | #include <sys/types.h> | ||
| 33 | |||
| 34 | /* | ||
| 35 | * hfs_unitstr.h | ||
| 36 | * | ||
| 37 | * This file contains definition of the unicode string used for HFS Plus | ||
| 38 | * files and folder names, as described by the on-disk format. | ||
| 39 | * | ||
| 40 | */ | ||
| 41 | |||
| 42 | #ifdef __cplusplus | ||
| 43 | extern "C" { | ||
| 44 | #endif | ||
| 45 | |||
| 46 | |||
| 47 | #ifndef _HFSUNISTR255_DEFINED_ | ||
| 48 | #define _HFSUNISTR255_DEFINED_ | ||
| 49 | /* Unicode strings are used for HFS Plus file and folder names */ | ||
| 50 | struct HFSUniStr255 { | ||
| 51 | 	u_int16_t	length;		/* number of unicode characters */ | ||
| 52 | 	u_int16_t	unicode[255];	/* unicode characters */ | ||
| 53 | } __attribute__((aligned(2), packed)); | ||
| 54 | typedef struct HFSUniStr255 HFSUniStr255; | ||
| 55 | typedef const HFSUniStr255 *ConstHFSUniStr255Param; | ||
| 56 | #endif /* _HFSUNISTR255_DEFINED_ */ | ||
| 57 | |||
| 58 | |||
| 59 | #ifdef __cplusplus | ||
| 60 | } | ||
| 61 | #endif | ||
| 62 | |||
| 63 | |||
| 64 | #endif /* __HFS_UNISTR__ */ | ||
lib/libc/include/x86_64-macos-gnu/i386/_param.h created+46| ... | @@ -0,0 +1,46 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _I386__PARAM_H_ | ||
| 30 | #define _I386__PARAM_H_ | ||
| 31 | |||
| 32 | #include <i386/_types.h> | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Round p (pointer or byte index) up to a correctly-aligned value for all | ||
| 36 | * data types (int, long, ...). The result is unsigned int and must be | ||
| 37 | * cast to any desired pointer type. | ||
| 38 | */ | ||
| 39 | #define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1) | ||
| 40 | #define __DARWIN_ALIGN(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) | ||
| 41 | |||
| 42 | #define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1) | ||
| 43 | #define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32) | ||
| 44 | |||
| 45 | |||
| 46 | #endif /* _I386__PARAM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/i386/eflags.h created+94| ... | @@ -0,0 +1,94 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _I386_EFLAGS_H_ | ||
| 60 | #define _I386_EFLAGS_H_ | ||
| 61 | |||
| 62 | /* | ||
| 63 | *	i386 flags register | ||
| 64 | */ | ||
| 65 | |||
| 66 | #ifndef EFL_CF | ||
| 67 | #define EFL_CF 0x00000001 /* carry */ | ||
| 68 | #define EFL_PF 0x00000004 /* parity of low 8 bits */ | ||
| 69 | #define EFL_AF 0x00000010 /* carry out of bit 3 */ | ||
| 70 | #define EFL_ZF 0x00000040 /* zero */ | ||
| 71 | #define EFL_SF 0x00000080 /* sign */ | ||
| 72 | #define EFL_TF 0x00000100 /* trace trap */ | ||
| 73 | #define EFL_IF 0x00000200 /* interrupt enable */ | ||
| 74 | #define EFL_DF 0x00000400 /* direction */ | ||
| 75 | #define EFL_OF 0x00000800 /* overflow */ | ||
| 76 | #define EFL_IOPL 0x00003000 /* IO privilege level: */ | ||
| 77 | #define EFL_IOPL_KERNEL 0x00000000 /* kernel */ | ||
| 78 | #define EFL_IOPL_USER 0x00003000 /* user */ | ||
| 79 | #define EFL_NT 0x00004000 /* nested task */ | ||
| 80 | #define EFL_RF 0x00010000 /* resume without tracing */ | ||
| 81 | #define EFL_VM 0x00020000 /* virtual 8086 mode */ | ||
| 82 | #define EFL_AC 0x00040000 /* alignment check */ | ||
| 83 | #define EFL_VIF 0x00080000 /* virtual interrupt flag */ | ||
| 84 | #define EFL_VIP 0x00100000 /* virtual interrupt pending */ | ||
| 85 | #define EFL_ID 0x00200000 /* cpuID instruction */ | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #define EFL_CLR 0xfff88028 | ||
| 89 | #define EFL_SET 0x00000002 | ||
| 90 | |||
| 91 | #define EFL_USER_SET (EFL_IF) | ||
| 92 | #define EFL_USER_CLEAR (EFL_IOPL|EFL_NT|EFL_RF) | ||
| 93 | |||
| 94 | #endif /* _I386_EFLAGS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/i386/param.h created+171| ... | @@ -0,0 +1,171 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2010 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*- | ||
| 29 | * Copyright (c) 1990, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * (c) UNIX System Laboratories, Inc. | ||
| 32 | * All or some portions of this file are derived from material licensed | ||
| 33 | * to the University of California by American Telephone and Telegraph | ||
| 34 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 35 | * the permission of UNIX System Laboratories, Inc. | ||
| 36 | * | ||
| 37 | * Redistribution and use in source and binary forms, with or without | ||
| 38 | * modification, are permitted provided that the following conditions | ||
| 39 | * are met: | ||
| 40 | * 1. Redistributions of source code must retain the above copyright | ||
| 41 | * notice, this list of conditions and the following disclaimer. | ||
| 42 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 43 | * notice, this list of conditions and the following disclaimer in the | ||
| 44 | * documentation and/or other materials provided with the distribution. | ||
| 45 | * 3. All advertising materials mentioning features or use of this software | ||
| 46 | * must display the following acknowledgement: | ||
| 47 | *	This product includes software developed by the University of | ||
| 48 | *	California, Berkeley and its contributors. | ||
| 49 | * 4. Neither the name of the University nor the names of its contributors | ||
| 50 | * may be used to endorse or promote products derived from this software | ||
| 51 | * without specific prior written permission. | ||
| 52 | * | ||
| 53 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 54 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 55 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 56 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 63 | * SUCH DAMAGE. | ||
| 64 | * | ||
| 65 | *	@(#)param.h	8.1 (Berkeley) 4/4/95 | ||
| 66 | */ | ||
| 67 | |||
| 68 | /* | ||
| 69 | * Machine dependent constants for Intel 386. | ||
| 70 | */ | ||
| 71 | |||
| 72 | #ifndef _I386_PARAM_H_ | ||
| 73 | #define _I386_PARAM_H_ | ||
| 74 | |||
| 75 | #include <i386/_param.h> | ||
| 76 | |||
| 77 | /* | ||
| 78 | * Round p (pointer or byte index) up to a correctly-aligned value for all | ||
| 79 | * data types (int, long, ...). The result is unsigned int and must be | ||
| 80 | * cast to any desired pointer type. | ||
| 81 | */ | ||
| 82 | #define ALIGNBYTES __DARWIN_ALIGNBYTES | ||
| 83 | #define ALIGN(p) __DARWIN_ALIGN(p) | ||
| 84 | |||
| 85 | #define NBPG 4096 /* bytes/page */ | ||
| 86 | #define PGOFSET (NBPG-1) /* byte offset into page */ | ||
| 87 | #define PGSHIFT 12 /* LOG2(NBPG) */ | ||
| 88 | |||
| 89 | #define DEV_BSIZE 512 | ||
| 90 | #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ | ||
| 91 | #define BLKDEV_IOSIZE 2048 | ||
| 92 | #define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ | ||
| 93 | |||
| 94 | #define CLSIZE 1 | ||
| 95 | #define CLSIZELOG2 0 | ||
| 96 | |||
| 97 | /* | ||
| 98 | * Constants related to network buffer management. | ||
| 99 | * MCLBYTES must be no larger than CLBYTES (the software page size), and, | ||
| 100 | * on machines that exchange pages of input or output buffers with mbuf | ||
| 101 | * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple | ||
| 102 | * of the hardware page size. | ||
| 103 | */ | ||
| 104 | #define MSIZESHIFT 8 /* 256 */ | ||
| 105 | #define MSIZE (1 << MSIZESHIFT) /* size of an mbuf */ | ||
| 106 | #define MCLSHIFT 11 /* 2048 */ | ||
| 107 | #define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */ | ||
| 108 | #define MBIGCLSHIFT 12 /* 4096 */ | ||
| 109 | #define MBIGCLBYTES (1 << MBIGCLSHIFT) /* size of a big cluster */ | ||
| 110 | #define M16KCLSHIFT 14 /* 16384 */ | ||
| 111 | #define M16KCLBYTES (1 << M16KCLSHIFT) /* size of a jumbo cluster */ | ||
| 112 | |||
| 113 | #define MCLOFSET (MCLBYTES - 1) | ||
| 114 | #ifndef NMBCLUSTERS | ||
| 115 | #define NMBCLUSTERS ((1024 * 1024) / MCLBYTES) /* cl map size: 1MB */ | ||
| 116 | #endif | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Some macros for units conversion | ||
| 120 | */ | ||
| 121 | /* Core clicks (NeXT_page_size bytes) to segments and vice versa */ | ||
| 122 | #define ctos(x) (x) | ||
| 123 | #define stoc(x) (x) | ||
| 124 | |||
| 125 | /* Core clicks (4096 bytes) to disk blocks */ | ||
| 126 | #define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT)) | ||
| 127 | #define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT)) | ||
| 128 | #define dtob(x) ((x)<<DEV_BSHIFT) | ||
| 129 | |||
| 130 | /* clicks to bytes */ | ||
| 131 | #define ctob(x) ((x)<<PGSHIFT) | ||
| 132 | |||
| 133 | /* bytes to clicks */ | ||
| 134 | #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) | ||
| 135 | |||
| 136 | #ifdef __APPLE__ | ||
| 137 | #define btodb(bytes, devBlockSize) \ | ||
| 138 | 	((unsigned)(bytes) / devBlockSize) | ||
| 139 | #define dbtob(db, devBlockSize) \ | ||
| 140 | 	((unsigned)(db) * devBlockSize) | ||
| 141 | #else | ||
| 142 | #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ | ||
| 143 | 	((unsigned)(bytes) >> DEV_BSHIFT) | ||
| 144 | #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ | ||
| 145 | 	((unsigned)(db) << DEV_BSHIFT) | ||
| 146 | #endif | ||
| 147 | |||
| 148 | /* | ||
| 149 | * Map a ``block device block'' to a file system block. | ||
| 150 | * This should be device dependent, and will be if we | ||
| 151 | * add an entry to cdevsw/bdevsw for that purpose. | ||
| 152 | * For now though just use DEV_BSIZE. | ||
| 153 | */ | ||
| 154 | #define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE)) | ||
| 155 | |||
| 156 | /* | ||
| 157 | * Macros to decode (and encode) processor status word. | ||
| 158 | */ | ||
| 159 | #define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl)) | ||
| 160 | #define USERMODE(x) (((x) & 3) == 3) | ||
| 161 | #define BASEPRI(x) (((x) & (255 << 8)) == 0) | ||
| 162 | |||
| 163 | |||
| 164 | #if defined(KERNEL) || defined(STANDALONE) | ||
| 165 | #define DELAY(n) delay(n) | ||
| 166 | |||
| 167 | #else /* defined(KERNEL) || defined(STANDALONE) */ | ||
| 168 | #define DELAY(n) { int N = (n); while (--N > 0); } | ||
| 169 | #endif /* defined(KERNEL) || defined(STANDALONE) */ | ||
| 170 | |||
| 171 | #endif /* _I386_PARAM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/iconv.h created+193| ... | @@ -0,0 +1,193 @@ | ||
| 1 | /* Copyright (C) 1999-2003, 2005-2006 Free Software Foundation, Inc. | ||
| 2 | This file is part of the GNU LIBICONV Library. | ||
| 3 | |||
| 4 | The GNU LIBICONV Library is free software; you can redistribute it | ||
| 5 | and/or modify it under the terms of the GNU Library General Public | ||
| 6 | License as published by the Free Software Foundation; either version 2 | ||
| 7 | of the License, or (at your option) any later version. | ||
| 8 | |||
| 9 | The GNU LIBICONV Library is distributed in the hope that it will be | ||
| 10 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 12 | Library General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU Library General Public | ||
| 15 | License along with the GNU LIBICONV Library; see the file COPYING.LIB. | ||
| 16 | If not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 17 | Fifth Floor, Boston, MA 02110-1301, USA. */ | ||
| 18 | |||
| 19 | /* When installed, this file is called "iconv.h". */ | ||
| 20 | |||
| 21 | #ifndef _LIBICONV_H | ||
| 22 | #define _LIBICONV_H | ||
| 23 | |||
| 24 | #include <sys/cdefs.h> | ||
| 25 | #include <_types.h> | ||
| 26 | #include <sys/_types/_size_t.h> | ||
| 27 | |||
| 28 | #define _LIBICONV_VERSION 0x010B /* version number: (major<<8) + minor */ | ||
| 29 | |||
| 30 | #if BUILDING_LIBICONV | ||
| 31 | #define __LIBICONV_DLL_EXPORTED __attribute__((__visibility__("default"))) | ||
| 32 | #else | ||
| 33 | #define __LIBICONV_DLL_EXPORTED | ||
| 34 | #endif | ||
| 35 | extern __LIBICONV_DLL_EXPORTED int _libiconv_version; /* Likewise */ | ||
| 36 | |||
| 37 | /* We would like to #include any system header file which could define | ||
| 38 | iconv_t, 1. in order to eliminate the risk that the user gets compilation | ||
| 39 | errors because some other system header file includes /usr/include/iconv.h | ||
| 40 | which defines iconv_t or declares iconv after this file, 2. when compiling | ||
| 41 | for LIBICONV_PLUG, we need the proper iconv_t type in order to produce | ||
| 42 | binary compatible code. | ||
| 43 | But gcc's #include_next is not portable. Thus, once libiconv's iconv.h | ||
| 44 | has been installed in /usr/local/include, there is no way any more to | ||
| 45 | include the original /usr/include/iconv.h. We simply have to get away | ||
| 46 | without it. | ||
| 47 | Ad 1. The risk that a system header file does | ||
| 48 | #include "iconv.h" or #include_next "iconv.h" | ||
| 49 | is small. They all do #include <iconv.h>. | ||
| 50 | Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It | ||
| 51 | has to be a scalar type because (iconv_t)(-1) is a possible return value | ||
| 52 | from iconv_open().) */ | ||
| 53 | |||
| 54 | /* Define iconv_t ourselves. */ | ||
| 55 | #ifndef _ICONV_T | ||
| 56 | #define _ICONV_T | ||
| 57 | typedef void* iconv_t; | ||
| 58 | #endif | ||
| 59 | |||
| 60 | |||
| 61 | #ifdef __cplusplus | ||
| 62 | extern "C" { | ||
| 63 | #endif | ||
| 64 | |||
| 65 | |||
| 66 | /* Allocates descriptor for code conversion from encoding `fromcode' to | ||
| 67 | encoding `tocode'. */ | ||
| 68 | extern __LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* __tocode, const char* __fromcode); | ||
| 69 | |||
| 70 | /* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes | ||
| 71 | starting at `*inbuf', writing at most `*outbytesleft' bytes starting at | ||
| 72 | `*outbuf'. | ||
| 73 | Decrements `*inbytesleft' and increments `*inbuf' by the same amount. | ||
| 74 | Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */ | ||
| 75 | extern __LIBICONV_DLL_EXPORTED size_t iconv (iconv_t __cd, char* * __restrict __inbuf, size_t * __restrict __inbytesleft, char* * __restrict __outbuf, size_t * __restrict __outbytesleft); | ||
| 76 | |||
| 77 | /* Frees resources allocated for conversion descriptor `cd'. */ | ||
| 78 | extern __LIBICONV_DLL_EXPORTED int iconv_close (iconv_t _cd); | ||
| 79 | |||
| 80 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 81 | |||
| 82 | /* Nonstandard extensions. */ | ||
| 83 | |||
| 84 | #include <sys/_types/_wchar_t.h> | ||
| 85 | |||
| 86 | /* Control of attributes. */ | ||
| 87 | extern __LIBICONV_DLL_EXPORTED int iconvctl (iconv_t cd, int request, void* argument); | ||
| 88 | |||
| 89 | /* Hook performed after every successful conversion of a Unicode character. */ | ||
| 90 | typedef void (*iconv_unicode_char_hook) (unsigned int uc, void* data); | ||
| 91 | /* Hook performed after every successful conversion of a wide character. */ | ||
| 92 | typedef void (*iconv_wide_char_hook) (wchar_t wc, void* data); | ||
| 93 | /* Set of hooks. */ | ||
| 94 | struct iconv_hooks { | ||
| 95 | iconv_unicode_char_hook uc_hook; | ||
| 96 | iconv_wide_char_hook wc_hook; | ||
| 97 | void* data; | ||
| 98 | }; | ||
| 99 | |||
| 100 | /* Fallback function. Invoked when a small number of bytes could not be | ||
| 101 | converted to a Unicode character. This function should process all | ||
| 102 | bytes from inbuf and may produce replacement Unicode characters by calling | ||
| 103 | the write_replacement callback repeatedly. */ | ||
| 104 | typedef void (*iconv_unicode_mb_to_uc_fallback) | ||
| 105 | (const char* inbuf, size_t inbufsize, | ||
| 106 | void (*write_replacement) (const unsigned int *buf, size_t buflen, | ||
| 107 | void* callback_arg), | ||
| 108 | void* callback_arg, | ||
| 109 | void* data); | ||
| 110 | /* Fallback function. Invoked when a Unicode character could not be converted | ||
| 111 | to the target encoding. This function should process the character and | ||
| 112 | may produce replacement bytes (in the target encoding) by calling the | ||
| 113 | write_replacement callback repeatedly. */ | ||
| 114 | typedef void (*iconv_unicode_uc_to_mb_fallback) | ||
| 115 | (unsigned int code, | ||
| 116 | void (*write_replacement) (const char *buf, size_t buflen, | ||
| 117 | void* callback_arg), | ||
| 118 | void* callback_arg, | ||
| 119 | void* data); | ||
| 120 | #if 1 | ||
| 121 | /* Fallback function. Invoked when a number of bytes could not be converted to | ||
| 122 | a wide character. This function should process all bytes from inbuf and may | ||
| 123 | produce replacement wide characters by calling the write_replacement | ||
| 124 | callback repeatedly. */ | ||
| 125 | typedef void (*iconv_wchar_mb_to_wc_fallback) | ||
| 126 | (const char* inbuf, size_t inbufsize, | ||
| 127 | void (*write_replacement) (const wchar_t *buf, size_t buflen, | ||
| 128 | void* callback_arg), | ||
| 129 | void* callback_arg, | ||
| 130 | void* data); | ||
| 131 | /* Fallback function. Invoked when a wide character could not be converted to | ||
| 132 | the target encoding. This function should process the character and may | ||
| 133 | produce replacement bytes (in the target encoding) by calling the | ||
| 134 | write_replacement callback repeatedly. */ | ||
| 135 | typedef void (*iconv_wchar_wc_to_mb_fallback) | ||
| 136 | (wchar_t code, | ||
| 137 | void (*write_replacement) (const char *buf, size_t buflen, | ||
| 138 | void* callback_arg), | ||
| 139 | void* callback_arg, | ||
| 140 | void* data); | ||
| 141 | #else | ||
| 142 | /* If the wchar_t type does not exist, these two fallback functions are never | ||
| 143 | invoked. Their argument list therefore does not matter. */ | ||
| 144 | typedef void (*iconv_wchar_mb_to_wc_fallback) (); | ||
| 145 | typedef void (*iconv_wchar_wc_to_mb_fallback) (); | ||
| 146 | #endif | ||
| 147 | /* Set of fallbacks. */ | ||
| 148 | struct iconv_fallbacks { | ||
| 149 | iconv_unicode_mb_to_uc_fallback mb_to_uc_fallback; | ||
| 150 | iconv_unicode_uc_to_mb_fallback uc_to_mb_fallback; | ||
| 151 | iconv_wchar_mb_to_wc_fallback mb_to_wc_fallback; | ||
| 152 | iconv_wchar_wc_to_mb_fallback wc_to_mb_fallback; | ||
| 153 | void* data; | ||
| 154 | }; | ||
| 155 | |||
| 156 | /* Requests for iconvctl. */ | ||
| 157 | #define ICONV_TRIVIALP 0 /* int *argument */ | ||
| 158 | #define ICONV_GET_TRANSLITERATE 1 /* int *argument */ | ||
| 159 | #define ICONV_SET_TRANSLITERATE 2 /* const int *argument */ | ||
| 160 | #define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */ | ||
| 161 | #define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */ | ||
| 162 | #define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */ | ||
| 163 | #define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */ | ||
| 164 | |||
| 165 | /* Listing of locale independent encodings. */ | ||
| 166 | extern __LIBICONV_DLL_EXPORTED void iconvlist (int (*do_one) (unsigned int namescount, | ||
| 167 | const char * const * names, | ||
| 168 | void* data), | ||
| 169 | void* data); | ||
| 170 | |||
| 171 | /* Canonicalize an encoding name. | ||
| 172 | The result is either a canonical encoding name, or name itself. */ | ||
| 173 | extern __LIBICONV_DLL_EXPORTED const char * iconv_canonicalize (const char * name); | ||
| 174 | |||
| 175 | /* Support for relocatable packages. */ | ||
| 176 | |||
| 177 | /* Sets the original and the current installation prefix of the package. | ||
| 178 | Relocation simply replaces a pathname starting with the original prefix | ||
| 179 | by the corresponding pathname with the current prefix instead. Both | ||
| 180 | prefixes should be directory names without trailing slash (i.e. use "" | ||
| 181 | instead of "/"). */ | ||
| 182 | extern __LIBICONV_DLL_EXPORTED void libiconv_set_relocation_prefix (const char *orig_prefix, | ||
| 183 | 					 const char *curr_prefix); | ||
| 184 | |||
| 185 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 186 | |||
| 187 | |||
| 188 | #ifdef __cplusplus | ||
| 189 | } | ||
| 190 | #endif | ||
| 191 | |||
| 192 | |||
| 193 | #endif /* _LIBICONV_H */ | ||
lib/libc/include/x86_64-macos-gnu/langinfo.h created+120| ... | @@ -0,0 +1,120 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer in the | ||
| 12 | * documentation and/or other materials provided with the distribution. | ||
| 13 | * | ||
| 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 24 | * SUCH DAMAGE. | ||
| 25 | * | ||
| 26 | * $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _LANGINFO_H_ | ||
| 30 | #define	_LANGINFO_H_ | ||
| 31 | |||
| 32 | #include <_types.h> | ||
| 33 | #include <_types/_nl_item.h> | ||
| 34 | |||
| 35 | #define	CODESET		0	/* codeset name */ | ||
| 36 | #define	D_T_FMT		1	/* string for formatting date and time */ | ||
| 37 | #define	D_FMT		2	/* date format string */ | ||
| 38 | #define	T_FMT		3	/* time format string */ | ||
| 39 | #define	T_FMT_AMPM	4	/* a.m. or p.m. time formatting string */ | ||
| 40 | #define	AM_STR		5	/* Ante Meridian affix */ | ||
| 41 | #define	PM_STR		6	/* Post Meridian affix */ | ||
| 42 | |||
| 43 | /* week day names */ | ||
| 44 | #define	DAY_1		7 | ||
| 45 | #define	DAY_2		8 | ||
| 46 | #define	DAY_3		9 | ||
| 47 | #define	DAY_4		10 | ||
| 48 | #define	DAY_5		11 | ||
| 49 | #define	DAY_6		12 | ||
| 50 | #define	DAY_7		13 | ||
| 51 | |||
| 52 | /* abbreviated week day names */ | ||
| 53 | #define	ABDAY_1		14 | ||
| 54 | #define	ABDAY_2		15 | ||
| 55 | #define	ABDAY_3		16 | ||
| 56 | #define	ABDAY_4		17 | ||
| 57 | #define	ABDAY_5		18 | ||
| 58 | #define	ABDAY_6		19 | ||
| 59 | #define	ABDAY_7		20 | ||
| 60 | |||
| 61 | /* month names */ | ||
| 62 | #define	MON_1		21 | ||
| 63 | #define	MON_2		22 | ||
| 64 | #define	MON_3		23 | ||
| 65 | #define	MON_4		24 | ||
| 66 | #define	MON_5		25 | ||
| 67 | #define	MON_6		26 | ||
| 68 | #define	MON_7		27 | ||
| 69 | #define	MON_8		28 | ||
| 70 | #define	MON_9		29 | ||
| 71 | #define	MON_10		30 | ||
| 72 | #define	MON_11		31 | ||
| 73 | #define	MON_12		32 | ||
| 74 | |||
| 75 | /* abbreviated month names */ | ||
| 76 | #define	ABMON_1		33 | ||
| 77 | #define	ABMON_2		34 | ||
| 78 | #define	ABMON_3		35 | ||
| 79 | #define	ABMON_4		36 | ||
| 80 | #define	ABMON_5		37 | ||
| 81 | #define	ABMON_6		38 | ||
| 82 | #define	ABMON_7		39 | ||
| 83 | #define	ABMON_8		40 | ||
| 84 | #define	ABMON_9		41 | ||
| 85 | #define	ABMON_10	42 | ||
| 86 | #define	ABMON_11	43 | ||
| 87 | #define	ABMON_12	44 | ||
| 88 | |||
| 89 | #define	ERA		45	/* era description segments */ | ||
| 90 | #define	ERA_D_FMT	46	/* era date format string */ | ||
| 91 | #define	ERA_D_T_FMT	47	/* era date and time format string */ | ||
| 92 | #define	ERA_T_FMT	48	/* era time format string */ | ||
| 93 | #define	ALT_DIGITS	49	/* alternative symbols for digits */ | ||
| 94 | |||
| 95 | #define	RADIXCHAR	50	/* radix char */ | ||
| 96 | #define	THOUSEP		51	/* separator for thousands */ | ||
| 97 | |||
| 98 | #define	YESEXPR		52	/* affirmative response expression */ | ||
| 99 | #define	NOEXPR		53	/* negative response expression */ | ||
| 100 | |||
| 101 | #if (__DARWIN_C_LEVEL > __DARWIN_C_ANSI && __DARWIN_C_LEVEL < 200112L) || __DARWIN_C_LEVEL == __DARWIN_C_FULL | ||
| 102 | #define	YESSTR		54	/* affirmative response for yes/no queries */ | ||
| 103 | #define	NOSTR		55	/* negative response for yes/no queries */ | ||
| 104 | #endif | ||
| 105 | |||
| 106 | #define	CRNCYSTR	56	/* currency symbol */ | ||
| 107 | |||
| 108 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 109 | #define	D_MD_ORDER	57	/* month/day order (local extension) */ | ||
| 110 | #endif | ||
| 111 | |||
| 112 | __BEGIN_DECLS | ||
| 113 | char	*nl_langinfo(nl_item); | ||
| 114 | __END_DECLS | ||
| 115 | |||
| 116 | #ifdef _USE_EXTENDED_LOCALES_ | ||
| 117 | #include <xlocale/_langinfo.h> | ||
| 118 | #endif /* _USE_EXTENDED_LOCALES_ */ | ||
| 119 | |||
| 120 | #endif /* !_LANGINFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/launch.h created+409| ... | @@ -0,0 +1,409 @@ | ||
| 1 | #ifndef __XPC_LAUNCH_H__ | ||
| 2 | #define __XPC_LAUNCH_H__ | ||
| 3 | |||
| 4 | /*! | ||
| 5 | * @header | ||
| 6 | * These interfaces were only ever documented for the purpose of allowing a | ||
| 7 | * launchd job to obtain file descriptors associated with the sockets it | ||
| 8 | * advertised in its launchd.plist(5). That functionality is now available in a | ||
| 9 | * much more straightforward fashion through the {@link launch_activate_socket} | ||
| 10 | * API. | ||
| 11 | * | ||
| 12 | * There are currently no replacements for other uses of the {@link launch_msg} | ||
| 13 | * API, including submitting, removing, starting, stopping and listing jobs. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <os/base.h> | ||
| 17 | #include <Availability.h> | ||
| 18 | |||
| 19 | #include <mach/mach.h> | ||
| 20 | #include <stddef.h> | ||
| 21 | #include <stdbool.h> | ||
| 22 | #include <sys/cdefs.h> | ||
| 23 | |||
| 24 | #if __has_feature(assume_nonnull) | ||
| 25 | _Pragma("clang assume_nonnull begin") | ||
| 26 | #endif | ||
| 27 | __BEGIN_DECLS | ||
| 28 | |||
| 29 | #define LAUNCH_KEY_SUBMITJOB "SubmitJob" | ||
| 30 | #define LAUNCH_KEY_REMOVEJOB "RemoveJob" | ||
| 31 | #define LAUNCH_KEY_STARTJOB "StartJob" | ||
| 32 | #define LAUNCH_KEY_STOPJOB "StopJob" | ||
| 33 | #define LAUNCH_KEY_GETJOB "GetJob" | ||
| 34 | #define LAUNCH_KEY_GETJOBS "GetJobs" | ||
| 35 | #define LAUNCH_KEY_CHECKIN "CheckIn" | ||
| 36 | |||
| 37 | #define LAUNCH_JOBKEY_LABEL "Label" | ||
| 38 | #define LAUNCH_JOBKEY_DISABLED "Disabled" | ||
| 39 | #define LAUNCH_JOBKEY_USERNAME "UserName" | ||
| 40 | #define LAUNCH_JOBKEY_GROUPNAME "GroupName" | ||
| 41 | #define LAUNCH_JOBKEY_TIMEOUT "TimeOut" | ||
| 42 | #define LAUNCH_JOBKEY_EXITTIMEOUT "ExitTimeOut" | ||
| 43 | #define LAUNCH_JOBKEY_INITGROUPS "InitGroups" | ||
| 44 | #define LAUNCH_JOBKEY_SOCKETS "Sockets" | ||
| 45 | #define LAUNCH_JOBKEY_MACHSERVICES "MachServices" | ||
| 46 | #define LAUNCH_JOBKEY_MACHSERVICELOOKUPPOLICIES "MachServiceLookupPolicies" | ||
| 47 | #define LAUNCH_JOBKEY_INETDCOMPATIBILITY "inetdCompatibility" | ||
| 48 | #define LAUNCH_JOBKEY_ENABLEGLOBBING "EnableGlobbing" | ||
| 49 | #define LAUNCH_JOBKEY_PROGRAMARGUMENTS "ProgramArguments" | ||
| 50 | #define LAUNCH_JOBKEY_PROGRAM "Program" | ||
| 51 | #define LAUNCH_JOBKEY_ONDEMAND "OnDemand" | ||
| 52 | #define LAUNCH_JOBKEY_KEEPALIVE "KeepAlive" | ||
| 53 | #define LAUNCH_JOBKEY_LIMITLOADTOHOSTS "LimitLoadToHosts" | ||
| 54 | #define LAUNCH_JOBKEY_LIMITLOADFROMHOSTS "LimitLoadFromHosts" | ||
| 55 | #define LAUNCH_JOBKEY_LIMITLOADTOSESSIONTYPE "LimitLoadToSessionType" | ||
| 56 | #define LAUNCH_JOBKEY_LIMITLOADTOHARDWARE "LimitLoadToHardware" | ||
| 57 | #define LAUNCH_JOBKEY_LIMITLOADFROMHARDWARE "LimitLoadFromHardware" | ||
| 58 | #define LAUNCH_JOBKEY_RUNATLOAD "RunAtLoad" | ||
| 59 | #define LAUNCH_JOBKEY_ROOTDIRECTORY "RootDirectory" | ||
| 60 | #define LAUNCH_JOBKEY_WORKINGDIRECTORY "WorkingDirectory" | ||
| 61 | #define LAUNCH_JOBKEY_ENVIRONMENTVARIABLES "EnvironmentVariables" | ||
| 62 | #define LAUNCH_JOBKEY_USERENVIRONMENTVARIABLES "UserEnvironmentVariables" | ||
| 63 | #define LAUNCH_JOBKEY_UMASK "Umask" | ||
| 64 | #define LAUNCH_JOBKEY_NICE "Nice" | ||
| 65 | #define LAUNCH_JOBKEY_HOPEFULLYEXITSFIRST "HopefullyExitsFirst" | ||
| 66 | #define LAUNCH_JOBKEY_HOPEFULLYEXITSLAST "HopefullyExitsLast" | ||
| 67 | #define LAUNCH_JOBKEY_LOWPRIORITYIO "LowPriorityIO" | ||
| 68 | #define LAUNCH_JOBKEY_LOWPRIORITYBACKGROUNDIO "LowPriorityBackgroundIO" | ||
| 69 | #define LAUNCH_JOBKEY_MATERIALIZEDATALESSFILES "MaterializeDatalessFiles" | ||
| 70 | #define LAUNCH_JOBKEY_SESSIONCREATE "SessionCreate" | ||
| 71 | #define LAUNCH_JOBKEY_STARTONMOUNT "StartOnMount" | ||
| 72 | #define LAUNCH_JOBKEY_SOFTRESOURCELIMITS "SoftResourceLimits" | ||
| 73 | #define LAUNCH_JOBKEY_HARDRESOURCELIMITS "HardResourceLimits" | ||
| 74 | #define LAUNCH_JOBKEY_STANDARDINPATH "StandardInPath" | ||
| 75 | #define LAUNCH_JOBKEY_STANDARDOUTPATH "StandardOutPath" | ||
| 76 | #define LAUNCH_JOBKEY_STANDARDERRORPATH "StandardErrorPath" | ||
| 77 | #define LAUNCH_JOBKEY_DEBUG "Debug" | ||
| 78 | #define LAUNCH_JOBKEY_WAITFORDEBUGGER "WaitForDebugger" | ||
| 79 | #define LAUNCH_JOBKEY_QUEUEDIRECTORIES "QueueDirectories" | ||
| 80 | #define LAUNCH_JOBKEY_HOMERELATIVEQUEUEDIRECTORIES "HomeRelativeQueueDirectories" | ||
| 81 | #define LAUNCH_JOBKEY_WATCHPATHS "WatchPaths" | ||
| 82 | #define LAUNCH_JOBKEY_STARTINTERVAL "StartInterval" | ||
| 83 | #define LAUNCH_JOBKEY_STARTCALENDARINTERVAL "StartCalendarInterval" | ||
| 84 | #define LAUNCH_JOBKEY_BONJOURFDS "BonjourFDs" | ||
| 85 | #define LAUNCH_JOBKEY_LASTEXITSTATUS "LastExitStatus" | ||
| 86 | #define LAUNCH_JOBKEY_PID "PID" | ||
| 87 | #define LAUNCH_JOBKEY_THROTTLEINTERVAL "ThrottleInterval" | ||
| 88 | #define LAUNCH_JOBKEY_LAUNCHONLYONCE "LaunchOnlyOnce" | ||
| 89 | #define LAUNCH_JOBKEY_ABANDONPROCESSGROUP "AbandonProcessGroup" | ||
| 90 | #define LAUNCH_JOBKEY_IGNOREPROCESSGROUPATSHUTDOWN \ | ||
| 91 | 	"IgnoreProcessGroupAtShutdown" | ||
| 92 | #define LAUNCH_JOBKEY_LEGACYTIMERS "LegacyTimers" | ||
| 93 | #define LAUNCH_JOBKEY_ENABLEPRESSUREDEXIT "EnablePressuredExit" | ||
| 94 | #define LAUNCH_JOBKEY_ENABLETRANSACTIONS "EnableTransactions" | ||
| 95 | #define LAUNCH_JOBKEY_DRAINMESSAGESONFAILEDINIT "DrainMessagesOnFailedInit" | ||
| 96 | #define LAUNCH_JOBKEY_POLICIES "Policies" | ||
| 97 | |||
| 98 | #define LAUNCH_JOBKEY_PUBLISHESEVENTS "PublishesEvents" | ||
| 99 | #define LAUNCH_KEY_PUBLISHESEVENTS_DOMAININTERNAL "DomainInternal" | ||
| 100 | |||
| 101 | #define LAUNCH_JOBPOLICY_DENYCREATINGOTHERJOBS "DenyCreatingOtherJobs" | ||
| 102 | |||
| 103 | #define LAUNCH_JOBINETDCOMPATIBILITY_WAIT "Wait" | ||
| 104 | #define LAUNCH_JOBINETDCOMPATIBILITY_INSTANCES "Instances" | ||
| 105 | |||
| 106 | #define LAUNCH_JOBKEY_MACH_RESETATCLOSE "ResetAtClose" | ||
| 107 | #define LAUNCH_JOBKEY_MACH_HIDEUNTILCHECKIN "HideUntilCheckIn" | ||
| 108 | |||
| 109 | #define LAUNCH_JOBKEY_KEEPALIVE_SUCCESSFULEXIT "SuccessfulExit" | ||
| 110 | #define LAUNCH_JOBKEY_KEEPALIVE_NETWORKSTATE "NetworkState" | ||
| 111 | #define LAUNCH_JOBKEY_KEEPALIVE_PATHSTATE "PathState" | ||
| 112 | #define LAUNCH_JOBKEY_KEEPALIVE_HOMERELATIVEPATHSTATE "HomeRelativePathState" | ||
| 113 | #define LAUNCH_JOBKEY_KEEPALIVE_OTHERJOBACTIVE "OtherJobActive" | ||
| 114 | #define LAUNCH_JOBKEY_KEEPALIVE_OTHERJOBENABLED "OtherJobEnabled" | ||
| 115 | #define LAUNCH_JOBKEY_KEEPALIVE_AFTERINITIALDEMAND	"AfterInitialDemand" | ||
| 116 | #define LAUNCH_JOBKEY_KEEPALIVE_CRASHED "Crashed" | ||
| 117 | |||
| 118 | #define LAUNCH_JOBKEY_LAUNCHEVENTS "LaunchEvents" | ||
| 119 | |||
| 120 | #define LAUNCH_JOBKEY_CAL_MINUTE "Minute" | ||
| 121 | #define LAUNCH_JOBKEY_CAL_HOUR "Hour" | ||
| 122 | #define LAUNCH_JOBKEY_CAL_DAY "Day" | ||
| 123 | #define LAUNCH_JOBKEY_CAL_WEEKDAY "Weekday" | ||
| 124 | #define LAUNCH_JOBKEY_CAL_MONTH "Month" | ||
| 125 | |||
| 126 | #define LAUNCH_JOBKEY_RESOURCELIMIT_CORE "Core" | ||
| 127 | #define LAUNCH_JOBKEY_RESOURCELIMIT_CPU "CPU" | ||
| 128 | #define LAUNCH_JOBKEY_RESOURCELIMIT_DATA "Data" | ||
| 129 | #define LAUNCH_JOBKEY_RESOURCELIMIT_FSIZE "FileSize" | ||
| 130 | #define LAUNCH_JOBKEY_RESOURCELIMIT_MEMLOCK "MemoryLock" | ||
| 131 | #define LAUNCH_JOBKEY_RESOURCELIMIT_NOFILE "NumberOfFiles" | ||
| 132 | #define LAUNCH_JOBKEY_RESOURCELIMIT_NPROC "NumberOfProcesses" | ||
| 133 | #define LAUNCH_JOBKEY_RESOURCELIMIT_RSS "ResidentSetSize" | ||
| 134 | #define LAUNCH_JOBKEY_RESOURCELIMIT_STACK "Stack" | ||
| 135 | |||
| 136 | #define LAUNCH_JOBKEY_DISABLED_MACHINETYPE "MachineType" | ||
| 137 | #define LAUNCH_JOBKEY_DISABLED_MODELNAME "ModelName" | ||
| 138 | |||
| 139 | #define LAUNCH_JOBKEY_DATASTORES "Datastores" | ||
| 140 | #define LAUNCH_JOBKEY_DATASTORES_SIZELIMIT "SizeLimit" | ||
| 141 | |||
| 142 | #define LAUNCH_JOBSOCKETKEY_TYPE "SockType" | ||
| 143 | #define LAUNCH_JOBSOCKETKEY_PASSIVE "SockPassive" | ||
| 144 | #define LAUNCH_JOBSOCKETKEY_BONJOUR "Bonjour" | ||
| 145 | #define LAUNCH_JOBSOCKETKEY_SECUREWITHKEY "SecureSocketWithKey" | ||
| 146 | #define LAUNCH_JOBSOCKETKEY_PATHNAME "SockPathName" | ||
| 147 | #define LAUNCH_JOBSOCKETKEY_PATHMODE "SockPathMode" | ||
| 148 | #define LAUNCH_JOBSOCKETKEY_PATHOWNER "SockPathOwner" | ||
| 149 | #define LAUNCH_JOBSOCKETKEY_PATHGROUP "SockPathGroup" | ||
| 150 | #define LAUNCH_JOBSOCKETKEY_NODENAME "SockNodeName" | ||
| 151 | #define LAUNCH_JOBSOCKETKEY_SERVICENAME "SockServiceName" | ||
| 152 | #define LAUNCH_JOBSOCKETKEY_FAMILY "SockFamily" | ||
| 153 | #define LAUNCH_JOBSOCKETKEY_PROTOCOL "SockProtocol" | ||
| 154 | #define LAUNCH_JOBSOCKETKEY_MULTICASTGROUP "MulticastGroup" | ||
| 155 | |||
| 156 | #define LAUNCH_JOBKEY_PROCESSTYPE "ProcessType" | ||
| 157 | #define LAUNCH_KEY_PROCESSTYPE_APP "App" | ||
| 158 | #define LAUNCH_KEY_PROCESSTYPE_STANDARD "Standard" | ||
| 159 | #define LAUNCH_KEY_PROCESSTYPE_BACKGROUND "Background" | ||
| 160 | #define LAUNCH_KEY_PROCESSTYPE_INTERACTIVE "Interactive" | ||
| 161 | #define LAUNCH_KEY_PROCESSTYPE_ADAPTIVE "Adaptive" | ||
| 162 | |||
| 163 | /*! | ||
| 164 | * @function launch_activate_socket | ||
| 165 | * | ||
| 166 | * @abstract | ||
| 167 | * Retrieves the file descriptors for sockets specified in the process' | ||
| 168 | * launchd.plist(5). | ||
| 169 | * | ||
| 170 | * @param name | ||
| 171 | * The name of the socket entry in the service's Sockets dictionary. | ||
| 172 | * | ||
| 173 | * @param fds | ||
| 174 | * On return, this parameter will be populated with an array of file | ||
| 175 | * descriptors. One socket can have many descriptors associated with it | ||
| 176 | * depending on the characteristics of the network interfaces on the system. | ||
| 177 | * The descriptors in this array are the results of calling getaddrinfo(3) with | ||
| 178 | * the parameters described in launchd.plist(5). | ||
| 179 | * | ||
| 180 | * The caller is responsible for calling free(3) on the returned pointer. | ||
| 181 | * | ||
| 182 | * @param cnt | ||
| 183 | * The number of file descriptor entries in the returned array. | ||
| 184 | * | ||
| 185 | * @result | ||
| 186 | * On success, zero is returned. Otherwise, an appropriate POSIX-domain is | ||
| 187 | * returned. Possible error codes are: | ||
| 188 | * | ||
| 189 | * ENOENT -> There was no socket of the specified name owned by the caller. | ||
| 190 | * ESRCH -> The caller is not a process managed by launchd. | ||
| 191 | * EALREADY -> The socket has already been activated by the caller. | ||
| 192 | */ | ||
| 193 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) | ||
| 194 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL2 OS_NONNULL3 | ||
| 195 | int | ||
| 196 | launch_activate_socket(const char *name, | ||
| 197 | 	int * _Nonnull * _Nullable fds, size_t *cnt); | ||
| 198 | |||
| 199 | typedef struct _launch_data *launch_data_t; | ||
| 200 | typedef void (*launch_data_dict_iterator_t)(const launch_data_t lval, | ||
| 201 | 	const char *key, void * _Nullable ctx); | ||
| 202 | |||
| 203 | typedef enum { | ||
| 204 | 	LAUNCH_DATA_DICTIONARY = 1, | ||
| 205 | 	LAUNCH_DATA_ARRAY, | ||
| 206 | 	LAUNCH_DATA_FD, | ||
| 207 | 	LAUNCH_DATA_INTEGER, | ||
| 208 | 	LAUNCH_DATA_REAL, | ||
| 209 | 	LAUNCH_DATA_BOOL, | ||
| 210 | 	LAUNCH_DATA_STRING, | ||
| 211 | 	LAUNCH_DATA_OPAQUE, | ||
| 212 | 	LAUNCH_DATA_ERRNO, | ||
| 213 | 	LAUNCH_DATA_MACHPORT, | ||
| 214 | } launch_data_type_t; | ||
| 215 | |||
| 216 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 217 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 218 | launch_data_t | ||
| 219 | launch_data_alloc(launch_data_type_t type); | ||
| 220 | |||
| 221 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 222 | OS_EXPORT OS_MALLOC OS_WARN_RESULT OS_NONNULL1 | ||
| 223 | launch_data_t | ||
| 224 | launch_data_copy(launch_data_t ld); | ||
| 225 | |||
| 226 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 227 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 228 | launch_data_type_t | ||
| 229 | launch_data_get_type(const launch_data_t ld); | ||
| 230 | |||
| 231 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 232 | OS_EXPORT OS_NONNULL1 | ||
| 233 | void | ||
| 234 | launch_data_free(launch_data_t ld); | ||
| 235 | |||
| 236 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 237 | OS_EXPORT OS_NONNULL1 OS_NONNULL2 OS_NONNULL3 | ||
| 238 | bool | ||
| 239 | launch_data_dict_insert(launch_data_t ldict, const launch_data_t lval, | ||
| 240 | 	const char *key); | ||
| 241 | |||
| 242 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 243 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL2 | ||
| 244 | launch_data_t _Nullable | ||
| 245 | launch_data_dict_lookup(const launch_data_t ldict, const char *key); | ||
| 246 | |||
| 247 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 248 | OS_EXPORT OS_NONNULL1 OS_NONNULL2 | ||
| 249 | bool | ||
| 250 | launch_data_dict_remove(launch_data_t ldict, const char *key); | ||
| 251 | |||
| 252 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 253 | OS_EXPORT OS_NONNULL1 OS_NONNULL2 | ||
| 254 | void | ||
| 255 | launch_data_dict_iterate(const launch_data_t ldict, | ||
| 256 | 	launch_data_dict_iterator_t iterator, void * _Nullable ctx); | ||
| 257 | |||
| 258 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 259 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 260 | size_t | ||
| 261 | launch_data_dict_get_count(const launch_data_t ldict); | ||
| 262 | |||
| 263 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 264 | OS_EXPORT OS_NONNULL1 OS_NONNULL2 | ||
| 265 | bool | ||
| 266 | launch_data_array_set_index(launch_data_t larray, const launch_data_t lval, | ||
| 267 | 	size_t idx); | ||
| 268 | |||
| 269 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 270 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 271 | launch_data_t | ||
| 272 | launch_data_array_get_index(const launch_data_t larray, size_t idx); | ||
| 273 | |||
| 274 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 275 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 276 | size_t | ||
| 277 | launch_data_array_get_count(const launch_data_t larray); | ||
| 278 | |||
| 279 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 280 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 281 | launch_data_t | ||
| 282 | launch_data_new_fd(int fd); | ||
| 283 | |||
| 284 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 285 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 286 | launch_data_t | ||
| 287 | launch_data_new_machport(mach_port_t val); | ||
| 288 | |||
| 289 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 290 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 291 | launch_data_t | ||
| 292 | launch_data_new_integer(long long val); | ||
| 293 | |||
| 294 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 295 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 296 | launch_data_t | ||
| 297 | launch_data_new_bool(bool val); | ||
| 298 | |||
| 299 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 300 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 301 | launch_data_t | ||
| 302 | launch_data_new_real(double val); | ||
| 303 | |||
| 304 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 305 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 306 | launch_data_t | ||
| 307 | launch_data_new_string(const char *val); | ||
| 308 | |||
| 309 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 310 | OS_EXPORT OS_MALLOC OS_WARN_RESULT | ||
| 311 | launch_data_t | ||
| 312 | launch_data_new_opaque(const void *bytes, size_t sz); | ||
| 313 | |||
| 314 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 315 | OS_EXPORT OS_NONNULL1 | ||
| 316 | bool | ||
| 317 | launch_data_set_fd(launch_data_t ld, int fd); | ||
| 318 | |||
| 319 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 320 | OS_EXPORT OS_NONNULL1 | ||
| 321 | bool | ||
| 322 | launch_data_set_machport(launch_data_t ld, mach_port_t mp); | ||
| 323 | |||
| 324 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 325 | OS_EXPORT OS_NONNULL1 | ||
| 326 | bool | ||
| 327 | launch_data_set_integer(launch_data_t ld, long long val); | ||
| 328 | |||
| 329 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 330 | OS_EXPORT OS_NONNULL1 | ||
| 331 | bool | ||
| 332 | launch_data_set_bool(launch_data_t ld, bool val); | ||
| 333 | |||
| 334 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 335 | OS_EXPORT OS_NONNULL1 | ||
| 336 | bool | ||
| 337 | launch_data_set_real(launch_data_t ld, double val); | ||
| 338 | |||
| 339 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 340 | OS_EXPORT OS_NONNULL1 | ||
| 341 | bool | ||
| 342 | launch_data_set_string(launch_data_t ld, const char *val); | ||
| 343 | |||
| 344 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 345 | OS_EXPORT OS_NONNULL1 | ||
| 346 | bool | ||
| 347 | launch_data_set_opaque(launch_data_t ld, const void *bytes, size_t sz); | ||
| 348 | |||
| 349 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 350 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 351 | int | ||
| 352 | launch_data_get_fd(const launch_data_t ld); | ||
| 353 | |||
| 354 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 355 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 356 | mach_port_t | ||
| 357 | launch_data_get_machport(const launch_data_t ld); | ||
| 358 | |||
| 359 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 360 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 361 | long long | ||
| 362 | launch_data_get_integer(const launch_data_t ld); | ||
| 363 | |||
| 364 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 365 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 366 | bool | ||
| 367 | launch_data_get_bool(const launch_data_t ld); | ||
| 368 | |||
| 369 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 370 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 371 | double | ||
| 372 | launch_data_get_real(const launch_data_t ld); | ||
| 373 | |||
| 374 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 375 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 376 | const char * | ||
| 377 | launch_data_get_string(const launch_data_t ld); | ||
| 378 | |||
| 379 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 380 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 381 | void * | ||
| 382 | launch_data_get_opaque(const launch_data_t ld); | ||
| 383 | |||
| 384 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 385 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 386 | size_t | ||
| 387 | launch_data_get_opaque_size(const launch_data_t ld); | ||
| 388 | |||
| 389 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 390 | OS_EXPORT OS_WARN_RESULT OS_NONNULL1 | ||
| 391 | int | ||
| 392 | launch_data_get_errno(const launch_data_t ld); | ||
| 393 | |||
| 394 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 395 | OS_EXPORT OS_WARN_RESULT | ||
| 396 | int | ||
| 397 | launch_get_fd(void); | ||
| 398 | |||
| 399 | __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0) | ||
| 400 | OS_EXPORT OS_MALLOC OS_WARN_RESULT OS_NONNULL1 | ||
| 401 | launch_data_t | ||
| 402 | launch_msg(const launch_data_t request); | ||
| 403 | |||
| 404 | __END_DECLS | ||
| 405 | #if __has_feature(assume_nonnull) | ||
| 406 | _Pragma("clang assume_nonnull end") | ||
| 407 | #endif | ||
| 408 | |||
| 409 | #endif // __XPC_LAUNCH_H__ | ||
lib/libc/include/x86_64-macos-gnu/libDER/DERItem.h created+47| ... | @@ -0,0 +1,47 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2020 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _DER_ITEM_H_ | ||
| 25 | #define _DER_ITEM_H_ | ||
| 26 | |||
| 27 | #if __has_include(<security_libDER/libDER/libDER_config.h>) | ||
| 28 | #include <security_libDER/libDER/libDER_config.h> | ||
| 29 | #else | ||
| 30 | #include <libDER/libDER_config.h> | ||
| 31 | #endif | ||
| 32 | |||
| 33 | __BEGIN_DECLS | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Primary representation of a block of memory. | ||
| 37 | */ | ||
| 38 | typedef struct { | ||
| 39 | DERByte *data; | ||
| 40 | DERSize length; | ||
| 41 | } DERItem; | ||
| 42 | |||
| 43 | __END_DECLS | ||
| 44 | |||
| 45 | #endif /* _DER_ITEM_H_ */ | ||
| 46 | |||
| 47 | |||
lib/libc/include/x86_64-macos-gnu/libDER/libDER_config.h created+121| ... | @@ -0,0 +1,121 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005-2007,2011-2012,2014 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | |||
| 25 | /* | ||
| 26 | * libDER_config.h - platform dependent #defines and typedefs for libDER | ||
| 27 | * | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef	_LIB_DER_CONFIG_H_ | ||
| 31 | #define _LIB_DER_CONFIG_H_ | ||
| 32 | |||
| 33 | #include <stddef.h> | ||
| 34 | #include <stdint.h> | ||
| 35 | #include <string.h> | ||
| 36 | |||
| 37 | #if defined(WIN32) && defined(__cplusplus) | ||
| 38 | |||
| 39 | #if !defined(__BEGIN_DECLS) || !defined(__END_DECLS) | ||
| 40 | #define __BEGIN_DECLS extern "C" { | ||
| 41 | #define __END_DECLS } | ||
| 42 | #endif // __BEGIN_DECLS || __END_DECLS | ||
| 43 | |||
| 44 | #else | ||
| 45 | #include <sys/cdefs.h> | ||
| 46 | #endif // defined(WIN32) && defined(__cplusplus) | ||
| 47 | |||
| 48 | __BEGIN_DECLS | ||
| 49 | |||
| 50 | /* | ||
| 51 | * Basic data types: unsigned 8-bit integer, unsigned 32-bit integer | ||
| 52 | */ | ||
| 53 | typedef uint8_t DERByte; | ||
| 54 | typedef uint16_t DERShort; | ||
| 55 | typedef size_t DERSize; | ||
| 56 | |||
| 57 | |||
| 58 | /* | ||
| 59 | * Use these #defines of you have memset, memmove, and memcmp; else | ||
| 60 | * write your own equivalents. | ||
| 61 | */ | ||
| 62 | |||
| 63 | #define DERMemset(ptr, c, len)		memset(ptr, c, len) | ||
| 64 | #define DERMemmove(dst, src, len)	memmove(dst, src, len) | ||
| 65 | #define DERMemcmp(b1, b2, len)		memcmp(b1, b2, len) | ||
| 66 | |||
| 67 | |||
| 68 | /*** | ||
| 69 | *** Compile time options to trim size of the library. | ||
| 70 | ***/ | ||
| 71 | |||
| 72 | /* enable general DER encode */ | ||
| 73 | #define DER_ENCODE_ENABLE		1 | ||
| 74 | |||
| 75 | /* enable general DER decode */ | ||
| 76 | #define DER_DECODE_ENABLE		1 | ||
| 77 | |||
| 78 | #ifndef DER_MULTIBYTE_TAGS | ||
| 79 | /* enable multibyte tag support. */ | ||
| 80 | #define DER_MULTIBYTE_TAGS		1 | ||
| 81 | #endif | ||
| 82 | |||
| 83 | #ifndef DER_TAG_SIZE | ||
| 84 | /* Iff DER_MULTIBYTE_TAGS is 1 this is the sizeof(DERTag) in bytes. Note that | ||
| 85 | tags are still encoded and decoded from a minimally encoded DER | ||
| 86 | represantation. This value maintains compatibility with libImg4Decode/Encode. */ | ||
| 87 | #define DER_TAG_SIZE 8 | ||
| 88 | #endif | ||
| 89 | |||
| 90 | |||
| 91 | /* ---------------------- Do not edit below this line ---------------------- */ | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Logical representation of a tag (the encoded representation is always in | ||
| 95 | * the minimal number of bytes). The top 3 bits encode class and method | ||
| 96 | * The remaining bits encode the tag value. To obtain smaller DERItemSpecs | ||
| 97 | * sizes, choose the smallest type that fits your needs. Most standard ASN.1 | ||
| 98 | * usage only needs single byte tags, but ocasionally custom applications | ||
| 99 | * require a larger tag namespace. | ||
| 100 | */ | ||
| 101 | #if DER_MULTIBYTE_TAGS | ||
| 102 | |||
| 103 | #if DER_TAG_SIZE == 1 | ||
| 104 | typedef uint8_t DERTag; | ||
| 105 | #elif DER_TAG_SIZE == 2 | ||
| 106 | typedef uint16_t DERTag; | ||
| 107 | #elif DER_TAG_SIZE == 4 | ||
| 108 | typedef uint32_t DERTag; | ||
| 109 | #elif DER_TAG_SIZE == 8 | ||
| 110 | typedef uint64_t DERTag; | ||
| 111 | #else | ||
| 112 | #error DER_TAG_SIZE invalid | ||
| 113 | #endif | ||
| 114 | |||
| 115 | #else /* DER_MULTIBYTE_TAGS */ | ||
| 116 | typedef DERByte DERTag; | ||
| 117 | #endif /* !DER_MULTIBYTE_TAGS */ | ||
| 118 | |||
| 119 | __END_DECLS | ||
| 120 | |||
| 121 | #endif	/* _LIB_DER_CONFIG_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/libgen.h created+63| ... | @@ -0,0 +1,63 @@ | ||
| 1 | /*	$OpenBSD: libgen.h,v 1.4 1999/05/28 22:00:22 espie Exp $	*/ | ||
| 2 | /*	$FreeBSD: src/include/libgen.h,v 1.1.2.1 2000/11/12 18:01:51 adrian Exp $	*/ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. The name of the author may not be used to endorse or promote products | ||
| 17 | * derived from this software without specific prior written permission. | ||
| 18 | * | ||
| 19 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
| 20 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY | ||
| 21 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
| 22 | * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| 23 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| 24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
| 25 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
| 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
| 27 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
| 28 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 29 | */ | ||
| 30 | |||
| 31 | #ifndef _LIBGEN_H_ | ||
| 32 | #define _LIBGEN_H_ | ||
| 33 | |||
| 34 | #include <sys/cdefs.h> | ||
| 35 | |||
| 36 | __BEGIN_DECLS | ||
| 37 | |||
| 38 | #if __DARWIN_UNIX03 | ||
| 39 | |||
| 40 | char	*basename(char *); | ||
| 41 | char	*dirname(char *); | ||
| 42 | |||
| 43 | #else /* !__DARWIN_UNIX03 */ | ||
| 44 | |||
| 45 | char	*basename(const char *); | ||
| 46 | char	*dirname(const char *); | ||
| 47 | |||
| 48 | #endif /* __DARWIN_UNIX_03 */ | ||
| 49 | |||
| 50 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 51 | #include <Availability.h> | ||
| 52 | char	*basename_r(const char *, char *) | ||
| 53 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 54 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 55 | |||
| 56 | char	*dirname_r(const char *, char *) | ||
| 57 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 58 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 59 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 60 | |||
| 61 | __END_DECLS | ||
| 62 | |||
| 63 | #endif /* _LIBGEN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/OSAtomic.h created+47| ... | @@ -0,0 +1,47 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2016 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _OSATOMIC_H_ | ||
| 25 | #define _OSATOMIC_H_ | ||
| 26 | |||
| 27 | /*! @header | ||
| 28 | * These are deprecated legacy interfaces for atomic and synchronization | ||
| 29 | * operations. | ||
| 30 | * | ||
| 31 | * Define OSATOMIC_USE_INLINED=1 to get inline implementations of the | ||
| 32 | * OSAtomic interfaces in terms of the <stdatomic.h> primitives. | ||
| 33 | * | ||
| 34 | * Define OSSPINLOCK_USE_INLINED=1 to get inline implementations of the | ||
| 35 | * OSSpinLock interfaces in terms of the <os/lock.h> primitives. | ||
| 36 | * | ||
| 37 | * These are intended as a transition convenience, direct use of those | ||
| 38 | * primitives should be preferred. | ||
| 39 | */ | ||
| 40 | |||
| 41 | #include <sys/cdefs.h> | ||
| 42 | |||
| 43 | #include "OSAtomicDeprecated.h" | ||
| 44 | #include "OSSpinLockDeprecated.h" | ||
| 45 | #include "OSAtomicQueue.h" | ||
| 46 | |||
| 47 | #endif /* _OSATOMIC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h created+1266| ... | @@ -0,0 +1,1266 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2016 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _OSATOMIC_DEPRECATED_H_ | ||
| 25 | #define _OSATOMIC_DEPRECATED_H_ | ||
| 26 | |||
| 27 | /*! @header | ||
| 28 | * These are deprecated legacy interfaces for atomic operations. | ||
| 29 | * The C11 interfaces in <stdatomic.h> resp. C++11 interfaces in <atomic> | ||
| 30 | * should be used instead. | ||
| 31 | * | ||
| 32 | * Define OSATOMIC_USE_INLINED=1 to get inline implementations of these | ||
| 33 | * interfaces in terms of the <stdatomic.h> resp. <atomic> primitives. | ||
| 34 | * This is intended as a transition convenience, direct use of those primitives | ||
| 35 | * is preferred. | ||
| 36 | */ | ||
| 37 | |||
| 38 | #include <Availability.h> | ||
| 39 | |||
| 40 | #if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED) | ||
| 41 | |||
| 42 | #include <sys/cdefs.h> | ||
| 43 | #include <stddef.h> | ||
| 44 | #include <stdint.h> | ||
| 45 | #include <stdbool.h> | ||
| 46 | |||
| 47 | #ifndef OSATOMIC_DEPRECATED | ||
| 48 | #define OSATOMIC_DEPRECATED 1 | ||
| 49 | #ifndef __cplusplus | ||
| 50 | #define OSATOMIC_BARRIER_DEPRECATED_MSG(_r) \ | ||
| 51 | 		"Use " #_r "() from <stdatomic.h> instead" | ||
| 52 | #define OSATOMIC_DEPRECATED_MSG(_r) \ | ||
| 53 | 		"Use " #_r "_explicit(memory_order_relaxed) from <stdatomic.h> instead" | ||
| 54 | #else | ||
| 55 | #define OSATOMIC_BARRIER_DEPRECATED_MSG(_r) \ | ||
| 56 | 		"Use std::" #_r "() from <atomic> instead" | ||
| 57 | #define OSATOMIC_DEPRECATED_MSG(_r) \ | ||
| 58 | 		"Use std::" #_r "_explicit(std::memory_order_relaxed) from <atomic> instead" | ||
| 59 | #endif | ||
| 60 | #define OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(_r) \ | ||
| 61 | 	__OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) \ | ||
| 62 | 	__OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) \ | ||
| 63 | 	__OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) \ | ||
| 64 | 	__OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) | ||
| 65 | #define OSATOMIC_DEPRECATED_REPLACE_WITH(_r) \ | ||
| 66 | 	__OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSATOMIC_DEPRECATED_MSG(_r)) \ | ||
| 67 | 	__OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSATOMIC_DEPRECATED_MSG(_r)) \ | ||
| 68 | 	__OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSATOMIC_DEPRECATED_MSG(_r)) \ | ||
| 69 | 	__OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSATOMIC_DEPRECATED_MSG(_r)) | ||
| 70 | #else | ||
| 71 | #undef OSATOMIC_DEPRECATED | ||
| 72 | #define OSATOMIC_DEPRECATED 0 | ||
| 73 | #define OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(_r) | ||
| 74 | #define OSATOMIC_DEPRECATED_REPLACE_WITH(_r) | ||
| 75 | #endif | ||
| 76 | |||
| 77 | /* | ||
| 78 | * WARNING: all addresses passed to these functions must be "naturally aligned", | ||
| 79 | * i.e. <code>int32_t</code> pointers must be 32-bit aligned (low 2 bits of | ||
| 80 | * address are zeroes), and <code>int64_t</code> pointers must be 64-bit | ||
| 81 | * aligned (low 3 bits of address are zeroes.). | ||
| 82 | * Note that this is not the default alignment of the <code>int64_t</code> type | ||
| 83 | * in the iOS ARMv7 ABI, see | ||
| 84 | * {@link //apple_ref/doc/uid/TP40009021-SW8 iPhoneOSABIReference} | ||
| 85 | * | ||
| 86 | * Note that some versions of the atomic functions incorporate memory barriers | ||
| 87 | * and some do not. Barriers strictly order memory access on weakly-ordered | ||
| 88 | * architectures such as ARM. All loads and stores that appear (in sequential | ||
| 89 | * program order) before the barrier are guaranteed to complete before any | ||
| 90 | * load or store that appears after the barrier. | ||
| 91 | * | ||
| 92 | * The barrier operation is typically a no-op on uniprocessor systems and | ||
| 93 | * fully enabled on multiprocessor systems. On some platforms, such as ARM, | ||
| 94 | * the barrier can be quite expensive. | ||
| 95 | * | ||
| 96 | * Most code should use the barrier functions to ensure that memory shared | ||
| 97 | * between threads is properly synchronized. For example, if you want to | ||
| 98 | * initialize a shared data structure and then atomically increment a variable | ||
| 99 | * to indicate that the initialization is complete, you must use | ||
| 100 | * {@link OSAtomicIncrement32Barrier} to ensure that the stores to your data | ||
| 101 | * structure complete before the atomic increment. | ||
| 102 | * | ||
| 103 | * Likewise, the consumer of that data structure must use | ||
| 104 | * {@link OSAtomicDecrement32Barrier}, | ||
| 105 | * in order to ensure that their loads of the structure are not executed before | ||
| 106 | * the atomic decrement. On the other hand, if you are simply incrementing a | ||
| 107 | * global counter, then it is safe and potentially faster to use | ||
| 108 | * {@link OSAtomicIncrement32}. | ||
| 109 | * | ||
| 110 | * If you are unsure which version to use, prefer the barrier variants as they | ||
| 111 | * are safer. | ||
| 112 | * | ||
| 113 | * For the kernel-space version of this header, see | ||
| 114 | * {@link //apple_ref/doc/header/OSAtomic.h OSAtomic.h (Kernel Framework)} | ||
| 115 | * | ||
| 116 | * @apiuid //apple_ref/doc/header/user_space_OSAtomic.h | ||
| 117 | */ | ||
| 118 | |||
| 119 | __BEGIN_DECLS | ||
| 120 | |||
| 121 | /*! @typedef OSAtomic_int64_aligned64_t | ||
| 122 | * 64-bit aligned <code>int64_t</code> type. | ||
| 123 | * Use for variables whose addresses are passed to OSAtomic*64() functions to | ||
| 124 | * get the compiler to generate the required alignment. | ||
| 125 | */ | ||
| 126 | |||
| 127 | #if __has_attribute(aligned) | ||
| 128 | typedef int64_t __attribute__((__aligned__((sizeof(int64_t))))) | ||
| 129 | 		OSAtomic_int64_aligned64_t; | ||
| 130 | #else | ||
| 131 | typedef int64_t OSAtomic_int64_aligned64_t; | ||
| 132 | #endif | ||
| 133 | |||
| 134 | /*! @group Arithmetic functions | ||
| 135 | All functions in this group return the new value. | ||
| 136 | */ | ||
| 137 | |||
| 138 | /*! @abstract Atomically adds two 32-bit values. | ||
| 139 | @discussion | ||
| 140 | 	This function adds the value given by <code>__theAmount</code> to the | ||
| 141 | 	value in the memory location referenced by <code>__theValue</code>, | ||
| 142 | 	storing the result back to that memory location atomically. | ||
| 143 | @result Returns the new value. | ||
| 144 | */ | ||
| 145 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 146 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 147 | int32_t	OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue ); | ||
| 148 | |||
| 149 | |||
| 150 | /*! @abstract Atomically adds two 32-bit values. | ||
| 151 | @discussion | ||
| 152 | 	This function adds the value given by <code>__theAmount</code> to the | ||
| 153 | 	value in the memory location referenced by <code>__theValue</code>, | ||
| 154 | 	storing the result back to that memory location atomically. | ||
| 155 | |||
| 156 | 	This function is equivalent to {@link OSAtomicAdd32} | ||
| 157 | 	except that it also introduces a barrier. | ||
| 158 | @result Returns the new value. | ||
| 159 | */ | ||
| 160 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 161 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 162 | int32_t	OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue ); | ||
| 163 | |||
| 164 | |||
| 165 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 || TARGET_OS_DRIVERKIT | ||
| 166 | |||
| 167 | /*! @abstract Atomically increments a 32-bit value. | ||
| 168 | @result Returns the new value. | ||
| 169 | */ | ||
| 170 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 171 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 172 | int32_t	OSAtomicIncrement32( volatile int32_t *__theValue ); | ||
| 173 | |||
| 174 | |||
| 175 | /*! @abstract Atomically increments a 32-bit value with a barrier. | ||
| 176 | @discussion | ||
| 177 | 	This function is equivalent to {@link OSAtomicIncrement32} | ||
| 178 | 	except that it also introduces a barrier. | ||
| 179 | @result Returns the new value. | ||
| 180 | */ | ||
| 181 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 182 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 183 | int32_t	OSAtomicIncrement32Barrier( volatile int32_t *__theValue ); | ||
| 184 | |||
| 185 | |||
| 186 | /*! @abstract Atomically decrements a 32-bit value. | ||
| 187 | @result Returns the new value. | ||
| 188 | */ | ||
| 189 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) | ||
| 190 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 191 | int32_t	OSAtomicDecrement32( volatile int32_t *__theValue ); | ||
| 192 | |||
| 193 | |||
| 194 | /*! @abstract Atomically decrements a 32-bit value with a barrier. | ||
| 195 | @discussion | ||
| 196 | 	This function is equivalent to {@link OSAtomicDecrement32} | ||
| 197 | 	except that it also introduces a barrier. | ||
| 198 | @result Returns the new value. | ||
| 199 | */ | ||
| 200 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) | ||
| 201 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 202 | int32_t	OSAtomicDecrement32Barrier( volatile int32_t *__theValue ); | ||
| 203 | |||
| 204 | #else | ||
| 205 | __inline static | ||
| 206 | int32_t	OSAtomicIncrement32( volatile int32_t *__theValue ) | ||
| 207 | { return OSAtomicAdd32( 1, __theValue); } | ||
| 208 | |||
| 209 | __inline static | ||
| 210 | int32_t	OSAtomicIncrement32Barrier( volatile int32_t *__theValue ) | ||
| 211 | { return OSAtomicAdd32Barrier( 1, __theValue); } | ||
| 212 | |||
| 213 | __inline static | ||
| 214 | int32_t	OSAtomicDecrement32( volatile int32_t *__theValue ) | ||
| 215 | { return OSAtomicAdd32( -1, __theValue); } | ||
| 216 | |||
| 217 | __inline static | ||
| 218 | int32_t	OSAtomicDecrement32Barrier( volatile int32_t *__theValue ) | ||
| 219 | { return OSAtomicAdd32Barrier( -1, __theValue); } | ||
| 220 | #endif | ||
| 221 | |||
| 222 | |||
| 223 | /*! @abstract Atomically adds two 64-bit values. | ||
| 224 | @discussion | ||
| 225 | 	This function adds the value given by <code>__theAmount</code> to the | ||
| 226 | 	value in the memory location referenced by <code>__theValue</code>, | ||
| 227 | 	storing the result back to that memory location atomically. | ||
| 228 | @result Returns the new value. | ||
| 229 | */ | ||
| 230 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 231 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 232 | int64_t	OSAtomicAdd64( int64_t __theAmount, | ||
| 233 | 		volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 234 | |||
| 235 | |||
| 236 | /*! @abstract Atomically adds two 64-bit values with a barrier. | ||
| 237 | @discussion | ||
| 238 | 	This function adds the value given by <code>__theAmount</code> to the | ||
| 239 | 	value in the memory location referenced by <code>__theValue</code>, | ||
| 240 | 	storing the result back to that memory location atomically. | ||
| 241 | |||
| 242 | 	This function is equivalent to {@link OSAtomicAdd64} | ||
| 243 | 	except that it also introduces a barrier. | ||
| 244 | @result Returns the new value. | ||
| 245 | */ | ||
| 246 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 247 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_3_2) | ||
| 248 | int64_t	OSAtomicAdd64Barrier( int64_t __theAmount, | ||
| 249 | 		volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 250 | |||
| 251 | |||
| 252 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 || TARGET_OS_DRIVERKIT | ||
| 253 | |||
| 254 | /*! @abstract Atomically increments a 64-bit value. | ||
| 255 | @result Returns the new value. | ||
| 256 | */ | ||
| 257 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 258 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 259 | int64_t	OSAtomicIncrement64( volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 260 | |||
| 261 | |||
| 262 | /*! @abstract Atomically increments a 64-bit value with a barrier. | ||
| 263 | @discussion | ||
| 264 | 	This function is equivalent to {@link OSAtomicIncrement64} | ||
| 265 | 	except that it also introduces a barrier. | ||
| 266 | @result Returns the new value. | ||
| 267 | */ | ||
| 268 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) | ||
| 269 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 270 | int64_t	OSAtomicIncrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 271 | |||
| 272 | |||
| 273 | /*! @abstract Atomically decrements a 64-bit value. | ||
| 274 | @result Returns the new value. | ||
| 275 | */ | ||
| 276 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) | ||
| 277 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 278 | int64_t	OSAtomicDecrement64( volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 279 | |||
| 280 | |||
| 281 | /*! @abstract Atomically decrements a 64-bit value with a barrier. | ||
| 282 | @discussion | ||
| 283 | 	This function is equivalent to {@link OSAtomicDecrement64} | ||
| 284 | 	except that it also introduces a barrier. | ||
| 285 | @result Returns the new value. | ||
| 286 | */ | ||
| 287 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) | ||
| 288 | __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) | ||
| 289 | int64_t	OSAtomicDecrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 290 | |||
| 291 | #else | ||
| 292 | __inline static | ||
| 293 | int64_t	OSAtomicIncrement64( volatile OSAtomic_int64_aligned64_t *__theValue ) | ||
| 294 | { return OSAtomicAdd64( 1, __theValue); } | ||
| 295 | |||
| 296 | __inline static | ||
| 297 | int64_t	OSAtomicIncrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue ) | ||
| 298 | { return OSAtomicAdd64Barrier( 1, __theValue); } | ||
| 299 | |||
| 300 | __inline static | ||
| 301 | int64_t	OSAtomicDecrement64( volatile OSAtomic_int64_aligned64_t *__theValue ) | ||
| 302 | { return OSAtomicAdd64( -1, __theValue); } | ||
| 303 | |||
| 304 | __inline static | ||
| 305 | int64_t	OSAtomicDecrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue ) | ||
| 306 | { return OSAtomicAdd64Barrier( -1, __theValue); } | ||
| 307 | #endif | ||
| 308 | |||
| 309 | |||
| 310 | /*! @group Boolean functions (AND, OR, XOR) | ||
| 311 | * | ||
| 312 | * @discussion Functions in this group come in four variants for each operation: | ||
| 313 | * with and without barriers, and functions that return the original value or | ||
| 314 | * the result value of the operation. | ||
| 315 | * | ||
| 316 | * The "Orig" versions return the original value, (before the operation); the non-Orig | ||
| 317 | * versions return the value after the operation. All are layered on top of | ||
| 318 | * {@link OSAtomicCompareAndSwap32} and similar. | ||
| 319 | */ | ||
| 320 | |||
| 321 | /*! @abstract Atomic bitwise OR of two 32-bit values. | ||
| 322 | @discussion | ||
| 323 | 	This function performs the bitwise OR of the value given by <code>__theMask</code> | ||
| 324 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 325 | 	storing the result back to that memory location atomically. | ||
| 326 | @result Returns the new value. | ||
| 327 | */ | ||
| 328 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or) | ||
| 329 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 330 | int32_t	OSAtomicOr32( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 331 | |||
| 332 | |||
| 333 | /*! @abstract Atomic bitwise OR of two 32-bit values with barrier. | ||
| 334 | @discussion | ||
| 335 | 	This function performs the bitwise OR of the value given by <code>__theMask</code> | ||
| 336 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 337 | 	storing the result back to that memory location atomically. | ||
| 338 | |||
| 339 | 	This function is equivalent to {@link OSAtomicOr32} | ||
| 340 | 	except that it also introduces a barrier. | ||
| 341 | @result Returns the new value. | ||
| 342 | */ | ||
| 343 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or) | ||
| 344 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 345 | int32_t	OSAtomicOr32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 346 | |||
| 347 | |||
| 348 | /*! @abstract Atomic bitwise OR of two 32-bit values returning original. | ||
| 349 | @discussion | ||
| 350 | 	This function performs the bitwise OR of the value given by <code>__theMask</code> | ||
| 351 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 352 | 	storing the result back to that memory location atomically. | ||
| 353 | @result Returns the original value referenced by <code>__theValue</code>. | ||
| 354 | */ | ||
| 355 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or) | ||
| 356 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) | ||
| 357 | int32_t	OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 358 | |||
| 359 | |||
| 360 | /*! @abstract Atomic bitwise OR of two 32-bit values returning original with barrier. | ||
| 361 | @discussion | ||
| 362 | 	This function performs the bitwise OR of the value given by <code>__theMask</code> | ||
| 363 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 364 | 	storing the result back to that memory location atomically. | ||
| 365 | |||
| 366 | 	This function is equivalent to {@link OSAtomicOr32Orig} | ||
| 367 | 	except that it also introduces a barrier. | ||
| 368 | @result Returns the original value referenced by <code>__theValue</code>. | ||
| 369 | */ | ||
| 370 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or) | ||
| 371 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) | ||
| 372 | int32_t	OSAtomicOr32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 373 | |||
| 374 | |||
| 375 | |||
| 376 | |||
| 377 | /*! @abstract Atomic bitwise AND of two 32-bit values. | ||
| 378 | @discussion | ||
| 379 | 	This function performs the bitwise AND of the value given by <code>__theMask</code> | ||
| 380 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 381 | 	storing the result back to that memory location atomically. | ||
| 382 | @result Returns the new value. | ||
| 383 | */ | ||
| 384 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and) | ||
| 385 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 386 | int32_t	OSAtomicAnd32( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 387 | |||
| 388 | |||
| 389 | /*! @abstract Atomic bitwise AND of two 32-bit values with barrier. | ||
| 390 | @discussion | ||
| 391 | 	This function performs the bitwise AND of the value given by <code>__theMask</code> | ||
| 392 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 393 | 	storing the result back to that memory location atomically. | ||
| 394 | |||
| 395 | 	This function is equivalent to {@link OSAtomicAnd32} | ||
| 396 | 	except that it also introduces a barrier. | ||
| 397 | @result Returns the new value. | ||
| 398 | */ | ||
| 399 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) | ||
| 400 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 401 | int32_t	OSAtomicAnd32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 402 | |||
| 403 | |||
| 404 | /*! @abstract Atomic bitwise AND of two 32-bit values returning original. | ||
| 405 | @discussion | ||
| 406 | 	This function performs the bitwise AND of the value given by <code>__theMask</code> | ||
| 407 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 408 | 	storing the result back to that memory location atomically. | ||
| 409 | @result Returns the original value referenced by <code>__theValue</code>. | ||
| 410 | */ | ||
| 411 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and) | ||
| 412 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) | ||
| 413 | int32_t	OSAtomicAnd32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 414 | |||
| 415 | |||
| 416 | /*! @abstract Atomic bitwise AND of two 32-bit values returning original with barrier. | ||
| 417 | @discussion | ||
| 418 | 	This function performs the bitwise AND of the value given by <code>__theMask</code> | ||
| 419 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 420 | 	storing the result back to that memory location atomically. | ||
| 421 | |||
| 422 | 	This function is equivalent to {@link OSAtomicAnd32Orig} | ||
| 423 | 	except that it also introduces a barrier. | ||
| 424 | @result Returns the original value referenced by <code>__theValue</code>. | ||
| 425 | */ | ||
| 426 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) | ||
| 427 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) | ||
| 428 | int32_t	OSAtomicAnd32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 429 | |||
| 430 | |||
| 431 | |||
| 432 | |||
| 433 | /*! @abstract Atomic bitwise XOR of two 32-bit values. | ||
| 434 | @discussion | ||
| 435 | 	This function performs the bitwise XOR of the value given by <code>__theMask</code> | ||
| 436 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 437 | 	storing the result back to that memory location atomically. | ||
| 438 | @result Returns the new value. | ||
| 439 | */ | ||
| 440 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) | ||
| 441 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 442 | int32_t	OSAtomicXor32( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 443 | |||
| 444 | |||
| 445 | /*! @abstract Atomic bitwise XOR of two 32-bit values with barrier. | ||
| 446 | @discussion | ||
| 447 | 	This function performs the bitwise XOR of the value given by <code>__theMask</code> | ||
| 448 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 449 | 	storing the result back to that memory location atomically. | ||
| 450 | |||
| 451 | 	This function is equivalent to {@link OSAtomicXor32} | ||
| 452 | 	except that it also introduces a barrier. | ||
| 453 | @result Returns the new value. | ||
| 454 | */ | ||
| 455 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) | ||
| 456 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 457 | int32_t	OSAtomicXor32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 458 | |||
| 459 | |||
| 460 | /*! @abstract Atomic bitwise XOR of two 32-bit values returning original. | ||
| 461 | @discussion | ||
| 462 | 	This function performs the bitwise XOR of the value given by <code>__theMask</code> | ||
| 463 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 464 | 	storing the result back to that memory location atomically. | ||
| 465 | @result Returns the original value referenced by <code>__theValue</code>. | ||
| 466 | */ | ||
| 467 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) | ||
| 468 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) | ||
| 469 | int32_t	OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 470 | |||
| 471 | |||
| 472 | /*! @abstract Atomic bitwise XOR of two 32-bit values returning original with barrier. | ||
| 473 | @discussion | ||
| 474 | 	This function performs the bitwise XOR of the value given by <code>__theMask</code> | ||
| 475 | 	with the value in the memory location referenced by <code>__theValue</code>, | ||
| 476 | 	storing the result back to that memory location atomically. | ||
| 477 | |||
| 478 | 	This function is equivalent to {@link OSAtomicXor32Orig} | ||
| 479 | 	except that it also introduces a barrier. | ||
| 480 | @result Returns the original value referenced by <code>__theValue</code>. | ||
| 481 | */ | ||
| 482 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) | ||
| 483 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) | ||
| 484 | int32_t	OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); | ||
| 485 | |||
| 486 | |||
| 487 | /*! @group Compare and swap | ||
| 488 | * Functions in this group return true if the swap occured. There are several versions, | ||
| 489 | * depending on data type and on whether or not a barrier is used. | ||
| 490 | */ | ||
| 491 | |||
| 492 | |||
| 493 | /*! @abstract Compare and swap for 32-bit values. | ||
| 494 | @discussion | ||
| 495 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 496 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 497 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 498 | 	that memory location atomically. | ||
| 499 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 500 | */ | ||
| 501 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 502 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 503 | bool OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); | ||
| 504 | |||
| 505 | |||
| 506 | /*! @abstract Compare and swap for 32-bit values with barrier. | ||
| 507 | @discussion | ||
| 508 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 509 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 510 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 511 | 	that memory location atomically. | ||
| 512 | |||
| 513 | 	This function is equivalent to {@link OSAtomicCompareAndSwap32} | ||
| 514 | 	except that it also introduces a barrier. | ||
| 515 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 516 | */ | ||
| 517 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 518 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 519 | bool OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); | ||
| 520 | |||
| 521 | |||
| 522 | /*! @abstract Compare and swap pointers. | ||
| 523 | @discussion | ||
| 524 | 	This function compares the pointer stored in <code>__oldValue</code> to the pointer | ||
| 525 | 	in the memory location referenced by <code>__theValue</code>. If the pointers | ||
| 526 | 	match, this function stores the pointer from <code>__newValue</code> into | ||
| 527 | 	that memory location atomically. | ||
| 528 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 529 | */ | ||
| 530 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 531 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) | ||
| 532 | bool	OSAtomicCompareAndSwapPtr( void *__oldValue, void *__newValue, void * volatile *__theValue ); | ||
| 533 | |||
| 534 | |||
| 535 | /*! @abstract Compare and swap pointers with barrier. | ||
| 536 | @discussion | ||
| 537 | 	This function compares the pointer stored in <code>__oldValue</code> to the pointer | ||
| 538 | 	in the memory location referenced by <code>__theValue</code>. If the pointers | ||
| 539 | 	match, this function stores the pointer from <code>__newValue</code> into | ||
| 540 | 	that memory location atomically. | ||
| 541 | |||
| 542 | 	This function is equivalent to {@link OSAtomicCompareAndSwapPtr} | ||
| 543 | 	except that it also introduces a barrier. | ||
| 544 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 545 | */ | ||
| 546 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 547 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) | ||
| 548 | bool	OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue ); | ||
| 549 | |||
| 550 | |||
| 551 | /*! @abstract Compare and swap for <code>int</code> values. | ||
| 552 | @discussion | ||
| 553 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 554 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 555 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 556 | 	that memory location atomically. | ||
| 557 | |||
| 558 | 	This function is equivalent to {@link OSAtomicCompareAndSwap32}. | ||
| 559 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 560 | */ | ||
| 561 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 562 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) | ||
| 563 | bool	OSAtomicCompareAndSwapInt( int __oldValue, int __newValue, volatile int *__theValue ); | ||
| 564 | |||
| 565 | |||
| 566 | /*! @abstract Compare and swap for <code>int</code> values. | ||
| 567 | @discussion | ||
| 568 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 569 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 570 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 571 | 	that memory location atomically. | ||
| 572 | |||
| 573 | 	This function is equivalent to {@link OSAtomicCompareAndSwapInt} | ||
| 574 | 	except that it also introduces a barrier. | ||
| 575 | |||
| 576 | 	This function is equivalent to {@link OSAtomicCompareAndSwap32Barrier}. | ||
| 577 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 578 | */ | ||
| 579 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 580 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) | ||
| 581 | bool	OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile int *__theValue ); | ||
| 582 | |||
| 583 | |||
| 584 | /*! @abstract Compare and swap for <code>long</code> values. | ||
| 585 | @discussion | ||
| 586 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 587 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 588 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 589 | 	that memory location atomically. | ||
| 590 | |||
| 591 | 	This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures, | ||
| 592 | 	or {@link OSAtomicCompareAndSwap64} on 64-bit architectures. | ||
| 593 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 594 | */ | ||
| 595 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 596 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) | ||
| 597 | bool	OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long *__theValue ); | ||
| 598 | |||
| 599 | |||
| 600 | /*! @abstract Compare and swap for <code>long</code> values. | ||
| 601 | @discussion | ||
| 602 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 603 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 604 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 605 | 	that memory location atomically. | ||
| 606 | |||
| 607 | 	This function is equivalent to {@link OSAtomicCompareAndSwapLong} | ||
| 608 | 	except that it also introduces a barrier. | ||
| 609 | |||
| 610 | 	This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures, | ||
| 611 | 	or {@link OSAtomicCompareAndSwap64} on 64-bit architectures. | ||
| 612 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 613 | */ | ||
| 614 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 615 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) | ||
| 616 | bool	OSAtomicCompareAndSwapLongBarrier( long __oldValue, long __newValue, volatile long *__theValue ); | ||
| 617 | |||
| 618 | |||
| 619 | /*! @abstract Compare and swap for <code>uint64_t</code> values. | ||
| 620 | @discussion | ||
| 621 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 622 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 623 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 624 | 	that memory location atomically. | ||
| 625 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 626 | */ | ||
| 627 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 628 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 629 | bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, | ||
| 630 | 		volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 631 | |||
| 632 | |||
| 633 | /*! @abstract Compare and swap for <code>uint64_t</code> values. | ||
| 634 | @discussion | ||
| 635 | 	This function compares the value in <code>__oldValue</code> to the value | ||
| 636 | 	in the memory location referenced by <code>__theValue</code>. If the values | ||
| 637 | 	match, this function stores the value from <code>__newValue</code> into | ||
| 638 | 	that memory location atomically. | ||
| 639 | |||
| 640 | 	This function is equivalent to {@link OSAtomicCompareAndSwap64} | ||
| 641 | 	except that it also introduces a barrier. | ||
| 642 | @result Returns TRUE on a match, FALSE otherwise. | ||
| 643 | */ | ||
| 644 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) | ||
| 645 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_3_2) | ||
| 646 | bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, | ||
| 647 | 		volatile OSAtomic_int64_aligned64_t *__theValue ); | ||
| 648 | |||
| 649 | |||
| 650 | /* Test and set. | ||
| 651 | * They return the original value of the bit, and operate on bit (0x80>>(n&7)) | ||
| 652 | * in byte ((char*)theAddress + (n>>3)). | ||
| 653 | */ | ||
| 654 | /*! @abstract Atomic test and set | ||
| 655 | @discussion | ||
| 656 | 	This function tests a bit in the value referenced by | ||
| 657 | 	<code>__theAddress</code> and if it is not set, sets it. | ||
| 658 | |||
| 659 | 	The bit is chosen by the value of <code>__n</code> such that the | ||
| 660 | 	operation will be performed on bit <code>(0x80 >> (__n & 7))</code> | ||
| 661 | 	of byte <code>((char *)__theAddress + (n >> 3))</code>. | ||
| 662 | |||
| 663 | 	For example, if <code>__theAddress</code> points to a 64-bit value, | ||
| 664 | 	to compare the value of the most significant bit, you would specify | ||
| 665 | 	<code>56</code> for <code>__n</code>. | ||
| 666 | @result | ||
| 667 | 	Returns the original value of the bit being tested. | ||
| 668 | */ | ||
| 669 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or) | ||
| 670 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 671 | bool OSAtomicTestAndSet( uint32_t __n, volatile void *__theAddress ); | ||
| 672 | |||
| 673 | |||
| 674 | /*! @abstract Atomic test and set with barrier | ||
| 675 | @discussion | ||
| 676 | 	This function tests a bit in the value referenced by <code>__theAddress</code> | ||
| 677 | 	and if it is not set, sets it. | ||
| 678 | |||
| 679 | 	The bit is chosen by the value of <code>__n</code> such that the | ||
| 680 | 	operation will be performed on bit <code>(0x80 >> (__n & 7))</code> | ||
| 681 | 	of byte <code>((char *)__theAddress + (n >> 3))</code>. | ||
| 682 | |||
| 683 | 	For example, if <code>__theAddress</code> points to a 64-bit value, | ||
| 684 | 	to compare the value of the most significant bit, you would specify | ||
| 685 | 	<code>56</code> for <code>__n</code>. | ||
| 686 | |||
| 687 | 	This function is equivalent to {@link OSAtomicTestAndSet} | ||
| 688 | 	except that it also introduces a barrier. | ||
| 689 | @result | ||
| 690 | 	Returns the original value of the bit being tested. | ||
| 691 | */ | ||
| 692 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or) | ||
| 693 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 694 | bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress ); | ||
| 695 | |||
| 696 | |||
| 697 | |||
| 698 | /*! @abstract Atomic test and clear | ||
| 699 | @discussion | ||
| 700 | 	This function tests a bit in the value referenced by <code>__theAddress</code> | ||
| 701 | 	and if it is not cleared, clears it. | ||
| 702 | |||
| 703 | 	The bit is chosen by the value of <code>__n</code> such that the | ||
| 704 | 	operation will be performed on bit <code>(0x80 >> (__n & 7))</code> | ||
| 705 | 	of byte <code>((char *)__theAddress + (n >> 3))</code>. | ||
| 706 | |||
| 707 | 	For example, if <code>__theAddress</code> points to a 64-bit value, | ||
| 708 | 	to compare the value of the most significant bit, you would specify | ||
| 709 | 	<code>56</code> for <code>__n</code>. | ||
| 710 | |||
| 711 | @result | ||
| 712 | 	Returns the original value of the bit being tested. | ||
| 713 | */ | ||
| 714 | OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and) | ||
| 715 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 716 | bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress ); | ||
| 717 | |||
| 718 | |||
| 719 | /*! @abstract Atomic test and clear | ||
| 720 | @discussion | ||
| 721 | 	This function tests a bit in the value referenced by <code>__theAddress</code> | ||
| 722 | 	and if it is not cleared, clears it. | ||
| 723 | |||
| 724 | 	The bit is chosen by the value of <code>__n</code> such that the | ||
| 725 | 	operation will be performed on bit <code>(0x80 >> (__n & 7))</code> | ||
| 726 | 	of byte <code>((char *)__theAddress + (n >> 3))</code>. | ||
| 727 | |||
| 728 | 	For example, if <code>__theAddress</code> points to a 64-bit value, | ||
| 729 | 	to compare the value of the most significant bit, you would specify | ||
| 730 | 	<code>56</code> for <code>__n</code>. | ||
| 731 | |||
| 732 | 	This function is equivalent to {@link OSAtomicTestAndSet} | ||
| 733 | 	except that it also introduces a barrier. | ||
| 734 | @result | ||
| 735 | 	Returns the original value of the bit being tested. | ||
| 736 | */ | ||
| 737 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) | ||
| 738 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 739 | bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress ); | ||
| 740 | |||
| 741 | |||
| 742 | /*! @group Memory barriers */ | ||
| 743 | |||
| 744 | /*! @abstract Memory barrier. | ||
| 745 | @discussion | ||
| 746 | 	This function serves as both a read and write barrier. | ||
| 747 | */ | ||
| 748 | OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_thread_fence) | ||
| 749 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 750 | void OSMemoryBarrier( void ); | ||
| 751 | |||
| 752 | __END_DECLS | ||
| 753 | |||
| 754 | #else // defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED | ||
| 755 | |||
| 756 | /* | ||
| 757 | * Inline implementations of the legacy OSAtomic interfaces in terms of | ||
| 758 | * C11 <stdatomic.h> resp. C++11 <atomic> primitives. | ||
| 759 | * Direct use of those primitives is preferred. | ||
| 760 | */ | ||
| 761 | |||
| 762 | #include <sys/cdefs.h> | ||
| 763 | |||
| 764 | #include <stddef.h> | ||
| 765 | #include <stdint.h> | ||
| 766 | #include <stdbool.h> | ||
| 767 | |||
| 768 | #ifdef __cplusplus | ||
| 769 | extern "C++" { | ||
| 770 | #if !(__has_include(<atomic>) && __has_extension(cxx_atomic)) | ||
| 771 | #error Cannot use inlined OSAtomic without <atomic> and C++11 atomics | ||
| 772 | #endif | ||
| 773 | #include <atomic> | ||
| 774 | typedef std::atomic<uint8_t> _OSAtomic_uint8_t; | ||
| 775 | typedef std::atomic<int32_t> _OSAtomic_int32_t; | ||
| 776 | typedef std::atomic<uint32_t> _OSAtomic_uint32_t; | ||
| 777 | typedef std::atomic<int64_t> _OSAtomic_int64_t; | ||
| 778 | typedef std::atomic<void*> _OSAtomic_void_ptr_t; | ||
| 779 | #define OSATOMIC_STD(_a) std::_a | ||
| 780 | __BEGIN_DECLS | ||
| 781 | #else | ||
| 782 | #if !(__has_include(<stdatomic.h>) && __has_extension(c_atomic)) | ||
| 783 | #error Cannot use inlined OSAtomic without <stdatomic.h> and C11 atomics | ||
| 784 | #endif | ||
| 785 | #include <stdatomic.h> | ||
| 786 | typedef _Atomic(uint8_t) _OSAtomic_uint8_t; | ||
| 787 | typedef _Atomic(int32_t) _OSAtomic_int32_t; | ||
| 788 | typedef _Atomic(uint32_t) _OSAtomic_uint32_t; | ||
| 789 | typedef _Atomic(int64_t) _OSAtomic_int64_t; | ||
| 790 | typedef _Atomic(void*) _OSAtomic_void_ptr_t; | ||
| 791 | #define OSATOMIC_STD(_a) _a | ||
| 792 | #endif | ||
| 793 | |||
| 794 | #if __has_extension(c_alignof) && __has_attribute(aligned) | ||
| 795 | typedef int64_t __attribute__((__aligned__(_Alignof(_OSAtomic_int64_t)))) | ||
| 796 | 		OSAtomic_int64_aligned64_t; | ||
| 797 | #elif __has_attribute(aligned) | ||
| 798 | typedef int64_t __attribute__((__aligned__((sizeof(_OSAtomic_int64_t))))) | ||
| 799 | 		OSAtomic_int64_aligned64_t; | ||
| 800 | #else | ||
| 801 | typedef int64_t OSAtomic_int64_aligned64_t; | ||
| 802 | #endif | ||
| 803 | |||
| 804 | #if __has_attribute(always_inline) | ||
| 805 | #define OSATOMIC_INLINE static __inline __attribute__((__always_inline__)) | ||
| 806 | #else | ||
| 807 | #define OSATOMIC_INLINE static __inline | ||
| 808 | #endif | ||
| 809 | |||
| 810 | OSATOMIC_INLINE | ||
| 811 | int32_t | ||
| 812 | OSAtomicAdd32(int32_t __theAmount, volatile int32_t *__theValue) | ||
| 813 | { | ||
| 814 | 	return (OSATOMIC_STD(atomic_fetch_add_explicit)( | ||
| 815 | 			(volatile _OSAtomic_int32_t*) __theValue, __theAmount, | ||
| 816 | 			OSATOMIC_STD(memory_order_relaxed)) + __theAmount); | ||
| 817 | } | ||
| 818 | |||
| 819 | OSATOMIC_INLINE | ||
| 820 | int32_t | ||
| 821 | OSAtomicAdd32Barrier(int32_t __theAmount, volatile int32_t *__theValue) | ||
| 822 | { | ||
| 823 | 	return (OSATOMIC_STD(atomic_fetch_add_explicit)( | ||
| 824 | 			(volatile _OSAtomic_int32_t*) __theValue, __theAmount, | ||
| 825 | 			OSATOMIC_STD(memory_order_seq_cst)) + __theAmount); | ||
| 826 | } | ||
| 827 | |||
| 828 | OSATOMIC_INLINE | ||
| 829 | int32_t | ||
| 830 | OSAtomicIncrement32(volatile int32_t *__theValue) | ||
| 831 | { | ||
| 832 | 	return OSAtomicAdd32(1, __theValue); | ||
| 833 | } | ||
| 834 | |||
| 835 | OSATOMIC_INLINE | ||
| 836 | int32_t | ||
| 837 | OSAtomicIncrement32Barrier(volatile int32_t *__theValue) | ||
| 838 | { | ||
| 839 | 	return OSAtomicAdd32Barrier(1, __theValue); | ||
| 840 | } | ||
| 841 | |||
| 842 | OSATOMIC_INLINE | ||
| 843 | int32_t | ||
| 844 | OSAtomicDecrement32(volatile int32_t *__theValue) | ||
| 845 | { | ||
| 846 | 	return OSAtomicAdd32(-1, __theValue); | ||
| 847 | } | ||
| 848 | |||
| 849 | OSATOMIC_INLINE | ||
| 850 | int32_t | ||
| 851 | OSAtomicDecrement32Barrier(volatile int32_t *__theValue) | ||
| 852 | { | ||
| 853 | 	return OSAtomicAdd32Barrier(-1, __theValue); | ||
| 854 | } | ||
| 855 | |||
| 856 | OSATOMIC_INLINE | ||
| 857 | int64_t | ||
| 858 | OSAtomicAdd64(int64_t __theAmount, | ||
| 859 | 		volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 860 | { | ||
| 861 | 	return (OSATOMIC_STD(atomic_fetch_add_explicit)( | ||
| 862 | 			(volatile _OSAtomic_int64_t*) __theValue, __theAmount, | ||
| 863 | 			OSATOMIC_STD(memory_order_relaxed)) + __theAmount); | ||
| 864 | } | ||
| 865 | |||
| 866 | OSATOMIC_INLINE | ||
| 867 | int64_t | ||
| 868 | OSAtomicAdd64Barrier(int64_t __theAmount, | ||
| 869 | 		volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 870 | { | ||
| 871 | 	return (OSATOMIC_STD(atomic_fetch_add_explicit)( | ||
| 872 | 			(volatile _OSAtomic_int64_t*) __theValue, __theAmount, | ||
| 873 | 			OSATOMIC_STD(memory_order_seq_cst)) + __theAmount); | ||
| 874 | } | ||
| 875 | |||
| 876 | OSATOMIC_INLINE | ||
| 877 | int64_t | ||
| 878 | OSAtomicIncrement64(volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 879 | { | ||
| 880 | 	return OSAtomicAdd64(1, __theValue); | ||
| 881 | } | ||
| 882 | |||
| 883 | OSATOMIC_INLINE | ||
| 884 | int64_t | ||
| 885 | OSAtomicIncrement64Barrier(volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 886 | { | ||
| 887 | 	return OSAtomicAdd64Barrier(1, __theValue); | ||
| 888 | } | ||
| 889 | |||
| 890 | OSATOMIC_INLINE | ||
| 891 | int64_t | ||
| 892 | OSAtomicDecrement64(volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 893 | { | ||
| 894 | 	return OSAtomicAdd64(-1, __theValue); | ||
| 895 | } | ||
| 896 | |||
| 897 | OSATOMIC_INLINE | ||
| 898 | int64_t | ||
| 899 | OSAtomicDecrement64Barrier(volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 900 | { | ||
| 901 | 	return OSAtomicAdd64Barrier(-1, __theValue); | ||
| 902 | } | ||
| 903 | |||
| 904 | OSATOMIC_INLINE | ||
| 905 | int32_t | ||
| 906 | OSAtomicOr32(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 907 | { | ||
| 908 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_or_explicit)( | ||
| 909 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 910 | 			OSATOMIC_STD(memory_order_relaxed)) | __theMask); | ||
| 911 | } | ||
| 912 | |||
| 913 | OSATOMIC_INLINE | ||
| 914 | int32_t | ||
| 915 | OSAtomicOr32Barrier(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 916 | { | ||
| 917 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_or_explicit)( | ||
| 918 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 919 | 			OSATOMIC_STD(memory_order_seq_cst)) | __theMask); | ||
| 920 | } | ||
| 921 | |||
| 922 | OSATOMIC_INLINE | ||
| 923 | int32_t | ||
| 924 | OSAtomicOr32Orig(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 925 | { | ||
| 926 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_or_explicit)( | ||
| 927 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 928 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 929 | } | ||
| 930 | |||
| 931 | OSATOMIC_INLINE | ||
| 932 | int32_t | ||
| 933 | OSAtomicOr32OrigBarrier(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 934 | { | ||
| 935 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_or_explicit)( | ||
| 936 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 937 | 			OSATOMIC_STD(memory_order_seq_cst))); | ||
| 938 | } | ||
| 939 | |||
| 940 | OSATOMIC_INLINE | ||
| 941 | int32_t | ||
| 942 | OSAtomicAnd32(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 943 | { | ||
| 944 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_and_explicit)( | ||
| 945 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 946 | 			OSATOMIC_STD(memory_order_relaxed)) & __theMask); | ||
| 947 | } | ||
| 948 | |||
| 949 | OSATOMIC_INLINE | ||
| 950 | int32_t | ||
| 951 | OSAtomicAnd32Barrier(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 952 | { | ||
| 953 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_and_explicit)( | ||
| 954 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 955 | 			OSATOMIC_STD(memory_order_seq_cst)) & __theMask); | ||
| 956 | } | ||
| 957 | |||
| 958 | OSATOMIC_INLINE | ||
| 959 | int32_t | ||
| 960 | OSAtomicAnd32Orig(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 961 | { | ||
| 962 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_and_explicit)( | ||
| 963 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 964 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 965 | } | ||
| 966 | |||
| 967 | OSATOMIC_INLINE | ||
| 968 | int32_t | ||
| 969 | OSAtomicAnd32OrigBarrier(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 970 | { | ||
| 971 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_and_explicit)( | ||
| 972 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 973 | 			OSATOMIC_STD(memory_order_seq_cst))); | ||
| 974 | } | ||
| 975 | |||
| 976 | OSATOMIC_INLINE | ||
| 977 | int32_t | ||
| 978 | OSAtomicXor32(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 979 | { | ||
| 980 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_xor_explicit)( | ||
| 981 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 982 | 			OSATOMIC_STD(memory_order_relaxed)) ^ __theMask); | ||
| 983 | } | ||
| 984 | |||
| 985 | OSATOMIC_INLINE | ||
| 986 | int32_t | ||
| 987 | OSAtomicXor32Barrier(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 988 | { | ||
| 989 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_xor_explicit)( | ||
| 990 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 991 | 			OSATOMIC_STD(memory_order_seq_cst)) ^ __theMask); | ||
| 992 | } | ||
| 993 | |||
| 994 | OSATOMIC_INLINE | ||
| 995 | int32_t | ||
| 996 | OSAtomicXor32Orig(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 997 | { | ||
| 998 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_xor_explicit)( | ||
| 999 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 1000 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1001 | } | ||
| 1002 | |||
| 1003 | OSATOMIC_INLINE | ||
| 1004 | int32_t | ||
| 1005 | OSAtomicXor32OrigBarrier(uint32_t __theMask, volatile uint32_t *__theValue) | ||
| 1006 | { | ||
| 1007 | 	return (int32_t)(OSATOMIC_STD(atomic_fetch_xor_explicit)( | ||
| 1008 | 			(volatile _OSAtomic_uint32_t*)__theValue, __theMask, | ||
| 1009 | 			OSATOMIC_STD(memory_order_seq_cst))); | ||
| 1010 | } | ||
| 1011 | |||
| 1012 | OSATOMIC_INLINE | ||
| 1013 | bool | ||
| 1014 | OSAtomicCompareAndSwap32(int32_t __oldValue, int32_t __newValue, | ||
| 1015 | 		volatile int32_t *__theValue) | ||
| 1016 | { | ||
| 1017 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1018 | 			(volatile _OSAtomic_int32_t*)__theValue, &__oldValue, __newValue, | ||
| 1019 | 			OSATOMIC_STD(memory_order_relaxed), | ||
| 1020 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1021 | } | ||
| 1022 | |||
| 1023 | OSATOMIC_INLINE | ||
| 1024 | bool | ||
| 1025 | OSAtomicCompareAndSwap32Barrier(int32_t __oldValue, int32_t __newValue, | ||
| 1026 | 		volatile int32_t *__theValue) | ||
| 1027 | { | ||
| 1028 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1029 | 			(volatile _OSAtomic_int32_t*)__theValue, &__oldValue, __newValue, | ||
| 1030 | 			OSATOMIC_STD(memory_order_seq_cst), | ||
| 1031 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1032 | } | ||
| 1033 | |||
| 1034 | OSATOMIC_INLINE | ||
| 1035 | bool | ||
| 1036 | OSAtomicCompareAndSwapPtr(void *__oldValue, void *__newValue, | ||
| 1037 | 		void * volatile *__theValue) | ||
| 1038 | { | ||
| 1039 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1040 | 			(volatile _OSAtomic_void_ptr_t*)__theValue, &__oldValue, __newValue, | ||
| 1041 | 			OSATOMIC_STD(memory_order_relaxed), | ||
| 1042 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1043 | } | ||
| 1044 | |||
| 1045 | OSATOMIC_INLINE | ||
| 1046 | bool | ||
| 1047 | OSAtomicCompareAndSwapPtrBarrier(void *__oldValue, void *__newValue, | ||
| 1048 | 		void * volatile *__theValue) | ||
| 1049 | { | ||
| 1050 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1051 | 			(volatile _OSAtomic_void_ptr_t*)__theValue, &__oldValue, __newValue, | ||
| 1052 | 			OSATOMIC_STD(memory_order_seq_cst), | ||
| 1053 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1054 | } | ||
| 1055 | |||
| 1056 | OSATOMIC_INLINE | ||
| 1057 | bool | ||
| 1058 | OSAtomicCompareAndSwapInt(int __oldValue, int __newValue, | ||
| 1059 | 		volatile int *__theValue) | ||
| 1060 | { | ||
| 1061 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1062 | 			(volatile OSATOMIC_STD(atomic_int)*)__theValue, &__oldValue, | ||
| 1063 | 			__newValue, OSATOMIC_STD(memory_order_relaxed), | ||
| 1064 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1065 | } | ||
| 1066 | |||
| 1067 | OSATOMIC_INLINE | ||
| 1068 | bool | ||
| 1069 | OSAtomicCompareAndSwapIntBarrier(int __oldValue, int __newValue, | ||
| 1070 | 		volatile int *__theValue) | ||
| 1071 | { | ||
| 1072 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1073 | 			(volatile OSATOMIC_STD(atomic_int)*)__theValue, &__oldValue, | ||
| 1074 | 			__newValue, OSATOMIC_STD(memory_order_seq_cst), | ||
| 1075 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1076 | } | ||
| 1077 | |||
| 1078 | OSATOMIC_INLINE | ||
| 1079 | bool | ||
| 1080 | OSAtomicCompareAndSwapLong(long __oldValue, long __newValue, | ||
| 1081 | 		volatile long *__theValue) | ||
| 1082 | { | ||
| 1083 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1084 | 			(volatile OSATOMIC_STD(atomic_long)*)__theValue, &__oldValue, | ||
| 1085 | 			__newValue, OSATOMIC_STD(memory_order_relaxed), | ||
| 1086 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1087 | } | ||
| 1088 | |||
| 1089 | OSATOMIC_INLINE | ||
| 1090 | bool | ||
| 1091 | OSAtomicCompareAndSwapLongBarrier(long __oldValue, long __newValue, | ||
| 1092 | 		volatile long *__theValue) | ||
| 1093 | { | ||
| 1094 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1095 | 			(volatile OSATOMIC_STD(atomic_long)*)__theValue, &__oldValue, | ||
| 1096 | 			__newValue, OSATOMIC_STD(memory_order_seq_cst), | ||
| 1097 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1098 | } | ||
| 1099 | |||
| 1100 | OSATOMIC_INLINE | ||
| 1101 | bool | ||
| 1102 | OSAtomicCompareAndSwap64(int64_t __oldValue, int64_t __newValue, | ||
| 1103 | 		volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 1104 | { | ||
| 1105 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1106 | 			(volatile _OSAtomic_int64_t*)__theValue, &__oldValue, __newValue, | ||
| 1107 | 			OSATOMIC_STD(memory_order_relaxed), | ||
| 1108 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1109 | } | ||
| 1110 | |||
| 1111 | OSATOMIC_INLINE | ||
| 1112 | bool | ||
| 1113 | OSAtomicCompareAndSwap64Barrier(int64_t __oldValue, int64_t __newValue, | ||
| 1114 | 		volatile OSAtomic_int64_aligned64_t *__theValue) | ||
| 1115 | { | ||
| 1116 | 	return (OSATOMIC_STD(atomic_compare_exchange_strong_explicit)( | ||
| 1117 | 			(volatile _OSAtomic_int64_t*)__theValue, &__oldValue, __newValue, | ||
| 1118 | 			OSATOMIC_STD(memory_order_seq_cst), | ||
| 1119 | 			OSATOMIC_STD(memory_order_relaxed))); | ||
| 1120 | } | ||
| 1121 | |||
| 1122 | OSATOMIC_INLINE | ||
| 1123 | bool | ||
| 1124 | OSAtomicTestAndSet(uint32_t __n, volatile void *__theAddress) | ||
| 1125 | { | ||
| 1126 | 	uintptr_t a = (uintptr_t)__theAddress + (__n >> 3); | ||
| 1127 | 	uint8_t v = (0x80u >> (__n & 7)); | ||
| 1128 | 	return (OSATOMIC_STD(atomic_fetch_or_explicit)((_OSAtomic_uint8_t*)a, v, | ||
| 1129 | 			OSATOMIC_STD(memory_order_relaxed)) & v); | ||
| 1130 | } | ||
| 1131 | |||
| 1132 | OSATOMIC_INLINE | ||
| 1133 | bool | ||
| 1134 | OSAtomicTestAndSetBarrier(uint32_t __n, volatile void *__theAddress) | ||
| 1135 | { | ||
| 1136 | 	uintptr_t a = (uintptr_t)__theAddress + (__n >> 3); | ||
| 1137 | 	uint8_t v = (0x80u >> (__n & 7)); | ||
| 1138 | 	return (OSATOMIC_STD(atomic_fetch_or_explicit)((_OSAtomic_uint8_t*)a, v, | ||
| 1139 | 			OSATOMIC_STD(memory_order_seq_cst)) & v); | ||
| 1140 | } | ||
| 1141 | |||
| 1142 | OSATOMIC_INLINE | ||
| 1143 | bool | ||
| 1144 | OSAtomicTestAndClear(uint32_t __n, volatile void *__theAddress) | ||
| 1145 | { | ||
| 1146 | 	uintptr_t a = (uintptr_t)__theAddress + (__n >> 3); | ||
| 1147 | 	uint8_t v = (0x80u >> (__n & 7)); | ||
| 1148 | 	return (OSATOMIC_STD(atomic_fetch_and_explicit)((_OSAtomic_uint8_t*)a, | ||
| 1149 | 			(uint8_t)~v, OSATOMIC_STD(memory_order_relaxed)) & v); | ||
| 1150 | } | ||
| 1151 | |||
| 1152 | OSATOMIC_INLINE | ||
| 1153 | bool | ||
| 1154 | OSAtomicTestAndClearBarrier(uint32_t __n, volatile void *__theAddress) | ||
| 1155 | { | ||
| 1156 | 	uintptr_t a = (uintptr_t)__theAddress + (__n >> 3); | ||
| 1157 | 	uint8_t v = (0x80u >> (__n & 7)); | ||
| 1158 | 	return (OSATOMIC_STD(atomic_fetch_and_explicit)((_OSAtomic_uint8_t*)a, | ||
| 1159 | 			(uint8_t)~v, OSATOMIC_STD(memory_order_seq_cst)) & v); | ||
| 1160 | } | ||
| 1161 | |||
| 1162 | OSATOMIC_INLINE | ||
| 1163 | void | ||
| 1164 | OSMemoryBarrier(void) | ||
| 1165 | { | ||
| 1166 | 	OSATOMIC_STD(atomic_thread_fence)(OSATOMIC_STD(memory_order_seq_cst)); | ||
| 1167 | } | ||
| 1168 | |||
| 1169 | #undef OSATOMIC_INLINE | ||
| 1170 | #undef OSATOMIC_STD | ||
| 1171 | #ifdef __cplusplus | ||
| 1172 | __END_DECLS | ||
| 1173 | } // extern "C++" | ||
| 1174 | #endif | ||
| 1175 | |||
| 1176 | #endif // defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED | ||
| 1177 | |||
| 1178 | #if TARGET_OS_OSX || TARGET_OS_DRIVERKIT | ||
| 1179 | |||
| 1180 | __BEGIN_DECLS | ||
| 1181 | |||
| 1182 | /*! @group Lockless atomic fifo enqueue and dequeue | ||
| 1183 | * These routines manipulate singly-linked FIFO lists. | ||
| 1184 | * | ||
| 1185 | * This API is deprecated and no longer recommended | ||
| 1186 | */ | ||
| 1187 | |||
| 1188 | /*! @abstract The data structure for a fifo queue head. | ||
| 1189 | @discussion | ||
| 1190 | 	You should always initialize a fifo queue head structure with the | ||
| 1191 | 	initialization vector {@link OS_ATOMIC_FIFO_QUEUE_INIT} before use. | ||
| 1192 | */ | ||
| 1193 | #if defined(__LP64__) | ||
| 1194 | |||
| 1195 | typedef	volatile struct { | ||
| 1196 | 	void	*opaque1; | ||
| 1197 | 	void	*opaque2; | ||
| 1198 | 	int	 opaque3; | ||
| 1199 | } __attribute__ ((aligned (16))) OSFifoQueueHead; | ||
| 1200 | |||
| 1201 | #else | ||
| 1202 | |||
| 1203 | typedef	volatile struct { | ||
| 1204 | 	void	*opaque1; | ||
| 1205 | 	void	*opaque2; | ||
| 1206 | 	int	 opaque3; | ||
| 1207 | } OSFifoQueueHead; | ||
| 1208 | |||
| 1209 | #endif | ||
| 1210 | /*! @abstract The initialization vector for a fifo queue head. */ | ||
| 1211 | #define OS_ATOMIC_FIFO_QUEUE_INIT { NULL, NULL, 0 } | ||
| 1212 | |||
| 1213 | /*! @abstract Enqueue an element onto a list. | ||
| 1214 | @discussion | ||
| 1215 | 	Memory barriers are incorporated as needed to permit thread-safe access | ||
| 1216 | 	to the queue element. | ||
| 1217 | @param __list | ||
| 1218 | 	The list on which you want to enqueue the element. | ||
| 1219 | @param __new | ||
| 1220 | 	The element to add. | ||
| 1221 | @param __offset | ||
| 1222 | 	The "offset" parameter is the offset (in bytes) of the link field | ||
| 1223 | 	from the beginning of the data structure being queued (<code>__new</code>). | ||
| 1224 | 	The link field should be a pointer type. | ||
| 1225 | 	The <code>__offset</code> value needs to be same for all enqueuing and | ||
| 1226 | 	dequeuing operations on the same list, even if different structure types | ||
| 1227 | 	are enqueued on that list. The use of <code>offsetset()</code>, defined in | ||
| 1228 | 	<code>stddef.h</code> is the common way to specify the <code>__offset</code> | ||
| 1229 | 	value. | ||
| 1230 | |||
| 1231 | 	@note | ||
| 1232 | 	This API is deprecated and no longer recommended | ||
| 1233 | */ | ||
| 1234 | __API_DEPRECATED("No longer supported", macos(10.7, 11.0)) | ||
| 1235 | void OSAtomicFifoEnqueue( OSFifoQueueHead *__list, void *__new, size_t __offset); | ||
| 1236 | |||
| 1237 | /*! @abstract Dequeue an element from a list. | ||
| 1238 | @discussion | ||
| 1239 | 	Memory barriers are incorporated as needed to permit thread-safe access | ||
| 1240 | 	to the queue element. | ||
| 1241 | @param __list | ||
| 1242 | 	The list from which you want to dequeue an element. | ||
| 1243 | @param __offset | ||
| 1244 | 	The "offset" parameter is the offset (in bytes) of the link field | ||
| 1245 | 	from the beginning of the data structure being dequeued (<code>__new</code>). | ||
| 1246 | 	The link field should be a pointer type. | ||
| 1247 | 	The <code>__offset</code> value needs to be same for all enqueuing and | ||
| 1248 | 	dequeuing operations on the same list, even if different structure types | ||
| 1249 | 	are enqueued on that list. The use of <code>offsetset()</code>, defined in | ||
| 1250 | 	<code>stddef.h</code> is the common way to specify the <code>__offset</code> | ||
| 1251 | 	value. | ||
| 1252 | @result | ||
| 1253 | 	Returns the oldest enqueued element, or <code>NULL</code> if the | ||
| 1254 | 	list is empty. | ||
| 1255 | |||
| 1256 | 	@note | ||
| 1257 | 	This API is deprecated and no longer recommended | ||
| 1258 | */ | ||
| 1259 | __API_DEPRECATED("No longer supported", macos(10.7, 11.0)) | ||
| 1260 | void* OSAtomicFifoDequeue( OSFifoQueueHead *__list, size_t __offset); | ||
| 1261 | |||
| 1262 | __END_DECLS | ||
| 1263 | |||
| 1264 | #endif /* TARGET_OS_OSX || TARGET_OS_DRIVERKIT */ | ||
| 1265 | |||
| 1266 | #endif /* _OSATOMIC_DEPRECATED_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h created+115| ... | @@ -0,0 +1,115 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2016 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _OSATOMICQUEUE_H_ | ||
| 25 | #define _OSATOMICQUEUE_H_ | ||
| 26 | |||
| 27 | #include <stddef.h> | ||
| 28 | #include <sys/cdefs.h> | ||
| 29 | #include <stdint.h> | ||
| 30 | #include <stdbool.h> | ||
| 31 | #include "OSAtomicDeprecated.h" | ||
| 32 | |||
| 33 | #include <Availability.h> | ||
| 34 | |||
| 35 | /*! @header Lockless atomic enqueue and dequeue | ||
| 36 | * These routines manipulate singly-linked LIFO lists. | ||
| 37 | */ | ||
| 38 | |||
| 39 | __BEGIN_DECLS | ||
| 40 | |||
| 41 | /*! @abstract The data structure for a queue head. | ||
| 42 | @discussion | ||
| 43 | 	You should always initialize a queue head structure with the | ||
| 44 | 	initialization vector {@link OS_ATOMIC_QUEUE_INIT} before use. | ||
| 45 | */ | ||
| 46 | #if defined(__LP64__) | ||
| 47 | |||
| 48 | typedef volatile struct { | ||
| 49 | 	void	*opaque1; | ||
| 50 | 	long	 opaque2; | ||
| 51 | } __attribute__ ((aligned (16))) OSQueueHead; | ||
| 52 | |||
| 53 | #else | ||
| 54 | |||
| 55 | typedef volatile struct { | ||
| 56 | 	void	*opaque1; | ||
| 57 | 	long	 opaque2; | ||
| 58 | } OSQueueHead; | ||
| 59 | |||
| 60 | #endif | ||
| 61 | |||
| 62 | /*! @abstract The initialization vector for a queue head. */ | ||
| 63 | #define	OS_ATOMIC_QUEUE_INIT	{ NULL, 0 } | ||
| 64 | |||
| 65 | /*! @abstract Enqueue an element onto a list. | ||
| 66 | @discussion | ||
| 67 | 	Memory barriers are incorporated as needed to permit thread-safe access | ||
| 68 | 	to the queue element. | ||
| 69 | @param __list | ||
| 70 | 	The list on which you want to enqueue the element. | ||
| 71 | @param __new | ||
| 72 | 	The element to add. | ||
| 73 | @param __offset | ||
| 74 | 	The "offset" parameter is the offset (in bytes) of the link field | ||
| 75 | 	from the beginning of the data structure being queued (<code>__new</code>). | ||
| 76 | 	The link field should be a pointer type. | ||
| 77 | 	The <code>__offset</code> value needs to be same for all enqueuing and | ||
| 78 | 	dequeuing operations on the same list, even if different structure types | ||
| 79 | 	are enqueued on that list. The use of <code>offsetset()</code>, defined in | ||
| 80 | 	<code>stddef.h</code> is the common way to specify the <code>__offset</code> | ||
| 81 | 	value. | ||
| 82 | */ | ||
| 83 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0) | ||
| 84 | void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset); | ||
| 85 | |||
| 86 | |||
| 87 | /*! @abstract Dequeue an element from a list. | ||
| 88 | @discussion | ||
| 89 | 	Memory barriers are incorporated as needed to permit thread-safe access | ||
| 90 | 	to the queue element. | ||
| 91 | @param __list | ||
| 92 | 	The list from which you want to dequeue an element. | ||
| 93 | @param __offset | ||
| 94 | 	The "offset" parameter is the offset (in bytes) of the link field | ||
| 95 | 	from the beginning of the data structure being dequeued (<code>__new</code>). | ||
| 96 | 	The link field should be a pointer type. | ||
| 97 | 	The <code>__offset</code> value needs to be same for all enqueuing and | ||
| 98 | 	dequeuing operations on the same list, even if different structure types | ||
| 99 | 	are enqueued on that list. The use of <code>offsetset()</code>, defined in | ||
| 100 | 	<code>stddef.h</code> is the common way to specify the <code>__offset</code> | ||
| 101 | 	value. | ||
| 102 | 	IMPORTANT: the memory backing the link field of a queue element must not be | ||
| 103 | 	unmapped after OSAtomicDequeue() returns until all concurrent calls to | ||
| 104 | 	OSAtomicDequeue() for the same list on other threads have also returned, | ||
| 105 | 	as they may still be accessing that memory location. | ||
| 106 | @result | ||
| 107 | 	Returns the most recently enqueued element, or <code>NULL</code> if the | ||
| 108 | 	list is empty. | ||
| 109 | */ | ||
| 110 | __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0) | ||
| 111 | void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset); | ||
| 112 | |||
| 113 | __END_DECLS | ||
| 114 | |||
| 115 | #endif /* _OSATOMICQUEUE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h created+317| ... | @@ -0,0 +1,317 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _OS_OSBYTEORDER_H | ||
| 30 | #define _OS_OSBYTEORDER_H | ||
| 31 | |||
| 32 | #include <stdint.h> | ||
| 33 | #include <libkern/_OSByteOrder.h> | ||
| 34 | |||
| 35 | /* Macros for swapping constant values in the preprocessing stage. */ | ||
| 36 | #define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x) | ||
| 37 | #define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x) | ||
| 38 | #define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x) | ||
| 39 | |||
| 40 | #if !defined(__DARWIN_OS_INLINE) | ||
| 41 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | ||
| 42 | # define __DARWIN_OS_INLINE static inline | ||
| 43 | # elif defined(__MWERKS__) || defined(__cplusplus) | ||
| 44 | # define __DARWIN_OS_INLINE static inline | ||
| 45 | # else | ||
| 46 | # define __DARWIN_OS_INLINE static __inline__ | ||
| 47 | # endif | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #if defined(__GNUC__) | ||
| 51 | |||
| 52 | #if (defined(__i386__) || defined(__x86_64__)) | ||
| 53 | #include <libkern/i386/OSByteOrder.h> | ||
| 54 | #elif defined (__arm__) || defined(__arm64__) | ||
| 55 | #include <libkern/arm/OSByteOrder.h> | ||
| 56 | #else | ||
| 57 | #include <libkern/machine/OSByteOrder.h> | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #else /* ! __GNUC__ */ | ||
| 61 | |||
| 62 | #include <libkern/machine/OSByteOrder.h> | ||
| 63 | |||
| 64 | #endif /* __GNUC__ */ | ||
| 65 | |||
| 66 | #define OSSwapInt16(x) __DARWIN_OSSwapInt16(x) | ||
| 67 | #define OSSwapInt32(x) __DARWIN_OSSwapInt32(x) | ||
| 68 | #define OSSwapInt64(x) __DARWIN_OSSwapInt64(x) | ||
| 69 | |||
| 70 | enum { | ||
| 71 | 	OSUnknownByteOrder, | ||
| 72 | 	OSLittleEndian, | ||
| 73 | 	OSBigEndian | ||
| 74 | }; | ||
| 75 | |||
| 76 | __DARWIN_OS_INLINE | ||
| 77 | int32_t | ||
| 78 | OSHostByteOrder(void) | ||
| 79 | { | ||
| 80 | #if defined(__LITTLE_ENDIAN__) | ||
| 81 | 	return OSLittleEndian; | ||
| 82 | #elif defined(__BIG_ENDIAN__) | ||
| 83 | 	return OSBigEndian; | ||
| 84 | #else | ||
| 85 | 	return OSUnknownByteOrder; | ||
| 86 | #endif | ||
| 87 | } | ||
| 88 | |||
| 89 | #define OSReadBigInt(x, y) OSReadBigInt32(x, y) | ||
| 90 | #define OSWriteBigInt(x, y, z) OSWriteBigInt32(x, y, z) | ||
| 91 | #define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x) | ||
| 92 | #define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x) | ||
| 93 | #define OSReadLittleInt(x, y) OSReadLittleInt32(x, y) | ||
| 94 | #define OSWriteLittleInt(x, y, z) OSWriteLittleInt32(x, y, z) | ||
| 95 | #define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x) | ||
| 96 | #define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x) | ||
| 97 | |||
| 98 | /* Functions for loading native endian values. */ | ||
| 99 | |||
| 100 | __DARWIN_OS_INLINE | ||
| 101 | uint16_t | ||
| 102 | _OSReadInt16( | ||
| 103 | 	const volatile void * base, | ||
| 104 | 	uintptr_t byteOffset | ||
| 105 | 	) | ||
| 106 | { | ||
| 107 | 	return *(volatile uint16_t *)((uintptr_t)base + byteOffset); | ||
| 108 | } | ||
| 109 | |||
| 110 | __DARWIN_OS_INLINE | ||
| 111 | uint32_t | ||
| 112 | _OSReadInt32( | ||
| 113 | 	const volatile void * base, | ||
| 114 | 	uintptr_t byteOffset | ||
| 115 | 	) | ||
| 116 | { | ||
| 117 | 	return *(volatile uint32_t *)((uintptr_t)base + byteOffset); | ||
| 118 | } | ||
| 119 | |||
| 120 | __DARWIN_OS_INLINE | ||
| 121 | uint64_t | ||
| 122 | _OSReadInt64( | ||
| 123 | 	const volatile void * base, | ||
| 124 | 	uintptr_t byteOffset | ||
| 125 | 	) | ||
| 126 | { | ||
| 127 | 	return *(volatile uint64_t *)((uintptr_t)base + byteOffset); | ||
| 128 | } | ||
| 129 | |||
| 130 | /* Functions for storing native endian values. */ | ||
| 131 | |||
| 132 | __DARWIN_OS_INLINE | ||
| 133 | void | ||
| 134 | _OSWriteInt16( | ||
| 135 | 	volatile void * base, | ||
| 136 | 	uintptr_t byteOffset, | ||
| 137 | 	uint16_t data | ||
| 138 | 	) | ||
| 139 | { | ||
| 140 | 	*(volatile uint16_t *)((uintptr_t)base + byteOffset) = data; | ||
| 141 | } | ||
| 142 | |||
| 143 | __DARWIN_OS_INLINE | ||
| 144 | void | ||
| 145 | _OSWriteInt32( | ||
| 146 | 	volatile void * base, | ||
| 147 | 	uintptr_t byteOffset, | ||
| 148 | 	uint32_t data | ||
| 149 | 	) | ||
| 150 | { | ||
| 151 | 	*(volatile uint32_t *)((uintptr_t)base + byteOffset) = data; | ||
| 152 | } | ||
| 153 | |||
| 154 | __DARWIN_OS_INLINE | ||
| 155 | void | ||
| 156 | _OSWriteInt64( | ||
| 157 | 	volatile void * base, | ||
| 158 | 	uintptr_t byteOffset, | ||
| 159 | 	uint64_t data | ||
| 160 | 	) | ||
| 161 | { | ||
| 162 | 	*(volatile uint64_t *)((uintptr_t)base + byteOffset) = data; | ||
| 163 | } | ||
| 164 | |||
| 165 | #if defined(__BIG_ENDIAN__) | ||
| 166 | |||
| 167 | /* Functions for loading big endian to host endianess. */ | ||
| 168 | |||
| 169 | #define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset) | ||
| 170 | #define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset) | ||
| 171 | #define OSReadBigInt64(base, byteOffset) _OSReadInt64(base, byteOffset) | ||
| 172 | |||
| 173 | /* Functions for storing host endianess to big endian. */ | ||
| 174 | |||
| 175 | #define OSWriteBigInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data) | ||
| 176 | #define OSWriteBigInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data) | ||
| 177 | #define OSWriteBigInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data) | ||
| 178 | |||
| 179 | /* Functions for loading little endian to host endianess. */ | ||
| 180 | |||
| 181 | #define OSReadLittleInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset) | ||
| 182 | #define OSReadLittleInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset) | ||
| 183 | #define OSReadLittleInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset) | ||
| 184 | |||
| 185 | /* Functions for storing host endianess to little endian. */ | ||
| 186 | |||
| 187 | #define OSWriteLittleInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data) | ||
| 188 | #define OSWriteLittleInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data) | ||
| 189 | #define OSWriteLittleInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data) | ||
| 190 | |||
| 191 | /* Host endianess to big endian byte swapping macros for constants. */ | ||
| 192 | |||
| 193 | #define OSSwapHostToBigConstInt16(x) ((uint16_t)(x)) | ||
| 194 | #define OSSwapHostToBigConstInt32(x) ((uint32_t)(x)) | ||
| 195 | #define OSSwapHostToBigConstInt64(x) ((uint64_t)(x)) | ||
| 196 | |||
| 197 | /* Generic host endianess to big endian byte swapping functions. */ | ||
| 198 | |||
| 199 | #define OSSwapHostToBigInt16(x) ((uint16_t)(x)) | ||
| 200 | #define OSSwapHostToBigInt32(x) ((uint32_t)(x)) | ||
| 201 | #define OSSwapHostToBigInt64(x) ((uint64_t)(x)) | ||
| 202 | |||
| 203 | /* Host endianess to little endian byte swapping macros for constants. */ | ||
| 204 | |||
| 205 | #define OSSwapHostToLittleConstInt16(x) OSSwapConstInt16(x) | ||
| 206 | #define OSSwapHostToLittleConstInt32(x) OSSwapConstInt32(x) | ||
| 207 | #define OSSwapHostToLittleConstInt64(x) OSSwapConstInt64(x) | ||
| 208 | |||
| 209 | /* Generic host endianess to little endian byte swapping functions. */ | ||
| 210 | |||
| 211 | #define OSSwapHostToLittleInt16(x) OSSwapInt16(x) | ||
| 212 | #define OSSwapHostToLittleInt32(x) OSSwapInt32(x) | ||
| 213 | #define OSSwapHostToLittleInt64(x) OSSwapInt64(x) | ||
| 214 | |||
| 215 | /* Big endian to host endianess byte swapping macros for constants. */ | ||
| 216 | |||
| 217 | #define OSSwapBigToHostConstInt16(x) ((uint16_t)(x)) | ||
| 218 | #define OSSwapBigToHostConstInt32(x) ((uint32_t)(x)) | ||
| 219 | #define OSSwapBigToHostConstInt64(x) ((uint64_t)(x)) | ||
| 220 | |||
| 221 | /* Generic big endian to host endianess byte swapping functions. */ | ||
| 222 | |||
| 223 | #define OSSwapBigToHostInt16(x) ((uint16_t)(x)) | ||
| 224 | #define OSSwapBigToHostInt32(x) ((uint32_t)(x)) | ||
| 225 | #define OSSwapBigToHostInt64(x) ((uint64_t)(x)) | ||
| 226 | |||
| 227 | /* Little endian to host endianess byte swapping macros for constants. */ | ||
| 228 | |||
| 229 | #define OSSwapLittleToHostConstInt16(x) OSSwapConstInt16(x) | ||
| 230 | #define OSSwapLittleToHostConstInt32(x) OSSwapConstInt32(x) | ||
| 231 | #define OSSwapLittleToHostConstInt64(x) OSSwapConstInt64(x) | ||
| 232 | |||
| 233 | /* Generic little endian to host endianess byte swapping functions. */ | ||
| 234 | |||
| 235 | #define OSSwapLittleToHostInt16(x) OSSwapInt16(x) | ||
| 236 | #define OSSwapLittleToHostInt32(x) OSSwapInt32(x) | ||
| 237 | #define OSSwapLittleToHostInt64(x) OSSwapInt64(x) | ||
| 238 | |||
| 239 | #elif defined(__LITTLE_ENDIAN__) | ||
| 240 | |||
| 241 | /* Functions for loading big endian to host endianess. */ | ||
| 242 | |||
| 243 | #define OSReadBigInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset) | ||
| 244 | #define OSReadBigInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset) | ||
| 245 | #define OSReadBigInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset) | ||
| 246 | |||
| 247 | /* Functions for storing host endianess to big endian. */ | ||
| 248 | |||
| 249 | #define OSWriteBigInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data) | ||
| 250 | #define OSWriteBigInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data) | ||
| 251 | #define OSWriteBigInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data) | ||
| 252 | |||
| 253 | /* Functions for loading little endian to host endianess. */ | ||
| 254 | |||
| 255 | #define OSReadLittleInt16(base, byteOffset) _OSReadInt16(base, byteOffset) | ||
| 256 | #define OSReadLittleInt32(base, byteOffset) _OSReadInt32(base, byteOffset) | ||
| 257 | #define OSReadLittleInt64(base, byteOffset) _OSReadInt64(base, byteOffset) | ||
| 258 | |||
| 259 | /* Functions for storing host endianess to little endian. */ | ||
| 260 | |||
| 261 | #define OSWriteLittleInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data) | ||
| 262 | #define OSWriteLittleInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data) | ||
| 263 | #define OSWriteLittleInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data) | ||
| 264 | |||
| 265 | /* Host endianess to big endian byte swapping macros for constants. */ | ||
| 266 | |||
| 267 | #define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x) | ||
| 268 | #define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x) | ||
| 269 | #define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x) | ||
| 270 | |||
| 271 | /* Generic host endianess to big endian byte swapping functions. */ | ||
| 272 | |||
| 273 | #define OSSwapHostToBigInt16(x) OSSwapInt16(x) | ||
| 274 | #define OSSwapHostToBigInt32(x) OSSwapInt32(x) | ||
| 275 | #define OSSwapHostToBigInt64(x) OSSwapInt64(x) | ||
| 276 | |||
| 277 | /* Host endianess to little endian byte swapping macros for constants. */ | ||
| 278 | |||
| 279 | #define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x)) | ||
| 280 | #define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x)) | ||
| 281 | #define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x)) | ||
| 282 | |||
| 283 | /* Generic host endianess to little endian byte swapping functions. */ | ||
| 284 | |||
| 285 | #define OSSwapHostToLittleInt16(x) ((uint16_t)(x)) | ||
| 286 | #define OSSwapHostToLittleInt32(x) ((uint32_t)(x)) | ||
| 287 | #define OSSwapHostToLittleInt64(x) ((uint64_t)(x)) | ||
| 288 | |||
| 289 | /* Big endian to host endianess byte swapping macros for constants. */ | ||
| 290 | |||
| 291 | #define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x) | ||
| 292 | #define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x) | ||
| 293 | #define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x) | ||
| 294 | |||
| 295 | /* Generic big endian to host endianess byte swapping functions. */ | ||
| 296 | |||
| 297 | #define OSSwapBigToHostInt16(x) OSSwapInt16(x) | ||
| 298 | #define OSSwapBigToHostInt32(x) OSSwapInt32(x) | ||
| 299 | #define OSSwapBigToHostInt64(x) OSSwapInt64(x) | ||
| 300 | |||
| 301 | /* Little endian to host endianess byte swapping macros for constants. */ | ||
| 302 | |||
| 303 | #define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x)) | ||
| 304 | #define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x)) | ||
| 305 | #define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x)) | ||
| 306 | |||
| 307 | /* Generic little endian to host endianess byte swapping functions. */ | ||
| 308 | |||
| 309 | #define OSSwapLittleToHostInt16(x) ((uint16_t)(x)) | ||
| 310 | #define OSSwapLittleToHostInt32(x) ((uint32_t)(x)) | ||
| 311 | #define OSSwapLittleToHostInt64(x) ((uint64_t)(x)) | ||
| 312 | |||
| 313 | #else | ||
| 314 | #error Unknown endianess. | ||
| 315 | #endif | ||
| 316 | |||
| 317 | #endif /* ! _OS_OSBYTEORDER_H */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/OSSpinLockDeprecated.h created+212| ... | @@ -0,0 +1,212 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2016 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _OSSPINLOCK_DEPRECATED_H_ | ||
| 25 | #define _OSSPINLOCK_DEPRECATED_H_ | ||
| 26 | |||
| 27 | /*! @header | ||
| 28 | * These are deprecated legacy interfaces for userspace spinlocks. | ||
| 29 | * | ||
| 30 | * These interfaces should no longer be used, particularily in situations where | ||
| 31 | * threads of differing priorities may contend on the same spinlock. | ||
| 32 | * | ||
| 33 | * The interfaces in <os/lock.h> should be used instead in cases where a very | ||
| 34 | * low-level lock primitive is required. In general however, using higher level | ||
| 35 | * synchronization primitives such as those provided by the pthread or dispatch | ||
| 36 | * subsystems should be preferred. | ||
| 37 | * | ||
| 38 | * Define OSSPINLOCK_USE_INLINED=1 to get inline implementations of these | ||
| 39 | * interfaces in terms of the <os/lock.h> primitives. This is intended as a | ||
| 40 | * transition convenience, direct use of those primitives is preferred. | ||
| 41 | */ | ||
| 42 | |||
| 43 | #ifndef OSSPINLOCK_DEPRECATED | ||
| 44 | #define OSSPINLOCK_DEPRECATED 1 | ||
| 45 | #define OSSPINLOCK_DEPRECATED_MSG(_r) "Use " #_r "() from <os/lock.h> instead" | ||
| 46 | #define OSSPINLOCK_DEPRECATED_REPLACE_WITH(_r) \ | ||
| 47 | 	__OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSSPINLOCK_DEPRECATED_MSG(_r)) \ | ||
| 48 | 	__OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSSPINLOCK_DEPRECATED_MSG(_r)) \ | ||
| 49 | 	__OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSSPINLOCK_DEPRECATED_MSG(_r)) \ | ||
| 50 | 	__OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSSPINLOCK_DEPRECATED_MSG(_r)) | ||
| 51 | #else | ||
| 52 | #undef OSSPINLOCK_DEPRECATED | ||
| 53 | #define OSSPINLOCK_DEPRECATED 0 | ||
| 54 | #define OSSPINLOCK_DEPRECATED_REPLACE_WITH(_r) | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #if !(defined(OSSPINLOCK_USE_INLINED) && OSSPINLOCK_USE_INLINED) | ||
| 58 | |||
| 59 | #include <sys/cdefs.h> | ||
| 60 | #include <stddef.h> | ||
| 61 | #include <stdint.h> | ||
| 62 | #include <stdbool.h> | ||
| 63 | #include <Availability.h> | ||
| 64 | |||
| 65 | __BEGIN_DECLS | ||
| 66 | |||
| 67 | /*! @abstract The default value for an <code>OSSpinLock</code>. | ||
| 68 | @discussion | ||
| 69 | 	The convention is that unlocked is zero, locked is nonzero. | ||
| 70 | */ | ||
| 71 | #define	OS_SPINLOCK_INIT 0 | ||
| 72 | |||
| 73 | |||
| 74 | /*! @abstract Data type for a spinlock. | ||
| 75 | @discussion | ||
| 76 | 	You should always initialize a spinlock to {@link OS_SPINLOCK_INIT} before | ||
| 77 | 	using it. | ||
| 78 | */ | ||
| 79 | typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock); | ||
| 80 | |||
| 81 | |||
| 82 | /*! @abstract Locks a spinlock if it would not block | ||
| 83 | @result | ||
| 84 | 	Returns <code>false</code> if the lock was already held by another thread, | ||
| 85 | 	<code>true</code> if it took the lock successfully. | ||
| 86 | */ | ||
| 87 | OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock) | ||
| 88 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 89 | bool OSSpinLockTry( volatile OSSpinLock *__lock ); | ||
| 90 | |||
| 91 | |||
| 92 | /*! @abstract Locks a spinlock | ||
| 93 | @discussion | ||
| 94 | 	Although the lock operation spins, it employs various strategies to back | ||
| 95 | 	off if the lock is held. | ||
| 96 | */ | ||
| 97 | OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock) | ||
| 98 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 99 | void OSSpinLockLock( volatile OSSpinLock *__lock ); | ||
| 100 | |||
| 101 | |||
| 102 | /*! @abstract Unlocks a spinlock */ | ||
| 103 | OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock) | ||
| 104 | __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) | ||
| 105 | void OSSpinLockUnlock( volatile OSSpinLock *__lock ); | ||
| 106 | |||
| 107 | __END_DECLS | ||
| 108 | |||
| 109 | #else /* OSSPINLOCK_USE_INLINED */ | ||
| 110 | |||
| 111 | /* | ||
| 112 | * Inline implementations of the legacy OSSpinLock interfaces in terms of the | ||
| 113 | * of the <os/lock.h> primitives. Direct use of those primitives is preferred. | ||
| 114 | * | ||
| 115 | * NOTE: the locked value of os_unfair_lock is implementation defined and | ||
| 116 | * subject to change, code that relies on the specific locked value used by the | ||
| 117 | * legacy OSSpinLock interface WILL break when using these inline | ||
| 118 | * implementations in terms of os_unfair_lock. | ||
| 119 | */ | ||
| 120 | |||
| 121 | #if !OSSPINLOCK_USE_INLINED_TRANSPARENT | ||
| 122 | |||
| 123 | #include <os/lock.h> | ||
| 124 | |||
| 125 | __BEGIN_DECLS | ||
| 126 | |||
| 127 | #if __has_attribute(always_inline) | ||
| 128 | #define OSSPINLOCK_INLINE static __inline | ||
| 129 | #else | ||
| 130 | #define OSSPINLOCK_INLINE static __inline __attribute__((__always_inline__)) | ||
| 131 | #endif | ||
| 132 | |||
| 133 | #define OS_SPINLOCK_INIT 0 | ||
| 134 | typedef int32_t OSSpinLock; | ||
| 135 | |||
| 136 | #if __has_extension(c_static_assert) | ||
| 137 | _Static_assert(sizeof(OSSpinLock) == sizeof(os_unfair_lock), | ||
| 138 | 		"Incompatible os_unfair_lock type"); | ||
| 139 | #endif | ||
| 140 | |||
| 141 | OSSPINLOCK_INLINE | ||
| 142 | void | ||
| 143 | OSSpinLockLock(volatile OSSpinLock *__lock) | ||
| 144 | { | ||
| 145 | 	os_unfair_lock_t lock = (os_unfair_lock_t)__lock; | ||
| 146 | 	return os_unfair_lock_lock(lock); | ||
| 147 | } | ||
| 148 | |||
| 149 | OSSPINLOCK_INLINE | ||
| 150 | bool | ||
| 151 | OSSpinLockTry(volatile OSSpinLock *__lock) | ||
| 152 | { | ||
| 153 | 	os_unfair_lock_t lock = (os_unfair_lock_t)__lock; | ||
| 154 | 	return os_unfair_lock_trylock(lock); | ||
| 155 | } | ||
| 156 | |||
| 157 | OSSPINLOCK_INLINE | ||
| 158 | void | ||
| 159 | OSSpinLockUnlock(volatile OSSpinLock *__lock) | ||
| 160 | { | ||
| 161 | 	os_unfair_lock_t lock = (os_unfair_lock_t)__lock; | ||
| 162 | 	return os_unfair_lock_unlock(lock); | ||
| 163 | } | ||
| 164 | |||
| 165 | #undef OSSPINLOCK_INLINE | ||
| 166 | |||
| 167 | __END_DECLS | ||
| 168 | |||
| 169 | #else /* OSSPINLOCK_USE_INLINED_TRANSPARENT */ | ||
| 170 | |||
| 171 | #include <sys/cdefs.h> | ||
| 172 | #include <stddef.h> | ||
| 173 | #include <stdint.h> | ||
| 174 | #include <stdbool.h> | ||
| 175 | #include <Availability.h> | ||
| 176 | |||
| 177 | #define OS_NOSPIN_LOCK_AVAILABILITY \ | ||
| 178 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) \ | ||
| 179 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) | ||
| 180 | |||
| 181 | __BEGIN_DECLS | ||
| 182 | |||
| 183 | #define OS_SPINLOCK_INIT 0 | ||
| 184 | typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock); | ||
| 185 | typedef volatile OSSpinLock *_os_nospin_lock_t | ||
| 186 | 		OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_t); | ||
| 187 | |||
| 188 | OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock) | ||
| 189 | OS_NOSPIN_LOCK_AVAILABILITY | ||
| 190 | void _os_nospin_lock_lock(_os_nospin_lock_t lock); | ||
| 191 | #undef OSSpinLockLock | ||
| 192 | #define OSSpinLockLock(lock) _os_nospin_lock_lock(lock) | ||
| 193 | |||
| 194 | OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock) | ||
| 195 | OS_NOSPIN_LOCK_AVAILABILITY | ||
| 196 | bool _os_nospin_lock_trylock(_os_nospin_lock_t lock); | ||
| 197 | #undef OSSpinLockTry | ||
| 198 | #define OSSpinLockTry(lock) _os_nospin_lock_trylock(lock) | ||
| 199 | |||
| 200 | OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock) | ||
| 201 | OS_NOSPIN_LOCK_AVAILABILITY | ||
| 202 | void _os_nospin_lock_unlock(_os_nospin_lock_t lock); | ||
| 203 | #undef OSSpinLockUnlock | ||
| 204 | #define OSSpinLockUnlock(lock) _os_nospin_lock_unlock(lock) | ||
| 205 | |||
| 206 | __END_DECLS | ||
| 207 | |||
| 208 | #endif /* OSSPINLOCK_USE_INLINED_TRANSPARENT */ | ||
| 209 | |||
| 210 | #endif /* OSSPINLOCK_USE_INLINED */ | ||
| 211 | |||
| 212 | #endif /* _OSSPINLOCK_DEPRECATED_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/OSTypes.h created+42| ... | @@ -0,0 +1,42 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2012 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #include <MacTypes.h> | ||
| 30 | |||
| 31 | #ifndef _OS_OSTYPES_H | ||
| 32 | #define _OS_OSTYPES_H | ||
| 33 | |||
| 34 | #define OSTYPES_K64_REV 2 | ||
| 35 | |||
| 36 | typedef unsigned int UInt; | ||
| 37 | typedef signed int SInt; | ||
| 38 | |||
| 39 | |||
| 40 | #include <sys/_types/_os_inline.h> | ||
| 41 | |||
| 42 | #endif /* _OS_OSTYPES_H */ | ||
lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h+19-16| ... | @@ -41,14 +41,14 @@ | ... | @@ -41,14 +41,14 @@ |
| 41 | 41 | ||
| 42 | /* Macros for swapping constant values in the preprocessing stage. */ | 42 | /* Macros for swapping constant values in the preprocessing stage. */ |
| 43 | #define __DARWIN_OSSwapConstInt16(x) \ | 43 | #define __DARWIN_OSSwapConstInt16(x) \ |
| 44 | ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \ | 44 | ((__uint16_t)((((__uint16_t)(x) & 0xff00U) >> 8) | \ |
| 45 | 	 (((__uint16_t)(x) & 0x00ff) << 8))) | 45 | 	 (((__uint16_t)(x) & 0x00ffU) << 8))) |
| 46 | 46 | ||
| 47 | #define __DARWIN_OSSwapConstInt32(x) \ | 47 | #define __DARWIN_OSSwapConstInt32(x) \ |
| 48 | ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | \ | 48 | ((__uint32_t)((((__uint32_t)(x) & 0xff000000U) >> 24) | \ |
| 49 | 	 (((__uint32_t)(x) & 0x00ff0000) >> 8) | \ | 49 | 	 (((__uint32_t)(x) & 0x00ff0000U) >> 8) | \ |
| 50 | 	 (((__uint32_t)(x) & 0x0000ff00) << 8) | \ | 50 | 	 (((__uint32_t)(x) & 0x0000ff00U) << 8) | \ |
| 51 | 	 (((__uint32_t)(x) & 0x000000ff) << 24))) | 51 | 	 (((__uint32_t)(x) & 0x000000ffU) << 24))) |
| 52 | 52 | ||
| 53 | #define __DARWIN_OSSwapConstInt64(x) \ | 53 | #define __DARWIN_OSSwapConstInt64(x) \ |
| 54 | ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \ | 54 | ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \ |
| ... | @@ -62,10 +62,23 @@ | ... | @@ -62,10 +62,23 @@ |
| 62 | 62 | ||
| 63 | #if defined(__GNUC__) | 63 | #if defined(__GNUC__) |
| 64 | 64 | ||
| 65 | #if !defined(__DARWIN_OS_INLINE) | ||
| 66 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | ||
| 67 | # define __DARWIN_OS_INLINE static inline | ||
| 68 | # elif defined(__MWERKS__) || defined(__cplusplus) | ||
| 69 | # define __DARWIN_OS_INLINE static inline | ||
| 70 | # else | ||
| 71 | # define __DARWIN_OS_INLINE static __inline__ | ||
| 72 | # endif | ||
| 73 | #endif | ||
| 74 | |||
| 65 | #if defined(__i386__) || defined(__x86_64__) | 75 | #if defined(__i386__) || defined(__x86_64__) |
| 66 | #include <libkern/i386/_OSByteOrder.h> | 76 | #include <libkern/i386/_OSByteOrder.h> |
| 67 | #endif | 77 | #endif |
| 68 | 78 | ||
| 79 | #if defined (__arm__) || defined(__arm64__) | ||
| 80 | #include <libkern/arm/OSByteOrder.h> | ||
| 81 | #endif | ||
| 69 | 82 | ||
| 70 | 83 | ||
| 71 | #define __DARWIN_OSSwapInt16(x) \ | 84 | #define __DARWIN_OSSwapInt16(x) \ |
| ... | @@ -81,16 +94,6 @@ | ... | @@ -81,16 +94,6 @@ |
| 81 | 94 | ||
| 82 | #if defined(__i386__) || defined(__x86_64__) | 95 | #if defined(__i386__) || defined(__x86_64__) |
| 83 | 96 | ||
| 84 | #if !defined(__DARWIN_OS_INLINE) | ||
| 85 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | ||
| 86 | # define __DARWIN_OS_INLINE static inline | ||
| 87 | # elif defined(__MWERKS__) || defined(__cplusplus) | ||
| 88 | # define __DARWIN_OS_INLINE static inline | ||
| 89 | # else | ||
| 90 | # define __DARWIN_OS_INLINE static __inline__ | ||
| 91 | # endif | ||
| 92 | #endif | ||
| 93 | |||
| 94 | __DARWIN_OS_INLINE | 97 | __DARWIN_OS_INLINE |
| 95 | uint16_t | 98 | uint16_t |
| 96 | _OSSwapInt16( | 99 | _OSSwapInt16( |
lib/libc/include/x86_64-macos-gnu/libkern/i386/OSByteOrder.h created+112| ... | @@ -0,0 +1,112 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _OS_OSBYTEORDERI386_H | ||
| 30 | #define _OS_OSBYTEORDERI386_H | ||
| 31 | |||
| 32 | #include <stdint.h> | ||
| 33 | #include <libkern/i386/_OSByteOrder.h> | ||
| 34 | #include <sys/_types/_os_inline.h> | ||
| 35 | |||
| 36 | /* Functions for byte reversed loads. */ | ||
| 37 | |||
| 38 | OS_INLINE | ||
| 39 | uint16_t | ||
| 40 | OSReadSwapInt16( | ||
| 41 | 	const volatile void * base, | ||
| 42 | 	uintptr_t byteOffset | ||
| 43 | 	) | ||
| 44 | { | ||
| 45 | 	uint16_t result; | ||
| 46 | |||
| 47 | 	result = *(volatile uint16_t *)((uintptr_t)base + byteOffset); | ||
| 48 | 	return _OSSwapInt16(result); | ||
| 49 | } | ||
| 50 | |||
| 51 | OS_INLINE | ||
| 52 | uint32_t | ||
| 53 | OSReadSwapInt32( | ||
| 54 | 	const volatile void * base, | ||
| 55 | 	uintptr_t byteOffset | ||
| 56 | 	) | ||
| 57 | { | ||
| 58 | 	uint32_t result; | ||
| 59 | |||
| 60 | 	result = *(volatile uint32_t *)((uintptr_t)base + byteOffset); | ||
| 61 | 	return _OSSwapInt32(result); | ||
| 62 | } | ||
| 63 | |||
| 64 | OS_INLINE | ||
| 65 | uint64_t | ||
| 66 | OSReadSwapInt64( | ||
| 67 | 	const volatile void * base, | ||
| 68 | 	uintptr_t byteOffset | ||
| 69 | 	) | ||
| 70 | { | ||
| 71 | 	uint64_t result; | ||
| 72 | |||
| 73 | 	result = *(volatile uint64_t *)((uintptr_t)base + byteOffset); | ||
| 74 | 	return _OSSwapInt64(result); | ||
| 75 | } | ||
| 76 | |||
| 77 | /* Functions for byte reversed stores. */ | ||
| 78 | |||
| 79 | OS_INLINE | ||
| 80 | void | ||
| 81 | OSWriteSwapInt16( | ||
| 82 | 	volatile void * base, | ||
| 83 | 	uintptr_t byteOffset, | ||
| 84 | 	uint16_t data | ||
| 85 | 	) | ||
| 86 | { | ||
| 87 | 	*(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); | ||
| 88 | } | ||
| 89 | |||
| 90 | OS_INLINE | ||
| 91 | void | ||
| 92 | OSWriteSwapInt32( | ||
| 93 | 	volatile void * base, | ||
| 94 | 	uintptr_t byteOffset, | ||
| 95 | 	uint32_t data | ||
| 96 | 	) | ||
| 97 | { | ||
| 98 | 	*(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); | ||
| 99 | } | ||
| 100 | |||
| 101 | OS_INLINE | ||
| 102 | void | ||
| 103 | OSWriteSwapInt64( | ||
| 104 | 	volatile void * base, | ||
| 105 | 	uintptr_t byteOffset, | ||
| 106 | 	uint64_t data | ||
| 107 | 	) | ||
| 108 | { | ||
| 109 | 	*(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); | ||
| 110 | } | ||
| 111 | |||
| 112 | #endif /* ! _OS_OSBYTEORDERI386_H */ | ||
lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h created+272| ... | @@ -0,0 +1,272 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #ifndef _MACH_O_DYLD_H_ | ||
| 24 | #define _MACH_O_DYLD_H_ | ||
| 25 | |||
| 26 | |||
| 27 | #include <stddef.h> | ||
| 28 | #include <stdint.h> | ||
| 29 | #include <stdbool.h> | ||
| 30 | |||
| 31 | #include <mach-o/loader.h> | ||
| 32 | #include <Availability.h> | ||
| 33 | |||
| 34 | #if __cplusplus | ||
| 35 | extern "C" { | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #ifdef __DRIVERKIT_19_0 | ||
| 39 | #define DYLD_DRIVERKIT_UNAVAILABLE __API_UNAVAILABLE(driverkit) | ||
| 40 | #else | ||
| 41 | #define DYLD_DRIVERKIT_UNAVAILABLE | ||
| 42 | #endif | ||
| 43 | |||
| 44 | /* | ||
| 45 | * The following functions allow you to iterate through all loaded images. | ||
| 46 | * This is not a thread safe operation. Another thread can add or remove | ||
| 47 | * an image during the iteration. | ||
| 48 | * | ||
| 49 | * Many uses of these routines can be replace by a call to dladdr() which | ||
| 50 | * will return the mach_header and name of an image, given an address in | ||
| 51 | * the image. dladdr() is thread safe. | ||
| 52 | */ | ||
| 53 | extern uint32_t _dyld_image_count(void) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 54 | extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 55 | extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 56 | extern const char* _dyld_get_image_name(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 57 | |||
| 58 | |||
| 59 | /* | ||
| 60 | * The following functions allow you to install callbacks which will be called | ||
| 61 | * by dyld whenever an image is loaded or unloaded. During a call to _dyld_register_func_for_add_image() | ||
| 62 | * the callback func is called for every existing image. Later, it is called as each new image | ||
| 63 | * is loaded and bound (but initializers not yet run). The callback registered with | ||
| 64 | * _dyld_register_func_for_remove_image() is called after any terminators in an image are run | ||
| 65 | * and before the image is un-memory-mapped. | ||
| 66 | */ | ||
| 67 | extern void _dyld_register_func_for_add_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 68 | extern void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 69 | |||
| 70 | |||
| 71 | /* | ||
| 72 | * NSVersionOfRunTimeLibrary() returns the current_version number of the currently dylib | ||
| 73 | * specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and | ||
| 74 | * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if no such library is loaded. | ||
| 75 | */ | ||
| 76 | extern int32_t NSVersionOfRunTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 77 | |||
| 78 | |||
| 79 | /* | ||
| 80 | * NSVersionOfLinkTimeLibrary() returns the current_version number that the main executable was linked | ||
| 81 | * against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and | ||
| 82 | * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if the main executable did not link | ||
| 83 | * against the specified library. | ||
| 84 | */ | ||
| 85 | extern int32_t NSVersionOfLinkTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); | ||
| 86 | |||
| 87 | |||
| 88 | /* | ||
| 89 | * _NSGetExecutablePath() copies the path of the main executable into the buffer. The bufsize parameter | ||
| 90 | * should initially be the size of the buffer. The function returns 0 if the path was successfully copied, | ||
| 91 | * and *bufsize is left unchanged. It returns -1 if the buffer is not large enough, and *bufsize is set | ||
| 92 | * to the size required. | ||
| 93 | * | ||
| 94 | * Note that _NSGetExecutablePath will return "a path" to the executable not a "real path" to the executable. | ||
| 95 | * That is the path may be a symbolic link and not the real file. With deep directories the total bufsize | ||
| 96 | * needed could be more than MAXPATHLEN. | ||
| 97 | */ | ||
| 98 | extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0); | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | /* | ||
| 103 | * Registers a function to be called when the current thread terminates. | ||
| 104 | * Called by c++ compiler to implement destructors on thread_local object variables. | ||
| 105 | */ | ||
| 106 | extern void _tlv_atexit(void (*termFunc)(void* objAddr), void* objAddr) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 107 | |||
| 108 | |||
| 109 | /* | ||
| 110 | * Never called. On-disk thread local variables contain a pointer to this. Once | ||
| 111 | * the thread local is prepared, the pointer changes to a real handler such as tlv_get_addr. | ||
| 112 | */ | ||
| 113 | extern void _tlv_bootstrap(void) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) DYLD_DRIVERKIT_UNAVAILABLE ; | ||
| 114 | |||
| 115 | |||
| 116 | /* | ||
| 117 | * Dylibs that are incorporated into the dyld cache are removed from disk. That means code | ||
| 118 | * cannot stat() the file to see if it "exists". This function is like a stat() call that checks if a | ||
| 119 | * path is to a dylib that was removed from disk and is incorporated into the active dyld cache. | ||
| 120 | */ | ||
| 121 | extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE; | ||
| 122 | |||
| 123 | |||
| 124 | /* | ||
| 125 | * The following dyld API's are deprecated as of Mac OS X 10.5. They are either | ||
| 126 | * no longer necessary or are superceeded by dlopen and friends in <dlfcn.h>. | ||
| 127 | * dlopen/dlsym/dlclose have been available since Mac OS X 10.3 and work with | ||
| 128 | * dylibs and bundles. | ||
| 129 | * | ||
| 130 | * NSAddImage -> dlopen | ||
| 131 | * NSLookupSymbolInImage -> dlsym | ||
| 132 | * NSCreateObjectFileImageFromFile -> dlopen | ||
| 133 | * NSDestroyObjectFileImage -> dlclose | ||
| 134 | * NSLinkModule -> not needed when dlopen used | ||
| 135 | * NSUnLinkModule -> not needed when dlclose used | ||
| 136 | * NSLookupSymbolInModule -> dlsym | ||
| 137 | * _dyld_image_containing_address -> dladdr | ||
| 138 | * NSLinkEditError -> dlerror | ||
| 139 | * | ||
| 140 | */ | ||
| 141 | |||
| 142 | #ifndef ENUM_DYLD_BOOL | ||
| 143 | #define ENUM_DYLD_BOOL | ||
| 144 | #undef FALSE | ||
| 145 | #undef TRUE | ||
| 146 | enum DYLD_BOOL { FALSE, TRUE }; | ||
| 147 | #endif /* ENUM_DYLD_BOOL */ | ||
| 148 | |||
| 149 | |||
| 150 | /* Object file image API */ | ||
| 151 | typedef enum { | ||
| 152 | NSObjectFileImageFailure, /* for this a message is printed on stderr */ | ||
| 153 | NSObjectFileImageSuccess, | ||
| 154 | NSObjectFileImageInappropriateFile, | ||
| 155 | NSObjectFileImageArch, | ||
| 156 | NSObjectFileImageFormat, /* for this a message is printed on stderr */ | ||
| 157 | NSObjectFileImageAccess | ||
| 158 | } NSObjectFileImageReturnCode; | ||
| 159 | |||
| 160 | typedef struct __NSObjectFileImage* NSObjectFileImage; | ||
| 161 | |||
| 162 | |||
| 163 | |||
| 164 | /* NSObjectFileImage can only be used with MH_BUNDLE files */ | ||
| 165 | extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()"); | ||
| 166 | extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 167 | extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlclose()"); | ||
| 168 | |||
| 169 | extern uint32_t NSSymbolDefinitionCountInObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 170 | extern const char* NSSymbolDefinitionNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 171 | extern uint32_t NSSymbolReferenceCountInObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 172 | extern const char* NSSymbolReferenceNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal, bool *tentative_definition) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 173 | extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 174 | extern void* NSGetSectionDataInObjectFileImage(NSObjectFileImage objectFileImage, const char* segmentName, const char* sectionName, size_t *size) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "getsectiondata()"); | ||
| 175 | |||
| 176 | typedef struct __NSModule* NSModule; | ||
| 177 | extern const char* NSNameOfModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 178 | extern const char* NSLibraryNameForModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 179 | |||
| 180 | extern NSModule NSLinkModule(NSObjectFileImage objectFileImage, const char* moduleName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()"); | ||
| 181 | #define NSLINKMODULE_OPTION_NONE 0x0 | ||
| 182 | #define NSLINKMODULE_OPTION_BINDNOW 0x1 | ||
| 183 | #define NSLINKMODULE_OPTION_PRIVATE 0x2 | ||
| 184 | #define NSLINKMODULE_OPTION_RETURN_ON_ERROR 0x4 | ||
| 185 | #define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8 | ||
| 186 | #define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10 | ||
| 187 | |||
| 188 | extern bool NSUnLinkModule(NSModule module, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 189 | #define NSUNLINKMODULE_OPTION_NONE 0x0 | ||
| 190 | #define NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED 0x1 | ||
| 191 | #define NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES	0x2 | ||
| 192 | |||
| 193 | /* symbol API */ | ||
| 194 | typedef struct __NSSymbol* NSSymbol; | ||
| 195 | extern bool NSIsSymbolNameDefined(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 196 | extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 197 | extern bool NSIsSymbolNameDefinedInImage(const struct mach_header* image, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 198 | extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 199 | extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 200 | extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()"); | ||
| 201 | extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()"); | ||
| 202 | #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 | ||
| 203 | #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 | ||
| 204 | #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 | ||
| 205 | #define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 | ||
| 206 | extern const char* NSNameOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 207 | extern void * NSAddressOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()"); | ||
| 208 | extern NSModule NSModuleForSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dladdr()"); | ||
| 209 | |||
| 210 | /* error handling API */ | ||
| 211 | typedef enum { | ||
| 212 | NSLinkEditFileAccessError, | ||
| 213 | NSLinkEditFileFormatError, | ||
| 214 | NSLinkEditMachResourceError, | ||
| 215 | NSLinkEditUnixResourceError, | ||
| 216 | NSLinkEditOtherError, | ||
| 217 | NSLinkEditWarningError, | ||
| 218 | NSLinkEditMultiplyDefinedError, | ||
| 219 | NSLinkEditUndefinedError | ||
| 220 | } NSLinkEditErrors; | ||
| 221 | |||
| 222 | /* | ||
| 223 | * For the NSLinkEditErrors value NSLinkEditOtherError these are the values | ||
| 224 | * passed to the link edit error handler as the errorNumber (what would be an | ||
| 225 | * errno value for NSLinkEditUnixResourceError or a kern_return_t value for | ||
| 226 | * NSLinkEditMachResourceError). | ||
| 227 | */ | ||
| 228 | typedef enum { | ||
| 229 | NSOtherErrorRelocation, | ||
| 230 | NSOtherErrorLazyBind, | ||
| 231 | NSOtherErrorIndrLoop, | ||
| 232 | NSOtherErrorLazyInit, | ||
| 233 | NSOtherErrorInvalidArgs | ||
| 234 | } NSOtherErrorNumbers; | ||
| 235 | |||
| 236 | extern void NSLinkEditError(NSLinkEditErrors *c, int *errorNumber, const char** fileName, const char** errorString) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlerror()"); | ||
| 237 | |||
| 238 | typedef struct { | ||
| 239 | void (*undefined)(const char* symbolName); | ||
| 240 | NSModule (*multiple)(NSSymbol s, NSModule oldModule, NSModule newModule); | ||
| 241 | void (*linkEdit)(NSLinkEditErrors errorClass, int errorNumber, | ||
| 242 | const char* fileName, const char* errorString); | ||
| 243 | } NSLinkEditErrorHandlers; | ||
| 244 | |||
| 245 | extern void NSInstallLinkEditErrorHandlers(const NSLinkEditErrorHandlers *handlers) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, ""); | ||
| 246 | |||
| 247 | extern bool NSAddLibrary(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()"); | ||
| 248 | extern bool NSAddLibraryWithSearching(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()"); | ||
| 249 | extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()"); | ||
| 250 | #define NSADDIMAGE_OPTION_NONE 	0x0 | ||
| 251 | #define NSADDIMAGE_OPTION_RETURN_ON_ERROR 	0x1 | ||
| 252 | #define NSADDIMAGE_OPTION_WITH_SEARCHING 	0x2 | ||
| 253 | #define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 	0x4 | ||
| 254 | #define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME	0x8 | ||
| 255 | |||
| 256 | extern bool _dyld_present(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "always true"); | ||
| 257 | extern bool _dyld_launched_prebound(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "moot"); | ||
| 258 | extern bool _dyld_all_twolevel_modules_prebound(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "moot"); | ||
| 259 | extern bool _dyld_bind_fully_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen(RTLD_NOW)"); | ||
| 260 | extern bool _dyld_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()"); | ||
| 261 | extern void _dyld_lookup_and_bind(const char* symbol_name, void **address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 262 | extern void _dyld_lookup_and_bind_with_hint(const char* symbol_name, const char* library_name_hint, void** address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()"); | ||
| 263 | extern void _dyld_lookup_and_bind_fully(const char* symbol_name, void** address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()"); | ||
| 264 | |||
| 265 | extern const struct mach_header* _dyld_get_image_header_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()"); | ||
| 266 | |||
| 267 | |||
| 268 | #if __cplusplus | ||
| 269 | } | ||
| 270 | #endif | ||
| 271 | |||
| 272 | #endif /* _MACH_O_DYLD_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach-o/loader.h created+1601| ... | @@ -0,0 +1,1601 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #ifndef _MACHO_LOADER_H_ | ||
| 24 | #define _MACHO_LOADER_H_ | ||
| 25 | |||
| 26 | /* | ||
| 27 | * This file describes the format of mach object files. | ||
| 28 | */ | ||
| 29 | #include <stdint.h> | ||
| 30 | |||
| 31 | /* | ||
| 32 | * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types | ||
| 33 | * and contains the constants for the possible values of these types. | ||
| 34 | */ | ||
| 35 | #include <mach/machine.h> | ||
| 36 | |||
| 37 | /* | ||
| 38 | * <mach/vm_prot.h> is needed here for the vm_prot_t type and contains the | ||
| 39 | * constants that are or'ed together for the possible values of this type. | ||
| 40 | */ | ||
| 41 | #include <mach/vm_prot.h> | ||
| 42 | |||
| 43 | /* | ||
| 44 | * <machine/thread_status.h> is expected to define the flavors of the thread | ||
| 45 | * states and the structures of those flavors for each machine. | ||
| 46 | */ | ||
| 47 | #include <mach/machine/thread_status.h> | ||
| 48 | #include <architecture/byte_order.h> | ||
| 49 | |||
| 50 | /* | ||
| 51 | * The 32-bit mach header appears at the very beginning of the object file for | ||
| 52 | * 32-bit architectures. | ||
| 53 | */ | ||
| 54 | struct mach_header { | ||
| 55 | 	uint32_t	magic;		/* mach magic number identifier */ | ||
| 56 | 	cpu_type_t	cputype;	/* cpu specifier */ | ||
| 57 | 	cpu_subtype_t	cpusubtype;	/* machine specifier */ | ||
| 58 | 	uint32_t	filetype;	/* type of file */ | ||
| 59 | 	uint32_t	ncmds;		/* number of load commands */ | ||
| 60 | 	uint32_t	sizeofcmds;	/* the size of all the load commands */ | ||
| 61 | 	uint32_t	flags;		/* flags */ | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* Constant for the magic field of the mach_header (32-bit architectures) */ | ||
| 65 | #define	MH_MAGIC	0xfeedface	/* the mach magic number */ | ||
| 66 | #define MH_CIGAM	0xcefaedfe	/* NXSwapInt(MH_MAGIC) */ | ||
| 67 | |||
| 68 | /* | ||
| 69 | * The 64-bit mach header appears at the very beginning of object files for | ||
| 70 | * 64-bit architectures. | ||
| 71 | */ | ||
| 72 | struct mach_header_64 { | ||
| 73 | 	uint32_t	magic;		/* mach magic number identifier */ | ||
| 74 | 	cpu_type_t	cputype;	/* cpu specifier */ | ||
| 75 | 	cpu_subtype_t	cpusubtype;	/* machine specifier */ | ||
| 76 | 	uint32_t	filetype;	/* type of file */ | ||
| 77 | 	uint32_t	ncmds;		/* number of load commands */ | ||
| 78 | 	uint32_t	sizeofcmds;	/* the size of all the load commands */ | ||
| 79 | 	uint32_t	flags;		/* flags */ | ||
| 80 | 	uint32_t	reserved;	/* reserved */ | ||
| 81 | }; | ||
| 82 | |||
| 83 | /* Constant for the magic field of the mach_header_64 (64-bit architectures) */ | ||
| 84 | #define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */ | ||
| 85 | #define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ | ||
| 86 | |||
| 87 | /* | ||
| 88 | * The layout of the file depends on the filetype. For all but the MH_OBJECT | ||
| 89 | * file type the segments are padded out and aligned on a segment alignment | ||
| 90 | * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB, | ||
| 91 | * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part | ||
| 92 | * of their first segment. | ||
| 93 | * | ||
| 94 | * The file type MH_OBJECT is a compact format intended as output of the | ||
| 95 | * assembler and input (and possibly output) of the link editor (the .o | ||
| 96 | * format). All sections are in one unnamed segment with no segment padding. | ||
| 97 | * This format is used as an executable format when the file is so small the | ||
| 98 | * segment padding greatly increases its size. | ||
| 99 | * | ||
| 100 | * The file type MH_PRELOAD is an executable format intended for things that | ||
| 101 | * are not executed under the kernel (proms, stand alones, kernels, etc). The | ||
| 102 | * format can be executed under the kernel but may demand paged it and not | ||
| 103 | * preload it before execution. | ||
| 104 | * | ||
| 105 | * A core file is in MH_CORE format and can be any in an arbritray legal | ||
| 106 | * Mach-O file. | ||
| 107 | * | ||
| 108 | * Constants for the filetype field of the mach_header | ||
| 109 | */ | ||
| 110 | #define	MH_OBJECT	0x1		/* relocatable object file */ | ||
| 111 | #define	MH_EXECUTE	0x2		/* demand paged executable file */ | ||
| 112 | #define	MH_FVMLIB	0x3		/* fixed VM shared library file */ | ||
| 113 | #define	MH_CORE		0x4		/* core file */ | ||
| 114 | #define	MH_PRELOAD	0x5		/* preloaded executable file */ | ||
| 115 | #define	MH_DYLIB	0x6		/* dynamically bound shared library */ | ||
| 116 | #define	MH_DYLINKER	0x7		/* dynamic link editor */ | ||
| 117 | #define	MH_BUNDLE	0x8		/* dynamically bound bundle file */ | ||
| 118 | #define	MH_DYLIB_STUB	0x9		/* shared library stub for static | ||
| 119 | 					 linking only, no section contents */ | ||
| 120 | #define	MH_DSYM		0xa		/* companion file with only debug | ||
| 121 | 					 sections */ | ||
| 122 | #define	MH_KEXT_BUNDLE	0xb		/* x86_64 kexts */ | ||
| 123 | #define MH_FILESET	0xc		/* a file composed of other Mach-Os to | ||
| 124 | 					 be run in the same userspace sharing | ||
| 125 | 					 a single linkedit. */ | ||
| 126 | |||
| 127 | /* Constants for the flags field of the mach_header */ | ||
| 128 | #define	MH_NOUNDEFS	0x1		/* the object file has no undefined | ||
| 129 | 					 references */ | ||
| 130 | #define	MH_INCRLINK	0x2		/* the object file is the output of an | ||
| 131 | 					 incremental link against a base file | ||
| 132 | 					 and can't be link edited again */ | ||
| 133 | #define MH_DYLDLINK	0x4		/* the object file is input for the | ||
| 134 | 					 dynamic linker and can't be staticly | ||
| 135 | 					 link edited again */ | ||
| 136 | #define MH_BINDATLOAD	0x8		/* the object file's undefined | ||
| 137 | 					 references are bound by the dynamic | ||
| 138 | 					 linker when loaded. */ | ||
| 139 | #define MH_PREBOUND	0x10		/* the file has its dynamic undefined | ||
| 140 | 					 references prebound. */ | ||
| 141 | #define MH_SPLIT_SEGS	0x20		/* the file has its read-only and | ||
| 142 | 					 read-write segments split */ | ||
| 143 | #define MH_LAZY_INIT	0x40		/* the shared library init routine is | ||
| 144 | 					 to be run lazily via catching memory | ||
| 145 | 					 faults to its writeable segments | ||
| 146 | 					 (obsolete) */ | ||
| 147 | #define MH_TWOLEVEL	0x80		/* the image is using two-level name | ||
| 148 | 					 space bindings */ | ||
| 149 | #define MH_FORCE_FLAT	0x100		/* the executable is forcing all images | ||
| 150 | 					 to use flat name space bindings */ | ||
| 151 | #define MH_NOMULTIDEFS	0x200		/* this umbrella guarantees no multiple | ||
| 152 | 					 defintions of symbols in its | ||
| 153 | 					 sub-images so the two-level namespace | ||
| 154 | 					 hints can always be used. */ | ||
| 155 | #define MH_NOFIXPREBINDING 0x400	/* do not have dyld notify the | ||
| 156 | 					 prebinding agent about this | ||
| 157 | 					 executable */ | ||
| 158 | #define MH_PREBINDABLE 0x800 /* the binary is not prebound but can | ||
| 159 | 					 have its prebinding redone. only used | ||
| 160 | when MH_PREBOUND is not set. */ | ||
| 161 | #define MH_ALLMODSBOUND 0x1000		/* indicates that this binary binds to | ||
| 162 | all two-level namespace modules of | ||
| 163 | 					 its dependent libraries. only used | ||
| 164 | 					 when MH_PREBINDABLE and MH_TWOLEVEL | ||
| 165 | 					 are both set. */ | ||
| 166 | #define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into | ||
| 167 | 					 sub-sections via symbols for dead | ||
| 168 | 					 code stripping */ | ||
| 169 | #define MH_CANONICAL 0x4000		/* the binary has been canonicalized | ||
| 170 | 					 via the unprebind operation */ | ||
| 171 | #define MH_WEAK_DEFINES	0x8000		/* the final linked image contains | ||
| 172 | 					 external weak symbols */ | ||
| 173 | #define MH_BINDS_TO_WEAK 0x10000	/* the final linked image uses | ||
| 174 | 					 weak symbols */ | ||
| 175 | |||
| 176 | #define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks | ||
| 177 | 					 in the task will be given stack | ||
| 178 | 					 execution privilege. Only used in | ||
| 179 | 					 MH_EXECUTE filetypes. */ | ||
| 180 | #define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary | ||
| 181 | 					 declares it is safe for use in | ||
| 182 | 					 processes with uid zero */ | ||
| 183 | |||
| 184 | #define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary | ||
| 185 | 					 declares it is safe for use in | ||
| 186 | 					 processes when issetugid() is true */ | ||
| 187 | |||
| 188 | #define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib, | ||
| 189 | 					 the static linker does not need to | ||
| 190 | 					 examine dependent dylibs to see | ||
| 191 | 					 if any are re-exported */ | ||
| 192 | #define	MH_PIE 0x200000			/* When this bit is set, the OS will | ||
| 193 | 					 load the main executable at a | ||
| 194 | 					 random address. Only used in | ||
| 195 | 					 MH_EXECUTE filetypes. */ | ||
| 196 | #define	MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When | ||
| 197 | 					 linking against a dylib that | ||
| 198 | 					 has this bit set, the static linker | ||
| 199 | 					 will automatically not create a | ||
| 200 | 					 LC_LOAD_DYLIB load command to the | ||
| 201 | 					 dylib if no symbols are being | ||
| 202 | 					 referenced from the dylib. */ | ||
| 203 | #define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type | ||
| 204 | 					 S_THREAD_LOCAL_VARIABLES */ | ||
| 205 | |||
| 206 | #define MH_NO_HEAP_EXECUTION 0x1000000	/* When this bit is set, the OS will | ||
| 207 | 					 run the main executable with | ||
| 208 | 					 a non-executable heap even on | ||
| 209 | 					 platforms (e.g. i386) that don't | ||
| 210 | 					 require it. Only used in MH_EXECUTE | ||
| 211 | 					 filetypes. */ | ||
| 212 | |||
| 213 | #define MH_APP_EXTENSION_SAFE 0x02000000 /* The code was linked for use in an | ||
| 214 | 					 application extension. */ | ||
| 215 | |||
| 216 | #define	MH_NLIST_OUTOFSYNC_WITH_DYLDINFO 0x04000000 /* The external symbols | ||
| 217 | 					 listed in the nlist symbol table do | ||
| 218 | 					 not include all the symbols listed in | ||
| 219 | 					 the dyld info. */ | ||
| 220 | |||
| 221 | #define	MH_SIM_SUPPORT 0x08000000	/* Allow LC_MIN_VERSION_MACOS and | ||
| 222 | 					 LC_BUILD_VERSION load commands with | ||
| 223 | 					 the platforms macOS, macCatalyst, | ||
| 224 | 					 iOSSimulator, tvOSSimulator and | ||
| 225 | 					 watchOSSimulator. */ | ||
| 226 | 					 | ||
| 227 | #define MH_DYLIB_IN_CACHE 0x80000000	/* Only for use on dylibs. When this bit | ||
| 228 | 					 is set, the dylib is part of the dyld | ||
| 229 | 					 shared cache, rather than loose in | ||
| 230 | 					 the filesystem. */ | ||
| 231 | |||
| 232 | /* | ||
| 233 | * The load commands directly follow the mach_header. The total size of all | ||
| 234 | * of the commands is given by the sizeofcmds field in the mach_header. All | ||
| 235 | * load commands must have as their first two fields cmd and cmdsize. The cmd | ||
| 236 | * field is filled in with a constant for that command type. Each command type | ||
| 237 | * has a structure specifically for it. The cmdsize field is the size in bytes | ||
| 238 | * of the particular load command structure plus anything that follows it that | ||
| 239 | * is a part of the load command (i.e. section structures, strings, etc.). To | ||
| 240 | * advance to the next load command the cmdsize can be added to the offset or | ||
| 241 | * pointer of the current load command. The cmdsize for 32-bit architectures | ||
| 242 | * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple | ||
| 243 | * of 8 bytes (these are forever the maximum alignment of any load commands). | ||
| 244 | * The padded bytes must be zero. All tables in the object file must also | ||
| 245 | * follow these rules so the file can be memory mapped. Otherwise the pointers | ||
| 246 | * to these tables will not work well or at all on some machines. With all | ||
| 247 | * padding zeroed like objects will compare byte for byte. | ||
| 248 | */ | ||
| 249 | struct load_command { | ||
| 250 | 	uint32_t cmd;		/* type of load command */ | ||
| 251 | 	uint32_t cmdsize;	/* total size of command in bytes */ | ||
| 252 | }; | ||
| 253 | |||
| 254 | /* | ||
| 255 | * After MacOS X 10.1 when a new load command is added that is required to be | ||
| 256 | * understood by the dynamic linker for the image to execute properly the | ||
| 257 | * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic | ||
| 258 | * linker sees such a load command it it does not understand will issue a | ||
| 259 | * "unknown load command required for execution" error and refuse to use the | ||
| 260 | * image. Other load commands without this bit that are not understood will | ||
| 261 | * simply be ignored. | ||
| 262 | */ | ||
| 263 | #define LC_REQ_DYLD 0x80000000 | ||
| 264 | |||
| 265 | /* Constants for the cmd field of all load commands, the type */ | ||
| 266 | #define	LC_SEGMENT	0x1	/* segment of this file to be mapped */ | ||
| 267 | #define	LC_SYMTAB	0x2	/* link-edit stab symbol table info */ | ||
| 268 | #define	LC_SYMSEG	0x3	/* link-edit gdb symbol table info (obsolete) */ | ||
| 269 | #define	LC_THREAD	0x4	/* thread */ | ||
| 270 | #define	LC_UNIXTHREAD	0x5	/* unix thread (includes a stack) */ | ||
| 271 | #define	LC_LOADFVMLIB	0x6	/* load a specified fixed VM shared library */ | ||
| 272 | #define	LC_IDFVMLIB	0x7	/* fixed VM shared library identification */ | ||
| 273 | #define	LC_IDENT	0x8	/* object identification info (obsolete) */ | ||
| 274 | #define LC_FVMFILE	0x9	/* fixed VM file inclusion (internal use) */ | ||
| 275 | #define LC_PREPAGE 0xa /* prepage command (internal use) */ | ||
| 276 | #define	LC_DYSYMTAB	0xb	/* dynamic link-edit symbol table info */ | ||
| 277 | #define	LC_LOAD_DYLIB	0xc	/* load a dynamically linked shared library */ | ||
| 278 | #define	LC_ID_DYLIB	0xd	/* dynamically linked shared lib ident */ | ||
| 279 | #define LC_LOAD_DYLINKER 0xe	/* load a dynamic linker */ | ||
| 280 | #define LC_ID_DYLINKER	0xf	/* dynamic linker identification */ | ||
| 281 | #define	LC_PREBOUND_DYLIB 0x10	/* modules prebound for a dynamically */ | ||
| 282 | 				/* linked shared library */ | ||
| 283 | #define	LC_ROUTINES	0x11	/* image routines */ | ||
| 284 | #define	LC_SUB_FRAMEWORK 0x12	/* sub framework */ | ||
| 285 | #define	LC_SUB_UMBRELLA 0x13	/* sub umbrella */ | ||
| 286 | #define	LC_SUB_CLIENT	0x14	/* sub client */ | ||
| 287 | #define	LC_SUB_LIBRARY 0x15	/* sub library */ | ||
| 288 | #define	LC_TWOLEVEL_HINTS 0x16	/* two-level namespace lookup hints */ | ||
| 289 | #define	LC_PREBIND_CKSUM 0x17	/* prebind checksum */ | ||
| 290 | |||
| 291 | /* | ||
| 292 | * load a dynamically linked shared library that is allowed to be missing | ||
| 293 | * (all symbols are weak imported). | ||
| 294 | */ | ||
| 295 | #define	LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) | ||
| 296 | |||
| 297 | #define	LC_SEGMENT_64	0x19	/* 64-bit segment of this file to be | ||
| 298 | 				 mapped */ | ||
| 299 | #define	LC_ROUTINES_64	0x1a	/* 64-bit image routines */ | ||
| 300 | #define LC_UUID		0x1b	/* the uuid */ | ||
| 301 | #define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */ | ||
| 302 | #define LC_CODE_SIGNATURE 0x1d	/* local of code signature */ | ||
| 303 | #define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */ | ||
| 304 | #define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */ | ||
| 305 | #define	LC_LAZY_LOAD_DYLIB 0x20	/* delay load of dylib until first use */ | ||
| 306 | #define	LC_ENCRYPTION_INFO 0x21	/* encrypted segment information */ | ||
| 307 | #define	LC_DYLD_INFO 	0x22	/* compressed dyld information */ | ||
| 308 | #define	LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD)	/* compressed dyld information only */ | ||
| 309 | #define	LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */ | ||
| 310 | #define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */ | ||
| 311 | #define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */ | ||
| 312 | #define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ | ||
| 313 | #define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat | ||
| 314 | 				 like environment variable */ | ||
| 315 | #define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */ | ||
| 316 | #define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */ | ||
| 317 | #define LC_SOURCE_VERSION 0x2A /* source version used to build binary */ | ||
| 318 | #define LC_DYLIB_CODE_SIGN_DRS 0x2B /* Code signing DRs copied from linked dylibs */ | ||
| 319 | #define	LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */ | ||
| 320 | #define LC_LINKER_OPTION 0x2D /* linker options in MH_OBJECT files */ | ||
| 321 | #define LC_LINKER_OPTIMIZATION_HINT 0x2E /* optimization hints in MH_OBJECT files */ | ||
| 322 | #define LC_VERSION_MIN_TVOS 0x2F /* build for AppleTV min OS version */ | ||
| 323 | #define LC_VERSION_MIN_WATCHOS 0x30 /* build for Watch min OS version */ | ||
| 324 | #define LC_NOTE 0x31 /* arbitrary data included within a Mach-O file */ | ||
| 325 | #define LC_BUILD_VERSION 0x32 /* build for platform min OS version */ | ||
| 326 | #define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) /* used with linkedit_data_command, payload is trie */ | ||
| 327 | #define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) /* used with linkedit_data_command */ | ||
| 328 | #define LC_FILESET_ENTRY (0x35 | LC_REQ_DYLD) /* used with fileset_entry_command */ | ||
| 329 | |||
| 330 | /* | ||
| 331 | * A variable length string in a load command is represented by an lc_str | ||
| 332 | * union. The strings are stored just after the load command structure and | ||
| 333 | * the offset is from the start of the load command structure. The size | ||
| 334 | * of the string is reflected in the cmdsize field of the load command. | ||
| 335 | * Once again any padded bytes to bring the cmdsize field to a multiple | ||
| 336 | * of 4 bytes must be zero. | ||
| 337 | */ | ||
| 338 | union lc_str { | ||
| 339 | 	uint32_t	offset;	/* offset to the string */ | ||
| 340 | #ifndef __LP64__ | ||
| 341 | 	char		*ptr;	/* pointer to the string */ | ||
| 342 | #endif | ||
| 343 | }; | ||
| 344 | |||
| 345 | /* | ||
| 346 | * The segment load command indicates that a part of this file is to be | ||
| 347 | * mapped into the task's address space. The size of this segment in memory, | ||
| 348 | * vmsize, maybe equal to or larger than the amount to map from this file, | ||
| 349 | * filesize. The file is mapped starting at fileoff to the beginning of | ||
| 350 | * the segment in memory, vmaddr. The rest of the memory of the segment, | ||
| 351 | * if any, is allocated zero fill on demand. The segment's maximum virtual | ||
| 352 | * memory protection and initial virtual memory protection are specified | ||
| 353 | * by the maxprot and initprot fields. If the segment has sections then the | ||
| 354 | * section structures directly follow the segment command and their size is | ||
| 355 | * reflected in cmdsize. | ||
| 356 | */ | ||
| 357 | struct segment_command { /* for 32-bit architectures */ | ||
| 358 | 	uint32_t	cmd;		/* LC_SEGMENT */ | ||
| 359 | 	uint32_t	cmdsize;	/* includes sizeof section structs */ | ||
| 360 | 	char		segname[16];	/* segment name */ | ||
| 361 | 	uint32_t	vmaddr;		/* memory address of this segment */ | ||
| 362 | 	uint32_t	vmsize;		/* memory size of this segment */ | ||
| 363 | 	uint32_t	fileoff;	/* file offset of this segment */ | ||
| 364 | 	uint32_t	filesize;	/* amount to map from the file */ | ||
| 365 | 	vm_prot_t	maxprot;	/* maximum VM protection */ | ||
| 366 | 	vm_prot_t	initprot;	/* initial VM protection */ | ||
| 367 | 	uint32_t	nsects;		/* number of sections in segment */ | ||
| 368 | 	uint32_t	flags;		/* flags */ | ||
| 369 | }; | ||
| 370 | |||
| 371 | /* | ||
| 372 | * The 64-bit segment load command indicates that a part of this file is to be | ||
| 373 | * mapped into a 64-bit task's address space. If the 64-bit segment has | ||
| 374 | * sections then section_64 structures directly follow the 64-bit segment | ||
| 375 | * command and their size is reflected in cmdsize. | ||
| 376 | */ | ||
| 377 | struct segment_command_64 { /* for 64-bit architectures */ | ||
| 378 | 	uint32_t	cmd;		/* LC_SEGMENT_64 */ | ||
| 379 | 	uint32_t	cmdsize;	/* includes sizeof section_64 structs */ | ||
| 380 | 	char		segname[16];	/* segment name */ | ||
| 381 | 	uint64_t	vmaddr;		/* memory address of this segment */ | ||
| 382 | 	uint64_t	vmsize;		/* memory size of this segment */ | ||
| 383 | 	uint64_t	fileoff;	/* file offset of this segment */ | ||
| 384 | 	uint64_t	filesize;	/* amount to map from the file */ | ||
| 385 | 	vm_prot_t	maxprot;	/* maximum VM protection */ | ||
| 386 | 	vm_prot_t	initprot;	/* initial VM protection */ | ||
| 387 | 	uint32_t	nsects;		/* number of sections in segment */ | ||
| 388 | 	uint32_t	flags;		/* flags */ | ||
| 389 | }; | ||
| 390 | |||
| 391 | /* Constants for the flags field of the segment_command */ | ||
| 392 | #define	SG_HIGHVM	0x1	/* the file contents for this segment is for | ||
| 393 | 				 the high part of the VM space, the low part | ||
| 394 | 				 is zero filled (for stacks in core files) */ | ||
| 395 | #define	SG_FVMLIB	0x2	/* this segment is the VM that is allocated by | ||
| 396 | 				 a fixed VM library, for overlap checking in | ||
| 397 | 				 the link editor */ | ||
| 398 | #define	SG_NORELOC	0x4	/* this segment has nothing that was relocated | ||
| 399 | 				 in it and nothing relocated to it, that is | ||
| 400 | 				 it maybe safely replaced without relocation*/ | ||
| 401 | #define SG_PROTECTED_VERSION_1	0x8 /* This segment is protected. If the | ||
| 402 | 				 segment starts at file offset 0, the | ||
| 403 | 				 first page of the segment is not | ||
| 404 | 				 protected. All other pages of the | ||
| 405 | 				 segment are protected. */ | ||
| 406 | #define SG_READ_ONLY 0x10 /* This segment is made read-only after fixups */ | ||
| 407 | |||
| 408 | |||
| 409 | |||
| 410 | /* | ||
| 411 | * A segment is made up of zero or more sections. Non-MH_OBJECT files have | ||
| 412 | * all of their segments with the proper sections in each, and padded to the | ||
| 413 | * specified segment alignment when produced by the link editor. The first | ||
| 414 | * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header | ||
| 415 | * and load commands of the object file before its first section. The zero | ||
| 416 | * fill sections are always last in their segment (in all formats). This | ||
| 417 | * allows the zeroed segment padding to be mapped into memory where zero fill | ||
| 418 | * sections might be. The gigabyte zero fill sections, those with the section | ||
| 419 | * type S_GB_ZEROFILL, can only be in a segment with sections of this type. | ||
| 420 | * These segments are then placed after all other segments. | ||
| 421 | * | ||
| 422 | * The MH_OBJECT format has all of its sections in one segment for | ||
| 423 | * compactness. There is no padding to a specified segment boundary and the | ||
| 424 | * mach_header and load commands are not part of the segment. | ||
| 425 | * | ||
| 426 | * Sections with the same section name, sectname, going into the same segment, | ||
| 427 | * segname, are combined by the link editor. The resulting section is aligned | ||
| 428 | * to the maximum alignment of the combined sections and is the new section's | ||
| 429 | * alignment. The combined sections are aligned to their original alignment in | ||
| 430 | * the combined section. Any padded bytes to get the specified alignment are | ||
| 431 | * zeroed. | ||
| 432 | * | ||
| 433 | * The format of the relocation entries referenced by the reloff and nreloc | ||
| 434 | * fields of the section structure for mach object files is described in the | ||
| 435 | * header file <reloc.h>. | ||
| 436 | */ | ||
| 437 | struct section { /* for 32-bit architectures */ | ||
| 438 | 	char		sectname[16];	/* name of this section */ | ||
| 439 | 	char		segname[16];	/* segment this section goes in */ | ||
| 440 | 	uint32_t	addr;		/* memory address of this section */ | ||
| 441 | 	uint32_t	size;		/* size in bytes of this section */ | ||
| 442 | 	uint32_t	offset;		/* file offset of this section */ | ||
| 443 | 	uint32_t	align;		/* section alignment (power of 2) */ | ||
| 444 | 	uint32_t	reloff;		/* file offset of relocation entries */ | ||
| 445 | 	uint32_t	nreloc;		/* number of relocation entries */ | ||
| 446 | 	uint32_t	flags;		/* flags (section type and attributes)*/ | ||
| 447 | 	uint32_t	reserved1;	/* reserved (for offset or index) */ | ||
| 448 | 	uint32_t	reserved2;	/* reserved (for count or sizeof) */ | ||
| 449 | }; | ||
| 450 | |||
| 451 | struct section_64 { /* for 64-bit architectures */ | ||
| 452 | 	char		sectname[16];	/* name of this section */ | ||
| 453 | 	char		segname[16];	/* segment this section goes in */ | ||
| 454 | 	uint64_t	addr;		/* memory address of this section */ | ||
| 455 | 	uint64_t	size;		/* size in bytes of this section */ | ||
| 456 | 	uint32_t	offset;		/* file offset of this section */ | ||
| 457 | 	uint32_t	align;		/* section alignment (power of 2) */ | ||
| 458 | 	uint32_t	reloff;		/* file offset of relocation entries */ | ||
| 459 | 	uint32_t	nreloc;		/* number of relocation entries */ | ||
| 460 | 	uint32_t	flags;		/* flags (section type and attributes)*/ | ||
| 461 | 	uint32_t	reserved1;	/* reserved (for offset or index) */ | ||
| 462 | 	uint32_t	reserved2;	/* reserved (for count or sizeof) */ | ||
| 463 | 	uint32_t	reserved3;	/* reserved */ | ||
| 464 | }; | ||
| 465 | |||
| 466 | /* | ||
| 467 | * The flags field of a section structure is separated into two parts a section | ||
| 468 | * type and section attributes. The section types are mutually exclusive (it | ||
| 469 | * can only have one type) but the section attributes are not (it may have more | ||
| 470 | * than one attribute). | ||
| 471 | */ | ||
| 472 | #define SECTION_TYPE		 0x000000ff	/* 256 section types */ | ||
| 473 | #define SECTION_ATTRIBUTES	 0xffffff00	/* 24 section attributes */ | ||
| 474 | |||
| 475 | /* Constants for the type of a section */ | ||
| 476 | #define	S_REGULAR		0x0	/* regular section */ | ||
| 477 | #define	S_ZEROFILL		0x1	/* zero fill on demand section */ | ||
| 478 | #define	S_CSTRING_LITERALS	0x2	/* section with only literal C strings*/ | ||
| 479 | #define	S_4BYTE_LITERALS	0x3	/* section with only 4 byte literals */ | ||
| 480 | #define	S_8BYTE_LITERALS	0x4	/* section with only 8 byte literals */ | ||
| 481 | #define	S_LITERAL_POINTERS	0x5	/* section with only pointers to */ | ||
| 482 | 					/* literals */ | ||
| 483 | /* | ||
| 484 | * For the two types of symbol pointers sections and the symbol stubs section | ||
| 485 | * they have indirect symbol table entries. For each of the entries in the | ||
| 486 | * section the indirect symbol table entries, in corresponding order in the | ||
| 487 | * indirect symbol table, start at the index stored in the reserved1 field | ||
| 488 | * of the section structure. Since the indirect symbol table entries | ||
| 489 | * correspond to the entries in the section the number of indirect symbol table | ||
| 490 | * entries is inferred from the size of the section divided by the size of the | ||
| 491 | * entries in the section. For symbol pointers sections the size of the entries | ||
| 492 | * in the section is 4 bytes and for symbol stubs sections the byte size of the | ||
| 493 | * stubs is stored in the reserved2 field of the section structure. | ||
| 494 | */ | ||
| 495 | #define	S_NON_LAZY_SYMBOL_POINTERS	0x6	/* section with only non-lazy | ||
| 496 | 						 symbol pointers */ | ||
| 497 | #define	S_LAZY_SYMBOL_POINTERS		0x7	/* section with only lazy symbol | ||
| 498 | 						 pointers */ | ||
| 499 | #define	S_SYMBOL_STUBS			0x8	/* section with only symbol | ||
| 500 | 						 stubs, byte size of stub in | ||
| 501 | 						 the reserved2 field */ | ||
| 502 | #define	S_MOD_INIT_FUNC_POINTERS	0x9	/* section with only function | ||
| 503 | 						 pointers for initialization*/ | ||
| 504 | #define	S_MOD_TERM_FUNC_POINTERS	0xa	/* section with only function | ||
| 505 | 						 pointers for termination */ | ||
| 506 | #define	S_COALESCED			0xb	/* section contains symbols that | ||
| 507 | 						 are to be coalesced */ | ||
| 508 | #define	S_GB_ZEROFILL			0xc	/* zero fill on demand section | ||
| 509 | 						 (that can be larger than 4 | ||
| 510 | 						 gigabytes) */ | ||
| 511 | #define	S_INTERPOSING			0xd	/* section with only pairs of | ||
| 512 | 						 function pointers for | ||
| 513 | 						 interposing */ | ||
| 514 | #define	S_16BYTE_LITERALS		0xe	/* section with only 16 byte | ||
| 515 | 						 literals */ | ||
| 516 | #define	S_DTRACE_DOF			0xf	/* section contains | ||
| 517 | 						 DTrace Object Format */ | ||
| 518 | #define	S_LAZY_DYLIB_SYMBOL_POINTERS	0x10	/* section with only lazy | ||
| 519 | 						 symbol pointers to lazy | ||
| 520 | 						 loaded dylibs */ | ||
| 521 | /* | ||
| 522 | * Section types to support thread local variables | ||
| 523 | */ | ||
| 524 | #define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial | ||
| 525 | 							 values for TLVs */ | ||
| 526 | #define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial | ||
| 527 | 							 values for TLVs */ | ||
| 528 | #define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */ | ||
| 529 | #define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV | ||
| 530 | descriptors */ | ||
| 531 | #define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call | ||
| 532 | 							 to initialize TLV | ||
| 533 | 							 values */ | ||
| 534 | #define S_INIT_FUNC_OFFSETS 0x16 /* 32-bit offsets to | ||
| 535 | 							 initializers */ | ||
| 536 | |||
| 537 | /* | ||
| 538 | * Constants for the section attributes part of the flags field of a section | ||
| 539 | * structure. | ||
| 540 | */ | ||
| 541 | #define SECTION_ATTRIBUTES_USR	 0xff000000	/* User setable attributes */ | ||
| 542 | #define S_ATTR_PURE_INSTRUCTIONS 0x80000000	/* section contains only true | ||
| 543 | 						 machine instructions */ | ||
| 544 | #define S_ATTR_NO_TOC 		 0x40000000	/* section contains coalesced | ||
| 545 | 						 symbols that are not to be | ||
| 546 | 						 in a ranlib table of | ||
| 547 | 						 contents */ | ||
| 548 | #define S_ATTR_STRIP_STATIC_SYMS 0x20000000	/* ok to strip static symbols | ||
| 549 | 						 in this section in files | ||
| 550 | 						 with the MH_DYLDLINK flag */ | ||
| 551 | #define S_ATTR_NO_DEAD_STRIP	 0x10000000	/* no dead stripping */ | ||
| 552 | #define S_ATTR_LIVE_SUPPORT	 0x08000000	/* blocks are live if they | ||
| 553 | 						 reference live blocks */ | ||
| 554 | #define S_ATTR_SELF_MODIFYING_CODE 0x04000000	/* Used with i386 code stubs | ||
| 555 | 						 written on by dyld */ | ||
| 556 | /* | ||
| 557 | * If a segment contains any sections marked with S_ATTR_DEBUG then all | ||
| 558 | * sections in that segment must have this attribute. No section other than | ||
| 559 | * a section marked with this attribute may reference the contents of this | ||
| 560 | * section. A section with this attribute may contain no symbols and must have | ||
| 561 | * a section type S_REGULAR. The static linker will not copy section contents | ||
| 562 | * from sections with this attribute into its output file. These sections | ||
| 563 | * generally contain DWARF debugging info. | ||
| 564 | */ | ||
| 565 | #define	S_ATTR_DEBUG		 0x02000000	/* a debug section */ | ||
| 566 | #define SECTION_ATTRIBUTES_SYS	 0x00ffff00	/* system setable attributes */ | ||
| 567 | #define S_ATTR_SOME_INSTRUCTIONS 0x00000400	/* section contains some | ||
| 568 | 						 machine instructions */ | ||
| 569 | #define S_ATTR_EXT_RELOC	 0x00000200	/* section has external | ||
| 570 | 						 relocation entries */ | ||
| 571 | #define S_ATTR_LOC_RELOC	 0x00000100	/* section has local | ||
| 572 | 						 relocation entries */ | ||
| 573 | |||
| 574 | |||
| 575 | /* | ||
| 576 | * The names of segments and sections in them are mostly meaningless to the | ||
| 577 | * link-editor. But there are few things to support traditional UNIX | ||
| 578 | * executables that require the link-editor and assembler to use some names | ||
| 579 | * agreed upon by convention. | ||
| 580 | * | ||
| 581 | * The initial protection of the "__TEXT" segment has write protection turned | ||
| 582 | * off (not writeable). | ||
| 583 | * | ||
| 584 | * The link-editor will allocate common symbols at the end of the "__common" | ||
| 585 | * section in the "__DATA" segment. It will create the section and segment | ||
| 586 | * if needed. | ||
| 587 | */ | ||
| 588 | |||
| 589 | /* The currently known segment names and the section names in those segments */ | ||
| 590 | |||
| 591 | #define	SEG_PAGEZERO	"__PAGEZERO"	/* the pagezero segment which has no */ | ||
| 592 | 					/* protections and catches NULL */ | ||
| 593 | 					/* references for MH_EXECUTE files */ | ||
| 594 | |||
| 595 | |||
| 596 | #define	SEG_TEXT	"__TEXT"	/* the tradition UNIX text segment */ | ||
| 597 | #define	SECT_TEXT	"__text"	/* the real text part of the text */ | ||
| 598 | 					/* section no headers, and no padding */ | ||
| 599 | #define SECT_FVMLIB_INIT0 "__fvmlib_init0"	/* the fvmlib initialization */ | ||
| 600 | 						/* section */ | ||
| 601 | #define SECT_FVMLIB_INIT1 "__fvmlib_init1"	/* the section following the */ | ||
| 602 | 					 /* fvmlib initialization */ | ||
| 603 | 						/* section */ | ||
| 604 | |||
| 605 | #define	SEG_DATA	"__DATA"	/* the tradition UNIX data segment */ | ||
| 606 | #define	SECT_DATA	"__data"	/* the real initialized data section */ | ||
| 607 | 					/* no padding, no bss overlap */ | ||
| 608 | #define	SECT_BSS	"__bss"		/* the real uninitialized data section*/ | ||
| 609 | 					/* no padding */ | ||
| 610 | #define SECT_COMMON	"__common"	/* the section common symbols are */ | ||
| 611 | 					/* allocated in by the link editor */ | ||
| 612 | |||
| 613 | #define	SEG_OBJC	"__OBJC"	/* objective-C runtime segment */ | ||
| 614 | #define SECT_OBJC_SYMBOLS "__symbol_table"	/* symbol table */ | ||
| 615 | #define SECT_OBJC_MODULES "__module_info"	/* module information */ | ||
| 616 | #define SECT_OBJC_STRINGS "__selector_strs"	/* string table */ | ||
| 617 | #define SECT_OBJC_REFS "__selector_refs"	/* string table */ | ||
| 618 | |||
| 619 | #define	SEG_ICON	 "__ICON"	/* the icon segment */ | ||
| 620 | #define	SECT_ICON_HEADER "__header"	/* the icon headers */ | ||
| 621 | #define	SECT_ICON_TIFF "__tiff"	/* the icons in tiff format */ | ||
| 622 | |||
| 623 | #define	SEG_LINKEDIT	"__LINKEDIT"	/* the segment containing all structs */ | ||
| 624 | 					/* created and maintained by the link */ | ||
| 625 | 					/* editor. Created with -seglinkedit */ | ||
| 626 | 					/* option to ld(1) for MH_EXECUTE and */ | ||
| 627 | 					/* FVMLIB file types only */ | ||
| 628 | |||
| 629 | #define SEG_UNIXSTACK	"__UNIXSTACK"	/* the unix stack segment */ | ||
| 630 | |||
| 631 | #define SEG_IMPORT	"__IMPORT"	/* the segment for the self (dyld) */ | ||
| 632 | 					/* modifing code stubs that has read, */ | ||
| 633 | 					/* write and execute permissions */ | ||
| 634 | |||
| 635 | /* | ||
| 636 | * Fixed virtual memory shared libraries are identified by two things. The | ||
| 637 | * target pathname (the name of the library as found for execution), and the | ||
| 638 | * minor version number. The address of where the headers are loaded is in | ||
| 639 | * header_addr. (THIS IS OBSOLETE and no longer supported). | ||
| 640 | */ | ||
| 641 | struct fvmlib { | ||
| 642 | 	union lc_str	name;		/* library's target pathname */ | ||
| 643 | 	uint32_t	minor_version;	/* library's minor version number */ | ||
| 644 | 	uint32_t	header_addr;	/* library's header address */ | ||
| 645 | }; | ||
| 646 | |||
| 647 | /* | ||
| 648 | * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header) | ||
| 649 | * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library. | ||
| 650 | * An object that uses a fixed virtual shared library also contains a | ||
| 651 | * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses. | ||
| 652 | * (THIS IS OBSOLETE and no longer supported). | ||
| 653 | */ | ||
| 654 | struct fvmlib_command { | ||
| 655 | 	uint32_t	cmd;		/* LC_IDFVMLIB or LC_LOADFVMLIB */ | ||
| 656 | 	uint32_t	cmdsize;	/* includes pathname string */ | ||
| 657 | 	struct fvmlib	fvmlib;		/* the library identification */ | ||
| 658 | }; | ||
| 659 | |||
| 660 | /* | ||
| 661 | * Dynamicly linked shared libraries are identified by two things. The | ||
| 662 | * pathname (the name of the library as found for execution), and the | ||
| 663 | * compatibility version number. The pathname must match and the compatibility | ||
| 664 | * number in the user of the library must be greater than or equal to the | ||
| 665 | * library being used. The time stamp is used to record the time a library was | ||
| 666 | * built and copied into user so it can be use to determined if the library used | ||
| 667 | * at runtime is exactly the same as used to built the program. | ||
| 668 | */ | ||
| 669 | struct dylib { | ||
| 670 | union lc_str name;			/* library's path name */ | ||
| 671 | uint32_t timestamp;			/* library's build time stamp */ | ||
| 672 | uint32_t current_version;		/* library's current version number */ | ||
| 673 | uint32_t compatibility_version;	/* library's compatibility vers number*/ | ||
| 674 | }; | ||
| 675 | |||
| 676 | /* | ||
| 677 | * A dynamically linked shared library (filetype == MH_DYLIB in the mach header) | ||
| 678 | * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library. | ||
| 679 | * An object that uses a dynamically linked shared library also contains a | ||
| 680 | * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or | ||
| 681 | * LC_REEXPORT_DYLIB) for each library it uses. | ||
| 682 | */ | ||
| 683 | struct dylib_command { | ||
| 684 | 	uint32_t	cmd;		/* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB, | ||
| 685 | 					 LC_REEXPORT_DYLIB */ | ||
| 686 | 	uint32_t	cmdsize;	/* includes pathname string */ | ||
| 687 | 	struct dylib	dylib;		/* the library identification */ | ||
| 688 | }; | ||
| 689 | |||
| 690 | /* | ||
| 691 | * A dynamically linked shared library may be a subframework of an umbrella | ||
| 692 | * framework. If so it will be linked with "-umbrella umbrella_name" where | ||
| 693 | * Where "umbrella_name" is the name of the umbrella framework. A subframework | ||
| 694 | * can only be linked against by its umbrella framework or other subframeworks | ||
| 695 | * that are part of the same umbrella framework. Otherwise the static link | ||
| 696 | * editor produces an error and states to link against the umbrella framework. | ||
| 697 | * The name of the umbrella framework for subframeworks is recorded in the | ||
| 698 | * following structure. | ||
| 699 | */ | ||
| 700 | struct sub_framework_command { | ||
| 701 | 	uint32_t	cmd;		/* LC_SUB_FRAMEWORK */ | ||
| 702 | 	uint32_t	cmdsize;	/* includes umbrella string */ | ||
| 703 | 	union lc_str 	umbrella;	/* the umbrella framework name */ | ||
| 704 | }; | ||
| 705 | |||
| 706 | /* | ||
| 707 | * For dynamically linked shared libraries that are subframework of an umbrella | ||
| 708 | * framework they can allow clients other than the umbrella framework or other | ||
| 709 | * subframeworks in the same umbrella framework. To do this the subframework | ||
| 710 | * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load | ||
| 711 | * command is created for each -allowable_client flag. The client_name is | ||
| 712 | * usually a framework name. It can also be a name used for bundles clients | ||
| 713 | * where the bundle is built with "-client_name client_name". | ||
| 714 | */ | ||
| 715 | struct sub_client_command { | ||
| 716 | 	uint32_t	cmd;		/* LC_SUB_CLIENT */ | ||
| 717 | 	uint32_t	cmdsize;	/* includes client string */ | ||
| 718 | 	union lc_str 	client;		/* the client name */ | ||
| 719 | }; | ||
| 720 | |||
| 721 | /* | ||
| 722 | * A dynamically linked shared library may be a sub_umbrella of an umbrella | ||
| 723 | * framework. If so it will be linked with "-sub_umbrella umbrella_name" where | ||
| 724 | * Where "umbrella_name" is the name of the sub_umbrella framework. When | ||
| 725 | * staticly linking when -twolevel_namespace is in effect a twolevel namespace | ||
| 726 | * umbrella framework will only cause its subframeworks and those frameworks | ||
| 727 | * listed as sub_umbrella frameworks to be implicited linked in. Any other | ||
| 728 | * dependent dynamic libraries will not be linked it when -twolevel_namespace | ||
| 729 | * is in effect. The primary library recorded by the static linker when | ||
| 730 | * resolving a symbol in these libraries will be the umbrella framework. | ||
| 731 | * Zero or more sub_umbrella frameworks may be use by an umbrella framework. | ||
| 732 | * The name of a sub_umbrella framework is recorded in the following structure. | ||
| 733 | */ | ||
| 734 | struct sub_umbrella_command { | ||
| 735 | 	uint32_t	cmd;		/* LC_SUB_UMBRELLA */ | ||
| 736 | 	uint32_t	cmdsize;	/* includes sub_umbrella string */ | ||
| 737 | 	union lc_str 	sub_umbrella;	/* the sub_umbrella framework name */ | ||
| 738 | }; | ||
| 739 | |||
| 740 | /* | ||
| 741 | * A dynamically linked shared library may be a sub_library of another shared | ||
| 742 | * library. If so it will be linked with "-sub_library library_name" where | ||
| 743 | * Where "library_name" is the name of the sub_library shared library. When | ||
| 744 | * staticly linking when -twolevel_namespace is in effect a twolevel namespace | ||
| 745 | * shared library will only cause its subframeworks and those frameworks | ||
| 746 | * listed as sub_umbrella frameworks and libraries listed as sub_libraries to | ||
| 747 | * be implicited linked in. Any other dependent dynamic libraries will not be | ||
| 748 | * linked it when -twolevel_namespace is in effect. The primary library | ||
| 749 | * recorded by the static linker when resolving a symbol in these libraries | ||
| 750 | * will be the umbrella framework (or dynamic library). Zero or more sub_library | ||
| 751 | * shared libraries may be use by an umbrella framework or (or dynamic library). | ||
| 752 | * The name of a sub_library framework is recorded in the following structure. | ||
| 753 | * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc". | ||
| 754 | */ | ||
| 755 | struct sub_library_command { | ||
| 756 | 	uint32_t	cmd;		/* LC_SUB_LIBRARY */ | ||
| 757 | 	uint32_t	cmdsize;	/* includes sub_library string */ | ||
| 758 | 	union lc_str 	sub_library;	/* the sub_library name */ | ||
| 759 | }; | ||
| 760 | |||
| 761 | /* | ||
| 762 | * A program (filetype == MH_EXECUTE) that is | ||
| 763 | * prebound to its dynamic libraries has one of these for each library that | ||
| 764 | * the static linker used in prebinding. It contains a bit vector for the | ||
| 765 | * modules in the library. The bits indicate which modules are bound (1) and | ||
| 766 | * which are not (0) from the library. The bit for module 0 is the low bit | ||
| 767 | * of the first byte. So the bit for the Nth module is: | ||
| 768 | * (linked_modules[N/8] >> N%8) & 1 | ||
| 769 | */ | ||
| 770 | struct prebound_dylib_command { | ||
| 771 | 	uint32_t	cmd;		/* LC_PREBOUND_DYLIB */ | ||
| 772 | 	uint32_t	cmdsize;	/* includes strings */ | ||
| 773 | 	union lc_str	name;		/* library's path name */ | ||
| 774 | 	uint32_t	nmodules;	/* number of modules in library */ | ||
| 775 | 	union lc_str	linked_modules;	/* bit vector of linked modules */ | ||
| 776 | }; | ||
| 777 | |||
| 778 | /* | ||
| 779 | * A program that uses a dynamic linker contains a dylinker_command to identify | ||
| 780 | * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker | ||
| 781 | * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER). | ||
| 782 | * A file can have at most one of these. | ||
| 783 | * This struct is also used for the LC_DYLD_ENVIRONMENT load command and | ||
| 784 | * contains string for dyld to treat like environment variable. | ||
| 785 | */ | ||
| 786 | struct dylinker_command { | ||
| 787 | 	uint32_t	cmd;		/* LC_ID_DYLINKER, LC_LOAD_DYLINKER or | ||
| 788 | 					 LC_DYLD_ENVIRONMENT */ | ||
| 789 | 	uint32_t	cmdsize;	/* includes pathname string */ | ||
| 790 | 	union lc_str name;		/* dynamic linker's path name */ | ||
| 791 | }; | ||
| 792 | |||
| 793 | /* | ||
| 794 | * Thread commands contain machine-specific data structures suitable for | ||
| 795 | * use in the thread state primitives. The machine specific data structures | ||
| 796 | * follow the struct thread_command as follows. | ||
| 797 | * Each flavor of machine specific data structure is preceded by an uint32_t | ||
| 798 | * constant for the flavor of that data structure, an uint32_t that is the | ||
| 799 | * count of uint32_t's of the size of the state data structure and then | ||
| 800 | * the state data structure follows. This triple may be repeated for many | ||
| 801 | * flavors. The constants for the flavors, counts and state data structure | ||
| 802 | * definitions are expected to be in the header file <machine/thread_status.h>. | ||
| 803 | * These machine specific data structures sizes must be multiples of | ||
| 804 | * 4 bytes. The cmdsize reflects the total size of the thread_command | ||
| 805 | * and all of the sizes of the constants for the flavors, counts and state | ||
| 806 | * data structures. | ||
| 807 | * | ||
| 808 | * For executable objects that are unix processes there will be one | ||
| 809 | * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor. | ||
| 810 | * This is the same as a LC_THREAD, except that a stack is automatically | ||
| 811 | * created (based on the shell's limit for the stack size). Command arguments | ||
| 812 | * and environment variables are copied onto that stack. | ||
| 813 | */ | ||
| 814 | struct thread_command { | ||
| 815 | 	uint32_t	cmd;		/* LC_THREAD or LC_UNIXTHREAD */ | ||
| 816 | 	uint32_t	cmdsize;	/* total size of this command */ | ||
| 817 | 	/* uint32_t flavor		 flavor of thread state */ | ||
| 818 | 	/* uint32_t count		 count of uint32_t's in thread state */ | ||
| 819 | 	/* struct XXX_thread_state state thread state for this flavor */ | ||
| 820 | 	/* ... */ | ||
| 821 | }; | ||
| 822 | |||
| 823 | /* | ||
| 824 | * The routines command contains the address of the dynamic shared library | ||
| 825 | * initialization routine and an index into the module table for the module | ||
| 826 | * that defines the routine. Before any modules are used from the library the | ||
| 827 | * dynamic linker fully binds the module that defines the initialization routine | ||
| 828 | * and then calls it. This gets called before any module initialization | ||
| 829 | * routines (used for C++ static constructors) in the library. | ||
| 830 | */ | ||
| 831 | struct routines_command { /* for 32-bit architectures */ | ||
| 832 | 	uint32_t	cmd;		/* LC_ROUTINES */ | ||
| 833 | 	uint32_t	cmdsize;	/* total size of this command */ | ||
| 834 | 	uint32_t	init_address;	/* address of initialization routine */ | ||
| 835 | 	uint32_t	init_module;	/* index into the module table that */ | ||
| 836 | 				 /* the init routine is defined in */ | ||
| 837 | 	uint32_t	reserved1; | ||
| 838 | 	uint32_t	reserved2; | ||
| 839 | 	uint32_t	reserved3; | ||
| 840 | 	uint32_t	reserved4; | ||
| 841 | 	uint32_t	reserved5; | ||
| 842 | 	uint32_t	reserved6; | ||
| 843 | }; | ||
| 844 | |||
| 845 | /* | ||
| 846 | * The 64-bit routines command. Same use as above. | ||
| 847 | */ | ||
| 848 | struct routines_command_64 { /* for 64-bit architectures */ | ||
| 849 | 	uint32_t	cmd;		/* LC_ROUTINES_64 */ | ||
| 850 | 	uint32_t	cmdsize;	/* total size of this command */ | ||
| 851 | 	uint64_t	init_address;	/* address of initialization routine */ | ||
| 852 | 	uint64_t	init_module;	/* index into the module table that */ | ||
| 853 | 					/* the init routine is defined in */ | ||
| 854 | 	uint64_t	reserved1; | ||
| 855 | 	uint64_t	reserved2; | ||
| 856 | 	uint64_t	reserved3; | ||
| 857 | 	uint64_t	reserved4; | ||
| 858 | 	uint64_t	reserved5; | ||
| 859 | 	uint64_t	reserved6; | ||
| 860 | }; | ||
| 861 | |||
| 862 | /* | ||
| 863 | * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD | ||
| 864 | * "stab" style symbol table information as described in the header files | ||
| 865 | * <nlist.h> and <stab.h>. | ||
| 866 | */ | ||
| 867 | struct symtab_command { | ||
| 868 | 	uint32_t	cmd;		/* LC_SYMTAB */ | ||
| 869 | 	uint32_t	cmdsize;	/* sizeof(struct symtab_command) */ | ||
| 870 | 	uint32_t	symoff;		/* symbol table offset */ | ||
| 871 | 	uint32_t	nsyms;		/* number of symbol table entries */ | ||
| 872 | 	uint32_t	stroff;		/* string table offset */ | ||
| 873 | 	uint32_t	strsize;	/* string table size in bytes */ | ||
| 874 | }; | ||
| 875 | |||
| 876 | /* | ||
| 877 | * This is the second set of the symbolic information which is used to support | ||
| 878 | * the data structures for the dynamically link editor. | ||
| 879 | * | ||
| 880 | * The original set of symbolic information in the symtab_command which contains | ||
| 881 | * the symbol and string tables must also be present when this load command is | ||
| 882 | * present. When this load command is present the symbol table is organized | ||
| 883 | * into three groups of symbols: | ||
| 884 | *	local symbols (static and debugging symbols) - grouped by module | ||
| 885 | *	defined external symbols - grouped by module (sorted by name if not lib) | ||
| 886 | *	undefined external symbols (sorted by name if MH_BINDATLOAD is not set, | ||
| 887 | *	 			 and in order the were seen by the static | ||
| 888 | *				 linker if MH_BINDATLOAD is set) | ||
| 889 | * In this load command there are offsets and counts to each of the three groups | ||
| 890 | * of symbols. | ||
| 891 | * | ||
| 892 | * This load command contains a the offsets and sizes of the following new | ||
| 893 | * symbolic information tables: | ||
| 894 | *	table of contents | ||
| 895 | *	module table | ||
| 896 | *	reference symbol table | ||
| 897 | *	indirect symbol table | ||
| 898 | * The first three tables above (the table of contents, module table and | ||
| 899 | * reference symbol table) are only present if the file is a dynamically linked | ||
| 900 | * shared library. For executable and object modules, which are files | ||
| 901 | * containing only one module, the information that would be in these three | ||
| 902 | * tables is determined as follows: | ||
| 903 | * 	table of contents - the defined external symbols are sorted by name | ||
| 904 | *	module table - the file contains only one module so everything in the | ||
| 905 | *		 file is part of the module. | ||
| 906 | *	reference symbol table - is the defined and undefined external symbols | ||
| 907 | * | ||
| 908 | * For dynamically linked shared library files this load command also contains | ||
| 909 | * offsets and sizes to the pool of relocation entries for all sections | ||
| 910 | * separated into two groups: | ||
| 911 | *	external relocation entries | ||
| 912 | *	local relocation entries | ||
| 913 | * For executable and object modules the relocation entries continue to hang | ||
| 914 | * off the section structures. | ||
| 915 | */ | ||
| 916 | struct dysymtab_command { | ||
| 917 | uint32_t cmd;	/* LC_DYSYMTAB */ | ||
| 918 | uint32_t cmdsize;	/* sizeof(struct dysymtab_command) */ | ||
| 919 | |||
| 920 | /* | ||
| 921 | * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command | ||
| 922 | * are grouped into the following three groups: | ||
| 923 | * local symbols (further grouped by the module they are from) | ||
| 924 | * defined external symbols (further grouped by the module they are from) | ||
| 925 | * undefined symbols | ||
| 926 | * | ||
| 927 | * The local symbols are used only for debugging. The dynamic binding | ||
| 928 | * process may have to use them to indicate to the debugger the local | ||
| 929 | * symbols for a module that is being bound. | ||
| 930 | * | ||
| 931 | * The last two groups are used by the dynamic binding process to do the | ||
| 932 | * binding (indirectly through the module table and the reference symbol | ||
| 933 | * table when this is a dynamically linked shared library file). | ||
| 934 | */ | ||
| 935 | uint32_t ilocalsym;	/* index to local symbols */ | ||
| 936 | uint32_t nlocalsym;	/* number of local symbols */ | ||
| 937 | |||
| 938 | uint32_t iextdefsym;/* index to externally defined symbols */ | ||
| 939 | uint32_t nextdefsym;/* number of externally defined symbols */ | ||
| 940 | |||
| 941 | uint32_t iundefsym;	/* index to undefined symbols */ | ||
| 942 | uint32_t nundefsym;	/* number of undefined symbols */ | ||
| 943 | |||
| 944 | /* | ||
| 945 | * For the for the dynamic binding process to find which module a symbol | ||
| 946 | * is defined in the table of contents is used (analogous to the ranlib | ||
| 947 | * structure in an archive) which maps defined external symbols to modules | ||
| 948 | * they are defined in. This exists only in a dynamically linked shared | ||
| 949 | * library file. For executable and object modules the defined external | ||
| 950 | * symbols are sorted by name and is use as the table of contents. | ||
| 951 | */ | ||
| 952 | uint32_t tocoff;	/* file offset to table of contents */ | ||
| 953 | uint32_t ntoc;	/* number of entries in table of contents */ | ||
| 954 | |||
| 955 | /* | ||
| 956 | * To support dynamic binding of "modules" (whole object files) the symbol | ||
| 957 | * table must reflect the modules that the file was created from. This is | ||
| 958 | * done by having a module table that has indexes and counts into the merged | ||
| 959 | * tables for each module. The module structure that these two entries | ||
| 960 | * refer to is described below. This exists only in a dynamically linked | ||
| 961 | * shared library file. For executable and object modules the file only | ||
| 962 | * contains one module so everything in the file belongs to the module. | ||
| 963 | */ | ||
| 964 | uint32_t modtaboff;	/* file offset to module table */ | ||
| 965 | uint32_t nmodtab;	/* number of module table entries */ | ||
| 966 | |||
| 967 | /* | ||
| 968 | * To support dynamic module binding the module structure for each module | ||
| 969 | * indicates the external references (defined and undefined) each module | ||
| 970 | * makes. For each module there is an offset and a count into the | ||
| 971 | * reference symbol table for the symbols that the module references. | ||
| 972 | * This exists only in a dynamically linked shared library file. For | ||
| 973 | * executable and object modules the defined external symbols and the | ||
| 974 | * undefined external symbols indicates the external references. | ||
| 975 | */ | ||
| 976 | uint32_t extrefsymoff;	/* offset to referenced symbol table */ | ||
| 977 | uint32_t nextrefsyms;	/* number of referenced symbol table entries */ | ||
| 978 | |||
| 979 | /* | ||
| 980 | * The sections that contain "symbol pointers" and "routine stubs" have | ||
| 981 | * indexes and (implied counts based on the size of the section and fixed | ||
| 982 | * size of the entry) into the "indirect symbol" table for each pointer | ||
| 983 | * and stub. For every section of these two types the index into the | ||
| 984 | * indirect symbol table is stored in the section header in the field | ||
| 985 | * reserved1. An indirect symbol table entry is simply a 32bit index into | ||
| 986 | * the symbol table to the symbol that the pointer or stub is referring to. | ||
| 987 | * The indirect symbol table is ordered to match the entries in the section. | ||
| 988 | */ | ||
| 989 | uint32_t indirectsymoff; /* file offset to the indirect symbol table */ | ||
| 990 | uint32_t nindirectsyms; /* number of indirect symbol table entries */ | ||
| 991 | |||
| 992 | /* | ||
| 993 | * To support relocating an individual module in a library file quickly the | ||
| 994 | * external relocation entries for each module in the library need to be | ||
| 995 | * accessed efficiently. Since the relocation entries can't be accessed | ||
| 996 | * through the section headers for a library file they are separated into | ||
| 997 | * groups of local and external entries further grouped by module. In this | ||
| 998 | * case the presents of this load command who's extreloff, nextrel, | ||
| 999 | * locreloff and nlocrel fields are non-zero indicates that the relocation | ||
| 1000 | * entries of non-merged sections are not referenced through the section | ||
| 1001 | * structures (and the reloff and nreloc fields in the section headers are | ||
| 1002 | * set to zero). | ||
| 1003 | * | ||
| 1004 | * Since the relocation entries are not accessed through the section headers | ||
| 1005 | * this requires the r_address field to be something other than a section | ||
| 1006 | * offset to identify the item to be relocated. In this case r_address is | ||
| 1007 | * set to the offset from the vmaddr of the first LC_SEGMENT command. | ||
| 1008 | * For MH_SPLIT_SEGS images r_address is set to the the offset from the | ||
| 1009 | * vmaddr of the first read-write LC_SEGMENT command. | ||
| 1010 | * | ||
| 1011 | * The relocation entries are grouped by module and the module table | ||
| 1012 | * entries have indexes and counts into them for the group of external | ||
| 1013 | * relocation entries for that the module. | ||
| 1014 | * | ||
| 1015 | * For sections that are merged across modules there must not be any | ||
| 1016 | * remaining external relocation entries for them (for merged sections | ||
| 1017 | * remaining relocation entries must be local). | ||
| 1018 | */ | ||
| 1019 | uint32_t extreloff;	/* offset to external relocation entries */ | ||
| 1020 | uint32_t nextrel;	/* number of external relocation entries */ | ||
| 1021 | |||
| 1022 | /* | ||
| 1023 | * All the local relocation entries are grouped together (they are not | ||
| 1024 | * grouped by their module since they are only used if the object is moved | ||
| 1025 | * from it staticly link edited address). | ||
| 1026 | */ | ||
| 1027 | uint32_t locreloff;	/* offset to local relocation entries */ | ||
| 1028 | uint32_t nlocrel;	/* number of local relocation entries */ | ||
| 1029 | |||
| 1030 | };	 | ||
| 1031 | |||
| 1032 | /* | ||
| 1033 | * An indirect symbol table entry is simply a 32bit index into the symbol table | ||
| 1034 | * to the symbol that the pointer or stub is refering to. Unless it is for a | ||
| 1035 | * non-lazy symbol pointer section for a defined symbol which strip(1) as | ||
| 1036 | * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the | ||
| 1037 | * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. | ||
| 1038 | */ | ||
| 1039 | #define INDIRECT_SYMBOL_LOCAL	0x80000000 | ||
| 1040 | #define INDIRECT_SYMBOL_ABS	0x40000000 | ||
| 1041 | |||
| 1042 | |||
| 1043 | /* a table of contents entry */ | ||
| 1044 | struct dylib_table_of_contents { | ||
| 1045 | uint32_t symbol_index;	/* the defined external symbol | ||
| 1046 | 				 (index into the symbol table) */ | ||
| 1047 | uint32_t module_index;	/* index into the module table this symbol | ||
| 1048 | 				 is defined in */ | ||
| 1049 | };	 | ||
| 1050 | |||
| 1051 | /* a module table entry */ | ||
| 1052 | struct dylib_module { | ||
| 1053 | uint32_t module_name;	/* the module name (index into string table) */ | ||
| 1054 | |||
| 1055 | uint32_t iextdefsym;	/* index into externally defined symbols */ | ||
| 1056 | uint32_t nextdefsym;	/* number of externally defined symbols */ | ||
| 1057 | uint32_t irefsym;		/* index into reference symbol table */ | ||
| 1058 | uint32_t nrefsym;		/* number of reference symbol table entries */ | ||
| 1059 | uint32_t ilocalsym;		/* index into symbols for local symbols */ | ||
| 1060 | uint32_t nlocalsym;		/* number of local symbols */ | ||
| 1061 | |||
| 1062 | uint32_t iextrel;		/* index into external relocation entries */ | ||
| 1063 | uint32_t nextrel;		/* number of external relocation entries */ | ||
| 1064 | |||
| 1065 | uint32_t iinit_iterm;	/* low 16 bits are the index into the init | ||
| 1066 | 				 section, high 16 bits are the index into | ||
| 1067 | 			 the term section */ | ||
| 1068 | uint32_t ninit_nterm;	/* low 16 bits are the number of init section | ||
| 1069 | 				 entries, high 16 bits are the number of | ||
| 1070 | 				 term section entries */ | ||
| 1071 | |||
| 1072 | uint32_t			/* for this module address of the start of */ | ||
| 1073 | 	objc_module_info_addr; /* the (__OBJC,__module_info) section */ | ||
| 1074 | uint32_t			/* for this module size of */ | ||
| 1075 | 	objc_module_info_size;	/* the (__OBJC,__module_info) section */ | ||
| 1076 | };	 | ||
| 1077 | |||
| 1078 | /* a 64-bit module table entry */ | ||
| 1079 | struct dylib_module_64 { | ||
| 1080 | uint32_t module_name;	/* the module name (index into string table) */ | ||
| 1081 | |||
| 1082 | uint32_t iextdefsym;	/* index into externally defined symbols */ | ||
| 1083 | uint32_t nextdefsym;	/* number of externally defined symbols */ | ||
| 1084 | uint32_t irefsym;		/* index into reference symbol table */ | ||
| 1085 | uint32_t nrefsym;		/* number of reference symbol table entries */ | ||
| 1086 | uint32_t ilocalsym;		/* index into symbols for local symbols */ | ||
| 1087 | uint32_t nlocalsym;		/* number of local symbols */ | ||
| 1088 | |||
| 1089 | uint32_t iextrel;		/* index into external relocation entries */ | ||
| 1090 | uint32_t nextrel;		/* number of external relocation entries */ | ||
| 1091 | |||
| 1092 | uint32_t iinit_iterm;	/* low 16 bits are the index into the init | ||
| 1093 | 				 section, high 16 bits are the index into | ||
| 1094 | 				 the term section */ | ||
| 1095 | uint32_t ninit_nterm; /* low 16 bits are the number of init section | ||
| 1096 | 				 entries, high 16 bits are the number of | ||
| 1097 | 				 term section entries */ | ||
| 1098 | |||
| 1099 | uint32_t			/* for this module size of */ | ||
| 1100 | objc_module_info_size;	/* the (__OBJC,__module_info) section */ | ||
| 1101 | uint64_t			/* for this module address of the start of */ | ||
| 1102 | objc_module_info_addr;	/* the (__OBJC,__module_info) section */ | ||
| 1103 | }; | ||
| 1104 | |||
| 1105 | /* | ||
| 1106 | * The entries in the reference symbol table are used when loading the module | ||
| 1107 | * (both by the static and dynamic link editors) and if the module is unloaded | ||
| 1108 | * or replaced. Therefore all external symbols (defined and undefined) are | ||
| 1109 | * listed in the module's reference table. The flags describe the type of | ||
| 1110 | * reference that is being made. The constants for the flags are defined in | ||
| 1111 | * <mach-o/nlist.h> as they are also used for symbol table entries. | ||
| 1112 | */ | ||
| 1113 | struct dylib_reference { | ||
| 1114 | uint32_t isym:24,		/* index into the symbol table */ | ||
| 1115 | 		 flags:8;	/* flags to indicate the type of reference */ | ||
| 1116 | }; | ||
| 1117 | |||
| 1118 | /* | ||
| 1119 | * The twolevel_hints_command contains the offset and number of hints in the | ||
| 1120 | * two-level namespace lookup hints table. | ||
| 1121 | */ | ||
| 1122 | struct twolevel_hints_command { | ||
| 1123 | uint32_t cmd;	/* LC_TWOLEVEL_HINTS */ | ||
| 1124 | uint32_t cmdsize;	/* sizeof(struct twolevel_hints_command) */ | ||
| 1125 | uint32_t offset;	/* offset to the hint table */ | ||
| 1126 | uint32_t nhints;	/* number of hints in the hint table */ | ||
| 1127 | }; | ||
| 1128 | |||
| 1129 | /* | ||
| 1130 | * The entries in the two-level namespace lookup hints table are twolevel_hint | ||
| 1131 | * structs. These provide hints to the dynamic link editor where to start | ||
| 1132 | * looking for an undefined symbol in a two-level namespace image. The | ||
| 1133 | * isub_image field is an index into the sub-images (sub-frameworks and | ||
| 1134 | * sub-umbrellas list) that made up the two-level image that the undefined | ||
| 1135 | * symbol was found in when it was built by the static link editor. If | ||
| 1136 | * isub-image is 0 the the symbol is expected to be defined in library and not | ||
| 1137 | * in the sub-images. If isub-image is non-zero it is an index into the array | ||
| 1138 | * of sub-images for the umbrella with the first index in the sub-images being | ||
| 1139 | * 1. The array of sub-images is the ordered list of sub-images of the umbrella | ||
| 1140 | * that would be searched for a symbol that has the umbrella recorded as its | ||
| 1141 | * primary library. The table of contents index is an index into the | ||
| 1142 | * library's table of contents. This is used as the starting point of the | ||
| 1143 | * binary search or a directed linear search. | ||
| 1144 | */ | ||
| 1145 | struct twolevel_hint { | ||
| 1146 | uint32_t | ||
| 1147 | 	isub_image:8,	/* index into the sub images */ | ||
| 1148 | 	itoc:24;	/* index into the table of contents */ | ||
| 1149 | }; | ||
| 1150 | |||
| 1151 | /* | ||
| 1152 | * The prebind_cksum_command contains the value of the original check sum for | ||
| 1153 | * prebound files or zero. When a prebound file is first created or modified | ||
| 1154 | * for other than updating its prebinding information the value of the check sum | ||
| 1155 | * is set to zero. When the file has it prebinding re-done and if the value of | ||
| 1156 | * the check sum is zero the original check sum is calculated and stored in | ||
| 1157 | * cksum field of this load command in the output file. If when the prebinding | ||
| 1158 | * is re-done and the cksum field is non-zero it is left unchanged from the | ||
| 1159 | * input file. | ||
| 1160 | */ | ||
| 1161 | struct prebind_cksum_command { | ||
| 1162 | uint32_t cmd;	/* LC_PREBIND_CKSUM */ | ||
| 1163 | uint32_t cmdsize;	/* sizeof(struct prebind_cksum_command) */ | ||
| 1164 | uint32_t cksum;	/* the check sum or zero */ | ||
| 1165 | }; | ||
| 1166 | |||
| 1167 | /* | ||
| 1168 | * The uuid load command contains a single 128-bit unique random number that | ||
| 1169 | * identifies an object produced by the static link editor. | ||
| 1170 | */ | ||
| 1171 | struct uuid_command { | ||
| 1172 | uint32_t	cmd;		/* LC_UUID */ | ||
| 1173 | uint32_t	cmdsize;	/* sizeof(struct uuid_command) */ | ||
| 1174 | uint8_t	uuid[16];	/* the 128-bit uuid */ | ||
| 1175 | }; | ||
| 1176 | |||
| 1177 | /* | ||
| 1178 | * The rpath_command contains a path which at runtime should be added to | ||
| 1179 | * the current run path used to find @rpath prefixed dylibs. | ||
| 1180 | */ | ||
| 1181 | struct rpath_command { | ||
| 1182 | uint32_t	 cmd;		/* LC_RPATH */ | ||
| 1183 | uint32_t	 cmdsize;	/* includes string */ | ||
| 1184 | union lc_str path;		/* path to add to run path */ | ||
| 1185 | }; | ||
| 1186 | |||
| 1187 | /* | ||
| 1188 | * The linkedit_data_command contains the offsets and sizes of a blob | ||
| 1189 | * of data in the __LINKEDIT segment. | ||
| 1190 | */ | ||
| 1191 | struct linkedit_data_command { | ||
| 1192 | uint32_t	cmd;		/* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, | ||
| 1193 | 				 LC_FUNCTION_STARTS, LC_DATA_IN_CODE, | ||
| 1194 | 				 LC_DYLIB_CODE_SIGN_DRS, | ||
| 1195 | 				 LC_LINKER_OPTIMIZATION_HINT, | ||
| 1196 | 				 LC_DYLD_EXPORTS_TRIE, or | ||
| 1197 | 				 LC_DYLD_CHAINED_FIXUPS. */ | ||
| 1198 | uint32_t	cmdsize;	/* sizeof(struct linkedit_data_command) */ | ||
| 1199 | uint32_t	dataoff;	/* file offset of data in __LINKEDIT segment */ | ||
| 1200 | uint32_t	datasize;	/* file size of data in __LINKEDIT segment */ | ||
| 1201 | }; | ||
| 1202 | |||
| 1203 | /* | ||
| 1204 | * The encryption_info_command contains the file offset and size of an | ||
| 1205 | * of an encrypted segment. | ||
| 1206 | */ | ||
| 1207 | struct encryption_info_command { | ||
| 1208 | uint32_t	cmd;		/* LC_ENCRYPTION_INFO */ | ||
| 1209 | uint32_t	cmdsize;	/* sizeof(struct encryption_info_command) */ | ||
| 1210 | uint32_t	cryptoff;	/* file offset of encrypted range */ | ||
| 1211 | uint32_t	cryptsize;	/* file size of encrypted range */ | ||
| 1212 | uint32_t	cryptid;	/* which enryption system, | ||
| 1213 | 				 0 means not-encrypted yet */ | ||
| 1214 | }; | ||
| 1215 | |||
| 1216 | /* | ||
| 1217 | * The encryption_info_command_64 contains the file offset and size of an | ||
| 1218 | * of an encrypted segment (for use in x86_64 targets). | ||
| 1219 | */ | ||
| 1220 | struct encryption_info_command_64 { | ||
| 1221 | uint32_t	cmd;		/* LC_ENCRYPTION_INFO_64 */ | ||
| 1222 | uint32_t	cmdsize;	/* sizeof(struct encryption_info_command_64) */ | ||
| 1223 | uint32_t	cryptoff;	/* file offset of encrypted range */ | ||
| 1224 | uint32_t	cryptsize;	/* file size of encrypted range */ | ||
| 1225 | uint32_t	cryptid;	/* which enryption system, | ||
| 1226 | 				 0 means not-encrypted yet */ | ||
| 1227 | uint32_t	pad;		/* padding to make this struct's size a multiple | ||
| 1228 | 				 of 8 bytes */ | ||
| 1229 | }; | ||
| 1230 | |||
| 1231 | /* | ||
| 1232 | * The version_min_command contains the min OS version on which this | ||
| 1233 | * binary was built to run. | ||
| 1234 | */ | ||
| 1235 | struct version_min_command { | ||
| 1236 | uint32_t	cmd;		/* LC_VERSION_MIN_MACOSX or | ||
| 1237 | 				 LC_VERSION_MIN_IPHONEOS or | ||
| 1238 | 				 LC_VERSION_MIN_WATCHOS or | ||
| 1239 | 				 LC_VERSION_MIN_TVOS */ | ||
| 1240 | uint32_t	cmdsize;	/* sizeof(struct min_version_command) */ | ||
| 1241 | uint32_t	version;	/* X.Y.Z is encoded in nibbles xxxx.yy.zz */ | ||
| 1242 | uint32_t	sdk;		/* X.Y.Z is encoded in nibbles xxxx.yy.zz */ | ||
| 1243 | }; | ||
| 1244 | |||
| 1245 | /* | ||
| 1246 | * The build_version_command contains the min OS version on which this | ||
| 1247 | * binary was built to run for its platform. The list of known platforms and | ||
| 1248 | * tool values following it. | ||
| 1249 | */ | ||
| 1250 | struct build_version_command { | ||
| 1251 | uint32_t	cmd;		/* LC_BUILD_VERSION */ | ||
| 1252 | uint32_t	cmdsize;	/* sizeof(struct build_version_command) plus */ | ||
| 1253 | 				/* ntools * sizeof(struct build_tool_version) */ | ||
| 1254 | uint32_t	platform;	/* platform */ | ||
| 1255 | uint32_t	minos;		/* X.Y.Z is encoded in nibbles xxxx.yy.zz */ | ||
| 1256 | uint32_t	sdk;		/* X.Y.Z is encoded in nibbles xxxx.yy.zz */ | ||
| 1257 | uint32_t	ntools;		/* number of tool entries following this */ | ||
| 1258 | }; | ||
| 1259 | |||
| 1260 | struct build_tool_version { | ||
| 1261 | uint32_t	tool;		/* enum for the tool */ | ||
| 1262 | uint32_t	version;	/* version number of the tool */ | ||
| 1263 | }; | ||
| 1264 | |||
| 1265 | /* Known values for the platform field above. */ | ||
| 1266 | #define PLATFORM_MACOS 1 | ||
| 1267 | #define PLATFORM_IOS 2 | ||
| 1268 | #define PLATFORM_TVOS 3 | ||
| 1269 | #define PLATFORM_WATCHOS 4 | ||
| 1270 | #define PLATFORM_BRIDGEOS 5 | ||
| 1271 | #define PLATFORM_MACCATALYST 6 | ||
| 1272 | #define PLATFORM_IOSSIMULATOR 7 | ||
| 1273 | #define PLATFORM_TVOSSIMULATOR 8 | ||
| 1274 | #define PLATFORM_WATCHOSSIMULATOR 9 | ||
| 1275 | #define PLATFORM_DRIVERKIT 10 | ||
| 1276 | |||
| 1277 | /* Known values for the tool field above. */ | ||
| 1278 | #define TOOL_CLANG 1 | ||
| 1279 | #define TOOL_SWIFT 2 | ||
| 1280 | #define TOOL_LD	3 | ||
| 1281 | |||
| 1282 | /* | ||
| 1283 | * The dyld_info_command contains the file offsets and sizes of | ||
| 1284 | * the new compressed form of the information dyld needs to | ||
| 1285 | * load the image. This information is used by dyld on Mac OS X | ||
| 1286 | * 10.6 and later. All information pointed to by this command | ||
| 1287 | * is encoded using byte streams, so no endian swapping is needed | ||
| 1288 | * to interpret it. | ||
| 1289 | */ | ||
| 1290 | struct dyld_info_command { | ||
| 1291 | uint32_t cmd;		/* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */ | ||
| 1292 | uint32_t cmdsize;		/* sizeof(struct dyld_info_command) */ | ||
| 1293 | |||
| 1294 | /* | ||
| 1295 | * Dyld rebases an image whenever dyld loads it at an address different | ||
| 1296 | * from its preferred address. The rebase information is a stream | ||
| 1297 | * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_. | ||
| 1298 | * Conceptually the rebase information is a table of tuples: | ||
| 1299 | * <seg-index, seg-offset, type> | ||
| 1300 | * The opcodes are a compressed way to encode the table by only | ||
| 1301 | * encoding when a column changes. In addition simple patterns | ||
| 1302 | * like "every n'th offset for m times" can be encoded in a few | ||
| 1303 | * bytes. | ||
| 1304 | */ | ||
| 1305 | uint32_t rebase_off;	/* file offset to rebase info */ | ||
| 1306 | uint32_t rebase_size;	/* size of rebase info */ | ||
| 1307 | |||
| 1308 | /* | ||
| 1309 | * Dyld binds an image during the loading process, if the image | ||
| 1310 | * requires any pointers to be initialized to symbols in other images. | ||
| 1311 | * The bind information is a stream of byte sized | ||
| 1312 | * opcodes whose symbolic names start with BIND_OPCODE_. | ||
| 1313 | * Conceptually the bind information is a table of tuples: | ||
| 1314 | * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend> | ||
| 1315 | * The opcodes are a compressed way to encode the table by only | ||
| 1316 | * encoding when a column changes. In addition simple patterns | ||
| 1317 | * like for runs of pointers initialzed to the same value can be | ||
| 1318 | * encoded in a few bytes. | ||
| 1319 | */ | ||
| 1320 | uint32_t bind_off;	/* file offset to binding info */ | ||
| 1321 | uint32_t bind_size;	/* size of binding info */ | ||
| 1322 | |||
| 1323 | /* | ||
| 1324 | * Some C++ programs require dyld to unique symbols so that all | ||
| 1325 | * images in the process use the same copy of some code/data. | ||
| 1326 | * This step is done after binding. The content of the weak_bind | ||
| 1327 | * info is an opcode stream like the bind_info. But it is sorted | ||
| 1328 | * alphabetically by symbol name. This enable dyld to walk | ||
| 1329 | * all images with weak binding information in order and look | ||
| 1330 | * for collisions. If there are no collisions, dyld does | ||
| 1331 | * no updating. That means that some fixups are also encoded | ||
| 1332 | * in the bind_info. For instance, all calls to "operator new" | ||
| 1333 | * are first bound to libstdc++.dylib using the information | ||
| 1334 | * in bind_info. Then if some image overrides operator new | ||
| 1335 | * that is detected when the weak_bind information is processed | ||
| 1336 | * and the call to operator new is then rebound. | ||
| 1337 | */ | ||
| 1338 | uint32_t weak_bind_off;	/* file offset to weak binding info */ | ||
| 1339 | uint32_t weak_bind_size; /* size of weak binding info */ | ||
| 1340 | |||
| 1341 | /* | ||
| 1342 | * Some uses of external symbols do not need to be bound immediately. | ||
| 1343 | * Instead they can be lazily bound on first use. The lazy_bind | ||
| 1344 | * are contains a stream of BIND opcodes to bind all lazy symbols. | ||
| 1345 | * Normal use is that dyld ignores the lazy_bind section when | ||
| 1346 | * loading an image. Instead the static linker arranged for the | ||
| 1347 | * lazy pointer to initially point to a helper function which | ||
| 1348 | * pushes the offset into the lazy_bind area for the symbol | ||
| 1349 | * needing to be bound, then jumps to dyld which simply adds | ||
| 1350 | * the offset to lazy_bind_off to get the information on what | ||
| 1351 | * to bind. | ||
| 1352 | */ | ||
| 1353 | uint32_t lazy_bind_off;	/* file offset to lazy binding info */ | ||
| 1354 | uint32_t lazy_bind_size; /* size of lazy binding infs */ | ||
| 1355 | |||
| 1356 | /* | ||
| 1357 | * The symbols exported by a dylib are encoded in a trie. This | ||
| 1358 | * is a compact representation that factors out common prefixes. | ||
| 1359 | * It also reduces LINKEDIT pages in RAM because it encodes all | ||
| 1360 | * information (name, address, flags) in one small, contiguous range. | ||
| 1361 | * The export area is a stream of nodes. The first node sequentially | ||
| 1362 | * is the start node for the trie. | ||
| 1363 | * | ||
| 1364 | * Nodes for a symbol start with a uleb128 that is the length of | ||
| 1365 | * the exported symbol information for the string so far. | ||
| 1366 | * If there is no exported symbol, the node starts with a zero byte. | ||
| 1367 | * If there is exported info, it follows the length. | ||
| 1368 | * | ||
| 1369 | * First is a uleb128 containing flags. Normally, it is followed by | ||
| 1370 | * a uleb128 encoded offset which is location of the content named | ||
| 1371 | * by the symbol from the mach_header for the image. If the flags | ||
| 1372 | * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is | ||
| 1373 | * a uleb128 encoded library ordinal, then a zero terminated | ||
| 1374 | * UTF8 string. If the string is zero length, then the symbol | ||
| 1375 | * is re-export from the specified dylib with the same name. | ||
| 1376 | * If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following | ||
| 1377 | * the flags is two uleb128s: the stub offset and the resolver offset. | ||
| 1378 | * The stub is used by non-lazy pointers. The resolver is used | ||
| 1379 | * by lazy pointers and must be called to get the actual address to use. | ||
| 1380 | * | ||
| 1381 | * After the optional exported symbol information is a byte of | ||
| 1382 | * how many edges (0-255) that this node has leaving it, | ||
| 1383 | * followed by each edge. | ||
| 1384 | * Each edge is a zero terminated UTF8 of the addition chars | ||
| 1385 | * in the symbol, followed by a uleb128 offset for the node that | ||
| 1386 | * edge points to. | ||
| 1387 | * | ||
| 1388 | */ | ||
| 1389 | uint32_t export_off;	/* file offset to lazy binding info */ | ||
| 1390 | uint32_t export_size;	/* size of lazy binding infs */ | ||
| 1391 | }; | ||
| 1392 | |||
| 1393 | /* | ||
| 1394 | * The following are used to encode rebasing information | ||
| 1395 | */ | ||
| 1396 | #define REBASE_TYPE_POINTER					1 | ||
| 1397 | #define REBASE_TYPE_TEXT_ABSOLUTE32				2 | ||
| 1398 | #define REBASE_TYPE_TEXT_PCREL32				3 | ||
| 1399 | |||
| 1400 | #define REBASE_OPCODE_MASK					0xF0 | ||
| 1401 | #define REBASE_IMMEDIATE_MASK					0x0F | ||
| 1402 | #define REBASE_OPCODE_DONE					0x00 | ||
| 1403 | #define REBASE_OPCODE_SET_TYPE_IMM				0x10 | ||
| 1404 | #define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB		0x20 | ||
| 1405 | #define REBASE_OPCODE_ADD_ADDR_ULEB				0x30 | ||
| 1406 | #define REBASE_OPCODE_ADD_ADDR_IMM_SCALED			0x40 | ||
| 1407 | #define REBASE_OPCODE_DO_REBASE_IMM_TIMES			0x50 | ||
| 1408 | #define REBASE_OPCODE_DO_REBASE_ULEB_TIMES			0x60 | ||
| 1409 | #define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB			0x70 | ||
| 1410 | #define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB	0x80 | ||
| 1411 | |||
| 1412 | |||
| 1413 | /* | ||
| 1414 | * The following are used to encode binding information | ||
| 1415 | */ | ||
| 1416 | #define BIND_TYPE_POINTER					1 | ||
| 1417 | #define BIND_TYPE_TEXT_ABSOLUTE32				2 | ||
| 1418 | #define BIND_TYPE_TEXT_PCREL32					3 | ||
| 1419 | |||
| 1420 | #define BIND_SPECIAL_DYLIB_SELF					 0 | ||
| 1421 | #define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE			-1 | ||
| 1422 | #define BIND_SPECIAL_DYLIB_FLAT_LOOKUP				-2 | ||
| 1423 | #define BIND_SPECIAL_DYLIB_WEAK_LOOKUP				-3 | ||
| 1424 | |||
| 1425 | #define BIND_SYMBOL_FLAGS_WEAK_IMPORT				0x1 | ||
| 1426 | #define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION			0x8 | ||
| 1427 | |||
| 1428 | #define BIND_OPCODE_MASK					0xF0 | ||
| 1429 | #define BIND_IMMEDIATE_MASK					0x0F | ||
| 1430 | #define BIND_OPCODE_DONE					0x00 | ||
| 1431 | #define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM			0x10 | ||
| 1432 | #define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB			0x20 | ||
| 1433 | #define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM			0x30 | ||
| 1434 | #define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM		0x40 | ||
| 1435 | #define BIND_OPCODE_SET_TYPE_IMM				0x50 | ||
| 1436 | #define BIND_OPCODE_SET_ADDEND_SLEB				0x60 | ||
| 1437 | #define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB			0x70 | ||
| 1438 | #define BIND_OPCODE_ADD_ADDR_ULEB				0x80 | ||
| 1439 | #define BIND_OPCODE_DO_BIND					0x90 | ||
| 1440 | #define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB			0xA0 | ||
| 1441 | #define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED			0xB0 | ||
| 1442 | #define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB		0xC0 | ||
| 1443 | #define	BIND_OPCODE_THREADED					0xD0 | ||
| 1444 | #define	BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB 0x00 | ||
| 1445 | #define	BIND_SUBOPCODE_THREADED_APPLY				 0x01 | ||
| 1446 | |||
| 1447 | |||
| 1448 | /* | ||
| 1449 | * The following are used on the flags byte of a terminal node | ||
| 1450 | * in the export information. | ||
| 1451 | */ | ||
| 1452 | #define EXPORT_SYMBOL_FLAGS_KIND_MASK				0x03 | ||
| 1453 | #define EXPORT_SYMBOL_FLAGS_KIND_REGULAR			0x00 | ||
| 1454 | #define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL			0x01 | ||
| 1455 | #define EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE			0x02 | ||
| 1456 | #define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION			0x04 | ||
| 1457 | #define EXPORT_SYMBOL_FLAGS_REEXPORT				0x08 | ||
| 1458 | #define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER			0x10 | ||
| 1459 | |||
| 1460 | /* | ||
| 1461 | * The linker_option_command contains linker options embedded in object files. | ||
| 1462 | */ | ||
| 1463 | struct linker_option_command { | ||
| 1464 | uint32_t cmd;	/* LC_LINKER_OPTION only used in MH_OBJECT filetypes */ | ||
| 1465 | uint32_t cmdsize; | ||
| 1466 | uint32_t count;	/* number of strings */ | ||
| 1467 | /* concatenation of zero terminated UTF8 strings. | ||
| 1468 | Zero filled at end to align */ | ||
| 1469 | }; | ||
| 1470 | |||
| 1471 | /* | ||
| 1472 | * The symseg_command contains the offset and size of the GNU style | ||
| 1473 | * symbol table information as described in the header file <symseg.h>. | ||
| 1474 | * The symbol roots of the symbol segments must also be aligned properly | ||
| 1475 | * in the file. So the requirement of keeping the offsets aligned to a | ||
| 1476 | * multiple of a 4 bytes translates to the length field of the symbol | ||
| 1477 | * roots also being a multiple of a long. Also the padding must again be | ||
| 1478 | * zeroed. (THIS IS OBSOLETE and no longer supported). | ||
| 1479 | */ | ||
| 1480 | struct symseg_command { | ||
| 1481 | 	uint32_t	cmd;		/* LC_SYMSEG */ | ||
| 1482 | 	uint32_t	cmdsize;	/* sizeof(struct symseg_command) */ | ||
| 1483 | 	uint32_t	offset;		/* symbol segment offset */ | ||
| 1484 | 	uint32_t	size;		/* symbol segment size in bytes */ | ||
| 1485 | }; | ||
| 1486 | |||
| 1487 | /* | ||
| 1488 | * The ident_command contains a free format string table following the | ||
| 1489 | * ident_command structure. The strings are null terminated and the size of | ||
| 1490 | * the command is padded out with zero bytes to a multiple of 4 bytes/ | ||
| 1491 | * (THIS IS OBSOLETE and no longer supported). | ||
| 1492 | */ | ||
| 1493 | struct ident_command { | ||
| 1494 | 	uint32_t cmd;		/* LC_IDENT */ | ||
| 1495 | 	uint32_t cmdsize;	/* strings that follow this command */ | ||
| 1496 | }; | ||
| 1497 | |||
| 1498 | /* | ||
| 1499 | * The fvmfile_command contains a reference to a file to be loaded at the | ||
| 1500 | * specified virtual address. (Presently, this command is reserved for | ||
| 1501 | * internal use. The kernel ignores this command when loading a program into | ||
| 1502 | * memory). | ||
| 1503 | */ | ||
| 1504 | struct fvmfile_command { | ||
| 1505 | 	uint32_t cmd;			/* LC_FVMFILE */ | ||
| 1506 | 	uint32_t cmdsize;		/* includes pathname string */ | ||
| 1507 | 	union lc_str	name;		/* files pathname */ | ||
| 1508 | 	uint32_t	header_addr;	/* files virtual address */ | ||
| 1509 | }; | ||
| 1510 | |||
| 1511 | |||
| 1512 | /* | ||
| 1513 | * The entry_point_command is a replacement for thread_command. | ||
| 1514 | * It is used for main executables to specify the location (file offset) | ||
| 1515 | * of main(). If -stack_size was used at link time, the stacksize | ||
| 1516 | * field will contain the stack size need for the main thread. | ||
| 1517 | */ | ||
| 1518 | struct entry_point_command { | ||
| 1519 | uint32_t cmd;	/* LC_MAIN only used in MH_EXECUTE filetypes */ | ||
| 1520 | uint32_t cmdsize;	/* 24 */ | ||
| 1521 | uint64_t entryoff;	/* file (__TEXT) offset of main() */ | ||
| 1522 | uint64_t stacksize;/* if not zero, initial stack size */ | ||
| 1523 | }; | ||
| 1524 | |||
| 1525 | |||
| 1526 | /* | ||
| 1527 | * The source_version_command is an optional load command containing | ||
| 1528 | * the version of the sources used to build the binary. | ||
| 1529 | */ | ||
| 1530 | struct source_version_command { | ||
| 1531 | uint32_t cmd;	/* LC_SOURCE_VERSION */ | ||
| 1532 | uint32_t cmdsize;	/* 16 */ | ||
| 1533 | uint64_t version;	/* A.B.C.D.E packed as a24.b10.c10.d10.e10 */ | ||
| 1534 | }; | ||
| 1535 | |||
| 1536 | |||
| 1537 | /* | ||
| 1538 | * The LC_DATA_IN_CODE load commands uses a linkedit_data_command | ||
| 1539 | * to point to an array of data_in_code_entry entries. Each entry | ||
| 1540 | * describes a range of data in a code section. | ||
| 1541 | */ | ||
| 1542 | struct data_in_code_entry { | ||
| 1543 | uint32_t	offset; /* from mach_header to start of data range*/ | ||
| 1544 | uint16_t	length; /* number of bytes in data range */ | ||
| 1545 | uint16_t	kind; /* a DICE_KIND_* value */ | ||
| 1546 | }; | ||
| 1547 | #define DICE_KIND_DATA 0x0001 | ||
| 1548 | #define DICE_KIND_JUMP_TABLE8 0x0002 | ||
| 1549 | #define DICE_KIND_JUMP_TABLE16 0x0003 | ||
| 1550 | #define DICE_KIND_JUMP_TABLE32 0x0004 | ||
| 1551 | #define DICE_KIND_ABS_JUMP_TABLE32 0x0005 | ||
| 1552 | |||
| 1553 | |||
| 1554 | |||
| 1555 | /* | ||
| 1556 | * Sections of type S_THREAD_LOCAL_VARIABLES contain an array | ||
| 1557 | * of tlv_descriptor structures. | ||
| 1558 | */ | ||
| 1559 | struct tlv_descriptor | ||
| 1560 | { | ||
| 1561 | 	void*		(*thunk)(struct tlv_descriptor*); | ||
| 1562 | 	unsigned long	key; | ||
| 1563 | 	unsigned long	offset; | ||
| 1564 | }; | ||
| 1565 | |||
| 1566 | /* | ||
| 1567 | * LC_NOTE commands describe a region of arbitrary data included in a Mach-O | ||
| 1568 | * file. Its initial use is to record extra data in MH_CORE files. | ||
| 1569 | */ | ||
| 1570 | struct note_command { | ||
| 1571 | uint32_t	cmd;		/* LC_NOTE */ | ||
| 1572 | uint32_t	cmdsize;	/* sizeof(struct note_command) */ | ||
| 1573 | char	data_owner[16];	/* owner name for this LC_NOTE */ | ||
| 1574 | uint64_t	offset;		/* file offset of this data */ | ||
| 1575 | uint64_t	size;		/* length of data region */ | ||
| 1576 | }; | ||
| 1577 | |||
| 1578 | /* | ||
| 1579 | * LC_FILESET_ENTRY commands describe constituent Mach-O files that are part | ||
| 1580 | * of a fileset. In one implementation, entries are dylibs with individual | ||
| 1581 | * mach headers and repositionable text and data segments. Each entry is | ||
| 1582 | * further described by its own mach header. | ||
| 1583 | */ | ||
| 1584 | struct fileset_entry_command { | ||
| 1585 | uint32_t cmd; /* LC_FILESET_ENTRY */ | ||
| 1586 | uint32_t cmdsize; /* includes entry_id string */ | ||
| 1587 | uint64_t vmaddr; /* memory address of the entry */ | ||
| 1588 | uint64_t fileoff; /* file offset of the entry */ | ||
| 1589 | union lc_str entry_id; /* contained entry id */ | ||
| 1590 | uint32_t reserved; /* reserved */ | ||
| 1591 | }; | ||
| 1592 | |||
| 1593 | /* | ||
| 1594 | * These deprecated values may still be used within Apple but are mechanically | ||
| 1595 | * removed from public API. The mechanical process may produce unusual results. | ||
| 1596 | */ | ||
| 1597 | #if (!defined(PLATFORM_MACCATALYST)) | ||
| 1598 | #define PLATFORM_MACCATALYST PLATFORM_MACCATALYST | ||
| 1599 | #endif | ||
| 1600 | |||
| 1601 | #endif /* _MACHO_LOADER_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/boolean.h created+88| ... | @@ -0,0 +1,88 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/boolean.h | ||
| 60 | * | ||
| 61 | *	Boolean data type. | ||
| 62 | * | ||
| 63 | */ | ||
| 64 | |||
| 65 | #ifndef _MACH_BOOLEAN_H_ | ||
| 66 | #define _MACH_BOOLEAN_H_ | ||
| 67 | |||
| 68 | /* | ||
| 69 | *	Pick up "boolean_t" type definition | ||
| 70 | */ | ||
| 71 | |||
| 72 | #ifndef ASSEMBLER | ||
| 73 | #include <mach/machine/boolean.h> | ||
| 74 | #endif /* ASSEMBLER */ | ||
| 75 | |||
| 76 | /* | ||
| 77 | *	Define TRUE and FALSE if not defined. | ||
| 78 | */ | ||
| 79 | |||
| 80 | #ifndef TRUE | ||
| 81 | #define TRUE 1 | ||
| 82 | #endif /* TRUE */ | ||
| 83 | |||
| 84 | #ifndef FALSE | ||
| 85 | #define FALSE 0 | ||
| 86 | #endif /* FALSE */ | ||
| 87 | |||
| 88 | #endif /* _MACH_BOOLEAN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/clock.h created+245| ... | @@ -0,0 +1,245 @@ | ||
| 1 | #ifndef	_clock_user_ | ||
| 2 | #define	_clock_user_ | ||
| 3 | |||
| 4 | /* Module clock */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	clock_MSG_COUNT | ||
| 52 | #define	clock_MSG_COUNT	3 | ||
| 53 | #endif	/* clock_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach/mach_types.h> | ||
| 60 | |||
| 61 | #ifdef __BeforeMigUserHeader | ||
| 62 | __BeforeMigUserHeader | ||
| 63 | #endif /* __BeforeMigUserHeader */ | ||
| 64 | |||
| 65 | #include <sys/cdefs.h> | ||
| 66 | __BEGIN_DECLS | ||
| 67 | |||
| 68 | |||
| 69 | /* Routine clock_get_time */ | ||
| 70 | #ifdef	mig_external | ||
| 71 | mig_external | ||
| 72 | #else | ||
| 73 | extern | ||
| 74 | #endif	/* mig_external */ | ||
| 75 | kern_return_t clock_get_time | ||
| 76 | ( | ||
| 77 | 	clock_serv_t clock_serv, | ||
| 78 | 	mach_timespec_t *cur_time | ||
| 79 | ); | ||
| 80 | |||
| 81 | /* Routine clock_get_attributes */ | ||
| 82 | #ifdef	mig_external | ||
| 83 | mig_external | ||
| 84 | #else | ||
| 85 | extern | ||
| 86 | #endif	/* mig_external */ | ||
| 87 | kern_return_t clock_get_attributes | ||
| 88 | ( | ||
| 89 | 	clock_serv_t clock_serv, | ||
| 90 | 	clock_flavor_t flavor, | ||
| 91 | 	clock_attr_t clock_attr, | ||
| 92 | 	mach_msg_type_number_t *clock_attrCnt | ||
| 93 | ); | ||
| 94 | |||
| 95 | /* Routine clock_alarm */ | ||
| 96 | #ifdef	mig_external | ||
| 97 | mig_external | ||
| 98 | #else | ||
| 99 | extern | ||
| 100 | #endif	/* mig_external */ | ||
| 101 | kern_return_t clock_alarm | ||
| 102 | ( | ||
| 103 | 	clock_serv_t clock_serv, | ||
| 104 | 	alarm_type_t alarm_type, | ||
| 105 | 	mach_timespec_t alarm_time, | ||
| 106 | 	clock_reply_t alarm_port | ||
| 107 | ); | ||
| 108 | |||
| 109 | __END_DECLS | ||
| 110 | |||
| 111 | /********************** Caution **************************/ | ||
| 112 | /* The following data types should be used to calculate */ | ||
| 113 | /* maximum message sizes only. The actual message may be */ | ||
| 114 | /* smaller, and the position of the arguments within the */ | ||
| 115 | /* message layout may vary from what is presented here. */ | ||
| 116 | /* For example, if any of the arguments are variable- */ | ||
| 117 | /* sized, and less than the maximum is sent, the data */ | ||
| 118 | /* will be packed tight in the actual message to reduce */ | ||
| 119 | /* the presence of holes. */ | ||
| 120 | /********************** Caution **************************/ | ||
| 121 | |||
| 122 | /* typedefs for all requests */ | ||
| 123 | |||
| 124 | #ifndef __Request__clock_subsystem__defined | ||
| 125 | #define __Request__clock_subsystem__defined | ||
| 126 | |||
| 127 | #ifdef __MigPackStructs | ||
| 128 | #pragma pack(push, 4) | ||
| 129 | #endif | ||
| 130 | 	typedef struct { | ||
| 131 | 		mach_msg_header_t Head; | ||
| 132 | 	} __Request__clock_get_time_t __attribute__((unused)); | ||
| 133 | #ifdef __MigPackStructs | ||
| 134 | #pragma pack(pop) | ||
| 135 | #endif | ||
| 136 | |||
| 137 | #ifdef __MigPackStructs | ||
| 138 | #pragma pack(push, 4) | ||
| 139 | #endif | ||
| 140 | 	typedef struct { | ||
| 141 | 		mach_msg_header_t Head; | ||
| 142 | 		NDR_record_t NDR; | ||
| 143 | 		clock_flavor_t flavor; | ||
| 144 | 		mach_msg_type_number_t clock_attrCnt; | ||
| 145 | 	} __Request__clock_get_attributes_t __attribute__((unused)); | ||
| 146 | #ifdef __MigPackStructs | ||
| 147 | #pragma pack(pop) | ||
| 148 | #endif | ||
| 149 | |||
| 150 | #ifdef __MigPackStructs | ||
| 151 | #pragma pack(push, 4) | ||
| 152 | #endif | ||
| 153 | 	typedef struct { | ||
| 154 | 		mach_msg_header_t Head; | ||
| 155 | 		/* start of the kernel processed data */ | ||
| 156 | 		mach_msg_body_t msgh_body; | ||
| 157 | 		mach_msg_port_descriptor_t alarm_port; | ||
| 158 | 		/* end of the kernel processed data */ | ||
| 159 | 		NDR_record_t NDR; | ||
| 160 | 		alarm_type_t alarm_type; | ||
| 161 | 		mach_timespec_t alarm_time; | ||
| 162 | 	} __Request__clock_alarm_t __attribute__((unused)); | ||
| 163 | #ifdef __MigPackStructs | ||
| 164 | #pragma pack(pop) | ||
| 165 | #endif | ||
| 166 | #endif /* !__Request__clock_subsystem__defined */ | ||
| 167 | |||
| 168 | /* union of all requests */ | ||
| 169 | |||
| 170 | #ifndef __RequestUnion__clock_subsystem__defined | ||
| 171 | #define __RequestUnion__clock_subsystem__defined | ||
| 172 | union __RequestUnion__clock_subsystem { | ||
| 173 | 	__Request__clock_get_time_t Request_clock_get_time; | ||
| 174 | 	__Request__clock_get_attributes_t Request_clock_get_attributes; | ||
| 175 | 	__Request__clock_alarm_t Request_clock_alarm; | ||
| 176 | }; | ||
| 177 | #endif /* !__RequestUnion__clock_subsystem__defined */ | ||
| 178 | /* typedefs for all replies */ | ||
| 179 | |||
| 180 | #ifndef __Reply__clock_subsystem__defined | ||
| 181 | #define __Reply__clock_subsystem__defined | ||
| 182 | |||
| 183 | #ifdef __MigPackStructs | ||
| 184 | #pragma pack(push, 4) | ||
| 185 | #endif | ||
| 186 | 	typedef struct { | ||
| 187 | 		mach_msg_header_t Head; | ||
| 188 | 		NDR_record_t NDR; | ||
| 189 | 		kern_return_t RetCode; | ||
| 190 | 		mach_timespec_t cur_time; | ||
| 191 | 	} __Reply__clock_get_time_t __attribute__((unused)); | ||
| 192 | #ifdef __MigPackStructs | ||
| 193 | #pragma pack(pop) | ||
| 194 | #endif | ||
| 195 | |||
| 196 | #ifdef __MigPackStructs | ||
| 197 | #pragma pack(push, 4) | ||
| 198 | #endif | ||
| 199 | 	typedef struct { | ||
| 200 | 		mach_msg_header_t Head; | ||
| 201 | 		NDR_record_t NDR; | ||
| 202 | 		kern_return_t RetCode; | ||
| 203 | 		mach_msg_type_number_t clock_attrCnt; | ||
| 204 | 		int clock_attr[1]; | ||
| 205 | 	} __Reply__clock_get_attributes_t __attribute__((unused)); | ||
| 206 | #ifdef __MigPackStructs | ||
| 207 | #pragma pack(pop) | ||
| 208 | #endif | ||
| 209 | |||
| 210 | #ifdef __MigPackStructs | ||
| 211 | #pragma pack(push, 4) | ||
| 212 | #endif | ||
| 213 | 	typedef struct { | ||
| 214 | 		mach_msg_header_t Head; | ||
| 215 | 		NDR_record_t NDR; | ||
| 216 | 		kern_return_t RetCode; | ||
| 217 | 	} __Reply__clock_alarm_t __attribute__((unused)); | ||
| 218 | #ifdef __MigPackStructs | ||
| 219 | #pragma pack(pop) | ||
| 220 | #endif | ||
| 221 | #endif /* !__Reply__clock_subsystem__defined */ | ||
| 222 | |||
| 223 | /* union of all replies */ | ||
| 224 | |||
| 225 | #ifndef __ReplyUnion__clock_subsystem__defined | ||
| 226 | #define __ReplyUnion__clock_subsystem__defined | ||
| 227 | union __ReplyUnion__clock_subsystem { | ||
| 228 | 	__Reply__clock_get_time_t Reply_clock_get_time; | ||
| 229 | 	__Reply__clock_get_attributes_t Reply_clock_get_attributes; | ||
| 230 | 	__Reply__clock_alarm_t Reply_clock_alarm; | ||
| 231 | }; | ||
| 232 | #endif /* !__RequestUnion__clock_subsystem__defined */ | ||
| 233 | |||
| 234 | #ifndef subsystem_to_name_map_clock | ||
| 235 | #define subsystem_to_name_map_clock \ | ||
| 236 | { "clock_get_time", 1000 },\ | ||
| 237 | { "clock_get_attributes", 1001 },\ | ||
| 238 | { "clock_alarm", 1002 } | ||
| 239 | #endif | ||
| 240 | |||
| 241 | #ifdef __AfterMigUserHeader | ||
| 242 | __AfterMigUserHeader | ||
| 243 | #endif /* __AfterMigUserHeader */ | ||
| 244 | |||
| 245 | #endif	 /* _clock_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/clock_priv.h created+199| ... | @@ -0,0 +1,199 @@ | ||
| 1 | #ifndef	_clock_priv_user_ | ||
| 2 | #define	_clock_priv_user_ | ||
| 3 | |||
| 4 | /* Module clock_priv */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	clock_priv_MSG_COUNT | ||
| 52 | #define	clock_priv_MSG_COUNT	2 | ||
| 53 | #endif	/* clock_priv_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach/mach_types.h> | ||
| 60 | |||
| 61 | #ifdef __BeforeMigUserHeader | ||
| 62 | __BeforeMigUserHeader | ||
| 63 | #endif /* __BeforeMigUserHeader */ | ||
| 64 | |||
| 65 | #include <sys/cdefs.h> | ||
| 66 | __BEGIN_DECLS | ||
| 67 | |||
| 68 | |||
| 69 | /* Routine clock_set_time */ | ||
| 70 | #ifdef	mig_external | ||
| 71 | mig_external | ||
| 72 | #else | ||
| 73 | extern | ||
| 74 | #endif	/* mig_external */ | ||
| 75 | kern_return_t clock_set_time | ||
| 76 | ( | ||
| 77 | 	clock_ctrl_t clock_ctrl, | ||
| 78 | 	mach_timespec_t new_time | ||
| 79 | ); | ||
| 80 | |||
| 81 | /* Routine clock_set_attributes */ | ||
| 82 | #ifdef	mig_external | ||
| 83 | mig_external | ||
| 84 | #else | ||
| 85 | extern | ||
| 86 | #endif	/* mig_external */ | ||
| 87 | kern_return_t clock_set_attributes | ||
| 88 | ( | ||
| 89 | 	clock_ctrl_t clock_ctrl, | ||
| 90 | 	clock_flavor_t flavor, | ||
| 91 | 	clock_attr_t clock_attr, | ||
| 92 | 	mach_msg_type_number_t clock_attrCnt | ||
| 93 | ); | ||
| 94 | |||
| 95 | __END_DECLS | ||
| 96 | |||
| 97 | /********************** Caution **************************/ | ||
| 98 | /* The following data types should be used to calculate */ | ||
| 99 | /* maximum message sizes only. The actual message may be */ | ||
| 100 | /* smaller, and the position of the arguments within the */ | ||
| 101 | /* message layout may vary from what is presented here. */ | ||
| 102 | /* For example, if any of the arguments are variable- */ | ||
| 103 | /* sized, and less than the maximum is sent, the data */ | ||
| 104 | /* will be packed tight in the actual message to reduce */ | ||
| 105 | /* the presence of holes. */ | ||
| 106 | /********************** Caution **************************/ | ||
| 107 | |||
| 108 | /* typedefs for all requests */ | ||
| 109 | |||
| 110 | #ifndef __Request__clock_priv_subsystem__defined | ||
| 111 | #define __Request__clock_priv_subsystem__defined | ||
| 112 | |||
| 113 | #ifdef __MigPackStructs | ||
| 114 | #pragma pack(push, 4) | ||
| 115 | #endif | ||
| 116 | 	typedef struct { | ||
| 117 | 		mach_msg_header_t Head; | ||
| 118 | 		NDR_record_t NDR; | ||
| 119 | 		mach_timespec_t new_time; | ||
| 120 | 	} __Request__clock_set_time_t __attribute__((unused)); | ||
| 121 | #ifdef __MigPackStructs | ||
| 122 | #pragma pack(pop) | ||
| 123 | #endif | ||
| 124 | |||
| 125 | #ifdef __MigPackStructs | ||
| 126 | #pragma pack(push, 4) | ||
| 127 | #endif | ||
| 128 | 	typedef struct { | ||
| 129 | 		mach_msg_header_t Head; | ||
| 130 | 		NDR_record_t NDR; | ||
| 131 | 		clock_flavor_t flavor; | ||
| 132 | 		mach_msg_type_number_t clock_attrCnt; | ||
| 133 | 		int clock_attr[1]; | ||
| 134 | 	} __Request__clock_set_attributes_t __attribute__((unused)); | ||
| 135 | #ifdef __MigPackStructs | ||
| 136 | #pragma pack(pop) | ||
| 137 | #endif | ||
| 138 | #endif /* !__Request__clock_priv_subsystem__defined */ | ||
| 139 | |||
| 140 | /* union of all requests */ | ||
| 141 | |||
| 142 | #ifndef __RequestUnion__clock_priv_subsystem__defined | ||
| 143 | #define __RequestUnion__clock_priv_subsystem__defined | ||
| 144 | union __RequestUnion__clock_priv_subsystem { | ||
| 145 | 	__Request__clock_set_time_t Request_clock_set_time; | ||
| 146 | 	__Request__clock_set_attributes_t Request_clock_set_attributes; | ||
| 147 | }; | ||
| 148 | #endif /* !__RequestUnion__clock_priv_subsystem__defined */ | ||
| 149 | /* typedefs for all replies */ | ||
| 150 | |||
| 151 | #ifndef __Reply__clock_priv_subsystem__defined | ||
| 152 | #define __Reply__clock_priv_subsystem__defined | ||
| 153 | |||
| 154 | #ifdef __MigPackStructs | ||
| 155 | #pragma pack(push, 4) | ||
| 156 | #endif | ||
| 157 | 	typedef struct { | ||
| 158 | 		mach_msg_header_t Head; | ||
| 159 | 		NDR_record_t NDR; | ||
| 160 | 		kern_return_t RetCode; | ||
| 161 | 	} __Reply__clock_set_time_t __attribute__((unused)); | ||
| 162 | #ifdef __MigPackStructs | ||
| 163 | #pragma pack(pop) | ||
| 164 | #endif | ||
| 165 | |||
| 166 | #ifdef __MigPackStructs | ||
| 167 | #pragma pack(push, 4) | ||
| 168 | #endif | ||
| 169 | 	typedef struct { | ||
| 170 | 		mach_msg_header_t Head; | ||
| 171 | 		NDR_record_t NDR; | ||
| 172 | 		kern_return_t RetCode; | ||
| 173 | 	} __Reply__clock_set_attributes_t __attribute__((unused)); | ||
| 174 | #ifdef __MigPackStructs | ||
| 175 | #pragma pack(pop) | ||
| 176 | #endif | ||
| 177 | #endif /* !__Reply__clock_priv_subsystem__defined */ | ||
| 178 | |||
| 179 | /* union of all replies */ | ||
| 180 | |||
| 181 | #ifndef __ReplyUnion__clock_priv_subsystem__defined | ||
| 182 | #define __ReplyUnion__clock_priv_subsystem__defined | ||
| 183 | union __ReplyUnion__clock_priv_subsystem { | ||
| 184 | 	__Reply__clock_set_time_t Reply_clock_set_time; | ||
| 185 | 	__Reply__clock_set_attributes_t Reply_clock_set_attributes; | ||
| 186 | }; | ||
| 187 | #endif /* !__RequestUnion__clock_priv_subsystem__defined */ | ||
| 188 | |||
| 189 | #ifndef subsystem_to_name_map_clock_priv | ||
| 190 | #define subsystem_to_name_map_clock_priv \ | ||
| 191 | { "clock_set_time", 1200 },\ | ||
| 192 | { "clock_set_attributes", 1201 } | ||
| 193 | #endif | ||
| 194 | |||
| 195 | #ifdef __AfterMigUserHeader | ||
| 196 | __AfterMigUserHeader | ||
| 197 | #endif /* __AfterMigUserHeader */ | ||
| 198 | |||
| 199 | #endif	 /* _clock_priv_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/clock_types.h created+127| ... | @@ -0,0 +1,127 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | *	File:		clock_types.h | ||
| 33 | *	Purpose:	Clock facility header definitions. These | ||
| 34 | *				definitons are needed by both kernel and | ||
| 35 | *				user-level software. | ||
| 36 | */ | ||
| 37 | |||
| 38 | /* | ||
| 39 | *	All interfaces defined here are obsolete. | ||
| 40 | */ | ||
| 41 | |||
| 42 | #ifndef _MACH_CLOCK_TYPES_H_ | ||
| 43 | #define _MACH_CLOCK_TYPES_H_ | ||
| 44 | |||
| 45 | #include <stdint.h> | ||
| 46 | #include <mach/time_value.h> | ||
| 47 | |||
| 48 | /* | ||
| 49 | * Type definitions. | ||
| 50 | */ | ||
| 51 | typedef int alarm_type_t; /* alarm time type */ | ||
| 52 | typedef int sleep_type_t; /* sleep time type */ | ||
| 53 | typedef int clock_id_t; /* clock identification type */ | ||
| 54 | typedef int clock_flavor_t; /* clock flavor type */ | ||
| 55 | typedef int *clock_attr_t; /* clock attribute type */ | ||
| 56 | typedef int clock_res_t; /* clock resolution type */ | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Normal time specification used by the kernel clock facility. | ||
| 60 | */ | ||
| 61 | struct mach_timespec { | ||
| 62 | 	unsigned int tv_sec; /* seconds */ | ||
| 63 | 	clock_res_t tv_nsec; /* nanoseconds */ | ||
| 64 | }; | ||
| 65 | typedef struct mach_timespec mach_timespec_t; | ||
| 66 | |||
| 67 | /* | ||
| 68 | * Reserved clock id values for default clocks. | ||
| 69 | */ | ||
| 70 | #define SYSTEM_CLOCK 0 | ||
| 71 | #define CALENDAR_CLOCK 1 | ||
| 72 | |||
| 73 | #define REALTIME_CLOCK 0 | ||
| 74 | |||
| 75 | /* | ||
| 76 | * Attribute names. | ||
| 77 | */ | ||
| 78 | #define CLOCK_GET_TIME_RES 1 /* get_time call resolution */ | ||
| 79 | /*							2	 * was map_time call resolution */ | ||
| 80 | #define CLOCK_ALARM_CURRES 3 /* current alarm resolution */ | ||
| 81 | #define CLOCK_ALARM_MINRES 4 /* minimum alarm resolution */ | ||
| 82 | #define CLOCK_ALARM_MAXRES 5 /* maximum alarm resolution */ | ||
| 83 | |||
| 84 | #define NSEC_PER_USEC 1000ull /* nanoseconds per microsecond */ | ||
| 85 | #define USEC_PER_SEC 1000000ull /* microseconds per second */ | ||
| 86 | #define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */ | ||
| 87 | #define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */ | ||
| 88 | |||
| 89 | #define BAD_MACH_TIMESPEC(t) \ | ||
| 90 | 	((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC) | ||
| 91 | |||
| 92 | /* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */ | ||
| 93 | #define CMP_MACH_TIMESPEC(t1, t2) \ | ||
| 94 | 	((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \ | ||
| 95 | 	((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \ | ||
| 96 | 	 (t1)->tv_nsec - (t2)->tv_nsec)) | ||
| 97 | |||
| 98 | /* t1 += t2 */ | ||
| 99 | #define ADD_MACH_TIMESPEC(t1, t2) \ | ||
| 100 | do { \ | ||
| 101 | 	if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \ | ||
| 102 | 	 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \ | ||
| 103 | 	 (t1)->tv_sec += 1; \ | ||
| 104 | 	} \ | ||
| 105 | 	(t1)->tv_sec += (t2)->tv_sec; \ | ||
| 106 | } while (0) | ||
| 107 | |||
| 108 | /* t1 -= t2 */ | ||
| 109 | #define SUB_MACH_TIMESPEC(t1, t2) \ | ||
| 110 | do { \ | ||
| 111 | 	if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \ | ||
| 112 | 	 (t1)->tv_nsec += (long) NSEC_PER_SEC; \ | ||
| 113 | 	 (t1)->tv_sec -= 1; \ | ||
| 114 | 	} \ | ||
| 115 | 	(t1)->tv_sec -= (t2)->tv_sec; \ | ||
| 116 | } while (0) | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Alarm parameter defines. | ||
| 120 | */ | ||
| 121 | #define ALRMTYPE 0xff /* type (8-bit field)	*/ | ||
| 122 | #define TIME_ABSOLUTE 0x00 /* absolute time */ | ||
| 123 | #define TIME_RELATIVE 0x01 /* relative time */ | ||
| 124 | |||
| 125 | #define BAD_ALRMTYPE(t) (((t) &~ TIME_RELATIVE) != 0) | ||
| 126 | |||
| 127 | #endif /* _MACH_CLOCK_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/dyld_kernel.h created+66| ... | @@ -0,0 +1,66 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2016 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_DYLIB_INFO_H_ | ||
| 30 | #define _MACH_DYLIB_INFO_H_ | ||
| 31 | |||
| 32 | #include <mach/boolean.h> | ||
| 33 | #include <stdint.h> | ||
| 34 | #include <sys/_types/_fsid_t.h> | ||
| 35 | #include <sys/_types/_u_int32_t.h> | ||
| 36 | #include <sys/_types/_fsobj_id_t.h> | ||
| 37 | #include <sys/_types/_uuid_t.h> | ||
| 38 | |||
| 39 | /* These definitions must be kept in sync with the ones in | ||
| 40 | * osfmk/mach/mach_types.defs. | ||
| 41 | */ | ||
| 42 | |||
| 43 | struct dyld_kernel_image_info { | ||
| 44 | 	uuid_t uuid; | ||
| 45 | 	fsobj_id_t fsobjid; | ||
| 46 | 	fsid_t fsid; | ||
| 47 | 	uint64_t load_addr; | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct dyld_kernel_process_info { | ||
| 51 | 	struct dyld_kernel_image_info cache_image_info; | ||
| 52 | 	uint64_t timestamp; // mach_absolute_time of last time dyld change to image list | ||
| 53 | 	uint32_t imageCount; // number of images currently loaded into process | ||
| 54 | 	uint32_t initialImageCount; // number of images statically loaded into process (before any dlopen() calls) | ||
| 55 | 	uint8_t dyldState; // one of dyld_process_state_* values | ||
| 56 | 	boolean_t no_cache; // process is running without a dyld cache | ||
| 57 | 	boolean_t private_cache; // process is using a private copy of its dyld cache | ||
| 58 | }; | ||
| 59 | |||
| 60 | /* typedefs so our MIG is sane */ | ||
| 61 | |||
| 62 | typedef struct dyld_kernel_image_info dyld_kernel_image_info_t; | ||
| 63 | typedef struct dyld_kernel_process_info dyld_kernel_process_info_t; | ||
| 64 | typedef dyld_kernel_image_info_t *dyld_kernel_image_info_array_t; | ||
| 65 | |||
| 66 | #endif /* _MACH_DYLIB_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/error.h created+114| ... | @@ -0,0 +1,114 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | * File:	mach/error.h | ||
| 60 | * Purpose: | ||
| 61 | *	error module definitions | ||
| 62 | * | ||
| 63 | */ | ||
| 64 | |||
| 65 | #ifndef _MACH_ERROR_H_ | ||
| 66 | #define _MACH_ERROR_H_ | ||
| 67 | |||
| 68 | #include <mach/kern_return.h> | ||
| 69 | |||
| 70 | /* | ||
| 71 | *	error number layout as follows: | ||
| 72 | * | ||
| 73 | *	hi		 lo | ||
| 74 | *	| system(6) | subsystem(12) | code(14) | | ||
| 75 | */ | ||
| 76 | |||
| 77 | |||
| 78 | #define err_none (mach_error_t)0 | ||
| 79 | #define ERR_SUCCESS (mach_error_t)0 | ||
| 80 | #define ERR_ROUTINE_NIL (mach_error_fn_t)0 | ||
| 81 | |||
| 82 | |||
| 83 | #define err_system(x) ((signed)((((unsigned)(x))&0x3f)<<26)) | ||
| 84 | #define err_sub(x) (((x)&0xfff)<<14) | ||
| 85 | |||
| 86 | #define err_get_system(err) (((err)>>26)&0x3f) | ||
| 87 | #define err_get_sub(err) (((err)>>14)&0xfff) | ||
| 88 | #define err_get_code(err) ((err)&0x3fff) | ||
| 89 | |||
| 90 | #define system_emask (err_system(0x3f)) | ||
| 91 | #define sub_emask (err_sub(0xfff)) | ||
| 92 | #define code_emask (0x3fff) | ||
| 93 | |||
| 94 | |||
| 95 | /*	major error systems	*/ | ||
| 96 | #define err_kern err_system(0x0) /* kernel */ | ||
| 97 | #define err_us err_system(0x1) /* user space library */ | ||
| 98 | #define err_server err_system(0x2) /* user space servers */ | ||
| 99 | #define err_ipc err_system(0x3) /* old ipc errors */ | ||
| 100 | #define err_mach_ipc err_system(0x4) /* mach-ipc errors */ | ||
| 101 | #define err_dipc err_system(0x7) /* distributed ipc */ | ||
| 102 | #define err_local err_system(0x3e) /* user defined errors */ | ||
| 103 | #define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */ | ||
| 104 | |||
| 105 | #define err_max_system 0x3f | ||
| 106 | |||
| 107 | |||
| 108 | /*	unix errors get lumped into one subsystem */ | ||
| 109 | #define unix_err(errno) (err_kern|err_sub(3)|errno) | ||
| 110 | |||
| 111 | typedef kern_return_t mach_error_t; | ||
| 112 | typedef mach_error_t (* mach_error_fn_t)( void ); | ||
| 113 | |||
| 114 | #endif /* _MACH_ERROR_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/exception_types.h created+204| ... | @@ -0,0 +1,204 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_EXCEPTION_TYPES_H_ | ||
| 60 | #define _MACH_EXCEPTION_TYPES_H_ | ||
| 61 | |||
| 62 | #include <mach/machine/exception.h> | ||
| 63 | |||
| 64 | /* | ||
| 65 | *	Machine-independent exception definitions. | ||
| 66 | */ | ||
| 67 | |||
| 68 | #define EXC_BAD_ACCESS 1 /* Could not access memory */ | ||
| 69 | /* Code contains kern_return_t describing error. */ | ||
| 70 | /* Subcode contains bad memory address. */ | ||
| 71 | |||
| 72 | #define EXC_BAD_INSTRUCTION 2 /* Instruction failed */ | ||
| 73 | /* Illegal or undefined instruction or operand */ | ||
| 74 | |||
| 75 | #define EXC_ARITHMETIC 3 /* Arithmetic exception */ | ||
| 76 | /* Exact nature of exception is in code field */ | ||
| 77 | |||
| 78 | #define EXC_EMULATION 4 /* Emulation instruction */ | ||
| 79 | /* Emulation support instruction encountered */ | ||
| 80 | /* Details in code and subcode fields	*/ | ||
| 81 | |||
| 82 | #define EXC_SOFTWARE 5 /* Software generated exception */ | ||
| 83 | /* Exact exception is in code field. */ | ||
| 84 | /* Codes 0 - 0xFFFF reserved to hardware */ | ||
| 85 | /* Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) */ | ||
| 86 | |||
| 87 | #define EXC_BREAKPOINT 6 /* Trace, breakpoint, etc. */ | ||
| 88 | /* Details in code field. */ | ||
| 89 | |||
| 90 | #define EXC_SYSCALL 7 /* System calls. */ | ||
| 91 | |||
| 92 | #define EXC_MACH_SYSCALL 8 /* Mach system calls. */ | ||
| 93 | |||
| 94 | #define EXC_RPC_ALERT 9 /* RPC alert */ | ||
| 95 | |||
| 96 | #define EXC_CRASH 10 /* Abnormal process exit */ | ||
| 97 | |||
| 98 | #define EXC_RESOURCE 11 /* Hit resource consumption limit */ | ||
| 99 | /* Exact resource is in code field. */ | ||
| 100 | |||
| 101 | #define EXC_GUARD 12 /* Violated guarded resource protections */ | ||
| 102 | |||
| 103 | #define EXC_CORPSE_NOTIFY 13 /* Abnormal process exited to corpse state */ | ||
| 104 | |||
| 105 | #define EXC_CORPSE_VARIANT_BIT 0x100 /* bit set for EXC_*_CORPSE variants of EXC_* */ | ||
| 106 | |||
| 107 | |||
| 108 | /* | ||
| 109 | *	Machine-independent exception behaviors | ||
| 110 | */ | ||
| 111 | |||
| 112 | # define EXCEPTION_DEFAULT 1 | ||
| 113 | /*	Send a catch_exception_raise message including the identity. | ||
| 114 | */ | ||
| 115 | |||
| 116 | # define EXCEPTION_STATE 2 | ||
| 117 | /*	Send a catch_exception_raise_state message including the | ||
| 118 | *	thread state. | ||
| 119 | */ | ||
| 120 | |||
| 121 | # define EXCEPTION_STATE_IDENTITY 3 | ||
| 122 | /*	Send a catch_exception_raise_state_identity message including | ||
| 123 | *	the thread identity and state. | ||
| 124 | */ | ||
| 125 | |||
| 126 | #define MACH_EXCEPTION_ERRORS 0x40000000 | ||
| 127 | /*	include additional exception specific errors, not used yet. */ | ||
| 128 | |||
| 129 | #define MACH_EXCEPTION_CODES 0x80000000 | ||
| 130 | /*	Send 64-bit code and subcode in the exception header */ | ||
| 131 | |||
| 132 | #define MACH_EXCEPTION_MASK (MACH_EXCEPTION_CODES | MACH_EXCEPTION_ERRORS) | ||
| 133 | /* | ||
| 134 | * Masks for exception definitions, above | ||
| 135 | * bit zero is unused, therefore 1 word = 31 exception types | ||
| 136 | */ | ||
| 137 | |||
| 138 | #define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS) | ||
| 139 | #define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION) | ||
| 140 | #define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC) | ||
| 141 | #define EXC_MASK_EMULATION (1 << EXC_EMULATION) | ||
| 142 | #define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE) | ||
| 143 | #define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT) | ||
| 144 | #define EXC_MASK_SYSCALL (1 << EXC_SYSCALL) | ||
| 145 | #define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL) | ||
| 146 | #define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT) | ||
| 147 | #define EXC_MASK_CRASH (1 << EXC_CRASH) | ||
| 148 | #define EXC_MASK_RESOURCE (1 << EXC_RESOURCE) | ||
| 149 | #define EXC_MASK_GUARD (1 << EXC_GUARD) | ||
| 150 | #define EXC_MASK_CORPSE_NOTIFY (1 << EXC_CORPSE_NOTIFY) | ||
| 151 | |||
| 152 | #define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | \ | ||
| 153 | 	 EXC_MASK_BAD_INSTRUCTION | \ | ||
| 154 | 	 EXC_MASK_ARITHMETIC | \ | ||
| 155 | 	 EXC_MASK_EMULATION | \ | ||
| 156 | 	 EXC_MASK_SOFTWARE | \ | ||
| 157 | 	 EXC_MASK_BREAKPOINT | \ | ||
| 158 | 	 EXC_MASK_SYSCALL | \ | ||
| 159 | 	 EXC_MASK_MACH_SYSCALL | \ | ||
| 160 | 	 EXC_MASK_RPC_ALERT | \ | ||
| 161 | 	 EXC_MASK_RESOURCE | \ | ||
| 162 | 	 EXC_MASK_GUARD | \ | ||
| 163 | 	 EXC_MASK_MACHINE) | ||
| 164 | |||
| 165 | |||
| 166 | #define FIRST_EXCEPTION 1 /* ZERO is illegal */ | ||
| 167 | |||
| 168 | /* | ||
| 169 | * Machine independent codes for EXC_SOFTWARE | ||
| 170 | * Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) | ||
| 171 | * 0x10000 - 0x10002 in use for unix signals | ||
| 172 | * 0x20000 - 0x2FFFF reserved for MACF | ||
| 173 | */ | ||
| 174 | #define EXC_SOFT_SIGNAL 0x10003 /* Unix signal exceptions */ | ||
| 175 | |||
| 176 | #define EXC_MACF_MIN 0x20000 /* MACF exceptions */ | ||
| 177 | #define EXC_MACF_MAX 0x2FFFF | ||
| 178 | |||
| 179 | #ifndef ASSEMBLER | ||
| 180 | |||
| 181 | #include <mach/port.h> | ||
| 182 | #include <mach/thread_status.h> | ||
| 183 | #include <mach/machine/vm_types.h> | ||
| 184 | /* | ||
| 185 | * Exported types | ||
| 186 | */ | ||
| 187 | |||
| 188 | typedef int exception_type_t; | ||
| 189 | typedef integer_t exception_data_type_t; | ||
| 190 | typedef int64_t mach_exception_data_type_t; | ||
| 191 | typedef int exception_behavior_t; | ||
| 192 | typedef exception_data_type_t *exception_data_t; | ||
| 193 | typedef mach_exception_data_type_t *mach_exception_data_t; | ||
| 194 | typedef unsigned int exception_mask_t; | ||
| 195 | typedef exception_mask_t *exception_mask_array_t; | ||
| 196 | typedef exception_behavior_t *exception_behavior_array_t; | ||
| 197 | typedef thread_state_flavor_t *exception_flavor_array_t; | ||
| 198 | typedef mach_port_t *exception_port_array_t; | ||
| 199 | typedef mach_exception_data_type_t mach_exception_code_t; | ||
| 200 | typedef mach_exception_data_type_t mach_exception_subcode_t; | ||
| 201 | |||
| 202 | #endif /* ASSEMBLER */ | ||
| 203 | |||
| 204 | #endif /* _MACH_EXCEPTION_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/host_info.h created+260| ... | @@ -0,0 +1,260 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2015 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | |||
| 57 | /* | ||
| 58 | *	File:	mach/host_info.h | ||
| 59 | * | ||
| 60 | *	Definitions for host_info call. | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _MACH_HOST_INFO_H_ | ||
| 64 | #define _MACH_HOST_INFO_H_ | ||
| 65 | |||
| 66 | #include <mach/message.h> | ||
| 67 | #include <mach/vm_statistics.h> | ||
| 68 | #include <mach/machine.h> | ||
| 69 | #include <mach/machine/vm_types.h> | ||
| 70 | #include <mach/time_value.h> | ||
| 71 | |||
| 72 | #include <sys/cdefs.h> | ||
| 73 | |||
| 74 | /* | ||
| 75 | *	Generic information structure to allow for expansion. | ||
| 76 | */ | ||
| 77 | typedef integer_t *host_info_t; /* varying array of int. */ | ||
| 78 | typedef integer_t *host_info64_t; /* varying array of int. */ | ||
| 79 | |||
| 80 | #define HOST_INFO_MAX (1024) /* max array size */ | ||
| 81 | typedef integer_t host_info_data_t[HOST_INFO_MAX]; | ||
| 82 | |||
| 83 | #define KERNEL_VERSION_MAX (512) | ||
| 84 | typedef char kernel_version_t[KERNEL_VERSION_MAX]; | ||
| 85 | |||
| 86 | #define KERNEL_BOOT_INFO_MAX (4096) | ||
| 87 | typedef char kernel_boot_info_t[KERNEL_BOOT_INFO_MAX]; | ||
| 88 | |||
| 89 | /* | ||
| 90 | *	Currently defined information. | ||
| 91 | */ | ||
| 92 | /* host_info() */ | ||
| 93 | typedef integer_t host_flavor_t; | ||
| 94 | #define HOST_BASIC_INFO 1 /* basic info */ | ||
| 95 | #define HOST_SCHED_INFO 3 /* scheduling info */ | ||
| 96 | #define HOST_RESOURCE_SIZES 4 /* kernel struct sizes */ | ||
| 97 | #define HOST_PRIORITY_INFO 5 /* priority information */ | ||
| 98 | #define HOST_SEMAPHORE_TRAPS 7 /* Has semaphore traps */ | ||
| 99 | #define HOST_MACH_MSG_TRAP 8 /* Has mach_msg_trap */ | ||
| 100 | #define HOST_VM_PURGABLE 9 /* purg'e'able memory info */ | ||
| 101 | #define HOST_DEBUG_INFO_INTERNAL 10 /* Used for kernel internal development tests only */ | ||
| 102 | #define HOST_CAN_HAS_DEBUGGER 11 | ||
| 103 | #define HOST_PREFERRED_USER_ARCH 12 /* Get the preferred user-space architecture */ | ||
| 104 | |||
| 105 | |||
| 106 | struct host_can_has_debugger_info { | ||
| 107 | 	boolean_t can_has_debugger; | ||
| 108 | }; | ||
| 109 | typedef struct host_can_has_debugger_info host_can_has_debugger_info_data_t; | ||
| 110 | typedef struct host_can_has_debugger_info *host_can_has_debugger_info_t; | ||
| 111 | #define HOST_CAN_HAS_DEBUGGER_COUNT ((mach_msg_type_number_t) \ | ||
| 112 | 	 (sizeof(host_can_has_debugger_info_data_t)/sizeof(integer_t))) | ||
| 113 | |||
| 114 | #pragma pack(push, 4) | ||
| 115 | |||
| 116 | struct host_basic_info { | ||
| 117 | 	integer_t max_cpus; /* max number of CPUs possible */ | ||
| 118 | 	integer_t avail_cpus; /* number of CPUs now available */ | ||
| 119 | 	natural_t memory_size; /* size of memory in bytes, capped at 2 GB */ | ||
| 120 | 	cpu_type_t cpu_type; /* cpu type */ | ||
| 121 | 	cpu_subtype_t cpu_subtype; /* cpu subtype */ | ||
| 122 | 	cpu_threadtype_t cpu_threadtype; /* cpu threadtype */ | ||
| 123 | 	integer_t physical_cpu; /* number of physical CPUs now available */ | ||
| 124 | 	integer_t physical_cpu_max; /* max number of physical CPUs possible */ | ||
| 125 | 	integer_t logical_cpu; /* number of logical cpu now available */ | ||
| 126 | 	integer_t logical_cpu_max; /* max number of physical CPUs possible */ | ||
| 127 | 	uint64_t max_mem; /* actual size of physical memory */ | ||
| 128 | }; | ||
| 129 | |||
| 130 | #pragma pack(pop) | ||
| 131 | |||
| 132 | typedef struct host_basic_info host_basic_info_data_t; | ||
| 133 | typedef struct host_basic_info *host_basic_info_t; | ||
| 134 | #define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 135 | 	 (sizeof(host_basic_info_data_t)/sizeof(integer_t))) | ||
| 136 | |||
| 137 | struct host_sched_info { | ||
| 138 | 	integer_t min_timeout; /* minimum timeout in milliseconds */ | ||
| 139 | 	integer_t min_quantum; /* minimum quantum in milliseconds */ | ||
| 140 | }; | ||
| 141 | |||
| 142 | typedef struct host_sched_info host_sched_info_data_t; | ||
| 143 | typedef struct host_sched_info *host_sched_info_t; | ||
| 144 | #define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 145 | 	 (sizeof(host_sched_info_data_t)/sizeof(integer_t))) | ||
| 146 | |||
| 147 | struct kernel_resource_sizes { | ||
| 148 | 	natural_t task; | ||
| 149 | 	natural_t thread; | ||
| 150 | 	natural_t port; | ||
| 151 | 	natural_t memory_region; | ||
| 152 | 	natural_t memory_object; | ||
| 153 | }; | ||
| 154 | |||
| 155 | typedef struct kernel_resource_sizes kernel_resource_sizes_data_t; | ||
| 156 | typedef struct kernel_resource_sizes *kernel_resource_sizes_t; | ||
| 157 | #define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) \ | ||
| 158 | 	 (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t))) | ||
| 159 | |||
| 160 | struct host_priority_info { | ||
| 161 | 	integer_t kernel_priority; | ||
| 162 | 	integer_t system_priority; | ||
| 163 | 	integer_t server_priority; | ||
| 164 | 	integer_t user_priority; | ||
| 165 | 	integer_t depress_priority; | ||
| 166 | 	integer_t idle_priority; | ||
| 167 | 	integer_t minimum_priority; | ||
| 168 | 	integer_t maximum_priority; | ||
| 169 | }; | ||
| 170 | |||
| 171 | typedef struct host_priority_info host_priority_info_data_t; | ||
| 172 | typedef struct host_priority_info *host_priority_info_t; | ||
| 173 | #define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 174 | 	 (sizeof(host_priority_info_data_t)/sizeof(integer_t))) | ||
| 175 | |||
| 176 | /* host_statistics() */ | ||
| 177 | #define HOST_LOAD_INFO 1 /* System loading stats */ | ||
| 178 | #define HOST_VM_INFO 2 /* Virtual memory stats */ | ||
| 179 | #define HOST_CPU_LOAD_INFO 3 /* CPU load stats */ | ||
| 180 | |||
| 181 | /* host_statistics64() */ | ||
| 182 | #define HOST_VM_INFO64 4 /* 64-bit virtual memory stats */ | ||
| 183 | #define HOST_EXTMOD_INFO64 5 /* External modification stats */ | ||
| 184 | #define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */ | ||
| 185 | |||
| 186 | |||
| 187 | struct host_load_info { | ||
| 188 | 	integer_t avenrun[3]; /* scaled by LOAD_SCALE */ | ||
| 189 | 	integer_t mach_factor[3]; /* scaled by LOAD_SCALE */ | ||
| 190 | }; | ||
| 191 | |||
| 192 | typedef struct host_load_info host_load_info_data_t; | ||
| 193 | typedef struct host_load_info *host_load_info_t; | ||
| 194 | #define HOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 195 | 	 (sizeof(host_load_info_data_t)/sizeof(integer_t))) | ||
| 196 | |||
| 197 | typedef struct vm_purgeable_info host_purgable_info_data_t; | ||
| 198 | typedef struct vm_purgeable_info *host_purgable_info_t; | ||
| 199 | #define HOST_VM_PURGABLE_COUNT ((mach_msg_type_number_t) \ | ||
| 200 | 	 (sizeof(host_purgable_info_data_t)/sizeof(integer_t))) | ||
| 201 | |||
| 202 | /* in <mach/vm_statistics.h> */ | ||
| 203 | /* vm_statistics64 */ | ||
| 204 | #define HOST_VM_INFO64_COUNT ((mach_msg_type_number_t) \ | ||
| 205 | 	 (sizeof(vm_statistics64_data_t)/sizeof(integer_t))) | ||
| 206 | |||
| 207 | /* size of the latest version of the structure */ | ||
| 208 | #define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT | ||
| 209 | #define HOST_VM_INFO64_REV1_COUNT HOST_VM_INFO64_LATEST_COUNT | ||
| 210 | /* previous versions: adjust the size according to what was added each time */ | ||
| 211 | #define HOST_VM_INFO64_REV0_COUNT /* added compression and swapper info (14 ints) */ \ | ||
| 212 | 	((mach_msg_type_number_t) \ | ||
| 213 | 	 (HOST_VM_INFO64_REV1_COUNT - 14)) | ||
| 214 | |||
| 215 | /* in <mach/vm_statistics.h> */ | ||
| 216 | /* vm_extmod_statistics */ | ||
| 217 | #define HOST_EXTMOD_INFO64_COUNT ((mach_msg_type_number_t) \ | ||
| 218 | 	 (sizeof(vm_extmod_statistics_data_t)/sizeof(integer_t))) | ||
| 219 | |||
| 220 | /* size of the latest version of the structure */ | ||
| 221 | #define HOST_EXTMOD_INFO64_LATEST_COUNT HOST_EXTMOD_INFO64_COUNT | ||
| 222 | |||
| 223 | /* vm_statistics */ | ||
| 224 | #define HOST_VM_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 225 | 	 (sizeof(vm_statistics_data_t)/sizeof(integer_t))) | ||
| 226 | |||
| 227 | /* size of the latest version of the structure */ | ||
| 228 | #define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT | ||
| 229 | #define HOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT | ||
| 230 | /* previous versions: adjust the size according to what was added each time */ | ||
| 231 | #define HOST_VM_INFO_REV1_COUNT /* added "speculative_count" (1 int) */ \ | ||
| 232 | 	((mach_msg_type_number_t) \ | ||
| 233 | 	 (HOST_VM_INFO_REV2_COUNT - 1)) | ||
| 234 | #define HOST_VM_INFO_REV0_COUNT /* added "purgable" info (2 ints) */ \ | ||
| 235 | 	((mach_msg_type_number_t) \ | ||
| 236 | 	 (HOST_VM_INFO_REV1_COUNT - 2)) | ||
| 237 | |||
| 238 | struct host_cpu_load_info { /* number of ticks while running... */ | ||
| 239 | 	natural_t cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ | ||
| 240 | }; | ||
| 241 | |||
| 242 | typedef struct host_cpu_load_info host_cpu_load_info_data_t; | ||
| 243 | typedef struct host_cpu_load_info *host_cpu_load_info_t; | ||
| 244 | #define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 245 | 	 (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t))) | ||
| 246 | |||
| 247 | struct host_preferred_user_arch { | ||
| 248 | 	cpu_type_t cpu_type; /* Preferred user-space cpu type */ | ||
| 249 | 	cpu_subtype_t cpu_subtype; /* Preferred user-space cpu subtype */ | ||
| 250 | }; | ||
| 251 | |||
| 252 | typedef struct host_preferred_user_arch host_preferred_user_arch_data_t; | ||
| 253 | typedef struct host_preferred_user_arch *host_preferred_user_arch_t; | ||
| 254 | #define HOST_PREFERRED_USER_ARCH_COUNT ((mach_msg_type_number_t) \ | ||
| 255 | 	 (sizeof(host_preferred_user_arch_data_t)/sizeof(integer_t))) | ||
| 256 | |||
| 257 | |||
| 258 | |||
| 259 | |||
| 260 | #endif /* _MACH_HOST_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/host_notify.h created+39| ... | @@ -0,0 +1,39 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_HOST_NOTIFY_H_ | ||
| 30 | #define _MACH_HOST_NOTIFY_H_ | ||
| 31 | |||
| 32 | #define HOST_NOTIFY_CALENDAR_CHANGE 0 | ||
| 33 | #define HOST_NOTIFY_CALENDAR_SET 1 | ||
| 34 | #define HOST_NOTIFY_TYPE_MAX 1 | ||
| 35 | |||
| 36 | #define HOST_CALENDAR_CHANGED_REPLYID 950 | ||
| 37 | #define HOST_CALENDAR_SET_REPLYID 951 | ||
| 38 | |||
| 39 | #endif /* _MACH_HOST_NOTIFY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/host_priv.h created+1163| ... | @@ -0,0 +1,1163 @@ | ||
| 1 | #ifndef	_host_priv_user_ | ||
| 2 | #define	_host_priv_user_ | ||
| 3 | |||
| 4 | /* Module host_priv */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	host_priv_MSG_COUNT | ||
| 52 | #define	host_priv_MSG_COUNT	26 | ||
| 53 | #endif	/* host_priv_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach/mach_types.h> | ||
| 60 | #include <mach_debug/mach_debug_types.h> | ||
| 61 | |||
| 62 | #ifdef __BeforeMigUserHeader | ||
| 63 | __BeforeMigUserHeader | ||
| 64 | #endif /* __BeforeMigUserHeader */ | ||
| 65 | |||
| 66 | #include <sys/cdefs.h> | ||
| 67 | __BEGIN_DECLS | ||
| 68 | |||
| 69 | |||
| 70 | /* Routine host_get_boot_info */ | ||
| 71 | #ifdef	mig_external | ||
| 72 | mig_external | ||
| 73 | #else | ||
| 74 | extern | ||
| 75 | #endif	/* mig_external */ | ||
| 76 | kern_return_t host_get_boot_info | ||
| 77 | ( | ||
| 78 | 	host_priv_t host_priv, | ||
| 79 | 	kernel_boot_info_t boot_info | ||
| 80 | ); | ||
| 81 | |||
| 82 | /* Routine host_reboot */ | ||
| 83 | #ifdef	mig_external | ||
| 84 | mig_external | ||
| 85 | #else | ||
| 86 | extern | ||
| 87 | #endif	/* mig_external */ | ||
| 88 | kern_return_t host_reboot | ||
| 89 | ( | ||
| 90 | 	host_priv_t host_priv, | ||
| 91 | 	int options | ||
| 92 | ); | ||
| 93 | |||
| 94 | /* Routine host_priv_statistics */ | ||
| 95 | #ifdef	mig_external | ||
| 96 | mig_external | ||
| 97 | #else | ||
| 98 | extern | ||
| 99 | #endif	/* mig_external */ | ||
| 100 | kern_return_t host_priv_statistics | ||
| 101 | ( | ||
| 102 | 	host_priv_t host_priv, | ||
| 103 | 	host_flavor_t flavor, | ||
| 104 | 	host_info_t host_info_out, | ||
| 105 | 	mach_msg_type_number_t *host_info_outCnt | ||
| 106 | ); | ||
| 107 | |||
| 108 | /* Routine host_default_memory_manager */ | ||
| 109 | #ifdef	mig_external | ||
| 110 | mig_external | ||
| 111 | #else | ||
| 112 | extern | ||
| 113 | #endif	/* mig_external */ | ||
| 114 | kern_return_t host_default_memory_manager | ||
| 115 | ( | ||
| 116 | 	host_priv_t host_priv, | ||
| 117 | 	memory_object_default_t *default_manager, | ||
| 118 | 	memory_object_cluster_size_t cluster_size | ||
| 119 | ); | ||
| 120 | |||
| 121 | /* Routine vm_wire */ | ||
| 122 | #ifdef	mig_external | ||
| 123 | mig_external | ||
| 124 | #else | ||
| 125 | extern | ||
| 126 | #endif	/* mig_external */ | ||
| 127 | kern_return_t vm_wire | ||
| 128 | ( | ||
| 129 | 	host_priv_t host_priv, | ||
| 130 | 	vm_map_t task, | ||
| 131 | 	vm_address_t address, | ||
| 132 | 	vm_size_t size, | ||
| 133 | 	vm_prot_t desired_access | ||
| 134 | ); | ||
| 135 | |||
| 136 | /* Routine thread_wire */ | ||
| 137 | #ifdef	mig_external | ||
| 138 | mig_external | ||
| 139 | #else | ||
| 140 | extern | ||
| 141 | #endif	/* mig_external */ | ||
| 142 | kern_return_t thread_wire | ||
| 143 | ( | ||
| 144 | 	host_priv_t host_priv, | ||
| 145 | 	thread_act_t thread, | ||
| 146 | 	boolean_t wired | ||
| 147 | ); | ||
| 148 | |||
| 149 | /* Routine vm_allocate_cpm */ | ||
| 150 | #ifdef	mig_external | ||
| 151 | mig_external | ||
| 152 | #else | ||
| 153 | extern | ||
| 154 | #endif	/* mig_external */ | ||
| 155 | kern_return_t vm_allocate_cpm | ||
| 156 | ( | ||
| 157 | 	host_priv_t host_priv, | ||
| 158 | 	vm_map_t task, | ||
| 159 | 	vm_address_t *address, | ||
| 160 | 	vm_size_t size, | ||
| 161 | 	int flags | ||
| 162 | ); | ||
| 163 | |||
| 164 | /* Routine host_processors */ | ||
| 165 | #ifdef	mig_external | ||
| 166 | mig_external | ||
| 167 | #else | ||
| 168 | extern | ||
| 169 | #endif	/* mig_external */ | ||
| 170 | kern_return_t host_processors | ||
| 171 | ( | ||
| 172 | 	host_priv_t host_priv, | ||
| 173 | 	processor_array_t *out_processor_list, | ||
| 174 | 	mach_msg_type_number_t *out_processor_listCnt | ||
| 175 | ); | ||
| 176 | |||
| 177 | /* Routine host_get_clock_control */ | ||
| 178 | #ifdef	mig_external | ||
| 179 | mig_external | ||
| 180 | #else | ||
| 181 | extern | ||
| 182 | #endif	/* mig_external */ | ||
| 183 | kern_return_t host_get_clock_control | ||
| 184 | ( | ||
| 185 | 	host_priv_t host_priv, | ||
| 186 | 	clock_id_t clock_id, | ||
| 187 | 	clock_ctrl_t *clock_ctrl | ||
| 188 | ); | ||
| 189 | |||
| 190 | /* Routine kmod_create */ | ||
| 191 | #ifdef	mig_external | ||
| 192 | mig_external | ||
| 193 | #else | ||
| 194 | extern | ||
| 195 | #endif	/* mig_external */ | ||
| 196 | kern_return_t kmod_create | ||
| 197 | ( | ||
| 198 | 	host_priv_t host_priv, | ||
| 199 | 	vm_address_t info, | ||
| 200 | 	kmod_t *module | ||
| 201 | ); | ||
| 202 | |||
| 203 | /* Routine kmod_destroy */ | ||
| 204 | #ifdef	mig_external | ||
| 205 | mig_external | ||
| 206 | #else | ||
| 207 | extern | ||
| 208 | #endif	/* mig_external */ | ||
| 209 | kern_return_t kmod_destroy | ||
| 210 | ( | ||
| 211 | 	host_priv_t host_priv, | ||
| 212 | 	kmod_t module | ||
| 213 | ); | ||
| 214 | |||
| 215 | /* Routine kmod_control */ | ||
| 216 | #ifdef	mig_external | ||
| 217 | mig_external | ||
| 218 | #else | ||
| 219 | extern | ||
| 220 | #endif	/* mig_external */ | ||
| 221 | kern_return_t kmod_control | ||
| 222 | ( | ||
| 223 | 	host_priv_t host_priv, | ||
| 224 | 	kmod_t module, | ||
| 225 | 	kmod_control_flavor_t flavor, | ||
| 226 | 	kmod_args_t *data, | ||
| 227 | 	mach_msg_type_number_t *dataCnt | ||
| 228 | ); | ||
| 229 | |||
| 230 | /* Routine host_get_special_port */ | ||
| 231 | #ifdef	mig_external | ||
| 232 | mig_external | ||
| 233 | #else | ||
| 234 | extern | ||
| 235 | #endif	/* mig_external */ | ||
| 236 | kern_return_t host_get_special_port | ||
| 237 | ( | ||
| 238 | 	host_priv_t host_priv, | ||
| 239 | 	int node, | ||
| 240 | 	int which, | ||
| 241 | 	mach_port_t *port | ||
| 242 | ); | ||
| 243 | |||
| 244 | /* Routine host_set_special_port */ | ||
| 245 | #ifdef	mig_external | ||
| 246 | mig_external | ||
| 247 | #else | ||
| 248 | extern | ||
| 249 | #endif	/* mig_external */ | ||
| 250 | kern_return_t host_set_special_port | ||
| 251 | ( | ||
| 252 | 	host_priv_t host_priv, | ||
| 253 | 	int which, | ||
| 254 | 	mach_port_t port | ||
| 255 | ); | ||
| 256 | |||
| 257 | /* Routine host_set_exception_ports */ | ||
| 258 | #ifdef	mig_external | ||
| 259 | mig_external | ||
| 260 | #else | ||
| 261 | extern | ||
| 262 | #endif	/* mig_external */ | ||
| 263 | kern_return_t host_set_exception_ports | ||
| 264 | ( | ||
| 265 | 	host_priv_t host_priv, | ||
| 266 | 	exception_mask_t exception_mask, | ||
| 267 | 	mach_port_t new_port, | ||
| 268 | 	exception_behavior_t behavior, | ||
| 269 | 	thread_state_flavor_t new_flavor | ||
| 270 | ); | ||
| 271 | |||
| 272 | /* Routine host_get_exception_ports */ | ||
| 273 | #ifdef	mig_external | ||
| 274 | mig_external | ||
| 275 | #else | ||
| 276 | extern | ||
| 277 | #endif	/* mig_external */ | ||
| 278 | kern_return_t host_get_exception_ports | ||
| 279 | ( | ||
| 280 | 	host_priv_t host_priv, | ||
| 281 | 	exception_mask_t exception_mask, | ||
| 282 | 	exception_mask_array_t masks, | ||
| 283 | 	mach_msg_type_number_t *masksCnt, | ||
| 284 | 	exception_handler_array_t old_handlers, | ||
| 285 | 	exception_behavior_array_t old_behaviors, | ||
| 286 | 	exception_flavor_array_t old_flavors | ||
| 287 | ); | ||
| 288 | |||
| 289 | /* Routine host_swap_exception_ports */ | ||
| 290 | #ifdef	mig_external | ||
| 291 | mig_external | ||
| 292 | #else | ||
| 293 | extern | ||
| 294 | #endif	/* mig_external */ | ||
| 295 | kern_return_t host_swap_exception_ports | ||
| 296 | ( | ||
| 297 | 	host_priv_t host_priv, | ||
| 298 | 	exception_mask_t exception_mask, | ||
| 299 | 	mach_port_t new_port, | ||
| 300 | 	exception_behavior_t behavior, | ||
| 301 | 	thread_state_flavor_t new_flavor, | ||
| 302 | 	exception_mask_array_t masks, | ||
| 303 | 	mach_msg_type_number_t *masksCnt, | ||
| 304 | 	exception_handler_array_t old_handlerss, | ||
| 305 | 	exception_behavior_array_t old_behaviors, | ||
| 306 | 	exception_flavor_array_t old_flavors | ||
| 307 | ); | ||
| 308 | |||
| 309 | /* Routine mach_vm_wire */ | ||
| 310 | #ifdef	mig_external | ||
| 311 | mig_external | ||
| 312 | #else | ||
| 313 | extern | ||
| 314 | #endif	/* mig_external */ | ||
| 315 | kern_return_t mach_vm_wire | ||
| 316 | ( | ||
| 317 | 	host_priv_t host_priv, | ||
| 318 | 	vm_map_t task, | ||
| 319 | 	mach_vm_address_t address, | ||
| 320 | 	mach_vm_size_t size, | ||
| 321 | 	vm_prot_t desired_access | ||
| 322 | ); | ||
| 323 | |||
| 324 | /* Routine host_processor_sets */ | ||
| 325 | #ifdef	mig_external | ||
| 326 | mig_external | ||
| 327 | #else | ||
| 328 | extern | ||
| 329 | #endif	/* mig_external */ | ||
| 330 | kern_return_t host_processor_sets | ||
| 331 | ( | ||
| 332 | 	host_priv_t host_priv, | ||
| 333 | 	processor_set_name_array_t *processor_sets, | ||
| 334 | 	mach_msg_type_number_t *processor_setsCnt | ||
| 335 | ); | ||
| 336 | |||
| 337 | /* Routine host_processor_set_priv */ | ||
| 338 | #ifdef	mig_external | ||
| 339 | mig_external | ||
| 340 | #else | ||
| 341 | extern | ||
| 342 | #endif	/* mig_external */ | ||
| 343 | kern_return_t host_processor_set_priv | ||
| 344 | ( | ||
| 345 | 	host_priv_t host_priv, | ||
| 346 | 	processor_set_name_t set_name, | ||
| 347 | 	processor_set_t *set | ||
| 348 | ); | ||
| 349 | |||
| 350 | /* Routine host_set_UNDServer */ | ||
| 351 | #ifdef	mig_external | ||
| 352 | mig_external | ||
| 353 | #else | ||
| 354 | extern | ||
| 355 | #endif	/* mig_external */ | ||
| 356 | kern_return_t host_set_UNDServer | ||
| 357 | ( | ||
| 358 | 	host_priv_t host, | ||
| 359 | 	UNDServerRef server | ||
| 360 | ); | ||
| 361 | |||
| 362 | /* Routine host_get_UNDServer */ | ||
| 363 | #ifdef	mig_external | ||
| 364 | mig_external | ||
| 365 | #else | ||
| 366 | extern | ||
| 367 | #endif	/* mig_external */ | ||
| 368 | kern_return_t host_get_UNDServer | ||
| 369 | ( | ||
| 370 | 	host_priv_t host, | ||
| 371 | 	UNDServerRef *server | ||
| 372 | ); | ||
| 373 | |||
| 374 | /* Routine kext_request */ | ||
| 375 | #ifdef	mig_external | ||
| 376 | mig_external | ||
| 377 | #else | ||
| 378 | extern | ||
| 379 | #endif	/* mig_external */ | ||
| 380 | kern_return_t kext_request | ||
| 381 | ( | ||
| 382 | 	host_priv_t host_priv, | ||
| 383 | 	uint32_t user_log_flags, | ||
| 384 | 	vm_offset_t request_data, | ||
| 385 | 	mach_msg_type_number_t request_dataCnt, | ||
| 386 | 	vm_offset_t *response_data, | ||
| 387 | 	mach_msg_type_number_t *response_dataCnt, | ||
| 388 | 	vm_offset_t *log_data, | ||
| 389 | 	mach_msg_type_number_t *log_dataCnt, | ||
| 390 | 	kern_return_t *op_result | ||
| 391 | ); | ||
| 392 | |||
| 393 | __END_DECLS | ||
| 394 | |||
| 395 | /********************** Caution **************************/ | ||
| 396 | /* The following data types should be used to calculate */ | ||
| 397 | /* maximum message sizes only. The actual message may be */ | ||
| 398 | /* smaller, and the position of the arguments within the */ | ||
| 399 | /* message layout may vary from what is presented here. */ | ||
| 400 | /* For example, if any of the arguments are variable- */ | ||
| 401 | /* sized, and less than the maximum is sent, the data */ | ||
| 402 | /* will be packed tight in the actual message to reduce */ | ||
| 403 | /* the presence of holes. */ | ||
| 404 | /********************** Caution **************************/ | ||
| 405 | |||
| 406 | /* typedefs for all requests */ | ||
| 407 | |||
| 408 | #ifndef __Request__host_priv_subsystem__defined | ||
| 409 | #define __Request__host_priv_subsystem__defined | ||
| 410 | |||
| 411 | #ifdef __MigPackStructs | ||
| 412 | #pragma pack(push, 4) | ||
| 413 | #endif | ||
| 414 | 	typedef struct { | ||
| 415 | 		mach_msg_header_t Head; | ||
| 416 | 	} __Request__host_get_boot_info_t __attribute__((unused)); | ||
| 417 | #ifdef __MigPackStructs | ||
| 418 | #pragma pack(pop) | ||
| 419 | #endif | ||
| 420 | |||
| 421 | #ifdef __MigPackStructs | ||
| 422 | #pragma pack(push, 4) | ||
| 423 | #endif | ||
| 424 | 	typedef struct { | ||
| 425 | 		mach_msg_header_t Head; | ||
| 426 | 		NDR_record_t NDR; | ||
| 427 | 		int options; | ||
| 428 | 	} __Request__host_reboot_t __attribute__((unused)); | ||
| 429 | #ifdef __MigPackStructs | ||
| 430 | #pragma pack(pop) | ||
| 431 | #endif | ||
| 432 | |||
| 433 | #ifdef __MigPackStructs | ||
| 434 | #pragma pack(push, 4) | ||
| 435 | #endif | ||
| 436 | 	typedef struct { | ||
| 437 | 		mach_msg_header_t Head; | ||
| 438 | 		NDR_record_t NDR; | ||
| 439 | 		host_flavor_t flavor; | ||
| 440 | 		mach_msg_type_number_t host_info_outCnt; | ||
| 441 | 	} __Request__host_priv_statistics_t __attribute__((unused)); | ||
| 442 | #ifdef __MigPackStructs | ||
| 443 | #pragma pack(pop) | ||
| 444 | #endif | ||
| 445 | |||
| 446 | #ifdef __MigPackStructs | ||
| 447 | #pragma pack(push, 4) | ||
| 448 | #endif | ||
| 449 | 	typedef struct { | ||
| 450 | 		mach_msg_header_t Head; | ||
| 451 | 		/* start of the kernel processed data */ | ||
| 452 | 		mach_msg_body_t msgh_body; | ||
| 453 | 		mach_msg_port_descriptor_t default_manager; | ||
| 454 | 		/* end of the kernel processed data */ | ||
| 455 | 		NDR_record_t NDR; | ||
| 456 | 		memory_object_cluster_size_t cluster_size; | ||
| 457 | 	} __Request__host_default_memory_manager_t __attribute__((unused)); | ||
| 458 | #ifdef __MigPackStructs | ||
| 459 | #pragma pack(pop) | ||
| 460 | #endif | ||
| 461 | |||
| 462 | #ifdef __MigPackStructs | ||
| 463 | #pragma pack(push, 4) | ||
| 464 | #endif | ||
| 465 | 	typedef struct { | ||
| 466 | 		mach_msg_header_t Head; | ||
| 467 | 		/* start of the kernel processed data */ | ||
| 468 | 		mach_msg_body_t msgh_body; | ||
| 469 | 		mach_msg_port_descriptor_t task; | ||
| 470 | 		/* end of the kernel processed data */ | ||
| 471 | 		NDR_record_t NDR; | ||
| 472 | 		vm_address_t address; | ||
| 473 | 		vm_size_t size; | ||
| 474 | 		vm_prot_t desired_access; | ||
| 475 | 	} __Request__vm_wire_t __attribute__((unused)); | ||
| 476 | #ifdef __MigPackStructs | ||
| 477 | #pragma pack(pop) | ||
| 478 | #endif | ||
| 479 | |||
| 480 | #ifdef __MigPackStructs | ||
| 481 | #pragma pack(push, 4) | ||
| 482 | #endif | ||
| 483 | 	typedef struct { | ||
| 484 | 		mach_msg_header_t Head; | ||
| 485 | 		/* start of the kernel processed data */ | ||
| 486 | 		mach_msg_body_t msgh_body; | ||
| 487 | 		mach_msg_port_descriptor_t thread; | ||
| 488 | 		/* end of the kernel processed data */ | ||
| 489 | 		NDR_record_t NDR; | ||
| 490 | 		boolean_t wired; | ||
| 491 | 	} __Request__thread_wire_t __attribute__((unused)); | ||
| 492 | #ifdef __MigPackStructs | ||
| 493 | #pragma pack(pop) | ||
| 494 | #endif | ||
| 495 | |||
| 496 | #ifdef __MigPackStructs | ||
| 497 | #pragma pack(push, 4) | ||
| 498 | #endif | ||
| 499 | 	typedef struct { | ||
| 500 | 		mach_msg_header_t Head; | ||
| 501 | 		/* start of the kernel processed data */ | ||
| 502 | 		mach_msg_body_t msgh_body; | ||
| 503 | 		mach_msg_port_descriptor_t task; | ||
| 504 | 		/* end of the kernel processed data */ | ||
| 505 | 		NDR_record_t NDR; | ||
| 506 | 		vm_address_t address; | ||
| 507 | 		vm_size_t size; | ||
| 508 | 		int flags; | ||
| 509 | 	} __Request__vm_allocate_cpm_t __attribute__((unused)); | ||
| 510 | #ifdef __MigPackStructs | ||
| 511 | #pragma pack(pop) | ||
| 512 | #endif | ||
| 513 | |||
| 514 | #ifdef __MigPackStructs | ||
| 515 | #pragma pack(push, 4) | ||
| 516 | #endif | ||
| 517 | 	typedef struct { | ||
| 518 | 		mach_msg_header_t Head; | ||
| 519 | 	} __Request__host_processors_t __attribute__((unused)); | ||
| 520 | #ifdef __MigPackStructs | ||
| 521 | #pragma pack(pop) | ||
| 522 | #endif | ||
| 523 | |||
| 524 | #ifdef __MigPackStructs | ||
| 525 | #pragma pack(push, 4) | ||
| 526 | #endif | ||
| 527 | 	typedef struct { | ||
| 528 | 		mach_msg_header_t Head; | ||
| 529 | 		NDR_record_t NDR; | ||
| 530 | 		clock_id_t clock_id; | ||
| 531 | 	} __Request__host_get_clock_control_t __attribute__((unused)); | ||
| 532 | #ifdef __MigPackStructs | ||
| 533 | #pragma pack(pop) | ||
| 534 | #endif | ||
| 535 | |||
| 536 | #ifdef __MigPackStructs | ||
| 537 | #pragma pack(push, 4) | ||
| 538 | #endif | ||
| 539 | 	typedef struct { | ||
| 540 | 		mach_msg_header_t Head; | ||
| 541 | 		NDR_record_t NDR; | ||
| 542 | 		vm_address_t info; | ||
| 543 | 	} __Request__kmod_create_t __attribute__((unused)); | ||
| 544 | #ifdef __MigPackStructs | ||
| 545 | #pragma pack(pop) | ||
| 546 | #endif | ||
| 547 | |||
| 548 | #ifdef __MigPackStructs | ||
| 549 | #pragma pack(push, 4) | ||
| 550 | #endif | ||
| 551 | 	typedef struct { | ||
| 552 | 		mach_msg_header_t Head; | ||
| 553 | 		NDR_record_t NDR; | ||
| 554 | 		kmod_t module; | ||
| 555 | 	} __Request__kmod_destroy_t __attribute__((unused)); | ||
| 556 | #ifdef __MigPackStructs | ||
| 557 | #pragma pack(pop) | ||
| 558 | #endif | ||
| 559 | |||
| 560 | #ifdef __MigPackStructs | ||
| 561 | #pragma pack(push, 4) | ||
| 562 | #endif | ||
| 563 | 	typedef struct { | ||
| 564 | 		mach_msg_header_t Head; | ||
| 565 | 		/* start of the kernel processed data */ | ||
| 566 | 		mach_msg_body_t msgh_body; | ||
| 567 | 		mach_msg_ool_descriptor_t data; | ||
| 568 | 		/* end of the kernel processed data */ | ||
| 569 | 		NDR_record_t NDR; | ||
| 570 | 		kmod_t module; | ||
| 571 | 		kmod_control_flavor_t flavor; | ||
| 572 | 		mach_msg_type_number_t dataCnt; | ||
| 573 | 	} __Request__kmod_control_t __attribute__((unused)); | ||
| 574 | #ifdef __MigPackStructs | ||
| 575 | #pragma pack(pop) | ||
| 576 | #endif | ||
| 577 | |||
| 578 | #ifdef __MigPackStructs | ||
| 579 | #pragma pack(push, 4) | ||
| 580 | #endif | ||
| 581 | 	typedef struct { | ||
| 582 | 		mach_msg_header_t Head; | ||
| 583 | 		NDR_record_t NDR; | ||
| 584 | 		int node; | ||
| 585 | 		int which; | ||
| 586 | 	} __Request__host_get_special_port_t __attribute__((unused)); | ||
| 587 | #ifdef __MigPackStructs | ||
| 588 | #pragma pack(pop) | ||
| 589 | #endif | ||
| 590 | |||
| 591 | #ifdef __MigPackStructs | ||
| 592 | #pragma pack(push, 4) | ||
| 593 | #endif | ||
| 594 | 	typedef struct { | ||
| 595 | 		mach_msg_header_t Head; | ||
| 596 | 		/* start of the kernel processed data */ | ||
| 597 | 		mach_msg_body_t msgh_body; | ||
| 598 | 		mach_msg_port_descriptor_t port; | ||
| 599 | 		/* end of the kernel processed data */ | ||
| 600 | 		NDR_record_t NDR; | ||
| 601 | 		int which; | ||
| 602 | 	} __Request__host_set_special_port_t __attribute__((unused)); | ||
| 603 | #ifdef __MigPackStructs | ||
| 604 | #pragma pack(pop) | ||
| 605 | #endif | ||
| 606 | |||
| 607 | #ifdef __MigPackStructs | ||
| 608 | #pragma pack(push, 4) | ||
| 609 | #endif | ||
| 610 | 	typedef struct { | ||
| 611 | 		mach_msg_header_t Head; | ||
| 612 | 		/* start of the kernel processed data */ | ||
| 613 | 		mach_msg_body_t msgh_body; | ||
| 614 | 		mach_msg_port_descriptor_t new_port; | ||
| 615 | 		/* end of the kernel processed data */ | ||
| 616 | 		NDR_record_t NDR; | ||
| 617 | 		exception_mask_t exception_mask; | ||
| 618 | 		exception_behavior_t behavior; | ||
| 619 | 		thread_state_flavor_t new_flavor; | ||
| 620 | 	} __Request__host_set_exception_ports_t __attribute__((unused)); | ||
| 621 | #ifdef __MigPackStructs | ||
| 622 | #pragma pack(pop) | ||
| 623 | #endif | ||
| 624 | |||
| 625 | #ifdef __MigPackStructs | ||
| 626 | #pragma pack(push, 4) | ||
| 627 | #endif | ||
| 628 | 	typedef struct { | ||
| 629 | 		mach_msg_header_t Head; | ||
| 630 | 		NDR_record_t NDR; | ||
| 631 | 		exception_mask_t exception_mask; | ||
| 632 | 	} __Request__host_get_exception_ports_t __attribute__((unused)); | ||
| 633 | #ifdef __MigPackStructs | ||
| 634 | #pragma pack(pop) | ||
| 635 | #endif | ||
| 636 | |||
| 637 | #ifdef __MigPackStructs | ||
| 638 | #pragma pack(push, 4) | ||
| 639 | #endif | ||
| 640 | 	typedef struct { | ||
| 641 | 		mach_msg_header_t Head; | ||
| 642 | 		/* start of the kernel processed data */ | ||
| 643 | 		mach_msg_body_t msgh_body; | ||
| 644 | 		mach_msg_port_descriptor_t new_port; | ||
| 645 | 		/* end of the kernel processed data */ | ||
| 646 | 		NDR_record_t NDR; | ||
| 647 | 		exception_mask_t exception_mask; | ||
| 648 | 		exception_behavior_t behavior; | ||
| 649 | 		thread_state_flavor_t new_flavor; | ||
| 650 | 	} __Request__host_swap_exception_ports_t __attribute__((unused)); | ||
| 651 | #ifdef __MigPackStructs | ||
| 652 | #pragma pack(pop) | ||
| 653 | #endif | ||
| 654 | |||
| 655 | #ifdef __MigPackStructs | ||
| 656 | #pragma pack(push, 4) | ||
| 657 | #endif | ||
| 658 | 	typedef struct { | ||
| 659 | 		mach_msg_header_t Head; | ||
| 660 | 		/* start of the kernel processed data */ | ||
| 661 | 		mach_msg_body_t msgh_body; | ||
| 662 | 		mach_msg_port_descriptor_t task; | ||
| 663 | 		/* end of the kernel processed data */ | ||
| 664 | 		NDR_record_t NDR; | ||
| 665 | 		mach_vm_address_t address; | ||
| 666 | 		mach_vm_size_t size; | ||
| 667 | 		vm_prot_t desired_access; | ||
| 668 | 	} __Request__mach_vm_wire_t __attribute__((unused)); | ||
| 669 | #ifdef __MigPackStructs | ||
| 670 | #pragma pack(pop) | ||
| 671 | #endif | ||
| 672 | |||
| 673 | #ifdef __MigPackStructs | ||
| 674 | #pragma pack(push, 4) | ||
| 675 | #endif | ||
| 676 | 	typedef struct { | ||
| 677 | 		mach_msg_header_t Head; | ||
| 678 | 	} __Request__host_processor_sets_t __attribute__((unused)); | ||
| 679 | #ifdef __MigPackStructs | ||
| 680 | #pragma pack(pop) | ||
| 681 | #endif | ||
| 682 | |||
| 683 | #ifdef __MigPackStructs | ||
| 684 | #pragma pack(push, 4) | ||
| 685 | #endif | ||
| 686 | 	typedef struct { | ||
| 687 | 		mach_msg_header_t Head; | ||
| 688 | 		/* start of the kernel processed data */ | ||
| 689 | 		mach_msg_body_t msgh_body; | ||
| 690 | 		mach_msg_port_descriptor_t set_name; | ||
| 691 | 		/* end of the kernel processed data */ | ||
| 692 | 	} __Request__host_processor_set_priv_t __attribute__((unused)); | ||
| 693 | #ifdef __MigPackStructs | ||
| 694 | #pragma pack(pop) | ||
| 695 | #endif | ||
| 696 | |||
| 697 | #ifdef __MigPackStructs | ||
| 698 | #pragma pack(push, 4) | ||
| 699 | #endif | ||
| 700 | 	typedef struct { | ||
| 701 | 		mach_msg_header_t Head; | ||
| 702 | 		/* start of the kernel processed data */ | ||
| 703 | 		mach_msg_body_t msgh_body; | ||
| 704 | 		mach_msg_port_descriptor_t server; | ||
| 705 | 		/* end of the kernel processed data */ | ||
| 706 | 	} __Request__host_set_UNDServer_t __attribute__((unused)); | ||
| 707 | #ifdef __MigPackStructs | ||
| 708 | #pragma pack(pop) | ||
| 709 | #endif | ||
| 710 | |||
| 711 | #ifdef __MigPackStructs | ||
| 712 | #pragma pack(push, 4) | ||
| 713 | #endif | ||
| 714 | 	typedef struct { | ||
| 715 | 		mach_msg_header_t Head; | ||
| 716 | 	} __Request__host_get_UNDServer_t __attribute__((unused)); | ||
| 717 | #ifdef __MigPackStructs | ||
| 718 | #pragma pack(pop) | ||
| 719 | #endif | ||
| 720 | |||
| 721 | #ifdef __MigPackStructs | ||
| 722 | #pragma pack(push, 4) | ||
| 723 | #endif | ||
| 724 | 	typedef struct { | ||
| 725 | 		mach_msg_header_t Head; | ||
| 726 | 		/* start of the kernel processed data */ | ||
| 727 | 		mach_msg_body_t msgh_body; | ||
| 728 | 		mach_msg_ool_descriptor_t request_data; | ||
| 729 | 		/* end of the kernel processed data */ | ||
| 730 | 		NDR_record_t NDR; | ||
| 731 | 		uint32_t user_log_flags; | ||
| 732 | 		mach_msg_type_number_t request_dataCnt; | ||
| 733 | 	} __Request__kext_request_t __attribute__((unused)); | ||
| 734 | #ifdef __MigPackStructs | ||
| 735 | #pragma pack(pop) | ||
| 736 | #endif | ||
| 737 | #endif /* !__Request__host_priv_subsystem__defined */ | ||
| 738 | |||
| 739 | /* union of all requests */ | ||
| 740 | |||
| 741 | #ifndef __RequestUnion__host_priv_subsystem__defined | ||
| 742 | #define __RequestUnion__host_priv_subsystem__defined | ||
| 743 | union __RequestUnion__host_priv_subsystem { | ||
| 744 | 	__Request__host_get_boot_info_t Request_host_get_boot_info; | ||
| 745 | 	__Request__host_reboot_t Request_host_reboot; | ||
| 746 | 	__Request__host_priv_statistics_t Request_host_priv_statistics; | ||
| 747 | 	__Request__host_default_memory_manager_t Request_host_default_memory_manager; | ||
| 748 | 	__Request__vm_wire_t Request_vm_wire; | ||
| 749 | 	__Request__thread_wire_t Request_thread_wire; | ||
| 750 | 	__Request__vm_allocate_cpm_t Request_vm_allocate_cpm; | ||
| 751 | 	__Request__host_processors_t Request_host_processors; | ||
| 752 | 	__Request__host_get_clock_control_t Request_host_get_clock_control; | ||
| 753 | 	__Request__kmod_create_t Request_kmod_create; | ||
| 754 | 	__Request__kmod_destroy_t Request_kmod_destroy; | ||
| 755 | 	__Request__kmod_control_t Request_kmod_control; | ||
| 756 | 	__Request__host_get_special_port_t Request_host_get_special_port; | ||
| 757 | 	__Request__host_set_special_port_t Request_host_set_special_port; | ||
| 758 | 	__Request__host_set_exception_ports_t Request_host_set_exception_ports; | ||
| 759 | 	__Request__host_get_exception_ports_t Request_host_get_exception_ports; | ||
| 760 | 	__Request__host_swap_exception_ports_t Request_host_swap_exception_ports; | ||
| 761 | 	__Request__mach_vm_wire_t Request_mach_vm_wire; | ||
| 762 | 	__Request__host_processor_sets_t Request_host_processor_sets; | ||
| 763 | 	__Request__host_processor_set_priv_t Request_host_processor_set_priv; | ||
| 764 | 	__Request__host_set_UNDServer_t Request_host_set_UNDServer; | ||
| 765 | 	__Request__host_get_UNDServer_t Request_host_get_UNDServer; | ||
| 766 | 	__Request__kext_request_t Request_kext_request; | ||
| 767 | }; | ||
| 768 | #endif /* !__RequestUnion__host_priv_subsystem__defined */ | ||
| 769 | /* typedefs for all replies */ | ||
| 770 | |||
| 771 | #ifndef __Reply__host_priv_subsystem__defined | ||
| 772 | #define __Reply__host_priv_subsystem__defined | ||
| 773 | |||
| 774 | #ifdef __MigPackStructs | ||
| 775 | #pragma pack(push, 4) | ||
| 776 | #endif | ||
| 777 | 	typedef struct { | ||
| 778 | 		mach_msg_header_t Head; | ||
| 779 | 		NDR_record_t NDR; | ||
| 780 | 		kern_return_t RetCode; | ||
| 781 | 		mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */ | ||
| 782 | 		mach_msg_type_number_t boot_infoCnt; | ||
| 783 | 		char boot_info[4096]; | ||
| 784 | 	} __Reply__host_get_boot_info_t __attribute__((unused)); | ||
| 785 | #ifdef __MigPackStructs | ||
| 786 | #pragma pack(pop) | ||
| 787 | #endif | ||
| 788 | |||
| 789 | #ifdef __MigPackStructs | ||
| 790 | #pragma pack(push, 4) | ||
| 791 | #endif | ||
| 792 | 	typedef struct { | ||
| 793 | 		mach_msg_header_t Head; | ||
| 794 | 		NDR_record_t NDR; | ||
| 795 | 		kern_return_t RetCode; | ||
| 796 | 	} __Reply__host_reboot_t __attribute__((unused)); | ||
| 797 | #ifdef __MigPackStructs | ||
| 798 | #pragma pack(pop) | ||
| 799 | #endif | ||
| 800 | |||
| 801 | #ifdef __MigPackStructs | ||
| 802 | #pragma pack(push, 4) | ||
| 803 | #endif | ||
| 804 | 	typedef struct { | ||
| 805 | 		mach_msg_header_t Head; | ||
| 806 | 		NDR_record_t NDR; | ||
| 807 | 		kern_return_t RetCode; | ||
| 808 | 		mach_msg_type_number_t host_info_outCnt; | ||
| 809 | 		integer_t host_info_out[68]; | ||
| 810 | 	} __Reply__host_priv_statistics_t __attribute__((unused)); | ||
| 811 | #ifdef __MigPackStructs | ||
| 812 | #pragma pack(pop) | ||
| 813 | #endif | ||
| 814 | |||
| 815 | #ifdef __MigPackStructs | ||
| 816 | #pragma pack(push, 4) | ||
| 817 | #endif | ||
| 818 | 	typedef struct { | ||
| 819 | 		mach_msg_header_t Head; | ||
| 820 | 		/* start of the kernel processed data */ | ||
| 821 | 		mach_msg_body_t msgh_body; | ||
| 822 | 		mach_msg_port_descriptor_t default_manager; | ||
| 823 | 		/* end of the kernel processed data */ | ||
| 824 | 	} __Reply__host_default_memory_manager_t __attribute__((unused)); | ||
| 825 | #ifdef __MigPackStructs | ||
| 826 | #pragma pack(pop) | ||
| 827 | #endif | ||
| 828 | |||
| 829 | #ifdef __MigPackStructs | ||
| 830 | #pragma pack(push, 4) | ||
| 831 | #endif | ||
| 832 | 	typedef struct { | ||
| 833 | 		mach_msg_header_t Head; | ||
| 834 | 		NDR_record_t NDR; | ||
| 835 | 		kern_return_t RetCode; | ||
| 836 | 	} __Reply__vm_wire_t __attribute__((unused)); | ||
| 837 | #ifdef __MigPackStructs | ||
| 838 | #pragma pack(pop) | ||
| 839 | #endif | ||
| 840 | |||
| 841 | #ifdef __MigPackStructs | ||
| 842 | #pragma pack(push, 4) | ||
| 843 | #endif | ||
| 844 | 	typedef struct { | ||
| 845 | 		mach_msg_header_t Head; | ||
| 846 | 		NDR_record_t NDR; | ||
| 847 | 		kern_return_t RetCode; | ||
| 848 | 	} __Reply__thread_wire_t __attribute__((unused)); | ||
| 849 | #ifdef __MigPackStructs | ||
| 850 | #pragma pack(pop) | ||
| 851 | #endif | ||
| 852 | |||
| 853 | #ifdef __MigPackStructs | ||
| 854 | #pragma pack(push, 4) | ||
| 855 | #endif | ||
| 856 | 	typedef struct { | ||
| 857 | 		mach_msg_header_t Head; | ||
| 858 | 		NDR_record_t NDR; | ||
| 859 | 		kern_return_t RetCode; | ||
| 860 | 		vm_address_t address; | ||
| 861 | 	} __Reply__vm_allocate_cpm_t __attribute__((unused)); | ||
| 862 | #ifdef __MigPackStructs | ||
| 863 | #pragma pack(pop) | ||
| 864 | #endif | ||
| 865 | |||
| 866 | #ifdef __MigPackStructs | ||
| 867 | #pragma pack(push, 4) | ||
| 868 | #endif | ||
| 869 | 	typedef struct { | ||
| 870 | 		mach_msg_header_t Head; | ||
| 871 | 		/* start of the kernel processed data */ | ||
| 872 | 		mach_msg_body_t msgh_body; | ||
| 873 | 		mach_msg_ool_ports_descriptor_t out_processor_list; | ||
| 874 | 		/* end of the kernel processed data */ | ||
| 875 | 		NDR_record_t NDR; | ||
| 876 | 		mach_msg_type_number_t out_processor_listCnt; | ||
| 877 | 	} __Reply__host_processors_t __attribute__((unused)); | ||
| 878 | #ifdef __MigPackStructs | ||
| 879 | #pragma pack(pop) | ||
| 880 | #endif | ||
| 881 | |||
| 882 | #ifdef __MigPackStructs | ||
| 883 | #pragma pack(push, 4) | ||
| 884 | #endif | ||
| 885 | 	typedef struct { | ||
| 886 | 		mach_msg_header_t Head; | ||
| 887 | 		/* start of the kernel processed data */ | ||
| 888 | 		mach_msg_body_t msgh_body; | ||
| 889 | 		mach_msg_port_descriptor_t clock_ctrl; | ||
| 890 | 		/* end of the kernel processed data */ | ||
| 891 | 	} __Reply__host_get_clock_control_t __attribute__((unused)); | ||
| 892 | #ifdef __MigPackStructs | ||
| 893 | #pragma pack(pop) | ||
| 894 | #endif | ||
| 895 | |||
| 896 | #ifdef __MigPackStructs | ||
| 897 | #pragma pack(push, 4) | ||
| 898 | #endif | ||
| 899 | 	typedef struct { | ||
| 900 | 		mach_msg_header_t Head; | ||
| 901 | 		NDR_record_t NDR; | ||
| 902 | 		kern_return_t RetCode; | ||
| 903 | 		kmod_t module; | ||
| 904 | 	} __Reply__kmod_create_t __attribute__((unused)); | ||
| 905 | #ifdef __MigPackStructs | ||
| 906 | #pragma pack(pop) | ||
| 907 | #endif | ||
| 908 | |||
| 909 | #ifdef __MigPackStructs | ||
| 910 | #pragma pack(push, 4) | ||
| 911 | #endif | ||
| 912 | 	typedef struct { | ||
| 913 | 		mach_msg_header_t Head; | ||
| 914 | 		NDR_record_t NDR; | ||
| 915 | 		kern_return_t RetCode; | ||
| 916 | 	} __Reply__kmod_destroy_t __attribute__((unused)); | ||
| 917 | #ifdef __MigPackStructs | ||
| 918 | #pragma pack(pop) | ||
| 919 | #endif | ||
| 920 | |||
| 921 | #ifdef __MigPackStructs | ||
| 922 | #pragma pack(push, 4) | ||
| 923 | #endif | ||
| 924 | 	typedef struct { | ||
| 925 | 		mach_msg_header_t Head; | ||
| 926 | 		/* start of the kernel processed data */ | ||
| 927 | 		mach_msg_body_t msgh_body; | ||
| 928 | 		mach_msg_ool_descriptor_t data; | ||
| 929 | 		/* end of the kernel processed data */ | ||
| 930 | 		NDR_record_t NDR; | ||
| 931 | 		mach_msg_type_number_t dataCnt; | ||
| 932 | 	} __Reply__kmod_control_t __attribute__((unused)); | ||
| 933 | #ifdef __MigPackStructs | ||
| 934 | #pragma pack(pop) | ||
| 935 | #endif | ||
| 936 | |||
| 937 | #ifdef __MigPackStructs | ||
| 938 | #pragma pack(push, 4) | ||
| 939 | #endif | ||
| 940 | 	typedef struct { | ||
| 941 | 		mach_msg_header_t Head; | ||
| 942 | 		/* start of the kernel processed data */ | ||
| 943 | 		mach_msg_body_t msgh_body; | ||
| 944 | 		mach_msg_port_descriptor_t port; | ||
| 945 | 		/* end of the kernel processed data */ | ||
| 946 | 	} __Reply__host_get_special_port_t __attribute__((unused)); | ||
| 947 | #ifdef __MigPackStructs | ||
| 948 | #pragma pack(pop) | ||
| 949 | #endif | ||
| 950 | |||
| 951 | #ifdef __MigPackStructs | ||
| 952 | #pragma pack(push, 4) | ||
| 953 | #endif | ||
| 954 | 	typedef struct { | ||
| 955 | 		mach_msg_header_t Head; | ||
| 956 | 		NDR_record_t NDR; | ||
| 957 | 		kern_return_t RetCode; | ||
| 958 | 	} __Reply__host_set_special_port_t __attribute__((unused)); | ||
| 959 | #ifdef __MigPackStructs | ||
| 960 | #pragma pack(pop) | ||
| 961 | #endif | ||
| 962 | |||
| 963 | #ifdef __MigPackStructs | ||
| 964 | #pragma pack(push, 4) | ||
| 965 | #endif | ||
| 966 | 	typedef struct { | ||
| 967 | 		mach_msg_header_t Head; | ||
| 968 | 		NDR_record_t NDR; | ||
| 969 | 		kern_return_t RetCode; | ||
| 970 | 	} __Reply__host_set_exception_ports_t __attribute__((unused)); | ||
| 971 | #ifdef __MigPackStructs | ||
| 972 | #pragma pack(pop) | ||
| 973 | #endif | ||
| 974 | |||
| 975 | #ifdef __MigPackStructs | ||
| 976 | #pragma pack(push, 4) | ||
| 977 | #endif | ||
| 978 | 	typedef struct { | ||
| 979 | 		mach_msg_header_t Head; | ||
| 980 | 		/* start of the kernel processed data */ | ||
| 981 | 		mach_msg_body_t msgh_body; | ||
| 982 | 		mach_msg_port_descriptor_t old_handlers[32]; | ||
| 983 | 		/* end of the kernel processed data */ | ||
| 984 | 		NDR_record_t NDR; | ||
| 985 | 		mach_msg_type_number_t masksCnt; | ||
| 986 | 		exception_mask_t masks[32]; | ||
| 987 | 		exception_behavior_t old_behaviors[32]; | ||
| 988 | 		thread_state_flavor_t old_flavors[32]; | ||
| 989 | 	} __Reply__host_get_exception_ports_t __attribute__((unused)); | ||
| 990 | #ifdef __MigPackStructs | ||
| 991 | #pragma pack(pop) | ||
| 992 | #endif | ||
| 993 | |||
| 994 | #ifdef __MigPackStructs | ||
| 995 | #pragma pack(push, 4) | ||
| 996 | #endif | ||
| 997 | 	typedef struct { | ||
| 998 | 		mach_msg_header_t Head; | ||
| 999 | 		/* start of the kernel processed data */ | ||
| 1000 | 		mach_msg_body_t msgh_body; | ||
| 1001 | 		mach_msg_port_descriptor_t old_handlerss[32]; | ||
| 1002 | 		/* end of the kernel processed data */ | ||
| 1003 | 		NDR_record_t NDR; | ||
| 1004 | 		mach_msg_type_number_t masksCnt; | ||
| 1005 | 		exception_mask_t masks[32]; | ||
| 1006 | 		exception_behavior_t old_behaviors[32]; | ||
| 1007 | 		thread_state_flavor_t old_flavors[32]; | ||
| 1008 | 	} __Reply__host_swap_exception_ports_t __attribute__((unused)); | ||
| 1009 | #ifdef __MigPackStructs | ||
| 1010 | #pragma pack(pop) | ||
| 1011 | #endif | ||
| 1012 | |||
| 1013 | #ifdef __MigPackStructs | ||
| 1014 | #pragma pack(push, 4) | ||
| 1015 | #endif | ||
| 1016 | 	typedef struct { | ||
| 1017 | 		mach_msg_header_t Head; | ||
| 1018 | 		NDR_record_t NDR; | ||
| 1019 | 		kern_return_t RetCode; | ||
| 1020 | 	} __Reply__mach_vm_wire_t __attribute__((unused)); | ||
| 1021 | #ifdef __MigPackStructs | ||
| 1022 | #pragma pack(pop) | ||
| 1023 | #endif | ||
| 1024 | |||
| 1025 | #ifdef __MigPackStructs | ||
| 1026 | #pragma pack(push, 4) | ||
| 1027 | #endif | ||
| 1028 | 	typedef struct { | ||
| 1029 | 		mach_msg_header_t Head; | ||
| 1030 | 		/* start of the kernel processed data */ | ||
| 1031 | 		mach_msg_body_t msgh_body; | ||
| 1032 | 		mach_msg_ool_ports_descriptor_t processor_sets; | ||
| 1033 | 		/* end of the kernel processed data */ | ||
| 1034 | 		NDR_record_t NDR; | ||
| 1035 | 		mach_msg_type_number_t processor_setsCnt; | ||
| 1036 | 	} __Reply__host_processor_sets_t __attribute__((unused)); | ||
| 1037 | #ifdef __MigPackStructs | ||
| 1038 | #pragma pack(pop) | ||
| 1039 | #endif | ||
| 1040 | |||
| 1041 | #ifdef __MigPackStructs | ||
| 1042 | #pragma pack(push, 4) | ||
| 1043 | #endif | ||
| 1044 | 	typedef struct { | ||
| 1045 | 		mach_msg_header_t Head; | ||
| 1046 | 		/* start of the kernel processed data */ | ||
| 1047 | 		mach_msg_body_t msgh_body; | ||
| 1048 | 		mach_msg_port_descriptor_t set; | ||
| 1049 | 		/* end of the kernel processed data */ | ||
| 1050 | 	} __Reply__host_processor_set_priv_t __attribute__((unused)); | ||
| 1051 | #ifdef __MigPackStructs | ||
| 1052 | #pragma pack(pop) | ||
| 1053 | #endif | ||
| 1054 | |||
| 1055 | #ifdef __MigPackStructs | ||
| 1056 | #pragma pack(push, 4) | ||
| 1057 | #endif | ||
| 1058 | 	typedef struct { | ||
| 1059 | 		mach_msg_header_t Head; | ||
| 1060 | 		NDR_record_t NDR; | ||
| 1061 | 		kern_return_t RetCode; | ||
| 1062 | 	} __Reply__host_set_UNDServer_t __attribute__((unused)); | ||
| 1063 | #ifdef __MigPackStructs | ||
| 1064 | #pragma pack(pop) | ||
| 1065 | #endif | ||
| 1066 | |||
| 1067 | #ifdef __MigPackStructs | ||
| 1068 | #pragma pack(push, 4) | ||
| 1069 | #endif | ||
| 1070 | 	typedef struct { | ||
| 1071 | 		mach_msg_header_t Head; | ||
| 1072 | 		/* start of the kernel processed data */ | ||
| 1073 | 		mach_msg_body_t msgh_body; | ||
| 1074 | 		mach_msg_port_descriptor_t server; | ||
| 1075 | 		/* end of the kernel processed data */ | ||
| 1076 | 	} __Reply__host_get_UNDServer_t __attribute__((unused)); | ||
| 1077 | #ifdef __MigPackStructs | ||
| 1078 | #pragma pack(pop) | ||
| 1079 | #endif | ||
| 1080 | |||
| 1081 | #ifdef __MigPackStructs | ||
| 1082 | #pragma pack(push, 4) | ||
| 1083 | #endif | ||
| 1084 | 	typedef struct { | ||
| 1085 | 		mach_msg_header_t Head; | ||
| 1086 | 		/* start of the kernel processed data */ | ||
| 1087 | 		mach_msg_body_t msgh_body; | ||
| 1088 | 		mach_msg_ool_descriptor_t response_data; | ||
| 1089 | 		mach_msg_ool_descriptor_t log_data; | ||
| 1090 | 		/* end of the kernel processed data */ | ||
| 1091 | 		NDR_record_t NDR; | ||
| 1092 | 		mach_msg_type_number_t response_dataCnt; | ||
| 1093 | 		mach_msg_type_number_t log_dataCnt; | ||
| 1094 | 		kern_return_t op_result; | ||
| 1095 | 	} __Reply__kext_request_t __attribute__((unused)); | ||
| 1096 | #ifdef __MigPackStructs | ||
| 1097 | #pragma pack(pop) | ||
| 1098 | #endif | ||
| 1099 | #endif /* !__Reply__host_priv_subsystem__defined */ | ||
| 1100 | |||
| 1101 | /* union of all replies */ | ||
| 1102 | |||
| 1103 | #ifndef __ReplyUnion__host_priv_subsystem__defined | ||
| 1104 | #define __ReplyUnion__host_priv_subsystem__defined | ||
| 1105 | union __ReplyUnion__host_priv_subsystem { | ||
| 1106 | 	__Reply__host_get_boot_info_t Reply_host_get_boot_info; | ||
| 1107 | 	__Reply__host_reboot_t Reply_host_reboot; | ||
| 1108 | 	__Reply__host_priv_statistics_t Reply_host_priv_statistics; | ||
| 1109 | 	__Reply__host_default_memory_manager_t Reply_host_default_memory_manager; | ||
| 1110 | 	__Reply__vm_wire_t Reply_vm_wire; | ||
| 1111 | 	__Reply__thread_wire_t Reply_thread_wire; | ||
| 1112 | 	__Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm; | ||
| 1113 | 	__Reply__host_processors_t Reply_host_processors; | ||
| 1114 | 	__Reply__host_get_clock_control_t Reply_host_get_clock_control; | ||
| 1115 | 	__Reply__kmod_create_t Reply_kmod_create; | ||
| 1116 | 	__Reply__kmod_destroy_t Reply_kmod_destroy; | ||
| 1117 | 	__Reply__kmod_control_t Reply_kmod_control; | ||
| 1118 | 	__Reply__host_get_special_port_t Reply_host_get_special_port; | ||
| 1119 | 	__Reply__host_set_special_port_t Reply_host_set_special_port; | ||
| 1120 | 	__Reply__host_set_exception_ports_t Reply_host_set_exception_ports; | ||
| 1121 | 	__Reply__host_get_exception_ports_t Reply_host_get_exception_ports; | ||
| 1122 | 	__Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports; | ||
| 1123 | 	__Reply__mach_vm_wire_t Reply_mach_vm_wire; | ||
| 1124 | 	__Reply__host_processor_sets_t Reply_host_processor_sets; | ||
| 1125 | 	__Reply__host_processor_set_priv_t Reply_host_processor_set_priv; | ||
| 1126 | 	__Reply__host_set_UNDServer_t Reply_host_set_UNDServer; | ||
| 1127 | 	__Reply__host_get_UNDServer_t Reply_host_get_UNDServer; | ||
| 1128 | 	__Reply__kext_request_t Reply_kext_request; | ||
| 1129 | }; | ||
| 1130 | #endif /* !__RequestUnion__host_priv_subsystem__defined */ | ||
| 1131 | |||
| 1132 | #ifndef subsystem_to_name_map_host_priv | ||
| 1133 | #define subsystem_to_name_map_host_priv \ | ||
| 1134 | { "host_get_boot_info", 400 },\ | ||
| 1135 | { "host_reboot", 401 },\ | ||
| 1136 | { "host_priv_statistics", 402 },\ | ||
| 1137 | { "host_default_memory_manager", 403 },\ | ||
| 1138 | { "vm_wire", 404 },\ | ||
| 1139 | { "thread_wire", 405 },\ | ||
| 1140 | { "vm_allocate_cpm", 406 },\ | ||
| 1141 | { "host_processors", 407 },\ | ||
| 1142 | { "host_get_clock_control", 408 },\ | ||
| 1143 | { "kmod_create", 409 },\ | ||
| 1144 | { "kmod_destroy", 410 },\ | ||
| 1145 | { "kmod_control", 411 },\ | ||
| 1146 | { "host_get_special_port", 412 },\ | ||
| 1147 | { "host_set_special_port", 413 },\ | ||
| 1148 | { "host_set_exception_ports", 414 },\ | ||
| 1149 | { "host_get_exception_ports", 415 },\ | ||
| 1150 | { "host_swap_exception_ports", 416 },\ | ||
| 1151 | { "mach_vm_wire", 418 },\ | ||
| 1152 | { "host_processor_sets", 419 },\ | ||
| 1153 | { "host_processor_set_priv", 420 },\ | ||
| 1154 | { "host_set_UNDServer", 423 },\ | ||
| 1155 | { "host_get_UNDServer", 424 },\ | ||
| 1156 | { "kext_request", 425 } | ||
| 1157 | #endif | ||
| 1158 | |||
| 1159 | #ifdef __AfterMigUserHeader | ||
| 1160 | __AfterMigUserHeader | ||
| 1161 | #endif /* __AfterMigUserHeader */ | ||
| 1162 | |||
| 1163 | #endif	 /* _host_priv_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/host_security.h created+221| ... | @@ -0,0 +1,221 @@ | ||
| 1 | #ifndef	_host_security_user_ | ||
| 2 | #define	_host_security_user_ | ||
| 3 | |||
| 4 | /* Module host_security */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	host_security_MSG_COUNT | ||
| 52 | #define	host_security_MSG_COUNT	2 | ||
| 53 | #endif	/* host_security_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | |||
| 60 | #ifdef __BeforeMigUserHeader | ||
| 61 | __BeforeMigUserHeader | ||
| 62 | #endif /* __BeforeMigUserHeader */ | ||
| 63 | |||
| 64 | #include <sys/cdefs.h> | ||
| 65 | __BEGIN_DECLS | ||
| 66 | |||
| 67 | |||
| 68 | /* Routine host_security_create_task_token */ | ||
| 69 | #ifdef	mig_external | ||
| 70 | mig_external | ||
| 71 | #else | ||
| 72 | extern | ||
| 73 | #endif	/* mig_external */ | ||
| 74 | kern_return_t host_security_create_task_token | ||
| 75 | ( | ||
| 76 | 	host_security_t host_security, | ||
| 77 | 	task_t parent_task, | ||
| 78 | 	security_token_t sec_token, | ||
| 79 | 	audit_token_t audit_token, | ||
| 80 | 	host_t host, | ||
| 81 | 	ledger_array_t ledgers, | ||
| 82 | 	mach_msg_type_number_t ledgersCnt, | ||
| 83 | 	boolean_t inherit_memory, | ||
| 84 | 	task_t *child_task | ||
| 85 | ); | ||
| 86 | |||
| 87 | /* Routine host_security_set_task_token */ | ||
| 88 | #ifdef	mig_external | ||
| 89 | mig_external | ||
| 90 | #else | ||
| 91 | extern | ||
| 92 | #endif	/* mig_external */ | ||
| 93 | kern_return_t host_security_set_task_token | ||
| 94 | ( | ||
| 95 | 	host_security_t host_security, | ||
| 96 | 	task_t target_task, | ||
| 97 | 	security_token_t sec_token, | ||
| 98 | 	audit_token_t audit_token, | ||
| 99 | 	host_t host | ||
| 100 | ); | ||
| 101 | |||
| 102 | __END_DECLS | ||
| 103 | |||
| 104 | /********************** Caution **************************/ | ||
| 105 | /* The following data types should be used to calculate */ | ||
| 106 | /* maximum message sizes only. The actual message may be */ | ||
| 107 | /* smaller, and the position of the arguments within the */ | ||
| 108 | /* message layout may vary from what is presented here. */ | ||
| 109 | /* For example, if any of the arguments are variable- */ | ||
| 110 | /* sized, and less than the maximum is sent, the data */ | ||
| 111 | /* will be packed tight in the actual message to reduce */ | ||
| 112 | /* the presence of holes. */ | ||
| 113 | /********************** Caution **************************/ | ||
| 114 | |||
| 115 | /* typedefs for all requests */ | ||
| 116 | |||
| 117 | #ifndef __Request__host_security_subsystem__defined | ||
| 118 | #define __Request__host_security_subsystem__defined | ||
| 119 | |||
| 120 | #ifdef __MigPackStructs | ||
| 121 | #pragma pack(push, 4) | ||
| 122 | #endif | ||
| 123 | 	typedef struct { | ||
| 124 | 		mach_msg_header_t Head; | ||
| 125 | 		/* start of the kernel processed data */ | ||
| 126 | 		mach_msg_body_t msgh_body; | ||
| 127 | 		mach_msg_port_descriptor_t parent_task; | ||
| 128 | 		mach_msg_port_descriptor_t host; | ||
| 129 | 		mach_msg_ool_ports_descriptor_t ledgers; | ||
| 130 | 		/* end of the kernel processed data */ | ||
| 131 | 		NDR_record_t NDR; | ||
| 132 | 		security_token_t sec_token; | ||
| 133 | 		audit_token_t audit_token; | ||
| 134 | 		mach_msg_type_number_t ledgersCnt; | ||
| 135 | 		boolean_t inherit_memory; | ||
| 136 | 	} __Request__host_security_create_task_token_t __attribute__((unused)); | ||
| 137 | #ifdef __MigPackStructs | ||
| 138 | #pragma pack(pop) | ||
| 139 | #endif | ||
| 140 | |||
| 141 | #ifdef __MigPackStructs | ||
| 142 | #pragma pack(push, 4) | ||
| 143 | #endif | ||
| 144 | 	typedef struct { | ||
| 145 | 		mach_msg_header_t Head; | ||
| 146 | 		/* start of the kernel processed data */ | ||
| 147 | 		mach_msg_body_t msgh_body; | ||
| 148 | 		mach_msg_port_descriptor_t target_task; | ||
| 149 | 		mach_msg_port_descriptor_t host; | ||
| 150 | 		/* end of the kernel processed data */ | ||
| 151 | 		NDR_record_t NDR; | ||
| 152 | 		security_token_t sec_token; | ||
| 153 | 		audit_token_t audit_token; | ||
| 154 | 	} __Request__host_security_set_task_token_t __attribute__((unused)); | ||
| 155 | #ifdef __MigPackStructs | ||
| 156 | #pragma pack(pop) | ||
| 157 | #endif | ||
| 158 | #endif /* !__Request__host_security_subsystem__defined */ | ||
| 159 | |||
| 160 | /* union of all requests */ | ||
| 161 | |||
| 162 | #ifndef __RequestUnion__host_security_subsystem__defined | ||
| 163 | #define __RequestUnion__host_security_subsystem__defined | ||
| 164 | union __RequestUnion__host_security_subsystem { | ||
| 165 | 	__Request__host_security_create_task_token_t Request_host_security_create_task_token; | ||
| 166 | 	__Request__host_security_set_task_token_t Request_host_security_set_task_token; | ||
| 167 | }; | ||
| 168 | #endif /* !__RequestUnion__host_security_subsystem__defined */ | ||
| 169 | /* typedefs for all replies */ | ||
| 170 | |||
| 171 | #ifndef __Reply__host_security_subsystem__defined | ||
| 172 | #define __Reply__host_security_subsystem__defined | ||
| 173 | |||
| 174 | #ifdef __MigPackStructs | ||
| 175 | #pragma pack(push, 4) | ||
| 176 | #endif | ||
| 177 | 	typedef struct { | ||
| 178 | 		mach_msg_header_t Head; | ||
| 179 | 		/* start of the kernel processed data */ | ||
| 180 | 		mach_msg_body_t msgh_body; | ||
| 181 | 		mach_msg_port_descriptor_t child_task; | ||
| 182 | 		/* end of the kernel processed data */ | ||
| 183 | 	} __Reply__host_security_create_task_token_t __attribute__((unused)); | ||
| 184 | #ifdef __MigPackStructs | ||
| 185 | #pragma pack(pop) | ||
| 186 | #endif | ||
| 187 | |||
| 188 | #ifdef __MigPackStructs | ||
| 189 | #pragma pack(push, 4) | ||
| 190 | #endif | ||
| 191 | 	typedef struct { | ||
| 192 | 		mach_msg_header_t Head; | ||
| 193 | 		NDR_record_t NDR; | ||
| 194 | 		kern_return_t RetCode; | ||
| 195 | 	} __Reply__host_security_set_task_token_t __attribute__((unused)); | ||
| 196 | #ifdef __MigPackStructs | ||
| 197 | #pragma pack(pop) | ||
| 198 | #endif | ||
| 199 | #endif /* !__Reply__host_security_subsystem__defined */ | ||
| 200 | |||
| 201 | /* union of all replies */ | ||
| 202 | |||
| 203 | #ifndef __ReplyUnion__host_security_subsystem__defined | ||
| 204 | #define __ReplyUnion__host_security_subsystem__defined | ||
| 205 | union __ReplyUnion__host_security_subsystem { | ||
| 206 | 	__Reply__host_security_create_task_token_t Reply_host_security_create_task_token; | ||
| 207 | 	__Reply__host_security_set_task_token_t Reply_host_security_set_task_token; | ||
| 208 | }; | ||
| 209 | #endif /* !__RequestUnion__host_security_subsystem__defined */ | ||
| 210 | |||
| 211 | #ifndef subsystem_to_name_map_host_security | ||
| 212 | #define subsystem_to_name_map_host_security \ | ||
| 213 | { "host_security_create_task_token", 600 },\ | ||
| 214 | { "host_security_set_task_token", 601 } | ||
| 215 | #endif | ||
| 216 | |||
| 217 | #ifdef __AfterMigUserHeader | ||
| 218 | __AfterMigUserHeader | ||
| 219 | #endif /* __AfterMigUserHeader */ | ||
| 220 | |||
| 221 | #endif	 /* _host_security_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/host_special_ports.h created+281| ... | @@ -0,0 +1,281 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/host_special_ports.h | ||
| 60 | * | ||
| 61 | *	Defines codes for access to host-wide special ports. | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _MACH_HOST_SPECIAL_PORTS_H_ | ||
| 65 | #define _MACH_HOST_SPECIAL_PORTS_H_ | ||
| 66 | |||
| 67 | /* | ||
| 68 | * Cannot be set or gotten from user space | ||
| 69 | */ | ||
| 70 | #define HOST_SECURITY_PORT 0 | ||
| 71 | |||
| 72 | #define HOST_MIN_SPECIAL_PORT HOST_SECURITY_PORT | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Always provided by kernel (cannot be set from user-space). | ||
| 76 | */ | ||
| 77 | #define HOST_PORT 1 | ||
| 78 | #define HOST_PRIV_PORT 2 | ||
| 79 | #define HOST_IO_MASTER_PORT 3 | ||
| 80 | #define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */ | ||
| 81 | |||
| 82 | #define HOST_LAST_SPECIAL_KERNEL_PORT HOST_IO_MASTER_PORT | ||
| 83 | |||
| 84 | /* | ||
| 85 | * Not provided by kernel | ||
| 86 | */ | ||
| 87 | #define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 88 | #define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 89 | #define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 90 | #define HOST_AUTOMOUNTD_PORT (4 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 91 | #define HOST_LOCKD_PORT (5 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 92 | #define HOST_KTRACE_BACKGROUND_PORT (6 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 93 | #define HOST_SEATBELT_PORT (7 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 94 | #define HOST_KEXTD_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 95 | #define HOST_LAUNCHCTL_PORT (9 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 96 | #define HOST_UNFREED_PORT (10 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 97 | #define HOST_AMFID_PORT (11 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 98 | #define HOST_GSSD_PORT (12 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 99 | #define HOST_TELEMETRY_PORT (13 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 100 | #define HOST_ATM_NOTIFICATION_PORT (14 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 101 | #define HOST_COALITION_PORT (15 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 102 | #define HOST_SYSDIAGNOSE_PORT (16 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 103 | #define HOST_XPC_EXCEPTION_PORT (17 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 104 | #define HOST_CONTAINERD_PORT (18 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 105 | #define HOST_NODE_PORT (19 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 106 | #define HOST_RESOURCE_NOTIFY_PORT (20 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 107 | #define HOST_CLOSURED_PORT (21 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 108 | #define HOST_SYSPOLICYD_PORT (22 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 109 | #define HOST_FILECOORDINATIOND_PORT (23 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 110 | #define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT) | ||
| 111 | |||
| 112 | #define HOST_MAX_SPECIAL_PORT HOST_FAIRPLAYD_PORT | ||
| 113 | /* MAX = last since rdar://35861175 */ | ||
| 114 | |||
| 115 | /* obsolete name */ | ||
| 116 | #define HOST_CHUD_PORT HOST_LAUNCHCTL_PORT | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Special node identifier to always represent the local node. | ||
| 120 | */ | ||
| 121 | #define HOST_LOCAL_NODE -1 | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Definitions for ease of use. | ||
| 125 | * | ||
| 126 | * In the get call, the host parameter can be any host, but will generally | ||
| 127 | * be the local node host port. In the set call, the host must the per-node | ||
| 128 | * host port for the node being affected. | ||
| 129 | */ | ||
| 130 | #define host_get_host_port(host, port) \ | ||
| 131 | 	(host_get_special_port((host), \ | ||
| 132 | 	HOST_LOCAL_NODE, HOST_PORT, (port))) | ||
| 133 | #define host_set_host_port(host, port) (KERN_INVALID_ARGUMENT) | ||
| 134 | |||
| 135 | #define host_get_host_priv_port(host, port) \ | ||
| 136 | 	(host_get_special_port((host), \ | ||
| 137 | 	HOST_LOCAL_NODE, HOST_PRIV_PORT, (port))) | ||
| 138 | #define host_set_host_priv_port(host, port) (KERN_INVALID_ARGUMENT) | ||
| 139 | |||
| 140 | #define host_get_io_master_port(host, port) \ | ||
| 141 | 	(host_get_special_port((host), \ | ||
| 142 | 	HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port))) | ||
| 143 | #define host_set_io_master_port(host, port) (KERN_INVALID_ARGUMENT) | ||
| 144 | |||
| 145 | /* | ||
| 146 | * User-settable special ports. | ||
| 147 | */ | ||
| 148 | #define host_get_dynamic_pager_port(host, port) \ | ||
| 149 | 	(host_get_special_port((host), \ | ||
| 150 | 	HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port))) | ||
| 151 | #define host_set_dynamic_pager_port(host, port) \ | ||
| 152 | 	(host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port))) | ||
| 153 | |||
| 154 | #define host_get_audit_control_port(host, port) \ | ||
| 155 | 	(host_get_special_port((host), \ | ||
| 156 | 	HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port))) | ||
| 157 | #define host_set_audit_control_port(host, port) \ | ||
| 158 | 	(host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port))) | ||
| 159 | |||
| 160 | #define host_get_user_notification_port(host, port) \ | ||
| 161 | 	(host_get_special_port((host), \ | ||
| 162 | 	HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port))) | ||
| 163 | #define host_set_user_notification_port(host, port) \ | ||
| 164 | 	(host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port))) | ||
| 165 | |||
| 166 | #define host_get_automountd_port(host, port) \ | ||
| 167 | 	(host_get_special_port((host), \ | ||
| 168 | 	HOST_LOCAL_NODE, HOST_AUTOMOUNTD_PORT, (port))) | ||
| 169 | #define host_set_automountd_port(host, port) \ | ||
| 170 | 	(host_set_special_port((host), HOST_AUTOMOUNTD_PORT, (port))) | ||
| 171 | |||
| 172 | #define host_get_lockd_port(host, port) \ | ||
| 173 | 	(host_get_special_port((host), \ | ||
| 174 | 	HOST_LOCAL_NODE, HOST_LOCKD_PORT, (port))) | ||
| 175 | #define host_set_lockd_port(host, port) \ | ||
| 176 | 	(host_set_special_port((host), HOST_LOCKD_PORT, (port))) | ||
| 177 | |||
| 178 | #define host_get_ktrace_background_port(host, port) \ | ||
| 179 | 	(host_get_special_port((host), \ | ||
| 180 | 	HOST_LOCAL_NODE, HOST_KTRACE_BACKGROUND_PORT, (port))) | ||
| 181 | #define host_set_ktrace_background_port(host, port) \ | ||
| 182 | 	(host_set_special_port((host), HOST_KTRACE_BACKGROUND_PORT, (port))) | ||
| 183 | |||
| 184 | #define host_get_kextd_port(host, port) \ | ||
| 185 | 	(host_get_special_port((host), \ | ||
| 186 | 	HOST_LOCAL_NODE, HOST_KEXTD_PORT, (port))) | ||
| 187 | #define host_set_kextd_port(host, port) \ | ||
| 188 | 	(host_set_special_port((host), HOST_KEXTD_PORT, (port))) | ||
| 189 | |||
| 190 | #define host_get_launchctl_port(host, port) \ | ||
| 191 | 	(host_get_special_port((host), HOST_LOCAL_NODE, HOST_LAUNCHCTL_PORT, \ | ||
| 192 | 	(port))) | ||
| 193 | #define host_set_launchctl_port(host, port) \ | ||
| 194 | 	(host_set_special_port((host), HOST_LAUNCHCTL_PORT, (port))) | ||
| 195 | |||
| 196 | #define host_get_chud_port(host, port) host_get_launchctl_port(host, port) | ||
| 197 | #define host_set_chud_port(host, port) host_set_launchctl_port(host, port) | ||
| 198 | |||
| 199 | #define host_get_unfreed_port(host, port) \ | ||
| 200 | 	(host_get_special_port((host), \ | ||
| 201 | 	HOST_LOCAL_NODE, HOST_UNFREED_PORT, (port))) | ||
| 202 | #define host_set_unfreed_port(host, port) \ | ||
| 203 | 	(host_set_special_port((host), HOST_UNFREED_PORT, (port))) | ||
| 204 | |||
| 205 | #define host_get_amfid_port(host, port) \ | ||
| 206 | 	(host_get_special_port((host), \ | ||
| 207 | 	HOST_LOCAL_NODE, HOST_AMFID_PORT, (port))) | ||
| 208 | #define host_set_amfid_port(host, port) \ | ||
| 209 | 	(host_set_special_port((host), HOST_AMFID_PORT, (port))) | ||
| 210 | |||
| 211 | #define host_get_gssd_port(host, port) \ | ||
| 212 | 	(host_get_special_port((host), \ | ||
| 213 | 	HOST_LOCAL_NODE, HOST_GSSD_PORT, (port))) | ||
| 214 | #define host_set_gssd_port(host, port) \ | ||
| 215 | 	(host_set_special_port((host), HOST_GSSD_PORT, (port))) | ||
| 216 | |||
| 217 | #define host_get_telemetry_port(host, port) \ | ||
| 218 | 	(host_get_special_port((host), \ | ||
| 219 | 	HOST_LOCAL_NODE, HOST_TELEMETRY_PORT, (port))) | ||
| 220 | #define host_set_telemetry_port(host, port) \ | ||
| 221 | 	(host_set_special_port((host), HOST_TELEMETRY_PORT, (port))) | ||
| 222 | |||
| 223 | #define host_get_atm_notification_port(host, port) \ | ||
| 224 | 	(host_get_special_port((host), \ | ||
| 225 | 	HOST_LOCAL_NODE, HOST_ATM_NOTIFICATION_PORT, (port))) | ||
| 226 | #define host_set_atm_notification_port(host, port) \ | ||
| 227 | 	(host_set_special_port((host), HOST_ATM_NOTIFICATION_PORT, (port))) | ||
| 228 | |||
| 229 | #define host_get_coalition_port(host, port) \ | ||
| 230 | 	(host_get_special_port((host), \ | ||
| 231 | 	HOST_LOCAL_NODE, HOST_COALITION_PORT, (port))) | ||
| 232 | #define host_set_coalition_port(host, port) \ | ||
| 233 | 	(host_set_special_port((host), HOST_COALITION_PORT, (port))) | ||
| 234 | |||
| 235 | #define host_get_sysdiagnose_port(host, port) \ | ||
| 236 | 	(host_get_special_port((host), \ | ||
| 237 | 	HOST_LOCAL_NODE, HOST_SYSDIAGNOSE_PORT, (port))) | ||
| 238 | #define host_set_sysdiagnose_port(host, port) \ | ||
| 239 | 	(host_set_special_port((host), HOST_SYSDIAGNOSE_PORT, (port))) | ||
| 240 | |||
| 241 | #define host_get_container_port(host, port) \ | ||
| 242 | 	(host_get_special_port((host), \ | ||
| 243 | 	HOST_LOCAL_NODE, HOST_CONTAINERD_PORT, (port))) | ||
| 244 | #define host_set_container_port(host, port) \ | ||
| 245 | 	(host_set_special_port((host), HOST_CONTAINERD_PORT, (port))) | ||
| 246 | |||
| 247 | #define host_get_node_port(host, port) \ | ||
| 248 | 	(host_get_special_port((host), \ | ||
| 249 | 	HOST_LOCAL_NODE, HOST_NODE_PORT, (port))) | ||
| 250 | #define host_set_node_port(host, port) \ | ||
| 251 | 	(host_set_special_port((host), HOST_NODE_PORT, (port))) | ||
| 252 | |||
| 253 | #define host_get_closured_port(host, port) \ | ||
| 254 | 	(host_get_special_port((host), \ | ||
| 255 | 	HOST_LOCAL_NODE, HOST_CLOSURED_PORT, (port))) | ||
| 256 | #define host_set_closured_port(host, port) \ | ||
| 257 | 	(host_set_special_port((host), HOST_CLOSURED_PORT, (port))) | ||
| 258 | |||
| 259 | #define host_get_syspolicyd_port(host, port) \ | ||
| 260 | 	(host_get_special_port((host), \ | ||
| 261 | 	HOST_LOCAL_NODE, HOST_SYSPOLICYD_PORT, (port))) | ||
| 262 | #define host_set_syspolicyd_port(host, port) \ | ||
| 263 | 	(host_set_special_port((host), HOST_SYSPOLICYD_PORT, (port))) | ||
| 264 | |||
| 265 | #define host_get_filecoordinationd_port(host, port) \ | ||
| 266 | 	(host_get_special_port((host), \ | ||
| 267 | 	HOST_LOCAL_NODE, HOST_FILECOORDINATIOND_PORT, (port))) | ||
| 268 | #define host_set_filecoordinationd_port(host, port) \ | ||
| 269 | 	(host_set_special_port((host), HOST_FILECOORDINATIOND_PORT, (port))) | ||
| 270 | |||
| 271 | #define host_get_fairplayd_port(host, port) \ | ||
| 272 | 	(host_get_special_port((host), \ | ||
| 273 | 	HOST_LOCAL_NODE, HOST_FAIRPLAYD_PORT, (port))) | ||
| 274 | #define host_set_fairplayd_port(host, port) \ | ||
| 275 | 	(host_set_special_port((host), HOST_FAIRPLAYD_PORT, (port))) | ||
| 276 | |||
| 277 | /* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences. | ||
| 278 | * All lookups go through send_resource_violation() | ||
| 279 | */ | ||
| 280 | |||
| 281 | #endif /* _MACH_HOST_SPECIAL_PORTS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h+80| ... | @@ -603,7 +603,48 @@ _STRUCT_X86_DEBUG_STATE32 | ... | @@ -603,7 +603,48 @@ _STRUCT_X86_DEBUG_STATE32 |
| 603 | 	unsigned int	__dr6; | 603 | 	unsigned int	__dr6; |
| 604 | 	unsigned int	__dr7; | 604 | 	unsigned int	__dr7; |
| 605 | }; | 605 | }; |
| 606 | |||
| 607 | #define _STRUCT_X86_INSTRUCTION_STATE	struct __x86_instruction_state | ||
| 608 | _STRUCT_X86_INSTRUCTION_STATE | ||
| 609 | { | ||
| 610 | int		__insn_stream_valid_bytes; | ||
| 611 | int		__insn_offset; | ||
| 612 | 	int		__out_of_synch;	/* | ||
| 613 | 					 * non-zero when the cacheline that includes the insn_offset | ||
| 614 | 					 * is replaced in the insn_bytes array due to a mismatch | ||
| 615 | 					 * detected when comparing it with the same cacheline in memory | ||
| 616 | 					 */ | ||
| 617 | #define _X86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4) | ||
| 618 | __uint8_t	__insn_bytes[_X86_INSTRUCTION_STATE_MAX_INSN_BYTES]; | ||
| 619 | #define _X86_INSTRUCTION_STATE_CACHELINE_SIZE	64 | ||
| 620 | 	__uint8_t	__insn_cacheline[_X86_INSTRUCTION_STATE_CACHELINE_SIZE]; | ||
| 621 | }; | ||
| 622 | |||
| 623 | #define _STRUCT_LAST_BRANCH_RECORD	struct __last_branch_record | ||
| 624 | _STRUCT_LAST_BRANCH_RECORD | ||
| 625 | { | ||
| 626 | 	__uint64_t	__from_ip; | ||
| 627 | 	__uint64_t	__to_ip; | ||
| 628 | 	__uint32_t	__mispredict : 1, | ||
| 629 | 			__tsx_abort : 1, | ||
| 630 | 			__in_tsx : 1, | ||
| 631 | 			__cycle_count: 16, | ||
| 632 | 			__reserved : 13; | ||
| 633 | }; | ||
| 634 | |||
| 635 | #define _STRUCT_LAST_BRANCH_STATE	struct __last_branch_state | ||
| 636 | _STRUCT_LAST_BRANCH_STATE | ||
| 637 | { | ||
| 638 | int				__lbr_count; | ||
| 639 | 	__uint32_t			__lbr_supported_tsx : 1, | ||
| 640 | 					__lbr_supported_cycle_count : 1, | ||
| 641 | 					__reserved : 30; | ||
| 642 | #define	__LASTBRANCH_MAX	32 | ||
| 643 | 	_STRUCT_LAST_BRANCH_RECORD	__lbrs[__LASTBRANCH_MAX]; | ||
| 644 | }; | ||
| 645 | |||
| 606 | #else /* !__DARWIN_UNIX03 */ | 646 | #else /* !__DARWIN_UNIX03 */ |
| 647 | |||
| 607 | #define _STRUCT_X86_DEBUG_STATE32	struct x86_debug_state32 | 648 | #define _STRUCT_X86_DEBUG_STATE32	struct x86_debug_state32 |
| 608 | _STRUCT_X86_DEBUG_STATE32 | 649 | _STRUCT_X86_DEBUG_STATE32 |
| 609 | { | 650 | { |
| ... | @@ -616,6 +657,45 @@ _STRUCT_X86_DEBUG_STATE32 | ... | @@ -616,6 +657,45 @@ _STRUCT_X86_DEBUG_STATE32 |
| 616 | 	unsigned int	dr6; | 657 | 	unsigned int	dr6; |
| 617 | 	unsigned int	dr7; | 658 | 	unsigned int	dr7; |
| 618 | }; | 659 | }; |
| 660 | |||
| 661 | #define _STRUCT_X86_INSTRUCTION_STATE	struct __x86_instruction_state | ||
| 662 | _STRUCT_X86_INSTRUCTION_STATE | ||
| 663 | { | ||
| 664 | int		insn_stream_valid_bytes; | ||
| 665 | int		insn_offset; | ||
| 666 | 	int		out_of_synch;	/* | ||
| 667 | 					 * non-zero when the cacheline that includes the insn_offset | ||
| 668 | 					 * is replaced in the insn_bytes array due to a mismatch | ||
| 669 | 					 * detected when comparing it with the same cacheline in memory | ||
| 670 | 					 */ | ||
| 671 | #define x86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4) | ||
| 672 | __uint8_t	insn_bytes[x86_INSTRUCTION_STATE_MAX_INSN_BYTES]; | ||
| 673 | #define x86_INSTRUCTION_STATE_CACHELINE_SIZE	64 | ||
| 674 | 	__uint8_t	insn_cacheline[x86_INSTRUCTION_STATE_CACHELINE_SIZE]; | ||
| 675 | }; | ||
| 676 | |||
| 677 | #define _STRUCT_LAST_BRANCH_RECORD	struct __last_branch_record | ||
| 678 | _STRUCT_LAST_BRANCH_RECORD | ||
| 679 | { | ||
| 680 | 	__uint64_t	from_ip; | ||
| 681 | 	__uint64_t	to_ip; | ||
| 682 | 	__uint32_t	mispredict : 1, | ||
| 683 | 			tsx_abort : 1, | ||
| 684 | 			in_tsx : 1, | ||
| 685 | 			cycle_count: 16, | ||
| 686 | 			reserved : 13; | ||
| 687 | }; | ||
| 688 | |||
| 689 | #define _STRUCT_LAST_BRANCH_STATE	struct __last_branch_state | ||
| 690 | _STRUCT_LAST_BRANCH_STATE | ||
| 691 | { | ||
| 692 | int				lbr_count; | ||
| 693 | 	__uint32_t			lbr_supported_tsx : 1, | ||
| 694 | 					lbr_supported_cycle_count : 1, | ||
| 695 | 					reserved : 30; | ||
| 696 | #define	__LASTBRANCH_MAX	32 | ||
| 697 | 	_STRUCT_LAST_BRANCH_RECORD	lbrs[__LASTBRANCH_MAX]; | ||
| 698 | }; | ||
| 619 | #endif /* !__DARWIN_UNIX03 */ | 699 | #endif /* !__DARWIN_UNIX03 */ |
| 620 | 700 | ||
| 621 | #define	_STRUCT_X86_PAGEIN_STATE	struct __x86_pagein_state | 701 | #define	_STRUCT_X86_PAGEIN_STATE	struct __x86_pagein_state |
lib/libc/include/x86_64-macos-gnu/mach/i386/boolean.h created+74| ... | @@ -0,0 +1,74 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | /* | ||
| 60 | *	File:	boolean.h | ||
| 61 | * | ||
| 62 | *	Boolean type, for I386. | ||
| 63 | */ | ||
| 64 | |||
| 65 | #ifndef _MACH_I386_BOOLEAN_H_ | ||
| 66 | #define _MACH_I386_BOOLEAN_H_ | ||
| 67 | |||
| 68 | #if defined(__x86_64__) && !defined(KERNEL) | ||
| 69 | typedef unsigned int boolean_t; | ||
| 70 | #else | ||
| 71 | typedef int boolean_t; | ||
| 72 | #endif | ||
| 73 | |||
| 74 | #endif /* _MACH_I386_BOOLEAN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/exception.h created+135| ... | @@ -0,0 +1,135 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_I386_EXCEPTION_H_ | ||
| 60 | #define _MACH_I386_EXCEPTION_H_ | ||
| 61 | |||
| 62 | /* | ||
| 63 | * No machine dependent types for the 80386 | ||
| 64 | */ | ||
| 65 | |||
| 66 | #define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */ | ||
| 67 | |||
| 68 | /* | ||
| 69 | *	Codes and subcodes for 80386 exceptions. | ||
| 70 | */ | ||
| 71 | |||
| 72 | #define EXCEPTION_CODE_MAX 2 /* currently code and subcode */ | ||
| 73 | |||
| 74 | /* | ||
| 75 | *	EXC_BAD_INSTRUCTION | ||
| 76 | */ | ||
| 77 | |||
| 78 | #define EXC_I386_INVOP 1 | ||
| 79 | |||
| 80 | /* | ||
| 81 | *	EXC_ARITHMETIC | ||
| 82 | */ | ||
| 83 | |||
| 84 | #define EXC_I386_DIV 1 | ||
| 85 | #define EXC_I386_INTO 2 | ||
| 86 | #define EXC_I386_NOEXT 3 | ||
| 87 | #define EXC_I386_EXTOVR 4 | ||
| 88 | #define EXC_I386_EXTERR 5 | ||
| 89 | #define EXC_I386_EMERR 6 | ||
| 90 | #define EXC_I386_BOUND 7 | ||
| 91 | #define EXC_I386_SSEEXTERR 8 | ||
| 92 | |||
| 93 | /* | ||
| 94 | *	EXC_SOFTWARE | ||
| 95 | *	Note: 0x10000-0x10003 in use for unix signal | ||
| 96 | */ | ||
| 97 | |||
| 98 | /* | ||
| 99 | *	EXC_BAD_ACCESS | ||
| 100 | */ | ||
| 101 | |||
| 102 | /* | ||
| 103 | *	EXC_BREAKPOINT | ||
| 104 | */ | ||
| 105 | |||
| 106 | #define EXC_I386_SGL 1 | ||
| 107 | #define EXC_I386_BPT 2 | ||
| 108 | |||
| 109 | #define EXC_I386_DIVERR 0 /* divide by 0 eprror		*/ | ||
| 110 | #define EXC_I386_SGLSTP 1 /* single step			*/ | ||
| 111 | #define EXC_I386_NMIFLT 2 /* NMI				*/ | ||
| 112 | #define EXC_I386_BPTFLT 3 /* breakpoint fault		*/ | ||
| 113 | #define EXC_I386_INTOFLT 4 /* INTO overflow fault		*/ | ||
| 114 | #define EXC_I386_BOUNDFLT 5 /* BOUND instruction fault	*/ | ||
| 115 | #define EXC_I386_INVOPFLT 6 /* invalid opcode fault		*/ | ||
| 116 | #define EXC_I386_NOEXTFLT 7 /* extension not available fault*/ | ||
| 117 | #define EXC_I386_DBLFLT 8 /* double fault			*/ | ||
| 118 | #define EXC_I386_EXTOVRFLT 9 /* extension overrun fault	*/ | ||
| 119 | #define EXC_I386_INVTSSFLT 10 /* invalid TSS fault		*/ | ||
| 120 | #define EXC_I386_SEGNPFLT 11 /* segment not present fault	*/ | ||
| 121 | #define EXC_I386_STKFLT 12 /* stack fault			*/ | ||
| 122 | #define EXC_I386_GPFLT 13 /* general protection fault	*/ | ||
| 123 | #define EXC_I386_PGFLT 14 /* page fault			*/ | ||
| 124 | #define EXC_I386_EXTERRFLT 16 /* extension error fault	*/ | ||
| 125 | #define EXC_I386_ALIGNFLT 17 /* Alignment fault */ | ||
| 126 | #define EXC_I386_ENDPERR 33 /* emulated extension error flt	*/ | ||
| 127 | #define EXC_I386_ENOEXTFLT 32 /* emulated ext not present	*/ | ||
| 128 | |||
| 129 | |||
| 130 | /* | ||
| 131 | *	machine dependent exception masks | ||
| 132 | */ | ||
| 133 | #define EXC_MASK_MACHINE 0 | ||
| 134 | |||
| 135 | #endif /* _MACH_I386_EXCEPTION_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/fp_reg.h created+118| ... | @@ -0,0 +1,118 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1992-1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _I386_FP_SAVE_H_ | ||
| 60 | #define _I386_FP_SAVE_H_ | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Control register | ||
| 64 | */ | ||
| 65 | #define FPC_IE 0x0001 /* enable invalid operation | ||
| 66 | 	 * exception */ | ||
| 67 | #define FPC_IM FPC_IE | ||
| 68 | #define FPC_DE 0x0002 /* enable denormalized operation | ||
| 69 | 	 * exception */ | ||
| 70 | #define FPC_DM FPC_DE | ||
| 71 | #define FPC_ZE 0x0004 /* enable zero-divide exception */ | ||
| 72 | #define FPC_ZM FPC_ZE | ||
| 73 | #define FPC_OE 0x0008 /* enable overflow exception */ | ||
| 74 | #define FPC_OM FPC_OE | ||
| 75 | #define FPC_UE 0x0010 /* enable underflow exception */ | ||
| 76 | #define FPC_PE 0x0020 /* enable precision exception */ | ||
| 77 | #define FPC_PC 0x0300 /* precision control: */ | ||
| 78 | #define FPC_PC_24 0x0000 /* 24 bits */ | ||
| 79 | #define FPC_PC_53 0x0200 /* 53 bits */ | ||
| 80 | #define FPC_PC_64 0x0300 /* 64 bits */ | ||
| 81 | #define FPC_RC 0x0c00 /* rounding control: */ | ||
| 82 | #define FPC_RC_RN 0x0000 /* round to nearest or even */ | ||
| 83 | #define FPC_RC_RD 0x0400 /* round down */ | ||
| 84 | #define FPC_RC_RU 0x0800 /* round up */ | ||
| 85 | #define FPC_RC_CHOP 0x0c00 /* chop */ | ||
| 86 | #define FPC_IC 0x1000 /* infinity control (obsolete) */ | ||
| 87 | #define FPC_IC_PROJ 0x0000 /* projective infinity */ | ||
| 88 | #define FPC_IC_AFF 0x1000 /* affine infinity (std) */ | ||
| 89 | |||
| 90 | /* | ||
| 91 | * Status register | ||
| 92 | */ | ||
| 93 | #define FPS_IE 0x0001 /* invalid operation */ | ||
| 94 | #define FPS_DE 0x0002 /* denormalized operand */ | ||
| 95 | #define FPS_ZE 0x0004 /* divide by zero */ | ||
| 96 | #define FPS_OE 0x0008 /* overflow */ | ||
| 97 | #define FPS_UE 0x0010 /* underflow */ | ||
| 98 | #define FPS_PE 0x0020 /* precision */ | ||
| 99 | #define FPS_SF 0x0040 /* stack flag */ | ||
| 100 | #define FPS_ES 0x0080 /* error summary */ | ||
| 101 | #define FPS_C0 0x0100 /* condition code bit 0 */ | ||
| 102 | #define FPS_C1 0x0200 /* condition code bit 1 */ | ||
| 103 | #define FPS_C2 0x0400 /* condition code bit 2 */ | ||
| 104 | #define FPS_TOS 0x3800 /* top-of-stack pointer */ | ||
| 105 | #define FPS_TOS_SHIFT 11 | ||
| 106 | #define FPS_C3 0x4000 /* condition code bit 3 */ | ||
| 107 | #define FPS_BUSY 0x8000 /* FPU busy */ | ||
| 108 | |||
| 109 | /* | ||
| 110 | * Kind of floating-point support provided by kernel. | ||
| 111 | */ | ||
| 112 | #define FP_NO 0 /* no floating point */ | ||
| 113 | #define FP_SOFT 1 /* software FP emulator */ | ||
| 114 | #define FP_287 2 /* 80287 */ | ||
| 115 | #define FP_387 3 /* 80387 or 80486 */ | ||
| 116 | #define FP_FXSR 4 /* Fast save/restore SIMD Extension */ | ||
| 117 | |||
| 118 | #endif /* _I386_FP_SAVE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/kern_return.h created+74| ... | @@ -0,0 +1,74 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | /* | ||
| 60 | *	File:	kern_return.h | ||
| 61 | *	Author:	Avadis Tevanian, Jr., Michael Wayne Young | ||
| 62 | *	Date:	1985 | ||
| 63 | * | ||
| 64 | *	Machine-dependent kernel return definitions. | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_I386_KERN_RETURN_H_ | ||
| 68 | #define _MACH_I386_KERN_RETURN_H_ | ||
| 69 | |||
| 70 | #ifndef ASSEMBLER | ||
| 71 | typedef int kern_return_t; | ||
| 72 | #endif /* ASSEMBLER */ | ||
| 73 | |||
| 74 | #endif /* _MACH_I386_KERN_RETURN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/processor_info.h created+37| ... | @@ -0,0 +1,37 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | *	File:	mach/i386/processor_info.h | ||
| 30 | * | ||
| 31 | *	Data structure definitions for i386 specific processor control | ||
| 32 | */ | ||
| 33 | |||
| 34 | #ifndef _MACH_I386_PROCESSOR_INFO_H_ | ||
| 35 | #define _MACH_I386_PROCESSOR_INFO_H_ | ||
| 36 | |||
| 37 | #endif /* _MACH_I386_PROCESSOR_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/rpc.h created+35| ... | @@ -0,0 +1,35 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _MACH_I386_RPC_H_ | ||
| 33 | #define _MACH_I386_RPC_H_ | ||
| 34 | |||
| 35 | #endif /* _MACH_I386_RPC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h created+42| ... | @@ -0,0 +1,42 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _MACH_I386_THREAD_STATE_H_ | ||
| 33 | #define _MACH_I386_THREAD_STATE_H_ | ||
| 34 | |||
| 35 | /* Size of maximum exported thread state in 32-bit words */ | ||
| 36 | #define I386_THREAD_STATE_MAX (614) /* Size of biggest state possible */ | ||
| 37 | |||
| 38 | #if defined (__i386__) || defined(__x86_64__) | ||
| 39 | #define THREAD_STATE_MAX I386_THREAD_STATE_MAX | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #endif /* _MACH_I386_THREAD_STATE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h created+362| ... | @@ -0,0 +1,362 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	thread_status.h | ||
| 60 | *	Author:	Avadis Tevanian, Jr. | ||
| 61 | *	Date:	1985 | ||
| 62 | * | ||
| 63 | *	This file contains the structure definitions for the thread | ||
| 64 | *	state as applied to I386 processors. | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_I386_THREAD_STATUS_H_ | ||
| 68 | #define _MACH_I386_THREAD_STATUS_H_ | ||
| 69 | |||
| 70 | #include <mach/machine/_structs.h> | ||
| 71 | #include <mach/message.h> | ||
| 72 | #include <mach/i386/fp_reg.h> | ||
| 73 | #include <mach/i386/thread_state.h> | ||
| 74 | #include <i386/eflags.h> | ||
| 75 | |||
| 76 | |||
| 77 | /* | ||
| 78 | * the i386_xxxx form is kept for legacy purposes since these types | ||
| 79 | * are externally known... eventually they should be deprecated. | ||
| 80 | * our internal implementation has moved to the following naming convention | ||
| 81 | * | ||
| 82 | * x86_xxxx32 names are used to deal with 32 bit states | ||
| 83 | * x86_xxxx64 names are used to deal with 64 bit states | ||
| 84 | * x86_xxxx names are used to deal with either 32 or 64 bit states | ||
| 85 | *	via a self-describing mechanism | ||
| 86 | */ | ||
| 87 | |||
| 88 | /* | ||
| 89 | * these are the legacy names which should be deprecated in the future | ||
| 90 | * they are externally known which is the only reason we don't just get | ||
| 91 | * rid of them | ||
| 92 | */ | ||
| 93 | #define i386_THREAD_STATE 1 | ||
| 94 | #define i386_FLOAT_STATE 2 | ||
| 95 | #define i386_EXCEPTION_STATE 3 | ||
| 96 | |||
| 97 | /* | ||
| 98 | * THREAD_STATE_FLAVOR_LIST 0 | ||
| 99 | * these are the supported flavors | ||
| 100 | */ | ||
| 101 | #define x86_THREAD_STATE32 1 | ||
| 102 | #define x86_FLOAT_STATE32 2 | ||
| 103 | #define x86_EXCEPTION_STATE32 3 | ||
| 104 | #define x86_THREAD_STATE64 4 | ||
| 105 | #define x86_FLOAT_STATE64 5 | ||
| 106 | #define x86_EXCEPTION_STATE64 6 | ||
| 107 | #define x86_THREAD_STATE 7 | ||
| 108 | #define x86_FLOAT_STATE 8 | ||
| 109 | #define x86_EXCEPTION_STATE 9 | ||
| 110 | #define x86_DEBUG_STATE32 10 | ||
| 111 | #define x86_DEBUG_STATE64 11 | ||
| 112 | #define x86_DEBUG_STATE 12 | ||
| 113 | #define THREAD_STATE_NONE 13 | ||
| 114 | /* 14 and 15 are used for the internal x86_SAVED_STATE flavours */ | ||
| 115 | /* Arrange for flavors to take sequential values, 32-bit, 64-bit, non-specific */ | ||
| 116 | #define x86_AVX_STATE32 16 | ||
| 117 | #define x86_AVX_STATE64 (x86_AVX_STATE32 + 1) | ||
| 118 | #define x86_AVX_STATE (x86_AVX_STATE32 + 2) | ||
| 119 | #define x86_AVX512_STATE32 19 | ||
| 120 | #define x86_AVX512_STATE64 (x86_AVX512_STATE32 + 1) | ||
| 121 | #define x86_AVX512_STATE (x86_AVX512_STATE32 + 2) | ||
| 122 | #define x86_PAGEIN_STATE 22 | ||
| 123 | #define x86_THREAD_FULL_STATE64 23 | ||
| 124 | #define x86_INSTRUCTION_STATE 24 | ||
| 125 | #define x86_LAST_BRANCH_STATE 25 | ||
| 126 | |||
| 127 | /* | ||
| 128 | * Largest state on this machine: | ||
| 129 | * (be sure mach/machine/thread_state.h matches!) | ||
| 130 | */ | ||
| 131 | #define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX | ||
| 132 | |||
| 133 | /* | ||
| 134 | * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed | ||
| 135 | * an exception flavor will return if that is a defined flavor for that | ||
| 136 | * platform. The macro must be manually updated to include all of the valid | ||
| 137 | * exception flavors as defined above. | ||
| 138 | */ | ||
| 139 | #define VALID_THREAD_STATE_FLAVOR(x) \ | ||
| 140 | 	 ((x == x86_THREAD_STATE32)		|| \ | ||
| 141 | 	 (x == x86_FLOAT_STATE32)		|| \ | ||
| 142 | 	 (x == x86_EXCEPTION_STATE32)		|| \ | ||
| 143 | 	 (x == x86_DEBUG_STATE32)		|| \ | ||
| 144 | 	 (x == x86_THREAD_STATE64)		|| \ | ||
| 145 | 	 (x == x86_THREAD_FULL_STATE64)	|| \ | ||
| 146 | 	 (x == x86_FLOAT_STATE64)		|| \ | ||
| 147 | 	 (x == x86_EXCEPTION_STATE64)		|| \ | ||
| 148 | 	 (x == x86_DEBUG_STATE64)		|| \ | ||
| 149 | 	 (x == x86_THREAD_STATE)		|| \ | ||
| 150 | 	 (x == x86_FLOAT_STATE)		|| \ | ||
| 151 | 	 (x == x86_EXCEPTION_STATE)		|| \ | ||
| 152 | 	 (x == x86_DEBUG_STATE)		|| \ | ||
| 153 | 	 (x == x86_AVX_STATE32)		|| \ | ||
| 154 | 	 (x == x86_AVX_STATE64)		|| \ | ||
| 155 | 	 (x == x86_AVX_STATE)			|| \ | ||
| 156 | 	 (x == x86_AVX512_STATE32)		|| \ | ||
| 157 | 	 (x == x86_AVX512_STATE64)		|| \ | ||
| 158 | 	 (x == x86_AVX512_STATE)		|| \ | ||
| 159 | 	 (x == x86_PAGEIN_STATE)		|| \ | ||
| 160 | 	 (x == x86_INSTRUCTION_STATE)		|| \ | ||
| 161 | 	 (x == x86_LAST_BRANCH_STATE)		|| \ | ||
| 162 | 	 (x == THREAD_STATE_NONE)) | ||
| 163 | |||
| 164 | struct x86_state_hdr { | ||
| 165 | 	uint32_t flavor; | ||
| 166 | 	uint32_t count; | ||
| 167 | }; | ||
| 168 | typedef struct x86_state_hdr x86_state_hdr_t; | ||
| 169 | |||
| 170 | /* | ||
| 171 | * Default segment register values. | ||
| 172 | */ | ||
| 173 | |||
| 174 | #define USER_CODE_SELECTOR 0x0017 | ||
| 175 | #define USER_DATA_SELECTOR 0x001f | ||
| 176 | #define KERN_CODE_SELECTOR 0x0008 | ||
| 177 | #define KERN_DATA_SELECTOR 0x0010 | ||
| 178 | |||
| 179 | /* | ||
| 180 | * to be deprecated in the future | ||
| 181 | */ | ||
| 182 | typedef _STRUCT_X86_THREAD_STATE32 i386_thread_state_t; | ||
| 183 | #define i386_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 184 | ( sizeof (i386_thread_state_t) / sizeof (int) )) | ||
| 185 | |||
| 186 | typedef _STRUCT_X86_THREAD_STATE32 x86_thread_state32_t; | ||
| 187 | #define x86_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \ | ||
| 188 | ( sizeof (x86_thread_state32_t) / sizeof (int) )) | ||
| 189 | |||
| 190 | /* | ||
| 191 | * to be deprecated in the future | ||
| 192 | */ | ||
| 193 | typedef _STRUCT_X86_FLOAT_STATE32 i386_float_state_t; | ||
| 194 | #define i386_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 195 | 	 (sizeof(i386_float_state_t)/sizeof(unsigned int))) | ||
| 196 | |||
| 197 | typedef _STRUCT_X86_FLOAT_STATE32 x86_float_state32_t; | ||
| 198 | #define x86_FLOAT_STATE32_COUNT ((mach_msg_type_number_t) \ | ||
| 199 | 	 (sizeof(x86_float_state32_t)/sizeof(unsigned int))) | ||
| 200 | |||
| 201 | typedef _STRUCT_X86_AVX_STATE32 x86_avx_state32_t; | ||
| 202 | #define x86_AVX_STATE32_COUNT ((mach_msg_type_number_t) \ | ||
| 203 | 	 (sizeof(x86_avx_state32_t)/sizeof(unsigned int))) | ||
| 204 | |||
| 205 | typedef _STRUCT_X86_AVX512_STATE32 x86_avx512_state32_t; | ||
| 206 | #define x86_AVX512_STATE32_COUNT ((mach_msg_type_number_t) \ | ||
| 207 | 	 (sizeof(x86_avx512_state32_t)/sizeof(unsigned int))) | ||
| 208 | |||
| 209 | /* | ||
| 210 | * to be deprecated in the future | ||
| 211 | */ | ||
| 212 | typedef _STRUCT_X86_EXCEPTION_STATE32 i386_exception_state_t; | ||
| 213 | #define i386_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 214 | ( sizeof (i386_exception_state_t) / sizeof (int) )) | ||
| 215 | |||
| 216 | typedef _STRUCT_X86_EXCEPTION_STATE32 x86_exception_state32_t; | ||
| 217 | #define x86_EXCEPTION_STATE32_COUNT ((mach_msg_type_number_t) \ | ||
| 218 | ( sizeof (x86_exception_state32_t) / sizeof (int) )) | ||
| 219 | |||
| 220 | #define I386_EXCEPTION_STATE_COUNT i386_EXCEPTION_STATE_COUNT | ||
| 221 | |||
| 222 | typedef _STRUCT_X86_DEBUG_STATE32 x86_debug_state32_t; | ||
| 223 | #define x86_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \ | ||
| 224 | 	( sizeof (x86_debug_state32_t) / sizeof (int) )) | ||
| 225 | |||
| 226 | #define X86_DEBUG_STATE32_COUNT x86_DEBUG_STATE32_COUNT | ||
| 227 | |||
| 228 | typedef _STRUCT_X86_THREAD_STATE64 x86_thread_state64_t; | ||
| 229 | #define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 230 | ( sizeof (x86_thread_state64_t) / sizeof (int) )) | ||
| 231 | |||
| 232 | typedef _STRUCT_X86_THREAD_FULL_STATE64 x86_thread_full_state64_t; | ||
| 233 | #define x86_THREAD_FULL_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 234 | ( sizeof (x86_thread_full_state64_t) / sizeof (int) )) | ||
| 235 | |||
| 236 | typedef _STRUCT_X86_FLOAT_STATE64 x86_float_state64_t; | ||
| 237 | #define x86_FLOAT_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 238 | 	 (sizeof(x86_float_state64_t)/sizeof(unsigned int))) | ||
| 239 | |||
| 240 | typedef _STRUCT_X86_AVX_STATE64 x86_avx_state64_t; | ||
| 241 | #define x86_AVX_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 242 | 	 (sizeof(x86_avx_state64_t)/sizeof(unsigned int))) | ||
| 243 | |||
| 244 | typedef _STRUCT_X86_AVX512_STATE64 x86_avx512_state64_t; | ||
| 245 | #define x86_AVX512_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 246 | 	 (sizeof(x86_avx512_state64_t)/sizeof(unsigned int))) | ||
| 247 | |||
| 248 | typedef _STRUCT_X86_EXCEPTION_STATE64 x86_exception_state64_t; | ||
| 249 | #define x86_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 250 | ( sizeof (x86_exception_state64_t) / sizeof (int) )) | ||
| 251 | |||
| 252 | #define X86_EXCEPTION_STATE64_COUNT x86_EXCEPTION_STATE64_COUNT | ||
| 253 | |||
| 254 | typedef _STRUCT_X86_DEBUG_STATE64 x86_debug_state64_t; | ||
| 255 | #define x86_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \ | ||
| 256 | ( sizeof (x86_debug_state64_t) / sizeof (int) )) | ||
| 257 | |||
| 258 | #define X86_DEBUG_STATE64_COUNT x86_DEBUG_STATE64_COUNT | ||
| 259 | |||
| 260 | typedef _STRUCT_X86_PAGEIN_STATE x86_pagein_state_t; | ||
| 261 | #define x86_PAGEIN_STATE_COUNT \ | ||
| 262 | ((mach_msg_type_number_t)(sizeof(x86_pagein_state_t) / sizeof(int))) | ||
| 263 | |||
| 264 | #define X86_PAGEIN_STATE_COUNT x86_PAGEIN_STATE_COUNT | ||
| 265 | |||
| 266 | typedef _STRUCT_X86_INSTRUCTION_STATE x86_instruction_state_t; | ||
| 267 | #define x86_INSTRUCTION_STATE_COUNT \ | ||
| 268 | ((mach_msg_type_number_t)(sizeof(x86_instruction_state_t) / sizeof(int))) | ||
| 269 | |||
| 270 | #define X86_INSTRUCTION_STATE_COUNT x86_INSTRUCTION_STATE_COUNT | ||
| 271 | |||
| 272 | typedef _STRUCT_LAST_BRANCH_STATE last_branch_state_t; | ||
| 273 | #define x86_LAST_BRANCH_STATE_COUNT \ | ||
| 274 | ((mach_msg_type_number_t)(sizeof(last_branch_state_t) / sizeof(int))) | ||
| 275 | |||
| 276 | #define X86_LAST_BRANCH_STATE_COUNT x86_LAST_BRANCH_STATE_COUNT | ||
| 277 | |||
| 278 | |||
| 279 | /* | ||
| 280 | * Combined thread, float and exception states | ||
| 281 | */ | ||
| 282 | struct x86_thread_state { | ||
| 283 | 	x86_state_hdr_t tsh; | ||
| 284 | 	union { | ||
| 285 | 		x86_thread_state32_t ts32; | ||
| 286 | 		x86_thread_state64_t ts64; | ||
| 287 | 	} uts; | ||
| 288 | }; | ||
| 289 | |||
| 290 | struct x86_float_state { | ||
| 291 | 	x86_state_hdr_t fsh; | ||
| 292 | 	union { | ||
| 293 | 		x86_float_state32_t fs32; | ||
| 294 | 		x86_float_state64_t fs64; | ||
| 295 | 	} ufs; | ||
| 296 | }; | ||
| 297 | |||
| 298 | struct x86_exception_state { | ||
| 299 | 	x86_state_hdr_t esh; | ||
| 300 | 	union { | ||
| 301 | 		x86_exception_state32_t es32; | ||
| 302 | 		x86_exception_state64_t es64; | ||
| 303 | 	} ues; | ||
| 304 | }; | ||
| 305 | |||
| 306 | struct x86_debug_state { | ||
| 307 | 	x86_state_hdr_t dsh; | ||
| 308 | 	union { | ||
| 309 | 		x86_debug_state32_t ds32; | ||
| 310 | 		x86_debug_state64_t ds64; | ||
| 311 | 	} uds; | ||
| 312 | }; | ||
| 313 | |||
| 314 | struct x86_avx_state { | ||
| 315 | 	x86_state_hdr_t ash; | ||
| 316 | 	union { | ||
| 317 | 		x86_avx_state32_t as32; | ||
| 318 | 		x86_avx_state64_t as64; | ||
| 319 | 	} ufs; | ||
| 320 | }; | ||
| 321 | |||
| 322 | struct x86_avx512_state { | ||
| 323 | 	x86_state_hdr_t ash; | ||
| 324 | 	union { | ||
| 325 | 		x86_avx512_state32_t as32; | ||
| 326 | 		x86_avx512_state64_t as64; | ||
| 327 | 	} ufs; | ||
| 328 | }; | ||
| 329 | |||
| 330 | typedef struct x86_thread_state x86_thread_state_t; | ||
| 331 | #define x86_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 332 | 	 ( sizeof (x86_thread_state_t) / sizeof (int) )) | ||
| 333 | |||
| 334 | typedef struct x86_float_state x86_float_state_t; | ||
| 335 | #define x86_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 336 | 	 (sizeof(x86_float_state_t)/sizeof(unsigned int))) | ||
| 337 | |||
| 338 | typedef struct x86_exception_state x86_exception_state_t; | ||
| 339 | #define x86_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 340 | 	 (sizeof(x86_exception_state_t)/sizeof(unsigned int))) | ||
| 341 | |||
| 342 | typedef struct x86_debug_state x86_debug_state_t; | ||
| 343 | #define x86_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 344 | 	 (sizeof(x86_debug_state_t)/sizeof(unsigned int))) | ||
| 345 | |||
| 346 | typedef struct x86_avx_state x86_avx_state_t; | ||
| 347 | #define x86_AVX_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 348 | 	 (sizeof(x86_avx_state_t)/sizeof(unsigned int))) | ||
| 349 | |||
| 350 | typedef struct x86_avx512_state x86_avx512_state_t; | ||
| 351 | #define x86_AVX512_STATE_COUNT ((mach_msg_type_number_t) \ | ||
| 352 | 	 (sizeof(x86_avx512_state_t)/sizeof(unsigned int))) | ||
| 353 | |||
| 354 | /* | ||
| 355 | * Machine-independent way for servers and Mach's exception mechanism to | ||
| 356 | * choose the most efficient state flavor for exception RPC's: | ||
| 357 | */ | ||
| 358 | #define MACHINE_THREAD_STATE x86_THREAD_STATE | ||
| 359 | #define MACHINE_THREAD_STATE_COUNT x86_THREAD_STATE_COUNT | ||
| 360 | |||
| 361 | |||
| 362 | #endif /* _MACH_I386_THREAD_STATUS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h created+157| ... | @@ -0,0 +1,157 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | |||
| 57 | /* | ||
| 58 | * Copyright (c) 1994 The University of Utah and | ||
| 59 | * the Computer Systems Laboratory at the University of Utah (CSL). | ||
| 60 | * All rights reserved. | ||
| 61 | * | ||
| 62 | * Permission to use, copy, modify and distribute this software is hereby | ||
| 63 | * granted provided that (1) source code retains these copyright, permission, | ||
| 64 | * and disclaimer notices, and (2) redistributions including binaries | ||
| 65 | * reproduce the notices in supporting documentation, and (3) all advertising | ||
| 66 | * materials mentioning features or use of this software display the following | ||
| 67 | * acknowledgement: ``This product includes software developed by the | ||
| 68 | * Computer Systems Laboratory at the University of Utah.'' | ||
| 69 | * | ||
| 70 | * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS | ||
| 71 | * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF | ||
| 72 | * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 73 | * | ||
| 74 | * CSL requests users of this software to return to csl-dist@cs.utah.edu any | ||
| 75 | * improvements that they make and grant CSL redistribution rights. | ||
| 76 | * | ||
| 77 | */ | ||
| 78 | |||
| 79 | /* | ||
| 80 | *	File:	vm_param.h | ||
| 81 | *	Author:	Avadis Tevanian, Jr. | ||
| 82 | *	Date:	1985 | ||
| 83 | * | ||
| 84 | *	I386 machine dependent virtual memory parameters. | ||
| 85 | *	Most of the declarations are preceeded by I386_ (or i386_) | ||
| 86 | *	which is OK because only I386 specific code will be using | ||
| 87 | *	them. | ||
| 88 | */ | ||
| 89 | |||
| 90 | #ifndef _MACH_I386_VM_PARAM_H_ | ||
| 91 | #define _MACH_I386_VM_PARAM_H_ | ||
| 92 | |||
| 93 | #if !defined(KERNEL) && !defined(__ASSEMBLER__) | ||
| 94 | |||
| 95 | #include <mach/vm_page_size.h> | ||
| 96 | #endif | ||
| 97 | |||
| 98 | #define BYTE_SIZE 8 /* byte size in bits */ | ||
| 99 | |||
| 100 | #define I386_PGBYTES 4096 /* bytes per 80386 page */ | ||
| 101 | #define I386_PGSHIFT 12 /* bitshift for pages */ | ||
| 102 | |||
| 103 | |||
| 104 | #if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) | ||
| 105 | #define PAGE_SHIFT I386_PGSHIFT | ||
| 106 | #define PAGE_SIZE I386_PGBYTES | ||
| 107 | #define PAGE_MASK (PAGE_SIZE-1) | ||
| 108 | #else /* !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) */ | ||
| 109 | #define PAGE_SHIFT vm_page_shift | ||
| 110 | #define PAGE_SIZE vm_page_size | ||
| 111 | #define PAGE_MASK vm_page_mask | ||
| 112 | #endif /* !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) */ | ||
| 113 | |||
| 114 | #define PAGE_MAX_SHIFT 14 | ||
| 115 | #define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT) | ||
| 116 | #define PAGE_MAX_MASK (PAGE_MAX_SIZE-1) | ||
| 117 | |||
| 118 | #define PAGE_MIN_SHIFT 12 | ||
| 119 | #define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT) | ||
| 120 | #define PAGE_MIN_MASK (PAGE_MIN_SIZE-1) | ||
| 121 | |||
| 122 | |||
| 123 | #define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) | ||
| 124 | /* | ||
| 125 | * default top of user stack... it grows down from here | ||
| 126 | */ | ||
| 127 | #define VM_USRSTACK64 ((user_addr_t) 0x00007FFEEFC00000ULL) | ||
| 128 | |||
| 129 | /* | ||
| 130 | * XXX TODO: Obsolete? | ||
| 131 | */ | ||
| 132 | #define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) | ||
| 133 | #define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) | ||
| 134 | #define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) | ||
| 135 | /* | ||
| 136 | * the end of the usable user address space , for now about 47 bits. | ||
| 137 | * the 64 bit commpage is past the end of this | ||
| 138 | */ | ||
| 139 | #define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL) | ||
| 140 | /* | ||
| 141 | * canonical end of user address space for limits checking | ||
| 142 | */ | ||
| 143 | #define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL) | ||
| 144 | |||
| 145 | |||
| 146 | /* system-wide values */ | ||
| 147 | #define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) | ||
| 148 | #define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) | ||
| 149 | |||
| 150 | /* process-relative values (all 32-bit legacy only for now) */ | ||
| 151 | #define VM_MIN_ADDRESS ((vm_offset_t) 0) | ||
| 152 | #define VM_USRSTACK32 ((vm_offset_t) 0xC0000000) /* ASLR slides stack down by up to 1 MB */ | ||
| 153 | #define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000) | ||
| 154 | |||
| 155 | |||
| 156 | |||
| 157 | #endif /* _MACH_I386_VM_PARAM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h created+141| ... | @@ -0,0 +1,141 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | /* | ||
| 60 | *	File:	vm_types.h | ||
| 61 | *	Author:	Avadis Tevanian, Jr. | ||
| 62 | *	Date: 1985 | ||
| 63 | * | ||
| 64 | *	Header file for VM data types. I386 version. | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_I386_VM_TYPES_H_ | ||
| 68 | #define _MACH_I386_VM_TYPES_H_ | ||
| 69 | |||
| 70 | #ifndef ASSEMBLER | ||
| 71 | |||
| 72 | #include <i386/_types.h> | ||
| 73 | #include <stdint.h> | ||
| 74 | |||
| 75 | /* | ||
| 76 | * natural_t and integer_t are Mach's legacy types for machine- | ||
| 77 | * independent integer types (unsigned, and signed, respectively). | ||
| 78 | * Their original purpose was to define other types in a machine/ | ||
| 79 | * compiler independent way. | ||
| 80 | * | ||
| 81 | * They also had an implicit "same size as pointer" characteristic | ||
| 82 | * to them (i.e. Mach's traditional types are very ILP32 or ILP64 | ||
| 83 | * centric). We support x86 ABIs that do not follow either of | ||
| 84 | * these models (specifically LP64). Therefore, we had to make a | ||
| 85 | * choice between making these types scale with pointers or stay | ||
| 86 | * tied to integers. Because their use is predominantly tied to | ||
| 87 | * to the size of an integer, we are keeping that association and | ||
| 88 | * breaking free from pointer size guarantees. | ||
| 89 | * | ||
| 90 | * New use of these types is discouraged. | ||
| 91 | */ | ||
| 92 | typedef __darwin_natural_t natural_t; | ||
| 93 | typedef int integer_t; | ||
| 94 | |||
| 95 | /* | ||
| 96 | * A vm_offset_t is a type-neutral pointer, | ||
| 97 | * e.g. an offset into a virtual memory space. | ||
| 98 | */ | ||
| 99 | #ifdef __LP64__ | ||
| 100 | typedef uintptr_t vm_offset_t; | ||
| 101 | #else /* __LP64__ */ | ||
| 102 | typedef natural_t vm_offset_t; | ||
| 103 | #endif /* __LP64__ */ | ||
| 104 | |||
| 105 | /* | ||
| 106 | * A vm_size_t is the proper type for e.g. | ||
| 107 | * expressing the difference between two | ||
| 108 | * vm_offset_t entities. | ||
| 109 | */ | ||
| 110 | #ifdef __LP64__ | ||
| 111 | typedef uintptr_t vm_size_t; | ||
| 112 | #else /* __LP64__ */ | ||
| 113 | typedef natural_t vm_size_t; | ||
| 114 | #endif /* __LP64__ */ | ||
| 115 | |||
| 116 | /* | ||
| 117 | * This new type is independent of a particular vm map's | ||
| 118 | * implementation size - and represents appropriate types | ||
| 119 | * for all possible maps. This is used for interfaces | ||
| 120 | * where the size of the map is not known - or we don't | ||
| 121 | * want to have to distinguish. | ||
| 122 | */ | ||
| 123 | typedef uint64_t mach_vm_address_t; | ||
| 124 | typedef uint64_t mach_vm_offset_t; | ||
| 125 | typedef uint64_t mach_vm_size_t; | ||
| 126 | |||
| 127 | typedef uint64_t vm_map_offset_t; | ||
| 128 | typedef uint64_t vm_map_address_t; | ||
| 129 | typedef uint64_t vm_map_size_t; | ||
| 130 | |||
| 131 | typedef mach_vm_address_t mach_port_context_t; | ||
| 132 | |||
| 133 | |||
| 134 | #endif /* ASSEMBLER */ | ||
| 135 | |||
| 136 | /* | ||
| 137 | * If composing messages by hand (please do not) | ||
| 138 | */ | ||
| 139 | #define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 | ||
| 140 | |||
| 141 | #endif /* _MACH_I386_VM_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/kern_return.h created+334| ... | @@ -0,0 +1,334 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	h/kern_return.h | ||
| 60 | *	Author:	Avadis Tevanian, Jr. | ||
| 61 | *	Date:	1985 | ||
| 62 | * | ||
| 63 | *	Kernel return codes. | ||
| 64 | * | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_KERN_RETURN_H_ | ||
| 68 | #define _MACH_KERN_RETURN_H_ | ||
| 69 | |||
| 70 | #include <mach/machine/kern_return.h> | ||
| 71 | |||
| 72 | #define KERN_SUCCESS 0 | ||
| 73 | |||
| 74 | #define KERN_INVALID_ADDRESS 1 | ||
| 75 | /* Specified address is not currently valid. | ||
| 76 | */ | ||
| 77 | |||
| 78 | #define KERN_PROTECTION_FAILURE 2 | ||
| 79 | /* Specified memory is valid, but does not permit the | ||
| 80 | * required forms of access. | ||
| 81 | */ | ||
| 82 | |||
| 83 | #define KERN_NO_SPACE 3 | ||
| 84 | /* The address range specified is already in use, or | ||
| 85 | * no address range of the size specified could be | ||
| 86 | * found. | ||
| 87 | */ | ||
| 88 | |||
| 89 | #define KERN_INVALID_ARGUMENT 4 | ||
| 90 | /* The function requested was not applicable to this | ||
| 91 | * type of argument, or an argument is invalid | ||
| 92 | */ | ||
| 93 | |||
| 94 | #define KERN_FAILURE 5 | ||
| 95 | /* The function could not be performed. A catch-all. | ||
| 96 | */ | ||
| 97 | |||
| 98 | #define KERN_RESOURCE_SHORTAGE 6 | ||
| 99 | /* A system resource could not be allocated to fulfill | ||
| 100 | * this request. This failure may not be permanent. | ||
| 101 | */ | ||
| 102 | |||
| 103 | #define KERN_NOT_RECEIVER 7 | ||
| 104 | /* The task in question does not hold receive rights | ||
| 105 | * for the port argument. | ||
| 106 | */ | ||
| 107 | |||
| 108 | #define KERN_NO_ACCESS 8 | ||
| 109 | /* Bogus access restriction. | ||
| 110 | */ | ||
| 111 | |||
| 112 | #define KERN_MEMORY_FAILURE 9 | ||
| 113 | /* During a page fault, the target address refers to a | ||
| 114 | * memory object that has been destroyed. This | ||
| 115 | * failure is permanent. | ||
| 116 | */ | ||
| 117 | |||
| 118 | #define KERN_MEMORY_ERROR 10 | ||
| 119 | /* During a page fault, the memory object indicated | ||
| 120 | * that the data could not be returned. This failure | ||
| 121 | * may be temporary; future attempts to access this | ||
| 122 | * same data may succeed, as defined by the memory | ||
| 123 | * object. | ||
| 124 | */ | ||
| 125 | |||
| 126 | #define KERN_ALREADY_IN_SET 11 | ||
| 127 | /* The receive right is already a member of the portset. | ||
| 128 | */ | ||
| 129 | |||
| 130 | #define KERN_NOT_IN_SET 12 | ||
| 131 | /* The receive right is not a member of a port set. | ||
| 132 | */ | ||
| 133 | |||
| 134 | #define KERN_NAME_EXISTS 13 | ||
| 135 | /* The name already denotes a right in the task. | ||
| 136 | */ | ||
| 137 | |||
| 138 | #define KERN_ABORTED 14 | ||
| 139 | /* The operation was aborted. Ipc code will | ||
| 140 | * catch this and reflect it as a message error. | ||
| 141 | */ | ||
| 142 | |||
| 143 | #define KERN_INVALID_NAME 15 | ||
| 144 | /* The name doesn't denote a right in the task. | ||
| 145 | */ | ||
| 146 | |||
| 147 | #define KERN_INVALID_TASK 16 | ||
| 148 | /* Target task isn't an active task. | ||
| 149 | */ | ||
| 150 | |||
| 151 | #define KERN_INVALID_RIGHT 17 | ||
| 152 | /* The name denotes a right, but not an appropriate right. | ||
| 153 | */ | ||
| 154 | |||
| 155 | #define KERN_INVALID_VALUE 18 | ||
| 156 | /* A blatant range error. | ||
| 157 | */ | ||
| 158 | |||
| 159 | #define KERN_UREFS_OVERFLOW 19 | ||
| 160 | /* Operation would overflow limit on user-references. | ||
| 161 | */ | ||
| 162 | |||
| 163 | #define KERN_INVALID_CAPABILITY 20 | ||
| 164 | /* The supplied (port) capability is improper. | ||
| 165 | */ | ||
| 166 | |||
| 167 | #define KERN_RIGHT_EXISTS 21 | ||
| 168 | /* The task already has send or receive rights | ||
| 169 | * for the port under another name. | ||
| 170 | */ | ||
| 171 | |||
| 172 | #define KERN_INVALID_HOST 22 | ||
| 173 | /* Target host isn't actually a host. | ||
| 174 | */ | ||
| 175 | |||
| 176 | #define KERN_MEMORY_PRESENT 23 | ||
| 177 | /* An attempt was made to supply "precious" data | ||
| 178 | * for memory that is already present in a | ||
| 179 | * memory object. | ||
| 180 | */ | ||
| 181 | |||
| 182 | #define KERN_MEMORY_DATA_MOVED 24 | ||
| 183 | /* A page was requested of a memory manager via | ||
| 184 | * memory_object_data_request for an object using | ||
| 185 | * a MEMORY_OBJECT_COPY_CALL strategy, with the | ||
| 186 | * VM_PROT_WANTS_COPY flag being used to specify | ||
| 187 | * that the page desired is for a copy of the | ||
| 188 | * object, and the memory manager has detected | ||
| 189 | * the page was pushed into a copy of the object | ||
| 190 | * while the kernel was walking the shadow chain | ||
| 191 | * from the copy to the object. This error code | ||
| 192 | * is delivered via memory_object_data_error | ||
| 193 | * and is handled by the kernel (it forces the | ||
| 194 | * kernel to restart the fault). It will not be | ||
| 195 | * seen by users. | ||
| 196 | */ | ||
| 197 | |||
| 198 | #define KERN_MEMORY_RESTART_COPY 25 | ||
| 199 | /* A strategic copy was attempted of an object | ||
| 200 | * upon which a quicker copy is now possible. | ||
| 201 | * The caller should retry the copy using | ||
| 202 | * vm_object_copy_quickly. This error code | ||
| 203 | * is seen only by the kernel. | ||
| 204 | */ | ||
| 205 | |||
| 206 | #define KERN_INVALID_PROCESSOR_SET 26 | ||
| 207 | /* An argument applied to assert processor set privilege | ||
| 208 | * was not a processor set control port. | ||
| 209 | */ | ||
| 210 | |||
| 211 | #define KERN_POLICY_LIMIT 27 | ||
| 212 | /* The specified scheduling attributes exceed the thread's | ||
| 213 | * limits. | ||
| 214 | */ | ||
| 215 | |||
| 216 | #define KERN_INVALID_POLICY 28 | ||
| 217 | /* The specified scheduling policy is not currently | ||
| 218 | * enabled for the processor set. | ||
| 219 | */ | ||
| 220 | |||
| 221 | #define KERN_INVALID_OBJECT 29 | ||
| 222 | /* The external memory manager failed to initialize the | ||
| 223 | * memory object. | ||
| 224 | */ | ||
| 225 | |||
| 226 | #define KERN_ALREADY_WAITING 30 | ||
| 227 | /* A thread is attempting to wait for an event for which | ||
| 228 | * there is already a waiting thread. | ||
| 229 | */ | ||
| 230 | |||
| 231 | #define KERN_DEFAULT_SET 31 | ||
| 232 | /* An attempt was made to destroy the default processor | ||
| 233 | * set. | ||
| 234 | */ | ||
| 235 | |||
| 236 | #define KERN_EXCEPTION_PROTECTED 32 | ||
| 237 | /* An attempt was made to fetch an exception port that is | ||
| 238 | * protected, or to abort a thread while processing a | ||
| 239 | * protected exception. | ||
| 240 | */ | ||
| 241 | |||
| 242 | #define KERN_INVALID_LEDGER 33 | ||
| 243 | /* A ledger was required but not supplied. | ||
| 244 | */ | ||
| 245 | |||
| 246 | #define KERN_INVALID_MEMORY_CONTROL 34 | ||
| 247 | /* The port was not a memory cache control port. | ||
| 248 | */ | ||
| 249 | |||
| 250 | #define KERN_INVALID_SECURITY 35 | ||
| 251 | /* An argument supplied to assert security privilege | ||
| 252 | * was not a host security port. | ||
| 253 | */ | ||
| 254 | |||
| 255 | #define KERN_NOT_DEPRESSED 36 | ||
| 256 | /* thread_depress_abort was called on a thread which | ||
| 257 | * was not currently depressed. | ||
| 258 | */ | ||
| 259 | |||
| 260 | #define KERN_TERMINATED 37 | ||
| 261 | /* Object has been terminated and is no longer available | ||
| 262 | */ | ||
| 263 | |||
| 264 | #define KERN_LOCK_SET_DESTROYED 38 | ||
| 265 | /* Lock set has been destroyed and is no longer available. | ||
| 266 | */ | ||
| 267 | |||
| 268 | #define KERN_LOCK_UNSTABLE 39 | ||
| 269 | /* The thread holding the lock terminated before releasing | ||
| 270 | * the lock | ||
| 271 | */ | ||
| 272 | |||
| 273 | #define KERN_LOCK_OWNED 40 | ||
| 274 | /* The lock is already owned by another thread | ||
| 275 | */ | ||
| 276 | |||
| 277 | #define KERN_LOCK_OWNED_SELF 41 | ||
| 278 | /* The lock is already owned by the calling thread | ||
| 279 | */ | ||
| 280 | |||
| 281 | #define KERN_SEMAPHORE_DESTROYED 42 | ||
| 282 | /* Semaphore has been destroyed and is no longer available. | ||
| 283 | */ | ||
| 284 | |||
| 285 | #define KERN_RPC_SERVER_TERMINATED 43 | ||
| 286 | /* Return from RPC indicating the target server was | ||
| 287 | * terminated before it successfully replied | ||
| 288 | */ | ||
| 289 | |||
| 290 | #define KERN_RPC_TERMINATE_ORPHAN 44 | ||
| 291 | /* Terminate an orphaned activation. | ||
| 292 | */ | ||
| 293 | |||
| 294 | #define KERN_RPC_CONTINUE_ORPHAN 45 | ||
| 295 | /* Allow an orphaned activation to continue executing. | ||
| 296 | */ | ||
| 297 | |||
| 298 | #define KERN_NOT_SUPPORTED 46 | ||
| 299 | /* Empty thread activation (No thread linked to it) | ||
| 300 | */ | ||
| 301 | |||
| 302 | #define KERN_NODE_DOWN 47 | ||
| 303 | /* Remote node down or inaccessible. | ||
| 304 | */ | ||
| 305 | |||
| 306 | #define KERN_NOT_WAITING 48 | ||
| 307 | /* A signalled thread was not actually waiting. */ | ||
| 308 | |||
| 309 | #define KERN_OPERATION_TIMED_OUT 49 | ||
| 310 | /* Some thread-oriented operation (semaphore_wait) timed out | ||
| 311 | */ | ||
| 312 | |||
| 313 | #define KERN_CODESIGN_ERROR 50 | ||
| 314 | /* During a page fault, indicates that the page was rejected | ||
| 315 | * as a result of a signature check. | ||
| 316 | */ | ||
| 317 | |||
| 318 | #define KERN_POLICY_STATIC 51 | ||
| 319 | /* The requested property cannot be changed at this time. | ||
| 320 | */ | ||
| 321 | |||
| 322 | #define KERN_INSUFFICIENT_BUFFER_SIZE 52 | ||
| 323 | /* The provided buffer is of insufficient size for the requested data. | ||
| 324 | */ | ||
| 325 | |||
| 326 | #define KERN_DENIED 53 | ||
| 327 | /* Denied by security policy | ||
| 328 | */ | ||
| 329 | |||
| 330 | #define KERN_RETURN_MAX 0x100 | ||
| 331 | /* Maximum return value allowable | ||
| 332 | */ | ||
| 333 | |||
| 334 | #endif /* _MACH_KERN_RETURN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/kmod.h created+180| ... | @@ -0,0 +1,180 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 30 | * support for mandatory and extensible security protections. This notice | ||
| 31 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 32 | * Version 2.0. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _MACH_KMOD_H_ | ||
| 36 | #define _MACH_KMOD_H_ | ||
| 37 | |||
| 38 | #include <mach/kern_return.h> | ||
| 39 | #include <mach/mach_types.h> | ||
| 40 | |||
| 41 | #include <sys/cdefs.h> | ||
| 42 | |||
| 43 | __BEGIN_DECLS | ||
| 44 | |||
| 45 | #if PRAGMA_MARK | ||
| 46 | #pragma mark Basic macros & typedefs | ||
| 47 | #endif | ||
| 48 | /*********************************************************************** | ||
| 49 | * Basic macros & typedefs | ||
| 50 | ***********************************************************************/ | ||
| 51 | #define KMOD_MAX_NAME 64 | ||
| 52 | |||
| 53 | #define KMOD_RETURN_SUCCESS KERN_SUCCESS | ||
| 54 | #define KMOD_RETURN_FAILURE KERN_FAILURE | ||
| 55 | |||
| 56 | typedef int kmod_t; | ||
| 57 | |||
| 58 | struct kmod_info; | ||
| 59 | typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data); | ||
| 60 | typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data); | ||
| 61 | |||
| 62 | #if PRAGMA_MARK | ||
| 63 | #pragma mark Structure definitions | ||
| 64 | #endif | ||
| 65 | /*********************************************************************** | ||
| 66 | * Structure definitions | ||
| 67 | * | ||
| 68 | * All structures must be #pragma pack(4). | ||
| 69 | ***********************************************************************/ | ||
| 70 | #pragma pack(push, 4) | ||
| 71 | |||
| 72 | /* Run-time struct only; never saved to a file */ | ||
| 73 | typedef struct kmod_reference { | ||
| 74 | 	struct kmod_reference * next; | ||
| 75 | 	struct kmod_info * info; | ||
| 76 | } kmod_reference_t; | ||
| 77 | |||
| 78 | /*********************************************************************** | ||
| 79 | * Warning: Any changes to the kmod_info structure affect the | ||
| 80 | * KMOD_..._DECL macros below. | ||
| 81 | ***********************************************************************/ | ||
| 82 | |||
| 83 | /* The kmod_info_t structure is only safe to use inside the running | ||
| 84 | * kernel. If you need to work with a kmod_info_t structure outside | ||
| 85 | * the kernel, please use the compatibility definitions below. | ||
| 86 | */ | ||
| 87 | typedef struct kmod_info { | ||
| 88 | 	struct kmod_info * next; | ||
| 89 | 	int32_t info_version; // version of this structure | ||
| 90 | 	uint32_t id; | ||
| 91 | 	char name[KMOD_MAX_NAME]; | ||
| 92 | 	char version[KMOD_MAX_NAME]; | ||
| 93 | 	int32_t reference_count; // # linkage refs to this | ||
| 94 | 	kmod_reference_t * reference_list; // who this refs (links on) | ||
| 95 | 	vm_address_t address; // starting address | ||
| 96 | 	vm_size_t size; // total size | ||
| 97 | 	vm_size_t hdr_size; // unwired hdr size | ||
| 98 | 	kmod_start_func_t * start; | ||
| 99 | 	kmod_stop_func_t * stop; | ||
| 100 | } kmod_info_t; | ||
| 101 | |||
| 102 | /* A compatibility definition of kmod_info_t for 32-bit kexts. | ||
| 103 | */ | ||
| 104 | typedef struct kmod_info_32_v1 { | ||
| 105 | 	uint32_t next_addr; | ||
| 106 | 	int32_t info_version; | ||
| 107 | 	uint32_t id; | ||
| 108 | 	uint8_t name[KMOD_MAX_NAME]; | ||
| 109 | 	uint8_t version[KMOD_MAX_NAME]; | ||
| 110 | 	int32_t reference_count; | ||
| 111 | 	uint32_t reference_list_addr; | ||
| 112 | 	uint32_t address; | ||
| 113 | 	uint32_t size; | ||
| 114 | 	uint32_t hdr_size; | ||
| 115 | 	uint32_t start_addr; | ||
| 116 | 	uint32_t stop_addr; | ||
| 117 | } kmod_info_32_v1_t; | ||
| 118 | |||
| 119 | /* A compatibility definition of kmod_info_t for 64-bit kexts. | ||
| 120 | */ | ||
| 121 | typedef struct kmod_info_64_v1 { | ||
| 122 | 	uint64_t next_addr; | ||
| 123 | 	int32_t info_version; | ||
| 124 | 	uint32_t id; | ||
| 125 | 	uint8_t name[KMOD_MAX_NAME]; | ||
| 126 | 	uint8_t version[KMOD_MAX_NAME]; | ||
| 127 | 	int32_t reference_count; | ||
| 128 | 	uint64_t reference_list_addr; | ||
| 129 | 	uint64_t address; | ||
| 130 | 	uint64_t size; | ||
| 131 | 	uint64_t hdr_size; | ||
| 132 | 	uint64_t start_addr; | ||
| 133 | 	uint64_t stop_addr; | ||
| 134 | } kmod_info_64_v1_t; | ||
| 135 | |||
| 136 | #pragma pack(pop) | ||
| 137 | |||
| 138 | #if PRAGMA_MARK | ||
| 139 | #pragma mark Kmod structure declaration macros | ||
| 140 | #endif | ||
| 141 | /*********************************************************************** | ||
| 142 | * Kmod structure declaration macros | ||
| 143 | ***********************************************************************/ | ||
| 144 | #define KMOD_INFO_NAME kmod_info | ||
| 145 | #define KMOD_INFO_VERSION 1 | ||
| 146 | |||
| 147 | #define KMOD_DECL(name, version) \ | ||
| 148 | static kmod_start_func_t name ## _module_start; \ | ||
| 149 | static kmod_stop_func_t name ## _module_stop; \ | ||
| 150 | kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \ | ||
| 151 | 	 { #name }, { version }, -1, 0, 0, 0, 0, \ | ||
| 152 | 	 name ## _module_start, \ | ||
| 153 | 	 name ## _module_stop }; | ||
| 154 | |||
| 155 | #define KMOD_EXPLICIT_DECL(name, version, start, stop) \ | ||
| 156 | kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \ | ||
| 157 | 	 { #name }, { version }, -1, 0, 0, 0, 0, \ | ||
| 158 | 	 start, stop }; | ||
| 159 | |||
| 160 | #if PRAGMA_MARK | ||
| 161 | #pragma mark Kernel private declarations | ||
| 162 | #endif | ||
| 163 | /*********************************************************************** | ||
| 164 | * Kernel private declarations. | ||
| 165 | ***********************************************************************/ | ||
| 166 | |||
| 167 | |||
| 168 | #if PRAGMA_MARK | ||
| 169 | #pragma mark Obsolete kmod stuff | ||
| 170 | #endif | ||
| 171 | /*********************************************************************** | ||
| 172 | * These 3 should be dropped but they're referenced by MIG declarations. | ||
| 173 | ***********************************************************************/ | ||
| 174 | typedef void * kmod_args_t; | ||
| 175 | typedef int kmod_control_flavor_t; | ||
| 176 | typedef kmod_info_t * kmod_info_array_t; | ||
| 177 | |||
| 178 | __END_DECLS | ||
| 179 | |||
| 180 | #endif /* _MACH_KMOD_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/lock_set.h created+350| ... | @@ -0,0 +1,350 @@ | ||
| 1 | #ifndef	_lock_set_user_ | ||
| 2 | #define	_lock_set_user_ | ||
| 3 | |||
| 4 | /* Module lock_set */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	lock_set_MSG_COUNT | ||
| 52 | #define	lock_set_MSG_COUNT	6 | ||
| 53 | #endif	/* lock_set_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | |||
| 60 | #ifdef __BeforeMigUserHeader | ||
| 61 | __BeforeMigUserHeader | ||
| 62 | #endif /* __BeforeMigUserHeader */ | ||
| 63 | |||
| 64 | #include <sys/cdefs.h> | ||
| 65 | __BEGIN_DECLS | ||
| 66 | |||
| 67 | |||
| 68 | /* Routine lock_acquire */ | ||
| 69 | #ifdef	mig_external | ||
| 70 | mig_external | ||
| 71 | #else | ||
| 72 | extern | ||
| 73 | #endif	/* mig_external */ | ||
| 74 | kern_return_t lock_acquire | ||
| 75 | ( | ||
| 76 | 	lock_set_t lock_set, | ||
| 77 | 	int lock_id | ||
| 78 | ); | ||
| 79 | |||
| 80 | /* Routine lock_release */ | ||
| 81 | #ifdef	mig_external | ||
| 82 | mig_external | ||
| 83 | #else | ||
| 84 | extern | ||
| 85 | #endif	/* mig_external */ | ||
| 86 | kern_return_t lock_release | ||
| 87 | ( | ||
| 88 | 	lock_set_t lock_set, | ||
| 89 | 	int lock_id | ||
| 90 | ); | ||
| 91 | |||
| 92 | /* Routine lock_try */ | ||
| 93 | #ifdef	mig_external | ||
| 94 | mig_external | ||
| 95 | #else | ||
| 96 | extern | ||
| 97 | #endif	/* mig_external */ | ||
| 98 | kern_return_t lock_try | ||
| 99 | ( | ||
| 100 | 	lock_set_t lock_set, | ||
| 101 | 	int lock_id | ||
| 102 | ); | ||
| 103 | |||
| 104 | /* Routine lock_make_stable */ | ||
| 105 | #ifdef	mig_external | ||
| 106 | mig_external | ||
| 107 | #else | ||
| 108 | extern | ||
| 109 | #endif	/* mig_external */ | ||
| 110 | kern_return_t lock_make_stable | ||
| 111 | ( | ||
| 112 | 	lock_set_t lock_set, | ||
| 113 | 	int lock_id | ||
| 114 | ); | ||
| 115 | |||
| 116 | /* Routine lock_handoff */ | ||
| 117 | #ifdef	mig_external | ||
| 118 | mig_external | ||
| 119 | #else | ||
| 120 | extern | ||
| 121 | #endif	/* mig_external */ | ||
| 122 | kern_return_t lock_handoff | ||
| 123 | ( | ||
| 124 | 	lock_set_t lock_set, | ||
| 125 | 	int lock_id | ||
| 126 | ); | ||
| 127 | |||
| 128 | /* Routine lock_handoff_accept */ | ||
| 129 | #ifdef	mig_external | ||
| 130 | mig_external | ||
| 131 | #else | ||
| 132 | extern | ||
| 133 | #endif	/* mig_external */ | ||
| 134 | kern_return_t lock_handoff_accept | ||
| 135 | ( | ||
| 136 | 	lock_set_t lock_set, | ||
| 137 | 	int lock_id | ||
| 138 | ); | ||
| 139 | |||
| 140 | __END_DECLS | ||
| 141 | |||
| 142 | /********************** Caution **************************/ | ||
| 143 | /* The following data types should be used to calculate */ | ||
| 144 | /* maximum message sizes only. The actual message may be */ | ||
| 145 | /* smaller, and the position of the arguments within the */ | ||
| 146 | /* message layout may vary from what is presented here. */ | ||
| 147 | /* For example, if any of the arguments are variable- */ | ||
| 148 | /* sized, and less than the maximum is sent, the data */ | ||
| 149 | /* will be packed tight in the actual message to reduce */ | ||
| 150 | /* the presence of holes. */ | ||
| 151 | /********************** Caution **************************/ | ||
| 152 | |||
| 153 | /* typedefs for all requests */ | ||
| 154 | |||
| 155 | #ifndef __Request__lock_set_subsystem__defined | ||
| 156 | #define __Request__lock_set_subsystem__defined | ||
| 157 | |||
| 158 | #ifdef __MigPackStructs | ||
| 159 | #pragma pack(push, 4) | ||
| 160 | #endif | ||
| 161 | 	typedef struct { | ||
| 162 | 		mach_msg_header_t Head; | ||
| 163 | 		NDR_record_t NDR; | ||
| 164 | 		int lock_id; | ||
| 165 | 	} __Request__lock_acquire_t __attribute__((unused)); | ||
| 166 | #ifdef __MigPackStructs | ||
| 167 | #pragma pack(pop) | ||
| 168 | #endif | ||
| 169 | |||
| 170 | #ifdef __MigPackStructs | ||
| 171 | #pragma pack(push, 4) | ||
| 172 | #endif | ||
| 173 | 	typedef struct { | ||
| 174 | 		mach_msg_header_t Head; | ||
| 175 | 		NDR_record_t NDR; | ||
| 176 | 		int lock_id; | ||
| 177 | 	} __Request__lock_release_t __attribute__((unused)); | ||
| 178 | #ifdef __MigPackStructs | ||
| 179 | #pragma pack(pop) | ||
| 180 | #endif | ||
| 181 | |||
| 182 | #ifdef __MigPackStructs | ||
| 183 | #pragma pack(push, 4) | ||
| 184 | #endif | ||
| 185 | 	typedef struct { | ||
| 186 | 		mach_msg_header_t Head; | ||
| 187 | 		NDR_record_t NDR; | ||
| 188 | 		int lock_id; | ||
| 189 | 	} __Request__lock_try_t __attribute__((unused)); | ||
| 190 | #ifdef __MigPackStructs | ||
| 191 | #pragma pack(pop) | ||
| 192 | #endif | ||
| 193 | |||
| 194 | #ifdef __MigPackStructs | ||
| 195 | #pragma pack(push, 4) | ||
| 196 | #endif | ||
| 197 | 	typedef struct { | ||
| 198 | 		mach_msg_header_t Head; | ||
| 199 | 		NDR_record_t NDR; | ||
| 200 | 		int lock_id; | ||
| 201 | 	} __Request__lock_make_stable_t __attribute__((unused)); | ||
| 202 | #ifdef __MigPackStructs | ||
| 203 | #pragma pack(pop) | ||
| 204 | #endif | ||
| 205 | |||
| 206 | #ifdef __MigPackStructs | ||
| 207 | #pragma pack(push, 4) | ||
| 208 | #endif | ||
| 209 | 	typedef struct { | ||
| 210 | 		mach_msg_header_t Head; | ||
| 211 | 		NDR_record_t NDR; | ||
| 212 | 		int lock_id; | ||
| 213 | 	} __Request__lock_handoff_t __attribute__((unused)); | ||
| 214 | #ifdef __MigPackStructs | ||
| 215 | #pragma pack(pop) | ||
| 216 | #endif | ||
| 217 | |||
| 218 | #ifdef __MigPackStructs | ||
| 219 | #pragma pack(push, 4) | ||
| 220 | #endif | ||
| 221 | 	typedef struct { | ||
| 222 | 		mach_msg_header_t Head; | ||
| 223 | 		NDR_record_t NDR; | ||
| 224 | 		int lock_id; | ||
| 225 | 	} __Request__lock_handoff_accept_t __attribute__((unused)); | ||
| 226 | #ifdef __MigPackStructs | ||
| 227 | #pragma pack(pop) | ||
| 228 | #endif | ||
| 229 | #endif /* !__Request__lock_set_subsystem__defined */ | ||
| 230 | |||
| 231 | /* union of all requests */ | ||
| 232 | |||
| 233 | #ifndef __RequestUnion__lock_set_subsystem__defined | ||
| 234 | #define __RequestUnion__lock_set_subsystem__defined | ||
| 235 | union __RequestUnion__lock_set_subsystem { | ||
| 236 | 	__Request__lock_acquire_t Request_lock_acquire; | ||
| 237 | 	__Request__lock_release_t Request_lock_release; | ||
| 238 | 	__Request__lock_try_t Request_lock_try; | ||
| 239 | 	__Request__lock_make_stable_t Request_lock_make_stable; | ||
| 240 | 	__Request__lock_handoff_t Request_lock_handoff; | ||
| 241 | 	__Request__lock_handoff_accept_t Request_lock_handoff_accept; | ||
| 242 | }; | ||
| 243 | #endif /* !__RequestUnion__lock_set_subsystem__defined */ | ||
| 244 | /* typedefs for all replies */ | ||
| 245 | |||
| 246 | #ifndef __Reply__lock_set_subsystem__defined | ||
| 247 | #define __Reply__lock_set_subsystem__defined | ||
| 248 | |||
| 249 | #ifdef __MigPackStructs | ||
| 250 | #pragma pack(push, 4) | ||
| 251 | #endif | ||
| 252 | 	typedef struct { | ||
| 253 | 		mach_msg_header_t Head; | ||
| 254 | 		NDR_record_t NDR; | ||
| 255 | 		kern_return_t RetCode; | ||
| 256 | 	} __Reply__lock_acquire_t __attribute__((unused)); | ||
| 257 | #ifdef __MigPackStructs | ||
| 258 | #pragma pack(pop) | ||
| 259 | #endif | ||
| 260 | |||
| 261 | #ifdef __MigPackStructs | ||
| 262 | #pragma pack(push, 4) | ||
| 263 | #endif | ||
| 264 | 	typedef struct { | ||
| 265 | 		mach_msg_header_t Head; | ||
| 266 | 		NDR_record_t NDR; | ||
| 267 | 		kern_return_t RetCode; | ||
| 268 | 	} __Reply__lock_release_t __attribute__((unused)); | ||
| 269 | #ifdef __MigPackStructs | ||
| 270 | #pragma pack(pop) | ||
| 271 | #endif | ||
| 272 | |||
| 273 | #ifdef __MigPackStructs | ||
| 274 | #pragma pack(push, 4) | ||
| 275 | #endif | ||
| 276 | 	typedef struct { | ||
| 277 | 		mach_msg_header_t Head; | ||
| 278 | 		NDR_record_t NDR; | ||
| 279 | 		kern_return_t RetCode; | ||
| 280 | 	} __Reply__lock_try_t __attribute__((unused)); | ||
| 281 | #ifdef __MigPackStructs | ||
| 282 | #pragma pack(pop) | ||
| 283 | #endif | ||
| 284 | |||
| 285 | #ifdef __MigPackStructs | ||
| 286 | #pragma pack(push, 4) | ||
| 287 | #endif | ||
| 288 | 	typedef struct { | ||
| 289 | 		mach_msg_header_t Head; | ||
| 290 | 		NDR_record_t NDR; | ||
| 291 | 		kern_return_t RetCode; | ||
| 292 | 	} __Reply__lock_make_stable_t __attribute__((unused)); | ||
| 293 | #ifdef __MigPackStructs | ||
| 294 | #pragma pack(pop) | ||
| 295 | #endif | ||
| 296 | |||
| 297 | #ifdef __MigPackStructs | ||
| 298 | #pragma pack(push, 4) | ||
| 299 | #endif | ||
| 300 | 	typedef struct { | ||
| 301 | 		mach_msg_header_t Head; | ||
| 302 | 		NDR_record_t NDR; | ||
| 303 | 		kern_return_t RetCode; | ||
| 304 | 	} __Reply__lock_handoff_t __attribute__((unused)); | ||
| 305 | #ifdef __MigPackStructs | ||
| 306 | #pragma pack(pop) | ||
| 307 | #endif | ||
| 308 | |||
| 309 | #ifdef __MigPackStructs | ||
| 310 | #pragma pack(push, 4) | ||
| 311 | #endif | ||
| 312 | 	typedef struct { | ||
| 313 | 		mach_msg_header_t Head; | ||
| 314 | 		NDR_record_t NDR; | ||
| 315 | 		kern_return_t RetCode; | ||
| 316 | 	} __Reply__lock_handoff_accept_t __attribute__((unused)); | ||
| 317 | #ifdef __MigPackStructs | ||
| 318 | #pragma pack(pop) | ||
| 319 | #endif | ||
| 320 | #endif /* !__Reply__lock_set_subsystem__defined */ | ||
| 321 | |||
| 322 | /* union of all replies */ | ||
| 323 | |||
| 324 | #ifndef __ReplyUnion__lock_set_subsystem__defined | ||
| 325 | #define __ReplyUnion__lock_set_subsystem__defined | ||
| 326 | union __ReplyUnion__lock_set_subsystem { | ||
| 327 | 	__Reply__lock_acquire_t Reply_lock_acquire; | ||
| 328 | 	__Reply__lock_release_t Reply_lock_release; | ||
| 329 | 	__Reply__lock_try_t Reply_lock_try; | ||
| 330 | 	__Reply__lock_make_stable_t Reply_lock_make_stable; | ||
| 331 | 	__Reply__lock_handoff_t Reply_lock_handoff; | ||
| 332 | 	__Reply__lock_handoff_accept_t Reply_lock_handoff_accept; | ||
| 333 | }; | ||
| 334 | #endif /* !__RequestUnion__lock_set_subsystem__defined */ | ||
| 335 | |||
| 336 | #ifndef subsystem_to_name_map_lock_set | ||
| 337 | #define subsystem_to_name_map_lock_set \ | ||
| 338 | { "lock_acquire", 617000 },\ | ||
| 339 | { "lock_release", 617001 },\ | ||
| 340 | { "lock_try", 617002 },\ | ||
| 341 | { "lock_make_stable", 617003 },\ | ||
| 342 | { "lock_handoff", 617004 },\ | ||
| 343 | { "lock_handoff_accept", 617005 } | ||
| 344 | #endif | ||
| 345 | |||
| 346 | #ifdef __AfterMigUserHeader | ||
| 347 | __AfterMigUserHeader | ||
| 348 | #endif /* __AfterMigUserHeader */ | ||
| 349 | |||
| 350 | #endif	 /* _lock_set_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach.h created+245| ... | @@ -0,0 +1,245 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2014 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Mach Operating System | ||
| 30 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 31 | * All Rights Reserved. | ||
| 32 | * | ||
| 33 | * Permission to use, copy, modify and distribute this software and its | ||
| 34 | * documentation is hereby granted, provided that both the copyright | ||
| 35 | * notice and this permission notice appear in all copies of the | ||
| 36 | * software, derivative works or modified versions, and any portions | ||
| 37 | * thereof, and that both notices appear in supporting documentation. | ||
| 38 | * | ||
| 39 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 40 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 41 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 42 | * | ||
| 43 | * Carnegie Mellon requests users of this software to return to | ||
| 44 | * | ||
| 45 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 46 | * School of Computer Science | ||
| 47 | * Carnegie Mellon University | ||
| 48 | * Pittsburgh PA 15213-3890 | ||
| 49 | * | ||
| 50 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 51 | * the rights to redistribute these changes. | ||
| 52 | */ | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Includes all the types that a normal user | ||
| 56 | * of Mach programs should need | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_H_ | ||
| 60 | #define _MACH_H_ | ||
| 61 | |||
| 62 | #define __MACH30__ | ||
| 63 | #define MACH_IPC_FLAVOR UNTYPED | ||
| 64 | |||
| 65 | #include <mach/std_types.h> | ||
| 66 | #include <mach/mach_types.h> | ||
| 67 | #include <mach/mach_interface.h> | ||
| 68 | #include <mach/mach_port.h> | ||
| 69 | #include <mach/mach_init.h> | ||
| 70 | #include <mach/mach_host.h> | ||
| 71 | #include <mach/thread_switch.h> | ||
| 72 | |||
| 73 | #include <mach/rpc.h> /* for compatibility only */ | ||
| 74 | #include <mach/mig.h> | ||
| 75 | |||
| 76 | #include <mach/mig_errors.h> | ||
| 77 | #include <mach/mach_error.h> | ||
| 78 | |||
| 79 | #include <sys/cdefs.h> | ||
| 80 | |||
| 81 | __BEGIN_DECLS | ||
| 82 | /* | ||
| 83 | * Standard prototypes | ||
| 84 | */ | ||
| 85 | extern void panic_init(mach_port_t); | ||
| 86 | extern void panic(const char *, ...); | ||
| 87 | |||
| 88 | extern void safe_gets(char *, | ||
| 89 | char *, | ||
| 90 | int); | ||
| 91 | |||
| 92 | extern void slot_name(cpu_type_t, | ||
| 93 | cpu_subtype_t, | ||
| 94 | char **, | ||
| 95 | char **); | ||
| 96 | |||
| 97 | extern void mig_reply_setup(mach_msg_header_t *, | ||
| 98 | mach_msg_header_t *); | ||
| 99 | |||
| 100 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 101 | extern void mach_msg_destroy(mach_msg_header_t *); | ||
| 102 | |||
| 103 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 104 | extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *); | ||
| 105 | |||
| 106 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 107 | extern mach_msg_return_t mach_msg_send(mach_msg_header_t *); | ||
| 108 | |||
| 109 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 110 | extern mach_msg_return_t mach_msg_server_once(boolean_t (*) | ||
| 111 | (mach_msg_header_t *, | ||
| 112 | mach_msg_header_t *), | ||
| 113 | mach_msg_size_t, | ||
| 114 | mach_port_t, | ||
| 115 | mach_msg_options_t); | ||
| 116 | |||
| 117 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 118 | extern mach_msg_return_t mach_msg_server(boolean_t (*) | ||
| 119 | (mach_msg_header_t *, | ||
| 120 | mach_msg_header_t *), | ||
| 121 | mach_msg_size_t, | ||
| 122 | mach_port_t, | ||
| 123 | mach_msg_options_t); | ||
| 124 | |||
| 125 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 126 | extern mach_msg_return_t mach_msg_server_importance(boolean_t (*) | ||
| 127 | (mach_msg_header_t *, | ||
| 128 | mach_msg_header_t *), | ||
| 129 | mach_msg_size_t, | ||
| 130 | mach_port_t, | ||
| 131 | mach_msg_options_t); | ||
| 132 | |||
| 133 | /* | ||
| 134 | * Prototypes for compatibility | ||
| 135 | */ | ||
| 136 | extern kern_return_t clock_get_res(mach_port_t, | ||
| 137 | clock_res_t *); | ||
| 138 | extern kern_return_t clock_set_res(mach_port_t, | ||
| 139 | clock_res_t); | ||
| 140 | |||
| 141 | extern kern_return_t clock_sleep(mach_port_t, | ||
| 142 | int, | ||
| 143 | mach_timespec_t, | ||
| 144 | mach_timespec_t *); | ||
| 145 | |||
| 146 | /*! | ||
| 147 | * @group voucher_mach_msg Prototypes | ||
| 148 | */ | ||
| 149 | |||
| 150 | #define VOUCHER_MACH_MSG_API_VERSION 20140205 | ||
| 151 | |||
| 152 | /*! | ||
| 153 | * @typedef voucher_mach_msg_state_t | ||
| 154 | * | ||
| 155 | * @abstract | ||
| 156 | * Opaque object encapsulating state changed by voucher_mach_msg_adopt(). | ||
| 157 | */ | ||
| 158 | typedef struct voucher_mach_msg_state_s *voucher_mach_msg_state_t; | ||
| 159 | |||
| 160 | /*! | ||
| 161 | * @const VOUCHER_MACH_MSG_STATE_UNCHANGED | ||
| 162 | * | ||
| 163 | * @discussion | ||
| 164 | * Constant indicating no state change occurred. | ||
| 165 | */ | ||
| 166 | #define VOUCHER_MACH_MSG_STATE_UNCHANGED ((voucher_mach_msg_state_t)~0ul) | ||
| 167 | |||
| 168 | /*! | ||
| 169 | * @function voucher_mach_msg_set | ||
| 170 | * | ||
| 171 | * @abstract | ||
| 172 | * Change specified message header to contain current mach voucher with a | ||
| 173 | * COPY_SEND disposition. | ||
| 174 | * Does not change message if it already has non-zero MACH_MSGH_BITS_VOUCHER. | ||
| 175 | * | ||
| 176 | * @discussion | ||
| 177 | * Borrows reference to current thread voucher so message should be sent | ||
| 178 | * immediately (without intervening calls that might change that voucher). | ||
| 179 | * | ||
| 180 | * @param msg | ||
| 181 | * The message to modify. | ||
| 182 | * | ||
| 183 | * @result | ||
| 184 | * True if header was changed. | ||
| 185 | */ | ||
| 186 | extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg); | ||
| 187 | |||
| 188 | /*! | ||
| 189 | * @function voucher_mach_msg_clear | ||
| 190 | * | ||
| 191 | * @abstract | ||
| 192 | * Removes changes made to specified message header by voucher_mach_msg_set() | ||
| 193 | * and any mach_msg() send operations (successful or not). | ||
| 194 | * If the message is not needed further, mach_msg_destroy() should be called | ||
| 195 | * instead. | ||
| 196 | * | ||
| 197 | * @discussion | ||
| 198 | * Not intended to be called if voucher_mach_msg_set() returned false. | ||
| 199 | * Releases reference to message mach voucher if an extra reference was | ||
| 200 | * acquired due to an unsuccessful send operation (pseudo-receive). | ||
| 201 | * | ||
| 202 | * @param msg | ||
| 203 | * The message to modify. | ||
| 204 | */ | ||
| 205 | extern void voucher_mach_msg_clear(mach_msg_header_t *msg); | ||
| 206 | |||
| 207 | /*! | ||
| 208 | * @function voucher_mach_msg_adopt | ||
| 209 | * | ||
| 210 | * @abstract | ||
| 211 | * Adopt the voucher contained in the specified message on the current thread | ||
| 212 | * and return the previous thread voucher state. | ||
| 213 | * | ||
| 214 | * @discussion | ||
| 215 | * Ownership of the mach voucher in the message is transferred to the current | ||
| 216 | * thread and the message header voucher fields are cleared. | ||
| 217 | * | ||
| 218 | * @param msg | ||
| 219 | * The message to query and modify. | ||
| 220 | * | ||
| 221 | * @result | ||
| 222 | * The previous thread voucher state or VOUCHER_MACH_MSG_STATE_UNCHANGED if no | ||
| 223 | * state change occurred. | ||
| 224 | */ | ||
| 225 | extern voucher_mach_msg_state_t voucher_mach_msg_adopt(mach_msg_header_t *msg); | ||
| 226 | |||
| 227 | /*! | ||
| 228 | * @function voucher_mach_msg_revert | ||
| 229 | * | ||
| 230 | * @abstract | ||
| 231 | * Restore thread voucher state previously modified by voucher_mach_msg_adopt(). | ||
| 232 | * | ||
| 233 | * @discussion | ||
| 234 | * Current thread voucher reference is released. | ||
| 235 | * No change to thread voucher state if passed VOUCHER_MACH_MSG_STATE_UNCHANGED. | ||
| 236 | * | ||
| 237 | * @param state | ||
| 238 | * The thread voucher state to restore. | ||
| 239 | */ | ||
| 240 | |||
| 241 | extern void voucher_mach_msg_revert(voucher_mach_msg_state_t state); | ||
| 242 | |||
| 243 | __END_DECLS | ||
| 244 | |||
| 245 | #endif /* _MACH_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_error.h created+93| ... | @@ -0,0 +1,93 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Mach Operating System | ||
| 30 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 31 | * All Rights Reserved. | ||
| 32 | * | ||
| 33 | * Permission to use, copy, modify and distribute this software and its | ||
| 34 | * documentation is hereby granted, provided that both the copyright | ||
| 35 | * notice and this permission notice appear in all copies of the | ||
| 36 | * software, derivative works or modified versions, and any portions | ||
| 37 | * thereof, and that both notices appear in supporting documentation. | ||
| 38 | * | ||
| 39 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS | ||
| 40 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 41 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 42 | * | ||
| 43 | * Carnegie Mellon requests users of this software to return to | ||
| 44 | * | ||
| 45 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 46 | * School of Computer Science | ||
| 47 | * Carnegie Mellon University | ||
| 48 | * Pittsburgh PA 15213-3890 | ||
| 49 | * | ||
| 50 | * any improvements or extensions that they make and grant Carnegie the | ||
| 51 | * rights to redistribute these changes. | ||
| 52 | */ | ||
| 53 | |||
| 54 | /* | ||
| 55 | *	File:	mach_error.h | ||
| 56 | *	Author:	Douglas Orr, Carnegie Mellon University | ||
| 57 | *	Date:	Mar. 1988 | ||
| 58 | * | ||
| 59 | *	Definitions of routines in mach_error.c | ||
| 60 | */ | ||
| 61 | |||
| 62 | #ifndef _MACH_ERROR_ | ||
| 63 | #define _MACH_ERROR_ 1 | ||
| 64 | |||
| 65 | #include <mach/error.h> | ||
| 66 | |||
| 67 | #include <sys/cdefs.h> | ||
| 68 | |||
| 69 | __BEGIN_DECLS | ||
| 70 | char *mach_error_string( | ||
| 71 | /* | ||
| 72 | *	Returns a string appropriate to the error argument given | ||
| 73 | */ | ||
| 74 | 	mach_error_t error_value | ||
| 75 | 	); | ||
| 76 | |||
| 77 | void mach_error( | ||
| 78 | /* | ||
| 79 | *	Prints an appropriate message on the standard error stream | ||
| 80 | */ | ||
| 81 | 	const char *str, | ||
| 82 | 	mach_error_t error_value | ||
| 83 | 	); | ||
| 84 | |||
| 85 | char *mach_error_type( | ||
| 86 | /* | ||
| 87 | *	Returns a string with the error system, subsystem and code | ||
| 88 | */ | ||
| 89 | 	mach_error_t error_value | ||
| 90 | 	); | ||
| 91 | __END_DECLS | ||
| 92 | |||
| 93 | #endif /* _MACH_ERROR_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_host.h created+1295| ... | @@ -0,0 +1,1295 @@ | ||
| 1 | #ifndef	_mach_host_user_ | ||
| 2 | #define	_mach_host_user_ | ||
| 3 | |||
| 4 | /* Module mach_host */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	mach_host_MSG_COUNT | ||
| 52 | #define	mach_host_MSG_COUNT	35 | ||
| 53 | #endif	/* mach_host_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach/mach_types.h> | ||
| 60 | #include <mach_debug/mach_debug_types.h> | ||
| 61 | #include <mach/mach_init.h> | ||
| 62 | |||
| 63 | #ifdef __BeforeMigUserHeader | ||
| 64 | __BeforeMigUserHeader | ||
| 65 | #endif /* __BeforeMigUserHeader */ | ||
| 66 | |||
| 67 | #include <sys/cdefs.h> | ||
| 68 | __BEGIN_DECLS | ||
| 69 | |||
| 70 | |||
| 71 | /* Routine host_info */ | ||
| 72 | #ifdef	mig_external | ||
| 73 | mig_external | ||
| 74 | #else | ||
| 75 | extern | ||
| 76 | #endif	/* mig_external */ | ||
| 77 | __WATCHOS_PROHIBITED | ||
| 78 | __TVOS_PROHIBITED | ||
| 79 | kern_return_t host_info | ||
| 80 | ( | ||
| 81 | 	host_t host, | ||
| 82 | 	host_flavor_t flavor, | ||
| 83 | 	host_info_t host_info_out, | ||
| 84 | 	mach_msg_type_number_t *host_info_outCnt | ||
| 85 | ); | ||
| 86 | |||
| 87 | /* Routine host_kernel_version */ | ||
| 88 | #ifdef	mig_external | ||
| 89 | mig_external | ||
| 90 | #else | ||
| 91 | extern | ||
| 92 | #endif	/* mig_external */ | ||
| 93 | kern_return_t host_kernel_version | ||
| 94 | ( | ||
| 95 | 	host_t host, | ||
| 96 | 	kernel_version_t kernel_version | ||
| 97 | ); | ||
| 98 | |||
| 99 | /* Routine _host_page_size */ | ||
| 100 | #ifdef	mig_external | ||
| 101 | mig_external | ||
| 102 | #else | ||
| 103 | extern | ||
| 104 | #endif	/* mig_external */ | ||
| 105 | kern_return_t _host_page_size | ||
| 106 | ( | ||
| 107 | 	host_t host, | ||
| 108 | 	vm_size_t *out_page_size | ||
| 109 | ); | ||
| 110 | |||
| 111 | /* Routine mach_memory_object_memory_entry */ | ||
| 112 | #ifdef	mig_external | ||
| 113 | mig_external | ||
| 114 | #else | ||
| 115 | extern | ||
| 116 | #endif	/* mig_external */ | ||
| 117 | kern_return_t mach_memory_object_memory_entry | ||
| 118 | ( | ||
| 119 | 	host_t host, | ||
| 120 | 	boolean_t internal, | ||
| 121 | 	vm_size_t size, | ||
| 122 | 	vm_prot_t permission, | ||
| 123 | 	memory_object_t pager, | ||
| 124 | 	mach_port_t *entry_handle | ||
| 125 | ); | ||
| 126 | |||
| 127 | /* Routine host_processor_info */ | ||
| 128 | #ifdef	mig_external | ||
| 129 | mig_external | ||
| 130 | #else | ||
| 131 | extern | ||
| 132 | #endif	/* mig_external */ | ||
| 133 | kern_return_t host_processor_info | ||
| 134 | ( | ||
| 135 | 	host_t host, | ||
| 136 | 	processor_flavor_t flavor, | ||
| 137 | 	natural_t *out_processor_count, | ||
| 138 | 	processor_info_array_t *out_processor_info, | ||
| 139 | 	mach_msg_type_number_t *out_processor_infoCnt | ||
| 140 | ); | ||
| 141 | |||
| 142 | /* Routine host_get_io_master */ | ||
| 143 | #ifdef	mig_external | ||
| 144 | mig_external | ||
| 145 | #else | ||
| 146 | extern | ||
| 147 | #endif	/* mig_external */ | ||
| 148 | kern_return_t host_get_io_master | ||
| 149 | ( | ||
| 150 | 	host_t host, | ||
| 151 | 	io_master_t *io_master | ||
| 152 | ); | ||
| 153 | |||
| 154 | /* Routine host_get_clock_service */ | ||
| 155 | #ifdef	mig_external | ||
| 156 | mig_external | ||
| 157 | #else | ||
| 158 | extern | ||
| 159 | #endif	/* mig_external */ | ||
| 160 | kern_return_t host_get_clock_service | ||
| 161 | ( | ||
| 162 | 	host_t host, | ||
| 163 | 	clock_id_t clock_id, | ||
| 164 | 	clock_serv_t *clock_serv | ||
| 165 | ); | ||
| 166 | |||
| 167 | /* Routine kmod_get_info */ | ||
| 168 | #ifdef	mig_external | ||
| 169 | mig_external | ||
| 170 | #else | ||
| 171 | extern | ||
| 172 | #endif	/* mig_external */ | ||
| 173 | kern_return_t kmod_get_info | ||
| 174 | ( | ||
| 175 | 	host_t host, | ||
| 176 | 	kmod_args_t *modules, | ||
| 177 | 	mach_msg_type_number_t *modulesCnt | ||
| 178 | ); | ||
| 179 | |||
| 180 | /* Routine host_virtual_physical_table_info */ | ||
| 181 | #ifdef	mig_external | ||
| 182 | mig_external | ||
| 183 | #else | ||
| 184 | extern | ||
| 185 | #endif	/* mig_external */ | ||
| 186 | kern_return_t host_virtual_physical_table_info | ||
| 187 | ( | ||
| 188 | 	host_t host, | ||
| 189 | 	hash_info_bucket_array_t *info, | ||
| 190 | 	mach_msg_type_number_t *infoCnt | ||
| 191 | ); | ||
| 192 | |||
| 193 | /* Routine processor_set_default */ | ||
| 194 | #ifdef	mig_external | ||
| 195 | mig_external | ||
| 196 | #else | ||
| 197 | extern | ||
| 198 | #endif	/* mig_external */ | ||
| 199 | kern_return_t processor_set_default | ||
| 200 | ( | ||
| 201 | 	host_t host, | ||
| 202 | 	processor_set_name_t *default_set | ||
| 203 | ); | ||
| 204 | |||
| 205 | /* Routine processor_set_create */ | ||
| 206 | #ifdef	mig_external | ||
| 207 | mig_external | ||
| 208 | #else | ||
| 209 | extern | ||
| 210 | #endif	/* mig_external */ | ||
| 211 | kern_return_t processor_set_create | ||
| 212 | ( | ||
| 213 | 	host_t host, | ||
| 214 | 	processor_set_t *new_set, | ||
| 215 | 	processor_set_name_t *new_name | ||
| 216 | ); | ||
| 217 | |||
| 218 | /* Routine mach_memory_object_memory_entry_64 */ | ||
| 219 | #ifdef	mig_external | ||
| 220 | mig_external | ||
| 221 | #else | ||
| 222 | extern | ||
| 223 | #endif	/* mig_external */ | ||
| 224 | kern_return_t mach_memory_object_memory_entry_64 | ||
| 225 | ( | ||
| 226 | 	host_t host, | ||
| 227 | 	boolean_t internal, | ||
| 228 | 	memory_object_size_t size, | ||
| 229 | 	vm_prot_t permission, | ||
| 230 | 	memory_object_t pager, | ||
| 231 | 	mach_port_t *entry_handle | ||
| 232 | ); | ||
| 233 | |||
| 234 | /* Routine host_statistics */ | ||
| 235 | #ifdef	mig_external | ||
| 236 | mig_external | ||
| 237 | #else | ||
| 238 | extern | ||
| 239 | #endif	/* mig_external */ | ||
| 240 | kern_return_t host_statistics | ||
| 241 | ( | ||
| 242 | 	host_t host_priv, | ||
| 243 | 	host_flavor_t flavor, | ||
| 244 | 	host_info_t host_info_out, | ||
| 245 | 	mach_msg_type_number_t *host_info_outCnt | ||
| 246 | ); | ||
| 247 | |||
| 248 | /* Routine host_request_notification */ | ||
| 249 | #ifdef	mig_external | ||
| 250 | mig_external | ||
| 251 | #else | ||
| 252 | extern | ||
| 253 | #endif	/* mig_external */ | ||
| 254 | __WATCHOS_PROHIBITED | ||
| 255 | __TVOS_PROHIBITED | ||
| 256 | kern_return_t host_request_notification | ||
| 257 | ( | ||
| 258 | 	host_t host, | ||
| 259 | 	host_flavor_t notify_type, | ||
| 260 | 	mach_port_t notify_port | ||
| 261 | ); | ||
| 262 | |||
| 263 | /* Routine host_lockgroup_info */ | ||
| 264 | #ifdef	mig_external | ||
| 265 | mig_external | ||
| 266 | #else | ||
| 267 | extern | ||
| 268 | #endif	/* mig_external */ | ||
| 269 | kern_return_t host_lockgroup_info | ||
| 270 | ( | ||
| 271 | 	host_t host, | ||
| 272 | 	lockgroup_info_array_t *lockgroup_info, | ||
| 273 | 	mach_msg_type_number_t *lockgroup_infoCnt | ||
| 274 | ); | ||
| 275 | |||
| 276 | /* Routine host_statistics64 */ | ||
| 277 | #ifdef	mig_external | ||
| 278 | mig_external | ||
| 279 | #else | ||
| 280 | extern | ||
| 281 | #endif	/* mig_external */ | ||
| 282 | kern_return_t host_statistics64 | ||
| 283 | ( | ||
| 284 | 	host_t host_priv, | ||
| 285 | 	host_flavor_t flavor, | ||
| 286 | 	host_info64_t host_info64_out, | ||
| 287 | 	mach_msg_type_number_t *host_info64_outCnt | ||
| 288 | ); | ||
| 289 | |||
| 290 | /* Routine mach_zone_info */ | ||
| 291 | #ifdef	mig_external | ||
| 292 | mig_external | ||
| 293 | #else | ||
| 294 | extern | ||
| 295 | #endif	/* mig_external */ | ||
| 296 | kern_return_t mach_zone_info | ||
| 297 | ( | ||
| 298 | 	host_priv_t host, | ||
| 299 | 	mach_zone_name_array_t *names, | ||
| 300 | 	mach_msg_type_number_t *namesCnt, | ||
| 301 | 	mach_zone_info_array_t *info, | ||
| 302 | 	mach_msg_type_number_t *infoCnt | ||
| 303 | ); | ||
| 304 | |||
| 305 | /* Routine host_create_mach_voucher */ | ||
| 306 | #ifdef	mig_external | ||
| 307 | mig_external | ||
| 308 | #else | ||
| 309 | extern | ||
| 310 | #endif	/* mig_external */ | ||
| 311 | __WATCHOS_PROHIBITED | ||
| 312 | __TVOS_PROHIBITED | ||
| 313 | kern_return_t host_create_mach_voucher | ||
| 314 | ( | ||
| 315 | 	host_t host, | ||
| 316 | 	mach_voucher_attr_raw_recipe_array_t recipes, | ||
| 317 | 	mach_msg_type_number_t recipesCnt, | ||
| 318 | 	ipc_voucher_t *voucher | ||
| 319 | ); | ||
| 320 | |||
| 321 | /* Routine host_register_mach_voucher_attr_manager */ | ||
| 322 | #ifdef	mig_external | ||
| 323 | mig_external | ||
| 324 | #else | ||
| 325 | extern | ||
| 326 | #endif	/* mig_external */ | ||
| 327 | __WATCHOS_PROHIBITED | ||
| 328 | __TVOS_PROHIBITED | ||
| 329 | kern_return_t host_register_mach_voucher_attr_manager | ||
| 330 | ( | ||
| 331 | 	host_t host, | ||
| 332 | 	mach_voucher_attr_manager_t attr_manager, | ||
| 333 | 	mach_voucher_attr_value_handle_t default_value, | ||
| 334 | 	mach_voucher_attr_key_t *new_key, | ||
| 335 | 	ipc_voucher_attr_control_t *new_attr_control | ||
| 336 | ); | ||
| 337 | |||
| 338 | /* Routine host_register_well_known_mach_voucher_attr_manager */ | ||
| 339 | #ifdef	mig_external | ||
| 340 | mig_external | ||
| 341 | #else | ||
| 342 | extern | ||
| 343 | #endif	/* mig_external */ | ||
| 344 | __WATCHOS_PROHIBITED | ||
| 345 | __TVOS_PROHIBITED | ||
| 346 | kern_return_t host_register_well_known_mach_voucher_attr_manager | ||
| 347 | ( | ||
| 348 | 	host_t host, | ||
| 349 | 	mach_voucher_attr_manager_t attr_manager, | ||
| 350 | 	mach_voucher_attr_value_handle_t default_value, | ||
| 351 | 	mach_voucher_attr_key_t key, | ||
| 352 | 	ipc_voucher_attr_control_t *new_attr_control | ||
| 353 | ); | ||
| 354 | |||
| 355 | /* Routine host_set_atm_diagnostic_flag */ | ||
| 356 | #ifdef	mig_external | ||
| 357 | mig_external | ||
| 358 | #else | ||
| 359 | extern | ||
| 360 | #endif	/* mig_external */ | ||
| 361 | __WATCHOS_PROHIBITED | ||
| 362 | __TVOS_PROHIBITED | ||
| 363 | kern_return_t host_set_atm_diagnostic_flag | ||
| 364 | ( | ||
| 365 | 	host_t host, | ||
| 366 | 	uint32_t diagnostic_flag | ||
| 367 | ); | ||
| 368 | |||
| 369 | /* Routine host_get_atm_diagnostic_flag */ | ||
| 370 | #ifdef	mig_external | ||
| 371 | mig_external | ||
| 372 | #else | ||
| 373 | extern | ||
| 374 | #endif	/* mig_external */ | ||
| 375 | __WATCHOS_PROHIBITED | ||
| 376 | __TVOS_PROHIBITED | ||
| 377 | kern_return_t host_get_atm_diagnostic_flag | ||
| 378 | ( | ||
| 379 | 	host_t host, | ||
| 380 | 	uint32_t *diagnostic_flag | ||
| 381 | ); | ||
| 382 | |||
| 383 | /* Routine mach_memory_info */ | ||
| 384 | #ifdef	mig_external | ||
| 385 | mig_external | ||
| 386 | #else | ||
| 387 | extern | ||
| 388 | #endif	/* mig_external */ | ||
| 389 | kern_return_t mach_memory_info | ||
| 390 | ( | ||
| 391 | 	host_priv_t host, | ||
| 392 | 	mach_zone_name_array_t *names, | ||
| 393 | 	mach_msg_type_number_t *namesCnt, | ||
| 394 | 	mach_zone_info_array_t *info, | ||
| 395 | 	mach_msg_type_number_t *infoCnt, | ||
| 396 | 	mach_memory_info_array_t *memory_info, | ||
| 397 | 	mach_msg_type_number_t *memory_infoCnt | ||
| 398 | ); | ||
| 399 | |||
| 400 | /* Routine host_set_multiuser_config_flags */ | ||
| 401 | #ifdef	mig_external | ||
| 402 | mig_external | ||
| 403 | #else | ||
| 404 | extern | ||
| 405 | #endif	/* mig_external */ | ||
| 406 | kern_return_t host_set_multiuser_config_flags | ||
| 407 | ( | ||
| 408 | 	host_priv_t host_priv, | ||
| 409 | 	uint32_t multiuser_flags | ||
| 410 | ); | ||
| 411 | |||
| 412 | /* Routine host_get_multiuser_config_flags */ | ||
| 413 | #ifdef	mig_external | ||
| 414 | mig_external | ||
| 415 | #else | ||
| 416 | extern | ||
| 417 | #endif	/* mig_external */ | ||
| 418 | kern_return_t host_get_multiuser_config_flags | ||
| 419 | ( | ||
| 420 | 	host_t host, | ||
| 421 | 	uint32_t *multiuser_flags | ||
| 422 | ); | ||
| 423 | |||
| 424 | /* Routine host_check_multiuser_mode */ | ||
| 425 | #ifdef	mig_external | ||
| 426 | mig_external | ||
| 427 | #else | ||
| 428 | extern | ||
| 429 | #endif	/* mig_external */ | ||
| 430 | kern_return_t host_check_multiuser_mode | ||
| 431 | ( | ||
| 432 | 	host_t host, | ||
| 433 | 	uint32_t *multiuser_mode | ||
| 434 | ); | ||
| 435 | |||
| 436 | /* Routine mach_zone_info_for_zone */ | ||
| 437 | #ifdef	mig_external | ||
| 438 | mig_external | ||
| 439 | #else | ||
| 440 | extern | ||
| 441 | #endif	/* mig_external */ | ||
| 442 | kern_return_t mach_zone_info_for_zone | ||
| 443 | ( | ||
| 444 | 	host_priv_t host, | ||
| 445 | 	mach_zone_name_t name, | ||
| 446 | 	mach_zone_info_t *info | ||
| 447 | ); | ||
| 448 | |||
| 449 | __END_DECLS | ||
| 450 | |||
| 451 | /********************** Caution **************************/ | ||
| 452 | /* The following data types should be used to calculate */ | ||
| 453 | /* maximum message sizes only. The actual message may be */ | ||
| 454 | /* smaller, and the position of the arguments within the */ | ||
| 455 | /* message layout may vary from what is presented here. */ | ||
| 456 | /* For example, if any of the arguments are variable- */ | ||
| 457 | /* sized, and less than the maximum is sent, the data */ | ||
| 458 | /* will be packed tight in the actual message to reduce */ | ||
| 459 | /* the presence of holes. */ | ||
| 460 | /********************** Caution **************************/ | ||
| 461 | |||
| 462 | /* typedefs for all requests */ | ||
| 463 | |||
| 464 | #ifndef __Request__mach_host_subsystem__defined | ||
| 465 | #define __Request__mach_host_subsystem__defined | ||
| 466 | |||
| 467 | #ifdef __MigPackStructs | ||
| 468 | #pragma pack(push, 4) | ||
| 469 | #endif | ||
| 470 | 	typedef struct { | ||
| 471 | 		mach_msg_header_t Head; | ||
| 472 | 		NDR_record_t NDR; | ||
| 473 | 		host_flavor_t flavor; | ||
| 474 | 		mach_msg_type_number_t host_info_outCnt; | ||
| 475 | 	} __Request__host_info_t __attribute__((unused)); | ||
| 476 | #ifdef __MigPackStructs | ||
| 477 | #pragma pack(pop) | ||
| 478 | #endif | ||
| 479 | |||
| 480 | #ifdef __MigPackStructs | ||
| 481 | #pragma pack(push, 4) | ||
| 482 | #endif | ||
| 483 | 	typedef struct { | ||
| 484 | 		mach_msg_header_t Head; | ||
| 485 | 	} __Request__host_kernel_version_t __attribute__((unused)); | ||
| 486 | #ifdef __MigPackStructs | ||
| 487 | #pragma pack(pop) | ||
| 488 | #endif | ||
| 489 | |||
| 490 | #ifdef __MigPackStructs | ||
| 491 | #pragma pack(push, 4) | ||
| 492 | #endif | ||
| 493 | 	typedef struct { | ||
| 494 | 		mach_msg_header_t Head; | ||
| 495 | 	} __Request___host_page_size_t __attribute__((unused)); | ||
| 496 | #ifdef __MigPackStructs | ||
| 497 | #pragma pack(pop) | ||
| 498 | #endif | ||
| 499 | |||
| 500 | #ifdef __MigPackStructs | ||
| 501 | #pragma pack(push, 4) | ||
| 502 | #endif | ||
| 503 | 	typedef struct { | ||
| 504 | 		mach_msg_header_t Head; | ||
| 505 | 		/* start of the kernel processed data */ | ||
| 506 | 		mach_msg_body_t msgh_body; | ||
| 507 | 		mach_msg_port_descriptor_t pager; | ||
| 508 | 		/* end of the kernel processed data */ | ||
| 509 | 		NDR_record_t NDR; | ||
| 510 | 		boolean_t internal; | ||
| 511 | 		vm_size_t size; | ||
| 512 | 		vm_prot_t permission; | ||
| 513 | 	} __Request__mach_memory_object_memory_entry_t __attribute__((unused)); | ||
| 514 | #ifdef __MigPackStructs | ||
| 515 | #pragma pack(pop) | ||
| 516 | #endif | ||
| 517 | |||
| 518 | #ifdef __MigPackStructs | ||
| 519 | #pragma pack(push, 4) | ||
| 520 | #endif | ||
| 521 | 	typedef struct { | ||
| 522 | 		mach_msg_header_t Head; | ||
| 523 | 		NDR_record_t NDR; | ||
| 524 | 		processor_flavor_t flavor; | ||
| 525 | 	} __Request__host_processor_info_t __attribute__((unused)); | ||
| 526 | #ifdef __MigPackStructs | ||
| 527 | #pragma pack(pop) | ||
| 528 | #endif | ||
| 529 | |||
| 530 | #ifdef __MigPackStructs | ||
| 531 | #pragma pack(push, 4) | ||
| 532 | #endif | ||
| 533 | 	typedef struct { | ||
| 534 | 		mach_msg_header_t Head; | ||
| 535 | 	} __Request__host_get_io_master_t __attribute__((unused)); | ||
| 536 | #ifdef __MigPackStructs | ||
| 537 | #pragma pack(pop) | ||
| 538 | #endif | ||
| 539 | |||
| 540 | #ifdef __MigPackStructs | ||
| 541 | #pragma pack(push, 4) | ||
| 542 | #endif | ||
| 543 | 	typedef struct { | ||
| 544 | 		mach_msg_header_t Head; | ||
| 545 | 		NDR_record_t NDR; | ||
| 546 | 		clock_id_t clock_id; | ||
| 547 | 	} __Request__host_get_clock_service_t __attribute__((unused)); | ||
| 548 | #ifdef __MigPackStructs | ||
| 549 | #pragma pack(pop) | ||
| 550 | #endif | ||
| 551 | |||
| 552 | #ifdef __MigPackStructs | ||
| 553 | #pragma pack(push, 4) | ||
| 554 | #endif | ||
| 555 | 	typedef struct { | ||
| 556 | 		mach_msg_header_t Head; | ||
| 557 | 	} __Request__kmod_get_info_t __attribute__((unused)); | ||
| 558 | #ifdef __MigPackStructs | ||
| 559 | #pragma pack(pop) | ||
| 560 | #endif | ||
| 561 | |||
| 562 | #ifdef __MigPackStructs | ||
| 563 | #pragma pack(push, 4) | ||
| 564 | #endif | ||
| 565 | 	typedef struct { | ||
| 566 | 		mach_msg_header_t Head; | ||
| 567 | 	} __Request__host_virtual_physical_table_info_t __attribute__((unused)); | ||
| 568 | #ifdef __MigPackStructs | ||
| 569 | #pragma pack(pop) | ||
| 570 | #endif | ||
| 571 | |||
| 572 | #ifdef __MigPackStructs | ||
| 573 | #pragma pack(push, 4) | ||
| 574 | #endif | ||
| 575 | 	typedef struct { | ||
| 576 | 		mach_msg_header_t Head; | ||
| 577 | 	} __Request__processor_set_default_t __attribute__((unused)); | ||
| 578 | #ifdef __MigPackStructs | ||
| 579 | #pragma pack(pop) | ||
| 580 | #endif | ||
| 581 | |||
| 582 | #ifdef __MigPackStructs | ||
| 583 | #pragma pack(push, 4) | ||
| 584 | #endif | ||
| 585 | 	typedef struct { | ||
| 586 | 		mach_msg_header_t Head; | ||
| 587 | 	} __Request__processor_set_create_t __attribute__((unused)); | ||
| 588 | #ifdef __MigPackStructs | ||
| 589 | #pragma pack(pop) | ||
| 590 | #endif | ||
| 591 | |||
| 592 | #ifdef __MigPackStructs | ||
| 593 | #pragma pack(push, 4) | ||
| 594 | #endif | ||
| 595 | 	typedef struct { | ||
| 596 | 		mach_msg_header_t Head; | ||
| 597 | 		/* start of the kernel processed data */ | ||
| 598 | 		mach_msg_body_t msgh_body; | ||
| 599 | 		mach_msg_port_descriptor_t pager; | ||
| 600 | 		/* end of the kernel processed data */ | ||
| 601 | 		NDR_record_t NDR; | ||
| 602 | 		boolean_t internal; | ||
| 603 | 		memory_object_size_t size; | ||
| 604 | 		vm_prot_t permission; | ||
| 605 | 	} __Request__mach_memory_object_memory_entry_64_t __attribute__((unused)); | ||
| 606 | #ifdef __MigPackStructs | ||
| 607 | #pragma pack(pop) | ||
| 608 | #endif | ||
| 609 | |||
| 610 | #ifdef __MigPackStructs | ||
| 611 | #pragma pack(push, 4) | ||
| 612 | #endif | ||
| 613 | 	typedef struct { | ||
| 614 | 		mach_msg_header_t Head; | ||
| 615 | 		NDR_record_t NDR; | ||
| 616 | 		host_flavor_t flavor; | ||
| 617 | 		mach_msg_type_number_t host_info_outCnt; | ||
| 618 | 	} __Request__host_statistics_t __attribute__((unused)); | ||
| 619 | #ifdef __MigPackStructs | ||
| 620 | #pragma pack(pop) | ||
| 621 | #endif | ||
| 622 | |||
| 623 | #ifdef __MigPackStructs | ||
| 624 | #pragma pack(push, 4) | ||
| 625 | #endif | ||
| 626 | 	typedef struct { | ||
| 627 | 		mach_msg_header_t Head; | ||
| 628 | 		/* start of the kernel processed data */ | ||
| 629 | 		mach_msg_body_t msgh_body; | ||
| 630 | 		mach_msg_port_descriptor_t notify_port; | ||
| 631 | 		/* end of the kernel processed data */ | ||
| 632 | 		NDR_record_t NDR; | ||
| 633 | 		host_flavor_t notify_type; | ||
| 634 | 	} __Request__host_request_notification_t __attribute__((unused)); | ||
| 635 | #ifdef __MigPackStructs | ||
| 636 | #pragma pack(pop) | ||
| 637 | #endif | ||
| 638 | |||
| 639 | #ifdef __MigPackStructs | ||
| 640 | #pragma pack(push, 4) | ||
| 641 | #endif | ||
| 642 | 	typedef struct { | ||
| 643 | 		mach_msg_header_t Head; | ||
| 644 | 	} __Request__host_lockgroup_info_t __attribute__((unused)); | ||
| 645 | #ifdef __MigPackStructs | ||
| 646 | #pragma pack(pop) | ||
| 647 | #endif | ||
| 648 | |||
| 649 | #ifdef __MigPackStructs | ||
| 650 | #pragma pack(push, 4) | ||
| 651 | #endif | ||
| 652 | 	typedef struct { | ||
| 653 | 		mach_msg_header_t Head; | ||
| 654 | 		NDR_record_t NDR; | ||
| 655 | 		host_flavor_t flavor; | ||
| 656 | 		mach_msg_type_number_t host_info64_outCnt; | ||
| 657 | 	} __Request__host_statistics64_t __attribute__((unused)); | ||
| 658 | #ifdef __MigPackStructs | ||
| 659 | #pragma pack(pop) | ||
| 660 | #endif | ||
| 661 | |||
| 662 | #ifdef __MigPackStructs | ||
| 663 | #pragma pack(push, 4) | ||
| 664 | #endif | ||
| 665 | 	typedef struct { | ||
| 666 | 		mach_msg_header_t Head; | ||
| 667 | 	} __Request__mach_zone_info_t __attribute__((unused)); | ||
| 668 | #ifdef __MigPackStructs | ||
| 669 | #pragma pack(pop) | ||
| 670 | #endif | ||
| 671 | |||
| 672 | #ifdef __MigPackStructs | ||
| 673 | #pragma pack(push, 4) | ||
| 674 | #endif | ||
| 675 | 	typedef struct { | ||
| 676 | 		mach_msg_header_t Head; | ||
| 677 | 		NDR_record_t NDR; | ||
| 678 | 		mach_msg_type_number_t recipesCnt; | ||
| 679 | 		uint8_t recipes[5120]; | ||
| 680 | 	} __Request__host_create_mach_voucher_t __attribute__((unused)); | ||
| 681 | #ifdef __MigPackStructs | ||
| 682 | #pragma pack(pop) | ||
| 683 | #endif | ||
| 684 | |||
| 685 | #ifdef __MigPackStructs | ||
| 686 | #pragma pack(push, 4) | ||
| 687 | #endif | ||
| 688 | 	typedef struct { | ||
| 689 | 		mach_msg_header_t Head; | ||
| 690 | 		/* start of the kernel processed data */ | ||
| 691 | 		mach_msg_body_t msgh_body; | ||
| 692 | 		mach_msg_port_descriptor_t attr_manager; | ||
| 693 | 		/* end of the kernel processed data */ | ||
| 694 | 		NDR_record_t NDR; | ||
| 695 | 		mach_voucher_attr_value_handle_t default_value; | ||
| 696 | 	} __Request__host_register_mach_voucher_attr_manager_t __attribute__((unused)); | ||
| 697 | #ifdef __MigPackStructs | ||
| 698 | #pragma pack(pop) | ||
| 699 | #endif | ||
| 700 | |||
| 701 | #ifdef __MigPackStructs | ||
| 702 | #pragma pack(push, 4) | ||
| 703 | #endif | ||
| 704 | 	typedef struct { | ||
| 705 | 		mach_msg_header_t Head; | ||
| 706 | 		/* start of the kernel processed data */ | ||
| 707 | 		mach_msg_body_t msgh_body; | ||
| 708 | 		mach_msg_port_descriptor_t attr_manager; | ||
| 709 | 		/* end of the kernel processed data */ | ||
| 710 | 		NDR_record_t NDR; | ||
| 711 | 		mach_voucher_attr_value_handle_t default_value; | ||
| 712 | 		mach_voucher_attr_key_t key; | ||
| 713 | 	} __Request__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused)); | ||
| 714 | #ifdef __MigPackStructs | ||
| 715 | #pragma pack(pop) | ||
| 716 | #endif | ||
| 717 | |||
| 718 | #ifdef __MigPackStructs | ||
| 719 | #pragma pack(push, 4) | ||
| 720 | #endif | ||
| 721 | 	typedef struct { | ||
| 722 | 		mach_msg_header_t Head; | ||
| 723 | 		NDR_record_t NDR; | ||
| 724 | 		uint32_t diagnostic_flag; | ||
| 725 | 	} __Request__host_set_atm_diagnostic_flag_t __attribute__((unused)); | ||
| 726 | #ifdef __MigPackStructs | ||
| 727 | #pragma pack(pop) | ||
| 728 | #endif | ||
| 729 | |||
| 730 | #ifdef __MigPackStructs | ||
| 731 | #pragma pack(push, 4) | ||
| 732 | #endif | ||
| 733 | 	typedef struct { | ||
| 734 | 		mach_msg_header_t Head; | ||
| 735 | 	} __Request__host_get_atm_diagnostic_flag_t __attribute__((unused)); | ||
| 736 | #ifdef __MigPackStructs | ||
| 737 | #pragma pack(pop) | ||
| 738 | #endif | ||
| 739 | |||
| 740 | #ifdef __MigPackStructs | ||
| 741 | #pragma pack(push, 4) | ||
| 742 | #endif | ||
| 743 | 	typedef struct { | ||
| 744 | 		mach_msg_header_t Head; | ||
| 745 | 	} __Request__mach_memory_info_t __attribute__((unused)); | ||
| 746 | #ifdef __MigPackStructs | ||
| 747 | #pragma pack(pop) | ||
| 748 | #endif | ||
| 749 | |||
| 750 | #ifdef __MigPackStructs | ||
| 751 | #pragma pack(push, 4) | ||
| 752 | #endif | ||
| 753 | 	typedef struct { | ||
| 754 | 		mach_msg_header_t Head; | ||
| 755 | 		NDR_record_t NDR; | ||
| 756 | 		uint32_t multiuser_flags; | ||
| 757 | 	} __Request__host_set_multiuser_config_flags_t __attribute__((unused)); | ||
| 758 | #ifdef __MigPackStructs | ||
| 759 | #pragma pack(pop) | ||
| 760 | #endif | ||
| 761 | |||
| 762 | #ifdef __MigPackStructs | ||
| 763 | #pragma pack(push, 4) | ||
| 764 | #endif | ||
| 765 | 	typedef struct { | ||
| 766 | 		mach_msg_header_t Head; | ||
| 767 | 	} __Request__host_get_multiuser_config_flags_t __attribute__((unused)); | ||
| 768 | #ifdef __MigPackStructs | ||
| 769 | #pragma pack(pop) | ||
| 770 | #endif | ||
| 771 | |||
| 772 | #ifdef __MigPackStructs | ||
| 773 | #pragma pack(push, 4) | ||
| 774 | #endif | ||
| 775 | 	typedef struct { | ||
| 776 | 		mach_msg_header_t Head; | ||
| 777 | 	} __Request__host_check_multiuser_mode_t __attribute__((unused)); | ||
| 778 | #ifdef __MigPackStructs | ||
| 779 | #pragma pack(pop) | ||
| 780 | #endif | ||
| 781 | |||
| 782 | #ifdef __MigPackStructs | ||
| 783 | #pragma pack(push, 4) | ||
| 784 | #endif | ||
| 785 | 	typedef struct { | ||
| 786 | 		mach_msg_header_t Head; | ||
| 787 | 		NDR_record_t NDR; | ||
| 788 | 		mach_zone_name_t name; | ||
| 789 | 	} __Request__mach_zone_info_for_zone_t __attribute__((unused)); | ||
| 790 | #ifdef __MigPackStructs | ||
| 791 | #pragma pack(pop) | ||
| 792 | #endif | ||
| 793 | #endif /* !__Request__mach_host_subsystem__defined */ | ||
| 794 | |||
| 795 | /* union of all requests */ | ||
| 796 | |||
| 797 | #ifndef __RequestUnion__mach_host_subsystem__defined | ||
| 798 | #define __RequestUnion__mach_host_subsystem__defined | ||
| 799 | union __RequestUnion__mach_host_subsystem { | ||
| 800 | 	__Request__host_info_t Request_host_info; | ||
| 801 | 	__Request__host_kernel_version_t Request_host_kernel_version; | ||
| 802 | 	__Request___host_page_size_t Request__host_page_size; | ||
| 803 | 	__Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry; | ||
| 804 | 	__Request__host_processor_info_t Request_host_processor_info; | ||
| 805 | 	__Request__host_get_io_master_t Request_host_get_io_master; | ||
| 806 | 	__Request__host_get_clock_service_t Request_host_get_clock_service; | ||
| 807 | 	__Request__kmod_get_info_t Request_kmod_get_info; | ||
| 808 | 	__Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info; | ||
| 809 | 	__Request__processor_set_default_t Request_processor_set_default; | ||
| 810 | 	__Request__processor_set_create_t Request_processor_set_create; | ||
| 811 | 	__Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64; | ||
| 812 | 	__Request__host_statistics_t Request_host_statistics; | ||
| 813 | 	__Request__host_request_notification_t Request_host_request_notification; | ||
| 814 | 	__Request__host_lockgroup_info_t Request_host_lockgroup_info; | ||
| 815 | 	__Request__host_statistics64_t Request_host_statistics64; | ||
| 816 | 	__Request__mach_zone_info_t Request_mach_zone_info; | ||
| 817 | 	__Request__host_create_mach_voucher_t Request_host_create_mach_voucher; | ||
| 818 | 	__Request__host_register_mach_voucher_attr_manager_t Request_host_register_mach_voucher_attr_manager; | ||
| 819 | 	__Request__host_register_well_known_mach_voucher_attr_manager_t Request_host_register_well_known_mach_voucher_attr_manager; | ||
| 820 | 	__Request__host_set_atm_diagnostic_flag_t Request_host_set_atm_diagnostic_flag; | ||
| 821 | 	__Request__host_get_atm_diagnostic_flag_t Request_host_get_atm_diagnostic_flag; | ||
| 822 | 	__Request__mach_memory_info_t Request_mach_memory_info; | ||
| 823 | 	__Request__host_set_multiuser_config_flags_t Request_host_set_multiuser_config_flags; | ||
| 824 | 	__Request__host_get_multiuser_config_flags_t Request_host_get_multiuser_config_flags; | ||
| 825 | 	__Request__host_check_multiuser_mode_t Request_host_check_multiuser_mode; | ||
| 826 | 	__Request__mach_zone_info_for_zone_t Request_mach_zone_info_for_zone; | ||
| 827 | }; | ||
| 828 | #endif /* !__RequestUnion__mach_host_subsystem__defined */ | ||
| 829 | /* typedefs for all replies */ | ||
| 830 | |||
| 831 | #ifndef __Reply__mach_host_subsystem__defined | ||
| 832 | #define __Reply__mach_host_subsystem__defined | ||
| 833 | |||
| 834 | #ifdef __MigPackStructs | ||
| 835 | #pragma pack(push, 4) | ||
| 836 | #endif | ||
| 837 | 	typedef struct { | ||
| 838 | 		mach_msg_header_t Head; | ||
| 839 | 		NDR_record_t NDR; | ||
| 840 | 		kern_return_t RetCode; | ||
| 841 | 		mach_msg_type_number_t host_info_outCnt; | ||
| 842 | 		integer_t host_info_out[68]; | ||
| 843 | 	} __Reply__host_info_t __attribute__((unused)); | ||
| 844 | #ifdef __MigPackStructs | ||
| 845 | #pragma pack(pop) | ||
| 846 | #endif | ||
| 847 | |||
| 848 | #ifdef __MigPackStructs | ||
| 849 | #pragma pack(push, 4) | ||
| 850 | #endif | ||
| 851 | 	typedef struct { | ||
| 852 | 		mach_msg_header_t Head; | ||
| 853 | 		NDR_record_t NDR; | ||
| 854 | 		kern_return_t RetCode; | ||
| 855 | 		mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */ | ||
| 856 | 		mach_msg_type_number_t kernel_versionCnt; | ||
| 857 | 		char kernel_version[512]; | ||
| 858 | 	} __Reply__host_kernel_version_t __attribute__((unused)); | ||
| 859 | #ifdef __MigPackStructs | ||
| 860 | #pragma pack(pop) | ||
| 861 | #endif | ||
| 862 | |||
| 863 | #ifdef __MigPackStructs | ||
| 864 | #pragma pack(push, 4) | ||
| 865 | #endif | ||
| 866 | 	typedef struct { | ||
| 867 | 		mach_msg_header_t Head; | ||
| 868 | 		NDR_record_t NDR; | ||
| 869 | 		kern_return_t RetCode; | ||
| 870 | 		vm_size_t out_page_size; | ||
| 871 | 	} __Reply___host_page_size_t __attribute__((unused)); | ||
| 872 | #ifdef __MigPackStructs | ||
| 873 | #pragma pack(pop) | ||
| 874 | #endif | ||
| 875 | |||
| 876 | #ifdef __MigPackStructs | ||
| 877 | #pragma pack(push, 4) | ||
| 878 | #endif | ||
| 879 | 	typedef struct { | ||
| 880 | 		mach_msg_header_t Head; | ||
| 881 | 		/* start of the kernel processed data */ | ||
| 882 | 		mach_msg_body_t msgh_body; | ||
| 883 | 		mach_msg_port_descriptor_t entry_handle; | ||
| 884 | 		/* end of the kernel processed data */ | ||
| 885 | 	} __Reply__mach_memory_object_memory_entry_t __attribute__((unused)); | ||
| 886 | #ifdef __MigPackStructs | ||
| 887 | #pragma pack(pop) | ||
| 888 | #endif | ||
| 889 | |||
| 890 | #ifdef __MigPackStructs | ||
| 891 | #pragma pack(push, 4) | ||
| 892 | #endif | ||
| 893 | 	typedef struct { | ||
| 894 | 		mach_msg_header_t Head; | ||
| 895 | 		/* start of the kernel processed data */ | ||
| 896 | 		mach_msg_body_t msgh_body; | ||
| 897 | 		mach_msg_ool_descriptor_t out_processor_info; | ||
| 898 | 		/* end of the kernel processed data */ | ||
| 899 | 		NDR_record_t NDR; | ||
| 900 | 		natural_t out_processor_count; | ||
| 901 | 		mach_msg_type_number_t out_processor_infoCnt; | ||
| 902 | 	} __Reply__host_processor_info_t __attribute__((unused)); | ||
| 903 | #ifdef __MigPackStructs | ||
| 904 | #pragma pack(pop) | ||
| 905 | #endif | ||
| 906 | |||
| 907 | #ifdef __MigPackStructs | ||
| 908 | #pragma pack(push, 4) | ||
| 909 | #endif | ||
| 910 | 	typedef struct { | ||
| 911 | 		mach_msg_header_t Head; | ||
| 912 | 		/* start of the kernel processed data */ | ||
| 913 | 		mach_msg_body_t msgh_body; | ||
| 914 | 		mach_msg_port_descriptor_t io_master; | ||
| 915 | 		/* end of the kernel processed data */ | ||
| 916 | 	} __Reply__host_get_io_master_t __attribute__((unused)); | ||
| 917 | #ifdef __MigPackStructs | ||
| 918 | #pragma pack(pop) | ||
| 919 | #endif | ||
| 920 | |||
| 921 | #ifdef __MigPackStructs | ||
| 922 | #pragma pack(push, 4) | ||
| 923 | #endif | ||
| 924 | 	typedef struct { | ||
| 925 | 		mach_msg_header_t Head; | ||
| 926 | 		/* start of the kernel processed data */ | ||
| 927 | 		mach_msg_body_t msgh_body; | ||
| 928 | 		mach_msg_port_descriptor_t clock_serv; | ||
| 929 | 		/* end of the kernel processed data */ | ||
| 930 | 	} __Reply__host_get_clock_service_t __attribute__((unused)); | ||
| 931 | #ifdef __MigPackStructs | ||
| 932 | #pragma pack(pop) | ||
| 933 | #endif | ||
| 934 | |||
| 935 | #ifdef __MigPackStructs | ||
| 936 | #pragma pack(push, 4) | ||
| 937 | #endif | ||
| 938 | 	typedef struct { | ||
| 939 | 		mach_msg_header_t Head; | ||
| 940 | 		/* start of the kernel processed data */ | ||
| 941 | 		mach_msg_body_t msgh_body; | ||
| 942 | 		mach_msg_ool_descriptor_t modules; | ||
| 943 | 		/* end of the kernel processed data */ | ||
| 944 | 		NDR_record_t NDR; | ||
| 945 | 		mach_msg_type_number_t modulesCnt; | ||
| 946 | 	} __Reply__kmod_get_info_t __attribute__((unused)); | ||
| 947 | #ifdef __MigPackStructs | ||
| 948 | #pragma pack(pop) | ||
| 949 | #endif | ||
| 950 | |||
| 951 | #ifdef __MigPackStructs | ||
| 952 | #pragma pack(push, 4) | ||
| 953 | #endif | ||
| 954 | 	typedef struct { | ||
| 955 | 		mach_msg_header_t Head; | ||
| 956 | 		/* start of the kernel processed data */ | ||
| 957 | 		mach_msg_body_t msgh_body; | ||
| 958 | 		mach_msg_ool_descriptor_t info; | ||
| 959 | 		/* end of the kernel processed data */ | ||
| 960 | 		NDR_record_t NDR; | ||
| 961 | 		mach_msg_type_number_t infoCnt; | ||
| 962 | 	} __Reply__host_virtual_physical_table_info_t __attribute__((unused)); | ||
| 963 | #ifdef __MigPackStructs | ||
| 964 | #pragma pack(pop) | ||
| 965 | #endif | ||
| 966 | |||
| 967 | #ifdef __MigPackStructs | ||
| 968 | #pragma pack(push, 4) | ||
| 969 | #endif | ||
| 970 | 	typedef struct { | ||
| 971 | 		mach_msg_header_t Head; | ||
| 972 | 		/* start of the kernel processed data */ | ||
| 973 | 		mach_msg_body_t msgh_body; | ||
| 974 | 		mach_msg_port_descriptor_t default_set; | ||
| 975 | 		/* end of the kernel processed data */ | ||
| 976 | 	} __Reply__processor_set_default_t __attribute__((unused)); | ||
| 977 | #ifdef __MigPackStructs | ||
| 978 | #pragma pack(pop) | ||
| 979 | #endif | ||
| 980 | |||
| 981 | #ifdef __MigPackStructs | ||
| 982 | #pragma pack(push, 4) | ||
| 983 | #endif | ||
| 984 | 	typedef struct { | ||
| 985 | 		mach_msg_header_t Head; | ||
| 986 | 		/* start of the kernel processed data */ | ||
| 987 | 		mach_msg_body_t msgh_body; | ||
| 988 | 		mach_msg_port_descriptor_t new_set; | ||
| 989 | 		mach_msg_port_descriptor_t new_name; | ||
| 990 | 		/* end of the kernel processed data */ | ||
| 991 | 	} __Reply__processor_set_create_t __attribute__((unused)); | ||
| 992 | #ifdef __MigPackStructs | ||
| 993 | #pragma pack(pop) | ||
| 994 | #endif | ||
| 995 | |||
| 996 | #ifdef __MigPackStructs | ||
| 997 | #pragma pack(push, 4) | ||
| 998 | #endif | ||
| 999 | 	typedef struct { | ||
| 1000 | 		mach_msg_header_t Head; | ||
| 1001 | 		/* start of the kernel processed data */ | ||
| 1002 | 		mach_msg_body_t msgh_body; | ||
| 1003 | 		mach_msg_port_descriptor_t entry_handle; | ||
| 1004 | 		/* end of the kernel processed data */ | ||
| 1005 | 	} __Reply__mach_memory_object_memory_entry_64_t __attribute__((unused)); | ||
| 1006 | #ifdef __MigPackStructs | ||
| 1007 | #pragma pack(pop) | ||
| 1008 | #endif | ||
| 1009 | |||
| 1010 | #ifdef __MigPackStructs | ||
| 1011 | #pragma pack(push, 4) | ||
| 1012 | #endif | ||
| 1013 | 	typedef struct { | ||
| 1014 | 		mach_msg_header_t Head; | ||
| 1015 | 		NDR_record_t NDR; | ||
| 1016 | 		kern_return_t RetCode; | ||
| 1017 | 		mach_msg_type_number_t host_info_outCnt; | ||
| 1018 | 		integer_t host_info_out[68]; | ||
| 1019 | 	} __Reply__host_statistics_t __attribute__((unused)); | ||
| 1020 | #ifdef __MigPackStructs | ||
| 1021 | #pragma pack(pop) | ||
| 1022 | #endif | ||
| 1023 | |||
| 1024 | #ifdef __MigPackStructs | ||
| 1025 | #pragma pack(push, 4) | ||
| 1026 | #endif | ||
| 1027 | 	typedef struct { | ||
| 1028 | 		mach_msg_header_t Head; | ||
| 1029 | 		NDR_record_t NDR; | ||
| 1030 | 		kern_return_t RetCode; | ||
| 1031 | 	} __Reply__host_request_notification_t __attribute__((unused)); | ||
| 1032 | #ifdef __MigPackStructs | ||
| 1033 | #pragma pack(pop) | ||
| 1034 | #endif | ||
| 1035 | |||
| 1036 | #ifdef __MigPackStructs | ||
| 1037 | #pragma pack(push, 4) | ||
| 1038 | #endif | ||
| 1039 | 	typedef struct { | ||
| 1040 | 		mach_msg_header_t Head; | ||
| 1041 | 		/* start of the kernel processed data */ | ||
| 1042 | 		mach_msg_body_t msgh_body; | ||
| 1043 | 		mach_msg_ool_descriptor_t lockgroup_info; | ||
| 1044 | 		/* end of the kernel processed data */ | ||
| 1045 | 		NDR_record_t NDR; | ||
| 1046 | 		mach_msg_type_number_t lockgroup_infoCnt; | ||
| 1047 | 	} __Reply__host_lockgroup_info_t __attribute__((unused)); | ||
| 1048 | #ifdef __MigPackStructs | ||
| 1049 | #pragma pack(pop) | ||
| 1050 | #endif | ||
| 1051 | |||
| 1052 | #ifdef __MigPackStructs | ||
| 1053 | #pragma pack(push, 4) | ||
| 1054 | #endif | ||
| 1055 | 	typedef struct { | ||
| 1056 | 		mach_msg_header_t Head; | ||
| 1057 | 		NDR_record_t NDR; | ||
| 1058 | 		kern_return_t RetCode; | ||
| 1059 | 		mach_msg_type_number_t host_info64_outCnt; | ||
| 1060 | 		integer_t host_info64_out[256]; | ||
| 1061 | 	} __Reply__host_statistics64_t __attribute__((unused)); | ||
| 1062 | #ifdef __MigPackStructs | ||
| 1063 | #pragma pack(pop) | ||
| 1064 | #endif | ||
| 1065 | |||
| 1066 | #ifdef __MigPackStructs | ||
| 1067 | #pragma pack(push, 4) | ||
| 1068 | #endif | ||
| 1069 | 	typedef struct { | ||
| 1070 | 		mach_msg_header_t Head; | ||
| 1071 | 		/* start of the kernel processed data */ | ||
| 1072 | 		mach_msg_body_t msgh_body; | ||
| 1073 | 		mach_msg_ool_descriptor_t names; | ||
| 1074 | 		mach_msg_ool_descriptor_t info; | ||
| 1075 | 		/* end of the kernel processed data */ | ||
| 1076 | 		NDR_record_t NDR; | ||
| 1077 | 		mach_msg_type_number_t namesCnt; | ||
| 1078 | 		mach_msg_type_number_t infoCnt; | ||
| 1079 | 	} __Reply__mach_zone_info_t __attribute__((unused)); | ||
| 1080 | #ifdef __MigPackStructs | ||
| 1081 | #pragma pack(pop) | ||
| 1082 | #endif | ||
| 1083 | |||
| 1084 | #ifdef __MigPackStructs | ||
| 1085 | #pragma pack(push, 4) | ||
| 1086 | #endif | ||
| 1087 | 	typedef struct { | ||
| 1088 | 		mach_msg_header_t Head; | ||
| 1089 | 		/* start of the kernel processed data */ | ||
| 1090 | 		mach_msg_body_t msgh_body; | ||
| 1091 | 		mach_msg_port_descriptor_t voucher; | ||
| 1092 | 		/* end of the kernel processed data */ | ||
| 1093 | 	} __Reply__host_create_mach_voucher_t __attribute__((unused)); | ||
| 1094 | #ifdef __MigPackStructs | ||
| 1095 | #pragma pack(pop) | ||
| 1096 | #endif | ||
| 1097 | |||
| 1098 | #ifdef __MigPackStructs | ||
| 1099 | #pragma pack(push, 4) | ||
| 1100 | #endif | ||
| 1101 | 	typedef struct { | ||
| 1102 | 		mach_msg_header_t Head; | ||
| 1103 | 		/* start of the kernel processed data */ | ||
| 1104 | 		mach_msg_body_t msgh_body; | ||
| 1105 | 		mach_msg_port_descriptor_t new_attr_control; | ||
| 1106 | 		/* end of the kernel processed data */ | ||
| 1107 | 		NDR_record_t NDR; | ||
| 1108 | 		mach_voucher_attr_key_t new_key; | ||
| 1109 | 	} __Reply__host_register_mach_voucher_attr_manager_t __attribute__((unused)); | ||
| 1110 | #ifdef __MigPackStructs | ||
| 1111 | #pragma pack(pop) | ||
| 1112 | #endif | ||
| 1113 | |||
| 1114 | #ifdef __MigPackStructs | ||
| 1115 | #pragma pack(push, 4) | ||
| 1116 | #endif | ||
| 1117 | 	typedef struct { | ||
| 1118 | 		mach_msg_header_t Head; | ||
| 1119 | 		/* start of the kernel processed data */ | ||
| 1120 | 		mach_msg_body_t msgh_body; | ||
| 1121 | 		mach_msg_port_descriptor_t new_attr_control; | ||
| 1122 | 		/* end of the kernel processed data */ | ||
| 1123 | 	} __Reply__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused)); | ||
| 1124 | #ifdef __MigPackStructs | ||
| 1125 | #pragma pack(pop) | ||
| 1126 | #endif | ||
| 1127 | |||
| 1128 | #ifdef __MigPackStructs | ||
| 1129 | #pragma pack(push, 4) | ||
| 1130 | #endif | ||
| 1131 | 	typedef struct { | ||
| 1132 | 		mach_msg_header_t Head; | ||
| 1133 | 		NDR_record_t NDR; | ||
| 1134 | 		kern_return_t RetCode; | ||
| 1135 | 	} __Reply__host_set_atm_diagnostic_flag_t __attribute__((unused)); | ||
| 1136 | #ifdef __MigPackStructs | ||
| 1137 | #pragma pack(pop) | ||
| 1138 | #endif | ||
| 1139 | |||
| 1140 | #ifdef __MigPackStructs | ||
| 1141 | #pragma pack(push, 4) | ||
| 1142 | #endif | ||
| 1143 | 	typedef struct { | ||
| 1144 | 		mach_msg_header_t Head; | ||
| 1145 | 		NDR_record_t NDR; | ||
| 1146 | 		kern_return_t RetCode; | ||
| 1147 | 		uint32_t diagnostic_flag; | ||
| 1148 | 	} __Reply__host_get_atm_diagnostic_flag_t __attribute__((unused)); | ||
| 1149 | #ifdef __MigPackStructs | ||
| 1150 | #pragma pack(pop) | ||
| 1151 | #endif | ||
| 1152 | |||
| 1153 | #ifdef __MigPackStructs | ||
| 1154 | #pragma pack(push, 4) | ||
| 1155 | #endif | ||
| 1156 | 	typedef struct { | ||
| 1157 | 		mach_msg_header_t Head; | ||
| 1158 | 		/* start of the kernel processed data */ | ||
| 1159 | 		mach_msg_body_t msgh_body; | ||
| 1160 | 		mach_msg_ool_descriptor_t names; | ||
| 1161 | 		mach_msg_ool_descriptor_t info; | ||
| 1162 | 		mach_msg_ool_descriptor_t memory_info; | ||
| 1163 | 		/* end of the kernel processed data */ | ||
| 1164 | 		NDR_record_t NDR; | ||
| 1165 | 		mach_msg_type_number_t namesCnt; | ||
| 1166 | 		mach_msg_type_number_t infoCnt; | ||
| 1167 | 		mach_msg_type_number_t memory_infoCnt; | ||
| 1168 | 	} __Reply__mach_memory_info_t __attribute__((unused)); | ||
| 1169 | #ifdef __MigPackStructs | ||
| 1170 | #pragma pack(pop) | ||
| 1171 | #endif | ||
| 1172 | |||
| 1173 | #ifdef __MigPackStructs | ||
| 1174 | #pragma pack(push, 4) | ||
| 1175 | #endif | ||
| 1176 | 	typedef struct { | ||
| 1177 | 		mach_msg_header_t Head; | ||
| 1178 | 		NDR_record_t NDR; | ||
| 1179 | 		kern_return_t RetCode; | ||
| 1180 | 	} __Reply__host_set_multiuser_config_flags_t __attribute__((unused)); | ||
| 1181 | #ifdef __MigPackStructs | ||
| 1182 | #pragma pack(pop) | ||
| 1183 | #endif | ||
| 1184 | |||
| 1185 | #ifdef __MigPackStructs | ||
| 1186 | #pragma pack(push, 4) | ||
| 1187 | #endif | ||
| 1188 | 	typedef struct { | ||
| 1189 | 		mach_msg_header_t Head; | ||
| 1190 | 		NDR_record_t NDR; | ||
| 1191 | 		kern_return_t RetCode; | ||
| 1192 | 		uint32_t multiuser_flags; | ||
| 1193 | 	} __Reply__host_get_multiuser_config_flags_t __attribute__((unused)); | ||
| 1194 | #ifdef __MigPackStructs | ||
| 1195 | #pragma pack(pop) | ||
| 1196 | #endif | ||
| 1197 | |||
| 1198 | #ifdef __MigPackStructs | ||
| 1199 | #pragma pack(push, 4) | ||
| 1200 | #endif | ||
| 1201 | 	typedef struct { | ||
| 1202 | 		mach_msg_header_t Head; | ||
| 1203 | 		NDR_record_t NDR; | ||
| 1204 | 		kern_return_t RetCode; | ||
| 1205 | 		uint32_t multiuser_mode; | ||
| 1206 | 	} __Reply__host_check_multiuser_mode_t __attribute__((unused)); | ||
| 1207 | #ifdef __MigPackStructs | ||
| 1208 | #pragma pack(pop) | ||
| 1209 | #endif | ||
| 1210 | |||
| 1211 | #ifdef __MigPackStructs | ||
| 1212 | #pragma pack(push, 4) | ||
| 1213 | #endif | ||
| 1214 | 	typedef struct { | ||
| 1215 | 		mach_msg_header_t Head; | ||
| 1216 | 		NDR_record_t NDR; | ||
| 1217 | 		kern_return_t RetCode; | ||
| 1218 | 		mach_zone_info_t info; | ||
| 1219 | 	} __Reply__mach_zone_info_for_zone_t __attribute__((unused)); | ||
| 1220 | #ifdef __MigPackStructs | ||
| 1221 | #pragma pack(pop) | ||
| 1222 | #endif | ||
| 1223 | #endif /* !__Reply__mach_host_subsystem__defined */ | ||
| 1224 | |||
| 1225 | /* union of all replies */ | ||
| 1226 | |||
| 1227 | #ifndef __ReplyUnion__mach_host_subsystem__defined | ||
| 1228 | #define __ReplyUnion__mach_host_subsystem__defined | ||
| 1229 | union __ReplyUnion__mach_host_subsystem { | ||
| 1230 | 	__Reply__host_info_t Reply_host_info; | ||
| 1231 | 	__Reply__host_kernel_version_t Reply_host_kernel_version; | ||
| 1232 | 	__Reply___host_page_size_t Reply__host_page_size; | ||
| 1233 | 	__Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry; | ||
| 1234 | 	__Reply__host_processor_info_t Reply_host_processor_info; | ||
| 1235 | 	__Reply__host_get_io_master_t Reply_host_get_io_master; | ||
| 1236 | 	__Reply__host_get_clock_service_t Reply_host_get_clock_service; | ||
| 1237 | 	__Reply__kmod_get_info_t Reply_kmod_get_info; | ||
| 1238 | 	__Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info; | ||
| 1239 | 	__Reply__processor_set_default_t Reply_processor_set_default; | ||
| 1240 | 	__Reply__processor_set_create_t Reply_processor_set_create; | ||
| 1241 | 	__Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64; | ||
| 1242 | 	__Reply__host_statistics_t Reply_host_statistics; | ||
| 1243 | 	__Reply__host_request_notification_t Reply_host_request_notification; | ||
| 1244 | 	__Reply__host_lockgroup_info_t Reply_host_lockgroup_info; | ||
| 1245 | 	__Reply__host_statistics64_t Reply_host_statistics64; | ||
| 1246 | 	__Reply__mach_zone_info_t Reply_mach_zone_info; | ||
| 1247 | 	__Reply__host_create_mach_voucher_t Reply_host_create_mach_voucher; | ||
| 1248 | 	__Reply__host_register_mach_voucher_attr_manager_t Reply_host_register_mach_voucher_attr_manager; | ||
| 1249 | 	__Reply__host_register_well_known_mach_voucher_attr_manager_t Reply_host_register_well_known_mach_voucher_attr_manager; | ||
| 1250 | 	__Reply__host_set_atm_diagnostic_flag_t Reply_host_set_atm_diagnostic_flag; | ||
| 1251 | 	__Reply__host_get_atm_diagnostic_flag_t Reply_host_get_atm_diagnostic_flag; | ||
| 1252 | 	__Reply__mach_memory_info_t Reply_mach_memory_info; | ||
| 1253 | 	__Reply__host_set_multiuser_config_flags_t Reply_host_set_multiuser_config_flags; | ||
| 1254 | 	__Reply__host_get_multiuser_config_flags_t Reply_host_get_multiuser_config_flags; | ||
| 1255 | 	__Reply__host_check_multiuser_mode_t Reply_host_check_multiuser_mode; | ||
| 1256 | 	__Reply__mach_zone_info_for_zone_t Reply_mach_zone_info_for_zone; | ||
| 1257 | }; | ||
| 1258 | #endif /* !__RequestUnion__mach_host_subsystem__defined */ | ||
| 1259 | |||
| 1260 | #ifndef subsystem_to_name_map_mach_host | ||
| 1261 | #define subsystem_to_name_map_mach_host \ | ||
| 1262 | { "host_info", 200 },\ | ||
| 1263 | { "host_kernel_version", 201 },\ | ||
| 1264 | { "_host_page_size", 202 },\ | ||
| 1265 | { "mach_memory_object_memory_entry", 203 },\ | ||
| 1266 | { "host_processor_info", 204 },\ | ||
| 1267 | { "host_get_io_master", 205 },\ | ||
| 1268 | { "host_get_clock_service", 206 },\ | ||
| 1269 | { "kmod_get_info", 207 },\ | ||
| 1270 | { "host_virtual_physical_table_info", 209 },\ | ||
| 1271 | { "processor_set_default", 213 },\ | ||
| 1272 | { "processor_set_create", 214 },\ | ||
| 1273 | { "mach_memory_object_memory_entry_64", 215 },\ | ||
| 1274 | { "host_statistics", 216 },\ | ||
| 1275 | { "host_request_notification", 217 },\ | ||
| 1276 | { "host_lockgroup_info", 218 },\ | ||
| 1277 | { "host_statistics64", 219 },\ | ||
| 1278 | { "mach_zone_info", 220 },\ | ||
| 1279 | { "host_create_mach_voucher", 222 },\ | ||
| 1280 | { "host_register_mach_voucher_attr_manager", 223 },\ | ||
| 1281 | { "host_register_well_known_mach_voucher_attr_manager", 224 },\ | ||
| 1282 | { "host_set_atm_diagnostic_flag", 225 },\ | ||
| 1283 | { "host_get_atm_diagnostic_flag", 226 },\ | ||
| 1284 | { "mach_memory_info", 227 },\ | ||
| 1285 | { "host_set_multiuser_config_flags", 228 },\ | ||
| 1286 | { "host_get_multiuser_config_flags", 229 },\ | ||
| 1287 | { "host_check_multiuser_mode", 230 },\ | ||
| 1288 | { "mach_zone_info_for_zone", 231 } | ||
| 1289 | #endif | ||
| 1290 | |||
| 1291 | #ifdef __AfterMigUserHeader | ||
| 1292 | __AfterMigUserHeader | ||
| 1293 | #endif /* __AfterMigUserHeader */ | ||
| 1294 | |||
| 1295 | #endif	 /* _mach_host_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_init.h created+110| ... | @@ -0,0 +1,110 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Mach Operating System | ||
| 30 | * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University | ||
| 31 | * All Rights Reserved. | ||
| 32 | * | ||
| 33 | * Permission to use, copy, modify and distribute this software and its | ||
| 34 | * documentation is hereby granted, provided that both the copyright | ||
| 35 | * notice and this permission notice appear in all copies of the | ||
| 36 | * software, derivative works or modified versions, and any portions | ||
| 37 | * thereof, and that both notices appear in supporting documentation. | ||
| 38 | * | ||
| 39 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 40 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 41 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 42 | * | ||
| 43 | * Carnegie Mellon requests users of this software to return to | ||
| 44 | * | ||
| 45 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 46 | * School of Computer Science | ||
| 47 | * Carnegie Mellon University | ||
| 48 | * Pittsburgh PA 15213-3890 | ||
| 49 | * | ||
| 50 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 51 | * the rights to redistribute these changes. | ||
| 52 | */ | ||
| 53 | |||
| 54 | /* | ||
| 55 | *	Items provided by the Mach environment initialization. | ||
| 56 | */ | ||
| 57 | |||
| 58 | #ifndef _MACH_INIT_ | ||
| 59 | #define _MACH_INIT_ 1 | ||
| 60 | |||
| 61 | #include <mach/mach_types.h> | ||
| 62 | #include <mach/vm_page_size.h> | ||
| 63 | #include <stdarg.h> | ||
| 64 | |||
| 65 | #include <sys/cdefs.h> | ||
| 66 | |||
| 67 | /* | ||
| 68 | *	Kernel-related ports; how a task/thread controls itself | ||
| 69 | */ | ||
| 70 | |||
| 71 | __BEGIN_DECLS | ||
| 72 | extern mach_port_t mach_host_self(void); | ||
| 73 | extern mach_port_t mach_thread_self(void); | ||
| 74 | extern kern_return_t host_page_size(host_t, vm_size_t *); | ||
| 75 | |||
| 76 | extern mach_port_t mach_task_self_; | ||
| 77 | #define mach_task_self() mach_task_self_ | ||
| 78 | #define current_task() mach_task_self() | ||
| 79 | |||
| 80 | __END_DECLS | ||
| 81 | #include <mach/mach_traps.h> | ||
| 82 | __BEGIN_DECLS | ||
| 83 | |||
| 84 | /* | ||
| 85 | *	Other important ports in the Mach user environment | ||
| 86 | */ | ||
| 87 | |||
| 88 | extern mach_port_t bootstrap_port; | ||
| 89 | |||
| 90 | /* | ||
| 91 | *	Where these ports occur in the "mach_ports_register" | ||
| 92 | *	collection... only servers or the runtime library need know. | ||
| 93 | */ | ||
| 94 | |||
| 95 | #define NAME_SERVER_SLOT 0 | ||
| 96 | #define ENVIRONMENT_SLOT 1 | ||
| 97 | #define SERVICE_SLOT 2 | ||
| 98 | |||
| 99 | #define MACH_PORTS_SLOTS_USED 3 | ||
| 100 | |||
| 101 | /* | ||
| 102 | *	fprintf_stderr uses vprintf_stderr_func to produce | ||
| 103 | *	error messages, this can be overridden by a user | ||
| 104 | *	application to point to a user-specified output function | ||
| 105 | */ | ||
| 106 | extern int (*vprintf_stderr_func)(const char *format, va_list ap); | ||
| 107 | |||
| 108 | __END_DECLS | ||
| 109 | |||
| 110 | #endif /* _MACH_INIT_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_interface.h created+53| ... | @@ -0,0 +1,53 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (C) Apple Computer 1998 | ||
| 30 | * ALL Rights Reserved | ||
| 31 | */ | ||
| 32 | /* | ||
| 33 | * This file represents the interfaces that used to come | ||
| 34 | * from creating the user headers from the mach.defs file. | ||
| 35 | * Because mach.defs was decomposed, this file now just | ||
| 36 | * wraps up all the new interface headers generated from | ||
| 37 | * each of the new .defs resulting from that decomposition. | ||
| 38 | */ | ||
| 39 | #ifndef _MACH_INTERFACE_H_ | ||
| 40 | #define _MACH_INTERFACE_H_ | ||
| 41 | |||
| 42 | #include <mach/clock_priv.h> | ||
| 43 | #include <mach/host_priv.h> | ||
| 44 | #include <mach/host_security.h> | ||
| 45 | #include <mach/lock_set.h> | ||
| 46 | #include <mach/processor.h> | ||
| 47 | #include <mach/processor_set.h> | ||
| 48 | #include <mach/semaphore.h> | ||
| 49 | #include <mach/task.h> | ||
| 50 | #include <mach/thread_act.h> | ||
| 51 | #include <mach/vm_map.h> | ||
| 52 | |||
| 53 | #endif /* _MACH_INTERFACE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_port.h created+1808| ... | @@ -0,0 +1,1808 @@ | ||
| 1 | #ifndef	_mach_port_user_ | ||
| 2 | #define	_mach_port_user_ | ||
| 3 | |||
| 4 | /* Module mach_port */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	mach_port_MSG_COUNT | ||
| 52 | #define	mach_port_MSG_COUNT	40 | ||
| 53 | #endif	/* mach_port_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach_debug/mach_debug_types.h> | ||
| 60 | |||
| 61 | #ifdef __BeforeMigUserHeader | ||
| 62 | __BeforeMigUserHeader | ||
| 63 | #endif /* __BeforeMigUserHeader */ | ||
| 64 | |||
| 65 | #include <sys/cdefs.h> | ||
| 66 | __BEGIN_DECLS | ||
| 67 | |||
| 68 | |||
| 69 | /* Routine mach_port_names */ | ||
| 70 | #ifdef	mig_external | ||
| 71 | mig_external | ||
| 72 | #else | ||
| 73 | extern | ||
| 74 | #endif	/* mig_external */ | ||
| 75 | kern_return_t mach_port_names | ||
| 76 | ( | ||
| 77 | 	ipc_space_t task, | ||
| 78 | 	mach_port_name_array_t *names, | ||
| 79 | 	mach_msg_type_number_t *namesCnt, | ||
| 80 | 	mach_port_type_array_t *types, | ||
| 81 | 	mach_msg_type_number_t *typesCnt | ||
| 82 | ); | ||
| 83 | |||
| 84 | /* Routine mach_port_type */ | ||
| 85 | #ifdef	mig_external | ||
| 86 | mig_external | ||
| 87 | #else | ||
| 88 | extern | ||
| 89 | #endif	/* mig_external */ | ||
| 90 | kern_return_t mach_port_type | ||
| 91 | ( | ||
| 92 | 	ipc_space_t task, | ||
| 93 | 	mach_port_name_t name, | ||
| 94 | 	mach_port_type_t *ptype | ||
| 95 | ); | ||
| 96 | |||
| 97 | /* Routine mach_port_rename */ | ||
| 98 | #ifdef	mig_external | ||
| 99 | mig_external | ||
| 100 | #else | ||
| 101 | extern | ||
| 102 | #endif	/* mig_external */ | ||
| 103 | kern_return_t mach_port_rename | ||
| 104 | ( | ||
| 105 | 	ipc_space_t task, | ||
| 106 | 	mach_port_name_t old_name, | ||
| 107 | 	mach_port_name_t new_name | ||
| 108 | ); | ||
| 109 | |||
| 110 | /* Routine mach_port_allocate_name */ | ||
| 111 | #ifdef	mig_external | ||
| 112 | mig_external | ||
| 113 | #else | ||
| 114 | extern | ||
| 115 | #endif	/* mig_external */ | ||
| 116 | __WATCHOS_PROHIBITED | ||
| 117 | __TVOS_PROHIBITED | ||
| 118 | kern_return_t mach_port_allocate_name | ||
| 119 | ( | ||
| 120 | 	ipc_space_t task, | ||
| 121 | 	mach_port_right_t right, | ||
| 122 | 	mach_port_name_t name | ||
| 123 | ); | ||
| 124 | |||
| 125 | /* Routine mach_port_allocate */ | ||
| 126 | #ifdef	mig_external | ||
| 127 | mig_external | ||
| 128 | #else | ||
| 129 | extern | ||
| 130 | #endif	/* mig_external */ | ||
| 131 | kern_return_t mach_port_allocate | ||
| 132 | ( | ||
| 133 | 	ipc_space_t task, | ||
| 134 | 	mach_port_right_t right, | ||
| 135 | 	mach_port_name_t *name | ||
| 136 | ); | ||
| 137 | |||
| 138 | /* Routine mach_port_destroy */ | ||
| 139 | #ifdef	mig_external | ||
| 140 | mig_external | ||
| 141 | #else | ||
| 142 | extern | ||
| 143 | #endif	/* mig_external */ | ||
| 144 | kern_return_t mach_port_destroy | ||
| 145 | ( | ||
| 146 | 	ipc_space_t task, | ||
| 147 | 	mach_port_name_t name | ||
| 148 | ); | ||
| 149 | |||
| 150 | /* Routine mach_port_deallocate */ | ||
| 151 | #ifdef	mig_external | ||
| 152 | mig_external | ||
| 153 | #else | ||
| 154 | extern | ||
| 155 | #endif	/* mig_external */ | ||
| 156 | kern_return_t mach_port_deallocate | ||
| 157 | ( | ||
| 158 | 	ipc_space_t task, | ||
| 159 | 	mach_port_name_t name | ||
| 160 | ); | ||
| 161 | |||
| 162 | /* Routine mach_port_get_refs */ | ||
| 163 | #ifdef	mig_external | ||
| 164 | mig_external | ||
| 165 | #else | ||
| 166 | extern | ||
| 167 | #endif	/* mig_external */ | ||
| 168 | kern_return_t mach_port_get_refs | ||
| 169 | ( | ||
| 170 | 	ipc_space_t task, | ||
| 171 | 	mach_port_name_t name, | ||
| 172 | 	mach_port_right_t right, | ||
| 173 | 	mach_port_urefs_t *refs | ||
| 174 | ); | ||
| 175 | |||
| 176 | /* Routine mach_port_mod_refs */ | ||
| 177 | #ifdef	mig_external | ||
| 178 | mig_external | ||
| 179 | #else | ||
| 180 | extern | ||
| 181 | #endif	/* mig_external */ | ||
| 182 | kern_return_t mach_port_mod_refs | ||
| 183 | ( | ||
| 184 | 	ipc_space_t task, | ||
| 185 | 	mach_port_name_t name, | ||
| 186 | 	mach_port_right_t right, | ||
| 187 | 	mach_port_delta_t delta | ||
| 188 | ); | ||
| 189 | |||
| 190 | /* Routine mach_port_peek */ | ||
| 191 | #ifdef	mig_external | ||
| 192 | mig_external | ||
| 193 | #else | ||
| 194 | extern | ||
| 195 | #endif	/* mig_external */ | ||
| 196 | kern_return_t mach_port_peek | ||
| 197 | ( | ||
| 198 | 	ipc_space_t task, | ||
| 199 | 	mach_port_name_t name, | ||
| 200 | 	mach_msg_trailer_type_t trailer_type, | ||
| 201 | 	mach_port_seqno_t *request_seqnop, | ||
| 202 | 	mach_msg_size_t *msg_sizep, | ||
| 203 | 	mach_msg_id_t *msg_idp, | ||
| 204 | 	mach_msg_trailer_info_t trailer_infop, | ||
| 205 | 	mach_msg_type_number_t *trailer_infopCnt | ||
| 206 | ); | ||
| 207 | |||
| 208 | /* Routine mach_port_set_mscount */ | ||
| 209 | #ifdef	mig_external | ||
| 210 | mig_external | ||
| 211 | #else | ||
| 212 | extern | ||
| 213 | #endif	/* mig_external */ | ||
| 214 | kern_return_t mach_port_set_mscount | ||
| 215 | ( | ||
| 216 | 	ipc_space_t task, | ||
| 217 | 	mach_port_name_t name, | ||
| 218 | 	mach_port_mscount_t mscount | ||
| 219 | ); | ||
| 220 | |||
| 221 | /* Routine mach_port_get_set_status */ | ||
| 222 | #ifdef	mig_external | ||
| 223 | mig_external | ||
| 224 | #else | ||
| 225 | extern | ||
| 226 | #endif	/* mig_external */ | ||
| 227 | kern_return_t mach_port_get_set_status | ||
| 228 | ( | ||
| 229 | 	ipc_space_read_t task, | ||
| 230 | 	mach_port_name_t name, | ||
| 231 | 	mach_port_name_array_t *members, | ||
| 232 | 	mach_msg_type_number_t *membersCnt | ||
| 233 | ); | ||
| 234 | |||
| 235 | /* Routine mach_port_move_member */ | ||
| 236 | #ifdef	mig_external | ||
| 237 | mig_external | ||
| 238 | #else | ||
| 239 | extern | ||
| 240 | #endif	/* mig_external */ | ||
| 241 | kern_return_t mach_port_move_member | ||
| 242 | ( | ||
| 243 | 	ipc_space_t task, | ||
| 244 | 	mach_port_name_t member, | ||
| 245 | 	mach_port_name_t after | ||
| 246 | ); | ||
| 247 | |||
| 248 | /* Routine mach_port_request_notification */ | ||
| 249 | #ifdef	mig_external | ||
| 250 | mig_external | ||
| 251 | #else | ||
| 252 | extern | ||
| 253 | #endif	/* mig_external */ | ||
| 254 | kern_return_t mach_port_request_notification | ||
| 255 | ( | ||
| 256 | 	ipc_space_t task, | ||
| 257 | 	mach_port_name_t name, | ||
| 258 | 	mach_msg_id_t msgid, | ||
| 259 | 	mach_port_mscount_t sync, | ||
| 260 | 	mach_port_t notify, | ||
| 261 | 	mach_msg_type_name_t notifyPoly, | ||
| 262 | 	mach_port_t *previous | ||
| 263 | ); | ||
| 264 | |||
| 265 | /* Routine mach_port_insert_right */ | ||
| 266 | #ifdef	mig_external | ||
| 267 | mig_external | ||
| 268 | #else | ||
| 269 | extern | ||
| 270 | #endif	/* mig_external */ | ||
| 271 | kern_return_t mach_port_insert_right | ||
| 272 | ( | ||
| 273 | 	ipc_space_t task, | ||
| 274 | 	mach_port_name_t name, | ||
| 275 | 	mach_port_t poly, | ||
| 276 | 	mach_msg_type_name_t polyPoly | ||
| 277 | ); | ||
| 278 | |||
| 279 | /* Routine mach_port_extract_right */ | ||
| 280 | #ifdef	mig_external | ||
| 281 | mig_external | ||
| 282 | #else | ||
| 283 | extern | ||
| 284 | #endif	/* mig_external */ | ||
| 285 | kern_return_t mach_port_extract_right | ||
| 286 | ( | ||
| 287 | 	ipc_space_t task, | ||
| 288 | 	mach_port_name_t name, | ||
| 289 | 	mach_msg_type_name_t msgt_name, | ||
| 290 | 	mach_port_t *poly, | ||
| 291 | 	mach_msg_type_name_t *polyPoly | ||
| 292 | ); | ||
| 293 | |||
| 294 | /* Routine mach_port_set_seqno */ | ||
| 295 | #ifdef	mig_external | ||
| 296 | mig_external | ||
| 297 | #else | ||
| 298 | extern | ||
| 299 | #endif	/* mig_external */ | ||
| 300 | kern_return_t mach_port_set_seqno | ||
| 301 | ( | ||
| 302 | 	ipc_space_t task, | ||
| 303 | 	mach_port_name_t name, | ||
| 304 | 	mach_port_seqno_t seqno | ||
| 305 | ); | ||
| 306 | |||
| 307 | /* Routine mach_port_get_attributes */ | ||
| 308 | #ifdef	mig_external | ||
| 309 | mig_external | ||
| 310 | #else | ||
| 311 | extern | ||
| 312 | #endif	/* mig_external */ | ||
| 313 | kern_return_t mach_port_get_attributes | ||
| 314 | ( | ||
| 315 | 	ipc_space_read_t task, | ||
| 316 | 	mach_port_name_t name, | ||
| 317 | 	mach_port_flavor_t flavor, | ||
| 318 | 	mach_port_info_t port_info_out, | ||
| 319 | 	mach_msg_type_number_t *port_info_outCnt | ||
| 320 | ); | ||
| 321 | |||
| 322 | /* Routine mach_port_set_attributes */ | ||
| 323 | #ifdef	mig_external | ||
| 324 | mig_external | ||
| 325 | #else | ||
| 326 | extern | ||
| 327 | #endif	/* mig_external */ | ||
| 328 | kern_return_t mach_port_set_attributes | ||
| 329 | ( | ||
| 330 | 	ipc_space_t task, | ||
| 331 | 	mach_port_name_t name, | ||
| 332 | 	mach_port_flavor_t flavor, | ||
| 333 | 	mach_port_info_t port_info, | ||
| 334 | 	mach_msg_type_number_t port_infoCnt | ||
| 335 | ); | ||
| 336 | |||
| 337 | /* Routine mach_port_allocate_qos */ | ||
| 338 | #ifdef	mig_external | ||
| 339 | mig_external | ||
| 340 | #else | ||
| 341 | extern | ||
| 342 | #endif	/* mig_external */ | ||
| 343 | kern_return_t mach_port_allocate_qos | ||
| 344 | ( | ||
| 345 | 	ipc_space_t task, | ||
| 346 | 	mach_port_right_t right, | ||
| 347 | 	mach_port_qos_t *qos, | ||
| 348 | 	mach_port_name_t *name | ||
| 349 | ); | ||
| 350 | |||
| 351 | /* Routine mach_port_allocate_full */ | ||
| 352 | #ifdef	mig_external | ||
| 353 | mig_external | ||
| 354 | #else | ||
| 355 | extern | ||
| 356 | #endif	/* mig_external */ | ||
| 357 | kern_return_t mach_port_allocate_full | ||
| 358 | ( | ||
| 359 | 	ipc_space_t task, | ||
| 360 | 	mach_port_right_t right, | ||
| 361 | 	mach_port_t proto, | ||
| 362 | 	mach_port_qos_t *qos, | ||
| 363 | 	mach_port_name_t *name | ||
| 364 | ); | ||
| 365 | |||
| 366 | /* Routine task_set_port_space */ | ||
| 367 | #ifdef	mig_external | ||
| 368 | mig_external | ||
| 369 | #else | ||
| 370 | extern | ||
| 371 | #endif	/* mig_external */ | ||
| 372 | __WATCHOS_PROHIBITED | ||
| 373 | __TVOS_PROHIBITED | ||
| 374 | kern_return_t task_set_port_space | ||
| 375 | ( | ||
| 376 | 	ipc_space_t task, | ||
| 377 | 	int table_entries | ||
| 378 | ); | ||
| 379 | |||
| 380 | /* Routine mach_port_get_srights */ | ||
| 381 | #ifdef	mig_external | ||
| 382 | mig_external | ||
| 383 | #else | ||
| 384 | extern | ||
| 385 | #endif	/* mig_external */ | ||
| 386 | kern_return_t mach_port_get_srights | ||
| 387 | ( | ||
| 388 | 	ipc_space_t task, | ||
| 389 | 	mach_port_name_t name, | ||
| 390 | 	mach_port_rights_t *srights | ||
| 391 | ); | ||
| 392 | |||
| 393 | /* Routine mach_port_space_info */ | ||
| 394 | #ifdef	mig_external | ||
| 395 | mig_external | ||
| 396 | #else | ||
| 397 | extern | ||
| 398 | #endif	/* mig_external */ | ||
| 399 | kern_return_t mach_port_space_info | ||
| 400 | ( | ||
| 401 | 	ipc_space_read_t space, | ||
| 402 | 	ipc_info_space_t *space_info, | ||
| 403 | 	ipc_info_name_array_t *table_info, | ||
| 404 | 	mach_msg_type_number_t *table_infoCnt, | ||
| 405 | 	ipc_info_tree_name_array_t *tree_info, | ||
| 406 | 	mach_msg_type_number_t *tree_infoCnt | ||
| 407 | ); | ||
| 408 | |||
| 409 | /* Routine mach_port_dnrequest_info */ | ||
| 410 | #ifdef	mig_external | ||
| 411 | mig_external | ||
| 412 | #else | ||
| 413 | extern | ||
| 414 | #endif	/* mig_external */ | ||
| 415 | kern_return_t mach_port_dnrequest_info | ||
| 416 | ( | ||
| 417 | 	ipc_space_t task, | ||
| 418 | 	mach_port_name_t name, | ||
| 419 | 	unsigned *dnr_total, | ||
| 420 | 	unsigned *dnr_used | ||
| 421 | ); | ||
| 422 | |||
| 423 | /* Routine mach_port_kernel_object */ | ||
| 424 | #ifdef	mig_external | ||
| 425 | mig_external | ||
| 426 | #else | ||
| 427 | extern | ||
| 428 | #endif	/* mig_external */ | ||
| 429 | kern_return_t mach_port_kernel_object | ||
| 430 | ( | ||
| 431 | 	ipc_space_read_t task, | ||
| 432 | 	mach_port_name_t name, | ||
| 433 | 	unsigned *object_type, | ||
| 434 | 	unsigned *object_addr | ||
| 435 | ); | ||
| 436 | |||
| 437 | /* Routine mach_port_insert_member */ | ||
| 438 | #ifdef	mig_external | ||
| 439 | mig_external | ||
| 440 | #else | ||
| 441 | extern | ||
| 442 | #endif	/* mig_external */ | ||
| 443 | kern_return_t mach_port_insert_member | ||
| 444 | ( | ||
| 445 | 	ipc_space_t task, | ||
| 446 | 	mach_port_name_t name, | ||
| 447 | 	mach_port_name_t pset | ||
| 448 | ); | ||
| 449 | |||
| 450 | /* Routine mach_port_extract_member */ | ||
| 451 | #ifdef	mig_external | ||
| 452 | mig_external | ||
| 453 | #else | ||
| 454 | extern | ||
| 455 | #endif	/* mig_external */ | ||
| 456 | kern_return_t mach_port_extract_member | ||
| 457 | ( | ||
| 458 | 	ipc_space_t task, | ||
| 459 | 	mach_port_name_t name, | ||
| 460 | 	mach_port_name_t pset | ||
| 461 | ); | ||
| 462 | |||
| 463 | /* Routine mach_port_get_context */ | ||
| 464 | #ifdef	mig_external | ||
| 465 | mig_external | ||
| 466 | #else | ||
| 467 | extern | ||
| 468 | #endif	/* mig_external */ | ||
| 469 | kern_return_t mach_port_get_context | ||
| 470 | ( | ||
| 471 | 	ipc_space_read_t task, | ||
| 472 | 	mach_port_name_t name, | ||
| 473 | 	mach_port_context_t *context | ||
| 474 | ); | ||
| 475 | |||
| 476 | /* Routine mach_port_set_context */ | ||
| 477 | #ifdef	mig_external | ||
| 478 | mig_external | ||
| 479 | #else | ||
| 480 | extern | ||
| 481 | #endif	/* mig_external */ | ||
| 482 | kern_return_t mach_port_set_context | ||
| 483 | ( | ||
| 484 | 	ipc_space_t task, | ||
| 485 | 	mach_port_name_t name, | ||
| 486 | 	mach_port_context_t context | ||
| 487 | ); | ||
| 488 | |||
| 489 | /* Routine mach_port_kobject */ | ||
| 490 | #ifdef	mig_external | ||
| 491 | mig_external | ||
| 492 | #else | ||
| 493 | extern | ||
| 494 | #endif	/* mig_external */ | ||
| 495 | kern_return_t mach_port_kobject | ||
| 496 | ( | ||
| 497 | 	ipc_space_read_t task, | ||
| 498 | 	mach_port_name_t name, | ||
| 499 | 	natural_t *object_type, | ||
| 500 | 	mach_vm_address_t *object_addr | ||
| 501 | ); | ||
| 502 | |||
| 503 | /* Routine mach_port_construct */ | ||
| 504 | #ifdef	mig_external | ||
| 505 | mig_external | ||
| 506 | #else | ||
| 507 | extern | ||
| 508 | #endif	/* mig_external */ | ||
| 509 | kern_return_t mach_port_construct | ||
| 510 | ( | ||
| 511 | 	ipc_space_t task, | ||
| 512 | 	mach_port_options_ptr_t options, | ||
| 513 | 	mach_port_context_t context, | ||
| 514 | 	mach_port_name_t *name | ||
| 515 | ); | ||
| 516 | |||
| 517 | /* Routine mach_port_destruct */ | ||
| 518 | #ifdef	mig_external | ||
| 519 | mig_external | ||
| 520 | #else | ||
| 521 | extern | ||
| 522 | #endif	/* mig_external */ | ||
| 523 | kern_return_t mach_port_destruct | ||
| 524 | ( | ||
| 525 | 	ipc_space_t task, | ||
| 526 | 	mach_port_name_t name, | ||
| 527 | 	mach_port_delta_t srdelta, | ||
| 528 | 	mach_port_context_t guard | ||
| 529 | ); | ||
| 530 | |||
| 531 | /* Routine mach_port_guard */ | ||
| 532 | #ifdef	mig_external | ||
| 533 | mig_external | ||
| 534 | #else | ||
| 535 | extern | ||
| 536 | #endif	/* mig_external */ | ||
| 537 | kern_return_t mach_port_guard | ||
| 538 | ( | ||
| 539 | 	ipc_space_t task, | ||
| 540 | 	mach_port_name_t name, | ||
| 541 | 	mach_port_context_t guard, | ||
| 542 | 	boolean_t strict | ||
| 543 | ); | ||
| 544 | |||
| 545 | /* Routine mach_port_unguard */ | ||
| 546 | #ifdef	mig_external | ||
| 547 | mig_external | ||
| 548 | #else | ||
| 549 | extern | ||
| 550 | #endif	/* mig_external */ | ||
| 551 | kern_return_t mach_port_unguard | ||
| 552 | ( | ||
| 553 | 	ipc_space_t task, | ||
| 554 | 	mach_port_name_t name, | ||
| 555 | 	mach_port_context_t guard | ||
| 556 | ); | ||
| 557 | |||
| 558 | /* Routine mach_port_space_basic_info */ | ||
| 559 | #ifdef	mig_external | ||
| 560 | mig_external | ||
| 561 | #else | ||
| 562 | extern | ||
| 563 | #endif	/* mig_external */ | ||
| 564 | kern_return_t mach_port_space_basic_info | ||
| 565 | ( | ||
| 566 | 	ipc_space_inspect_t task, | ||
| 567 | 	ipc_info_space_basic_t *basic_info | ||
| 568 | ); | ||
| 569 | |||
| 570 | /* Routine mach_port_guard_with_flags */ | ||
| 571 | #ifdef	mig_external | ||
| 572 | mig_external | ||
| 573 | #else | ||
| 574 | extern | ||
| 575 | #endif	/* mig_external */ | ||
| 576 | kern_return_t mach_port_guard_with_flags | ||
| 577 | ( | ||
| 578 | 	ipc_space_t task, | ||
| 579 | 	mach_port_name_t name, | ||
| 580 | 	mach_port_context_t guard, | ||
| 581 | 	uint64_t flags | ||
| 582 | ); | ||
| 583 | |||
| 584 | /* Routine mach_port_swap_guard */ | ||
| 585 | #ifdef	mig_external | ||
| 586 | mig_external | ||
| 587 | #else | ||
| 588 | extern | ||
| 589 | #endif	/* mig_external */ | ||
| 590 | kern_return_t mach_port_swap_guard | ||
| 591 | ( | ||
| 592 | 	ipc_space_t task, | ||
| 593 | 	mach_port_name_t name, | ||
| 594 | 	mach_port_context_t old_guard, | ||
| 595 | 	mach_port_context_t new_guard | ||
| 596 | ); | ||
| 597 | |||
| 598 | /* Routine mach_port_kobject_description */ | ||
| 599 | #ifdef	mig_external | ||
| 600 | mig_external | ||
| 601 | #else | ||
| 602 | extern | ||
| 603 | #endif	/* mig_external */ | ||
| 604 | kern_return_t mach_port_kobject_description | ||
| 605 | ( | ||
| 606 | 	ipc_space_read_t task, | ||
| 607 | 	mach_port_name_t name, | ||
| 608 | 	natural_t *object_type, | ||
| 609 | 	mach_vm_address_t *object_addr, | ||
| 610 | 	kobject_description_t description | ||
| 611 | ); | ||
| 612 | |||
| 613 | __END_DECLS | ||
| 614 | |||
| 615 | /********************** Caution **************************/ | ||
| 616 | /* The following data types should be used to calculate */ | ||
| 617 | /* maximum message sizes only. The actual message may be */ | ||
| 618 | /* smaller, and the position of the arguments within the */ | ||
| 619 | /* message layout may vary from what is presented here. */ | ||
| 620 | /* For example, if any of the arguments are variable- */ | ||
| 621 | /* sized, and less than the maximum is sent, the data */ | ||
| 622 | /* will be packed tight in the actual message to reduce */ | ||
| 623 | /* the presence of holes. */ | ||
| 624 | /********************** Caution **************************/ | ||
| 625 | |||
| 626 | /* typedefs for all requests */ | ||
| 627 | |||
| 628 | #ifndef __Request__mach_port_subsystem__defined | ||
| 629 | #define __Request__mach_port_subsystem__defined | ||
| 630 | |||
| 631 | #ifdef __MigPackStructs | ||
| 632 | #pragma pack(push, 4) | ||
| 633 | #endif | ||
| 634 | 	typedef struct { | ||
| 635 | 		mach_msg_header_t Head; | ||
| 636 | 	} __Request__mach_port_names_t __attribute__((unused)); | ||
| 637 | #ifdef __MigPackStructs | ||
| 638 | #pragma pack(pop) | ||
| 639 | #endif | ||
| 640 | |||
| 641 | #ifdef __MigPackStructs | ||
| 642 | #pragma pack(push, 4) | ||
| 643 | #endif | ||
| 644 | 	typedef struct { | ||
| 645 | 		mach_msg_header_t Head; | ||
| 646 | 		NDR_record_t NDR; | ||
| 647 | 		mach_port_name_t name; | ||
| 648 | 	} __Request__mach_port_type_t __attribute__((unused)); | ||
| 649 | #ifdef __MigPackStructs | ||
| 650 | #pragma pack(pop) | ||
| 651 | #endif | ||
| 652 | |||
| 653 | #ifdef __MigPackStructs | ||
| 654 | #pragma pack(push, 4) | ||
| 655 | #endif | ||
| 656 | 	typedef struct { | ||
| 657 | 		mach_msg_header_t Head; | ||
| 658 | 		NDR_record_t NDR; | ||
| 659 | 		mach_port_name_t old_name; | ||
| 660 | 		mach_port_name_t new_name; | ||
| 661 | 	} __Request__mach_port_rename_t __attribute__((unused)); | ||
| 662 | #ifdef __MigPackStructs | ||
| 663 | #pragma pack(pop) | ||
| 664 | #endif | ||
| 665 | |||
| 666 | #ifdef __MigPackStructs | ||
| 667 | #pragma pack(push, 4) | ||
| 668 | #endif | ||
| 669 | 	typedef struct { | ||
| 670 | 		mach_msg_header_t Head; | ||
| 671 | 		NDR_record_t NDR; | ||
| 672 | 		mach_port_right_t right; | ||
| 673 | 		mach_port_name_t name; | ||
| 674 | 	} __Request__mach_port_allocate_name_t __attribute__((unused)); | ||
| 675 | #ifdef __MigPackStructs | ||
| 676 | #pragma pack(pop) | ||
| 677 | #endif | ||
| 678 | |||
| 679 | #ifdef __MigPackStructs | ||
| 680 | #pragma pack(push, 4) | ||
| 681 | #endif | ||
| 682 | 	typedef struct { | ||
| 683 | 		mach_msg_header_t Head; | ||
| 684 | 		NDR_record_t NDR; | ||
| 685 | 		mach_port_right_t right; | ||
| 686 | 	} __Request__mach_port_allocate_t __attribute__((unused)); | ||
| 687 | #ifdef __MigPackStructs | ||
| 688 | #pragma pack(pop) | ||
| 689 | #endif | ||
| 690 | |||
| 691 | #ifdef __MigPackStructs | ||
| 692 | #pragma pack(push, 4) | ||
| 693 | #endif | ||
| 694 | 	typedef struct { | ||
| 695 | 		mach_msg_header_t Head; | ||
| 696 | 		NDR_record_t NDR; | ||
| 697 | 		mach_port_name_t name; | ||
| 698 | 	} __Request__mach_port_destroy_t __attribute__((unused)); | ||
| 699 | #ifdef __MigPackStructs | ||
| 700 | #pragma pack(pop) | ||
| 701 | #endif | ||
| 702 | |||
| 703 | #ifdef __MigPackStructs | ||
| 704 | #pragma pack(push, 4) | ||
| 705 | #endif | ||
| 706 | 	typedef struct { | ||
| 707 | 		mach_msg_header_t Head; | ||
| 708 | 		NDR_record_t NDR; | ||
| 709 | 		mach_port_name_t name; | ||
| 710 | 	} __Request__mach_port_deallocate_t __attribute__((unused)); | ||
| 711 | #ifdef __MigPackStructs | ||
| 712 | #pragma pack(pop) | ||
| 713 | #endif | ||
| 714 | |||
| 715 | #ifdef __MigPackStructs | ||
| 716 | #pragma pack(push, 4) | ||
| 717 | #endif | ||
| 718 | 	typedef struct { | ||
| 719 | 		mach_msg_header_t Head; | ||
| 720 | 		NDR_record_t NDR; | ||
| 721 | 		mach_port_name_t name; | ||
| 722 | 		mach_port_right_t right; | ||
| 723 | 	} __Request__mach_port_get_refs_t __attribute__((unused)); | ||
| 724 | #ifdef __MigPackStructs | ||
| 725 | #pragma pack(pop) | ||
| 726 | #endif | ||
| 727 | |||
| 728 | #ifdef __MigPackStructs | ||
| 729 | #pragma pack(push, 4) | ||
| 730 | #endif | ||
| 731 | 	typedef struct { | ||
| 732 | 		mach_msg_header_t Head; | ||
| 733 | 		NDR_record_t NDR; | ||
| 734 | 		mach_port_name_t name; | ||
| 735 | 		mach_port_right_t right; | ||
| 736 | 		mach_port_delta_t delta; | ||
| 737 | 	} __Request__mach_port_mod_refs_t __attribute__((unused)); | ||
| 738 | #ifdef __MigPackStructs | ||
| 739 | #pragma pack(pop) | ||
| 740 | #endif | ||
| 741 | |||
| 742 | #ifdef __MigPackStructs | ||
| 743 | #pragma pack(push, 4) | ||
| 744 | #endif | ||
| 745 | 	typedef struct { | ||
| 746 | 		mach_msg_header_t Head; | ||
| 747 | 		NDR_record_t NDR; | ||
| 748 | 		mach_port_name_t name; | ||
| 749 | 		mach_msg_trailer_type_t trailer_type; | ||
| 750 | 		mach_port_seqno_t request_seqnop; | ||
| 751 | 		mach_msg_type_number_t trailer_infopCnt; | ||
| 752 | 	} __Request__mach_port_peek_t __attribute__((unused)); | ||
| 753 | #ifdef __MigPackStructs | ||
| 754 | #pragma pack(pop) | ||
| 755 | #endif | ||
| 756 | |||
| 757 | #ifdef __MigPackStructs | ||
| 758 | #pragma pack(push, 4) | ||
| 759 | #endif | ||
| 760 | 	typedef struct { | ||
| 761 | 		mach_msg_header_t Head; | ||
| 762 | 		NDR_record_t NDR; | ||
| 763 | 		mach_port_name_t name; | ||
| 764 | 		mach_port_mscount_t mscount; | ||
| 765 | 	} __Request__mach_port_set_mscount_t __attribute__((unused)); | ||
| 766 | #ifdef __MigPackStructs | ||
| 767 | #pragma pack(pop) | ||
| 768 | #endif | ||
| 769 | |||
| 770 | #ifdef __MigPackStructs | ||
| 771 | #pragma pack(push, 4) | ||
| 772 | #endif | ||
| 773 | 	typedef struct { | ||
| 774 | 		mach_msg_header_t Head; | ||
| 775 | 		NDR_record_t NDR; | ||
| 776 | 		mach_port_name_t name; | ||
| 777 | 	} __Request__mach_port_get_set_status_t __attribute__((unused)); | ||
| 778 | #ifdef __MigPackStructs | ||
| 779 | #pragma pack(pop) | ||
| 780 | #endif | ||
| 781 | |||
| 782 | #ifdef __MigPackStructs | ||
| 783 | #pragma pack(push, 4) | ||
| 784 | #endif | ||
| 785 | 	typedef struct { | ||
| 786 | 		mach_msg_header_t Head; | ||
| 787 | 		NDR_record_t NDR; | ||
| 788 | 		mach_port_name_t member; | ||
| 789 | 		mach_port_name_t after; | ||
| 790 | 	} __Request__mach_port_move_member_t __attribute__((unused)); | ||
| 791 | #ifdef __MigPackStructs | ||
| 792 | #pragma pack(pop) | ||
| 793 | #endif | ||
| 794 | |||
| 795 | #ifdef __MigPackStructs | ||
| 796 | #pragma pack(push, 4) | ||
| 797 | #endif | ||
| 798 | 	typedef struct { | ||
| 799 | 		mach_msg_header_t Head; | ||
| 800 | 		/* start of the kernel processed data */ | ||
| 801 | 		mach_msg_body_t msgh_body; | ||
| 802 | 		mach_msg_port_descriptor_t notify; | ||
| 803 | 		/* end of the kernel processed data */ | ||
| 804 | 		NDR_record_t NDR; | ||
| 805 | 		mach_port_name_t name; | ||
| 806 | 		mach_msg_id_t msgid; | ||
| 807 | 		mach_port_mscount_t sync; | ||
| 808 | 	} __Request__mach_port_request_notification_t __attribute__((unused)); | ||
| 809 | #ifdef __MigPackStructs | ||
| 810 | #pragma pack(pop) | ||
| 811 | #endif | ||
| 812 | |||
| 813 | #ifdef __MigPackStructs | ||
| 814 | #pragma pack(push, 4) | ||
| 815 | #endif | ||
| 816 | 	typedef struct { | ||
| 817 | 		mach_msg_header_t Head; | ||
| 818 | 		/* start of the kernel processed data */ | ||
| 819 | 		mach_msg_body_t msgh_body; | ||
| 820 | 		mach_msg_port_descriptor_t poly; | ||
| 821 | 		/* end of the kernel processed data */ | ||
| 822 | 		NDR_record_t NDR; | ||
| 823 | 		mach_port_name_t name; | ||
| 824 | 	} __Request__mach_port_insert_right_t __attribute__((unused)); | ||
| 825 | #ifdef __MigPackStructs | ||
| 826 | #pragma pack(pop) | ||
| 827 | #endif | ||
| 828 | |||
| 829 | #ifdef __MigPackStructs | ||
| 830 | #pragma pack(push, 4) | ||
| 831 | #endif | ||
| 832 | 	typedef struct { | ||
| 833 | 		mach_msg_header_t Head; | ||
| 834 | 		NDR_record_t NDR; | ||
| 835 | 		mach_port_name_t name; | ||
| 836 | 		mach_msg_type_name_t msgt_name; | ||
| 837 | 	} __Request__mach_port_extract_right_t __attribute__((unused)); | ||
| 838 | #ifdef __MigPackStructs | ||
| 839 | #pragma pack(pop) | ||
| 840 | #endif | ||
| 841 | |||
| 842 | #ifdef __MigPackStructs | ||
| 843 | #pragma pack(push, 4) | ||
| 844 | #endif | ||
| 845 | 	typedef struct { | ||
| 846 | 		mach_msg_header_t Head; | ||
| 847 | 		NDR_record_t NDR; | ||
| 848 | 		mach_port_name_t name; | ||
| 849 | 		mach_port_seqno_t seqno; | ||
| 850 | 	} __Request__mach_port_set_seqno_t __attribute__((unused)); | ||
| 851 | #ifdef __MigPackStructs | ||
| 852 | #pragma pack(pop) | ||
| 853 | #endif | ||
| 854 | |||
| 855 | #ifdef __MigPackStructs | ||
| 856 | #pragma pack(push, 4) | ||
| 857 | #endif | ||
| 858 | 	typedef struct { | ||
| 859 | 		mach_msg_header_t Head; | ||
| 860 | 		NDR_record_t NDR; | ||
| 861 | 		mach_port_name_t name; | ||
| 862 | 		mach_port_flavor_t flavor; | ||
| 863 | 		mach_msg_type_number_t port_info_outCnt; | ||
| 864 | 	} __Request__mach_port_get_attributes_t __attribute__((unused)); | ||
| 865 | #ifdef __MigPackStructs | ||
| 866 | #pragma pack(pop) | ||
| 867 | #endif | ||
| 868 | |||
| 869 | #ifdef __MigPackStructs | ||
| 870 | #pragma pack(push, 4) | ||
| 871 | #endif | ||
| 872 | 	typedef struct { | ||
| 873 | 		mach_msg_header_t Head; | ||
| 874 | 		NDR_record_t NDR; | ||
| 875 | 		mach_port_name_t name; | ||
| 876 | 		mach_port_flavor_t flavor; | ||
| 877 | 		mach_msg_type_number_t port_infoCnt; | ||
| 878 | 		integer_t port_info[17]; | ||
| 879 | 	} __Request__mach_port_set_attributes_t __attribute__((unused)); | ||
| 880 | #ifdef __MigPackStructs | ||
| 881 | #pragma pack(pop) | ||
| 882 | #endif | ||
| 883 | |||
| 884 | #ifdef __MigPackStructs | ||
| 885 | #pragma pack(push, 4) | ||
| 886 | #endif | ||
| 887 | 	typedef struct { | ||
| 888 | 		mach_msg_header_t Head; | ||
| 889 | 		NDR_record_t NDR; | ||
| 890 | 		mach_port_right_t right; | ||
| 891 | 		mach_port_qos_t qos; | ||
| 892 | 	} __Request__mach_port_allocate_qos_t __attribute__((unused)); | ||
| 893 | #ifdef __MigPackStructs | ||
| 894 | #pragma pack(pop) | ||
| 895 | #endif | ||
| 896 | |||
| 897 | #ifdef __MigPackStructs | ||
| 898 | #pragma pack(push, 4) | ||
| 899 | #endif | ||
| 900 | 	typedef struct { | ||
| 901 | 		mach_msg_header_t Head; | ||
| 902 | 		/* start of the kernel processed data */ | ||
| 903 | 		mach_msg_body_t msgh_body; | ||
| 904 | 		mach_msg_port_descriptor_t proto; | ||
| 905 | 		/* end of the kernel processed data */ | ||
| 906 | 		NDR_record_t NDR; | ||
| 907 | 		mach_port_right_t right; | ||
| 908 | 		mach_port_qos_t qos; | ||
| 909 | 		mach_port_name_t name; | ||
| 910 | 	} __Request__mach_port_allocate_full_t __attribute__((unused)); | ||
| 911 | #ifdef __MigPackStructs | ||
| 912 | #pragma pack(pop) | ||
| 913 | #endif | ||
| 914 | |||
| 915 | #ifdef __MigPackStructs | ||
| 916 | #pragma pack(push, 4) | ||
| 917 | #endif | ||
| 918 | 	typedef struct { | ||
| 919 | 		mach_msg_header_t Head; | ||
| 920 | 		NDR_record_t NDR; | ||
| 921 | 		int table_entries; | ||
| 922 | 	} __Request__task_set_port_space_t __attribute__((unused)); | ||
| 923 | #ifdef __MigPackStructs | ||
| 924 | #pragma pack(pop) | ||
| 925 | #endif | ||
| 926 | |||
| 927 | #ifdef __MigPackStructs | ||
| 928 | #pragma pack(push, 4) | ||
| 929 | #endif | ||
| 930 | 	typedef struct { | ||
| 931 | 		mach_msg_header_t Head; | ||
| 932 | 		NDR_record_t NDR; | ||
| 933 | 		mach_port_name_t name; | ||
| 934 | 	} __Request__mach_port_get_srights_t __attribute__((unused)); | ||
| 935 | #ifdef __MigPackStructs | ||
| 936 | #pragma pack(pop) | ||
| 937 | #endif | ||
| 938 | |||
| 939 | #ifdef __MigPackStructs | ||
| 940 | #pragma pack(push, 4) | ||
| 941 | #endif | ||
| 942 | 	typedef struct { | ||
| 943 | 		mach_msg_header_t Head; | ||
| 944 | 	} __Request__mach_port_space_info_t __attribute__((unused)); | ||
| 945 | #ifdef __MigPackStructs | ||
| 946 | #pragma pack(pop) | ||
| 947 | #endif | ||
| 948 | |||
| 949 | #ifdef __MigPackStructs | ||
| 950 | #pragma pack(push, 4) | ||
| 951 | #endif | ||
| 952 | 	typedef struct { | ||
| 953 | 		mach_msg_header_t Head; | ||
| 954 | 		NDR_record_t NDR; | ||
| 955 | 		mach_port_name_t name; | ||
| 956 | 	} __Request__mach_port_dnrequest_info_t __attribute__((unused)); | ||
| 957 | #ifdef __MigPackStructs | ||
| 958 | #pragma pack(pop) | ||
| 959 | #endif | ||
| 960 | |||
| 961 | #ifdef __MigPackStructs | ||
| 962 | #pragma pack(push, 4) | ||
| 963 | #endif | ||
| 964 | 	typedef struct { | ||
| 965 | 		mach_msg_header_t Head; | ||
| 966 | 		NDR_record_t NDR; | ||
| 967 | 		mach_port_name_t name; | ||
| 968 | 	} __Request__mach_port_kernel_object_t __attribute__((unused)); | ||
| 969 | #ifdef __MigPackStructs | ||
| 970 | #pragma pack(pop) | ||
| 971 | #endif | ||
| 972 | |||
| 973 | #ifdef __MigPackStructs | ||
| 974 | #pragma pack(push, 4) | ||
| 975 | #endif | ||
| 976 | 	typedef struct { | ||
| 977 | 		mach_msg_header_t Head; | ||
| 978 | 		NDR_record_t NDR; | ||
| 979 | 		mach_port_name_t name; | ||
| 980 | 		mach_port_name_t pset; | ||
| 981 | 	} __Request__mach_port_insert_member_t __attribute__((unused)); | ||
| 982 | #ifdef __MigPackStructs | ||
| 983 | #pragma pack(pop) | ||
| 984 | #endif | ||
| 985 | |||
| 986 | #ifdef __MigPackStructs | ||
| 987 | #pragma pack(push, 4) | ||
| 988 | #endif | ||
| 989 | 	typedef struct { | ||
| 990 | 		mach_msg_header_t Head; | ||
| 991 | 		NDR_record_t NDR; | ||
| 992 | 		mach_port_name_t name; | ||
| 993 | 		mach_port_name_t pset; | ||
| 994 | 	} __Request__mach_port_extract_member_t __attribute__((unused)); | ||
| 995 | #ifdef __MigPackStructs | ||
| 996 | #pragma pack(pop) | ||
| 997 | #endif | ||
| 998 | |||
| 999 | #ifdef __MigPackStructs | ||
| 1000 | #pragma pack(push, 4) | ||
| 1001 | #endif | ||
| 1002 | 	typedef struct { | ||
| 1003 | 		mach_msg_header_t Head; | ||
| 1004 | 		NDR_record_t NDR; | ||
| 1005 | 		mach_port_name_t name; | ||
| 1006 | 	} __Request__mach_port_get_context_t __attribute__((unused)); | ||
| 1007 | #ifdef __MigPackStructs | ||
| 1008 | #pragma pack(pop) | ||
| 1009 | #endif | ||
| 1010 | |||
| 1011 | #ifdef __MigPackStructs | ||
| 1012 | #pragma pack(push, 4) | ||
| 1013 | #endif | ||
| 1014 | 	typedef struct { | ||
| 1015 | 		mach_msg_header_t Head; | ||
| 1016 | 		NDR_record_t NDR; | ||
| 1017 | 		mach_port_name_t name; | ||
| 1018 | 		mach_port_context_t context; | ||
| 1019 | 	} __Request__mach_port_set_context_t __attribute__((unused)); | ||
| 1020 | #ifdef __MigPackStructs | ||
| 1021 | #pragma pack(pop) | ||
| 1022 | #endif | ||
| 1023 | |||
| 1024 | #ifdef __MigPackStructs | ||
| 1025 | #pragma pack(push, 4) | ||
| 1026 | #endif | ||
| 1027 | 	typedef struct { | ||
| 1028 | 		mach_msg_header_t Head; | ||
| 1029 | 		NDR_record_t NDR; | ||
| 1030 | 		mach_port_name_t name; | ||
| 1031 | 	} __Request__mach_port_kobject_t __attribute__((unused)); | ||
| 1032 | #ifdef __MigPackStructs | ||
| 1033 | #pragma pack(pop) | ||
| 1034 | #endif | ||
| 1035 | |||
| 1036 | #ifdef __MigPackStructs | ||
| 1037 | #pragma pack(push, 4) | ||
| 1038 | #endif | ||
| 1039 | 	typedef struct { | ||
| 1040 | 		mach_msg_header_t Head; | ||
| 1041 | 		/* start of the kernel processed data */ | ||
| 1042 | 		mach_msg_body_t msgh_body; | ||
| 1043 | 		mach_msg_ool_descriptor_t options; | ||
| 1044 | 		/* end of the kernel processed data */ | ||
| 1045 | 		NDR_record_t NDR; | ||
| 1046 | 		mach_port_context_t context; | ||
| 1047 | 	} __Request__mach_port_construct_t __attribute__((unused)); | ||
| 1048 | #ifdef __MigPackStructs | ||
| 1049 | #pragma pack(pop) | ||
| 1050 | #endif | ||
| 1051 | |||
| 1052 | #ifdef __MigPackStructs | ||
| 1053 | #pragma pack(push, 4) | ||
| 1054 | #endif | ||
| 1055 | 	typedef struct { | ||
| 1056 | 		mach_msg_header_t Head; | ||
| 1057 | 		NDR_record_t NDR; | ||
| 1058 | 		mach_port_name_t name; | ||
| 1059 | 		mach_port_delta_t srdelta; | ||
| 1060 | 		mach_port_context_t guard; | ||
| 1061 | 	} __Request__mach_port_destruct_t __attribute__((unused)); | ||
| 1062 | #ifdef __MigPackStructs | ||
| 1063 | #pragma pack(pop) | ||
| 1064 | #endif | ||
| 1065 | |||
| 1066 | #ifdef __MigPackStructs | ||
| 1067 | #pragma pack(push, 4) | ||
| 1068 | #endif | ||
| 1069 | 	typedef struct { | ||
| 1070 | 		mach_msg_header_t Head; | ||
| 1071 | 		NDR_record_t NDR; | ||
| 1072 | 		mach_port_name_t name; | ||
| 1073 | 		mach_port_context_t guard; | ||
| 1074 | 		boolean_t strict; | ||
| 1075 | 	} __Request__mach_port_guard_t __attribute__((unused)); | ||
| 1076 | #ifdef __MigPackStructs | ||
| 1077 | #pragma pack(pop) | ||
| 1078 | #endif | ||
| 1079 | |||
| 1080 | #ifdef __MigPackStructs | ||
| 1081 | #pragma pack(push, 4) | ||
| 1082 | #endif | ||
| 1083 | 	typedef struct { | ||
| 1084 | 		mach_msg_header_t Head; | ||
| 1085 | 		NDR_record_t NDR; | ||
| 1086 | 		mach_port_name_t name; | ||
| 1087 | 		mach_port_context_t guard; | ||
| 1088 | 	} __Request__mach_port_unguard_t __attribute__((unused)); | ||
| 1089 | #ifdef __MigPackStructs | ||
| 1090 | #pragma pack(pop) | ||
| 1091 | #endif | ||
| 1092 | |||
| 1093 | #ifdef __MigPackStructs | ||
| 1094 | #pragma pack(push, 4) | ||
| 1095 | #endif | ||
| 1096 | 	typedef struct { | ||
| 1097 | 		mach_msg_header_t Head; | ||
| 1098 | 	} __Request__mach_port_space_basic_info_t __attribute__((unused)); | ||
| 1099 | #ifdef __MigPackStructs | ||
| 1100 | #pragma pack(pop) | ||
| 1101 | #endif | ||
| 1102 | |||
| 1103 | #ifdef __MigPackStructs | ||
| 1104 | #pragma pack(push, 4) | ||
| 1105 | #endif | ||
| 1106 | 	typedef struct { | ||
| 1107 | 		mach_msg_header_t Head; | ||
| 1108 | 		NDR_record_t NDR; | ||
| 1109 | 		mach_port_name_t name; | ||
| 1110 | 		mach_port_context_t guard; | ||
| 1111 | 		uint64_t flags; | ||
| 1112 | 	} __Request__mach_port_guard_with_flags_t __attribute__((unused)); | ||
| 1113 | #ifdef __MigPackStructs | ||
| 1114 | #pragma pack(pop) | ||
| 1115 | #endif | ||
| 1116 | |||
| 1117 | #ifdef __MigPackStructs | ||
| 1118 | #pragma pack(push, 4) | ||
| 1119 | #endif | ||
| 1120 | 	typedef struct { | ||
| 1121 | 		mach_msg_header_t Head; | ||
| 1122 | 		NDR_record_t NDR; | ||
| 1123 | 		mach_port_name_t name; | ||
| 1124 | 		mach_port_context_t old_guard; | ||
| 1125 | 		mach_port_context_t new_guard; | ||
| 1126 | 	} __Request__mach_port_swap_guard_t __attribute__((unused)); | ||
| 1127 | #ifdef __MigPackStructs | ||
| 1128 | #pragma pack(pop) | ||
| 1129 | #endif | ||
| 1130 | |||
| 1131 | #ifdef __MigPackStructs | ||
| 1132 | #pragma pack(push, 4) | ||
| 1133 | #endif | ||
| 1134 | 	typedef struct { | ||
| 1135 | 		mach_msg_header_t Head; | ||
| 1136 | 		NDR_record_t NDR; | ||
| 1137 | 		mach_port_name_t name; | ||
| 1138 | 	} __Request__mach_port_kobject_description_t __attribute__((unused)); | ||
| 1139 | #ifdef __MigPackStructs | ||
| 1140 | #pragma pack(pop) | ||
| 1141 | #endif | ||
| 1142 | #endif /* !__Request__mach_port_subsystem__defined */ | ||
| 1143 | |||
| 1144 | /* union of all requests */ | ||
| 1145 | |||
| 1146 | #ifndef __RequestUnion__mach_port_subsystem__defined | ||
| 1147 | #define __RequestUnion__mach_port_subsystem__defined | ||
| 1148 | union __RequestUnion__mach_port_subsystem { | ||
| 1149 | 	__Request__mach_port_names_t Request_mach_port_names; | ||
| 1150 | 	__Request__mach_port_type_t Request_mach_port_type; | ||
| 1151 | 	__Request__mach_port_rename_t Request_mach_port_rename; | ||
| 1152 | 	__Request__mach_port_allocate_name_t Request_mach_port_allocate_name; | ||
| 1153 | 	__Request__mach_port_allocate_t Request_mach_port_allocate; | ||
| 1154 | 	__Request__mach_port_destroy_t Request_mach_port_destroy; | ||
| 1155 | 	__Request__mach_port_deallocate_t Request_mach_port_deallocate; | ||
| 1156 | 	__Request__mach_port_get_refs_t Request_mach_port_get_refs; | ||
| 1157 | 	__Request__mach_port_mod_refs_t Request_mach_port_mod_refs; | ||
| 1158 | 	__Request__mach_port_peek_t Request_mach_port_peek; | ||
| 1159 | 	__Request__mach_port_set_mscount_t Request_mach_port_set_mscount; | ||
| 1160 | 	__Request__mach_port_get_set_status_t Request_mach_port_get_set_status; | ||
| 1161 | 	__Request__mach_port_move_member_t Request_mach_port_move_member; | ||
| 1162 | 	__Request__mach_port_request_notification_t Request_mach_port_request_notification; | ||
| 1163 | 	__Request__mach_port_insert_right_t Request_mach_port_insert_right; | ||
| 1164 | 	__Request__mach_port_extract_right_t Request_mach_port_extract_right; | ||
| 1165 | 	__Request__mach_port_set_seqno_t Request_mach_port_set_seqno; | ||
| 1166 | 	__Request__mach_port_get_attributes_t Request_mach_port_get_attributes; | ||
| 1167 | 	__Request__mach_port_set_attributes_t Request_mach_port_set_attributes; | ||
| 1168 | 	__Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos; | ||
| 1169 | 	__Request__mach_port_allocate_full_t Request_mach_port_allocate_full; | ||
| 1170 | 	__Request__task_set_port_space_t Request_task_set_port_space; | ||
| 1171 | 	__Request__mach_port_get_srights_t Request_mach_port_get_srights; | ||
| 1172 | 	__Request__mach_port_space_info_t Request_mach_port_space_info; | ||
| 1173 | 	__Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info; | ||
| 1174 | 	__Request__mach_port_kernel_object_t Request_mach_port_kernel_object; | ||
| 1175 | 	__Request__mach_port_insert_member_t Request_mach_port_insert_member; | ||
| 1176 | 	__Request__mach_port_extract_member_t Request_mach_port_extract_member; | ||
| 1177 | 	__Request__mach_port_get_context_t Request_mach_port_get_context; | ||
| 1178 | 	__Request__mach_port_set_context_t Request_mach_port_set_context; | ||
| 1179 | 	__Request__mach_port_kobject_t Request_mach_port_kobject; | ||
| 1180 | 	__Request__mach_port_construct_t Request_mach_port_construct; | ||
| 1181 | 	__Request__mach_port_destruct_t Request_mach_port_destruct; | ||
| 1182 | 	__Request__mach_port_guard_t Request_mach_port_guard; | ||
| 1183 | 	__Request__mach_port_unguard_t Request_mach_port_unguard; | ||
| 1184 | 	__Request__mach_port_space_basic_info_t Request_mach_port_space_basic_info; | ||
| 1185 | 	__Request__mach_port_guard_with_flags_t Request_mach_port_guard_with_flags; | ||
| 1186 | 	__Request__mach_port_swap_guard_t Request_mach_port_swap_guard; | ||
| 1187 | 	__Request__mach_port_kobject_description_t Request_mach_port_kobject_description; | ||
| 1188 | }; | ||
| 1189 | #endif /* !__RequestUnion__mach_port_subsystem__defined */ | ||
| 1190 | /* typedefs for all replies */ | ||
| 1191 | |||
| 1192 | #ifndef __Reply__mach_port_subsystem__defined | ||
| 1193 | #define __Reply__mach_port_subsystem__defined | ||
| 1194 | |||
| 1195 | #ifdef __MigPackStructs | ||
| 1196 | #pragma pack(push, 4) | ||
| 1197 | #endif | ||
| 1198 | 	typedef struct { | ||
| 1199 | 		mach_msg_header_t Head; | ||
| 1200 | 		/* start of the kernel processed data */ | ||
| 1201 | 		mach_msg_body_t msgh_body; | ||
| 1202 | 		mach_msg_ool_descriptor_t names; | ||
| 1203 | 		mach_msg_ool_descriptor_t types; | ||
| 1204 | 		/* end of the kernel processed data */ | ||
| 1205 | 		NDR_record_t NDR; | ||
| 1206 | 		mach_msg_type_number_t namesCnt; | ||
| 1207 | 		mach_msg_type_number_t typesCnt; | ||
| 1208 | 	} __Reply__mach_port_names_t __attribute__((unused)); | ||
| 1209 | #ifdef __MigPackStructs | ||
| 1210 | #pragma pack(pop) | ||
| 1211 | #endif | ||
| 1212 | |||
| 1213 | #ifdef __MigPackStructs | ||
| 1214 | #pragma pack(push, 4) | ||
| 1215 | #endif | ||
| 1216 | 	typedef struct { | ||
| 1217 | 		mach_msg_header_t Head; | ||
| 1218 | 		NDR_record_t NDR; | ||
| 1219 | 		kern_return_t RetCode; | ||
| 1220 | 		mach_port_type_t ptype; | ||
| 1221 | 	} __Reply__mach_port_type_t __attribute__((unused)); | ||
| 1222 | #ifdef __MigPackStructs | ||
| 1223 | #pragma pack(pop) | ||
| 1224 | #endif | ||
| 1225 | |||
| 1226 | #ifdef __MigPackStructs | ||
| 1227 | #pragma pack(push, 4) | ||
| 1228 | #endif | ||
| 1229 | 	typedef struct { | ||
| 1230 | 		mach_msg_header_t Head; | ||
| 1231 | 		NDR_record_t NDR; | ||
| 1232 | 		kern_return_t RetCode; | ||
| 1233 | 	} __Reply__mach_port_rename_t __attribute__((unused)); | ||
| 1234 | #ifdef __MigPackStructs | ||
| 1235 | #pragma pack(pop) | ||
| 1236 | #endif | ||
| 1237 | |||
| 1238 | #ifdef __MigPackStructs | ||
| 1239 | #pragma pack(push, 4) | ||
| 1240 | #endif | ||
| 1241 | 	typedef struct { | ||
| 1242 | 		mach_msg_header_t Head; | ||
| 1243 | 		NDR_record_t NDR; | ||
| 1244 | 		kern_return_t RetCode; | ||
| 1245 | 	} __Reply__mach_port_allocate_name_t __attribute__((unused)); | ||
| 1246 | #ifdef __MigPackStructs | ||
| 1247 | #pragma pack(pop) | ||
| 1248 | #endif | ||
| 1249 | |||
| 1250 | #ifdef __MigPackStructs | ||
| 1251 | #pragma pack(push, 4) | ||
| 1252 | #endif | ||
| 1253 | 	typedef struct { | ||
| 1254 | 		mach_msg_header_t Head; | ||
| 1255 | 		NDR_record_t NDR; | ||
| 1256 | 		kern_return_t RetCode; | ||
| 1257 | 		mach_port_name_t name; | ||
| 1258 | 	} __Reply__mach_port_allocate_t __attribute__((unused)); | ||
| 1259 | #ifdef __MigPackStructs | ||
| 1260 | #pragma pack(pop) | ||
| 1261 | #endif | ||
| 1262 | |||
| 1263 | #ifdef __MigPackStructs | ||
| 1264 | #pragma pack(push, 4) | ||
| 1265 | #endif | ||
| 1266 | 	typedef struct { | ||
| 1267 | 		mach_msg_header_t Head; | ||
| 1268 | 		NDR_record_t NDR; | ||
| 1269 | 		kern_return_t RetCode; | ||
| 1270 | 	} __Reply__mach_port_destroy_t __attribute__((unused)); | ||
| 1271 | #ifdef __MigPackStructs | ||
| 1272 | #pragma pack(pop) | ||
| 1273 | #endif | ||
| 1274 | |||
| 1275 | #ifdef __MigPackStructs | ||
| 1276 | #pragma pack(push, 4) | ||
| 1277 | #endif | ||
| 1278 | 	typedef struct { | ||
| 1279 | 		mach_msg_header_t Head; | ||
| 1280 | 		NDR_record_t NDR; | ||
| 1281 | 		kern_return_t RetCode; | ||
| 1282 | 	} __Reply__mach_port_deallocate_t __attribute__((unused)); | ||
| 1283 | #ifdef __MigPackStructs | ||
| 1284 | #pragma pack(pop) | ||
| 1285 | #endif | ||
| 1286 | |||
| 1287 | #ifdef __MigPackStructs | ||
| 1288 | #pragma pack(push, 4) | ||
| 1289 | #endif | ||
| 1290 | 	typedef struct { | ||
| 1291 | 		mach_msg_header_t Head; | ||
| 1292 | 		NDR_record_t NDR; | ||
| 1293 | 		kern_return_t RetCode; | ||
| 1294 | 		mach_port_urefs_t refs; | ||
| 1295 | 	} __Reply__mach_port_get_refs_t __attribute__((unused)); | ||
| 1296 | #ifdef __MigPackStructs | ||
| 1297 | #pragma pack(pop) | ||
| 1298 | #endif | ||
| 1299 | |||
| 1300 | #ifdef __MigPackStructs | ||
| 1301 | #pragma pack(push, 4) | ||
| 1302 | #endif | ||
| 1303 | 	typedef struct { | ||
| 1304 | 		mach_msg_header_t Head; | ||
| 1305 | 		NDR_record_t NDR; | ||
| 1306 | 		kern_return_t RetCode; | ||
| 1307 | 	} __Reply__mach_port_mod_refs_t __attribute__((unused)); | ||
| 1308 | #ifdef __MigPackStructs | ||
| 1309 | #pragma pack(pop) | ||
| 1310 | #endif | ||
| 1311 | |||
| 1312 | #ifdef __MigPackStructs | ||
| 1313 | #pragma pack(push, 4) | ||
| 1314 | #endif | ||
| 1315 | 	typedef struct { | ||
| 1316 | 		mach_msg_header_t Head; | ||
| 1317 | 		NDR_record_t NDR; | ||
| 1318 | 		kern_return_t RetCode; | ||
| 1319 | 		mach_port_seqno_t request_seqnop; | ||
| 1320 | 		mach_msg_size_t msg_sizep; | ||
| 1321 | 		mach_msg_id_t msg_idp; | ||
| 1322 | 		mach_msg_type_number_t trailer_infopCnt; | ||
| 1323 | 		char trailer_infop[68]; | ||
| 1324 | 	} __Reply__mach_port_peek_t __attribute__((unused)); | ||
| 1325 | #ifdef __MigPackStructs | ||
| 1326 | #pragma pack(pop) | ||
| 1327 | #endif | ||
| 1328 | |||
| 1329 | #ifdef __MigPackStructs | ||
| 1330 | #pragma pack(push, 4) | ||
| 1331 | #endif | ||
| 1332 | 	typedef struct { | ||
| 1333 | 		mach_msg_header_t Head; | ||
| 1334 | 		NDR_record_t NDR; | ||
| 1335 | 		kern_return_t RetCode; | ||
| 1336 | 	} __Reply__mach_port_set_mscount_t __attribute__((unused)); | ||
| 1337 | #ifdef __MigPackStructs | ||
| 1338 | #pragma pack(pop) | ||
| 1339 | #endif | ||
| 1340 | |||
| 1341 | #ifdef __MigPackStructs | ||
| 1342 | #pragma pack(push, 4) | ||
| 1343 | #endif | ||
| 1344 | 	typedef struct { | ||
| 1345 | 		mach_msg_header_t Head; | ||
| 1346 | 		/* start of the kernel processed data */ | ||
| 1347 | 		mach_msg_body_t msgh_body; | ||
| 1348 | 		mach_msg_ool_descriptor_t members; | ||
| 1349 | 		/* end of the kernel processed data */ | ||
| 1350 | 		NDR_record_t NDR; | ||
| 1351 | 		mach_msg_type_number_t membersCnt; | ||
| 1352 | 	} __Reply__mach_port_get_set_status_t __attribute__((unused)); | ||
| 1353 | #ifdef __MigPackStructs | ||
| 1354 | #pragma pack(pop) | ||
| 1355 | #endif | ||
| 1356 | |||
| 1357 | #ifdef __MigPackStructs | ||
| 1358 | #pragma pack(push, 4) | ||
| 1359 | #endif | ||
| 1360 | 	typedef struct { | ||
| 1361 | 		mach_msg_header_t Head; | ||
| 1362 | 		NDR_record_t NDR; | ||
| 1363 | 		kern_return_t RetCode; | ||
| 1364 | 	} __Reply__mach_port_move_member_t __attribute__((unused)); | ||
| 1365 | #ifdef __MigPackStructs | ||
| 1366 | #pragma pack(pop) | ||
| 1367 | #endif | ||
| 1368 | |||
| 1369 | #ifdef __MigPackStructs | ||
| 1370 | #pragma pack(push, 4) | ||
| 1371 | #endif | ||
| 1372 | 	typedef struct { | ||
| 1373 | 		mach_msg_header_t Head; | ||
| 1374 | 		/* start of the kernel processed data */ | ||
| 1375 | 		mach_msg_body_t msgh_body; | ||
| 1376 | 		mach_msg_port_descriptor_t previous; | ||
| 1377 | 		/* end of the kernel processed data */ | ||
| 1378 | 	} __Reply__mach_port_request_notification_t __attribute__((unused)); | ||
| 1379 | #ifdef __MigPackStructs | ||
| 1380 | #pragma pack(pop) | ||
| 1381 | #endif | ||
| 1382 | |||
| 1383 | #ifdef __MigPackStructs | ||
| 1384 | #pragma pack(push, 4) | ||
| 1385 | #endif | ||
| 1386 | 	typedef struct { | ||
| 1387 | 		mach_msg_header_t Head; | ||
| 1388 | 		NDR_record_t NDR; | ||
| 1389 | 		kern_return_t RetCode; | ||
| 1390 | 	} __Reply__mach_port_insert_right_t __attribute__((unused)); | ||
| 1391 | #ifdef __MigPackStructs | ||
| 1392 | #pragma pack(pop) | ||
| 1393 | #endif | ||
| 1394 | |||
| 1395 | #ifdef __MigPackStructs | ||
| 1396 | #pragma pack(push, 4) | ||
| 1397 | #endif | ||
| 1398 | 	typedef struct { | ||
| 1399 | 		mach_msg_header_t Head; | ||
| 1400 | 		/* start of the kernel processed data */ | ||
| 1401 | 		mach_msg_body_t msgh_body; | ||
| 1402 | 		mach_msg_port_descriptor_t poly; | ||
| 1403 | 		/* end of the kernel processed data */ | ||
| 1404 | 	} __Reply__mach_port_extract_right_t __attribute__((unused)); | ||
| 1405 | #ifdef __MigPackStructs | ||
| 1406 | #pragma pack(pop) | ||
| 1407 | #endif | ||
| 1408 | |||
| 1409 | #ifdef __MigPackStructs | ||
| 1410 | #pragma pack(push, 4) | ||
| 1411 | #endif | ||
| 1412 | 	typedef struct { | ||
| 1413 | 		mach_msg_header_t Head; | ||
| 1414 | 		NDR_record_t NDR; | ||
| 1415 | 		kern_return_t RetCode; | ||
| 1416 | 	} __Reply__mach_port_set_seqno_t __attribute__((unused)); | ||
| 1417 | #ifdef __MigPackStructs | ||
| 1418 | #pragma pack(pop) | ||
| 1419 | #endif | ||
| 1420 | |||
| 1421 | #ifdef __MigPackStructs | ||
| 1422 | #pragma pack(push, 4) | ||
| 1423 | #endif | ||
| 1424 | 	typedef struct { | ||
| 1425 | 		mach_msg_header_t Head; | ||
| 1426 | 		NDR_record_t NDR; | ||
| 1427 | 		kern_return_t RetCode; | ||
| 1428 | 		mach_msg_type_number_t port_info_outCnt; | ||
| 1429 | 		integer_t port_info_out[17]; | ||
| 1430 | 	} __Reply__mach_port_get_attributes_t __attribute__((unused)); | ||
| 1431 | #ifdef __MigPackStructs | ||
| 1432 | #pragma pack(pop) | ||
| 1433 | #endif | ||
| 1434 | |||
| 1435 | #ifdef __MigPackStructs | ||
| 1436 | #pragma pack(push, 4) | ||
| 1437 | #endif | ||
| 1438 | 	typedef struct { | ||
| 1439 | 		mach_msg_header_t Head; | ||
| 1440 | 		NDR_record_t NDR; | ||
| 1441 | 		kern_return_t RetCode; | ||
| 1442 | 	} __Reply__mach_port_set_attributes_t __attribute__((unused)); | ||
| 1443 | #ifdef __MigPackStructs | ||
| 1444 | #pragma pack(pop) | ||
| 1445 | #endif | ||
| 1446 | |||
| 1447 | #ifdef __MigPackStructs | ||
| 1448 | #pragma pack(push, 4) | ||
| 1449 | #endif | ||
| 1450 | 	typedef struct { | ||
| 1451 | 		mach_msg_header_t Head; | ||
| 1452 | 		NDR_record_t NDR; | ||
| 1453 | 		kern_return_t RetCode; | ||
| 1454 | 		mach_port_qos_t qos; | ||
| 1455 | 		mach_port_name_t name; | ||
| 1456 | 	} __Reply__mach_port_allocate_qos_t __attribute__((unused)); | ||
| 1457 | #ifdef __MigPackStructs | ||
| 1458 | #pragma pack(pop) | ||
| 1459 | #endif | ||
| 1460 | |||
| 1461 | #ifdef __MigPackStructs | ||
| 1462 | #pragma pack(push, 4) | ||
| 1463 | #endif | ||
| 1464 | 	typedef struct { | ||
| 1465 | 		mach_msg_header_t Head; | ||
| 1466 | 		NDR_record_t NDR; | ||
| 1467 | 		kern_return_t RetCode; | ||
| 1468 | 		mach_port_qos_t qos; | ||
| 1469 | 		mach_port_name_t name; | ||
| 1470 | 	} __Reply__mach_port_allocate_full_t __attribute__((unused)); | ||
| 1471 | #ifdef __MigPackStructs | ||
| 1472 | #pragma pack(pop) | ||
| 1473 | #endif | ||
| 1474 | |||
| 1475 | #ifdef __MigPackStructs | ||
| 1476 | #pragma pack(push, 4) | ||
| 1477 | #endif | ||
| 1478 | 	typedef struct { | ||
| 1479 | 		mach_msg_header_t Head; | ||
| 1480 | 		NDR_record_t NDR; | ||
| 1481 | 		kern_return_t RetCode; | ||
| 1482 | 	} __Reply__task_set_port_space_t __attribute__((unused)); | ||
| 1483 | #ifdef __MigPackStructs | ||
| 1484 | #pragma pack(pop) | ||
| 1485 | #endif | ||
| 1486 | |||
| 1487 | #ifdef __MigPackStructs | ||
| 1488 | #pragma pack(push, 4) | ||
| 1489 | #endif | ||
| 1490 | 	typedef struct { | ||
| 1491 | 		mach_msg_header_t Head; | ||
| 1492 | 		NDR_record_t NDR; | ||
| 1493 | 		kern_return_t RetCode; | ||
| 1494 | 		mach_port_rights_t srights; | ||
| 1495 | 	} __Reply__mach_port_get_srights_t __attribute__((unused)); | ||
| 1496 | #ifdef __MigPackStructs | ||
| 1497 | #pragma pack(pop) | ||
| 1498 | #endif | ||
| 1499 | |||
| 1500 | #ifdef __MigPackStructs | ||
| 1501 | #pragma pack(push, 4) | ||
| 1502 | #endif | ||
| 1503 | 	typedef struct { | ||
| 1504 | 		mach_msg_header_t Head; | ||
| 1505 | 		/* start of the kernel processed data */ | ||
| 1506 | 		mach_msg_body_t msgh_body; | ||
| 1507 | 		mach_msg_ool_descriptor_t table_info; | ||
| 1508 | 		mach_msg_ool_descriptor_t tree_info; | ||
| 1509 | 		/* end of the kernel processed data */ | ||
| 1510 | 		NDR_record_t NDR; | ||
| 1511 | 		ipc_info_space_t space_info; | ||
| 1512 | 		mach_msg_type_number_t table_infoCnt; | ||
| 1513 | 		mach_msg_type_number_t tree_infoCnt; | ||
| 1514 | 	} __Reply__mach_port_space_info_t __attribute__((unused)); | ||
| 1515 | #ifdef __MigPackStructs | ||
| 1516 | #pragma pack(pop) | ||
| 1517 | #endif | ||
| 1518 | |||
| 1519 | #ifdef __MigPackStructs | ||
| 1520 | #pragma pack(push, 4) | ||
| 1521 | #endif | ||
| 1522 | 	typedef struct { | ||
| 1523 | 		mach_msg_header_t Head; | ||
| 1524 | 		NDR_record_t NDR; | ||
| 1525 | 		kern_return_t RetCode; | ||
| 1526 | 		unsigned dnr_total; | ||
| 1527 | 		unsigned dnr_used; | ||
| 1528 | 	} __Reply__mach_port_dnrequest_info_t __attribute__((unused)); | ||
| 1529 | #ifdef __MigPackStructs | ||
| 1530 | #pragma pack(pop) | ||
| 1531 | #endif | ||
| 1532 | |||
| 1533 | #ifdef __MigPackStructs | ||
| 1534 | #pragma pack(push, 4) | ||
| 1535 | #endif | ||
| 1536 | 	typedef struct { | ||
| 1537 | 		mach_msg_header_t Head; | ||
| 1538 | 		NDR_record_t NDR; | ||
| 1539 | 		kern_return_t RetCode; | ||
| 1540 | 		unsigned object_type; | ||
| 1541 | 		unsigned object_addr; | ||
| 1542 | 	} __Reply__mach_port_kernel_object_t __attribute__((unused)); | ||
| 1543 | #ifdef __MigPackStructs | ||
| 1544 | #pragma pack(pop) | ||
| 1545 | #endif | ||
| 1546 | |||
| 1547 | #ifdef __MigPackStructs | ||
| 1548 | #pragma pack(push, 4) | ||
| 1549 | #endif | ||
| 1550 | 	typedef struct { | ||
| 1551 | 		mach_msg_header_t Head; | ||
| 1552 | 		NDR_record_t NDR; | ||
| 1553 | 		kern_return_t RetCode; | ||
| 1554 | 	} __Reply__mach_port_insert_member_t __attribute__((unused)); | ||
| 1555 | #ifdef __MigPackStructs | ||
| 1556 | #pragma pack(pop) | ||
| 1557 | #endif | ||
| 1558 | |||
| 1559 | #ifdef __MigPackStructs | ||
| 1560 | #pragma pack(push, 4) | ||
| 1561 | #endif | ||
| 1562 | 	typedef struct { | ||
| 1563 | 		mach_msg_header_t Head; | ||
| 1564 | 		NDR_record_t NDR; | ||
| 1565 | 		kern_return_t RetCode; | ||
| 1566 | 	} __Reply__mach_port_extract_member_t __attribute__((unused)); | ||
| 1567 | #ifdef __MigPackStructs | ||
| 1568 | #pragma pack(pop) | ||
| 1569 | #endif | ||
| 1570 | |||
| 1571 | #ifdef __MigPackStructs | ||
| 1572 | #pragma pack(push, 4) | ||
| 1573 | #endif | ||
| 1574 | 	typedef struct { | ||
| 1575 | 		mach_msg_header_t Head; | ||
| 1576 | 		NDR_record_t NDR; | ||
| 1577 | 		kern_return_t RetCode; | ||
| 1578 | 		mach_port_context_t context; | ||
| 1579 | 	} __Reply__mach_port_get_context_t __attribute__((unused)); | ||
| 1580 | #ifdef __MigPackStructs | ||
| 1581 | #pragma pack(pop) | ||
| 1582 | #endif | ||
| 1583 | |||
| 1584 | #ifdef __MigPackStructs | ||
| 1585 | #pragma pack(push, 4) | ||
| 1586 | #endif | ||
| 1587 | 	typedef struct { | ||
| 1588 | 		mach_msg_header_t Head; | ||
| 1589 | 		NDR_record_t NDR; | ||
| 1590 | 		kern_return_t RetCode; | ||
| 1591 | 	} __Reply__mach_port_set_context_t __attribute__((unused)); | ||
| 1592 | #ifdef __MigPackStructs | ||
| 1593 | #pragma pack(pop) | ||
| 1594 | #endif | ||
| 1595 | |||
| 1596 | #ifdef __MigPackStructs | ||
| 1597 | #pragma pack(push, 4) | ||
| 1598 | #endif | ||
| 1599 | 	typedef struct { | ||
| 1600 | 		mach_msg_header_t Head; | ||
| 1601 | 		NDR_record_t NDR; | ||
| 1602 | 		kern_return_t RetCode; | ||
| 1603 | 		natural_t object_type; | ||
| 1604 | 		mach_vm_address_t object_addr; | ||
| 1605 | 	} __Reply__mach_port_kobject_t __attribute__((unused)); | ||
| 1606 | #ifdef __MigPackStructs | ||
| 1607 | #pragma pack(pop) | ||
| 1608 | #endif | ||
| 1609 | |||
| 1610 | #ifdef __MigPackStructs | ||
| 1611 | #pragma pack(push, 4) | ||
| 1612 | #endif | ||
| 1613 | 	typedef struct { | ||
| 1614 | 		mach_msg_header_t Head; | ||
| 1615 | 		NDR_record_t NDR; | ||
| 1616 | 		kern_return_t RetCode; | ||
| 1617 | 		mach_port_name_t name; | ||
| 1618 | 	} __Reply__mach_port_construct_t __attribute__((unused)); | ||
| 1619 | #ifdef __MigPackStructs | ||
| 1620 | #pragma pack(pop) | ||
| 1621 | #endif | ||
| 1622 | |||
| 1623 | #ifdef __MigPackStructs | ||
| 1624 | #pragma pack(push, 4) | ||
| 1625 | #endif | ||
| 1626 | 	typedef struct { | ||
| 1627 | 		mach_msg_header_t Head; | ||
| 1628 | 		NDR_record_t NDR; | ||
| 1629 | 		kern_return_t RetCode; | ||
| 1630 | 	} __Reply__mach_port_destruct_t __attribute__((unused)); | ||
| 1631 | #ifdef __MigPackStructs | ||
| 1632 | #pragma pack(pop) | ||
| 1633 | #endif | ||
| 1634 | |||
| 1635 | #ifdef __MigPackStructs | ||
| 1636 | #pragma pack(push, 4) | ||
| 1637 | #endif | ||
| 1638 | 	typedef struct { | ||
| 1639 | 		mach_msg_header_t Head; | ||
| 1640 | 		NDR_record_t NDR; | ||
| 1641 | 		kern_return_t RetCode; | ||
| 1642 | 	} __Reply__mach_port_guard_t __attribute__((unused)); | ||
| 1643 | #ifdef __MigPackStructs | ||
| 1644 | #pragma pack(pop) | ||
| 1645 | #endif | ||
| 1646 | |||
| 1647 | #ifdef __MigPackStructs | ||
| 1648 | #pragma pack(push, 4) | ||
| 1649 | #endif | ||
| 1650 | 	typedef struct { | ||
| 1651 | 		mach_msg_header_t Head; | ||
| 1652 | 		NDR_record_t NDR; | ||
| 1653 | 		kern_return_t RetCode; | ||
| 1654 | 	} __Reply__mach_port_unguard_t __attribute__((unused)); | ||
| 1655 | #ifdef __MigPackStructs | ||
| 1656 | #pragma pack(pop) | ||
| 1657 | #endif | ||
| 1658 | |||
| 1659 | #ifdef __MigPackStructs | ||
| 1660 | #pragma pack(push, 4) | ||
| 1661 | #endif | ||
| 1662 | 	typedef struct { | ||
| 1663 | 		mach_msg_header_t Head; | ||
| 1664 | 		NDR_record_t NDR; | ||
| 1665 | 		kern_return_t RetCode; | ||
| 1666 | 		ipc_info_space_basic_t basic_info; | ||
| 1667 | 	} __Reply__mach_port_space_basic_info_t __attribute__((unused)); | ||
| 1668 | #ifdef __MigPackStructs | ||
| 1669 | #pragma pack(pop) | ||
| 1670 | #endif | ||
| 1671 | |||
| 1672 | #ifdef __MigPackStructs | ||
| 1673 | #pragma pack(push, 4) | ||
| 1674 | #endif | ||
| 1675 | 	typedef struct { | ||
| 1676 | 		mach_msg_header_t Head; | ||
| 1677 | 		NDR_record_t NDR; | ||
| 1678 | 		kern_return_t RetCode; | ||
| 1679 | 	} __Reply__mach_port_guard_with_flags_t __attribute__((unused)); | ||
| 1680 | #ifdef __MigPackStructs | ||
| 1681 | #pragma pack(pop) | ||
| 1682 | #endif | ||
| 1683 | |||
| 1684 | #ifdef __MigPackStructs | ||
| 1685 | #pragma pack(push, 4) | ||
| 1686 | #endif | ||
| 1687 | 	typedef struct { | ||
| 1688 | 		mach_msg_header_t Head; | ||
| 1689 | 		NDR_record_t NDR; | ||
| 1690 | 		kern_return_t RetCode; | ||
| 1691 | 	} __Reply__mach_port_swap_guard_t __attribute__((unused)); | ||
| 1692 | #ifdef __MigPackStructs | ||
| 1693 | #pragma pack(pop) | ||
| 1694 | #endif | ||
| 1695 | |||
| 1696 | #ifdef __MigPackStructs | ||
| 1697 | #pragma pack(push, 4) | ||
| 1698 | #endif | ||
| 1699 | 	typedef struct { | ||
| 1700 | 		mach_msg_header_t Head; | ||
| 1701 | 		NDR_record_t NDR; | ||
| 1702 | 		kern_return_t RetCode; | ||
| 1703 | 		natural_t object_type; | ||
| 1704 | 		mach_vm_address_t object_addr; | ||
| 1705 | 		mach_msg_type_number_t descriptionOffset; /* MiG doesn't use it */ | ||
| 1706 | 		mach_msg_type_number_t descriptionCnt; | ||
| 1707 | 		char description[512]; | ||
| 1708 | 	} __Reply__mach_port_kobject_description_t __attribute__((unused)); | ||
| 1709 | #ifdef __MigPackStructs | ||
| 1710 | #pragma pack(pop) | ||
| 1711 | #endif | ||
| 1712 | #endif /* !__Reply__mach_port_subsystem__defined */ | ||
| 1713 | |||
| 1714 | /* union of all replies */ | ||
| 1715 | |||
| 1716 | #ifndef __ReplyUnion__mach_port_subsystem__defined | ||
| 1717 | #define __ReplyUnion__mach_port_subsystem__defined | ||
| 1718 | union __ReplyUnion__mach_port_subsystem { | ||
| 1719 | 	__Reply__mach_port_names_t Reply_mach_port_names; | ||
| 1720 | 	__Reply__mach_port_type_t Reply_mach_port_type; | ||
| 1721 | 	__Reply__mach_port_rename_t Reply_mach_port_rename; | ||
| 1722 | 	__Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name; | ||
| 1723 | 	__Reply__mach_port_allocate_t Reply_mach_port_allocate; | ||
| 1724 | 	__Reply__mach_port_destroy_t Reply_mach_port_destroy; | ||
| 1725 | 	__Reply__mach_port_deallocate_t Reply_mach_port_deallocate; | ||
| 1726 | 	__Reply__mach_port_get_refs_t Reply_mach_port_get_refs; | ||
| 1727 | 	__Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs; | ||
| 1728 | 	__Reply__mach_port_peek_t Reply_mach_port_peek; | ||
| 1729 | 	__Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount; | ||
| 1730 | 	__Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status; | ||
| 1731 | 	__Reply__mach_port_move_member_t Reply_mach_port_move_member; | ||
| 1732 | 	__Reply__mach_port_request_notification_t Reply_mach_port_request_notification; | ||
| 1733 | 	__Reply__mach_port_insert_right_t Reply_mach_port_insert_right; | ||
| 1734 | 	__Reply__mach_port_extract_right_t Reply_mach_port_extract_right; | ||
| 1735 | 	__Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno; | ||
| 1736 | 	__Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes; | ||
| 1737 | 	__Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes; | ||
| 1738 | 	__Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos; | ||
| 1739 | 	__Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full; | ||
| 1740 | 	__Reply__task_set_port_space_t Reply_task_set_port_space; | ||
| 1741 | 	__Reply__mach_port_get_srights_t Reply_mach_port_get_srights; | ||
| 1742 | 	__Reply__mach_port_space_info_t Reply_mach_port_space_info; | ||
| 1743 | 	__Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info; | ||
| 1744 | 	__Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object; | ||
| 1745 | 	__Reply__mach_port_insert_member_t Reply_mach_port_insert_member; | ||
| 1746 | 	__Reply__mach_port_extract_member_t Reply_mach_port_extract_member; | ||
| 1747 | 	__Reply__mach_port_get_context_t Reply_mach_port_get_context; | ||
| 1748 | 	__Reply__mach_port_set_context_t Reply_mach_port_set_context; | ||
| 1749 | 	__Reply__mach_port_kobject_t Reply_mach_port_kobject; | ||
| 1750 | 	__Reply__mach_port_construct_t Reply_mach_port_construct; | ||
| 1751 | 	__Reply__mach_port_destruct_t Reply_mach_port_destruct; | ||
| 1752 | 	__Reply__mach_port_guard_t Reply_mach_port_guard; | ||
| 1753 | 	__Reply__mach_port_unguard_t Reply_mach_port_unguard; | ||
| 1754 | 	__Reply__mach_port_space_basic_info_t Reply_mach_port_space_basic_info; | ||
| 1755 | 	__Reply__mach_port_guard_with_flags_t Reply_mach_port_guard_with_flags; | ||
| 1756 | 	__Reply__mach_port_swap_guard_t Reply_mach_port_swap_guard; | ||
| 1757 | 	__Reply__mach_port_kobject_description_t Reply_mach_port_kobject_description; | ||
| 1758 | }; | ||
| 1759 | #endif /* !__RequestUnion__mach_port_subsystem__defined */ | ||
| 1760 | |||
| 1761 | #ifndef subsystem_to_name_map_mach_port | ||
| 1762 | #define subsystem_to_name_map_mach_port \ | ||
| 1763 | { "mach_port_names", 3200 },\ | ||
| 1764 | { "mach_port_type", 3201 },\ | ||
| 1765 | { "mach_port_rename", 3202 },\ | ||
| 1766 | { "mach_port_allocate_name", 3203 },\ | ||
| 1767 | { "mach_port_allocate", 3204 },\ | ||
| 1768 | { "mach_port_destroy", 3205 },\ | ||
| 1769 | { "mach_port_deallocate", 3206 },\ | ||
| 1770 | { "mach_port_get_refs", 3207 },\ | ||
| 1771 | { "mach_port_mod_refs", 3208 },\ | ||
| 1772 | { "mach_port_peek", 3209 },\ | ||
| 1773 | { "mach_port_set_mscount", 3210 },\ | ||
| 1774 | { "mach_port_get_set_status", 3211 },\ | ||
| 1775 | { "mach_port_move_member", 3212 },\ | ||
| 1776 | { "mach_port_request_notification", 3213 },\ | ||
| 1777 | { "mach_port_insert_right", 3214 },\ | ||
| 1778 | { "mach_port_extract_right", 3215 },\ | ||
| 1779 | { "mach_port_set_seqno", 3216 },\ | ||
| 1780 | { "mach_port_get_attributes", 3217 },\ | ||
| 1781 | { "mach_port_set_attributes", 3218 },\ | ||
| 1782 | { "mach_port_allocate_qos", 3219 },\ | ||
| 1783 | { "mach_port_allocate_full", 3220 },\ | ||
| 1784 | { "task_set_port_space", 3221 },\ | ||
| 1785 | { "mach_port_get_srights", 3222 },\ | ||
| 1786 | { "mach_port_space_info", 3223 },\ | ||
| 1787 | { "mach_port_dnrequest_info", 3224 },\ | ||
| 1788 | { "mach_port_kernel_object", 3225 },\ | ||
| 1789 | { "mach_port_insert_member", 3226 },\ | ||
| 1790 | { "mach_port_extract_member", 3227 },\ | ||
| 1791 | { "mach_port_get_context", 3228 },\ | ||
| 1792 | { "mach_port_set_context", 3229 },\ | ||
| 1793 | { "mach_port_kobject", 3230 },\ | ||
| 1794 | { "mach_port_construct", 3231 },\ | ||
| 1795 | { "mach_port_destruct", 3232 },\ | ||
| 1796 | { "mach_port_guard", 3233 },\ | ||
| 1797 | { "mach_port_unguard", 3234 },\ | ||
| 1798 | { "mach_port_space_basic_info", 3235 },\ | ||
| 1799 | { "mach_port_guard_with_flags", 3237 },\ | ||
| 1800 | { "mach_port_swap_guard", 3238 },\ | ||
| 1801 | { "mach_port_kobject_description", 3239 } | ||
| 1802 | #endif | ||
| 1803 | |||
| 1804 | #ifdef __AfterMigUserHeader | ||
| 1805 | __AfterMigUserHeader | ||
| 1806 | #endif /* __AfterMigUserHeader */ | ||
| 1807 | |||
| 1808 | #endif	 /* _mach_port_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h created+297| ... | @@ -0,0 +1,297 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2019 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	Definitions of general Mach system traps. | ||
| 60 | * | ||
| 61 | *	These are the definitions as seen from user-space. | ||
| 62 | *	The kernel definitions are in <mach/syscall_sw.h>. | ||
| 63 | *	Kernel RPC functions are defined in <mach/mach_interface.h>. | ||
| 64 | */ | ||
| 65 | |||
| 66 | #ifndef _MACH_MACH_TRAPS_H_ | ||
| 67 | #define _MACH_MACH_TRAPS_H_ | ||
| 68 | |||
| 69 | #include <stdint.h> | ||
| 70 | |||
| 71 | #include <mach/std_types.h> | ||
| 72 | #include <mach/mach_types.h> | ||
| 73 | #include <mach/kern_return.h> | ||
| 74 | #include <mach/port.h> | ||
| 75 | #include <mach/vm_types.h> | ||
| 76 | #include <mach/clock_types.h> | ||
| 77 | |||
| 78 | #include <machine/endian.h> | ||
| 79 | |||
| 80 | #include <sys/cdefs.h> | ||
| 81 | |||
| 82 | __BEGIN_DECLS | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | extern kern_return_t clock_sleep_trap( | ||
| 87 | 	mach_port_name_t clock_name, | ||
| 88 | 	sleep_type_t sleep_type, | ||
| 89 | 	int sleep_sec, | ||
| 90 | 	int sleep_nsec, | ||
| 91 | 	mach_timespec_t *wakeup_time); | ||
| 92 | |||
| 93 | extern kern_return_t _kernelrpc_mach_vm_allocate_trap( | ||
| 94 | 	mach_port_name_t target, | ||
| 95 | 	mach_vm_offset_t *addr, | ||
| 96 | 	mach_vm_size_t size, | ||
| 97 | 	int flags); | ||
| 98 | |||
| 99 | extern kern_return_t _kernelrpc_mach_vm_deallocate_trap( | ||
| 100 | 	mach_port_name_t target, | ||
| 101 | 	mach_vm_address_t address, | ||
| 102 | 	mach_vm_size_t size | ||
| 103 | 	); | ||
| 104 | |||
| 105 | extern kern_return_t _kernelrpc_mach_vm_protect_trap( | ||
| 106 | 	mach_port_name_t target, | ||
| 107 | 	mach_vm_address_t address, | ||
| 108 | 	mach_vm_size_t size, | ||
| 109 | 	boolean_t set_maximum, | ||
| 110 | 	vm_prot_t new_protection | ||
| 111 | 	); | ||
| 112 | |||
| 113 | extern kern_return_t _kernelrpc_mach_vm_map_trap( | ||
| 114 | 	mach_port_name_t target, | ||
| 115 | 	mach_vm_offset_t *address, | ||
| 116 | 	mach_vm_size_t size, | ||
| 117 | 	mach_vm_offset_t mask, | ||
| 118 | 	int flags, | ||
| 119 | 	vm_prot_t cur_protection | ||
| 120 | 	); | ||
| 121 | |||
| 122 | extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap( | ||
| 123 | 	mach_port_name_t target, | ||
| 124 | 	mach_vm_offset_t address, | ||
| 125 | 	vm_purgable_t control, | ||
| 126 | 	int *state); | ||
| 127 | |||
| 128 | extern kern_return_t _kernelrpc_mach_port_allocate_trap( | ||
| 129 | 	mach_port_name_t target, | ||
| 130 | 	mach_port_right_t right, | ||
| 131 | 	mach_port_name_t *name | ||
| 132 | 	); | ||
| 133 | |||
| 134 | extern kern_return_t _kernelrpc_mach_port_deallocate_trap( | ||
| 135 | 	mach_port_name_t target, | ||
| 136 | 	mach_port_name_t name | ||
| 137 | 	); | ||
| 138 | |||
| 139 | extern kern_return_t _kernelrpc_mach_port_mod_refs_trap( | ||
| 140 | 	mach_port_name_t target, | ||
| 141 | 	mach_port_name_t name, | ||
| 142 | 	mach_port_right_t right, | ||
| 143 | 	mach_port_delta_t delta | ||
| 144 | 	); | ||
| 145 | |||
| 146 | extern kern_return_t _kernelrpc_mach_port_move_member_trap( | ||
| 147 | 	mach_port_name_t target, | ||
| 148 | 	mach_port_name_t member, | ||
| 149 | 	mach_port_name_t after | ||
| 150 | 	); | ||
| 151 | |||
| 152 | extern kern_return_t _kernelrpc_mach_port_insert_right_trap( | ||
| 153 | 	mach_port_name_t target, | ||
| 154 | 	mach_port_name_t name, | ||
| 155 | 	mach_port_name_t poly, | ||
| 156 | 	mach_msg_type_name_t polyPoly | ||
| 157 | 	); | ||
| 158 | |||
| 159 | extern kern_return_t _kernelrpc_mach_port_get_attributes_trap( | ||
| 160 | 	mach_port_name_t target, | ||
| 161 | 	mach_port_name_t name, | ||
| 162 | 	mach_port_flavor_t flavor, | ||
| 163 | 	mach_port_info_t port_info_out, | ||
| 164 | 	mach_msg_type_number_t *port_info_outCnt | ||
| 165 | 	); | ||
| 166 | |||
| 167 | extern kern_return_t _kernelrpc_mach_port_insert_member_trap( | ||
| 168 | 	mach_port_name_t target, | ||
| 169 | 	mach_port_name_t name, | ||
| 170 | 	mach_port_name_t pset | ||
| 171 | 	); | ||
| 172 | |||
| 173 | extern kern_return_t _kernelrpc_mach_port_extract_member_trap( | ||
| 174 | 	mach_port_name_t target, | ||
| 175 | 	mach_port_name_t name, | ||
| 176 | 	mach_port_name_t pset | ||
| 177 | 	); | ||
| 178 | |||
| 179 | extern kern_return_t _kernelrpc_mach_port_construct_trap( | ||
| 180 | 	mach_port_name_t target, | ||
| 181 | 	mach_port_options_t *options, | ||
| 182 | 	uint64_t context, | ||
| 183 | 	mach_port_name_t *name | ||
| 184 | 	); | ||
| 185 | |||
| 186 | extern kern_return_t _kernelrpc_mach_port_destruct_trap( | ||
| 187 | 	mach_port_name_t target, | ||
| 188 | 	mach_port_name_t name, | ||
| 189 | 	mach_port_delta_t srdelta, | ||
| 190 | 	uint64_t guard | ||
| 191 | 	); | ||
| 192 | |||
| 193 | extern kern_return_t _kernelrpc_mach_port_guard_trap( | ||
| 194 | 	mach_port_name_t target, | ||
| 195 | 	mach_port_name_t name, | ||
| 196 | 	uint64_t guard, | ||
| 197 | 	boolean_t strict | ||
| 198 | 	); | ||
| 199 | |||
| 200 | extern kern_return_t _kernelrpc_mach_port_unguard_trap( | ||
| 201 | 	mach_port_name_t target, | ||
| 202 | 	mach_port_name_t name, | ||
| 203 | 	uint64_t guard | ||
| 204 | 	); | ||
| 205 | |||
| 206 | extern kern_return_t mach_generate_activity_id( | ||
| 207 | 	mach_port_name_t target, | ||
| 208 | 	int count, | ||
| 209 | 	uint64_t *activity_id | ||
| 210 | 	); | ||
| 211 | |||
| 212 | extern kern_return_t macx_swapon( | ||
| 213 | 	uint64_t filename, | ||
| 214 | 	int flags, | ||
| 215 | 	int size, | ||
| 216 | 	int priority); | ||
| 217 | |||
| 218 | extern kern_return_t macx_swapoff( | ||
| 219 | 	uint64_t filename, | ||
| 220 | 	int flags); | ||
| 221 | |||
| 222 | extern kern_return_t macx_triggers( | ||
| 223 | 	int hi_water, | ||
| 224 | 	int low_water, | ||
| 225 | 	int flags, | ||
| 226 | 	mach_port_t alert_port); | ||
| 227 | |||
| 228 | extern kern_return_t macx_backing_store_suspend( | ||
| 229 | 	boolean_t suspend); | ||
| 230 | |||
| 231 | extern kern_return_t macx_backing_store_recovery( | ||
| 232 | 	int pid); | ||
| 233 | |||
| 234 | extern boolean_t swtch_pri(int pri); | ||
| 235 | |||
| 236 | extern boolean_t swtch(void); | ||
| 237 | |||
| 238 | extern kern_return_t thread_switch( | ||
| 239 | 	mach_port_name_t thread_name, | ||
| 240 | 	int option, | ||
| 241 | 	mach_msg_timeout_t option_time); | ||
| 242 | |||
| 243 | extern mach_port_name_t task_self_trap(void); | ||
| 244 | |||
| 245 | extern kern_return_t host_create_mach_voucher_trap( | ||
| 246 | 	mach_port_name_t host, | ||
| 247 | 	mach_voucher_attr_raw_recipe_array_t recipes, | ||
| 248 | 	int recipes_size, | ||
| 249 | 	mach_port_name_t *voucher); | ||
| 250 | |||
| 251 | extern kern_return_t mach_voucher_extract_attr_recipe_trap( | ||
| 252 | 	mach_port_name_t voucher_name, | ||
| 253 | 	mach_voucher_attr_key_t key, | ||
| 254 | 	mach_voucher_attr_raw_recipe_t recipe, | ||
| 255 | 	mach_msg_type_number_t *recipe_size); | ||
| 256 | |||
| 257 | extern kern_return_t _kernelrpc_mach_port_type_trap( | ||
| 258 | 	ipc_space_t task, | ||
| 259 | 	mach_port_name_t name, | ||
| 260 | 	mach_port_type_t *ptype); | ||
| 261 | |||
| 262 | extern kern_return_t _kernelrpc_mach_port_request_notification_trap( | ||
| 263 | 	ipc_space_t task, | ||
| 264 | 	mach_port_name_t name, | ||
| 265 | 	mach_msg_id_t msgid, | ||
| 266 | 	mach_port_mscount_t sync, | ||
| 267 | 	mach_port_name_t notify, | ||
| 268 | 	mach_msg_type_name_t notifyPoly, | ||
| 269 | 	mach_port_name_t *previous); | ||
| 270 | |||
| 271 | /* | ||
| 272 | *	Obsolete interfaces. | ||
| 273 | */ | ||
| 274 | |||
| 275 | extern kern_return_t task_for_pid( | ||
| 276 | 	mach_port_name_t target_tport, | ||
| 277 | 	int pid, | ||
| 278 | 	mach_port_name_t *t); | ||
| 279 | |||
| 280 | extern kern_return_t task_name_for_pid( | ||
| 281 | 	mach_port_name_t target_tport, | ||
| 282 | 	int pid, | ||
| 283 | 	mach_port_name_t *tn); | ||
| 284 | |||
| 285 | extern kern_return_t pid_for_task( | ||
| 286 | 	mach_port_name_t t, | ||
| 287 | 	int *x); | ||
| 288 | |||
| 289 | extern kern_return_t debug_control_port_for_pid( | ||
| 290 | 	mach_port_name_t target_tport, | ||
| 291 | 	int pid, | ||
| 292 | 	mach_port_name_t *t); | ||
| 293 | |||
| 294 | |||
| 295 | __END_DECLS | ||
| 296 | |||
| 297 | #endif /* _MACH_MACH_TRAPS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_types.h created+283| ... | @@ -0,0 +1,283 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 60 | * support for mandatory and extensible security protections. This notice | ||
| 61 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 62 | * Version 2.0. | ||
| 63 | */ | ||
| 64 | /* | ||
| 65 | *	File:	mach/mach_types.h | ||
| 66 | *	Author:	Avadis Tevanian, Jr., Michael Wayne Young | ||
| 67 | *	Date:	1986 | ||
| 68 | * | ||
| 69 | *	Mach external interface definitions. | ||
| 70 | * | ||
| 71 | */ | ||
| 72 | |||
| 73 | #ifndef _MACH_MACH_TYPES_H_ | ||
| 74 | #define _MACH_MACH_TYPES_H_ | ||
| 75 | |||
| 76 | #include <stdint.h> | ||
| 77 | |||
| 78 | #include <sys/cdefs.h> | ||
| 79 | |||
| 80 | #include <mach/host_info.h> | ||
| 81 | #include <mach/host_notify.h> | ||
| 82 | #include <mach/host_special_ports.h> | ||
| 83 | #include <mach/machine.h> | ||
| 84 | #include <mach/machine/vm_types.h> | ||
| 85 | #include <mach/memory_object_types.h> | ||
| 86 | #include <mach/message.h> | ||
| 87 | #include <mach/exception_types.h> | ||
| 88 | #include <mach/port.h> | ||
| 89 | #include <mach/mach_voucher_types.h> | ||
| 90 | #include <mach/processor_info.h> | ||
| 91 | #include <mach/task_info.h> | ||
| 92 | #include <mach/task_inspect.h> | ||
| 93 | #include <mach/task_policy.h> | ||
| 94 | #include <mach/task_special_ports.h> | ||
| 95 | #include <mach/thread_info.h> | ||
| 96 | #include <mach/thread_policy.h> | ||
| 97 | #include <mach/thread_special_ports.h> | ||
| 98 | #include <mach/thread_status.h> | ||
| 99 | #include <mach/time_value.h> | ||
| 100 | #include <mach/clock_types.h> | ||
| 101 | #include <mach/vm_attributes.h> | ||
| 102 | #include <mach/vm_inherit.h> | ||
| 103 | #include <mach/vm_purgable.h> | ||
| 104 | #include <mach/vm_behavior.h> | ||
| 105 | #include <mach/vm_prot.h> | ||
| 106 | #include <mach/vm_statistics.h> | ||
| 107 | #include <mach/vm_sync.h> | ||
| 108 | #include <mach/vm_types.h> | ||
| 109 | #include <mach/vm_region.h> | ||
| 110 | #include <mach/kmod.h> | ||
| 111 | #include <mach/dyld_kernel.h> | ||
| 112 | |||
| 113 | |||
| 114 | /* | ||
| 115 | * If we are not in the kernel, then these will all be represented by | ||
| 116 | * ports at user-space. | ||
| 117 | */ | ||
| 118 | typedef mach_port_t task_t; | ||
| 119 | typedef mach_port_t task_name_t; | ||
| 120 | typedef mach_port_t task_policy_set_t; | ||
| 121 | typedef mach_port_t task_policy_get_t; | ||
| 122 | typedef mach_port_t task_inspect_t; | ||
| 123 | typedef mach_port_t task_read_t; | ||
| 124 | typedef mach_port_t task_suspension_token_t; | ||
| 125 | typedef mach_port_t thread_t; | ||
| 126 | typedef mach_port_t thread_act_t; | ||
| 127 | typedef mach_port_t thread_inspect_t; | ||
| 128 | typedef mach_port_t thread_read_t; | ||
| 129 | typedef mach_port_t ipc_space_t; | ||
| 130 | typedef mach_port_t ipc_space_read_t; | ||
| 131 | typedef mach_port_t ipc_space_inspect_t; | ||
| 132 | typedef mach_port_t coalition_t; | ||
| 133 | typedef mach_port_t host_t; | ||
| 134 | typedef mach_port_t host_priv_t; | ||
| 135 | typedef mach_port_t host_security_t; | ||
| 136 | typedef mach_port_t processor_t; | ||
| 137 | typedef mach_port_t processor_set_t; | ||
| 138 | typedef mach_port_t processor_set_control_t; | ||
| 139 | typedef mach_port_t semaphore_t; | ||
| 140 | typedef mach_port_t lock_set_t; | ||
| 141 | typedef mach_port_t ledger_t; | ||
| 142 | typedef mach_port_t alarm_t; | ||
| 143 | typedef mach_port_t clock_serv_t; | ||
| 144 | typedef mach_port_t clock_ctrl_t; | ||
| 145 | typedef mach_port_t arcade_register_t; | ||
| 146 | typedef mach_port_t ipc_eventlink_t; | ||
| 147 | typedef mach_port_t eventlink_port_pair_t[2]; | ||
| 148 | typedef mach_port_t suid_cred_t; | ||
| 149 | |||
| 150 | |||
| 151 | /* | ||
| 152 | * These aren't really unique types. They are just called | ||
| 153 | * out as unique types at one point in history. So we list | ||
| 154 | * them here for compatibility. | ||
| 155 | */ | ||
| 156 | typedef processor_set_t processor_set_name_t; | ||
| 157 | |||
| 158 | /* | ||
| 159 | * These types are just hard-coded as ports | ||
| 160 | */ | ||
| 161 | typedef mach_port_t clock_reply_t; | ||
| 162 | typedef mach_port_t bootstrap_t; | ||
| 163 | typedef mach_port_t mem_entry_name_port_t; | ||
| 164 | typedef mach_port_t exception_handler_t; | ||
| 165 | typedef exception_handler_t *exception_handler_array_t; | ||
| 166 | typedef mach_port_t vm_task_entry_t; | ||
| 167 | typedef mach_port_t io_master_t; | ||
| 168 | typedef mach_port_t UNDServerRef; | ||
| 169 | typedef mach_port_t mach_eventlink_t; | ||
| 170 | |||
| 171 | /* | ||
| 172 | * Mig doesn't translate the components of an array. | ||
| 173 | * For example, Mig won't use the thread_t translations | ||
| 174 | * to translate a thread_array_t argument. So, these definitions | ||
| 175 | * are not completely accurate at the moment for other kernel | ||
| 176 | * components. | ||
| 177 | */ | ||
| 178 | typedef task_t *task_array_t; | ||
| 179 | typedef thread_t *thread_array_t; | ||
| 180 | typedef processor_set_t *processor_set_array_t; | ||
| 181 | typedef processor_set_t *processor_set_name_array_t; | ||
| 182 | typedef processor_t *processor_array_t; | ||
| 183 | typedef thread_act_t *thread_act_array_t; | ||
| 184 | typedef ledger_t *ledger_array_t; | ||
| 185 | |||
| 186 | /* | ||
| 187 | * However the real mach_types got declared, we also have to declare | ||
| 188 | * types with "port" in the name for compatability with the way OSF | ||
| 189 | * had declared the user interfaces at one point. Someday these should | ||
| 190 | * go away. | ||
| 191 | */ | ||
| 192 | typedef task_t task_port_t; | ||
| 193 | typedef task_array_t task_port_array_t; | ||
| 194 | typedef thread_t thread_port_t; | ||
| 195 | typedef thread_array_t thread_port_array_t; | ||
| 196 | typedef ipc_space_t ipc_space_port_t; | ||
| 197 | typedef host_t host_name_t; | ||
| 198 | typedef host_t host_name_port_t; | ||
| 199 | typedef processor_set_t processor_set_port_t; | ||
| 200 | typedef processor_set_t processor_set_name_port_t; | ||
| 201 | typedef processor_set_array_t processor_set_name_port_array_t; | ||
| 202 | typedef processor_set_t processor_set_control_port_t; | ||
| 203 | typedef processor_t processor_port_t; | ||
| 204 | typedef processor_array_t processor_port_array_t; | ||
| 205 | typedef thread_act_t thread_act_port_t; | ||
| 206 | typedef thread_act_array_t thread_act_port_array_t; | ||
| 207 | typedef semaphore_t semaphore_port_t; | ||
| 208 | typedef lock_set_t lock_set_port_t; | ||
| 209 | typedef ledger_t ledger_port_t; | ||
| 210 | typedef ledger_array_t ledger_port_array_t; | ||
| 211 | typedef alarm_t alarm_port_t; | ||
| 212 | typedef clock_serv_t clock_serv_port_t; | ||
| 213 | typedef clock_ctrl_t clock_ctrl_port_t; | ||
| 214 | typedef exception_handler_t exception_port_t; | ||
| 215 | typedef exception_handler_array_t exception_port_arrary_t; | ||
| 216 | typedef char vfs_path_t[4096]; | ||
| 217 | typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */ | ||
| 218 | typedef char suid_cred_path_t[1024]; | ||
| 219 | typedef uint32_t suid_cred_uid_t; | ||
| 220 | |||
| 221 | #define TASK_NULL ((task_t) 0) | ||
| 222 | #define TASK_NAME_NULL ((task_name_t) 0) | ||
| 223 | #define TASK_INSPECT_NULL ((task_inspect_t) 0) | ||
| 224 | #define TASK_READ_NULL ((task_read_t) 0) | ||
| 225 | #define THREAD_NULL ((thread_t) 0) | ||
| 226 | #define THREAD_INSPECT_NULL ((thread_inspect_t) 0) | ||
| 227 | #define THREAD_READ_NULL ((thread_read_t) 0) | ||
| 228 | #define TID_NULL ((uint64_t) 0) | ||
| 229 | #define THR_ACT_NULL ((thread_act_t) 0) | ||
| 230 | #define IPC_SPACE_NULL ((ipc_space_t) 0) | ||
| 231 | #define IPC_SPACE_READ_NULL ((ipc_space_read_t) 0) | ||
| 232 | #define IPC_SPACE_INSPECT_NULL ((ipc_space_inspect_t) 0) | ||
| 233 | #define COALITION_NULL ((coalition_t) 0) | ||
| 234 | #define HOST_NULL ((host_t) 0) | ||
| 235 | #define HOST_PRIV_NULL ((host_priv_t) 0) | ||
| 236 | #define HOST_SECURITY_NULL ((host_security_t) 0) | ||
| 237 | #define PROCESSOR_SET_NULL ((processor_set_t) 0) | ||
| 238 | #define PROCESSOR_NULL ((processor_t) 0) | ||
| 239 | #define SEMAPHORE_NULL ((semaphore_t) 0) | ||
| 240 | #define LOCK_SET_NULL ((lock_set_t) 0) | ||
| 241 | #define LEDGER_NULL ((ledger_t) 0) | ||
| 242 | #define ALARM_NULL ((alarm_t) 0) | ||
| 243 | #define CLOCK_NULL ((clock_t) 0) | ||
| 244 | #define UND_SERVER_NULL ((UNDServerRef) 0) | ||
| 245 | #define ARCADE_REG_NULL ((arcade_register_t) 0) | ||
| 246 | #define MACH_EVENTLINK_NULL ((mach_eventlink_t) 0) | ||
| 247 | #define IPC_EVENTLINK_NULL ((ipc_eventlink_t) 0) | ||
| 248 | #define SUID_CRED_NULL ((suid_cred_t) 0) | ||
| 249 | |||
| 250 | /* capability strictly _DECREASING_. | ||
| 251 | * not ordered the other way around because we want TASK_FLAVOR_CONTROL | ||
| 252 | * to be closest to the itk_lock. see task.h. | ||
| 253 | */ | ||
| 254 | typedef unsigned int mach_task_flavor_t; | ||
| 255 | #define TASK_FLAVOR_CONTROL 0 /* a task_t */ | ||
| 256 | #define TASK_FLAVOR_READ 1 /* a task_read_t */ | ||
| 257 | #define TASK_FLAVOR_INSPECT 2 /* a task_inspect_t */ | ||
| 258 | #define TASK_FLAVOR_NAME 3 /* a task_name_t */ | ||
| 259 | |||
| 260 | /* capability strictly _DECREASING_ */ | ||
| 261 | typedef unsigned int mach_thread_flavor_t; | ||
| 262 | #define THREAD_FLAVOR_CONTROL 0 /* a thread_t */ | ||
| 263 | #define THREAD_FLAVOR_READ 1 /* a thread_read_t */ | ||
| 264 | #define THREAD_FLAVOR_INSPECT 2 /* a thread_inspect_t */ | ||
| 265 | |||
| 266 | /* DEPRECATED */ | ||
| 267 | typedef natural_t ledger_item_t; | ||
| 268 | #define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0)) | ||
| 269 | |||
| 270 | typedef int64_t ledger_amount_t; | ||
| 271 | #define LEDGER_LIMIT_INFINITY ((ledger_amount_t)((1ULL << 63) - 1)) | ||
| 272 | |||
| 273 | typedef mach_vm_offset_t *emulation_vector_t; | ||
| 274 | typedef char *user_subsystem_t; | ||
| 275 | |||
| 276 | typedef char *labelstr_t; | ||
| 277 | /* | ||
| 278 | *	Backwards compatibility, for those programs written | ||
| 279 | *	before mach/{std,mach}_types.{defs,h} were set up. | ||
| 280 | */ | ||
| 281 | #include <mach/std_types.h> | ||
| 282 | |||
| 283 | #endif /* _MACH_MACH_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mach_voucher_types.h created+245| ... | @@ -0,0 +1,245 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_VOUCHER_TYPES_H_ | ||
| 30 | #define _MACH_VOUCHER_TYPES_H_ | ||
| 31 | |||
| 32 | #include <mach/std_types.h> | ||
| 33 | #include <mach/port.h> | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Mach Voucher - an immutable collection of attribute value handles. | ||
| 37 | * | ||
| 38 | * The mach voucher is such that it can be passed between processes | ||
| 39 | * as a Mach port send right (by convention in the mach_msg_header_t’s | ||
| 40 | * msgh_voucher field). | ||
| 41 | * | ||
| 42 | * You may construct a new mach voucher by passing a construction | ||
| 43 | * recipe to host_create_mach_voucher(). The construction recipe supports | ||
| 44 | * generic commands for copying, removing, and redeeming attribute value | ||
| 45 | * handles from previous vouchers, or running attribute-mananger-specific | ||
| 46 | * commands within the recipe. | ||
| 47 | * | ||
| 48 | * Once the set of attribute value handles is constructed and returned, | ||
| 49 | * that set will not change for the life of the voucher (just because the | ||
| 50 | * attribute value handle itself doesn't change, the value the handle refers | ||
| 51 | * to is free to change at will). | ||
| 52 | */ | ||
| 53 | typedef mach_port_t mach_voucher_t; | ||
| 54 | #define MACH_VOUCHER_NULL ((mach_voucher_t) 0) | ||
| 55 | |||
| 56 | typedef mach_port_name_t mach_voucher_name_t; | ||
| 57 | #define MACH_VOUCHER_NAME_NULL ((mach_voucher_name_t) 0) | ||
| 58 | |||
| 59 | typedef mach_voucher_name_t *mach_voucher_name_array_t; | ||
| 60 | #define MACH_VOUCHER_NAME_ARRAY_NULL ((mach_voucher_name_array_t) 0) | ||
| 61 | |||
| 62 | /* | ||
| 63 | * This type changes appearance between user-space and kernel. It is | ||
| 64 | * a port at user-space and a reference to an ipc_voucher structure in-kernel. | ||
| 65 | */ | ||
| 66 | typedef mach_voucher_t ipc_voucher_t; | ||
| 67 | #define IPC_VOUCHER_NULL ((ipc_voucher_t) 0) | ||
| 68 | |||
| 69 | /* | ||
| 70 | * mach_voucher_selector_t - A means of specifying which thread/task value to extract - | ||
| 71 | * the current voucher set at this level, or a voucher representing | ||
| 72 | * the full [layered] effective value for the task/thread. | ||
| 73 | */ | ||
| 74 | typedef uint32_t mach_voucher_selector_t; | ||
| 75 | #define MACH_VOUCHER_SELECTOR_CURRENT ((mach_voucher_selector_t)0) | ||
| 76 | #define MACH_VOUCHER_SELECTOR_EFFECTIVE ((mach_voucher_selector_t)1) | ||
| 77 | |||
| 78 | |||
| 79 | /* | ||
| 80 | * mach_voucher_attr_key_t - The key used to identify a particular managed resource or | ||
| 81 | * to select the specific resource manager’s data associated | ||
| 82 | * with a given voucher. | ||
| 83 | */ | ||
| 84 | typedef uint32_t mach_voucher_attr_key_t; | ||
| 85 | typedef mach_voucher_attr_key_t *mach_voucher_attr_key_array_t; | ||
| 86 | |||
| 87 | #define MACH_VOUCHER_ATTR_KEY_ALL ((mach_voucher_attr_key_t)~0) | ||
| 88 | #define MACH_VOUCHER_ATTR_KEY_NONE ((mach_voucher_attr_key_t)0) | ||
| 89 | |||
| 90 | /* other well-known-keys will be added here */ | ||
| 91 | #define MACH_VOUCHER_ATTR_KEY_ATM ((mach_voucher_attr_key_t)1) | ||
| 92 | #define MACH_VOUCHER_ATTR_KEY_IMPORTANCE ((mach_voucher_attr_key_t)2) | ||
| 93 | #define MACH_VOUCHER_ATTR_KEY_BANK ((mach_voucher_attr_key_t)3) | ||
| 94 | #define MACH_VOUCHER_ATTR_KEY_PTHPRIORITY ((mach_voucher_attr_key_t)4) | ||
| 95 | |||
| 96 | #define MACH_VOUCHER_ATTR_KEY_USER_DATA ((mach_voucher_attr_key_t)7) | ||
| 97 | #define MACH_VOUCHER_ATTR_KEY_BITS MACH_VOUCHER_ATTR_KEY_USER_DATA /* deprecated */ | ||
| 98 | #define MACH_VOUCHER_ATTR_KEY_TEST ((mach_voucher_attr_key_t)8) | ||
| 99 | |||
| 100 | #define MACH_VOUCHER_ATTR_KEY_NUM_WELL_KNOWN MACH_VOUCHER_ATTR_KEY_TEST | ||
| 101 | |||
| 102 | /* | ||
| 103 | * mach_voucher_attr_content_t | ||
| 104 | * | ||
| 105 | * Data passed to a resource manager for modifying an attribute | ||
| 106 | * value or returned from the resource manager in response to a | ||
| 107 | * request to externalize the current value for that attribute. | ||
| 108 | */ | ||
| 109 | typedef uint8_t *mach_voucher_attr_content_t; | ||
| 110 | typedef uint32_t mach_voucher_attr_content_size_t; | ||
| 111 | |||
| 112 | /* | ||
| 113 | * mach_voucher_attr_command_t - The private verbs implemented by each voucher | ||
| 114 | * attribute manager via mach_voucher_attr_command(). | ||
| 115 | */ | ||
| 116 | typedef uint32_t mach_voucher_attr_command_t; | ||
| 117 | |||
| 118 | /* | ||
| 119 | * mach_voucher_attr_recipe_command_t | ||
| 120 | * | ||
| 121 | * The verbs used to create/morph a voucher attribute value. | ||
| 122 | * We define some system-wide commands here - related to creation, and transport of | ||
| 123 | * vouchers and attributes. Additional commands can be defined by, and supported by, | ||
| 124 | * individual attribute resource managers. | ||
| 125 | */ | ||
| 126 | typedef uint32_t mach_voucher_attr_recipe_command_t; | ||
| 127 | typedef mach_voucher_attr_recipe_command_t *mach_voucher_attr_recipe_command_array_t; | ||
| 128 | |||
| 129 | #define MACH_VOUCHER_ATTR_NOOP ((mach_voucher_attr_recipe_command_t)0) | ||
| 130 | #define MACH_VOUCHER_ATTR_COPY ((mach_voucher_attr_recipe_command_t)1) | ||
| 131 | #define MACH_VOUCHER_ATTR_REMOVE ((mach_voucher_attr_recipe_command_t)2) | ||
| 132 | #define MACH_VOUCHER_ATTR_SET_VALUE_HANDLE ((mach_voucher_attr_recipe_command_t)3) | ||
| 133 | #define MACH_VOUCHER_ATTR_AUTO_REDEEM ((mach_voucher_attr_recipe_command_t)4) | ||
| 134 | #define MACH_VOUCHER_ATTR_SEND_PREPROCESS ((mach_voucher_attr_recipe_command_t)5) | ||
| 135 | |||
| 136 | /* redeem is on its way out? */ | ||
| 137 | #define MACH_VOUCHER_ATTR_REDEEM ((mach_voucher_attr_recipe_command_t)10) | ||
| 138 | |||
| 139 | /* recipe command(s) for importance attribute manager */ | ||
| 140 | #define MACH_VOUCHER_ATTR_IMPORTANCE_SELF ((mach_voucher_attr_recipe_command_t)200) | ||
| 141 | |||
| 142 | /* recipe command(s) for bit-store attribute manager */ | ||
| 143 | #define MACH_VOUCHER_ATTR_USER_DATA_STORE ((mach_voucher_attr_recipe_command_t)211) | ||
| 144 | #define MACH_VOUCHER_ATTR_BITS_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE /* deprecated */ | ||
| 145 | |||
| 146 | /* recipe command(s) for test attribute manager */ | ||
| 147 | #define MACH_VOUCHER_ATTR_TEST_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE | ||
| 148 | |||
| 149 | /* | ||
| 150 | * mach_voucher_attr_recipe_t | ||
| 151 | * | ||
| 152 | * An element in a recipe list to create a voucher. | ||
| 153 | */ | ||
| 154 | #pragma pack(push, 1) | ||
| 155 | |||
| 156 | typedef struct mach_voucher_attr_recipe_data { | ||
| 157 | 	mach_voucher_attr_key_t key; | ||
| 158 | 	mach_voucher_attr_recipe_command_t command; | ||
| 159 | 	mach_voucher_name_t previous_voucher; | ||
| 160 | 	mach_voucher_attr_content_size_t content_size; | ||
| 161 | 	uint8_t content[]; | ||
| 162 | } mach_voucher_attr_recipe_data_t; | ||
| 163 | typedef mach_voucher_attr_recipe_data_t *mach_voucher_attr_recipe_t; | ||
| 164 | typedef mach_msg_type_number_t mach_voucher_attr_recipe_size_t; | ||
| 165 | |||
| 166 | /* Make the above palatable to MIG */ | ||
| 167 | typedef uint8_t *mach_voucher_attr_raw_recipe_t; | ||
| 168 | typedef mach_voucher_attr_raw_recipe_t mach_voucher_attr_raw_recipe_array_t; | ||
| 169 | typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_size_t; | ||
| 170 | typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_array_size_t; | ||
| 171 | |||
| 172 | #define MACH_VOUCHER_ATTR_MAX_RAW_RECIPE_ARRAY_SIZE 5120 | ||
| 173 | #define MACH_VOUCHER_TRAP_STACK_LIMIT 256 | ||
| 174 | |||
| 175 | #pragma pack(pop) | ||
| 176 | |||
| 177 | /* | ||
| 178 | * VOUCHER ATTRIBUTE MANAGER Writer types | ||
| 179 | */ | ||
| 180 | |||
| 181 | /* | ||
| 182 | * mach_voucher_attr_manager_t | ||
| 183 | * | ||
| 184 | * A handle through which the mach voucher mechanism communicates with the voucher | ||
| 185 | * attribute manager for a given attribute key. | ||
| 186 | */ | ||
| 187 | typedef mach_port_t mach_voucher_attr_manager_t; | ||
| 188 | #define MACH_VOUCHER_ATTR_MANAGER_NULL ((mach_voucher_attr_manager_t) 0) | ||
| 189 | |||
| 190 | /* | ||
| 191 | * mach_voucher_attr_control_t | ||
| 192 | * | ||
| 193 | * A handle provided to the voucher attribute manager for a given attribute key | ||
| 194 | * through which it makes inquiries or control operations of the mach voucher mechanism. | ||
| 195 | */ | ||
| 196 | typedef mach_port_t mach_voucher_attr_control_t; | ||
| 197 | #define MACH_VOUCHER_ATTR_CONTROL_NULL ((mach_voucher_attr_control_t) 0) | ||
| 198 | |||
| 199 | /* | ||
| 200 | * These types are different in-kernel vs user-space. They are ports in user-space, | ||
| 201 | * pointers to opaque structs in most of the kernel, and pointers to known struct | ||
| 202 | * types in the Mach portion of the kernel. | ||
| 203 | */ | ||
| 204 | typedef mach_port_t ipc_voucher_attr_manager_t; | ||
| 205 | typedef mach_port_t ipc_voucher_attr_control_t; | ||
| 206 | #define IPC_VOUCHER_ATTR_MANAGER_NULL ((ipc_voucher_attr_manager_t) 0) | ||
| 207 | #define IPC_VOUCHER_ATTR_CONTROL_NULL ((ipc_voucher_attr_control_t) 0) | ||
| 208 | |||
| 209 | /* | ||
| 210 | * mach_voucher_attr_value_handle_t | ||
| 211 | * | ||
| 212 | * The private handle that the voucher attribute manager provides to | ||
| 213 | * the mach voucher mechanism to represent a given attr content/value. | ||
| 214 | */ | ||
| 215 | typedef uint64_t mach_voucher_attr_value_handle_t; | ||
| 216 | typedef mach_voucher_attr_value_handle_t *mach_voucher_attr_value_handle_array_t; | ||
| 217 | |||
| 218 | typedef mach_msg_type_number_t mach_voucher_attr_value_handle_array_size_t; | ||
| 219 | #define MACH_VOUCHER_ATTR_VALUE_MAX_NESTED ((mach_voucher_attr_value_handle_array_size_t)4) | ||
| 220 | |||
| 221 | typedef uint32_t mach_voucher_attr_value_reference_t; | ||
| 222 | typedef uint32_t mach_voucher_attr_value_flags_t; | ||
| 223 | #define MACH_VOUCHER_ATTR_VALUE_FLAGS_NONE ((mach_voucher_attr_value_flags_t)0) | ||
| 224 | #define MACH_VOUCHER_ATTR_VALUE_FLAGS_PERSIST ((mach_voucher_attr_value_flags_t)1) | ||
| 225 | |||
| 226 | /* USE - TBD */ | ||
| 227 | typedef uint32_t mach_voucher_attr_control_flags_t; | ||
| 228 | #define MACH_VOUCHER_ATTR_CONTROL_FLAGS_NONE ((mach_voucher_attr_control_flags_t)0) | ||
| 229 | |||
| 230 | /* | ||
| 231 | * Commands and types for the IPC Importance Attribute Manager | ||
| 232 | * | ||
| 233 | * These are the valid mach_voucher_attr_command() options with the | ||
| 234 | * MACH_VOUCHER_ATTR_KEY_IMPORTANCE key. | ||
| 235 | */ | ||
| 236 | #define MACH_VOUCHER_IMPORTANCE_ATTR_ADD_EXTERNAL 1 /* Add some number of external refs (not supported) */ | ||
| 237 | #define MACH_VOUCHER_IMPORTANCE_ATTR_DROP_EXTERNAL 2 /* Drop some number of external refs */ | ||
| 238 | typedef uint32_t mach_voucher_attr_importance_refs; | ||
| 239 | |||
| 240 | /* | ||
| 241 | * Activity id Generation defines | ||
| 242 | */ | ||
| 243 | #define MACH_ACTIVITY_ID_COUNT_MAX 16 | ||
| 244 | |||
| 245 | #endif /* _MACH_VOUCHER_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine.h created+411| ... | @@ -0,0 +1,411 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2007-2016 Apple, Inc. All rights reserved. | ||
| 3 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 4 | * | ||
| 5 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 6 | * | ||
| 7 | * This file contains Original Code and/or Modifications of Original Code | ||
| 8 | * as defined in and that are subject to the Apple Public Source License | ||
| 9 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 10 | * compliance with the License. The rights granted to you under the License | ||
| 11 | * may not be used to create, or enable the creation or redistribution of, | ||
| 12 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 13 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 14 | * terms of an Apple operating system software license agreement. | ||
| 15 | * | ||
| 16 | * Please obtain a copy of the License at | ||
| 17 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 18 | * | ||
| 19 | * The Original Code and all software distributed under the License are | ||
| 20 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 21 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 22 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 23 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 24 | * Please see the License for the specific language governing rights and | ||
| 25 | * limitations under the License. | ||
| 26 | * | ||
| 27 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 28 | */ | ||
| 29 | /* | ||
| 30 | * Mach Operating System | ||
| 31 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 32 | * All Rights Reserved. | ||
| 33 | * | ||
| 34 | * Permission to use, copy, modify and distribute this software and its | ||
| 35 | * documentation is hereby granted, provided that both the copyright | ||
| 36 | * notice and this permission notice appear in all copies of the | ||
| 37 | * software, derivative works or modified versions, and any portions | ||
| 38 | * thereof, and that both notices appear in supporting documentation. | ||
| 39 | * | ||
| 40 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 41 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 42 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 43 | * | ||
| 44 | * Carnegie Mellon requests users of this software to return to | ||
| 45 | * | ||
| 46 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 47 | * School of Computer Science | ||
| 48 | * Carnegie Mellon University | ||
| 49 | * Pittsburgh PA 15213-3890 | ||
| 50 | * | ||
| 51 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 52 | * the rights to redistribute these changes. | ||
| 53 | */ | ||
| 54 | /*	File:	machine.h | ||
| 55 | *	Author:	Avadis Tevanian, Jr. | ||
| 56 | *	Date:	1986 | ||
| 57 | * | ||
| 58 | *	Machine independent machine abstraction. | ||
| 59 | */ | ||
| 60 | |||
| 61 | #ifndef _MACH_MACHINE_H_ | ||
| 62 | #define _MACH_MACHINE_H_ | ||
| 63 | |||
| 64 | #ifndef __ASSEMBLER__ | ||
| 65 | |||
| 66 | #include <stdint.h> | ||
| 67 | #include <mach/machine/vm_types.h> | ||
| 68 | #include <mach/boolean.h> | ||
| 69 | |||
| 70 | typedef integer_t cpu_type_t; | ||
| 71 | typedef integer_t cpu_subtype_t; | ||
| 72 | typedef integer_t cpu_threadtype_t; | ||
| 73 | |||
| 74 | #define CPU_STATE_MAX 4 | ||
| 75 | |||
| 76 | #define CPU_STATE_USER 0 | ||
| 77 | #define CPU_STATE_SYSTEM 1 | ||
| 78 | #define CPU_STATE_IDLE 2 | ||
| 79 | #define CPU_STATE_NICE 3 | ||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | /* | ||
| 84 | * Capability bits used in the definition of cpu_type. | ||
| 85 | */ | ||
| 86 | #define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */ | ||
| 87 | #define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */ | ||
| 88 | #define CPU_ARCH_ABI64_32 0x02000000 /* ABI for 64-bit hardware with 32-bit types; LP32 */ | ||
| 89 | |||
| 90 | /* | ||
| 91 | *	Machine types known by all. | ||
| 92 | */ | ||
| 93 | |||
| 94 | #define CPU_TYPE_ANY ((cpu_type_t) -1) | ||
| 95 | |||
| 96 | #define CPU_TYPE_VAX ((cpu_type_t) 1) | ||
| 97 | /* skip				((cpu_type_t) 2)	*/ | ||
| 98 | /* skip				((cpu_type_t) 3)	*/ | ||
| 99 | /* skip				((cpu_type_t) 4)	*/ | ||
| 100 | /* skip				((cpu_type_t) 5)	*/ | ||
| 101 | #define CPU_TYPE_MC680x0 ((cpu_type_t) 6) | ||
| 102 | #define CPU_TYPE_X86 ((cpu_type_t) 7) | ||
| 103 | #define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */ | ||
| 104 | #define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) | ||
| 105 | |||
| 106 | /* skip CPU_TYPE_MIPS		((cpu_type_t) 8)	*/ | ||
| 107 | /* skip ((cpu_type_t) 9)	*/ | ||
| 108 | #define CPU_TYPE_MC98000 ((cpu_type_t) 10) | ||
| 109 | #define CPU_TYPE_HPPA ((cpu_type_t) 11) | ||
| 110 | #define CPU_TYPE_ARM ((cpu_type_t) 12) | ||
| 111 | #define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) | ||
| 112 | #define CPU_TYPE_ARM64_32 (CPU_TYPE_ARM | CPU_ARCH_ABI64_32) | ||
| 113 | #define CPU_TYPE_MC88000 ((cpu_type_t) 13) | ||
| 114 | #define CPU_TYPE_SPARC ((cpu_type_t) 14) | ||
| 115 | #define CPU_TYPE_I860 ((cpu_type_t) 15) | ||
| 116 | /* skip	CPU_TYPE_ALPHA		((cpu_type_t) 16)	*/ | ||
| 117 | /* skip				((cpu_type_t) 17)	*/ | ||
| 118 | #define CPU_TYPE_POWERPC ((cpu_type_t) 18) | ||
| 119 | #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) | ||
| 120 | /* skip				((cpu_type_t) 19)	*/ | ||
| 121 | /* skip				((cpu_type_t) 20 */ | ||
| 122 | /* skip				((cpu_type_t) 21 */ | ||
| 123 | /* skip				((cpu_type_t) 22 */ | ||
| 124 | |||
| 125 | /* | ||
| 126 | *	Machine subtypes (these are defined here, instead of in a machine | ||
| 127 | *	dependent directory, so that any program can get all definitions | ||
| 128 | *	regardless of where is it compiled). | ||
| 129 | */ | ||
| 130 | |||
| 131 | /* | ||
| 132 | * Capability bits used in the definition of cpu_subtype. | ||
| 133 | */ | ||
| 134 | #define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */ | ||
| 135 | #define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */ | ||
| 136 | #define CPU_SUBTYPE_PTRAUTH_ABI 0x80000000 /* pointer authentication with versioned ABI */ | ||
| 137 | |||
| 138 | /* | ||
| 139 | * When selecting a slice, ANY will pick the slice with the best | ||
| 140 | * grading for the selected cpu_type_t, unlike the "ALL" subtypes, | ||
| 141 | * which are the slices that can run on any hardware for that cpu type. | ||
| 142 | */ | ||
| 143 | #define CPU_SUBTYPE_ANY ((cpu_subtype_t) -1) | ||
| 144 | |||
| 145 | /* | ||
| 146 | *	Object files that are hand-crafted to run on any | ||
| 147 | *	implementation of an architecture are tagged with | ||
| 148 | *	CPU_SUBTYPE_MULTIPLE. This functions essentially the same as | ||
| 149 | *	the "ALL" subtype of an architecture except that it allows us | ||
| 150 | *	to easily find object files that may need to be modified | ||
| 151 | *	whenever a new implementation of an architecture comes out. | ||
| 152 | * | ||
| 153 | *	It is the responsibility of the implementor to make sure the | ||
| 154 | *	software handles unsupported implementations elegantly. | ||
| 155 | */ | ||
| 156 | #define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1) | ||
| 157 | #define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0) | ||
| 158 | #define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1) | ||
| 159 | |||
| 160 | /* | ||
| 161 | * Machine threadtypes. | ||
| 162 | * This is none - not defined - for most machine types/subtypes. | ||
| 163 | */ | ||
| 164 | #define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0) | ||
| 165 | |||
| 166 | /* | ||
| 167 | *	VAX subtypes (these do *not* necessary conform to the actual cpu | ||
| 168 | *	ID assigned by DEC available via the SID register). | ||
| 169 | */ | ||
| 170 | |||
| 171 | #define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0) | ||
| 172 | #define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1) | ||
| 173 | #define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2) | ||
| 174 | #define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3) | ||
| 175 | #define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4) | ||
| 176 | #define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5) | ||
| 177 | #define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6) | ||
| 178 | #define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7) | ||
| 179 | #define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8) | ||
| 180 | #define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9) | ||
| 181 | #define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10) | ||
| 182 | #define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11) | ||
| 183 | #define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12) | ||
| 184 | |||
| 185 | /* | ||
| 186 | * 680x0 subtypes | ||
| 187 | * | ||
| 188 | * The subtype definitions here are unusual for historical reasons. | ||
| 189 | * NeXT used to consider 68030 code as generic 68000 code. For | ||
| 190 | * backwards compatability: | ||
| 191 | * | ||
| 192 | *	CPU_SUBTYPE_MC68030 symbol has been preserved for source code | ||
| 193 | *	compatability. | ||
| 194 | * | ||
| 195 | *	CPU_SUBTYPE_MC680x0_ALL has been defined to be the same | ||
| 196 | *	subtype as CPU_SUBTYPE_MC68030 for binary comatability. | ||
| 197 | * | ||
| 198 | *	CPU_SUBTYPE_MC68030_ONLY has been added to allow new object | ||
| 199 | *	files to be tagged as containing 68030-specific instructions. | ||
| 200 | */ | ||
| 201 | |||
| 202 | #define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1) | ||
| 203 | #define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */ | ||
| 204 | #define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2) | ||
| 205 | #define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3) | ||
| 206 | |||
| 207 | /* | ||
| 208 | *	I386 subtypes | ||
| 209 | */ | ||
| 210 | |||
| 211 | #define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4)) | ||
| 212 | |||
| 213 | #define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0) | ||
| 214 | #define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0) | ||
| 215 | #define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0) | ||
| 216 | #define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128 | ||
| 217 | #define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0) | ||
| 218 | #define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0) | ||
| 219 | #define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1) | ||
| 220 | #define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3) | ||
| 221 | #define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5) | ||
| 222 | #define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6) | ||
| 223 | #define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7) | ||
| 224 | #define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0) | ||
| 225 | #define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1) | ||
| 226 | #define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2) | ||
| 227 | #define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0) | ||
| 228 | #define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0) | ||
| 229 | #define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1) | ||
| 230 | #define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0) | ||
| 231 | #define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1) | ||
| 232 | #define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0) | ||
| 233 | #define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1) | ||
| 234 | |||
| 235 | #define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15) | ||
| 236 | #define CPU_SUBTYPE_INTEL_FAMILY_MAX 15 | ||
| 237 | |||
| 238 | #define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4) | ||
| 239 | #define CPU_SUBTYPE_INTEL_MODEL_ALL 0 | ||
| 240 | |||
| 241 | /* | ||
| 242 | *	X86 subtypes. | ||
| 243 | */ | ||
| 244 | |||
| 245 | #define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3) | ||
| 246 | #define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3) | ||
| 247 | #define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4) | ||
| 248 | #define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell feature subset */ | ||
| 249 | |||
| 250 | |||
| 251 | #define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1) | ||
| 252 | |||
| 253 | /* | ||
| 254 | *	Mips subtypes. | ||
| 255 | */ | ||
| 256 | |||
| 257 | #define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0) | ||
| 258 | #define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1) | ||
| 259 | #define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2) | ||
| 260 | #define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3) | ||
| 261 | #define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */ | ||
| 262 | #define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5) | ||
| 263 | #define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */ | ||
| 264 | #define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7) | ||
| 265 | |||
| 266 | /* | ||
| 267 | *	MC98000 (PowerPC) subtypes | ||
| 268 | */ | ||
| 269 | #define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0) | ||
| 270 | #define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1) | ||
| 271 | |||
| 272 | /* | ||
| 273 | *	HPPA subtypes for Hewlett-Packard HP-PA family of | ||
| 274 | *	risc processors. Port by NeXT to 700 series. | ||
| 275 | */ | ||
| 276 | |||
| 277 | #define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0) | ||
| 278 | #define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */ | ||
| 279 | #define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1) | ||
| 280 | |||
| 281 | /* | ||
| 282 | *	MC88000 subtypes. | ||
| 283 | */ | ||
| 284 | #define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0) | ||
| 285 | #define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1) | ||
| 286 | #define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2) | ||
| 287 | |||
| 288 | /* | ||
| 289 | *	SPARC subtypes | ||
| 290 | */ | ||
| 291 | #define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0) | ||
| 292 | |||
| 293 | /* | ||
| 294 | *	I860 subtypes | ||
| 295 | */ | ||
| 296 | #define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0) | ||
| 297 | #define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1) | ||
| 298 | |||
| 299 | /* | ||
| 300 | *	PowerPC subtypes | ||
| 301 | */ | ||
| 302 | #define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0) | ||
| 303 | #define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1) | ||
| 304 | #define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2) | ||
| 305 | #define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3) | ||
| 306 | #define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4) | ||
| 307 | #define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5) | ||
| 308 | #define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6) | ||
| 309 | #define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7) | ||
| 310 | #define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8) | ||
| 311 | #define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9) | ||
| 312 | #define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10) | ||
| 313 | #define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11) | ||
| 314 | #define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100) | ||
| 315 | |||
| 316 | /* | ||
| 317 | *	ARM subtypes | ||
| 318 | */ | ||
| 319 | #define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0) | ||
| 320 | #define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5) | ||
| 321 | #define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6) | ||
| 322 | #define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7) | ||
| 323 | #define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8) | ||
| 324 | #define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) /* ARMv7-A and ARMv7-R */ | ||
| 325 | #define CPU_SUBTYPE_ARM_V7F ((cpu_subtype_t) 10) /* Cortex A9 */ | ||
| 326 | #define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11) /* Swift */ | ||
| 327 | #define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t) 12) | ||
| 328 | #define CPU_SUBTYPE_ARM_V8 ((cpu_subtype_t) 13) | ||
| 329 | #define CPU_SUBTYPE_ARM_V6M ((cpu_subtype_t) 14) /* Not meant to be run under xnu */ | ||
| 330 | #define CPU_SUBTYPE_ARM_V7M ((cpu_subtype_t) 15) /* Not meant to be run under xnu */ | ||
| 331 | #define CPU_SUBTYPE_ARM_V7EM ((cpu_subtype_t) 16) /* Not meant to be run under xnu */ | ||
| 332 | #define CPU_SUBTYPE_ARM_V8M ((cpu_subtype_t) 17) /* Not meant to be run under xnu */ | ||
| 333 | |||
| 334 | /* | ||
| 335 | * ARM64 subtypes | ||
| 336 | */ | ||
| 337 | #define CPU_SUBTYPE_ARM64_ALL ((cpu_subtype_t) 0) | ||
| 338 | #define CPU_SUBTYPE_ARM64_V8 ((cpu_subtype_t) 1) | ||
| 339 | #define CPU_SUBTYPE_ARM64E ((cpu_subtype_t) 2) | ||
| 340 | |||
| 341 | /* CPU subtype feature flags for ptrauth on arm64e platforms */ | ||
| 342 | #define CPU_SUBTYPE_ARM64_PTR_AUTH_MASK 0x0f000000 | ||
| 343 | #define CPU_SUBTYPE_ARM64_PTR_AUTH_VERSION(x) (((x) & CPU_SUBTYPE_ARM64_PTR_AUTH_MASK) >> 24) | ||
| 344 | |||
| 345 | /* | ||
| 346 | * ARM64_32 subtypes | ||
| 347 | */ | ||
| 348 | #define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0) | ||
| 349 | #define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1) | ||
| 350 | |||
| 351 | #endif /* !__ASSEMBLER__ */ | ||
| 352 | |||
| 353 | /* | ||
| 354 | *	CPU families (sysctl hw.cpufamily) | ||
| 355 | * | ||
| 356 | * These are meant to identify the CPU's marketing name - an | ||
| 357 | * application can map these to (possibly) localized strings. | ||
| 358 | * NB: the encodings of the CPU families are intentionally arbitrary. | ||
| 359 | * There is no ordering, and you should never try to deduce whether | ||
| 360 | * or not some feature is available based on the family. | ||
| 361 | * Use feature flags (eg, hw.optional.altivec) to test for optional | ||
| 362 | * functionality. | ||
| 363 | */ | ||
| 364 | #define CPUFAMILY_UNKNOWN 0 | ||
| 365 | #define CPUFAMILY_POWERPC_G3 0xcee41549 | ||
| 366 | #define CPUFAMILY_POWERPC_G4 0x77c184ae | ||
| 367 | #define CPUFAMILY_POWERPC_G5 0xed76d8aa | ||
| 368 | #define CPUFAMILY_INTEL_6_13 0xaa33392b | ||
| 369 | #define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc | ||
| 370 | #define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2 | ||
| 371 | #define CPUFAMILY_INTEL_WESTMERE 0x573b5eec | ||
| 372 | #define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c | ||
| 373 | #define CPUFAMILY_INTEL_IVYBRIDGE 0x1f65e835 | ||
| 374 | #define CPUFAMILY_INTEL_HASWELL 0x10b282dc | ||
| 375 | #define CPUFAMILY_INTEL_BROADWELL 0x582ed09c | ||
| 376 | #define CPUFAMILY_INTEL_SKYLAKE 0x37fc219f | ||
| 377 | #define CPUFAMILY_INTEL_KABYLAKE 0x0f817246 | ||
| 378 | #define CPUFAMILY_INTEL_ICELAKE 0x38435547 | ||
| 379 | #if !defined(RC_HIDE_XNU_COMETLAKE) | ||
| 380 | #define CPUFAMILY_INTEL_COMETLAKE 0x1cf8a03e | ||
| 381 | #endif /* not RC_HIDE_XNU_COMETLAKE */ | ||
| 382 | #define CPUFAMILY_ARM_9 0xe73283ae | ||
| 383 | #define CPUFAMILY_ARM_11 0x8ff620d8 | ||
| 384 | #define CPUFAMILY_ARM_XSCALE 0x53b005f5 | ||
| 385 | #define CPUFAMILY_ARM_12 0xbd1b0ae9 | ||
| 386 | #define CPUFAMILY_ARM_13 0x0cc90e64 | ||
| 387 | #define CPUFAMILY_ARM_14 0x96077ef1 | ||
| 388 | #define CPUFAMILY_ARM_15 0xa8511bca | ||
| 389 | #define CPUFAMILY_ARM_SWIFT 0x1e2d6381 | ||
| 390 | #define CPUFAMILY_ARM_CYCLONE 0x37a09642 | ||
| 391 | #define CPUFAMILY_ARM_TYPHOON 0x2c91a47e | ||
| 392 | #define CPUFAMILY_ARM_TWISTER 0x92fb37c8 | ||
| 393 | #define CPUFAMILY_ARM_HURRICANE 0x67ceee93 | ||
| 394 | #define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6 | ||
| 395 | #define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f | ||
| 396 | #define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2 | ||
| 397 | #define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3 | ||
| 398 | |||
| 399 | #define CPUSUBFAMILY_UNKNOWN 0 | ||
| 400 | #define CPUSUBFAMILY_ARM_HP 1 | ||
| 401 | #define CPUSUBFAMILY_ARM_HG 2 | ||
| 402 | #define CPUSUBFAMILY_ARM_M 3 | ||
| 403 | #define CPUSUBFAMILY_ARM_HS 4 | ||
| 404 | #define CPUSUBFAMILY_ARM_HC_HD 5 | ||
| 405 | |||
| 406 | /* The following synonyms are deprecated: */ | ||
| 407 | #define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN | ||
| 408 | #define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM | ||
| 409 | |||
| 410 | |||
| 411 | #endif /* _MACH_MACHINE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h+2| ... | @@ -31,6 +31,8 @@ | ... | @@ -31,6 +31,8 @@ |
| 31 | 31 | ||
| 32 | #if defined (__i386__) || defined(__x86_64__) | 32 | #if defined (__i386__) || defined(__x86_64__) |
| 33 | #include "mach/i386/_structs.h" | 33 | #include "mach/i386/_structs.h" |
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/_structs.h" | ||
| 34 | #else | 36 | #else |
| 35 | #error architecture not supported | 37 | #error architecture not supported |
| 36 | #endif | 38 | #endif |
lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_BOOLEAN_H_ | ||
| 30 | #define _MACH_MACHINE_BOOLEAN_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/boolean.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/boolean.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_BOOLEAN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_EXCEPTION_H_ | ||
| 30 | #define _MACH_MACHINE_EXCEPTION_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/exception.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/exception.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_EXCEPTION_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_KERN_RETURN_H_ | ||
| 30 | #define _MACH_MACHINE_KERN_RETURN_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/kern_return.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/kern_return.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_KERN_RETURN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_PROCESSOR_INFO_H_ | ||
| 30 | #define _MACH_MACHINE_PROCESSOR_INFO_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/processor_info.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/processor_info.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_PROCESSOR_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_RPC_H_ | ||
| 30 | #define _MACH_MACHINE_RPC_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/rpc.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/rpc.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_RPC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_THREAD_STATE_H_ | ||
| 30 | #define _MACH_MACHINE_THREAD_STATE_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/thread_state.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/thread_state.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_THREAD_STATE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_THREAD_STATUS_H_ | ||
| 30 | #define _MACH_MACHINE_THREAD_STATUS_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/thread_status.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/thread_status.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_THREAD_STATUS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_VM_PARAM_H_ | ||
| 30 | #define _MACH_MACHINE_VM_PARAM_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/vm_param.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/vm_param.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_VM_PARAM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h created+40| ... | @@ -0,0 +1,40 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_MACHINE_VM_TYPES_H_ | ||
| 30 | #define _MACH_MACHINE_VM_TYPES_H_ | ||
| 31 | |||
| 32 | #if defined (__i386__) || defined(__x86_64__) | ||
| 33 | #include "mach/i386/vm_types.h" | ||
| 34 | #elif defined (__arm__) || defined (__arm64__) | ||
| 35 | #include "mach/arm/vm_types.h" | ||
| 36 | #else | ||
| 37 | #error architecture not supported | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif /* _MACH_MACHINE_VM_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/memory_object_types.h created+299| ... | @@ -0,0 +1,299 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	memory_object.h | ||
| 60 | *	Author:	Michael Wayne Young | ||
| 61 | * | ||
| 62 | *	External memory management interface definition. | ||
| 63 | */ | ||
| 64 | |||
| 65 | #ifndef _MACH_MEMORY_OBJECT_TYPES_H_ | ||
| 66 | #define _MACH_MEMORY_OBJECT_TYPES_H_ | ||
| 67 | |||
| 68 | /* | ||
| 69 | *	User-visible types used in the external memory | ||
| 70 | *	management interface: | ||
| 71 | */ | ||
| 72 | |||
| 73 | #include <mach/port.h> | ||
| 74 | #include <mach/message.h> | ||
| 75 | #include <mach/vm_prot.h> | ||
| 76 | #include <mach/vm_sync.h> | ||
| 77 | #include <mach/vm_types.h> | ||
| 78 | #include <mach/machine/vm_types.h> | ||
| 79 | |||
| 80 | #include <sys/cdefs.h> | ||
| 81 | |||
| 82 | #define VM_64_BIT_DATA_OBJECTS | ||
| 83 | |||
| 84 | typedef unsigned long long memory_object_offset_t; | ||
| 85 | typedef unsigned long long memory_object_size_t; | ||
| 86 | typedef natural_t memory_object_cluster_size_t; | ||
| 87 | typedef natural_t * memory_object_fault_info_t; | ||
| 88 | |||
| 89 | typedef unsigned long long vm_object_id_t; | ||
| 90 | |||
| 91 | |||
| 92 | /* | ||
| 93 | * Temporary until real EMMI version gets re-implemented | ||
| 94 | */ | ||
| 95 | |||
| 96 | |||
| 97 | typedef mach_port_t memory_object_t; | ||
| 98 | typedef mach_port_t memory_object_control_t; | ||
| 99 | |||
| 100 | |||
| 101 | typedef memory_object_t *memory_object_array_t; | ||
| 102 | /* A memory object ... */ | ||
| 103 | /* Used by the kernel to retrieve */ | ||
| 104 | /* or store data */ | ||
| 105 | |||
| 106 | typedef mach_port_t memory_object_name_t; | ||
| 107 | /* Used to describe the memory ... */ | ||
| 108 | /* object in vm_regions() calls */ | ||
| 109 | |||
| 110 | typedef mach_port_t memory_object_default_t; | ||
| 111 | /* Registered with the host ... */ | ||
| 112 | /* for creating new internal objects */ | ||
| 113 | |||
| 114 | #define MEMORY_OBJECT_NULL ((memory_object_t) 0) | ||
| 115 | #define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0) | ||
| 116 | #define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0) | ||
| 117 | #define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0) | ||
| 118 | |||
| 119 | |||
| 120 | typedef int memory_object_copy_strategy_t; | ||
| 121 | /* How memory manager handles copy: */ | ||
| 122 | #define MEMORY_OBJECT_COPY_NONE 0 | ||
| 123 | /* ... No special support */ | ||
| 124 | #define MEMORY_OBJECT_COPY_CALL 1 | ||
| 125 | /* ... Make call on memory manager */ | ||
| 126 | #define MEMORY_OBJECT_COPY_DELAY 2 | ||
| 127 | /* ... Memory manager doesn't | ||
| 128 | * change data externally. | ||
| 129 | */ | ||
| 130 | #define MEMORY_OBJECT_COPY_TEMPORARY 3 | ||
| 131 | /* ... Memory manager doesn't | ||
| 132 | * change data externally, and | ||
| 133 | * doesn't need to see changes. | ||
| 134 | */ | ||
| 135 | #define MEMORY_OBJECT_COPY_SYMMETRIC 4 | ||
| 136 | /* ... Memory manager doesn't | ||
| 137 | * change data externally, | ||
| 138 | * doesn't need to see changes, | ||
| 139 | * and object will not be | ||
| 140 | * multiply mapped. | ||
| 141 | * | ||
| 142 | * XXX | ||
| 143 | * Not yet safe for non-kernel use. | ||
| 144 | */ | ||
| 145 | |||
| 146 | #define MEMORY_OBJECT_COPY_INVALID 5 | ||
| 147 | /* ...	An invalid copy strategy, | ||
| 148 | *	for external objects which | ||
| 149 | *	have not been initialized. | ||
| 150 | *	Allows copy_strategy to be | ||
| 151 | *	examined without also | ||
| 152 | *	examining pager_ready and | ||
| 153 | *	internal. | ||
| 154 | */ | ||
| 155 | |||
| 156 | typedef int memory_object_return_t; | ||
| 157 | /* Which pages to return to manager | ||
| 158 | * this time (lock_request) */ | ||
| 159 | #define MEMORY_OBJECT_RETURN_NONE 0 | ||
| 160 | /* ... don't return any. */ | ||
| 161 | #define MEMORY_OBJECT_RETURN_DIRTY 1 | ||
| 162 | /* ... only dirty pages. */ | ||
| 163 | #define MEMORY_OBJECT_RETURN_ALL 2 | ||
| 164 | /* ... dirty and precious pages. */ | ||
| 165 | #define MEMORY_OBJECT_RETURN_ANYTHING 3 | ||
| 166 | /* ... any resident page. */ | ||
| 167 | |||
| 168 | /* | ||
| 169 | *	Data lock request flags | ||
| 170 | */ | ||
| 171 | |||
| 172 | #define MEMORY_OBJECT_DATA_FLUSH 0x1 | ||
| 173 | #define MEMORY_OBJECT_DATA_NO_CHANGE 0x2 | ||
| 174 | #define MEMORY_OBJECT_DATA_PURGE 0x4 | ||
| 175 | #define MEMORY_OBJECT_COPY_SYNC 0x8 | ||
| 176 | #define MEMORY_OBJECT_DATA_SYNC 0x10 | ||
| 177 | #define MEMORY_OBJECT_IO_SYNC 0x20 | ||
| 178 | #define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40 | ||
| 179 | |||
| 180 | /* | ||
| 181 | *	Types for the memory object flavor interfaces | ||
| 182 | */ | ||
| 183 | |||
| 184 | #define MEMORY_OBJECT_INFO_MAX (1024) | ||
| 185 | typedef int *memory_object_info_t; | ||
| 186 | typedef int memory_object_flavor_t; | ||
| 187 | typedef int memory_object_info_data_t[MEMORY_OBJECT_INFO_MAX]; | ||
| 188 | |||
| 189 | |||
| 190 | #define MEMORY_OBJECT_PERFORMANCE_INFO 11 | ||
| 191 | #define MEMORY_OBJECT_ATTRIBUTE_INFO 14 | ||
| 192 | #define MEMORY_OBJECT_BEHAVIOR_INFO 15 | ||
| 193 | |||
| 194 | |||
| 195 | struct memory_object_perf_info { | ||
| 196 | 	memory_object_cluster_size_t cluster_size; | ||
| 197 | 	boolean_t may_cache; | ||
| 198 | }; | ||
| 199 | |||
| 200 | struct memory_object_attr_info { | ||
| 201 | 	memory_object_copy_strategy_t copy_strategy; | ||
| 202 | 	memory_object_cluster_size_t cluster_size; | ||
| 203 | 	boolean_t may_cache_object; | ||
| 204 | 	boolean_t temporary; | ||
| 205 | }; | ||
| 206 | |||
| 207 | struct memory_object_behave_info { | ||
| 208 | 	memory_object_copy_strategy_t copy_strategy; | ||
| 209 | 	boolean_t temporary; | ||
| 210 | 	boolean_t invalidate; | ||
| 211 | 	boolean_t silent_overwrite; | ||
| 212 | 	boolean_t advisory_pageout; | ||
| 213 | }; | ||
| 214 | |||
| 215 | |||
| 216 | typedef struct memory_object_behave_info *memory_object_behave_info_t; | ||
| 217 | typedef struct memory_object_behave_info memory_object_behave_info_data_t; | ||
| 218 | |||
| 219 | typedef struct memory_object_perf_info *memory_object_perf_info_t; | ||
| 220 | typedef struct memory_object_perf_info memory_object_perf_info_data_t; | ||
| 221 | |||
| 222 | typedef struct memory_object_attr_info *memory_object_attr_info_t; | ||
| 223 | typedef struct memory_object_attr_info memory_object_attr_info_data_t; | ||
| 224 | |||
| 225 | #define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 226 | 	 (sizeof(memory_object_behave_info_data_t)/sizeof(int))) | ||
| 227 | #define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 228 | 	 (sizeof(memory_object_perf_info_data_t)/sizeof(int))) | ||
| 229 | #define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 230 | 	 (sizeof(memory_object_attr_info_data_t)/sizeof(int))) | ||
| 231 | |||
| 232 | #define invalid_memory_object_flavor(f) \ | ||
| 233 | 	(f != MEMORY_OBJECT_ATTRIBUTE_INFO && \ | ||
| 234 | 	 f != MEMORY_OBJECT_PERFORMANCE_INFO && \ | ||
| 235 | 	 f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && \ | ||
| 236 | 	 f != MEMORY_OBJECT_BEHAVIOR_INFO && \ | ||
| 237 | 	 f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO) | ||
| 238 | |||
| 239 | |||
| 240 | /* | ||
| 241 | * Used to support options on memory_object_release_name call | ||
| 242 | */ | ||
| 243 | #define MEMORY_OBJECT_TERMINATE_IDLE 0x1 | ||
| 244 | #define MEMORY_OBJECT_RESPECT_CACHE 0x2 | ||
| 245 | #define MEMORY_OBJECT_RELEASE_NO_OP 0x4 | ||
| 246 | |||
| 247 | |||
| 248 | /* named entry processor mapping options */ | ||
| 249 | /* enumerated */ | ||
| 250 | #define MAP_MEM_NOOP 0 | ||
| 251 | #define MAP_MEM_COPYBACK 1 | ||
| 252 | #define MAP_MEM_IO 2 | ||
| 253 | #define MAP_MEM_WTHRU 3 | ||
| 254 | #define MAP_MEM_WCOMB 4 /* Write combining mode */ | ||
| 255 | /* aka store gather */ | ||
| 256 | #define MAP_MEM_INNERWBACK 5 | ||
| 257 | #define MAP_MEM_POSTED 6 | ||
| 258 | #define MAP_MEM_RT 7 | ||
| 259 | #define MAP_MEM_POSTED_REORDERED 8 | ||
| 260 | #define MAP_MEM_POSTED_COMBINED_REORDERED 9 | ||
| 261 | |||
| 262 | #define GET_MAP_MEM(flags) \ | ||
| 263 | 	((((unsigned int)(flags)) >> 24) & 0xFF) | ||
| 264 | |||
| 265 | #define SET_MAP_MEM(caching, flags) \ | ||
| 266 | 	((flags) = ((((unsigned int)(caching)) << 24) \ | ||
| 267 | 	 & 0xFF000000) | ((flags) & 0xFFFFFF)); | ||
| 268 | |||
| 269 | /* leave room for vm_prot bits (0xFF ?) */ | ||
| 270 | #define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */ | ||
| 271 | #define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */ | ||
| 272 | #define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */ | ||
| 273 | #define MAP_MEM_ONLY 0x010000 /* change processor caching */ | ||
| 274 | #define MAP_MEM_NAMED_CREATE 0x020000 /* create extant object */ | ||
| 275 | #define MAP_MEM_PURGABLE 0x040000 /* create a purgable VM object */ | ||
| 276 | #define MAP_MEM_NAMED_REUSE 0x080000 /* reuse provided entry if identical */ | ||
| 277 | #define MAP_MEM_USE_DATA_ADDR 0x100000 /* preserve address of data, rather than base of page */ | ||
| 278 | #define MAP_MEM_VM_COPY 0x200000 /* make a copy of a VM range */ | ||
| 279 | #define MAP_MEM_VM_SHARE 0x400000 /* extract a VM range for remap */ | ||
| 280 | #define MAP_MEM_4K_DATA_ADDR 0x800000 /* preserve 4K aligned address of data */ | ||
| 281 | |||
| 282 | #define MAP_MEM_FLAGS_MASK 0x00FFFF00 | ||
| 283 | #define MAP_MEM_FLAGS_USER ( \ | ||
| 284 | 	MAP_MEM_PURGABLE_KERNEL_ONLY | \ | ||
| 285 | 	MAP_MEM_GRAB_SECLUDED | \ | ||
| 286 | 	MAP_MEM_ONLY | \ | ||
| 287 | 	MAP_MEM_NAMED_CREATE | \ | ||
| 288 | 	MAP_MEM_PURGABLE | \ | ||
| 289 | 	MAP_MEM_NAMED_REUSE | \ | ||
| 290 | 	MAP_MEM_USE_DATA_ADDR | \ | ||
| 291 | 	MAP_MEM_VM_COPY | \ | ||
| 292 | 	MAP_MEM_VM_SHARE | \ | ||
| 293 | 	MAP_MEM_LEDGER_TAGGED | \ | ||
| 294 | 	MAP_MEM_4K_DATA_ADDR) | ||
| 295 | #define MAP_MEM_FLAGS_ALL ( \ | ||
| 296 | 	MAP_MEM_FLAGS_USER) | ||
| 297 | |||
| 298 | |||
| 299 | #endif /* _MACH_MEMORY_OBJECT_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/message.h created+908| ... | @@ -0,0 +1,908 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | * NOTICE: This file was modified by McAfee Research in 2004 to introduce | ||
| 58 | * support for mandatory and extensible security protections. This notice | ||
| 59 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 60 | * Version 2.0. | ||
| 61 | * Copyright (c) 2005 SPARTA, Inc. | ||
| 62 | */ | ||
| 63 | /* | ||
| 64 | */ | ||
| 65 | /* | ||
| 66 | *	File:	mach/message.h | ||
| 67 | * | ||
| 68 | *	Mach IPC message and primitive function definitions. | ||
| 69 | */ | ||
| 70 | |||
| 71 | #ifndef _MACH_MESSAGE_H_ | ||
| 72 | #define _MACH_MESSAGE_H_ | ||
| 73 | |||
| 74 | #include <stdint.h> | ||
| 75 | #include <mach/port.h> | ||
| 76 | #include <mach/boolean.h> | ||
| 77 | #include <mach/kern_return.h> | ||
| 78 | #include <mach/machine/vm_types.h> | ||
| 79 | |||
| 80 | #include <sys/cdefs.h> | ||
| 81 | #include <sys/appleapiopts.h> | ||
| 82 | #include <Availability.h> | ||
| 83 | |||
| 84 | /* | ||
| 85 | * The timeout mechanism uses mach_msg_timeout_t values, | ||
| 86 | * passed by value. The timeout units are milliseconds. | ||
| 87 | * It is controlled with the MACH_SEND_TIMEOUT | ||
| 88 | * and MACH_RCV_TIMEOUT options. | ||
| 89 | */ | ||
| 90 | |||
| 91 | typedef natural_t mach_msg_timeout_t; | ||
| 92 | |||
| 93 | /* | ||
| 94 | * The value to be used when there is no timeout. | ||
| 95 | * (No MACH_SEND_TIMEOUT/MACH_RCV_TIMEOUT option.) | ||
| 96 | */ | ||
| 97 | |||
| 98 | #define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0) | ||
| 99 | |||
| 100 | /* | ||
| 101 | * The kernel uses MACH_MSGH_BITS_COMPLEX as a hint. If it isn't on, it | ||
| 102 | * assumes the body of the message doesn't contain port rights or OOL | ||
| 103 | * data. The field is set in received messages. A user task must | ||
| 104 | * use caution in interpreting the body of a message if the bit isn't | ||
| 105 | * on, because the mach_msg_type's in the body might "lie" about the | ||
| 106 | * contents. If the bit isn't on, but the mach_msg_types | ||
| 107 | * in the body specify rights or OOL data, the behavior is undefined. | ||
| 108 | * (Ie, an error may or may not be produced.) | ||
| 109 | * | ||
| 110 | * The value of MACH_MSGH_BITS_REMOTE determines the interpretation | ||
| 111 | * of the msgh_remote_port field. It is handled like a msgt_name, | ||
| 112 | * but must result in a send or send-once type right. | ||
| 113 | * | ||
| 114 | * The value of MACH_MSGH_BITS_LOCAL determines the interpretation | ||
| 115 | * of the msgh_local_port field. It is handled like a msgt_name, | ||
| 116 | * and also must result in a send or send-once type right. | ||
| 117 | * | ||
| 118 | * The value of MACH_MSGH_BITS_VOUCHER determines the interpretation | ||
| 119 | * of the msgh_voucher_port field. It is handled like a msgt_name, | ||
| 120 | * but must result in a send right (and the msgh_voucher_port field | ||
| 121 | * must be the name of a send right to a Mach voucher kernel object. | ||
| 122 | * | ||
| 123 | * MACH_MSGH_BITS() combines two MACH_MSG_TYPE_* values, for the remote | ||
| 124 | * and local fields, into a single value suitable for msgh_bits. | ||
| 125 | * | ||
| 126 | * MACH_MSGH_BITS_CIRCULAR should be zero; is is used internally. | ||
| 127 | * | ||
| 128 | * The unused bits should be zero and are reserved for the kernel | ||
| 129 | * or for future interface expansion. | ||
| 130 | */ | ||
| 131 | |||
| 132 | #define MACH_MSGH_BITS_ZERO 0x00000000 | ||
| 133 | |||
| 134 | #define MACH_MSGH_BITS_REMOTE_MASK 0x0000001f | ||
| 135 | #define MACH_MSGH_BITS_LOCAL_MASK 0x00001f00 | ||
| 136 | #define MACH_MSGH_BITS_VOUCHER_MASK 0x001f0000 | ||
| 137 | |||
| 138 | #define MACH_MSGH_BITS_PORTS_MASK \ | ||
| 139 | 	 (MACH_MSGH_BITS_REMOTE_MASK | \ | ||
| 140 | 	 MACH_MSGH_BITS_LOCAL_MASK | \ | ||
| 141 | 	 MACH_MSGH_BITS_VOUCHER_MASK) | ||
| 142 | |||
| 143 | #define MACH_MSGH_BITS_COMPLEX 0x80000000U /* message is complex */ | ||
| 144 | |||
| 145 | #define MACH_MSGH_BITS_USER 0x801f1f1fU /* allowed bits user->kernel */ | ||
| 146 | |||
| 147 | #define MACH_MSGH_BITS_RAISEIMP 0x20000000U /* importance raised due to msg */ | ||
| 148 | #define MACH_MSGH_BITS_DENAP MACH_MSGH_BITS_RAISEIMP | ||
| 149 | |||
| 150 | #define MACH_MSGH_BITS_IMPHOLDASRT 0x10000000U /* assertion help, userland private */ | ||
| 151 | #define MACH_MSGH_BITS_DENAPHOLDASRT MACH_MSGH_BITS_IMPHOLDASRT | ||
| 152 | |||
| 153 | #define MACH_MSGH_BITS_CIRCULAR 0x10000000U /* message circular, kernel private */ | ||
| 154 | |||
| 155 | #define MACH_MSGH_BITS_USED 0xb01f1f1fU | ||
| 156 | |||
| 157 | /* setter macros for the bits */ | ||
| 158 | #define MACH_MSGH_BITS(remote, local) /* legacy */ \ | ||
| 159 | 	 ((remote) | ((local) << 8)) | ||
| 160 | #define MACH_MSGH_BITS_SET_PORTS(remote, local, voucher) \ | ||
| 161 | 	(((remote) & MACH_MSGH_BITS_REMOTE_MASK) | \ | ||
| 162 | 	 (((local) << 8) & MACH_MSGH_BITS_LOCAL_MASK) | \ | ||
| 163 | 	 (((voucher) << 16) & MACH_MSGH_BITS_VOUCHER_MASK)) | ||
| 164 | #define MACH_MSGH_BITS_SET(remote, local, voucher, other) \ | ||
| 165 | 	(MACH_MSGH_BITS_SET_PORTS((remote), (local), (voucher)) \ | ||
| 166 | 	 | ((other) &~ MACH_MSGH_BITS_PORTS_MASK)) | ||
| 167 | |||
| 168 | /* getter macros for pulling values out of the bits field */ | ||
| 169 | #define MACH_MSGH_BITS_REMOTE(bits) \ | ||
| 170 | 	 ((bits) & MACH_MSGH_BITS_REMOTE_MASK) | ||
| 171 | #define MACH_MSGH_BITS_LOCAL(bits) \ | ||
| 172 | 	 (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8) | ||
| 173 | #define MACH_MSGH_BITS_VOUCHER(bits) \ | ||
| 174 | 	 (((bits) & MACH_MSGH_BITS_VOUCHER_MASK) >> 16) | ||
| 175 | #define MACH_MSGH_BITS_PORTS(bits) \ | ||
| 176 | 	((bits) & MACH_MSGH_BITS_PORTS_MASK) | ||
| 177 | #define MACH_MSGH_BITS_OTHER(bits) \ | ||
| 178 | 	 ((bits) &~ MACH_MSGH_BITS_PORTS_MASK) | ||
| 179 | |||
| 180 | /* checking macros */ | ||
| 181 | #define MACH_MSGH_BITS_HAS_REMOTE(bits) \ | ||
| 182 | 	(MACH_MSGH_BITS_REMOTE(bits) != MACH_MSGH_BITS_ZERO) | ||
| 183 | #define MACH_MSGH_BITS_HAS_LOCAL(bits) \ | ||
| 184 | 	(MACH_MSGH_BITS_LOCAL(bits) != MACH_MSGH_BITS_ZERO) | ||
| 185 | #define MACH_MSGH_BITS_HAS_VOUCHER(bits) \ | ||
| 186 | 	(MACH_MSGH_BITS_VOUCHER(bits) != MACH_MSGH_BITS_ZERO) | ||
| 187 | #define MACH_MSGH_BITS_IS_COMPLEX(bits) \ | ||
| 188 | 	(((bits) & MACH_MSGH_BITS_COMPLEX) != MACH_MSGH_BITS_ZERO) | ||
| 189 | |||
| 190 | /* importance checking macros */ | ||
| 191 | #define MACH_MSGH_BITS_RAISED_IMPORTANCE(bits) \ | ||
| 192 | 	(((bits) & MACH_MSGH_BITS_RAISEIMP) != MACH_MSGH_BITS_ZERO) | ||
| 193 | #define MACH_MSGH_BITS_HOLDS_IMPORTANCE_ASSERTION(bits) \ | ||
| 194 | 	(((bits) & MACH_MSGH_BITS_IMPHOLDASRT) != MACH_MSGH_BITS_ZERO) | ||
| 195 | |||
| 196 | /* | ||
| 197 | * Every message starts with a message header. | ||
| 198 | * Following the message header, if the message is complex, are a count | ||
| 199 | * of type descriptors and the type descriptors themselves | ||
| 200 | * (mach_msg_descriptor_t). The size of the message must be specified in | ||
| 201 | * bytes, and includes the message header, descriptor count, descriptors, | ||
| 202 | * and inline data. | ||
| 203 | * | ||
| 204 | * The msgh_remote_port field specifies the destination of the message. | ||
| 205 | * It must specify a valid send or send-once right for a port. | ||
| 206 | * | ||
| 207 | * The msgh_local_port field specifies a "reply port". Normally, | ||
| 208 | * This field carries a send-once right that the receiver will use | ||
| 209 | * to reply to the message. It may carry the values MACH_PORT_NULL, | ||
| 210 | * MACH_PORT_DEAD, a send-once right, or a send right. | ||
| 211 | * | ||
| 212 | * The msgh_voucher_port field specifies a Mach voucher port. Only | ||
| 213 | * send rights to kernel-implemented Mach Voucher kernel objects in | ||
| 214 | * addition to MACH_PORT_NULL or MACH_PORT_DEAD may be passed. | ||
| 215 | * | ||
| 216 | * The msgh_id field is uninterpreted by the message primitives. | ||
| 217 | * It normally carries information specifying the format | ||
| 218 | * or meaning of the message. | ||
| 219 | */ | ||
| 220 | |||
| 221 | typedef unsigned int mach_msg_bits_t; | ||
| 222 | typedef natural_t mach_msg_size_t; | ||
| 223 | typedef integer_t mach_msg_id_t; | ||
| 224 | |||
| 225 | #define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0 | ||
| 226 | |||
| 227 | typedef unsigned int mach_msg_priority_t; | ||
| 228 | |||
| 229 | #define MACH_MSG_PRIORITY_UNSPECIFIED (mach_msg_priority_t) 0 | ||
| 230 | |||
| 231 | |||
| 232 | typedef unsigned int mach_msg_type_name_t; | ||
| 233 | |||
| 234 | #define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive right */ | ||
| 235 | #define MACH_MSG_TYPE_MOVE_SEND 17 /* Must hold send right(s) */ | ||
| 236 | #define MACH_MSG_TYPE_MOVE_SEND_ONCE 18 /* Must hold sendonce right */ | ||
| 237 | #define MACH_MSG_TYPE_COPY_SEND 19 /* Must hold send right(s) */ | ||
| 238 | #define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive right */ | ||
| 239 | #define MACH_MSG_TYPE_MAKE_SEND_ONCE 21 /* Must hold receive right */ | ||
| 240 | #define MACH_MSG_TYPE_COPY_RECEIVE 22 /* NOT VALID */ | ||
| 241 | #define MACH_MSG_TYPE_DISPOSE_RECEIVE 24 /* must hold receive right */ | ||
| 242 | #define MACH_MSG_TYPE_DISPOSE_SEND 25 /* must hold send right(s) */ | ||
| 243 | #define MACH_MSG_TYPE_DISPOSE_SEND_ONCE 26 /* must hold sendonce right */ | ||
| 244 | |||
| 245 | typedef unsigned int mach_msg_copy_options_t; | ||
| 246 | |||
| 247 | #define MACH_MSG_PHYSICAL_COPY 0 | ||
| 248 | #define MACH_MSG_VIRTUAL_COPY 1 | ||
| 249 | #define MACH_MSG_ALLOCATE 2 | ||
| 250 | #define MACH_MSG_OVERWRITE 3 /* deprecated */ | ||
| 251 | #ifdef MACH_KERNEL | ||
| 252 | #define MACH_MSG_KALLOC_COPY_T 4 | ||
| 253 | #endif /* MACH_KERNEL */ | ||
| 254 | |||
| 255 | #define MACH_MSG_GUARD_FLAGS_NONE 0x0000 | ||
| 256 | #define MACH_MSG_GUARD_FLAGS_IMMOVABLE_RECEIVE 0x0001 /* Move the receive right and mark it as immovable */ | ||
| 257 | #define MACH_MSG_GUARD_FLAGS_UNGUARDED_ON_SEND 0x0002 /* Verify that the port is unguarded */ | ||
| 258 | #define MACH_MSG_GUARD_FLAGS_MASK 0x0003 /* Valid flag bits */ | ||
| 259 | typedef unsigned int mach_msg_guard_flags_t; | ||
| 260 | |||
| 261 | /* | ||
| 262 | * In a complex mach message, the mach_msg_header_t is followed by | ||
| 263 | * a descriptor count, then an array of that number of descriptors | ||
| 264 | * (mach_msg_*_descriptor_t). The type field of mach_msg_type_descriptor_t | ||
| 265 | * (which any descriptor can be cast to) indicates the flavor of the | ||
| 266 | * descriptor. | ||
| 267 | * | ||
| 268 | * Note that in LP64, the various types of descriptors are no longer all | ||
| 269 | * the same size as mach_msg_descriptor_t, so the array cannot be indexed | ||
| 270 | * as expected. | ||
| 271 | */ | ||
| 272 | |||
| 273 | typedef unsigned int mach_msg_descriptor_type_t; | ||
| 274 | |||
| 275 | #define MACH_MSG_PORT_DESCRIPTOR 0 | ||
| 276 | #define MACH_MSG_OOL_DESCRIPTOR 1 | ||
| 277 | #define MACH_MSG_OOL_PORTS_DESCRIPTOR 2 | ||
| 278 | #define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3 | ||
| 279 | #define MACH_MSG_GUARDED_PORT_DESCRIPTOR 4 | ||
| 280 | |||
| 281 | #pragma pack(push, 4) | ||
| 282 | |||
| 283 | typedef struct{ | ||
| 284 | 	natural_t pad1; | ||
| 285 | 	mach_msg_size_t pad2; | ||
| 286 | 	unsigned int pad3 : 24; | ||
| 287 | 	mach_msg_descriptor_type_t type : 8; | ||
| 288 | } mach_msg_type_descriptor_t; | ||
| 289 | |||
| 290 | typedef struct{ | ||
| 291 | 	mach_port_t name; | ||
| 292 | // Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes | ||
| 293 | 	mach_msg_size_t pad1; | ||
| 294 | 	unsigned int pad2 : 16; | ||
| 295 | 	mach_msg_type_name_t disposition : 8; | ||
| 296 | 	mach_msg_descriptor_type_t type : 8; | ||
| 297 | } mach_msg_port_descriptor_t; | ||
| 298 | |||
| 299 | typedef struct{ | ||
| 300 | 	uint32_t address; | ||
| 301 | 	mach_msg_size_t size; | ||
| 302 | 	boolean_t deallocate: 8; | ||
| 303 | 	mach_msg_copy_options_t copy: 8; | ||
| 304 | 	unsigned int pad1: 8; | ||
| 305 | 	mach_msg_descriptor_type_t type: 8; | ||
| 306 | } mach_msg_ool_descriptor32_t; | ||
| 307 | |||
| 308 | typedef struct{ | ||
| 309 | 	uint64_t address; | ||
| 310 | 	boolean_t deallocate: 8; | ||
| 311 | 	mach_msg_copy_options_t copy: 8; | ||
| 312 | 	unsigned int pad1: 8; | ||
| 313 | 	mach_msg_descriptor_type_t type: 8; | ||
| 314 | 	mach_msg_size_t size; | ||
| 315 | } mach_msg_ool_descriptor64_t; | ||
| 316 | |||
| 317 | typedef struct{ | ||
| 318 | 	void* address; | ||
| 319 | #if !defined(__LP64__) | ||
| 320 | 	mach_msg_size_t size; | ||
| 321 | #endif | ||
| 322 | 	boolean_t deallocate: 8; | ||
| 323 | 	mach_msg_copy_options_t copy: 8; | ||
| 324 | 	unsigned int pad1: 8; | ||
| 325 | 	mach_msg_descriptor_type_t type: 8; | ||
| 326 | #if defined(__LP64__) | ||
| 327 | 	mach_msg_size_t size; | ||
| 328 | #endif | ||
| 329 | } mach_msg_ool_descriptor_t; | ||
| 330 | |||
| 331 | typedef struct{ | ||
| 332 | 	uint32_t address; | ||
| 333 | 	mach_msg_size_t count; | ||
| 334 | 	boolean_t deallocate: 8; | ||
| 335 | 	mach_msg_copy_options_t copy: 8; | ||
| 336 | 	mach_msg_type_name_t disposition : 8; | ||
| 337 | 	mach_msg_descriptor_type_t type : 8; | ||
| 338 | } mach_msg_ool_ports_descriptor32_t; | ||
| 339 | |||
| 340 | typedef struct{ | ||
| 341 | 	uint64_t address; | ||
| 342 | 	boolean_t deallocate: 8; | ||
| 343 | 	mach_msg_copy_options_t copy: 8; | ||
| 344 | 	mach_msg_type_name_t disposition : 8; | ||
| 345 | 	mach_msg_descriptor_type_t type : 8; | ||
| 346 | 	mach_msg_size_t count; | ||
| 347 | } mach_msg_ool_ports_descriptor64_t; | ||
| 348 | |||
| 349 | typedef struct{ | ||
| 350 | 	void* address; | ||
| 351 | #if !defined(__LP64__) | ||
| 352 | 	mach_msg_size_t count; | ||
| 353 | #endif | ||
| 354 | 	boolean_t deallocate: 8; | ||
| 355 | 	mach_msg_copy_options_t copy: 8; | ||
| 356 | 	mach_msg_type_name_t disposition : 8; | ||
| 357 | 	mach_msg_descriptor_type_t type : 8; | ||
| 358 | #if defined(__LP64__) | ||
| 359 | 	mach_msg_size_t count; | ||
| 360 | #endif | ||
| 361 | } mach_msg_ool_ports_descriptor_t; | ||
| 362 | |||
| 363 | typedef struct{ | ||
| 364 | 	uint32_t context; | ||
| 365 | 	mach_port_name_t name; | ||
| 366 | 	mach_msg_guard_flags_t flags : 16; | ||
| 367 | 	mach_msg_type_name_t disposition : 8; | ||
| 368 | 	mach_msg_descriptor_type_t type : 8; | ||
| 369 | } mach_msg_guarded_port_descriptor32_t; | ||
| 370 | |||
| 371 | typedef struct{ | ||
| 372 | 	uint64_t context; | ||
| 373 | 	mach_msg_guard_flags_t flags : 16; | ||
| 374 | 	mach_msg_type_name_t disposition : 8; | ||
| 375 | 	mach_msg_descriptor_type_t type : 8; | ||
| 376 | 	mach_port_name_t name; | ||
| 377 | } mach_msg_guarded_port_descriptor64_t; | ||
| 378 | |||
| 379 | typedef struct{ | ||
| 380 | 	mach_port_context_t context; | ||
| 381 | #if !defined(__LP64__) | ||
| 382 | 	mach_port_name_t name; | ||
| 383 | #endif | ||
| 384 | 	mach_msg_guard_flags_t flags : 16; | ||
| 385 | 	mach_msg_type_name_t disposition : 8; | ||
| 386 | 	mach_msg_descriptor_type_t type : 8; | ||
| 387 | #if defined(__LP64__) | ||
| 388 | 	mach_port_name_t name; | ||
| 389 | #endif /* defined(__LP64__) */ | ||
| 390 | } mach_msg_guarded_port_descriptor_t; | ||
| 391 | |||
| 392 | /* | ||
| 393 | * LP64support - This union definition is not really | ||
| 394 | * appropriate in LP64 mode because not all descriptors | ||
| 395 | * are of the same size in that environment. | ||
| 396 | */ | ||
| 397 | typedef union{ | ||
| 398 | 	mach_msg_port_descriptor_t port; | ||
| 399 | 	mach_msg_ool_descriptor_t out_of_line; | ||
| 400 | 	mach_msg_ool_ports_descriptor_t ool_ports; | ||
| 401 | 	mach_msg_type_descriptor_t type; | ||
| 402 | 	mach_msg_guarded_port_descriptor_t guarded_port; | ||
| 403 | } mach_msg_descriptor_t; | ||
| 404 | |||
| 405 | typedef struct{ | ||
| 406 | 	mach_msg_size_t msgh_descriptor_count; | ||
| 407 | } mach_msg_body_t; | ||
| 408 | |||
| 409 | #define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0 | ||
| 410 | #define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0 | ||
| 411 | |||
| 412 | typedef struct{ | ||
| 413 | 	mach_msg_bits_t msgh_bits; | ||
| 414 | 	mach_msg_size_t msgh_size; | ||
| 415 | 	mach_port_t msgh_remote_port; | ||
| 416 | 	mach_port_t msgh_local_port; | ||
| 417 | 	mach_port_name_t msgh_voucher_port; | ||
| 418 | 	mach_msg_id_t msgh_id; | ||
| 419 | } mach_msg_header_t; | ||
| 420 | |||
| 421 | #define msgh_reserved msgh_voucher_port | ||
| 422 | #define MACH_MSG_NULL (mach_msg_header_t *) 0 | ||
| 423 | |||
| 424 | typedef struct{ | ||
| 425 | 	mach_msg_header_t header; | ||
| 426 | 	mach_msg_body_t body; | ||
| 427 | } mach_msg_base_t; | ||
| 428 | |||
| 429 | typedef unsigned int mach_msg_trailer_type_t; | ||
| 430 | |||
| 431 | #define MACH_MSG_TRAILER_FORMAT_0 0 | ||
| 432 | |||
| 433 | typedef unsigned int mach_msg_trailer_size_t; | ||
| 434 | typedef char *mach_msg_trailer_info_t; | ||
| 435 | |||
| 436 | typedef struct{ | ||
| 437 | 	mach_msg_trailer_type_t msgh_trailer_type; | ||
| 438 | 	mach_msg_trailer_size_t msgh_trailer_size; | ||
| 439 | } mach_msg_trailer_t; | ||
| 440 | |||
| 441 | /* | ||
| 442 | * The msgh_seqno field carries a sequence number | ||
| 443 | * associated with the received-from port. A port's | ||
| 444 | * sequence number is incremented every time a message | ||
| 445 | * is received from it and included in the received | ||
| 446 | * trailer to help put messages back in sequence if | ||
| 447 | * multiple threads receive and/or process received | ||
| 448 | * messages. | ||
| 449 | */ | ||
| 450 | typedef struct{ | ||
| 451 | 	mach_msg_trailer_type_t msgh_trailer_type; | ||
| 452 | 	mach_msg_trailer_size_t msgh_trailer_size; | ||
| 453 | 	mach_port_seqno_t msgh_seqno; | ||
| 454 | } mach_msg_seqno_trailer_t; | ||
| 455 | |||
| 456 | typedef struct{ | ||
| 457 | 	unsigned int val[2]; | ||
| 458 | } security_token_t; | ||
| 459 | |||
| 460 | typedef struct{ | ||
| 461 | 	mach_msg_trailer_type_t msgh_trailer_type; | ||
| 462 | 	mach_msg_trailer_size_t msgh_trailer_size; | ||
| 463 | 	mach_port_seqno_t msgh_seqno; | ||
| 464 | 	security_token_t msgh_sender; | ||
| 465 | } mach_msg_security_trailer_t; | ||
| 466 | |||
| 467 | /* | ||
| 468 | * The audit token is an opaque token which identifies | ||
| 469 | * Mach tasks and senders of Mach messages as subjects | ||
| 470 | * to the BSM audit system. Only the appropriate BSM | ||
| 471 | * library routines should be used to interpret the | ||
| 472 | * contents of the audit token as the representation | ||
| 473 | * of the subject identity within the token may change | ||
| 474 | * over time. | ||
| 475 | */ | ||
| 476 | typedef struct{ | ||
| 477 | 	unsigned int val[8]; | ||
| 478 | } audit_token_t; | ||
| 479 | |||
| 480 | typedef struct{ | ||
| 481 | 	mach_msg_trailer_type_t msgh_trailer_type; | ||
| 482 | 	mach_msg_trailer_size_t msgh_trailer_size; | ||
| 483 | 	mach_port_seqno_t msgh_seqno; | ||
| 484 | 	security_token_t msgh_sender; | ||
| 485 | 	audit_token_t msgh_audit; | ||
| 486 | } mach_msg_audit_trailer_t; | ||
| 487 | |||
| 488 | typedef struct{ | ||
| 489 | 	mach_msg_trailer_type_t msgh_trailer_type; | ||
| 490 | 	mach_msg_trailer_size_t msgh_trailer_size; | ||
| 491 | 	mach_port_seqno_t msgh_seqno; | ||
| 492 | 	security_token_t msgh_sender; | ||
| 493 | 	audit_token_t msgh_audit; | ||
| 494 | 	mach_port_context_t msgh_context; | ||
| 495 | } mach_msg_context_trailer_t; | ||
| 496 | |||
| 497 | |||
| 498 | |||
| 499 | typedef struct{ | ||
| 500 | 	mach_port_name_t sender; | ||
| 501 | } msg_labels_t; | ||
| 502 | |||
| 503 | typedef int mach_msg_filter_id; | ||
| 504 | #define MACH_MSG_FILTER_POLICY_ALLOW (mach_msg_filter_id)0 | ||
| 505 | |||
| 506 | /* | ||
| 507 | * Trailer type to pass MAC policy label info as a mach message trailer. | ||
| 508 | * | ||
| 509 | */ | ||
| 510 | |||
| 511 | typedef struct{ | ||
| 512 | 	mach_msg_trailer_type_t msgh_trailer_type; | ||
| 513 | 	mach_msg_trailer_size_t msgh_trailer_size; | ||
| 514 | 	mach_port_seqno_t msgh_seqno; | ||
| 515 | 	security_token_t msgh_sender; | ||
| 516 | 	audit_token_t msgh_audit; | ||
| 517 | 	mach_port_context_t msgh_context; | ||
| 518 | 	mach_msg_filter_id msgh_ad; | ||
| 519 | 	msg_labels_t msgh_labels; | ||
| 520 | } mach_msg_mac_trailer_t; | ||
| 521 | |||
| 522 | |||
| 523 | #define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t) | ||
| 524 | |||
| 525 | /* | ||
| 526 | * These values can change from release to release - but clearly | ||
| 527 | * code cannot request additional trailer elements one was not | ||
| 528 | * compiled to understand. Therefore, it is safe to use this | ||
| 529 | * constant when the same module specified the receive options. | ||
| 530 | * Otherwise, you run the risk that the options requested by | ||
| 531 | * another module may exceed the local modules notion of | ||
| 532 | * MAX_TRAILER_SIZE. | ||
| 533 | */ | ||
| 534 | |||
| 535 | typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t; | ||
| 536 | #define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t)) | ||
| 537 | |||
| 538 | /* | ||
| 539 | * Legacy requirements keep us from ever updating these defines (even | ||
| 540 | * when the format_0 trailers gain new option data fields in the future). | ||
| 541 | * Therefore, they shouldn't be used going forward. Instead, the sizes | ||
| 542 | * should be compared against the specific element size requested using | ||
| 543 | * REQUESTED_TRAILER_SIZE. | ||
| 544 | */ | ||
| 545 | typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t; | ||
| 546 | |||
| 547 | /*typedef mach_msg_mac_trailer_t mach_msg_format_0_trailer_t; | ||
| 548 | */ | ||
| 549 | |||
| 550 | #define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t) | ||
| 551 | |||
| 552 | #define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} } | ||
| 553 | extern const security_token_t KERNEL_SECURITY_TOKEN; | ||
| 554 | |||
| 555 | #define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} } | ||
| 556 | extern const audit_token_t KERNEL_AUDIT_TOKEN; | ||
| 557 | |||
| 558 | typedef integer_t mach_msg_options_t; | ||
| 559 | |||
| 560 | typedef struct{ | ||
| 561 | 	mach_msg_header_t header; | ||
| 562 | } mach_msg_empty_send_t; | ||
| 563 | |||
| 564 | typedef struct{ | ||
| 565 | 	mach_msg_header_t header; | ||
| 566 | 	mach_msg_trailer_t trailer; | ||
| 567 | } mach_msg_empty_rcv_t; | ||
| 568 | |||
| 569 | typedef union{ | ||
| 570 | 	mach_msg_empty_send_t send; | ||
| 571 | 	mach_msg_empty_rcv_t rcv; | ||
| 572 | } mach_msg_empty_t; | ||
| 573 | |||
| 574 | #pragma pack(pop) | ||
| 575 | |||
| 576 | /* utility to round the message size - will become machine dependent */ | ||
| 577 | #define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \ | ||
| 578 | 	 ~(sizeof (natural_t) - 1)) | ||
| 579 | |||
| 580 | |||
| 581 | /* | ||
| 582 | * There is no fixed upper bound to the size of Mach messages. | ||
| 583 | */ | ||
| 584 | #define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0) | ||
| 585 | |||
| 586 | #if defined(__APPLE_API_PRIVATE) | ||
| 587 | /* | ||
| 588 | * But architectural limits of a given implementation, or | ||
| 589 | * temporal conditions may cause unpredictable send failures | ||
| 590 | * for messages larger than MACH_MSG_SIZE_RELIABLE. | ||
| 591 | * | ||
| 592 | * In either case, waiting for memory is [currently] outside | ||
| 593 | * the scope of send timeout values provided to IPC. | ||
| 594 | */ | ||
| 595 | #define MACH_MSG_SIZE_RELIABLE ((mach_msg_size_t) 256 * 1024) | ||
| 596 | #endif | ||
| 597 | /* | ||
| 598 | * Compatibility definitions, for code written | ||
| 599 | * when there was a msgh_kind instead of msgh_seqno. | ||
| 600 | */ | ||
| 601 | #define MACH_MSGH_KIND_NORMAL 0x00000000 | ||
| 602 | #define MACH_MSGH_KIND_NOTIFICATION 0x00000001 | ||
| 603 | #define msgh_kind msgh_seqno | ||
| 604 | #define mach_msg_kind_t mach_port_seqno_t | ||
| 605 | |||
| 606 | typedef natural_t mach_msg_type_size_t; | ||
| 607 | typedef natural_t mach_msg_type_number_t; | ||
| 608 | |||
| 609 | /* | ||
| 610 | * Values received/carried in messages. Tells the receiver what | ||
| 611 | * sort of port right he now has. | ||
| 612 | * | ||
| 613 | * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name | ||
| 614 | * which should remain uninterpreted by the kernel. (Port rights | ||
| 615 | * are not transferred, just the port name.) | ||
| 616 | */ | ||
| 617 | |||
| 618 | #define MACH_MSG_TYPE_PORT_NONE 0 | ||
| 619 | |||
| 620 | #define MACH_MSG_TYPE_PORT_NAME 15 | ||
| 621 | #define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE | ||
| 622 | #define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND | ||
| 623 | #define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE | ||
| 624 | |||
| 625 | #define MACH_MSG_TYPE_LAST 22 /* Last assigned */ | ||
| 626 | |||
| 627 | /* | ||
| 628 | * A dummy value. Mostly used to indicate that the actual value | ||
| 629 | * will be filled in later, dynamically. | ||
| 630 | */ | ||
| 631 | |||
| 632 | #define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1) | ||
| 633 | |||
| 634 | /* | ||
| 635 | *	Is a given item a port type? | ||
| 636 | */ | ||
| 637 | |||
| 638 | #define MACH_MSG_TYPE_PORT_ANY(x) \ | ||
| 639 | 	(((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ | ||
| 640 | 	 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) | ||
| 641 | |||
| 642 | #define MACH_MSG_TYPE_PORT_ANY_SEND(x) \ | ||
| 643 | 	(((x) >= MACH_MSG_TYPE_MOVE_SEND) && \ | ||
| 644 | 	 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) | ||
| 645 | |||
| 646 | #define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \ | ||
| 647 | 	(((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ | ||
| 648 | 	 ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE)) | ||
| 649 | |||
| 650 | typedef integer_t mach_msg_option_t; | ||
| 651 | |||
| 652 | #define MACH_MSG_OPTION_NONE 0x00000000 | ||
| 653 | |||
| 654 | #define MACH_SEND_MSG 0x00000001 | ||
| 655 | #define MACH_RCV_MSG 0x00000002 | ||
| 656 | |||
| 657 | #define MACH_RCV_LARGE 0x00000004 /* report large message sizes */ | ||
| 658 | #define MACH_RCV_LARGE_IDENTITY 0x00000008 /* identify source of large messages */ | ||
| 659 | |||
| 660 | #define MACH_SEND_TIMEOUT 0x00000010 /* timeout value applies to send */ | ||
| 661 | #define MACH_SEND_OVERRIDE 0x00000020 /* priority override for send */ | ||
| 662 | #define MACH_SEND_INTERRUPT 0x00000040 /* don't restart interrupted sends */ | ||
| 663 | #define MACH_SEND_NOTIFY 0x00000080 /* arm send-possible notify */ | ||
| 664 | #define MACH_SEND_ALWAYS 0x00010000 /* ignore qlimits - kernel only */ | ||
| 665 | #define MACH_SEND_TRAILER 0x00020000 /* sender-provided trailer */ | ||
| 666 | #define MACH_SEND_NOIMPORTANCE 0x00040000 /* msg won't carry importance */ | ||
| 667 | #define MACH_SEND_NODENAP MACH_SEND_NOIMPORTANCE | ||
| 668 | #define MACH_SEND_IMPORTANCE 0x00080000 /* msg carries importance - kernel only */ | ||
| 669 | #define MACH_SEND_SYNC_OVERRIDE 0x00100000 /* msg should do sync ipc override */ | ||
| 670 | #define MACH_SEND_PROPAGATE_QOS 0x00200000 /* IPC should propagate the caller's QoS */ | ||
| 671 | #define MACH_SEND_SYNC_USE_THRPRI MACH_SEND_PROPAGATE_QOS /* obsolete name */ | ||
| 672 | #define MACH_SEND_KERNEL 0x00400000 /* full send from kernel space - kernel only */ | ||
| 673 | #define MACH_SEND_SYNC_BOOTSTRAP_CHECKIN 0x00800000 /* special reply port should boost thread doing sync bootstrap checkin */ | ||
| 674 | |||
| 675 | #define MACH_RCV_TIMEOUT 0x00000100 /* timeout value applies to receive */ | ||
| 676 | #define MACH_RCV_NOTIFY 0x00000000 /* legacy name (value was: 0x00000200) */ | ||
| 677 | #define MACH_RCV_INTERRUPT 0x00000400 /* don't restart interrupted receive */ | ||
| 678 | #define MACH_RCV_VOUCHER 0x00000800 /* willing to receive voucher port */ | ||
| 679 | #define MACH_RCV_OVERWRITE 0x00000000 /* scatter receive (deprecated) */ | ||
| 680 | #define MACH_RCV_GUARDED_DESC 0x00001000 /* Can receive new guarded descriptor */ | ||
| 681 | #define MACH_RCV_SYNC_WAIT 0x00004000 /* sync waiter waiting for rcv */ | ||
| 682 | #define MACH_RCV_SYNC_PEEK 0x00008000 /* sync waiter waiting to peek */ | ||
| 683 | |||
| 684 | #define MACH_MSG_STRICT_REPLY 0x00000200 /* Enforce specific properties about the reply port, and | ||
| 685 | 	 * the context in which a thread replies to a message. | ||
| 686 | 	 * This flag must be passed on both the SEND and RCV */ | ||
| 687 | |||
| 688 | |||
| 689 | /* | ||
| 690 | * NOTE: a 0x00------ RCV mask implies to ask for | ||
| 691 | * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements, | ||
| 692 | * which is equivalent to a mach_msg_trailer_t. | ||
| 693 | * | ||
| 694 | * XXXMAC: unlike the rest of the MACH_RCV_* flags, MACH_RCV_TRAILER_LABELS | ||
| 695 | * needs its own private bit since we only calculate its fields when absolutely | ||
| 696 | * required. | ||
| 697 | */ | ||
| 698 | #define MACH_RCV_TRAILER_NULL 0 | ||
| 699 | #define MACH_RCV_TRAILER_SEQNO 1 | ||
| 700 | #define MACH_RCV_TRAILER_SENDER 2 | ||
| 701 | #define MACH_RCV_TRAILER_AUDIT 3 | ||
| 702 | #define MACH_RCV_TRAILER_CTX 4 | ||
| 703 | #define MACH_RCV_TRAILER_AV 7 | ||
| 704 | #define MACH_RCV_TRAILER_LABELS 8 | ||
| 705 | |||
| 706 | #define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28) | ||
| 707 | #define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24) | ||
| 708 | #define MACH_RCV_TRAILER_MASK ((0xf << 24)) | ||
| 709 | |||
| 710 | #define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf) | ||
| 711 | |||
| 712 | |||
| 713 | /* | ||
| 714 | * XXXMAC: note that in the case of MACH_RCV_TRAILER_LABELS, | ||
| 715 | * we just fall through to mach_msg_max_trailer_t. | ||
| 716 | * This is correct behavior since mach_msg_max_trailer_t is defined as | ||
| 717 | * mac_msg_mac_trailer_t which is used for the LABELS trailer. | ||
| 718 | * It also makes things work properly if MACH_RCV_TRAILER_LABELS is ORed | ||
| 719 | * with one of the other options. | ||
| 720 | */ | ||
| 721 | |||
| 722 | #define REQUESTED_TRAILER_SIZE_NATIVE(y) \ | ||
| 723 | 	((mach_msg_trailer_size_t) \ | ||
| 724 | 	 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \ | ||
| 725 | 	 sizeof(mach_msg_trailer_t) : \ | ||
| 726 | 	 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \ | ||
| 727 | 	 sizeof(mach_msg_seqno_trailer_t) : \ | ||
| 728 | 	 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? \ | ||
| 729 | 	 sizeof(mach_msg_security_trailer_t) : \ | ||
| 730 | 	 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? \ | ||
| 731 | 	 sizeof(mach_msg_audit_trailer_t) : \ | ||
| 732 | 	 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? \ | ||
| 733 | 	 sizeof(mach_msg_context_trailer_t) : \ | ||
| 734 | 	 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? \ | ||
| 735 | 	 sizeof(mach_msg_mac_trailer_t) : \ | ||
| 736 | 	 sizeof(mach_msg_max_trailer_t)))))))) | ||
| 737 | |||
| 738 | |||
| 739 | #define REQUESTED_TRAILER_SIZE(y) REQUESTED_TRAILER_SIZE_NATIVE(y) | ||
| 740 | |||
| 741 | /* | ||
| 742 | * Much code assumes that mach_msg_return_t == kern_return_t. | ||
| 743 | * This definition is useful for descriptive purposes. | ||
| 744 | * | ||
| 745 | * See <mach/error.h> for the format of error codes. | ||
| 746 | * IPC errors are system 4. Send errors are subsystem 0; | ||
| 747 | * receive errors are subsystem 1. The code field is always non-zero. | ||
| 748 | * The high bits of the code field communicate extra information | ||
| 749 | * for some error codes. MACH_MSG_MASK masks off these special bits. | ||
| 750 | */ | ||
| 751 | |||
| 752 | typedef kern_return_t mach_msg_return_t; | ||
| 753 | |||
| 754 | #define MACH_MSG_SUCCESS 0x00000000 | ||
| 755 | |||
| 756 | |||
| 757 | #define MACH_MSG_MASK 0x00003e00 | ||
| 758 | /* All special error code bits defined below. */ | ||
| 759 | #define MACH_MSG_IPC_SPACE 0x00002000 | ||
| 760 | /* No room in IPC name space for another capability name. */ | ||
| 761 | #define MACH_MSG_VM_SPACE 0x00001000 | ||
| 762 | /* No room in VM address space for out-of-line memory. */ | ||
| 763 | #define MACH_MSG_IPC_KERNEL 0x00000800 | ||
| 764 | /* Kernel resource shortage handling an IPC capability. */ | ||
| 765 | #define MACH_MSG_VM_KERNEL 0x00000400 | ||
| 766 | /* Kernel resource shortage handling out-of-line memory. */ | ||
| 767 | |||
| 768 | #define MACH_SEND_IN_PROGRESS 0x10000001 | ||
| 769 | /* Thread is waiting to send. (Internal use only.) */ | ||
| 770 | #define MACH_SEND_INVALID_DATA 0x10000002 | ||
| 771 | /* Bogus in-line data. */ | ||
| 772 | #define MACH_SEND_INVALID_DEST 0x10000003 | ||
| 773 | /* Bogus destination port. */ | ||
| 774 | #define MACH_SEND_TIMED_OUT 0x10000004 | ||
| 775 | /* Message not sent before timeout expired. */ | ||
| 776 | #define MACH_SEND_INVALID_VOUCHER 0x10000005 | ||
| 777 | /* Bogus voucher port. */ | ||
| 778 | #define MACH_SEND_INTERRUPTED 0x10000007 | ||
| 779 | /* Software interrupt. */ | ||
| 780 | #define MACH_SEND_MSG_TOO_SMALL 0x10000008 | ||
| 781 | /* Data doesn't contain a complete message. */ | ||
| 782 | #define MACH_SEND_INVALID_REPLY 0x10000009 | ||
| 783 | /* Bogus reply port. */ | ||
| 784 | #define MACH_SEND_INVALID_RIGHT 0x1000000a | ||
| 785 | /* Bogus port rights in the message body. */ | ||
| 786 | #define MACH_SEND_INVALID_NOTIFY 0x1000000b | ||
| 787 | /* Bogus notify port argument. */ | ||
| 788 | #define MACH_SEND_INVALID_MEMORY 0x1000000c | ||
| 789 | /* Invalid out-of-line memory pointer. */ | ||
| 790 | #define MACH_SEND_NO_BUFFER 0x1000000d | ||
| 791 | /* No message buffer is available. */ | ||
| 792 | #define MACH_SEND_TOO_LARGE 0x1000000e | ||
| 793 | /* Send is too large for port */ | ||
| 794 | #define MACH_SEND_INVALID_TYPE 0x1000000f | ||
| 795 | /* Invalid msg-type specification. */ | ||
| 796 | #define MACH_SEND_INVALID_HEADER 0x10000010 | ||
| 797 | /* A field in the header had a bad value. */ | ||
| 798 | #define MACH_SEND_INVALID_TRAILER 0x10000011 | ||
| 799 | /* The trailer to be sent does not match kernel format. */ | ||
| 800 | #define MACH_SEND_INVALID_CONTEXT 0x10000012 | ||
| 801 | /* The sending thread context did not match the context on the dest port */ | ||
| 802 | #define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015 | ||
| 803 | /* compatibility: no longer a returned error */ | ||
| 804 | #define MACH_SEND_NO_GRANT_DEST 0x10000016 | ||
| 805 | /* The destination port doesn't accept ports in body */ | ||
| 806 | #define MACH_SEND_MSG_FILTERED 0x10000017 | ||
| 807 | /* Message send was rejected by message filter */ | ||
| 808 | |||
| 809 | #define MACH_RCV_IN_PROGRESS 0x10004001 | ||
| 810 | /* Thread is waiting for receive. (Internal use only.) */ | ||
| 811 | #define MACH_RCV_INVALID_NAME 0x10004002 | ||
| 812 | /* Bogus name for receive port/port-set. */ | ||
| 813 | #define MACH_RCV_TIMED_OUT 0x10004003 | ||
| 814 | /* Didn't get a message within the timeout value. */ | ||
| 815 | #define MACH_RCV_TOO_LARGE 0x10004004 | ||
| 816 | /* Message buffer is not large enough for inline data. */ | ||
| 817 | #define MACH_RCV_INTERRUPTED 0x10004005 | ||
| 818 | /* Software interrupt. */ | ||
| 819 | #define MACH_RCV_PORT_CHANGED 0x10004006 | ||
| 820 | /* compatibility: no longer a returned error */ | ||
| 821 | #define MACH_RCV_INVALID_NOTIFY 0x10004007 | ||
| 822 | /* Bogus notify port argument. */ | ||
| 823 | #define MACH_RCV_INVALID_DATA 0x10004008 | ||
| 824 | /* Bogus message buffer for inline data. */ | ||
| 825 | #define MACH_RCV_PORT_DIED 0x10004009 | ||
| 826 | /* Port/set was sent away/died during receive. */ | ||
| 827 | #define MACH_RCV_IN_SET 0x1000400a | ||
| 828 | /* compatibility: no longer a returned error */ | ||
| 829 | #define MACH_RCV_HEADER_ERROR 0x1000400b | ||
| 830 | /* Error receiving message header. See special bits. */ | ||
| 831 | #define MACH_RCV_BODY_ERROR 0x1000400c | ||
| 832 | /* Error receiving message body. See special bits. */ | ||
| 833 | #define MACH_RCV_INVALID_TYPE 0x1000400d | ||
| 834 | /* Invalid msg-type specification in scatter list. */ | ||
| 835 | #define MACH_RCV_SCATTER_SMALL 0x1000400e | ||
| 836 | /* Out-of-line overwrite region is not large enough */ | ||
| 837 | #define MACH_RCV_INVALID_TRAILER 0x1000400f | ||
| 838 | /* trailer type or number of trailer elements not supported */ | ||
| 839 | #define MACH_RCV_IN_PROGRESS_TIMED 0x10004011 | ||
| 840 | /* Waiting for receive with timeout. (Internal use only.) */ | ||
| 841 | #define MACH_RCV_INVALID_REPLY 0x10004012 | ||
| 842 | /* invalid reply port used in a STRICT_REPLY message */ | ||
| 843 | |||
| 844 | |||
| 845 | |||
| 846 | __BEGIN_DECLS | ||
| 847 | |||
| 848 | /* | ||
| 849 | *	Routine:	mach_msg_overwrite | ||
| 850 | *	Purpose: | ||
| 851 | *		Send and/or receive a message. If the message operation | ||
| 852 | *		is interrupted, and the user did not request an indication | ||
| 853 | *		of that fact, then restart the appropriate parts of the | ||
| 854 | *		operation silently (trap version does not restart). | ||
| 855 | * | ||
| 856 | *		Distinct send and receive buffers may be specified. If | ||
| 857 | *		no separate receive buffer is specified, the msg parameter | ||
| 858 | *		will be used for both send and receive operations. | ||
| 859 | * | ||
| 860 | *		In addition to a distinct receive buffer, that buffer may | ||
| 861 | *		already contain scatter control information to direct the | ||
| 862 | *		receiving of the message. | ||
| 863 | */ | ||
| 864 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 865 | extern mach_msg_return_t mach_msg_overwrite( | ||
| 866 | 	mach_msg_header_t *msg, | ||
| 867 | 	mach_msg_option_t option, | ||
| 868 | 	mach_msg_size_t send_size, | ||
| 869 | 	mach_msg_size_t rcv_size, | ||
| 870 | 	mach_port_name_t rcv_name, | ||
| 871 | 	mach_msg_timeout_t timeout, | ||
| 872 | 	mach_port_name_t notify, | ||
| 873 | 	mach_msg_header_t *rcv_msg, | ||
| 874 | 	mach_msg_size_t rcv_limit); | ||
| 875 | |||
| 876 | |||
| 877 | /* | ||
| 878 | *	Routine:	mach_msg | ||
| 879 | *	Purpose: | ||
| 880 | *		Send and/or receive a message. If the message operation | ||
| 881 | *		is interrupted, and the user did not request an indication | ||
| 882 | *		of that fact, then restart the appropriate parts of the | ||
| 883 | *		operation silently (trap version does not restart). | ||
| 884 | */ | ||
| 885 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 886 | extern mach_msg_return_t mach_msg( | ||
| 887 | 	mach_msg_header_t *msg, | ||
| 888 | 	mach_msg_option_t option, | ||
| 889 | 	mach_msg_size_t send_size, | ||
| 890 | 	mach_msg_size_t rcv_size, | ||
| 891 | 	mach_port_name_t rcv_name, | ||
| 892 | 	mach_msg_timeout_t timeout, | ||
| 893 | 	mach_port_name_t notify); | ||
| 894 | |||
| 895 | /* | ||
| 896 | *	Routine:	mach_voucher_deallocate | ||
| 897 | *	Purpose: | ||
| 898 | *		Deallocate a mach voucher created or received in a message. Drops | ||
| 899 | *		one (send right) reference to the voucher. | ||
| 900 | */ | ||
| 901 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 902 | extern kern_return_t mach_voucher_deallocate( | ||
| 903 | 	mach_port_name_t voucher); | ||
| 904 | |||
| 905 | |||
| 906 | __END_DECLS | ||
| 907 | |||
| 908 | #endif /* _MACH_MESSAGE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mig.h created+180| ... | @@ -0,0 +1,180 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Mach MIG Subsystem Interfaces | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef _MACH_MIG_H_ | ||
| 37 | #define _MACH_MIG_H_ | ||
| 38 | |||
| 39 | #include <stdint.h> | ||
| 40 | #include <mach/port.h> | ||
| 41 | #include <mach/message.h> | ||
| 42 | #include <mach/vm_types.h> | ||
| 43 | |||
| 44 | #include <sys/cdefs.h> | ||
| 45 | |||
| 46 | #if defined(MACH_KERNEL) | ||
| 47 | |||
| 48 | #if !defined(__MigTypeCheck) | ||
| 49 | /* Turn MIG type checking on by default for kernel */ | ||
| 50 | #define __MigTypeCheck 1 | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define __MigKernelSpecificCode 1 | ||
| 54 | #define _MIG_KERNEL_SPECIFIC_CODE_ 1 | ||
| 55 | |||
| 56 | #elif !defined(__MigTypeCheck) | ||
| 57 | |||
| 58 | #if defined(TypeCheck) | ||
| 59 | /* use legacy setting (temporary) */ | ||
| 60 | #define __MigTypeCheck TypeCheck | ||
| 61 | #else | ||
| 62 | /* default MIG type checking on */ | ||
| 63 | #define __MigTypeCheck 1 | ||
| 64 | #endif | ||
| 65 | |||
| 66 | #endif /* !defined(MACH_KERNEL) && !defined(__MigTypeCheck) */ | ||
| 67 | |||
| 68 | /* | ||
| 69 | * Pack MIG message structs. | ||
| 70 | * This is an indicator of the need to view shared structs in a | ||
| 71 | * binary-compatible format - and MIG message structs are no different. | ||
| 72 | */ | ||
| 73 | #define __MigPackStructs 1 | ||
| 74 | |||
| 75 | /* | ||
| 76 | * Definition for MIG-generated server stub routines. These routines | ||
| 77 | * unpack the request message, call the server procedure, and pack the | ||
| 78 | * reply message. | ||
| 79 | */ | ||
| 80 | typedef void (*mig_stub_routine_t) (mach_msg_header_t *InHeadP, | ||
| 81 | mach_msg_header_t *OutHeadP); | ||
| 82 | |||
| 83 | typedef mig_stub_routine_t mig_routine_t; | ||
| 84 | |||
| 85 | /* | ||
| 86 | * Definition for MIG-generated server routine. This routine takes a | ||
| 87 | * message, and returns the appropriate stub function for handling that | ||
| 88 | * message. | ||
| 89 | */ | ||
| 90 | typedef mig_routine_t (*mig_server_routine_t) (mach_msg_header_t *InHeadP); | ||
| 91 | |||
| 92 | /* | ||
| 93 | * Generic definition for implementation routines. These routines do | ||
| 94 | * the real work associated with this request. This generic type is | ||
| 95 | * used for keeping the pointers in the subsystem array. | ||
| 96 | */ | ||
| 97 | typedef kern_return_t (*mig_impl_routine_t)(void); | ||
| 98 | |||
| 99 | typedef mach_msg_type_descriptor_t routine_arg_descriptor; | ||
| 100 | typedef mach_msg_type_descriptor_t *routine_arg_descriptor_t; | ||
| 101 | typedef mach_msg_type_descriptor_t *mig_routine_arg_descriptor_t; | ||
| 102 | |||
| 103 | #define MIG_ROUTINE_ARG_DESCRIPTOR_NULL ((mig_routine_arg_descriptor_t)0) | ||
| 104 | |||
| 105 | struct routine_descriptor { | ||
| 106 | 	mig_impl_routine_t impl_routine; /* Server work func pointer */ | ||
| 107 | 	mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */ | ||
| 108 | 	unsigned int argc; /* Number of argument words */ | ||
| 109 | 	unsigned int descr_count; /* Number complex descriptors */ | ||
| 110 | 	routine_arg_descriptor_t | ||
| 111 | 	 arg_descr; /* pointer to descriptor array*/ | ||
| 112 | 	unsigned int max_reply_msg; /* Max size for reply msg */ | ||
| 113 | }; | ||
| 114 | typedef struct routine_descriptor *routine_descriptor_t; | ||
| 115 | |||
| 116 | typedef struct routine_descriptor mig_routine_descriptor; | ||
| 117 | typedef mig_routine_descriptor *mig_routine_descriptor_t; | ||
| 118 | |||
| 119 | #define MIG_ROUTINE_DESCRIPTOR_NULL ((mig_routine_descriptor_t)0) | ||
| 120 | |||
| 121 | typedef struct mig_subsystem { | ||
| 122 | 	mig_server_routine_t server; /* pointer to demux routine	*/ | ||
| 123 | 	mach_msg_id_t start; /* Min routine number	 */ | ||
| 124 | 	mach_msg_id_t end; /* Max routine number + 1 */ | ||
| 125 | 	mach_msg_size_t maxsize; /* Max reply message size */ | ||
| 126 | 	vm_address_t reserved; /* reserved for MIG use	 */ | ||
| 127 | 	mig_routine_descriptor | ||
| 128 | 	 routine[1]; /* Routine descriptor array */ | ||
| 129 | } *mig_subsystem_t; | ||
| 130 | |||
| 131 | #define MIG_SUBSYSTEM_NULL ((mig_subsystem_t)0) | ||
| 132 | |||
| 133 | typedef struct mig_symtab { | ||
| 134 | 	char *ms_routine_name; | ||
| 135 | 	int ms_routine_number; | ||
| 136 | 	void (*ms_routine)(void); /* Since the functions in the | ||
| 137 | 	 * symbol table have unknown | ||
| 138 | 	 * signatures, this is the best | ||
| 139 | 	 * we can do... | ||
| 140 | 	 */ | ||
| 141 | } mig_symtab_t; | ||
| 142 | |||
| 143 | /* | ||
| 144 | * A compiler attribute for annotating all MIG server routines and other | ||
| 145 | * functions that should behave similarly. Allows the compiler to perform | ||
| 146 | * additional static bug-finding over them. | ||
| 147 | */ | ||
| 148 | #if __has_attribute(mig_server_routine) | ||
| 149 | #define MIG_SERVER_ROUTINE __attribute__((mig_server_routine)) | ||
| 150 | #else | ||
| 151 | #define MIG_SERVER_ROUTINE | ||
| 152 | #endif | ||
| 153 | |||
| 154 | |||
| 155 | __BEGIN_DECLS | ||
| 156 | |||
| 157 | /* Client side reply port allocate */ | ||
| 158 | extern mach_port_t mig_get_reply_port(void); | ||
| 159 | |||
| 160 | /* Client side reply port deallocate */ | ||
| 161 | extern void mig_dealloc_reply_port(mach_port_t reply_port); | ||
| 162 | |||
| 163 | /* Client side reply port "deallocation" */ | ||
| 164 | extern void mig_put_reply_port(mach_port_t reply_port); | ||
| 165 | |||
| 166 | /* Bounded string copy */ | ||
| 167 | extern int mig_strncpy(char *dest, const char *src, int len); | ||
| 168 | extern int mig_strncpy_zerofill(char *dest, const char *src, int len); | ||
| 169 | |||
| 170 | |||
| 171 | /* Allocate memory for out-of-line mig structures */ | ||
| 172 | extern void mig_allocate(vm_address_t *, vm_size_t); | ||
| 173 | |||
| 174 | /* Deallocate memory used for out-of-line mig structures */ | ||
| 175 | extern void mig_deallocate(vm_address_t, vm_size_t); | ||
| 176 | |||
| 177 | |||
| 178 | __END_DECLS | ||
| 179 | |||
| 180 | #endif /* _MACH_MIG_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mig_errors.h created+125| ... | @@ -0,0 +1,125 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | * Mach Interface Generator errors | ||
| 60 | * | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _MACH_MIG_ERRORS_H_ | ||
| 64 | #define _MACH_MIG_ERRORS_H_ | ||
| 65 | |||
| 66 | #include <mach/mig.h> | ||
| 67 | #include <mach/ndr.h> | ||
| 68 | #include <mach/message.h> | ||
| 69 | #include <mach/kern_return.h> | ||
| 70 | |||
| 71 | #include <sys/cdefs.h> | ||
| 72 | |||
| 73 | /* | ||
| 74 | *	These error codes should be specified as system 4, subsytem 2. | ||
| 75 | *	But alas backwards compatibility makes that impossible. | ||
| 76 | *	The problem is old clients of new servers (eg, the kernel) | ||
| 77 | *	which get strange large error codes when there is a Mig problem | ||
| 78 | *	in the server. Unfortunately, the IPC system doesn't have | ||
| 79 | *	the knowledge to convert the codes in this situation. | ||
| 80 | */ | ||
| 81 | |||
| 82 | #define MIG_TYPE_ERROR -300 /* client type check failure */ | ||
| 83 | #define MIG_REPLY_MISMATCH -301 /* wrong reply message ID */ | ||
| 84 | #define MIG_REMOTE_ERROR -302 /* server detected error */ | ||
| 85 | #define MIG_BAD_ID -303 /* bad request message ID */ | ||
| 86 | #define MIG_BAD_ARGUMENTS -304 /* server type check failure */ | ||
| 87 | #define MIG_NO_REPLY -305 /* no reply should be send */ | ||
| 88 | #define MIG_EXCEPTION -306 /* server raised exception */ | ||
| 89 | #define MIG_ARRAY_TOO_LARGE -307 /* array not large enough */ | ||
| 90 | #define MIG_SERVER_DIED -308 /* server died */ | ||
| 91 | #define MIG_TRAILER_ERROR -309 /* trailer has an unknown format */ | ||
| 92 | |||
| 93 | /* | ||
| 94 | *	Whenever MIG detects an error, it sends back a generic | ||
| 95 | *	mig_reply_error_t format message. Clients must accept | ||
| 96 | *	these in addition to the expected reply message format. | ||
| 97 | */ | ||
| 98 | #pragma pack(4) | ||
| 99 | typedef struct { | ||
| 100 | 	mach_msg_header_t Head; | ||
| 101 | 	NDR_record_t NDR; | ||
| 102 | 	kern_return_t RetCode; | ||
| 103 | } mig_reply_error_t; | ||
| 104 | #pragma pack() | ||
| 105 | |||
| 106 | |||
| 107 | __BEGIN_DECLS | ||
| 108 | |||
| 109 | #if !defined(__NDR_convert__mig_reply_error_t__defined) | ||
| 110 | #define __NDR_convert__mig_reply_error_t__defined | ||
| 111 | |||
| 112 | static __inline__ void | ||
| 113 | __NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x) | ||
| 114 | { | ||
| 115 | #if defined(__NDR_convert__int_rep__kern_return_t__defined) | ||
| 116 | 	if (x->NDR.int_rep != NDR_record.int_rep) { | ||
| 117 | 		__NDR_convert__int_rep__kern_return_t(&x->RetCode, x->NDR.int_rep); | ||
| 118 | 	} | ||
| 119 | #endif /* __NDR_convert__int_rep__kern_return_t__defined */ | ||
| 120 | } | ||
| 121 | #endif /* !defined(__NDR_convert__mig_reply_error_t__defined) */ | ||
| 122 | |||
| 123 | __END_DECLS | ||
| 124 | |||
| 125 | #endif /* _MACH_MIG_ERRORS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/mig_strncpy_zerofill_support.h created+35| ... | @@ -0,0 +1,35 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | //This dummy header file is created for mig to check when to call mig_strncpy_zerofill. | ||
| 29 | //Mig checks if this file is available to include and knows that Libsyscall has the new mig_strncpy_zerofill symbols to link to. | ||
| 30 | //Do not delete this file, mig will stop calling mig_strncpy_zerofill. | ||
| 31 | |||
| 32 | #ifndef __MACH_MIG_STRNCPY_ZEROFILL_SUPPORT__ | ||
| 33 | #define __MACH_MIG_STRNCPY_ZEROFILL_SUPPORT__ | ||
| 34 | |||
| 35 | #endif // __MACH_MIG_STRNCPY_ZEROFILL_SUPPORT__ | ||
lib/libc/include/x86_64-macos-gnu/mach/ndr.h created+207| ... | @@ -0,0 +1,207 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _MACH_NDR_H_ | ||
| 33 | #define _MACH_NDR_H_ | ||
| 34 | |||
| 35 | #include <stdint.h> | ||
| 36 | #include <sys/cdefs.h> | ||
| 37 | #include <libkern/OSByteOrder.h> | ||
| 38 | |||
| 39 | |||
| 40 | typedef struct { | ||
| 41 | 	unsigned char mig_vers; | ||
| 42 | 	unsigned char if_vers; | ||
| 43 | 	unsigned char reserved1; | ||
| 44 | 	unsigned char mig_encoding; | ||
| 45 | 	unsigned char int_rep; | ||
| 46 | 	unsigned char char_rep; | ||
| 47 | 	unsigned char float_rep; | ||
| 48 | 	unsigned char reserved2; | ||
| 49 | } NDR_record_t; | ||
| 50 | |||
| 51 | /* | ||
| 52 | * MIG supported protocols for Network Data Representation | ||
| 53 | */ | ||
| 54 | #define NDR_PROTOCOL_2_0 0 | ||
| 55 | |||
| 56 | /* | ||
| 57 | * NDR 2.0 format flag type definition and values. | ||
| 58 | */ | ||
| 59 | #define NDR_INT_BIG_ENDIAN 0 | ||
| 60 | #define NDR_INT_LITTLE_ENDIAN 1 | ||
| 61 | #define NDR_FLOAT_IEEE 0 | ||
| 62 | #define NDR_FLOAT_VAX 1 | ||
| 63 | #define NDR_FLOAT_CRAY 2 | ||
| 64 | #define NDR_FLOAT_IBM 3 | ||
| 65 | #define NDR_CHAR_ASCII 0 | ||
| 66 | #define NDR_CHAR_EBCDIC 1 | ||
| 67 | |||
| 68 | extern NDR_record_t NDR_record; | ||
| 69 | |||
| 70 | /* NDR conversion off by default */ | ||
| 71 | |||
| 72 | #if !defined(__NDR_convert__) | ||
| 73 | #define __NDR_convert__ 0 | ||
| 74 | #endif /* !defined(__NDR_convert__) */ | ||
| 75 | |||
| 76 | #ifndef __NDR_convert__int_rep__ | ||
| 77 | #define __NDR_convert__int_rep__ __NDR_convert__ | ||
| 78 | #endif /* __NDR_convert__int_rep__ */ | ||
| 79 | |||
| 80 | #ifndef __NDR_convert__char_rep__ | ||
| 81 | #define __NDR_convert__char_rep__ 0 | ||
| 82 | #endif /* __NDR_convert__char_rep__ */ | ||
| 83 | |||
| 84 | #ifndef __NDR_convert__float_rep__ | ||
| 85 | #define __NDR_convert__float_rep__ 0 | ||
| 86 | #endif /* __NDR_convert__float_rep__ */ | ||
| 87 | |||
| 88 | #if __NDR_convert__ | ||
| 89 | |||
| 90 | #define __NDR_convert__NOOP do ; while (0) | ||
| 91 | #define __NDR_convert__UNKNOWN(s) __NDR_convert__NOOP | ||
| 92 | #define __NDR_convert__SINGLE(a, f, r) do { r((a), (f)); } while (0) | ||
| 93 | #define __NDR_convert__ARRAY(a, f, c, r) \ | ||
| 94 | 	do { int __i__, __C__ = (c); \ | ||
| 95 | 	for (__i__ = 0; __i__ < __C__; __i__++) \ | ||
| 96 | 	r(&(a)[__i__], f); } while (0) | ||
| 97 | #define __NDR_convert__2DARRAY(a, f, s, c, r) \ | ||
| 98 | 	do { int __i__, __C__ = (c), __S__ = (s); \ | ||
| 99 | 	for (__i__ = 0; __i__ < __C__; __i__++) \ | ||
| 100 | 	r(&(a)[__i__ * __S__], f, __S__); } while (0) | ||
| 101 | |||
| 102 | #if __NDR_convert__int_rep__ | ||
| 103 | |||
| 104 | #define __NDR_READSWAP_assign(a, rs) do { *(a) = rs(a); } while (0) | ||
| 105 | |||
| 106 | #define __NDR_READSWAP__uint16_t(a) OSReadSwapInt16((void *)a, 0) | ||
| 107 | #define __NDR_READSWAP__int16_t(a) (int16_t)OSReadSwapInt16((void *)a, 0) | ||
| 108 | #define __NDR_READSWAP__uint32_t(a) OSReadSwapInt32((void *)a, 0) | ||
| 109 | #define __NDR_READSWAP__int32_t(a) (int32_t)OSReadSwapInt32((void *)a, 0) | ||
| 110 | #define __NDR_READSWAP__uint64_t(a) OSReadSwapInt64((void *)a, 0) | ||
| 111 | #define __NDR_READSWAP__int64_t(a) (int64_t)OSReadSwapInt64((void *)a, 0) | ||
| 112 | |||
| 113 | __BEGIN_DECLS | ||
| 114 | |||
| 115 | static __inline__ float | ||
| 116 | __NDR_READSWAP__float(float *argp) | ||
| 117 | { | ||
| 118 | 	union { | ||
| 119 | 		float sv; | ||
| 120 | 		uint32_t ull; | ||
| 121 | 	} result; | ||
| 122 | 	result.ull = __NDR_READSWAP__uint32_t((uint32_t *)argp); | ||
| 123 | 	return result.sv; | ||
| 124 | } | ||
| 125 | |||
| 126 | static __inline__ double | ||
| 127 | __NDR_READSWAP__double(double *argp) | ||
| 128 | { | ||
| 129 | 	union { | ||
| 130 | 		double sv; | ||
| 131 | 		uint64_t ull; | ||
| 132 | 	} result; | ||
| 133 | 	result.ull = __NDR_READSWAP__uint64_t((uint64_t *)argp); | ||
| 134 | 	return result.sv; | ||
| 135 | } | ||
| 136 | |||
| 137 | __END_DECLS | ||
| 138 | |||
| 139 | #define __NDR_convert__int_rep__int16_t__defined | ||
| 140 | #define __NDR_convert__int_rep__int16_t(v, f) \ | ||
| 141 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__int16_t) | ||
| 142 | |||
| 143 | #define __NDR_convert__int_rep__uint16_t__defined | ||
| 144 | #define __NDR_convert__int_rep__uint16_t(v, f) \ | ||
| 145 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__uint16_t) | ||
| 146 | |||
| 147 | #define __NDR_convert__int_rep__int32_t__defined | ||
| 148 | #define __NDR_convert__int_rep__int32_t(v, f) \ | ||
| 149 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__int32_t) | ||
| 150 | |||
| 151 | #define __NDR_convert__int_rep__uint32_t__defined | ||
| 152 | #define __NDR_convert__int_rep__uint32_t(v, f) \ | ||
| 153 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__uint32_t) | ||
| 154 | |||
| 155 | #define __NDR_convert__int_rep__int64_t__defined | ||
| 156 | #define __NDR_convert__int_rep__int64_t(v, f) \ | ||
| 157 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__int64_t) | ||
| 158 | |||
| 159 | #define __NDR_convert__int_rep__uint64_t__defined | ||
| 160 | #define __NDR_convert__int_rep__uint64_t(v, f) \ | ||
| 161 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__uint64_t) | ||
| 162 | |||
| 163 | #define __NDR_convert__int_rep__float__defined | ||
| 164 | #define __NDR_convert__int_rep__float(v, f) \ | ||
| 165 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__float) | ||
| 166 | |||
| 167 | #define __NDR_convert__int_rep__double__defined | ||
| 168 | #define __NDR_convert__int_rep__double(v, f) \ | ||
| 169 | 	__NDR_READSWAP_assign(v, __NDR_READSWAP__double) | ||
| 170 | |||
| 171 | #define __NDR_convert__int_rep__boolean_t__defined | ||
| 172 | #define __NDR_convert__int_rep__boolean_t(v, f) \ | ||
| 173 | 	__NDR_convert__int_rep__int32_t(v,f) | ||
| 174 | |||
| 175 | #define __NDR_convert__int_rep__kern_return_t__defined | ||
| 176 | #define __NDR_convert__int_rep__kern_return_t(v, f) \ | ||
| 177 | 	__NDR_convert__int_rep__int32_t(v,f) | ||
| 178 | |||
| 179 | #define __NDR_convert__int_rep__mach_port_name_t__defined | ||
| 180 | #define __NDR_convert__int_rep__mach_port_name_t(v, f) \ | ||
| 181 | 	__NDR_convert__int_rep__uint32_t(v,f) | ||
| 182 | |||
| 183 | #define __NDR_convert__int_rep__mach_msg_type_number_t__defined | ||
| 184 | #define __NDR_convert__int_rep__mach_msg_type_number_t(v, f) \ | ||
| 185 | 	__NDR_convert__int_rep__uint32_t(v,f) | ||
| 186 | |||
| 187 | #endif /* __NDR_convert__int_rep__ */ | ||
| 188 | |||
| 189 | #if __NDR_convert__char_rep__ | ||
| 190 | |||
| 191 | #warning NDR character representation conversions not implemented yet! | ||
| 192 | #define __NDR_convert__char_rep__char(v, f) __NDR_convert__NOOP | ||
| 193 | #define __NDR_convert__char_rep__string(v, f, l) __NDR_convert__NOOP | ||
| 194 | |||
| 195 | #endif /* __NDR_convert__char_rep__ */ | ||
| 196 | |||
| 197 | #if __NDR_convert__float_rep__ | ||
| 198 | |||
| 199 | #warning NDR floating point representation conversions not implemented yet! | ||
| 200 | #define __NDR_convert__float_rep__float(v, f) __NDR_convert__NOOP | ||
| 201 | #define __NDR_convert__float_rep__double(v, f) __NDR_convert__NOOP | ||
| 202 | |||
| 203 | #endif /* __NDR_convert__float_rep__ */ | ||
| 204 | |||
| 205 | #endif /* __NDR_convert__ */ | ||
| 206 | |||
| 207 | #endif /* _MACH_NDR_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/notify.h created+141| ... | @@ -0,0 +1,141 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/notify.h | ||
| 60 | * | ||
| 61 | *	Kernel notification message definitions. | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _MACH_NOTIFY_H_ | ||
| 65 | #define _MACH_NOTIFY_H_ | ||
| 66 | |||
| 67 | #include <mach/port.h> | ||
| 68 | #include <mach/message.h> | ||
| 69 | #include <mach/ndr.h> | ||
| 70 | |||
| 71 | /* | ||
| 72 | * An alternative specification of the notification interface | ||
| 73 | * may be found in mach/notify.defs. | ||
| 74 | */ | ||
| 75 | |||
| 76 | #define MACH_NOTIFY_FIRST 0100 | ||
| 77 | #define MACH_NOTIFY_PORT_DELETED (MACH_NOTIFY_FIRST + 001) | ||
| 78 | /* A send or send-once right was deleted. */ | ||
| 79 | #define MACH_NOTIFY_SEND_POSSIBLE (MACH_NOTIFY_FIRST + 002) | ||
| 80 | /* Now possible to send using specified right */ | ||
| 81 | #define MACH_NOTIFY_PORT_DESTROYED (MACH_NOTIFY_FIRST + 005) | ||
| 82 | /* A receive right was (would have been) deallocated */ | ||
| 83 | #define MACH_NOTIFY_NO_SENDERS (MACH_NOTIFY_FIRST + 006) | ||
| 84 | /* Receive right has no extant send rights */ | ||
| 85 | #define MACH_NOTIFY_SEND_ONCE (MACH_NOTIFY_FIRST + 007) | ||
| 86 | /* An extant send-once right died */ | ||
| 87 | #define MACH_NOTIFY_DEAD_NAME (MACH_NOTIFY_FIRST + 010) | ||
| 88 | /* Send or send-once right died, leaving a dead-name */ | ||
| 89 | #define MACH_NOTIFY_LAST (MACH_NOTIFY_FIRST + 015) | ||
| 90 | |||
| 91 | typedef mach_port_t notify_port_t; | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Hard-coded message structures for receiving Mach port notification | ||
| 95 | * messages. However, they are not actual large enough to receive | ||
| 96 | * the largest trailers current exported by Mach IPC (so they cannot | ||
| 97 | * be used for space allocations in situations using these new larger | ||
| 98 | * trailers). Instead, the MIG-generated server routines (and | ||
| 99 | * related prototypes should be used). | ||
| 100 | */ | ||
| 101 | typedef struct { | ||
| 102 | 	mach_msg_header_t not_header; | ||
| 103 | 	NDR_record_t NDR; | ||
| 104 | 	mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ | ||
| 105 | 	mach_msg_format_0_trailer_t trailer; | ||
| 106 | } mach_port_deleted_notification_t; | ||
| 107 | |||
| 108 | typedef struct { | ||
| 109 | 	mach_msg_header_t not_header; | ||
| 110 | 	NDR_record_t NDR; | ||
| 111 | 	mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ | ||
| 112 | 	mach_msg_format_0_trailer_t trailer; | ||
| 113 | } mach_send_possible_notification_t; | ||
| 114 | |||
| 115 | typedef struct { | ||
| 116 | 	mach_msg_header_t not_header; | ||
| 117 | 	mach_msg_body_t not_body; | ||
| 118 | 	mach_msg_port_descriptor_t not_port;/* MACH_MSG_TYPE_PORT_RECEIVE */ | ||
| 119 | 	mach_msg_format_0_trailer_t trailer; | ||
| 120 | } mach_port_destroyed_notification_t; | ||
| 121 | |||
| 122 | typedef struct { | ||
| 123 | 	mach_msg_header_t not_header; | ||
| 124 | 	NDR_record_t NDR; | ||
| 125 | 	mach_msg_type_number_t not_count; | ||
| 126 | 	mach_msg_format_0_trailer_t trailer; | ||
| 127 | } mach_no_senders_notification_t; | ||
| 128 | |||
| 129 | typedef struct { | ||
| 130 | 	mach_msg_header_t not_header; | ||
| 131 | 	mach_msg_format_0_trailer_t trailer; | ||
| 132 | } mach_send_once_notification_t; | ||
| 133 | |||
| 134 | typedef struct { | ||
| 135 | 	mach_msg_header_t not_header; | ||
| 136 | 	NDR_record_t NDR; | ||
| 137 | 	mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ | ||
| 138 | 	mach_msg_format_0_trailer_t trailer; | ||
| 139 | } mach_dead_name_notification_t; | ||
| 140 | |||
| 141 | #endif /* _MACH_NOTIFY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/policy.h created+235| ... | @@ -0,0 +1,235 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_POLICY_H_ | ||
| 60 | #define _MACH_POLICY_H_ | ||
| 61 | |||
| 62 | /* | ||
| 63 | *	mach/policy.h | ||
| 64 | * | ||
| 65 | *	Definitions for scheduing policy. | ||
| 66 | */ | ||
| 67 | |||
| 68 | /* | ||
| 69 | * All interfaces defined here are obsolete. | ||
| 70 | */ | ||
| 71 | |||
| 72 | #include <mach/boolean.h> | ||
| 73 | #include <mach/message.h> | ||
| 74 | #include <mach/vm_types.h> | ||
| 75 | |||
| 76 | /* | ||
| 77 | *	Old scheduling control interface | ||
| 78 | */ | ||
| 79 | typedef int policy_t; | ||
| 80 | typedef integer_t *policy_info_t; | ||
| 81 | typedef integer_t *policy_base_t; | ||
| 82 | typedef integer_t *policy_limit_t; | ||
| 83 | |||
| 84 | /* | ||
| 85 | *	Policy definitions. Policies should be powers of 2, | ||
| 86 | *	but cannot be or'd together other than to test for a | ||
| 87 | *	policy 'class'. | ||
| 88 | */ | ||
| 89 | #define POLICY_NULL 0 /* none			*/ | ||
| 90 | #define POLICY_TIMESHARE 1 /* timesharing		*/ | ||
| 91 | #define POLICY_RR 2 /* fixed round robin	*/ | ||
| 92 | #define POLICY_FIFO 4 /* fixed fifo		*/ | ||
| 93 | |||
| 94 | #define __NEW_SCHEDULING_FRAMEWORK__ | ||
| 95 | |||
| 96 | /* | ||
| 97 | *	Check if policy is of 'class' fixed-priority. | ||
| 98 | */ | ||
| 99 | #define POLICYCLASS_FIXEDPRI (POLICY_RR | POLICY_FIFO) | ||
| 100 | |||
| 101 | /* | ||
| 102 | *	Check if policy is valid. | ||
| 103 | */ | ||
| 104 | #define invalid_policy(policy) \ | ||
| 105 | 	((policy) != POLICY_TIMESHARE && \ | ||
| 106 | 	 (policy) != POLICY_RR && \ | ||
| 107 | 	 (policy) != POLICY_FIFO) | ||
| 108 | |||
| 109 | |||
| 110 | /* | ||
| 111 | * Types for TIMESHARE policy | ||
| 112 | */ | ||
| 113 | struct policy_timeshare_base { | ||
| 114 | 	integer_t base_priority; | ||
| 115 | }; | ||
| 116 | struct policy_timeshare_limit { | ||
| 117 | 	integer_t max_priority; | ||
| 118 | }; | ||
| 119 | struct policy_timeshare_info { | ||
| 120 | 	integer_t max_priority; | ||
| 121 | 	integer_t base_priority; | ||
| 122 | 	integer_t cur_priority; | ||
| 123 | 	boolean_t depressed; | ||
| 124 | 	integer_t depress_priority; | ||
| 125 | }; | ||
| 126 | |||
| 127 | typedef struct policy_timeshare_base *policy_timeshare_base_t; | ||
| 128 | typedef struct policy_timeshare_limit *policy_timeshare_limit_t; | ||
| 129 | typedef struct policy_timeshare_info *policy_timeshare_info_t; | ||
| 130 | |||
| 131 | typedef struct policy_timeshare_base policy_timeshare_base_data_t; | ||
| 132 | typedef struct policy_timeshare_limit policy_timeshare_limit_data_t; | ||
| 133 | typedef struct policy_timeshare_info policy_timeshare_info_data_t; | ||
| 134 | |||
| 135 | |||
| 136 | #define POLICY_TIMESHARE_BASE_COUNT ((mach_msg_type_number_t) \ | ||
| 137 | 	(sizeof(struct policy_timeshare_base)/sizeof(integer_t))) | ||
| 138 | #define POLICY_TIMESHARE_LIMIT_COUNT ((mach_msg_type_number_t) \ | ||
| 139 | 	(sizeof(struct policy_timeshare_limit)/sizeof(integer_t))) | ||
| 140 | #define POLICY_TIMESHARE_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 141 | 	(sizeof(struct policy_timeshare_info)/sizeof(integer_t))) | ||
| 142 | |||
| 143 | |||
| 144 | /* | ||
| 145 | *	Types for the ROUND ROBIN (RR) policy | ||
| 146 | */ | ||
| 147 | struct policy_rr_base { | ||
| 148 | 	integer_t base_priority; | ||
| 149 | 	integer_t quantum; | ||
| 150 | }; | ||
| 151 | struct policy_rr_limit { | ||
| 152 | 	integer_t max_priority; | ||
| 153 | }; | ||
| 154 | struct policy_rr_info { | ||
| 155 | 	integer_t max_priority; | ||
| 156 | 	integer_t base_priority; | ||
| 157 | 	integer_t quantum; | ||
| 158 | 	boolean_t depressed; | ||
| 159 | 	integer_t depress_priority; | ||
| 160 | }; | ||
| 161 | |||
| 162 | typedef struct policy_rr_base *policy_rr_base_t; | ||
| 163 | typedef struct policy_rr_limit *policy_rr_limit_t; | ||
| 164 | typedef struct policy_rr_info *policy_rr_info_t; | ||
| 165 | |||
| 166 | typedef struct policy_rr_base policy_rr_base_data_t; | ||
| 167 | typedef struct policy_rr_limit policy_rr_limit_data_t; | ||
| 168 | typedef struct policy_rr_info policy_rr_info_data_t; | ||
| 169 | |||
| 170 | #define POLICY_RR_BASE_COUNT ((mach_msg_type_number_t) \ | ||
| 171 | 	(sizeof(struct policy_rr_base)/sizeof(integer_t))) | ||
| 172 | #define POLICY_RR_LIMIT_COUNT ((mach_msg_type_number_t) \ | ||
| 173 | 	(sizeof(struct policy_rr_limit)/sizeof(integer_t))) | ||
| 174 | #define POLICY_RR_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 175 | 	(sizeof(struct policy_rr_info)/sizeof(integer_t))) | ||
| 176 | |||
| 177 | |||
| 178 | /* | ||
| 179 | * Types for the FIRST-IN-FIRST-OUT (FIFO) policy | ||
| 180 | */ | ||
| 181 | struct policy_fifo_base { | ||
| 182 | 	integer_t base_priority; | ||
| 183 | }; | ||
| 184 | struct policy_fifo_limit { | ||
| 185 | 	integer_t max_priority; | ||
| 186 | }; | ||
| 187 | struct policy_fifo_info { | ||
| 188 | 	integer_t max_priority; | ||
| 189 | 	integer_t base_priority; | ||
| 190 | 	boolean_t depressed; | ||
| 191 | 	integer_t depress_priority; | ||
| 192 | }; | ||
| 193 | |||
| 194 | typedef struct policy_fifo_base *policy_fifo_base_t; | ||
| 195 | typedef struct policy_fifo_limit *policy_fifo_limit_t; | ||
| 196 | typedef struct policy_fifo_info *policy_fifo_info_t; | ||
| 197 | |||
| 198 | typedef struct policy_fifo_base policy_fifo_base_data_t; | ||
| 199 | typedef struct policy_fifo_limit policy_fifo_limit_data_t; | ||
| 200 | typedef struct policy_fifo_info policy_fifo_info_data_t; | ||
| 201 | |||
| 202 | #define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t) \ | ||
| 203 | 	(sizeof(struct policy_fifo_base)/sizeof(integer_t))) | ||
| 204 | #define POLICY_FIFO_LIMIT_COUNT ((mach_msg_type_number_t) \ | ||
| 205 | 	(sizeof(struct policy_fifo_limit)/sizeof(integer_t))) | ||
| 206 | #define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 207 | 	(sizeof(struct policy_fifo_info)/sizeof(integer_t))) | ||
| 208 | |||
| 209 | /* | ||
| 210 | * Aggregate policy types | ||
| 211 | */ | ||
| 212 | |||
| 213 | struct policy_bases { | ||
| 214 | 	policy_timeshare_base_data_t ts; | ||
| 215 | 	policy_rr_base_data_t rr; | ||
| 216 | 	policy_fifo_base_data_t fifo; | ||
| 217 | }; | ||
| 218 | |||
| 219 | struct policy_limits { | ||
| 220 | 	policy_timeshare_limit_data_t ts; | ||
| 221 | 	policy_rr_limit_data_t rr; | ||
| 222 | 	policy_fifo_limit_data_t fifo; | ||
| 223 | }; | ||
| 224 | |||
| 225 | struct policy_infos { | ||
| 226 | 	policy_timeshare_info_data_t ts; | ||
| 227 | 	policy_rr_info_data_t rr; | ||
| 228 | 	policy_fifo_info_data_t fifo; | ||
| 229 | }; | ||
| 230 | |||
| 231 | typedef struct policy_bases policy_base_data_t; | ||
| 232 | typedef struct policy_limits policy_limit_data_t; | ||
| 233 | typedef struct policy_infos policy_info_data_t; | ||
| 234 | |||
| 235 | #endif /* _MACH_POLICY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/port.h created+429| ... | @@ -0,0 +1,429 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | * NOTICE: This file was modified by McAfee Research in 2004 to introduce | ||
| 58 | * support for mandatory and extensible security protections. This notice | ||
| 59 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 60 | * Version 2.0. | ||
| 61 | */ | ||
| 62 | /* | ||
| 63 | */ | ||
| 64 | /* | ||
| 65 | *	File:	mach/port.h | ||
| 66 | * | ||
| 67 | *	Definition of a Mach port | ||
| 68 | * | ||
| 69 | *	Mach ports are the endpoints to Mach-implemented communications | ||
| 70 | *	channels (usually uni-directional message queues, but other types | ||
| 71 | *	also exist). | ||
| 72 | * | ||
| 73 | *	Unique collections of these endpoints are maintained for each | ||
| 74 | *	Mach task. Each Mach port in the task's collection is given a | ||
| 75 | *	[task-local] name to identify it - and the the various "rights" | ||
| 76 | *	held by the task for that specific endpoint. | ||
| 77 | * | ||
| 78 | *	This header defines the types used to identify these Mach ports | ||
| 79 | *	and the various rights associated with them. For more info see: | ||
| 80 | * | ||
| 81 | *	<mach/mach_port.h> - manipulation of port rights in a given space | ||
| 82 | *	<mach/message.h> - message queue [and port right passing] mechanism | ||
| 83 | * | ||
| 84 | */ | ||
| 85 | |||
| 86 | #ifndef _MACH_PORT_H_ | ||
| 87 | #define _MACH_PORT_H_ | ||
| 88 | |||
| 89 | #include <sys/cdefs.h> | ||
| 90 | #include <stdint.h> | ||
| 91 | #include <mach/boolean.h> | ||
| 92 | #include <mach/machine/vm_types.h> | ||
| 93 | |||
| 94 | /* | ||
| 95 | *	mach_port_name_t - the local identity for a Mach port | ||
| 96 | * | ||
| 97 | *	The name is Mach port namespace specific. It is used to | ||
| 98 | *	identify the rights held for that port by the task whose | ||
| 99 | *	namespace is implied [or specifically provided]. | ||
| 100 | * | ||
| 101 | *	Use of this type usually implies just a name - no rights. | ||
| 102 | *	See mach_port_t for a type that implies a "named right." | ||
| 103 | * | ||
| 104 | */ | ||
| 105 | |||
| 106 | typedef natural_t mach_port_name_t; | ||
| 107 | typedef mach_port_name_t *mach_port_name_array_t; | ||
| 108 | |||
| 109 | |||
| 110 | /* | ||
| 111 | *	mach_port_t - a named port right | ||
| 112 | * | ||
| 113 | *	In user-space, "rights" are represented by the name of the | ||
| 114 | *	right in the Mach port namespace. Even so, this type is | ||
| 115 | *	presented as a unique one to more clearly denote the presence | ||
| 116 | *	of a right coming along with the name. | ||
| 117 | * | ||
| 118 | *	Often, various rights for a port held in a single name space | ||
| 119 | *	will coalesce and are, therefore, be identified by a single name | ||
| 120 | *	[this is the case for send and receive rights]. But not | ||
| 121 | *	always [send-once rights currently get a unique name for | ||
| 122 | *	each right]. | ||
| 123 | * | ||
| 124 | */ | ||
| 125 | |||
| 126 | #include <sys/_types.h> | ||
| 127 | #include <sys/_types/_mach_port_t.h> | ||
| 128 | |||
| 129 | |||
| 130 | typedef mach_port_t *mach_port_array_t; | ||
| 131 | |||
| 132 | /* | ||
| 133 | * MACH_PORT_NULL is a legal value that can be carried in messages. | ||
| 134 | * It indicates the absence of any port or port rights. (A port | ||
| 135 | * argument keeps the message from being "simple", even if the | ||
| 136 | * value is MACH_PORT_NULL.) The value MACH_PORT_DEAD is also a legal | ||
| 137 | * value that can be carried in messages. It indicates | ||
| 138 | * that a port right was present, but it died. | ||
| 139 | */ | ||
| 140 | |||
| 141 | #define MACH_PORT_NULL 0 /* intentional loose typing */ | ||
| 142 | #define MACH_PORT_DEAD ((mach_port_name_t) ~0) | ||
| 143 | #define MACH_PORT_VALID(name) \ | ||
| 144 | 	 (((name) != MACH_PORT_NULL) && \ | ||
| 145 | 	 ((name) != MACH_PORT_DEAD)) | ||
| 146 | |||
| 147 | |||
| 148 | /* | ||
| 149 | *	For kernel-selected [assigned] port names, the name is | ||
| 150 | *	comprised of two parts: a generation number and an index. | ||
| 151 | *	This approach keeps the exact same name from being generated | ||
| 152 | *	and reused too quickly [to catch right/reference counting bugs]. | ||
| 153 | *	The dividing line between the constituent parts is exposed so | ||
| 154 | *	that efficient "mach_port_name_t to data structure pointer" | ||
| 155 | *	conversion implementation can be made. But it is possible | ||
| 156 | *	for user-level code to assign their own names to Mach ports. | ||
| 157 | *	These are not required to participate in this algorithm. So | ||
| 158 | *	care should be taken before "assuming" this model. | ||
| 159 | * | ||
| 160 | */ | ||
| 161 | |||
| 162 | #ifndef NO_PORT_GEN | ||
| 163 | |||
| 164 | #define MACH_PORT_INDEX(name) ((name) >> 8) | ||
| 165 | #define MACH_PORT_GEN(name) (((name) & 0xff) << 24) | ||
| 166 | #define MACH_PORT_MAKE(index, gen) \ | ||
| 167 | 	 (((index) << 8) | (gen) >> 24) | ||
| 168 | |||
| 169 | #else /* NO_PORT_GEN */ | ||
| 170 | |||
| 171 | #define MACH_PORT_INDEX(name) (name) | ||
| 172 | #define MACH_PORT_GEN(name) (0) | ||
| 173 | #define MACH_PORT_MAKE(index, gen) (index) | ||
| 174 | |||
| 175 | #endif /* NO_PORT_GEN */ | ||
| 176 | |||
| 177 | |||
| 178 | /* | ||
| 179 | * These are the different rights a task may have for a port. | ||
| 180 | * The MACH_PORT_RIGHT_* definitions are used as arguments | ||
| 181 | * to mach_port_allocate, mach_port_get_refs, etc, to specify | ||
| 182 | * a particular right to act upon. The mach_port_names and | ||
| 183 | * mach_port_type calls return bitmasks using the MACH_PORT_TYPE_* | ||
| 184 | * definitions. This is because a single name may denote | ||
| 185 | * multiple rights. | ||
| 186 | */ | ||
| 187 | |||
| 188 | typedef natural_t mach_port_right_t; | ||
| 189 | |||
| 190 | #define MACH_PORT_RIGHT_SEND ((mach_port_right_t) 0) | ||
| 191 | #define MACH_PORT_RIGHT_RECEIVE ((mach_port_right_t) 1) | ||
| 192 | #define MACH_PORT_RIGHT_SEND_ONCE ((mach_port_right_t) 2) | ||
| 193 | #define MACH_PORT_RIGHT_PORT_SET ((mach_port_right_t) 3) | ||
| 194 | #define MACH_PORT_RIGHT_DEAD_NAME ((mach_port_right_t) 4) | ||
| 195 | #define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) /* obsolete right */ | ||
| 196 | #define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) /* right not implemented */ | ||
| 197 | |||
| 198 | |||
| 199 | typedef natural_t mach_port_type_t; | ||
| 200 | typedef mach_port_type_t *mach_port_type_array_t; | ||
| 201 | |||
| 202 | #define MACH_PORT_TYPE(right) \ | ||
| 203 | 	 ((mach_port_type_t)(((mach_port_type_t) 1) \ | ||
| 204 | 	 << ((right) + ((mach_port_right_t) 16)))) | ||
| 205 | #define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L) | ||
| 206 | #define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND) | ||
| 207 | #define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE) | ||
| 208 | #define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE) | ||
| 209 | #define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET) | ||
| 210 | #define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME) | ||
| 211 | #define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */ | ||
| 212 | |||
| 213 | |||
| 214 | |||
| 215 | /* Convenient combinations. */ | ||
| 216 | |||
| 217 | #define MACH_PORT_TYPE_SEND_RECEIVE \ | ||
| 218 | 	 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE) | ||
| 219 | #define MACH_PORT_TYPE_SEND_RIGHTS \ | ||
| 220 | 	 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE) | ||
| 221 | #define MACH_PORT_TYPE_PORT_RIGHTS \ | ||
| 222 | 	 (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE) | ||
| 223 | #define MACH_PORT_TYPE_PORT_OR_DEAD \ | ||
| 224 | 	 (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME) | ||
| 225 | #define MACH_PORT_TYPE_ALL_RIGHTS \ | ||
| 226 | 	 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET) | ||
| 227 | |||
| 228 | /* Dummy type bits that mach_port_type/mach_port_names can return. */ | ||
| 229 | |||
| 230 | #define MACH_PORT_TYPE_DNREQUEST 0x80000000 | ||
| 231 | #define MACH_PORT_TYPE_SPREQUEST 0x40000000 | ||
| 232 | #define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000 | ||
| 233 | |||
| 234 | /* User-references for capabilities. */ | ||
| 235 | |||
| 236 | typedef natural_t mach_port_urefs_t; | ||
| 237 | typedef integer_t mach_port_delta_t; /* change in urefs */ | ||
| 238 | |||
| 239 | /* Attributes of ports. (See mach_port_get_receive_status.) */ | ||
| 240 | |||
| 241 | typedef natural_t mach_port_seqno_t; /* sequence number */ | ||
| 242 | typedef natural_t mach_port_mscount_t; /* make-send count */ | ||
| 243 | typedef natural_t mach_port_msgcount_t; /* number of msgs */ | ||
| 244 | typedef natural_t mach_port_rights_t; /* number of rights */ | ||
| 245 | |||
| 246 | /* | ||
| 247 | *	Are there outstanding send rights for a given port? | ||
| 248 | */ | ||
| 249 | #define MACH_PORT_SRIGHTS_NONE 0 /* no srights */ | ||
| 250 | #define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */ | ||
| 251 | typedef unsigned int mach_port_srights_t; /* status of send rights */ | ||
| 252 | |||
| 253 | typedef struct mach_port_status { | ||
| 254 | 	mach_port_rights_t mps_pset; /* count of containing port sets */ | ||
| 255 | 	mach_port_seqno_t mps_seqno; /* sequence number */ | ||
| 256 | 	mach_port_mscount_t mps_mscount; /* make-send count */ | ||
| 257 | 	mach_port_msgcount_t mps_qlimit; /* queue limit */ | ||
| 258 | 	mach_port_msgcount_t mps_msgcount; /* number in the queue */ | ||
| 259 | 	mach_port_rights_t mps_sorights; /* how many send-once rights */ | ||
| 260 | 	boolean_t mps_srights; /* do send rights exist? */ | ||
| 261 | 	boolean_t mps_pdrequest; /* port-deleted requested? */ | ||
| 262 | 	boolean_t mps_nsrequest; /* no-senders requested? */ | ||
| 263 | 	natural_t mps_flags; /* port flags */ | ||
| 264 | } mach_port_status_t; | ||
| 265 | |||
| 266 | /* System-wide values for setting queue limits on a port */ | ||
| 267 | #define MACH_PORT_QLIMIT_ZERO (0) | ||
| 268 | #define MACH_PORT_QLIMIT_BASIC (5) | ||
| 269 | #define MACH_PORT_QLIMIT_SMALL (16) | ||
| 270 | #define MACH_PORT_QLIMIT_LARGE (1024) | ||
| 271 | #define MACH_PORT_QLIMIT_KERNEL (65534) | ||
| 272 | #define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO | ||
| 273 | #define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC | ||
| 274 | #define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE | ||
| 275 | |||
| 276 | typedef struct mach_port_limits { | ||
| 277 | 	mach_port_msgcount_t mpl_qlimit; /* number of msgs */ | ||
| 278 | } mach_port_limits_t; | ||
| 279 | |||
| 280 | /* Possible values for mps_flags (part of mach_port_status_t) */ | ||
| 281 | #define MACH_PORT_STATUS_FLAG_TEMPOWNER 0x01 | ||
| 282 | #define MACH_PORT_STATUS_FLAG_GUARDED 0x02 | ||
| 283 | #define MACH_PORT_STATUS_FLAG_STRICT_GUARD 0x04 | ||
| 284 | #define MACH_PORT_STATUS_FLAG_IMP_DONATION 0x08 | ||
| 285 | #define MACH_PORT_STATUS_FLAG_REVIVE 0x10 | ||
| 286 | #define MACH_PORT_STATUS_FLAG_TASKPTR 0x20 | ||
| 287 | #define MACH_PORT_STATUS_FLAG_GUARD_IMMOVABLE_RECEIVE 0x40 | ||
| 288 | #define MACH_PORT_STATUS_FLAG_NO_GRANT 0x80 | ||
| 289 | |||
| 290 | typedef struct mach_port_info_ext { | ||
| 291 | 	mach_port_status_t mpie_status; | ||
| 292 | 	mach_port_msgcount_t mpie_boost_cnt; | ||
| 293 | 	uint32_t reserved[6]; | ||
| 294 | } mach_port_info_ext_t; | ||
| 295 | |||
| 296 | typedef integer_t *mach_port_info_t; /* varying array of natural_t */ | ||
| 297 | |||
| 298 | /* Flavors for mach_port_get/set_attributes() */ | ||
| 299 | typedef int mach_port_flavor_t; | ||
| 300 | #define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_limits_t */ | ||
| 301 | #define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_status_t */ | ||
| 302 | #define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */ | ||
| 303 | #define MACH_PORT_TEMPOWNER 4 /* indicates receive right will be reassigned to another task */ | ||
| 304 | #define MACH_PORT_IMPORTANCE_RECEIVER 5 /* indicates recieve right accepts priority donation */ | ||
| 305 | #define MACH_PORT_DENAP_RECEIVER 6 /* indicates receive right accepts de-nap donation */ | ||
| 306 | #define MACH_PORT_INFO_EXT 7 /* uses mach_port_info_ext_t */ | ||
| 307 | |||
| 308 | #define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \ | ||
| 309 | 	(sizeof(mach_port_limits_t)/sizeof(natural_t))) | ||
| 310 | #define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \ | ||
| 311 | 	(sizeof(mach_port_status_t)/sizeof(natural_t))) | ||
| 312 | #define MACH_PORT_DNREQUESTS_SIZE_COUNT 1 | ||
| 313 | #define MACH_PORT_INFO_EXT_COUNT ((natural_t) \ | ||
| 314 | 	(sizeof(mach_port_info_ext_t)/sizeof(natural_t))) | ||
| 315 | /* | ||
| 316 | * Structure used to pass information about port allocation requests. | ||
| 317 | * Must be padded to 64-bits total length. | ||
| 318 | */ | ||
| 319 | typedef struct mach_port_qos { | ||
| 320 | 	unsigned int name:1; /* name given */ | ||
| 321 | 	unsigned int prealloc:1; /* prealloced message */ | ||
| 322 | 	boolean_t pad1:30; | ||
| 323 | 	natural_t len; | ||
| 324 | } mach_port_qos_t; | ||
| 325 | |||
| 326 | /* Mach Port Guarding definitions */ | ||
| 327 | |||
| 328 | /* | ||
| 329 | * Flags for mach_port_options (used for | ||
| 330 | * invocation of mach_port_construct). | ||
| 331 | * Indicates attributes to be set for the newly | ||
| 332 | * allocated port. | ||
| 333 | */ | ||
| 334 | #define MPO_CONTEXT_AS_GUARD 0x01 /* Add guard to the port */ | ||
| 335 | #define MPO_QLIMIT 0x02 /* Set qlimit for the port msg queue */ | ||
| 336 | #define MPO_TEMPOWNER 0x04 /* Set the tempowner bit of the port */ | ||
| 337 | #define MPO_IMPORTANCE_RECEIVER 0x08 /* Mark the port as importance receiver */ | ||
| 338 | #define MPO_INSERT_SEND_RIGHT 0x10 /* Insert a send right for the port */ | ||
| 339 | #define MPO_STRICT 0x20 /* Apply strict guarding for port */ | ||
| 340 | #define MPO_DENAP_RECEIVER 0x40 /* Mark the port as App de-nap receiver */ | ||
| 341 | #define MPO_IMMOVABLE_RECEIVE 0x80 /* Mark the port as immovable; protected by the guard context */ | ||
| 342 | #define MPO_FILTER_MSG 0x100 /* Allow message filtering */ | ||
| 343 | #define MPO_TG_BLOCK_TRACKING 0x200 /* Track blocking relationship for thread group during sync IPC */ | ||
| 344 | |||
| 345 | /* | ||
| 346 | * Structure to define optional attributes for a newly | ||
| 347 | * constructed port. | ||
| 348 | */ | ||
| 349 | typedef struct mach_port_options { | ||
| 350 | 	uint32_t flags; /* Flags defining attributes for port */ | ||
| 351 | 	mach_port_limits_t mpl; /* Message queue limit for port */ | ||
| 352 | 	union { | ||
| 353 | 		uint64_t reserved[2]; /* Reserved */ | ||
| 354 | 		mach_port_name_t work_interval_port; /* Work interval port */ | ||
| 355 | 	}; | ||
| 356 | }mach_port_options_t; | ||
| 357 | |||
| 358 | typedef mach_port_options_t *mach_port_options_ptr_t; | ||
| 359 | |||
| 360 | /* | ||
| 361 | * EXC_GUARD represents a guard violation for both | ||
| 362 | * mach ports and file descriptors. GUARD_TYPE_ is used | ||
| 363 | * to differentiate among them. | ||
| 364 | */ | ||
| 365 | #define GUARD_TYPE_MACH_PORT 0x1 | ||
| 366 | |||
| 367 | /* Reasons for exception for a guarded mach port */ | ||
| 368 | enum mach_port_guard_exception_codes { | ||
| 369 | 	kGUARD_EXC_DESTROY = 1u << 0, | ||
| 370 | 	kGUARD_EXC_MOD_REFS = 1u << 1, | ||
| 371 | 	kGUARD_EXC_SET_CONTEXT = 1u << 2, | ||
| 372 | 	kGUARD_EXC_UNGUARDED = 1u << 3, | ||
| 373 | 	kGUARD_EXC_INCORRECT_GUARD = 1u << 4, | ||
| 374 | 	kGUARD_EXC_IMMOVABLE = 1u << 5, | ||
| 375 | 	kGUARD_EXC_STRICT_REPLY = 1u << 6, | ||
| 376 | 	kGUARD_EXC_MSG_FILTERED = 1u << 7, | ||
| 377 | 	/* start of [optionally] non-fatal guards */ | ||
| 378 | 	kGUARD_EXC_INVALID_RIGHT = 1u << 8, | ||
| 379 | 	kGUARD_EXC_INVALID_NAME = 1u << 9, | ||
| 380 | 	kGUARD_EXC_INVALID_VALUE = 1u << 10, | ||
| 381 | 	kGUARD_EXC_INVALID_ARGUMENT = 1u << 11, | ||
| 382 | 	kGUARD_EXC_RIGHT_EXISTS = 1u << 12, | ||
| 383 | 	kGUARD_EXC_KERN_NO_SPACE = 1u << 13, | ||
| 384 | 	kGUARD_EXC_KERN_FAILURE = 1u << 14, | ||
| 385 | 	kGUARD_EXC_KERN_RESOURCE = 1u << 15, | ||
| 386 | 	kGUARD_EXC_SEND_INVALID_REPLY = 1u << 16, | ||
| 387 | 	kGUARD_EXC_SEND_INVALID_VOUCHER = 1u << 17, | ||
| 388 | 	kGUARD_EXC_SEND_INVALID_RIGHT = 1u << 18, | ||
| 389 | 	kGUARD_EXC_RCV_INVALID_NAME = 1u << 19, | ||
| 390 | 	kGUARD_EXC_RCV_GUARDED_DESC = 1u << 20, /* should never be fatal; for development only */ | ||
| 391 | }; | ||
| 392 | |||
| 393 | #define MAX_FATAL_kGUARD_EXC_CODE (1u << 6) | ||
| 394 | |||
| 395 | /* | ||
| 396 | * These flags are used as bits in the subcode of kGUARD_EXC_STRICT_REPLY exceptions. | ||
| 397 | */ | ||
| 398 | #define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_DISP (0x01ull << 56) | ||
| 399 | #define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_PORT (0x02ull << 56) | ||
| 400 | #define MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER (0x04ull << 56) | ||
| 401 | #define MPG_FLAGS_STRICT_REPLY_NO_BANK_ATTR (0x08ull << 56) | ||
| 402 | #define MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA (0x10ull << 56) | ||
| 403 | #define MPG_FLAGS_STRICT_REPLY_MASK (0xffull << 56) | ||
| 404 | |||
| 405 | /* | ||
| 406 | * Flags for mach_port_guard_with_flags. These flags extend | ||
| 407 | * the attributes associated with a guarded port. | ||
| 408 | */ | ||
| 409 | #define MPG_STRICT 0x01 /* Apply strict guarding for a port */ | ||
| 410 | #define MPG_IMMOVABLE_RECEIVE 0x02 /* Receive right cannot be moved out of the space */ | ||
| 411 | |||
| 412 | #if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH) | ||
| 413 | /* | ||
| 414 | * Mach 3.0 renamed everything to have mach_ in front of it. | ||
| 415 | * These types and macros are provided for backward compatibility | ||
| 416 | *	but are deprecated. | ||
| 417 | */ | ||
| 418 | typedef mach_port_t port_t; | ||
| 419 | typedef mach_port_name_t port_name_t; | ||
| 420 | typedef mach_port_name_t *port_name_array_t; | ||
| 421 | |||
| 422 | #define PORT_NULL ((port_t) 0) | ||
| 423 | #define PORT_DEAD ((port_t) ~0) | ||
| 424 | #define PORT_VALID(name) \ | ||
| 425 | 	 ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD) | ||
| 426 | |||
| 427 | #endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */ | ||
| 428 | |||
| 429 | #endif /* _MACH_PORT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/processor.h created+360| ... | @@ -0,0 +1,360 @@ | ||
| 1 | #ifndef	_processor_user_ | ||
| 2 | #define	_processor_user_ | ||
| 3 | |||
| 4 | /* Module processor */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	processor_MSG_COUNT | ||
| 52 | #define	processor_MSG_COUNT	6 | ||
| 53 | #endif	/* processor_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | |||
| 60 | #ifdef __BeforeMigUserHeader | ||
| 61 | __BeforeMigUserHeader | ||
| 62 | #endif /* __BeforeMigUserHeader */ | ||
| 63 | |||
| 64 | #include <sys/cdefs.h> | ||
| 65 | __BEGIN_DECLS | ||
| 66 | |||
| 67 | |||
| 68 | /* Routine processor_start */ | ||
| 69 | #ifdef	mig_external | ||
| 70 | mig_external | ||
| 71 | #else | ||
| 72 | extern | ||
| 73 | #endif	/* mig_external */ | ||
| 74 | kern_return_t processor_start | ||
| 75 | ( | ||
| 76 | 	processor_t processor | ||
| 77 | ); | ||
| 78 | |||
| 79 | /* Routine processor_exit */ | ||
| 80 | #ifdef	mig_external | ||
| 81 | mig_external | ||
| 82 | #else | ||
| 83 | extern | ||
| 84 | #endif	/* mig_external */ | ||
| 85 | kern_return_t processor_exit | ||
| 86 | ( | ||
| 87 | 	processor_t processor | ||
| 88 | ); | ||
| 89 | |||
| 90 | /* Routine processor_info */ | ||
| 91 | #ifdef	mig_external | ||
| 92 | mig_external | ||
| 93 | #else | ||
| 94 | extern | ||
| 95 | #endif	/* mig_external */ | ||
| 96 | kern_return_t processor_info | ||
| 97 | ( | ||
| 98 | 	processor_t processor, | ||
| 99 | 	processor_flavor_t flavor, | ||
| 100 | 	host_t *host, | ||
| 101 | 	processor_info_t processor_info_out, | ||
| 102 | 	mach_msg_type_number_t *processor_info_outCnt | ||
| 103 | ); | ||
| 104 | |||
| 105 | /* Routine processor_control */ | ||
| 106 | #ifdef	mig_external | ||
| 107 | mig_external | ||
| 108 | #else | ||
| 109 | extern | ||
| 110 | #endif	/* mig_external */ | ||
| 111 | kern_return_t processor_control | ||
| 112 | ( | ||
| 113 | 	processor_t processor, | ||
| 114 | 	processor_info_t processor_cmd, | ||
| 115 | 	mach_msg_type_number_t processor_cmdCnt | ||
| 116 | ); | ||
| 117 | |||
| 118 | /* Routine processor_assign */ | ||
| 119 | #ifdef	mig_external | ||
| 120 | mig_external | ||
| 121 | #else | ||
| 122 | extern | ||
| 123 | #endif	/* mig_external */ | ||
| 124 | kern_return_t processor_assign | ||
| 125 | ( | ||
| 126 | 	processor_t processor, | ||
| 127 | 	processor_set_t new_set, | ||
| 128 | 	boolean_t wait | ||
| 129 | ); | ||
| 130 | |||
| 131 | /* Routine processor_get_assignment */ | ||
| 132 | #ifdef	mig_external | ||
| 133 | mig_external | ||
| 134 | #else | ||
| 135 | extern | ||
| 136 | #endif	/* mig_external */ | ||
| 137 | kern_return_t processor_get_assignment | ||
| 138 | ( | ||
| 139 | 	processor_t processor, | ||
| 140 | 	processor_set_name_t *assigned_set | ||
| 141 | ); | ||
| 142 | |||
| 143 | __END_DECLS | ||
| 144 | |||
| 145 | /********************** Caution **************************/ | ||
| 146 | /* The following data types should be used to calculate */ | ||
| 147 | /* maximum message sizes only. The actual message may be */ | ||
| 148 | /* smaller, and the position of the arguments within the */ | ||
| 149 | /* message layout may vary from what is presented here. */ | ||
| 150 | /* For example, if any of the arguments are variable- */ | ||
| 151 | /* sized, and less than the maximum is sent, the data */ | ||
| 152 | /* will be packed tight in the actual message to reduce */ | ||
| 153 | /* the presence of holes. */ | ||
| 154 | /********************** Caution **************************/ | ||
| 155 | |||
| 156 | /* typedefs for all requests */ | ||
| 157 | |||
| 158 | #ifndef __Request__processor_subsystem__defined | ||
| 159 | #define __Request__processor_subsystem__defined | ||
| 160 | |||
| 161 | #ifdef __MigPackStructs | ||
| 162 | #pragma pack(push, 4) | ||
| 163 | #endif | ||
| 164 | 	typedef struct { | ||
| 165 | 		mach_msg_header_t Head; | ||
| 166 | 	} __Request__processor_start_t __attribute__((unused)); | ||
| 167 | #ifdef __MigPackStructs | ||
| 168 | #pragma pack(pop) | ||
| 169 | #endif | ||
| 170 | |||
| 171 | #ifdef __MigPackStructs | ||
| 172 | #pragma pack(push, 4) | ||
| 173 | #endif | ||
| 174 | 	typedef struct { | ||
| 175 | 		mach_msg_header_t Head; | ||
| 176 | 	} __Request__processor_exit_t __attribute__((unused)); | ||
| 177 | #ifdef __MigPackStructs | ||
| 178 | #pragma pack(pop) | ||
| 179 | #endif | ||
| 180 | |||
| 181 | #ifdef __MigPackStructs | ||
| 182 | #pragma pack(push, 4) | ||
| 183 | #endif | ||
| 184 | 	typedef struct { | ||
| 185 | 		mach_msg_header_t Head; | ||
| 186 | 		NDR_record_t NDR; | ||
| 187 | 		processor_flavor_t flavor; | ||
| 188 | 		mach_msg_type_number_t processor_info_outCnt; | ||
| 189 | 	} __Request__processor_info_t __attribute__((unused)); | ||
| 190 | #ifdef __MigPackStructs | ||
| 191 | #pragma pack(pop) | ||
| 192 | #endif | ||
| 193 | |||
| 194 | #ifdef __MigPackStructs | ||
| 195 | #pragma pack(push, 4) | ||
| 196 | #endif | ||
| 197 | 	typedef struct { | ||
| 198 | 		mach_msg_header_t Head; | ||
| 199 | 		NDR_record_t NDR; | ||
| 200 | 		mach_msg_type_number_t processor_cmdCnt; | ||
| 201 | 		integer_t processor_cmd[20]; | ||
| 202 | 	} __Request__processor_control_t __attribute__((unused)); | ||
| 203 | #ifdef __MigPackStructs | ||
| 204 | #pragma pack(pop) | ||
| 205 | #endif | ||
| 206 | |||
| 207 | #ifdef __MigPackStructs | ||
| 208 | #pragma pack(push, 4) | ||
| 209 | #endif | ||
| 210 | 	typedef struct { | ||
| 211 | 		mach_msg_header_t Head; | ||
| 212 | 		/* start of the kernel processed data */ | ||
| 213 | 		mach_msg_body_t msgh_body; | ||
| 214 | 		mach_msg_port_descriptor_t new_set; | ||
| 215 | 		/* end of the kernel processed data */ | ||
| 216 | 		NDR_record_t NDR; | ||
| 217 | 		boolean_t wait; | ||
| 218 | 	} __Request__processor_assign_t __attribute__((unused)); | ||
| 219 | #ifdef __MigPackStructs | ||
| 220 | #pragma pack(pop) | ||
| 221 | #endif | ||
| 222 | |||
| 223 | #ifdef __MigPackStructs | ||
| 224 | #pragma pack(push, 4) | ||
| 225 | #endif | ||
| 226 | 	typedef struct { | ||
| 227 | 		mach_msg_header_t Head; | ||
| 228 | 	} __Request__processor_get_assignment_t __attribute__((unused)); | ||
| 229 | #ifdef __MigPackStructs | ||
| 230 | #pragma pack(pop) | ||
| 231 | #endif | ||
| 232 | #endif /* !__Request__processor_subsystem__defined */ | ||
| 233 | |||
| 234 | /* union of all requests */ | ||
| 235 | |||
| 236 | #ifndef __RequestUnion__processor_subsystem__defined | ||
| 237 | #define __RequestUnion__processor_subsystem__defined | ||
| 238 | union __RequestUnion__processor_subsystem { | ||
| 239 | 	__Request__processor_start_t Request_processor_start; | ||
| 240 | 	__Request__processor_exit_t Request_processor_exit; | ||
| 241 | 	__Request__processor_info_t Request_processor_info; | ||
| 242 | 	__Request__processor_control_t Request_processor_control; | ||
| 243 | 	__Request__processor_assign_t Request_processor_assign; | ||
| 244 | 	__Request__processor_get_assignment_t Request_processor_get_assignment; | ||
| 245 | }; | ||
| 246 | #endif /* !__RequestUnion__processor_subsystem__defined */ | ||
| 247 | /* typedefs for all replies */ | ||
| 248 | |||
| 249 | #ifndef __Reply__processor_subsystem__defined | ||
| 250 | #define __Reply__processor_subsystem__defined | ||
| 251 | |||
| 252 | #ifdef __MigPackStructs | ||
| 253 | #pragma pack(push, 4) | ||
| 254 | #endif | ||
| 255 | 	typedef struct { | ||
| 256 | 		mach_msg_header_t Head; | ||
| 257 | 		NDR_record_t NDR; | ||
| 258 | 		kern_return_t RetCode; | ||
| 259 | 	} __Reply__processor_start_t __attribute__((unused)); | ||
| 260 | #ifdef __MigPackStructs | ||
| 261 | #pragma pack(pop) | ||
| 262 | #endif | ||
| 263 | |||
| 264 | #ifdef __MigPackStructs | ||
| 265 | #pragma pack(push, 4) | ||
| 266 | #endif | ||
| 267 | 	typedef struct { | ||
| 268 | 		mach_msg_header_t Head; | ||
| 269 | 		NDR_record_t NDR; | ||
| 270 | 		kern_return_t RetCode; | ||
| 271 | 	} __Reply__processor_exit_t __attribute__((unused)); | ||
| 272 | #ifdef __MigPackStructs | ||
| 273 | #pragma pack(pop) | ||
| 274 | #endif | ||
| 275 | |||
| 276 | #ifdef __MigPackStructs | ||
| 277 | #pragma pack(push, 4) | ||
| 278 | #endif | ||
| 279 | 	typedef struct { | ||
| 280 | 		mach_msg_header_t Head; | ||
| 281 | 		/* start of the kernel processed data */ | ||
| 282 | 		mach_msg_body_t msgh_body; | ||
| 283 | 		mach_msg_port_descriptor_t host; | ||
| 284 | 		/* end of the kernel processed data */ | ||
| 285 | 		NDR_record_t NDR; | ||
| 286 | 		mach_msg_type_number_t processor_info_outCnt; | ||
| 287 | 		integer_t processor_info_out[20]; | ||
| 288 | 	} __Reply__processor_info_t __attribute__((unused)); | ||
| 289 | #ifdef __MigPackStructs | ||
| 290 | #pragma pack(pop) | ||
| 291 | #endif | ||
| 292 | |||
| 293 | #ifdef __MigPackStructs | ||
| 294 | #pragma pack(push, 4) | ||
| 295 | #endif | ||
| 296 | 	typedef struct { | ||
| 297 | 		mach_msg_header_t Head; | ||
| 298 | 		NDR_record_t NDR; | ||
| 299 | 		kern_return_t RetCode; | ||
| 300 | 	} __Reply__processor_control_t __attribute__((unused)); | ||
| 301 | #ifdef __MigPackStructs | ||
| 302 | #pragma pack(pop) | ||
| 303 | #endif | ||
| 304 | |||
| 305 | #ifdef __MigPackStructs | ||
| 306 | #pragma pack(push, 4) | ||
| 307 | #endif | ||
| 308 | 	typedef struct { | ||
| 309 | 		mach_msg_header_t Head; | ||
| 310 | 		NDR_record_t NDR; | ||
| 311 | 		kern_return_t RetCode; | ||
| 312 | 	} __Reply__processor_assign_t __attribute__((unused)); | ||
| 313 | #ifdef __MigPackStructs | ||
| 314 | #pragma pack(pop) | ||
| 315 | #endif | ||
| 316 | |||
| 317 | #ifdef __MigPackStructs | ||
| 318 | #pragma pack(push, 4) | ||
| 319 | #endif | ||
| 320 | 	typedef struct { | ||
| 321 | 		mach_msg_header_t Head; | ||
| 322 | 		/* start of the kernel processed data */ | ||
| 323 | 		mach_msg_body_t msgh_body; | ||
| 324 | 		mach_msg_port_descriptor_t assigned_set; | ||
| 325 | 		/* end of the kernel processed data */ | ||
| 326 | 	} __Reply__processor_get_assignment_t __attribute__((unused)); | ||
| 327 | #ifdef __MigPackStructs | ||
| 328 | #pragma pack(pop) | ||
| 329 | #endif | ||
| 330 | #endif /* !__Reply__processor_subsystem__defined */ | ||
| 331 | |||
| 332 | /* union of all replies */ | ||
| 333 | |||
| 334 | #ifndef __ReplyUnion__processor_subsystem__defined | ||
| 335 | #define __ReplyUnion__processor_subsystem__defined | ||
| 336 | union __ReplyUnion__processor_subsystem { | ||
| 337 | 	__Reply__processor_start_t Reply_processor_start; | ||
| 338 | 	__Reply__processor_exit_t Reply_processor_exit; | ||
| 339 | 	__Reply__processor_info_t Reply_processor_info; | ||
| 340 | 	__Reply__processor_control_t Reply_processor_control; | ||
| 341 | 	__Reply__processor_assign_t Reply_processor_assign; | ||
| 342 | 	__Reply__processor_get_assignment_t Reply_processor_get_assignment; | ||
| 343 | }; | ||
| 344 | #endif /* !__RequestUnion__processor_subsystem__defined */ | ||
| 345 | |||
| 346 | #ifndef subsystem_to_name_map_processor | ||
| 347 | #define subsystem_to_name_map_processor \ | ||
| 348 | { "processor_start", 3000 },\ | ||
| 349 | { "processor_exit", 3001 },\ | ||
| 350 | { "processor_info", 3002 },\ | ||
| 351 | { "processor_control", 3003 },\ | ||
| 352 | { "processor_assign", 3004 },\ | ||
| 353 | { "processor_get_assignment", 3005 } | ||
| 354 | #endif | ||
| 355 | |||
| 356 | #ifdef __AfterMigUserHeader | ||
| 357 | __AfterMigUserHeader | ||
| 358 | #endif /* __AfterMigUserHeader */ | ||
| 359 | |||
| 360 | #endif	 /* _processor_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/processor_info.h created+153| ... | @@ -0,0 +1,153 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | /* | ||
| 60 | *	File:	mach/processor_info.h | ||
| 61 | *	Author:	David L. Black | ||
| 62 | *	Date:	1988 | ||
| 63 | * | ||
| 64 | *	Data structure definitions for processor_info, processor_set_info | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_PROCESSOR_INFO_H_ | ||
| 68 | #define _MACH_PROCESSOR_INFO_H_ | ||
| 69 | |||
| 70 | #include <mach/message.h> | ||
| 71 | #include <mach/machine.h> | ||
| 72 | #include <mach/machine/processor_info.h> | ||
| 73 | |||
| 74 | /* | ||
| 75 | *	Generic information structure to allow for expansion. | ||
| 76 | */ | ||
| 77 | typedef integer_t *processor_info_t; /* varying array of int. */ | ||
| 78 | typedef integer_t *processor_info_array_t; /* varying array of int */ | ||
| 79 | |||
| 80 | #define PROCESSOR_INFO_MAX (1024) /* max array size */ | ||
| 81 | typedef integer_t processor_info_data_t[PROCESSOR_INFO_MAX]; | ||
| 82 | |||
| 83 | |||
| 84 | typedef integer_t *processor_set_info_t; /* varying array of int. */ | ||
| 85 | |||
| 86 | #define PROCESSOR_SET_INFO_MAX (1024) /* max array size */ | ||
| 87 | typedef integer_t processor_set_info_data_t[PROCESSOR_SET_INFO_MAX]; | ||
| 88 | |||
| 89 | /* | ||
| 90 | *	Currently defined information. | ||
| 91 | */ | ||
| 92 | typedef int processor_flavor_t; | ||
| 93 | #define PROCESSOR_BASIC_INFO 1 /* basic information */ | ||
| 94 | #define PROCESSOR_CPU_LOAD_INFO 2 /* cpu load information */ | ||
| 95 | #define PROCESSOR_PM_REGS_INFO 0x10000001 /* performance monitor register info */ | ||
| 96 | #define PROCESSOR_TEMPERATURE 0x10000002 /* Processor core temperature */ | ||
| 97 | |||
| 98 | struct processor_basic_info { | ||
| 99 | 	cpu_type_t cpu_type; /* type of cpu */ | ||
| 100 | 	cpu_subtype_t cpu_subtype; /* subtype of cpu */ | ||
| 101 | 	boolean_t running; /* is processor running */ | ||
| 102 | 	int slot_num; /* slot number */ | ||
| 103 | 	boolean_t is_master; /* is this the master processor */ | ||
| 104 | }; | ||
| 105 | |||
| 106 | typedef struct processor_basic_info processor_basic_info_data_t; | ||
| 107 | typedef struct processor_basic_info *processor_basic_info_t; | ||
| 108 | #define PROCESSOR_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 109 | 	 (sizeof(processor_basic_info_data_t)/sizeof(natural_t))) | ||
| 110 | |||
| 111 | struct processor_cpu_load_info { /* number of ticks while running... */ | ||
| 112 | 	unsigned int cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ | ||
| 113 | }; | ||
| 114 | |||
| 115 | typedef struct processor_cpu_load_info processor_cpu_load_info_data_t; | ||
| 116 | typedef struct processor_cpu_load_info *processor_cpu_load_info_t; | ||
| 117 | #define PROCESSOR_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 118 | 	 (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t))) | ||
| 119 | |||
| 120 | /* | ||
| 121 | *	Scaling factor for load_average, mach_factor. | ||
| 122 | */ | ||
| 123 | #define LOAD_SCALE 1000 | ||
| 124 | |||
| 125 | typedef int processor_set_flavor_t; | ||
| 126 | #define PROCESSOR_SET_BASIC_INFO 5 /* basic information */ | ||
| 127 | |||
| 128 | struct processor_set_basic_info { | ||
| 129 | 	int processor_count; /* How many processors */ | ||
| 130 | 	int default_policy; /* When others not enabled */ | ||
| 131 | }; | ||
| 132 | |||
| 133 | typedef struct processor_set_basic_info processor_set_basic_info_data_t; | ||
| 134 | typedef struct processor_set_basic_info *processor_set_basic_info_t; | ||
| 135 | #define PROCESSOR_SET_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 136 | 	 (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t))) | ||
| 137 | |||
| 138 | #define PROCESSOR_SET_LOAD_INFO 4 /* scheduling statistics */ | ||
| 139 | |||
| 140 | struct processor_set_load_info { | ||
| 141 | 	int task_count; /* How many tasks */ | ||
| 142 | 	int thread_count; /* How many threads */ | ||
| 143 | 	integer_t load_average; /* Scaled */ | ||
| 144 | 	integer_t mach_factor; /* Scaled */ | ||
| 145 | }; | ||
| 146 | |||
| 147 | typedef struct processor_set_load_info processor_set_load_info_data_t; | ||
| 148 | typedef struct processor_set_load_info *processor_set_load_info_t; | ||
| 149 | #define PROCESSOR_SET_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 150 | 	 (sizeof(processor_set_load_info_data_t)/sizeof(natural_t))) | ||
| 151 | |||
| 152 | |||
| 153 | #endif /* _MACH_PROCESSOR_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/processor_set.h created+585| ... | @@ -0,0 +1,585 @@ | ||
| 1 | #ifndef	_processor_set_user_ | ||
| 2 | #define	_processor_set_user_ | ||
| 3 | |||
| 4 | /* Module processor_set */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	processor_set_MSG_COUNT | ||
| 52 | #define	processor_set_MSG_COUNT	11 | ||
| 53 | #endif	/* processor_set_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | |||
| 60 | #ifdef __BeforeMigUserHeader | ||
| 61 | __BeforeMigUserHeader | ||
| 62 | #endif /* __BeforeMigUserHeader */ | ||
| 63 | |||
| 64 | #include <sys/cdefs.h> | ||
| 65 | __BEGIN_DECLS | ||
| 66 | |||
| 67 | |||
| 68 | /* Routine processor_set_statistics */ | ||
| 69 | #ifdef	mig_external | ||
| 70 | mig_external | ||
| 71 | #else | ||
| 72 | extern | ||
| 73 | #endif	/* mig_external */ | ||
| 74 | kern_return_t processor_set_statistics | ||
| 75 | ( | ||
| 76 | 	processor_set_name_t pset, | ||
| 77 | 	processor_set_flavor_t flavor, | ||
| 78 | 	processor_set_info_t info_out, | ||
| 79 | 	mach_msg_type_number_t *info_outCnt | ||
| 80 | ); | ||
| 81 | |||
| 82 | /* Routine processor_set_destroy */ | ||
| 83 | #ifdef	mig_external | ||
| 84 | mig_external | ||
| 85 | #else | ||
| 86 | extern | ||
| 87 | #endif	/* mig_external */ | ||
| 88 | kern_return_t processor_set_destroy | ||
| 89 | ( | ||
| 90 | 	processor_set_t set | ||
| 91 | ); | ||
| 92 | |||
| 93 | /* Routine processor_set_max_priority */ | ||
| 94 | #ifdef	mig_external | ||
| 95 | mig_external | ||
| 96 | #else | ||
| 97 | extern | ||
| 98 | #endif	/* mig_external */ | ||
| 99 | kern_return_t processor_set_max_priority | ||
| 100 | ( | ||
| 101 | 	processor_set_t processor_set, | ||
| 102 | 	int max_priority, | ||
| 103 | 	boolean_t change_threads | ||
| 104 | ); | ||
| 105 | |||
| 106 | /* Routine processor_set_policy_enable */ | ||
| 107 | #ifdef	mig_external | ||
| 108 | mig_external | ||
| 109 | #else | ||
| 110 | extern | ||
| 111 | #endif	/* mig_external */ | ||
| 112 | kern_return_t processor_set_policy_enable | ||
| 113 | ( | ||
| 114 | 	processor_set_t processor_set, | ||
| 115 | 	int policy | ||
| 116 | ); | ||
| 117 | |||
| 118 | /* Routine processor_set_policy_disable */ | ||
| 119 | #ifdef	mig_external | ||
| 120 | mig_external | ||
| 121 | #else | ||
| 122 | extern | ||
| 123 | #endif	/* mig_external */ | ||
| 124 | kern_return_t processor_set_policy_disable | ||
| 125 | ( | ||
| 126 | 	processor_set_t processor_set, | ||
| 127 | 	int policy, | ||
| 128 | 	boolean_t change_threads | ||
| 129 | ); | ||
| 130 | |||
| 131 | /* Routine processor_set_tasks */ | ||
| 132 | #ifdef	mig_external | ||
| 133 | mig_external | ||
| 134 | #else | ||
| 135 | extern | ||
| 136 | #endif	/* mig_external */ | ||
| 137 | kern_return_t processor_set_tasks | ||
| 138 | ( | ||
| 139 | 	processor_set_t processor_set, | ||
| 140 | 	task_array_t *task_list, | ||
| 141 | 	mach_msg_type_number_t *task_listCnt | ||
| 142 | ); | ||
| 143 | |||
| 144 | /* Routine processor_set_threads */ | ||
| 145 | #ifdef	mig_external | ||
| 146 | mig_external | ||
| 147 | #else | ||
| 148 | extern | ||
| 149 | #endif	/* mig_external */ | ||
| 150 | kern_return_t processor_set_threads | ||
| 151 | ( | ||
| 152 | 	processor_set_t processor_set, | ||
| 153 | 	thread_act_array_t *thread_list, | ||
| 154 | 	mach_msg_type_number_t *thread_listCnt | ||
| 155 | ); | ||
| 156 | |||
| 157 | /* Routine processor_set_policy_control */ | ||
| 158 | #ifdef	mig_external | ||
| 159 | mig_external | ||
| 160 | #else | ||
| 161 | extern | ||
| 162 | #endif	/* mig_external */ | ||
| 163 | kern_return_t processor_set_policy_control | ||
| 164 | ( | ||
| 165 | 	processor_set_t pset, | ||
| 166 | 	processor_set_flavor_t flavor, | ||
| 167 | 	processor_set_info_t policy_info, | ||
| 168 | 	mach_msg_type_number_t policy_infoCnt, | ||
| 169 | 	boolean_t change | ||
| 170 | ); | ||
| 171 | |||
| 172 | /* Routine processor_set_stack_usage */ | ||
| 173 | #ifdef	mig_external | ||
| 174 | mig_external | ||
| 175 | #else | ||
| 176 | extern | ||
| 177 | #endif	/* mig_external */ | ||
| 178 | kern_return_t processor_set_stack_usage | ||
| 179 | ( | ||
| 180 | 	processor_set_t pset, | ||
| 181 | 	unsigned *ltotal, | ||
| 182 | 	vm_size_t *space, | ||
| 183 | 	vm_size_t *resident, | ||
| 184 | 	vm_size_t *maxusage, | ||
| 185 | 	vm_offset_t *maxstack | ||
| 186 | ); | ||
| 187 | |||
| 188 | /* Routine processor_set_info */ | ||
| 189 | #ifdef	mig_external | ||
| 190 | mig_external | ||
| 191 | #else | ||
| 192 | extern | ||
| 193 | #endif	/* mig_external */ | ||
| 194 | kern_return_t processor_set_info | ||
| 195 | ( | ||
| 196 | 	processor_set_name_t set_name, | ||
| 197 | 	int flavor, | ||
| 198 | 	host_t *host, | ||
| 199 | 	processor_set_info_t info_out, | ||
| 200 | 	mach_msg_type_number_t *info_outCnt | ||
| 201 | ); | ||
| 202 | |||
| 203 | /* Routine processor_set_tasks_with_flavor */ | ||
| 204 | #ifdef	mig_external | ||
| 205 | mig_external | ||
| 206 | #else | ||
| 207 | extern | ||
| 208 | #endif	/* mig_external */ | ||
| 209 | kern_return_t processor_set_tasks_with_flavor | ||
| 210 | ( | ||
| 211 | 	processor_set_t processor_set, | ||
| 212 | 	mach_task_flavor_t flavor, | ||
| 213 | 	task_array_t *task_list, | ||
| 214 | 	mach_msg_type_number_t *task_listCnt | ||
| 215 | ); | ||
| 216 | |||
| 217 | __END_DECLS | ||
| 218 | |||
| 219 | /********************** Caution **************************/ | ||
| 220 | /* The following data types should be used to calculate */ | ||
| 221 | /* maximum message sizes only. The actual message may be */ | ||
| 222 | /* smaller, and the position of the arguments within the */ | ||
| 223 | /* message layout may vary from what is presented here. */ | ||
| 224 | /* For example, if any of the arguments are variable- */ | ||
| 225 | /* sized, and less than the maximum is sent, the data */ | ||
| 226 | /* will be packed tight in the actual message to reduce */ | ||
| 227 | /* the presence of holes. */ | ||
| 228 | /********************** Caution **************************/ | ||
| 229 | |||
| 230 | /* typedefs for all requests */ | ||
| 231 | |||
| 232 | #ifndef __Request__processor_set_subsystem__defined | ||
| 233 | #define __Request__processor_set_subsystem__defined | ||
| 234 | |||
| 235 | #ifdef __MigPackStructs | ||
| 236 | #pragma pack(push, 4) | ||
| 237 | #endif | ||
| 238 | 	typedef struct { | ||
| 239 | 		mach_msg_header_t Head; | ||
| 240 | 		NDR_record_t NDR; | ||
| 241 | 		processor_set_flavor_t flavor; | ||
| 242 | 		mach_msg_type_number_t info_outCnt; | ||
| 243 | 	} __Request__processor_set_statistics_t __attribute__((unused)); | ||
| 244 | #ifdef __MigPackStructs | ||
| 245 | #pragma pack(pop) | ||
| 246 | #endif | ||
| 247 | |||
| 248 | #ifdef __MigPackStructs | ||
| 249 | #pragma pack(push, 4) | ||
| 250 | #endif | ||
| 251 | 	typedef struct { | ||
| 252 | 		mach_msg_header_t Head; | ||
| 253 | 	} __Request__processor_set_destroy_t __attribute__((unused)); | ||
| 254 | #ifdef __MigPackStructs | ||
| 255 | #pragma pack(pop) | ||
| 256 | #endif | ||
| 257 | |||
| 258 | #ifdef __MigPackStructs | ||
| 259 | #pragma pack(push, 4) | ||
| 260 | #endif | ||
| 261 | 	typedef struct { | ||
| 262 | 		mach_msg_header_t Head; | ||
| 263 | 		NDR_record_t NDR; | ||
| 264 | 		int max_priority; | ||
| 265 | 		boolean_t change_threads; | ||
| 266 | 	} __Request__processor_set_max_priority_t __attribute__((unused)); | ||
| 267 | #ifdef __MigPackStructs | ||
| 268 | #pragma pack(pop) | ||
| 269 | #endif | ||
| 270 | |||
| 271 | #ifdef __MigPackStructs | ||
| 272 | #pragma pack(push, 4) | ||
| 273 | #endif | ||
| 274 | 	typedef struct { | ||
| 275 | 		mach_msg_header_t Head; | ||
| 276 | 		NDR_record_t NDR; | ||
| 277 | 		int policy; | ||
| 278 | 	} __Request__processor_set_policy_enable_t __attribute__((unused)); | ||
| 279 | #ifdef __MigPackStructs | ||
| 280 | #pragma pack(pop) | ||
| 281 | #endif | ||
| 282 | |||
| 283 | #ifdef __MigPackStructs | ||
| 284 | #pragma pack(push, 4) | ||
| 285 | #endif | ||
| 286 | 	typedef struct { | ||
| 287 | 		mach_msg_header_t Head; | ||
| 288 | 		NDR_record_t NDR; | ||
| 289 | 		int policy; | ||
| 290 | 		boolean_t change_threads; | ||
| 291 | 	} __Request__processor_set_policy_disable_t __attribute__((unused)); | ||
| 292 | #ifdef __MigPackStructs | ||
| 293 | #pragma pack(pop) | ||
| 294 | #endif | ||
| 295 | |||
| 296 | #ifdef __MigPackStructs | ||
| 297 | #pragma pack(push, 4) | ||
| 298 | #endif | ||
| 299 | 	typedef struct { | ||
| 300 | 		mach_msg_header_t Head; | ||
| 301 | 	} __Request__processor_set_tasks_t __attribute__((unused)); | ||
| 302 | #ifdef __MigPackStructs | ||
| 303 | #pragma pack(pop) | ||
| 304 | #endif | ||
| 305 | |||
| 306 | #ifdef __MigPackStructs | ||
| 307 | #pragma pack(push, 4) | ||
| 308 | #endif | ||
| 309 | 	typedef struct { | ||
| 310 | 		mach_msg_header_t Head; | ||
| 311 | 	} __Request__processor_set_threads_t __attribute__((unused)); | ||
| 312 | #ifdef __MigPackStructs | ||
| 313 | #pragma pack(pop) | ||
| 314 | #endif | ||
| 315 | |||
| 316 | #ifdef __MigPackStructs | ||
| 317 | #pragma pack(push, 4) | ||
| 318 | #endif | ||
| 319 | 	typedef struct { | ||
| 320 | 		mach_msg_header_t Head; | ||
| 321 | 		NDR_record_t NDR; | ||
| 322 | 		processor_set_flavor_t flavor; | ||
| 323 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 324 | 		integer_t policy_info[5]; | ||
| 325 | 		boolean_t change; | ||
| 326 | 	} __Request__processor_set_policy_control_t __attribute__((unused)); | ||
| 327 | #ifdef __MigPackStructs | ||
| 328 | #pragma pack(pop) | ||
| 329 | #endif | ||
| 330 | |||
| 331 | #ifdef __MigPackStructs | ||
| 332 | #pragma pack(push, 4) | ||
| 333 | #endif | ||
| 334 | 	typedef struct { | ||
| 335 | 		mach_msg_header_t Head; | ||
| 336 | 	} __Request__processor_set_stack_usage_t __attribute__((unused)); | ||
| 337 | #ifdef __MigPackStructs | ||
| 338 | #pragma pack(pop) | ||
| 339 | #endif | ||
| 340 | |||
| 341 | #ifdef __MigPackStructs | ||
| 342 | #pragma pack(push, 4) | ||
| 343 | #endif | ||
| 344 | 	typedef struct { | ||
| 345 | 		mach_msg_header_t Head; | ||
| 346 | 		NDR_record_t NDR; | ||
| 347 | 		int flavor; | ||
| 348 | 		mach_msg_type_number_t info_outCnt; | ||
| 349 | 	} __Request__processor_set_info_t __attribute__((unused)); | ||
| 350 | #ifdef __MigPackStructs | ||
| 351 | #pragma pack(pop) | ||
| 352 | #endif | ||
| 353 | |||
| 354 | #ifdef __MigPackStructs | ||
| 355 | #pragma pack(push, 4) | ||
| 356 | #endif | ||
| 357 | 	typedef struct { | ||
| 358 | 		mach_msg_header_t Head; | ||
| 359 | 		NDR_record_t NDR; | ||
| 360 | 		mach_task_flavor_t flavor; | ||
| 361 | 	} __Request__processor_set_tasks_with_flavor_t __attribute__((unused)); | ||
| 362 | #ifdef __MigPackStructs | ||
| 363 | #pragma pack(pop) | ||
| 364 | #endif | ||
| 365 | #endif /* !__Request__processor_set_subsystem__defined */ | ||
| 366 | |||
| 367 | /* union of all requests */ | ||
| 368 | |||
| 369 | #ifndef __RequestUnion__processor_set_subsystem__defined | ||
| 370 | #define __RequestUnion__processor_set_subsystem__defined | ||
| 371 | union __RequestUnion__processor_set_subsystem { | ||
| 372 | 	__Request__processor_set_statistics_t Request_processor_set_statistics; | ||
| 373 | 	__Request__processor_set_destroy_t Request_processor_set_destroy; | ||
| 374 | 	__Request__processor_set_max_priority_t Request_processor_set_max_priority; | ||
| 375 | 	__Request__processor_set_policy_enable_t Request_processor_set_policy_enable; | ||
| 376 | 	__Request__processor_set_policy_disable_t Request_processor_set_policy_disable; | ||
| 377 | 	__Request__processor_set_tasks_t Request_processor_set_tasks; | ||
| 378 | 	__Request__processor_set_threads_t Request_processor_set_threads; | ||
| 379 | 	__Request__processor_set_policy_control_t Request_processor_set_policy_control; | ||
| 380 | 	__Request__processor_set_stack_usage_t Request_processor_set_stack_usage; | ||
| 381 | 	__Request__processor_set_info_t Request_processor_set_info; | ||
| 382 | 	__Request__processor_set_tasks_with_flavor_t Request_processor_set_tasks_with_flavor; | ||
| 383 | }; | ||
| 384 | #endif /* !__RequestUnion__processor_set_subsystem__defined */ | ||
| 385 | /* typedefs for all replies */ | ||
| 386 | |||
| 387 | #ifndef __Reply__processor_set_subsystem__defined | ||
| 388 | #define __Reply__processor_set_subsystem__defined | ||
| 389 | |||
| 390 | #ifdef __MigPackStructs | ||
| 391 | #pragma pack(push, 4) | ||
| 392 | #endif | ||
| 393 | 	typedef struct { | ||
| 394 | 		mach_msg_header_t Head; | ||
| 395 | 		NDR_record_t NDR; | ||
| 396 | 		kern_return_t RetCode; | ||
| 397 | 		mach_msg_type_number_t info_outCnt; | ||
| 398 | 		integer_t info_out[5]; | ||
| 399 | 	} __Reply__processor_set_statistics_t __attribute__((unused)); | ||
| 400 | #ifdef __MigPackStructs | ||
| 401 | #pragma pack(pop) | ||
| 402 | #endif | ||
| 403 | |||
| 404 | #ifdef __MigPackStructs | ||
| 405 | #pragma pack(push, 4) | ||
| 406 | #endif | ||
| 407 | 	typedef struct { | ||
| 408 | 		mach_msg_header_t Head; | ||
| 409 | 		NDR_record_t NDR; | ||
| 410 | 		kern_return_t RetCode; | ||
| 411 | 	} __Reply__processor_set_destroy_t __attribute__((unused)); | ||
| 412 | #ifdef __MigPackStructs | ||
| 413 | #pragma pack(pop) | ||
| 414 | #endif | ||
| 415 | |||
| 416 | #ifdef __MigPackStructs | ||
| 417 | #pragma pack(push, 4) | ||
| 418 | #endif | ||
| 419 | 	typedef struct { | ||
| 420 | 		mach_msg_header_t Head; | ||
| 421 | 		NDR_record_t NDR; | ||
| 422 | 		kern_return_t RetCode; | ||
| 423 | 	} __Reply__processor_set_max_priority_t __attribute__((unused)); | ||
| 424 | #ifdef __MigPackStructs | ||
| 425 | #pragma pack(pop) | ||
| 426 | #endif | ||
| 427 | |||
| 428 | #ifdef __MigPackStructs | ||
| 429 | #pragma pack(push, 4) | ||
| 430 | #endif | ||
| 431 | 	typedef struct { | ||
| 432 | 		mach_msg_header_t Head; | ||
| 433 | 		NDR_record_t NDR; | ||
| 434 | 		kern_return_t RetCode; | ||
| 435 | 	} __Reply__processor_set_policy_enable_t __attribute__((unused)); | ||
| 436 | #ifdef __MigPackStructs | ||
| 437 | #pragma pack(pop) | ||
| 438 | #endif | ||
| 439 | |||
| 440 | #ifdef __MigPackStructs | ||
| 441 | #pragma pack(push, 4) | ||
| 442 | #endif | ||
| 443 | 	typedef struct { | ||
| 444 | 		mach_msg_header_t Head; | ||
| 445 | 		NDR_record_t NDR; | ||
| 446 | 		kern_return_t RetCode; | ||
| 447 | 	} __Reply__processor_set_policy_disable_t __attribute__((unused)); | ||
| 448 | #ifdef __MigPackStructs | ||
| 449 | #pragma pack(pop) | ||
| 450 | #endif | ||
| 451 | |||
| 452 | #ifdef __MigPackStructs | ||
| 453 | #pragma pack(push, 4) | ||
| 454 | #endif | ||
| 455 | 	typedef struct { | ||
| 456 | 		mach_msg_header_t Head; | ||
| 457 | 		/* start of the kernel processed data */ | ||
| 458 | 		mach_msg_body_t msgh_body; | ||
| 459 | 		mach_msg_ool_ports_descriptor_t task_list; | ||
| 460 | 		/* end of the kernel processed data */ | ||
| 461 | 		NDR_record_t NDR; | ||
| 462 | 		mach_msg_type_number_t task_listCnt; | ||
| 463 | 	} __Reply__processor_set_tasks_t __attribute__((unused)); | ||
| 464 | #ifdef __MigPackStructs | ||
| 465 | #pragma pack(pop) | ||
| 466 | #endif | ||
| 467 | |||
| 468 | #ifdef __MigPackStructs | ||
| 469 | #pragma pack(push, 4) | ||
| 470 | #endif | ||
| 471 | 	typedef struct { | ||
| 472 | 		mach_msg_header_t Head; | ||
| 473 | 		/* start of the kernel processed data */ | ||
| 474 | 		mach_msg_body_t msgh_body; | ||
| 475 | 		mach_msg_ool_ports_descriptor_t thread_list; | ||
| 476 | 		/* end of the kernel processed data */ | ||
| 477 | 		NDR_record_t NDR; | ||
| 478 | 		mach_msg_type_number_t thread_listCnt; | ||
| 479 | 	} __Reply__processor_set_threads_t __attribute__((unused)); | ||
| 480 | #ifdef __MigPackStructs | ||
| 481 | #pragma pack(pop) | ||
| 482 | #endif | ||
| 483 | |||
| 484 | #ifdef __MigPackStructs | ||
| 485 | #pragma pack(push, 4) | ||
| 486 | #endif | ||
| 487 | 	typedef struct { | ||
| 488 | 		mach_msg_header_t Head; | ||
| 489 | 		NDR_record_t NDR; | ||
| 490 | 		kern_return_t RetCode; | ||
| 491 | 	} __Reply__processor_set_policy_control_t __attribute__((unused)); | ||
| 492 | #ifdef __MigPackStructs | ||
| 493 | #pragma pack(pop) | ||
| 494 | #endif | ||
| 495 | |||
| 496 | #ifdef __MigPackStructs | ||
| 497 | #pragma pack(push, 4) | ||
| 498 | #endif | ||
| 499 | 	typedef struct { | ||
| 500 | 		mach_msg_header_t Head; | ||
| 501 | 		NDR_record_t NDR; | ||
| 502 | 		kern_return_t RetCode; | ||
| 503 | 		unsigned ltotal; | ||
| 504 | 		vm_size_t space; | ||
| 505 | 		vm_size_t resident; | ||
| 506 | 		vm_size_t maxusage; | ||
| 507 | 		vm_offset_t maxstack; | ||
| 508 | 	} __Reply__processor_set_stack_usage_t __attribute__((unused)); | ||
| 509 | #ifdef __MigPackStructs | ||
| 510 | #pragma pack(pop) | ||
| 511 | #endif | ||
| 512 | |||
| 513 | #ifdef __MigPackStructs | ||
| 514 | #pragma pack(push, 4) | ||
| 515 | #endif | ||
| 516 | 	typedef struct { | ||
| 517 | 		mach_msg_header_t Head; | ||
| 518 | 		/* start of the kernel processed data */ | ||
| 519 | 		mach_msg_body_t msgh_body; | ||
| 520 | 		mach_msg_port_descriptor_t host; | ||
| 521 | 		/* end of the kernel processed data */ | ||
| 522 | 		NDR_record_t NDR; | ||
| 523 | 		mach_msg_type_number_t info_outCnt; | ||
| 524 | 		integer_t info_out[5]; | ||
| 525 | 	} __Reply__processor_set_info_t __attribute__((unused)); | ||
| 526 | #ifdef __MigPackStructs | ||
| 527 | #pragma pack(pop) | ||
| 528 | #endif | ||
| 529 | |||
| 530 | #ifdef __MigPackStructs | ||
| 531 | #pragma pack(push, 4) | ||
| 532 | #endif | ||
| 533 | 	typedef struct { | ||
| 534 | 		mach_msg_header_t Head; | ||
| 535 | 		/* start of the kernel processed data */ | ||
| 536 | 		mach_msg_body_t msgh_body; | ||
| 537 | 		mach_msg_ool_ports_descriptor_t task_list; | ||
| 538 | 		/* end of the kernel processed data */ | ||
| 539 | 		NDR_record_t NDR; | ||
| 540 | 		mach_msg_type_number_t task_listCnt; | ||
| 541 | 	} __Reply__processor_set_tasks_with_flavor_t __attribute__((unused)); | ||
| 542 | #ifdef __MigPackStructs | ||
| 543 | #pragma pack(pop) | ||
| 544 | #endif | ||
| 545 | #endif /* !__Reply__processor_set_subsystem__defined */ | ||
| 546 | |||
| 547 | /* union of all replies */ | ||
| 548 | |||
| 549 | #ifndef __ReplyUnion__processor_set_subsystem__defined | ||
| 550 | #define __ReplyUnion__processor_set_subsystem__defined | ||
| 551 | union __ReplyUnion__processor_set_subsystem { | ||
| 552 | 	__Reply__processor_set_statistics_t Reply_processor_set_statistics; | ||
| 553 | 	__Reply__processor_set_destroy_t Reply_processor_set_destroy; | ||
| 554 | 	__Reply__processor_set_max_priority_t Reply_processor_set_max_priority; | ||
| 555 | 	__Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable; | ||
| 556 | 	__Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable; | ||
| 557 | 	__Reply__processor_set_tasks_t Reply_processor_set_tasks; | ||
| 558 | 	__Reply__processor_set_threads_t Reply_processor_set_threads; | ||
| 559 | 	__Reply__processor_set_policy_control_t Reply_processor_set_policy_control; | ||
| 560 | 	__Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage; | ||
| 561 | 	__Reply__processor_set_info_t Reply_processor_set_info; | ||
| 562 | 	__Reply__processor_set_tasks_with_flavor_t Reply_processor_set_tasks_with_flavor; | ||
| 563 | }; | ||
| 564 | #endif /* !__RequestUnion__processor_set_subsystem__defined */ | ||
| 565 | |||
| 566 | #ifndef subsystem_to_name_map_processor_set | ||
| 567 | #define subsystem_to_name_map_processor_set \ | ||
| 568 | { "processor_set_statistics", 4000 },\ | ||
| 569 | { "processor_set_destroy", 4001 },\ | ||
| 570 | { "processor_set_max_priority", 4002 },\ | ||
| 571 | { "processor_set_policy_enable", 4003 },\ | ||
| 572 | { "processor_set_policy_disable", 4004 },\ | ||
| 573 | { "processor_set_tasks", 4005 },\ | ||
| 574 | { "processor_set_threads", 4006 },\ | ||
| 575 | { "processor_set_policy_control", 4007 },\ | ||
| 576 | { "processor_set_stack_usage", 4008 },\ | ||
| 577 | { "processor_set_info", 4009 },\ | ||
| 578 | { "processor_set_tasks_with_flavor", 4010 } | ||
| 579 | #endif | ||
| 580 | |||
| 581 | #ifdef __AfterMigUserHeader | ||
| 582 | __AfterMigUserHeader | ||
| 583 | #endif /* __AfterMigUserHeader */ | ||
| 584 | |||
| 585 | #endif	 /* _processor_set_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/rpc.h created+135| ... | @@ -0,0 +1,135 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Mach RPC Subsystem Interfaces | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef _MACH_RPC_H_ | ||
| 37 | #define _MACH_RPC_H_ | ||
| 38 | |||
| 39 | #include <mach/boolean.h> | ||
| 40 | #include <mach/kern_return.h> | ||
| 41 | #include <mach/port.h> | ||
| 42 | #include <mach/vm_types.h> | ||
| 43 | |||
| 44 | #include <mach/mig.h> | ||
| 45 | #include <mach/mig_errors.h> | ||
| 46 | #include <mach/machine/rpc.h> | ||
| 47 | #include <mach/thread_status.h> | ||
| 48 | |||
| 49 | /* | ||
| 50 | * These are the types for RPC-specific variants of the MIG routine | ||
| 51 | * descriptor and subsystem data types. | ||
| 52 | * | ||
| 53 | * THIS IS ONLY FOR COMPATIBILITY. WE WILL NOT BE IMPLEMENTING THIS. | ||
| 54 | */ | ||
| 55 | |||
| 56 | /* | ||
| 57 | * Basic mach rpc types. | ||
| 58 | */ | ||
| 59 | typedef unsigned int routine_arg_type; | ||
| 60 | typedef unsigned int routine_arg_offset; | ||
| 61 | typedef unsigned int routine_arg_size; | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Definitions for a signature's argument and routine descriptor's. | ||
| 65 | */ | ||
| 66 | struct rpc_routine_arg_descriptor { | ||
| 67 | 	routine_arg_type type; /* Port, Array, etc. */ | ||
| 68 | 	routine_arg_size size; /* element size in bytes */ | ||
| 69 | 	routine_arg_size count; /* number of elements */ | ||
| 70 | 	routine_arg_offset offset; /* Offset in list of routine args */ | ||
| 71 | }; | ||
| 72 | typedef struct rpc_routine_arg_descriptor *rpc_routine_arg_descriptor_t; | ||
| 73 | |||
| 74 | struct rpc_routine_descriptor { | ||
| 75 | 	mig_impl_routine_t impl_routine; /* Server work func pointer */ | ||
| 76 | 	mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */ | ||
| 77 | 	unsigned int argc; /* Number of argument words */ | ||
| 78 | 	unsigned int descr_count; /* Number of complex argument */ | ||
| 79 | 	 /* descriptors */ | ||
| 80 | 	rpc_routine_arg_descriptor_t | ||
| 81 | 	 arg_descr; /* Pointer to beginning of */ | ||
| 82 | 	 /* the arg_descr array */ | ||
| 83 | 	unsigned int max_reply_msg; /* Max size for reply msg */ | ||
| 84 | }; | ||
| 85 | typedef struct rpc_routine_descriptor *rpc_routine_descriptor_t; | ||
| 86 | |||
| 87 | #define RPC_DESCR_SIZE(x) ((x)->descr_count * \ | ||
| 88 | 	 sizeof(struct rpc_routine_arg_descriptor)) | ||
| 89 | |||
| 90 | struct rpc_signature { | ||
| 91 | 	struct rpc_routine_descriptor rd; | ||
| 92 | 	struct rpc_routine_arg_descriptor rad[1]; | ||
| 93 | }; | ||
| 94 | |||
| 95 | #define RPC_SIGBUF_SIZE 8 | ||
| 96 | |||
| 97 | /* | ||
| 98 | *	A subsystem describes a set of server routines that can be invoked by | ||
| 99 | *	mach_rpc() on the ports that are registered with the subsystem. For | ||
| 100 | *	each routine, the routine number is given, along with the | ||
| 101 | *	address of the implementation function in the server and a | ||
| 102 | *	description of the arguments of the routine (it's "signature"). | ||
| 103 | * | ||
| 104 | *	This structure definition is only a template for what is really a | ||
| 105 | *	variable-length structure (generated by MIG for each subsystem). | ||
| 106 | *	The actual structures do not always have one entry in the routine | ||
| 107 | *	array, and also have a varying number of entries in the arg_descr | ||
| 108 | *	array. Each routine has an array of zero or more arg descriptors | ||
| 109 | *	one for each complex arg. These arrays are all catenated together | ||
| 110 | *	to form the arg_descr field of the subsystem struct. The | ||
| 111 | *	arg_descr field of each routine entry points to a unique sub-sequence | ||
| 112 | *	within this catenated array. The goal is to keep everything | ||
| 113 | *	contiguous. | ||
| 114 | */ | ||
| 115 | struct rpc_subsystem { | ||
| 116 | 	void *reserved; /* Reserved for system use */ | ||
| 117 | |||
| 118 | 	mach_msg_id_t start; /* Min routine number */ | ||
| 119 | 	mach_msg_id_t end; /* Max routine number + 1 */ | ||
| 120 | 	unsigned int maxsize; /* Max mach_msg size */ | ||
| 121 | 	vm_address_t base_addr; /* Address of this struct in user */ | ||
| 122 | |||
| 123 | 	struct rpc_routine_descriptor /* Array of routine descriptors */ | ||
| 124 | 	 routine[1 /* Actually, (start-end+1) */ | ||
| 125 | 	]; | ||
| 126 | |||
| 127 | 	struct rpc_routine_arg_descriptor | ||
| 128 | 	 arg_descriptor[1 /* Actually, the sum of the descr_ */ | ||
| 129 | 	]; /* count fields for all routines */ | ||
| 130 | }; | ||
| 131 | typedef struct rpc_subsystem *rpc_subsystem_t; | ||
| 132 | |||
| 133 | #define RPC_SUBSYSTEM_NULL ((rpc_subsystem_t) 0) | ||
| 134 | |||
| 135 | #endif /* _MACH_RPC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/semaphore.h created+78| ... | @@ -0,0 +1,78 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_SEMAPHORE_H_ | ||
| 30 | #define _MACH_SEMAPHORE_H_ | ||
| 31 | |||
| 32 | #include <mach/port.h> | ||
| 33 | #include <mach/mach_types.h> | ||
| 34 | #include <mach/kern_return.h> | ||
| 35 | #include <mach/sync_policy.h> | ||
| 36 | |||
| 37 | /* | ||
| 38 | *	Forward Declarations | ||
| 39 | * | ||
| 40 | *	The semaphore creation and deallocation routines are | ||
| 41 | *	defined with the Mach task APIs in <mach/task.h>. | ||
| 42 | * | ||
| 43 | * kern_return_t	semaphore_create(task_t task, | ||
| 44 | * semaphore_t *new_semaphore, | ||
| 45 | *					 sync_policy_t policy, | ||
| 46 | *					 int value); | ||
| 47 | * | ||
| 48 | *	kern_return_t	semaphore_destroy(task_t task, | ||
| 49 | *					 semaphore_t semaphore); | ||
| 50 | */ | ||
| 51 | |||
| 52 | #include <sys/cdefs.h> | ||
| 53 | __BEGIN_DECLS | ||
| 54 | |||
| 55 | extern kern_return_t semaphore_signal(semaphore_t semaphore); | ||
| 56 | extern kern_return_t semaphore_signal_all(semaphore_t semaphore); | ||
| 57 | |||
| 58 | extern kern_return_t semaphore_wait(semaphore_t semaphore); | ||
| 59 | |||
| 60 | |||
| 61 | extern kern_return_t semaphore_timedwait(semaphore_t semaphore, | ||
| 62 | mach_timespec_t wait_time); | ||
| 63 | |||
| 64 | extern kern_return_t semaphore_timedwait_signal(semaphore_t wait_semaphore, | ||
| 65 | semaphore_t signal_semaphore, | ||
| 66 | mach_timespec_t wait_time); | ||
| 67 | |||
| 68 | extern kern_return_t semaphore_wait_signal(semaphore_t wait_semaphore, | ||
| 69 | semaphore_t signal_semaphore); | ||
| 70 | |||
| 71 | extern kern_return_t semaphore_signal_thread(semaphore_t semaphore, | ||
| 72 | thread_t thread); | ||
| 73 | |||
| 74 | |||
| 75 | __END_DECLS | ||
| 76 | |||
| 77 | |||
| 78 | #endif /* _MACH_SEMAPHORE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/std_types.h created+75| ... | @@ -0,0 +1,75 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	Mach standard external interface type definitions. | ||
| 60 | * | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _MACH_STD_TYPES_H_ | ||
| 64 | #define _MACH_STD_TYPES_H_ | ||
| 65 | |||
| 66 | #include <stdint.h> | ||
| 67 | #include <mach/boolean.h> | ||
| 68 | #include <mach/kern_return.h> | ||
| 69 | #include <mach/port.h> | ||
| 70 | #include <mach/vm_types.h> | ||
| 71 | |||
| 72 | #include <sys/_types.h> | ||
| 73 | #include <sys/_types/_uuid_t.h> | ||
| 74 | |||
| 75 | #endif /* _MACH_STD_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/sync_policy.h created+49| ... | @@ -0,0 +1,49 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _MACH_SYNC_POLICY_H_ | ||
| 33 | #define _MACH_SYNC_POLICY_H_ | ||
| 34 | |||
| 35 | typedef int sync_policy_t; | ||
| 36 | |||
| 37 | /* | ||
| 38 | *	These options define the wait ordering of the synchronizers | ||
| 39 | */ | ||
| 40 | #define SYNC_POLICY_FIFO 0x0 | ||
| 41 | #define SYNC_POLICY_FIXED_PRIORITY 0x1 | ||
| 42 | #define SYNC_POLICY_REVERSED 0x2 | ||
| 43 | #define SYNC_POLICY_ORDER_MASK 0x3 | ||
| 44 | #define SYNC_POLICY_LIFO (SYNC_POLICY_FIFO|SYNC_POLICY_REVERSED) | ||
| 45 | |||
| 46 | |||
| 47 | #define SYNC_POLICY_MAX 0x7 | ||
| 48 | |||
| 49 | #endif /* _MACH_SYNC_POLICY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/task.h created+2523| ... | @@ -0,0 +1,2523 @@ | ||
| 1 | #ifndef	_task_user_ | ||
| 2 | #define	_task_user_ | ||
| 3 | |||
| 4 | /* Module task */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	task_MSG_COUNT | ||
| 52 | #define	task_MSG_COUNT	55 | ||
| 53 | #endif	/* task_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach_debug/mach_debug_types.h> | ||
| 60 | |||
| 61 | #ifdef __BeforeMigUserHeader | ||
| 62 | __BeforeMigUserHeader | ||
| 63 | #endif /* __BeforeMigUserHeader */ | ||
| 64 | |||
| 65 | #include <sys/cdefs.h> | ||
| 66 | __BEGIN_DECLS | ||
| 67 | |||
| 68 | |||
| 69 | /* Routine task_create */ | ||
| 70 | #ifdef	mig_external | ||
| 71 | mig_external | ||
| 72 | #else | ||
| 73 | extern | ||
| 74 | #endif	/* mig_external */ | ||
| 75 | kern_return_t task_create | ||
| 76 | ( | ||
| 77 | 	task_t target_task, | ||
| 78 | 	ledger_array_t ledgers, | ||
| 79 | 	mach_msg_type_number_t ledgersCnt, | ||
| 80 | 	boolean_t inherit_memory, | ||
| 81 | 	task_t *child_task | ||
| 82 | ); | ||
| 83 | |||
| 84 | /* Routine task_terminate */ | ||
| 85 | #ifdef	mig_external | ||
| 86 | mig_external | ||
| 87 | #else | ||
| 88 | extern | ||
| 89 | #endif	/* mig_external */ | ||
| 90 | kern_return_t task_terminate | ||
| 91 | ( | ||
| 92 | 	task_t target_task | ||
| 93 | ); | ||
| 94 | |||
| 95 | /* Routine task_threads */ | ||
| 96 | #ifdef	mig_external | ||
| 97 | mig_external | ||
| 98 | #else | ||
| 99 | extern | ||
| 100 | #endif	/* mig_external */ | ||
| 101 | kern_return_t task_threads | ||
| 102 | ( | ||
| 103 | 	task_inspect_t target_task, | ||
| 104 | 	thread_act_array_t *act_list, | ||
| 105 | 	mach_msg_type_number_t *act_listCnt | ||
| 106 | ); | ||
| 107 | |||
| 108 | /* Routine mach_ports_register */ | ||
| 109 | #ifdef	mig_external | ||
| 110 | mig_external | ||
| 111 | #else | ||
| 112 | extern | ||
| 113 | #endif	/* mig_external */ | ||
| 114 | __WATCHOS_PROHIBITED | ||
| 115 | __TVOS_PROHIBITED | ||
| 116 | kern_return_t mach_ports_register | ||
| 117 | ( | ||
| 118 | 	task_t target_task, | ||
| 119 | 	mach_port_array_t init_port_set, | ||
| 120 | 	mach_msg_type_number_t init_port_setCnt | ||
| 121 | ); | ||
| 122 | |||
| 123 | /* Routine mach_ports_lookup */ | ||
| 124 | #ifdef	mig_external | ||
| 125 | mig_external | ||
| 126 | #else | ||
| 127 | extern | ||
| 128 | #endif	/* mig_external */ | ||
| 129 | __WATCHOS_PROHIBITED | ||
| 130 | __TVOS_PROHIBITED | ||
| 131 | kern_return_t mach_ports_lookup | ||
| 132 | ( | ||
| 133 | 	task_t target_task, | ||
| 134 | 	mach_port_array_t *init_port_set, | ||
| 135 | 	mach_msg_type_number_t *init_port_setCnt | ||
| 136 | ); | ||
| 137 | |||
| 138 | /* Routine task_info */ | ||
| 139 | #ifdef	mig_external | ||
| 140 | mig_external | ||
| 141 | #else | ||
| 142 | extern | ||
| 143 | #endif	/* mig_external */ | ||
| 144 | kern_return_t task_info | ||
| 145 | ( | ||
| 146 | 	task_name_t target_task, | ||
| 147 | 	task_flavor_t flavor, | ||
| 148 | 	task_info_t task_info_out, | ||
| 149 | 	mach_msg_type_number_t *task_info_outCnt | ||
| 150 | ); | ||
| 151 | |||
| 152 | /* Routine task_set_info */ | ||
| 153 | #ifdef	mig_external | ||
| 154 | mig_external | ||
| 155 | #else | ||
| 156 | extern | ||
| 157 | #endif	/* mig_external */ | ||
| 158 | __WATCHOS_PROHIBITED | ||
| 159 | __TVOS_PROHIBITED | ||
| 160 | kern_return_t task_set_info | ||
| 161 | ( | ||
| 162 | 	task_t target_task, | ||
| 163 | 	task_flavor_t flavor, | ||
| 164 | 	task_info_t task_info_in, | ||
| 165 | 	mach_msg_type_number_t task_info_inCnt | ||
| 166 | ); | ||
| 167 | |||
| 168 | /* Routine task_suspend */ | ||
| 169 | #ifdef	mig_external | ||
| 170 | mig_external | ||
| 171 | #else | ||
| 172 | extern | ||
| 173 | #endif	/* mig_external */ | ||
| 174 | __WATCHOS_PROHIBITED | ||
| 175 | __TVOS_PROHIBITED | ||
| 176 | kern_return_t task_suspend | ||
| 177 | ( | ||
| 178 | 	task_t target_task | ||
| 179 | ); | ||
| 180 | |||
| 181 | /* Routine task_resume */ | ||
| 182 | #ifdef	mig_external | ||
| 183 | mig_external | ||
| 184 | #else | ||
| 185 | extern | ||
| 186 | #endif	/* mig_external */ | ||
| 187 | __WATCHOS_PROHIBITED | ||
| 188 | __TVOS_PROHIBITED | ||
| 189 | kern_return_t task_resume | ||
| 190 | ( | ||
| 191 | 	task_t target_task | ||
| 192 | ); | ||
| 193 | |||
| 194 | /* Routine task_get_special_port */ | ||
| 195 | #ifdef	mig_external | ||
| 196 | mig_external | ||
| 197 | #else | ||
| 198 | extern | ||
| 199 | #endif	/* mig_external */ | ||
| 200 | __WATCHOS_PROHIBITED | ||
| 201 | __TVOS_PROHIBITED | ||
| 202 | kern_return_t task_get_special_port | ||
| 203 | ( | ||
| 204 | 	task_inspect_t task, | ||
| 205 | 	int which_port, | ||
| 206 | 	mach_port_t *special_port | ||
| 207 | ); | ||
| 208 | |||
| 209 | /* Routine task_set_special_port */ | ||
| 210 | #ifdef	mig_external | ||
| 211 | mig_external | ||
| 212 | #else | ||
| 213 | extern | ||
| 214 | #endif	/* mig_external */ | ||
| 215 | __WATCHOS_PROHIBITED | ||
| 216 | __TVOS_PROHIBITED | ||
| 217 | kern_return_t task_set_special_port | ||
| 218 | ( | ||
| 219 | 	task_t task, | ||
| 220 | 	int which_port, | ||
| 221 | 	mach_port_t special_port | ||
| 222 | ); | ||
| 223 | |||
| 224 | /* Routine thread_create */ | ||
| 225 | #ifdef	mig_external | ||
| 226 | mig_external | ||
| 227 | #else | ||
| 228 | extern | ||
| 229 | #endif	/* mig_external */ | ||
| 230 | __WATCHOS_PROHIBITED | ||
| 231 | __TVOS_PROHIBITED | ||
| 232 | kern_return_t thread_create | ||
| 233 | ( | ||
| 234 | 	task_t parent_task, | ||
| 235 | 	thread_act_t *child_act | ||
| 236 | ); | ||
| 237 | |||
| 238 | /* Routine thread_create_running */ | ||
| 239 | #ifdef	mig_external | ||
| 240 | mig_external | ||
| 241 | #else | ||
| 242 | extern | ||
| 243 | #endif	/* mig_external */ | ||
| 244 | __WATCHOS_PROHIBITED | ||
| 245 | __TVOS_PROHIBITED | ||
| 246 | kern_return_t thread_create_running | ||
| 247 | ( | ||
| 248 | 	task_t parent_task, | ||
| 249 | 	thread_state_flavor_t flavor, | ||
| 250 | 	thread_state_t new_state, | ||
| 251 | 	mach_msg_type_number_t new_stateCnt, | ||
| 252 | 	thread_act_t *child_act | ||
| 253 | ); | ||
| 254 | |||
| 255 | /* Routine task_set_exception_ports */ | ||
| 256 | #ifdef	mig_external | ||
| 257 | mig_external | ||
| 258 | #else | ||
| 259 | extern | ||
| 260 | #endif	/* mig_external */ | ||
| 261 | __WATCHOS_PROHIBITED | ||
| 262 | __TVOS_PROHIBITED | ||
| 263 | kern_return_t task_set_exception_ports | ||
| 264 | ( | ||
| 265 | 	task_t task, | ||
| 266 | 	exception_mask_t exception_mask, | ||
| 267 | 	mach_port_t new_port, | ||
| 268 | 	exception_behavior_t behavior, | ||
| 269 | 	thread_state_flavor_t new_flavor | ||
| 270 | ); | ||
| 271 | |||
| 272 | /* Routine task_get_exception_ports */ | ||
| 273 | #ifdef	mig_external | ||
| 274 | mig_external | ||
| 275 | #else | ||
| 276 | extern | ||
| 277 | #endif	/* mig_external */ | ||
| 278 | __WATCHOS_PROHIBITED | ||
| 279 | __TVOS_PROHIBITED | ||
| 280 | kern_return_t task_get_exception_ports | ||
| 281 | ( | ||
| 282 | 	task_t task, | ||
| 283 | 	exception_mask_t exception_mask, | ||
| 284 | 	exception_mask_array_t masks, | ||
| 285 | 	mach_msg_type_number_t *masksCnt, | ||
| 286 | 	exception_handler_array_t old_handlers, | ||
| 287 | 	exception_behavior_array_t old_behaviors, | ||
| 288 | 	exception_flavor_array_t old_flavors | ||
| 289 | ); | ||
| 290 | |||
| 291 | /* Routine task_swap_exception_ports */ | ||
| 292 | #ifdef	mig_external | ||
| 293 | mig_external | ||
| 294 | #else | ||
| 295 | extern | ||
| 296 | #endif	/* mig_external */ | ||
| 297 | __WATCHOS_PROHIBITED | ||
| 298 | __TVOS_PROHIBITED | ||
| 299 | kern_return_t task_swap_exception_ports | ||
| 300 | ( | ||
| 301 | 	task_t task, | ||
| 302 | 	exception_mask_t exception_mask, | ||
| 303 | 	mach_port_t new_port, | ||
| 304 | 	exception_behavior_t behavior, | ||
| 305 | 	thread_state_flavor_t new_flavor, | ||
| 306 | 	exception_mask_array_t masks, | ||
| 307 | 	mach_msg_type_number_t *masksCnt, | ||
| 308 | 	exception_handler_array_t old_handlerss, | ||
| 309 | 	exception_behavior_array_t old_behaviors, | ||
| 310 | 	exception_flavor_array_t old_flavors | ||
| 311 | ); | ||
| 312 | |||
| 313 | /* Routine lock_set_create */ | ||
| 314 | #ifdef	mig_external | ||
| 315 | mig_external | ||
| 316 | #else | ||
| 317 | extern | ||
| 318 | #endif	/* mig_external */ | ||
| 319 | kern_return_t lock_set_create | ||
| 320 | ( | ||
| 321 | 	task_t task, | ||
| 322 | 	lock_set_t *new_lock_set, | ||
| 323 | 	int n_ulocks, | ||
| 324 | 	int policy | ||
| 325 | ); | ||
| 326 | |||
| 327 | /* Routine lock_set_destroy */ | ||
| 328 | #ifdef	mig_external | ||
| 329 | mig_external | ||
| 330 | #else | ||
| 331 | extern | ||
| 332 | #endif	/* mig_external */ | ||
| 333 | kern_return_t lock_set_destroy | ||
| 334 | ( | ||
| 335 | 	task_t task, | ||
| 336 | 	lock_set_t lock_set | ||
| 337 | ); | ||
| 338 | |||
| 339 | /* Routine semaphore_create */ | ||
| 340 | #ifdef	mig_external | ||
| 341 | mig_external | ||
| 342 | #else | ||
| 343 | extern | ||
| 344 | #endif	/* mig_external */ | ||
| 345 | kern_return_t semaphore_create | ||
| 346 | ( | ||
| 347 | 	task_t task, | ||
| 348 | 	semaphore_t *semaphore, | ||
| 349 | 	int policy, | ||
| 350 | 	int value | ||
| 351 | ); | ||
| 352 | |||
| 353 | /* Routine semaphore_destroy */ | ||
| 354 | #ifdef	mig_external | ||
| 355 | mig_external | ||
| 356 | #else | ||
| 357 | extern | ||
| 358 | #endif	/* mig_external */ | ||
| 359 | kern_return_t semaphore_destroy | ||
| 360 | ( | ||
| 361 | 	task_t task, | ||
| 362 | 	semaphore_t semaphore | ||
| 363 | ); | ||
| 364 | |||
| 365 | /* Routine task_policy_set */ | ||
| 366 | #ifdef	mig_external | ||
| 367 | mig_external | ||
| 368 | #else | ||
| 369 | extern | ||
| 370 | #endif	/* mig_external */ | ||
| 371 | __WATCHOS_PROHIBITED | ||
| 372 | __TVOS_PROHIBITED | ||
| 373 | kern_return_t task_policy_set | ||
| 374 | ( | ||
| 375 | 	task_policy_set_t task, | ||
| 376 | 	task_policy_flavor_t flavor, | ||
| 377 | 	task_policy_t policy_info, | ||
| 378 | 	mach_msg_type_number_t policy_infoCnt | ||
| 379 | ); | ||
| 380 | |||
| 381 | /* Routine task_policy_get */ | ||
| 382 | #ifdef	mig_external | ||
| 383 | mig_external | ||
| 384 | #else | ||
| 385 | extern | ||
| 386 | #endif	/* mig_external */ | ||
| 387 | __WATCHOS_PROHIBITED | ||
| 388 | __TVOS_PROHIBITED | ||
| 389 | kern_return_t task_policy_get | ||
| 390 | ( | ||
| 391 | 	task_policy_get_t task, | ||
| 392 | 	task_policy_flavor_t flavor, | ||
| 393 | 	task_policy_t policy_info, | ||
| 394 | 	mach_msg_type_number_t *policy_infoCnt, | ||
| 395 | 	boolean_t *get_default | ||
| 396 | ); | ||
| 397 | |||
| 398 | /* Routine task_sample */ | ||
| 399 | #ifdef	mig_external | ||
| 400 | mig_external | ||
| 401 | #else | ||
| 402 | extern | ||
| 403 | #endif	/* mig_external */ | ||
| 404 | kern_return_t task_sample | ||
| 405 | ( | ||
| 406 | 	task_t task, | ||
| 407 | 	mach_port_t reply | ||
| 408 | ); | ||
| 409 | |||
| 410 | /* Routine task_policy */ | ||
| 411 | #ifdef	mig_external | ||
| 412 | mig_external | ||
| 413 | #else | ||
| 414 | extern | ||
| 415 | #endif	/* mig_external */ | ||
| 416 | kern_return_t task_policy | ||
| 417 | ( | ||
| 418 | 	task_t task, | ||
| 419 | 	policy_t policy, | ||
| 420 | 	policy_base_t base, | ||
| 421 | 	mach_msg_type_number_t baseCnt, | ||
| 422 | 	boolean_t set_limit, | ||
| 423 | 	boolean_t change | ||
| 424 | ); | ||
| 425 | |||
| 426 | /* Routine task_set_emulation */ | ||
| 427 | #ifdef	mig_external | ||
| 428 | mig_external | ||
| 429 | #else | ||
| 430 | extern | ||
| 431 | #endif	/* mig_external */ | ||
| 432 | kern_return_t task_set_emulation | ||
| 433 | ( | ||
| 434 | 	task_t target_port, | ||
| 435 | 	vm_address_t routine_entry_pt, | ||
| 436 | 	int routine_number | ||
| 437 | ); | ||
| 438 | |||
| 439 | /* Routine task_get_emulation_vector */ | ||
| 440 | #ifdef	mig_external | ||
| 441 | mig_external | ||
| 442 | #else | ||
| 443 | extern | ||
| 444 | #endif	/* mig_external */ | ||
| 445 | kern_return_t task_get_emulation_vector | ||
| 446 | ( | ||
| 447 | 	task_t task, | ||
| 448 | 	int *vector_start, | ||
| 449 | 	emulation_vector_t *emulation_vector, | ||
| 450 | 	mach_msg_type_number_t *emulation_vectorCnt | ||
| 451 | ); | ||
| 452 | |||
| 453 | /* Routine task_set_emulation_vector */ | ||
| 454 | #ifdef	mig_external | ||
| 455 | mig_external | ||
| 456 | #else | ||
| 457 | extern | ||
| 458 | #endif	/* mig_external */ | ||
| 459 | kern_return_t task_set_emulation_vector | ||
| 460 | ( | ||
| 461 | 	task_t task, | ||
| 462 | 	int vector_start, | ||
| 463 | 	emulation_vector_t emulation_vector, | ||
| 464 | 	mach_msg_type_number_t emulation_vectorCnt | ||
| 465 | ); | ||
| 466 | |||
| 467 | /* Routine task_set_ras_pc */ | ||
| 468 | #ifdef	mig_external | ||
| 469 | mig_external | ||
| 470 | #else | ||
| 471 | extern | ||
| 472 | #endif	/* mig_external */ | ||
| 473 | kern_return_t task_set_ras_pc | ||
| 474 | ( | ||
| 475 | 	task_t target_task, | ||
| 476 | 	vm_address_t basepc, | ||
| 477 | 	vm_address_t boundspc | ||
| 478 | ); | ||
| 479 | |||
| 480 | /* Routine task_zone_info */ | ||
| 481 | #ifdef	mig_external | ||
| 482 | mig_external | ||
| 483 | #else | ||
| 484 | extern | ||
| 485 | #endif	/* mig_external */ | ||
| 486 | __WATCHOS_PROHIBITED | ||
| 487 | __TVOS_PROHIBITED | ||
| 488 | kern_return_t task_zone_info | ||
| 489 | ( | ||
| 490 | 	task_inspect_t target_task, | ||
| 491 | 	mach_zone_name_array_t *names, | ||
| 492 | 	mach_msg_type_number_t *namesCnt, | ||
| 493 | 	task_zone_info_array_t *info, | ||
| 494 | 	mach_msg_type_number_t *infoCnt | ||
| 495 | ); | ||
| 496 | |||
| 497 | /* Routine task_assign */ | ||
| 498 | #ifdef	mig_external | ||
| 499 | mig_external | ||
| 500 | #else | ||
| 501 | extern | ||
| 502 | #endif	/* mig_external */ | ||
| 503 | kern_return_t task_assign | ||
| 504 | ( | ||
| 505 | 	task_t task, | ||
| 506 | 	processor_set_t new_set, | ||
| 507 | 	boolean_t assign_threads | ||
| 508 | ); | ||
| 509 | |||
| 510 | /* Routine task_assign_default */ | ||
| 511 | #ifdef	mig_external | ||
| 512 | mig_external | ||
| 513 | #else | ||
| 514 | extern | ||
| 515 | #endif	/* mig_external */ | ||
| 516 | kern_return_t task_assign_default | ||
| 517 | ( | ||
| 518 | 	task_t task, | ||
| 519 | 	boolean_t assign_threads | ||
| 520 | ); | ||
| 521 | |||
| 522 | /* Routine task_get_assignment */ | ||
| 523 | #ifdef	mig_external | ||
| 524 | mig_external | ||
| 525 | #else | ||
| 526 | extern | ||
| 527 | #endif	/* mig_external */ | ||
| 528 | kern_return_t task_get_assignment | ||
| 529 | ( | ||
| 530 | 	task_inspect_t task, | ||
| 531 | 	processor_set_name_t *assigned_set | ||
| 532 | ); | ||
| 533 | |||
| 534 | /* Routine task_set_policy */ | ||
| 535 | #ifdef	mig_external | ||
| 536 | mig_external | ||
| 537 | #else | ||
| 538 | extern | ||
| 539 | #endif	/* mig_external */ | ||
| 540 | kern_return_t task_set_policy | ||
| 541 | ( | ||
| 542 | 	task_t task, | ||
| 543 | 	processor_set_t pset, | ||
| 544 | 	policy_t policy, | ||
| 545 | 	policy_base_t base, | ||
| 546 | 	mach_msg_type_number_t baseCnt, | ||
| 547 | 	policy_limit_t limit, | ||
| 548 | 	mach_msg_type_number_t limitCnt, | ||
| 549 | 	boolean_t change | ||
| 550 | ); | ||
| 551 | |||
| 552 | /* Routine task_get_state */ | ||
| 553 | #ifdef	mig_external | ||
| 554 | mig_external | ||
| 555 | #else | ||
| 556 | extern | ||
| 557 | #endif	/* mig_external */ | ||
| 558 | __WATCHOS_PROHIBITED | ||
| 559 | __TVOS_PROHIBITED | ||
| 560 | kern_return_t task_get_state | ||
| 561 | ( | ||
| 562 | 	task_read_t task, | ||
| 563 | 	thread_state_flavor_t flavor, | ||
| 564 | 	thread_state_t old_state, | ||
| 565 | 	mach_msg_type_number_t *old_stateCnt | ||
| 566 | ); | ||
| 567 | |||
| 568 | /* Routine task_set_state */ | ||
| 569 | #ifdef	mig_external | ||
| 570 | mig_external | ||
| 571 | #else | ||
| 572 | extern | ||
| 573 | #endif	/* mig_external */ | ||
| 574 | __WATCHOS_PROHIBITED | ||
| 575 | __TVOS_PROHIBITED | ||
| 576 | kern_return_t task_set_state | ||
| 577 | ( | ||
| 578 | 	task_t task, | ||
| 579 | 	thread_state_flavor_t flavor, | ||
| 580 | 	thread_state_t new_state, | ||
| 581 | 	mach_msg_type_number_t new_stateCnt | ||
| 582 | ); | ||
| 583 | |||
| 584 | /* Routine task_set_phys_footprint_limit */ | ||
| 585 | #ifdef	mig_external | ||
| 586 | mig_external | ||
| 587 | #else | ||
| 588 | extern | ||
| 589 | #endif	/* mig_external */ | ||
| 590 | __WATCHOS_PROHIBITED | ||
| 591 | __TVOS_PROHIBITED | ||
| 592 | kern_return_t task_set_phys_footprint_limit | ||
| 593 | ( | ||
| 594 | 	task_t task, | ||
| 595 | 	int new_limit, | ||
| 596 | 	int *old_limit | ||
| 597 | ); | ||
| 598 | |||
| 599 | /* Routine task_suspend2 */ | ||
| 600 | #ifdef	mig_external | ||
| 601 | mig_external | ||
| 602 | #else | ||
| 603 | extern | ||
| 604 | #endif	/* mig_external */ | ||
| 605 | __WATCHOS_PROHIBITED | ||
| 606 | __TVOS_PROHIBITED | ||
| 607 | kern_return_t task_suspend2 | ||
| 608 | ( | ||
| 609 | 	task_t target_task, | ||
| 610 | 	task_suspension_token_t *suspend_token | ||
| 611 | ); | ||
| 612 | |||
| 613 | /* Routine task_resume2 */ | ||
| 614 | #ifdef	mig_external | ||
| 615 | mig_external | ||
| 616 | #else | ||
| 617 | extern | ||
| 618 | #endif	/* mig_external */ | ||
| 619 | __WATCHOS_PROHIBITED | ||
| 620 | __TVOS_PROHIBITED | ||
| 621 | kern_return_t task_resume2 | ||
| 622 | ( | ||
| 623 | 	task_suspension_token_t suspend_token | ||
| 624 | ); | ||
| 625 | |||
| 626 | /* Routine task_purgable_info */ | ||
| 627 | #ifdef	mig_external | ||
| 628 | mig_external | ||
| 629 | #else | ||
| 630 | extern | ||
| 631 | #endif	/* mig_external */ | ||
| 632 | kern_return_t task_purgable_info | ||
| 633 | ( | ||
| 634 | 	task_inspect_t task, | ||
| 635 | 	task_purgable_info_t *stats | ||
| 636 | ); | ||
| 637 | |||
| 638 | /* Routine task_get_mach_voucher */ | ||
| 639 | #ifdef	mig_external | ||
| 640 | mig_external | ||
| 641 | #else | ||
| 642 | extern | ||
| 643 | #endif	/* mig_external */ | ||
| 644 | __WATCHOS_PROHIBITED | ||
| 645 | __TVOS_PROHIBITED | ||
| 646 | kern_return_t task_get_mach_voucher | ||
| 647 | ( | ||
| 648 | 	task_read_t task, | ||
| 649 | 	mach_voucher_selector_t which, | ||
| 650 | 	ipc_voucher_t *voucher | ||
| 651 | ); | ||
| 652 | |||
| 653 | /* Routine task_set_mach_voucher */ | ||
| 654 | #ifdef	mig_external | ||
| 655 | mig_external | ||
| 656 | #else | ||
| 657 | extern | ||
| 658 | #endif	/* mig_external */ | ||
| 659 | __WATCHOS_PROHIBITED | ||
| 660 | __TVOS_PROHIBITED | ||
| 661 | kern_return_t task_set_mach_voucher | ||
| 662 | ( | ||
| 663 | 	task_t task, | ||
| 664 | 	ipc_voucher_t voucher | ||
| 665 | ); | ||
| 666 | |||
| 667 | /* Routine task_swap_mach_voucher */ | ||
| 668 | #ifdef	mig_external | ||
| 669 | mig_external | ||
| 670 | #else | ||
| 671 | extern | ||
| 672 | #endif	/* mig_external */ | ||
| 673 | __WATCHOS_PROHIBITED | ||
| 674 | __TVOS_PROHIBITED | ||
| 675 | kern_return_t task_swap_mach_voucher | ||
| 676 | ( | ||
| 677 | 	task_t task, | ||
| 678 | 	ipc_voucher_t new_voucher, | ||
| 679 | 	ipc_voucher_t *old_voucher | ||
| 680 | ); | ||
| 681 | |||
| 682 | /* Routine task_generate_corpse */ | ||
| 683 | #ifdef	mig_external | ||
| 684 | mig_external | ||
| 685 | #else | ||
| 686 | extern | ||
| 687 | #endif	/* mig_external */ | ||
| 688 | kern_return_t task_generate_corpse | ||
| 689 | ( | ||
| 690 | 	task_t task, | ||
| 691 | 	mach_port_t *corpse_task_port | ||
| 692 | ); | ||
| 693 | |||
| 694 | /* Routine task_map_corpse_info */ | ||
| 695 | #ifdef	mig_external | ||
| 696 | mig_external | ||
| 697 | #else | ||
| 698 | extern | ||
| 699 | #endif	/* mig_external */ | ||
| 700 | kern_return_t task_map_corpse_info | ||
| 701 | ( | ||
| 702 | 	task_t task, | ||
| 703 | 	task_read_t corspe_task, | ||
| 704 | 	vm_address_t *kcd_addr_begin, | ||
| 705 | 	uint32_t *kcd_size | ||
| 706 | ); | ||
| 707 | |||
| 708 | /* Routine task_register_dyld_image_infos */ | ||
| 709 | #ifdef	mig_external | ||
| 710 | mig_external | ||
| 711 | #else | ||
| 712 | extern | ||
| 713 | #endif	/* mig_external */ | ||
| 714 | kern_return_t task_register_dyld_image_infos | ||
| 715 | ( | ||
| 716 | 	task_t task, | ||
| 717 | 	dyld_kernel_image_info_array_t dyld_images, | ||
| 718 | 	mach_msg_type_number_t dyld_imagesCnt | ||
| 719 | ); | ||
| 720 | |||
| 721 | /* Routine task_unregister_dyld_image_infos */ | ||
| 722 | #ifdef	mig_external | ||
| 723 | mig_external | ||
| 724 | #else | ||
| 725 | extern | ||
| 726 | #endif	/* mig_external */ | ||
| 727 | kern_return_t task_unregister_dyld_image_infos | ||
| 728 | ( | ||
| 729 | 	task_t task, | ||
| 730 | 	dyld_kernel_image_info_array_t dyld_images, | ||
| 731 | 	mach_msg_type_number_t dyld_imagesCnt | ||
| 732 | ); | ||
| 733 | |||
| 734 | /* Routine task_get_dyld_image_infos */ | ||
| 735 | #ifdef	mig_external | ||
| 736 | mig_external | ||
| 737 | #else | ||
| 738 | extern | ||
| 739 | #endif	/* mig_external */ | ||
| 740 | kern_return_t task_get_dyld_image_infos | ||
| 741 | ( | ||
| 742 | 	task_read_t task, | ||
| 743 | 	dyld_kernel_image_info_array_t *dyld_images, | ||
| 744 | 	mach_msg_type_number_t *dyld_imagesCnt | ||
| 745 | ); | ||
| 746 | |||
| 747 | /* Routine task_register_dyld_shared_cache_image_info */ | ||
| 748 | #ifdef	mig_external | ||
| 749 | mig_external | ||
| 750 | #else | ||
| 751 | extern | ||
| 752 | #endif	/* mig_external */ | ||
| 753 | kern_return_t task_register_dyld_shared_cache_image_info | ||
| 754 | ( | ||
| 755 | 	task_t task, | ||
| 756 | 	dyld_kernel_image_info_t dyld_cache_image, | ||
| 757 | 	boolean_t no_cache, | ||
| 758 | 	boolean_t private_cache | ||
| 759 | ); | ||
| 760 | |||
| 761 | /* Routine task_register_dyld_set_dyld_state */ | ||
| 762 | #ifdef	mig_external | ||
| 763 | mig_external | ||
| 764 | #else | ||
| 765 | extern | ||
| 766 | #endif	/* mig_external */ | ||
| 767 | kern_return_t task_register_dyld_set_dyld_state | ||
| 768 | ( | ||
| 769 | 	task_t task, | ||
| 770 | 	uint8_t dyld_state | ||
| 771 | ); | ||
| 772 | |||
| 773 | /* Routine task_register_dyld_get_process_state */ | ||
| 774 | #ifdef	mig_external | ||
| 775 | mig_external | ||
| 776 | #else | ||
| 777 | extern | ||
| 778 | #endif	/* mig_external */ | ||
| 779 | kern_return_t task_register_dyld_get_process_state | ||
| 780 | ( | ||
| 781 | 	task_t task, | ||
| 782 | 	dyld_kernel_process_info_t *dyld_process_state | ||
| 783 | ); | ||
| 784 | |||
| 785 | /* Routine task_map_corpse_info_64 */ | ||
| 786 | #ifdef	mig_external | ||
| 787 | mig_external | ||
| 788 | #else | ||
| 789 | extern | ||
| 790 | #endif	/* mig_external */ | ||
| 791 | kern_return_t task_map_corpse_info_64 | ||
| 792 | ( | ||
| 793 | 	task_t task, | ||
| 794 | 	task_read_t corspe_task, | ||
| 795 | 	mach_vm_address_t *kcd_addr_begin, | ||
| 796 | 	mach_vm_size_t *kcd_size | ||
| 797 | ); | ||
| 798 | |||
| 799 | /* Routine task_inspect */ | ||
| 800 | #ifdef	mig_external | ||
| 801 | mig_external | ||
| 802 | #else | ||
| 803 | extern | ||
| 804 | #endif	/* mig_external */ | ||
| 805 | kern_return_t task_inspect | ||
| 806 | ( | ||
| 807 | 	task_inspect_t task, | ||
| 808 | 	task_inspect_flavor_t flavor, | ||
| 809 | 	task_inspect_info_t info_out, | ||
| 810 | 	mach_msg_type_number_t *info_outCnt | ||
| 811 | ); | ||
| 812 | |||
| 813 | /* Routine task_get_exc_guard_behavior */ | ||
| 814 | #ifdef	mig_external | ||
| 815 | mig_external | ||
| 816 | #else | ||
| 817 | extern | ||
| 818 | #endif	/* mig_external */ | ||
| 819 | kern_return_t task_get_exc_guard_behavior | ||
| 820 | ( | ||
| 821 | 	task_inspect_t task, | ||
| 822 | 	task_exc_guard_behavior_t *behavior | ||
| 823 | ); | ||
| 824 | |||
| 825 | /* Routine task_set_exc_guard_behavior */ | ||
| 826 | #ifdef	mig_external | ||
| 827 | mig_external | ||
| 828 | #else | ||
| 829 | extern | ||
| 830 | #endif	/* mig_external */ | ||
| 831 | kern_return_t task_set_exc_guard_behavior | ||
| 832 | ( | ||
| 833 | 	task_t task, | ||
| 834 | 	task_exc_guard_behavior_t behavior | ||
| 835 | ); | ||
| 836 | |||
| 837 | /* Routine task_create_suid_cred */ | ||
| 838 | #ifdef	mig_external | ||
| 839 | mig_external | ||
| 840 | #else | ||
| 841 | extern | ||
| 842 | #endif	/* mig_external */ | ||
| 843 | kern_return_t task_create_suid_cred | ||
| 844 | ( | ||
| 845 | 	task_t task, | ||
| 846 | 	suid_cred_path_t path, | ||
| 847 | 	suid_cred_uid_t uid, | ||
| 848 | 	suid_cred_t *delegation | ||
| 849 | ); | ||
| 850 | |||
| 851 | __END_DECLS | ||
| 852 | |||
| 853 | /********************** Caution **************************/ | ||
| 854 | /* The following data types should be used to calculate */ | ||
| 855 | /* maximum message sizes only. The actual message may be */ | ||
| 856 | /* smaller, and the position of the arguments within the */ | ||
| 857 | /* message layout may vary from what is presented here. */ | ||
| 858 | /* For example, if any of the arguments are variable- */ | ||
| 859 | /* sized, and less than the maximum is sent, the data */ | ||
| 860 | /* will be packed tight in the actual message to reduce */ | ||
| 861 | /* the presence of holes. */ | ||
| 862 | /********************** Caution **************************/ | ||
| 863 | |||
| 864 | /* typedefs for all requests */ | ||
| 865 | |||
| 866 | #ifndef __Request__task_subsystem__defined | ||
| 867 | #define __Request__task_subsystem__defined | ||
| 868 | |||
| 869 | #ifdef __MigPackStructs | ||
| 870 | #pragma pack(push, 4) | ||
| 871 | #endif | ||
| 872 | 	typedef struct { | ||
| 873 | 		mach_msg_header_t Head; | ||
| 874 | 		/* start of the kernel processed data */ | ||
| 875 | 		mach_msg_body_t msgh_body; | ||
| 876 | 		mach_msg_ool_ports_descriptor_t ledgers; | ||
| 877 | 		/* end of the kernel processed data */ | ||
| 878 | 		NDR_record_t NDR; | ||
| 879 | 		mach_msg_type_number_t ledgersCnt; | ||
| 880 | 		boolean_t inherit_memory; | ||
| 881 | 	} __Request__task_create_t __attribute__((unused)); | ||
| 882 | #ifdef __MigPackStructs | ||
| 883 | #pragma pack(pop) | ||
| 884 | #endif | ||
| 885 | |||
| 886 | #ifdef __MigPackStructs | ||
| 887 | #pragma pack(push, 4) | ||
| 888 | #endif | ||
| 889 | 	typedef struct { | ||
| 890 | 		mach_msg_header_t Head; | ||
| 891 | 	} __Request__task_terminate_t __attribute__((unused)); | ||
| 892 | #ifdef __MigPackStructs | ||
| 893 | #pragma pack(pop) | ||
| 894 | #endif | ||
| 895 | |||
| 896 | #ifdef __MigPackStructs | ||
| 897 | #pragma pack(push, 4) | ||
| 898 | #endif | ||
| 899 | 	typedef struct { | ||
| 900 | 		mach_msg_header_t Head; | ||
| 901 | 	} __Request__task_threads_t __attribute__((unused)); | ||
| 902 | #ifdef __MigPackStructs | ||
| 903 | #pragma pack(pop) | ||
| 904 | #endif | ||
| 905 | |||
| 906 | #ifdef __MigPackStructs | ||
| 907 | #pragma pack(push, 4) | ||
| 908 | #endif | ||
| 909 | 	typedef struct { | ||
| 910 | 		mach_msg_header_t Head; | ||
| 911 | 		/* start of the kernel processed data */ | ||
| 912 | 		mach_msg_body_t msgh_body; | ||
| 913 | 		mach_msg_ool_ports_descriptor_t init_port_set; | ||
| 914 | 		/* end of the kernel processed data */ | ||
| 915 | 		NDR_record_t NDR; | ||
| 916 | 		mach_msg_type_number_t init_port_setCnt; | ||
| 917 | 	} __Request__mach_ports_register_t __attribute__((unused)); | ||
| 918 | #ifdef __MigPackStructs | ||
| 919 | #pragma pack(pop) | ||
| 920 | #endif | ||
| 921 | |||
| 922 | #ifdef __MigPackStructs | ||
| 923 | #pragma pack(push, 4) | ||
| 924 | #endif | ||
| 925 | 	typedef struct { | ||
| 926 | 		mach_msg_header_t Head; | ||
| 927 | 	} __Request__mach_ports_lookup_t __attribute__((unused)); | ||
| 928 | #ifdef __MigPackStructs | ||
| 929 | #pragma pack(pop) | ||
| 930 | #endif | ||
| 931 | |||
| 932 | #ifdef __MigPackStructs | ||
| 933 | #pragma pack(push, 4) | ||
| 934 | #endif | ||
| 935 | 	typedef struct { | ||
| 936 | 		mach_msg_header_t Head; | ||
| 937 | 		NDR_record_t NDR; | ||
| 938 | 		task_flavor_t flavor; | ||
| 939 | 		mach_msg_type_number_t task_info_outCnt; | ||
| 940 | 	} __Request__task_info_t __attribute__((unused)); | ||
| 941 | #ifdef __MigPackStructs | ||
| 942 | #pragma pack(pop) | ||
| 943 | #endif | ||
| 944 | |||
| 945 | #ifdef __MigPackStructs | ||
| 946 | #pragma pack(push, 4) | ||
| 947 | #endif | ||
| 948 | 	typedef struct { | ||
| 949 | 		mach_msg_header_t Head; | ||
| 950 | 		NDR_record_t NDR; | ||
| 951 | 		task_flavor_t flavor; | ||
| 952 | 		mach_msg_type_number_t task_info_inCnt; | ||
| 953 | 		integer_t task_info_in[87]; | ||
| 954 | 	} __Request__task_set_info_t __attribute__((unused)); | ||
| 955 | #ifdef __MigPackStructs | ||
| 956 | #pragma pack(pop) | ||
| 957 | #endif | ||
| 958 | |||
| 959 | #ifdef __MigPackStructs | ||
| 960 | #pragma pack(push, 4) | ||
| 961 | #endif | ||
| 962 | 	typedef struct { | ||
| 963 | 		mach_msg_header_t Head; | ||
| 964 | 	} __Request__task_suspend_t __attribute__((unused)); | ||
| 965 | #ifdef __MigPackStructs | ||
| 966 | #pragma pack(pop) | ||
| 967 | #endif | ||
| 968 | |||
| 969 | #ifdef __MigPackStructs | ||
| 970 | #pragma pack(push, 4) | ||
| 971 | #endif | ||
| 972 | 	typedef struct { | ||
| 973 | 		mach_msg_header_t Head; | ||
| 974 | 	} __Request__task_resume_t __attribute__((unused)); | ||
| 975 | #ifdef __MigPackStructs | ||
| 976 | #pragma pack(pop) | ||
| 977 | #endif | ||
| 978 | |||
| 979 | #ifdef __MigPackStructs | ||
| 980 | #pragma pack(push, 4) | ||
| 981 | #endif | ||
| 982 | 	typedef struct { | ||
| 983 | 		mach_msg_header_t Head; | ||
| 984 | 		NDR_record_t NDR; | ||
| 985 | 		int which_port; | ||
| 986 | 	} __Request__task_get_special_port_t __attribute__((unused)); | ||
| 987 | #ifdef __MigPackStructs | ||
| 988 | #pragma pack(pop) | ||
| 989 | #endif | ||
| 990 | |||
| 991 | #ifdef __MigPackStructs | ||
| 992 | #pragma pack(push, 4) | ||
| 993 | #endif | ||
| 994 | 	typedef struct { | ||
| 995 | 		mach_msg_header_t Head; | ||
| 996 | 		/* start of the kernel processed data */ | ||
| 997 | 		mach_msg_body_t msgh_body; | ||
| 998 | 		mach_msg_port_descriptor_t special_port; | ||
| 999 | 		/* end of the kernel processed data */ | ||
| 1000 | 		NDR_record_t NDR; | ||
| 1001 | 		int which_port; | ||
| 1002 | 	} __Request__task_set_special_port_t __attribute__((unused)); | ||
| 1003 | #ifdef __MigPackStructs | ||
| 1004 | #pragma pack(pop) | ||
| 1005 | #endif | ||
| 1006 | |||
| 1007 | #ifdef __MigPackStructs | ||
| 1008 | #pragma pack(push, 4) | ||
| 1009 | #endif | ||
| 1010 | 	typedef struct { | ||
| 1011 | 		mach_msg_header_t Head; | ||
| 1012 | 	} __Request__thread_create_t __attribute__((unused)); | ||
| 1013 | #ifdef __MigPackStructs | ||
| 1014 | #pragma pack(pop) | ||
| 1015 | #endif | ||
| 1016 | |||
| 1017 | #ifdef __MigPackStructs | ||
| 1018 | #pragma pack(push, 4) | ||
| 1019 | #endif | ||
| 1020 | 	typedef struct { | ||
| 1021 | 		mach_msg_header_t Head; | ||
| 1022 | 		NDR_record_t NDR; | ||
| 1023 | 		thread_state_flavor_t flavor; | ||
| 1024 | 		mach_msg_type_number_t new_stateCnt; | ||
| 1025 | 		natural_t new_state[1296]; | ||
| 1026 | 	} __Request__thread_create_running_t __attribute__((unused)); | ||
| 1027 | #ifdef __MigPackStructs | ||
| 1028 | #pragma pack(pop) | ||
| 1029 | #endif | ||
| 1030 | |||
| 1031 | #ifdef __MigPackStructs | ||
| 1032 | #pragma pack(push, 4) | ||
| 1033 | #endif | ||
| 1034 | 	typedef struct { | ||
| 1035 | 		mach_msg_header_t Head; | ||
| 1036 | 		/* start of the kernel processed data */ | ||
| 1037 | 		mach_msg_body_t msgh_body; | ||
| 1038 | 		mach_msg_port_descriptor_t new_port; | ||
| 1039 | 		/* end of the kernel processed data */ | ||
| 1040 | 		NDR_record_t NDR; | ||
| 1041 | 		exception_mask_t exception_mask; | ||
| 1042 | 		exception_behavior_t behavior; | ||
| 1043 | 		thread_state_flavor_t new_flavor; | ||
| 1044 | 	} __Request__task_set_exception_ports_t __attribute__((unused)); | ||
| 1045 | #ifdef __MigPackStructs | ||
| 1046 | #pragma pack(pop) | ||
| 1047 | #endif | ||
| 1048 | |||
| 1049 | #ifdef __MigPackStructs | ||
| 1050 | #pragma pack(push, 4) | ||
| 1051 | #endif | ||
| 1052 | 	typedef struct { | ||
| 1053 | 		mach_msg_header_t Head; | ||
| 1054 | 		NDR_record_t NDR; | ||
| 1055 | 		exception_mask_t exception_mask; | ||
| 1056 | 	} __Request__task_get_exception_ports_t __attribute__((unused)); | ||
| 1057 | #ifdef __MigPackStructs | ||
| 1058 | #pragma pack(pop) | ||
| 1059 | #endif | ||
| 1060 | |||
| 1061 | #ifdef __MigPackStructs | ||
| 1062 | #pragma pack(push, 4) | ||
| 1063 | #endif | ||
| 1064 | 	typedef struct { | ||
| 1065 | 		mach_msg_header_t Head; | ||
| 1066 | 		/* start of the kernel processed data */ | ||
| 1067 | 		mach_msg_body_t msgh_body; | ||
| 1068 | 		mach_msg_port_descriptor_t new_port; | ||
| 1069 | 		/* end of the kernel processed data */ | ||
| 1070 | 		NDR_record_t NDR; | ||
| 1071 | 		exception_mask_t exception_mask; | ||
| 1072 | 		exception_behavior_t behavior; | ||
| 1073 | 		thread_state_flavor_t new_flavor; | ||
| 1074 | 	} __Request__task_swap_exception_ports_t __attribute__((unused)); | ||
| 1075 | #ifdef __MigPackStructs | ||
| 1076 | #pragma pack(pop) | ||
| 1077 | #endif | ||
| 1078 | |||
| 1079 | #ifdef __MigPackStructs | ||
| 1080 | #pragma pack(push, 4) | ||
| 1081 | #endif | ||
| 1082 | 	typedef struct { | ||
| 1083 | 		mach_msg_header_t Head; | ||
| 1084 | 		NDR_record_t NDR; | ||
| 1085 | 		int n_ulocks; | ||
| 1086 | 		int policy; | ||
| 1087 | 	} __Request__lock_set_create_t __attribute__((unused)); | ||
| 1088 | #ifdef __MigPackStructs | ||
| 1089 | #pragma pack(pop) | ||
| 1090 | #endif | ||
| 1091 | |||
| 1092 | #ifdef __MigPackStructs | ||
| 1093 | #pragma pack(push, 4) | ||
| 1094 | #endif | ||
| 1095 | 	typedef struct { | ||
| 1096 | 		mach_msg_header_t Head; | ||
| 1097 | 		/* start of the kernel processed data */ | ||
| 1098 | 		mach_msg_body_t msgh_body; | ||
| 1099 | 		mach_msg_port_descriptor_t lock_set; | ||
| 1100 | 		/* end of the kernel processed data */ | ||
| 1101 | 	} __Request__lock_set_destroy_t __attribute__((unused)); | ||
| 1102 | #ifdef __MigPackStructs | ||
| 1103 | #pragma pack(pop) | ||
| 1104 | #endif | ||
| 1105 | |||
| 1106 | #ifdef __MigPackStructs | ||
| 1107 | #pragma pack(push, 4) | ||
| 1108 | #endif | ||
| 1109 | 	typedef struct { | ||
| 1110 | 		mach_msg_header_t Head; | ||
| 1111 | 		NDR_record_t NDR; | ||
| 1112 | 		int policy; | ||
| 1113 | 		int value; | ||
| 1114 | 	} __Request__semaphore_create_t __attribute__((unused)); | ||
| 1115 | #ifdef __MigPackStructs | ||
| 1116 | #pragma pack(pop) | ||
| 1117 | #endif | ||
| 1118 | |||
| 1119 | #ifdef __MigPackStructs | ||
| 1120 | #pragma pack(push, 4) | ||
| 1121 | #endif | ||
| 1122 | 	typedef struct { | ||
| 1123 | 		mach_msg_header_t Head; | ||
| 1124 | 		/* start of the kernel processed data */ | ||
| 1125 | 		mach_msg_body_t msgh_body; | ||
| 1126 | 		mach_msg_port_descriptor_t semaphore; | ||
| 1127 | 		/* end of the kernel processed data */ | ||
| 1128 | 	} __Request__semaphore_destroy_t __attribute__((unused)); | ||
| 1129 | #ifdef __MigPackStructs | ||
| 1130 | #pragma pack(pop) | ||
| 1131 | #endif | ||
| 1132 | |||
| 1133 | #ifdef __MigPackStructs | ||
| 1134 | #pragma pack(push, 4) | ||
| 1135 | #endif | ||
| 1136 | 	typedef struct { | ||
| 1137 | 		mach_msg_header_t Head; | ||
| 1138 | 		NDR_record_t NDR; | ||
| 1139 | 		task_policy_flavor_t flavor; | ||
| 1140 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 1141 | 		integer_t policy_info[16]; | ||
| 1142 | 	} __Request__task_policy_set_t __attribute__((unused)); | ||
| 1143 | #ifdef __MigPackStructs | ||
| 1144 | #pragma pack(pop) | ||
| 1145 | #endif | ||
| 1146 | |||
| 1147 | #ifdef __MigPackStructs | ||
| 1148 | #pragma pack(push, 4) | ||
| 1149 | #endif | ||
| 1150 | 	typedef struct { | ||
| 1151 | 		mach_msg_header_t Head; | ||
| 1152 | 		NDR_record_t NDR; | ||
| 1153 | 		task_policy_flavor_t flavor; | ||
| 1154 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 1155 | 		boolean_t get_default; | ||
| 1156 | 	} __Request__task_policy_get_t __attribute__((unused)); | ||
| 1157 | #ifdef __MigPackStructs | ||
| 1158 | #pragma pack(pop) | ||
| 1159 | #endif | ||
| 1160 | |||
| 1161 | #ifdef __MigPackStructs | ||
| 1162 | #pragma pack(push, 4) | ||
| 1163 | #endif | ||
| 1164 | 	typedef struct { | ||
| 1165 | 		mach_msg_header_t Head; | ||
| 1166 | 		/* start of the kernel processed data */ | ||
| 1167 | 		mach_msg_body_t msgh_body; | ||
| 1168 | 		mach_msg_port_descriptor_t reply; | ||
| 1169 | 		/* end of the kernel processed data */ | ||
| 1170 | 	} __Request__task_sample_t __attribute__((unused)); | ||
| 1171 | #ifdef __MigPackStructs | ||
| 1172 | #pragma pack(pop) | ||
| 1173 | #endif | ||
| 1174 | |||
| 1175 | #ifdef __MigPackStructs | ||
| 1176 | #pragma pack(push, 4) | ||
| 1177 | #endif | ||
| 1178 | 	typedef struct { | ||
| 1179 | 		mach_msg_header_t Head; | ||
| 1180 | 		NDR_record_t NDR; | ||
| 1181 | 		policy_t policy; | ||
| 1182 | 		mach_msg_type_number_t baseCnt; | ||
| 1183 | 		integer_t base[5]; | ||
| 1184 | 		boolean_t set_limit; | ||
| 1185 | 		boolean_t change; | ||
| 1186 | 	} __Request__task_policy_t __attribute__((unused)); | ||
| 1187 | #ifdef __MigPackStructs | ||
| 1188 | #pragma pack(pop) | ||
| 1189 | #endif | ||
| 1190 | |||
| 1191 | #ifdef __MigPackStructs | ||
| 1192 | #pragma pack(push, 4) | ||
| 1193 | #endif | ||
| 1194 | 	typedef struct { | ||
| 1195 | 		mach_msg_header_t Head; | ||
| 1196 | 		NDR_record_t NDR; | ||
| 1197 | 		vm_address_t routine_entry_pt; | ||
| 1198 | 		int routine_number; | ||
| 1199 | 	} __Request__task_set_emulation_t __attribute__((unused)); | ||
| 1200 | #ifdef __MigPackStructs | ||
| 1201 | #pragma pack(pop) | ||
| 1202 | #endif | ||
| 1203 | |||
| 1204 | #ifdef __MigPackStructs | ||
| 1205 | #pragma pack(push, 4) | ||
| 1206 | #endif | ||
| 1207 | 	typedef struct { | ||
| 1208 | 		mach_msg_header_t Head; | ||
| 1209 | 	} __Request__task_get_emulation_vector_t __attribute__((unused)); | ||
| 1210 | #ifdef __MigPackStructs | ||
| 1211 | #pragma pack(pop) | ||
| 1212 | #endif | ||
| 1213 | |||
| 1214 | #ifdef __MigPackStructs | ||
| 1215 | #pragma pack(push, 4) | ||
| 1216 | #endif | ||
| 1217 | 	typedef struct { | ||
| 1218 | 		mach_msg_header_t Head; | ||
| 1219 | 		/* start of the kernel processed data */ | ||
| 1220 | 		mach_msg_body_t msgh_body; | ||
| 1221 | 		mach_msg_ool_descriptor_t emulation_vector; | ||
| 1222 | 		/* end of the kernel processed data */ | ||
| 1223 | 		NDR_record_t NDR; | ||
| 1224 | 		int vector_start; | ||
| 1225 | 		mach_msg_type_number_t emulation_vectorCnt; | ||
| 1226 | 	} __Request__task_set_emulation_vector_t __attribute__((unused)); | ||
| 1227 | #ifdef __MigPackStructs | ||
| 1228 | #pragma pack(pop) | ||
| 1229 | #endif | ||
| 1230 | |||
| 1231 | #ifdef __MigPackStructs | ||
| 1232 | #pragma pack(push, 4) | ||
| 1233 | #endif | ||
| 1234 | 	typedef struct { | ||
| 1235 | 		mach_msg_header_t Head; | ||
| 1236 | 		NDR_record_t NDR; | ||
| 1237 | 		vm_address_t basepc; | ||
| 1238 | 		vm_address_t boundspc; | ||
| 1239 | 	} __Request__task_set_ras_pc_t __attribute__((unused)); | ||
| 1240 | #ifdef __MigPackStructs | ||
| 1241 | #pragma pack(pop) | ||
| 1242 | #endif | ||
| 1243 | |||
| 1244 | #ifdef __MigPackStructs | ||
| 1245 | #pragma pack(push, 4) | ||
| 1246 | #endif | ||
| 1247 | 	typedef struct { | ||
| 1248 | 		mach_msg_header_t Head; | ||
| 1249 | 	} __Request__task_zone_info_t __attribute__((unused)); | ||
| 1250 | #ifdef __MigPackStructs | ||
| 1251 | #pragma pack(pop) | ||
| 1252 | #endif | ||
| 1253 | |||
| 1254 | #ifdef __MigPackStructs | ||
| 1255 | #pragma pack(push, 4) | ||
| 1256 | #endif | ||
| 1257 | 	typedef struct { | ||
| 1258 | 		mach_msg_header_t Head; | ||
| 1259 | 		/* start of the kernel processed data */ | ||
| 1260 | 		mach_msg_body_t msgh_body; | ||
| 1261 | 		mach_msg_port_descriptor_t new_set; | ||
| 1262 | 		/* end of the kernel processed data */ | ||
| 1263 | 		NDR_record_t NDR; | ||
| 1264 | 		boolean_t assign_threads; | ||
| 1265 | 	} __Request__task_assign_t __attribute__((unused)); | ||
| 1266 | #ifdef __MigPackStructs | ||
| 1267 | #pragma pack(pop) | ||
| 1268 | #endif | ||
| 1269 | |||
| 1270 | #ifdef __MigPackStructs | ||
| 1271 | #pragma pack(push, 4) | ||
| 1272 | #endif | ||
| 1273 | 	typedef struct { | ||
| 1274 | 		mach_msg_header_t Head; | ||
| 1275 | 		NDR_record_t NDR; | ||
| 1276 | 		boolean_t assign_threads; | ||
| 1277 | 	} __Request__task_assign_default_t __attribute__((unused)); | ||
| 1278 | #ifdef __MigPackStructs | ||
| 1279 | #pragma pack(pop) | ||
| 1280 | #endif | ||
| 1281 | |||
| 1282 | #ifdef __MigPackStructs | ||
| 1283 | #pragma pack(push, 4) | ||
| 1284 | #endif | ||
| 1285 | 	typedef struct { | ||
| 1286 | 		mach_msg_header_t Head; | ||
| 1287 | 	} __Request__task_get_assignment_t __attribute__((unused)); | ||
| 1288 | #ifdef __MigPackStructs | ||
| 1289 | #pragma pack(pop) | ||
| 1290 | #endif | ||
| 1291 | |||
| 1292 | #ifdef __MigPackStructs | ||
| 1293 | #pragma pack(push, 4) | ||
| 1294 | #endif | ||
| 1295 | 	typedef struct { | ||
| 1296 | 		mach_msg_header_t Head; | ||
| 1297 | 		/* start of the kernel processed data */ | ||
| 1298 | 		mach_msg_body_t msgh_body; | ||
| 1299 | 		mach_msg_port_descriptor_t pset; | ||
| 1300 | 		/* end of the kernel processed data */ | ||
| 1301 | 		NDR_record_t NDR; | ||
| 1302 | 		policy_t policy; | ||
| 1303 | 		mach_msg_type_number_t baseCnt; | ||
| 1304 | 		integer_t base[5]; | ||
| 1305 | 		mach_msg_type_number_t limitCnt; | ||
| 1306 | 		integer_t limit[1]; | ||
| 1307 | 		boolean_t change; | ||
| 1308 | 	} __Request__task_set_policy_t __attribute__((unused)); | ||
| 1309 | #ifdef __MigPackStructs | ||
| 1310 | #pragma pack(pop) | ||
| 1311 | #endif | ||
| 1312 | |||
| 1313 | #ifdef __MigPackStructs | ||
| 1314 | #pragma pack(push, 4) | ||
| 1315 | #endif | ||
| 1316 | 	typedef struct { | ||
| 1317 | 		mach_msg_header_t Head; | ||
| 1318 | 		NDR_record_t NDR; | ||
| 1319 | 		thread_state_flavor_t flavor; | ||
| 1320 | 		mach_msg_type_number_t old_stateCnt; | ||
| 1321 | 	} __Request__task_get_state_t __attribute__((unused)); | ||
| 1322 | #ifdef __MigPackStructs | ||
| 1323 | #pragma pack(pop) | ||
| 1324 | #endif | ||
| 1325 | |||
| 1326 | #ifdef __MigPackStructs | ||
| 1327 | #pragma pack(push, 4) | ||
| 1328 | #endif | ||
| 1329 | 	typedef struct { | ||
| 1330 | 		mach_msg_header_t Head; | ||
| 1331 | 		NDR_record_t NDR; | ||
| 1332 | 		thread_state_flavor_t flavor; | ||
| 1333 | 		mach_msg_type_number_t new_stateCnt; | ||
| 1334 | 		natural_t new_state[1296]; | ||
| 1335 | 	} __Request__task_set_state_t __attribute__((unused)); | ||
| 1336 | #ifdef __MigPackStructs | ||
| 1337 | #pragma pack(pop) | ||
| 1338 | #endif | ||
| 1339 | |||
| 1340 | #ifdef __MigPackStructs | ||
| 1341 | #pragma pack(push, 4) | ||
| 1342 | #endif | ||
| 1343 | 	typedef struct { | ||
| 1344 | 		mach_msg_header_t Head; | ||
| 1345 | 		NDR_record_t NDR; | ||
| 1346 | 		int new_limit; | ||
| 1347 | 	} __Request__task_set_phys_footprint_limit_t __attribute__((unused)); | ||
| 1348 | #ifdef __MigPackStructs | ||
| 1349 | #pragma pack(pop) | ||
| 1350 | #endif | ||
| 1351 | |||
| 1352 | #ifdef __MigPackStructs | ||
| 1353 | #pragma pack(push, 4) | ||
| 1354 | #endif | ||
| 1355 | 	typedef struct { | ||
| 1356 | 		mach_msg_header_t Head; | ||
| 1357 | 	} __Request__task_suspend2_t __attribute__((unused)); | ||
| 1358 | #ifdef __MigPackStructs | ||
| 1359 | #pragma pack(pop) | ||
| 1360 | #endif | ||
| 1361 | |||
| 1362 | #ifdef __MigPackStructs | ||
| 1363 | #pragma pack(push, 4) | ||
| 1364 | #endif | ||
| 1365 | 	typedef struct { | ||
| 1366 | 		mach_msg_header_t Head; | ||
| 1367 | 	} __Request__task_resume2_t __attribute__((unused)); | ||
| 1368 | #ifdef __MigPackStructs | ||
| 1369 | #pragma pack(pop) | ||
| 1370 | #endif | ||
| 1371 | |||
| 1372 | #ifdef __MigPackStructs | ||
| 1373 | #pragma pack(push, 4) | ||
| 1374 | #endif | ||
| 1375 | 	typedef struct { | ||
| 1376 | 		mach_msg_header_t Head; | ||
| 1377 | 	} __Request__task_purgable_info_t __attribute__((unused)); | ||
| 1378 | #ifdef __MigPackStructs | ||
| 1379 | #pragma pack(pop) | ||
| 1380 | #endif | ||
| 1381 | |||
| 1382 | #ifdef __MigPackStructs | ||
| 1383 | #pragma pack(push, 4) | ||
| 1384 | #endif | ||
| 1385 | 	typedef struct { | ||
| 1386 | 		mach_msg_header_t Head; | ||
| 1387 | 		NDR_record_t NDR; | ||
| 1388 | 		mach_voucher_selector_t which; | ||
| 1389 | 	} __Request__task_get_mach_voucher_t __attribute__((unused)); | ||
| 1390 | #ifdef __MigPackStructs | ||
| 1391 | #pragma pack(pop) | ||
| 1392 | #endif | ||
| 1393 | |||
| 1394 | #ifdef __MigPackStructs | ||
| 1395 | #pragma pack(push, 4) | ||
| 1396 | #endif | ||
| 1397 | 	typedef struct { | ||
| 1398 | 		mach_msg_header_t Head; | ||
| 1399 | 		/* start of the kernel processed data */ | ||
| 1400 | 		mach_msg_body_t msgh_body; | ||
| 1401 | 		mach_msg_port_descriptor_t voucher; | ||
| 1402 | 		/* end of the kernel processed data */ | ||
| 1403 | 	} __Request__task_set_mach_voucher_t __attribute__((unused)); | ||
| 1404 | #ifdef __MigPackStructs | ||
| 1405 | #pragma pack(pop) | ||
| 1406 | #endif | ||
| 1407 | |||
| 1408 | #ifdef __MigPackStructs | ||
| 1409 | #pragma pack(push, 4) | ||
| 1410 | #endif | ||
| 1411 | 	typedef struct { | ||
| 1412 | 		mach_msg_header_t Head; | ||
| 1413 | 		/* start of the kernel processed data */ | ||
| 1414 | 		mach_msg_body_t msgh_body; | ||
| 1415 | 		mach_msg_port_descriptor_t new_voucher; | ||
| 1416 | 		mach_msg_port_descriptor_t old_voucher; | ||
| 1417 | 		/* end of the kernel processed data */ | ||
| 1418 | 	} __Request__task_swap_mach_voucher_t __attribute__((unused)); | ||
| 1419 | #ifdef __MigPackStructs | ||
| 1420 | #pragma pack(pop) | ||
| 1421 | #endif | ||
| 1422 | |||
| 1423 | #ifdef __MigPackStructs | ||
| 1424 | #pragma pack(push, 4) | ||
| 1425 | #endif | ||
| 1426 | 	typedef struct { | ||
| 1427 | 		mach_msg_header_t Head; | ||
| 1428 | 	} __Request__task_generate_corpse_t __attribute__((unused)); | ||
| 1429 | #ifdef __MigPackStructs | ||
| 1430 | #pragma pack(pop) | ||
| 1431 | #endif | ||
| 1432 | |||
| 1433 | #ifdef __MigPackStructs | ||
| 1434 | #pragma pack(push, 4) | ||
| 1435 | #endif | ||
| 1436 | 	typedef struct { | ||
| 1437 | 		mach_msg_header_t Head; | ||
| 1438 | 		/* start of the kernel processed data */ | ||
| 1439 | 		mach_msg_body_t msgh_body; | ||
| 1440 | 		mach_msg_port_descriptor_t corspe_task; | ||
| 1441 | 		/* end of the kernel processed data */ | ||
| 1442 | 	} __Request__task_map_corpse_info_t __attribute__((unused)); | ||
| 1443 | #ifdef __MigPackStructs | ||
| 1444 | #pragma pack(pop) | ||
| 1445 | #endif | ||
| 1446 | |||
| 1447 | #ifdef __MigPackStructs | ||
| 1448 | #pragma pack(push, 4) | ||
| 1449 | #endif | ||
| 1450 | 	typedef struct { | ||
| 1451 | 		mach_msg_header_t Head; | ||
| 1452 | 		/* start of the kernel processed data */ | ||
| 1453 | 		mach_msg_body_t msgh_body; | ||
| 1454 | 		mach_msg_ool_descriptor_t dyld_images; | ||
| 1455 | 		/* end of the kernel processed data */ | ||
| 1456 | 		NDR_record_t NDR; | ||
| 1457 | 		mach_msg_type_number_t dyld_imagesCnt; | ||
| 1458 | 	} __Request__task_register_dyld_image_infos_t __attribute__((unused)); | ||
| 1459 | #ifdef __MigPackStructs | ||
| 1460 | #pragma pack(pop) | ||
| 1461 | #endif | ||
| 1462 | |||
| 1463 | #ifdef __MigPackStructs | ||
| 1464 | #pragma pack(push, 4) | ||
| 1465 | #endif | ||
| 1466 | 	typedef struct { | ||
| 1467 | 		mach_msg_header_t Head; | ||
| 1468 | 		/* start of the kernel processed data */ | ||
| 1469 | 		mach_msg_body_t msgh_body; | ||
| 1470 | 		mach_msg_ool_descriptor_t dyld_images; | ||
| 1471 | 		/* end of the kernel processed data */ | ||
| 1472 | 		NDR_record_t NDR; | ||
| 1473 | 		mach_msg_type_number_t dyld_imagesCnt; | ||
| 1474 | 	} __Request__task_unregister_dyld_image_infos_t __attribute__((unused)); | ||
| 1475 | #ifdef __MigPackStructs | ||
| 1476 | #pragma pack(pop) | ||
| 1477 | #endif | ||
| 1478 | |||
| 1479 | #ifdef __MigPackStructs | ||
| 1480 | #pragma pack(push, 4) | ||
| 1481 | #endif | ||
| 1482 | 	typedef struct { | ||
| 1483 | 		mach_msg_header_t Head; | ||
| 1484 | 	} __Request__task_get_dyld_image_infos_t __attribute__((unused)); | ||
| 1485 | #ifdef __MigPackStructs | ||
| 1486 | #pragma pack(pop) | ||
| 1487 | #endif | ||
| 1488 | |||
| 1489 | #ifdef __MigPackStructs | ||
| 1490 | #pragma pack(push, 4) | ||
| 1491 | #endif | ||
| 1492 | 	typedef struct { | ||
| 1493 | 		mach_msg_header_t Head; | ||
| 1494 | 		NDR_record_t NDR; | ||
| 1495 | 		dyld_kernel_image_info_t dyld_cache_image; | ||
| 1496 | 		boolean_t no_cache; | ||
| 1497 | 		boolean_t private_cache; | ||
| 1498 | 	} __Request__task_register_dyld_shared_cache_image_info_t __attribute__((unused)); | ||
| 1499 | #ifdef __MigPackStructs | ||
| 1500 | #pragma pack(pop) | ||
| 1501 | #endif | ||
| 1502 | |||
| 1503 | #ifdef __MigPackStructs | ||
| 1504 | #pragma pack(push, 4) | ||
| 1505 | #endif | ||
| 1506 | 	typedef struct { | ||
| 1507 | 		mach_msg_header_t Head; | ||
| 1508 | 		NDR_record_t NDR; | ||
| 1509 | 		uint8_t dyld_state; | ||
| 1510 | 		char dyld_statePad[3]; | ||
| 1511 | 	} __Request__task_register_dyld_set_dyld_state_t __attribute__((unused)); | ||
| 1512 | #ifdef __MigPackStructs | ||
| 1513 | #pragma pack(pop) | ||
| 1514 | #endif | ||
| 1515 | |||
| 1516 | #ifdef __MigPackStructs | ||
| 1517 | #pragma pack(push, 4) | ||
| 1518 | #endif | ||
| 1519 | 	typedef struct { | ||
| 1520 | 		mach_msg_header_t Head; | ||
| 1521 | 	} __Request__task_register_dyld_get_process_state_t __attribute__((unused)); | ||
| 1522 | #ifdef __MigPackStructs | ||
| 1523 | #pragma pack(pop) | ||
| 1524 | #endif | ||
| 1525 | |||
| 1526 | #ifdef __MigPackStructs | ||
| 1527 | #pragma pack(push, 4) | ||
| 1528 | #endif | ||
| 1529 | 	typedef struct { | ||
| 1530 | 		mach_msg_header_t Head; | ||
| 1531 | 		/* start of the kernel processed data */ | ||
| 1532 | 		mach_msg_body_t msgh_body; | ||
| 1533 | 		mach_msg_port_descriptor_t corspe_task; | ||
| 1534 | 		/* end of the kernel processed data */ | ||
| 1535 | 	} __Request__task_map_corpse_info_64_t __attribute__((unused)); | ||
| 1536 | #ifdef __MigPackStructs | ||
| 1537 | #pragma pack(pop) | ||
| 1538 | #endif | ||
| 1539 | |||
| 1540 | #ifdef __MigPackStructs | ||
| 1541 | #pragma pack(push, 4) | ||
| 1542 | #endif | ||
| 1543 | 	typedef struct { | ||
| 1544 | 		mach_msg_header_t Head; | ||
| 1545 | 		NDR_record_t NDR; | ||
| 1546 | 		task_inspect_flavor_t flavor; | ||
| 1547 | 		mach_msg_type_number_t info_outCnt; | ||
| 1548 | 	} __Request__task_inspect_t __attribute__((unused)); | ||
| 1549 | #ifdef __MigPackStructs | ||
| 1550 | #pragma pack(pop) | ||
| 1551 | #endif | ||
| 1552 | |||
| 1553 | #ifdef __MigPackStructs | ||
| 1554 | #pragma pack(push, 4) | ||
| 1555 | #endif | ||
| 1556 | 	typedef struct { | ||
| 1557 | 		mach_msg_header_t Head; | ||
| 1558 | 	} __Request__task_get_exc_guard_behavior_t __attribute__((unused)); | ||
| 1559 | #ifdef __MigPackStructs | ||
| 1560 | #pragma pack(pop) | ||
| 1561 | #endif | ||
| 1562 | |||
| 1563 | #ifdef __MigPackStructs | ||
| 1564 | #pragma pack(push, 4) | ||
| 1565 | #endif | ||
| 1566 | 	typedef struct { | ||
| 1567 | 		mach_msg_header_t Head; | ||
| 1568 | 		NDR_record_t NDR; | ||
| 1569 | 		task_exc_guard_behavior_t behavior; | ||
| 1570 | 	} __Request__task_set_exc_guard_behavior_t __attribute__((unused)); | ||
| 1571 | #ifdef __MigPackStructs | ||
| 1572 | #pragma pack(pop) | ||
| 1573 | #endif | ||
| 1574 | |||
| 1575 | #ifdef __MigPackStructs | ||
| 1576 | #pragma pack(push, 4) | ||
| 1577 | #endif | ||
| 1578 | 	typedef struct { | ||
| 1579 | 		mach_msg_header_t Head; | ||
| 1580 | 		NDR_record_t NDR; | ||
| 1581 | 		mach_msg_type_number_t pathOffset; /* MiG doesn't use it */ | ||
| 1582 | 		mach_msg_type_number_t pathCnt; | ||
| 1583 | 		char path[1024]; | ||
| 1584 | 		suid_cred_uid_t uid; | ||
| 1585 | 	} __Request__task_create_suid_cred_t __attribute__((unused)); | ||
| 1586 | #ifdef __MigPackStructs | ||
| 1587 | #pragma pack(pop) | ||
| 1588 | #endif | ||
| 1589 | #endif /* !__Request__task_subsystem__defined */ | ||
| 1590 | |||
| 1591 | /* union of all requests */ | ||
| 1592 | |||
| 1593 | #ifndef __RequestUnion__task_subsystem__defined | ||
| 1594 | #define __RequestUnion__task_subsystem__defined | ||
| 1595 | union __RequestUnion__task_subsystem { | ||
| 1596 | 	__Request__task_create_t Request_task_create; | ||
| 1597 | 	__Request__task_terminate_t Request_task_terminate; | ||
| 1598 | 	__Request__task_threads_t Request_task_threads; | ||
| 1599 | 	__Request__mach_ports_register_t Request_mach_ports_register; | ||
| 1600 | 	__Request__mach_ports_lookup_t Request_mach_ports_lookup; | ||
| 1601 | 	__Request__task_info_t Request_task_info; | ||
| 1602 | 	__Request__task_set_info_t Request_task_set_info; | ||
| 1603 | 	__Request__task_suspend_t Request_task_suspend; | ||
| 1604 | 	__Request__task_resume_t Request_task_resume; | ||
| 1605 | 	__Request__task_get_special_port_t Request_task_get_special_port; | ||
| 1606 | 	__Request__task_set_special_port_t Request_task_set_special_port; | ||
| 1607 | 	__Request__thread_create_t Request_thread_create; | ||
| 1608 | 	__Request__thread_create_running_t Request_thread_create_running; | ||
| 1609 | 	__Request__task_set_exception_ports_t Request_task_set_exception_ports; | ||
| 1610 | 	__Request__task_get_exception_ports_t Request_task_get_exception_ports; | ||
| 1611 | 	__Request__task_swap_exception_ports_t Request_task_swap_exception_ports; | ||
| 1612 | 	__Request__lock_set_create_t Request_lock_set_create; | ||
| 1613 | 	__Request__lock_set_destroy_t Request_lock_set_destroy; | ||
| 1614 | 	__Request__semaphore_create_t Request_semaphore_create; | ||
| 1615 | 	__Request__semaphore_destroy_t Request_semaphore_destroy; | ||
| 1616 | 	__Request__task_policy_set_t Request_task_policy_set; | ||
| 1617 | 	__Request__task_policy_get_t Request_task_policy_get; | ||
| 1618 | 	__Request__task_sample_t Request_task_sample; | ||
| 1619 | 	__Request__task_policy_t Request_task_policy; | ||
| 1620 | 	__Request__task_set_emulation_t Request_task_set_emulation; | ||
| 1621 | 	__Request__task_get_emulation_vector_t Request_task_get_emulation_vector; | ||
| 1622 | 	__Request__task_set_emulation_vector_t Request_task_set_emulation_vector; | ||
| 1623 | 	__Request__task_set_ras_pc_t Request_task_set_ras_pc; | ||
| 1624 | 	__Request__task_zone_info_t Request_task_zone_info; | ||
| 1625 | 	__Request__task_assign_t Request_task_assign; | ||
| 1626 | 	__Request__task_assign_default_t Request_task_assign_default; | ||
| 1627 | 	__Request__task_get_assignment_t Request_task_get_assignment; | ||
| 1628 | 	__Request__task_set_policy_t Request_task_set_policy; | ||
| 1629 | 	__Request__task_get_state_t Request_task_get_state; | ||
| 1630 | 	__Request__task_set_state_t Request_task_set_state; | ||
| 1631 | 	__Request__task_set_phys_footprint_limit_t Request_task_set_phys_footprint_limit; | ||
| 1632 | 	__Request__task_suspend2_t Request_task_suspend2; | ||
| 1633 | 	__Request__task_resume2_t Request_task_resume2; | ||
| 1634 | 	__Request__task_purgable_info_t Request_task_purgable_info; | ||
| 1635 | 	__Request__task_get_mach_voucher_t Request_task_get_mach_voucher; | ||
| 1636 | 	__Request__task_set_mach_voucher_t Request_task_set_mach_voucher; | ||
| 1637 | 	__Request__task_swap_mach_voucher_t Request_task_swap_mach_voucher; | ||
| 1638 | 	__Request__task_generate_corpse_t Request_task_generate_corpse; | ||
| 1639 | 	__Request__task_map_corpse_info_t Request_task_map_corpse_info; | ||
| 1640 | 	__Request__task_register_dyld_image_infos_t Request_task_register_dyld_image_infos; | ||
| 1641 | 	__Request__task_unregister_dyld_image_infos_t Request_task_unregister_dyld_image_infos; | ||
| 1642 | 	__Request__task_get_dyld_image_infos_t Request_task_get_dyld_image_infos; | ||
| 1643 | 	__Request__task_register_dyld_shared_cache_image_info_t Request_task_register_dyld_shared_cache_image_info; | ||
| 1644 | 	__Request__task_register_dyld_set_dyld_state_t Request_task_register_dyld_set_dyld_state; | ||
| 1645 | 	__Request__task_register_dyld_get_process_state_t Request_task_register_dyld_get_process_state; | ||
| 1646 | 	__Request__task_map_corpse_info_64_t Request_task_map_corpse_info_64; | ||
| 1647 | 	__Request__task_inspect_t Request_task_inspect; | ||
| 1648 | 	__Request__task_get_exc_guard_behavior_t Request_task_get_exc_guard_behavior; | ||
| 1649 | 	__Request__task_set_exc_guard_behavior_t Request_task_set_exc_guard_behavior; | ||
| 1650 | 	__Request__task_create_suid_cred_t Request_task_create_suid_cred; | ||
| 1651 | }; | ||
| 1652 | #endif /* !__RequestUnion__task_subsystem__defined */ | ||
| 1653 | /* typedefs for all replies */ | ||
| 1654 | |||
| 1655 | #ifndef __Reply__task_subsystem__defined | ||
| 1656 | #define __Reply__task_subsystem__defined | ||
| 1657 | |||
| 1658 | #ifdef __MigPackStructs | ||
| 1659 | #pragma pack(push, 4) | ||
| 1660 | #endif | ||
| 1661 | 	typedef struct { | ||
| 1662 | 		mach_msg_header_t Head; | ||
| 1663 | 		/* start of the kernel processed data */ | ||
| 1664 | 		mach_msg_body_t msgh_body; | ||
| 1665 | 		mach_msg_port_descriptor_t child_task; | ||
| 1666 | 		/* end of the kernel processed data */ | ||
| 1667 | 	} __Reply__task_create_t __attribute__((unused)); | ||
| 1668 | #ifdef __MigPackStructs | ||
| 1669 | #pragma pack(pop) | ||
| 1670 | #endif | ||
| 1671 | |||
| 1672 | #ifdef __MigPackStructs | ||
| 1673 | #pragma pack(push, 4) | ||
| 1674 | #endif | ||
| 1675 | 	typedef struct { | ||
| 1676 | 		mach_msg_header_t Head; | ||
| 1677 | 		NDR_record_t NDR; | ||
| 1678 | 		kern_return_t RetCode; | ||
| 1679 | 	} __Reply__task_terminate_t __attribute__((unused)); | ||
| 1680 | #ifdef __MigPackStructs | ||
| 1681 | #pragma pack(pop) | ||
| 1682 | #endif | ||
| 1683 | |||
| 1684 | #ifdef __MigPackStructs | ||
| 1685 | #pragma pack(push, 4) | ||
| 1686 | #endif | ||
| 1687 | 	typedef struct { | ||
| 1688 | 		mach_msg_header_t Head; | ||
| 1689 | 		/* start of the kernel processed data */ | ||
| 1690 | 		mach_msg_body_t msgh_body; | ||
| 1691 | 		mach_msg_ool_ports_descriptor_t act_list; | ||
| 1692 | 		/* end of the kernel processed data */ | ||
| 1693 | 		NDR_record_t NDR; | ||
| 1694 | 		mach_msg_type_number_t act_listCnt; | ||
| 1695 | 	} __Reply__task_threads_t __attribute__((unused)); | ||
| 1696 | #ifdef __MigPackStructs | ||
| 1697 | #pragma pack(pop) | ||
| 1698 | #endif | ||
| 1699 | |||
| 1700 | #ifdef __MigPackStructs | ||
| 1701 | #pragma pack(push, 4) | ||
| 1702 | #endif | ||
| 1703 | 	typedef struct { | ||
| 1704 | 		mach_msg_header_t Head; | ||
| 1705 | 		NDR_record_t NDR; | ||
| 1706 | 		kern_return_t RetCode; | ||
| 1707 | 	} __Reply__mach_ports_register_t __attribute__((unused)); | ||
| 1708 | #ifdef __MigPackStructs | ||
| 1709 | #pragma pack(pop) | ||
| 1710 | #endif | ||
| 1711 | |||
| 1712 | #ifdef __MigPackStructs | ||
| 1713 | #pragma pack(push, 4) | ||
| 1714 | #endif | ||
| 1715 | 	typedef struct { | ||
| 1716 | 		mach_msg_header_t Head; | ||
| 1717 | 		/* start of the kernel processed data */ | ||
| 1718 | 		mach_msg_body_t msgh_body; | ||
| 1719 | 		mach_msg_ool_ports_descriptor_t init_port_set; | ||
| 1720 | 		/* end of the kernel processed data */ | ||
| 1721 | 		NDR_record_t NDR; | ||
| 1722 | 		mach_msg_type_number_t init_port_setCnt; | ||
| 1723 | 	} __Reply__mach_ports_lookup_t __attribute__((unused)); | ||
| 1724 | #ifdef __MigPackStructs | ||
| 1725 | #pragma pack(pop) | ||
| 1726 | #endif | ||
| 1727 | |||
| 1728 | #ifdef __MigPackStructs | ||
| 1729 | #pragma pack(push, 4) | ||
| 1730 | #endif | ||
| 1731 | 	typedef struct { | ||
| 1732 | 		mach_msg_header_t Head; | ||
| 1733 | 		NDR_record_t NDR; | ||
| 1734 | 		kern_return_t RetCode; | ||
| 1735 | 		mach_msg_type_number_t task_info_outCnt; | ||
| 1736 | 		integer_t task_info_out[87]; | ||
| 1737 | 	} __Reply__task_info_t __attribute__((unused)); | ||
| 1738 | #ifdef __MigPackStructs | ||
| 1739 | #pragma pack(pop) | ||
| 1740 | #endif | ||
| 1741 | |||
| 1742 | #ifdef __MigPackStructs | ||
| 1743 | #pragma pack(push, 4) | ||
| 1744 | #endif | ||
| 1745 | 	typedef struct { | ||
| 1746 | 		mach_msg_header_t Head; | ||
| 1747 | 		NDR_record_t NDR; | ||
| 1748 | 		kern_return_t RetCode; | ||
| 1749 | 	} __Reply__task_set_info_t __attribute__((unused)); | ||
| 1750 | #ifdef __MigPackStructs | ||
| 1751 | #pragma pack(pop) | ||
| 1752 | #endif | ||
| 1753 | |||
| 1754 | #ifdef __MigPackStructs | ||
| 1755 | #pragma pack(push, 4) | ||
| 1756 | #endif | ||
| 1757 | 	typedef struct { | ||
| 1758 | 		mach_msg_header_t Head; | ||
| 1759 | 		NDR_record_t NDR; | ||
| 1760 | 		kern_return_t RetCode; | ||
| 1761 | 	} __Reply__task_suspend_t __attribute__((unused)); | ||
| 1762 | #ifdef __MigPackStructs | ||
| 1763 | #pragma pack(pop) | ||
| 1764 | #endif | ||
| 1765 | |||
| 1766 | #ifdef __MigPackStructs | ||
| 1767 | #pragma pack(push, 4) | ||
| 1768 | #endif | ||
| 1769 | 	typedef struct { | ||
| 1770 | 		mach_msg_header_t Head; | ||
| 1771 | 		NDR_record_t NDR; | ||
| 1772 | 		kern_return_t RetCode; | ||
| 1773 | 	} __Reply__task_resume_t __attribute__((unused)); | ||
| 1774 | #ifdef __MigPackStructs | ||
| 1775 | #pragma pack(pop) | ||
| 1776 | #endif | ||
| 1777 | |||
| 1778 | #ifdef __MigPackStructs | ||
| 1779 | #pragma pack(push, 4) | ||
| 1780 | #endif | ||
| 1781 | 	typedef struct { | ||
| 1782 | 		mach_msg_header_t Head; | ||
| 1783 | 		/* start of the kernel processed data */ | ||
| 1784 | 		mach_msg_body_t msgh_body; | ||
| 1785 | 		mach_msg_port_descriptor_t special_port; | ||
| 1786 | 		/* end of the kernel processed data */ | ||
| 1787 | 	} __Reply__task_get_special_port_t __attribute__((unused)); | ||
| 1788 | #ifdef __MigPackStructs | ||
| 1789 | #pragma pack(pop) | ||
| 1790 | #endif | ||
| 1791 | |||
| 1792 | #ifdef __MigPackStructs | ||
| 1793 | #pragma pack(push, 4) | ||
| 1794 | #endif | ||
| 1795 | 	typedef struct { | ||
| 1796 | 		mach_msg_header_t Head; | ||
| 1797 | 		NDR_record_t NDR; | ||
| 1798 | 		kern_return_t RetCode; | ||
| 1799 | 	} __Reply__task_set_special_port_t __attribute__((unused)); | ||
| 1800 | #ifdef __MigPackStructs | ||
| 1801 | #pragma pack(pop) | ||
| 1802 | #endif | ||
| 1803 | |||
| 1804 | #ifdef __MigPackStructs | ||
| 1805 | #pragma pack(push, 4) | ||
| 1806 | #endif | ||
| 1807 | 	typedef struct { | ||
| 1808 | 		mach_msg_header_t Head; | ||
| 1809 | 		/* start of the kernel processed data */ | ||
| 1810 | 		mach_msg_body_t msgh_body; | ||
| 1811 | 		mach_msg_port_descriptor_t child_act; | ||
| 1812 | 		/* end of the kernel processed data */ | ||
| 1813 | 	} __Reply__thread_create_t __attribute__((unused)); | ||
| 1814 | #ifdef __MigPackStructs | ||
| 1815 | #pragma pack(pop) | ||
| 1816 | #endif | ||
| 1817 | |||
| 1818 | #ifdef __MigPackStructs | ||
| 1819 | #pragma pack(push, 4) | ||
| 1820 | #endif | ||
| 1821 | 	typedef struct { | ||
| 1822 | 		mach_msg_header_t Head; | ||
| 1823 | 		/* start of the kernel processed data */ | ||
| 1824 | 		mach_msg_body_t msgh_body; | ||
| 1825 | 		mach_msg_port_descriptor_t child_act; | ||
| 1826 | 		/* end of the kernel processed data */ | ||
| 1827 | 	} __Reply__thread_create_running_t __attribute__((unused)); | ||
| 1828 | #ifdef __MigPackStructs | ||
| 1829 | #pragma pack(pop) | ||
| 1830 | #endif | ||
| 1831 | |||
| 1832 | #ifdef __MigPackStructs | ||
| 1833 | #pragma pack(push, 4) | ||
| 1834 | #endif | ||
| 1835 | 	typedef struct { | ||
| 1836 | 		mach_msg_header_t Head; | ||
| 1837 | 		NDR_record_t NDR; | ||
| 1838 | 		kern_return_t RetCode; | ||
| 1839 | 	} __Reply__task_set_exception_ports_t __attribute__((unused)); | ||
| 1840 | #ifdef __MigPackStructs | ||
| 1841 | #pragma pack(pop) | ||
| 1842 | #endif | ||
| 1843 | |||
| 1844 | #ifdef __MigPackStructs | ||
| 1845 | #pragma pack(push, 4) | ||
| 1846 | #endif | ||
| 1847 | 	typedef struct { | ||
| 1848 | 		mach_msg_header_t Head; | ||
| 1849 | 		/* start of the kernel processed data */ | ||
| 1850 | 		mach_msg_body_t msgh_body; | ||
| 1851 | 		mach_msg_port_descriptor_t old_handlers[32]; | ||
| 1852 | 		/* end of the kernel processed data */ | ||
| 1853 | 		NDR_record_t NDR; | ||
| 1854 | 		mach_msg_type_number_t masksCnt; | ||
| 1855 | 		exception_mask_t masks[32]; | ||
| 1856 | 		exception_behavior_t old_behaviors[32]; | ||
| 1857 | 		thread_state_flavor_t old_flavors[32]; | ||
| 1858 | 	} __Reply__task_get_exception_ports_t __attribute__((unused)); | ||
| 1859 | #ifdef __MigPackStructs | ||
| 1860 | #pragma pack(pop) | ||
| 1861 | #endif | ||
| 1862 | |||
| 1863 | #ifdef __MigPackStructs | ||
| 1864 | #pragma pack(push, 4) | ||
| 1865 | #endif | ||
| 1866 | 	typedef struct { | ||
| 1867 | 		mach_msg_header_t Head; | ||
| 1868 | 		/* start of the kernel processed data */ | ||
| 1869 | 		mach_msg_body_t msgh_body; | ||
| 1870 | 		mach_msg_port_descriptor_t old_handlerss[32]; | ||
| 1871 | 		/* end of the kernel processed data */ | ||
| 1872 | 		NDR_record_t NDR; | ||
| 1873 | 		mach_msg_type_number_t masksCnt; | ||
| 1874 | 		exception_mask_t masks[32]; | ||
| 1875 | 		exception_behavior_t old_behaviors[32]; | ||
| 1876 | 		thread_state_flavor_t old_flavors[32]; | ||
| 1877 | 	} __Reply__task_swap_exception_ports_t __attribute__((unused)); | ||
| 1878 | #ifdef __MigPackStructs | ||
| 1879 | #pragma pack(pop) | ||
| 1880 | #endif | ||
| 1881 | |||
| 1882 | #ifdef __MigPackStructs | ||
| 1883 | #pragma pack(push, 4) | ||
| 1884 | #endif | ||
| 1885 | 	typedef struct { | ||
| 1886 | 		mach_msg_header_t Head; | ||
| 1887 | 		/* start of the kernel processed data */ | ||
| 1888 | 		mach_msg_body_t msgh_body; | ||
| 1889 | 		mach_msg_port_descriptor_t new_lock_set; | ||
| 1890 | 		/* end of the kernel processed data */ | ||
| 1891 | 	} __Reply__lock_set_create_t __attribute__((unused)); | ||
| 1892 | #ifdef __MigPackStructs | ||
| 1893 | #pragma pack(pop) | ||
| 1894 | #endif | ||
| 1895 | |||
| 1896 | #ifdef __MigPackStructs | ||
| 1897 | #pragma pack(push, 4) | ||
| 1898 | #endif | ||
| 1899 | 	typedef struct { | ||
| 1900 | 		mach_msg_header_t Head; | ||
| 1901 | 		NDR_record_t NDR; | ||
| 1902 | 		kern_return_t RetCode; | ||
| 1903 | 	} __Reply__lock_set_destroy_t __attribute__((unused)); | ||
| 1904 | #ifdef __MigPackStructs | ||
| 1905 | #pragma pack(pop) | ||
| 1906 | #endif | ||
| 1907 | |||
| 1908 | #ifdef __MigPackStructs | ||
| 1909 | #pragma pack(push, 4) | ||
| 1910 | #endif | ||
| 1911 | 	typedef struct { | ||
| 1912 | 		mach_msg_header_t Head; | ||
| 1913 | 		/* start of the kernel processed data */ | ||
| 1914 | 		mach_msg_body_t msgh_body; | ||
| 1915 | 		mach_msg_port_descriptor_t semaphore; | ||
| 1916 | 		/* end of the kernel processed data */ | ||
| 1917 | 	} __Reply__semaphore_create_t __attribute__((unused)); | ||
| 1918 | #ifdef __MigPackStructs | ||
| 1919 | #pragma pack(pop) | ||
| 1920 | #endif | ||
| 1921 | |||
| 1922 | #ifdef __MigPackStructs | ||
| 1923 | #pragma pack(push, 4) | ||
| 1924 | #endif | ||
| 1925 | 	typedef struct { | ||
| 1926 | 		mach_msg_header_t Head; | ||
| 1927 | 		NDR_record_t NDR; | ||
| 1928 | 		kern_return_t RetCode; | ||
| 1929 | 	} __Reply__semaphore_destroy_t __attribute__((unused)); | ||
| 1930 | #ifdef __MigPackStructs | ||
| 1931 | #pragma pack(pop) | ||
| 1932 | #endif | ||
| 1933 | |||
| 1934 | #ifdef __MigPackStructs | ||
| 1935 | #pragma pack(push, 4) | ||
| 1936 | #endif | ||
| 1937 | 	typedef struct { | ||
| 1938 | 		mach_msg_header_t Head; | ||
| 1939 | 		NDR_record_t NDR; | ||
| 1940 | 		kern_return_t RetCode; | ||
| 1941 | 	} __Reply__task_policy_set_t __attribute__((unused)); | ||
| 1942 | #ifdef __MigPackStructs | ||
| 1943 | #pragma pack(pop) | ||
| 1944 | #endif | ||
| 1945 | |||
| 1946 | #ifdef __MigPackStructs | ||
| 1947 | #pragma pack(push, 4) | ||
| 1948 | #endif | ||
| 1949 | 	typedef struct { | ||
| 1950 | 		mach_msg_header_t Head; | ||
| 1951 | 		NDR_record_t NDR; | ||
| 1952 | 		kern_return_t RetCode; | ||
| 1953 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 1954 | 		integer_t policy_info[16]; | ||
| 1955 | 		boolean_t get_default; | ||
| 1956 | 	} __Reply__task_policy_get_t __attribute__((unused)); | ||
| 1957 | #ifdef __MigPackStructs | ||
| 1958 | #pragma pack(pop) | ||
| 1959 | #endif | ||
| 1960 | |||
| 1961 | #ifdef __MigPackStructs | ||
| 1962 | #pragma pack(push, 4) | ||
| 1963 | #endif | ||
| 1964 | 	typedef struct { | ||
| 1965 | 		mach_msg_header_t Head; | ||
| 1966 | 		NDR_record_t NDR; | ||
| 1967 | 		kern_return_t RetCode; | ||
| 1968 | 	} __Reply__task_sample_t __attribute__((unused)); | ||
| 1969 | #ifdef __MigPackStructs | ||
| 1970 | #pragma pack(pop) | ||
| 1971 | #endif | ||
| 1972 | |||
| 1973 | #ifdef __MigPackStructs | ||
| 1974 | #pragma pack(push, 4) | ||
| 1975 | #endif | ||
| 1976 | 	typedef struct { | ||
| 1977 | 		mach_msg_header_t Head; | ||
| 1978 | 		NDR_record_t NDR; | ||
| 1979 | 		kern_return_t RetCode; | ||
| 1980 | 	} __Reply__task_policy_t __attribute__((unused)); | ||
| 1981 | #ifdef __MigPackStructs | ||
| 1982 | #pragma pack(pop) | ||
| 1983 | #endif | ||
| 1984 | |||
| 1985 | #ifdef __MigPackStructs | ||
| 1986 | #pragma pack(push, 4) | ||
| 1987 | #endif | ||
| 1988 | 	typedef struct { | ||
| 1989 | 		mach_msg_header_t Head; | ||
| 1990 | 		NDR_record_t NDR; | ||
| 1991 | 		kern_return_t RetCode; | ||
| 1992 | 	} __Reply__task_set_emulation_t __attribute__((unused)); | ||
| 1993 | #ifdef __MigPackStructs | ||
| 1994 | #pragma pack(pop) | ||
| 1995 | #endif | ||
| 1996 | |||
| 1997 | #ifdef __MigPackStructs | ||
| 1998 | #pragma pack(push, 4) | ||
| 1999 | #endif | ||
| 2000 | 	typedef struct { | ||
| 2001 | 		mach_msg_header_t Head; | ||
| 2002 | 		/* start of the kernel processed data */ | ||
| 2003 | 		mach_msg_body_t msgh_body; | ||
| 2004 | 		mach_msg_ool_descriptor_t emulation_vector; | ||
| 2005 | 		/* end of the kernel processed data */ | ||
| 2006 | 		NDR_record_t NDR; | ||
| 2007 | 		int vector_start; | ||
| 2008 | 		mach_msg_type_number_t emulation_vectorCnt; | ||
| 2009 | 	} __Reply__task_get_emulation_vector_t __attribute__((unused)); | ||
| 2010 | #ifdef __MigPackStructs | ||
| 2011 | #pragma pack(pop) | ||
| 2012 | #endif | ||
| 2013 | |||
| 2014 | #ifdef __MigPackStructs | ||
| 2015 | #pragma pack(push, 4) | ||
| 2016 | #endif | ||
| 2017 | 	typedef struct { | ||
| 2018 | 		mach_msg_header_t Head; | ||
| 2019 | 		NDR_record_t NDR; | ||
| 2020 | 		kern_return_t RetCode; | ||
| 2021 | 	} __Reply__task_set_emulation_vector_t __attribute__((unused)); | ||
| 2022 | #ifdef __MigPackStructs | ||
| 2023 | #pragma pack(pop) | ||
| 2024 | #endif | ||
| 2025 | |||
| 2026 | #ifdef __MigPackStructs | ||
| 2027 | #pragma pack(push, 4) | ||
| 2028 | #endif | ||
| 2029 | 	typedef struct { | ||
| 2030 | 		mach_msg_header_t Head; | ||
| 2031 | 		NDR_record_t NDR; | ||
| 2032 | 		kern_return_t RetCode; | ||
| 2033 | 	} __Reply__task_set_ras_pc_t __attribute__((unused)); | ||
| 2034 | #ifdef __MigPackStructs | ||
| 2035 | #pragma pack(pop) | ||
| 2036 | #endif | ||
| 2037 | |||
| 2038 | #ifdef __MigPackStructs | ||
| 2039 | #pragma pack(push, 4) | ||
| 2040 | #endif | ||
| 2041 | 	typedef struct { | ||
| 2042 | 		mach_msg_header_t Head; | ||
| 2043 | 		/* start of the kernel processed data */ | ||
| 2044 | 		mach_msg_body_t msgh_body; | ||
| 2045 | 		mach_msg_ool_descriptor_t names; | ||
| 2046 | 		mach_msg_ool_descriptor_t info; | ||
| 2047 | 		/* end of the kernel processed data */ | ||
| 2048 | 		NDR_record_t NDR; | ||
| 2049 | 		mach_msg_type_number_t namesCnt; | ||
| 2050 | 		mach_msg_type_number_t infoCnt; | ||
| 2051 | 	} __Reply__task_zone_info_t __attribute__((unused)); | ||
| 2052 | #ifdef __MigPackStructs | ||
| 2053 | #pragma pack(pop) | ||
| 2054 | #endif | ||
| 2055 | |||
| 2056 | #ifdef __MigPackStructs | ||
| 2057 | #pragma pack(push, 4) | ||
| 2058 | #endif | ||
| 2059 | 	typedef struct { | ||
| 2060 | 		mach_msg_header_t Head; | ||
| 2061 | 		NDR_record_t NDR; | ||
| 2062 | 		kern_return_t RetCode; | ||
| 2063 | 	} __Reply__task_assign_t __attribute__((unused)); | ||
| 2064 | #ifdef __MigPackStructs | ||
| 2065 | #pragma pack(pop) | ||
| 2066 | #endif | ||
| 2067 | |||
| 2068 | #ifdef __MigPackStructs | ||
| 2069 | #pragma pack(push, 4) | ||
| 2070 | #endif | ||
| 2071 | 	typedef struct { | ||
| 2072 | 		mach_msg_header_t Head; | ||
| 2073 | 		NDR_record_t NDR; | ||
| 2074 | 		kern_return_t RetCode; | ||
| 2075 | 	} __Reply__task_assign_default_t __attribute__((unused)); | ||
| 2076 | #ifdef __MigPackStructs | ||
| 2077 | #pragma pack(pop) | ||
| 2078 | #endif | ||
| 2079 | |||
| 2080 | #ifdef __MigPackStructs | ||
| 2081 | #pragma pack(push, 4) | ||
| 2082 | #endif | ||
| 2083 | 	typedef struct { | ||
| 2084 | 		mach_msg_header_t Head; | ||
| 2085 | 		/* start of the kernel processed data */ | ||
| 2086 | 		mach_msg_body_t msgh_body; | ||
| 2087 | 		mach_msg_port_descriptor_t assigned_set; | ||
| 2088 | 		/* end of the kernel processed data */ | ||
| 2089 | 	} __Reply__task_get_assignment_t __attribute__((unused)); | ||
| 2090 | #ifdef __MigPackStructs | ||
| 2091 | #pragma pack(pop) | ||
| 2092 | #endif | ||
| 2093 | |||
| 2094 | #ifdef __MigPackStructs | ||
| 2095 | #pragma pack(push, 4) | ||
| 2096 | #endif | ||
| 2097 | 	typedef struct { | ||
| 2098 | 		mach_msg_header_t Head; | ||
| 2099 | 		NDR_record_t NDR; | ||
| 2100 | 		kern_return_t RetCode; | ||
| 2101 | 	} __Reply__task_set_policy_t __attribute__((unused)); | ||
| 2102 | #ifdef __MigPackStructs | ||
| 2103 | #pragma pack(pop) | ||
| 2104 | #endif | ||
| 2105 | |||
| 2106 | #ifdef __MigPackStructs | ||
| 2107 | #pragma pack(push, 4) | ||
| 2108 | #endif | ||
| 2109 | 	typedef struct { | ||
| 2110 | 		mach_msg_header_t Head; | ||
| 2111 | 		NDR_record_t NDR; | ||
| 2112 | 		kern_return_t RetCode; | ||
| 2113 | 		mach_msg_type_number_t old_stateCnt; | ||
| 2114 | 		natural_t old_state[1296]; | ||
| 2115 | 	} __Reply__task_get_state_t __attribute__((unused)); | ||
| 2116 | #ifdef __MigPackStructs | ||
| 2117 | #pragma pack(pop) | ||
| 2118 | #endif | ||
| 2119 | |||
| 2120 | #ifdef __MigPackStructs | ||
| 2121 | #pragma pack(push, 4) | ||
| 2122 | #endif | ||
| 2123 | 	typedef struct { | ||
| 2124 | 		mach_msg_header_t Head; | ||
| 2125 | 		NDR_record_t NDR; | ||
| 2126 | 		kern_return_t RetCode; | ||
| 2127 | 	} __Reply__task_set_state_t __attribute__((unused)); | ||
| 2128 | #ifdef __MigPackStructs | ||
| 2129 | #pragma pack(pop) | ||
| 2130 | #endif | ||
| 2131 | |||
| 2132 | #ifdef __MigPackStructs | ||
| 2133 | #pragma pack(push, 4) | ||
| 2134 | #endif | ||
| 2135 | 	typedef struct { | ||
| 2136 | 		mach_msg_header_t Head; | ||
| 2137 | 		NDR_record_t NDR; | ||
| 2138 | 		kern_return_t RetCode; | ||
| 2139 | 		int old_limit; | ||
| 2140 | 	} __Reply__task_set_phys_footprint_limit_t __attribute__((unused)); | ||
| 2141 | #ifdef __MigPackStructs | ||
| 2142 | #pragma pack(pop) | ||
| 2143 | #endif | ||
| 2144 | |||
| 2145 | #ifdef __MigPackStructs | ||
| 2146 | #pragma pack(push, 4) | ||
| 2147 | #endif | ||
| 2148 | 	typedef struct { | ||
| 2149 | 		mach_msg_header_t Head; | ||
| 2150 | 		/* start of the kernel processed data */ | ||
| 2151 | 		mach_msg_body_t msgh_body; | ||
| 2152 | 		mach_msg_port_descriptor_t suspend_token; | ||
| 2153 | 		/* end of the kernel processed data */ | ||
| 2154 | 	} __Reply__task_suspend2_t __attribute__((unused)); | ||
| 2155 | #ifdef __MigPackStructs | ||
| 2156 | #pragma pack(pop) | ||
| 2157 | #endif | ||
| 2158 | |||
| 2159 | #ifdef __MigPackStructs | ||
| 2160 | #pragma pack(push, 4) | ||
| 2161 | #endif | ||
| 2162 | 	typedef struct { | ||
| 2163 | 		mach_msg_header_t Head; | ||
| 2164 | 		NDR_record_t NDR; | ||
| 2165 | 		kern_return_t RetCode; | ||
| 2166 | 	} __Reply__task_resume2_t __attribute__((unused)); | ||
| 2167 | #ifdef __MigPackStructs | ||
| 2168 | #pragma pack(pop) | ||
| 2169 | #endif | ||
| 2170 | |||
| 2171 | #ifdef __MigPackStructs | ||
| 2172 | #pragma pack(push, 4) | ||
| 2173 | #endif | ||
| 2174 | 	typedef struct { | ||
| 2175 | 		mach_msg_header_t Head; | ||
| 2176 | 		NDR_record_t NDR; | ||
| 2177 | 		kern_return_t RetCode; | ||
| 2178 | 		task_purgable_info_t stats; | ||
| 2179 | 	} __Reply__task_purgable_info_t __attribute__((unused)); | ||
| 2180 | #ifdef __MigPackStructs | ||
| 2181 | #pragma pack(pop) | ||
| 2182 | #endif | ||
| 2183 | |||
| 2184 | #ifdef __MigPackStructs | ||
| 2185 | #pragma pack(push, 4) | ||
| 2186 | #endif | ||
| 2187 | 	typedef struct { | ||
| 2188 | 		mach_msg_header_t Head; | ||
| 2189 | 		/* start of the kernel processed data */ | ||
| 2190 | 		mach_msg_body_t msgh_body; | ||
| 2191 | 		mach_msg_port_descriptor_t voucher; | ||
| 2192 | 		/* end of the kernel processed data */ | ||
| 2193 | 	} __Reply__task_get_mach_voucher_t __attribute__((unused)); | ||
| 2194 | #ifdef __MigPackStructs | ||
| 2195 | #pragma pack(pop) | ||
| 2196 | #endif | ||
| 2197 | |||
| 2198 | #ifdef __MigPackStructs | ||
| 2199 | #pragma pack(push, 4) | ||
| 2200 | #endif | ||
| 2201 | 	typedef struct { | ||
| 2202 | 		mach_msg_header_t Head; | ||
| 2203 | 		NDR_record_t NDR; | ||
| 2204 | 		kern_return_t RetCode; | ||
| 2205 | 	} __Reply__task_set_mach_voucher_t __attribute__((unused)); | ||
| 2206 | #ifdef __MigPackStructs | ||
| 2207 | #pragma pack(pop) | ||
| 2208 | #endif | ||
| 2209 | |||
| 2210 | #ifdef __MigPackStructs | ||
| 2211 | #pragma pack(push, 4) | ||
| 2212 | #endif | ||
| 2213 | 	typedef struct { | ||
| 2214 | 		mach_msg_header_t Head; | ||
| 2215 | 		/* start of the kernel processed data */ | ||
| 2216 | 		mach_msg_body_t msgh_body; | ||
| 2217 | 		mach_msg_port_descriptor_t old_voucher; | ||
| 2218 | 		/* end of the kernel processed data */ | ||
| 2219 | 	} __Reply__task_swap_mach_voucher_t __attribute__((unused)); | ||
| 2220 | #ifdef __MigPackStructs | ||
| 2221 | #pragma pack(pop) | ||
| 2222 | #endif | ||
| 2223 | |||
| 2224 | #ifdef __MigPackStructs | ||
| 2225 | #pragma pack(push, 4) | ||
| 2226 | #endif | ||
| 2227 | 	typedef struct { | ||
| 2228 | 		mach_msg_header_t Head; | ||
| 2229 | 		/* start of the kernel processed data */ | ||
| 2230 | 		mach_msg_body_t msgh_body; | ||
| 2231 | 		mach_msg_port_descriptor_t corpse_task_port; | ||
| 2232 | 		/* end of the kernel processed data */ | ||
| 2233 | 	} __Reply__task_generate_corpse_t __attribute__((unused)); | ||
| 2234 | #ifdef __MigPackStructs | ||
| 2235 | #pragma pack(pop) | ||
| 2236 | #endif | ||
| 2237 | |||
| 2238 | #ifdef __MigPackStructs | ||
| 2239 | #pragma pack(push, 4) | ||
| 2240 | #endif | ||
| 2241 | 	typedef struct { | ||
| 2242 | 		mach_msg_header_t Head; | ||
| 2243 | 		NDR_record_t NDR; | ||
| 2244 | 		kern_return_t RetCode; | ||
| 2245 | 		vm_address_t kcd_addr_begin; | ||
| 2246 | 		uint32_t kcd_size; | ||
| 2247 | 	} __Reply__task_map_corpse_info_t __attribute__((unused)); | ||
| 2248 | #ifdef __MigPackStructs | ||
| 2249 | #pragma pack(pop) | ||
| 2250 | #endif | ||
| 2251 | |||
| 2252 | #ifdef __MigPackStructs | ||
| 2253 | #pragma pack(push, 4) | ||
| 2254 | #endif | ||
| 2255 | 	typedef struct { | ||
| 2256 | 		mach_msg_header_t Head; | ||
| 2257 | 		NDR_record_t NDR; | ||
| 2258 | 		kern_return_t RetCode; | ||
| 2259 | 	} __Reply__task_register_dyld_image_infos_t __attribute__((unused)); | ||
| 2260 | #ifdef __MigPackStructs | ||
| 2261 | #pragma pack(pop) | ||
| 2262 | #endif | ||
| 2263 | |||
| 2264 | #ifdef __MigPackStructs | ||
| 2265 | #pragma pack(push, 4) | ||
| 2266 | #endif | ||
| 2267 | 	typedef struct { | ||
| 2268 | 		mach_msg_header_t Head; | ||
| 2269 | 		NDR_record_t NDR; | ||
| 2270 | 		kern_return_t RetCode; | ||
| 2271 | 	} __Reply__task_unregister_dyld_image_infos_t __attribute__((unused)); | ||
| 2272 | #ifdef __MigPackStructs | ||
| 2273 | #pragma pack(pop) | ||
| 2274 | #endif | ||
| 2275 | |||
| 2276 | #ifdef __MigPackStructs | ||
| 2277 | #pragma pack(push, 4) | ||
| 2278 | #endif | ||
| 2279 | 	typedef struct { | ||
| 2280 | 		mach_msg_header_t Head; | ||
| 2281 | 		/* start of the kernel processed data */ | ||
| 2282 | 		mach_msg_body_t msgh_body; | ||
| 2283 | 		mach_msg_ool_descriptor_t dyld_images; | ||
| 2284 | 		/* end of the kernel processed data */ | ||
| 2285 | 		NDR_record_t NDR; | ||
| 2286 | 		mach_msg_type_number_t dyld_imagesCnt; | ||
| 2287 | 	} __Reply__task_get_dyld_image_infos_t __attribute__((unused)); | ||
| 2288 | #ifdef __MigPackStructs | ||
| 2289 | #pragma pack(pop) | ||
| 2290 | #endif | ||
| 2291 | |||
| 2292 | #ifdef __MigPackStructs | ||
| 2293 | #pragma pack(push, 4) | ||
| 2294 | #endif | ||
| 2295 | 	typedef struct { | ||
| 2296 | 		mach_msg_header_t Head; | ||
| 2297 | 		NDR_record_t NDR; | ||
| 2298 | 		kern_return_t RetCode; | ||
| 2299 | 	} __Reply__task_register_dyld_shared_cache_image_info_t __attribute__((unused)); | ||
| 2300 | #ifdef __MigPackStructs | ||
| 2301 | #pragma pack(pop) | ||
| 2302 | #endif | ||
| 2303 | |||
| 2304 | #ifdef __MigPackStructs | ||
| 2305 | #pragma pack(push, 4) | ||
| 2306 | #endif | ||
| 2307 | 	typedef struct { | ||
| 2308 | 		mach_msg_header_t Head; | ||
| 2309 | 		NDR_record_t NDR; | ||
| 2310 | 		kern_return_t RetCode; | ||
| 2311 | 	} __Reply__task_register_dyld_set_dyld_state_t __attribute__((unused)); | ||
| 2312 | #ifdef __MigPackStructs | ||
| 2313 | #pragma pack(pop) | ||
| 2314 | #endif | ||
| 2315 | |||
| 2316 | #ifdef __MigPackStructs | ||
| 2317 | #pragma pack(push, 4) | ||
| 2318 | #endif | ||
| 2319 | 	typedef struct { | ||
| 2320 | 		mach_msg_header_t Head; | ||
| 2321 | 		NDR_record_t NDR; | ||
| 2322 | 		kern_return_t RetCode; | ||
| 2323 | 		dyld_kernel_process_info_t dyld_process_state; | ||
| 2324 | 	} __Reply__task_register_dyld_get_process_state_t __attribute__((unused)); | ||
| 2325 | #ifdef __MigPackStructs | ||
| 2326 | #pragma pack(pop) | ||
| 2327 | #endif | ||
| 2328 | |||
| 2329 | #ifdef __MigPackStructs | ||
| 2330 | #pragma pack(push, 4) | ||
| 2331 | #endif | ||
| 2332 | 	typedef struct { | ||
| 2333 | 		mach_msg_header_t Head; | ||
| 2334 | 		NDR_record_t NDR; | ||
| 2335 | 		kern_return_t RetCode; | ||
| 2336 | 		mach_vm_address_t kcd_addr_begin; | ||
| 2337 | 		mach_vm_size_t kcd_size; | ||
| 2338 | 	} __Reply__task_map_corpse_info_64_t __attribute__((unused)); | ||
| 2339 | #ifdef __MigPackStructs | ||
| 2340 | #pragma pack(pop) | ||
| 2341 | #endif | ||
| 2342 | |||
| 2343 | #ifdef __MigPackStructs | ||
| 2344 | #pragma pack(push, 4) | ||
| 2345 | #endif | ||
| 2346 | 	typedef struct { | ||
| 2347 | 		mach_msg_header_t Head; | ||
| 2348 | 		NDR_record_t NDR; | ||
| 2349 | 		kern_return_t RetCode; | ||
| 2350 | 		mach_msg_type_number_t info_outCnt; | ||
| 2351 | 		integer_t info_out[4]; | ||
| 2352 | 	} __Reply__task_inspect_t __attribute__((unused)); | ||
| 2353 | #ifdef __MigPackStructs | ||
| 2354 | #pragma pack(pop) | ||
| 2355 | #endif | ||
| 2356 | |||
| 2357 | #ifdef __MigPackStructs | ||
| 2358 | #pragma pack(push, 4) | ||
| 2359 | #endif | ||
| 2360 | 	typedef struct { | ||
| 2361 | 		mach_msg_header_t Head; | ||
| 2362 | 		NDR_record_t NDR; | ||
| 2363 | 		kern_return_t RetCode; | ||
| 2364 | 		task_exc_guard_behavior_t behavior; | ||
| 2365 | 	} __Reply__task_get_exc_guard_behavior_t __attribute__((unused)); | ||
| 2366 | #ifdef __MigPackStructs | ||
| 2367 | #pragma pack(pop) | ||
| 2368 | #endif | ||
| 2369 | |||
| 2370 | #ifdef __MigPackStructs | ||
| 2371 | #pragma pack(push, 4) | ||
| 2372 | #endif | ||
| 2373 | 	typedef struct { | ||
| 2374 | 		mach_msg_header_t Head; | ||
| 2375 | 		NDR_record_t NDR; | ||
| 2376 | 		kern_return_t RetCode; | ||
| 2377 | 	} __Reply__task_set_exc_guard_behavior_t __attribute__((unused)); | ||
| 2378 | #ifdef __MigPackStructs | ||
| 2379 | #pragma pack(pop) | ||
| 2380 | #endif | ||
| 2381 | |||
| 2382 | #ifdef __MigPackStructs | ||
| 2383 | #pragma pack(push, 4) | ||
| 2384 | #endif | ||
| 2385 | 	typedef struct { | ||
| 2386 | 		mach_msg_header_t Head; | ||
| 2387 | 		/* start of the kernel processed data */ | ||
| 2388 | 		mach_msg_body_t msgh_body; | ||
| 2389 | 		mach_msg_port_descriptor_t delegation; | ||
| 2390 | 		/* end of the kernel processed data */ | ||
| 2391 | 	} __Reply__task_create_suid_cred_t __attribute__((unused)); | ||
| 2392 | #ifdef __MigPackStructs | ||
| 2393 | #pragma pack(pop) | ||
| 2394 | #endif | ||
| 2395 | #endif /* !__Reply__task_subsystem__defined */ | ||
| 2396 | |||
| 2397 | /* union of all replies */ | ||
| 2398 | |||
| 2399 | #ifndef __ReplyUnion__task_subsystem__defined | ||
| 2400 | #define __ReplyUnion__task_subsystem__defined | ||
| 2401 | union __ReplyUnion__task_subsystem { | ||
| 2402 | 	__Reply__task_create_t Reply_task_create; | ||
| 2403 | 	__Reply__task_terminate_t Reply_task_terminate; | ||
| 2404 | 	__Reply__task_threads_t Reply_task_threads; | ||
| 2405 | 	__Reply__mach_ports_register_t Reply_mach_ports_register; | ||
| 2406 | 	__Reply__mach_ports_lookup_t Reply_mach_ports_lookup; | ||
| 2407 | 	__Reply__task_info_t Reply_task_info; | ||
| 2408 | 	__Reply__task_set_info_t Reply_task_set_info; | ||
| 2409 | 	__Reply__task_suspend_t Reply_task_suspend; | ||
| 2410 | 	__Reply__task_resume_t Reply_task_resume; | ||
| 2411 | 	__Reply__task_get_special_port_t Reply_task_get_special_port; | ||
| 2412 | 	__Reply__task_set_special_port_t Reply_task_set_special_port; | ||
| 2413 | 	__Reply__thread_create_t Reply_thread_create; | ||
| 2414 | 	__Reply__thread_create_running_t Reply_thread_create_running; | ||
| 2415 | 	__Reply__task_set_exception_ports_t Reply_task_set_exception_ports; | ||
| 2416 | 	__Reply__task_get_exception_ports_t Reply_task_get_exception_ports; | ||
| 2417 | 	__Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; | ||
| 2418 | 	__Reply__lock_set_create_t Reply_lock_set_create; | ||
| 2419 | 	__Reply__lock_set_destroy_t Reply_lock_set_destroy; | ||
| 2420 | 	__Reply__semaphore_create_t Reply_semaphore_create; | ||
| 2421 | 	__Reply__semaphore_destroy_t Reply_semaphore_destroy; | ||
| 2422 | 	__Reply__task_policy_set_t Reply_task_policy_set; | ||
| 2423 | 	__Reply__task_policy_get_t Reply_task_policy_get; | ||
| 2424 | 	__Reply__task_sample_t Reply_task_sample; | ||
| 2425 | 	__Reply__task_policy_t Reply_task_policy; | ||
| 2426 | 	__Reply__task_set_emulation_t Reply_task_set_emulation; | ||
| 2427 | 	__Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; | ||
| 2428 | 	__Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; | ||
| 2429 | 	__Reply__task_set_ras_pc_t Reply_task_set_ras_pc; | ||
| 2430 | 	__Reply__task_zone_info_t Reply_task_zone_info; | ||
| 2431 | 	__Reply__task_assign_t Reply_task_assign; | ||
| 2432 | 	__Reply__task_assign_default_t Reply_task_assign_default; | ||
| 2433 | 	__Reply__task_get_assignment_t Reply_task_get_assignment; | ||
| 2434 | 	__Reply__task_set_policy_t Reply_task_set_policy; | ||
| 2435 | 	__Reply__task_get_state_t Reply_task_get_state; | ||
| 2436 | 	__Reply__task_set_state_t Reply_task_set_state; | ||
| 2437 | 	__Reply__task_set_phys_footprint_limit_t Reply_task_set_phys_footprint_limit; | ||
| 2438 | 	__Reply__task_suspend2_t Reply_task_suspend2; | ||
| 2439 | 	__Reply__task_resume2_t Reply_task_resume2; | ||
| 2440 | 	__Reply__task_purgable_info_t Reply_task_purgable_info; | ||
| 2441 | 	__Reply__task_get_mach_voucher_t Reply_task_get_mach_voucher; | ||
| 2442 | 	__Reply__task_set_mach_voucher_t Reply_task_set_mach_voucher; | ||
| 2443 | 	__Reply__task_swap_mach_voucher_t Reply_task_swap_mach_voucher; | ||
| 2444 | 	__Reply__task_generate_corpse_t Reply_task_generate_corpse; | ||
| 2445 | 	__Reply__task_map_corpse_info_t Reply_task_map_corpse_info; | ||
| 2446 | 	__Reply__task_register_dyld_image_infos_t Reply_task_register_dyld_image_infos; | ||
| 2447 | 	__Reply__task_unregister_dyld_image_infos_t Reply_task_unregister_dyld_image_infos; | ||
| 2448 | 	__Reply__task_get_dyld_image_infos_t Reply_task_get_dyld_image_infos; | ||
| 2449 | 	__Reply__task_register_dyld_shared_cache_image_info_t Reply_task_register_dyld_shared_cache_image_info; | ||
| 2450 | 	__Reply__task_register_dyld_set_dyld_state_t Reply_task_register_dyld_set_dyld_state; | ||
| 2451 | 	__Reply__task_register_dyld_get_process_state_t Reply_task_register_dyld_get_process_state; | ||
| 2452 | 	__Reply__task_map_corpse_info_64_t Reply_task_map_corpse_info_64; | ||
| 2453 | 	__Reply__task_inspect_t Reply_task_inspect; | ||
| 2454 | 	__Reply__task_get_exc_guard_behavior_t Reply_task_get_exc_guard_behavior; | ||
| 2455 | 	__Reply__task_set_exc_guard_behavior_t Reply_task_set_exc_guard_behavior; | ||
| 2456 | 	__Reply__task_create_suid_cred_t Reply_task_create_suid_cred; | ||
| 2457 | }; | ||
| 2458 | #endif /* !__RequestUnion__task_subsystem__defined */ | ||
| 2459 | |||
| 2460 | #ifndef subsystem_to_name_map_task | ||
| 2461 | #define subsystem_to_name_map_task \ | ||
| 2462 | { "task_create", 3400 },\ | ||
| 2463 | { "task_terminate", 3401 },\ | ||
| 2464 | { "task_threads", 3402 },\ | ||
| 2465 | { "mach_ports_register", 3403 },\ | ||
| 2466 | { "mach_ports_lookup", 3404 },\ | ||
| 2467 | { "task_info", 3405 },\ | ||
| 2468 | { "task_set_info", 3406 },\ | ||
| 2469 | { "task_suspend", 3407 },\ | ||
| 2470 | { "task_resume", 3408 },\ | ||
| 2471 | { "task_get_special_port", 3409 },\ | ||
| 2472 | { "task_set_special_port", 3410 },\ | ||
| 2473 | { "thread_create", 3411 },\ | ||
| 2474 | { "thread_create_running", 3412 },\ | ||
| 2475 | { "task_set_exception_ports", 3413 },\ | ||
| 2476 | { "task_get_exception_ports", 3414 },\ | ||
| 2477 | { "task_swap_exception_ports", 3415 },\ | ||
| 2478 | { "lock_set_create", 3416 },\ | ||
| 2479 | { "lock_set_destroy", 3417 },\ | ||
| 2480 | { "semaphore_create", 3418 },\ | ||
| 2481 | { "semaphore_destroy", 3419 },\ | ||
| 2482 | { "task_policy_set", 3420 },\ | ||
| 2483 | { "task_policy_get", 3421 },\ | ||
| 2484 | { "task_sample", 3422 },\ | ||
| 2485 | { "task_policy", 3423 },\ | ||
| 2486 | { "task_set_emulation", 3424 },\ | ||
| 2487 | { "task_get_emulation_vector", 3425 },\ | ||
| 2488 | { "task_set_emulation_vector", 3426 },\ | ||
| 2489 | { "task_set_ras_pc", 3427 },\ | ||
| 2490 | { "task_zone_info", 3428 },\ | ||
| 2491 | { "task_assign", 3429 },\ | ||
| 2492 | { "task_assign_default", 3430 },\ | ||
| 2493 | { "task_get_assignment", 3431 },\ | ||
| 2494 | { "task_set_policy", 3432 },\ | ||
| 2495 | { "task_get_state", 3433 },\ | ||
| 2496 | { "task_set_state", 3434 },\ | ||
| 2497 | { "task_set_phys_footprint_limit", 3435 },\ | ||
| 2498 | { "task_suspend2", 3436 },\ | ||
| 2499 | { "task_resume2", 3437 },\ | ||
| 2500 | { "task_purgable_info", 3438 },\ | ||
| 2501 | { "task_get_mach_voucher", 3439 },\ | ||
| 2502 | { "task_set_mach_voucher", 3440 },\ | ||
| 2503 | { "task_swap_mach_voucher", 3441 },\ | ||
| 2504 | { "task_generate_corpse", 3442 },\ | ||
| 2505 | { "task_map_corpse_info", 3443 },\ | ||
| 2506 | { "task_register_dyld_image_infos", 3444 },\ | ||
| 2507 | { "task_unregister_dyld_image_infos", 3445 },\ | ||
| 2508 | { "task_get_dyld_image_infos", 3446 },\ | ||
| 2509 | { "task_register_dyld_shared_cache_image_info", 3447 },\ | ||
| 2510 | { "task_register_dyld_set_dyld_state", 3448 },\ | ||
| 2511 | { "task_register_dyld_get_process_state", 3449 },\ | ||
| 2512 | { "task_map_corpse_info_64", 3450 },\ | ||
| 2513 | { "task_inspect", 3451 },\ | ||
| 2514 | { "task_get_exc_guard_behavior", 3452 },\ | ||
| 2515 | { "task_set_exc_guard_behavior", 3453 },\ | ||
| 2516 | { "task_create_suid_cred", 3454 } | ||
| 2517 | #endif | ||
| 2518 | |||
| 2519 | #ifdef __AfterMigUserHeader | ||
| 2520 | __AfterMigUserHeader | ||
| 2521 | #endif /* __AfterMigUserHeader */ | ||
| 2522 | |||
| 2523 | #endif	 /* _task_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/task_info.h created+524| ... | @@ -0,0 +1,524 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007, 2015 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | *	Machine-independent task information structures and definitions. | ||
| 58 | * | ||
| 59 | *	The definitions in this file are exported to the user. The kernel | ||
| 60 | *	will translate its internal data structures to these structures | ||
| 61 | *	as appropriate. | ||
| 62 | * | ||
| 63 | */ | ||
| 64 | |||
| 65 | #ifndef _MACH_TASK_INFO_H_ | ||
| 66 | #define _MACH_TASK_INFO_H_ | ||
| 67 | |||
| 68 | #include <mach/message.h> | ||
| 69 | #include <mach/machine/vm_types.h> | ||
| 70 | #include <mach/time_value.h> | ||
| 71 | #include <mach/policy.h> | ||
| 72 | #include <mach/vm_statistics.h> /* for vm_extmod_statistics_data_t */ | ||
| 73 | #include <Availability.h> | ||
| 74 | |||
| 75 | #include <sys/cdefs.h> | ||
| 76 | |||
| 77 | /* | ||
| 78 | *	Generic information structure to allow for expansion. | ||
| 79 | */ | ||
| 80 | typedef natural_t task_flavor_t; | ||
| 81 | typedef integer_t *task_info_t; /* varying array of int */ | ||
| 82 | |||
| 83 | /* Deprecated, use per structure _data_t's instead */ | ||
| 84 | #define TASK_INFO_MAX (1024) /* maximum array size */ | ||
| 85 | typedef integer_t task_info_data_t[TASK_INFO_MAX]; | ||
| 86 | |||
| 87 | /* | ||
| 88 | *	Currently defined information structures. | ||
| 89 | */ | ||
| 90 | |||
| 91 | #pragma pack(push, 4) | ||
| 92 | |||
| 93 | /* Don't use this, use MACH_TASK_BASIC_INFO instead */ | ||
| 94 | #define TASK_BASIC_INFO_32 4 /* basic information */ | ||
| 95 | #define TASK_BASIC2_INFO_32 6 | ||
| 96 | |||
| 97 | struct task_basic_info_32 { | ||
| 98 | 	integer_t suspend_count; /* suspend count for task */ | ||
| 99 | 	natural_t virtual_size; /* virtual memory size (bytes) */ | ||
| 100 | 	natural_t resident_size; /* resident memory size (bytes) */ | ||
| 101 | 	time_value_t user_time; /* total user run time for | ||
| 102 | 	 * terminated threads */ | ||
| 103 | 	time_value_t system_time; /* total system run time for | ||
| 104 | 	 * terminated threads */ | ||
| 105 | 	policy_t policy; /* default policy for new threads */ | ||
| 106 | }; | ||
| 107 | typedef struct task_basic_info_32 task_basic_info_32_data_t; | ||
| 108 | typedef struct task_basic_info_32 *task_basic_info_32_t; | ||
| 109 | #define TASK_BASIC_INFO_32_COUNT \ | ||
| 110 | 	 (sizeof(task_basic_info_32_data_t) / sizeof(natural_t)) | ||
| 111 | |||
| 112 | /* Don't use this, use MACH_TASK_BASIC_INFO instead */ | ||
| 113 | struct task_basic_info_64 { | ||
| 114 | 	integer_t suspend_count; /* suspend count for task */ | ||
| 115 | #if defined(__arm__) || defined(__arm64__) | ||
| 116 | 	mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ | ||
| 117 | 	mach_vm_size_t resident_size; /* resident memory size (bytes) */ | ||
| 118 | #else /* defined(__arm__) || defined(__arm64__) */ | ||
| 119 | 	mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ | ||
| 120 | 	mach_vm_size_t resident_size; /* resident memory size (bytes) */ | ||
| 121 | #endif /* defined(__arm__) || defined(__arm64__) */ | ||
| 122 | 	time_value_t user_time; /* total user run time for | ||
| 123 | 	 * terminated threads */ | ||
| 124 | 	time_value_t system_time; /* total system run time for | ||
| 125 | 	 * terminated threads */ | ||
| 126 | 	policy_t policy; /* default policy for new threads */ | ||
| 127 | }; | ||
| 128 | typedef struct task_basic_info_64 task_basic_info_64_data_t; | ||
| 129 | typedef struct task_basic_info_64 *task_basic_info_64_t; | ||
| 130 | |||
| 131 | #if defined(__arm__) || defined(__arm64__) | ||
| 132 | 	#if defined(__arm__) && defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0) | ||
| 133 | /* | ||
| 134 | * Note: arm64 can't use the old flavor. If you somehow manage to, | ||
| 135 | * you can cope with the nonsense data yourself. | ||
| 136 | */ | ||
| 137 | 	#define TASK_BASIC_INFO_64 5 | ||
| 138 | 	#define TASK_BASIC_INFO_64_COUNT \ | ||
| 139 | 	 (sizeof(task_basic_info_64_data_t) / sizeof(natural_t)) | ||
| 140 | |||
| 141 | 	#else | ||
| 142 | |||
| 143 | 	#define TASK_BASIC_INFO_64 TASK_BASIC_INFO_64_2 | ||
| 144 | 	#define TASK_BASIC_INFO_64_COUNT TASK_BASIC_INFO_64_2_COUNT | ||
| 145 | 	#endif | ||
| 146 | #else /* defined(__arm__) || defined(__arm64__) */ | ||
| 147 | #define TASK_BASIC_INFO_64 5 /* 64-bit capable basic info */ | ||
| 148 | #define TASK_BASIC_INFO_64_COUNT \ | ||
| 149 | 	 (sizeof(task_basic_info_64_data_t) / sizeof(natural_t)) | ||
| 150 | #endif | ||
| 151 | |||
| 152 | |||
| 153 | /* localized structure - cannot be safely passed between tasks of differing sizes */ | ||
| 154 | /* Don't use this, use MACH_TASK_BASIC_INFO instead */ | ||
| 155 | struct task_basic_info { | ||
| 156 | 	integer_t suspend_count; /* suspend count for task */ | ||
| 157 | 	vm_size_t virtual_size; /* virtual memory size (bytes) */ | ||
| 158 | 	vm_size_t resident_size; /* resident memory size (bytes) */ | ||
| 159 | 	time_value_t user_time; /* total user run time for | ||
| 160 | 	 * terminated threads */ | ||
| 161 | 	time_value_t system_time; /* total system run time for | ||
| 162 | 	 * terminated threads */ | ||
| 163 | 	policy_t policy; /* default policy for new threads */ | ||
| 164 | }; | ||
| 165 | |||
| 166 | typedef struct task_basic_info task_basic_info_data_t; | ||
| 167 | typedef struct task_basic_info *task_basic_info_t; | ||
| 168 | #define TASK_BASIC_INFO_COUNT \ | ||
| 169 | 	 (sizeof(task_basic_info_data_t) / sizeof(natural_t)) | ||
| 170 | #if !defined(__LP64__) | ||
| 171 | #define TASK_BASIC_INFO TASK_BASIC_INFO_32 | ||
| 172 | #else | ||
| 173 | #define TASK_BASIC_INFO TASK_BASIC_INFO_64 | ||
| 174 | #endif | ||
| 175 | |||
| 176 | |||
| 177 | |||
| 178 | #define TASK_EVENTS_INFO 2 /* various event counts */ | ||
| 179 | |||
| 180 | struct task_events_info { | ||
| 181 | 	integer_t faults; /* number of page faults */ | ||
| 182 | 	integer_t pageins; /* number of actual pageins */ | ||
| 183 | 	integer_t cow_faults; /* number of copy-on-write faults */ | ||
| 184 | 	integer_t messages_sent; /* number of messages sent */ | ||
| 185 | 	integer_t messages_received; /* number of messages received */ | ||
| 186 | 	integer_t syscalls_mach; /* number of mach system calls */ | ||
| 187 | 	integer_t syscalls_unix; /* number of unix system calls */ | ||
| 188 | 	integer_t csw; /* number of context switches */ | ||
| 189 | }; | ||
| 190 | typedef struct task_events_info task_events_info_data_t; | ||
| 191 | typedef struct task_events_info *task_events_info_t; | ||
| 192 | #define TASK_EVENTS_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 193 | 	 (sizeof(task_events_info_data_t) / sizeof(natural_t))) | ||
| 194 | |||
| 195 | #define TASK_THREAD_TIMES_INFO 3 /* total times for live threads - | ||
| 196 | 	 * only accurate if suspended */ | ||
| 197 | |||
| 198 | struct task_thread_times_info { | ||
| 199 | 	time_value_t user_time; /* total user run time for | ||
| 200 | 	 * live threads */ | ||
| 201 | 	time_value_t system_time; /* total system run time for | ||
| 202 | 	 * live threads */ | ||
| 203 | }; | ||
| 204 | |||
| 205 | typedef struct task_thread_times_info task_thread_times_info_data_t; | ||
| 206 | typedef struct task_thread_times_info *task_thread_times_info_t; | ||
| 207 | #define TASK_THREAD_TIMES_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 208 | 	 (sizeof(task_thread_times_info_data_t) / sizeof(natural_t))) | ||
| 209 | |||
| 210 | #define TASK_ABSOLUTETIME_INFO 1 | ||
| 211 | |||
| 212 | struct task_absolutetime_info { | ||
| 213 | 	uint64_t total_user; | ||
| 214 | 	uint64_t total_system; | ||
| 215 | 	uint64_t threads_user; /* existing threads only */ | ||
| 216 | 	uint64_t threads_system; | ||
| 217 | }; | ||
| 218 | |||
| 219 | typedef struct task_absolutetime_info task_absolutetime_info_data_t; | ||
| 220 | typedef struct task_absolutetime_info *task_absolutetime_info_t; | ||
| 221 | #define TASK_ABSOLUTETIME_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 222 | 	 (sizeof (task_absolutetime_info_data_t) / sizeof (natural_t))) | ||
| 223 | |||
| 224 | #define TASK_KERNELMEMORY_INFO 7 | ||
| 225 | |||
| 226 | struct task_kernelmemory_info { | ||
| 227 | 	uint64_t total_palloc; /* private kernel mem alloc'ed */ | ||
| 228 | 	uint64_t total_pfree; /* private kernel mem freed */ | ||
| 229 | 	uint64_t total_salloc; /* shared kernel mem alloc'ed */ | ||
| 230 | 	uint64_t total_sfree; /* shared kernel mem freed */ | ||
| 231 | }; | ||
| 232 | |||
| 233 | typedef struct task_kernelmemory_info task_kernelmemory_info_data_t; | ||
| 234 | typedef struct task_kernelmemory_info *task_kernelmemory_info_t; | ||
| 235 | #define TASK_KERNELMEMORY_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 236 | 	 (sizeof (task_kernelmemory_info_data_t) / sizeof (natural_t))) | ||
| 237 | |||
| 238 | #define TASK_SECURITY_TOKEN 13 | ||
| 239 | #define TASK_SECURITY_TOKEN_COUNT ((mach_msg_type_number_t) \ | ||
| 240 | 	 (sizeof(security_token_t) / sizeof(natural_t))) | ||
| 241 | |||
| 242 | #define TASK_AUDIT_TOKEN 15 | ||
| 243 | #define TASK_AUDIT_TOKEN_COUNT \ | ||
| 244 | 	 (sizeof(audit_token_t) / sizeof(natural_t)) | ||
| 245 | |||
| 246 | |||
| 247 | #define TASK_AFFINITY_TAG_INFO 16 /* This is experimental. */ | ||
| 248 | |||
| 249 | struct task_affinity_tag_info { | ||
| 250 | 	integer_t set_count; | ||
| 251 | 	integer_t min; | ||
| 252 | 	integer_t max; | ||
| 253 | 	integer_t task_count; | ||
| 254 | }; | ||
| 255 | typedef struct task_affinity_tag_info task_affinity_tag_info_data_t; | ||
| 256 | typedef struct task_affinity_tag_info *task_affinity_tag_info_t; | ||
| 257 | #define TASK_AFFINITY_TAG_INFO_COUNT \ | ||
| 258 | 	 (sizeof(task_affinity_tag_info_data_t) / sizeof(natural_t)) | ||
| 259 | |||
| 260 | #define TASK_DYLD_INFO 17 | ||
| 261 | |||
| 262 | struct task_dyld_info { | ||
| 263 | 	mach_vm_address_t all_image_info_addr; | ||
| 264 | 	mach_vm_size_t all_image_info_size; | ||
| 265 | 	integer_t all_image_info_format; | ||
| 266 | }; | ||
| 267 | typedef struct task_dyld_info task_dyld_info_data_t; | ||
| 268 | typedef struct task_dyld_info *task_dyld_info_t; | ||
| 269 | #define TASK_DYLD_INFO_COUNT \ | ||
| 270 | 	 (sizeof(task_dyld_info_data_t) / sizeof(natural_t)) | ||
| 271 | #define TASK_DYLD_ALL_IMAGE_INFO_32 0 /* format value */ | ||
| 272 | #define TASK_DYLD_ALL_IMAGE_INFO_64 1 /* format value */ | ||
| 273 | |||
| 274 | #if defined(__arm__) || defined(__arm64__) | ||
| 275 | |||
| 276 | /* Don't use this, use MACH_TASK_BASIC_INFO instead */ | ||
| 277 | /* Compatibility for old 32-bit mach_vm_*_t */ | ||
| 278 | #define TASK_BASIC_INFO_64_2 18 /* 64-bit capable basic info */ | ||
| 279 | |||
| 280 | struct task_basic_info_64_2 { | ||
| 281 | 	integer_t suspend_count; /* suspend count for task */ | ||
| 282 | 	mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ | ||
| 283 | 	mach_vm_size_t resident_size; /* resident memory size (bytes) */ | ||
| 284 | 	time_value_t user_time; /* total user run time for | ||
| 285 | 	 * terminated threads */ | ||
| 286 | 	time_value_t system_time; /* total system run time for | ||
| 287 | 	 * terminated threads */ | ||
| 288 | 	policy_t policy; /* default policy for new threads */ | ||
| 289 | }; | ||
| 290 | typedef struct task_basic_info_64_2 task_basic_info_64_2_data_t; | ||
| 291 | typedef struct task_basic_info_64_2 *task_basic_info_64_2_t; | ||
| 292 | #define TASK_BASIC_INFO_64_2_COUNT \ | ||
| 293 | 	 (sizeof(task_basic_info_64_2_data_t) / sizeof(natural_t)) | ||
| 294 | #endif | ||
| 295 | |||
| 296 | #define TASK_EXTMOD_INFO 19 | ||
| 297 | |||
| 298 | struct task_extmod_info { | ||
| 299 | 	unsigned char task_uuid[16]; | ||
| 300 | 	vm_extmod_statistics_data_t extmod_statistics; | ||
| 301 | }; | ||
| 302 | typedef struct task_extmod_info task_extmod_info_data_t; | ||
| 303 | typedef struct task_extmod_info *task_extmod_info_t; | ||
| 304 | #define TASK_EXTMOD_INFO_COUNT \ | ||
| 305 | 	 (sizeof(task_extmod_info_data_t) / sizeof(natural_t)) | ||
| 306 | |||
| 307 | |||
| 308 | #define MACH_TASK_BASIC_INFO 20 /* always 64-bit basic info */ | ||
| 309 | struct mach_task_basic_info { | ||
| 310 | 	mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ | ||
| 311 | 	mach_vm_size_t resident_size; /* resident memory size (bytes) */ | ||
| 312 | 	mach_vm_size_t resident_size_max; /* maximum resident memory size (bytes) */ | ||
| 313 | 	time_value_t user_time; /* total user run time for | ||
| 314 | 	 * terminated threads */ | ||
| 315 | 	time_value_t system_time; /* total system run time for | ||
| 316 | 	 * terminated threads */ | ||
| 317 | 	policy_t policy; /* default policy for new threads */ | ||
| 318 | 	integer_t suspend_count; /* suspend count for task */ | ||
| 319 | }; | ||
| 320 | typedef struct mach_task_basic_info mach_task_basic_info_data_t; | ||
| 321 | typedef struct mach_task_basic_info *mach_task_basic_info_t; | ||
| 322 | #define MACH_TASK_BASIC_INFO_COUNT \ | ||
| 323 | 	 (sizeof(mach_task_basic_info_data_t) / sizeof(natural_t)) | ||
| 324 | |||
| 325 | |||
| 326 | #define TASK_POWER_INFO 21 | ||
| 327 | |||
| 328 | struct task_power_info { | ||
| 329 | 	uint64_t total_user; | ||
| 330 | 	uint64_t total_system; | ||
| 331 | 	uint64_t task_interrupt_wakeups; | ||
| 332 | 	uint64_t task_platform_idle_wakeups; | ||
| 333 | 	uint64_t task_timer_wakeups_bin_1; | ||
| 334 | 	uint64_t task_timer_wakeups_bin_2; | ||
| 335 | }; | ||
| 336 | |||
| 337 | typedef struct task_power_info task_power_info_data_t; | ||
| 338 | typedef struct task_power_info *task_power_info_t; | ||
| 339 | #define TASK_POWER_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 340 | 	 (sizeof (task_power_info_data_t) / sizeof (natural_t))) | ||
| 341 | |||
| 342 | |||
| 343 | |||
| 344 | #define TASK_VM_INFO 22 | ||
| 345 | #define TASK_VM_INFO_PURGEABLE 23 | ||
| 346 | struct task_vm_info { | ||
| 347 | 	mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ | ||
| 348 | 	integer_t region_count; /* number of memory regions */ | ||
| 349 | 	integer_t page_size; | ||
| 350 | 	mach_vm_size_t resident_size; /* resident memory size (bytes) */ | ||
| 351 | 	mach_vm_size_t resident_size_peak; /* peak resident size (bytes) */ | ||
| 352 | |||
| 353 | 	mach_vm_size_t device; | ||
| 354 | 	mach_vm_size_t device_peak; | ||
| 355 | 	mach_vm_size_t internal; | ||
| 356 | 	mach_vm_size_t internal_peak; | ||
| 357 | 	mach_vm_size_t external; | ||
| 358 | 	mach_vm_size_t external_peak; | ||
| 359 | 	mach_vm_size_t reusable; | ||
| 360 | 	mach_vm_size_t reusable_peak; | ||
| 361 | 	mach_vm_size_t purgeable_volatile_pmap; | ||
| 362 | 	mach_vm_size_t purgeable_volatile_resident; | ||
| 363 | 	mach_vm_size_t purgeable_volatile_virtual; | ||
| 364 | 	mach_vm_size_t compressed; | ||
| 365 | 	mach_vm_size_t compressed_peak; | ||
| 366 | 	mach_vm_size_t compressed_lifetime; | ||
| 367 | |||
| 368 | 	/* added for rev1 */ | ||
| 369 | 	mach_vm_size_t phys_footprint; | ||
| 370 | |||
| 371 | 	/* added for rev2 */ | ||
| 372 | 	mach_vm_address_t min_address; | ||
| 373 | 	mach_vm_address_t max_address; | ||
| 374 | |||
| 375 | 	/* added for rev3 */ | ||
| 376 | 	int64_t ledger_phys_footprint_peak; | ||
| 377 | 	int64_t ledger_purgeable_nonvolatile; | ||
| 378 | 	int64_t ledger_purgeable_novolatile_compressed; | ||
| 379 | 	int64_t ledger_purgeable_volatile; | ||
| 380 | 	int64_t ledger_purgeable_volatile_compressed; | ||
| 381 | 	int64_t ledger_tag_network_nonvolatile; | ||
| 382 | 	int64_t ledger_tag_network_nonvolatile_compressed; | ||
| 383 | 	int64_t ledger_tag_network_volatile; | ||
| 384 | 	int64_t ledger_tag_network_volatile_compressed; | ||
| 385 | 	int64_t ledger_tag_media_footprint; | ||
| 386 | 	int64_t ledger_tag_media_footprint_compressed; | ||
| 387 | 	int64_t ledger_tag_media_nofootprint; | ||
| 388 | 	int64_t ledger_tag_media_nofootprint_compressed; | ||
| 389 | 	int64_t ledger_tag_graphics_footprint; | ||
| 390 | 	int64_t ledger_tag_graphics_footprint_compressed; | ||
| 391 | 	int64_t ledger_tag_graphics_nofootprint; | ||
| 392 | 	int64_t ledger_tag_graphics_nofootprint_compressed; | ||
| 393 | 	int64_t ledger_tag_neural_footprint; | ||
| 394 | 	int64_t ledger_tag_neural_footprint_compressed; | ||
| 395 | 	int64_t ledger_tag_neural_nofootprint; | ||
| 396 | 	int64_t ledger_tag_neural_nofootprint_compressed; | ||
| 397 | |||
| 398 | 	/* added for rev4 */ | ||
| 399 | 	uint64_t limit_bytes_remaining; | ||
| 400 | |||
| 401 | 	/* added for rev5 */ | ||
| 402 | 	integer_t decompressions; | ||
| 403 | }; | ||
| 404 | typedef struct task_vm_info task_vm_info_data_t; | ||
| 405 | typedef struct task_vm_info *task_vm_info_t; | ||
| 406 | #define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 407 | 	 (sizeof (task_vm_info_data_t) / sizeof (natural_t))) | ||
| 408 | #define TASK_VM_INFO_REV5_COUNT TASK_VM_INFO_COUNT | ||
| 409 | #define TASK_VM_INFO_REV4_COUNT /* doesn't include decompressions */ \ | ||
| 410 | 	((mach_msg_type_number_t) (TASK_VM_INFO_REV5_COUNT - 1)) | ||
| 411 | #define TASK_VM_INFO_REV3_COUNT /* doesn't include limit bytes */ \ | ||
| 412 | 	((mach_msg_type_number_t) (TASK_VM_INFO_REV4_COUNT - 2)) | ||
| 413 | #define TASK_VM_INFO_REV2_COUNT /* doesn't include extra ledgers info */ \ | ||
| 414 | 	((mach_msg_type_number_t) (TASK_VM_INFO_REV3_COUNT - 42)) | ||
| 415 | #define TASK_VM_INFO_REV1_COUNT /* doesn't include min and max address */ \ | ||
| 416 | 	((mach_msg_type_number_t) (TASK_VM_INFO_REV2_COUNT - 4)) | ||
| 417 | #define TASK_VM_INFO_REV0_COUNT /* doesn't include phys_footprint */ \ | ||
| 418 | 	((mach_msg_type_number_t) (TASK_VM_INFO_REV1_COUNT - 2)) | ||
| 419 | |||
| 420 | typedef struct vm_purgeable_info task_purgable_info_t; | ||
| 421 | |||
| 422 | |||
| 423 | #define TASK_TRACE_MEMORY_INFO 24 /* no longer supported */ | ||
| 424 | struct task_trace_memory_info { | ||
| 425 | 	uint64_t user_memory_address; /* address of start of trace memory buffer */ | ||
| 426 | 	uint64_t buffer_size; /* size of buffer in bytes */ | ||
| 427 | 	uint64_t mailbox_array_size; /* size of mailbox area in bytes */ | ||
| 428 | }; | ||
| 429 | typedef struct task_trace_memory_info task_trace_memory_info_data_t; | ||
| 430 | typedef struct task_trace_memory_info * task_trace_memory_info_t; | ||
| 431 | #define TASK_TRACE_MEMORY_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 432 | 	 (sizeof(task_trace_memory_info_data_t) / sizeof(natural_t))) | ||
| 433 | |||
| 434 | #define TASK_WAIT_STATE_INFO 25 /* deprecated. */ | ||
| 435 | struct task_wait_state_info { | ||
| 436 | 	uint64_t total_wait_state_time; /* Time that all threads past and present have been in a wait state */ | ||
| 437 | 	uint64_t total_wait_sfi_state_time; /* Time that threads have been in SFI wait (should be a subset of total wait state time */ | ||
| 438 | 	uint32_t _reserved[4]; | ||
| 439 | }; | ||
| 440 | typedef struct task_wait_state_info task_wait_state_info_data_t; | ||
| 441 | typedef struct task_wait_state_info * task_wait_state_info_t; | ||
| 442 | #define TASK_WAIT_STATE_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 443 | 	 (sizeof(task_wait_state_info_data_t) / sizeof(natural_t))) | ||
| 444 | |||
| 445 | #define TASK_POWER_INFO_V2 26 | ||
| 446 | |||
| 447 | typedef struct { | ||
| 448 | 	uint64_t task_gpu_utilisation; | ||
| 449 | 	uint64_t task_gpu_stat_reserved0; | ||
| 450 | 	uint64_t task_gpu_stat_reserved1; | ||
| 451 | 	uint64_t task_gpu_stat_reserved2; | ||
| 452 | } gpu_energy_data; | ||
| 453 | |||
| 454 | typedef gpu_energy_data *gpu_energy_data_t; | ||
| 455 | struct task_power_info_v2 { | ||
| 456 | 	task_power_info_data_t cpu_energy; | ||
| 457 | 	gpu_energy_data gpu_energy; | ||
| 458 | #if defined(__arm__) || defined(__arm64__) | ||
| 459 | 	uint64_t task_energy; | ||
| 460 | #endif /* defined(__arm__) || defined(__arm64__) */ | ||
| 461 | 	uint64_t task_ptime; | ||
| 462 | 	uint64_t task_pset_switches; | ||
| 463 | }; | ||
| 464 | |||
| 465 | typedef struct task_power_info_v2 task_power_info_v2_data_t; | ||
| 466 | typedef struct task_power_info_v2 *task_power_info_v2_t; | ||
| 467 | #define TASK_POWER_INFO_V2_COUNT_OLD \ | ||
| 468 | 	 ((mach_msg_type_number_t) (sizeof (task_power_info_v2_data_t) - sizeof(uint64_t)*2) / sizeof (natural_t)) | ||
| 469 | #define TASK_POWER_INFO_V2_COUNT \ | ||
| 470 | 	 ((mach_msg_type_number_t) (sizeof (task_power_info_v2_data_t) / sizeof (natural_t))) | ||
| 471 | |||
| 472 | #define TASK_VM_INFO_PURGEABLE_ACCOUNT 27 /* Used for xnu purgeable vm unit tests */ | ||
| 473 | |||
| 474 | |||
| 475 | #define TASK_FLAGS_INFO 28 /* return t_flags field */ | ||
| 476 | struct task_flags_info { | ||
| 477 | 	uint32_t flags; /* task flags */ | ||
| 478 | }; | ||
| 479 | typedef struct task_flags_info task_flags_info_data_t; | ||
| 480 | typedef struct task_flags_info * task_flags_info_t; | ||
| 481 | #define TASK_FLAGS_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 482 | 	 (sizeof(task_flags_info_data_t) / sizeof (natural_t))) | ||
| 483 | |||
| 484 | #define TF_LP64 0x00000001 /* task has 64-bit addressing */ | ||
| 485 | #define TF_64B_DATA 0x00000002 /* task has 64-bit data registers */ | ||
| 486 | |||
| 487 | #define TASK_DEBUG_INFO_INTERNAL 29 /* Used for kernel internal development tests. */ | ||
| 488 | |||
| 489 | |||
| 490 | /* | ||
| 491 | * Type to control EXC_GUARD delivery options for a task | ||
| 492 | * via task_get/set_exc_guard_behavior interface(s). | ||
| 493 | */ | ||
| 494 | typedef uint32_t task_exc_guard_behavior_t; | ||
| 495 | |||
| 496 | /* EXC_GUARD optional delivery settings on a per-task basis */ | ||
| 497 | #define TASK_EXC_GUARD_VM_DELIVER 0x01 /* Deliver virtual memory EXC_GUARD exceptions */ | ||
| 498 | #define TASK_EXC_GUARD_VM_ONCE 0x02 /* Deliver them only once */ | ||
| 499 | #define TASK_EXC_GUARD_VM_CORPSE 0x04 /* Deliver them via a forked corpse */ | ||
| 500 | #define TASK_EXC_GUARD_VM_FATAL 0x08 /* Virtual Memory EXC_GUARD delivery is fatal */ | ||
| 501 | #define TASK_EXC_GUARD_VM_ALL 0x0f | ||
| 502 | |||
| 503 | #define TASK_EXC_GUARD_MP_DELIVER 0x10 /* Deliver mach port EXC_GUARD exceptions */ | ||
| 504 | #define TASK_EXC_GUARD_MP_ONCE 0x20 /* Deliver them only once */ | ||
| 505 | #define TASK_EXC_GUARD_MP_CORPSE 0x40 /* Deliver them via a forked corpse */ | ||
| 506 | #define TASK_EXC_GUARD_MP_FATAL 0x80 /* mach port EXC_GUARD delivery is fatal */ | ||
| 507 | #define TASK_EXC_GUARD_MP_ALL 0xf0 | ||
| 508 | |||
| 509 | #define TASK_EXC_GUARD_ALL 0xff /* All optional deliver settings */ | ||
| 510 | |||
| 511 | |||
| 512 | /* | ||
| 513 | * Obsolete interfaces. | ||
| 514 | */ | ||
| 515 | |||
| 516 | #define TASK_SCHED_TIMESHARE_INFO 10 | ||
| 517 | #define TASK_SCHED_RR_INFO 11 | ||
| 518 | #define TASK_SCHED_FIFO_INFO 12 | ||
| 519 | |||
| 520 | #define TASK_SCHED_INFO 14 | ||
| 521 | |||
| 522 | #pragma pack(pop) | ||
| 523 | |||
| 524 | #endif /* _MACH_TASK_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/task_inspect.h created+54| ... | @@ -0,0 +1,54 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef MACH_TASK_INSPECT_H | ||
| 30 | #define MACH_TASK_INSPECT_H | ||
| 31 | |||
| 32 | /* | ||
| 33 | * XXX These interfaces are still in development -- they are subject to change | ||
| 34 | * without notice. | ||
| 35 | */ | ||
| 36 | |||
| 37 | typedef natural_t task_inspect_flavor_t; | ||
| 38 | |||
| 39 | enum task_inspect_flavor { | ||
| 40 | 	TASK_INSPECT_BASIC_COUNTS = 1, | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct task_inspect_basic_counts { | ||
| 44 | 	uint64_t instructions; | ||
| 45 | 	uint64_t cycles; | ||
| 46 | }; | ||
| 47 | #define TASK_INSPECT_BASIC_COUNTS_COUNT \ | ||
| 48 | 	(sizeof(struct task_inspect_basic_counts) / sizeof(natural_t)) | ||
| 49 | typedef struct task_inspect_basic_counts task_inspect_basic_counts_data_t; | ||
| 50 | typedef struct task_inspect_basic_counts *task_inspect_basic_counts_t; | ||
| 51 | |||
| 52 | typedef integer_t *task_inspect_info_t; | ||
| 53 | |||
| 54 | #endif /* !defined(MACH_TASK_INSPECT_H) */ | ||
lib/libc/include/x86_64-macos-gnu/mach/task_policy.h created+186| ... | @@ -0,0 +1,186 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_TASK_POLICY_H_ | ||
| 30 | #define _MACH_TASK_POLICY_H_ | ||
| 31 | |||
| 32 | #include <mach/mach_types.h> | ||
| 33 | |||
| 34 | /* | ||
| 35 | * These are the calls for accessing the policy parameters | ||
| 36 | * of a particular task. | ||
| 37 | * | ||
| 38 | * The extra 'get_default' parameter to the second call is | ||
| 39 | * IN/OUT as follows: | ||
| 40 | * 1) if asserted on the way in it indicates that the default | ||
| 41 | * values should be returned, not the ones currently set, in | ||
| 42 | * this case 'get_default' will always be asserted on return; | ||
| 43 | * 2) if unasserted on the way in, the current settings are | ||
| 44 | * desired and if still unasserted on return, then the info | ||
| 45 | * returned reflects the current settings, otherwise if | ||
| 46 | * 'get_default' returns asserted, it means that there are no | ||
| 47 | * current settings due to other parameters taking precedence, | ||
| 48 | * and the default ones are being returned instead. | ||
| 49 | */ | ||
| 50 | |||
| 51 | typedef natural_t task_policy_flavor_t; | ||
| 52 | typedef integer_t *task_policy_t; | ||
| 53 | |||
| 54 | /* | ||
| 55 | * kern_return_t	task_policy_set( | ||
| 56 | * task_t					task, | ||
| 57 | * task_policy_flavor_t	flavor, | ||
| 58 | * task_policy_t			policy_info, | ||
| 59 | * mach_msg_type_number_t	count); | ||
| 60 | * | ||
| 61 | * kern_return_t	task_policy_get( | ||
| 62 | * task_t					task, | ||
| 63 | * task_policy_flavor_t	flavor, | ||
| 64 | * task_policy_t			policy_info, | ||
| 65 | * mach_msg_type_number_t	*count, | ||
| 66 | * boolean_t				*get_default); | ||
| 67 | */ | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Defined flavors. | ||
| 71 | */ | ||
| 72 | /* | ||
| 73 | * TASK_CATEGORY_POLICY: | ||
| 74 | * | ||
| 75 | * This provides information to the kernel about the role | ||
| 76 | * of the task in the system. | ||
| 77 | * | ||
| 78 | * Parameters: | ||
| 79 | * | ||
| 80 | * role: Enumerated as follows: | ||
| 81 | * | ||
| 82 | * TASK_UNSPECIFIED is the default, since the role is not | ||
| 83 | * inherited from the parent. | ||
| 84 | * | ||
| 85 | * TASK_FOREGROUND_APPLICATION should be assigned when the | ||
| 86 | * task is a normal UI application in the foreground from | ||
| 87 | * the HI point of view. | ||
| 88 | * **N.B. There may be more than one of these at a given time. | ||
| 89 | * | ||
| 90 | * TASK_BACKGROUND_APPLICATION should be assigned when the | ||
| 91 | * task is a normal UI application in the background from | ||
| 92 | * the HI point of view. | ||
| 93 | * | ||
| 94 | * TASK_CONTROL_APPLICATION should be assigned to the unique | ||
| 95 | * UI application which implements the pop-up application dialog. | ||
| 96 | * There can only be one task at a time with this designation, | ||
| 97 | * which is assigned FCFS. | ||
| 98 | * | ||
| 99 | * TASK_GRAPHICS_SERVER should be assigned to the graphics | ||
| 100 | * management (window) server. There can only be one task at | ||
| 101 | * a time with this designation, which is assigned FCFS. | ||
| 102 | */ | ||
| 103 | |||
| 104 | #define TASK_CATEGORY_POLICY 1 | ||
| 105 | |||
| 106 | #define TASK_SUPPRESSION_POLICY 3 | ||
| 107 | #define TASK_POLICY_STATE 4 | ||
| 108 | #define TASK_BASE_QOS_POLICY 8 | ||
| 109 | #define TASK_OVERRIDE_QOS_POLICY 9 | ||
| 110 | #define TASK_BASE_LATENCY_QOS_POLICY 10 | ||
| 111 | #define TASK_BASE_THROUGHPUT_QOS_POLICY 11 | ||
| 112 | |||
| 113 | typedef enum task_role { | ||
| 114 | 	TASK_RENICED = -1, | ||
| 115 | 	TASK_UNSPECIFIED = 0, | ||
| 116 | 	TASK_FOREGROUND_APPLICATION = 1, | ||
| 117 | 	TASK_BACKGROUND_APPLICATION = 2, | ||
| 118 | 	TASK_CONTROL_APPLICATION = 3, | ||
| 119 | 	TASK_GRAPHICS_SERVER = 4, | ||
| 120 | 	TASK_THROTTLE_APPLICATION = 5, | ||
| 121 | 	TASK_NONUI_APPLICATION = 6, | ||
| 122 | 	TASK_DEFAULT_APPLICATION = 7, | ||
| 123 | 	TASK_DARWINBG_APPLICATION = 8, | ||
| 124 | } task_role_t; | ||
| 125 | |||
| 126 | struct task_category_policy { | ||
| 127 | 	task_role_t role; | ||
| 128 | }; | ||
| 129 | |||
| 130 | typedef struct task_category_policy task_category_policy_data_t; | ||
| 131 | typedef struct task_category_policy *task_category_policy_t; | ||
| 132 | |||
| 133 | #define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 134 | 	(sizeof (task_category_policy_data_t) / sizeof (integer_t))) | ||
| 135 | |||
| 136 | |||
| 137 | enum task_latency_qos { | ||
| 138 | 	LATENCY_QOS_TIER_UNSPECIFIED = 0x0, | ||
| 139 | 	LATENCY_QOS_TIER_0 = ((0xFF << 16) | 1), | ||
| 140 | 	LATENCY_QOS_TIER_1 = ((0xFF << 16) | 2), | ||
| 141 | 	LATENCY_QOS_TIER_2 = ((0xFF << 16) | 3), | ||
| 142 | 	LATENCY_QOS_TIER_3 = ((0xFF << 16) | 4), | ||
| 143 | 	LATENCY_QOS_TIER_4 = ((0xFF << 16) | 5), | ||
| 144 | 	LATENCY_QOS_TIER_5 = ((0xFF << 16) | 6) | ||
| 145 | }; | ||
| 146 | typedef integer_t task_latency_qos_t; | ||
| 147 | enum task_throughput_qos { | ||
| 148 | 	THROUGHPUT_QOS_TIER_UNSPECIFIED = 0x0, | ||
| 149 | 	THROUGHPUT_QOS_TIER_0 = ((0xFE << 16) | 1), | ||
| 150 | 	THROUGHPUT_QOS_TIER_1 = ((0xFE << 16) | 2), | ||
| 151 | 	THROUGHPUT_QOS_TIER_2 = ((0xFE << 16) | 3), | ||
| 152 | 	THROUGHPUT_QOS_TIER_3 = ((0xFE << 16) | 4), | ||
| 153 | 	THROUGHPUT_QOS_TIER_4 = ((0xFE << 16) | 5), | ||
| 154 | 	THROUGHPUT_QOS_TIER_5 = ((0xFE << 16) | 6), | ||
| 155 | }; | ||
| 156 | |||
| 157 | #define LATENCY_QOS_LAUNCH_DEFAULT_TIER LATENCY_QOS_TIER_3 | ||
| 158 | #define THROUGHPUT_QOS_LAUNCH_DEFAULT_TIER THROUGHPUT_QOS_TIER_3 | ||
| 159 | |||
| 160 | typedef integer_t task_throughput_qos_t; | ||
| 161 | |||
| 162 | struct task_qos_policy { | ||
| 163 | 	task_latency_qos_t task_latency_qos_tier; | ||
| 164 | 	task_throughput_qos_t task_throughput_qos_tier; | ||
| 165 | }; | ||
| 166 | |||
| 167 | typedef struct task_qos_policy *task_qos_policy_t; | ||
| 168 | #define TASK_QOS_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 169 | 	(sizeof (struct task_qos_policy) / sizeof (integer_t))) | ||
| 170 | |||
| 171 | /* These should be removed - they belong in proc_info.h */ | ||
| 172 | #define PROC_FLAG_DARWINBG 0x8000 /* process in darwin background */ | ||
| 173 | #define PROC_FLAG_EXT_DARWINBG 0x10000 /* process in darwin background - external enforcement */ | ||
| 174 | #define PROC_FLAG_IOS_APPLEDAEMON 0x20000 /* process is apple ios daemon */ | ||
| 175 | #define PROC_FLAG_IOS_IMPPROMOTION 0x80000 /* process is apple ios daemon */ | ||
| 176 | #define PROC_FLAG_ADAPTIVE 0x100000 /* Process is adaptive */ | ||
| 177 | #define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000 /* Process is adaptive, and is currently important */ | ||
| 178 | #define PROC_FLAG_IMPORTANCE_DONOR 0x400000 /* Process is marked as an importance donor */ | ||
| 179 | #define PROC_FLAG_SUPPRESSED 0x800000 /* Process is suppressed */ | ||
| 180 | #define PROC_FLAG_APPLICATION 0x1000000 /* Process is an application */ | ||
| 181 | #define PROC_FLAG_IOS_APPLICATION PROC_FLAG_APPLICATION /* Process is an application */ | ||
| 182 | |||
| 183 | |||
| 184 | |||
| 185 | |||
| 186 | #endif /* _MACH_TASK_POLICY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/task_special_ports.h created+133| ... | @@ -0,0 +1,133 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2010 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/task_special_ports.h | ||
| 60 | * | ||
| 61 | *	Defines codes for special_purpose task ports. These are NOT | ||
| 62 | *	port identifiers - they are only used for the task_get_special_port | ||
| 63 | *	and task_set_special_port routines. | ||
| 64 | * | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_TASK_SPECIAL_PORTS_H_ | ||
| 68 | #define _MACH_TASK_SPECIAL_PORTS_H_ | ||
| 69 | |||
| 70 | typedef int task_special_port_t; | ||
| 71 | |||
| 72 | #define TASK_KERNEL_PORT 1 /* The full task port for task. */ | ||
| 73 | |||
| 74 | #define TASK_HOST_PORT 2 /* The host (priv) port for task. */ | ||
| 75 | |||
| 76 | #define TASK_NAME_PORT 3 /* The name port for task. */ | ||
| 77 | |||
| 78 | #define TASK_BOOTSTRAP_PORT 4 /* Bootstrap environment for task. */ | ||
| 79 | |||
| 80 | #define TASK_INSPECT_PORT 5 /* The inspect port for task. */ | ||
| 81 | |||
| 82 | #define TASK_READ_PORT 6 /* The read port for task. */ | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | #define TASK_SEATBELT_PORT 7 /* Seatbelt compiler/DEM port for task. */ | ||
| 87 | |||
| 88 | /* PORT 8 was the GSSD TASK PORT which transformed to a host port */ | ||
| 89 | |||
| 90 | #define TASK_ACCESS_PORT 9 /* Permission check for task_for_pid. */ | ||
| 91 | |||
| 92 | #define TASK_DEBUG_CONTROL_PORT 10 /* debug control port */ | ||
| 93 | |||
| 94 | #define TASK_RESOURCE_NOTIFY_PORT 11 /* overrides host special RN port */ | ||
| 95 | |||
| 96 | #define TASK_MAX_SPECIAL_PORT TASK_RESOURCE_NOTIFY_PORT | ||
| 97 | |||
| 98 | /* | ||
| 99 | *	Definitions for ease of use | ||
| 100 | */ | ||
| 101 | |||
| 102 | #define task_get_kernel_port(task, port) \ | ||
| 103 | 	 (task_get_special_port((task), TASK_KERNEL_PORT, (port))) | ||
| 104 | |||
| 105 | #define task_set_kernel_port(task, port) \ | ||
| 106 | 	 (task_set_special_port((task), TASK_KERNEL_PORT, (port))) | ||
| 107 | |||
| 108 | #define task_get_host_port(task, port) \ | ||
| 109 | 	 (task_get_special_port((task), TASK_HOST_PORT, (port))) | ||
| 110 | |||
| 111 | #define task_set_host_port(task, port) \ | ||
| 112 | 	 (task_set_special_port((task), TASK_HOST_PORT, (port))) | ||
| 113 | |||
| 114 | #define task_get_bootstrap_port(task, port) \ | ||
| 115 | 	 (task_get_special_port((task), TASK_BOOTSTRAP_PORT, (port))) | ||
| 116 | |||
| 117 | #define task_get_debug_control_port(task, port) \ | ||
| 118 | 	 (task_get_special_port((task), TASK_DEBUG_CONTROL_PORT, (port))) | ||
| 119 | |||
| 120 | #define task_set_bootstrap_port(task, port) \ | ||
| 121 | 	 (task_set_special_port((task), TASK_BOOTSTRAP_PORT, (port))) | ||
| 122 | |||
| 123 | #define task_get_task_access_port(task, port) \ | ||
| 124 | 	 (task_get_special_port((task), TASK_ACCESS_PORT, (port))) | ||
| 125 | |||
| 126 | #define task_set_task_access_port(task, port) \ | ||
| 127 | 	 (task_set_special_port((task), TASK_ACCESS_PORT, (port))) | ||
| 128 | |||
| 129 | #define task_set_task_debug_control_port(task, port) \ | ||
| 130 | 	 (task_set_special_port((task), TASK_DEBUG_CONTROL_PORT, (port))) | ||
| 131 | |||
| 132 | |||
| 133 | #endif /* _MACH_TASK_SPECIAL_PORTS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/thread_act.h created+1386| ... | @@ -0,0 +1,1386 @@ | ||
| 1 | #ifndef	_thread_act_user_ | ||
| 2 | #define	_thread_act_user_ | ||
| 3 | |||
| 4 | /* Module thread_act */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	thread_act_MSG_COUNT | ||
| 52 | #define	thread_act_MSG_COUNT	29 | ||
| 53 | #endif	/* thread_act_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | |||
| 60 | #ifdef __BeforeMigUserHeader | ||
| 61 | __BeforeMigUserHeader | ||
| 62 | #endif /* __BeforeMigUserHeader */ | ||
| 63 | |||
| 64 | #include <sys/cdefs.h> | ||
| 65 | __BEGIN_DECLS | ||
| 66 | |||
| 67 | |||
| 68 | /* Routine thread_terminate */ | ||
| 69 | #ifdef	mig_external | ||
| 70 | mig_external | ||
| 71 | #else | ||
| 72 | extern | ||
| 73 | #endif	/* mig_external */ | ||
| 74 | __WATCHOS_PROHIBITED | ||
| 75 | __TVOS_PROHIBITED | ||
| 76 | kern_return_t thread_terminate | ||
| 77 | ( | ||
| 78 | 	thread_act_t target_act | ||
| 79 | ); | ||
| 80 | |||
| 81 | /* Routine act_get_state */ | ||
| 82 | #ifdef	mig_external | ||
| 83 | mig_external | ||
| 84 | #else | ||
| 85 | extern | ||
| 86 | #endif	/* mig_external */ | ||
| 87 | __WATCHOS_PROHIBITED | ||
| 88 | __TVOS_PROHIBITED | ||
| 89 | kern_return_t act_get_state | ||
| 90 | ( | ||
| 91 | 	thread_read_t target_act, | ||
| 92 | 	int flavor, | ||
| 93 | 	thread_state_t old_state, | ||
| 94 | 	mach_msg_type_number_t *old_stateCnt | ||
| 95 | ); | ||
| 96 | |||
| 97 | /* Routine act_set_state */ | ||
| 98 | #ifdef	mig_external | ||
| 99 | mig_external | ||
| 100 | #else | ||
| 101 | extern | ||
| 102 | #endif	/* mig_external */ | ||
| 103 | __WATCHOS_PROHIBITED | ||
| 104 | __TVOS_PROHIBITED | ||
| 105 | kern_return_t act_set_state | ||
| 106 | ( | ||
| 107 | 	thread_act_t target_act, | ||
| 108 | 	int flavor, | ||
| 109 | 	thread_state_t new_state, | ||
| 110 | 	mach_msg_type_number_t new_stateCnt | ||
| 111 | ); | ||
| 112 | |||
| 113 | /* Routine thread_get_state */ | ||
| 114 | #ifdef	mig_external | ||
| 115 | mig_external | ||
| 116 | #else | ||
| 117 | extern | ||
| 118 | #endif	/* mig_external */ | ||
| 119 | __WATCHOS_PROHIBITED | ||
| 120 | kern_return_t thread_get_state | ||
| 121 | ( | ||
| 122 | 	thread_read_t target_act, | ||
| 123 | 	thread_state_flavor_t flavor, | ||
| 124 | 	thread_state_t old_state, | ||
| 125 | 	mach_msg_type_number_t *old_stateCnt | ||
| 126 | ); | ||
| 127 | |||
| 128 | /* Routine thread_set_state */ | ||
| 129 | #ifdef	mig_external | ||
| 130 | mig_external | ||
| 131 | #else | ||
| 132 | extern | ||
| 133 | #endif	/* mig_external */ | ||
| 134 | __WATCHOS_PROHIBITED | ||
| 135 | kern_return_t thread_set_state | ||
| 136 | ( | ||
| 137 | 	thread_act_t target_act, | ||
| 138 | 	thread_state_flavor_t flavor, | ||
| 139 | 	thread_state_t new_state, | ||
| 140 | 	mach_msg_type_number_t new_stateCnt | ||
| 141 | ); | ||
| 142 | |||
| 143 | /* Routine thread_suspend */ | ||
| 144 | #ifdef	mig_external | ||
| 145 | mig_external | ||
| 146 | #else | ||
| 147 | extern | ||
| 148 | #endif	/* mig_external */ | ||
| 149 | __WATCHOS_PROHIBITED | ||
| 150 | kern_return_t thread_suspend | ||
| 151 | ( | ||
| 152 | 	thread_act_t target_act | ||
| 153 | ); | ||
| 154 | |||
| 155 | /* Routine thread_resume */ | ||
| 156 | #ifdef	mig_external | ||
| 157 | mig_external | ||
| 158 | #else | ||
| 159 | extern | ||
| 160 | #endif	/* mig_external */ | ||
| 161 | __WATCHOS_PROHIBITED | ||
| 162 | kern_return_t thread_resume | ||
| 163 | ( | ||
| 164 | 	thread_act_t target_act | ||
| 165 | ); | ||
| 166 | |||
| 167 | /* Routine thread_abort */ | ||
| 168 | #ifdef	mig_external | ||
| 169 | mig_external | ||
| 170 | #else | ||
| 171 | extern | ||
| 172 | #endif	/* mig_external */ | ||
| 173 | __WATCHOS_PROHIBITED | ||
| 174 | kern_return_t thread_abort | ||
| 175 | ( | ||
| 176 | 	thread_act_t target_act | ||
| 177 | ); | ||
| 178 | |||
| 179 | /* Routine thread_abort_safely */ | ||
| 180 | #ifdef	mig_external | ||
| 181 | mig_external | ||
| 182 | #else | ||
| 183 | extern | ||
| 184 | #endif	/* mig_external */ | ||
| 185 | __WATCHOS_PROHIBITED | ||
| 186 | kern_return_t thread_abort_safely | ||
| 187 | ( | ||
| 188 | 	thread_act_t target_act | ||
| 189 | ); | ||
| 190 | |||
| 191 | /* Routine thread_depress_abort */ | ||
| 192 | #ifdef	mig_external | ||
| 193 | mig_external | ||
| 194 | #else | ||
| 195 | extern | ||
| 196 | #endif	/* mig_external */ | ||
| 197 | __WATCHOS_PROHIBITED | ||
| 198 | __TVOS_PROHIBITED | ||
| 199 | kern_return_t thread_depress_abort | ||
| 200 | ( | ||
| 201 | 	thread_act_t thread | ||
| 202 | ); | ||
| 203 | |||
| 204 | /* Routine thread_get_special_port */ | ||
| 205 | #ifdef	mig_external | ||
| 206 | mig_external | ||
| 207 | #else | ||
| 208 | extern | ||
| 209 | #endif	/* mig_external */ | ||
| 210 | __WATCHOS_PROHIBITED | ||
| 211 | __TVOS_PROHIBITED | ||
| 212 | kern_return_t thread_get_special_port | ||
| 213 | ( | ||
| 214 | 	thread_inspect_t thr_act, | ||
| 215 | 	int which_port, | ||
| 216 | 	mach_port_t *special_port | ||
| 217 | ); | ||
| 218 | |||
| 219 | /* Routine thread_set_special_port */ | ||
| 220 | #ifdef	mig_external | ||
| 221 | mig_external | ||
| 222 | #else | ||
| 223 | extern | ||
| 224 | #endif	/* mig_external */ | ||
| 225 | __WATCHOS_PROHIBITED | ||
| 226 | __TVOS_PROHIBITED | ||
| 227 | kern_return_t thread_set_special_port | ||
| 228 | ( | ||
| 229 | 	thread_act_t thr_act, | ||
| 230 | 	int which_port, | ||
| 231 | 	mach_port_t special_port | ||
| 232 | ); | ||
| 233 | |||
| 234 | /* Routine thread_info */ | ||
| 235 | #ifdef	mig_external | ||
| 236 | mig_external | ||
| 237 | #else | ||
| 238 | extern | ||
| 239 | #endif	/* mig_external */ | ||
| 240 | kern_return_t thread_info | ||
| 241 | ( | ||
| 242 | 	thread_inspect_t target_act, | ||
| 243 | 	thread_flavor_t flavor, | ||
| 244 | 	thread_info_t thread_info_out, | ||
| 245 | 	mach_msg_type_number_t *thread_info_outCnt | ||
| 246 | ); | ||
| 247 | |||
| 248 | /* Routine thread_set_exception_ports */ | ||
| 249 | #ifdef	mig_external | ||
| 250 | mig_external | ||
| 251 | #else | ||
| 252 | extern | ||
| 253 | #endif	/* mig_external */ | ||
| 254 | __WATCHOS_PROHIBITED | ||
| 255 | __TVOS_PROHIBITED | ||
| 256 | kern_return_t thread_set_exception_ports | ||
| 257 | ( | ||
| 258 | 	thread_act_t thread, | ||
| 259 | 	exception_mask_t exception_mask, | ||
| 260 | 	mach_port_t new_port, | ||
| 261 | 	exception_behavior_t behavior, | ||
| 262 | 	thread_state_flavor_t new_flavor | ||
| 263 | ); | ||
| 264 | |||
| 265 | /* Routine thread_get_exception_ports */ | ||
| 266 | #ifdef	mig_external | ||
| 267 | mig_external | ||
| 268 | #else | ||
| 269 | extern | ||
| 270 | #endif	/* mig_external */ | ||
| 271 | __WATCHOS_PROHIBITED | ||
| 272 | __TVOS_PROHIBITED | ||
| 273 | kern_return_t thread_get_exception_ports | ||
| 274 | ( | ||
| 275 | 	thread_act_t thread, | ||
| 276 | 	exception_mask_t exception_mask, | ||
| 277 | 	exception_mask_array_t masks, | ||
| 278 | 	mach_msg_type_number_t *masksCnt, | ||
| 279 | 	exception_handler_array_t old_handlers, | ||
| 280 | 	exception_behavior_array_t old_behaviors, | ||
| 281 | 	exception_flavor_array_t old_flavors | ||
| 282 | ); | ||
| 283 | |||
| 284 | /* Routine thread_swap_exception_ports */ | ||
| 285 | #ifdef	mig_external | ||
| 286 | mig_external | ||
| 287 | #else | ||
| 288 | extern | ||
| 289 | #endif	/* mig_external */ | ||
| 290 | __WATCHOS_PROHIBITED | ||
| 291 | __TVOS_PROHIBITED | ||
| 292 | kern_return_t thread_swap_exception_ports | ||
| 293 | ( | ||
| 294 | 	thread_act_t thread, | ||
| 295 | 	exception_mask_t exception_mask, | ||
| 296 | 	mach_port_t new_port, | ||
| 297 | 	exception_behavior_t behavior, | ||
| 298 | 	thread_state_flavor_t new_flavor, | ||
| 299 | 	exception_mask_array_t masks, | ||
| 300 | 	mach_msg_type_number_t *masksCnt, | ||
| 301 | 	exception_handler_array_t old_handlers, | ||
| 302 | 	exception_behavior_array_t old_behaviors, | ||
| 303 | 	exception_flavor_array_t old_flavors | ||
| 304 | ); | ||
| 305 | |||
| 306 | /* Routine thread_policy */ | ||
| 307 | #ifdef	mig_external | ||
| 308 | mig_external | ||
| 309 | #else | ||
| 310 | extern | ||
| 311 | #endif	/* mig_external */ | ||
| 312 | kern_return_t thread_policy | ||
| 313 | ( | ||
| 314 | 	thread_act_t thr_act, | ||
| 315 | 	policy_t policy, | ||
| 316 | 	policy_base_t base, | ||
| 317 | 	mach_msg_type_number_t baseCnt, | ||
| 318 | 	boolean_t set_limit | ||
| 319 | ); | ||
| 320 | |||
| 321 | /* Routine thread_policy_set */ | ||
| 322 | #ifdef	mig_external | ||
| 323 | mig_external | ||
| 324 | #else | ||
| 325 | extern | ||
| 326 | #endif	/* mig_external */ | ||
| 327 | kern_return_t thread_policy_set | ||
| 328 | ( | ||
| 329 | 	thread_act_t thread, | ||
| 330 | 	thread_policy_flavor_t flavor, | ||
| 331 | 	thread_policy_t policy_info, | ||
| 332 | 	mach_msg_type_number_t policy_infoCnt | ||
| 333 | ); | ||
| 334 | |||
| 335 | /* Routine thread_policy_get */ | ||
| 336 | #ifdef	mig_external | ||
| 337 | mig_external | ||
| 338 | #else | ||
| 339 | extern | ||
| 340 | #endif	/* mig_external */ | ||
| 341 | kern_return_t thread_policy_get | ||
| 342 | ( | ||
| 343 | 	thread_inspect_t thread, | ||
| 344 | 	thread_policy_flavor_t flavor, | ||
| 345 | 	thread_policy_t policy_info, | ||
| 346 | 	mach_msg_type_number_t *policy_infoCnt, | ||
| 347 | 	boolean_t *get_default | ||
| 348 | ); | ||
| 349 | |||
| 350 | /* Routine thread_sample */ | ||
| 351 | #ifdef	mig_external | ||
| 352 | mig_external | ||
| 353 | #else | ||
| 354 | extern | ||
| 355 | #endif	/* mig_external */ | ||
| 356 | kern_return_t thread_sample | ||
| 357 | ( | ||
| 358 | 	thread_act_t thread, | ||
| 359 | 	mach_port_t reply | ||
| 360 | ); | ||
| 361 | |||
| 362 | /* Routine etap_trace_thread */ | ||
| 363 | #ifdef	mig_external | ||
| 364 | mig_external | ||
| 365 | #else | ||
| 366 | extern | ||
| 367 | #endif	/* mig_external */ | ||
| 368 | kern_return_t etap_trace_thread | ||
| 369 | ( | ||
| 370 | 	thread_act_t target_act, | ||
| 371 | 	boolean_t trace_status | ||
| 372 | ); | ||
| 373 | |||
| 374 | /* Routine thread_assign */ | ||
| 375 | #ifdef	mig_external | ||
| 376 | mig_external | ||
| 377 | #else | ||
| 378 | extern | ||
| 379 | #endif	/* mig_external */ | ||
| 380 | kern_return_t thread_assign | ||
| 381 | ( | ||
| 382 | 	thread_act_t thread, | ||
| 383 | 	processor_set_t new_set | ||
| 384 | ); | ||
| 385 | |||
| 386 | /* Routine thread_assign_default */ | ||
| 387 | #ifdef	mig_external | ||
| 388 | mig_external | ||
| 389 | #else | ||
| 390 | extern | ||
| 391 | #endif	/* mig_external */ | ||
| 392 | kern_return_t thread_assign_default | ||
| 393 | ( | ||
| 394 | 	thread_act_t thread | ||
| 395 | ); | ||
| 396 | |||
| 397 | /* Routine thread_get_assignment */ | ||
| 398 | #ifdef	mig_external | ||
| 399 | mig_external | ||
| 400 | #else | ||
| 401 | extern | ||
| 402 | #endif	/* mig_external */ | ||
| 403 | kern_return_t thread_get_assignment | ||
| 404 | ( | ||
| 405 | 	thread_inspect_t thread, | ||
| 406 | 	processor_set_name_t *assigned_set | ||
| 407 | ); | ||
| 408 | |||
| 409 | /* Routine thread_set_policy */ | ||
| 410 | #ifdef	mig_external | ||
| 411 | mig_external | ||
| 412 | #else | ||
| 413 | extern | ||
| 414 | #endif	/* mig_external */ | ||
| 415 | kern_return_t thread_set_policy | ||
| 416 | ( | ||
| 417 | 	thread_act_t thr_act, | ||
| 418 | 	processor_set_t pset, | ||
| 419 | 	policy_t policy, | ||
| 420 | 	policy_base_t base, | ||
| 421 | 	mach_msg_type_number_t baseCnt, | ||
| 422 | 	policy_limit_t limit, | ||
| 423 | 	mach_msg_type_number_t limitCnt | ||
| 424 | ); | ||
| 425 | |||
| 426 | /* Routine thread_get_mach_voucher */ | ||
| 427 | #ifdef	mig_external | ||
| 428 | mig_external | ||
| 429 | #else | ||
| 430 | extern | ||
| 431 | #endif	/* mig_external */ | ||
| 432 | __WATCHOS_PROHIBITED | ||
| 433 | __TVOS_PROHIBITED | ||
| 434 | kern_return_t thread_get_mach_voucher | ||
| 435 | ( | ||
| 436 | 	thread_read_t thr_act, | ||
| 437 | 	mach_voucher_selector_t which, | ||
| 438 | 	ipc_voucher_t *voucher | ||
| 439 | ); | ||
| 440 | |||
| 441 | /* Routine thread_set_mach_voucher */ | ||
| 442 | #ifdef	mig_external | ||
| 443 | mig_external | ||
| 444 | #else | ||
| 445 | extern | ||
| 446 | #endif	/* mig_external */ | ||
| 447 | __WATCHOS_PROHIBITED | ||
| 448 | __TVOS_PROHIBITED | ||
| 449 | kern_return_t thread_set_mach_voucher | ||
| 450 | ( | ||
| 451 | 	thread_act_t thr_act, | ||
| 452 | 	ipc_voucher_t voucher | ||
| 453 | ); | ||
| 454 | |||
| 455 | /* Routine thread_swap_mach_voucher */ | ||
| 456 | #ifdef	mig_external | ||
| 457 | mig_external | ||
| 458 | #else | ||
| 459 | extern | ||
| 460 | #endif	/* mig_external */ | ||
| 461 | __WATCHOS_PROHIBITED | ||
| 462 | __TVOS_PROHIBITED | ||
| 463 | kern_return_t thread_swap_mach_voucher | ||
| 464 | ( | ||
| 465 | 	thread_act_t thr_act, | ||
| 466 | 	ipc_voucher_t new_voucher, | ||
| 467 | 	ipc_voucher_t *old_voucher | ||
| 468 | ); | ||
| 469 | |||
| 470 | /* Routine thread_convert_thread_state */ | ||
| 471 | #ifdef	mig_external | ||
| 472 | mig_external | ||
| 473 | #else | ||
| 474 | extern | ||
| 475 | #endif	/* mig_external */ | ||
| 476 | kern_return_t thread_convert_thread_state | ||
| 477 | ( | ||
| 478 | 	thread_act_t thread, | ||
| 479 | 	int direction, | ||
| 480 | 	thread_state_flavor_t flavor, | ||
| 481 | 	thread_state_t in_state, | ||
| 482 | 	mach_msg_type_number_t in_stateCnt, | ||
| 483 | 	thread_state_t out_state, | ||
| 484 | 	mach_msg_type_number_t *out_stateCnt | ||
| 485 | ); | ||
| 486 | |||
| 487 | __END_DECLS | ||
| 488 | |||
| 489 | /********************** Caution **************************/ | ||
| 490 | /* The following data types should be used to calculate */ | ||
| 491 | /* maximum message sizes only. The actual message may be */ | ||
| 492 | /* smaller, and the position of the arguments within the */ | ||
| 493 | /* message layout may vary from what is presented here. */ | ||
| 494 | /* For example, if any of the arguments are variable- */ | ||
| 495 | /* sized, and less than the maximum is sent, the data */ | ||
| 496 | /* will be packed tight in the actual message to reduce */ | ||
| 497 | /* the presence of holes. */ | ||
| 498 | /********************** Caution **************************/ | ||
| 499 | |||
| 500 | /* typedefs for all requests */ | ||
| 501 | |||
| 502 | #ifndef __Request__thread_act_subsystem__defined | ||
| 503 | #define __Request__thread_act_subsystem__defined | ||
| 504 | |||
| 505 | #ifdef __MigPackStructs | ||
| 506 | #pragma pack(push, 4) | ||
| 507 | #endif | ||
| 508 | 	typedef struct { | ||
| 509 | 		mach_msg_header_t Head; | ||
| 510 | 	} __Request__thread_terminate_t __attribute__((unused)); | ||
| 511 | #ifdef __MigPackStructs | ||
| 512 | #pragma pack(pop) | ||
| 513 | #endif | ||
| 514 | |||
| 515 | #ifdef __MigPackStructs | ||
| 516 | #pragma pack(push, 4) | ||
| 517 | #endif | ||
| 518 | 	typedef struct { | ||
| 519 | 		mach_msg_header_t Head; | ||
| 520 | 		NDR_record_t NDR; | ||
| 521 | 		int flavor; | ||
| 522 | 		mach_msg_type_number_t old_stateCnt; | ||
| 523 | 	} __Request__act_get_state_t __attribute__((unused)); | ||
| 524 | #ifdef __MigPackStructs | ||
| 525 | #pragma pack(pop) | ||
| 526 | #endif | ||
| 527 | |||
| 528 | #ifdef __MigPackStructs | ||
| 529 | #pragma pack(push, 4) | ||
| 530 | #endif | ||
| 531 | 	typedef struct { | ||
| 532 | 		mach_msg_header_t Head; | ||
| 533 | 		NDR_record_t NDR; | ||
| 534 | 		int flavor; | ||
| 535 | 		mach_msg_type_number_t new_stateCnt; | ||
| 536 | 		natural_t new_state[1296]; | ||
| 537 | 	} __Request__act_set_state_t __attribute__((unused)); | ||
| 538 | #ifdef __MigPackStructs | ||
| 539 | #pragma pack(pop) | ||
| 540 | #endif | ||
| 541 | |||
| 542 | #ifdef __MigPackStructs | ||
| 543 | #pragma pack(push, 4) | ||
| 544 | #endif | ||
| 545 | 	typedef struct { | ||
| 546 | 		mach_msg_header_t Head; | ||
| 547 | 		NDR_record_t NDR; | ||
| 548 | 		thread_state_flavor_t flavor; | ||
| 549 | 		mach_msg_type_number_t old_stateCnt; | ||
| 550 | 	} __Request__thread_get_state_t __attribute__((unused)); | ||
| 551 | #ifdef __MigPackStructs | ||
| 552 | #pragma pack(pop) | ||
| 553 | #endif | ||
| 554 | |||
| 555 | #ifdef __MigPackStructs | ||
| 556 | #pragma pack(push, 4) | ||
| 557 | #endif | ||
| 558 | 	typedef struct { | ||
| 559 | 		mach_msg_header_t Head; | ||
| 560 | 		NDR_record_t NDR; | ||
| 561 | 		thread_state_flavor_t flavor; | ||
| 562 | 		mach_msg_type_number_t new_stateCnt; | ||
| 563 | 		natural_t new_state[1296]; | ||
| 564 | 	} __Request__thread_set_state_t __attribute__((unused)); | ||
| 565 | #ifdef __MigPackStructs | ||
| 566 | #pragma pack(pop) | ||
| 567 | #endif | ||
| 568 | |||
| 569 | #ifdef __MigPackStructs | ||
| 570 | #pragma pack(push, 4) | ||
| 571 | #endif | ||
| 572 | 	typedef struct { | ||
| 573 | 		mach_msg_header_t Head; | ||
| 574 | 	} __Request__thread_suspend_t __attribute__((unused)); | ||
| 575 | #ifdef __MigPackStructs | ||
| 576 | #pragma pack(pop) | ||
| 577 | #endif | ||
| 578 | |||
| 579 | #ifdef __MigPackStructs | ||
| 580 | #pragma pack(push, 4) | ||
| 581 | #endif | ||
| 582 | 	typedef struct { | ||
| 583 | 		mach_msg_header_t Head; | ||
| 584 | 	} __Request__thread_resume_t __attribute__((unused)); | ||
| 585 | #ifdef __MigPackStructs | ||
| 586 | #pragma pack(pop) | ||
| 587 | #endif | ||
| 588 | |||
| 589 | #ifdef __MigPackStructs | ||
| 590 | #pragma pack(push, 4) | ||
| 591 | #endif | ||
| 592 | 	typedef struct { | ||
| 593 | 		mach_msg_header_t Head; | ||
| 594 | 	} __Request__thread_abort_t __attribute__((unused)); | ||
| 595 | #ifdef __MigPackStructs | ||
| 596 | #pragma pack(pop) | ||
| 597 | #endif | ||
| 598 | |||
| 599 | #ifdef __MigPackStructs | ||
| 600 | #pragma pack(push, 4) | ||
| 601 | #endif | ||
| 602 | 	typedef struct { | ||
| 603 | 		mach_msg_header_t Head; | ||
| 604 | 	} __Request__thread_abort_safely_t __attribute__((unused)); | ||
| 605 | #ifdef __MigPackStructs | ||
| 606 | #pragma pack(pop) | ||
| 607 | #endif | ||
| 608 | |||
| 609 | #ifdef __MigPackStructs | ||
| 610 | #pragma pack(push, 4) | ||
| 611 | #endif | ||
| 612 | 	typedef struct { | ||
| 613 | 		mach_msg_header_t Head; | ||
| 614 | 	} __Request__thread_depress_abort_t __attribute__((unused)); | ||
| 615 | #ifdef __MigPackStructs | ||
| 616 | #pragma pack(pop) | ||
| 617 | #endif | ||
| 618 | |||
| 619 | #ifdef __MigPackStructs | ||
| 620 | #pragma pack(push, 4) | ||
| 621 | #endif | ||
| 622 | 	typedef struct { | ||
| 623 | 		mach_msg_header_t Head; | ||
| 624 | 		NDR_record_t NDR; | ||
| 625 | 		int which_port; | ||
| 626 | 	} __Request__thread_get_special_port_t __attribute__((unused)); | ||
| 627 | #ifdef __MigPackStructs | ||
| 628 | #pragma pack(pop) | ||
| 629 | #endif | ||
| 630 | |||
| 631 | #ifdef __MigPackStructs | ||
| 632 | #pragma pack(push, 4) | ||
| 633 | #endif | ||
| 634 | 	typedef struct { | ||
| 635 | 		mach_msg_header_t Head; | ||
| 636 | 		/* start of the kernel processed data */ | ||
| 637 | 		mach_msg_body_t msgh_body; | ||
| 638 | 		mach_msg_port_descriptor_t special_port; | ||
| 639 | 		/* end of the kernel processed data */ | ||
| 640 | 		NDR_record_t NDR; | ||
| 641 | 		int which_port; | ||
| 642 | 	} __Request__thread_set_special_port_t __attribute__((unused)); | ||
| 643 | #ifdef __MigPackStructs | ||
| 644 | #pragma pack(pop) | ||
| 645 | #endif | ||
| 646 | |||
| 647 | #ifdef __MigPackStructs | ||
| 648 | #pragma pack(push, 4) | ||
| 649 | #endif | ||
| 650 | 	typedef struct { | ||
| 651 | 		mach_msg_header_t Head; | ||
| 652 | 		NDR_record_t NDR; | ||
| 653 | 		thread_flavor_t flavor; | ||
| 654 | 		mach_msg_type_number_t thread_info_outCnt; | ||
| 655 | 	} __Request__thread_info_t __attribute__((unused)); | ||
| 656 | #ifdef __MigPackStructs | ||
| 657 | #pragma pack(pop) | ||
| 658 | #endif | ||
| 659 | |||
| 660 | #ifdef __MigPackStructs | ||
| 661 | #pragma pack(push, 4) | ||
| 662 | #endif | ||
| 663 | 	typedef struct { | ||
| 664 | 		mach_msg_header_t Head; | ||
| 665 | 		/* start of the kernel processed data */ | ||
| 666 | 		mach_msg_body_t msgh_body; | ||
| 667 | 		mach_msg_port_descriptor_t new_port; | ||
| 668 | 		/* end of the kernel processed data */ | ||
| 669 | 		NDR_record_t NDR; | ||
| 670 | 		exception_mask_t exception_mask; | ||
| 671 | 		exception_behavior_t behavior; | ||
| 672 | 		thread_state_flavor_t new_flavor; | ||
| 673 | 	} __Request__thread_set_exception_ports_t __attribute__((unused)); | ||
| 674 | #ifdef __MigPackStructs | ||
| 675 | #pragma pack(pop) | ||
| 676 | #endif | ||
| 677 | |||
| 678 | #ifdef __MigPackStructs | ||
| 679 | #pragma pack(push, 4) | ||
| 680 | #endif | ||
| 681 | 	typedef struct { | ||
| 682 | 		mach_msg_header_t Head; | ||
| 683 | 		NDR_record_t NDR; | ||
| 684 | 		exception_mask_t exception_mask; | ||
| 685 | 	} __Request__thread_get_exception_ports_t __attribute__((unused)); | ||
| 686 | #ifdef __MigPackStructs | ||
| 687 | #pragma pack(pop) | ||
| 688 | #endif | ||
| 689 | |||
| 690 | #ifdef __MigPackStructs | ||
| 691 | #pragma pack(push, 4) | ||
| 692 | #endif | ||
| 693 | 	typedef struct { | ||
| 694 | 		mach_msg_header_t Head; | ||
| 695 | 		/* start of the kernel processed data */ | ||
| 696 | 		mach_msg_body_t msgh_body; | ||
| 697 | 		mach_msg_port_descriptor_t new_port; | ||
| 698 | 		/* end of the kernel processed data */ | ||
| 699 | 		NDR_record_t NDR; | ||
| 700 | 		exception_mask_t exception_mask; | ||
| 701 | 		exception_behavior_t behavior; | ||
| 702 | 		thread_state_flavor_t new_flavor; | ||
| 703 | 	} __Request__thread_swap_exception_ports_t __attribute__((unused)); | ||
| 704 | #ifdef __MigPackStructs | ||
| 705 | #pragma pack(pop) | ||
| 706 | #endif | ||
| 707 | |||
| 708 | #ifdef __MigPackStructs | ||
| 709 | #pragma pack(push, 4) | ||
| 710 | #endif | ||
| 711 | 	typedef struct { | ||
| 712 | 		mach_msg_header_t Head; | ||
| 713 | 		NDR_record_t NDR; | ||
| 714 | 		policy_t policy; | ||
| 715 | 		mach_msg_type_number_t baseCnt; | ||
| 716 | 		integer_t base[5]; | ||
| 717 | 		boolean_t set_limit; | ||
| 718 | 	} __Request__thread_policy_t __attribute__((unused)); | ||
| 719 | #ifdef __MigPackStructs | ||
| 720 | #pragma pack(pop) | ||
| 721 | #endif | ||
| 722 | |||
| 723 | #ifdef __MigPackStructs | ||
| 724 | #pragma pack(push, 4) | ||
| 725 | #endif | ||
| 726 | 	typedef struct { | ||
| 727 | 		mach_msg_header_t Head; | ||
| 728 | 		NDR_record_t NDR; | ||
| 729 | 		thread_policy_flavor_t flavor; | ||
| 730 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 731 | 		integer_t policy_info[16]; | ||
| 732 | 	} __Request__thread_policy_set_t __attribute__((unused)); | ||
| 733 | #ifdef __MigPackStructs | ||
| 734 | #pragma pack(pop) | ||
| 735 | #endif | ||
| 736 | |||
| 737 | #ifdef __MigPackStructs | ||
| 738 | #pragma pack(push, 4) | ||
| 739 | #endif | ||
| 740 | 	typedef struct { | ||
| 741 | 		mach_msg_header_t Head; | ||
| 742 | 		NDR_record_t NDR; | ||
| 743 | 		thread_policy_flavor_t flavor; | ||
| 744 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 745 | 		boolean_t get_default; | ||
| 746 | 	} __Request__thread_policy_get_t __attribute__((unused)); | ||
| 747 | #ifdef __MigPackStructs | ||
| 748 | #pragma pack(pop) | ||
| 749 | #endif | ||
| 750 | |||
| 751 | #ifdef __MigPackStructs | ||
| 752 | #pragma pack(push, 4) | ||
| 753 | #endif | ||
| 754 | 	typedef struct { | ||
| 755 | 		mach_msg_header_t Head; | ||
| 756 | 		/* start of the kernel processed data */ | ||
| 757 | 		mach_msg_body_t msgh_body; | ||
| 758 | 		mach_msg_port_descriptor_t reply; | ||
| 759 | 		/* end of the kernel processed data */ | ||
| 760 | 	} __Request__thread_sample_t __attribute__((unused)); | ||
| 761 | #ifdef __MigPackStructs | ||
| 762 | #pragma pack(pop) | ||
| 763 | #endif | ||
| 764 | |||
| 765 | #ifdef __MigPackStructs | ||
| 766 | #pragma pack(push, 4) | ||
| 767 | #endif | ||
| 768 | 	typedef struct { | ||
| 769 | 		mach_msg_header_t Head; | ||
| 770 | 		NDR_record_t NDR; | ||
| 771 | 		boolean_t trace_status; | ||
| 772 | 	} __Request__etap_trace_thread_t __attribute__((unused)); | ||
| 773 | #ifdef __MigPackStructs | ||
| 774 | #pragma pack(pop) | ||
| 775 | #endif | ||
| 776 | |||
| 777 | #ifdef __MigPackStructs | ||
| 778 | #pragma pack(push, 4) | ||
| 779 | #endif | ||
| 780 | 	typedef struct { | ||
| 781 | 		mach_msg_header_t Head; | ||
| 782 | 		/* start of the kernel processed data */ | ||
| 783 | 		mach_msg_body_t msgh_body; | ||
| 784 | 		mach_msg_port_descriptor_t new_set; | ||
| 785 | 		/* end of the kernel processed data */ | ||
| 786 | 	} __Request__thread_assign_t __attribute__((unused)); | ||
| 787 | #ifdef __MigPackStructs | ||
| 788 | #pragma pack(pop) | ||
| 789 | #endif | ||
| 790 | |||
| 791 | #ifdef __MigPackStructs | ||
| 792 | #pragma pack(push, 4) | ||
| 793 | #endif | ||
| 794 | 	typedef struct { | ||
| 795 | 		mach_msg_header_t Head; | ||
| 796 | 	} __Request__thread_assign_default_t __attribute__((unused)); | ||
| 797 | #ifdef __MigPackStructs | ||
| 798 | #pragma pack(pop) | ||
| 799 | #endif | ||
| 800 | |||
| 801 | #ifdef __MigPackStructs | ||
| 802 | #pragma pack(push, 4) | ||
| 803 | #endif | ||
| 804 | 	typedef struct { | ||
| 805 | 		mach_msg_header_t Head; | ||
| 806 | 	} __Request__thread_get_assignment_t __attribute__((unused)); | ||
| 807 | #ifdef __MigPackStructs | ||
| 808 | #pragma pack(pop) | ||
| 809 | #endif | ||
| 810 | |||
| 811 | #ifdef __MigPackStructs | ||
| 812 | #pragma pack(push, 4) | ||
| 813 | #endif | ||
| 814 | 	typedef struct { | ||
| 815 | 		mach_msg_header_t Head; | ||
| 816 | 		/* start of the kernel processed data */ | ||
| 817 | 		mach_msg_body_t msgh_body; | ||
| 818 | 		mach_msg_port_descriptor_t pset; | ||
| 819 | 		/* end of the kernel processed data */ | ||
| 820 | 		NDR_record_t NDR; | ||
| 821 | 		policy_t policy; | ||
| 822 | 		mach_msg_type_number_t baseCnt; | ||
| 823 | 		integer_t base[5]; | ||
| 824 | 		mach_msg_type_number_t limitCnt; | ||
| 825 | 		integer_t limit[1]; | ||
| 826 | 	} __Request__thread_set_policy_t __attribute__((unused)); | ||
| 827 | #ifdef __MigPackStructs | ||
| 828 | #pragma pack(pop) | ||
| 829 | #endif | ||
| 830 | |||
| 831 | #ifdef __MigPackStructs | ||
| 832 | #pragma pack(push, 4) | ||
| 833 | #endif | ||
| 834 | 	typedef struct { | ||
| 835 | 		mach_msg_header_t Head; | ||
| 836 | 		NDR_record_t NDR; | ||
| 837 | 		mach_voucher_selector_t which; | ||
| 838 | 	} __Request__thread_get_mach_voucher_t __attribute__((unused)); | ||
| 839 | #ifdef __MigPackStructs | ||
| 840 | #pragma pack(pop) | ||
| 841 | #endif | ||
| 842 | |||
| 843 | #ifdef __MigPackStructs | ||
| 844 | #pragma pack(push, 4) | ||
| 845 | #endif | ||
| 846 | 	typedef struct { | ||
| 847 | 		mach_msg_header_t Head; | ||
| 848 | 		/* start of the kernel processed data */ | ||
| 849 | 		mach_msg_body_t msgh_body; | ||
| 850 | 		mach_msg_port_descriptor_t voucher; | ||
| 851 | 		/* end of the kernel processed data */ | ||
| 852 | 	} __Request__thread_set_mach_voucher_t __attribute__((unused)); | ||
| 853 | #ifdef __MigPackStructs | ||
| 854 | #pragma pack(pop) | ||
| 855 | #endif | ||
| 856 | |||
| 857 | #ifdef __MigPackStructs | ||
| 858 | #pragma pack(push, 4) | ||
| 859 | #endif | ||
| 860 | 	typedef struct { | ||
| 861 | 		mach_msg_header_t Head; | ||
| 862 | 		/* start of the kernel processed data */ | ||
| 863 | 		mach_msg_body_t msgh_body; | ||
| 864 | 		mach_msg_port_descriptor_t new_voucher; | ||
| 865 | 		mach_msg_port_descriptor_t old_voucher; | ||
| 866 | 		/* end of the kernel processed data */ | ||
| 867 | 	} __Request__thread_swap_mach_voucher_t __attribute__((unused)); | ||
| 868 | #ifdef __MigPackStructs | ||
| 869 | #pragma pack(pop) | ||
| 870 | #endif | ||
| 871 | |||
| 872 | #ifdef __MigPackStructs | ||
| 873 | #pragma pack(push, 4) | ||
| 874 | #endif | ||
| 875 | 	typedef struct { | ||
| 876 | 		mach_msg_header_t Head; | ||
| 877 | 		NDR_record_t NDR; | ||
| 878 | 		int direction; | ||
| 879 | 		thread_state_flavor_t flavor; | ||
| 880 | 		mach_msg_type_number_t in_stateCnt; | ||
| 881 | 		natural_t in_state[1296]; | ||
| 882 | 		mach_msg_type_number_t out_stateCnt; | ||
| 883 | 	} __Request__thread_convert_thread_state_t __attribute__((unused)); | ||
| 884 | #ifdef __MigPackStructs | ||
| 885 | #pragma pack(pop) | ||
| 886 | #endif | ||
| 887 | #endif /* !__Request__thread_act_subsystem__defined */ | ||
| 888 | |||
| 889 | /* union of all requests */ | ||
| 890 | |||
| 891 | #ifndef __RequestUnion__thread_act_subsystem__defined | ||
| 892 | #define __RequestUnion__thread_act_subsystem__defined | ||
| 893 | union __RequestUnion__thread_act_subsystem { | ||
| 894 | 	__Request__thread_terminate_t Request_thread_terminate; | ||
| 895 | 	__Request__act_get_state_t Request_act_get_state; | ||
| 896 | 	__Request__act_set_state_t Request_act_set_state; | ||
| 897 | 	__Request__thread_get_state_t Request_thread_get_state; | ||
| 898 | 	__Request__thread_set_state_t Request_thread_set_state; | ||
| 899 | 	__Request__thread_suspend_t Request_thread_suspend; | ||
| 900 | 	__Request__thread_resume_t Request_thread_resume; | ||
| 901 | 	__Request__thread_abort_t Request_thread_abort; | ||
| 902 | 	__Request__thread_abort_safely_t Request_thread_abort_safely; | ||
| 903 | 	__Request__thread_depress_abort_t Request_thread_depress_abort; | ||
| 904 | 	__Request__thread_get_special_port_t Request_thread_get_special_port; | ||
| 905 | 	__Request__thread_set_special_port_t Request_thread_set_special_port; | ||
| 906 | 	__Request__thread_info_t Request_thread_info; | ||
| 907 | 	__Request__thread_set_exception_ports_t Request_thread_set_exception_ports; | ||
| 908 | 	__Request__thread_get_exception_ports_t Request_thread_get_exception_ports; | ||
| 909 | 	__Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; | ||
| 910 | 	__Request__thread_policy_t Request_thread_policy; | ||
| 911 | 	__Request__thread_policy_set_t Request_thread_policy_set; | ||
| 912 | 	__Request__thread_policy_get_t Request_thread_policy_get; | ||
| 913 | 	__Request__thread_sample_t Request_thread_sample; | ||
| 914 | 	__Request__etap_trace_thread_t Request_etap_trace_thread; | ||
| 915 | 	__Request__thread_assign_t Request_thread_assign; | ||
| 916 | 	__Request__thread_assign_default_t Request_thread_assign_default; | ||
| 917 | 	__Request__thread_get_assignment_t Request_thread_get_assignment; | ||
| 918 | 	__Request__thread_set_policy_t Request_thread_set_policy; | ||
| 919 | 	__Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher; | ||
| 920 | 	__Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher; | ||
| 921 | 	__Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher; | ||
| 922 | 	__Request__thread_convert_thread_state_t Request_thread_convert_thread_state; | ||
| 923 | }; | ||
| 924 | #endif /* !__RequestUnion__thread_act_subsystem__defined */ | ||
| 925 | /* typedefs for all replies */ | ||
| 926 | |||
| 927 | #ifndef __Reply__thread_act_subsystem__defined | ||
| 928 | #define __Reply__thread_act_subsystem__defined | ||
| 929 | |||
| 930 | #ifdef __MigPackStructs | ||
| 931 | #pragma pack(push, 4) | ||
| 932 | #endif | ||
| 933 | 	typedef struct { | ||
| 934 | 		mach_msg_header_t Head; | ||
| 935 | 		NDR_record_t NDR; | ||
| 936 | 		kern_return_t RetCode; | ||
| 937 | 	} __Reply__thread_terminate_t __attribute__((unused)); | ||
| 938 | #ifdef __MigPackStructs | ||
| 939 | #pragma pack(pop) | ||
| 940 | #endif | ||
| 941 | |||
| 942 | #ifdef __MigPackStructs | ||
| 943 | #pragma pack(push, 4) | ||
| 944 | #endif | ||
| 945 | 	typedef struct { | ||
| 946 | 		mach_msg_header_t Head; | ||
| 947 | 		NDR_record_t NDR; | ||
| 948 | 		kern_return_t RetCode; | ||
| 949 | 		mach_msg_type_number_t old_stateCnt; | ||
| 950 | 		natural_t old_state[1296]; | ||
| 951 | 	} __Reply__act_get_state_t __attribute__((unused)); | ||
| 952 | #ifdef __MigPackStructs | ||
| 953 | #pragma pack(pop) | ||
| 954 | #endif | ||
| 955 | |||
| 956 | #ifdef __MigPackStructs | ||
| 957 | #pragma pack(push, 4) | ||
| 958 | #endif | ||
| 959 | 	typedef struct { | ||
| 960 | 		mach_msg_header_t Head; | ||
| 961 | 		NDR_record_t NDR; | ||
| 962 | 		kern_return_t RetCode; | ||
| 963 | 	} __Reply__act_set_state_t __attribute__((unused)); | ||
| 964 | #ifdef __MigPackStructs | ||
| 965 | #pragma pack(pop) | ||
| 966 | #endif | ||
| 967 | |||
| 968 | #ifdef __MigPackStructs | ||
| 969 | #pragma pack(push, 4) | ||
| 970 | #endif | ||
| 971 | 	typedef struct { | ||
| 972 | 		mach_msg_header_t Head; | ||
| 973 | 		NDR_record_t NDR; | ||
| 974 | 		kern_return_t RetCode; | ||
| 975 | 		mach_msg_type_number_t old_stateCnt; | ||
| 976 | 		natural_t old_state[1296]; | ||
| 977 | 	} __Reply__thread_get_state_t __attribute__((unused)); | ||
| 978 | #ifdef __MigPackStructs | ||
| 979 | #pragma pack(pop) | ||
| 980 | #endif | ||
| 981 | |||
| 982 | #ifdef __MigPackStructs | ||
| 983 | #pragma pack(push, 4) | ||
| 984 | #endif | ||
| 985 | 	typedef struct { | ||
| 986 | 		mach_msg_header_t Head; | ||
| 987 | 		NDR_record_t NDR; | ||
| 988 | 		kern_return_t RetCode; | ||
| 989 | 	} __Reply__thread_set_state_t __attribute__((unused)); | ||
| 990 | #ifdef __MigPackStructs | ||
| 991 | #pragma pack(pop) | ||
| 992 | #endif | ||
| 993 | |||
| 994 | #ifdef __MigPackStructs | ||
| 995 | #pragma pack(push, 4) | ||
| 996 | #endif | ||
| 997 | 	typedef struct { | ||
| 998 | 		mach_msg_header_t Head; | ||
| 999 | 		NDR_record_t NDR; | ||
| 1000 | 		kern_return_t RetCode; | ||
| 1001 | 	} __Reply__thread_suspend_t __attribute__((unused)); | ||
| 1002 | #ifdef __MigPackStructs | ||
| 1003 | #pragma pack(pop) | ||
| 1004 | #endif | ||
| 1005 | |||
| 1006 | #ifdef __MigPackStructs | ||
| 1007 | #pragma pack(push, 4) | ||
| 1008 | #endif | ||
| 1009 | 	typedef struct { | ||
| 1010 | 		mach_msg_header_t Head; | ||
| 1011 | 		NDR_record_t NDR; | ||
| 1012 | 		kern_return_t RetCode; | ||
| 1013 | 	} __Reply__thread_resume_t __attribute__((unused)); | ||
| 1014 | #ifdef __MigPackStructs | ||
| 1015 | #pragma pack(pop) | ||
| 1016 | #endif | ||
| 1017 | |||
| 1018 | #ifdef __MigPackStructs | ||
| 1019 | #pragma pack(push, 4) | ||
| 1020 | #endif | ||
| 1021 | 	typedef struct { | ||
| 1022 | 		mach_msg_header_t Head; | ||
| 1023 | 		NDR_record_t NDR; | ||
| 1024 | 		kern_return_t RetCode; | ||
| 1025 | 	} __Reply__thread_abort_t __attribute__((unused)); | ||
| 1026 | #ifdef __MigPackStructs | ||
| 1027 | #pragma pack(pop) | ||
| 1028 | #endif | ||
| 1029 | |||
| 1030 | #ifdef __MigPackStructs | ||
| 1031 | #pragma pack(push, 4) | ||
| 1032 | #endif | ||
| 1033 | 	typedef struct { | ||
| 1034 | 		mach_msg_header_t Head; | ||
| 1035 | 		NDR_record_t NDR; | ||
| 1036 | 		kern_return_t RetCode; | ||
| 1037 | 	} __Reply__thread_abort_safely_t __attribute__((unused)); | ||
| 1038 | #ifdef __MigPackStructs | ||
| 1039 | #pragma pack(pop) | ||
| 1040 | #endif | ||
| 1041 | |||
| 1042 | #ifdef __MigPackStructs | ||
| 1043 | #pragma pack(push, 4) | ||
| 1044 | #endif | ||
| 1045 | 	typedef struct { | ||
| 1046 | 		mach_msg_header_t Head; | ||
| 1047 | 		NDR_record_t NDR; | ||
| 1048 | 		kern_return_t RetCode; | ||
| 1049 | 	} __Reply__thread_depress_abort_t __attribute__((unused)); | ||
| 1050 | #ifdef __MigPackStructs | ||
| 1051 | #pragma pack(pop) | ||
| 1052 | #endif | ||
| 1053 | |||
| 1054 | #ifdef __MigPackStructs | ||
| 1055 | #pragma pack(push, 4) | ||
| 1056 | #endif | ||
| 1057 | 	typedef struct { | ||
| 1058 | 		mach_msg_header_t Head; | ||
| 1059 | 		/* start of the kernel processed data */ | ||
| 1060 | 		mach_msg_body_t msgh_body; | ||
| 1061 | 		mach_msg_port_descriptor_t special_port; | ||
| 1062 | 		/* end of the kernel processed data */ | ||
| 1063 | 	} __Reply__thread_get_special_port_t __attribute__((unused)); | ||
| 1064 | #ifdef __MigPackStructs | ||
| 1065 | #pragma pack(pop) | ||
| 1066 | #endif | ||
| 1067 | |||
| 1068 | #ifdef __MigPackStructs | ||
| 1069 | #pragma pack(push, 4) | ||
| 1070 | #endif | ||
| 1071 | 	typedef struct { | ||
| 1072 | 		mach_msg_header_t Head; | ||
| 1073 | 		NDR_record_t NDR; | ||
| 1074 | 		kern_return_t RetCode; | ||
| 1075 | 	} __Reply__thread_set_special_port_t __attribute__((unused)); | ||
| 1076 | #ifdef __MigPackStructs | ||
| 1077 | #pragma pack(pop) | ||
| 1078 | #endif | ||
| 1079 | |||
| 1080 | #ifdef __MigPackStructs | ||
| 1081 | #pragma pack(push, 4) | ||
| 1082 | #endif | ||
| 1083 | 	typedef struct { | ||
| 1084 | 		mach_msg_header_t Head; | ||
| 1085 | 		NDR_record_t NDR; | ||
| 1086 | 		kern_return_t RetCode; | ||
| 1087 | 		mach_msg_type_number_t thread_info_outCnt; | ||
| 1088 | 		integer_t thread_info_out[32]; | ||
| 1089 | 	} __Reply__thread_info_t __attribute__((unused)); | ||
| 1090 | #ifdef __MigPackStructs | ||
| 1091 | #pragma pack(pop) | ||
| 1092 | #endif | ||
| 1093 | |||
| 1094 | #ifdef __MigPackStructs | ||
| 1095 | #pragma pack(push, 4) | ||
| 1096 | #endif | ||
| 1097 | 	typedef struct { | ||
| 1098 | 		mach_msg_header_t Head; | ||
| 1099 | 		NDR_record_t NDR; | ||
| 1100 | 		kern_return_t RetCode; | ||
| 1101 | 	} __Reply__thread_set_exception_ports_t __attribute__((unused)); | ||
| 1102 | #ifdef __MigPackStructs | ||
| 1103 | #pragma pack(pop) | ||
| 1104 | #endif | ||
| 1105 | |||
| 1106 | #ifdef __MigPackStructs | ||
| 1107 | #pragma pack(push, 4) | ||
| 1108 | #endif | ||
| 1109 | 	typedef struct { | ||
| 1110 | 		mach_msg_header_t Head; | ||
| 1111 | 		/* start of the kernel processed data */ | ||
| 1112 | 		mach_msg_body_t msgh_body; | ||
| 1113 | 		mach_msg_port_descriptor_t old_handlers[32]; | ||
| 1114 | 		/* end of the kernel processed data */ | ||
| 1115 | 		NDR_record_t NDR; | ||
| 1116 | 		mach_msg_type_number_t masksCnt; | ||
| 1117 | 		exception_mask_t masks[32]; | ||
| 1118 | 		exception_behavior_t old_behaviors[32]; | ||
| 1119 | 		thread_state_flavor_t old_flavors[32]; | ||
| 1120 | 	} __Reply__thread_get_exception_ports_t __attribute__((unused)); | ||
| 1121 | #ifdef __MigPackStructs | ||
| 1122 | #pragma pack(pop) | ||
| 1123 | #endif | ||
| 1124 | |||
| 1125 | #ifdef __MigPackStructs | ||
| 1126 | #pragma pack(push, 4) | ||
| 1127 | #endif | ||
| 1128 | 	typedef struct { | ||
| 1129 | 		mach_msg_header_t Head; | ||
| 1130 | 		/* start of the kernel processed data */ | ||
| 1131 | 		mach_msg_body_t msgh_body; | ||
| 1132 | 		mach_msg_port_descriptor_t old_handlers[32]; | ||
| 1133 | 		/* end of the kernel processed data */ | ||
| 1134 | 		NDR_record_t NDR; | ||
| 1135 | 		mach_msg_type_number_t masksCnt; | ||
| 1136 | 		exception_mask_t masks[32]; | ||
| 1137 | 		exception_behavior_t old_behaviors[32]; | ||
| 1138 | 		thread_state_flavor_t old_flavors[32]; | ||
| 1139 | 	} __Reply__thread_swap_exception_ports_t __attribute__((unused)); | ||
| 1140 | #ifdef __MigPackStructs | ||
| 1141 | #pragma pack(pop) | ||
| 1142 | #endif | ||
| 1143 | |||
| 1144 | #ifdef __MigPackStructs | ||
| 1145 | #pragma pack(push, 4) | ||
| 1146 | #endif | ||
| 1147 | 	typedef struct { | ||
| 1148 | 		mach_msg_header_t Head; | ||
| 1149 | 		NDR_record_t NDR; | ||
| 1150 | 		kern_return_t RetCode; | ||
| 1151 | 	} __Reply__thread_policy_t __attribute__((unused)); | ||
| 1152 | #ifdef __MigPackStructs | ||
| 1153 | #pragma pack(pop) | ||
| 1154 | #endif | ||
| 1155 | |||
| 1156 | #ifdef __MigPackStructs | ||
| 1157 | #pragma pack(push, 4) | ||
| 1158 | #endif | ||
| 1159 | 	typedef struct { | ||
| 1160 | 		mach_msg_header_t Head; | ||
| 1161 | 		NDR_record_t NDR; | ||
| 1162 | 		kern_return_t RetCode; | ||
| 1163 | 	} __Reply__thread_policy_set_t __attribute__((unused)); | ||
| 1164 | #ifdef __MigPackStructs | ||
| 1165 | #pragma pack(pop) | ||
| 1166 | #endif | ||
| 1167 | |||
| 1168 | #ifdef __MigPackStructs | ||
| 1169 | #pragma pack(push, 4) | ||
| 1170 | #endif | ||
| 1171 | 	typedef struct { | ||
| 1172 | 		mach_msg_header_t Head; | ||
| 1173 | 		NDR_record_t NDR; | ||
| 1174 | 		kern_return_t RetCode; | ||
| 1175 | 		mach_msg_type_number_t policy_infoCnt; | ||
| 1176 | 		integer_t policy_info[16]; | ||
| 1177 | 		boolean_t get_default; | ||
| 1178 | 	} __Reply__thread_policy_get_t __attribute__((unused)); | ||
| 1179 | #ifdef __MigPackStructs | ||
| 1180 | #pragma pack(pop) | ||
| 1181 | #endif | ||
| 1182 | |||
| 1183 | #ifdef __MigPackStructs | ||
| 1184 | #pragma pack(push, 4) | ||
| 1185 | #endif | ||
| 1186 | 	typedef struct { | ||
| 1187 | 		mach_msg_header_t Head; | ||
| 1188 | 		NDR_record_t NDR; | ||
| 1189 | 		kern_return_t RetCode; | ||
| 1190 | 	} __Reply__thread_sample_t __attribute__((unused)); | ||
| 1191 | #ifdef __MigPackStructs | ||
| 1192 | #pragma pack(pop) | ||
| 1193 | #endif | ||
| 1194 | |||
| 1195 | #ifdef __MigPackStructs | ||
| 1196 | #pragma pack(push, 4) | ||
| 1197 | #endif | ||
| 1198 | 	typedef struct { | ||
| 1199 | 		mach_msg_header_t Head; | ||
| 1200 | 		NDR_record_t NDR; | ||
| 1201 | 		kern_return_t RetCode; | ||
| 1202 | 	} __Reply__etap_trace_thread_t __attribute__((unused)); | ||
| 1203 | #ifdef __MigPackStructs | ||
| 1204 | #pragma pack(pop) | ||
| 1205 | #endif | ||
| 1206 | |||
| 1207 | #ifdef __MigPackStructs | ||
| 1208 | #pragma pack(push, 4) | ||
| 1209 | #endif | ||
| 1210 | 	typedef struct { | ||
| 1211 | 		mach_msg_header_t Head; | ||
| 1212 | 		NDR_record_t NDR; | ||
| 1213 | 		kern_return_t RetCode; | ||
| 1214 | 	} __Reply__thread_assign_t __attribute__((unused)); | ||
| 1215 | #ifdef __MigPackStructs | ||
| 1216 | #pragma pack(pop) | ||
| 1217 | #endif | ||
| 1218 | |||
| 1219 | #ifdef __MigPackStructs | ||
| 1220 | #pragma pack(push, 4) | ||
| 1221 | #endif | ||
| 1222 | 	typedef struct { | ||
| 1223 | 		mach_msg_header_t Head; | ||
| 1224 | 		NDR_record_t NDR; | ||
| 1225 | 		kern_return_t RetCode; | ||
| 1226 | 	} __Reply__thread_assign_default_t __attribute__((unused)); | ||
| 1227 | #ifdef __MigPackStructs | ||
| 1228 | #pragma pack(pop) | ||
| 1229 | #endif | ||
| 1230 | |||
| 1231 | #ifdef __MigPackStructs | ||
| 1232 | #pragma pack(push, 4) | ||
| 1233 | #endif | ||
| 1234 | 	typedef struct { | ||
| 1235 | 		mach_msg_header_t Head; | ||
| 1236 | 		/* start of the kernel processed data */ | ||
| 1237 | 		mach_msg_body_t msgh_body; | ||
| 1238 | 		mach_msg_port_descriptor_t assigned_set; | ||
| 1239 | 		/* end of the kernel processed data */ | ||
| 1240 | 	} __Reply__thread_get_assignment_t __attribute__((unused)); | ||
| 1241 | #ifdef __MigPackStructs | ||
| 1242 | #pragma pack(pop) | ||
| 1243 | #endif | ||
| 1244 | |||
| 1245 | #ifdef __MigPackStructs | ||
| 1246 | #pragma pack(push, 4) | ||
| 1247 | #endif | ||
| 1248 | 	typedef struct { | ||
| 1249 | 		mach_msg_header_t Head; | ||
| 1250 | 		NDR_record_t NDR; | ||
| 1251 | 		kern_return_t RetCode; | ||
| 1252 | 	} __Reply__thread_set_policy_t __attribute__((unused)); | ||
| 1253 | #ifdef __MigPackStructs | ||
| 1254 | #pragma pack(pop) | ||
| 1255 | #endif | ||
| 1256 | |||
| 1257 | #ifdef __MigPackStructs | ||
| 1258 | #pragma pack(push, 4) | ||
| 1259 | #endif | ||
| 1260 | 	typedef struct { | ||
| 1261 | 		mach_msg_header_t Head; | ||
| 1262 | 		/* start of the kernel processed data */ | ||
| 1263 | 		mach_msg_body_t msgh_body; | ||
| 1264 | 		mach_msg_port_descriptor_t voucher; | ||
| 1265 | 		/* end of the kernel processed data */ | ||
| 1266 | 	} __Reply__thread_get_mach_voucher_t __attribute__((unused)); | ||
| 1267 | #ifdef __MigPackStructs | ||
| 1268 | #pragma pack(pop) | ||
| 1269 | #endif | ||
| 1270 | |||
| 1271 | #ifdef __MigPackStructs | ||
| 1272 | #pragma pack(push, 4) | ||
| 1273 | #endif | ||
| 1274 | 	typedef struct { | ||
| 1275 | 		mach_msg_header_t Head; | ||
| 1276 | 		NDR_record_t NDR; | ||
| 1277 | 		kern_return_t RetCode; | ||
| 1278 | 	} __Reply__thread_set_mach_voucher_t __attribute__((unused)); | ||
| 1279 | #ifdef __MigPackStructs | ||
| 1280 | #pragma pack(pop) | ||
| 1281 | #endif | ||
| 1282 | |||
| 1283 | #ifdef __MigPackStructs | ||
| 1284 | #pragma pack(push, 4) | ||
| 1285 | #endif | ||
| 1286 | 	typedef struct { | ||
| 1287 | 		mach_msg_header_t Head; | ||
| 1288 | 		/* start of the kernel processed data */ | ||
| 1289 | 		mach_msg_body_t msgh_body; | ||
| 1290 | 		mach_msg_port_descriptor_t old_voucher; | ||
| 1291 | 		/* end of the kernel processed data */ | ||
| 1292 | 	} __Reply__thread_swap_mach_voucher_t __attribute__((unused)); | ||
| 1293 | #ifdef __MigPackStructs | ||
| 1294 | #pragma pack(pop) | ||
| 1295 | #endif | ||
| 1296 | |||
| 1297 | #ifdef __MigPackStructs | ||
| 1298 | #pragma pack(push, 4) | ||
| 1299 | #endif | ||
| 1300 | 	typedef struct { | ||
| 1301 | 		mach_msg_header_t Head; | ||
| 1302 | 		NDR_record_t NDR; | ||
| 1303 | 		kern_return_t RetCode; | ||
| 1304 | 		mach_msg_type_number_t out_stateCnt; | ||
| 1305 | 		natural_t out_state[1296]; | ||
| 1306 | 	} __Reply__thread_convert_thread_state_t __attribute__((unused)); | ||
| 1307 | #ifdef __MigPackStructs | ||
| 1308 | #pragma pack(pop) | ||
| 1309 | #endif | ||
| 1310 | #endif /* !__Reply__thread_act_subsystem__defined */ | ||
| 1311 | |||
| 1312 | /* union of all replies */ | ||
| 1313 | |||
| 1314 | #ifndef __ReplyUnion__thread_act_subsystem__defined | ||
| 1315 | #define __ReplyUnion__thread_act_subsystem__defined | ||
| 1316 | union __ReplyUnion__thread_act_subsystem { | ||
| 1317 | 	__Reply__thread_terminate_t Reply_thread_terminate; | ||
| 1318 | 	__Reply__act_get_state_t Reply_act_get_state; | ||
| 1319 | 	__Reply__act_set_state_t Reply_act_set_state; | ||
| 1320 | 	__Reply__thread_get_state_t Reply_thread_get_state; | ||
| 1321 | 	__Reply__thread_set_state_t Reply_thread_set_state; | ||
| 1322 | 	__Reply__thread_suspend_t Reply_thread_suspend; | ||
| 1323 | 	__Reply__thread_resume_t Reply_thread_resume; | ||
| 1324 | 	__Reply__thread_abort_t Reply_thread_abort; | ||
| 1325 | 	__Reply__thread_abort_safely_t Reply_thread_abort_safely; | ||
| 1326 | 	__Reply__thread_depress_abort_t Reply_thread_depress_abort; | ||
| 1327 | 	__Reply__thread_get_special_port_t Reply_thread_get_special_port; | ||
| 1328 | 	__Reply__thread_set_special_port_t Reply_thread_set_special_port; | ||
| 1329 | 	__Reply__thread_info_t Reply_thread_info; | ||
| 1330 | 	__Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; | ||
| 1331 | 	__Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; | ||
| 1332 | 	__Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; | ||
| 1333 | 	__Reply__thread_policy_t Reply_thread_policy; | ||
| 1334 | 	__Reply__thread_policy_set_t Reply_thread_policy_set; | ||
| 1335 | 	__Reply__thread_policy_get_t Reply_thread_policy_get; | ||
| 1336 | 	__Reply__thread_sample_t Reply_thread_sample; | ||
| 1337 | 	__Reply__etap_trace_thread_t Reply_etap_trace_thread; | ||
| 1338 | 	__Reply__thread_assign_t Reply_thread_assign; | ||
| 1339 | 	__Reply__thread_assign_default_t Reply_thread_assign_default; | ||
| 1340 | 	__Reply__thread_get_assignment_t Reply_thread_get_assignment; | ||
| 1341 | 	__Reply__thread_set_policy_t Reply_thread_set_policy; | ||
| 1342 | 	__Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher; | ||
| 1343 | 	__Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher; | ||
| 1344 | 	__Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher; | ||
| 1345 | 	__Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state; | ||
| 1346 | }; | ||
| 1347 | #endif /* !__RequestUnion__thread_act_subsystem__defined */ | ||
| 1348 | |||
| 1349 | #ifndef subsystem_to_name_map_thread_act | ||
| 1350 | #define subsystem_to_name_map_thread_act \ | ||
| 1351 | { "thread_terminate", 3600 },\ | ||
| 1352 | { "act_get_state", 3601 },\ | ||
| 1353 | { "act_set_state", 3602 },\ | ||
| 1354 | { "thread_get_state", 3603 },\ | ||
| 1355 | { "thread_set_state", 3604 },\ | ||
| 1356 | { "thread_suspend", 3605 },\ | ||
| 1357 | { "thread_resume", 3606 },\ | ||
| 1358 | { "thread_abort", 3607 },\ | ||
| 1359 | { "thread_abort_safely", 3608 },\ | ||
| 1360 | { "thread_depress_abort", 3609 },\ | ||
| 1361 | { "thread_get_special_port", 3610 },\ | ||
| 1362 | { "thread_set_special_port", 3611 },\ | ||
| 1363 | { "thread_info", 3612 },\ | ||
| 1364 | { "thread_set_exception_ports", 3613 },\ | ||
| 1365 | { "thread_get_exception_ports", 3614 },\ | ||
| 1366 | { "thread_swap_exception_ports", 3615 },\ | ||
| 1367 | { "thread_policy", 3616 },\ | ||
| 1368 | { "thread_policy_set", 3617 },\ | ||
| 1369 | { "thread_policy_get", 3618 },\ | ||
| 1370 | { "thread_sample", 3619 },\ | ||
| 1371 | { "etap_trace_thread", 3620 },\ | ||
| 1372 | { "thread_assign", 3621 },\ | ||
| 1373 | { "thread_assign_default", 3622 },\ | ||
| 1374 | { "thread_get_assignment", 3623 },\ | ||
| 1375 | { "thread_set_policy", 3624 },\ | ||
| 1376 | { "thread_get_mach_voucher", 3625 },\ | ||
| 1377 | { "thread_set_mach_voucher", 3626 },\ | ||
| 1378 | { "thread_swap_mach_voucher", 3627 },\ | ||
| 1379 | { "thread_convert_thread_state", 3628 } | ||
| 1380 | #endif | ||
| 1381 | |||
| 1382 | #ifdef __AfterMigUserHeader | ||
| 1383 | __AfterMigUserHeader | ||
| 1384 | #endif /* __AfterMigUserHeader */ | ||
| 1385 | |||
| 1386 | #endif	 /* _thread_act_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/thread_info.h created+211| ... | @@ -0,0 +1,211 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005, 2015 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/thread_info | ||
| 60 | * | ||
| 61 | *	Thread information structure and definitions. | ||
| 62 | * | ||
| 63 | *	The defintions in this file are exported to the user. The kernel | ||
| 64 | *	will translate its internal data structures to these structures | ||
| 65 | *	as appropriate. | ||
| 66 | * | ||
| 67 | */ | ||
| 68 | |||
| 69 | #ifndef _MACH_THREAD_INFO_H_ | ||
| 70 | #define _MACH_THREAD_INFO_H_ | ||
| 71 | |||
| 72 | #include <mach/boolean.h> | ||
| 73 | #include <mach/policy.h> | ||
| 74 | #include <mach/time_value.h> | ||
| 75 | #include <mach/message.h> | ||
| 76 | #include <mach/machine/vm_types.h> | ||
| 77 | |||
| 78 | /* | ||
| 79 | *	Generic information structure to allow for expansion. | ||
| 80 | */ | ||
| 81 | typedef natural_t thread_flavor_t; | ||
| 82 | typedef integer_t *thread_info_t; /* varying array of int */ | ||
| 83 | |||
| 84 | #define THREAD_INFO_MAX (32) /* maximum array size */ | ||
| 85 | typedef integer_t thread_info_data_t[THREAD_INFO_MAX]; | ||
| 86 | |||
| 87 | /* | ||
| 88 | *	Currently defined information. | ||
| 89 | */ | ||
| 90 | #define THREAD_BASIC_INFO 3 /* basic information */ | ||
| 91 | |||
| 92 | struct thread_basic_info { | ||
| 93 | 	time_value_t user_time; /* user run time */ | ||
| 94 | 	time_value_t system_time; /* system run time */ | ||
| 95 | 	integer_t cpu_usage; /* scaled cpu usage percentage */ | ||
| 96 | 	policy_t policy; /* scheduling policy in effect */ | ||
| 97 | 	integer_t run_state; /* run state (see below) */ | ||
| 98 | 	integer_t flags; /* various flags (see below) */ | ||
| 99 | 	integer_t suspend_count; /* suspend count for thread */ | ||
| 100 | 	integer_t sleep_time; /* number of seconds that thread | ||
| 101 | 	 * has been sleeping */ | ||
| 102 | }; | ||
| 103 | |||
| 104 | typedef struct thread_basic_info thread_basic_info_data_t; | ||
| 105 | typedef struct thread_basic_info *thread_basic_info_t; | ||
| 106 | #define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 107 | 	 (sizeof(thread_basic_info_data_t) / sizeof(natural_t))) | ||
| 108 | |||
| 109 | #define THREAD_IDENTIFIER_INFO 4 /* thread id and other information */ | ||
| 110 | |||
| 111 | struct thread_identifier_info { | ||
| 112 | 	uint64_t thread_id; /* system-wide unique 64-bit thread id */ | ||
| 113 | 	uint64_t thread_handle; /* handle to be used by libproc */ | ||
| 114 | 	uint64_t dispatch_qaddr; /* libdispatch queue address */ | ||
| 115 | }; | ||
| 116 | |||
| 117 | typedef struct thread_identifier_info thread_identifier_info_data_t; | ||
| 118 | typedef struct thread_identifier_info *thread_identifier_info_t; | ||
| 119 | #define THREAD_IDENTIFIER_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 120 | 	 (sizeof(thread_identifier_info_data_t) / sizeof(natural_t))) | ||
| 121 | |||
| 122 | /* | ||
| 123 | *	Scale factor for usage field. | ||
| 124 | */ | ||
| 125 | |||
| 126 | #define TH_USAGE_SCALE 1000 | ||
| 127 | |||
| 128 | /* | ||
| 129 | *	Thread run states (state field). | ||
| 130 | */ | ||
| 131 | |||
| 132 | #define TH_STATE_RUNNING 1 /* thread is running normally */ | ||
| 133 | #define TH_STATE_STOPPED 2 /* thread is stopped */ | ||
| 134 | #define TH_STATE_WAITING 3 /* thread is waiting normally */ | ||
| 135 | #define TH_STATE_UNINTERRUPTIBLE 4 /* thread is in an uninterruptible | ||
| 136 | 	 * wait */ | ||
| 137 | #define TH_STATE_HALTED 5 /* thread is halted at a | ||
| 138 | 	 * clean point */ | ||
| 139 | |||
| 140 | /* | ||
| 141 | *	Thread flags (flags field). | ||
| 142 | */ | ||
| 143 | #define TH_FLAGS_SWAPPED 0x1 /* thread is swapped out */ | ||
| 144 | #define TH_FLAGS_IDLE 0x2 /* thread is an idle thread */ | ||
| 145 | #define TH_FLAGS_GLOBAL_FORCED_IDLE 0x4 /* thread performs global forced idle */ | ||
| 146 | |||
| 147 | /* | ||
| 148 | * Thread extended info (returns same info as proc_pidinfo(...,PROC_PIDTHREADINFO,...) | ||
| 149 | */ | ||
| 150 | #define THREAD_EXTENDED_INFO 5 | ||
| 151 | #define MAXTHREADNAMESIZE 64 | ||
| 152 | struct thread_extended_info { // same as proc_threadinfo (from proc_info.h) & proc_threadinfo_internal (from bsd_taskinfo.h) | ||
| 153 | 	uint64_t pth_user_time; /* user run time */ | ||
| 154 | 	uint64_t pth_system_time; /* system run time */ | ||
| 155 | 	int32_t pth_cpu_usage; /* scaled cpu usage percentage */ | ||
| 156 | 	int32_t pth_policy; /* scheduling policy in effect */ | ||
| 157 | 	int32_t pth_run_state; /* run state (see below) */ | ||
| 158 | 	int32_t pth_flags; /* various flags (see below) */ | ||
| 159 | 	int32_t pth_sleep_time; /* number of seconds that thread */ | ||
| 160 | 	int32_t pth_curpri; /* cur priority*/ | ||
| 161 | 	int32_t pth_priority; /* priority*/ | ||
| 162 | 	int32_t pth_maxpriority; /* max priority*/ | ||
| 163 | 	char pth_name[MAXTHREADNAMESIZE]; /* thread name, if any */ | ||
| 164 | }; | ||
| 165 | typedef struct thread_extended_info thread_extended_info_data_t; | ||
| 166 | typedef struct thread_extended_info * thread_extended_info_t; | ||
| 167 | #define THREAD_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 168 | 	 (sizeof(thread_extended_info_data_t) / sizeof (natural_t))) | ||
| 169 | |||
| 170 | #define THREAD_DEBUG_INFO_INTERNAL 6 /* for kernel development internal info */ | ||
| 171 | |||
| 172 | |||
| 173 | #define IO_NUM_PRIORITIES 4 | ||
| 174 | |||
| 175 | #define UPDATE_IO_STATS(info, size) \ | ||
| 176 | { \ | ||
| 177 | 	info.count++; \ | ||
| 178 | 	info.size += size; \ | ||
| 179 | } | ||
| 180 | |||
| 181 | #define UPDATE_IO_STATS_ATOMIC(info, io_size) \ | ||
| 182 | { \ | ||
| 183 | 	OSIncrementAtomic64((SInt64 *)&(info.count)); \ | ||
| 184 | 	OSAddAtomic64(io_size, (SInt64 *)&(info.size)); \ | ||
| 185 | } | ||
| 186 | |||
| 187 | struct io_stat_entry { | ||
| 188 | 	uint64_t count; | ||
| 189 | 	uint64_t size; | ||
| 190 | }; | ||
| 191 | |||
| 192 | struct io_stat_info { | ||
| 193 | 	struct io_stat_entry disk_reads; | ||
| 194 | 	struct io_stat_entry io_priority[IO_NUM_PRIORITIES]; | ||
| 195 | 	struct io_stat_entry paging; | ||
| 196 | 	struct io_stat_entry metadata; | ||
| 197 | 	struct io_stat_entry total_io; | ||
| 198 | }; | ||
| 199 | |||
| 200 | typedef struct io_stat_info *io_stat_info_t; | ||
| 201 | |||
| 202 | |||
| 203 | /* | ||
| 204 | * Obsolete interfaces. | ||
| 205 | */ | ||
| 206 | |||
| 207 | #define THREAD_SCHED_TIMESHARE_INFO 10 | ||
| 208 | #define THREAD_SCHED_RR_INFO 11 | ||
| 209 | #define THREAD_SCHED_FIFO_INFO 12 | ||
| 210 | |||
| 211 | #endif /* _MACH_THREAD_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/thread_policy.h created+266| ... | @@ -0,0 +1,266 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MACH_THREAD_POLICY_H_ | ||
| 30 | #define _MACH_THREAD_POLICY_H_ | ||
| 31 | |||
| 32 | #include <mach/mach_types.h> | ||
| 33 | |||
| 34 | /* | ||
| 35 | * These are the calls for accessing the policy parameters | ||
| 36 | * of a particular thread. | ||
| 37 | * | ||
| 38 | * The extra 'get_default' parameter to the second call is | ||
| 39 | * IN/OUT as follows: | ||
| 40 | * 1) if asserted on the way in it indicates that the default | ||
| 41 | * values should be returned, not the ones currently set, in | ||
| 42 | * this case 'get_default' will always be asserted on return; | ||
| 43 | * 2) if unasserted on the way in, the current settings are | ||
| 44 | * desired and if still unasserted on return, then the info | ||
| 45 | * returned reflects the current settings, otherwise if | ||
| 46 | * 'get_default' returns asserted, it means that there are no | ||
| 47 | * current settings due to other parameters taking precedence, | ||
| 48 | * and the default ones are being returned instead. | ||
| 49 | */ | ||
| 50 | |||
| 51 | typedef natural_t thread_policy_flavor_t; | ||
| 52 | typedef integer_t *thread_policy_t; | ||
| 53 | |||
| 54 | /* | ||
| 55 | * kern_return_t	thread_policy_set( | ||
| 56 | * thread_t					thread, | ||
| 57 | * thread_policy_flavor_t		flavor, | ||
| 58 | * thread_policy_t				policy_info, | ||
| 59 | * mach_msg_type_number_t		count); | ||
| 60 | * | ||
| 61 | * kern_return_t	thread_policy_get( | ||
| 62 | * thread_t					thread, | ||
| 63 | * thread_policy_flavor_t		flavor, | ||
| 64 | * thread_policy_t				policy_info, | ||
| 65 | * mach_msg_type_number_t		*count, | ||
| 66 | * boolean_t					*get_default); | ||
| 67 | */ | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Defined flavors. | ||
| 71 | */ | ||
| 72 | /* | ||
| 73 | * THREAD_STANDARD_POLICY: | ||
| 74 | * | ||
| 75 | * This is the standard (fair) scheduling mode, assigned to new | ||
| 76 | * threads. The thread will be given processor time in a manner | ||
| 77 | * which apportions approximately equal share to long running | ||
| 78 | * computations. | ||
| 79 | * | ||
| 80 | * Parameters: | ||
| 81 | *	[none] | ||
| 82 | */ | ||
| 83 | |||
| 84 | #define THREAD_STANDARD_POLICY 1 | ||
| 85 | |||
| 86 | struct thread_standard_policy { | ||
| 87 | 	natural_t no_data; | ||
| 88 | }; | ||
| 89 | |||
| 90 | typedef struct thread_standard_policy thread_standard_policy_data_t; | ||
| 91 | typedef struct thread_standard_policy *thread_standard_policy_t; | ||
| 92 | |||
| 93 | #define THREAD_STANDARD_POLICY_COUNT 0 | ||
| 94 | |||
| 95 | /* | ||
| 96 | * THREAD_EXTENDED_POLICY: | ||
| 97 | * | ||
| 98 | * Extended form of THREAD_STANDARD_POLICY, which supplies a | ||
| 99 | * hint indicating whether this is a long running computation. | ||
| 100 | * | ||
| 101 | * Parameters: | ||
| 102 | * | ||
| 103 | * timeshare: TRUE (the default) results in identical scheduling | ||
| 104 | * behavior as THREAD_STANDARD_POLICY. | ||
| 105 | */ | ||
| 106 | |||
| 107 | #define THREAD_EXTENDED_POLICY 1 | ||
| 108 | |||
| 109 | struct thread_extended_policy { | ||
| 110 | 	boolean_t timeshare; | ||
| 111 | }; | ||
| 112 | |||
| 113 | typedef struct thread_extended_policy thread_extended_policy_data_t; | ||
| 114 | typedef struct thread_extended_policy *thread_extended_policy_t; | ||
| 115 | |||
| 116 | #define THREAD_EXTENDED_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 117 | 	(sizeof (thread_extended_policy_data_t) / sizeof (integer_t))) | ||
| 118 | |||
| 119 | /* | ||
| 120 | * THREAD_TIME_CONSTRAINT_POLICY: | ||
| 121 | * | ||
| 122 | * This scheduling mode is for threads which have real time | ||
| 123 | * constraints on their execution. | ||
| 124 | * | ||
| 125 | * Parameters: | ||
| 126 | * | ||
| 127 | * period: This is the nominal amount of time between separate | ||
| 128 | * processing arrivals, specified in absolute time units. A | ||
| 129 | * value of 0 indicates that there is no inherent periodicity in | ||
| 130 | * the computation. | ||
| 131 | * | ||
| 132 | * computation: This is the nominal amount of computation | ||
| 133 | * time needed during a separate processing arrival, specified | ||
| 134 | * in absolute time units. | ||
| 135 | * | ||
| 136 | * constraint: This is the maximum amount of real time that | ||
| 137 | * may elapse from the start of a separate processing arrival | ||
| 138 | * to the end of computation for logically correct functioning, | ||
| 139 | * specified in absolute time units. Must be (>= computation). | ||
| 140 | * Note that latency = (constraint - computation). | ||
| 141 | * | ||
| 142 | * preemptible: This indicates that the computation may be | ||
| 143 | * interrupted, subject to the constraint specified above. | ||
| 144 | */ | ||
| 145 | |||
| 146 | #define THREAD_TIME_CONSTRAINT_POLICY 2 | ||
| 147 | |||
| 148 | struct thread_time_constraint_policy { | ||
| 149 | 	uint32_t period; | ||
| 150 | 	uint32_t computation; | ||
| 151 | 	uint32_t constraint; | ||
| 152 | 	boolean_t preemptible; | ||
| 153 | }; | ||
| 154 | |||
| 155 | typedef struct thread_time_constraint_policy \ | ||
| 156 | thread_time_constraint_policy_data_t; | ||
| 157 | typedef struct thread_time_constraint_policy \ | ||
| 158 | *thread_time_constraint_policy_t; | ||
| 159 | |||
| 160 | #define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 161 | 	(sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t))) | ||
| 162 | |||
| 163 | /* | ||
| 164 | * THREAD_PRECEDENCE_POLICY: | ||
| 165 | * | ||
| 166 | * This may be used to indicate the relative value of the | ||
| 167 | * computation compared to the other threads in the task. | ||
| 168 | * | ||
| 169 | * Parameters: | ||
| 170 | * | ||
| 171 | * importance: The importance is specified as a signed value. | ||
| 172 | */ | ||
| 173 | |||
| 174 | #define THREAD_PRECEDENCE_POLICY 3 | ||
| 175 | |||
| 176 | struct thread_precedence_policy { | ||
| 177 | 	integer_t importance; | ||
| 178 | }; | ||
| 179 | |||
| 180 | typedef struct thread_precedence_policy thread_precedence_policy_data_t; | ||
| 181 | typedef struct thread_precedence_policy *thread_precedence_policy_t; | ||
| 182 | |||
| 183 | #define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 184 | 	(sizeof (thread_precedence_policy_data_t) / sizeof (integer_t))) | ||
| 185 | |||
| 186 | /* | ||
| 187 | * THREAD_AFFINITY_POLICY: | ||
| 188 | * | ||
| 189 | * This policy is experimental. | ||
| 190 | * This may be used to express affinity relationships | ||
| 191 | * between threads in the task. Threads with the same affinity tag will | ||
| 192 | * be scheduled to share an L2 cache if possible. That is, affinity tags | ||
| 193 | * are a hint to the scheduler for thread placement. | ||
| 194 | * | ||
| 195 | * The namespace of affinity tags is generally local to one task. However, | ||
| 196 | * a child task created after the assignment of affinity tags by its parent | ||
| 197 | * will share that namespace. In particular, a family of forked processes | ||
| 198 | * may be created with a shared affinity namespace. | ||
| 199 | * | ||
| 200 | * Parameters: | ||
| 201 | * tag: The affinity set identifier. | ||
| 202 | */ | ||
| 203 | |||
| 204 | #define THREAD_AFFINITY_POLICY 4 | ||
| 205 | |||
| 206 | struct thread_affinity_policy { | ||
| 207 | 	integer_t affinity_tag; | ||
| 208 | }; | ||
| 209 | |||
| 210 | #define THREAD_AFFINITY_TAG_NULL 0 | ||
| 211 | |||
| 212 | typedef struct thread_affinity_policy thread_affinity_policy_data_t; | ||
| 213 | typedef struct thread_affinity_policy *thread_affinity_policy_t; | ||
| 214 | |||
| 215 | #define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 216 | 	(sizeof (thread_affinity_policy_data_t) / sizeof (integer_t))) | ||
| 217 | |||
| 218 | /* | ||
| 219 | * THREAD_BACKGROUND_POLICY: | ||
| 220 | */ | ||
| 221 | |||
| 222 | #define THREAD_BACKGROUND_POLICY 5 | ||
| 223 | |||
| 224 | struct thread_background_policy { | ||
| 225 | 	integer_t priority; | ||
| 226 | }; | ||
| 227 | |||
| 228 | #define THREAD_BACKGROUND_POLICY_DARWIN_BG 0x1000 | ||
| 229 | |||
| 230 | typedef struct thread_background_policy thread_background_policy_data_t; | ||
| 231 | typedef struct thread_background_policy *thread_background_policy_t; | ||
| 232 | |||
| 233 | #define THREAD_BACKGROUND_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 234 | 	(sizeof (thread_background_policy_data_t) / sizeof (integer_t))) | ||
| 235 | |||
| 236 | |||
| 237 | #define THREAD_LATENCY_QOS_POLICY 7 | ||
| 238 | typedef integer_t thread_latency_qos_t; | ||
| 239 | |||
| 240 | struct thread_latency_qos_policy { | ||
| 241 | 	thread_latency_qos_t thread_latency_qos_tier; | ||
| 242 | }; | ||
| 243 | |||
| 244 | typedef struct thread_latency_qos_policy thread_latency_qos_policy_data_t; | ||
| 245 | typedef struct thread_latency_qos_policy *thread_latency_qos_policy_t; | ||
| 246 | |||
| 247 | #define THREAD_LATENCY_QOS_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 248 | 	 (sizeof (thread_latency_qos_policy_data_t) / sizeof (integer_t))) | ||
| 249 | |||
| 250 | #define THREAD_THROUGHPUT_QOS_POLICY 8 | ||
| 251 | typedef integer_t thread_throughput_qos_t; | ||
| 252 | |||
| 253 | struct thread_throughput_qos_policy { | ||
| 254 | 	thread_throughput_qos_t thread_throughput_qos_tier; | ||
| 255 | }; | ||
| 256 | |||
| 257 | typedef struct thread_throughput_qos_policy thread_throughput_qos_policy_data_t; | ||
| 258 | typedef struct thread_throughput_qos_policy *thread_throughput_qos_policy_t; | ||
| 259 | |||
| 260 | #define THREAD_THROUGHPUT_QOS_POLICY_COUNT ((mach_msg_type_number_t) \ | ||
| 261 | 	 (sizeof (thread_throughput_qos_policy_data_t) / sizeof (integer_t))) | ||
| 262 | |||
| 263 | |||
| 264 | |||
| 265 | |||
| 266 | #endif /* _MACH_THREAD_POLICY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/thread_special_ports.h created+86| ... | @@ -0,0 +1,86 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/thread_special_ports.h | ||
| 60 | * | ||
| 61 | *	Defines codes for special_purpose thread ports. These are NOT | ||
| 62 | *	port identifiers - they are only used for the thread_get_special_port | ||
| 63 | *	and thread_set_special_port routines. | ||
| 64 | * | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _MACH_THREAD_SPECIAL_PORTS_H_ | ||
| 68 | #define _MACH_THREAD_SPECIAL_PORTS_H_ | ||
| 69 | |||
| 70 | #define THREAD_KERNEL_PORT 1 /* The full thread port for thread. */ | ||
| 71 | |||
| 72 | #define THREAD_INSPECT_PORT 2 /* The inspect port for thread. */ | ||
| 73 | |||
| 74 | #define THREAD_READ_PORT 3 /* The read port for thread. */ | ||
| 75 | |||
| 76 | /* | ||
| 77 | *	Definitions for ease of use | ||
| 78 | */ | ||
| 79 | |||
| 80 | #define thread_get_kernel_port(thread, port) \ | ||
| 81 | 	 (thread_get_special_port((thread), THREAD_KERNEL_PORT, (port))) | ||
| 82 | |||
| 83 | #define thread_set_kernel_port(thread, port) \ | ||
| 84 | 	 (thread_set_special_port((thread), THREAD_KERNEL_PORT, (port))) | ||
| 85 | |||
| 86 | #endif /* _MACH_THREAD_SPECIAL_PORTS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/thread_status.h created+100| ... | @@ -0,0 +1,100 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/thread_status.h | ||
| 60 | *	Author:	Avadis Tevanian, Jr. | ||
| 61 | * | ||
| 62 | *	This file contains the structure definitions for the user-visible | ||
| 63 | *	thread state. This thread state is examined with the thread_get_state | ||
| 64 | *	kernel call and may be changed with the thread_set_state kernel call. | ||
| 65 | * | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _MACH_THREAD_STATUS_H_ | ||
| 69 | #define _MACH_THREAD_STATUS_H_ | ||
| 70 | |||
| 71 | /* | ||
| 72 | *	The actual structure that comprises the thread state is defined | ||
| 73 | *	in the machine dependent module. | ||
| 74 | */ | ||
| 75 | #include <mach/machine/vm_types.h> | ||
| 76 | #include <mach/machine/thread_status.h> | ||
| 77 | #include <mach/machine/thread_state.h> | ||
| 78 | |||
| 79 | /* | ||
| 80 | *	Generic definition for machine-dependent thread status. | ||
| 81 | */ | ||
| 82 | |||
| 83 | typedef natural_t *thread_state_t; /* Variable-length array */ | ||
| 84 | |||
| 85 | /* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */ | ||
| 86 | typedef natural_t thread_state_data_t[THREAD_STATE_MAX]; | ||
| 87 | |||
| 88 | #define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */ | ||
| 89 | #define THREAD_STATE_FLAVOR_LIST_NEW 128 | ||
| 90 | #define THREAD_STATE_FLAVOR_LIST_10_9 129 | ||
| 91 | #define THREAD_STATE_FLAVOR_LIST_10_13 130 | ||
| 92 | #define THREAD_STATE_FLAVOR_LIST_10_15 131 | ||
| 93 | |||
| 94 | typedef int thread_state_flavor_t; | ||
| 95 | typedef thread_state_flavor_t *thread_state_flavor_array_t; | ||
| 96 | |||
| 97 | #define THREAD_CONVERT_THREAD_STATE_TO_SELF 1 | ||
| 98 | #define THREAD_CONVERT_THREAD_STATE_FROM_SELF 2 | ||
| 99 | |||
| 100 | #endif /* _MACH_THREAD_STATUS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/thread_switch.h created+77| ... | @@ -0,0 +1,77 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_THREAD_SWITCH_H_ | ||
| 60 | #define _MACH_THREAD_SWITCH_H_ | ||
| 61 | |||
| 62 | #include <mach/mach_types.h> | ||
| 63 | #include <mach/kern_return.h> | ||
| 64 | #include <mach/message.h> | ||
| 65 | #include <mach/mach_traps.h> | ||
| 66 | |||
| 67 | /* | ||
| 68 | *	Constant definitions for thread_switch trap. | ||
| 69 | */ | ||
| 70 | |||
| 71 | #define SWITCH_OPTION_NONE 0 | ||
| 72 | #define SWITCH_OPTION_DEPRESS 1 | ||
| 73 | #define SWITCH_OPTION_WAIT 2 | ||
| 74 | |||
| 75 | #define valid_switch_option(opt) (0 <= (opt) && (opt) <= 5) | ||
| 76 | |||
| 77 | #endif /* _MACH_THREAD_SWITCH_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/time_value.h created+96| ... | @@ -0,0 +1,96 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | |||
| 57 | #ifndef _MACH_TIME_VALUE_H_ | ||
| 58 | #define _MACH_TIME_VALUE_H_ | ||
| 59 | |||
| 60 | #include <mach/machine/vm_types.h> | ||
| 61 | |||
| 62 | /* | ||
| 63 | *	Time value returned by kernel. | ||
| 64 | */ | ||
| 65 | |||
| 66 | struct time_value { | ||
| 67 | 	integer_t seconds; | ||
| 68 | 	integer_t microseconds; | ||
| 69 | }; | ||
| 70 | |||
| 71 | typedef struct time_value time_value_t; | ||
| 72 | |||
| 73 | /* | ||
| 74 | *	Macros to manipulate time values. Assume that time values | ||
| 75 | *	are normalized (microseconds <= 999999). | ||
| 76 | */ | ||
| 77 | #define TIME_MICROS_MAX (1000000) | ||
| 78 | |||
| 79 | #define time_value_add_usec(val, micros) { \ | ||
| 80 | 	if (((val)->microseconds += (micros)) \ | ||
| 81 | 	 >= TIME_MICROS_MAX) { \ | ||
| 82 | 	 (val)->microseconds -= TIME_MICROS_MAX; \ | ||
| 83 | 	 (val)->seconds++; \ | ||
| 84 | 	} \ | ||
| 85 | } | ||
| 86 | |||
| 87 | #define time_value_add(result, addend) { \ | ||
| 88 | 	(result)->microseconds += (addend)->microseconds; \ | ||
| 89 | 	(result)->seconds += (addend)->seconds; \ | ||
| 90 | 	if ((result)->microseconds >= TIME_MICROS_MAX) { \ | ||
| 91 | 	 (result)->microseconds -= TIME_MICROS_MAX; \ | ||
| 92 | 	 (result)->seconds++; \ | ||
| 93 | 	} \ | ||
| 94 | } | ||
| 95 | |||
| 96 | #endif /* _MACH_TIME_VALUE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_attributes.h created+99| ... | @@ -0,0 +1,99 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/vm_attributes.h | ||
| 60 | *	Author:	Alessandro Forin | ||
| 61 | * | ||
| 62 | *	Virtual memory attributes definitions. | ||
| 63 | * | ||
| 64 | *	These definitions are in addition to the machine-independent | ||
| 65 | *	ones (e.g. protection), and are only selectively supported | ||
| 66 | *	on specific machine architectures. | ||
| 67 | * | ||
| 68 | */ | ||
| 69 | |||
| 70 | #ifndef _MACH_VM_ATTRIBUTES_H_ | ||
| 71 | #define _MACH_VM_ATTRIBUTES_H_ | ||
| 72 | |||
| 73 | /* | ||
| 74 | *	Types of machine-dependent attributes | ||
| 75 | */ | ||
| 76 | typedef unsigned int vm_machine_attribute_t; | ||
| 77 | |||
| 78 | #define MATTR_CACHE 1 /* cachability */ | ||
| 79 | #define MATTR_MIGRATE 2 /* migrability */ | ||
| 80 | #define MATTR_REPLICATE 4 /* replicability */ | ||
| 81 | |||
| 82 | /* | ||
| 83 | *	Values for the above, e.g. operations on attribute | ||
| 84 | */ | ||
| 85 | typedef int vm_machine_attribute_val_t; | ||
| 86 | |||
| 87 | #define MATTR_VAL_OFF 0 /* (generic) turn attribute off */ | ||
| 88 | #define MATTR_VAL_ON 1 /* (generic) turn attribute on */ | ||
| 89 | #define MATTR_VAL_GET 2 /* (generic) return current value */ | ||
| 90 | |||
| 91 | #define MATTR_VAL_CACHE_FLUSH 6 /* flush from all caches */ | ||
| 92 | #define MATTR_VAL_DCACHE_FLUSH 7 /* flush from data caches */ | ||
| 93 | #define MATTR_VAL_ICACHE_FLUSH 8 /* flush from instruction caches */ | ||
| 94 | #define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */ | ||
| 95 | #define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */ | ||
| 96 | |||
| 97 | #define MATTR_VAL_GET_INFO 10 /* get page info (stats) */ | ||
| 98 | |||
| 99 | #endif /* _MACH_VM_ATTRIBUTES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_behavior.h created+79| ... | @@ -0,0 +1,79 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | *	File:	mach/vm_behavior.h | ||
| 33 | * | ||
| 34 | *	Virtual memory map behavior definitions. | ||
| 35 | * | ||
| 36 | */ | ||
| 37 | |||
| 38 | #ifndef _MACH_VM_BEHAVIOR_H_ | ||
| 39 | #define _MACH_VM_BEHAVIOR_H_ | ||
| 40 | |||
| 41 | /* | ||
| 42 | *	Types defined: | ||
| 43 | * | ||
| 44 | *	vm_behavior_t	behavior codes. | ||
| 45 | */ | ||
| 46 | |||
| 47 | typedef int vm_behavior_t; | ||
| 48 | |||
| 49 | /* | ||
| 50 | *	Enumeration of valid values for vm_behavior_t. | ||
| 51 | *	These describe expected page reference behavior for | ||
| 52 | *	for a given range of virtual memory. For implementation | ||
| 53 | *	details see vm/vm_fault.c | ||
| 54 | */ | ||
| 55 | |||
| 56 | |||
| 57 | /* | ||
| 58 | * The following behaviors affect the memory region's future behavior | ||
| 59 | * and are stored in the VM map entry data structure. | ||
| 60 | */ | ||
| 61 | #define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0) /* default */ | ||
| 62 | #define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1) /* random */ | ||
| 63 | #define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2) /* forward sequential */ | ||
| 64 | #define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3) /* reverse sequential */ | ||
| 65 | |||
| 66 | /* | ||
| 67 | * The following "behaviors" affect the memory region only at the time of the | ||
| 68 | * call and are not stored in the VM map entry. | ||
| 69 | */ | ||
| 70 | #define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4) /* will need in near future */ | ||
| 71 | #define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5) /* dont need in near future */ | ||
| 72 | #define VM_BEHAVIOR_FREE ((vm_behavior_t) 6) /* free memory without write-back */ | ||
| 73 | #define VM_BEHAVIOR_ZERO_WIRED_PAGES ((vm_behavior_t) 7) /* zero out the wired pages of an entry if it is being deleted without unwiring them first */ | ||
| 74 | #define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8) | ||
| 75 | #define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9) | ||
| 76 | #define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10) | ||
| 77 | #define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11) | ||
| 78 | |||
| 79 | #endif /*_MACH_VM_BEHAVIOR_H_*/ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_inherit.h created+89| ... | @@ -0,0 +1,89 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/vm_inherit.h | ||
| 60 | *	Author:	Avadis Tevanian, Jr., Michael Wayne Young | ||
| 61 | * | ||
| 62 | *	Virtual memory map inheritance definitions. | ||
| 63 | * | ||
| 64 | */ | ||
| 65 | |||
| 66 | #ifndef _MACH_VM_INHERIT_H_ | ||
| 67 | #define _MACH_VM_INHERIT_H_ | ||
| 68 | |||
| 69 | /* | ||
| 70 | *	Types defined: | ||
| 71 | * | ||
| 72 | *	vm_inherit_t	inheritance codes. | ||
| 73 | */ | ||
| 74 | |||
| 75 | typedef unsigned int vm_inherit_t; /* might want to change this */ | ||
| 76 | |||
| 77 | /* | ||
| 78 | *	Enumeration of valid values for vm_inherit_t. | ||
| 79 | */ | ||
| 80 | |||
| 81 | #define VM_INHERIT_SHARE ((vm_inherit_t) 0) /* share with child */ | ||
| 82 | #define VM_INHERIT_COPY ((vm_inherit_t) 1) /* copy into child */ | ||
| 83 | #define VM_INHERIT_NONE ((vm_inherit_t) 2) /* absent from child */ | ||
| 84 | #define VM_INHERIT_DONATE_COPY ((vm_inherit_t) 3) /* copy and delete */ | ||
| 85 | |||
| 86 | #define VM_INHERIT_DEFAULT VM_INHERIT_COPY | ||
| 87 | #define VM_INHERIT_LAST_VALID VM_INHERIT_NONE | ||
| 88 | |||
| 89 | #endif /* _MACH_VM_INHERIT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_map.h created+1440| ... | @@ -0,0 +1,1440 @@ | ||
| 1 | #ifndef	_vm_map_user_ | ||
| 2 | #define	_vm_map_user_ | ||
| 3 | |||
| 4 | /* Module vm_map */ | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | #include <mach/ndr.h> | ||
| 8 | #include <mach/boolean.h> | ||
| 9 | #include <mach/kern_return.h> | ||
| 10 | #include <mach/notify.h> | ||
| 11 | #include <mach/mach_types.h> | ||
| 12 | #include <mach/message.h> | ||
| 13 | #include <mach/mig_errors.h> | ||
| 14 | #include <mach/port.h> | ||
| 15 | 	 | ||
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ | ||
| 17 | |||
| 18 | #if defined(__has_include) | ||
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) | ||
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL | ||
| 21 | #define USING_MIG_STRNCPY_ZEROFILL | ||
| 22 | #endif | ||
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ | ||
| 25 | #ifdef __cplusplus | ||
| 26 | extern "C" { | ||
| 27 | #endif | ||
| 28 | 	extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); | ||
| 29 | #ifdef __cplusplus | ||
| 30 | } | ||
| 31 | #endif | ||
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ | ||
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ | ||
| 34 | #endif /* __has_include */ | ||
| 35 | 	 | ||
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ | ||
| 37 | |||
| 38 | |||
| 39 | #ifdef AUTOTEST | ||
| 40 | #ifndef FUNCTION_PTR_T | ||
| 41 | #define FUNCTION_PTR_T | ||
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); | ||
| 43 | typedef struct { | ||
| 44 | char *name; | ||
| 45 | function_ptr_t function; | ||
| 46 | } function_table_entry; | ||
| 47 | typedef function_table_entry *function_table_t; | ||
| 48 | #endif /* FUNCTION_PTR_T */ | ||
| 49 | #endif /* AUTOTEST */ | ||
| 50 | |||
| 51 | #ifndef	vm_map_MSG_COUNT | ||
| 52 | #define	vm_map_MSG_COUNT	32 | ||
| 53 | #endif	/* vm_map_MSG_COUNT */ | ||
| 54 | |||
| 55 | #include <mach/std_types.h> | ||
| 56 | #include <mach/mig.h> | ||
| 57 | #include <mach/mig.h> | ||
| 58 | #include <mach/mach_types.h> | ||
| 59 | #include <mach_debug/mach_debug_types.h> | ||
| 60 | |||
| 61 | #ifdef __BeforeMigUserHeader | ||
| 62 | __BeforeMigUserHeader | ||
| 63 | #endif /* __BeforeMigUserHeader */ | ||
| 64 | |||
| 65 | #include <sys/cdefs.h> | ||
| 66 | __BEGIN_DECLS | ||
| 67 | |||
| 68 | |||
| 69 | /* Routine vm_region */ | ||
| 70 | #ifdef	mig_external | ||
| 71 | mig_external | ||
| 72 | #else | ||
| 73 | extern | ||
| 74 | #endif	/* mig_external */ | ||
| 75 | kern_return_t vm_region | ||
| 76 | ( | ||
| 77 | 	vm_map_t target_task, | ||
| 78 | 	vm_address_t *address, | ||
| 79 | 	vm_size_t *size, | ||
| 80 | 	vm_region_flavor_t flavor, | ||
| 81 | 	vm_region_info_t info, | ||
| 82 | 	mach_msg_type_number_t *infoCnt, | ||
| 83 | 	mach_port_t *object_name | ||
| 84 | ); | ||
| 85 | |||
| 86 | /* Routine vm_allocate */ | ||
| 87 | #ifdef	mig_external | ||
| 88 | mig_external | ||
| 89 | #else | ||
| 90 | extern | ||
| 91 | #endif	/* mig_external */ | ||
| 92 | kern_return_t vm_allocate | ||
| 93 | ( | ||
| 94 | 	vm_map_t target_task, | ||
| 95 | 	vm_address_t *address, | ||
| 96 | 	vm_size_t size, | ||
| 97 | 	int flags | ||
| 98 | ); | ||
| 99 | |||
| 100 | /* Routine vm_deallocate */ | ||
| 101 | #ifdef	mig_external | ||
| 102 | mig_external | ||
| 103 | #else | ||
| 104 | extern | ||
| 105 | #endif	/* mig_external */ | ||
| 106 | kern_return_t vm_deallocate | ||
| 107 | ( | ||
| 108 | 	vm_map_t target_task, | ||
| 109 | 	vm_address_t address, | ||
| 110 | 	vm_size_t size | ||
| 111 | ); | ||
| 112 | |||
| 113 | /* Routine vm_protect */ | ||
| 114 | #ifdef	mig_external | ||
| 115 | mig_external | ||
| 116 | #else | ||
| 117 | extern | ||
| 118 | #endif	/* mig_external */ | ||
| 119 | kern_return_t vm_protect | ||
| 120 | ( | ||
| 121 | 	vm_map_t target_task, | ||
| 122 | 	vm_address_t address, | ||
| 123 | 	vm_size_t size, | ||
| 124 | 	boolean_t set_maximum, | ||
| 125 | 	vm_prot_t new_protection | ||
| 126 | ); | ||
| 127 | |||
| 128 | /* Routine vm_inherit */ | ||
| 129 | #ifdef	mig_external | ||
| 130 | mig_external | ||
| 131 | #else | ||
| 132 | extern | ||
| 133 | #endif	/* mig_external */ | ||
| 134 | kern_return_t vm_inherit | ||
| 135 | ( | ||
| 136 | 	vm_map_t target_task, | ||
| 137 | 	vm_address_t address, | ||
| 138 | 	vm_size_t size, | ||
| 139 | 	vm_inherit_t new_inheritance | ||
| 140 | ); | ||
| 141 | |||
| 142 | /* Routine vm_read */ | ||
| 143 | #ifdef	mig_external | ||
| 144 | mig_external | ||
| 145 | #else | ||
| 146 | extern | ||
| 147 | #endif	/* mig_external */ | ||
| 148 | kern_return_t vm_read | ||
| 149 | ( | ||
| 150 | 	vm_map_t target_task, | ||
| 151 | 	vm_address_t address, | ||
| 152 | 	vm_size_t size, | ||
| 153 | 	vm_offset_t *data, | ||
| 154 | 	mach_msg_type_number_t *dataCnt | ||
| 155 | ); | ||
| 156 | |||
| 157 | /* Routine vm_read_list */ | ||
| 158 | #ifdef	mig_external | ||
| 159 | mig_external | ||
| 160 | #else | ||
| 161 | extern | ||
| 162 | #endif	/* mig_external */ | ||
| 163 | kern_return_t vm_read_list | ||
| 164 | ( | ||
| 165 | 	vm_map_t target_task, | ||
| 166 | 	vm_read_entry_t data_list, | ||
| 167 | 	natural_t count | ||
| 168 | ); | ||
| 169 | |||
| 170 | /* Routine vm_write */ | ||
| 171 | #ifdef	mig_external | ||
| 172 | mig_external | ||
| 173 | #else | ||
| 174 | extern | ||
| 175 | #endif	/* mig_external */ | ||
| 176 | kern_return_t vm_write | ||
| 177 | ( | ||
| 178 | 	vm_map_t target_task, | ||
| 179 | 	vm_address_t address, | ||
| 180 | 	vm_offset_t data, | ||
| 181 | 	mach_msg_type_number_t dataCnt | ||
| 182 | ); | ||
| 183 | |||
| 184 | /* Routine vm_copy */ | ||
| 185 | #ifdef	mig_external | ||
| 186 | mig_external | ||
| 187 | #else | ||
| 188 | extern | ||
| 189 | #endif	/* mig_external */ | ||
| 190 | kern_return_t vm_copy | ||
| 191 | ( | ||
| 192 | 	vm_map_t target_task, | ||
| 193 | 	vm_address_t source_address, | ||
| 194 | 	vm_size_t size, | ||
| 195 | 	vm_address_t dest_address | ||
| 196 | ); | ||
| 197 | |||
| 198 | /* Routine vm_read_overwrite */ | ||
| 199 | #ifdef	mig_external | ||
| 200 | mig_external | ||
| 201 | #else | ||
| 202 | extern | ||
| 203 | #endif	/* mig_external */ | ||
| 204 | kern_return_t vm_read_overwrite | ||
| 205 | ( | ||
| 206 | 	vm_map_t target_task, | ||
| 207 | 	vm_address_t address, | ||
| 208 | 	vm_size_t size, | ||
| 209 | 	vm_address_t data, | ||
| 210 | 	vm_size_t *outsize | ||
| 211 | ); | ||
| 212 | |||
| 213 | /* Routine vm_msync */ | ||
| 214 | #ifdef	mig_external | ||
| 215 | mig_external | ||
| 216 | #else | ||
| 217 | extern | ||
| 218 | #endif	/* mig_external */ | ||
| 219 | kern_return_t vm_msync | ||
| 220 | ( | ||
| 221 | 	vm_map_t target_task, | ||
| 222 | 	vm_address_t address, | ||
| 223 | 	vm_size_t size, | ||
| 224 | 	vm_sync_t sync_flags | ||
| 225 | ); | ||
| 226 | |||
| 227 | /* Routine vm_behavior_set */ | ||
| 228 | #ifdef	mig_external | ||
| 229 | mig_external | ||
| 230 | #else | ||
| 231 | extern | ||
| 232 | #endif	/* mig_external */ | ||
| 233 | kern_return_t vm_behavior_set | ||
| 234 | ( | ||
| 235 | 	vm_map_t target_task, | ||
| 236 | 	vm_address_t address, | ||
| 237 | 	vm_size_t size, | ||
| 238 | 	vm_behavior_t new_behavior | ||
| 239 | ); | ||
| 240 | |||
| 241 | /* Routine vm_map */ | ||
| 242 | #ifdef	mig_external | ||
| 243 | mig_external | ||
| 244 | #else | ||
| 245 | extern | ||
| 246 | #endif	/* mig_external */ | ||
| 247 | kern_return_t vm_map | ||
| 248 | ( | ||
| 249 | 	vm_map_t target_task, | ||
| 250 | 	vm_address_t *address, | ||
| 251 | 	vm_size_t size, | ||
| 252 | 	vm_address_t mask, | ||
| 253 | 	int flags, | ||
| 254 | 	mem_entry_name_port_t object, | ||
| 255 | 	vm_offset_t offset, | ||
| 256 | 	boolean_t copy, | ||
| 257 | 	vm_prot_t cur_protection, | ||
| 258 | 	vm_prot_t max_protection, | ||
| 259 | 	vm_inherit_t inheritance | ||
| 260 | ); | ||
| 261 | |||
| 262 | /* Routine vm_machine_attribute */ | ||
| 263 | #ifdef	mig_external | ||
| 264 | mig_external | ||
| 265 | #else | ||
| 266 | extern | ||
| 267 | #endif	/* mig_external */ | ||
| 268 | kern_return_t vm_machine_attribute | ||
| 269 | ( | ||
| 270 | 	vm_map_t target_task, | ||
| 271 | 	vm_address_t address, | ||
| 272 | 	vm_size_t size, | ||
| 273 | 	vm_machine_attribute_t attribute, | ||
| 274 | 	vm_machine_attribute_val_t *value | ||
| 275 | ); | ||
| 276 | |||
| 277 | /* Routine vm_remap */ | ||
| 278 | #ifdef	mig_external | ||
| 279 | mig_external | ||
| 280 | #else | ||
| 281 | extern | ||
| 282 | #endif	/* mig_external */ | ||
| 283 | kern_return_t vm_remap | ||
| 284 | ( | ||
| 285 | 	vm_map_t target_task, | ||
| 286 | 	vm_address_t *target_address, | ||
| 287 | 	vm_size_t size, | ||
| 288 | 	vm_address_t mask, | ||
| 289 | 	int flags, | ||
| 290 | 	vm_map_t src_task, | ||
| 291 | 	vm_address_t src_address, | ||
| 292 | 	boolean_t copy, | ||
| 293 | 	vm_prot_t *cur_protection, | ||
| 294 | 	vm_prot_t *max_protection, | ||
| 295 | 	vm_inherit_t inheritance | ||
| 296 | ); | ||
| 297 | |||
| 298 | /* Routine task_wire */ | ||
| 299 | #ifdef	mig_external | ||
| 300 | mig_external | ||
| 301 | #else | ||
| 302 | extern | ||
| 303 | #endif	/* mig_external */ | ||
| 304 | __WATCHOS_PROHIBITED | ||
| 305 | __TVOS_PROHIBITED | ||
| 306 | kern_return_t task_wire | ||
| 307 | ( | ||
| 308 | 	vm_map_t target_task, | ||
| 309 | 	boolean_t must_wire | ||
| 310 | ); | ||
| 311 | |||
| 312 | /* Routine mach_make_memory_entry */ | ||
| 313 | #ifdef	mig_external | ||
| 314 | mig_external | ||
| 315 | #else | ||
| 316 | extern | ||
| 317 | #endif	/* mig_external */ | ||
| 318 | kern_return_t mach_make_memory_entry | ||
| 319 | ( | ||
| 320 | 	vm_map_t target_task, | ||
| 321 | 	vm_size_t *size, | ||
| 322 | 	vm_offset_t offset, | ||
| 323 | 	vm_prot_t permission, | ||
| 324 | 	mem_entry_name_port_t *object_handle, | ||
| 325 | 	mem_entry_name_port_t parent_entry | ||
| 326 | ); | ||
| 327 | |||
| 328 | /* Routine vm_map_page_query */ | ||
| 329 | #ifdef	mig_external | ||
| 330 | mig_external | ||
| 331 | #else | ||
| 332 | extern | ||
| 333 | #endif	/* mig_external */ | ||
| 334 | kern_return_t vm_map_page_query | ||
| 335 | ( | ||
| 336 | 	vm_map_t target_map, | ||
| 337 | 	vm_offset_t offset, | ||
| 338 | 	integer_t *disposition, | ||
| 339 | 	integer_t *ref_count | ||
| 340 | ); | ||
| 341 | |||
| 342 | /* Routine mach_vm_region_info */ | ||
| 343 | #ifdef	mig_external | ||
| 344 | mig_external | ||
| 345 | #else | ||
| 346 | extern | ||
| 347 | #endif	/* mig_external */ | ||
| 348 | kern_return_t mach_vm_region_info | ||
| 349 | ( | ||
| 350 | 	vm_map_t task, | ||
| 351 | 	vm_address_t address, | ||
| 352 | 	vm_info_region_t *region, | ||
| 353 | 	vm_info_object_array_t *objects, | ||
| 354 | 	mach_msg_type_number_t *objectsCnt | ||
| 355 | ); | ||
| 356 | |||
| 357 | /* Routine vm_mapped_pages_info */ | ||
| 358 | #ifdef	mig_external | ||
| 359 | mig_external | ||
| 360 | #else | ||
| 361 | extern | ||
| 362 | #endif	/* mig_external */ | ||
| 363 | kern_return_t vm_mapped_pages_info | ||
| 364 | ( | ||
| 365 | 	vm_map_t task, | ||
| 366 | 	page_address_array_t *pages, | ||
| 367 | 	mach_msg_type_number_t *pagesCnt | ||
| 368 | ); | ||
| 369 | |||
| 370 | /* Routine vm_region_recurse */ | ||
| 371 | #ifdef	mig_external | ||
| 372 | mig_external | ||
| 373 | #else | ||
| 374 | extern | ||
| 375 | #endif	/* mig_external */ | ||
| 376 | kern_return_t vm_region_recurse | ||
| 377 | ( | ||
| 378 | 	vm_map_t target_task, | ||
| 379 | 	vm_address_t *address, | ||
| 380 | 	vm_size_t *size, | ||
| 381 | 	natural_t *nesting_depth, | ||
| 382 | 	vm_region_recurse_info_t info, | ||
| 383 | 	mach_msg_type_number_t *infoCnt | ||
| 384 | ); | ||
| 385 | |||
| 386 | /* Routine vm_region_recurse_64 */ | ||
| 387 | #ifdef	mig_external | ||
| 388 | mig_external | ||
| 389 | #else | ||
| 390 | extern | ||
| 391 | #endif	/* mig_external */ | ||
| 392 | kern_return_t vm_region_recurse_64 | ||
| 393 | ( | ||
| 394 | 	vm_map_t target_task, | ||
| 395 | 	vm_address_t *address, | ||
| 396 | 	vm_size_t *size, | ||
| 397 | 	natural_t *nesting_depth, | ||
| 398 | 	vm_region_recurse_info_t info, | ||
| 399 | 	mach_msg_type_number_t *infoCnt | ||
| 400 | ); | ||
| 401 | |||
| 402 | /* Routine mach_vm_region_info_64 */ | ||
| 403 | #ifdef	mig_external | ||
| 404 | mig_external | ||
| 405 | #else | ||
| 406 | extern | ||
| 407 | #endif	/* mig_external */ | ||
| 408 | kern_return_t mach_vm_region_info_64 | ||
| 409 | ( | ||
| 410 | 	vm_map_t task, | ||
| 411 | 	vm_address_t address, | ||
| 412 | 	vm_info_region_64_t *region, | ||
| 413 | 	vm_info_object_array_t *objects, | ||
| 414 | 	mach_msg_type_number_t *objectsCnt | ||
| 415 | ); | ||
| 416 | |||
| 417 | /* Routine vm_region_64 */ | ||
| 418 | #ifdef	mig_external | ||
| 419 | mig_external | ||
| 420 | #else | ||
| 421 | extern | ||
| 422 | #endif	/* mig_external */ | ||
| 423 | kern_return_t vm_region_64 | ||
| 424 | ( | ||
| 425 | 	vm_map_t target_task, | ||
| 426 | 	vm_address_t *address, | ||
| 427 | 	vm_size_t *size, | ||
| 428 | 	vm_region_flavor_t flavor, | ||
| 429 | 	vm_region_info_t info, | ||
| 430 | 	mach_msg_type_number_t *infoCnt, | ||
| 431 | 	mach_port_t *object_name | ||
| 432 | ); | ||
| 433 | |||
| 434 | /* Routine mach_make_memory_entry_64 */ | ||
| 435 | #ifdef	mig_external | ||
| 436 | mig_external | ||
| 437 | #else | ||
| 438 | extern | ||
| 439 | #endif	/* mig_external */ | ||
| 440 | kern_return_t mach_make_memory_entry_64 | ||
| 441 | ( | ||
| 442 | 	vm_map_t target_task, | ||
| 443 | 	memory_object_size_t *size, | ||
| 444 | 	memory_object_offset_t offset, | ||
| 445 | 	vm_prot_t permission, | ||
| 446 | 	mach_port_t *object_handle, | ||
| 447 | 	mem_entry_name_port_t parent_entry | ||
| 448 | ); | ||
| 449 | |||
| 450 | /* Routine vm_map_64 */ | ||
| 451 | #ifdef	mig_external | ||
| 452 | mig_external | ||
| 453 | #else | ||
| 454 | extern | ||
| 455 | #endif	/* mig_external */ | ||
| 456 | kern_return_t vm_map_64 | ||
| 457 | ( | ||
| 458 | 	vm_map_t target_task, | ||
| 459 | 	vm_address_t *address, | ||
| 460 | 	vm_size_t size, | ||
| 461 | 	vm_address_t mask, | ||
| 462 | 	int flags, | ||
| 463 | 	mem_entry_name_port_t object, | ||
| 464 | 	memory_object_offset_t offset, | ||
| 465 | 	boolean_t copy, | ||
| 466 | 	vm_prot_t cur_protection, | ||
| 467 | 	vm_prot_t max_protection, | ||
| 468 | 	vm_inherit_t inheritance | ||
| 469 | ); | ||
| 470 | |||
| 471 | /* Routine vm_purgable_control */ | ||
| 472 | #ifdef	mig_external | ||
| 473 | mig_external | ||
| 474 | #else | ||
| 475 | extern | ||
| 476 | #endif	/* mig_external */ | ||
| 477 | kern_return_t vm_purgable_control | ||
| 478 | ( | ||
| 479 | 	vm_map_t target_task, | ||
| 480 | 	vm_address_t address, | ||
| 481 | 	vm_purgable_t control, | ||
| 482 | 	int *state | ||
| 483 | ); | ||
| 484 | |||
| 485 | /* Routine vm_map_exec_lockdown */ | ||
| 486 | #ifdef	mig_external | ||
| 487 | mig_external | ||
| 488 | #else | ||
| 489 | extern | ||
| 490 | #endif	/* mig_external */ | ||
| 491 | kern_return_t vm_map_exec_lockdown | ||
| 492 | ( | ||
| 493 | 	vm_map_t target_task | ||
| 494 | ); | ||
| 495 | |||
| 496 | __END_DECLS | ||
| 497 | |||
| 498 | /********************** Caution **************************/ | ||
| 499 | /* The following data types should be used to calculate */ | ||
| 500 | /* maximum message sizes only. The actual message may be */ | ||
| 501 | /* smaller, and the position of the arguments within the */ | ||
| 502 | /* message layout may vary from what is presented here. */ | ||
| 503 | /* For example, if any of the arguments are variable- */ | ||
| 504 | /* sized, and less than the maximum is sent, the data */ | ||
| 505 | /* will be packed tight in the actual message to reduce */ | ||
| 506 | /* the presence of holes. */ | ||
| 507 | /********************** Caution **************************/ | ||
| 508 | |||
| 509 | /* typedefs for all requests */ | ||
| 510 | |||
| 511 | #ifndef __Request__vm_map_subsystem__defined | ||
| 512 | #define __Request__vm_map_subsystem__defined | ||
| 513 | |||
| 514 | #ifdef __MigPackStructs | ||
| 515 | #pragma pack(push, 4) | ||
| 516 | #endif | ||
| 517 | 	typedef struct { | ||
| 518 | 		mach_msg_header_t Head; | ||
| 519 | 		NDR_record_t NDR; | ||
| 520 | 		vm_address_t address; | ||
| 521 | 		vm_region_flavor_t flavor; | ||
| 522 | 		mach_msg_type_number_t infoCnt; | ||
| 523 | 	} __Request__vm_region_t __attribute__((unused)); | ||
| 524 | #ifdef __MigPackStructs | ||
| 525 | #pragma pack(pop) | ||
| 526 | #endif | ||
| 527 | |||
| 528 | #ifdef __MigPackStructs | ||
| 529 | #pragma pack(push, 4) | ||
| 530 | #endif | ||
| 531 | 	typedef struct { | ||
| 532 | 		mach_msg_header_t Head; | ||
| 533 | 		NDR_record_t NDR; | ||
| 534 | 		vm_address_t address; | ||
| 535 | 		vm_size_t size; | ||
| 536 | 		int flags; | ||
| 537 | 	} __Request__vm_allocate_t __attribute__((unused)); | ||
| 538 | #ifdef __MigPackStructs | ||
| 539 | #pragma pack(pop) | ||
| 540 | #endif | ||
| 541 | |||
| 542 | #ifdef __MigPackStructs | ||
| 543 | #pragma pack(push, 4) | ||
| 544 | #endif | ||
| 545 | 	typedef struct { | ||
| 546 | 		mach_msg_header_t Head; | ||
| 547 | 		NDR_record_t NDR; | ||
| 548 | 		vm_address_t address; | ||
| 549 | 		vm_size_t size; | ||
| 550 | 	} __Request__vm_deallocate_t __attribute__((unused)); | ||
| 551 | #ifdef __MigPackStructs | ||
| 552 | #pragma pack(pop) | ||
| 553 | #endif | ||
| 554 | |||
| 555 | #ifdef __MigPackStructs | ||
| 556 | #pragma pack(push, 4) | ||
| 557 | #endif | ||
| 558 | 	typedef struct { | ||
| 559 | 		mach_msg_header_t Head; | ||
| 560 | 		NDR_record_t NDR; | ||
| 561 | 		vm_address_t address; | ||
| 562 | 		vm_size_t size; | ||
| 563 | 		boolean_t set_maximum; | ||
| 564 | 		vm_prot_t new_protection; | ||
| 565 | 	} __Request__vm_protect_t __attribute__((unused)); | ||
| 566 | #ifdef __MigPackStructs | ||
| 567 | #pragma pack(pop) | ||
| 568 | #endif | ||
| 569 | |||
| 570 | #ifdef __MigPackStructs | ||
| 571 | #pragma pack(push, 4) | ||
| 572 | #endif | ||
| 573 | 	typedef struct { | ||
| 574 | 		mach_msg_header_t Head; | ||
| 575 | 		NDR_record_t NDR; | ||
| 576 | 		vm_address_t address; | ||
| 577 | 		vm_size_t size; | ||
| 578 | 		vm_inherit_t new_inheritance; | ||
| 579 | 	} __Request__vm_inherit_t __attribute__((unused)); | ||
| 580 | #ifdef __MigPackStructs | ||
| 581 | #pragma pack(pop) | ||
| 582 | #endif | ||
| 583 | |||
| 584 | #ifdef __MigPackStructs | ||
| 585 | #pragma pack(push, 4) | ||
| 586 | #endif | ||
| 587 | 	typedef struct { | ||
| 588 | 		mach_msg_header_t Head; | ||
| 589 | 		NDR_record_t NDR; | ||
| 590 | 		vm_address_t address; | ||
| 591 | 		vm_size_t size; | ||
| 592 | 	} __Request__vm_read_t __attribute__((unused)); | ||
| 593 | #ifdef __MigPackStructs | ||
| 594 | #pragma pack(pop) | ||
| 595 | #endif | ||
| 596 | |||
| 597 | #ifdef __MigPackStructs | ||
| 598 | #pragma pack(push, 4) | ||
| 599 | #endif | ||
| 600 | 	typedef struct { | ||
| 601 | 		mach_msg_header_t Head; | ||
| 602 | 		NDR_record_t NDR; | ||
| 603 | 		vm_read_entry_t data_list; | ||
| 604 | 		natural_t count; | ||
| 605 | 	} __Request__vm_read_list_t __attribute__((unused)); | ||
| 606 | #ifdef __MigPackStructs | ||
| 607 | #pragma pack(pop) | ||
| 608 | #endif | ||
| 609 | |||
| 610 | #ifdef __MigPackStructs | ||
| 611 | #pragma pack(push, 4) | ||
| 612 | #endif | ||
| 613 | 	typedef struct { | ||
| 614 | 		mach_msg_header_t Head; | ||
| 615 | 		/* start of the kernel processed data */ | ||
| 616 | 		mach_msg_body_t msgh_body; | ||
| 617 | 		mach_msg_ool_descriptor_t data; | ||
| 618 | 		/* end of the kernel processed data */ | ||
| 619 | 		NDR_record_t NDR; | ||
| 620 | 		vm_address_t address; | ||
| 621 | 		mach_msg_type_number_t dataCnt; | ||
| 622 | 	} __Request__vm_write_t __attribute__((unused)); | ||
| 623 | #ifdef __MigPackStructs | ||
| 624 | #pragma pack(pop) | ||
| 625 | #endif | ||
| 626 | |||
| 627 | #ifdef __MigPackStructs | ||
| 628 | #pragma pack(push, 4) | ||
| 629 | #endif | ||
| 630 | 	typedef struct { | ||
| 631 | 		mach_msg_header_t Head; | ||
| 632 | 		NDR_record_t NDR; | ||
| 633 | 		vm_address_t source_address; | ||
| 634 | 		vm_size_t size; | ||
| 635 | 		vm_address_t dest_address; | ||
| 636 | 	} __Request__vm_copy_t __attribute__((unused)); | ||
| 637 | #ifdef __MigPackStructs | ||
| 638 | #pragma pack(pop) | ||
| 639 | #endif | ||
| 640 | |||
| 641 | #ifdef __MigPackStructs | ||
| 642 | #pragma pack(push, 4) | ||
| 643 | #endif | ||
| 644 | 	typedef struct { | ||
| 645 | 		mach_msg_header_t Head; | ||
| 646 | 		NDR_record_t NDR; | ||
| 647 | 		vm_address_t address; | ||
| 648 | 		vm_size_t size; | ||
| 649 | 		vm_address_t data; | ||
| 650 | 	} __Request__vm_read_overwrite_t __attribute__((unused)); | ||
| 651 | #ifdef __MigPackStructs | ||
| 652 | #pragma pack(pop) | ||
| 653 | #endif | ||
| 654 | |||
| 655 | #ifdef __MigPackStructs | ||
| 656 | #pragma pack(push, 4) | ||
| 657 | #endif | ||
| 658 | 	typedef struct { | ||
| 659 | 		mach_msg_header_t Head; | ||
| 660 | 		NDR_record_t NDR; | ||
| 661 | 		vm_address_t address; | ||
| 662 | 		vm_size_t size; | ||
| 663 | 		vm_sync_t sync_flags; | ||
| 664 | 	} __Request__vm_msync_t __attribute__((unused)); | ||
| 665 | #ifdef __MigPackStructs | ||
| 666 | #pragma pack(pop) | ||
| 667 | #endif | ||
| 668 | |||
| 669 | #ifdef __MigPackStructs | ||
| 670 | #pragma pack(push, 4) | ||
| 671 | #endif | ||
| 672 | 	typedef struct { | ||
| 673 | 		mach_msg_header_t Head; | ||
| 674 | 		NDR_record_t NDR; | ||
| 675 | 		vm_address_t address; | ||
| 676 | 		vm_size_t size; | ||
| 677 | 		vm_behavior_t new_behavior; | ||
| 678 | 	} __Request__vm_behavior_set_t __attribute__((unused)); | ||
| 679 | #ifdef __MigPackStructs | ||
| 680 | #pragma pack(pop) | ||
| 681 | #endif | ||
| 682 | |||
| 683 | #ifdef __MigPackStructs | ||
| 684 | #pragma pack(push, 4) | ||
| 685 | #endif | ||
| 686 | 	typedef struct { | ||
| 687 | 		mach_msg_header_t Head; | ||
| 688 | 		/* start of the kernel processed data */ | ||
| 689 | 		mach_msg_body_t msgh_body; | ||
| 690 | 		mach_msg_port_descriptor_t object; | ||
| 691 | 		/* end of the kernel processed data */ | ||
| 692 | 		NDR_record_t NDR; | ||
| 693 | 		vm_address_t address; | ||
| 694 | 		vm_size_t size; | ||
| 695 | 		vm_address_t mask; | ||
| 696 | 		int flags; | ||
| 697 | 		vm_offset_t offset; | ||
| 698 | 		boolean_t copy; | ||
| 699 | 		vm_prot_t cur_protection; | ||
| 700 | 		vm_prot_t max_protection; | ||
| 701 | 		vm_inherit_t inheritance; | ||
| 702 | 	} __Request__vm_map_t __attribute__((unused)); | ||
| 703 | #ifdef __MigPackStructs | ||
| 704 | #pragma pack(pop) | ||
| 705 | #endif | ||
| 706 | |||
| 707 | #ifdef __MigPackStructs | ||
| 708 | #pragma pack(push, 4) | ||
| 709 | #endif | ||
| 710 | 	typedef struct { | ||
| 711 | 		mach_msg_header_t Head; | ||
| 712 | 		NDR_record_t NDR; | ||
| 713 | 		vm_address_t address; | ||
| 714 | 		vm_size_t size; | ||
| 715 | 		vm_machine_attribute_t attribute; | ||
| 716 | 		vm_machine_attribute_val_t value; | ||
| 717 | 	} __Request__vm_machine_attribute_t __attribute__((unused)); | ||
| 718 | #ifdef __MigPackStructs | ||
| 719 | #pragma pack(pop) | ||
| 720 | #endif | ||
| 721 | |||
| 722 | #ifdef __MigPackStructs | ||
| 723 | #pragma pack(push, 4) | ||
| 724 | #endif | ||
| 725 | 	typedef struct { | ||
| 726 | 		mach_msg_header_t Head; | ||
| 727 | 		/* start of the kernel processed data */ | ||
| 728 | 		mach_msg_body_t msgh_body; | ||
| 729 | 		mach_msg_port_descriptor_t src_task; | ||
| 730 | 		/* end of the kernel processed data */ | ||
| 731 | 		NDR_record_t NDR; | ||
| 732 | 		vm_address_t target_address; | ||
| 733 | 		vm_size_t size; | ||
| 734 | 		vm_address_t mask; | ||
| 735 | 		int flags; | ||
| 736 | 		vm_address_t src_address; | ||
| 737 | 		boolean_t copy; | ||
| 738 | 		vm_inherit_t inheritance; | ||
| 739 | 	} __Request__vm_remap_t __attribute__((unused)); | ||
| 740 | #ifdef __MigPackStructs | ||
| 741 | #pragma pack(pop) | ||
| 742 | #endif | ||
| 743 | |||
| 744 | #ifdef __MigPackStructs | ||
| 745 | #pragma pack(push, 4) | ||
| 746 | #endif | ||
| 747 | 	typedef struct { | ||
| 748 | 		mach_msg_header_t Head; | ||
| 749 | 		NDR_record_t NDR; | ||
| 750 | 		boolean_t must_wire; | ||
| 751 | 	} __Request__task_wire_t __attribute__((unused)); | ||
| 752 | #ifdef __MigPackStructs | ||
| 753 | #pragma pack(pop) | ||
| 754 | #endif | ||
| 755 | |||
| 756 | #ifdef __MigPackStructs | ||
| 757 | #pragma pack(push, 4) | ||
| 758 | #endif | ||
| 759 | 	typedef struct { | ||
| 760 | 		mach_msg_header_t Head; | ||
| 761 | 		/* start of the kernel processed data */ | ||
| 762 | 		mach_msg_body_t msgh_body; | ||
| 763 | 		mach_msg_port_descriptor_t parent_entry; | ||
| 764 | 		/* end of the kernel processed data */ | ||
| 765 | 		NDR_record_t NDR; | ||
| 766 | 		vm_size_t size; | ||
| 767 | 		vm_offset_t offset; | ||
| 768 | 		vm_prot_t permission; | ||
| 769 | 	} __Request__mach_make_memory_entry_t __attribute__((unused)); | ||
| 770 | #ifdef __MigPackStructs | ||
| 771 | #pragma pack(pop) | ||
| 772 | #endif | ||
| 773 | |||
| 774 | #ifdef __MigPackStructs | ||
| 775 | #pragma pack(push, 4) | ||
| 776 | #endif | ||
| 777 | 	typedef struct { | ||
| 778 | 		mach_msg_header_t Head; | ||
| 779 | 		NDR_record_t NDR; | ||
| 780 | 		vm_offset_t offset; | ||
| 781 | 	} __Request__vm_map_page_query_t __attribute__((unused)); | ||
| 782 | #ifdef __MigPackStructs | ||
| 783 | #pragma pack(pop) | ||
| 784 | #endif | ||
| 785 | |||
| 786 | #ifdef __MigPackStructs | ||
| 787 | #pragma pack(push, 4) | ||
| 788 | #endif | ||
| 789 | 	typedef struct { | ||
| 790 | 		mach_msg_header_t Head; | ||
| 791 | 		NDR_record_t NDR; | ||
| 792 | 		vm_address_t address; | ||
| 793 | 	} __Request__mach_vm_region_info_t __attribute__((unused)); | ||
| 794 | #ifdef __MigPackStructs | ||
| 795 | #pragma pack(pop) | ||
| 796 | #endif | ||
| 797 | |||
| 798 | #ifdef __MigPackStructs | ||
| 799 | #pragma pack(push, 4) | ||
| 800 | #endif | ||
| 801 | 	typedef struct { | ||
| 802 | 		mach_msg_header_t Head; | ||
| 803 | 	} __Request__vm_mapped_pages_info_t __attribute__((unused)); | ||
| 804 | #ifdef __MigPackStructs | ||
| 805 | #pragma pack(pop) | ||
| 806 | #endif | ||
| 807 | |||
| 808 | #ifdef __MigPackStructs | ||
| 809 | #pragma pack(push, 4) | ||
| 810 | #endif | ||
| 811 | 	typedef struct { | ||
| 812 | 		mach_msg_header_t Head; | ||
| 813 | 		NDR_record_t NDR; | ||
| 814 | 		vm_address_t address; | ||
| 815 | 		natural_t nesting_depth; | ||
| 816 | 		mach_msg_type_number_t infoCnt; | ||
| 817 | 	} __Request__vm_region_recurse_t __attribute__((unused)); | ||
| 818 | #ifdef __MigPackStructs | ||
| 819 | #pragma pack(pop) | ||
| 820 | #endif | ||
| 821 | |||
| 822 | #ifdef __MigPackStructs | ||
| 823 | #pragma pack(push, 4) | ||
| 824 | #endif | ||
| 825 | 	typedef struct { | ||
| 826 | 		mach_msg_header_t Head; | ||
| 827 | 		NDR_record_t NDR; | ||
| 828 | 		vm_address_t address; | ||
| 829 | 		natural_t nesting_depth; | ||
| 830 | 		mach_msg_type_number_t infoCnt; | ||
| 831 | 	} __Request__vm_region_recurse_64_t __attribute__((unused)); | ||
| 832 | #ifdef __MigPackStructs | ||
| 833 | #pragma pack(pop) | ||
| 834 | #endif | ||
| 835 | |||
| 836 | #ifdef __MigPackStructs | ||
| 837 | #pragma pack(push, 4) | ||
| 838 | #endif | ||
| 839 | 	typedef struct { | ||
| 840 | 		mach_msg_header_t Head; | ||
| 841 | 		NDR_record_t NDR; | ||
| 842 | 		vm_address_t address; | ||
| 843 | 	} __Request__mach_vm_region_info_64_t __attribute__((unused)); | ||
| 844 | #ifdef __MigPackStructs | ||
| 845 | #pragma pack(pop) | ||
| 846 | #endif | ||
| 847 | |||
| 848 | #ifdef __MigPackStructs | ||
| 849 | #pragma pack(push, 4) | ||
| 850 | #endif | ||
| 851 | 	typedef struct { | ||
| 852 | 		mach_msg_header_t Head; | ||
| 853 | 		NDR_record_t NDR; | ||
| 854 | 		vm_address_t address; | ||
| 855 | 		vm_region_flavor_t flavor; | ||
| 856 | 		mach_msg_type_number_t infoCnt; | ||
| 857 | 	} __Request__vm_region_64_t __attribute__((unused)); | ||
| 858 | #ifdef __MigPackStructs | ||
| 859 | #pragma pack(pop) | ||
| 860 | #endif | ||
| 861 | |||
| 862 | #ifdef __MigPackStructs | ||
| 863 | #pragma pack(push, 4) | ||
| 864 | #endif | ||
| 865 | 	typedef struct { | ||
| 866 | 		mach_msg_header_t Head; | ||
| 867 | 		/* start of the kernel processed data */ | ||
| 868 | 		mach_msg_body_t msgh_body; | ||
| 869 | 		mach_msg_port_descriptor_t parent_entry; | ||
| 870 | 		/* end of the kernel processed data */ | ||
| 871 | 		NDR_record_t NDR; | ||
| 872 | 		memory_object_size_t size; | ||
| 873 | 		memory_object_offset_t offset; | ||
| 874 | 		vm_prot_t permission; | ||
| 875 | 	} __Request__mach_make_memory_entry_64_t __attribute__((unused)); | ||
| 876 | #ifdef __MigPackStructs | ||
| 877 | #pragma pack(pop) | ||
| 878 | #endif | ||
| 879 | |||
| 880 | #ifdef __MigPackStructs | ||
| 881 | #pragma pack(push, 4) | ||
| 882 | #endif | ||
| 883 | 	typedef struct { | ||
| 884 | 		mach_msg_header_t Head; | ||
| 885 | 		/* start of the kernel processed data */ | ||
| 886 | 		mach_msg_body_t msgh_body; | ||
| 887 | 		mach_msg_port_descriptor_t object; | ||
| 888 | 		/* end of the kernel processed data */ | ||
| 889 | 		NDR_record_t NDR; | ||
| 890 | 		vm_address_t address; | ||
| 891 | 		vm_size_t size; | ||
| 892 | 		vm_address_t mask; | ||
| 893 | 		int flags; | ||
| 894 | 		memory_object_offset_t offset; | ||
| 895 | 		boolean_t copy; | ||
| 896 | 		vm_prot_t cur_protection; | ||
| 897 | 		vm_prot_t max_protection; | ||
| 898 | 		vm_inherit_t inheritance; | ||
| 899 | 	} __Request__vm_map_64_t __attribute__((unused)); | ||
| 900 | #ifdef __MigPackStructs | ||
| 901 | #pragma pack(pop) | ||
| 902 | #endif | ||
| 903 | |||
| 904 | #ifdef __MigPackStructs | ||
| 905 | #pragma pack(push, 4) | ||
| 906 | #endif | ||
| 907 | 	typedef struct { | ||
| 908 | 		mach_msg_header_t Head; | ||
| 909 | 		NDR_record_t NDR; | ||
| 910 | 		vm_address_t address; | ||
| 911 | 		vm_purgable_t control; | ||
| 912 | 		int state; | ||
| 913 | 	} __Request__vm_purgable_control_t __attribute__((unused)); | ||
| 914 | #ifdef __MigPackStructs | ||
| 915 | #pragma pack(pop) | ||
| 916 | #endif | ||
| 917 | |||
| 918 | #ifdef __MigPackStructs | ||
| 919 | #pragma pack(push, 4) | ||
| 920 | #endif | ||
| 921 | 	typedef struct { | ||
| 922 | 		mach_msg_header_t Head; | ||
| 923 | 	} __Request__vm_map_exec_lockdown_t __attribute__((unused)); | ||
| 924 | #ifdef __MigPackStructs | ||
| 925 | #pragma pack(pop) | ||
| 926 | #endif | ||
| 927 | #endif /* !__Request__vm_map_subsystem__defined */ | ||
| 928 | |||
| 929 | /* union of all requests */ | ||
| 930 | |||
| 931 | #ifndef __RequestUnion__vm_map_subsystem__defined | ||
| 932 | #define __RequestUnion__vm_map_subsystem__defined | ||
| 933 | union __RequestUnion__vm_map_subsystem { | ||
| 934 | 	__Request__vm_region_t Request_vm_region; | ||
| 935 | 	__Request__vm_allocate_t Request_vm_allocate; | ||
| 936 | 	__Request__vm_deallocate_t Request_vm_deallocate; | ||
| 937 | 	__Request__vm_protect_t Request_vm_protect; | ||
| 938 | 	__Request__vm_inherit_t Request_vm_inherit; | ||
| 939 | 	__Request__vm_read_t Request_vm_read; | ||
| 940 | 	__Request__vm_read_list_t Request_vm_read_list; | ||
| 941 | 	__Request__vm_write_t Request_vm_write; | ||
| 942 | 	__Request__vm_copy_t Request_vm_copy; | ||
| 943 | 	__Request__vm_read_overwrite_t Request_vm_read_overwrite; | ||
| 944 | 	__Request__vm_msync_t Request_vm_msync; | ||
| 945 | 	__Request__vm_behavior_set_t Request_vm_behavior_set; | ||
| 946 | 	__Request__vm_map_t Request_vm_map; | ||
| 947 | 	__Request__vm_machine_attribute_t Request_vm_machine_attribute; | ||
| 948 | 	__Request__vm_remap_t Request_vm_remap; | ||
| 949 | 	__Request__task_wire_t Request_task_wire; | ||
| 950 | 	__Request__mach_make_memory_entry_t Request_mach_make_memory_entry; | ||
| 951 | 	__Request__vm_map_page_query_t Request_vm_map_page_query; | ||
| 952 | 	__Request__mach_vm_region_info_t Request_mach_vm_region_info; | ||
| 953 | 	__Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info; | ||
| 954 | 	__Request__vm_region_recurse_t Request_vm_region_recurse; | ||
| 955 | 	__Request__vm_region_recurse_64_t Request_vm_region_recurse_64; | ||
| 956 | 	__Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64; | ||
| 957 | 	__Request__vm_region_64_t Request_vm_region_64; | ||
| 958 | 	__Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64; | ||
| 959 | 	__Request__vm_map_64_t Request_vm_map_64; | ||
| 960 | 	__Request__vm_purgable_control_t Request_vm_purgable_control; | ||
| 961 | 	__Request__vm_map_exec_lockdown_t Request_vm_map_exec_lockdown; | ||
| 962 | }; | ||
| 963 | #endif /* !__RequestUnion__vm_map_subsystem__defined */ | ||
| 964 | /* typedefs for all replies */ | ||
| 965 | |||
| 966 | #ifndef __Reply__vm_map_subsystem__defined | ||
| 967 | #define __Reply__vm_map_subsystem__defined | ||
| 968 | |||
| 969 | #ifdef __MigPackStructs | ||
| 970 | #pragma pack(push, 4) | ||
| 971 | #endif | ||
| 972 | 	typedef struct { | ||
| 973 | 		mach_msg_header_t Head; | ||
| 974 | 		/* start of the kernel processed data */ | ||
| 975 | 		mach_msg_body_t msgh_body; | ||
| 976 | 		mach_msg_port_descriptor_t object_name; | ||
| 977 | 		/* end of the kernel processed data */ | ||
| 978 | 		NDR_record_t NDR; | ||
| 979 | 		vm_address_t address; | ||
| 980 | 		vm_size_t size; | ||
| 981 | 		mach_msg_type_number_t infoCnt; | ||
| 982 | 		int info[10]; | ||
| 983 | 	} __Reply__vm_region_t __attribute__((unused)); | ||
| 984 | #ifdef __MigPackStructs | ||
| 985 | #pragma pack(pop) | ||
| 986 | #endif | ||
| 987 | |||
| 988 | #ifdef __MigPackStructs | ||
| 989 | #pragma pack(push, 4) | ||
| 990 | #endif | ||
| 991 | 	typedef struct { | ||
| 992 | 		mach_msg_header_t Head; | ||
| 993 | 		NDR_record_t NDR; | ||
| 994 | 		kern_return_t RetCode; | ||
| 995 | 		vm_address_t address; | ||
| 996 | 	} __Reply__vm_allocate_t __attribute__((unused)); | ||
| 997 | #ifdef __MigPackStructs | ||
| 998 | #pragma pack(pop) | ||
| 999 | #endif | ||
| 1000 | |||
| 1001 | #ifdef __MigPackStructs | ||
| 1002 | #pragma pack(push, 4) | ||
| 1003 | #endif | ||
| 1004 | 	typedef struct { | ||
| 1005 | 		mach_msg_header_t Head; | ||
| 1006 | 		NDR_record_t NDR; | ||
| 1007 | 		kern_return_t RetCode; | ||
| 1008 | 	} __Reply__vm_deallocate_t __attribute__((unused)); | ||
| 1009 | #ifdef __MigPackStructs | ||
| 1010 | #pragma pack(pop) | ||
| 1011 | #endif | ||
| 1012 | |||
| 1013 | #ifdef __MigPackStructs | ||
| 1014 | #pragma pack(push, 4) | ||
| 1015 | #endif | ||
| 1016 | 	typedef struct { | ||
| 1017 | 		mach_msg_header_t Head; | ||
| 1018 | 		NDR_record_t NDR; | ||
| 1019 | 		kern_return_t RetCode; | ||
| 1020 | 	} __Reply__vm_protect_t __attribute__((unused)); | ||
| 1021 | #ifdef __MigPackStructs | ||
| 1022 | #pragma pack(pop) | ||
| 1023 | #endif | ||
| 1024 | |||
| 1025 | #ifdef __MigPackStructs | ||
| 1026 | #pragma pack(push, 4) | ||
| 1027 | #endif | ||
| 1028 | 	typedef struct { | ||
| 1029 | 		mach_msg_header_t Head; | ||
| 1030 | 		NDR_record_t NDR; | ||
| 1031 | 		kern_return_t RetCode; | ||
| 1032 | 	} __Reply__vm_inherit_t __attribute__((unused)); | ||
| 1033 | #ifdef __MigPackStructs | ||
| 1034 | #pragma pack(pop) | ||
| 1035 | #endif | ||
| 1036 | |||
| 1037 | #ifdef __MigPackStructs | ||
| 1038 | #pragma pack(push, 4) | ||
| 1039 | #endif | ||
| 1040 | 	typedef struct { | ||
| 1041 | 		mach_msg_header_t Head; | ||
| 1042 | 		/* start of the kernel processed data */ | ||
| 1043 | 		mach_msg_body_t msgh_body; | ||
| 1044 | 		mach_msg_ool_descriptor_t data; | ||
| 1045 | 		/* end of the kernel processed data */ | ||
| 1046 | 		NDR_record_t NDR; | ||
| 1047 | 		mach_msg_type_number_t dataCnt; | ||
| 1048 | 	} __Reply__vm_read_t __attribute__((unused)); | ||
| 1049 | #ifdef __MigPackStructs | ||
| 1050 | #pragma pack(pop) | ||
| 1051 | #endif | ||
| 1052 | |||
| 1053 | #ifdef __MigPackStructs | ||
| 1054 | #pragma pack(push, 4) | ||
| 1055 | #endif | ||
| 1056 | 	typedef struct { | ||
| 1057 | 		mach_msg_header_t Head; | ||
| 1058 | 		NDR_record_t NDR; | ||
| 1059 | 		kern_return_t RetCode; | ||
| 1060 | 		vm_read_entry_t data_list; | ||
| 1061 | 	} __Reply__vm_read_list_t __attribute__((unused)); | ||
| 1062 | #ifdef __MigPackStructs | ||
| 1063 | #pragma pack(pop) | ||
| 1064 | #endif | ||
| 1065 | |||
| 1066 | #ifdef __MigPackStructs | ||
| 1067 | #pragma pack(push, 4) | ||
| 1068 | #endif | ||
| 1069 | 	typedef struct { | ||
| 1070 | 		mach_msg_header_t Head; | ||
| 1071 | 		NDR_record_t NDR; | ||
| 1072 | 		kern_return_t RetCode; | ||
| 1073 | 	} __Reply__vm_write_t __attribute__((unused)); | ||
| 1074 | #ifdef __MigPackStructs | ||
| 1075 | #pragma pack(pop) | ||
| 1076 | #endif | ||
| 1077 | |||
| 1078 | #ifdef __MigPackStructs | ||
| 1079 | #pragma pack(push, 4) | ||
| 1080 | #endif | ||
| 1081 | 	typedef struct { | ||
| 1082 | 		mach_msg_header_t Head; | ||
| 1083 | 		NDR_record_t NDR; | ||
| 1084 | 		kern_return_t RetCode; | ||
| 1085 | 	} __Reply__vm_copy_t __attribute__((unused)); | ||
| 1086 | #ifdef __MigPackStructs | ||
| 1087 | #pragma pack(pop) | ||
| 1088 | #endif | ||
| 1089 | |||
| 1090 | #ifdef __MigPackStructs | ||
| 1091 | #pragma pack(push, 4) | ||
| 1092 | #endif | ||
| 1093 | 	typedef struct { | ||
| 1094 | 		mach_msg_header_t Head; | ||
| 1095 | 		NDR_record_t NDR; | ||
| 1096 | 		kern_return_t RetCode; | ||
| 1097 | 		vm_size_t outsize; | ||
| 1098 | 	} __Reply__vm_read_overwrite_t __attribute__((unused)); | ||
| 1099 | #ifdef __MigPackStructs | ||
| 1100 | #pragma pack(pop) | ||
| 1101 | #endif | ||
| 1102 | |||
| 1103 | #ifdef __MigPackStructs | ||
| 1104 | #pragma pack(push, 4) | ||
| 1105 | #endif | ||
| 1106 | 	typedef struct { | ||
| 1107 | 		mach_msg_header_t Head; | ||
| 1108 | 		NDR_record_t NDR; | ||
| 1109 | 		kern_return_t RetCode; | ||
| 1110 | 	} __Reply__vm_msync_t __attribute__((unused)); | ||
| 1111 | #ifdef __MigPackStructs | ||
| 1112 | #pragma pack(pop) | ||
| 1113 | #endif | ||
| 1114 | |||
| 1115 | #ifdef __MigPackStructs | ||
| 1116 | #pragma pack(push, 4) | ||
| 1117 | #endif | ||
| 1118 | 	typedef struct { | ||
| 1119 | 		mach_msg_header_t Head; | ||
| 1120 | 		NDR_record_t NDR; | ||
| 1121 | 		kern_return_t RetCode; | ||
| 1122 | 	} __Reply__vm_behavior_set_t __attribute__((unused)); | ||
| 1123 | #ifdef __MigPackStructs | ||
| 1124 | #pragma pack(pop) | ||
| 1125 | #endif | ||
| 1126 | |||
| 1127 | #ifdef __MigPackStructs | ||
| 1128 | #pragma pack(push, 4) | ||
| 1129 | #endif | ||
| 1130 | 	typedef struct { | ||
| 1131 | 		mach_msg_header_t Head; | ||
| 1132 | 		NDR_record_t NDR; | ||
| 1133 | 		kern_return_t RetCode; | ||
| 1134 | 		vm_address_t address; | ||
| 1135 | 	} __Reply__vm_map_t __attribute__((unused)); | ||
| 1136 | #ifdef __MigPackStructs | ||
| 1137 | #pragma pack(pop) | ||
| 1138 | #endif | ||
| 1139 | |||
| 1140 | #ifdef __MigPackStructs | ||
| 1141 | #pragma pack(push, 4) | ||
| 1142 | #endif | ||
| 1143 | 	typedef struct { | ||
| 1144 | 		mach_msg_header_t Head; | ||
| 1145 | 		NDR_record_t NDR; | ||
| 1146 | 		kern_return_t RetCode; | ||
| 1147 | 		vm_machine_attribute_val_t value; | ||
| 1148 | 	} __Reply__vm_machine_attribute_t __attribute__((unused)); | ||
| 1149 | #ifdef __MigPackStructs | ||
| 1150 | #pragma pack(pop) | ||
| 1151 | #endif | ||
| 1152 | |||
| 1153 | #ifdef __MigPackStructs | ||
| 1154 | #pragma pack(push, 4) | ||
| 1155 | #endif | ||
| 1156 | 	typedef struct { | ||
| 1157 | 		mach_msg_header_t Head; | ||
| 1158 | 		NDR_record_t NDR; | ||
| 1159 | 		kern_return_t RetCode; | ||
| 1160 | 		vm_address_t target_address; | ||
| 1161 | 		vm_prot_t cur_protection; | ||
| 1162 | 		vm_prot_t max_protection; | ||
| 1163 | 	} __Reply__vm_remap_t __attribute__((unused)); | ||
| 1164 | #ifdef __MigPackStructs | ||
| 1165 | #pragma pack(pop) | ||
| 1166 | #endif | ||
| 1167 | |||
| 1168 | #ifdef __MigPackStructs | ||
| 1169 | #pragma pack(push, 4) | ||
| 1170 | #endif | ||
| 1171 | 	typedef struct { | ||
| 1172 | 		mach_msg_header_t Head; | ||
| 1173 | 		NDR_record_t NDR; | ||
| 1174 | 		kern_return_t RetCode; | ||
| 1175 | 	} __Reply__task_wire_t __attribute__((unused)); | ||
| 1176 | #ifdef __MigPackStructs | ||
| 1177 | #pragma pack(pop) | ||
| 1178 | #endif | ||
| 1179 | |||
| 1180 | #ifdef __MigPackStructs | ||
| 1181 | #pragma pack(push, 4) | ||
| 1182 | #endif | ||
| 1183 | 	typedef struct { | ||
| 1184 | 		mach_msg_header_t Head; | ||
| 1185 | 		/* start of the kernel processed data */ | ||
| 1186 | 		mach_msg_body_t msgh_body; | ||
| 1187 | 		mach_msg_port_descriptor_t object_handle; | ||
| 1188 | 		/* end of the kernel processed data */ | ||
| 1189 | 		NDR_record_t NDR; | ||
| 1190 | 		vm_size_t size; | ||
| 1191 | 	} __Reply__mach_make_memory_entry_t __attribute__((unused)); | ||
| 1192 | #ifdef __MigPackStructs | ||
| 1193 | #pragma pack(pop) | ||
| 1194 | #endif | ||
| 1195 | |||
| 1196 | #ifdef __MigPackStructs | ||
| 1197 | #pragma pack(push, 4) | ||
| 1198 | #endif | ||
| 1199 | 	typedef struct { | ||
| 1200 | 		mach_msg_header_t Head; | ||
| 1201 | 		NDR_record_t NDR; | ||
| 1202 | 		kern_return_t RetCode; | ||
| 1203 | 		integer_t disposition; | ||
| 1204 | 		integer_t ref_count; | ||
| 1205 | 	} __Reply__vm_map_page_query_t __attribute__((unused)); | ||
| 1206 | #ifdef __MigPackStructs | ||
| 1207 | #pragma pack(pop) | ||
| 1208 | #endif | ||
| 1209 | |||
| 1210 | #ifdef __MigPackStructs | ||
| 1211 | #pragma pack(push, 4) | ||
| 1212 | #endif | ||
| 1213 | 	typedef struct { | ||
| 1214 | 		mach_msg_header_t Head; | ||
| 1215 | 		/* start of the kernel processed data */ | ||
| 1216 | 		mach_msg_body_t msgh_body; | ||
| 1217 | 		mach_msg_ool_descriptor_t objects; | ||
| 1218 | 		/* end of the kernel processed data */ | ||
| 1219 | 		NDR_record_t NDR; | ||
| 1220 | 		vm_info_region_t region; | ||
| 1221 | 		mach_msg_type_number_t objectsCnt; | ||
| 1222 | 	} __Reply__mach_vm_region_info_t __attribute__((unused)); | ||
| 1223 | #ifdef __MigPackStructs | ||
| 1224 | #pragma pack(pop) | ||
| 1225 | #endif | ||
| 1226 | |||
| 1227 | #ifdef __MigPackStructs | ||
| 1228 | #pragma pack(push, 4) | ||
| 1229 | #endif | ||
| 1230 | 	typedef struct { | ||
| 1231 | 		mach_msg_header_t Head; | ||
| 1232 | 		/* start of the kernel processed data */ | ||
| 1233 | 		mach_msg_body_t msgh_body; | ||
| 1234 | 		mach_msg_ool_descriptor_t pages; | ||
| 1235 | 		/* end of the kernel processed data */ | ||
| 1236 | 		NDR_record_t NDR; | ||
| 1237 | 		mach_msg_type_number_t pagesCnt; | ||
| 1238 | 	} __Reply__vm_mapped_pages_info_t __attribute__((unused)); | ||
| 1239 | #ifdef __MigPackStructs | ||
| 1240 | #pragma pack(pop) | ||
| 1241 | #endif | ||
| 1242 | |||
| 1243 | #ifdef __MigPackStructs | ||
| 1244 | #pragma pack(push, 4) | ||
| 1245 | #endif | ||
| 1246 | 	typedef struct { | ||
| 1247 | 		mach_msg_header_t Head; | ||
| 1248 | 		NDR_record_t NDR; | ||
| 1249 | 		kern_return_t RetCode; | ||
| 1250 | 		vm_address_t address; | ||
| 1251 | 		vm_size_t size; | ||
| 1252 | 		natural_t nesting_depth; | ||
| 1253 | 		mach_msg_type_number_t infoCnt; | ||
| 1254 | 		int info[19]; | ||
| 1255 | 	} __Reply__vm_region_recurse_t __attribute__((unused)); | ||
| 1256 | #ifdef __MigPackStructs | ||
| 1257 | #pragma pack(pop) | ||
| 1258 | #endif | ||
| 1259 | |||
| 1260 | #ifdef __MigPackStructs | ||
| 1261 | #pragma pack(push, 4) | ||
| 1262 | #endif | ||
| 1263 | 	typedef struct { | ||
| 1264 | 		mach_msg_header_t Head; | ||
| 1265 | 		NDR_record_t NDR; | ||
| 1266 | 		kern_return_t RetCode; | ||
| 1267 | 		vm_address_t address; | ||
| 1268 | 		vm_size_t size; | ||
| 1269 | 		natural_t nesting_depth; | ||
| 1270 | 		mach_msg_type_number_t infoCnt; | ||
| 1271 | 		int info[19]; | ||
| 1272 | 	} __Reply__vm_region_recurse_64_t __attribute__((unused)); | ||
| 1273 | #ifdef __MigPackStructs | ||
| 1274 | #pragma pack(pop) | ||
| 1275 | #endif | ||
| 1276 | |||
| 1277 | #ifdef __MigPackStructs | ||
| 1278 | #pragma pack(push, 4) | ||
| 1279 | #endif | ||
| 1280 | 	typedef struct { | ||
| 1281 | 		mach_msg_header_t Head; | ||
| 1282 | 		/* start of the kernel processed data */ | ||
| 1283 | 		mach_msg_body_t msgh_body; | ||
| 1284 | 		mach_msg_ool_descriptor_t objects; | ||
| 1285 | 		/* end of the kernel processed data */ | ||
| 1286 | 		NDR_record_t NDR; | ||
| 1287 | 		vm_info_region_64_t region; | ||
| 1288 | 		mach_msg_type_number_t objectsCnt; | ||
| 1289 | 	} __Reply__mach_vm_region_info_64_t __attribute__((unused)); | ||
| 1290 | #ifdef __MigPackStructs | ||
| 1291 | #pragma pack(pop) | ||
| 1292 | #endif | ||
| 1293 | |||
| 1294 | #ifdef __MigPackStructs | ||
| 1295 | #pragma pack(push, 4) | ||
| 1296 | #endif | ||
| 1297 | 	typedef struct { | ||
| 1298 | 		mach_msg_header_t Head; | ||
| 1299 | 		/* start of the kernel processed data */ | ||
| 1300 | 		mach_msg_body_t msgh_body; | ||
| 1301 | 		mach_msg_port_descriptor_t object_name; | ||
| 1302 | 		/* end of the kernel processed data */ | ||
| 1303 | 		NDR_record_t NDR; | ||
| 1304 | 		vm_address_t address; | ||
| 1305 | 		vm_size_t size; | ||
| 1306 | 		mach_msg_type_number_t infoCnt; | ||
| 1307 | 		int info[10]; | ||
| 1308 | 	} __Reply__vm_region_64_t __attribute__((unused)); | ||
| 1309 | #ifdef __MigPackStructs | ||
| 1310 | #pragma pack(pop) | ||
| 1311 | #endif | ||
| 1312 | |||
| 1313 | #ifdef __MigPackStructs | ||
| 1314 | #pragma pack(push, 4) | ||
| 1315 | #endif | ||
| 1316 | 	typedef struct { | ||
| 1317 | 		mach_msg_header_t Head; | ||
| 1318 | 		/* start of the kernel processed data */ | ||
| 1319 | 		mach_msg_body_t msgh_body; | ||
| 1320 | 		mach_msg_port_descriptor_t object_handle; | ||
| 1321 | 		/* end of the kernel processed data */ | ||
| 1322 | 		NDR_record_t NDR; | ||
| 1323 | 		memory_object_size_t size; | ||
| 1324 | 	} __Reply__mach_make_memory_entry_64_t __attribute__((unused)); | ||
| 1325 | #ifdef __MigPackStructs | ||
| 1326 | #pragma pack(pop) | ||
| 1327 | #endif | ||
| 1328 | |||
| 1329 | #ifdef __MigPackStructs | ||
| 1330 | #pragma pack(push, 4) | ||
| 1331 | #endif | ||
| 1332 | 	typedef struct { | ||
| 1333 | 		mach_msg_header_t Head; | ||
| 1334 | 		NDR_record_t NDR; | ||
| 1335 | 		kern_return_t RetCode; | ||
| 1336 | 		vm_address_t address; | ||
| 1337 | 	} __Reply__vm_map_64_t __attribute__((unused)); | ||
| 1338 | #ifdef __MigPackStructs | ||
| 1339 | #pragma pack(pop) | ||
| 1340 | #endif | ||
| 1341 | |||
| 1342 | #ifdef __MigPackStructs | ||
| 1343 | #pragma pack(push, 4) | ||
| 1344 | #endif | ||
| 1345 | 	typedef struct { | ||
| 1346 | 		mach_msg_header_t Head; | ||
| 1347 | 		NDR_record_t NDR; | ||
| 1348 | 		kern_return_t RetCode; | ||
| 1349 | 		int state; | ||
| 1350 | 	} __Reply__vm_purgable_control_t __attribute__((unused)); | ||
| 1351 | #ifdef __MigPackStructs | ||
| 1352 | #pragma pack(pop) | ||
| 1353 | #endif | ||
| 1354 | |||
| 1355 | #ifdef __MigPackStructs | ||
| 1356 | #pragma pack(push, 4) | ||
| 1357 | #endif | ||
| 1358 | 	typedef struct { | ||
| 1359 | 		mach_msg_header_t Head; | ||
| 1360 | 		NDR_record_t NDR; | ||
| 1361 | 		kern_return_t RetCode; | ||
| 1362 | 	} __Reply__vm_map_exec_lockdown_t __attribute__((unused)); | ||
| 1363 | #ifdef __MigPackStructs | ||
| 1364 | #pragma pack(pop) | ||
| 1365 | #endif | ||
| 1366 | #endif /* !__Reply__vm_map_subsystem__defined */ | ||
| 1367 | |||
| 1368 | /* union of all replies */ | ||
| 1369 | |||
| 1370 | #ifndef __ReplyUnion__vm_map_subsystem__defined | ||
| 1371 | #define __ReplyUnion__vm_map_subsystem__defined | ||
| 1372 | union __ReplyUnion__vm_map_subsystem { | ||
| 1373 | 	__Reply__vm_region_t Reply_vm_region; | ||
| 1374 | 	__Reply__vm_allocate_t Reply_vm_allocate; | ||
| 1375 | 	__Reply__vm_deallocate_t Reply_vm_deallocate; | ||
| 1376 | 	__Reply__vm_protect_t Reply_vm_protect; | ||
| 1377 | 	__Reply__vm_inherit_t Reply_vm_inherit; | ||
| 1378 | 	__Reply__vm_read_t Reply_vm_read; | ||
| 1379 | 	__Reply__vm_read_list_t Reply_vm_read_list; | ||
| 1380 | 	__Reply__vm_write_t Reply_vm_write; | ||
| 1381 | 	__Reply__vm_copy_t Reply_vm_copy; | ||
| 1382 | 	__Reply__vm_read_overwrite_t Reply_vm_read_overwrite; | ||
| 1383 | 	__Reply__vm_msync_t Reply_vm_msync; | ||
| 1384 | 	__Reply__vm_behavior_set_t Reply_vm_behavior_set; | ||
| 1385 | 	__Reply__vm_map_t Reply_vm_map; | ||
| 1386 | 	__Reply__vm_machine_attribute_t Reply_vm_machine_attribute; | ||
| 1387 | 	__Reply__vm_remap_t Reply_vm_remap; | ||
| 1388 | 	__Reply__task_wire_t Reply_task_wire; | ||
| 1389 | 	__Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry; | ||
| 1390 | 	__Reply__vm_map_page_query_t Reply_vm_map_page_query; | ||
| 1391 | 	__Reply__mach_vm_region_info_t Reply_mach_vm_region_info; | ||
| 1392 | 	__Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info; | ||
| 1393 | 	__Reply__vm_region_recurse_t Reply_vm_region_recurse; | ||
| 1394 | 	__Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64; | ||
| 1395 | 	__Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64; | ||
| 1396 | 	__Reply__vm_region_64_t Reply_vm_region_64; | ||
| 1397 | 	__Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64; | ||
| 1398 | 	__Reply__vm_map_64_t Reply_vm_map_64; | ||
| 1399 | 	__Reply__vm_purgable_control_t Reply_vm_purgable_control; | ||
| 1400 | 	__Reply__vm_map_exec_lockdown_t Reply_vm_map_exec_lockdown; | ||
| 1401 | }; | ||
| 1402 | #endif /* !__RequestUnion__vm_map_subsystem__defined */ | ||
| 1403 | |||
| 1404 | #ifndef subsystem_to_name_map_vm_map | ||
| 1405 | #define subsystem_to_name_map_vm_map \ | ||
| 1406 | { "vm_region", 3800 },\ | ||
| 1407 | { "vm_allocate", 3801 },\ | ||
| 1408 | { "vm_deallocate", 3802 },\ | ||
| 1409 | { "vm_protect", 3803 },\ | ||
| 1410 | { "vm_inherit", 3804 },\ | ||
| 1411 | { "vm_read", 3805 },\ | ||
| 1412 | { "vm_read_list", 3806 },\ | ||
| 1413 | { "vm_write", 3807 },\ | ||
| 1414 | { "vm_copy", 3808 },\ | ||
| 1415 | { "vm_read_overwrite", 3809 },\ | ||
| 1416 | { "vm_msync", 3810 },\ | ||
| 1417 | { "vm_behavior_set", 3811 },\ | ||
| 1418 | { "vm_map", 3812 },\ | ||
| 1419 | { "vm_machine_attribute", 3813 },\ | ||
| 1420 | { "vm_remap", 3814 },\ | ||
| 1421 | { "task_wire", 3815 },\ | ||
| 1422 | { "mach_make_memory_entry", 3816 },\ | ||
| 1423 | { "vm_map_page_query", 3817 },\ | ||
| 1424 | { "mach_vm_region_info", 3818 },\ | ||
| 1425 | { "vm_mapped_pages_info", 3819 },\ | ||
| 1426 | { "vm_region_recurse", 3821 },\ | ||
| 1427 | { "vm_region_recurse_64", 3822 },\ | ||
| 1428 | { "mach_vm_region_info_64", 3823 },\ | ||
| 1429 | { "vm_region_64", 3824 },\ | ||
| 1430 | { "mach_make_memory_entry_64", 3825 },\ | ||
| 1431 | { "vm_map_64", 3826 },\ | ||
| 1432 | { "vm_purgable_control", 3830 },\ | ||
| 1433 | { "vm_map_exec_lockdown", 3831 } | ||
| 1434 | #endif | ||
| 1435 | |||
| 1436 | #ifdef __AfterMigUserHeader | ||
| 1437 | __AfterMigUserHeader | ||
| 1438 | #endif /* __AfterMigUserHeader */ | ||
| 1439 | |||
| 1440 | #endif	 /* _vm_map_user_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_page_size.h created+68| ... | @@ -0,0 +1,68 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _VM_PAGE_SIZE_H_ | ||
| 30 | #define _VM_PAGE_SIZE_H_ | ||
| 31 | |||
| 32 | #include <Availability.h> | ||
| 33 | #include <mach/mach_types.h> | ||
| 34 | #include <sys/cdefs.h> | ||
| 35 | |||
| 36 | __BEGIN_DECLS | ||
| 37 | |||
| 38 | /* | ||
| 39 | *	Globally interesting numbers. | ||
| 40 | *	These macros assume vm_page_size is a power-of-2. | ||
| 41 | */ | ||
| 42 | extern vm_size_t vm_page_size; | ||
| 43 | extern vm_size_t vm_page_mask; | ||
| 44 | extern int vm_page_shift; | ||
| 45 | |||
| 46 | /* | ||
| 47 | *	These macros assume vm_page_size is a power-of-2. | ||
| 48 | */ | ||
| 49 | #define trunc_page(x) ((x) & (~(vm_page_size - 1))) | ||
| 50 | #define round_page(x) trunc_page((x) + (vm_page_size - 1)) | ||
| 51 | |||
| 52 | /* | ||
| 53 | *	Page-size rounding macros for the fixed-width VM types. | ||
| 54 | */ | ||
| 55 | #define mach_vm_trunc_page(x) ((mach_vm_offset_t)(x) & ~((signed)vm_page_mask)) | ||
| 56 | #define mach_vm_round_page(x) (((mach_vm_offset_t)(x) + vm_page_mask) & ~((signed)vm_page_mask)) | ||
| 57 | |||
| 58 | |||
| 59 | extern vm_size_t vm_kernel_page_size __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); | ||
| 60 | extern vm_size_t vm_kernel_page_mask __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); | ||
| 61 | extern int vm_kernel_page_shift __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); | ||
| 62 | |||
| 63 | #define trunc_page_kernel(x) ((x) & (~vm_kernel_page_mask)) | ||
| 64 | #define round_page_kernel(x) trunc_page_kernel((x) + vm_kernel_page_mask) | ||
| 65 | |||
| 66 | __END_DECLS | ||
| 67 | |||
| 68 | #endif | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_prot.h created+153| ... | @@ -0,0 +1,153 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/vm_prot.h | ||
| 60 | *	Author:	Avadis Tevanian, Jr., Michael Wayne Young | ||
| 61 | * | ||
| 62 | *	Virtual memory protection definitions. | ||
| 63 | * | ||
| 64 | */ | ||
| 65 | |||
| 66 | #ifndef _MACH_VM_PROT_H_ | ||
| 67 | #define _MACH_VM_PROT_H_ | ||
| 68 | |||
| 69 | /* | ||
| 70 | *	Types defined: | ||
| 71 | * | ||
| 72 | *	vm_prot_t		VM protection values. | ||
| 73 | */ | ||
| 74 | |||
| 75 | typedef int vm_prot_t; | ||
| 76 | |||
| 77 | /* | ||
| 78 | *	Protection values, defined as bits within the vm_prot_t type | ||
| 79 | */ | ||
| 80 | |||
| 81 | #define VM_PROT_NONE ((vm_prot_t) 0x00) | ||
| 82 | |||
| 83 | #define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */ | ||
| 84 | #define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */ | ||
| 85 | #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */ | ||
| 86 | |||
| 87 | /* | ||
| 88 | *	The default protection for newly-created virtual memory | ||
| 89 | */ | ||
| 90 | |||
| 91 | #define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE) | ||
| 92 | |||
| 93 | /* | ||
| 94 | *	The maximum privileges possible, for parameter checking. | ||
| 95 | */ | ||
| 96 | |||
| 97 | #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) | ||
| 98 | |||
| 99 | /* | ||
| 100 | *	An invalid protection value. | ||
| 101 | *	Used only by memory_object_lock_request to indicate no change | ||
| 102 | *	to page locks. Using -1 here is a bad idea because it | ||
| 103 | *	looks like VM_PROT_ALL and then some. | ||
| 104 | */ | ||
| 105 | |||
| 106 | #define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08) | ||
| 107 | |||
| 108 | /* | ||
| 109 | * When a caller finds that he cannot obtain write permission on a | ||
| 110 | * mapped entry, the following flag can be used. The entry will | ||
| 111 | * be made "needs copy" effectively copying the object (using COW), | ||
| 112 | * and write permission will be added to the maximum protections | ||
| 113 | * for the associated entry. | ||
| 114 | */ | ||
| 115 | |||
| 116 | #define VM_PROT_COPY ((vm_prot_t) 0x10) | ||
| 117 | |||
| 118 | |||
| 119 | /* | ||
| 120 | *	Another invalid protection value. | ||
| 121 | *	Used only by memory_object_data_request upon an object | ||
| 122 | *	which has specified a copy_call copy strategy. It is used | ||
| 123 | *	when the kernel wants a page belonging to a copy of the | ||
| 124 | *	object, and is only asking the object as a result of | ||
| 125 | *	following a shadow chain. This solves the race between pages | ||
| 126 | *	being pushed up by the memory manager and the kernel | ||
| 127 | *	walking down the shadow chain. | ||
| 128 | */ | ||
| 129 | |||
| 130 | #define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10) | ||
| 131 | |||
| 132 | |||
| 133 | /* | ||
| 134 | * Another invalid protection value. | ||
| 135 | *	Indicates that the other protection bits are to be applied as a mask | ||
| 136 | *	against the actual protection bits of the map entry. | ||
| 137 | */ | ||
| 138 | #define VM_PROT_IS_MASK ((vm_prot_t) 0x40) | ||
| 139 | |||
| 140 | /* | ||
| 141 | * Another invalid protection value to support execute-only protection. | ||
| 142 | * VM_PROT_STRIP_READ is a special marker that tells mprotect to not | ||
| 143 | * set VM_PROT_READ. We have to do it this way because existing code | ||
| 144 | * expects the system to set VM_PROT_READ if VM_PROT_EXECUTE is set. | ||
| 145 | * VM_PROT_EXECUTE_ONLY is just a convenience value to indicate that | ||
| 146 | * the memory should be executable and explicitly not readable. It will | ||
| 147 | * be ignored on platforms that do not support this type of protection. | ||
| 148 | */ | ||
| 149 | #define VM_PROT_STRIP_READ ((vm_prot_t) 0x80) | ||
| 150 | #define VM_PROT_EXECUTE_ONLY (VM_PROT_EXECUTE|VM_PROT_STRIP_READ) | ||
| 151 | |||
| 152 | |||
| 153 | #endif /* _MACH_VM_PROT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_purgable.h created+162| ... | @@ -0,0 +1,162 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Virtual memory map purgeable object definitions. | ||
| 31 | * Objects that will be needed in the future (forward cached objects) should be queued LIFO. | ||
| 32 | * Objects that have been used and are cached for reuse (backward cached) should be queued FIFO. | ||
| 33 | * Every user of purgeable memory is entitled to using the highest volatile group (7). | ||
| 34 | * Only if a client wants some of its objects to definitely be purged earlier, it can put those in | ||
| 35 | * another group. This could be used to make all FIFO objects (in the lower group) go away before | ||
| 36 | * any LIFO objects (in the higher group) go away. | ||
| 37 | * Objects that should not get any chance to stay around can be marked as "obsolete". They will | ||
| 38 | * be emptied before any other objects or pages are reclaimed. Obsolete objects are not emptied | ||
| 39 | * in any particular order. | ||
| 40 | * 'purgeable' is recognized as the correct spelling. For historical reasons, definitions | ||
| 41 | * in this file are spelled 'purgable'. | ||
| 42 | */ | ||
| 43 | |||
| 44 | #ifndef _MACH_VM_PURGABLE_H_ | ||
| 45 | #define _MACH_VM_PURGABLE_H_ | ||
| 46 | |||
| 47 | /* | ||
| 48 | *	Types defined: | ||
| 49 | * | ||
| 50 | *	vm_purgable_t	purgeable object control codes. | ||
| 51 | */ | ||
| 52 | |||
| 53 | typedef int vm_purgable_t; | ||
| 54 | |||
| 55 | /* | ||
| 56 | *	Enumeration of valid values for vm_purgable_t. | ||
| 57 | */ | ||
| 58 | #define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0) /* set state of purgeable object */ | ||
| 59 | #define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1) /* get state of purgeable object */ | ||
| 60 | #define VM_PURGABLE_PURGE_ALL ((vm_purgable_t) 2) /* purge all volatile objects now */ | ||
| 61 | #define VM_PURGABLE_SET_STATE_FROM_KERNEL ((vm_purgable_t) 3) /* set state from kernel */ | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Purgeable state: | ||
| 65 | * | ||
| 66 | * 31 15 14 13 12 11 10 8 7 6 5 4 3 2 1 0 | ||
| 67 | * +-----+--+-----+--+----+-+-+---+---+---+ | ||
| 68 | * | |NA|DEBUG| | GRP| |B|ORD| |STA| | ||
| 69 | * +-----+--+-----+--+----+-+-+---+---+---+ | ||
| 70 | * " ": unused (i.e. reserved) | ||
| 71 | * STA: purgeable state | ||
| 72 | * see: VM_PURGABLE_NONVOLATILE=0 to VM_PURGABLE_DENY=3 | ||
| 73 | * ORD: order | ||
| 74 | * see:VM_VOLATILE_ORDER_* | ||
| 75 | * B: behavior | ||
| 76 | * see: VM_PURGABLE_BEHAVIOR_* | ||
| 77 | * GRP: group | ||
| 78 | * see: VM_VOLATILE_GROUP_* | ||
| 79 | * DEBUG: debug | ||
| 80 | * see: VM_PURGABLE_DEBUG_* | ||
| 81 | * NA: no aging | ||
| 82 | * see: VM_PURGABLE_NO_AGING* | ||
| 83 | */ | ||
| 84 | |||
| 85 | #define VM_PURGABLE_NO_AGING_SHIFT 16 | ||
| 86 | #define VM_PURGABLE_NO_AGING_MASK (0x1 << VM_PURGABLE_NO_AGING_SHIFT) | ||
| 87 | #define VM_PURGABLE_NO_AGING (0x1 << VM_PURGABLE_NO_AGING_SHIFT) | ||
| 88 | |||
| 89 | #define VM_PURGABLE_DEBUG_SHIFT 12 | ||
| 90 | #define VM_PURGABLE_DEBUG_MASK (0x3 << VM_PURGABLE_DEBUG_SHIFT) | ||
| 91 | #define VM_PURGABLE_DEBUG_EMPTY (0x1 << VM_PURGABLE_DEBUG_SHIFT) | ||
| 92 | #define VM_PURGABLE_DEBUG_FAULT (0x2 << VM_PURGABLE_DEBUG_SHIFT) | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Volatile memory ordering groups (group zero objects are purged before group 1, etc... | ||
| 96 | * It is implementation dependent as to whether these groups are global or per-address space. | ||
| 97 | * (for the moment, they are global). | ||
| 98 | */ | ||
| 99 | #define VM_VOLATILE_GROUP_SHIFT 8 | ||
| 100 | #define VM_VOLATILE_GROUP_MASK (7 << VM_VOLATILE_GROUP_SHIFT) | ||
| 101 | #define VM_VOLATILE_GROUP_DEFAULT VM_VOLATILE_GROUP_0 | ||
| 102 | |||
| 103 | #define VM_VOLATILE_GROUP_0 (0 << VM_VOLATILE_GROUP_SHIFT) | ||
| 104 | #define VM_VOLATILE_GROUP_1 (1 << VM_VOLATILE_GROUP_SHIFT) | ||
| 105 | #define VM_VOLATILE_GROUP_2 (2 << VM_VOLATILE_GROUP_SHIFT) | ||
| 106 | #define VM_VOLATILE_GROUP_3 (3 << VM_VOLATILE_GROUP_SHIFT) | ||
| 107 | #define VM_VOLATILE_GROUP_4 (4 << VM_VOLATILE_GROUP_SHIFT) | ||
| 108 | #define VM_VOLATILE_GROUP_5 (5 << VM_VOLATILE_GROUP_SHIFT) | ||
| 109 | #define VM_VOLATILE_GROUP_6 (6 << VM_VOLATILE_GROUP_SHIFT) | ||
| 110 | #define VM_VOLATILE_GROUP_7 (7 << VM_VOLATILE_GROUP_SHIFT) | ||
| 111 | |||
| 112 | /* | ||
| 113 | * Purgeable behavior | ||
| 114 | * Within the same group, FIFO objects will be emptied before objects that are added later. | ||
| 115 | * LIFO objects will be emptied after objects that are added later. | ||
| 116 | * - Input only, not returned on state queries. | ||
| 117 | */ | ||
| 118 | #define VM_PURGABLE_BEHAVIOR_SHIFT 6 | ||
| 119 | #define VM_PURGABLE_BEHAVIOR_MASK (1 << VM_PURGABLE_BEHAVIOR_SHIFT) | ||
| 120 | #define VM_PURGABLE_BEHAVIOR_FIFO (0 << VM_PURGABLE_BEHAVIOR_SHIFT) | ||
| 121 | #define VM_PURGABLE_BEHAVIOR_LIFO (1 << VM_PURGABLE_BEHAVIOR_SHIFT) | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Obsolete object. | ||
| 125 | * Disregard volatile group, and put object into obsolete queue instead, so it is the next object | ||
| 126 | * to be purged. | ||
| 127 | * - Input only, not returned on state queries. | ||
| 128 | */ | ||
| 129 | #define VM_PURGABLE_ORDERING_SHIFT 5 | ||
| 130 | #define VM_PURGABLE_ORDERING_MASK (1 << VM_PURGABLE_ORDERING_SHIFT) | ||
| 131 | #define VM_PURGABLE_ORDERING_OBSOLETE (1 << VM_PURGABLE_ORDERING_SHIFT) | ||
| 132 | #define VM_PURGABLE_ORDERING_NORMAL (0 << VM_PURGABLE_ORDERING_SHIFT) | ||
| 133 | |||
| 134 | |||
| 135 | /* | ||
| 136 | * Obsolete parameter - do not use | ||
| 137 | */ | ||
| 138 | #define VM_VOLATILE_ORDER_SHIFT 4 | ||
| 139 | #define VM_VOLATILE_ORDER_MASK (1 << VM_VOLATILE_ORDER_SHIFT) | ||
| 140 | #define VM_VOLATILE_MAKE_FIRST_IN_GROUP (1 << VM_VOLATILE_ORDER_SHIFT) | ||
| 141 | #define VM_VOLATILE_MAKE_LAST_IN_GROUP (0 << VM_VOLATILE_ORDER_SHIFT) | ||
| 142 | |||
| 143 | /* | ||
| 144 | * Valid states of a purgeable object. | ||
| 145 | */ | ||
| 146 | #define VM_PURGABLE_STATE_MIN 0 /* minimum purgeable object state value */ | ||
| 147 | #define VM_PURGABLE_STATE_MAX 3 /* maximum purgeable object state value */ | ||
| 148 | #define VM_PURGABLE_STATE_MASK 3 /* mask to separate state from group */ | ||
| 149 | |||
| 150 | #define VM_PURGABLE_NONVOLATILE 0 /* purgeable object is non-volatile */ | ||
| 151 | #define VM_PURGABLE_VOLATILE 1 /* purgeable object is volatile */ | ||
| 152 | #define VM_PURGABLE_EMPTY 2 /* purgeable object is volatile and empty */ | ||
| 153 | #define VM_PURGABLE_DENY 3 /* (mark) object not purgeable */ | ||
| 154 | |||
| 155 | #define VM_PURGABLE_ALL_MASKS (VM_PURGABLE_STATE_MASK | \ | ||
| 156 | 	 VM_VOLATILE_ORDER_MASK | \ | ||
| 157 | 	 VM_PURGABLE_ORDERING_MASK | \ | ||
| 158 | 	 VM_PURGABLE_BEHAVIOR_MASK | \ | ||
| 159 | 	 VM_VOLATILE_GROUP_MASK | \ | ||
| 160 | 	 VM_PURGABLE_DEBUG_MASK | \ | ||
| 161 | 	 VM_PURGABLE_NO_AGING_MASK) | ||
| 162 | #endif /* _MACH_VM_PURGABLE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_region.h created+349| ... | @@ -0,0 +1,349 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | *	File:	mach/vm_region.h | ||
| 33 | * | ||
| 34 | *	Define the attributes of a task's memory region | ||
| 35 | * | ||
| 36 | */ | ||
| 37 | |||
| 38 | #ifndef _MACH_VM_REGION_H_ | ||
| 39 | #define _MACH_VM_REGION_H_ | ||
| 40 | |||
| 41 | #include <mach/boolean.h> | ||
| 42 | #include <mach/vm_prot.h> | ||
| 43 | #include <mach/vm_inherit.h> | ||
| 44 | #include <mach/vm_behavior.h> | ||
| 45 | #include <mach/vm_types.h> | ||
| 46 | #include <mach/message.h> | ||
| 47 | #include <mach/machine/vm_param.h> | ||
| 48 | #include <mach/machine/vm_types.h> | ||
| 49 | #include <mach/memory_object_types.h> | ||
| 50 | |||
| 51 | #include <sys/cdefs.h> | ||
| 52 | |||
| 53 | #pragma pack(push, 4) | ||
| 54 | |||
| 55 | // LP64todo: all the current tools are 32bit, obviously never worked for 64b | ||
| 56 | // so probably should be a real 32b ID vs. ptr. | ||
| 57 | // Current users just check for equality | ||
| 58 | typedef uint32_t vm32_object_id_t; | ||
| 59 | |||
| 60 | /* | ||
| 61 | *	Types defined: | ||
| 62 | * | ||
| 63 | *	vm_region_info_t	memory region attributes | ||
| 64 | */ | ||
| 65 | |||
| 66 | #define VM_REGION_INFO_MAX (1024) | ||
| 67 | typedef int *vm_region_info_t; | ||
| 68 | typedef int *vm_region_info_64_t; | ||
| 69 | typedef int *vm_region_recurse_info_t; | ||
| 70 | typedef int *vm_region_recurse_info_64_t; | ||
| 71 | typedef int vm_region_flavor_t; | ||
| 72 | typedef int vm_region_info_data_t[VM_REGION_INFO_MAX]; | ||
| 73 | |||
| 74 | #define VM_REGION_BASIC_INFO_64 9 | ||
| 75 | struct vm_region_basic_info_64 { | ||
| 76 | 	vm_prot_t protection; | ||
| 77 | 	vm_prot_t max_protection; | ||
| 78 | 	vm_inherit_t inheritance; | ||
| 79 | 	boolean_t shared; | ||
| 80 | 	boolean_t reserved; | ||
| 81 | 	memory_object_offset_t offset; | ||
| 82 | 	vm_behavior_t behavior; | ||
| 83 | 	unsigned short user_wired_count; | ||
| 84 | }; | ||
| 85 | typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t; | ||
| 86 | typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t; | ||
| 87 | |||
| 88 | #define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) \ | ||
| 89 | 	(sizeof(vm_region_basic_info_data_64_t)/sizeof(int))) | ||
| 90 | |||
| 91 | /* | ||
| 92 | * Passing VM_REGION_BASIC_INFO to vm_region_64 | ||
| 93 | * automatically converts it to a VM_REGION_BASIC_INFO_64. | ||
| 94 | * Please use that explicitly instead. | ||
| 95 | */ | ||
| 96 | #define VM_REGION_BASIC_INFO 10 | ||
| 97 | |||
| 98 | /* | ||
| 99 | * This is the legacy basic info structure. It is | ||
| 100 | * deprecated because it passes only a 32-bit memory object | ||
| 101 | * offset back - too small for many larger objects (e.g. files). | ||
| 102 | */ | ||
| 103 | struct vm_region_basic_info { | ||
| 104 | 	vm_prot_t protection; | ||
| 105 | 	vm_prot_t max_protection; | ||
| 106 | 	vm_inherit_t inheritance; | ||
| 107 | 	boolean_t shared; | ||
| 108 | 	boolean_t reserved; | ||
| 109 | 	uint32_t offset; /* too small for a real offset */ | ||
| 110 | 	vm_behavior_t behavior; | ||
| 111 | 	unsigned short user_wired_count; | ||
| 112 | }; | ||
| 113 | |||
| 114 | typedef struct vm_region_basic_info *vm_region_basic_info_t; | ||
| 115 | typedef struct vm_region_basic_info vm_region_basic_info_data_t; | ||
| 116 | |||
| 117 | #define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ | ||
| 118 | 	(sizeof(vm_region_basic_info_data_t)/sizeof(int))) | ||
| 119 | |||
| 120 | #define SM_COW 1 | ||
| 121 | #define SM_PRIVATE 2 | ||
| 122 | #define SM_EMPTY 3 | ||
| 123 | #define SM_SHARED 4 | ||
| 124 | #define SM_TRUESHARED 5 | ||
| 125 | #define SM_PRIVATE_ALIASED 6 | ||
| 126 | #define SM_SHARED_ALIASED 7 | ||
| 127 | #define SM_LARGE_PAGE 8 | ||
| 128 | |||
| 129 | /* | ||
| 130 | * For submap info, the SM flags above are overlayed when a submap | ||
| 131 | * is encountered. The field denotes whether or not machine level mapping | ||
| 132 | * information is being shared. PTE's etc. When such sharing is taking | ||
| 133 | * place the value returned is SM_TRUESHARED otherwise SM_PRIVATE is passed | ||
| 134 | * back. | ||
| 135 | */ | ||
| 136 | |||
| 137 | |||
| 138 | |||
| 139 | |||
| 140 | #define VM_REGION_EXTENDED_INFO 13 | ||
| 141 | struct vm_region_extended_info { | ||
| 142 | 	vm_prot_t protection; | ||
| 143 | 	unsigned int user_tag; | ||
| 144 | 	unsigned int pages_resident; | ||
| 145 | 	unsigned int pages_shared_now_private; | ||
| 146 | 	unsigned int pages_swapped_out; | ||
| 147 | 	unsigned int pages_dirtied; | ||
| 148 | 	unsigned int ref_count; | ||
| 149 | 	unsigned short shadow_depth; | ||
| 150 | 	unsigned char external_pager; | ||
| 151 | 	unsigned char share_mode; | ||
| 152 | 	unsigned int pages_reusable; | ||
| 153 | }; | ||
| 154 | typedef struct vm_region_extended_info *vm_region_extended_info_t; | ||
| 155 | typedef struct vm_region_extended_info vm_region_extended_info_data_t; | ||
| 156 | #define VM_REGION_EXTENDED_INFO_COUNT \ | ||
| 157 | 	((mach_msg_type_number_t) \ | ||
| 158 | 	 (sizeof (vm_region_extended_info_data_t) / sizeof (natural_t))) | ||
| 159 | |||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | #define VM_REGION_TOP_INFO 12 | ||
| 164 | |||
| 165 | struct vm_region_top_info { | ||
| 166 | 	unsigned int obj_id; | ||
| 167 | 	unsigned int ref_count; | ||
| 168 | 	unsigned int private_pages_resident; | ||
| 169 | 	unsigned int shared_pages_resident; | ||
| 170 | 	unsigned char share_mode; | ||
| 171 | }; | ||
| 172 | |||
| 173 | typedef struct vm_region_top_info *vm_region_top_info_t; | ||
| 174 | typedef struct vm_region_top_info vm_region_top_info_data_t; | ||
| 175 | |||
| 176 | #define VM_REGION_TOP_INFO_COUNT \ | ||
| 177 | 	((mach_msg_type_number_t) \ | ||
| 178 | 	 (sizeof(vm_region_top_info_data_t) / sizeof(natural_t))) | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | /* | ||
| 183 | * vm_region_submap_info will return information on a submap or object. | ||
| 184 | * The user supplies a nesting level on the call. When a walk of the | ||
| 185 | * user's map is done and a submap is encountered, the nesting count is | ||
| 186 | * checked. If the nesting count is greater than 1 the submap is entered and | ||
| 187 | * the offset relative to the address in the base map is examined. If the | ||
| 188 | * nesting count is zero, the information on the submap is returned. | ||
| 189 | * The caller may thus learn about a submap and its contents by judicious | ||
| 190 | * choice of the base map address and nesting count. The nesting count | ||
| 191 | * allows penetration of recursively mapped submaps. If a submap is | ||
| 192 | * encountered as a mapped entry of another submap, the caller may bump | ||
| 193 | * the nesting count and call vm_region_recurse again on the target address | ||
| 194 | * range. The "is_submap" field tells the caller whether or not a submap | ||
| 195 | * has been encountered. | ||
| 196 | * | ||
| 197 | * Object only fields are filled in through a walking of the object shadow | ||
| 198 | * chain (where one is present), and a walking of the resident page queue. | ||
| 199 | * | ||
| 200 | */ | ||
| 201 | |||
| 202 | struct vm_region_submap_info { | ||
| 203 | 	vm_prot_t protection; /* present access protection */ | ||
| 204 | 	vm_prot_t max_protection; /* max avail through vm_prot */ | ||
| 205 | 	vm_inherit_t inheritance;/* behavior of map/obj on fork */ | ||
| 206 | 	uint32_t offset; /* offset into object/map */ | ||
| 207 | 	unsigned int user_tag; /* user tag on map entry */ | ||
| 208 | 	unsigned int pages_resident; /* only valid for objects */ | ||
| 209 | 	unsigned int pages_shared_now_private; /* only for objects */ | ||
| 210 | 	unsigned int pages_swapped_out; /* only for objects */ | ||
| 211 | 	unsigned int pages_dirtied; /* only for objects */ | ||
| 212 | 	unsigned int ref_count; /* obj/map mappers, etc */ | ||
| 213 | 	unsigned short shadow_depth; /* only for obj */ | ||
| 214 | 	unsigned char external_pager; /* only for obj */ | ||
| 215 | 	unsigned char share_mode; /* see enumeration */ | ||
| 216 | 	boolean_t is_submap; /* submap vs obj */ | ||
| 217 | 	vm_behavior_t behavior; /* access behavior hint */ | ||
| 218 | 	vm32_object_id_t object_id; /* obj/map name, not a handle */ | ||
| 219 | 	unsigned short user_wired_count; | ||
| 220 | }; | ||
| 221 | |||
| 222 | typedef struct vm_region_submap_info *vm_region_submap_info_t; | ||
| 223 | typedef struct vm_region_submap_info vm_region_submap_info_data_t; | ||
| 224 | |||
| 225 | #define VM_REGION_SUBMAP_INFO_COUNT \ | ||
| 226 | 	((mach_msg_type_number_t) \ | ||
| 227 | 	 (sizeof(vm_region_submap_info_data_t) / sizeof(natural_t))) | ||
| 228 | |||
| 229 | struct vm_region_submap_info_64 { | ||
| 230 | 	vm_prot_t protection; /* present access protection */ | ||
| 231 | 	vm_prot_t max_protection; /* max avail through vm_prot */ | ||
| 232 | 	vm_inherit_t inheritance;/* behavior of map/obj on fork */ | ||
| 233 | 	memory_object_offset_t offset; /* offset into object/map */ | ||
| 234 | 	unsigned int user_tag; /* user tag on map entry */ | ||
| 235 | 	unsigned int pages_resident; /* only valid for objects */ | ||
| 236 | 	unsigned int pages_shared_now_private; /* only for objects */ | ||
| 237 | 	unsigned int pages_swapped_out; /* only for objects */ | ||
| 238 | 	unsigned int pages_dirtied; /* only for objects */ | ||
| 239 | 	unsigned int ref_count; /* obj/map mappers, etc */ | ||
| 240 | 	unsigned short shadow_depth; /* only for obj */ | ||
| 241 | 	unsigned char external_pager; /* only for obj */ | ||
| 242 | 	unsigned char share_mode; /* see enumeration */ | ||
| 243 | 	boolean_t is_submap; /* submap vs obj */ | ||
| 244 | 	vm_behavior_t behavior; /* access behavior hint */ | ||
| 245 | 	vm32_object_id_t object_id; /* obj/map name, not a handle */ | ||
| 246 | 	unsigned short user_wired_count; | ||
| 247 | 	unsigned int pages_reusable; | ||
| 248 | 	vm_object_id_t object_id_full; | ||
| 249 | }; | ||
| 250 | |||
| 251 | typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t; | ||
| 252 | typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t; | ||
| 253 | |||
| 254 | #define VM_REGION_SUBMAP_INFO_V2_SIZE \ | ||
| 255 | 	(sizeof (vm_region_submap_info_data_64_t)) | ||
| 256 | #define VM_REGION_SUBMAP_INFO_V1_SIZE \ | ||
| 257 | 	(VM_REGION_SUBMAP_INFO_V2_SIZE - \ | ||
| 258 | 	 sizeof (vm_object_id_t) /* object_id_full */ ) | ||
| 259 | #define VM_REGION_SUBMAP_INFO_V0_SIZE \ | ||
| 260 | 	(VM_REGION_SUBMAP_INFO_V1_SIZE - \ | ||
| 261 | 	 sizeof (unsigned int) /* pages_reusable */ ) | ||
| 262 | |||
| 263 | #define VM_REGION_SUBMAP_INFO_V2_COUNT_64 \ | ||
| 264 | 	((mach_msg_type_number_t) \ | ||
| 265 | 	 (VM_REGION_SUBMAP_INFO_V2_SIZE / sizeof (natural_t))) | ||
| 266 | #define VM_REGION_SUBMAP_INFO_V1_COUNT_64 \ | ||
| 267 | 	((mach_msg_type_number_t) \ | ||
| 268 | 	 (VM_REGION_SUBMAP_INFO_V1_SIZE / sizeof (natural_t))) | ||
| 269 | #define VM_REGION_SUBMAP_INFO_V0_COUNT_64 \ | ||
| 270 | 	((mach_msg_type_number_t) \ | ||
| 271 | 	 (VM_REGION_SUBMAP_INFO_V0_SIZE / sizeof (natural_t))) | ||
| 272 | |||
| 273 | /* set this to the latest version */ | ||
| 274 | #define VM_REGION_SUBMAP_INFO_COUNT_64 VM_REGION_SUBMAP_INFO_V2_COUNT_64 | ||
| 275 | |||
| 276 | struct vm_region_submap_short_info_64 { | ||
| 277 | 	vm_prot_t protection; /* present access protection */ | ||
| 278 | 	vm_prot_t max_protection; /* max avail through vm_prot */ | ||
| 279 | 	vm_inherit_t inheritance;/* behavior of map/obj on fork */ | ||
| 280 | 	memory_object_offset_t offset; /* offset into object/map */ | ||
| 281 | 	unsigned int user_tag; /* user tag on map entry */ | ||
| 282 | 	unsigned int ref_count; /* obj/map mappers, etc */ | ||
| 283 | 	unsigned short shadow_depth; /* only for obj */ | ||
| 284 | 	unsigned char external_pager; /* only for obj */ | ||
| 285 | 	unsigned char share_mode; /* see enumeration */ | ||
| 286 | 	boolean_t is_submap; /* submap vs obj */ | ||
| 287 | 	vm_behavior_t behavior; /* access behavior hint */ | ||
| 288 | 	vm32_object_id_t object_id; /* obj/map name, not a handle */ | ||
| 289 | 	unsigned short user_wired_count; | ||
| 290 | }; | ||
| 291 | |||
| 292 | typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t; | ||
| 293 | typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t; | ||
| 294 | |||
| 295 | #define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 \ | ||
| 296 | 	((mach_msg_type_number_t) \ | ||
| 297 | 	 (sizeof (vm_region_submap_short_info_data_64_t) / sizeof (natural_t))) | ||
| 298 | |||
| 299 | struct mach_vm_read_entry { | ||
| 300 | 	mach_vm_address_t address; | ||
| 301 | 	mach_vm_size_t size; | ||
| 302 | }; | ||
| 303 | |||
| 304 | struct vm_read_entry { | ||
| 305 | 	vm_address_t address; | ||
| 306 | 	vm_size_t size; | ||
| 307 | }; | ||
| 308 | |||
| 309 | #ifdef VM32_SUPPORT | ||
| 310 | struct vm32_read_entry { | ||
| 311 | 	vm32_address_t address; | ||
| 312 | 	vm32_size_t size; | ||
| 313 | }; | ||
| 314 | #endif | ||
| 315 | |||
| 316 | |||
| 317 | #define VM_MAP_ENTRY_MAX (256) | ||
| 318 | |||
| 319 | typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX]; | ||
| 320 | typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX]; | ||
| 321 | #ifdef VM32_SUPPORT | ||
| 322 | typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX]; | ||
| 323 | #endif | ||
| 324 | |||
| 325 | #pragma pack(pop) | ||
| 326 | |||
| 327 | |||
| 328 | #define VM_PAGE_INFO_MAX | ||
| 329 | typedef int *vm_page_info_t; | ||
| 330 | typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX]; | ||
| 331 | typedef int vm_page_info_flavor_t; | ||
| 332 | |||
| 333 | #define VM_PAGE_INFO_BASIC 1 | ||
| 334 | struct vm_page_info_basic { | ||
| 335 | 	int disposition; | ||
| 336 | 	int ref_count; | ||
| 337 | 	vm_object_id_t object_id; | ||
| 338 | 	memory_object_offset_t offset; | ||
| 339 | 	int depth; | ||
| 340 | 	int __pad; /* pad to 64-bit boundary */ | ||
| 341 | }; | ||
| 342 | typedef struct vm_page_info_basic *vm_page_info_basic_t; | ||
| 343 | typedef struct vm_page_info_basic vm_page_info_basic_data_t; | ||
| 344 | |||
| 345 | #define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) \ | ||
| 346 | 	(sizeof(vm_page_info_basic_data_t)/sizeof(int))) | ||
| 347 | |||
| 348 | |||
| 349 | #endif /*_MACH_VM_REGION_H_*/ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_statistics.h created+550| ... | @@ -0,0 +1,550 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach/vm_statistics.h | ||
| 60 | *	Author:	Avadis Tevanian, Jr., Michael Wayne Young, David Golub | ||
| 61 | * | ||
| 62 | *	Virtual memory statistics structure. | ||
| 63 | * | ||
| 64 | */ | ||
| 65 | |||
| 66 | #ifndef _MACH_VM_STATISTICS_H_ | ||
| 67 | #define _MACH_VM_STATISTICS_H_ | ||
| 68 | |||
| 69 | #ifdef __cplusplus | ||
| 70 | extern "C" { | ||
| 71 | #endif | ||
| 72 | |||
| 73 | #include <mach/machine/vm_types.h> | ||
| 74 | #include <mach/machine/kern_return.h> | ||
| 75 | |||
| 76 | /* | ||
| 77 | * vm_statistics | ||
| 78 | * | ||
| 79 | * History: | ||
| 80 | *	rev0 - original structure. | ||
| 81 | *	rev1 - added purgable info (purgable_count and purges). | ||
| 82 | *	rev2 - added speculative_count. | ||
| 83 | * | ||
| 84 | * Note: you cannot add any new fields to this structure. Add them below in | ||
| 85 | * vm_statistics64. | ||
| 86 | */ | ||
| 87 | |||
| 88 | struct vm_statistics { | ||
| 89 | 	natural_t free_count; /* # of pages free */ | ||
| 90 | 	natural_t active_count; /* # of pages active */ | ||
| 91 | 	natural_t inactive_count; /* # of pages inactive */ | ||
| 92 | 	natural_t wire_count; /* # of pages wired down */ | ||
| 93 | 	natural_t zero_fill_count; /* # of zero fill pages */ | ||
| 94 | 	natural_t reactivations; /* # of pages reactivated */ | ||
| 95 | 	natural_t pageins; /* # of pageins */ | ||
| 96 | 	natural_t pageouts; /* # of pageouts */ | ||
| 97 | 	natural_t faults; /* # of faults */ | ||
| 98 | 	natural_t cow_faults; /* # of copy-on-writes */ | ||
| 99 | 	natural_t lookups; /* object cache lookups */ | ||
| 100 | 	natural_t hits; /* object cache hits */ | ||
| 101 | |||
| 102 | 	/* added for rev1 */ | ||
| 103 | 	natural_t purgeable_count; /* # of pages purgeable */ | ||
| 104 | 	natural_t purges; /* # of pages purged */ | ||
| 105 | |||
| 106 | 	/* added for rev2 */ | ||
| 107 | 	/* | ||
| 108 | 	 * NB: speculative pages are already accounted for in "free_count", | ||
| 109 | 	 * so "speculative_count" is the number of "free" pages that are | ||
| 110 | 	 * used to hold data that was read speculatively from disk but | ||
| 111 | 	 * haven't actually been used by anyone so far. | ||
| 112 | 	 */ | ||
| 113 | 	natural_t speculative_count; /* # of pages speculative */ | ||
| 114 | }; | ||
| 115 | |||
| 116 | /* Used by all architectures */ | ||
| 117 | typedef struct vm_statistics *vm_statistics_t; | ||
| 118 | typedef struct vm_statistics vm_statistics_data_t; | ||
| 119 | |||
| 120 | /* | ||
| 121 | * vm_statistics64 | ||
| 122 | * | ||
| 123 | * History: | ||
| 124 | *	rev0 - original structure. | ||
| 125 | *	rev1 - added purgable info (purgable_count and purges). | ||
| 126 | *	rev2 - added speculative_count. | ||
| 127 | *	 ---- | ||
| 128 | *	rev3 - changed name to vm_statistics64. | ||
| 129 | *		changed some fields in structure to 64-bit on | ||
| 130 | *		arm, i386 and x86_64 architectures. | ||
| 131 | *	rev4 - require 64-bit alignment for efficient access | ||
| 132 | *		in the kernel. No change to reported data. | ||
| 133 | * | ||
| 134 | */ | ||
| 135 | |||
| 136 | struct vm_statistics64 { | ||
| 137 | 	natural_t free_count; /* # of pages free */ | ||
| 138 | 	natural_t active_count; /* # of pages active */ | ||
| 139 | 	natural_t inactive_count; /* # of pages inactive */ | ||
| 140 | 	natural_t wire_count; /* # of pages wired down */ | ||
| 141 | 	uint64_t zero_fill_count; /* # of zero fill pages */ | ||
| 142 | 	uint64_t reactivations; /* # of pages reactivated */ | ||
| 143 | 	uint64_t pageins; /* # of pageins */ | ||
| 144 | 	uint64_t pageouts; /* # of pageouts */ | ||
| 145 | 	uint64_t faults; /* # of faults */ | ||
| 146 | 	uint64_t cow_faults; /* # of copy-on-writes */ | ||
| 147 | 	uint64_t lookups; /* object cache lookups */ | ||
| 148 | 	uint64_t hits; /* object cache hits */ | ||
| 149 | 	uint64_t purges; /* # of pages purged */ | ||
| 150 | 	natural_t purgeable_count; /* # of pages purgeable */ | ||
| 151 | 	/* | ||
| 152 | 	 * NB: speculative pages are already accounted for in "free_count", | ||
| 153 | 	 * so "speculative_count" is the number of "free" pages that are | ||
| 154 | 	 * used to hold data that was read speculatively from disk but | ||
| 155 | 	 * haven't actually been used by anyone so far. | ||
| 156 | 	 */ | ||
| 157 | 	natural_t speculative_count; /* # of pages speculative */ | ||
| 158 | |||
| 159 | 	/* added for rev1 */ | ||
| 160 | 	uint64_t decompressions; /* # of pages decompressed */ | ||
| 161 | 	uint64_t compressions; /* # of pages compressed */ | ||
| 162 | 	uint64_t swapins; /* # of pages swapped in (via compression segments) */ | ||
| 163 | 	uint64_t swapouts; /* # of pages swapped out (via compression segments) */ | ||
| 164 | 	natural_t compressor_page_count; /* # of pages used by the compressed pager to hold all the compressed data */ | ||
| 165 | 	natural_t throttled_count; /* # of pages throttled */ | ||
| 166 | 	natural_t external_page_count; /* # of pages that are file-backed (non-swap) */ | ||
| 167 | 	natural_t internal_page_count; /* # of pages that are anonymous */ | ||
| 168 | 	uint64_t total_uncompressed_pages_in_compressor; /* # of pages (uncompressed) held within the compressor. */ | ||
| 169 | } __attribute__((aligned(8))); | ||
| 170 | |||
| 171 | typedef struct vm_statistics64 *vm_statistics64_t; | ||
| 172 | typedef struct vm_statistics64 vm_statistics64_data_t; | ||
| 173 | |||
| 174 | kern_return_t vm_stats(void *info, unsigned int *count); | ||
| 175 | |||
| 176 | /* | ||
| 177 | * VM_STATISTICS_TRUNCATE_TO_32_BIT | ||
| 178 | * | ||
| 179 | * This is used by host_statistics() to truncate and peg the 64-bit in-kernel values from | ||
| 180 | * vm_statistics64 to the 32-bit values of the older structure above (vm_statistics). | ||
| 181 | */ | ||
| 182 | #define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value))) | ||
| 183 | |||
| 184 | /* | ||
| 185 | * vm_extmod_statistics | ||
| 186 | * | ||
| 187 | * Structure to record modifications to a task by an | ||
| 188 | * external agent. | ||
| 189 | * | ||
| 190 | * History: | ||
| 191 | *	rev0 - original structure. | ||
| 192 | */ | ||
| 193 | |||
| 194 | struct vm_extmod_statistics { | ||
| 195 | 	int64_t task_for_pid_count; /* # of times task port was looked up */ | ||
| 196 | 	int64_t task_for_pid_caller_count; /* # of times this task called task_for_pid */ | ||
| 197 | 	int64_t thread_creation_count; /* # of threads created in task */ | ||
| 198 | 	int64_t thread_creation_caller_count; /* # of threads created by task */ | ||
| 199 | 	int64_t thread_set_state_count; /* # of register state sets in task */ | ||
| 200 | 	int64_t thread_set_state_caller_count; /* # of register state sets by task */ | ||
| 201 | } __attribute__((aligned(8))); | ||
| 202 | |||
| 203 | typedef struct vm_extmod_statistics *vm_extmod_statistics_t; | ||
| 204 | typedef struct vm_extmod_statistics vm_extmod_statistics_data_t; | ||
| 205 | |||
| 206 | typedef struct vm_purgeable_stat { | ||
| 207 | 	uint64_t count; | ||
| 208 | 	uint64_t size; | ||
| 209 | }vm_purgeable_stat_t; | ||
| 210 | |||
| 211 | struct vm_purgeable_info { | ||
| 212 | 	vm_purgeable_stat_t fifo_data[8]; | ||
| 213 | 	vm_purgeable_stat_t obsolete_data; | ||
| 214 | 	vm_purgeable_stat_t lifo_data[8]; | ||
| 215 | }; | ||
| 216 | |||
| 217 | typedef struct vm_purgeable_info *vm_purgeable_info_t; | ||
| 218 | |||
| 219 | /* included for the vm_map_page_query call */ | ||
| 220 | |||
| 221 | #define VM_PAGE_QUERY_PAGE_PRESENT 0x1 | ||
| 222 | #define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2 | ||
| 223 | #define VM_PAGE_QUERY_PAGE_REF 0x4 | ||
| 224 | #define VM_PAGE_QUERY_PAGE_DIRTY 0x8 | ||
| 225 | #define VM_PAGE_QUERY_PAGE_PAGED_OUT 0x10 | ||
| 226 | #define VM_PAGE_QUERY_PAGE_COPIED 0x20 | ||
| 227 | #define VM_PAGE_QUERY_PAGE_SPECULATIVE 0x40 | ||
| 228 | #define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80 | ||
| 229 | #define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100 | ||
| 230 | #define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200 | ||
| 231 | #define VM_PAGE_QUERY_PAGE_CS_NX 0x400 | ||
| 232 | #define VM_PAGE_QUERY_PAGE_REUSABLE 0x800 | ||
| 233 | |||
| 234 | |||
| 235 | /* | ||
| 236 | * VM allocation flags: | ||
| 237 | * | ||
| 238 | * VM_FLAGS_FIXED | ||
| 239 | * (really the absence of VM_FLAGS_ANYWHERE) | ||
| 240 | *	Allocate new VM region at the specified virtual address, if possible. | ||
| 241 | * | ||
| 242 | * VM_FLAGS_ANYWHERE | ||
| 243 | *	Allocate new VM region anywhere it would fit in the address space. | ||
| 244 | * | ||
| 245 | * VM_FLAGS_PURGABLE | ||
| 246 | *	Create a purgable VM object for that new VM region. | ||
| 247 | * | ||
| 248 | * VM_FLAGS_4GB_CHUNK | ||
| 249 | *	The new VM region will be chunked up into 4GB sized pieces. | ||
| 250 | * | ||
| 251 | * VM_FLAGS_NO_PMAP_CHECK | ||
| 252 | *	(for DEBUG kernel config only, ignored for other configs) | ||
| 253 | *	Do not check that there is no stale pmap mapping for the new VM region. | ||
| 254 | *	This is useful for kernel memory allocations at bootstrap when building | ||
| 255 | *	the initial kernel address space while some memory is already in use. | ||
| 256 | * | ||
| 257 | * VM_FLAGS_OVERWRITE | ||
| 258 | *	The new VM region can replace existing VM regions if necessary | ||
| 259 | *	(to be used in combination with VM_FLAGS_FIXED). | ||
| 260 | * | ||
| 261 | * VM_FLAGS_NO_CACHE | ||
| 262 | *	Pages brought in to this VM region are placed on the speculative | ||
| 263 | *	queue instead of the active queue. In other words, they are not | ||
| 264 | *	cached so that they will be stolen first if memory runs low. | ||
| 265 | */ | ||
| 266 | |||
| 267 | #define VM_FLAGS_FIXED 0x0000 | ||
| 268 | #define VM_FLAGS_ANYWHERE 0x0001 | ||
| 269 | #define VM_FLAGS_PURGABLE 0x0002 | ||
| 270 | #define VM_FLAGS_4GB_CHUNK 0x0004 | ||
| 271 | #define VM_FLAGS_RANDOM_ADDR 0x0008 | ||
| 272 | #define VM_FLAGS_NO_CACHE 0x0010 | ||
| 273 | #define VM_FLAGS_RESILIENT_CODESIGN 0x0020 | ||
| 274 | #define VM_FLAGS_RESILIENT_MEDIA 0x0040 | ||
| 275 | #define VM_FLAGS_OVERWRITE 0x4000 /* delete any existing mappings first */ | ||
| 276 | /* | ||
| 277 | * VM_FLAGS_SUPERPAGE_MASK | ||
| 278 | *	3 bits that specify whether large pages should be used instead of | ||
| 279 | *	base pages (!=0), as well as the requested page size. | ||
| 280 | */ | ||
| 281 | #define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */ | ||
| 282 | #define VM_FLAGS_RETURN_DATA_ADDR 0x100000 /* Return address of target data, rather than base of page */ | ||
| 283 | #define VM_FLAGS_RETURN_4K_DATA_ADDR 0x800000 /* Return 4K aligned address of target data */ | ||
| 284 | #define VM_FLAGS_ALIAS_MASK 0xFF000000 | ||
| 285 | #define VM_GET_FLAGS_ALIAS(flags, alias) \ | ||
| 286 | 	 (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 | ||
| 287 | #define VM_SET_FLAGS_ALIAS(flags, alias) \ | ||
| 288 | 	 (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ | ||
| 289 | 	 (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) | ||
| 290 | |||
| 291 | /* These are the flags that we accept from user-space */ | ||
| 292 | #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ | ||
| 293 | 	 VM_FLAGS_ANYWHERE | \ | ||
| 294 | 	 VM_FLAGS_PURGABLE | \ | ||
| 295 | 	 VM_FLAGS_4GB_CHUNK | \ | ||
| 296 | 	 VM_FLAGS_RANDOM_ADDR | \ | ||
| 297 | 	 VM_FLAGS_NO_CACHE | \ | ||
| 298 | 	 VM_FLAGS_OVERWRITE | \ | ||
| 299 | 	 VM_FLAGS_SUPERPAGE_MASK | \ | ||
| 300 | 	 VM_FLAGS_ALIAS_MASK) | ||
| 301 | #define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \ | ||
| 302 | 	 VM_FLAGS_RETURN_4K_DATA_ADDR | \ | ||
| 303 | 	 VM_FLAGS_RETURN_DATA_ADDR) | ||
| 304 | #define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \ | ||
| 305 | 	 VM_FLAGS_ANYWHERE | \ | ||
| 306 | 	 VM_FLAGS_RANDOM_ADDR | \ | ||
| 307 | 	 VM_FLAGS_OVERWRITE| \ | ||
| 308 | 	 VM_FLAGS_RETURN_DATA_ADDR | \ | ||
| 309 | 	 VM_FLAGS_RESILIENT_CODESIGN | \ | ||
| 310 | 	 VM_FLAGS_RESILIENT_MEDIA) | ||
| 311 | |||
| 312 | #define VM_FLAGS_SUPERPAGE_SHIFT 16 | ||
| 313 | #define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */ | ||
| 314 | #define SUPERPAGE_SIZE_ANY 1 | ||
| 315 | #define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT) | ||
| 316 | #define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT) | ||
| 317 | #define SUPERPAGE_SIZE_2MB 2 | ||
| 318 | #define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT) | ||
| 319 | |||
| 320 | /* | ||
| 321 | * EXC_GUARD definitions for virtual memory. | ||
| 322 | */ | ||
| 323 | #define GUARD_TYPE_VIRT_MEMORY 0x5 | ||
| 324 | |||
| 325 | /* Reasons for exception for virtual memory */ | ||
| 326 | enum virtual_memory_guard_exception_codes { | ||
| 327 | 	kGUARD_EXC_DEALLOC_GAP = 1u << 0 | ||
| 328 | }; | ||
| 329 | |||
| 330 | |||
| 331 | /* current accounting postmark */ | ||
| 332 | #define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600 | ||
| 333 | |||
| 334 | /* discrete values: */ | ||
| 335 | #define VM_LEDGER_TAG_NONE 0x00000000 | ||
| 336 | #define VM_LEDGER_TAG_DEFAULT 0x00000001 | ||
| 337 | #define VM_LEDGER_TAG_NETWORK 0x00000002 | ||
| 338 | #define VM_LEDGER_TAG_MEDIA 0x00000003 | ||
| 339 | #define VM_LEDGER_TAG_GRAPHICS 0x00000004 | ||
| 340 | #define VM_LEDGER_TAG_NEURAL 0x00000005 | ||
| 341 | #define VM_LEDGER_TAG_MAX 0x00000005 | ||
| 342 | /* individual bits: */ | ||
| 343 | #define VM_LEDGER_FLAG_NO_FOOTPRINT 0x00000001 | ||
| 344 | #define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT) | ||
| 345 | |||
| 346 | |||
| 347 | #define VM_MEMORY_MALLOC 1 | ||
| 348 | #define VM_MEMORY_MALLOC_SMALL 2 | ||
| 349 | #define VM_MEMORY_MALLOC_LARGE 3 | ||
| 350 | #define VM_MEMORY_MALLOC_HUGE 4 | ||
| 351 | #define VM_MEMORY_SBRK 5// uninteresting -- no one should call | ||
| 352 | #define VM_MEMORY_REALLOC 6 | ||
| 353 | #define VM_MEMORY_MALLOC_TINY 7 | ||
| 354 | #define VM_MEMORY_MALLOC_LARGE_REUSABLE 8 | ||
| 355 | #define VM_MEMORY_MALLOC_LARGE_REUSED 9 | ||
| 356 | |||
| 357 | #define VM_MEMORY_ANALYSIS_TOOL 10 | ||
| 358 | |||
| 359 | #define VM_MEMORY_MALLOC_NANO 11 | ||
| 360 | #define VM_MEMORY_MALLOC_MEDIUM 12 | ||
| 361 | #define VM_MEMORY_MALLOC_PGUARD 13 | ||
| 362 | |||
| 363 | #define VM_MEMORY_MACH_MSG 20 | ||
| 364 | #define VM_MEMORY_IOKIT 21 | ||
| 365 | #define VM_MEMORY_STACK 30 | ||
| 366 | #define VM_MEMORY_GUARD 31 | ||
| 367 | #define VM_MEMORY_SHARED_PMAP 32 | ||
| 368 | /* memory containing a dylib */ | ||
| 369 | #define VM_MEMORY_DYLIB 33 | ||
| 370 | #define VM_MEMORY_OBJC_DISPATCHERS 34 | ||
| 371 | |||
| 372 | /* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */ | ||
| 373 | #define VM_MEMORY_UNSHARED_PMAP 35 | ||
| 374 | |||
| 375 | |||
| 376 | // Placeholders for now -- as we analyze the libraries and find how they | ||
| 377 | // use memory, we can make these labels more specific. | ||
| 378 | #define VM_MEMORY_APPKIT 40 | ||
| 379 | #define VM_MEMORY_FOUNDATION 41 | ||
| 380 | #define VM_MEMORY_COREGRAPHICS 42 | ||
| 381 | #define VM_MEMORY_CORESERVICES 43 | ||
| 382 | #define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES | ||
| 383 | #define VM_MEMORY_JAVA 44 | ||
| 384 | #define VM_MEMORY_COREDATA 45 | ||
| 385 | #define VM_MEMORY_COREDATA_OBJECTIDS 46 | ||
| 386 | #define VM_MEMORY_ATS 50 | ||
| 387 | #define VM_MEMORY_LAYERKIT 51 | ||
| 388 | #define VM_MEMORY_CGIMAGE 52 | ||
| 389 | #define VM_MEMORY_TCMALLOC 53 | ||
| 390 | |||
| 391 | /* private raster data (i.e. layers, some images, QGL allocator) */ | ||
| 392 | #define VM_MEMORY_COREGRAPHICS_DATA 54 | ||
| 393 | |||
| 394 | /* shared image and font caches */ | ||
| 395 | #define VM_MEMORY_COREGRAPHICS_SHARED 55 | ||
| 396 | |||
| 397 | /* Memory used for virtual framebuffers, shadowing buffers, etc... */ | ||
| 398 | #define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56 | ||
| 399 | |||
| 400 | /* Window backing stores, custom shadow data, and compressed backing stores */ | ||
| 401 | #define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57 | ||
| 402 | |||
| 403 | /* x-alloc'd memory */ | ||
| 404 | #define VM_MEMORY_COREGRAPHICS_XALLOC 58 | ||
| 405 | |||
| 406 | /* catch-all for other uses, such as the read-only shared data page */ | ||
| 407 | #define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS | ||
| 408 | |||
| 409 | /* memory allocated by the dynamic loader for itself */ | ||
| 410 | #define VM_MEMORY_DYLD 60 | ||
| 411 | /* malloc'd memory created by dyld */ | ||
| 412 | #define VM_MEMORY_DYLD_MALLOC 61 | ||
| 413 | |||
| 414 | /* Used for sqlite page cache */ | ||
| 415 | #define VM_MEMORY_SQLITE 62 | ||
| 416 | |||
| 417 | /* JavaScriptCore heaps */ | ||
| 418 | #define VM_MEMORY_JAVASCRIPT_CORE 63 | ||
| 419 | #define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE | ||
| 420 | /* memory allocated for the JIT */ | ||
| 421 | #define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64 | ||
| 422 | #define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65 | ||
| 423 | |||
| 424 | /* memory allocated for GLSL */ | ||
| 425 | #define VM_MEMORY_GLSL 66 | ||
| 426 | |||
| 427 | /* memory allocated for OpenCL.framework */ | ||
| 428 | #define VM_MEMORY_OPENCL 67 | ||
| 429 | |||
| 430 | /* memory allocated for QuartzCore.framework */ | ||
| 431 | #define VM_MEMORY_COREIMAGE 68 | ||
| 432 | |||
| 433 | /* memory allocated for WebCore Purgeable Buffers */ | ||
| 434 | #define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69 | ||
| 435 | |||
| 436 | /* ImageIO memory */ | ||
| 437 | #define VM_MEMORY_IMAGEIO 70 | ||
| 438 | |||
| 439 | /* CoreProfile memory */ | ||
| 440 | #define VM_MEMORY_COREPROFILE 71 | ||
| 441 | |||
| 442 | /* assetsd / MobileSlideShow memory */ | ||
| 443 | #define VM_MEMORY_ASSETSD 72 | ||
| 444 | |||
| 445 | /* libsystem_kernel os_once_alloc */ | ||
| 446 | #define VM_MEMORY_OS_ALLOC_ONCE 73 | ||
| 447 | |||
| 448 | /* libdispatch internal allocator */ | ||
| 449 | #define VM_MEMORY_LIBDISPATCH 74 | ||
| 450 | |||
| 451 | /* Accelerate.framework image backing stores */ | ||
| 452 | #define VM_MEMORY_ACCELERATE 75 | ||
| 453 | |||
| 454 | /* CoreUI image block data */ | ||
| 455 | #define VM_MEMORY_COREUI 76 | ||
| 456 | |||
| 457 | /* CoreUI image file */ | ||
| 458 | #define VM_MEMORY_COREUIFILE 77 | ||
| 459 | |||
| 460 | /* Genealogy buffers */ | ||
| 461 | #define VM_MEMORY_GENEALOGY 78 | ||
| 462 | |||
| 463 | /* RawCamera VM allocated memory */ | ||
| 464 | #define VM_MEMORY_RAWCAMERA 79 | ||
| 465 | |||
| 466 | /* corpse info for dead process */ | ||
| 467 | #define VM_MEMORY_CORPSEINFO 80 | ||
| 468 | |||
| 469 | /* Apple System Logger (ASL) messages */ | ||
| 470 | #define VM_MEMORY_ASL 81 | ||
| 471 | |||
| 472 | /* Swift runtime */ | ||
| 473 | #define VM_MEMORY_SWIFT_RUNTIME 82 | ||
| 474 | |||
| 475 | /* Swift metadata */ | ||
| 476 | #define VM_MEMORY_SWIFT_METADATA 83 | ||
| 477 | |||
| 478 | /* DHMM data */ | ||
| 479 | #define VM_MEMORY_DHMM 84 | ||
| 480 | |||
| 481 | |||
| 482 | /* memory allocated by SceneKit.framework */ | ||
| 483 | #define VM_MEMORY_SCENEKIT 86 | ||
| 484 | |||
| 485 | /* memory allocated by skywalk networking */ | ||
| 486 | #define VM_MEMORY_SKYWALK 87 | ||
| 487 | |||
| 488 | #define VM_MEMORY_IOSURFACE 88 | ||
| 489 | |||
| 490 | #define VM_MEMORY_LIBNETWORK 89 | ||
| 491 | |||
| 492 | #define VM_MEMORY_AUDIO 90 | ||
| 493 | |||
| 494 | #define VM_MEMORY_VIDEOBITSTREAM 91 | ||
| 495 | |||
| 496 | /* memory allocated by CoreMedia */ | ||
| 497 | #define VM_MEMORY_CM_XPC 92 | ||
| 498 | |||
| 499 | #define VM_MEMORY_CM_RPC 93 | ||
| 500 | |||
| 501 | #define VM_MEMORY_CM_MEMORYPOOL 94 | ||
| 502 | |||
| 503 | #define VM_MEMORY_CM_READCACHE 95 | ||
| 504 | |||
| 505 | #define VM_MEMORY_CM_CRABS 96 | ||
| 506 | |||
| 507 | /* memory allocated for QuickLookThumbnailing */ | ||
| 508 | #define VM_MEMORY_QUICKLOOK_THUMBNAILS 97 | ||
| 509 | |||
| 510 | /* memory allocated by Accounts framework */ | ||
| 511 | #define VM_MEMORY_ACCOUNTS 98 | ||
| 512 | |||
| 513 | /* memory allocated by Sanitizer runtime libraries */ | ||
| 514 | #define VM_MEMORY_SANITIZER 99 | ||
| 515 | |||
| 516 | /* Differentiate memory needed by GPU drivers and frameworks from generic IOKit allocations */ | ||
| 517 | #define VM_MEMORY_IOACCELERATOR 100 | ||
| 518 | |||
| 519 | /* memory allocated by CoreMedia for global image registration of frames */ | ||
| 520 | #define VM_MEMORY_CM_REGWARP 101 | ||
| 521 | |||
| 522 | /* memory allocated by EmbeddedAcousticRecognition for speech decoder */ | ||
| 523 | #define VM_MEMORY_EAR_DECODER 102 | ||
| 524 | |||
| 525 | /* CoreUI cached image data */ | ||
| 526 | #define VM_MEMORY_COREUI_CACHED_IMAGE_DATA 103 | ||
| 527 | |||
| 528 | /* Reserve 230-239 for Rosetta */ | ||
| 529 | #define VM_MEMORY_ROSETTA 230 | ||
| 530 | #define VM_MEMORY_ROSETTA_THREAD_CONTEXT 231 | ||
| 531 | #define VM_MEMORY_ROSETTA_INDIRECT_BRANCH_MAP 232 | ||
| 532 | #define VM_MEMORY_ROSETTA_RETURN_STACK 233 | ||
| 533 | #define VM_MEMORY_ROSETTA_EXECUTABLE_HEAP 234 | ||
| 534 | #define VM_MEMORY_ROSETTA_USER_LDT 235 | ||
| 535 | #define VM_MEMORY_ROSETTA_ARENA 236 | ||
| 536 | #define VM_MEMORY_ROSETTA_10 239 | ||
| 537 | |||
| 538 | /* Reserve 240-255 for application */ | ||
| 539 | #define VM_MEMORY_APPLICATION_SPECIFIC_1 240 | ||
| 540 | #define VM_MEMORY_APPLICATION_SPECIFIC_16 255 | ||
| 541 | |||
| 542 | #define VM_MAKE_TAG(tag) ((tag) << 24) | ||
| 543 | |||
| 544 | |||
| 545 | |||
| 546 | #ifdef __cplusplus | ||
| 547 | } | ||
| 548 | #endif | ||
| 549 | |||
| 550 | #endif /* _MACH_VM_STATISTICS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_sync.h created+80| ... | @@ -0,0 +1,80 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | *	File:	mach/vm_sync.h | ||
| 58 | * | ||
| 59 | *	Virtual memory synchronisation definitions. | ||
| 60 | * | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _MACH_VM_SYNC_H_ | ||
| 64 | #define _MACH_VM_SYNC_H_ | ||
| 65 | |||
| 66 | typedef unsigned vm_sync_t; | ||
| 67 | |||
| 68 | /* | ||
| 69 | *	Synchronization flags, defined as bits within the vm_sync_t type | ||
| 70 | */ | ||
| 71 | |||
| 72 | #define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01) | ||
| 73 | #define VM_SYNC_SYNCHRONOUS ((vm_sync_t) 0x02) | ||
| 74 | #define VM_SYNC_INVALIDATE ((vm_sync_t) 0x04) | ||
| 75 | #define VM_SYNC_KILLPAGES ((vm_sync_t) 0x08) | ||
| 76 | #define VM_SYNC_DEACTIVATE ((vm_sync_t) 0x10) | ||
| 77 | #define VM_SYNC_CONTIGUOUS ((vm_sync_t) 0x20) | ||
| 78 | #define VM_SYNC_REUSABLEPAGES ((vm_sync_t) 0x40) | ||
| 79 | |||
| 80 | #endif /* _MACH_VM_SYNC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach/vm_types.h created+97| ... | @@ -0,0 +1,97 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | * | ||
| 31 | */ | ||
| 32 | #ifndef _MACH_VM_TYPES_H_ | ||
| 33 | #define _MACH_VM_TYPES_H_ | ||
| 34 | |||
| 35 | #include <mach/port.h> | ||
| 36 | #include <mach/machine/vm_types.h> | ||
| 37 | |||
| 38 | #include <stdint.h> | ||
| 39 | |||
| 40 | typedef vm_offset_t pointer_t; | ||
| 41 | typedef vm_offset_t vm_address_t; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * We use addr64_t for 64-bit addresses that are used on both | ||
| 45 | * 32 and 64-bit machines. On PPC, they are passed and returned as | ||
| 46 | * two adjacent 32-bit GPRs. We use addr64_t in places where | ||
| 47 | * common code must be useable both on 32 and 64-bit machines. | ||
| 48 | */ | ||
| 49 | typedef uint64_t addr64_t; /* Basic effective address */ | ||
| 50 | |||
| 51 | /* | ||
| 52 | * We use reg64_t for addresses that are 32 bits on a 32-bit | ||
| 53 | * machine, and 64 bits on a 64-bit machine, but are always | ||
| 54 | * passed and returned in a single GPR on PPC. This type | ||
| 55 | * cannot be used in generic 32-bit c, since on a 64-bit | ||
| 56 | * machine the upper half of the register will be ignored | ||
| 57 | * by the c compiler in 32-bit mode. In c, we can only use the | ||
| 58 | * type in prototypes of functions that are written in and called | ||
| 59 | * from assembly language. This type is basically a comment. | ||
| 60 | */ | ||
| 61 | typedef uint32_t reg64_t; | ||
| 62 | |||
| 63 | /* | ||
| 64 | * To minimize the use of 64-bit fields, we keep some physical | ||
| 65 | * addresses (that are page aligned) as 32-bit page numbers. | ||
| 66 | * This limits the physical address space to 16TB of RAM. | ||
| 67 | */ | ||
| 68 | typedef uint32_t ppnum_t; /* Physical page number */ | ||
| 69 | #define PPNUM_MAX UINT32_MAX | ||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | typedef mach_port_t vm_map_t, vm_map_read_t, vm_map_inspect_t; | ||
| 74 | |||
| 75 | |||
| 76 | #define VM_MAP_NULL ((vm_map_t) 0) | ||
| 77 | #define VM_MAP_INSPECT_NULL ((vm_map_inspect_t) 0) | ||
| 78 | #define VM_MAP_READ_NULL ((vm_map_read_t) 0) | ||
| 79 | |||
| 80 | /* | ||
| 81 | * Evolving definitions, likely to change. | ||
| 82 | */ | ||
| 83 | |||
| 84 | typedef uint64_t vm_object_offset_t; | ||
| 85 | typedef uint64_t vm_object_size_t; | ||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | typedef mach_port_t upl_t; | ||
| 91 | typedef mach_port_t vm_named_entry_t; | ||
| 92 | |||
| 93 | |||
| 94 | #define UPL_NULL ((upl_t) 0) | ||
| 95 | #define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0) | ||
| 96 | |||
| 97 | #endif /* _MACH_VM_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/hash_info.h created+75| ... | @@ -0,0 +1,75 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_DEBUG_HASH_INFO_H_ | ||
| 60 | #define _MACH_DEBUG_HASH_INFO_H_ | ||
| 61 | |||
| 62 | #include <mach/machine/vm_types.h> /* natural_t */ | ||
| 63 | |||
| 64 | /* | ||
| 65 | *	Remember to update the mig type definitions | ||
| 66 | *	in mach_debug_types.defs when adding/removing fields. | ||
| 67 | */ | ||
| 68 | |||
| 69 | typedef struct hash_info_bucket { | ||
| 70 | 	natural_t hib_count; /* number of records in bucket */ | ||
| 71 | } hash_info_bucket_t; | ||
| 72 | |||
| 73 | typedef hash_info_bucket_t *hash_info_bucket_array_t; | ||
| 74 | |||
| 75 | #endif /* _MACH_DEBUG_HASH_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/ipc_info.h created+116| ... | @@ -0,0 +1,116 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	File:	mach_debug/ipc_info.h | ||
| 60 | *	Author:	Rich Draves | ||
| 61 | *	Date:	March, 1990 | ||
| 62 | * | ||
| 63 | *	Definitions for the IPC debugging interface. | ||
| 64 | */ | ||
| 65 | |||
| 66 | #ifndef _MACH_DEBUG_IPC_INFO_H_ | ||
| 67 | #define _MACH_DEBUG_IPC_INFO_H_ | ||
| 68 | |||
| 69 | #include <mach/boolean.h> | ||
| 70 | #include <mach/port.h> | ||
| 71 | #include <mach/machine/vm_types.h> | ||
| 72 | |||
| 73 | /* | ||
| 74 | *	Remember to update the mig type definitions | ||
| 75 | *	in mach_debug_types.defs when adding/removing fields. | ||
| 76 | */ | ||
| 77 | |||
| 78 | typedef struct ipc_info_space { | ||
| 79 | 	natural_t iis_genno_mask; /* generation number mask */ | ||
| 80 | 	natural_t iis_table_size; /* size of table */ | ||
| 81 | 	natural_t iis_table_next; /* next possible size of table */ | ||
| 82 | 	natural_t iis_tree_size; /* size of tree (UNUSED) */ | ||
| 83 | 	natural_t iis_tree_small; /* # of small entries in tree (UNUSED) */ | ||
| 84 | 	natural_t iis_tree_hash; /* # of hashed entries in tree (UNUSED) */ | ||
| 85 | } ipc_info_space_t; | ||
| 86 | |||
| 87 | typedef struct ipc_info_space_basic { | ||
| 88 | 	natural_t iisb_genno_mask; /* generation number mask */ | ||
| 89 | 	natural_t iisb_table_size; /* size of table */ | ||
| 90 | 	natural_t iisb_table_next; /* next possible size of table */ | ||
| 91 | 	natural_t iisb_table_inuse; /* number of entries in use */ | ||
| 92 | 	natural_t iisb_reserved[2]; /* future expansion */ | ||
| 93 | } ipc_info_space_basic_t; | ||
| 94 | |||
| 95 | typedef struct ipc_info_name { | ||
| 96 | 	mach_port_name_t iin_name; /* port name, including gen number */ | ||
| 97 | /*boolean_t*/ integer_t iin_collision; /* collision at this entry? */ | ||
| 98 | 	mach_port_type_t iin_type; /* straight port type */ | ||
| 99 | 	mach_port_urefs_t iin_urefs; /* user-references */ | ||
| 100 | 	natural_t iin_object; /* object pointer/identifier */ | ||
| 101 | 	natural_t iin_next; /* marequest/next in free list */ | ||
| 102 | 	natural_t iin_hash; /* hash index */ | ||
| 103 | } ipc_info_name_t; | ||
| 104 | |||
| 105 | typedef ipc_info_name_t *ipc_info_name_array_t; | ||
| 106 | |||
| 107 | /* UNUSED */ | ||
| 108 | typedef struct ipc_info_tree_name { | ||
| 109 | 	ipc_info_name_t iitn_name; | ||
| 110 | 	mach_port_name_t iitn_lchild; /* name of left child */ | ||
| 111 | 	mach_port_name_t iitn_rchild; /* name of right child */ | ||
| 112 | } ipc_info_tree_name_t; | ||
| 113 | |||
| 114 | typedef ipc_info_tree_name_t *ipc_info_tree_name_array_t; | ||
| 115 | |||
| 116 | #endif /* _MACH_DEBUG_IPC_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/lockgroup_info.h created+74| ... | @@ -0,0 +1,74 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | *	File:	mach/lockgroup_info.h | ||
| 30 | * | ||
| 31 | *	Definitions for host_lockgroup_info call. | ||
| 32 | */ | ||
| 33 | |||
| 34 | #ifndef _MACH_DEBUG_LOCKGROUP_INFO_H_ | ||
| 35 | #define _MACH_DEBUG_LOCKGROUP_INFO_H_ | ||
| 36 | |||
| 37 | #include <mach/mach_types.h> | ||
| 38 | |||
| 39 | #define LOCKGROUP_MAX_NAME 64 | ||
| 40 | |||
| 41 | #define LOCKGROUP_ATTR_STAT 0x01ULL | ||
| 42 | |||
| 43 | typedef struct lockgroup_info { | ||
| 44 | 	char lockgroup_name[LOCKGROUP_MAX_NAME]; | ||
| 45 | 	uint64_t lockgroup_attr; | ||
| 46 | 	uint64_t lock_spin_cnt; | ||
| 47 | 	uint64_t lock_spin_util_cnt; | ||
| 48 | 	uint64_t lock_spin_held_cnt; | ||
| 49 | 	uint64_t lock_spin_miss_cnt; | ||
| 50 | 	uint64_t lock_spin_held_max; | ||
| 51 | 	uint64_t lock_spin_held_cum; | ||
| 52 | 	uint64_t lock_mtx_cnt; | ||
| 53 | 	uint64_t lock_mtx_util_cnt; | ||
| 54 | 	uint64_t lock_mtx_held_cnt; | ||
| 55 | 	uint64_t lock_mtx_miss_cnt; | ||
| 56 | 	uint64_t lock_mtx_wait_cnt; | ||
| 57 | 	uint64_t lock_mtx_held_max; | ||
| 58 | 	uint64_t lock_mtx_held_cum; | ||
| 59 | 	uint64_t lock_mtx_wait_max; | ||
| 60 | 	uint64_t lock_mtx_wait_cum; | ||
| 61 | 	uint64_t lock_rw_cnt; | ||
| 62 | 	uint64_t lock_rw_util_cnt; | ||
| 63 | 	uint64_t lock_rw_held_cnt; | ||
| 64 | 	uint64_t lock_rw_miss_cnt; | ||
| 65 | 	uint64_t lock_rw_wait_cnt; | ||
| 66 | 	uint64_t lock_rw_held_max; | ||
| 67 | 	uint64_t lock_rw_held_cum; | ||
| 68 | 	uint64_t lock_rw_wait_max; | ||
| 69 | 	uint64_t lock_rw_wait_cum; | ||
| 70 | } lockgroup_info_t; | ||
| 71 | |||
| 72 | typedef lockgroup_info_t *lockgroup_info_array_t; | ||
| 73 | |||
| 74 | #endif /* _MACH_DEBUG_LOCKGROUP_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/mach_debug_types.h created+95| ... | @@ -0,0 +1,95 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | /* | ||
| 59 | *	Mach kernel debugging interface type declarations | ||
| 60 | */ | ||
| 61 | |||
| 62 | #ifndef _MACH_DEBUG_MACH_DEBUG_TYPES_H_ | ||
| 63 | #define _MACH_DEBUG_MACH_DEBUG_TYPES_H_ | ||
| 64 | |||
| 65 | #include <mach_debug/ipc_info.h> | ||
| 66 | #include <mach_debug/vm_info.h> | ||
| 67 | #include <mach_debug/zone_info.h> | ||
| 68 | #include <mach_debug/page_info.h> | ||
| 69 | #include <mach_debug/hash_info.h> | ||
| 70 | #include <mach_debug/lockgroup_info.h> | ||
| 71 | |||
| 72 | #define MACH_CORE_FILEHEADER_SIGNATURE 0x0063614d20646152ULL | ||
| 73 | #define MACH_CORE_FILEHEADER_MAXFILES 16 | ||
| 74 | #define MACH_CORE_FILEHEADER_NAMELEN 16 | ||
| 75 | |||
| 76 | typedef char symtab_name_t[32]; | ||
| 77 | |||
| 78 | struct mach_core_details { | ||
| 79 | 	uint64_t gzip_offset; | ||
| 80 | 	uint64_t gzip_length; | ||
| 81 | 	char core_name[MACH_CORE_FILEHEADER_NAMELEN]; | ||
| 82 | }; | ||
| 83 | |||
| 84 | struct mach_core_fileheader { | ||
| 85 | 	uint64_t signature; | ||
| 86 | 	uint64_t log_offset; | ||
| 87 | 	uint64_t log_length; | ||
| 88 | 	uint64_t num_files; | ||
| 89 | 	struct mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES]; | ||
| 90 | }; | ||
| 91 | |||
| 92 | #define KOBJECT_DESCRIPTION_LENGTH 512 | ||
| 93 | typedef char kobject_description_t[KOBJECT_DESCRIPTION_LENGTH]; | ||
| 94 | |||
| 95 | #endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/page_info.h created+64| ... | @@ -0,0 +1,64 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | #ifndef MACH_DEBUG_PAGE_INFO_H | ||
| 59 | #define MACH_DEBUG_PAGE_INFO_H | ||
| 60 | |||
| 61 | #include <mach/machine/vm_types.h> | ||
| 62 | |||
| 63 | typedef vm_offset_t *page_address_array_t; | ||
| 64 | #endif /* MACH_DEBUG_PAGE_INFO_H */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/vm_info.h created+149| ... | @@ -0,0 +1,149 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | *	File:	mach_debug/vm_info.h | ||
| 58 | *	Author:	Rich Draves | ||
| 59 | *	Date:	March, 1990 | ||
| 60 | * | ||
| 61 | *	Definitions for the VM debugging interface. | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _MACH_DEBUG_VM_INFO_H_ | ||
| 65 | #define _MACH_DEBUG_VM_INFO_H_ | ||
| 66 | |||
| 67 | #include <mach/boolean.h> | ||
| 68 | #include <mach/machine/vm_types.h> | ||
| 69 | #include <mach/vm_inherit.h> | ||
| 70 | #include <mach/vm_prot.h> | ||
| 71 | #include <mach/memory_object_types.h> | ||
| 72 | |||
| 73 | #pragma pack(4) | ||
| 74 | |||
| 75 | /* | ||
| 76 | *	Remember to update the mig type definitions | ||
| 77 | *	in mach_debug_types.defs when adding/removing fields. | ||
| 78 | */ | ||
| 79 | typedef struct mach_vm_info_region { | ||
| 80 | 	mach_vm_offset_t vir_start; /* start of region */ | ||
| 81 | 	mach_vm_offset_t vir_end; /* end of region */ | ||
| 82 | 	mach_vm_offset_t vir_object; /* the mapped object(kernal addr) */ | ||
| 83 | 	memory_object_offset_t vir_offset; /* offset into object */ | ||
| 84 | 	boolean_t vir_needs_copy; /* does object need to be copied? */ | ||
| 85 | 	vm_prot_t vir_protection; /* protection code */ | ||
| 86 | 	vm_prot_t vir_max_protection; /* maximum protection */ | ||
| 87 | 	vm_inherit_t vir_inheritance; /* inheritance */ | ||
| 88 | 	natural_t vir_wired_count; /* number of times wired */ | ||
| 89 | 	natural_t vir_user_wired_count; /* number of times user has wired */ | ||
| 90 | } mach_vm_info_region_t; | ||
| 91 | |||
| 92 | typedef struct vm_info_region_64 { | ||
| 93 | 	natural_t vir_start; /* start of region */ | ||
| 94 | 	natural_t vir_end; /* end of region */ | ||
| 95 | 	natural_t vir_object; /* the mapped object */ | ||
| 96 | 	memory_object_offset_t vir_offset; /* offset into object */ | ||
| 97 | 	boolean_t vir_needs_copy; /* does object need to be copied? */ | ||
| 98 | 	vm_prot_t vir_protection; /* protection code */ | ||
| 99 | 	vm_prot_t vir_max_protection; /* maximum protection */ | ||
| 100 | 	vm_inherit_t vir_inheritance; /* inheritance */ | ||
| 101 | 	natural_t vir_wired_count; /* number of times wired */ | ||
| 102 | 	natural_t vir_user_wired_count; /* number of times user has wired */ | ||
| 103 | } vm_info_region_64_t; | ||
| 104 | |||
| 105 | typedef struct vm_info_region { | ||
| 106 | 	natural_t vir_start; /* start of region */ | ||
| 107 | 	natural_t vir_end; /* end of region */ | ||
| 108 | 	natural_t vir_object; /* the mapped object */ | ||
| 109 | 	natural_t vir_offset; /* offset into object */ | ||
| 110 | 	boolean_t vir_needs_copy; /* does object need to be copied? */ | ||
| 111 | 	vm_prot_t vir_protection; /* protection code */ | ||
| 112 | 	vm_prot_t vir_max_protection; /* maximum protection */ | ||
| 113 | 	vm_inherit_t vir_inheritance; /* inheritance */ | ||
| 114 | 	natural_t vir_wired_count; /* number of times wired */ | ||
| 115 | 	natural_t vir_user_wired_count; /* number of times user has wired */ | ||
| 116 | } vm_info_region_t; | ||
| 117 | |||
| 118 | |||
| 119 | typedef struct vm_info_object { | ||
| 120 | 	natural_t vio_object; /* this object */ | ||
| 121 | 	natural_t vio_size; /* object size (valid if internal - but too small) */ | ||
| 122 | 	unsigned int vio_ref_count; /* number of references */ | ||
| 123 | 	unsigned int vio_resident_page_count; /* number of resident pages */ | ||
| 124 | 	unsigned int vio_absent_count; /* number requested but not filled */ | ||
| 125 | 	natural_t vio_copy; /* copy object */ | ||
| 126 | 	natural_t vio_shadow; /* shadow object */ | ||
| 127 | 	natural_t vio_shadow_offset; /* offset into shadow object */ | ||
| 128 | 	natural_t vio_paging_offset; /* offset into memory object */ | ||
| 129 | 	memory_object_copy_strategy_t vio_copy_strategy; | ||
| 130 | 	/* how to handle data copy */ | ||
| 131 | 	vm_offset_t vio_last_alloc; /* offset of last allocation */ | ||
| 132 | 	/* many random attributes */ | ||
| 133 | 	unsigned int vio_paging_in_progress; | ||
| 134 | 	boolean_t vio_pager_created; | ||
| 135 | 	boolean_t vio_pager_initialized; | ||
| 136 | 	boolean_t vio_pager_ready; | ||
| 137 | 	boolean_t vio_can_persist; | ||
| 138 | 	boolean_t vio_internal; | ||
| 139 | 	boolean_t vio_temporary; | ||
| 140 | 	boolean_t vio_alive; | ||
| 141 | 	boolean_t vio_purgable; | ||
| 142 | 	boolean_t vio_purgable_volatile; | ||
| 143 | } vm_info_object_t; | ||
| 144 | |||
| 145 | typedef vm_info_object_t *vm_info_object_array_t; | ||
| 146 | |||
| 147 | #pragma pack() | ||
| 148 | |||
| 149 | #endif /* _MACH_DEBUG_VM_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/mach_debug/zone_info.h created+201| ... | @@ -0,0 +1,201 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * @OSF_COPYRIGHT@ | ||
| 30 | */ | ||
| 31 | /* | ||
| 32 | * Mach Operating System | ||
| 33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | ||
| 34 | * All Rights Reserved. | ||
| 35 | * | ||
| 36 | * Permission to use, copy, modify and distribute this software and its | ||
| 37 | * documentation is hereby granted, provided that both the copyright | ||
| 38 | * notice and this permission notice appear in all copies of the | ||
| 39 | * software, derivative works or modified versions, and any portions | ||
| 40 | * thereof, and that both notices appear in supporting documentation. | ||
| 41 | * | ||
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | ||
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | ||
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | ||
| 45 | * | ||
| 46 | * Carnegie Mellon requests users of this software to return to | ||
| 47 | * | ||
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | ||
| 49 | * School of Computer Science | ||
| 50 | * Carnegie Mellon University | ||
| 51 | * Pittsburgh PA 15213-3890 | ||
| 52 | * | ||
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | ||
| 54 | * the rights to redistribute these changes. | ||
| 55 | */ | ||
| 56 | /* | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _MACH_DEBUG_ZONE_INFO_H_ | ||
| 60 | #define _MACH_DEBUG_ZONE_INFO_H_ | ||
| 61 | |||
| 62 | #include <mach/boolean.h> | ||
| 63 | #include <mach/machine/vm_types.h> | ||
| 64 | |||
| 65 | /* | ||
| 66 | *	Legacy definitions for host_zone_info(). This interface, and | ||
| 67 | *	these definitions have been deprecated in favor of the new | ||
| 68 | *	mach_zone_info() inteface and types below. | ||
| 69 | */ | ||
| 70 | |||
| 71 | #define ZONE_NAME_MAX_LEN 80 | ||
| 72 | |||
| 73 | typedef struct zone_name { | ||
| 74 | 	char zn_name[ZONE_NAME_MAX_LEN]; | ||
| 75 | } zone_name_t; | ||
| 76 | |||
| 77 | typedef zone_name_t *zone_name_array_t; | ||
| 78 | |||
| 79 | |||
| 80 | typedef struct zone_info { | ||
| 81 | 	integer_t zi_count; /* Number of elements used now */ | ||
| 82 | 	vm_size_t zi_cur_size; /* current memory utilization */ | ||
| 83 | 	vm_size_t zi_max_size; /* how large can this zone grow */ | ||
| 84 | 	vm_size_t zi_elem_size; /* size of an element */ | ||
| 85 | 	vm_size_t zi_alloc_size; /* size used for more memory */ | ||
| 86 | 	integer_t zi_pageable; /* zone pageable? */ | ||
| 87 | 	integer_t zi_sleepable; /* sleep if empty? */ | ||
| 88 | 	integer_t zi_exhaustible; /* merely return if empty? */ | ||
| 89 | 	integer_t zi_collectable; /* garbage collect elements? */ | ||
| 90 | } zone_info_t; | ||
| 91 | |||
| 92 | typedef zone_info_t *zone_info_array_t; | ||
| 93 | |||
| 94 | |||
| 95 | /* | ||
| 96 | *	Remember to update the mig type definitions | ||
| 97 | *	in mach_debug_types.defs when adding/removing fields. | ||
| 98 | */ | ||
| 99 | |||
| 100 | #define MACH_ZONE_NAME_MAX_LEN 80 | ||
| 101 | |||
| 102 | typedef struct mach_zone_name { | ||
| 103 | 	char mzn_name[ZONE_NAME_MAX_LEN]; | ||
| 104 | } mach_zone_name_t; | ||
| 105 | |||
| 106 | typedef mach_zone_name_t *mach_zone_name_array_t; | ||
| 107 | |||
| 108 | typedef struct mach_zone_info_data { | ||
| 109 | 	uint64_t mzi_count; /* count of elements in use */ | ||
| 110 | 	uint64_t mzi_cur_size; /* current memory utilization */ | ||
| 111 | 	uint64_t mzi_max_size; /* how large can this zone grow */ | ||
| 112 | 	uint64_t mzi_elem_size; /* size of an element */ | ||
| 113 | 	uint64_t mzi_alloc_size; /* size used for more memory */ | ||
| 114 | 	uint64_t mzi_sum_size; /* sum of all allocs (life of zone) */ | ||
| 115 | 	uint64_t mzi_exhaustible; /* merely return if empty? */ | ||
| 116 | 	uint64_t mzi_collectable; /* garbage collect elements? and how much? */ | ||
| 117 | } mach_zone_info_t; | ||
| 118 | |||
| 119 | typedef mach_zone_info_t *mach_zone_info_array_t; | ||
| 120 | |||
| 121 | /* | ||
| 122 | * The lowest bit of mzi_collectable indicates whether or not the zone | ||
| 123 | * is collectable by zone_gc(). The higher bits contain the size in bytes | ||
| 124 | * that can be collected. | ||
| 125 | */ | ||
| 126 | #define GET_MZI_COLLECTABLE_BYTES(val) ((val) >> 1) | ||
| 127 | #define GET_MZI_COLLECTABLE_FLAG(val) ((val) & 1) | ||
| 128 | |||
| 129 | #define SET_MZI_COLLECTABLE_BYTES(val, size) \ | ||
| 130 | 	(val) = ((val) & 1) | ((size) << 1) | ||
| 131 | #define SET_MZI_COLLECTABLE_FLAG(val, flag) \ | ||
| 132 | 	(val) = (flag) ? ((val) | 1) : (val) | ||
| 133 | |||
| 134 | typedef struct task_zone_info_data { | ||
| 135 | 	uint64_t tzi_count; /* count of elements in use */ | ||
| 136 | 	uint64_t tzi_cur_size; /* current memory utilization */ | ||
| 137 | 	uint64_t tzi_max_size; /* how large can this zone grow */ | ||
| 138 | 	uint64_t tzi_elem_size; /* size of an element */ | ||
| 139 | 	uint64_t tzi_alloc_size; /* size used for more memory */ | ||
| 140 | 	uint64_t tzi_sum_size; /* sum of all allocs (life of zone) */ | ||
| 141 | 	uint64_t tzi_exhaustible; /* merely return if empty? */ | ||
| 142 | 	uint64_t tzi_collectable; /* garbage collect elements? */ | ||
| 143 | 	uint64_t tzi_caller_acct; /* charged to caller (or kernel) */ | ||
| 144 | 	uint64_t tzi_task_alloc; /* sum of all allocs by this task */ | ||
| 145 | 	uint64_t tzi_task_free; /* sum of all frees by this task */ | ||
| 146 | } task_zone_info_t; | ||
| 147 | |||
| 148 | typedef task_zone_info_t *task_zone_info_array_t; | ||
| 149 | |||
| 150 | #define MACH_MEMORY_INFO_NAME_MAX_LEN 80 | ||
| 151 | |||
| 152 | typedef struct mach_memory_info { | ||
| 153 | 	uint64_t flags; | ||
| 154 | 	uint64_t site; | ||
| 155 | 	uint64_t size; | ||
| 156 | 	uint64_t free; | ||
| 157 | 	uint64_t largest; | ||
| 158 | 	uint64_t collectable_bytes; | ||
| 159 | 	uint64_t mapped; | ||
| 160 | 	uint64_t peak; | ||
| 161 | 	uint16_t tag; | ||
| 162 | 	uint16_t zone; | ||
| 163 | 	uint16_t _resvA[2]; | ||
| 164 | 	uint64_t _resv[3]; | ||
| 165 | 	char name[MACH_MEMORY_INFO_NAME_MAX_LEN]; | ||
| 166 | } mach_memory_info_t; | ||
| 167 | |||
| 168 | typedef mach_memory_info_t *mach_memory_info_array_t; | ||
| 169 | |||
| 170 | /* | ||
| 171 | * MAX_ZTRACE_DEPTH configures how deep of a stack trace is taken on each zalloc in the zone of interest. 15 | ||
| 172 | * levels is usually enough to get past all the layers of code in kalloc and IOKit and see who the actual | ||
| 173 | * caller is up above these lower levels. | ||
| 174 | * | ||
| 175 | * This is used both for the zone leak detector and the zone corruption log. Make sure this isn't greater than | ||
| 176 | * BTLOG_MAX_DEPTH defined in btlog.h. Also make sure to update the definition of zone_btrecord_t in | ||
| 177 | * mach_debug_types.defs if this changes. | ||
| 178 | */ | ||
| 179 | |||
| 180 | #define MAX_ZTRACE_DEPTH 15 | ||
| 181 | |||
| 182 | /* | ||
| 183 | * Opcodes for the btlog operation field: | ||
| 184 | */ | ||
| 185 | |||
| 186 | #define ZOP_ALLOC 1 | ||
| 187 | #define ZOP_FREE 0 | ||
| 188 | |||
| 189 | /* | ||
| 190 | * Structure used to copy out btlog records to userspace, via the MIG call | ||
| 191 | * mach_zone_get_btlog_records(). | ||
| 192 | */ | ||
| 193 | typedef struct zone_btrecord { | ||
| 194 | 	uint32_t ref_count; /* no. of active references on the record */ | ||
| 195 | 	uint32_t operation_type; /* operation type (alloc/free) */ | ||
| 196 | 	uint64_t bt[MAX_ZTRACE_DEPTH]; /* backtrace */ | ||
| 197 | } zone_btrecord_t; | ||
| 198 | |||
| 199 | typedef zone_btrecord_t *zone_btrecord_array_t; | ||
| 200 | |||
| 201 | #endif /* _MACH_DEBUG_ZONE_INFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/machine/_mcontext.h+2| ... | @@ -27,6 +27,8 @@ | ... | @@ -27,6 +27,8 @@ |
| 27 | */ | 27 | */ |
| 28 | #if defined (__i386__) || defined (__x86_64__) | 28 | #if defined (__i386__) || defined (__x86_64__) |
| 29 | #include "i386/_mcontext.h" | 29 | #include "i386/_mcontext.h" |
| 30 | #elif defined (__arm__) || defined (__arm64__) | ||
| 31 | #include "arm/_mcontext.h" | ||
| 30 | #else | 32 | #else |
| 31 | #error architecture not supported | 33 | #error architecture not supported |
| 32 | #endif | 34 | #endif |
lib/libc/include/x86_64-macos-gnu/machine/_param.h created+34| ... | @@ -0,0 +1,34 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #if defined (__i386__) || defined (__x86_64__) | ||
| 29 | #include <i386/_param.h> | ||
| 30 | #elif defined (__arm__) || defined (__arm64__) | ||
| 31 | #include <arm/_param.h> | ||
| 32 | #else | ||
| 33 | #error architecture not supported | ||
| 34 | #endif | ||
lib/libc/include/x86_64-macos-gnu/machine/_types.h+2| ... | @@ -30,6 +30,8 @@ | ... | @@ -30,6 +30,8 @@ |
| 30 | 30 | ||
| 31 | #if defined (__i386__) || defined(__x86_64__) | 31 | #if defined (__i386__) || defined(__x86_64__) |
| 32 | #include "i386/_types.h" | 32 | #include "i386/_types.h" |
| 33 | #elif defined (__arm__) || defined (__arm64__) | ||
| 34 | #include "arm/_types.h" | ||
| 33 | #else | 35 | #else |
| 34 | #error architecture not supported | 36 | #error architecture not supported |
| 35 | #endif | 37 | #endif |
lib/libc/include/x86_64-macos-gnu/machine/endian.h+2| ... | @@ -33,6 +33,8 @@ | ... | @@ -33,6 +33,8 @@ |
| 33 | 33 | ||
| 34 | #if defined (__i386__) || defined(__x86_64__) | 34 | #if defined (__i386__) || defined(__x86_64__) |
| 35 | #include "i386/endian.h" | 35 | #include "i386/endian.h" |
| 36 | #elif defined (__arm__) || defined (__arm64__) | ||
| 37 | #include "arm/endian.h" | ||
| 36 | #else | 38 | #else |
| 37 | #error architecture not supported | 39 | #error architecture not supported |
| 38 | #endif | 40 | #endif |
lib/libc/include/x86_64-macos-gnu/machine/limits.h+2| ... | @@ -4,6 +4,8 @@ | ... | @@ -4,6 +4,8 @@ |
| 4 | * This file is public domain. */ | 4 | * This file is public domain. */ |
| 5 | #if defined (__i386__) || defined(__x86_64__) | 5 | #if defined (__i386__) || defined(__x86_64__) |
| 6 | #include <i386/limits.h> | 6 | #include <i386/limits.h> |
| 7 | #elif defined (__arm__) || defined (__arm64__) | ||
| 8 | #include <arm/limits.h> | ||
| 7 | #else | 9 | #else |
| 8 | #error architecture not supported | 10 | #error architecture not supported |
| 9 | #endif | 11 | #endif |
lib/libc/include/x86_64-macos-gnu/machine/param.h created+42| ... | @@ -0,0 +1,42 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright 1995 NeXT Computer, Inc. All rights reserved. | ||
| 30 | */ | ||
| 31 | #ifndef _BSD_MACHINE_PARAM_H_ | ||
| 32 | #define _BSD_MACHINE_PARAM_H_ | ||
| 33 | |||
| 34 | #if defined (__i386__) || defined(__x86_64__) | ||
| 35 | #include <i386/param.h> | ||
| 36 | #elif defined (__arm__) || defined (__arm64__) | ||
| 37 | #include <arm/param.h> | ||
| 38 | #else | ||
| 39 | #error architecture not supported | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #endif /* _BSD_MACHINE_PARAM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/machine/signal.h+2| ... | @@ -30,6 +30,8 @@ | ... | @@ -30,6 +30,8 @@ |
| 30 | 30 | ||
| 31 | #if defined (__i386__) || defined(__x86_64__) | 31 | #if defined (__i386__) || defined(__x86_64__) |
| 32 | #include "i386/signal.h" | 32 | #include "i386/signal.h" |
| 33 | #elif defined (__arm__) || defined (__arm64__) | ||
| 34 | #include "arm/signal.h" | ||
| 33 | #else | 35 | #else |
| 34 | #error architecture not supported | 36 | #error architecture not supported |
| 35 | #endif | 37 | #endif |
lib/libc/include/x86_64-macos-gnu/machine/types.h+2| ... | @@ -33,6 +33,8 @@ | ... | @@ -33,6 +33,8 @@ |
| 33 | 33 | ||
| 34 | #if defined (__i386__) || defined(__x86_64__) | 34 | #if defined (__i386__) || defined(__x86_64__) |
| 35 | #include "i386/types.h" | 35 | #include "i386/types.h" |
| 36 | #elif defined (__arm__) || defined (__arm64__) | ||
| 37 | #include "arm/types.h" | ||
| 36 | #else | 38 | #else |
| 37 | #error architecture not supported | 39 | #error architecture not supported |
| 38 | #endif | 40 | #endif |
lib/libc/include/x86_64-macos-gnu/malloc/_malloc.h+3-3| ... | @@ -44,9 +44,9 @@ void	*realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2); | ... | @@ -44,9 +44,9 @@ void	*realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2); |
| 44 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | 44 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) |
| 45 | void	*valloc(size_t) __alloc_size(1); | 45 | void	*valloc(size_t) __alloc_size(1); |
| 46 | #endif // !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | 46 | #endif // !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) |
| 47 | #if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) && \ | 47 | #if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \ |
| 48 | ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ | 48 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ |
| 49 | (defined(__cplusplus) && __cplusplus >= 201703L)) | 49 | (defined(__cplusplus) && __cplusplus >= 201703L) |
| 50 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0); | 50 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0); |
| 51 | #endif | 51 | #endif |
| 52 | int 	 posix_memalign(void **__memptr, size_t __alignment, size_t __size) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | 52 | int 	 posix_memalign(void **__memptr, size_t __alignment, size_t __size) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); |
lib/libc/include/x86_64-macos-gnu/math.h+4| ... | @@ -547,6 +547,7 @@ extern long double fmal(long double, long double, long double); | ... | @@ -547,6 +547,7 @@ extern long double fmal(long double, long double, long double); |
| 547 | #define islessgreater(x, y) __builtin_islessgreater((x),(y)) | 547 | #define islessgreater(x, y) __builtin_islessgreater((x),(y)) |
| 548 | #define isunordered(x, y) __builtin_isunordered((x),(y)) | 548 | #define isunordered(x, y) __builtin_isunordered((x),(y)) |
| 549 | 549 | ||
| 550 | #if defined __i386__ || defined __x86_64__ | ||
| 550 | /* Deprecated functions; use the INFINITY and NAN macros instead. */ | 551 | /* Deprecated functions; use the INFINITY and NAN macros instead. */ |
| 551 | extern float __inff(void) | 552 | extern float __inff(void) |
| 552 | __API_DEPRECATED("use `(float)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); | 553 | __API_DEPRECATED("use `(float)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); |
| ... | @@ -556,6 +557,7 @@ extern long double __infl(void) | ... | @@ -556,6 +557,7 @@ extern long double __infl(void) |
| 556 | __API_DEPRECATED("use `(long double)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); | 557 | __API_DEPRECATED("use `(long double)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); |
| 557 | extern float __nan(void) | 558 | extern float __nan(void) |
| 558 | __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios, watchos, tvos); | 559 | __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios, watchos, tvos); |
| 560 | #endif | ||
| 559 | 561 | ||
| 560 | /****************************************************************************** | 562 | /****************************************************************************** |
| 561 | * Reentrant variants of lgamma[fl] * | 563 | * Reentrant variants of lgamma[fl] * |
| ... | @@ -736,6 +738,7 @@ extern int signgam; | ... | @@ -736,6 +738,7 @@ extern int signgam; |
| 736 | #define	TLOSS		5 | 738 | #define	TLOSS		5 |
| 737 | #define	PLOSS		6 | 739 | #define	PLOSS		6 |
| 738 | 740 | ||
| 741 | #if defined __i386__ || defined __x86_64__ | ||
| 739 | /* Legacy BSD API; use the C99 `lrint( )` function instead. */ | 742 | /* Legacy BSD API; use the C99 `lrint( )` function instead. */ |
| 740 | extern long int rinttol(double) | 743 | extern long int rinttol(double) |
| 741 | __API_DEPRECATED_WITH_REPLACEMENT("lrint", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); | 744 | __API_DEPRECATED_WITH_REPLACEMENT("lrint", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); |
| ... | @@ -754,6 +757,7 @@ __API_DEPRECATED_WITH_REPLACEMENT("tgamma", macos(10.0, 10.9)) __API_UNAVAILABLE | ... | @@ -754,6 +757,7 @@ __API_DEPRECATED_WITH_REPLACEMENT("tgamma", macos(10.0, 10.9)) __API_UNAVAILABLE |
| 754 | /* Legacy BSD API; use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead. */ | 757 | /* Legacy BSD API; use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead. */ |
| 755 | extern double significand(double) | 758 | extern double significand(double) |
| 756 | __API_DEPRECATED("Use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead.", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); | 759 | __API_DEPRECATED("Use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead.", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); |
| 760 | #endif | ||
| 757 | 761 | ||
| 758 | #if !defined __cplusplus | 762 | #if !defined __cplusplus |
| 759 | struct exception { | 763 | struct exception { |
lib/libc/include/x86_64-macos-gnu/monetary.h created+45| ... | @@ -0,0 +1,45 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer in the | ||
| 12 | * documentation and/or other materials provided with the distribution. | ||
| 13 | * | ||
| 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 24 | * SUCH DAMAGE. | ||
| 25 | * | ||
| 26 | * $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _MONETARY_H_ | ||
| 30 | #define	_MONETARY_H_ | ||
| 31 | |||
| 32 | #include <sys/cdefs.h> | ||
| 33 | #include <_types.h> | ||
| 34 | #include <sys/_types/_size_t.h> | ||
| 35 | #include <sys/_types/_ssize_t.h> | ||
| 36 | |||
| 37 | __BEGIN_DECLS | ||
| 38 | ssize_t	strfmon(char *, size_t, const char *, ...); | ||
| 39 | __END_DECLS | ||
| 40 | |||
| 41 | #ifdef _USE_EXTENDED_LOCALES_ | ||
| 42 | #include <xlocale/_monetary.h> | ||
| 43 | #endif /* _USE_EXTENDED_LOCALES_ */ | ||
| 44 | |||
| 45 | #endif /* !_MONETARY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/ndbm.h created+120| ... | @@ -0,0 +1,120 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1990, 1993 | ||
| 25 | *	The Regents of the University of California. All rights reserved. | ||
| 26 | * | ||
| 27 | * This code is derived from software contributed to Berkeley by | ||
| 28 | * Margo Seltzer. | ||
| 29 | * | ||
| 30 | * Redistribution and use in source and binary forms, with or without | ||
| 31 | * modification, are permitted provided that the following conditions | ||
| 32 | * are met: | ||
| 33 | * 1. Redistributions of source code must retain the above copyright | ||
| 34 | * notice, this list of conditions and the following disclaimer. | ||
| 35 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer in the | ||
| 37 | * documentation and/or other materials provided with the distribution. | ||
| 38 | * 3. All advertising materials mentioning features or use of this software | ||
| 39 | * must display the following acknowledgement: | ||
| 40 | *	This product includes software developed by the University of | ||
| 41 | *	California, Berkeley and its contributors. | ||
| 42 | * 4. Neither the name of the University nor the names of its contributors | ||
| 43 | * may be used to endorse or promote products derived from this software | ||
| 44 | * without specific prior written permission. | ||
| 45 | * | ||
| 46 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 47 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 48 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 49 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 50 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 51 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 52 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 56 | * SUCH DAMAGE. | ||
| 57 | * | ||
| 58 | *	@(#)ndbm.h	8.1 (Berkeley) 6/2/93 | ||
| 59 | */ | ||
| 60 | |||
| 61 | #ifndef _NDBM_H_ | ||
| 62 | #define	_NDBM_H_ | ||
| 63 | |||
| 64 | #include <_types.h> | ||
| 65 | #include <sys/_types/_mode_t.h> | ||
| 66 | #include <sys/_types/_size_t.h> | ||
| 67 | |||
| 68 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 69 | /* Map dbm interface onto db(3). */ | ||
| 70 | #include <fcntl.h> | ||
| 71 | #define DBM_RDONLY	O_RDONLY | ||
| 72 | #endif | ||
| 73 | |||
| 74 | /* Flags to dbm_store(). */ | ||
| 75 | #define DBM_INSERT 0 | ||
| 76 | #define DBM_REPLACE 1 | ||
| 77 | |||
| 78 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 79 | /* | ||
| 80 | * The db(3) support for ndbm(3) always appends this suffix to the | ||
| 81 | * file name to avoid overwriting the user's original database. | ||
| 82 | */ | ||
| 83 | #define	DBM_SUFFIX	".db" | ||
| 84 | #endif | ||
| 85 | |||
| 86 | typedef struct { | ||
| 87 | 	void *dptr; | ||
| 88 | 	size_t dsize; | ||
| 89 | } datum; | ||
| 90 | |||
| 91 | #ifndef _DBM | ||
| 92 | #define _DBM | ||
| 93 | typedef struct { | ||
| 94 | char __opaque[sizeof(int) + 8 * sizeof(void *)]; | ||
| 95 | } DBM; | ||
| 96 | #endif /* _DBM */ | ||
| 97 | |||
| 98 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 99 | #define	dbm_pagfno(a)	DBM_PAGFNO_NOT_AVAILABLE | ||
| 100 | #endif | ||
| 101 | |||
| 102 | __BEGIN_DECLS | ||
| 103 | int	 dbm_clearerr( DBM *); | ||
| 104 | void	 dbm_close(DBM *); | ||
| 105 | int	 dbm_delete(DBM *, datum); | ||
| 106 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 107 | int	 dbm_dirfno(DBM *); | ||
| 108 | #endif | ||
| 109 | int	 dbm_error( DBM *); | ||
| 110 | datum	 dbm_fetch(DBM *, datum); | ||
| 111 | datum	 dbm_firstkey(DBM *); | ||
| 112 | #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) | ||
| 113 | long	 dbm_forder(DBM *, datum); | ||
| 114 | #endif | ||
| 115 | datum	 dbm_nextkey(DBM *); | ||
| 116 | DBM	*dbm_open(const char *, int, mode_t); | ||
| 117 | int	 dbm_store(DBM *, datum, datum, int); | ||
| 118 | __END_DECLS | ||
| 119 | |||
| 120 | #endif /* !_NDBM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/net/if.h created+442| ... | @@ -0,0 +1,442 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1982, 1986, 1989, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | *	This product includes software developed by the University of | ||
| 43 | *	California, Berkeley and its contributors. | ||
| 44 | * 4. Neither the name of the University nor the names of its contributors | ||
| 45 | * may be used to endorse or promote products derived from this software | ||
| 46 | * without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 58 | * SUCH DAMAGE. | ||
| 59 | * | ||
| 60 | *	@(#)if.h	8.1 (Berkeley) 6/10/93 | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _NET_IF_H_ | ||
| 64 | #define _NET_IF_H_ | ||
| 65 | |||
| 66 | #include <sys/cdefs.h> | ||
| 67 | #include <net/net_kev.h> | ||
| 68 | |||
| 69 | #define IF_NAMESIZE 16 | ||
| 70 | |||
| 71 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 72 | #include <sys/appleapiopts.h> | ||
| 73 | #ifdef __APPLE__ | ||
| 74 | |||
| 75 | #include <net/if_var.h> | ||
| 76 | #include <sys/types.h> | ||
| 77 | #include <sys/socket.h> | ||
| 78 | |||
| 79 | #endif | ||
| 80 | |||
| 81 | struct if_clonereq { | ||
| 82 | 	int ifcr_total; /* total cloners (out) */ | ||
| 83 | 	int ifcr_count; /* room for this many in user buffer */ | ||
| 84 | 	char *ifcr_buffer; /* buffer for cloner names */ | ||
| 85 | }; | ||
| 86 | |||
| 87 | |||
| 88 | #define IFF_UP 0x1 /* interface is up */ | ||
| 89 | #define IFF_BROADCAST 0x2 /* broadcast address valid */ | ||
| 90 | #define IFF_DEBUG 0x4 /* turn on debugging */ | ||
| 91 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ | ||
| 92 | #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ | ||
| 93 | #define IFF_NOTRAILERS 0x20 /* obsolete: avoid use of trailers */ | ||
| 94 | #define IFF_RUNNING 0x40 /* resources allocated */ | ||
| 95 | #define IFF_NOARP 0x80 /* no address resolution protocol */ | ||
| 96 | #define IFF_PROMISC 0x100 /* receive all packets */ | ||
| 97 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets */ | ||
| 98 | #define IFF_OACTIVE 0x400 /* transmission in progress */ | ||
| 99 | #define IFF_SIMPLEX 0x800 /* can't hear own transmissions */ | ||
| 100 | #define IFF_LINK0 0x1000 /* per link layer defined bit */ | ||
| 101 | #define IFF_LINK1 0x2000 /* per link layer defined bit */ | ||
| 102 | #define IFF_LINK2 0x4000 /* per link layer defined bit */ | ||
| 103 | #define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */ | ||
| 104 | #define IFF_MULTICAST 0x8000 /* supports multicast */ | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | /* | ||
| 109 | * Capabilities that interfaces can advertise. | ||
| 110 | * | ||
| 111 | * struct ifnet.if_capabilities | ||
| 112 | * contains the optional features & capabilities a particular interface | ||
| 113 | * supports (not only the driver but also the detected hw revision). | ||
| 114 | * Capabilities are defined by IFCAP_* below. | ||
| 115 | * struct ifnet.if_capenable | ||
| 116 | * contains the enabled (either by default or through ifconfig) optional | ||
| 117 | * features & capabilities on this interface. | ||
| 118 | * Capabilities are defined by IFCAP_* below. | ||
| 119 | * struct if_data.ifi_hwassist in IFNET_* form, defined in net/kpi_interface.h, | ||
| 120 | * contains the enabled optional features & capabilites that can be used | ||
| 121 | * individually per packet and are specified in the mbuf pkthdr.csum_flags | ||
| 122 | * field. IFCAP_* and IFNET_* do not match one to one and IFNET_* may be | ||
| 123 | * more detailed or differentiated than IFCAP_*. | ||
| 124 | * IFNET_* hwassist flags have corresponding CSUM_* in sys/mbuf.h | ||
| 125 | */ | ||
| 126 | #define IFCAP_RXCSUM 0x00001 /* can offload checksum on RX */ | ||
| 127 | #define IFCAP_TXCSUM 0x00002 /* can offload checksum on TX */ | ||
| 128 | #define IFCAP_VLAN_MTU 0x00004 /* VLAN-compatible MTU */ | ||
| 129 | #define IFCAP_VLAN_HWTAGGING 0x00008 /* hardware VLAN tag support */ | ||
| 130 | #define IFCAP_JUMBO_MTU 0x00010 /* 9000 byte MTU supported */ | ||
| 131 | #define IFCAP_TSO4 0x00020 /* can do TCP Segmentation Offload */ | ||
| 132 | #define IFCAP_TSO6 0x00040 /* can do TCP6 Segmentation Offload */ | ||
| 133 | #define IFCAP_LRO 0x00080 /* can do Large Receive Offload */ | ||
| 134 | #define IFCAP_AV 0x00100 /* can do 802.1 AV Bridging */ | ||
| 135 | #define IFCAP_TXSTATUS 0x00200 /* can return linklevel xmit status */ | ||
| 136 | #define IFCAP_SKYWALK 0x00400 /* Skywalk mode supported/enabled */ | ||
| 137 | #define IFCAP_HW_TIMESTAMP 0x00800 /* Time stamping in hardware */ | ||
| 138 | #define IFCAP_SW_TIMESTAMP 0x01000 /* Time stamping in software */ | ||
| 139 | #define IFCAP_CSUM_PARTIAL 0x02000 /* can offload partial checksum */ | ||
| 140 | #define IFCAP_CSUM_ZERO_INVERT 0x04000 /* can invert 0 to -0 (0xffff) */ | ||
| 141 | |||
| 142 | #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) | ||
| 143 | #define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6) | ||
| 144 | |||
| 145 | #define IFCAP_VALID (IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO | IFCAP_VLAN_MTU | \ | ||
| 146 | 	IFCAP_VLAN_HWTAGGING | IFCAP_JUMBO_MTU | IFCAP_AV | IFCAP_TXSTATUS | \ | ||
| 147 | 	IFCAP_SKYWALK | IFCAP_SW_TIMESTAMP | IFCAP_HW_TIMESTAMP | \ | ||
| 148 | 	IFCAP_CSUM_PARTIAL | IFCAP_CSUM_ZERO_INVERT) | ||
| 149 | |||
| 150 | #define IFQ_MAXLEN 128 | ||
| 151 | #define IFNET_SLOWHZ 1 /* granularity is 1 second */ | ||
| 152 | #define IFQ_TARGET_DELAY (10ULL * 1000 * 1000) /* 10 ms */ | ||
| 153 | #define IFQ_UPDATE_INTERVAL (100ULL * 1000 * 1000) /* 100 ms */ | ||
| 154 | |||
| 155 | /* | ||
| 156 | * Message format for use in obtaining information about interfaces | ||
| 157 | * from sysctl and the routing socket | ||
| 158 | */ | ||
| 159 | struct if_msghdr { | ||
| 160 | 	unsigned short ifm_msglen; /* to skip non-understood messages */ | ||
| 161 | 	unsigned char ifm_version; /* future binary compatability */ | ||
| 162 | 	unsigned char ifm_type; /* message type */ | ||
| 163 | 	int ifm_addrs; /* like rtm_addrs */ | ||
| 164 | 	int ifm_flags; /* value of if_flags */ | ||
| 165 | 	unsigned short ifm_index; /* index for associated ifp */ | ||
| 166 | 	struct if_data ifm_data; /* statistics and other data about if */ | ||
| 167 | }; | ||
| 168 | |||
| 169 | /* | ||
| 170 | * Message format for use in obtaining information about interface addresses | ||
| 171 | * from sysctl and the routing socket | ||
| 172 | */ | ||
| 173 | struct ifa_msghdr { | ||
| 174 | 	unsigned short ifam_msglen; /* to skip non-understood messages */ | ||
| 175 | 	unsigned char ifam_version; /* future binary compatability */ | ||
| 176 | 	unsigned char ifam_type; /* message type */ | ||
| 177 | 	int ifam_addrs; /* like rtm_addrs */ | ||
| 178 | 	int ifam_flags; /* value of ifa_flags */ | ||
| 179 | 	unsigned short ifam_index; /* index for associated ifp */ | ||
| 180 | 	int ifam_metric; /* value of ifa_metric */ | ||
| 181 | }; | ||
| 182 | |||
| 183 | /* | ||
| 184 | * Message format for use in obtaining information about multicast addresses | ||
| 185 | * from the routing socket | ||
| 186 | */ | ||
| 187 | struct ifma_msghdr { | ||
| 188 | 	unsigned short ifmam_msglen; /* to skip non-understood messages */ | ||
| 189 | 	unsigned char ifmam_version; /* future binary compatability */ | ||
| 190 | 	unsigned char ifmam_type; /* message type */ | ||
| 191 | 	int ifmam_addrs; /* like rtm_addrs */ | ||
| 192 | 	int ifmam_flags; /* value of ifa_flags */ | ||
| 193 | 	unsigned short ifmam_index; /* index for associated ifp */ | ||
| 194 | }; | ||
| 195 | |||
| 196 | /* | ||
| 197 | * Message format for use in obtaining information about interfaces | ||
| 198 | * from sysctl | ||
| 199 | */ | ||
| 200 | struct if_msghdr2 { | ||
| 201 | 	u_short ifm_msglen; /* to skip over non-understood messages */ | ||
| 202 | 	u_char ifm_version; /* future binary compatability */ | ||
| 203 | 	u_char ifm_type; /* message type */ | ||
| 204 | 	int ifm_addrs; /* like rtm_addrs */ | ||
| 205 | 	int ifm_flags; /* value of if_flags */ | ||
| 206 | 	u_short ifm_index; /* index for associated ifp */ | ||
| 207 | 	int ifm_snd_len; /* instantaneous length of send queue */ | ||
| 208 | 	int ifm_snd_maxlen; /* maximum length of send queue */ | ||
| 209 | 	int ifm_snd_drops; /* number of drops in send queue */ | ||
| 210 | 	int ifm_timer; /* time until if_watchdog called */ | ||
| 211 | 	struct if_data64 ifm_data; /* statistics and other data */ | ||
| 212 | }; | ||
| 213 | |||
| 214 | /* | ||
| 215 | * Message format for use in obtaining information about multicast addresses | ||
| 216 | * from sysctl | ||
| 217 | */ | ||
| 218 | struct ifma_msghdr2 { | ||
| 219 | 	u_short ifmam_msglen; /* to skip over non-understood messages */ | ||
| 220 | 	u_char ifmam_version; /* future binary compatability */ | ||
| 221 | 	u_char ifmam_type; /* message type */ | ||
| 222 | 	int ifmam_addrs; /* like rtm_addrs */ | ||
| 223 | 	int ifmam_flags; /* value of ifa_flags */ | ||
| 224 | 	u_short ifmam_index; /* index for associated ifp */ | ||
| 225 | 	int32_t ifmam_refcount; | ||
| 226 | }; | ||
| 227 | |||
| 228 | /* | ||
| 229 | * ifdevmtu: interface device mtu | ||
| 230 | * Used with SIOCGIFDEVMTU to get the current mtu in use by the device, | ||
| 231 | * as well as the minimum and maximum mtu allowed by the device. | ||
| 232 | */ | ||
| 233 | struct ifdevmtu { | ||
| 234 | 	int ifdm_current; | ||
| 235 | 	int ifdm_min; | ||
| 236 | 	int ifdm_max; | ||
| 237 | }; | ||
| 238 | |||
| 239 | #pragma pack(4) | ||
| 240 | |||
| 241 | /* | ||
| 242 | * ifkpi: interface kpi ioctl | ||
| 243 | * Used with SIOCSIFKPI and SIOCGIFKPI. | ||
| 244 | * | ||
| 245 | * ifk_module_id - From in the kernel, a value from kev_vendor_code_find. From | ||
| 246 | * user space, a value from SIOCGKEVVENDOR ioctl on a kernel event socket. | ||
| 247 | * ifk_type - The type. Types are specific to each module id. | ||
| 248 | * ifk_data - The data. ifk_ptr may be a 64bit pointer for 64 bit processes. | ||
| 249 | * | ||
| 250 | * Copying data between user space and kernel space is done using copyin | ||
| 251 | * and copyout. A process may be running in 64bit mode. In such a case, | ||
| 252 | * the pointer will be a 64bit pointer, not a 32bit pointer. The following | ||
| 253 | * sample is a safe way to copy the data in to the kernel from either a | ||
| 254 | * 32bit or 64bit process: | ||
| 255 | * | ||
| 256 | * user_addr_t tmp_ptr; | ||
| 257 | * if (IS_64BIT_PROCESS(current_proc())) { | ||
| 258 | * tmp_ptr = CAST_USER_ADDR_T(ifkpi.ifk_data.ifk_ptr64); | ||
| 259 | * } | ||
| 260 | * else { | ||
| 261 | * tmp_ptr = CAST_USER_ADDR_T(ifkpi.ifk_data.ifk_ptr); | ||
| 262 | * } | ||
| 263 | * error = copyin(tmp_ptr, allocated_dst_buffer, size of allocated_dst_buffer); | ||
| 264 | */ | ||
| 265 | |||
| 266 | struct ifkpi { | ||
| 267 | 	unsigned int ifk_module_id; | ||
| 268 | 	unsigned int ifk_type; | ||
| 269 | 	union { | ||
| 270 | 		void *ifk_ptr; | ||
| 271 | 		int ifk_value; | ||
| 272 | 	} ifk_data; | ||
| 273 | }; | ||
| 274 | |||
| 275 | /* Wake capabilities of a interface */ | ||
| 276 | #define IF_WAKE_ON_MAGIC_PACKET 0x01 | ||
| 277 | |||
| 278 | |||
| 279 | #pragma pack() | ||
| 280 | |||
| 281 | /* | ||
| 282 | * Interface request structure used for socket | ||
| 283 | * ioctl's. All interface ioctl's must have parameter | ||
| 284 | * definitions which begin with ifr_name. The | ||
| 285 | * remainder may be interface specific. | ||
| 286 | */ | ||
| 287 | struct ifreq { | ||
| 288 | #ifndef IFNAMSIZ | ||
| 289 | #define IFNAMSIZ IF_NAMESIZE | ||
| 290 | #endif | ||
| 291 | 	char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
| 292 | 	union { | ||
| 293 | 		struct sockaddr ifru_addr; | ||
| 294 | 		struct sockaddr ifru_dstaddr; | ||
| 295 | 		struct sockaddr ifru_broadaddr; | ||
| 296 | 		short ifru_flags; | ||
| 297 | 		int ifru_metric; | ||
| 298 | 		int ifru_mtu; | ||
| 299 | 		int ifru_phys; | ||
| 300 | 		int ifru_media; | ||
| 301 | 		int ifru_intval; | ||
| 302 | 		caddr_t ifru_data; | ||
| 303 | 		struct ifdevmtu ifru_devmtu; | ||
| 304 | 		struct ifkpi ifru_kpi; | ||
| 305 | 		u_int32_t ifru_wake_flags; | ||
| 306 | 		u_int32_t ifru_route_refcnt; | ||
| 307 | 		int ifru_cap[2]; | ||
| 308 | 		u_int32_t ifru_functional_type; | ||
| 309 | #define IFRTYPE_FUNCTIONAL_UNKNOWN 0 | ||
| 310 | #define IFRTYPE_FUNCTIONAL_LOOPBACK 1 | ||
| 311 | #define IFRTYPE_FUNCTIONAL_WIRED 2 | ||
| 312 | #define IFRTYPE_FUNCTIONAL_WIFI_INFRA 3 | ||
| 313 | #define IFRTYPE_FUNCTIONAL_WIFI_AWDL 4 | ||
| 314 | #define IFRTYPE_FUNCTIONAL_CELLULAR 5 | ||
| 315 | #define IFRTYPE_FUNCTIONAL_INTCOPROC 6 | ||
| 316 | #define IFRTYPE_FUNCTIONAL_COMPANIONLINK 7 | ||
| 317 | #define IFRTYPE_FUNCTIONAL_LAST 7 | ||
| 318 | 	} ifr_ifru; | ||
| 319 | #define ifr_addr ifr_ifru.ifru_addr /* address */ | ||
| 320 | #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ | ||
| 321 | #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ | ||
| 322 | #ifdef __APPLE__ | ||
| 323 | #define ifr_flags ifr_ifru.ifru_flags /* flags */ | ||
| 324 | #else | ||
| 325 | #define ifr_flags ifr_ifru.ifru_flags[0] /* flags */ | ||
| 326 | #define ifr_prevflags ifr_ifru.ifru_flags[1] /* flags */ | ||
| 327 | #endif /* __APPLE__ */ | ||
| 328 | #define ifr_metric ifr_ifru.ifru_metric /* metric */ | ||
| 329 | #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ | ||
| 330 | #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ | ||
| 331 | #define ifr_media ifr_ifru.ifru_media /* physical media */ | ||
| 332 | #define ifr_data ifr_ifru.ifru_data /* for use by interface */ | ||
| 333 | #define ifr_devmtu ifr_ifru.ifru_devmtu | ||
| 334 | #define ifr_intval ifr_ifru.ifru_intval /* integer value */ | ||
| 335 | #define ifr_kpi ifr_ifru.ifru_kpi | ||
| 336 | #define ifr_wake_flags ifr_ifru.ifru_wake_flags /* wake capabilities */ | ||
| 337 | #define ifr_route_refcnt ifr_ifru.ifru_route_refcnt /* route references count */ | ||
| 338 | #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ | ||
| 339 | #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ | ||
| 340 | }; | ||
| 341 | |||
| 342 | #define _SIZEOF_ADDR_IFREQ(ifr) \ | ||
| 343 | 	((ifr).ifr_addr.sa_len > sizeof (struct sockaddr) ? \ | ||
| 344 | 	(sizeof (struct ifreq) - sizeof (struct sockaddr) + \ | ||
| 345 | 	(ifr).ifr_addr.sa_len) : sizeof (struct ifreq)) | ||
| 346 | |||
| 347 | struct ifaliasreq { | ||
| 348 | 	char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
| 349 | 	struct sockaddr ifra_addr; | ||
| 350 | 	struct sockaddr ifra_broadaddr; | ||
| 351 | 	struct sockaddr ifra_mask; | ||
| 352 | }; | ||
| 353 | |||
| 354 | struct rslvmulti_req { | ||
| 355 | 	struct sockaddr *sa; | ||
| 356 | 	struct sockaddr **llsa; | ||
| 357 | }; | ||
| 358 | |||
| 359 | #pragma pack(4) | ||
| 360 | |||
| 361 | struct ifmediareq { | ||
| 362 | 	char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
| 363 | 	int ifm_current; /* current media options */ | ||
| 364 | 	int ifm_mask; /* don't care mask */ | ||
| 365 | 	int ifm_status; /* media status */ | ||
| 366 | 	int ifm_active; /* active options */ | ||
| 367 | 	int ifm_count; /* # entries in ifm_ulist array */ | ||
| 368 | 	int *ifm_ulist; /* media words */ | ||
| 369 | }; | ||
| 370 | |||
| 371 | #pragma pack() | ||
| 372 | |||
| 373 | |||
| 374 | |||
| 375 | #pragma pack(4) | ||
| 376 | struct ifdrv { | ||
| 377 | 	char ifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
| 378 | 	unsigned long ifd_cmd; | ||
| 379 | 	size_t ifd_len; /* length of ifd_data buffer */ | ||
| 380 | 	void *ifd_data; | ||
| 381 | }; | ||
| 382 | #pragma pack() | ||
| 383 | |||
| 384 | |||
| 385 | /* | ||
| 386 | * Structure used to retrieve aux status data from interfaces. | ||
| 387 | * Kernel suppliers to this interface should respect the formatting | ||
| 388 | * needed by ifconfig(8): each line starts with a TAB and ends with | ||
| 389 | * a newline. | ||
| 390 | */ | ||
| 391 | |||
| 392 | #define IFSTATMAX 800 /* 10 lines of text */ | ||
| 393 | struct ifstat { | ||
| 394 | 	char ifs_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
| 395 | 	char ascii[IFSTATMAX + 1]; | ||
| 396 | }; | ||
| 397 | |||
| 398 | /* | ||
| 399 | * Structure used in SIOCGIFCONF request. | ||
| 400 | * Used to retrieve interface configuration | ||
| 401 | * for machine (useful for programs which | ||
| 402 | * must know all networks accessible). | ||
| 403 | */ | ||
| 404 | #pragma pack(4) | ||
| 405 | struct ifconf { | ||
| 406 | 	int ifc_len; /* size of associated buffer */ | ||
| 407 | 	union { | ||
| 408 | 		caddr_t ifcu_buf; | ||
| 409 | 		struct ifreq *ifcu_req; | ||
| 410 | 	} ifc_ifcu; | ||
| 411 | }; | ||
| 412 | #pragma pack() | ||
| 413 | #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ | ||
| 414 | #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ | ||
| 415 | |||
| 416 | |||
| 417 | /* | ||
| 418 | * DLIL KEV_DL_PROTO_ATTACHED/DETACHED structure | ||
| 419 | */ | ||
| 420 | struct kev_dl_proto_data { | ||
| 421 | 	struct net_event_data link_data; | ||
| 422 | 	u_int32_t proto_family; | ||
| 423 | 	u_int32_t proto_remaining_count; | ||
| 424 | }; | ||
| 425 | |||
| 426 | |||
| 427 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 428 | |||
| 429 | struct if_nameindex { | ||
| 430 | 	unsigned int if_index; /* 1, 2, ... */ | ||
| 431 | 	char *if_name; /* null terminated name: "le0", ... */ | ||
| 432 | }; | ||
| 433 | |||
| 434 | __BEGIN_DECLS | ||
| 435 | unsigned int if_nametoindex(const char *); | ||
| 436 | char *if_indextoname(unsigned int, char *); | ||
| 437 | struct if_nameindex *if_nameindex(void); | ||
| 438 | void if_freenameindex(struct if_nameindex *); | ||
| 439 | __END_DECLS | ||
| 440 | |||
| 441 | |||
| 442 | #endif /* !_NET_IF_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/net/if_var.h created+243| ... | @@ -0,0 +1,243 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1982, 1986, 1989, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | *	This product includes software developed by the University of | ||
| 43 | *	California, Berkeley and its contributors. | ||
| 44 | * 4. Neither the name of the University nor the names of its contributors | ||
| 45 | * may be used to endorse or promote products derived from this software | ||
| 46 | * without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 58 | * SUCH DAMAGE. | ||
| 59 | * | ||
| 60 | *	From: @(#)if.h	8.1 (Berkeley) 6/10/93 | ||
| 61 | * $FreeBSD: src/sys/net/if_var.h,v 1.18.2.7 2001/07/24 19:10:18 brooks Exp $ | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _NET_IF_VAR_H_ | ||
| 65 | #define _NET_IF_VAR_H_ | ||
| 66 | |||
| 67 | #include <sys/appleapiopts.h> | ||
| 68 | #include <stdint.h> | ||
| 69 | #include <sys/types.h> | ||
| 70 | #include <sys/time.h> | ||
| 71 | #include <sys/queue.h> /* get TAILQ macros */ | ||
| 72 | #ifdef BSD_KERN_PRIVATE | ||
| 73 | #include <net/pktsched/pktsched.h> | ||
| 74 | #include <sys/eventhandler.h> | ||
| 75 | #endif | ||
| 76 | |||
| 77 | |||
| 78 | #ifdef __APPLE__ | ||
| 79 | #define APPLE_IF_FAM_LOOPBACK 1 | ||
| 80 | #define APPLE_IF_FAM_ETHERNET 2 | ||
| 81 | #define APPLE_IF_FAM_SLIP 3 | ||
| 82 | #define APPLE_IF_FAM_TUN 4 | ||
| 83 | #define APPLE_IF_FAM_VLAN 5 | ||
| 84 | #define APPLE_IF_FAM_PPP 6 | ||
| 85 | #define APPLE_IF_FAM_PVC 7 | ||
| 86 | #define APPLE_IF_FAM_DISC 8 | ||
| 87 | #define APPLE_IF_FAM_MDECAP 9 | ||
| 88 | #define APPLE_IF_FAM_GIF 10 | ||
| 89 | #define APPLE_IF_FAM_FAITH 11 /* deprecated */ | ||
| 90 | #define APPLE_IF_FAM_STF 12 | ||
| 91 | #define APPLE_IF_FAM_FIREWIRE 13 | ||
| 92 | #define APPLE_IF_FAM_BOND 14 | ||
| 93 | #define APPLE_IF_FAM_CELLULAR 15 | ||
| 94 | #define APPLE_IF_FAM_6LOWPAN 16 | ||
| 95 | #define APPLE_IF_FAM_UTUN 17 | ||
| 96 | #define APPLE_IF_FAM_IPSEC 18 | ||
| 97 | #endif /* __APPLE__ */ | ||
| 98 | |||
| 99 | /* | ||
| 100 | * 72 was chosen below because it is the size of a TCP/IP | ||
| 101 | * header (40) + the minimum mss (32). | ||
| 102 | */ | ||
| 103 | #define IF_MINMTU 72 | ||
| 104 | #define IF_MAXMTU 65535 | ||
| 105 | |||
| 106 | /* | ||
| 107 | * Structures defining a network interface, providing a packet | ||
| 108 | * transport mechanism (ala level 0 of the PUP protocols). | ||
| 109 | * | ||
| 110 | * Each interface accepts output datagrams of a specified maximum | ||
| 111 | * length, and provides higher level routines with input datagrams | ||
| 112 | * received from its medium. | ||
| 113 | * | ||
| 114 | * Output occurs when the routine if_output is called, with three parameters: | ||
| 115 | *	(*ifp->if_output)(ifp, m, dst, rt) | ||
| 116 | * Here m is the mbuf chain to be sent and dst is the destination address. | ||
| 117 | * The output routine encapsulates the supplied datagram if necessary, | ||
| 118 | * and then transmits it on its medium. | ||
| 119 | * | ||
| 120 | * On input, each interface unwraps the data received by it, and either | ||
| 121 | * places it on the input queue of a internetwork datagram routine | ||
| 122 | * and posts the associated software interrupt, or passes the datagram to a raw | ||
| 123 | * packet input routine. | ||
| 124 | * | ||
| 125 | * Routines exist for locating interfaces by their addresses | ||
| 126 | * or for locating a interface on a certain network, as well as more general | ||
| 127 | * routing and gateway routines maintaining information used to locate | ||
| 128 | * interfaces. These routines live in the files if.c and route.c | ||
| 129 | */ | ||
| 130 | |||
| 131 | #define IFNAMSIZ 16 | ||
| 132 | |||
| 133 | /* This belongs up in socket.h or socketvar.h, depending on how far the | ||
| 134 | * event bubbles up. | ||
| 135 | */ | ||
| 136 | |||
| 137 | struct net_event_data { | ||
| 138 | 	u_int32_t if_family; | ||
| 139 | 	u_int32_t if_unit; | ||
| 140 | 	char if_name[IFNAMSIZ]; | ||
| 141 | }; | ||
| 142 | |||
| 143 | #if defined(__LP64__) | ||
| 144 | #include <sys/_types/_timeval32.h> | ||
| 145 | #define IF_DATA_TIMEVAL timeval32 | ||
| 146 | #else | ||
| 147 | #define IF_DATA_TIMEVAL timeval | ||
| 148 | #endif | ||
| 149 | |||
| 150 | #pragma pack(4) | ||
| 151 | |||
| 152 | /* | ||
| 153 | * Structure describing information about an interface | ||
| 154 | * which may be of interest to management entities. | ||
| 155 | */ | ||
| 156 | struct if_data { | ||
| 157 | 	/* generic interface information */ | ||
| 158 | 	u_char ifi_type; /* ethernet, tokenring, etc */ | ||
| 159 | 	u_char ifi_typelen; /* Length of frame type id */ | ||
| 160 | 	u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ | ||
| 161 | 	u_char ifi_addrlen; /* media address length */ | ||
| 162 | 	u_char ifi_hdrlen; /* media header length */ | ||
| 163 | 	u_char ifi_recvquota; /* polling quota for receive intrs */ | ||
| 164 | 	u_char ifi_xmitquota; /* polling quota for xmit intrs */ | ||
| 165 | 	u_char ifi_unused1; /* for future use */ | ||
| 166 | 	u_int32_t ifi_mtu; /* maximum transmission unit */ | ||
| 167 | 	u_int32_t ifi_metric; /* routing metric (external only) */ | ||
| 168 | 	u_int32_t ifi_baudrate; /* linespeed */ | ||
| 169 | 	/* volatile statistics */ | ||
| 170 | 	u_int32_t ifi_ipackets; /* packets received on interface */ | ||
| 171 | 	u_int32_t ifi_ierrors; /* input errors on interface */ | ||
| 172 | 	u_int32_t ifi_opackets; /* packets sent on interface */ | ||
| 173 | 	u_int32_t ifi_oerrors; /* output errors on interface */ | ||
| 174 | 	u_int32_t ifi_collisions; /* collisions on csma interfaces */ | ||
| 175 | 	u_int32_t ifi_ibytes; /* total number of octets received */ | ||
| 176 | 	u_int32_t ifi_obytes; /* total number of octets sent */ | ||
| 177 | 	u_int32_t ifi_imcasts; /* packets received via multicast */ | ||
| 178 | 	u_int32_t ifi_omcasts; /* packets sent via multicast */ | ||
| 179 | 	u_int32_t ifi_iqdrops; /* dropped on input, this interface */ | ||
| 180 | 	u_int32_t ifi_noproto; /* destined for unsupported protocol */ | ||
| 181 | 	u_int32_t ifi_recvtiming; /* usec spent receiving when timing */ | ||
| 182 | 	u_int32_t ifi_xmittiming; /* usec spent xmitting when timing */ | ||
| 183 | 	struct IF_DATA_TIMEVAL ifi_lastchange; /* time of last administrative change */ | ||
| 184 | 	u_int32_t ifi_unused2; /* used to be the default_proto */ | ||
| 185 | 	u_int32_t ifi_hwassist; /* HW offload capabilities */ | ||
| 186 | 	u_int32_t ifi_reserved1; /* for future use */ | ||
| 187 | 	u_int32_t ifi_reserved2; /* for future use */ | ||
| 188 | }; | ||
| 189 | |||
| 190 | /* | ||
| 191 | * Structure describing information about an interface | ||
| 192 | * which may be of interest to management entities. | ||
| 193 | */ | ||
| 194 | struct if_data64 { | ||
| 195 | 	/* generic interface information */ | ||
| 196 | 	u_char ifi_type; /* ethernet, tokenring, etc */ | ||
| 197 | 	u_char ifi_typelen; /* Length of frame type id */ | ||
| 198 | 	u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ | ||
| 199 | 	u_char ifi_addrlen; /* media address length */ | ||
| 200 | 	u_char ifi_hdrlen; /* media header length */ | ||
| 201 | 	u_char ifi_recvquota; /* polling quota for receive intrs */ | ||
| 202 | 	u_char ifi_xmitquota; /* polling quota for xmit intrs */ | ||
| 203 | 	u_char ifi_unused1; /* for future use */ | ||
| 204 | 	u_int32_t ifi_mtu; /* maximum transmission unit */ | ||
| 205 | 	u_int32_t ifi_metric; /* routing metric (external only) */ | ||
| 206 | 	u_int64_t ifi_baudrate; /* linespeed */ | ||
| 207 | 	/* volatile statistics */ | ||
| 208 | 	u_int64_t ifi_ipackets; /* packets received on interface */ | ||
| 209 | 	u_int64_t ifi_ierrors; /* input errors on interface */ | ||
| 210 | 	u_int64_t ifi_opackets; /* packets sent on interface */ | ||
| 211 | 	u_int64_t ifi_oerrors; /* output errors on interface */ | ||
| 212 | 	u_int64_t ifi_collisions; /* collisions on csma interfaces */ | ||
| 213 | 	u_int64_t ifi_ibytes; /* total number of octets received */ | ||
| 214 | 	u_int64_t ifi_obytes; /* total number of octets sent */ | ||
| 215 | 	u_int64_t ifi_imcasts; /* packets received via multicast */ | ||
| 216 | 	u_int64_t ifi_omcasts; /* packets sent via multicast */ | ||
| 217 | 	u_int64_t ifi_iqdrops; /* dropped on input, this interface */ | ||
| 218 | 	u_int64_t ifi_noproto; /* destined for unsupported protocol */ | ||
| 219 | 	u_int32_t ifi_recvtiming; /* usec spent receiving when timing */ | ||
| 220 | 	u_int32_t ifi_xmittiming; /* usec spent xmitting when timing */ | ||
| 221 | 	struct IF_DATA_TIMEVAL ifi_lastchange; /* time of last administrative change */ | ||
| 222 | }; | ||
| 223 | |||
| 224 | |||
| 225 | #pragma pack() | ||
| 226 | |||
| 227 | /* | ||
| 228 | * Structure defining a queue for a network interface. | ||
| 229 | */ | ||
| 230 | struct ifqueue { | ||
| 231 | 	void *ifq_head; | ||
| 232 | 	void *ifq_tail; | ||
| 233 | 	int ifq_len; | ||
| 234 | 	int ifq_maxlen; | ||
| 235 | 	int ifq_drops; | ||
| 236 | }; | ||
| 237 | |||
| 238 | |||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | |||
| 243 | #endif /* !_NET_IF_VAR_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/net/net_kev.h created+98| ... | @@ -0,0 +1,98 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2016-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _NET_NETKEV_H_ | ||
| 30 | #define _NET_NETKEV_H_ | ||
| 31 | |||
| 32 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 33 | |||
| 34 | /* Kernel event subclass identifiers for KEV_NETWORK_CLASS */ | ||
| 35 | #define KEV_INET_SUBCLASS 1 /* inet subclass */ | ||
| 36 | /* KEV_INET_SUBCLASS event codes */ | ||
| 37 | #define KEV_INET_NEW_ADDR 1 /* Userland configured IP address */ | ||
| 38 | #define KEV_INET_CHANGED_ADDR 2 /* Address changed event */ | ||
| 39 | #define KEV_INET_ADDR_DELETED 3 /* IPv6 address was deleted */ | ||
| 40 | #define KEV_INET_SIFDSTADDR 4 /* Dest. address was set */ | ||
| 41 | #define KEV_INET_SIFBRDADDR 5 /* Broadcast address was set */ | ||
| 42 | #define KEV_INET_SIFNETMASK 6 /* Netmask was set */ | ||
| 43 | #define KEV_INET_ARPCOLLISION 7 /* ARP collision detected */ | ||
| 44 | #ifdef __APPLE_API_PRIVATE | ||
| 45 | #define KEV_INET_PORTINUSE 8 /* use ken_in_portinuse */ | ||
| 46 | #endif | ||
| 47 | #define KEV_INET_ARPRTRFAILURE 9 /* ARP resolution failed for router */ | ||
| 48 | #define KEV_INET_ARPRTRALIVE 10 /* ARP resolution succeeded for router */ | ||
| 49 | |||
| 50 | #define KEV_DL_SUBCLASS 2 /* Data Link subclass */ | ||
| 51 | /* | ||
| 52 | * Define Data-Link event subclass, and associated | ||
| 53 | * events. | ||
| 54 | */ | ||
| 55 | #define KEV_DL_SIFFLAGS 1 | ||
| 56 | #define KEV_DL_SIFMETRICS 2 | ||
| 57 | #define KEV_DL_SIFMTU 3 | ||
| 58 | #define KEV_DL_SIFPHYS 4 | ||
| 59 | #define KEV_DL_SIFMEDIA 5 | ||
| 60 | #define KEV_DL_SIFGENERIC 6 | ||
| 61 | #define KEV_DL_ADDMULTI 7 | ||
| 62 | #define KEV_DL_DELMULTI 8 | ||
| 63 | #define KEV_DL_IF_ATTACHED 9 | ||
| 64 | #define KEV_DL_IF_DETACHING 10 | ||
| 65 | #define KEV_DL_IF_DETACHED 11 | ||
| 66 | #define KEV_DL_LINK_OFF 12 | ||
| 67 | #define KEV_DL_LINK_ON 13 | ||
| 68 | #define KEV_DL_PROTO_ATTACHED 14 | ||
| 69 | #define KEV_DL_PROTO_DETACHED 15 | ||
| 70 | #define KEV_DL_LINK_ADDRESS_CHANGED 16 | ||
| 71 | #define KEV_DL_WAKEFLAGS_CHANGED 17 | ||
| 72 | #define KEV_DL_IF_IDLE_ROUTE_REFCNT 18 | ||
| 73 | #define KEV_DL_IFCAP_CHANGED 19 | ||
| 74 | #define KEV_DL_LINK_QUALITY_METRIC_CHANGED 20 | ||
| 75 | #define KEV_DL_NODE_PRESENCE 21 | ||
| 76 | #define KEV_DL_NODE_ABSENCE 22 | ||
| 77 | #define KEV_DL_MASTER_ELECTED 23 | ||
| 78 | #define KEV_DL_ISSUES 24 | ||
| 79 | #define KEV_DL_IFDELEGATE_CHANGED 25 | ||
| 80 | #define KEV_DL_AWDL_RESTRICTED 26 | ||
| 81 | #define KEV_DL_AWDL_UNRESTRICTED 27 | ||
| 82 | #define KEV_DL_RRC_STATE_CHANGED 28 | ||
| 83 | #define KEV_DL_QOS_MODE_CHANGED 29 | ||
| 84 | #define KEV_DL_LOW_POWER_MODE_CHANGED 30 | ||
| 85 | |||
| 86 | |||
| 87 | #define KEV_INET6_SUBCLASS 6 /* inet6 subclass */ | ||
| 88 | /* KEV_INET6_SUBCLASS event codes */ | ||
| 89 | #define KEV_INET6_NEW_USER_ADDR 1 /* Userland configured IPv6 address */ | ||
| 90 | #define KEV_INET6_CHANGED_ADDR 2 /* Address changed event (future) */ | ||
| 91 | #define KEV_INET6_ADDR_DELETED 3 /* IPv6 address was deleted */ | ||
| 92 | #define KEV_INET6_NEW_LL_ADDR 4 /* Autoconf LL address appeared */ | ||
| 93 | #define KEV_INET6_NEW_RTADV_ADDR 5 /* Autoconf address has appeared */ | ||
| 94 | #define KEV_INET6_DEFROUTER 6 /* Default router detected */ | ||
| 95 | #define KEV_INET6_REQUEST_NAT64_PREFIX 7 /* Asking for the NAT64-prefix */ | ||
| 96 | |||
| 97 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 98 | #endif /* _NET_NETKEV_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/netdb.h created+319| ... | @@ -0,0 +1,319 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2009 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | * ++Copyright++ 1980, 1983, 1988, 1993 | ||
| 25 | * - | ||
| 26 | * Copyright (c) 1980, 1983, 1988, 1993 | ||
| 27 | *	The Regents of the University of California. All rights reserved. | ||
| 28 | * | ||
| 29 | * Redistribution and use in source and binary forms, with or without | ||
| 30 | * modification, are permitted provided that the following conditions | ||
| 31 | * are met: | ||
| 32 | * 1. Redistributions of source code must retain the above copyright | ||
| 33 | * notice, this list of conditions and the following disclaimer. | ||
| 34 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 35 | * notice, this list of conditions and the following disclaimer in the | ||
| 36 | * documentation and/or other materials provided with the distribution. | ||
| 37 | * 3. All advertising materials mentioning features or use of this software | ||
| 38 | * must display the following acknowledgement: | ||
| 39 | *	This product includes software developed by the University of | ||
| 40 | *	California, Berkeley and its contributors. | ||
| 41 | * 4. Neither the name of the University nor the names of its contributors | ||
| 42 | * may be used to endorse or promote products derived from this software | ||
| 43 | * without specific prior written permission. | ||
| 44 | * | ||
| 45 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 46 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 55 | * SUCH DAMAGE. | ||
| 56 | * | ||
| 57 | * - | ||
| 58 | * Portions Copyright (c) 1993 by Digital Equipment Corporation. | ||
| 59 | * | ||
| 60 | * Permission to use, copy, modify, and distribute this software for any | ||
| 61 | * purpose with or without fee is hereby granted, provided that the above | ||
| 62 | * copyright notice and this permission notice appear in all copies, and that | ||
| 63 | * the name of Digital Equipment Corporation not be used in advertising or | ||
| 64 | * publicity pertaining to distribution of the document or software without | ||
| 65 | * specific, written prior permission. | ||
| 66 | * | ||
| 67 | * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL | ||
| 68 | * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES | ||
| 69 | * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT | ||
| 70 | * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | ||
| 71 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR | ||
| 72 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS | ||
| 73 | * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | ||
| 74 | * SOFTWARE. | ||
| 75 | * - | ||
| 76 | * --Copyright-- | ||
| 77 | */ | ||
| 78 | |||
| 79 | /* | ||
| 80 | * @(#)netdb.h	8.1 (Berkeley) 6/2/93 | ||
| 81 | */ | ||
| 82 | |||
| 83 | #ifndef _NETDB_H_ | ||
| 84 | #define _NETDB_H_ | ||
| 85 | |||
| 86 | #include <_types.h> | ||
| 87 | #include <sys/_types/_size_t.h> | ||
| 88 | #include <sys/_types/_socklen_t.h> | ||
| 89 | |||
| 90 | #include <stdint.h> | ||
| 91 | #include <netinet/in.h>		/* IPPORT_RESERVED */ | ||
| 92 | |||
| 93 | #ifndef _PATH_HEQUIV | ||
| 94 | # define	_PATH_HEQUIV	"/etc/hosts.equiv" | ||
| 95 | #endif | ||
| 96 | #define	_PATH_HOSTS	"/etc/hosts" | ||
| 97 | #define	_PATH_NETWORKS	"/etc/networks" | ||
| 98 | #define	_PATH_PROTOCOLS	"/etc/protocols" | ||
| 99 | #define	_PATH_SERVICES	"/etc/services" | ||
| 100 | |||
| 101 | extern int h_errno; | ||
| 102 | |||
| 103 | #ifndef IPPORT_RESERVED | ||
| 104 | #define	IPPORT_RESERVED		__DARWIN_IPPORT_RESERVED | ||
| 105 | #endif | ||
| 106 | |||
| 107 | /* | ||
| 108 | * Structures returned by network data base library. All addresses are | ||
| 109 | * supplied in host order, and returned in network order (suitable for | ||
| 110 | * use in system calls). | ||
| 111 | */ | ||
| 112 | struct hostent { | ||
| 113 | 	char	*h_name;	/* official name of host */ | ||
| 114 | 	char	**h_aliases;	/* alias list */ | ||
| 115 | 	int	h_addrtype;	/* host address type */ | ||
| 116 | 	int	h_length;	/* length of address */ | ||
| 117 | 	char	**h_addr_list;	/* list of addresses from name server */ | ||
| 118 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 119 | #define	h_addr	h_addr_list[0]	/* address, for backward compatibility */ | ||
| 120 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 121 | }; | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Assumption here is that a network number | ||
| 125 | * fits in an unsigned long -- probably a poor one. | ||
| 126 | */ | ||
| 127 | struct netent { | ||
| 128 | 	char		*n_name;	/* official name of net */ | ||
| 129 | 	char		**n_aliases;	/* alias list */ | ||
| 130 | 	int		n_addrtype;	/* net address type */ | ||
| 131 | 	uint32_t	n_net;		/* network # */ | ||
| 132 | }; | ||
| 133 | |||
| 134 | struct servent { | ||
| 135 | 	char	*s_name;	/* official service name */ | ||
| 136 | 	char	**s_aliases;	/* alias list */ | ||
| 137 | 	int	s_port;		/* port # */ | ||
| 138 | 	char	*s_proto;	/* protocol to use */ | ||
| 139 | }; | ||
| 140 | |||
| 141 | struct protoent { | ||
| 142 | 	char	*p_name;	/* official protocol name */ | ||
| 143 | 	char	**p_aliases;	/* alias list */ | ||
| 144 | 	int	p_proto;	/* protocol # */ | ||
| 145 | }; | ||
| 146 | |||
| 147 | struct addrinfo { | ||
| 148 | 	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ | ||
| 149 | 	int	ai_family;	/* PF_xxx */ | ||
| 150 | 	int	ai_socktype;	/* SOCK_xxx */ | ||
| 151 | 	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */ | ||
| 152 | 	socklen_t ai_addrlen;	/* length of ai_addr */ | ||
| 153 | 	char	*ai_canonname;	/* canonical name for hostname */ | ||
| 154 | 	struct	sockaddr *ai_addr;	/* binary address */ | ||
| 155 | 	struct	addrinfo *ai_next;	/* next structure in linked list */ | ||
| 156 | }; | ||
| 157 | |||
| 158 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 159 | struct rpcent { | ||
| 160 | char *r_name; /* name of server for this rpc program */ | ||
| 161 | char **r_aliases; /* alias list */ | ||
| 162 | int r_number; /* rpc program number */ | ||
| 163 | }; | ||
| 164 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 165 | |||
| 166 | /* | ||
| 167 | * Error return codes from gethostbyname() and gethostbyaddr() | ||
| 168 | * (left in h_errno). | ||
| 169 | */ | ||
| 170 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 171 | #define	NETDB_INTERNAL	-1	/* see errno */ | ||
| 172 | #define	NETDB_SUCCESS	0	/* no problem */ | ||
| 173 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 174 | #define	HOST_NOT_FOUND	1 /* Authoritative Answer Host not found */ | ||
| 175 | #define	TRY_AGAIN	2 /* Non-Authoritative Host not found, or SERVERFAIL */ | ||
| 176 | #define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ | ||
| 177 | #define	NO_DATA		4 /* Valid name, no data record of requested type */ | ||
| 178 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 179 | #define	NO_ADDRESS	NO_DATA		/* no address, look for MX record */ | ||
| 180 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 181 | /* | ||
| 182 | * Error return codes from getaddrinfo() | ||
| 183 | */ | ||
| 184 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 185 | #define	EAI_ADDRFAMILY	 1	/* address family for hostname not supported */ | ||
| 186 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 187 | #define	EAI_AGAIN	 2	/* temporary failure in name resolution */ | ||
| 188 | #define	EAI_BADFLAGS	 3	/* invalid value for ai_flags */ | ||
| 189 | #define	EAI_FAIL	 4	/* non-recoverable failure in name resolution */ | ||
| 190 | #define	EAI_FAMILY	 5	/* ai_family not supported */ | ||
| 191 | #define	EAI_MEMORY	 6	/* memory allocation failure */ | ||
| 192 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 193 | #define	EAI_NODATA	 7	/* no address associated with hostname */ | ||
| 194 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 195 | #define	EAI_NONAME	 8	/* hostname nor servname provided, or not known */ | ||
| 196 | #define	EAI_SERVICE	 9	/* servname not supported for ai_socktype */ | ||
| 197 | #define	EAI_SOCKTYPE	10	/* ai_socktype not supported */ | ||
| 198 | #define	EAI_SYSTEM	11	/* system error returned in errno */ | ||
| 199 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 200 | #define	EAI_BADHINTS	12	/* invalid value for hints */ | ||
| 201 | #define	EAI_PROTOCOL	13	/* resolved protocol is unknown */ | ||
| 202 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 203 | #define	EAI_OVERFLOW	14	/* argument buffer overflow */ | ||
| 204 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 205 | #define	EAI_MAX		15 | ||
| 206 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 207 | |||
| 208 | /* | ||
| 209 | * Flag values for getaddrinfo() | ||
| 210 | */ | ||
| 211 | #define	AI_PASSIVE	0x00000001 /* get address to use bind() */ | ||
| 212 | #define	AI_CANONNAME	0x00000002 /* fill ai_canonname */ | ||
| 213 | #define	AI_NUMERICHOST	0x00000004 /* prevent host name resolution */ | ||
| 214 | #define	AI_NUMERICSERV	0x00001000 /* prevent service name resolution */ | ||
| 215 | /* valid flags for addrinfo (not a standard def, apps should not use it) */ | ||
| 216 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 217 | #define AI_MASK \ | ||
| 218 | (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ | ||
| 219 | AI_ADDRCONFIG) | ||
| 220 | |||
| 221 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 222 | #define	AI_ALL		0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ | ||
| 223 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 224 | #define	AI_V4MAPPED_CFG	0x00000200 /* accept IPv4-mapped if kernel supports */ | ||
| 225 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 226 | #define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */ | ||
| 227 | #define	AI_V4MAPPED	0x00000800 /* accept IPv4-mapped IPv6 address */ | ||
| 228 | /* special recommended flags for getipnodebyname */ | ||
| 229 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 230 | #define	AI_DEFAULT	(AI_V4MAPPED_CFG | AI_ADDRCONFIG) | ||
| 231 | /* If the hints pointer is null or ai_flags is zero, getaddrinfo() automatically defaults to the AI_DEFAULT behavior. | ||
| 232 | * To override this default behavior, thereby causing unusable addresses to be included in the results, pass any nonzero | ||
| 233 | * value for ai_flags, by setting any desired flag values, or by setting AI_UNUSABLE if no other flags are desired. */ | ||
| 234 | #define	AI_UNUSABLE	0x10000000 /* return addresses even if unusable (i.e. opposite of AI_DEFAULT) */ | ||
| 235 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 236 | |||
| 237 | /* | ||
| 238 | * Constants for getnameinfo() | ||
| 239 | */ | ||
| 240 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 241 | #define	NI_MAXHOST	1025 | ||
| 242 | #define	NI_MAXSERV	32 | ||
| 243 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 244 | /* | ||
| 245 | * Flag values for getnameinfo() | ||
| 246 | */ | ||
| 247 | #define	NI_NOFQDN	0x00000001 | ||
| 248 | #define	NI_NUMERICHOST	0x00000002 | ||
| 249 | #define	NI_NAMEREQD	0x00000004 | ||
| 250 | #define	NI_NUMERICSERV	0x00000008 | ||
| 251 | #define	NI_NUMERICSCOPE 0x00000100 | ||
| 252 | #define	NI_DGRAM	0x00000010 | ||
| 253 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 254 | #define NI_WITHSCOPEID	0x00000020 | ||
| 255 | |||
| 256 | /* | ||
| 257 | * Scope delimit character | ||
| 258 | */ | ||
| 259 | #define	SCOPE_DELIMITER	'%' | ||
| 260 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 261 | |||
| 262 | __BEGIN_DECLS | ||
| 263 | |||
| 264 | void		endhostent(void); | ||
| 265 | void		endnetent(void); | ||
| 266 | void		endprotoent(void); | ||
| 267 | void		endservent(void); | ||
| 268 | |||
| 269 | void		freeaddrinfo(struct addrinfo *); | ||
| 270 | const char	*gai_strerror(int); | ||
| 271 | int		getaddrinfo(const char * __restrict, const char * __restrict, | ||
| 272 | 			 const struct addrinfo * __restrict, | ||
| 273 | 			 struct addrinfo ** __restrict); | ||
| 274 | struct hostent	*gethostbyaddr(const void *, socklen_t, int); | ||
| 275 | struct hostent	*gethostbyname(const char *); | ||
| 276 | struct hostent	*gethostent(void); | ||
| 277 | int getnameinfo(const struct sockaddr * __restrict, socklen_t, | ||
| 278 | 			 char * __restrict, socklen_t, char * __restrict, | ||
| 279 | 			 socklen_t, int); | ||
| 280 | struct netent	*getnetbyaddr(uint32_t, int); | ||
| 281 | struct netent	*getnetbyname(const char *); | ||
| 282 | struct netent	*getnetent(void); | ||
| 283 | struct protoent	*getprotobyname(const char *); | ||
| 284 | struct protoent	*getprotobynumber(int); | ||
| 285 | struct protoent	*getprotoent(void); | ||
| 286 | struct servent	*getservbyname(const char *, const char *); | ||
| 287 | struct servent	*getservbyport(int, const char *); | ||
| 288 | struct servent	*getservent(void); | ||
| 289 | void		sethostent(int); | ||
| 290 | /* void		sethostfile(const char *); */ | ||
| 291 | void		setnetent(int); | ||
| 292 | void		setprotoent(int); | ||
| 293 | void		setservent(int); | ||
| 294 | |||
| 295 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 296 | void		freehostent(struct hostent *); | ||
| 297 | struct hostent	*gethostbyname2(const char *, int); | ||
| 298 | struct hostent	*getipnodebyaddr(const void *, size_t, int, int *); | ||
| 299 | struct hostent	*getipnodebyname(const char *, int, int, int *); | ||
| 300 | struct rpcent	*getrpcbyname(const char *name); | ||
| 301 | #ifdef __LP64__ | ||
| 302 | struct rpcent	*getrpcbynumber(int number); | ||
| 303 | #else | ||
| 304 | struct rpcent	*getrpcbynumber(long number); | ||
| 305 | #endif | ||
| 306 | struct rpcent	*getrpcent(void); | ||
| 307 | void		setrpcent(int stayopen); | ||
| 308 | void		endrpcent(void); | ||
| 309 | void		herror(const char *); | ||
| 310 | const char	*hstrerror(int); | ||
| 311 | int			innetgr(const char *, const char *, const char *, const char *); | ||
| 312 | int			getnetgrent(char **, char **, char **); | ||
| 313 | void		endnetgrent(void); | ||
| 314 | void		setnetgrent(const char *); | ||
| 315 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 316 | |||
| 317 | __END_DECLS | ||
| 318 | |||
| 319 | #endif /* !_NETDB_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/netinet/in.h created+672| ... | @@ -0,0 +1,672 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1982, 1986, 1990, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | *	This product includes software developed by the University of | ||
| 43 | *	California, Berkeley and its contributors. | ||
| 44 | * 4. Neither the name of the University nor the names of its contributors | ||
| 45 | * may be used to endorse or promote products derived from this software | ||
| 46 | * without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 58 | * SUCH DAMAGE. | ||
| 59 | * | ||
| 60 | *	@(#)in.h	8.3 (Berkeley) 1/3/94 | ||
| 61 | * $FreeBSD: src/sys/netinet/in.h,v 1.48.2.2 2001/04/21 14:53:06 ume Exp $ | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _NETINET_IN_H_ | ||
| 65 | #define _NETINET_IN_H_ | ||
| 66 | |||
| 67 | #include <sys/appleapiopts.h> | ||
| 68 | #include <stdint.h> /* uint(8|16|32)_t */ | ||
| 69 | |||
| 70 | #include <Availability.h> | ||
| 71 | |||
| 72 | |||
| 73 | #include <sys/_types/_in_addr_t.h> | ||
| 74 | #include <sys/_types/_in_port_t.h> | ||
| 75 | |||
| 76 | /* | ||
| 77 | * POSIX 1003.1-2003 | ||
| 78 | * "Inclusion of the <netinet/in.h> header may also make visible all | ||
| 79 | * symbols from <inttypes.h> and <sys/socket.h>". | ||
| 80 | */ | ||
| 81 | #include <sys/socket.h> | ||
| 82 | |||
| 83 | /* | ||
| 84 | * The following two #includes insure htonl and family are defined | ||
| 85 | */ | ||
| 86 | #include <machine/endian.h> | ||
| 87 | #include <sys/_endian.h> | ||
| 88 | |||
| 89 | /* | ||
| 90 | * Constants and structures defined by the internet system, | ||
| 91 | * Per RFC 790, September 1981, and numerous additions. | ||
| 92 | */ | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Protocols (RFC 1700) | ||
| 96 | */ | ||
| 97 | #define IPPROTO_IP 0 /* dummy for IP */ | ||
| 98 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 99 | #define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ | ||
| 100 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 101 | #define IPPROTO_ICMP 1 /* control message protocol */ | ||
| 102 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 103 | #define IPPROTO_IGMP 2 /* group mgmt protocol */ | ||
| 104 | #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ | ||
| 105 | #define IPPROTO_IPV4 4 /* IPv4 encapsulation */ | ||
| 106 | #define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ | ||
| 107 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 108 | #define IPPROTO_TCP 6 /* tcp */ | ||
| 109 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 110 | #define IPPROTO_ST 7 /* Stream protocol II */ | ||
| 111 | #define IPPROTO_EGP 8 /* exterior gateway protocol */ | ||
| 112 | #define IPPROTO_PIGP 9 /* private interior gateway */ | ||
| 113 | #define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ | ||
| 114 | #define IPPROTO_NVPII 11 /* network voice protocol*/ | ||
| 115 | #define IPPROTO_PUP 12 /* pup */ | ||
| 116 | #define IPPROTO_ARGUS 13 /* Argus */ | ||
| 117 | #define IPPROTO_EMCON 14 /* EMCON */ | ||
| 118 | #define IPPROTO_XNET 15 /* Cross Net Debugger */ | ||
| 119 | #define IPPROTO_CHAOS 16 /* Chaos*/ | ||
| 120 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 121 | #define IPPROTO_UDP 17 /* user datagram protocol */ | ||
| 122 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 123 | #define IPPROTO_MUX 18 /* Multiplexing */ | ||
| 124 | #define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ | ||
| 125 | #define IPPROTO_HMP 20 /* Host Monitoring */ | ||
| 126 | #define IPPROTO_PRM 21 /* Packet Radio Measurement */ | ||
| 127 | #define IPPROTO_IDP 22 /* xns idp */ | ||
| 128 | #define IPPROTO_TRUNK1 23 /* Trunk-1 */ | ||
| 129 | #define IPPROTO_TRUNK2 24 /* Trunk-2 */ | ||
| 130 | #define IPPROTO_LEAF1 25 /* Leaf-1 */ | ||
| 131 | #define IPPROTO_LEAF2 26 /* Leaf-2 */ | ||
| 132 | #define IPPROTO_RDP 27 /* Reliable Data */ | ||
| 133 | #define IPPROTO_IRTP 28 /* Reliable Transaction */ | ||
| 134 | #define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ | ||
| 135 | #define IPPROTO_BLT 30 /* Bulk Data Transfer */ | ||
| 136 | #define IPPROTO_NSP 31 /* Network Services */ | ||
| 137 | #define IPPROTO_INP 32 /* Merit Internodal */ | ||
| 138 | #define IPPROTO_SEP 33 /* Sequential Exchange */ | ||
| 139 | #define IPPROTO_3PC 34 /* Third Party Connect */ | ||
| 140 | #define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ | ||
| 141 | #define IPPROTO_XTP 36 /* XTP */ | ||
| 142 | #define IPPROTO_DDP 37 /* Datagram Delivery */ | ||
| 143 | #define IPPROTO_CMTP 38 /* Control Message Transport */ | ||
| 144 | #define IPPROTO_TPXX 39 /* TP++ Transport */ | ||
| 145 | #define IPPROTO_IL 40 /* IL transport protocol */ | ||
| 146 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 147 | #define IPPROTO_IPV6 41 /* IP6 header */ | ||
| 148 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 149 | #define IPPROTO_SDRP 42 /* Source Demand Routing */ | ||
| 150 | #define IPPROTO_ROUTING 43 /* IP6 routing header */ | ||
| 151 | #define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ | ||
| 152 | #define IPPROTO_IDRP 45 /* InterDomain Routing*/ | ||
| 153 | #define IPPROTO_RSVP 46 /* resource reservation */ | ||
| 154 | #define IPPROTO_GRE 47 /* General Routing Encap. */ | ||
| 155 | #define IPPROTO_MHRP 48 /* Mobile Host Routing */ | ||
| 156 | #define IPPROTO_BHA 49 /* BHA */ | ||
| 157 | #define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ | ||
| 158 | #define IPPROTO_AH 51 /* IP6 Auth Header */ | ||
| 159 | #define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ | ||
| 160 | #define IPPROTO_SWIPE 53 /* IP with encryption */ | ||
| 161 | #define IPPROTO_NHRP 54 /* Next Hop Resolution */ | ||
| 162 | /* 55-57: Unassigned */ | ||
| 163 | #define IPPROTO_ICMPV6 58 /* ICMP6 */ | ||
| 164 | #define IPPROTO_NONE 59 /* IP6 no next header */ | ||
| 165 | #define IPPROTO_DSTOPTS 60 /* IP6 destination option */ | ||
| 166 | #define IPPROTO_AHIP 61 /* any host internal protocol */ | ||
| 167 | #define IPPROTO_CFTP 62 /* CFTP */ | ||
| 168 | #define IPPROTO_HELLO 63 /* "hello" routing protocol */ | ||
| 169 | #define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ | ||
| 170 | #define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ | ||
| 171 | #define IPPROTO_RVD 66 /* Remote Virtual Disk */ | ||
| 172 | #define IPPROTO_IPPC 67 /* Pluribus Packet Core */ | ||
| 173 | #define IPPROTO_ADFS 68 /* Any distributed FS */ | ||
| 174 | #define IPPROTO_SATMON 69 /* Satnet Monitoring */ | ||
| 175 | #define IPPROTO_VISA 70 /* VISA Protocol */ | ||
| 176 | #define IPPROTO_IPCV 71 /* Packet Core Utility */ | ||
| 177 | #define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ | ||
| 178 | #define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ | ||
| 179 | #define IPPROTO_WSN 74 /* Wang Span Network */ | ||
| 180 | #define IPPROTO_PVP 75 /* Packet Video Protocol */ | ||
| 181 | #define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ | ||
| 182 | #define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ | ||
| 183 | #define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ | ||
| 184 | #define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ | ||
| 185 | #define IPPROTO_EON 80 /* ISO cnlp */ | ||
| 186 | #define IPPROTO_VMTP 81 /* VMTP */ | ||
| 187 | #define IPPROTO_SVMTP 82 /* Secure VMTP */ | ||
| 188 | #define IPPROTO_VINES 83 /* Banyon VINES */ | ||
| 189 | #define IPPROTO_TTP 84 /* TTP */ | ||
| 190 | #define IPPROTO_IGP 85 /* NSFNET-IGP */ | ||
| 191 | #define IPPROTO_DGP 86 /* dissimilar gateway prot. */ | ||
| 192 | #define IPPROTO_TCF 87 /* TCF */ | ||
| 193 | #define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ | ||
| 194 | #define IPPROTO_OSPFIGP 89 /* OSPFIGP */ | ||
| 195 | #define IPPROTO_SRPC 90 /* Strite RPC protocol */ | ||
| 196 | #define IPPROTO_LARP 91 /* Locus Address Resoloution */ | ||
| 197 | #define IPPROTO_MTP 92 /* Multicast Transport */ | ||
| 198 | #define IPPROTO_AX25 93 /* AX.25 Frames */ | ||
| 199 | #define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ | ||
| 200 | #define IPPROTO_MICP 95 /* Mobile Int.ing control */ | ||
| 201 | #define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ | ||
| 202 | #define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ | ||
| 203 | #define IPPROTO_ENCAP 98 /* encapsulation header */ | ||
| 204 | #define IPPROTO_APES 99 /* any private encr. scheme */ | ||
| 205 | #define IPPROTO_GMTP 100 /* GMTP*/ | ||
| 206 | /* 101-252: Partly Unassigned */ | ||
| 207 | #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ | ||
| 208 | #define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ | ||
| 209 | #define IPPROTO_PGM 113 /* PGM */ | ||
| 210 | #define IPPROTO_SCTP 132 /* SCTP */ | ||
| 211 | /* 253-254: Experimentation and testing; 255: Reserved (RFC3692) */ | ||
| 212 | /* BSD Private, local use, namespace incursion */ | ||
| 213 | #define IPPROTO_DIVERT 254 /* divert pseudo-protocol */ | ||
| 214 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 215 | #define IPPROTO_RAW 255 /* raw IP packet */ | ||
| 216 | |||
| 217 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 218 | #define IPPROTO_MAX 256 | ||
| 219 | |||
| 220 | /* last return value of *_input(), meaning "all job for this pkt is done". */ | ||
| 221 | #define IPPROTO_DONE 257 | ||
| 222 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 223 | |||
| 224 | /* | ||
| 225 | * Local port number conventions: | ||
| 226 | * | ||
| 227 | * When a user does a bind(2) or connect(2) with a port number of zero, | ||
| 228 | * a non-conflicting local port address is chosen. | ||
| 229 | * The default range is IPPORT_RESERVED through | ||
| 230 | * IPPORT_USERRESERVED, although that is settable by sysctl. | ||
| 231 | * | ||
| 232 | * A user may set the IPPROTO_IP option IP_PORTRANGE to change this | ||
| 233 | * default assignment range. | ||
| 234 | * | ||
| 235 | * The value IP_PORTRANGE_DEFAULT causes the default behavior. | ||
| 236 | * | ||
| 237 | * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers | ||
| 238 | * into the "high" range. These are reserved for client outbound connections | ||
| 239 | * which do not want to be filtered by any firewalls. | ||
| 240 | * | ||
| 241 | * The value IP_PORTRANGE_LOW changes the range to the "low" are | ||
| 242 | * that is (by convention) restricted to privileged processes. This | ||
| 243 | * convention is based on "vouchsafe" principles only. It is only secure | ||
| 244 | * if you trust the remote host to restrict these ports. | ||
| 245 | * | ||
| 246 | * The default range of ports and the high range can be changed by | ||
| 247 | * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto) | ||
| 248 | * | ||
| 249 | * Changing those values has bad security implications if you are | ||
| 250 | * using a a stateless firewall that is allowing packets outside of that | ||
| 251 | * range in order to allow transparent outgoing connections. | ||
| 252 | * | ||
| 253 | * Such a firewall configuration will generally depend on the use of these | ||
| 254 | * default values. If you change them, you may find your Security | ||
| 255 | * Administrator looking for you with a heavy object. | ||
| 256 | * | ||
| 257 | * For a slightly more orthodox text view on this: | ||
| 258 | * | ||
| 259 | * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers | ||
| 260 | * | ||
| 261 | * port numbers are divided into three ranges: | ||
| 262 | * | ||
| 263 | * 0 - 1023 Well Known Ports | ||
| 264 | * 1024 - 49151 Registered Ports | ||
| 265 | * 49152 - 65535 Dynamic and/or Private Ports | ||
| 266 | * | ||
| 267 | */ | ||
| 268 | |||
| 269 | #define __DARWIN_IPPORT_RESERVED 1024 | ||
| 270 | |||
| 271 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 272 | /* | ||
| 273 | * Ports < IPPORT_RESERVED are reserved for | ||
| 274 | * privileged processes (e.g. root). (IP_PORTRANGE_LOW) | ||
| 275 | * Ports > IPPORT_USERRESERVED are reserved | ||
| 276 | * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT) | ||
| 277 | */ | ||
| 278 | #ifndef IPPORT_RESERVED | ||
| 279 | #define IPPORT_RESERVED __DARWIN_IPPORT_RESERVED | ||
| 280 | #endif | ||
| 281 | #define IPPORT_USERRESERVED 5000 | ||
| 282 | |||
| 283 | /* | ||
| 284 | * Default local port range to use by setting IP_PORTRANGE_HIGH | ||
| 285 | */ | ||
| 286 | #define IPPORT_HIFIRSTAUTO 49152 | ||
| 287 | #define IPPORT_HILASTAUTO 65535 | ||
| 288 | |||
| 289 | /* | ||
| 290 | * Scanning for a free reserved port return a value below IPPORT_RESERVED, | ||
| 291 | * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was | ||
| 292 | * 512, but that conflicts with some well-known-services that firewalls may | ||
| 293 | * have a fit if we use. | ||
| 294 | */ | ||
| 295 | #define IPPORT_RESERVEDSTART 600 | ||
| 296 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 297 | |||
| 298 | /* | ||
| 299 | * Internet address (a structure for historical reasons) | ||
| 300 | */ | ||
| 301 | struct in_addr { | ||
| 302 | 	in_addr_t s_addr; | ||
| 303 | }; | ||
| 304 | |||
| 305 | /* | ||
| 306 | * Definitions of bits in internet address integers. | ||
| 307 | * On subnets, the decomposition of addresses to host and net parts | ||
| 308 | * is done according to subnet mask, not the masks here. | ||
| 309 | */ | ||
| 310 | #define INADDR_ANY (u_int32_t)0x00000000 | ||
| 311 | #define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */ | ||
| 312 | |||
| 313 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 314 | #define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) | ||
| 315 | #define IN_CLASSA_NET 0xff000000 | ||
| 316 | #define IN_CLASSA_NSHIFT 24 | ||
| 317 | #define IN_CLASSA_HOST 0x00ffffff | ||
| 318 | #define IN_CLASSA_MAX 128 | ||
| 319 | |||
| 320 | #define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) | ||
| 321 | #define IN_CLASSB_NET 0xffff0000 | ||
| 322 | #define IN_CLASSB_NSHIFT 16 | ||
| 323 | #define IN_CLASSB_HOST 0x0000ffff | ||
| 324 | #define IN_CLASSB_MAX 65536 | ||
| 325 | |||
| 326 | #define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) | ||
| 327 | #define IN_CLASSC_NET 0xffffff00 | ||
| 328 | #define IN_CLASSC_NSHIFT 8 | ||
| 329 | #define IN_CLASSC_HOST 0x000000ff | ||
| 330 | |||
| 331 | #define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) | ||
| 332 | #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ | ||
| 333 | #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ | ||
| 334 | #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ | ||
| 335 | #define IN_MULTICAST(i) IN_CLASSD(i) | ||
| 336 | |||
| 337 | #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) | ||
| 338 | #define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) | ||
| 339 | |||
| 340 | #define INADDR_LOOPBACK (u_int32_t)0x7f000001 | ||
| 341 | |||
| 342 | #define INADDR_NONE 0xffffffff /* -1 return */ | ||
| 343 | |||
| 344 | #define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ | ||
| 345 | #define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ | ||
| 346 | #define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ | ||
| 347 | #define INADDR_ALLRPTS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22, IGMPv3 */ | ||
| 348 | #define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */ | ||
| 349 | #define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */ | ||
| 350 | #define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */ | ||
| 351 | #define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ | ||
| 352 | |||
| 353 | #ifdef __APPLE__ | ||
| 354 | #define IN_LINKLOCALNETNUM (u_int32_t)0xA9FE0000 /* 169.254.0.0 */ | ||
| 355 | #define IN_LINKLOCAL(i) (((u_int32_t)(i) & IN_CLASSB_NET) == IN_LINKLOCALNETNUM) | ||
| 356 | #define IN_LOOPBACK(i) (((u_int32_t)(i) & 0xff000000) == 0x7f000000) | ||
| 357 | #define IN_ZERONET(i) (((u_int32_t)(i) & 0xff000000) == 0) | ||
| 358 | |||
| 359 | #define IN_PRIVATE(i) ((((u_int32_t)(i) & 0xff000000) == 0x0a000000) || \ | ||
| 360 | 	 (((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \ | ||
| 361 | 	 (((u_int32_t)(i) & 0xffff0000) == 0xc0a80000)) | ||
| 362 | |||
| 363 | |||
| 364 | #define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000) | ||
| 365 | |||
| 366 | #define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i)) | ||
| 367 | #endif /* __APPLE__ */ | ||
| 368 | |||
| 369 | #define IN_LOOPBACKNET 127 /* official! */ | ||
| 370 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 371 | |||
| 372 | /* | ||
| 373 | * Socket address, internet style. | ||
| 374 | */ | ||
| 375 | struct sockaddr_in { | ||
| 376 | 	__uint8_t sin_len; | ||
| 377 | 	sa_family_t sin_family; | ||
| 378 | 	in_port_t sin_port; | ||
| 379 | 	struct in_addr sin_addr; | ||
| 380 | 	char sin_zero[8]; | ||
| 381 | }; | ||
| 382 | |||
| 383 | #define IN_ARE_ADDR_EQUAL(a, b) \ | ||
| 384 | (bcmp(&(a)->s_addr, &(b)->s_addr, \ | ||
| 385 | 	sizeof (struct in_addr)) == 0) | ||
| 386 | |||
| 387 | |||
| 388 | #define INET_ADDRSTRLEN 16 | ||
| 389 | |||
| 390 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 391 | /* | ||
| 392 | * Structure used to describe IP options. | ||
| 393 | * Used to store options internally, to pass them to a process, | ||
| 394 | * or to restore options retrieved earlier. | ||
| 395 | * The ip_dst is used for the first-hop gateway when using a source route | ||
| 396 | * (this gets put into the header proper). | ||
| 397 | */ | ||
| 398 | struct ip_opts { | ||
| 399 | 	struct in_addr ip_dst; /* first hop, 0 w/o src rt */ | ||
| 400 | 	char ip_opts[40]; /* actually variable in size */ | ||
| 401 | }; | ||
| 402 | |||
| 403 | /* | ||
| 404 | * Options for use with [gs]etsockopt at the IP level. | ||
| 405 | * First word of comment is data type; bool is stored in int. | ||
| 406 | */ | ||
| 407 | #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ | ||
| 408 | #define IP_HDRINCL 2 /* int; header is included with data */ | ||
| 409 | #define IP_TOS 3 /* int; IP type of service and preced. */ | ||
| 410 | #define IP_TTL 4 /* int; IP time to live */ | ||
| 411 | #define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ | ||
| 412 | #define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ | ||
| 413 | #define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ | ||
| 414 | #define IP_RETOPTS 8 /* ip_opts; set/get IP options */ | ||
| 415 | #define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */ | ||
| 416 | #define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ | ||
| 417 | #define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ | ||
| 418 | #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ | ||
| 419 | #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ | ||
| 420 | #define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ | ||
| 421 | #define IP_RSVP_ON 15 /* enable RSVP in kernel */ | ||
| 422 | #define IP_RSVP_OFF 16 /* disable RSVP in kernel */ | ||
| 423 | #define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ | ||
| 424 | #define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ | ||
| 425 | #define IP_PORTRANGE 19 /* int; range to choose for unspec port */ | ||
| 426 | #define IP_RECVIF 20 /* bool; receive reception if w/dgram */ | ||
| 427 | /* for IPSEC */ | ||
| 428 | #define IP_IPSEC_POLICY 21 /* int; set/get security policy */ | ||
| 429 | #define IP_FAITH 22 /* deprecated */ | ||
| 430 | #ifdef __APPLE__ | ||
| 431 | #define IP_STRIPHDR 23 /* bool: drop receive of raw IP header */ | ||
| 432 | #endif | ||
| 433 | #define IP_RECVTTL 24 /* bool; receive reception TTL w/dgram */ | ||
| 434 | #define IP_BOUND_IF 25 /* int; set/get bound interface */ | ||
| 435 | #define IP_PKTINFO 26 /* get pktinfo on recv socket, set src on sent dgram */ | ||
| 436 | #define IP_RECVPKTINFO IP_PKTINFO /* receive pktinfo w/dgram */ | ||
| 437 | #define IP_RECVTOS 27 /* bool; receive IP TOS w/dgram */ | ||
| 438 | #define IP_DONTFRAG 28 /* don't fragment packet */ | ||
| 439 | |||
| 440 | #define IP_FW_ADD 40 /* add a firewall rule to chain */ | ||
| 441 | #define IP_FW_DEL 41 /* delete a firewall rule from chain */ | ||
| 442 | #define IP_FW_FLUSH 42 /* flush firewall rule chain */ | ||
| 443 | #define IP_FW_ZERO 43 /* clear single/all firewall counter(s) */ | ||
| 444 | #define IP_FW_GET 44 /* get entire firewall rule chain */ | ||
| 445 | #define IP_FW_RESETLOG 45 /* reset logging counters */ | ||
| 446 | |||
| 447 | /* These older firewall socket option codes are maintained for backward compatibility. */ | ||
| 448 | #define IP_OLD_FW_ADD 50 /* add a firewall rule to chain */ | ||
| 449 | #define IP_OLD_FW_DEL 51 /* delete a firewall rule from chain */ | ||
| 450 | #define IP_OLD_FW_FLUSH 52 /* flush firewall rule chain */ | ||
| 451 | #define IP_OLD_FW_ZERO 53 /* clear single/all firewall counter(s) */ | ||
| 452 | #define IP_OLD_FW_GET 54 /* get entire firewall rule chain */ | ||
| 453 | #define IP_NAT__XXX 55 /* set/get NAT opts XXX Deprecated, do not use */ | ||
| 454 | #define IP_OLD_FW_RESETLOG 56 /* reset logging counters */ | ||
| 455 | |||
| 456 | #define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ | ||
| 457 | #define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ | ||
| 458 | #define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ | ||
| 459 | #define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ | ||
| 460 | |||
| 461 | #define IP_TRAFFIC_MGT_BACKGROUND 65 /* int*; get background IO flags; set background IO */ | ||
| 462 | #define IP_MULTICAST_IFINDEX 66 /* int*; set/get IP multicast i/f index */ | ||
| 463 | |||
| 464 | /* IPv4 Source Filter Multicast API [RFC3678] */ | ||
| 465 | #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ | ||
| 466 | #define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ | ||
| 467 | #define IP_BLOCK_SOURCE 72 /* block a source */ | ||
| 468 | #define IP_UNBLOCK_SOURCE 73 /* unblock a source */ | ||
| 469 | |||
| 470 | /* The following option is private; do not use it from user applications. */ | ||
| 471 | #define IP_MSFILTER 74 /* set/get filter list */ | ||
| 472 | |||
| 473 | /* Protocol Independent Multicast API [RFC3678] */ | ||
| 474 | #define MCAST_JOIN_GROUP 80 /* join an any-source group */ | ||
| 475 | #define MCAST_LEAVE_GROUP 81 /* leave all sources for group */ | ||
| 476 | #define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ | ||
| 477 | #define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ | ||
| 478 | #define MCAST_BLOCK_SOURCE 84 /* block a source */ | ||
| 479 | #define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ | ||
| 480 | |||
| 481 | |||
| 482 | /* | ||
| 483 | * Defaults and limits for options | ||
| 484 | */ | ||
| 485 | #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ | ||
| 486 | #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ | ||
| 487 | |||
| 488 | /* | ||
| 489 | * The imo_membership vector for each socket is now dynamically allocated at | ||
| 490 | * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized | ||
| 491 | * according to a power-of-two increment. | ||
| 492 | */ | ||
| 493 | #define IP_MIN_MEMBERSHIPS 31 | ||
| 494 | #define IP_MAX_MEMBERSHIPS 4095 | ||
| 495 | |||
| 496 | /* | ||
| 497 | * Default resource limits for IPv4 multicast source filtering. | ||
| 498 | * These may be modified by sysctl. | ||
| 499 | */ | ||
| 500 | #define IP_MAX_GROUP_SRC_FILTER 512 /* sources per group */ | ||
| 501 | #define IP_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ | ||
| 502 | #define IP_MAX_SOCK_MUTE_FILTER 128 /* XXX no longer used */ | ||
| 503 | |||
| 504 | /* | ||
| 505 | * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. | ||
| 506 | */ | ||
| 507 | struct ip_mreq { | ||
| 508 | 	struct in_addr imr_multiaddr; /* IP multicast address of group */ | ||
| 509 | 	struct in_addr imr_interface; /* local IP address of interface */ | ||
| 510 | }; | ||
| 511 | |||
| 512 | /* | ||
| 513 | * Modified argument structure for IP_MULTICAST_IF, obtained from Linux. | ||
| 514 | * This is used to specify an interface index for multicast sends, as | ||
| 515 | * the IPv4 legacy APIs do not support this (unless IP_SENDIF is available). | ||
| 516 | */ | ||
| 517 | struct ip_mreqn { | ||
| 518 | 	struct in_addr imr_multiaddr; /* IP multicast address of group */ | ||
| 519 | 	struct in_addr imr_address; /* local IP address of interface */ | ||
| 520 | 	int imr_ifindex; /* Interface index; cast to uint32_t */ | ||
| 521 | }; | ||
| 522 | |||
| 523 | #pragma pack(4) | ||
| 524 | /* | ||
| 525 | * Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678] | ||
| 526 | */ | ||
| 527 | struct ip_mreq_source { | ||
| 528 | 	struct in_addr imr_multiaddr; /* IP multicast address of group */ | ||
| 529 | 	struct in_addr imr_sourceaddr; /* IP address of source */ | ||
| 530 | 	struct in_addr imr_interface; /* local IP address of interface */ | ||
| 531 | }; | ||
| 532 | |||
| 533 | /* | ||
| 534 | * Argument structures for Protocol-Independent Multicast Source | ||
| 535 | * Filter APIs. [RFC3678] | ||
| 536 | */ | ||
| 537 | struct group_req { | ||
| 538 | 	uint32_t gr_interface; /* interface index */ | ||
| 539 | 	struct sockaddr_storage gr_group; /* group address */ | ||
| 540 | }; | ||
| 541 | |||
| 542 | struct group_source_req { | ||
| 543 | 	uint32_t gsr_interface; /* interface index */ | ||
| 544 | 	struct sockaddr_storage gsr_group; /* group address */ | ||
| 545 | 	struct sockaddr_storage gsr_source; /* source address */ | ||
| 546 | }; | ||
| 547 | |||
| 548 | #ifndef __MSFILTERREQ_DEFINED | ||
| 549 | #define __MSFILTERREQ_DEFINED | ||
| 550 | /* | ||
| 551 | * The following structure is private; do not use it from user applications. | ||
| 552 | * It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between | ||
| 553 | * the RFC 3678 libc functions and the kernel. | ||
| 554 | */ | ||
| 555 | struct __msfilterreq { | ||
| 556 | 	uint32_t msfr_ifindex; /* interface index */ | ||
| 557 | 	uint32_t msfr_fmode; /* filter mode for group */ | ||
| 558 | 	uint32_t msfr_nsrcs; /* # of sources in msfr_srcs */ | ||
| 559 | 	uint32_t __msfr_align; | ||
| 560 | 	struct sockaddr_storage msfr_group; /* group address */ | ||
| 561 | 	struct sockaddr_storage *msfr_srcs; | ||
| 562 | }; | ||
| 563 | |||
| 564 | #endif /* __MSFILTERREQ_DEFINED */ | ||
| 565 | |||
| 566 | #pragma pack() | ||
| 567 | struct sockaddr; | ||
| 568 | |||
| 569 | /* | ||
| 570 | * Advanced (Full-state) APIs [RFC3678] | ||
| 571 | * The RFC specifies uint_t for the 6th argument to [sg]etsourcefilter(). | ||
| 572 | * We use uint32_t here to be consistent. | ||
| 573 | */ | ||
| 574 | int setipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t, | ||
| 575 | uint32_t, struct in_addr *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 576 | int getipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t *, | ||
| 577 | uint32_t *, struct in_addr *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 578 | int setsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, | ||
| 579 | uint32_t, uint32_t, struct sockaddr_storage *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 580 | int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, | ||
| 581 | uint32_t *, uint32_t *, struct sockaddr_storage *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 582 | |||
| 583 | /* | ||
| 584 | * Filter modes; also used to represent per-socket filter mode internally. | ||
| 585 | */ | ||
| 586 | #define MCAST_UNDEFINED 0 /* fmode: not yet defined */ | ||
| 587 | #define MCAST_INCLUDE 1 /* fmode: include these source(s) */ | ||
| 588 | #define MCAST_EXCLUDE 2 /* fmode: exclude these source(s) */ | ||
| 589 | |||
| 590 | /* | ||
| 591 | * Argument for IP_PORTRANGE: | ||
| 592 | * - which range to search when port is unspecified at bind() or connect() | ||
| 593 | */ | ||
| 594 | #define IP_PORTRANGE_DEFAULT 0 /* default range */ | ||
| 595 | #define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ | ||
| 596 | #define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ | ||
| 597 | |||
| 598 | |||
| 599 | /* | ||
| 600 | * IP_PKTINFO: Packet information (equivalent to RFC2292 sec 5 for IPv4) | ||
| 601 | * This structure is used for | ||
| 602 | * | ||
| 603 | * 1) Receiving ancilliary data about the datagram if IP_PKTINFO sockopt is | ||
| 604 | * set on the socket. In this case ipi_ifindex will contain the interface | ||
| 605 | * index the datagram was received on, ipi_addr is the IP address the | ||
| 606 | * datagram was received to. | ||
| 607 | * | ||
| 608 | * 2) Sending a datagram using a specific interface or IP source address. | ||
| 609 | * if ipi_ifindex is set to non-zero when in_pktinfo is passed as | ||
| 610 | * ancilliary data of type IP_PKTINFO, this will be used as the source | ||
| 611 | * interface to send the datagram from. If ipi_ifindex is null, ip_spec_dst | ||
| 612 | * will be used for the source address. | ||
| 613 | * | ||
| 614 | * Note: if IP_BOUND_IF is set on the socket, ipi_ifindex in the ancillary | ||
| 615 | * IP_PKTINFO option silently overrides the bound interface when it is | ||
| 616 | * specified during send time. | ||
| 617 | */ | ||
| 618 | struct in_pktinfo { | ||
| 619 | 	unsigned int ipi_ifindex; /* send/recv interface index */ | ||
| 620 | 	struct in_addr ipi_spec_dst; /* Local address */ | ||
| 621 | 	struct in_addr ipi_addr; /* IP Header dst address */ | ||
| 622 | }; | ||
| 623 | |||
| 624 | /* | ||
| 625 | * Definitions for inet sysctl operations. | ||
| 626 | * | ||
| 627 | * Third level is protocol number. | ||
| 628 | * Fourth level is desired variable within that protocol. | ||
| 629 | */ | ||
| 630 | #define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ | ||
| 631 | |||
| 632 | |||
| 633 | /* | ||
| 634 | * Names for IP sysctl objects | ||
| 635 | */ | ||
| 636 | #define IPCTL_FORWARDING 1 /* act as router */ | ||
| 637 | #define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ | ||
| 638 | #define IPCTL_DEFTTL 3 /* default TTL */ | ||
| 639 | #ifdef notyet | ||
| 640 | #define IPCTL_DEFMTU 4 /* default MTU */ | ||
| 641 | #endif | ||
| 642 | #define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ | ||
| 643 | #define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ | ||
| 644 | #define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ | ||
| 645 | #define IPCTL_SOURCEROUTE 8 /* may perform source routes */ | ||
| 646 | #define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ | ||
| 647 | #define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ | ||
| 648 | #define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ | ||
| 649 | #define IPCTL_STATS 12 /* ipstat structure */ | ||
| 650 | #define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ | ||
| 651 | #define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ | ||
| 652 | #define IPCTL_KEEPFAITH 15 /* deprecated */ | ||
| 653 | #define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ | ||
| 654 | #define IPCTL_MAXID 17 | ||
| 655 | |||
| 656 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 657 | |||
| 658 | /* INET6 stuff */ | ||
| 659 | #define __KAME_NETINET_IN_H_INCLUDED_ | ||
| 660 | #include <netinet6/in6.h> | ||
| 661 | #undef __KAME_NETINET_IN_H_INCLUDED_ | ||
| 662 | |||
| 663 | |||
| 664 | |||
| 665 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 666 | __BEGIN_DECLS | ||
| 667 | int bindresvport(int, struct sockaddr_in *); | ||
| 668 | struct sockaddr; | ||
| 669 | int bindresvport_sa(int, struct sockaddr *); | ||
| 670 | __END_DECLS | ||
| 671 | #endif | ||
| 672 | #endif /* _NETINET_IN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/netinet/tcp.h created+285| ... | @@ -0,0 +1,285 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1982, 1986, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | *	This product includes software developed by the University of | ||
| 43 | *	California, Berkeley and its contributors. | ||
| 44 | * 4. Neither the name of the University nor the names of its contributors | ||
| 45 | * may be used to endorse or promote products derived from this software | ||
| 46 | * without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 58 | * SUCH DAMAGE. | ||
| 59 | * | ||
| 60 | *	@(#)tcp.h	8.1 (Berkeley) 6/10/93 | ||
| 61 | * $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $ | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _NETINET_TCP_H_ | ||
| 65 | #define _NETINET_TCP_H_ | ||
| 66 | #include <sys/appleapiopts.h> | ||
| 67 | |||
| 68 | #include <machine/endian.h> | ||
| 69 | #include <machine/types.h> /* __uint32_t */ | ||
| 70 | |||
| 71 | #include <sys/types.h> | ||
| 72 | |||
| 73 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 74 | typedef __uint32_t tcp_seq; | ||
| 75 | typedef __uint32_t tcp_cc; /* connection count per rfc1644 */ | ||
| 76 | |||
| 77 | #define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */ | ||
| 78 | #define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */ | ||
| 79 | |||
| 80 | /* | ||
| 81 | * TCP header. | ||
| 82 | * Per RFC 793, September, 1981. | ||
| 83 | */ | ||
| 84 | struct tcphdr { | ||
| 85 | 	unsigned short th_sport; /* source port */ | ||
| 86 | 	unsigned short th_dport; /* destination port */ | ||
| 87 | 	tcp_seq th_seq; /* sequence number */ | ||
| 88 | 	tcp_seq th_ack; /* acknowledgement number */ | ||
| 89 | #if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN | ||
| 90 | 	unsigned int th_x2:4, /* (unused) */ | ||
| 91 | 	 th_off:4; /* data offset */ | ||
| 92 | #endif | ||
| 93 | #if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN | ||
| 94 | 	unsigned int th_off:4, /* data offset */ | ||
| 95 | 	 th_x2:4; /* (unused) */ | ||
| 96 | #endif | ||
| 97 | 	unsigned char th_flags; | ||
| 98 | #define TH_FIN 0x01 | ||
| 99 | #define TH_SYN 0x02 | ||
| 100 | #define TH_RST 0x04 | ||
| 101 | #define TH_PUSH 0x08 | ||
| 102 | #define TH_ACK 0x10 | ||
| 103 | #define TH_URG 0x20 | ||
| 104 | #define TH_ECE 0x40 | ||
| 105 | #define TH_CWR 0x80 | ||
| 106 | #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR) | ||
| 107 | #define TH_ACCEPT (TH_FIN|TH_SYN|TH_RST|TH_ACK) | ||
| 108 | |||
| 109 | 	unsigned short th_win; /* window */ | ||
| 110 | 	unsigned short th_sum; /* checksum */ | ||
| 111 | 	unsigned short th_urp; /* urgent pointer */ | ||
| 112 | }; | ||
| 113 | |||
| 114 | #define TCPOPT_EOL 0 | ||
| 115 | #define TCPOPT_NOP 1 | ||
| 116 | #define TCPOPT_MAXSEG 2 | ||
| 117 | #define TCPOLEN_MAXSEG 4 | ||
| 118 | #define TCPOPT_WINDOW 3 | ||
| 119 | #define TCPOLEN_WINDOW 3 | ||
| 120 | #define TCPOPT_SACK_PERMITTED 4 /* Experimental */ | ||
| 121 | #define TCPOLEN_SACK_PERMITTED 2 | ||
| 122 | #define TCPOPT_SACK 5 /* Experimental */ | ||
| 123 | #define TCPOLEN_SACK 8 /* len of sack block */ | ||
| 124 | #define TCPOPT_TIMESTAMP 8 | ||
| 125 | #define TCPOLEN_TIMESTAMP 10 | ||
| 126 | #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ | ||
| 127 | #define TCPOPT_TSTAMP_HDR \ | ||
| 128 | (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) | ||
| 129 | |||
| 130 | #define MAX_TCPOPTLEN 40 /* Absolute maximum TCP options len */ | ||
| 131 | |||
| 132 | #define TCPOPT_CC 11 /* CC options: RFC-1644 */ | ||
| 133 | #define TCPOPT_CCNEW 12 | ||
| 134 | #define TCPOPT_CCECHO 13 | ||
| 135 | #define TCPOLEN_CC 6 | ||
| 136 | #define TCPOLEN_CC_APPA (TCPOLEN_CC+2) | ||
| 137 | #define TCPOPT_CC_HDR(ccopt) \ | ||
| 138 | (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) | ||
| 139 | #define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */ | ||
| 140 | #define TCPOLEN_SIGNATURE 18 | ||
| 141 | #if MPTCP | ||
| 142 | #define TCPOPT_MULTIPATH 30 | ||
| 143 | #endif | ||
| 144 | |||
| 145 | #define TCPOPT_FASTOPEN 34 | ||
| 146 | #define TCPOLEN_FASTOPEN_REQ 2 | ||
| 147 | |||
| 148 | /* Option definitions */ | ||
| 149 | #define TCPOPT_SACK_PERMIT_HDR \ | ||
| 150 | (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK_PERMITTED<<8|TCPOLEN_SACK_PERMITTED) | ||
| 151 | #define TCPOPT_SACK_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK<<8) | ||
| 152 | /* Miscellaneous constants */ | ||
| 153 | #define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at sender side */ | ||
| 154 | |||
| 155 | /* | ||
| 156 | * A SACK option that specifies n blocks will have a length of (8*n + 2) | ||
| 157 | * bytes, so the 40 bytes available for TCP options can specify a | ||
| 158 | * maximum of 4 blocks. | ||
| 159 | */ | ||
| 160 | |||
| 161 | #define TCP_MAX_SACK 4 /* MAX # SACKs sent in any segment */ | ||
| 162 | |||
| 163 | |||
| 164 | /* | ||
| 165 | * Default maximum segment size for TCP. | ||
| 166 | * With an IP MTU of 576, this is 536, | ||
| 167 | * but 512 is probably more convenient. | ||
| 168 | * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). | ||
| 169 | */ | ||
| 170 | #define TCP_MSS 512 | ||
| 171 | |||
| 172 | /* | ||
| 173 | * TCP_MINMSS is defined to be 216 which is fine for the smallest | ||
| 174 | * link MTU (256 bytes, SLIP interface) in the Internet. | ||
| 175 | * However it is very unlikely to come across such low MTU interfaces | ||
| 176 | * these days (anno dato 2004). | ||
| 177 | * Probably it can be set to 512 without ill effects. But we play safe. | ||
| 178 | * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. | ||
| 179 | * Setting this to "0" disables the minmss check. | ||
| 180 | */ | ||
| 181 | #define TCP_MINMSS 216 | ||
| 182 | |||
| 183 | /* | ||
| 184 | * Default maximum segment size for TCP6. | ||
| 185 | * With an IP6 MSS of 1280, this is 1220, | ||
| 186 | * but 1024 is probably more convenient. (xxx kazu in doubt) | ||
| 187 | * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)) | ||
| 188 | */ | ||
| 189 | #define TCP6_MSS 1024 | ||
| 190 | |||
| 191 | #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ | ||
| 192 | #define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ | ||
| 193 | |||
| 194 | #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ | ||
| 195 | |||
| 196 | #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ | ||
| 197 | #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) | ||
| 198 | /* max space left for options */ | ||
| 199 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 200 | |||
| 201 | /* | ||
| 202 | * User-settable options (used with setsockopt). | ||
| 203 | */ | ||
| 204 | #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ | ||
| 205 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 206 | #define TCP_MAXSEG 0x02 /* set maximum segment size */ | ||
| 207 | #define TCP_NOPUSH 0x04 /* don't push last block of write */ | ||
| 208 | #define TCP_NOOPT 0x08 /* don't use TCP options */ | ||
| 209 | #define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */ | ||
| 210 | #define TCP_CONNECTIONTIMEOUT 0x20 /* connection timeout */ | ||
| 211 | #define PERSIST_TIMEOUT 0x40 /* time after which a connection in | ||
| 212 | 	 * persist timeout will terminate. | ||
| 213 | 	 * see draft-ananth-tcpm-persist-02.txt | ||
| 214 | 	 */ | ||
| 215 | #define TCP_RXT_CONNDROPTIME 0x80 /* time after which tcp retransmissions will be | ||
| 216 | 	 * stopped and the connection will be dropped | ||
| 217 | 	 */ | ||
| 218 | #define TCP_RXT_FINDROP 0x100 /* when this option is set, drop a connection | ||
| 219 | 	 * after retransmitting the FIN 3 times. It will | ||
| 220 | 	 * prevent holding too many mbufs in socket | ||
| 221 | 	 * buffer queues. | ||
| 222 | 	 */ | ||
| 223 | #define TCP_KEEPINTVL 0x101 /* interval between keepalives */ | ||
| 224 | #define TCP_KEEPCNT 0x102 /* number of keepalives before close */ | ||
| 225 | #define TCP_SENDMOREACKS 0x103 /* always ack every other packet */ | ||
| 226 | #define TCP_ENABLE_ECN 0x104 /* Enable ECN on a connection */ | ||
| 227 | #define TCP_FASTOPEN 0x105 /* Enable/Disable TCP Fastopen on this socket */ | ||
| 228 | #define TCP_CONNECTION_INFO 0x106 /* State of TCP connection */ | ||
| 229 | |||
| 230 | |||
| 231 | |||
| 232 | #define TCP_NOTSENT_LOWAT 0x201 /* Low water mark for TCP unsent data */ | ||
| 233 | |||
| 234 | |||
| 235 | struct tcp_connection_info { | ||
| 236 | 	u_int8_t tcpi_state; /* connection state */ | ||
| 237 | 	u_int8_t tcpi_snd_wscale; /* Window scale for send window */ | ||
| 238 | 	u_int8_t tcpi_rcv_wscale; /* Window scale for receive window */ | ||
| 239 | 	u_int8_t __pad1; | ||
| 240 | 	u_int32_t tcpi_options; /* TCP options supported */ | ||
| 241 | #define TCPCI_OPT_TIMESTAMPS 0x00000001 /* Timestamps enabled */ | ||
| 242 | #define TCPCI_OPT_SACK 0x00000002 /* SACK enabled */ | ||
| 243 | #define TCPCI_OPT_WSCALE 0x00000004 /* Window scaling enabled */ | ||
| 244 | #define TCPCI_OPT_ECN 0x00000008 /* ECN enabled */ | ||
| 245 | 	u_int32_t tcpi_flags; /* flags */ | ||
| 246 | #define TCPCI_FLAG_LOSSRECOVERY 0x00000001 | ||
| 247 | #define TCPCI_FLAG_REORDERING_DETECTED 0x00000002 | ||
| 248 | 	u_int32_t tcpi_rto; /* retransmit timeout in ms */ | ||
| 249 | 	u_int32_t tcpi_maxseg; /* maximum segment size supported */ | ||
| 250 | 	u_int32_t tcpi_snd_ssthresh; /* slow start threshold in bytes */ | ||
| 251 | 	u_int32_t tcpi_snd_cwnd; /* send congestion window in bytes */ | ||
| 252 | 	u_int32_t tcpi_snd_wnd; /* send widnow in bytes */ | ||
| 253 | 	u_int32_t tcpi_snd_sbbytes; /* bytes in send socket buffer, including in-flight data */ | ||
| 254 | 	u_int32_t tcpi_rcv_wnd; /* receive window in bytes*/ | ||
| 255 | 	u_int32_t tcpi_rttcur; /* most recent RTT in ms */ | ||
| 256 | 	u_int32_t tcpi_srtt; /* average RTT in ms */ | ||
| 257 | 	u_int32_t tcpi_rttvar; /* RTT variance */ | ||
| 258 | 	u_int32_t | ||
| 259 | 	 tcpi_tfo_cookie_req:1, /* Cookie requested? */ | ||
| 260 | 	 tcpi_tfo_cookie_rcv:1, /* Cookie received? */ | ||
| 261 | 	 tcpi_tfo_syn_loss:1, /* Fallback to reg. TCP after SYN-loss */ | ||
| 262 | 	 tcpi_tfo_syn_data_sent:1, /* SYN+data has been sent out */ | ||
| 263 | 	 tcpi_tfo_syn_data_acked:1, /* SYN+data has been fully acknowledged */ | ||
| 264 | 	 tcpi_tfo_syn_data_rcv:1, /* Server received SYN+data with a valid cookie */ | ||
| 265 | 	 tcpi_tfo_cookie_req_rcv:1, /* Server received cookie-request */ | ||
| 266 | 	 tcpi_tfo_cookie_sent:1, /* Server announced cookie */ | ||
| 267 | 	 tcpi_tfo_cookie_invalid:1, /* Server received an invalid cookie */ | ||
| 268 | 	 tcpi_tfo_cookie_wrong:1, /* Our sent cookie was wrong */ | ||
| 269 | 	 tcpi_tfo_no_cookie_rcv:1, /* We did not receive a cookie upon our request */ | ||
| 270 | 	 tcpi_tfo_heuristics_disable:1, /* TFO-heuristics disabled it */ | ||
| 271 | 	 tcpi_tfo_send_blackhole:1, /* A sending-blackhole got detected */ | ||
| 272 | 	 tcpi_tfo_recv_blackhole:1, /* A receiver-blackhole got detected */ | ||
| 273 | 	 tcpi_tfo_onebyte_proxy:1, /* A proxy acknowledges all but one byte of the SYN */ | ||
| 274 | 	 __pad2:17; | ||
| 275 | 	u_int64_t tcpi_txpackets __attribute__((aligned(8))); | ||
| 276 | 	u_int64_t tcpi_txbytes __attribute__((aligned(8))); | ||
| 277 | 	u_int64_t tcpi_txretransmitbytes __attribute__((aligned(8))); | ||
| 278 | 	u_int64_t tcpi_rxpackets __attribute__((aligned(8))); | ||
| 279 | 	u_int64_t tcpi_rxbytes __attribute__((aligned(8))); | ||
| 280 | 	u_int64_t tcpi_rxoutoforderbytes __attribute__((aligned(8))); | ||
| 281 | 	u_int64_t tcpi_txretransmitpackets __attribute__((aligned(8))); | ||
| 282 | }; | ||
| 283 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 284 | |||
| 285 | #endif | ||
lib/libc/include/x86_64-macos-gnu/netinet6/in6.h created+681| ... | @@ -0,0 +1,681 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | ||
| 31 | * All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. Neither the name of the project nor the names of its contributors | ||
| 42 | * may be used to endorse or promote products derived from this software | ||
| 43 | * without specific prior written permission. | ||
| 44 | * | ||
| 45 | * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND | ||
| 46 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE | ||
| 49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 55 | * SUCH DAMAGE. | ||
| 56 | */ | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Copyright (c) 1982, 1986, 1990, 1993 | ||
| 60 | *	The Regents of the University of California. All rights reserved. | ||
| 61 | * | ||
| 62 | * Redistribution and use in source and binary forms, with or without | ||
| 63 | * modification, are permitted provided that the following conditions | ||
| 64 | * are met: | ||
| 65 | * 1. Redistributions of source code must retain the above copyright | ||
| 66 | * notice, this list of conditions and the following disclaimer. | ||
| 67 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 68 | * notice, this list of conditions and the following disclaimer in the | ||
| 69 | * documentation and/or other materials provided with the distribution. | ||
| 70 | * 3. All advertising materials mentioning features or use of this software | ||
| 71 | * must display the following acknowledgement: | ||
| 72 | *	This product includes software developed by the University of | ||
| 73 | *	California, Berkeley and its contributors. | ||
| 74 | * 4. Neither the name of the University nor the names of its contributors | ||
| 75 | * may be used to endorse or promote products derived from this software | ||
| 76 | * without specific prior written permission. | ||
| 77 | * | ||
| 78 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 79 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 80 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 81 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 82 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 83 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 84 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 85 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 86 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 87 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 88 | * SUCH DAMAGE. | ||
| 89 | * | ||
| 90 | *	@(#)in.h	8.3 (Berkeley) 1/3/94 | ||
| 91 | */ | ||
| 92 | |||
| 93 | #ifndef __KAME_NETINET_IN_H_INCLUDED_ | ||
| 94 | #error "do not include netinet6/in6.h directly, include netinet/in.h. " \ | ||
| 95 | " see RFC2553" | ||
| 96 | #endif | ||
| 97 | |||
| 98 | #ifndef _NETINET6_IN6_H_ | ||
| 99 | #define _NETINET6_IN6_H_ | ||
| 100 | #include <sys/appleapiopts.h> | ||
| 101 | |||
| 102 | #include <sys/_types.h> | ||
| 103 | #include <sys/_types/_sa_family_t.h> | ||
| 104 | |||
| 105 | /* | ||
| 106 | * Identification of the network protocol stack | ||
| 107 | * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE | ||
| 108 | * has the table of implementation/integration differences. | ||
| 109 | */ | ||
| 110 | #define __KAME__ | ||
| 111 | #define __KAME_VERSION "2009/apple-darwin" | ||
| 112 | |||
| 113 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 114 | /* | ||
| 115 | * Local port number conventions: | ||
| 116 | * | ||
| 117 | * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), | ||
| 118 | * unless a kernel is compiled with IPNOPRIVPORTS defined. | ||
| 119 | * | ||
| 120 | * When a user does a bind(2) or connect(2) with a port number of zero, | ||
| 121 | * a non-conflicting local port address is chosen. | ||
| 122 | * | ||
| 123 | * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although | ||
| 124 | * that is settable by sysctl(3); net.inet.ip.anonportmin and | ||
| 125 | * net.inet.ip.anonportmax respectively. | ||
| 126 | * | ||
| 127 | * A user may set the IPPROTO_IP option IP_PORTRANGE to change this | ||
| 128 | * default assignment range. | ||
| 129 | * | ||
| 130 | * The value IP_PORTRANGE_DEFAULT causes the default behavior. | ||
| 131 | * | ||
| 132 | * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, | ||
| 133 | * and exists only for FreeBSD compatibility purposes. | ||
| 134 | * | ||
| 135 | * The value IP_PORTRANGE_LOW changes the range to the "low" are | ||
| 136 | * that is (by convention) restricted to privileged processes. | ||
| 137 | * This convention is based on "vouchsafe" principles only. | ||
| 138 | * It is only secure if you trust the remote host to restrict these ports. | ||
| 139 | * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. | ||
| 140 | */ | ||
| 141 | |||
| 142 | #define IPV6PORT_RESERVED 1024 | ||
| 143 | #define IPV6PORT_ANONMIN 49152 | ||
| 144 | #define IPV6PORT_ANONMAX 65535 | ||
| 145 | #define IPV6PORT_RESERVEDMIN 600 | ||
| 146 | #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) | ||
| 147 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 148 | |||
| 149 | /* | ||
| 150 | * IPv6 address | ||
| 151 | */ | ||
| 152 | typedef struct in6_addr { | ||
| 153 | 	union { | ||
| 154 | 		__uint8_t __u6_addr8[16]; | ||
| 155 | 		__uint16_t __u6_addr16[8]; | ||
| 156 | 		__uint32_t __u6_addr32[4]; | ||
| 157 | 	} __u6_addr; /* 128-bit IP6 address */ | ||
| 158 | } in6_addr_t; | ||
| 159 | |||
| 160 | #define s6_addr __u6_addr.__u6_addr8 | ||
| 161 | |||
| 162 | #define INET6_ADDRSTRLEN 46 | ||
| 163 | |||
| 164 | /* | ||
| 165 | * Socket address for IPv6 | ||
| 166 | */ | ||
| 167 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 168 | #define SIN6_LEN | ||
| 169 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 170 | struct sockaddr_in6 { | ||
| 171 | 	__uint8_t sin6_len; /* length of this struct(sa_family_t) */ | ||
| 172 | 	sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ | ||
| 173 | 	in_port_t sin6_port; /* Transport layer port # (in_port_t) */ | ||
| 174 | 	__uint32_t sin6_flowinfo; /* IP6 flow information */ | ||
| 175 | 	struct in6_addr sin6_addr; /* IP6 address */ | ||
| 176 | 	__uint32_t sin6_scope_id; /* scope zone index */ | ||
| 177 | }; | ||
| 178 | |||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | /* | ||
| 184 | * Definition of some useful macros to handle IP6 addresses | ||
| 185 | */ | ||
| 186 | #define IN6ADDR_ANY_INIT \ | ||
| 187 | 	{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 188 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} | ||
| 189 | #define IN6ADDR_LOOPBACK_INIT \ | ||
| 190 | 	{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 191 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} | ||
| 192 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 193 | #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ | ||
| 194 | 	{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 195 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} | ||
| 196 | #define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \ | ||
| 197 | 	{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 198 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} | ||
| 199 | #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ | ||
| 200 | 	{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 201 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} | ||
| 202 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ | ||
| 203 | 	{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 204 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} | ||
| 205 | #define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \ | ||
| 206 | 	{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 207 | 	 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}} | ||
| 208 | #define IN6ADDR_V4MAPPED_INIT \ | ||
| 209 | 	{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | ||
| 210 | 	 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} | ||
| 211 | #define IN6ADDR_MULTICAST_PREFIX IN6MASK8 | ||
| 212 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 213 | |||
| 214 | extern const struct in6_addr in6addr_any; | ||
| 215 | extern const struct in6_addr in6addr_loopback; | ||
| 216 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 217 | extern const struct in6_addr in6addr_nodelocal_allnodes; | ||
| 218 | extern const struct in6_addr in6addr_linklocal_allnodes; | ||
| 219 | extern const struct in6_addr in6addr_linklocal_allrouters; | ||
| 220 | extern const struct in6_addr in6addr_linklocal_allv2routers; | ||
| 221 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 222 | |||
| 223 | /* | ||
| 224 | * Equality | ||
| 225 | * NOTE: Some of kernel programming environment (for example, openbsd/sparc) | ||
| 226 | * does not supply memcmp(). For userland memcmp() is preferred as it is | ||
| 227 | * in ANSI standard. | ||
| 228 | */ | ||
| 229 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 230 | #define IN6_ARE_ADDR_EQUAL(a, b) \ | ||
| 231 | 	(memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof (struct in6_addr)) \ | ||
| 232 | 	== 0) | ||
| 233 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 234 | |||
| 235 | |||
| 236 | /* | ||
| 237 | * Unspecified | ||
| 238 | */ | ||
| 239 | #define IN6_IS_ADDR_UNSPECIFIED(a) \ | ||
| 240 | 	((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ | ||
| 241 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ | ||
| 242 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ | ||
| 243 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) | ||
| 244 | |||
| 245 | /* | ||
| 246 | * Loopback | ||
| 247 | */ | ||
| 248 | #define IN6_IS_ADDR_LOOPBACK(a) \ | ||
| 249 | 	((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ | ||
| 250 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ | ||
| 251 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ | ||
| 252 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) | ||
| 253 | |||
| 254 | /* | ||
| 255 | * IPv4 compatible | ||
| 256 | */ | ||
| 257 | #define IN6_IS_ADDR_V4COMPAT(a) \ | ||
| 258 | 	((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ | ||
| 259 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ | ||
| 260 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ | ||
| 261 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ | ||
| 262 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) | ||
| 263 | |||
| 264 | /* | ||
| 265 | * Mapped | ||
| 266 | */ | ||
| 267 | #define IN6_IS_ADDR_V4MAPPED(a) \ | ||
| 268 | 	((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ | ||
| 269 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ | ||
| 270 | 	(*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == \ | ||
| 271 | 	ntohl(0x0000ffff))) | ||
| 272 | |||
| 273 | /* | ||
| 274 | * 6to4 | ||
| 275 | */ | ||
| 276 | #define IN6_IS_ADDR_6TO4(x) (ntohs((x)->s6_addr16[0]) == 0x2002) | ||
| 277 | |||
| 278 | /* | ||
| 279 | * KAME Scope Values | ||
| 280 | */ | ||
| 281 | |||
| 282 | #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 | ||
| 283 | #define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 | ||
| 284 | #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 | ||
| 285 | #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 | ||
| 286 | #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ | ||
| 287 | #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e | ||
| 288 | |||
| 289 | /* | ||
| 290 | * Unicast Scope | ||
| 291 | * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). | ||
| 292 | */ | ||
| 293 | #define IN6_IS_ADDR_LINKLOCAL(a) \ | ||
| 294 | 	(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) | ||
| 295 | #define IN6_IS_ADDR_SITELOCAL(a) \ | ||
| 296 | 	(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) | ||
| 297 | |||
| 298 | /* | ||
| 299 | * Multicast | ||
| 300 | */ | ||
| 301 | #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) | ||
| 302 | |||
| 303 | #define IPV6_ADDR_MC_FLAGS(a) ((a)->s6_addr[1] & 0xf0) | ||
| 304 | |||
| 305 | #define IPV6_ADDR_MC_FLAGS_TRANSIENT 0x10 | ||
| 306 | #define IPV6_ADDR_MC_FLAGS_PREFIX 0x20 | ||
| 307 | #define IPV6_ADDR_MC_FLAGS_UNICAST_BASED (IPV6_ADDR_MC_FLAGS_TRANSIENT | IPV6_ADDR_MC_FLAGS_PREFIX) | ||
| 308 | |||
| 309 | #define IN6_IS_ADDR_UNICAST_BASED_MULTICAST(a) \ | ||
| 310 | 	(IN6_IS_ADDR_MULTICAST(a) && \ | ||
| 311 | 	(IPV6_ADDR_MC_FLAGS(a) == IPV6_ADDR_MC_FLAGS_UNICAST_BASED)) | ||
| 312 | |||
| 313 | /* | ||
| 314 | * Unique Local IPv6 Unicast Addresses (per RFC 4193) | ||
| 315 | */ | ||
| 316 | #define IN6_IS_ADDR_UNIQUE_LOCAL(a) \ | ||
| 317 | 	(((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd)) | ||
| 318 | |||
| 319 | #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) | ||
| 320 | |||
| 321 | /* | ||
| 322 | * Multicast Scope | ||
| 323 | */ | ||
| 324 | #define IN6_IS_ADDR_MC_NODELOCAL(a) \ | ||
| 325 | 	(IN6_IS_ADDR_MULTICAST(a) && \ | ||
| 326 | 	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) | ||
| 327 | #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ | ||
| 328 | 	(IN6_IS_ADDR_MULTICAST(a) && \ | ||
| 329 | 	(IPV6_ADDR_MC_FLAGS(a) != IPV6_ADDR_MC_FLAGS_UNICAST_BASED) && \ | ||
| 330 | 	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) | ||
| 331 | #define IN6_IS_ADDR_MC_SITELOCAL(a) \ | ||
| 332 | 	(IN6_IS_ADDR_MULTICAST(a) && \ | ||
| 333 | 	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) | ||
| 334 | #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ | ||
| 335 | 	(IN6_IS_ADDR_MULTICAST(a) && \ | ||
| 336 | 	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) | ||
| 337 | #define IN6_IS_ADDR_MC_GLOBAL(a) \ | ||
| 338 | 	(IN6_IS_ADDR_MULTICAST(a) && \ | ||
| 339 | 	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) | ||
| 340 | |||
| 341 | |||
| 342 | |||
| 343 | |||
| 344 | /* | ||
| 345 | * Options for use with [gs]etsockopt at the IPV6 level. | ||
| 346 | * First word of comment is data type; bool is stored in int. | ||
| 347 | */ | ||
| 348 | /* no hdrincl */ | ||
| 349 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 350 | /* | ||
| 351 | * RFC 3542 define the following socket options in a manner incompatible | ||
| 352 | * with RFC 2292: | ||
| 353 | * IPV6_PKTINFO | ||
| 354 | * IPV6_HOPLIMIT | ||
| 355 | * IPV6_NEXTHOP | ||
| 356 | * IPV6_HOPOPTS | ||
| 357 | * IPV6_DSTOPTS | ||
| 358 | * IPV6_RTHDR | ||
| 359 | * | ||
| 360 | * To use the new IPv6 Sockets options introduced by RFC 3542 | ||
| 361 | * the constant __APPLE_USE_RFC_3542 must be defined before | ||
| 362 | * including <netinet/in.h> | ||
| 363 | * | ||
| 364 | * To use the old IPv6 Sockets options from RFC 2292 | ||
| 365 | * the constant __APPLE_USE_RFC_2292 must be defined before | ||
| 366 | * including <netinet/in.h> | ||
| 367 | * | ||
| 368 | * Note that eventually RFC 3542 is going to be the | ||
| 369 | * default and RFC 2292 will be obsolete. | ||
| 370 | */ | ||
| 371 | |||
| 372 | #if defined(__APPLE_USE_RFC_3542) && defined(__APPLE_USE_RFC_2292) | ||
| 373 | #error "__APPLE_USE_RFC_3542 and __APPLE_USE_RFC_2292 cannot be both defined" | ||
| 374 | #endif | ||
| 375 | |||
| 376 | #if 0 /* the followings are relic in IPv4 and hence are disabled */ | ||
| 377 | #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ | ||
| 378 | #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ | ||
| 379 | #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ | ||
| 380 | #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ | ||
| 381 | #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ | ||
| 382 | #endif /* 0 */ | ||
| 383 | #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ | ||
| 384 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 385 | #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ | ||
| 386 | #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ | ||
| 387 | #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ | ||
| 388 | #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 mcast loopback */ | ||
| 389 | #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ | ||
| 390 | #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ | ||
| 391 | |||
| 392 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 393 | #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ | ||
| 394 | #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ | ||
| 395 | #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ | ||
| 396 | #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ | ||
| 397 | #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ | ||
| 398 | #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ | ||
| 399 | #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ | ||
| 400 | #define IPV6_2292RTHDR 24 /* ip6_rthdr: routing header */ | ||
| 401 | |||
| 402 | /* buf/cmsghdr; set/get IPv6 options [obsoleted by RFC3542] */ | ||
| 403 | #define IPV6_2292PKTOPTIONS 25 | ||
| 404 | |||
| 405 | #ifdef __APPLE_USE_RFC_2292 | ||
| 406 | #define IPV6_PKTINFO IPV6_2292PKTINFO | ||
| 407 | #define IPV6_HOPLIMIT IPV6_2292HOPLIMIT | ||
| 408 | #define IPV6_NEXTHOP IPV6_2292NEXTHOP | ||
| 409 | #define IPV6_HOPOPTS IPV6_2292HOPOPTS | ||
| 410 | #define IPV6_DSTOPTS IPV6_2292DSTOPTS | ||
| 411 | #define IPV6_RTHDR IPV6_2292RTHDR | ||
| 412 | #define IPV6_PKTOPTIONS IPV6_2292PKTOPTIONS | ||
| 413 | #endif /* __APPLE_USE_RFC_2292 */ | ||
| 414 | |||
| 415 | #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ | ||
| 416 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 417 | #define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ | ||
| 418 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 419 | #define IPV6_BINDV6ONLY IPV6_V6ONLY | ||
| 420 | |||
| 421 | |||
| 422 | #if 1 /* IPSEC */ | ||
| 423 | #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ | ||
| 424 | #endif /* 1 */ | ||
| 425 | #define IPV6_FAITH 29 /* deprecated */ | ||
| 426 | |||
| 427 | #if 1 /* IPV6FIREWALL */ | ||
| 428 | #define IPV6_FW_ADD 30 /* add a firewall rule to chain */ | ||
| 429 | #define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ | ||
| 430 | #define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ | ||
| 431 | #define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ | ||
| 432 | #define IPV6_FW_GET 34 /* get entire firewall rule chain */ | ||
| 433 | #endif /* 1 */ | ||
| 434 | |||
| 435 | /* | ||
| 436 | * APPLE: NOTE the value of those 2 options is kept unchanged from | ||
| 437 | * previous version of darwin/OS X for binary compatibility reasons | ||
| 438 | * and differ from FreeBSD (values 57 and 61). See below. | ||
| 439 | */ | ||
| 440 | #define IPV6_RECVTCLASS 35 /* bool; recv traffic class values */ | ||
| 441 | #define IPV6_TCLASS 36 /* int; send traffic class value */ | ||
| 442 | |||
| 443 | #ifdef __APPLE_USE_RFC_3542 | ||
| 444 | /* new socket options introduced in RFC3542 */ | ||
| 445 | /* | ||
| 446 | * ip6_dest; send dst option before rthdr | ||
| 447 | * APPLE: Value purposely different than FreeBSD (35) to avoid | ||
| 448 | * collision with definition of IPV6_RECVTCLASS in previous | ||
| 449 | * darwin implementations | ||
| 450 | */ | ||
| 451 | #define IPV6_RTHDRDSTOPTS 57 | ||
| 452 | |||
| 453 | /* | ||
| 454 | * bool; recv if, dst addr | ||
| 455 | * APPLE: Value purposely different than FreeBSD(36) to avoid | ||
| 456 | * collision with definition of IPV6_TCLASS in previous | ||
| 457 | * darwin implementations | ||
| 458 | */ | ||
| 459 | #define IPV6_RECVPKTINFO 61 | ||
| 460 | |||
| 461 | #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ | ||
| 462 | #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ | ||
| 463 | #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ | ||
| 464 | #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ | ||
| 465 | |||
| 466 | #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ | ||
| 467 | #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ | ||
| 468 | |||
| 469 | /* | ||
| 470 | * mtuinfo; get the current path MTU (sopt), 4 bytes int; | ||
| 471 | * MTU notification (cmsg) | ||
| 472 | */ | ||
| 473 | #define IPV6_PATHMTU 44 | ||
| 474 | |||
| 475 | #if 0 /* obsoleted during 2292bis -> 3542 */ | ||
| 476 | /* no data; ND reachability confirm (cmsg only/not in of RFC3542) */ | ||
| 477 | #define IPV6_REACHCONF 45 | ||
| 478 | #endif | ||
| 479 | /* more new socket options introduced in RFC3542 */ | ||
| 480 | #define IPV6_3542PKTINFO 46 /* in6_pktinfo; send if, src addr */ | ||
| 481 | #define IPV6_3542HOPLIMIT 47 /* int; send hop limit */ | ||
| 482 | #define IPV6_3542NEXTHOP 48 /* sockaddr; next hop addr */ | ||
| 483 | #define IPV6_3542HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ | ||
| 484 | #define IPV6_3542DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ | ||
| 485 | #define IPV6_3542RTHDR 51 /* ip6_rthdr; send routing header */ | ||
| 486 | |||
| 487 | #define IPV6_PKTINFO IPV6_3542PKTINFO | ||
| 488 | #define IPV6_HOPLIMIT IPV6_3542HOPLIMIT | ||
| 489 | #define IPV6_NEXTHOP IPV6_3542NEXTHOP | ||
| 490 | #define IPV6_HOPOPTS IPV6_3542HOPOPTS | ||
| 491 | #define IPV6_DSTOPTS IPV6_3542DSTOPTS | ||
| 492 | #define IPV6_RTHDR IPV6_3542RTHDR | ||
| 493 | |||
| 494 | #define IPV6_AUTOFLOWLABEL 59 /* bool; attach flowlabel automagically */ | ||
| 495 | |||
| 496 | #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ | ||
| 497 | |||
| 498 | /* int; prefer temporary addresses as the source address. */ | ||
| 499 | #define IPV6_PREFER_TEMPADDR 63 | ||
| 500 | |||
| 501 | /* | ||
| 502 | * The following option is private; do not use it from user applications. | ||
| 503 | * It is deliberately defined to the same value as IP_MSFILTER. | ||
| 504 | */ | ||
| 505 | #define IPV6_MSFILTER 74 /* struct __msfilterreq; */ | ||
| 506 | #endif /* __APPLE_USE_RFC_3542 */ | ||
| 507 | |||
| 508 | #define IPV6_BOUND_IF 125 /* int; set/get bound interface */ | ||
| 509 | |||
| 510 | |||
| 511 | /* to define items, should talk with KAME guys first, for *BSD compatibility */ | ||
| 512 | |||
| 513 | #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. */ | ||
| 514 | #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. */ | ||
| 515 | #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ | ||
| 516 | |||
| 517 | /* | ||
| 518 | * Defaults and limits for options | ||
| 519 | */ | ||
| 520 | #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ | ||
| 521 | #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ | ||
| 522 | |||
| 523 | /* | ||
| 524 | * The im6o_membership vector for each socket is now dynamically allocated at | ||
| 525 | * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized | ||
| 526 | * according to a power-of-two increment. | ||
| 527 | */ | ||
| 528 | #define IPV6_MIN_MEMBERSHIPS 31 | ||
| 529 | #define IPV6_MAX_MEMBERSHIPS 4095 | ||
| 530 | |||
| 531 | /* | ||
| 532 | * Default resource limits for IPv6 multicast source filtering. | ||
| 533 | * These may be modified by sysctl. | ||
| 534 | */ | ||
| 535 | #define IPV6_MAX_GROUP_SRC_FILTER 512 /* sources per group */ | ||
| 536 | #define IPV6_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ | ||
| 537 | |||
| 538 | /* | ||
| 539 | * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. | ||
| 540 | */ | ||
| 541 | struct ipv6_mreq { | ||
| 542 | 	struct in6_addr ipv6mr_multiaddr; | ||
| 543 | 	unsigned int ipv6mr_interface; | ||
| 544 | }; | ||
| 545 | |||
| 546 | /* | ||
| 547 | * IPV6_2292PKTINFO: Packet information(RFC2292 sec 5) | ||
| 548 | */ | ||
| 549 | struct in6_pktinfo { | ||
| 550 | 	struct in6_addr ipi6_addr; /* src/dst IPv6 address */ | ||
| 551 | 	unsigned int ipi6_ifindex; /* send/recv interface index */ | ||
| 552 | }; | ||
| 553 | |||
| 554 | /* | ||
| 555 | * Control structure for IPV6_RECVPATHMTU socket option. | ||
| 556 | */ | ||
| 557 | struct ip6_mtuinfo { | ||
| 558 | 	struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ | ||
| 559 | 	uint32_t ip6m_mtu; | ||
| 560 | }; | ||
| 561 | |||
| 562 | /* | ||
| 563 | * Argument for IPV6_PORTRANGE: | ||
| 564 | * - which range to search when port is unspecified at bind() or connect() | ||
| 565 | */ | ||
| 566 | #define IPV6_PORTRANGE_DEFAULT 0 /* default range */ | ||
| 567 | #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ | ||
| 568 | #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ | ||
| 569 | |||
| 570 | /* | ||
| 571 | * Definitions for inet6 sysctl operations. | ||
| 572 | * | ||
| 573 | * Third level is protocol number. | ||
| 574 | * Fourth level is desired variable within that protocol. | ||
| 575 | */ | ||
| 576 | #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ | ||
| 577 | |||
| 578 | /* | ||
| 579 | * Names for IP sysctl objects | ||
| 580 | */ | ||
| 581 | #define IPV6CTL_FORWARDING 1 /* act as router */ | ||
| 582 | #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ | ||
| 583 | #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ | ||
| 584 | #ifdef notyet | ||
| 585 | #define IPV6CTL_DEFMTU 4 /* default MTU */ | ||
| 586 | #endif | ||
| 587 | #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ | ||
| 588 | #define IPV6CTL_STATS 6 /* stats */ | ||
| 589 | #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ | ||
| 590 | #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ | ||
| 591 | #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ | ||
| 592 | #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ | ||
| 593 | #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ | ||
| 594 | #define IPV6CTL_ACCEPT_RTADV 12 | ||
| 595 | #define IPV6CTL_KEEPFAITH 13 /* deprecated */ | ||
| 596 | #define IPV6CTL_LOG_INTERVAL 14 | ||
| 597 | #define IPV6CTL_HDRNESTLIMIT 15 | ||
| 598 | #define IPV6CTL_DAD_COUNT 16 | ||
| 599 | #define IPV6CTL_AUTO_FLOWLABEL 17 | ||
| 600 | #define IPV6CTL_DEFMCASTHLIM 18 | ||
| 601 | #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ | ||
| 602 | #define IPV6CTL_KAME_VERSION 20 | ||
| 603 | #define IPV6CTL_USE_DEPRECATED 21 /* use deprec addr (RFC2462 5.5.4) */ | ||
| 604 | #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ | ||
| 605 | #if 0 /* obsolete */ | ||
| 606 | #define IPV6CTL_MAPPED_ADDR 23 | ||
| 607 | #endif | ||
| 608 | #define IPV6CTL_V6ONLY 24 | ||
| 609 | #define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ | ||
| 610 | #define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ | ||
| 611 | #define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ | ||
| 612 | |||
| 613 | #define IPV6CTL_USETEMPADDR 32 /* use temporary addresses [RFC 4941] */ | ||
| 614 | #define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ | ||
| 615 | #define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ | ||
| 616 | #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ | ||
| 617 | #define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ | ||
| 618 | #define IPV6CTL_PREFER_TEMPADDR 37 /* prefer temporary addr as src */ | ||
| 619 | #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ | ||
| 620 | #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ | ||
| 621 | |||
| 622 | #define IPV6CTL_MAXFRAGS 41 /* max fragments */ | ||
| 623 | #define IPV6CTL_MCAST_PMTU 44 /* enable pMTU discovery for mcast? */ | ||
| 624 | |||
| 625 | #define IPV6CTL_NEIGHBORGCTHRESH 46 | ||
| 626 | #define IPV6CTL_MAXIFPREFIXES 47 | ||
| 627 | #define IPV6CTL_MAXIFDEFROUTERS 48 | ||
| 628 | #define IPV6CTL_MAXDYNROUTES 49 | ||
| 629 | #define ICMPV6CTL_ND6_ONLINKNSRFC4861 50 | ||
| 630 | |||
| 631 | /* New entries should be added here from current IPV6CTL_MAXID value. */ | ||
| 632 | /* to define items, should talk with KAME guys first, for *BSD compatibility */ | ||
| 633 | #define IPV6CTL_MAXID 51 | ||
| 634 | |||
| 635 | |||
| 636 | |||
| 637 | |||
| 638 | |||
| 639 | __BEGIN_DECLS | ||
| 640 | struct cmsghdr; | ||
| 641 | |||
| 642 | extern int inet6_option_space(int); | ||
| 643 | extern int inet6_option_init(void *, struct cmsghdr **, int); | ||
| 644 | extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, int, int); | ||
| 645 | extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); | ||
| 646 | extern int inet6_option_next(const struct cmsghdr *, __uint8_t **); | ||
| 647 | extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int); | ||
| 648 | |||
| 649 | extern size_t inet6_rthdr_space(int, int); | ||
| 650 | extern struct cmsghdr *inet6_rthdr_init(void *, int); | ||
| 651 | extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, | ||
| 652 | unsigned int); | ||
| 653 | extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); | ||
| 654 | #if 0 /* not implemented yet */ | ||
| 655 | extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); | ||
| 656 | #endif | ||
| 657 | extern int inet6_rthdr_segments(const struct cmsghdr *); | ||
| 658 | extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); | ||
| 659 | extern int inet6_rthdr_getflags(const struct cmsghdr *, int); | ||
| 660 | |||
| 661 | extern int inet6_opt_init(void *, socklen_t); | ||
| 662 | extern int inet6_opt_append(void *, socklen_t, int, __uint8_t, socklen_t, | ||
| 663 | __uint8_t, void **); | ||
| 664 | extern int inet6_opt_finish(void *, socklen_t, int); | ||
| 665 | extern int inet6_opt_set_val(void *, int, void *, socklen_t); | ||
| 666 | |||
| 667 | extern int inet6_opt_next(void *, socklen_t, int, __uint8_t *, socklen_t *, | ||
| 668 | void **); | ||
| 669 | extern int inet6_opt_find(void *, socklen_t, int, __uint8_t, socklen_t *, | ||
| 670 | void **); | ||
| 671 | extern int inet6_opt_get_val(void *, int, void *, socklen_t); | ||
| 672 | extern socklen_t inet6_rth_space(int, int); | ||
| 673 | extern void *inet6_rth_init(void *, socklen_t, int, int); | ||
| 674 | extern int inet6_rth_add(void *, const struct in6_addr *); | ||
| 675 | extern int inet6_rth_reverse(const void *, void *); | ||
| 676 | extern int inet6_rth_segments(const void *); | ||
| 677 | extern struct in6_addr *inet6_rth_getaddr(const void *, int); | ||
| 678 | |||
| 679 | __END_DECLS | ||
| 680 | #endif /* PLATFORM_DriverKit */ | ||
| 681 | #endif /* !_NETINET6_IN6_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/nl_types.h created+103| ... | @@ -0,0 +1,103 @@ | ||
| 1 | /*	$NetBSD: nl_types.h,v 1.9 2000/10/03 19:53:32 sommerfeld Exp $	*/ | ||
| 2 | |||
| 3 | /*- | ||
| 4 | * Copyright (c) 1996 The NetBSD Foundation, Inc. | ||
| 5 | * All rights reserved. | ||
| 6 | * | ||
| 7 | * This code is derived from software contributed to The NetBSD Foundation | ||
| 8 | * by J.T. Conklin. | ||
| 9 | * | ||
| 10 | * Redistribution and use in source and binary forms, with or without | ||
| 11 | * modification, are permitted provided that the following conditions | ||
| 12 | * are met: | ||
| 13 | * 1. Redistributions of source code must retain the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer. | ||
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | * notice, this list of conditions and the following disclaimer in the | ||
| 17 | * documentation and/or other materials provided with the distribution. | ||
| 18 | * 3. All advertising materials mentioning features or use of this software | ||
| 19 | * must display the following acknowledgement: | ||
| 20 | * This product includes software developed by the NetBSD | ||
| 21 | * Foundation, Inc. and its contributors. | ||
| 22 | * 4. Neither the name of The NetBSD Foundation nor the names of its | ||
| 23 | * contributors may be used to endorse or promote products derived | ||
| 24 | * from this software without specific prior written permission. | ||
| 25 | * | ||
| 26 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | ||
| 27 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| 28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | ||
| 30 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 31 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 36 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 37 | * | ||
| 38 | * $FreeBSD: src/include/nl_types.h,v 1.11 2005/02/27 16:20:53 phantom Exp $ | ||
| 39 | */ | ||
| 40 | |||
| 41 | #ifndef _NL_TYPES_H_ | ||
| 42 | #define _NL_TYPES_H_ | ||
| 43 | |||
| 44 | #include <sys/cdefs.h> | ||
| 45 | #include <sys/types.h> | ||
| 46 | #include <_types.h> | ||
| 47 | |||
| 48 | #ifdef _NLS_PRIVATE | ||
| 49 | /* | ||
| 50 | * MESSAGE CATALOG FILE FORMAT. | ||
| 51 | * | ||
| 52 | * The NetBSD/FreeBSD message catalog format is similar to the format used by | ||
| 53 | * Svr4 systems. The differences are: | ||
| 54 | * * fixed byte order (big endian) | ||
| 55 | * * fixed data field sizes | ||
| 56 | * | ||
| 57 | * A message catalog contains four data types: a catalog header, one | ||
| 58 | * or more set headers, one or more message headers, and one or more | ||
| 59 | * text strings. | ||
| 60 | */ | ||
| 61 | |||
| 62 | #define _NLS_MAGIC	0xff88ff89 | ||
| 63 | |||
| 64 | struct _nls_cat_hdr { | ||
| 65 | 	int32_t __magic; | ||
| 66 | 	int32_t __nsets; | ||
| 67 | 	int32_t __mem; | ||
| 68 | 	int32_t __msg_hdr_offset; | ||
| 69 | 	int32_t __msg_txt_offset; | ||
| 70 | } ; | ||
| 71 | |||
| 72 | struct _nls_set_hdr { | ||
| 73 | 	int32_t __setno;	/* set number: 0 < x <= NL_SETMAX */ | ||
| 74 | 	int32_t __nmsgs;	/* number of messages in the set */ | ||
| 75 | 	int32_t __index;	/* index of first msg_hdr in msg_hdr table */ | ||
| 76 | } ; | ||
| 77 | |||
| 78 | struct _nls_msg_hdr { | ||
| 79 | 	int32_t __msgno;	/* msg number: 0 < x <= NL_MSGMAX */ | ||
| 80 | 	int32_t __msglen; | ||
| 81 | 	int32_t __offset; | ||
| 82 | } ; | ||
| 83 | |||
| 84 | #endif	/* _NLS_PRIVATE */ | ||
| 85 | |||
| 86 | #define	NL_SETD		1 | ||
| 87 | #define	NL_CAT_LOCALE	1 | ||
| 88 | |||
| 89 | typedef struct __nl_cat_d { | ||
| 90 | 	void	*__data; | ||
| 91 | 	int	__size; | ||
| 92 | } *nl_catd; | ||
| 93 | |||
| 94 | #include <_types/_nl_item.h> | ||
| 95 | |||
| 96 | __BEGIN_DECLS | ||
| 97 | nl_catd catopen(const char *, int); | ||
| 98 | char *catgets(nl_catd, int, int, const char *) | ||
| 99 | 	__attribute__((__format_arg__(4))); | ||
| 100 | int	 catclose(nl_catd); | ||
| 101 | __END_DECLS | ||
| 102 | |||
| 103 | #endif	/* _NL_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/objc/NSObjCRuntime.h created+33| ... | @@ -0,0 +1,33 @@ | ||
| 1 | /*	NSObjCRuntime.h | ||
| 2 | 	Copyright (c) 1994-2012, Apple Inc. All rights reserved. | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _OBJC_NSOBJCRUNTIME_H_ | ||
| 6 | #define _OBJC_NSOBJCRUNTIME_H_ | ||
| 7 | |||
| 8 | #include <TargetConditionals.h> | ||
| 9 | #include <objc/objc.h> | ||
| 10 | |||
| 11 | #if __LP64__ || 0 || NS_BUILD_32_LIKE_64 | ||
| 12 | typedef long NSInteger; | ||
| 13 | typedef unsigned long NSUInteger; | ||
| 14 | #else | ||
| 15 | typedef int NSInteger; | ||
| 16 | typedef unsigned int NSUInteger; | ||
| 17 | #endif | ||
| 18 | |||
| 19 | #define NSIntegerMax LONG_MAX | ||
| 20 | #define NSIntegerMin LONG_MIN | ||
| 21 | #define NSUIntegerMax ULONG_MAX | ||
| 22 | |||
| 23 | #define NSINTEGER_DEFINED 1 | ||
| 24 | |||
| 25 | #ifndef NS_DESIGNATED_INITIALIZER | ||
| 26 | #if __has_attribute(objc_designated_initializer) | ||
| 27 | #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) | ||
| 28 | #else | ||
| 29 | #define NS_DESIGNATED_INITIALIZER | ||
| 30 | #endif | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #endif | ||
lib/libc/include/x86_64-macos-gnu/objc/NSObject.h created+112| ... | @@ -0,0 +1,112 @@ | ||
| 1 | /*	NSObject.h | ||
| 2 | 	Copyright (c) 1994-2012, Apple Inc. All rights reserved. | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _OBJC_NSOBJECT_H_ | ||
| 6 | #define _OBJC_NSOBJECT_H_ | ||
| 7 | |||
| 8 | #if __OBJC__ | ||
| 9 | |||
| 10 | #include <objc/objc.h> | ||
| 11 | #include <objc/NSObjCRuntime.h> | ||
| 12 | |||
| 13 | @class NSString, NSMethodSignature, NSInvocation; | ||
| 14 | |||
| 15 | @protocol NSObject | ||
| 16 | |||
| 17 | - (BOOL)isEqual:(id)object; | ||
| 18 | @property (readonly) NSUInteger hash; | ||
| 19 | |||
| 20 | @property (readonly) Class superclass; | ||
| 21 | - (Class)class OBJC_SWIFT_UNAVAILABLE("use 'type(of: anObject)' instead"); | ||
| 22 | - (instancetype)self; | ||
| 23 | |||
| 24 | - (id)performSelector:(SEL)aSelector; | ||
| 25 | - (id)performSelector:(SEL)aSelector withObject:(id)object; | ||
| 26 | - (id)performSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2; | ||
| 27 | |||
| 28 | - (BOOL)isProxy; | ||
| 29 | |||
| 30 | - (BOOL)isKindOfClass:(Class)aClass; | ||
| 31 | - (BOOL)isMemberOfClass:(Class)aClass; | ||
| 32 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol; | ||
| 33 | |||
| 34 | - (BOOL)respondsToSelector:(SEL)aSelector; | ||
| 35 | |||
| 36 | - (instancetype)retain OBJC_ARC_UNAVAILABLE; | ||
| 37 | - (oneway void)release OBJC_ARC_UNAVAILABLE; | ||
| 38 | - (instancetype)autorelease OBJC_ARC_UNAVAILABLE; | ||
| 39 | - (NSUInteger)retainCount OBJC_ARC_UNAVAILABLE; | ||
| 40 | |||
| 41 | - (struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; | ||
| 42 | |||
| 43 | @property (readonly, copy) NSString *description; | ||
| 44 | @optional | ||
| 45 | @property (readonly, copy) NSString *debugDescription; | ||
| 46 | |||
| 47 | @end | ||
| 48 | |||
| 49 | |||
| 50 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 51 | OBJC_ROOT_CLASS | ||
| 52 | OBJC_EXPORT | ||
| 53 | @interface NSObject <NSObject> { | ||
| 54 | #pragma clang diagnostic push | ||
| 55 | #pragma clang diagnostic ignored "-Wobjc-interface-ivars" | ||
| 56 | Class isa OBJC_ISA_AVAILABILITY; | ||
| 57 | #pragma clang diagnostic pop | ||
| 58 | } | ||
| 59 | |||
| 60 | + (void)load; | ||
| 61 | |||
| 62 | + (void)initialize; | ||
| 63 | - (instancetype)init | ||
| 64 | #if NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER | ||
| 65 | NS_DESIGNATED_INITIALIZER | ||
| 66 | #endif | ||
| 67 | ; | ||
| 68 | |||
| 69 | + (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); | ||
| 70 | + (instancetype)allocWithZone:(struct _NSZone *)zone OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); | ||
| 71 | + (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); | ||
| 72 | - (void)dealloc OBJC_SWIFT_UNAVAILABLE("use 'deinit' to define a de-initializer"); | ||
| 73 | |||
| 74 | - (void)finalize OBJC_DEPRECATED("Objective-C garbage collection is no longer supported"); | ||
| 75 | |||
| 76 | - (id)copy; | ||
| 77 | - (id)mutableCopy; | ||
| 78 | |||
| 79 | + (id)copyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; | ||
| 80 | + (id)mutableCopyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; | ||
| 81 | |||
| 82 | + (BOOL)instancesRespondToSelector:(SEL)aSelector; | ||
| 83 | + (BOOL)conformsToProtocol:(Protocol *)protocol; | ||
| 84 | - (IMP)methodForSelector:(SEL)aSelector; | ||
| 85 | + (IMP)instanceMethodForSelector:(SEL)aSelector; | ||
| 86 | - (void)doesNotRecognizeSelector:(SEL)aSelector; | ||
| 87 | |||
| 88 | - (id)forwardingTargetForSelector:(SEL)aSelector OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 89 | - (void)forwardInvocation:(NSInvocation *)anInvocation OBJC_SWIFT_UNAVAILABLE(""); | ||
| 90 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE(""); | ||
| 91 | |||
| 92 | + (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE(""); | ||
| 93 | |||
| 94 | - (BOOL)allowsWeakReference UNAVAILABLE_ATTRIBUTE; | ||
| 95 | - (BOOL)retainWeakReference UNAVAILABLE_ATTRIBUTE; | ||
| 96 | |||
| 97 | + (BOOL)isSubclassOfClass:(Class)aClass; | ||
| 98 | |||
| 99 | + (BOOL)resolveClassMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 100 | + (BOOL)resolveInstanceMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 101 | |||
| 102 | + (NSUInteger)hash; | ||
| 103 | + (Class)superclass; | ||
| 104 | + (Class)class OBJC_SWIFT_UNAVAILABLE("use 'aClass.self' instead"); | ||
| 105 | + (NSString *)description; | ||
| 106 | + (NSString *)debugDescription; | ||
| 107 | |||
| 108 | @end | ||
| 109 | |||
| 110 | #endif | ||
| 111 | |||
| 112 | #endif | ||
lib/libc/include/x86_64-macos-gnu/objc/message.h created+388| ... | @@ -0,0 +1,388 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2007 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _OBJC_MESSAGE_H | ||
| 25 | #define _OBJC_MESSAGE_H | ||
| 26 | |||
| 27 | #include <objc/objc.h> | ||
| 28 | #include <objc/runtime.h> | ||
| 29 | |||
| 30 | #ifndef OBJC_SUPER | ||
| 31 | #define OBJC_SUPER | ||
| 32 | |||
| 33 | /// Specifies the superclass of an instance. | ||
| 34 | struct objc_super { | ||
| 35 | /// Specifies an instance of a class. | ||
| 36 | __unsafe_unretained _Nonnull id receiver; | ||
| 37 | |||
| 38 | /// Specifies the particular superclass of the instance to message. | ||
| 39 | #if !defined(__cplusplus) && !__OBJC2__ | ||
| 40 | /* For compatibility with old objc-runtime.h header */ | ||
| 41 | __unsafe_unretained _Nonnull Class class; | ||
| 42 | #else | ||
| 43 | __unsafe_unretained _Nonnull Class super_class; | ||
| 44 | #endif | ||
| 45 | /* super_class is the first class to search */ | ||
| 46 | }; | ||
| 47 | #endif | ||
| 48 | |||
| 49 | |||
| 50 | /* Basic Messaging Primitives | ||
| 51 | * | ||
| 52 | * On some architectures, use objc_msgSend_stret for some struct return types. | ||
| 53 | * On some architectures, use objc_msgSend_fpret for some float return types. | ||
| 54 | * On some architectures, use objc_msgSend_fp2ret for some float return types. | ||
| 55 | * | ||
| 56 | * These functions must be cast to an appropriate function pointer type | ||
| 57 | * before being called. | ||
| 58 | */ | ||
| 59 | #if !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 60 | #pragma clang diagnostic push | ||
| 61 | #pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" | ||
| 62 | OBJC_EXPORT void | ||
| 63 | objc_msgSend(void /* id self, SEL op, ... */ ) | ||
| 64 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 65 | |||
| 66 | OBJC_EXPORT void | ||
| 67 | objc_msgSendSuper(void /* struct objc_super *super, SEL op, ... */ ) | ||
| 68 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 69 | #pragma clang diagnostic pop | ||
| 70 | #else | ||
| 71 | /** | ||
| 72 | * Sends a message with a simple return value to an instance of a class. | ||
| 73 | * | ||
| 74 | * @param self A pointer to the instance of the class that is to receive the message. | ||
| 75 | * @param op The selector of the method that handles the message. | ||
| 76 | * @param ... | ||
| 77 | * A variable argument list containing the arguments to the method. | ||
| 78 | * | ||
| 79 | * @return The return value of the method. | ||
| 80 | * | ||
| 81 | * @note When it encounters a method call, the compiler generates a call to one of the | ||
| 82 | * functions \c objc_msgSend, \c objc_msgSend_stret, \c objc_msgSendSuper, or \c objc_msgSendSuper_stret. | ||
| 83 | * Messages sent to an object’s superclass (using the \c super keyword) are sent using \c objc_msgSendSuper; | ||
| 84 | * other messages are sent using \c objc_msgSend. Methods that have data structures as return values | ||
| 85 | * are sent using \c objc_msgSendSuper_stret and \c objc_msgSend_stret. | ||
| 86 | */ | ||
| 87 | OBJC_EXPORT id _Nullable | ||
| 88 | objc_msgSend(id _Nullable self, SEL _Nonnull op, ...) | ||
| 89 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 90 | /** | ||
| 91 | * Sends a message with a simple return value to the superclass of an instance of a class. | ||
| 92 | * | ||
| 93 | * @param super A pointer to an \c objc_super data structure. Pass values identifying the | ||
| 94 | * context the message was sent to, including the instance of the class that is to receive the | ||
| 95 | * message and the superclass at which to start searching for the method implementation. | ||
| 96 | * @param op A pointer of type SEL. Pass the selector of the method that will handle the message. | ||
| 97 | * @param ... | ||
| 98 | * A variable argument list containing the arguments to the method. | ||
| 99 | * | ||
| 100 | * @return The return value of the method identified by \e op. | ||
| 101 | * | ||
| 102 | * @see objc_msgSend | ||
| 103 | */ | ||
| 104 | OBJC_EXPORT id _Nullable | ||
| 105 | objc_msgSendSuper(struct objc_super * _Nonnull super, SEL _Nonnull op, ...) | ||
| 106 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 107 | #endif | ||
| 108 | |||
| 109 | |||
| 110 | /* Struct-returning Messaging Primitives | ||
| 111 | * | ||
| 112 | * Use these functions to call methods that return structs on the stack. | ||
| 113 | * On some architectures, some structures are returned in registers. | ||
| 114 | * Consult your local function call ABI documentation for details. | ||
| 115 | * | ||
| 116 | * These functions must be cast to an appropriate function pointer type | ||
| 117 | * before being called. | ||
| 118 | */ | ||
| 119 | #if !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 120 | #pragma clang diagnostic push | ||
| 121 | #pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" | ||
| 122 | OBJC_EXPORT void | ||
| 123 | objc_msgSend_stret(void /* id self, SEL op, ... */ ) | ||
| 124 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 125 | OBJC_ARM64_UNAVAILABLE; | ||
| 126 | |||
| 127 | OBJC_EXPORT void | ||
| 128 | objc_msgSendSuper_stret(void /* struct objc_super *super, SEL op, ... */ ) | ||
| 129 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 130 | OBJC_ARM64_UNAVAILABLE; | ||
| 131 | #pragma clang diagnostic pop | ||
| 132 | #else | ||
| 133 | /** | ||
| 134 | * Sends a message with a data-structure return value to an instance of a class. | ||
| 135 | * | ||
| 136 | * @see objc_msgSend | ||
| 137 | */ | ||
| 138 | OBJC_EXPORT void | ||
| 139 | objc_msgSend_stret(id _Nullable self, SEL _Nonnull op, ...) | ||
| 140 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 141 | OBJC_ARM64_UNAVAILABLE; | ||
| 142 | |||
| 143 | /** | ||
| 144 | * Sends a message with a data-structure return value to the superclass of an instance of a class. | ||
| 145 | * | ||
| 146 | * @see objc_msgSendSuper | ||
| 147 | */ | ||
| 148 | OBJC_EXPORT void | ||
| 149 | objc_msgSendSuper_stret(struct objc_super * _Nonnull super, | ||
| 150 | SEL _Nonnull op, ...) | ||
| 151 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 152 | OBJC_ARM64_UNAVAILABLE; | ||
| 153 | #endif | ||
| 154 | |||
| 155 | |||
| 156 | /* Floating-point-returning Messaging Primitives | ||
| 157 | * | ||
| 158 | * Use these functions to call methods that return floating-point values | ||
| 159 | * on the stack. | ||
| 160 | * Consult your local function call ABI documentation for details. | ||
| 161 | * | ||
| 162 | * arm: objc_msgSend_fpret not used | ||
| 163 | * i386: objc_msgSend_fpret used for `float`, `double`, `long double`. | ||
| 164 | * x86-64: objc_msgSend_fpret used for `long double`. | ||
| 165 | * | ||
| 166 | * arm: objc_msgSend_fp2ret not used | ||
| 167 | * i386: objc_msgSend_fp2ret not used | ||
| 168 | * x86-64: objc_msgSend_fp2ret used for `_Complex long double`. | ||
| 169 | * | ||
| 170 | * These functions must be cast to an appropriate function pointer type | ||
| 171 | * before being called. | ||
| 172 | */ | ||
| 173 | #if !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 174 | #pragma clang diagnostic push | ||
| 175 | #pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" | ||
| 176 | |||
| 177 | # if defined(__i386__) | ||
| 178 | |||
| 179 | OBJC_EXPORT void | ||
| 180 | objc_msgSend_fpret(void /* id self, SEL op, ... */ ) | ||
| 181 | OBJC_AVAILABLE(10.4, 2.0, 9.0, 1.0, 2.0); | ||
| 182 | |||
| 183 | # elif defined(__x86_64__) | ||
| 184 | |||
| 185 | OBJC_EXPORT void | ||
| 186 | objc_msgSend_fpret(void /* id self, SEL op, ... */ ) | ||
| 187 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 188 | |||
| 189 | OBJC_EXPORT void | ||
| 190 | objc_msgSend_fp2ret(void /* id self, SEL op, ... */ ) | ||
| 191 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 192 | |||
| 193 | #pragma clang diagnostic pop | ||
| 194 | # endif | ||
| 195 | |||
| 196 | // !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 197 | #else | ||
| 198 | // OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 199 | # if defined(__i386__) | ||
| 200 | |||
| 201 | /** | ||
| 202 | * Sends a message with a floating-point return value to an instance of a class. | ||
| 203 | * | ||
| 204 | * @see objc_msgSend | ||
| 205 | * @note On the i386 platform, the ABI for functions returning a floating-point value is | ||
| 206 | * incompatible with that for functions returning an integral type. On the i386 platform, therefore, | ||
| 207 | * you must use \c objc_msgSend_fpret for functions returning non-integral type. For \c float or | ||
| 208 | * \c long \c double return types, cast the function to an appropriate function pointer type first. | ||
| 209 | */ | ||
| 210 | #pragma clang diagnostic push | ||
| 211 | #pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" | ||
| 212 | OBJC_EXPORT double | ||
| 213 | objc_msgSend_fpret(id _Nullable self, SEL _Nonnull op, ...) | ||
| 214 | OBJC_AVAILABLE(10.4, 2.0, 9.0, 1.0, 2.0); | ||
| 215 | #pragma clang diagnostic pop | ||
| 216 | |||
| 217 | /* Use objc_msgSendSuper() for fp-returning messages to super. */ | ||
| 218 | /* See also objc_msgSendv_fpret() below. */ | ||
| 219 | |||
| 220 | # elif defined(__x86_64__) | ||
| 221 | /** | ||
| 222 | * Sends a message with a floating-point return value to an instance of a class. | ||
| 223 | * | ||
| 224 | * @see objc_msgSend | ||
| 225 | */ | ||
| 226 | OBJC_EXPORT long double | ||
| 227 | objc_msgSend_fpret(id _Nullable self, SEL _Nonnull op, ...) | ||
| 228 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 229 | |||
| 230 | # if __STDC_VERSION__ >= 199901L | ||
| 231 | OBJC_EXPORT _Complex long double | ||
| 232 | objc_msgSend_fp2ret(id _Nullable self, SEL _Nonnull op, ...) | ||
| 233 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 234 | # else | ||
| 235 | OBJC_EXPORT void objc_msgSend_fp2ret(id _Nullable self, SEL _Nonnull op, ...) | ||
| 236 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 237 | # endif | ||
| 238 | |||
| 239 | /* Use objc_msgSendSuper() for fp-returning messages to super. */ | ||
| 240 | /* See also objc_msgSendv_fpret() below. */ | ||
| 241 | |||
| 242 | # endif | ||
| 243 | |||
| 244 | // OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 245 | #endif | ||
| 246 | |||
| 247 | |||
| 248 | /* Direct Method Invocation Primitives | ||
| 249 | * Use these functions to call the implementation of a given Method. | ||
| 250 | * This is faster than calling method_getImplementation() and method_getName(). | ||
| 251 | * | ||
| 252 | * The receiver must not be nil. | ||
| 253 | * | ||
| 254 | * These functions must be cast to an appropriate function pointer type | ||
| 255 | * before being called. | ||
| 256 | */ | ||
| 257 | #if !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 258 | #pragma clang diagnostic push | ||
| 259 | #pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" | ||
| 260 | OBJC_EXPORT void | ||
| 261 | method_invoke(void /* id receiver, Method m, ... */ ) | ||
| 262 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 263 | |||
| 264 | OBJC_EXPORT void | ||
| 265 | method_invoke_stret(void /* id receiver, Method m, ... */ ) | ||
| 266 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0) | ||
| 267 | OBJC_ARM64_UNAVAILABLE; | ||
| 268 | #pragma clang diagnostic pop | ||
| 269 | #else | ||
| 270 | OBJC_EXPORT id _Nullable | ||
| 271 | method_invoke(id _Nullable receiver, Method _Nonnull m, ...) | ||
| 272 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 273 | |||
| 274 | OBJC_EXPORT void | ||
| 275 | method_invoke_stret(id _Nullable receiver, Method _Nonnull m, ...) | ||
| 276 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0) | ||
| 277 | OBJC_ARM64_UNAVAILABLE; | ||
| 278 | #endif | ||
| 279 | |||
| 280 | |||
| 281 | /* Message Forwarding Primitives | ||
| 282 | * Use these functions to forward a message as if the receiver did not | ||
| 283 | * respond to it. | ||
| 284 | * | ||
| 285 | * The receiver must not be nil. | ||
| 286 | * | ||
| 287 | * class_getMethodImplementation() may return (IMP)_objc_msgForward. | ||
| 288 | * class_getMethodImplementation_stret() may return (IMP)_objc_msgForward_stret | ||
| 289 | * | ||
| 290 | * These functions must be cast to an appropriate function pointer type | ||
| 291 | * before being called. | ||
| 292 | * | ||
| 293 | * Before Mac OS X 10.6, _objc_msgForward must not be called directly | ||
| 294 | * but may be compared to other IMP values. | ||
| 295 | */ | ||
| 296 | #if !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 297 | #pragma clang diagnostic push | ||
| 298 | #pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" | ||
| 299 | OBJC_EXPORT void | ||
| 300 | _objc_msgForward(void /* id receiver, SEL sel, ... */ ) | ||
| 301 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 302 | |||
| 303 | OBJC_EXPORT void | ||
| 304 | _objc_msgForward_stret(void /* id receiver, SEL sel, ... */ ) | ||
| 305 | OBJC_AVAILABLE(10.6, 3.0, 9.0, 1.0, 2.0) | ||
| 306 | OBJC_ARM64_UNAVAILABLE; | ||
| 307 | #pragma clang diagnostic pop | ||
| 308 | #else | ||
| 309 | OBJC_EXPORT id _Nullable | ||
| 310 | _objc_msgForward(id _Nonnull receiver, SEL _Nonnull sel, ...) | ||
| 311 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 312 | |||
| 313 | OBJC_EXPORT void | ||
| 314 | _objc_msgForward_stret(id _Nonnull receiver, SEL _Nonnull sel, ...) | ||
| 315 | OBJC_AVAILABLE(10.6, 3.0, 9.0, 1.0, 2.0) | ||
| 316 | OBJC_ARM64_UNAVAILABLE; | ||
| 317 | #endif | ||
| 318 | |||
| 319 | |||
| 320 | /* Variable-argument Messaging Primitives | ||
| 321 | * | ||
| 322 | * Use these functions to call methods with a list of arguments, such | ||
| 323 | * as the one passed to forward:: . | ||
| 324 | * | ||
| 325 | * The contents of the argument list are architecture-specific. | ||
| 326 | * Consult your local function call ABI documentation for details. | ||
| 327 | * | ||
| 328 | * These functions must be cast to an appropriate function pointer type | ||
| 329 | * before being called, except for objc_msgSendv_stret() which must not | ||
| 330 | * be cast to a struct-returning type. | ||
| 331 | */ | ||
| 332 | |||
| 333 | typedef void* marg_list; | ||
| 334 | |||
| 335 | OBJC_EXPORT id _Nullable | ||
| 336 | objc_msgSendv(id _Nullable self, SEL _Nonnull op, size_t arg_size, | ||
| 337 | marg_list _Nonnull arg_frame) | ||
| 338 | OBJC2_UNAVAILABLE; | ||
| 339 | |||
| 340 | OBJC_EXPORT void | ||
| 341 | objc_msgSendv_stret(void * _Nonnull stretAddr, id _Nullable self, | ||
| 342 | SEL _Nonnull op, size_t arg_size, | ||
| 343 | marg_list _Nullable arg_frame) | ||
| 344 | OBJC2_UNAVAILABLE; | ||
| 345 | /* Note that objc_msgSendv_stret() does not return a structure type, | ||
| 346 | * and should not be cast to do so. This is unlike objc_msgSend_stret() | ||
| 347 | * and objc_msgSendSuper_stret(). | ||
| 348 | */ | ||
| 349 | #if defined(__i386__) | ||
| 350 | OBJC_EXPORT double | ||
| 351 | objc_msgSendv_fpret(id _Nullable self, SEL _Nonnull op, | ||
| 352 | unsigned arg_size, marg_list _Nullable arg_frame) | ||
| 353 | OBJC2_UNAVAILABLE; | ||
| 354 | #endif | ||
| 355 | |||
| 356 | |||
| 357 | /* The following marg_list macros are of marginal utility. They | ||
| 358 | * are included for compatibility with the old objc-class.h header. */ | ||
| 359 | |||
| 360 | #if !__OBJC2__ | ||
| 361 | |||
| 362 | #define marg_prearg_size	0 | ||
| 363 | |||
| 364 | #define marg_malloc(margs, method) \ | ||
| 365 | 	do { \ | ||
| 366 | 		margs = (marg_list *)malloc (marg_prearg_size + ((7 + method_getSizeOfArguments(method)) & ~7)); \ | ||
| 367 | 	} while (0) | ||
| 368 | |||
| 369 | #define marg_free(margs) \ | ||
| 370 | 	do { \ | ||
| 371 | 		free(margs); \ | ||
| 372 | 	} while (0) | ||
| 373 | 	 | ||
| 374 | #define marg_adjustedOffset(method, offset) \ | ||
| 375 | 	(marg_prearg_size + offset) | ||
| 376 | |||
| 377 | #define marg_getRef(margs, offset, type) \ | ||
| 378 | 	( (type *)((char *)margs + marg_adjustedOffset(method,offset) ) ) | ||
| 379 | |||
| 380 | #define marg_getValue(margs, offset, type) \ | ||
| 381 | 	( *marg_getRef(margs, offset, type) ) | ||
| 382 | |||
| 383 | #define marg_setValue(margs, offset, type, value) \ | ||
| 384 | 	( marg_getValue(margs, offset, type) = (value) ) | ||
| 385 | |||
| 386 | #endif | ||
| 387 | |||
| 388 | #endif | ||
lib/libc/include/x86_64-macos-gnu/objc/objc-api.h created+286| ... | @@ -0,0 +1,286 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2006 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | // Copyright 1988-1996 NeXT Software, Inc. | ||
| 24 | |||
| 25 | #ifndef _OBJC_OBJC_API_H_ | ||
| 26 | #define _OBJC_OBJC_API_H_ | ||
| 27 | |||
| 28 | #include <Availability.h> | ||
| 29 | #include <AvailabilityMacros.h> | ||
| 30 | #include <TargetConditionals.h> | ||
| 31 | #include <sys/types.h> | ||
| 32 | |||
| 33 | #ifndef __has_feature | ||
| 34 | # define __has_feature(x) 0 | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifndef __has_extension | ||
| 38 | # define __has_extension __has_feature | ||
| 39 | #endif | ||
| 40 | |||
| 41 | #ifndef __has_attribute | ||
| 42 | # define __has_attribute(x) 0 | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #if !__has_feature(nullability) | ||
| 46 | # ifndef _Nullable | ||
| 47 | # define _Nullable | ||
| 48 | # endif | ||
| 49 | # ifndef _Nonnull | ||
| 50 | # define _Nonnull | ||
| 51 | # endif | ||
| 52 | # ifndef _Null_unspecified | ||
| 53 | # define _Null_unspecified | ||
| 54 | # endif | ||
| 55 | #endif | ||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | /* | ||
| 60 | * OBJC_API_VERSION 0 or undef: Tiger and earlier API only | ||
| 61 | * OBJC_API_VERSION 2: Leopard and later API available | ||
| 62 | */ | ||
| 63 | #if !defined(OBJC_API_VERSION) | ||
| 64 | # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5 | ||
| 65 | # define OBJC_API_VERSION 0 | ||
| 66 | # else | ||
| 67 | # define OBJC_API_VERSION 2 | ||
| 68 | # endif | ||
| 69 | #endif | ||
| 70 | |||
| 71 | |||
| 72 | /* | ||
| 73 | * OBJC_NO_GC 1: GC is not supported | ||
| 74 | * OBJC_NO_GC undef: GC is supported. This SDK no longer supports this mode. | ||
| 75 | * | ||
| 76 | * OBJC_NO_GC_API undef: Libraries must export any symbols that | ||
| 77 | * dual-mode code may links to. | ||
| 78 | * OBJC_NO_GC_API 1: Libraries need not export GC-related symbols. | ||
| 79 | */ | ||
| 80 | #if defined(__OBJC_GC__) | ||
| 81 | # error Objective-C garbage collection is not supported. | ||
| 82 | #elif TARGET_OS_OSX | ||
| 83 | /* GC is unsupported. GC API symbols are exported. */ | ||
| 84 | # define OBJC_NO_GC 1 | ||
| 85 | # undef OBJC_NO_GC_API | ||
| 86 | #else | ||
| 87 | /* GC is unsupported. GC API symbols are not exported. */ | ||
| 88 | # define OBJC_NO_GC 1 | ||
| 89 | # define OBJC_NO_GC_API 1 | ||
| 90 | #endif | ||
| 91 | |||
| 92 | |||
| 93 | /* NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER == 1 | ||
| 94 | * marks -[NSObject init] as a designated initializer. */ | ||
| 95 | #if !defined(NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER) | ||
| 96 | # define NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER 1 | ||
| 97 | #endif | ||
| 98 | |||
| 99 | /* The arm64 ABI requires proper casting to ensure arguments are passed | ||
| 100 | * * correctly. */ | ||
| 101 | #if defined(__arm64__) && !__swift__ | ||
| 102 | # undef OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 103 | # define OBJC_OLD_DISPATCH_PROTOTYPES 0 | ||
| 104 | #endif | ||
| 105 | |||
| 106 | /* OBJC_OLD_DISPATCH_PROTOTYPES == 0 enforces the rule that the dispatch | ||
| 107 | * functions must be cast to an appropriate function pointer type. */ | ||
| 108 | #if !defined(OBJC_OLD_DISPATCH_PROTOTYPES) | ||
| 109 | # if __swift__ | ||
| 110 | // Existing Swift code expects IMP to be Comparable. | ||
| 111 | // Variadic IMP is comparable via OpaquePointer; non-variadic IMP isn't. | ||
| 112 | # define OBJC_OLD_DISPATCH_PROTOTYPES 1 | ||
| 113 | # else | ||
| 114 | # define OBJC_OLD_DISPATCH_PROTOTYPES 0 | ||
| 115 | # endif | ||
| 116 | #endif | ||
| 117 | |||
| 118 | |||
| 119 | /* OBJC_AVAILABLE: shorthand for all-OS availability */ | ||
| 120 | |||
| 121 | # if !defined(OBJC_AVAILABLE) | ||
| 122 | # define OBJC_AVAILABLE(x, i, t, w, b) \ | ||
| 123 | __OSX_AVAILABLE(x) __IOS_AVAILABLE(i) __TVOS_AVAILABLE(t) \ | ||
| 124 | __WATCHOS_AVAILABLE(w) | ||
| 125 | # endif | ||
| 126 | |||
| 127 | |||
| 128 | |||
| 129 | /* OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE: Deprecated on OS X, | ||
| 130 | * unavailable everywhere else. */ | ||
| 131 | |||
| 132 | # if !defined(OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE) | ||
| 133 | # define OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(_start, _dep, _msg) \ | ||
| 134 | __OSX_DEPRECATED(_start, _dep, _msg) \ | ||
| 135 | __IOS_UNAVAILABLE __TVOS_UNAVAILABLE \ | ||
| 136 | __WATCHOS_UNAVAILABLE | ||
| 137 | # endif | ||
| 138 | |||
| 139 | |||
| 140 | |||
| 141 | /* OBJC_OSX_AVAILABLE_OTHERS_UNAVAILABLE: Available on OS X, | ||
| 142 | * unavailable everywhere else. */ | ||
| 143 | |||
| 144 | # if !defined(OBJC_OSX_AVAILABLE_OTHERS_UNAVAILABLE) | ||
| 145 | # define OBJC_OSX_AVAILABLE_OTHERS_UNAVAILABLE(vers) \ | ||
| 146 | __OSX_AVAILABLE(vers) \ | ||
| 147 | __IOS_UNAVAILABLE __TVOS_UNAVAILABLE \ | ||
| 148 | __WATCHOS_UNAVAILABLE | ||
| 149 | # endif | ||
| 150 | |||
| 151 | |||
| 152 | |||
| 153 | /* OBJC_ISA_AVAILABILITY: `isa` will be deprecated or unavailable | ||
| 154 | * in the future */ | ||
| 155 | #if !defined(OBJC_ISA_AVAILABILITY) | ||
| 156 | # if __OBJC2__ | ||
| 157 | # define OBJC_ISA_AVAILABILITY __attribute__((deprecated)) | ||
| 158 | # else | ||
| 159 | # define OBJC_ISA_AVAILABILITY /* still available */ | ||
| 160 | # endif | ||
| 161 | #endif | ||
| 162 | |||
| 163 | |||
| 164 | /* OBJC2_UNAVAILABLE: unavailable in objc 2.0, deprecated in Leopard */ | ||
| 165 | #if !defined(OBJC2_UNAVAILABLE) | ||
| 166 | # if __OBJC2__ | ||
| 167 | # define OBJC2_UNAVAILABLE UNAVAILABLE_ATTRIBUTE | ||
| 168 | # else | ||
| 169 | /* plain C code also falls here, but this is close enough */ | ||
| 170 | # define OBJC2_UNAVAILABLE \ | ||
| 171 | __OSX_DEPRECATED(10.5, 10.5, "not available in __OBJC2__") \ | ||
| 172 | __IOS_DEPRECATED(2.0, 2.0, "not available in __OBJC2__") \ | ||
| 173 | __TVOS_UNAVAILABLE __WATCHOS_UNAVAILABLE | ||
| 174 | # endif | ||
| 175 | #endif | ||
| 176 | |||
| 177 | /* OBJC_UNAVAILABLE: unavailable, with a message where supported */ | ||
| 178 | #if !defined(OBJC_UNAVAILABLE) | ||
| 179 | # if __has_extension(attribute_unavailable_with_message) | ||
| 180 | # define OBJC_UNAVAILABLE(_msg) __attribute__((unavailable(_msg))) | ||
| 181 | # else | ||
| 182 | # define OBJC_UNAVAILABLE(_msg) __attribute__((unavailable)) | ||
| 183 | # endif | ||
| 184 | #endif | ||
| 185 | |||
| 186 | /* OBJC_DEPRECATED: deprecated, with a message where supported */ | ||
| 187 | #if !defined(OBJC_DEPRECATED) | ||
| 188 | # if __has_extension(attribute_deprecated_with_message) | ||
| 189 | # define OBJC_DEPRECATED(_msg) __attribute__((deprecated(_msg))) | ||
| 190 | # else | ||
| 191 | # define OBJC_DEPRECATED(_msg) __attribute__((deprecated)) | ||
| 192 | # endif | ||
| 193 | #endif | ||
| 194 | |||
| 195 | /* OBJC_ARC_UNAVAILABLE: unavailable with -fobjc-arc */ | ||
| 196 | #if !defined(OBJC_ARC_UNAVAILABLE) | ||
| 197 | # if __has_feature(objc_arc) | ||
| 198 | # define OBJC_ARC_UNAVAILABLE OBJC_UNAVAILABLE("not available in automatic reference counting mode") | ||
| 199 | # else | ||
| 200 | # define OBJC_ARC_UNAVAILABLE | ||
| 201 | # endif | ||
| 202 | #endif | ||
| 203 | |||
| 204 | /* OBJC_SWIFT_UNAVAILABLE: unavailable in Swift */ | ||
| 205 | #if !defined(OBJC_SWIFT_UNAVAILABLE) | ||
| 206 | # if __has_feature(attribute_availability_swift) | ||
| 207 | # define OBJC_SWIFT_UNAVAILABLE(_msg) __attribute__((availability(swift, unavailable, message=_msg))) | ||
| 208 | # else | ||
| 209 | # define OBJC_SWIFT_UNAVAILABLE(_msg) | ||
| 210 | # endif | ||
| 211 | #endif | ||
| 212 | |||
| 213 | /* OBJC_ARM64_UNAVAILABLE: unavailable on arm64 (i.e. stret dispatch) */ | ||
| 214 | #if !defined(OBJC_ARM64_UNAVAILABLE) | ||
| 215 | # if defined(__arm64__) | ||
| 216 | # define OBJC_ARM64_UNAVAILABLE OBJC_UNAVAILABLE("not available in arm64") | ||
| 217 | # else | ||
| 218 | # define OBJC_ARM64_UNAVAILABLE | ||
| 219 | # endif | ||
| 220 | #endif | ||
| 221 | |||
| 222 | /* OBJC_GC_UNAVAILABLE: unavailable with -fobjc-gc or -fobjc-gc-only */ | ||
| 223 | #if !defined(OBJC_GC_UNAVAILABLE) | ||
| 224 | # define OBJC_GC_UNAVAILABLE | ||
| 225 | #endif | ||
| 226 | |||
| 227 | #if !defined(OBJC_EXTERN) | ||
| 228 | # if defined(__cplusplus) | ||
| 229 | # define OBJC_EXTERN extern "C" | ||
| 230 | # else | ||
| 231 | # define OBJC_EXTERN extern | ||
| 232 | # endif | ||
| 233 | #endif | ||
| 234 | |||
| 235 | #if !defined(OBJC_VISIBLE) | ||
| 236 | |||
| 237 | # define OBJC_VISIBLE __attribute__((visibility("default"))) | ||
| 238 | |||
| 239 | #endif | ||
| 240 | |||
| 241 | #if !defined(OBJC_EXPORT) | ||
| 242 | # define OBJC_EXPORT OBJC_EXTERN OBJC_VISIBLE | ||
| 243 | #endif | ||
| 244 | |||
| 245 | #if !defined(OBJC_IMPORT) | ||
| 246 | # define OBJC_IMPORT extern | ||
| 247 | #endif | ||
| 248 | |||
| 249 | #if !defined(OBJC_ROOT_CLASS) | ||
| 250 | # if __has_attribute(objc_root_class) | ||
| 251 | # define OBJC_ROOT_CLASS __attribute__((objc_root_class)) | ||
| 252 | # else | ||
| 253 | # define OBJC_ROOT_CLASS | ||
| 254 | # endif | ||
| 255 | #endif | ||
| 256 | |||
| 257 | #ifndef __DARWIN_NULL | ||
| 258 | #define __DARWIN_NULL NULL | ||
| 259 | #endif | ||
| 260 | |||
| 261 | #if !defined(OBJC_INLINE) | ||
| 262 | # define OBJC_INLINE __inline | ||
| 263 | #endif | ||
| 264 | |||
| 265 | // Declares an enum type or option bits type as appropriate for each language. | ||
| 266 | #if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum)) | ||
| 267 | #define OBJC_ENUM(_type, _name) enum _name : _type _name; enum _name : _type | ||
| 268 | #if (__cplusplus) | ||
| 269 | #define OBJC_OPTIONS(_type, _name) _type _name; enum : _type | ||
| 270 | #else | ||
| 271 | #define OBJC_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type | ||
| 272 | #endif | ||
| 273 | #else | ||
| 274 | #define OBJC_ENUM(_type, _name) _type _name; enum | ||
| 275 | #define OBJC_OPTIONS(_type, _name) _type _name; enum | ||
| 276 | #endif | ||
| 277 | |||
| 278 | #if !defined(OBJC_RETURNS_RETAINED) | ||
| 279 | # if __OBJC__ && __has_attribute(ns_returns_retained) | ||
| 280 | # define OBJC_RETURNS_RETAINED __attribute__((ns_returns_retained)) | ||
| 281 | # else | ||
| 282 | # define OBJC_RETURNS_RETAINED | ||
| 283 | # endif | ||
| 284 | #endif | ||
| 285 | |||
| 286 | #endif | ||
lib/libc/include/x86_64-macos-gnu/objc/objc.h created+259| ... | @@ -0,0 +1,259 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2007 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | *	objc.h | ||
| 25 | *	Copyright 1988-1996, NeXT Software, Inc. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef _OBJC_OBJC_H_ | ||
| 29 | #define _OBJC_OBJC_H_ | ||
| 30 | |||
| 31 | #include <sys/types.h> // for __DARWIN_NULL | ||
| 32 | #include <Availability.h> | ||
| 33 | #include <objc/objc-api.h> | ||
| 34 | #include <stdbool.h> | ||
| 35 | |||
| 36 | #if !OBJC_TYPES_DEFINED | ||
| 37 | /// An opaque type that represents an Objective-C class. | ||
| 38 | typedef struct objc_class *Class; | ||
| 39 | |||
| 40 | /// Represents an instance of a class. | ||
| 41 | struct objc_object { | ||
| 42 | Class _Nonnull isa OBJC_ISA_AVAILABILITY; | ||
| 43 | }; | ||
| 44 | |||
| 45 | /// A pointer to an instance of a class. | ||
| 46 | typedef struct objc_object *id; | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /// An opaque type that represents a method selector. | ||
| 50 | typedef struct objc_selector *SEL; | ||
| 51 | |||
| 52 | /// A pointer to the function of a method implementation. | ||
| 53 | #if !OBJC_OLD_DISPATCH_PROTOTYPES | ||
| 54 | typedef void (*IMP)(void /* id, SEL, ... */ ); | ||
| 55 | #else | ||
| 56 | typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...); | ||
| 57 | #endif | ||
| 58 | |||
| 59 | /// Type to represent a boolean value. | ||
| 60 | |||
| 61 | #if defined(__OBJC_BOOL_IS_BOOL) | ||
| 62 | // Honor __OBJC_BOOL_IS_BOOL when available. | ||
| 63 | # if __OBJC_BOOL_IS_BOOL | ||
| 64 | # define OBJC_BOOL_IS_BOOL 1 | ||
| 65 | # else | ||
| 66 | # define OBJC_BOOL_IS_BOOL 0 | ||
| 67 | # endif | ||
| 68 | #else | ||
| 69 | // __OBJC_BOOL_IS_BOOL not set. | ||
| 70 | # if TARGET_OS_OSX || TARGET_OS_MACCATALYST || ((TARGET_OS_IOS || 0) && !__LP64__ && !__ARM_ARCH_7K) | ||
| 71 | # define OBJC_BOOL_IS_BOOL 0 | ||
| 72 | # else | ||
| 73 | # define OBJC_BOOL_IS_BOOL 1 | ||
| 74 | # endif | ||
| 75 | #endif | ||
| 76 | |||
| 77 | #if OBJC_BOOL_IS_BOOL | ||
| 78 | typedef bool BOOL; | ||
| 79 | #else | ||
| 80 | # define OBJC_BOOL_IS_CHAR 1 | ||
| 81 | typedef signed char BOOL; | ||
| 82 | // BOOL is explicitly signed so @encode(BOOL) == "c" rather than "C" | ||
| 83 | // even if -funsigned-char is used. | ||
| 84 | #endif | ||
| 85 | |||
| 86 | #define OBJC_BOOL_DEFINED | ||
| 87 | |||
| 88 | #if __has_feature(objc_bool) | ||
| 89 | #define YES __objc_yes | ||
| 90 | #define NO __objc_no | ||
| 91 | #else | ||
| 92 | #define YES ((BOOL)1) | ||
| 93 | #define NO ((BOOL)0) | ||
| 94 | #endif | ||
| 95 | |||
| 96 | #ifndef Nil | ||
| 97 | # if __has_feature(cxx_nullptr) | ||
| 98 | # define Nil nullptr | ||
| 99 | # else | ||
| 100 | # define Nil __DARWIN_NULL | ||
| 101 | # endif | ||
| 102 | #endif | ||
| 103 | |||
| 104 | #ifndef nil | ||
| 105 | # if __has_feature(cxx_nullptr) | ||
| 106 | # define nil nullptr | ||
| 107 | # else | ||
| 108 | # define nil __DARWIN_NULL | ||
| 109 | # endif | ||
| 110 | #endif | ||
| 111 | |||
| 112 | #ifndef __strong | ||
| 113 | # if !__has_feature(objc_arc) | ||
| 114 | # define __strong /* empty */ | ||
| 115 | # endif | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifndef __unsafe_unretained | ||
| 119 | # if !__has_feature(objc_arc) | ||
| 120 | # define __unsafe_unretained /* empty */ | ||
| 121 | # endif | ||
| 122 | #endif | ||
| 123 | |||
| 124 | #ifndef __autoreleasing | ||
| 125 | # if !__has_feature(objc_arc) | ||
| 126 | # define __autoreleasing /* empty */ | ||
| 127 | # endif | ||
| 128 | #endif | ||
| 129 | |||
| 130 | |||
| 131 | /** | ||
| 132 | * Returns the name of the method specified by a given selector. | ||
| 133 | * | ||
| 134 | * @param sel A pointer of type \c SEL. Pass the selector whose name you wish to determine. | ||
| 135 | * | ||
| 136 | * @return A C string indicating the name of the selector. | ||
| 137 | */ | ||
| 138 | OBJC_EXPORT const char * _Nonnull sel_getName(SEL _Nonnull sel) | ||
| 139 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 140 | |||
| 141 | /** | ||
| 142 | * Registers a method with the Objective-C runtime system, maps the method | ||
| 143 | * name to a selector, and returns the selector value. | ||
| 144 | * | ||
| 145 | * @param str A pointer to a C string. Pass the name of the method you wish to register. | ||
| 146 | * | ||
| 147 | * @return A pointer of type SEL specifying the selector for the named method. | ||
| 148 | * | ||
| 149 | * @note You must register a method name with the Objective-C runtime system to obtain the | ||
| 150 | * method’s selector before you can add the method to a class definition. If the method name | ||
| 151 | * has already been registered, this function simply returns the selector. | ||
| 152 | */ | ||
| 153 | OBJC_EXPORT SEL _Nonnull sel_registerName(const char * _Nonnull str) | ||
| 154 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 155 | |||
| 156 | /** | ||
| 157 | * Returns the class name of a given object. | ||
| 158 | * | ||
| 159 | * @param obj An Objective-C object. | ||
| 160 | * | ||
| 161 | * @return The name of the class of which \e obj is an instance. | ||
| 162 | */ | ||
| 163 | OBJC_EXPORT const char * _Nonnull object_getClassName(id _Nullable obj) | ||
| 164 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 165 | |||
| 166 | /** | ||
| 167 | * Returns a pointer to any extra bytes allocated with an instance given object. | ||
| 168 | * | ||
| 169 | * @param obj An Objective-C object. | ||
| 170 | * | ||
| 171 | * @return A pointer to any extra bytes allocated with \e obj. If \e obj was | ||
| 172 | * not allocated with any extra bytes, then dereferencing the returned pointer is undefined. | ||
| 173 | * | ||
| 174 | * @note This function returns a pointer to any extra bytes allocated with the instance | ||
| 175 | * (as specified by \c class_createInstance with extraBytes>0). This memory follows the | ||
| 176 | * object's ordinary ivars, but may not be adjacent to the last ivar. | ||
| 177 | * @note The returned pointer is guaranteed to be pointer-size aligned, even if the area following | ||
| 178 | * the object's last ivar is less aligned than that. Alignment greater than pointer-size is never | ||
| 179 | * guaranteed, even if the area following the object's last ivar is more aligned than that. | ||
| 180 | * @note In a garbage-collected environment, the memory is scanned conservatively. | ||
| 181 | */ | ||
| 182 | OBJC_EXPORT void * _Nullable object_getIndexedIvars(id _Nullable obj) | ||
| 183 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 184 | |||
| 185 | /** | ||
| 186 | * Identifies a selector as being valid or invalid. | ||
| 187 | * | ||
| 188 | * @param sel The selector you want to identify. | ||
| 189 | * | ||
| 190 | * @return YES if selector is valid and has a function implementation, NO otherwise. | ||
| 191 | * | ||
| 192 | * @warning On some platforms, an invalid reference (to invalid memory addresses) can cause | ||
| 193 | * a crash. | ||
| 194 | */ | ||
| 195 | OBJC_EXPORT BOOL sel_isMapped(SEL _Nonnull sel) | ||
| 196 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 197 | |||
| 198 | /** | ||
| 199 | * Registers a method name with the Objective-C runtime system. | ||
| 200 | * | ||
| 201 | * @param str A pointer to a C string. Pass the name of the method you wish to register. | ||
| 202 | * | ||
| 203 | * @return A pointer of type SEL specifying the selector for the named method. | ||
| 204 | * | ||
| 205 | * @note The implementation of this method is identical to the implementation of \c sel_registerName. | ||
| 206 | * @note Prior to OS X version 10.0, this method tried to find the selector mapped to the given name | ||
| 207 | * and returned \c NULL if the selector was not found. This was changed for safety, because it was | ||
| 208 | * observed that many of the callers of this function did not check the return value for \c NULL. | ||
| 209 | */ | ||
| 210 | OBJC_EXPORT SEL _Nonnull sel_getUid(const char * _Nonnull str) | ||
| 211 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 212 | |||
| 213 | typedef const void* objc_objectptr_t; | ||
| 214 | |||
| 215 | |||
| 216 | // Obsolete ARC conversions. | ||
| 217 | |||
| 218 | OBJC_EXPORT id _Nullable objc_retainedObject(objc_objectptr_t _Nullable obj) | ||
| 219 | #if !OBJC_DECLARE_SYMBOLS | ||
| 220 | OBJC_UNAVAILABLE("use CFBridgingRelease() or a (__bridge_transfer id) cast instead") | ||
| 221 | #endif | ||
| 222 | ; | ||
| 223 | OBJC_EXPORT id _Nullable objc_unretainedObject(objc_objectptr_t _Nullable obj) | ||
| 224 | #if !OBJC_DECLARE_SYMBOLS | ||
| 225 | OBJC_UNAVAILABLE("use a (__bridge id) cast instead") | ||
| 226 | #endif | ||
| 227 | ; | ||
| 228 | OBJC_EXPORT objc_objectptr_t _Nullable objc_unretainedPointer(id _Nullable obj) | ||
| 229 | #if !OBJC_DECLARE_SYMBOLS | ||
| 230 | OBJC_UNAVAILABLE("use a __bridge cast instead") | ||
| 231 | #endif | ||
| 232 | ; | ||
| 233 | |||
| 234 | |||
| 235 | #if !__OBJC2__ | ||
| 236 | |||
| 237 | // The following declarations are provided here for source compatibility. | ||
| 238 | |||
| 239 | #if defined(__LP64__) | ||
| 240 | typedef long arith_t; | ||
| 241 | typedef unsigned long uarith_t; | ||
| 242 | # define ARITH_SHIFT 32 | ||
| 243 | #else | ||
| 244 | typedef int arith_t; | ||
| 245 | typedef unsigned uarith_t; | ||
| 246 | # define ARITH_SHIFT 16 | ||
| 247 | #endif | ||
| 248 | |||
| 249 | typedef char *STR; | ||
| 250 | |||
| 251 | #define ISSELECTOR(sel) sel_isMapped(sel) | ||
| 252 | #define SELNAME(sel)	sel_getName(sel) | ||
| 253 | #define SELUID(str)	sel_getUid(str) | ||
| 254 | #define NAMEOF(obj) object_getClassName(obj) | ||
| 255 | #define IV(obj) object_getIndexedIvars(obj) | ||
| 256 | |||
| 257 | #endif | ||
| 258 | |||
| 259 | #endif /* _OBJC_OBJC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/objc/runtime.h created+2164| ... | @@ -0,0 +1,2164 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1999-2007 Apple Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _OBJC_RUNTIME_H | ||
| 25 | #define _OBJC_RUNTIME_H | ||
| 26 | |||
| 27 | #include <objc/objc.h> | ||
| 28 | #include <stdarg.h> | ||
| 29 | #include <stdint.h> | ||
| 30 | #include <stddef.h> | ||
| 31 | #include <Availability.h> | ||
| 32 | #include <TargetConditionals.h> | ||
| 33 | |||
| 34 | #if TARGET_OS_MAC | ||
| 35 | #include <sys/types.h> | ||
| 36 | #endif | ||
| 37 | |||
| 38 | |||
| 39 | /* Types */ | ||
| 40 | |||
| 41 | #if !OBJC_TYPES_DEFINED | ||
| 42 | |||
| 43 | /// An opaque type that represents a method in a class definition. | ||
| 44 | typedef struct objc_method *Method; | ||
| 45 | |||
| 46 | /// An opaque type that represents an instance variable. | ||
| 47 | typedef struct objc_ivar *Ivar; | ||
| 48 | |||
| 49 | /// An opaque type that represents a category. | ||
| 50 | typedef struct objc_category *Category; | ||
| 51 | |||
| 52 | /// An opaque type that represents an Objective-C declared property. | ||
| 53 | typedef struct objc_property *objc_property_t; | ||
| 54 | |||
| 55 | struct objc_class { | ||
| 56 | Class _Nonnull isa OBJC_ISA_AVAILABILITY; | ||
| 57 | |||
| 58 | #if !__OBJC2__ | ||
| 59 | Class _Nullable super_class OBJC2_UNAVAILABLE; | ||
| 60 | const char * _Nonnull name OBJC2_UNAVAILABLE; | ||
| 61 | long version OBJC2_UNAVAILABLE; | ||
| 62 | long info OBJC2_UNAVAILABLE; | ||
| 63 | long instance_size OBJC2_UNAVAILABLE; | ||
| 64 | struct objc_ivar_list * _Nullable ivars OBJC2_UNAVAILABLE; | ||
| 65 | struct objc_method_list * _Nullable * _Nullable methodLists OBJC2_UNAVAILABLE; | ||
| 66 | struct objc_cache * _Nonnull cache OBJC2_UNAVAILABLE; | ||
| 67 | struct objc_protocol_list * _Nullable protocols OBJC2_UNAVAILABLE; | ||
| 68 | #endif | ||
| 69 | |||
| 70 | } OBJC2_UNAVAILABLE; | ||
| 71 | /* Use `Class` instead of `struct objc_class *` */ | ||
| 72 | |||
| 73 | #endif | ||
| 74 | |||
| 75 | #ifdef __OBJC__ | ||
| 76 | @class Protocol; | ||
| 77 | #else | ||
| 78 | typedef struct objc_object Protocol; | ||
| 79 | #endif | ||
| 80 | |||
| 81 | /// Defines a method | ||
| 82 | struct objc_method_description { | ||
| 83 | SEL _Nullable name; /**< The name of the method */ | ||
| 84 | char * _Nullable types; /**< The types of the method arguments */ | ||
| 85 | }; | ||
| 86 | |||
| 87 | /// Defines a property attribute | ||
| 88 | typedef struct { | ||
| 89 | const char * _Nonnull name; /**< The name of the attribute */ | ||
| 90 | const char * _Nonnull value; /**< The value of the attribute (usually empty) */ | ||
| 91 | } objc_property_attribute_t; | ||
| 92 | |||
| 93 | |||
| 94 | /* Functions */ | ||
| 95 | |||
| 96 | /* Working with Instances */ | ||
| 97 | |||
| 98 | /** | ||
| 99 | * Returns a copy of a given object. | ||
| 100 | * | ||
| 101 | * @param obj An Objective-C object. | ||
| 102 | * @param size The size of the object \e obj. | ||
| 103 | * | ||
| 104 | * @return A copy of \e obj. | ||
| 105 | */ | ||
| 106 | OBJC_EXPORT id _Nullable object_copy(id _Nullable obj, size_t size) | ||
| 107 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 108 | OBJC_ARC_UNAVAILABLE; | ||
| 109 | |||
| 110 | /** | ||
| 111 | * Frees the memory occupied by a given object. | ||
| 112 | * | ||
| 113 | * @param obj An Objective-C object. | ||
| 114 | * | ||
| 115 | * @return nil | ||
| 116 | */ | ||
| 117 | OBJC_EXPORT id _Nullable | ||
| 118 | object_dispose(id _Nullable obj) | ||
| 119 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 120 | OBJC_ARC_UNAVAILABLE; | ||
| 121 | |||
| 122 | /** | ||
| 123 | * Returns the class of an object. | ||
| 124 | * | ||
| 125 | * @param obj The object you want to inspect. | ||
| 126 | * | ||
| 127 | * @return The class object of which \e object is an instance, | ||
| 128 | * or \c Nil if \e object is \c nil. | ||
| 129 | */ | ||
| 130 | OBJC_EXPORT Class _Nullable | ||
| 131 | object_getClass(id _Nullable obj) | ||
| 132 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 133 | |||
| 134 | /** | ||
| 135 | * Sets the class of an object. | ||
| 136 | * | ||
| 137 | * @param obj The object to modify. | ||
| 138 | * @param cls A class object. | ||
| 139 | * | ||
| 140 | * @return The previous value of \e object's class, or \c Nil if \e object is \c nil. | ||
| 141 | */ | ||
| 142 | OBJC_EXPORT Class _Nullable | ||
| 143 | object_setClass(id _Nullable obj, Class _Nonnull cls) | ||
| 144 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 145 | |||
| 146 | |||
| 147 | /** | ||
| 148 | * Returns whether an object is a class object. | ||
| 149 | * | ||
| 150 | * @param obj An Objective-C object. | ||
| 151 | * | ||
| 152 | * @return true if the object is a class or metaclass, false otherwise. | ||
| 153 | */ | ||
| 154 | OBJC_EXPORT BOOL | ||
| 155 | object_isClass(id _Nullable obj) | ||
| 156 | OBJC_AVAILABLE(10.10, 8.0, 9.0, 1.0, 2.0); | ||
| 157 | |||
| 158 | |||
| 159 | /** | ||
| 160 | * Reads the value of an instance variable in an object. | ||
| 161 | * | ||
| 162 | * @param obj The object containing the instance variable whose value you want to read. | ||
| 163 | * @param ivar The Ivar describing the instance variable whose value you want to read. | ||
| 164 | * | ||
| 165 | * @return The value of the instance variable specified by \e ivar, or \c nil if \e object is \c nil. | ||
| 166 | * | ||
| 167 | * @note \c object_getIvar is faster than \c object_getInstanceVariable if the Ivar | ||
| 168 | * for the instance variable is already known. | ||
| 169 | */ | ||
| 170 | OBJC_EXPORT id _Nullable | ||
| 171 | object_getIvar(id _Nullable obj, Ivar _Nonnull ivar) | ||
| 172 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 173 | |||
| 174 | /** | ||
| 175 | * Sets the value of an instance variable in an object. | ||
| 176 | * | ||
| 177 | * @param obj The object containing the instance variable whose value you want to set. | ||
| 178 | * @param ivar The Ivar describing the instance variable whose value you want to set. | ||
| 179 | * @param value The new value for the instance variable. | ||
| 180 | * | ||
| 181 | * @note Instance variables with known memory management (such as ARC strong and weak) | ||
| 182 | * use that memory management. Instance variables with unknown memory management | ||
| 183 | * are assigned as if they were unsafe_unretained. | ||
| 184 | * @note \c object_setIvar is faster than \c object_setInstanceVariable if the Ivar | ||
| 185 | * for the instance variable is already known. | ||
| 186 | */ | ||
| 187 | OBJC_EXPORT void | ||
| 188 | object_setIvar(id _Nullable obj, Ivar _Nonnull ivar, id _Nullable value) | ||
| 189 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 190 | |||
| 191 | /** | ||
| 192 | * Sets the value of an instance variable in an object. | ||
| 193 | * | ||
| 194 | * @param obj The object containing the instance variable whose value you want to set. | ||
| 195 | * @param ivar The Ivar describing the instance variable whose value you want to set. | ||
| 196 | * @param value The new value for the instance variable. | ||
| 197 | * | ||
| 198 | * @note Instance variables with known memory management (such as ARC strong and weak) | ||
| 199 | * use that memory management. Instance variables with unknown memory management | ||
| 200 | * are assigned as if they were strong. | ||
| 201 | * @note \c object_setIvar is faster than \c object_setInstanceVariable if the Ivar | ||
| 202 | * for the instance variable is already known. | ||
| 203 | */ | ||
| 204 | OBJC_EXPORT void | ||
| 205 | object_setIvarWithStrongDefault(id _Nullable obj, Ivar _Nonnull ivar, | ||
| 206 | id _Nullable value) | ||
| 207 | OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0); | ||
| 208 | |||
| 209 | /** | ||
| 210 | * Changes the value of an instance variable of a class instance. | ||
| 211 | * | ||
| 212 | * @param obj A pointer to an instance of a class. Pass the object containing | ||
| 213 | * the instance variable whose value you wish to modify. | ||
| 214 | * @param name A C string. Pass the name of the instance variable whose value you wish to modify. | ||
| 215 | * @param value The new value for the instance variable. | ||
| 216 | * | ||
| 217 | * @return A pointer to the \c Ivar data structure that defines the type and | ||
| 218 | * name of the instance variable specified by \e name. | ||
| 219 | * | ||
| 220 | * @note Instance variables with known memory management (such as ARC strong and weak) | ||
| 221 | * use that memory management. Instance variables with unknown memory management | ||
| 222 | * are assigned as if they were unsafe_unretained. | ||
| 223 | */ | ||
| 224 | OBJC_EXPORT Ivar _Nullable | ||
| 225 | object_setInstanceVariable(id _Nullable obj, const char * _Nonnull name, | ||
| 226 | void * _Nullable value) | ||
| 227 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 228 | OBJC_ARC_UNAVAILABLE; | ||
| 229 | |||
| 230 | /** | ||
| 231 | * Changes the value of an instance variable of a class instance. | ||
| 232 | * | ||
| 233 | * @param obj A pointer to an instance of a class. Pass the object containing | ||
| 234 | * the instance variable whose value you wish to modify. | ||
| 235 | * @param name A C string. Pass the name of the instance variable whose value you wish to modify. | ||
| 236 | * @param value The new value for the instance variable. | ||
| 237 | * | ||
| 238 | * @return A pointer to the \c Ivar data structure that defines the type and | ||
| 239 | * name of the instance variable specified by \e name. | ||
| 240 | * | ||
| 241 | * @note Instance variables with known memory management (such as ARC strong and weak) | ||
| 242 | * use that memory management. Instance variables with unknown memory management | ||
| 243 | * are assigned as if they were strong. | ||
| 244 | */ | ||
| 245 | OBJC_EXPORT Ivar _Nullable | ||
| 246 | object_setInstanceVariableWithStrongDefault(id _Nullable obj, | ||
| 247 | const char * _Nonnull name, | ||
| 248 | void * _Nullable value) | ||
| 249 | OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0) | ||
| 250 | OBJC_ARC_UNAVAILABLE; | ||
| 251 | |||
| 252 | /** | ||
| 253 | * Obtains the value of an instance variable of a class instance. | ||
| 254 | * | ||
| 255 | * @param obj A pointer to an instance of a class. Pass the object containing | ||
| 256 | * the instance variable whose value you wish to obtain. | ||
| 257 | * @param name A C string. Pass the name of the instance variable whose value you wish to obtain. | ||
| 258 | * @param outValue On return, contains a pointer to the value of the instance variable. | ||
| 259 | * | ||
| 260 | * @return A pointer to the \c Ivar data structure that defines the type and name of | ||
| 261 | * the instance variable specified by \e name. | ||
| 262 | */ | ||
| 263 | OBJC_EXPORT Ivar _Nullable | ||
| 264 | object_getInstanceVariable(id _Nullable obj, const char * _Nonnull name, | ||
| 265 | void * _Nullable * _Nullable outValue) | ||
| 266 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 267 | OBJC_ARC_UNAVAILABLE; | ||
| 268 | |||
| 269 | |||
| 270 | /* Obtaining Class Definitions */ | ||
| 271 | |||
| 272 | /** | ||
| 273 | * Returns the class definition of a specified class. | ||
| 274 | * | ||
| 275 | * @param name The name of the class to look up. | ||
| 276 | * | ||
| 277 | * @return The Class object for the named class, or \c nil | ||
| 278 | * if the class is not registered with the Objective-C runtime. | ||
| 279 | * | ||
| 280 | * @note \c objc_getClass is different from \c objc_lookUpClass in that if the class | ||
| 281 | * is not registered, \c objc_getClass calls the class handler callback and then checks | ||
| 282 | * a second time to see whether the class is registered. \c objc_lookUpClass does | ||
| 283 | * not call the class handler callback. | ||
| 284 | * | ||
| 285 | * @warning Earlier implementations of this function (prior to OS X v10.0) | ||
| 286 | * terminate the program if the class does not exist. | ||
| 287 | */ | ||
| 288 | OBJC_EXPORT Class _Nullable | ||
| 289 | objc_getClass(const char * _Nonnull name) | ||
| 290 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 291 | |||
| 292 | /** | ||
| 293 | * Returns the metaclass definition of a specified class. | ||
| 294 | * | ||
| 295 | * @param name The name of the class to look up. | ||
| 296 | * | ||
| 297 | * @return The \c Class object for the metaclass of the named class, or \c nil if the class | ||
| 298 | * is not registered with the Objective-C runtime. | ||
| 299 | * | ||
| 300 | * @note If the definition for the named class is not registered, this function calls the class handler | ||
| 301 | * callback and then checks a second time to see if the class is registered. However, every class | ||
| 302 | * definition must have a valid metaclass definition, and so the metaclass definition is always returned, | ||
| 303 | * whether it’s valid or not. | ||
| 304 | */ | ||
| 305 | OBJC_EXPORT Class _Nullable | ||
| 306 | objc_getMetaClass(const char * _Nonnull name) | ||
| 307 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 308 | |||
| 309 | /** | ||
| 310 | * Returns the class definition of a specified class. | ||
| 311 | * | ||
| 312 | * @param name The name of the class to look up. | ||
| 313 | * | ||
| 314 | * @return The Class object for the named class, or \c nil if the class | ||
| 315 | * is not registered with the Objective-C runtime. | ||
| 316 | * | ||
| 317 | * @note \c objc_getClass is different from this function in that if the class is not | ||
| 318 | * registered, \c objc_getClass calls the class handler callback and then checks a second | ||
| 319 | * time to see whether the class is registered. This function does not call the class handler callback. | ||
| 320 | */ | ||
| 321 | OBJC_EXPORT Class _Nullable | ||
| 322 | objc_lookUpClass(const char * _Nonnull name) | ||
| 323 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 324 | |||
| 325 | /** | ||
| 326 | * Returns the class definition of a specified class. | ||
| 327 | * | ||
| 328 | * @param name The name of the class to look up. | ||
| 329 | * | ||
| 330 | * @return The Class object for the named class. | ||
| 331 | * | ||
| 332 | * @note This function is the same as \c objc_getClass, but kills the process if the class is not found. | ||
| 333 | * @note This function is used by ZeroLink, where failing to find a class would be a compile-time link error without ZeroLink. | ||
| 334 | */ | ||
| 335 | OBJC_EXPORT Class _Nonnull | ||
| 336 | objc_getRequiredClass(const char * _Nonnull name) | ||
| 337 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 338 | |||
| 339 | /** | ||
| 340 | * Obtains the list of registered class definitions. | ||
| 341 | * | ||
| 342 | * @param buffer An array of \c Class values. On output, each \c Class value points to | ||
| 343 | * one class definition, up to either \e bufferCount or the total number of registered classes, | ||
| 344 | * whichever is less. You can pass \c NULL to obtain the total number of registered class | ||
| 345 | * definitions without actually retrieving any class definitions. | ||
| 346 | * @param bufferCount An integer value. Pass the number of pointers for which you have allocated space | ||
| 347 | * in \e buffer. On return, this function fills in only this number of elements. If this number is less | ||
| 348 | * than the number of registered classes, this function returns an arbitrary subset of the registered classes. | ||
| 349 | * | ||
| 350 | * @return An integer value indicating the total number of registered classes. | ||
| 351 | * | ||
| 352 | * @note The Objective-C runtime library automatically registers all the classes defined in your source code. | ||
| 353 | * You can create class definitions at runtime and register them with the \c objc_addClass function. | ||
| 354 | * | ||
| 355 | * @warning You cannot assume that class objects you get from this function are classes that inherit from \c NSObject, | ||
| 356 | * so you cannot safely call any methods on such classes without detecting that the method is implemented first. | ||
| 357 | */ | ||
| 358 | OBJC_EXPORT int | ||
| 359 | objc_getClassList(Class _Nonnull * _Nullable buffer, int bufferCount) | ||
| 360 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 361 | |||
| 362 | /** | ||
| 363 | * Creates and returns a list of pointers to all registered class definitions. | ||
| 364 | * | ||
| 365 | * @param outCount An integer pointer used to store the number of classes returned by | ||
| 366 | * this function in the list. It can be \c nil. | ||
| 367 | * | ||
| 368 | * @return A nil terminated array of classes. It must be freed with \c free(). | ||
| 369 | * | ||
| 370 | * @see objc_getClassList | ||
| 371 | */ | ||
| 372 | OBJC_EXPORT Class _Nonnull * _Nullable | ||
| 373 | objc_copyClassList(unsigned int * _Nullable outCount) | ||
| 374 | OBJC_AVAILABLE(10.7, 3.1, 9.0, 1.0, 2.0); | ||
| 375 | |||
| 376 | |||
| 377 | /* Working with Classes */ | ||
| 378 | |||
| 379 | /** | ||
| 380 | * Returns the name of a class. | ||
| 381 | * | ||
| 382 | * @param cls A class object. | ||
| 383 | * | ||
| 384 | * @return The name of the class, or the empty string if \e cls is \c Nil. | ||
| 385 | */ | ||
| 386 | OBJC_EXPORT const char * _Nonnull | ||
| 387 | class_getName(Class _Nullable cls) | ||
| 388 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 389 | |||
| 390 | /** | ||
| 391 | * Returns a Boolean value that indicates whether a class object is a metaclass. | ||
| 392 | * | ||
| 393 | * @param cls A class object. | ||
| 394 | * | ||
| 395 | * @return \c YES if \e cls is a metaclass, \c NO if \e cls is a non-meta class, | ||
| 396 | * \c NO if \e cls is \c Nil. | ||
| 397 | */ | ||
| 398 | OBJC_EXPORT BOOL | ||
| 399 | class_isMetaClass(Class _Nullable cls) | ||
| 400 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 401 | |||
| 402 | /** | ||
| 403 | * Returns the superclass of a class. | ||
| 404 | * | ||
| 405 | * @param cls A class object. | ||
| 406 | * | ||
| 407 | * @return The superclass of the class, or \c Nil if | ||
| 408 | * \e cls is a root class, or \c Nil if \e cls is \c Nil. | ||
| 409 | * | ||
| 410 | * @note You should usually use \c NSObject's \c superclass method instead of this function. | ||
| 411 | */ | ||
| 412 | OBJC_EXPORT Class _Nullable | ||
| 413 | class_getSuperclass(Class _Nullable cls) | ||
| 414 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 415 | |||
| 416 | /** | ||
| 417 | * Sets the superclass of a given class. | ||
| 418 | * | ||
| 419 | * @param cls The class whose superclass you want to set. | ||
| 420 | * @param newSuper The new superclass for cls. | ||
| 421 | * | ||
| 422 | * @return The old superclass for cls. | ||
| 423 | * | ||
| 424 | * @warning You should not use this function. | ||
| 425 | */ | ||
| 426 | OBJC_EXPORT Class _Nonnull | ||
| 427 | class_setSuperclass(Class _Nonnull cls, Class _Nonnull newSuper) | ||
| 428 | __OSX_DEPRECATED(10.5, 10.5, "not recommended") | ||
| 429 | __IOS_DEPRECATED(2.0, 2.0, "not recommended") | ||
| 430 | __TVOS_DEPRECATED(9.0, 9.0, "not recommended") | ||
| 431 | __WATCHOS_DEPRECATED(1.0, 1.0, "not recommended") | ||
| 432 | |||
| 433 | ; | ||
| 434 | |||
| 435 | /** | ||
| 436 | * Returns the version number of a class definition. | ||
| 437 | * | ||
| 438 | * @param cls A pointer to a \c Class data structure. Pass | ||
| 439 | * the class definition for which you wish to obtain the version. | ||
| 440 | * | ||
| 441 | * @return An integer indicating the version number of the class definition. | ||
| 442 | * | ||
| 443 | * @see class_setVersion | ||
| 444 | */ | ||
| 445 | OBJC_EXPORT int | ||
| 446 | class_getVersion(Class _Nullable cls) | ||
| 447 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 448 | |||
| 449 | /** | ||
| 450 | * Sets the version number of a class definition. | ||
| 451 | * | ||
| 452 | * @param cls A pointer to an Class data structure. | ||
| 453 | * Pass the class definition for which you wish to set the version. | ||
| 454 | * @param version An integer. Pass the new version number of the class definition. | ||
| 455 | * | ||
| 456 | * @note You can use the version number of the class definition to provide versioning of the | ||
| 457 | * interface that your class represents to other classes. This is especially useful for object | ||
| 458 | * serialization (that is, archiving of the object in a flattened form), where it is important to | ||
| 459 | * recognize changes to the layout of the instance variables in different class-definition versions. | ||
| 460 | * @note Classes derived from the Foundation framework \c NSObject class can set the class-definition | ||
| 461 | * version number using the \c setVersion: class method, which is implemented using the \c class_setVersion function. | ||
| 462 | */ | ||
| 463 | OBJC_EXPORT void | ||
| 464 | class_setVersion(Class _Nullable cls, int version) | ||
| 465 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 466 | |||
| 467 | /** | ||
| 468 | * Returns the size of instances of a class. | ||
| 469 | * | ||
| 470 | * @param cls A class object. | ||
| 471 | * | ||
| 472 | * @return The size in bytes of instances of the class \e cls, or \c 0 if \e cls is \c Nil. | ||
| 473 | */ | ||
| 474 | OBJC_EXPORT size_t | ||
| 475 | class_getInstanceSize(Class _Nullable cls) | ||
| 476 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 477 | |||
| 478 | /** | ||
| 479 | * Returns the \c Ivar for a specified instance variable of a given class. | ||
| 480 | * | ||
| 481 | * @param cls The class whose instance variable you wish to obtain. | ||
| 482 | * @param name The name of the instance variable definition to obtain. | ||
| 483 | * | ||
| 484 | * @return A pointer to an \c Ivar data structure containing information about | ||
| 485 | * the instance variable specified by \e name. | ||
| 486 | */ | ||
| 487 | OBJC_EXPORT Ivar _Nullable | ||
| 488 | class_getInstanceVariable(Class _Nullable cls, const char * _Nonnull name) | ||
| 489 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 490 | |||
| 491 | /** | ||
| 492 | * Returns the Ivar for a specified class variable of a given class. | ||
| 493 | * | ||
| 494 | * @param cls The class definition whose class variable you wish to obtain. | ||
| 495 | * @param name The name of the class variable definition to obtain. | ||
| 496 | * | ||
| 497 | * @return A pointer to an \c Ivar data structure containing information about the class variable specified by \e name. | ||
| 498 | */ | ||
| 499 | OBJC_EXPORT Ivar _Nullable | ||
| 500 | class_getClassVariable(Class _Nullable cls, const char * _Nonnull name) | ||
| 501 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 502 | |||
| 503 | /** | ||
| 504 | * Describes the instance variables declared by a class. | ||
| 505 | * | ||
| 506 | * @param cls The class to inspect. | ||
| 507 | * @param outCount On return, contains the length of the returned array. | ||
| 508 | * If outCount is NULL, the length is not returned. | ||
| 509 | * | ||
| 510 | * @return An array of pointers of type Ivar describing the instance variables declared by the class. | ||
| 511 | * Any instance variables declared by superclasses are not included. The array contains *outCount | ||
| 512 | * pointers followed by a NULL terminator. You must free the array with free(). | ||
| 513 | * | ||
| 514 | * If the class declares no instance variables, or cls is Nil, NULL is returned and *outCount is 0. | ||
| 515 | */ | ||
| 516 | OBJC_EXPORT Ivar _Nonnull * _Nullable | ||
| 517 | class_copyIvarList(Class _Nullable cls, unsigned int * _Nullable outCount) | ||
| 518 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 519 | |||
| 520 | /** | ||
| 521 | * Returns a specified instance method for a given class. | ||
| 522 | * | ||
| 523 | * @param cls The class you want to inspect. | ||
| 524 | * @param name The selector of the method you want to retrieve. | ||
| 525 | * | ||
| 526 | * @return The method that corresponds to the implementation of the selector specified by | ||
| 527 | * \e name for the class specified by \e cls, or \c NULL if the specified class or its | ||
| 528 | * superclasses do not contain an instance method with the specified selector. | ||
| 529 | * | ||
| 530 | * @note This function searches superclasses for implementations, whereas \c class_copyMethodList does not. | ||
| 531 | */ | ||
| 532 | OBJC_EXPORT Method _Nullable | ||
| 533 | class_getInstanceMethod(Class _Nullable cls, SEL _Nonnull name) | ||
| 534 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 535 | |||
| 536 | /** | ||
| 537 | * Returns a pointer to the data structure describing a given class method for a given class. | ||
| 538 | * | ||
| 539 | * @param cls A pointer to a class definition. Pass the class that contains the method you want to retrieve. | ||
| 540 | * @param name A pointer of type \c SEL. Pass the selector of the method you want to retrieve. | ||
| 541 | * | ||
| 542 | * @return A pointer to the \c Method data structure that corresponds to the implementation of the | ||
| 543 | * selector specified by aSelector for the class specified by aClass, or NULL if the specified | ||
| 544 | * class or its superclasses do not contain an instance method with the specified selector. | ||
| 545 | * | ||
| 546 | * @note Note that this function searches superclasses for implementations, | ||
| 547 | * whereas \c class_copyMethodList does not. | ||
| 548 | */ | ||
| 549 | OBJC_EXPORT Method _Nullable | ||
| 550 | class_getClassMethod(Class _Nullable cls, SEL _Nonnull name) | ||
| 551 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 552 | |||
| 553 | /** | ||
| 554 | * Returns the function pointer that would be called if a | ||
| 555 | * particular message were sent to an instance of a class. | ||
| 556 | * | ||
| 557 | * @param cls The class you want to inspect. | ||
| 558 | * @param name A selector. | ||
| 559 | * | ||
| 560 | * @return The function pointer that would be called if \c [object name] were called | ||
| 561 | * with an instance of the class, or \c NULL if \e cls is \c Nil. | ||
| 562 | * | ||
| 563 | * @note \c class_getMethodImplementation may be faster than \c method_getImplementation(class_getInstanceMethod(cls, name)). | ||
| 564 | * @note The function pointer returned may be a function internal to the runtime instead of | ||
| 565 | * an actual method implementation. For example, if instances of the class do not respond to | ||
| 566 | * the selector, the function pointer returned will be part of the runtime's message forwarding machinery. | ||
| 567 | */ | ||
| 568 | OBJC_EXPORT IMP _Nullable | ||
| 569 | class_getMethodImplementation(Class _Nullable cls, SEL _Nonnull name) | ||
| 570 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 571 | |||
| 572 | /** | ||
| 573 | * Returns the function pointer that would be called if a particular | ||
| 574 | * message were sent to an instance of a class. | ||
| 575 | * | ||
| 576 | * @param cls The class you want to inspect. | ||
| 577 | * @param name A selector. | ||
| 578 | * | ||
| 579 | * @return The function pointer that would be called if \c [object name] were called | ||
| 580 | * with an instance of the class, or \c NULL if \e cls is \c Nil. | ||
| 581 | */ | ||
| 582 | OBJC_EXPORT IMP _Nullable | ||
| 583 | class_getMethodImplementation_stret(Class _Nullable cls, SEL _Nonnull name) | ||
| 584 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0) | ||
| 585 | OBJC_ARM64_UNAVAILABLE; | ||
| 586 | |||
| 587 | /** | ||
| 588 | * Returns a Boolean value that indicates whether instances of a class respond to a particular selector. | ||
| 589 | * | ||
| 590 | * @param cls The class you want to inspect. | ||
| 591 | * @param sel A selector. | ||
| 592 | * | ||
| 593 | * @return \c YES if instances of the class respond to the selector, otherwise \c NO. | ||
| 594 | * | ||
| 595 | * @note You should usually use \c NSObject's \c respondsToSelector: or \c instancesRespondToSelector: | ||
| 596 | * methods instead of this function. | ||
| 597 | */ | ||
| 598 | OBJC_EXPORT BOOL | ||
| 599 | class_respondsToSelector(Class _Nullable cls, SEL _Nonnull sel) | ||
| 600 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 601 | |||
| 602 | /** | ||
| 603 | * Describes the instance methods implemented by a class. | ||
| 604 | * | ||
| 605 | * @param cls The class you want to inspect. | ||
| 606 | * @param outCount On return, contains the length of the returned array. | ||
| 607 | * If outCount is NULL, the length is not returned. | ||
| 608 | * | ||
| 609 | * @return An array of pointers of type Method describing the instance methods | ||
| 610 | * implemented by the class—any instance methods implemented by superclasses are not included. | ||
| 611 | * The array contains *outCount pointers followed by a NULL terminator. You must free the array with free(). | ||
| 612 | * | ||
| 613 | * If cls implements no instance methods, or cls is Nil, returns NULL and *outCount is 0. | ||
| 614 | * | ||
| 615 | * @note To get the class methods of a class, use \c class_copyMethodList(object_getClass(cls), &count). | ||
| 616 | * @note To get the implementations of methods that may be implemented by superclasses, | ||
| 617 | * use \c class_getInstanceMethod or \c class_getClassMethod. | ||
| 618 | */ | ||
| 619 | OBJC_EXPORT Method _Nonnull * _Nullable | ||
| 620 | class_copyMethodList(Class _Nullable cls, unsigned int * _Nullable outCount) | ||
| 621 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 622 | |||
| 623 | /** | ||
| 624 | * Returns a Boolean value that indicates whether a class conforms to a given protocol. | ||
| 625 | * | ||
| 626 | * @param cls The class you want to inspect. | ||
| 627 | * @param protocol A protocol. | ||
| 628 | * | ||
| 629 | * @return YES if cls conforms to protocol, otherwise NO. | ||
| 630 | * | ||
| 631 | * @note You should usually use NSObject's conformsToProtocol: method instead of this function. | ||
| 632 | */ | ||
| 633 | OBJC_EXPORT BOOL | ||
| 634 | class_conformsToProtocol(Class _Nullable cls, Protocol * _Nullable protocol) | ||
| 635 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 636 | |||
| 637 | /** | ||
| 638 | * Describes the protocols adopted by a class. | ||
| 639 | * | ||
| 640 | * @param cls The class you want to inspect. | ||
| 641 | * @param outCount On return, contains the length of the returned array. | ||
| 642 | * If outCount is NULL, the length is not returned. | ||
| 643 | * | ||
| 644 | * @return An array of pointers of type Protocol* describing the protocols adopted | ||
| 645 | * by the class. Any protocols adopted by superclasses or other protocols are not included. | ||
| 646 | * The array contains *outCount pointers followed by a NULL terminator. You must free the array with free(). | ||
| 647 | * | ||
| 648 | * If cls adopts no protocols, or cls is Nil, returns NULL and *outCount is 0. | ||
| 649 | */ | ||
| 650 | OBJC_EXPORT Protocol * __unsafe_unretained _Nonnull * _Nullable | ||
| 651 | class_copyProtocolList(Class _Nullable cls, unsigned int * _Nullable outCount) | ||
| 652 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 653 | |||
| 654 | /** | ||
| 655 | * Returns a property with a given name of a given class. | ||
| 656 | * | ||
| 657 | * @param cls The class you want to inspect. | ||
| 658 | * @param name The name of the property you want to inspect. | ||
| 659 | * | ||
| 660 | * @return A pointer of type \c objc_property_t describing the property, or | ||
| 661 | * \c NULL if the class does not declare a property with that name, | ||
| 662 | * or \c NULL if \e cls is \c Nil. | ||
| 663 | */ | ||
| 664 | OBJC_EXPORT objc_property_t _Nullable | ||
| 665 | class_getProperty(Class _Nullable cls, const char * _Nonnull name) | ||
| 666 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 667 | |||
| 668 | /** | ||
| 669 | * Describes the properties declared by a class. | ||
| 670 | * | ||
| 671 | * @param cls The class you want to inspect. | ||
| 672 | * @param outCount On return, contains the length of the returned array. | ||
| 673 | * If \e outCount is \c NULL, the length is not returned. | ||
| 674 | * | ||
| 675 | * @return An array of pointers of type \c objc_property_t describing the properties | ||
| 676 | * declared by the class. Any properties declared by superclasses are not included. | ||
| 677 | * The array contains \c *outCount pointers followed by a \c NULL terminator. You must free the array with \c free(). | ||
| 678 | * | ||
| 679 | * If \e cls declares no properties, or \e cls is \c Nil, returns \c NULL and \c *outCount is \c 0. | ||
| 680 | */ | ||
| 681 | OBJC_EXPORT objc_property_t _Nonnull * _Nullable | ||
| 682 | class_copyPropertyList(Class _Nullable cls, unsigned int * _Nullable outCount) | ||
| 683 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 684 | |||
| 685 | /** | ||
| 686 | * Returns a description of the \c Ivar layout for a given class. | ||
| 687 | * | ||
| 688 | * @param cls The class to inspect. | ||
| 689 | * | ||
| 690 | * @return A description of the \c Ivar layout for \e cls. | ||
| 691 | */ | ||
| 692 | OBJC_EXPORT const uint8_t * _Nullable | ||
| 693 | class_getIvarLayout(Class _Nullable cls) | ||
| 694 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 695 | |||
| 696 | /** | ||
| 697 | * Returns a description of the layout of weak Ivars for a given class. | ||
| 698 | * | ||
| 699 | * @param cls The class to inspect. | ||
| 700 | * | ||
| 701 | * @return A description of the layout of the weak \c Ivars for \e cls. | ||
| 702 | */ | ||
| 703 | OBJC_EXPORT const uint8_t * _Nullable | ||
| 704 | class_getWeakIvarLayout(Class _Nullable cls) | ||
| 705 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 706 | |||
| 707 | /** | ||
| 708 | * Adds a new method to a class with a given name and implementation. | ||
| 709 | * | ||
| 710 | * @param cls The class to which to add a method. | ||
| 711 | * @param name A selector that specifies the name of the method being added. | ||
| 712 | * @param imp A function which is the implementation of the new method. The function must take at least two arguments—self and _cmd. | ||
| 713 | * @param types An array of characters that describe the types of the arguments to the method. | ||
| 714 | * | ||
| 715 | * @return YES if the method was added successfully, otherwise NO | ||
| 716 | * (for example, the class already contains a method implementation with that name). | ||
| 717 | * | ||
| 718 | * @note class_addMethod will add an override of a superclass's implementation, | ||
| 719 | * but will not replace an existing implementation in this class. | ||
| 720 | * To change an existing implementation, use method_setImplementation. | ||
| 721 | */ | ||
| 722 | OBJC_EXPORT BOOL | ||
| 723 | class_addMethod(Class _Nullable cls, SEL _Nonnull name, IMP _Nonnull imp, | ||
| 724 | const char * _Nullable types) | ||
| 725 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 726 | |||
| 727 | /** | ||
| 728 | * Replaces the implementation of a method for a given class. | ||
| 729 | * | ||
| 730 | * @param cls The class you want to modify. | ||
| 731 | * @param name A selector that identifies the method whose implementation you want to replace. | ||
| 732 | * @param imp The new implementation for the method identified by name for the class identified by cls. | ||
| 733 | * @param types An array of characters that describe the types of the arguments to the method. | ||
| 734 | * Since the function must take at least two arguments—self and _cmd, the second and third characters | ||
| 735 | * must be “@:” (the first character is the return type). | ||
| 736 | * | ||
| 737 | * @return The previous implementation of the method identified by \e name for the class identified by \e cls. | ||
| 738 | * | ||
| 739 | * @note This function behaves in two different ways: | ||
| 740 | * - If the method identified by \e name does not yet exist, it is added as if \c class_addMethod were called. | ||
| 741 | * The type encoding specified by \e types is used as given. | ||
| 742 | * - If the method identified by \e name does exist, its \c IMP is replaced as if \c method_setImplementation were called. | ||
| 743 | * The type encoding specified by \e types is ignored. | ||
| 744 | */ | ||
| 745 | OBJC_EXPORT IMP _Nullable | ||
| 746 | class_replaceMethod(Class _Nullable cls, SEL _Nonnull name, IMP _Nonnull imp, | ||
| 747 | const char * _Nullable types) | ||
| 748 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 749 | |||
| 750 | /** | ||
| 751 | * Adds a new instance variable to a class. | ||
| 752 | * | ||
| 753 | * @return YES if the instance variable was added successfully, otherwise NO | ||
| 754 | * (for example, the class already contains an instance variable with that name). | ||
| 755 | * | ||
| 756 | * @note This function may only be called after objc_allocateClassPair and before objc_registerClassPair. | ||
| 757 | * Adding an instance variable to an existing class is not supported. | ||
| 758 | * @note The class must not be a metaclass. Adding an instance variable to a metaclass is not supported. | ||
| 759 | * @note The instance variable's minimum alignment in bytes is 1<<align. The minimum alignment of an instance | ||
| 760 | * variable depends on the ivar's type and the machine architecture. | ||
| 761 | * For variables of any pointer type, pass log2(sizeof(pointer_type)). | ||
| 762 | */ | ||
| 763 | OBJC_EXPORT BOOL | ||
| 764 | class_addIvar(Class _Nullable cls, const char * _Nonnull name, size_t size, | ||
| 765 | uint8_t alignment, const char * _Nullable types) | ||
| 766 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 767 | |||
| 768 | /** | ||
| 769 | * Adds a protocol to a class. | ||
| 770 | * | ||
| 771 | * @param cls The class to modify. | ||
| 772 | * @param protocol The protocol to add to \e cls. | ||
| 773 | * | ||
| 774 | * @return \c YES if the method was added successfully, otherwise \c NO | ||
| 775 | * (for example, the class already conforms to that protocol). | ||
| 776 | */ | ||
| 777 | OBJC_EXPORT BOOL | ||
| 778 | class_addProtocol(Class _Nullable cls, Protocol * _Nonnull protocol) | ||
| 779 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 780 | |||
| 781 | /** | ||
| 782 | * Adds a property to a class. | ||
| 783 | * | ||
| 784 | * @param cls The class to modify. | ||
| 785 | * @param name The name of the property. | ||
| 786 | * @param attributes An array of property attributes. | ||
| 787 | * @param attributeCount The number of attributes in \e attributes. | ||
| 788 | * | ||
| 789 | * @return \c YES if the property was added successfully, otherwise \c NO | ||
| 790 | * (for example, the class already has that property). | ||
| 791 | */ | ||
| 792 | OBJC_EXPORT BOOL | ||
| 793 | class_addProperty(Class _Nullable cls, const char * _Nonnull name, | ||
| 794 | const objc_property_attribute_t * _Nullable attributes, | ||
| 795 | unsigned int attributeCount) | ||
| 796 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 797 | |||
| 798 | /** | ||
| 799 | * Replace a property of a class. | ||
| 800 | * | ||
| 801 | * @param cls The class to modify. | ||
| 802 | * @param name The name of the property. | ||
| 803 | * @param attributes An array of property attributes. | ||
| 804 | * @param attributeCount The number of attributes in \e attributes. | ||
| 805 | */ | ||
| 806 | OBJC_EXPORT void | ||
| 807 | class_replaceProperty(Class _Nullable cls, const char * _Nonnull name, | ||
| 808 | const objc_property_attribute_t * _Nullable attributes, | ||
| 809 | unsigned int attributeCount) | ||
| 810 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 811 | |||
| 812 | /** | ||
| 813 | * Sets the Ivar layout for a given class. | ||
| 814 | * | ||
| 815 | * @param cls The class to modify. | ||
| 816 | * @param layout The layout of the \c Ivars for \e cls. | ||
| 817 | */ | ||
| 818 | OBJC_EXPORT void | ||
| 819 | class_setIvarLayout(Class _Nullable cls, const uint8_t * _Nullable layout) | ||
| 820 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 821 | |||
| 822 | /** | ||
| 823 | * Sets the layout for weak Ivars for a given class. | ||
| 824 | * | ||
| 825 | * @param cls The class to modify. | ||
| 826 | * @param layout The layout of the weak Ivars for \e cls. | ||
| 827 | */ | ||
| 828 | OBJC_EXPORT void | ||
| 829 | class_setWeakIvarLayout(Class _Nullable cls, const uint8_t * _Nullable layout) | ||
| 830 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 831 | |||
| 832 | /** | ||
| 833 | * Used by CoreFoundation's toll-free bridging. | ||
| 834 | * Return the id of the named class. | ||
| 835 | * | ||
| 836 | * @return The id of the named class, or an uninitialized class | ||
| 837 | * structure that will be used for the class when and if it does | ||
| 838 | * get loaded. | ||
| 839 | * | ||
| 840 | * @warning Do not call this function yourself. | ||
| 841 | */ | ||
| 842 | OBJC_EXPORT Class _Nonnull | ||
| 843 | objc_getFutureClass(const char * _Nonnull name) | ||
| 844 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0) | ||
| 845 | OBJC_ARC_UNAVAILABLE; | ||
| 846 | |||
| 847 | |||
| 848 | /* Instantiating Classes */ | ||
| 849 | |||
| 850 | /** | ||
| 851 | * Creates an instance of a class, allocating memory for the class in the | ||
| 852 | * default malloc memory zone. | ||
| 853 | * | ||
| 854 | * @param cls The class that you wish to allocate an instance of. | ||
| 855 | * @param extraBytes An integer indicating the number of extra bytes to allocate. | ||
| 856 | * The additional bytes can be used to store additional instance variables beyond | ||
| 857 | * those defined in the class definition. | ||
| 858 | * | ||
| 859 | * @return An instance of the class \e cls. | ||
| 860 | */ | ||
| 861 | OBJC_EXPORT id _Nullable | ||
| 862 | class_createInstance(Class _Nullable cls, size_t extraBytes) | ||
| 863 | OBJC_RETURNS_RETAINED | ||
| 864 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 865 | |||
| 866 | /** | ||
| 867 | * Creates an instance of a class at the specific location provided. | ||
| 868 | * | ||
| 869 | * @param cls The class that you wish to allocate an instance of. | ||
| 870 | * @param bytes The location at which to allocate an instance of \e cls. | ||
| 871 | * Must point to at least \c class_getInstanceSize(cls) bytes of well-aligned, | ||
| 872 | * zero-filled memory. | ||
| 873 | * | ||
| 874 | * @return \e bytes on success, \c nil otherwise. (For example, \e cls or \e bytes | ||
| 875 | * might be \c nil) | ||
| 876 | * | ||
| 877 | * @see class_createInstance | ||
| 878 | */ | ||
| 879 | OBJC_EXPORT id _Nullable | ||
| 880 | objc_constructInstance(Class _Nullable cls, void * _Nullable bytes) | ||
| 881 | OBJC_AVAILABLE(10.6, 3.0, 9.0, 1.0, 2.0) | ||
| 882 | OBJC_ARC_UNAVAILABLE; | ||
| 883 | |||
| 884 | /** | ||
| 885 | * Destroys an instance of a class without freeing memory and removes any | ||
| 886 | * associated references this instance might have had. | ||
| 887 | * | ||
| 888 | * @param obj The class instance to destroy. | ||
| 889 | * | ||
| 890 | * @return \e obj. Does nothing if \e obj is nil. | ||
| 891 | * | ||
| 892 | * @note CF and other clients do call this under GC. | ||
| 893 | */ | ||
| 894 | OBJC_EXPORT void * _Nullable objc_destructInstance(id _Nullable obj) | ||
| 895 | OBJC_AVAILABLE(10.6, 3.0, 9.0, 1.0, 2.0) | ||
| 896 | OBJC_ARC_UNAVAILABLE; | ||
| 897 | |||
| 898 | |||
| 899 | /* Adding Classes */ | ||
| 900 | |||
| 901 | /** | ||
| 902 | * Creates a new class and metaclass. | ||
| 903 | * | ||
| 904 | * @param superclass The class to use as the new class's superclass, or \c Nil to create a new root class. | ||
| 905 | * @param name The string to use as the new class's name. The string will be copied. | ||
| 906 | * @param extraBytes The number of bytes to allocate for indexed ivars at the end of | ||
| 907 | * the class and metaclass objects. This should usually be \c 0. | ||
| 908 | * | ||
| 909 | * @return The new class, or Nil if the class could not be created (for example, the desired name is already in use). | ||
| 910 | * | ||
| 911 | * @note You can get a pointer to the new metaclass by calling \c object_getClass(newClass). | ||
| 912 | * @note To create a new class, start by calling \c objc_allocateClassPair. | ||
| 913 | * Then set the class's attributes with functions like \c class_addMethod and \c class_addIvar. | ||
| 914 | * When you are done building the class, call \c objc_registerClassPair. The new class is now ready for use. | ||
| 915 | * @note Instance methods and instance variables should be added to the class itself. | ||
| 916 | * Class methods should be added to the metaclass. | ||
| 917 | */ | ||
| 918 | OBJC_EXPORT Class _Nullable | ||
| 919 | objc_allocateClassPair(Class _Nullable superclass, const char * _Nonnull name, | ||
| 920 | size_t extraBytes) | ||
| 921 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 922 | |||
| 923 | /** | ||
| 924 | * Registers a class that was allocated using \c objc_allocateClassPair. | ||
| 925 | * | ||
| 926 | * @param cls The class you want to register. | ||
| 927 | */ | ||
| 928 | OBJC_EXPORT void | ||
| 929 | objc_registerClassPair(Class _Nonnull cls) | ||
| 930 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 931 | |||
| 932 | /** | ||
| 933 | * Used by Foundation's Key-Value Observing. | ||
| 934 | * | ||
| 935 | * @warning Do not call this function yourself. | ||
| 936 | */ | ||
| 937 | OBJC_EXPORT Class _Nonnull | ||
| 938 | objc_duplicateClass(Class _Nonnull original, const char * _Nonnull name, | ||
| 939 | size_t extraBytes) | ||
| 940 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 941 | |||
| 942 | /** | ||
| 943 | * Destroy a class and its associated metaclass. | ||
| 944 | * | ||
| 945 | * @param cls The class to be destroyed. It must have been allocated with | ||
| 946 | * \c objc_allocateClassPair | ||
| 947 | * | ||
| 948 | * @warning Do not call if instances of this class or a subclass exist. | ||
| 949 | */ | ||
| 950 | OBJC_EXPORT void | ||
| 951 | objc_disposeClassPair(Class _Nonnull cls) | ||
| 952 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 953 | |||
| 954 | |||
| 955 | /* Working with Methods */ | ||
| 956 | |||
| 957 | /** | ||
| 958 | * Returns the name of a method. | ||
| 959 | * | ||
| 960 | * @param m The method to inspect. | ||
| 961 | * | ||
| 962 | * @return A pointer of type SEL. | ||
| 963 | * | ||
| 964 | * @note To get the method name as a C string, call \c sel_getName(method_getName(method)). | ||
| 965 | */ | ||
| 966 | OBJC_EXPORT SEL _Nonnull | ||
| 967 | method_getName(Method _Nonnull m) | ||
| 968 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 969 | |||
| 970 | /** | ||
| 971 | * Returns the implementation of a method. | ||
| 972 | * | ||
| 973 | * @param m The method to inspect. | ||
| 974 | * | ||
| 975 | * @return A function pointer of type IMP. | ||
| 976 | */ | ||
| 977 | OBJC_EXPORT IMP _Nonnull | ||
| 978 | method_getImplementation(Method _Nonnull m) | ||
| 979 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 980 | |||
| 981 | /** | ||
| 982 | * Returns a string describing a method's parameter and return types. | ||
| 983 | * | ||
| 984 | * @param m The method to inspect. | ||
| 985 | * | ||
| 986 | * @return A C string. The string may be \c NULL. | ||
| 987 | */ | ||
| 988 | OBJC_EXPORT const char * _Nullable | ||
| 989 | method_getTypeEncoding(Method _Nonnull m) | ||
| 990 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 991 | |||
| 992 | /** | ||
| 993 | * Returns the number of arguments accepted by a method. | ||
| 994 | * | ||
| 995 | * @param m A pointer to a \c Method data structure. Pass the method in question. | ||
| 996 | * | ||
| 997 | * @return An integer containing the number of arguments accepted by the given method. | ||
| 998 | */ | ||
| 999 | OBJC_EXPORT unsigned int | ||
| 1000 | method_getNumberOfArguments(Method _Nonnull m) | ||
| 1001 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 1002 | |||
| 1003 | /** | ||
| 1004 | * Returns a string describing a method's return type. | ||
| 1005 | * | ||
| 1006 | * @param m The method to inspect. | ||
| 1007 | * | ||
| 1008 | * @return A C string describing the return type. You must free the string with \c free(). | ||
| 1009 | */ | ||
| 1010 | OBJC_EXPORT char * _Nonnull | ||
| 1011 | method_copyReturnType(Method _Nonnull m) | ||
| 1012 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1013 | |||
| 1014 | /** | ||
| 1015 | * Returns a string describing a single parameter type of a method. | ||
| 1016 | * | ||
| 1017 | * @param m The method to inspect. | ||
| 1018 | * @param index The index of the parameter to inspect. | ||
| 1019 | * | ||
| 1020 | * @return A C string describing the type of the parameter at index \e index, or \c NULL | ||
| 1021 | * if method has no parameter index \e index. You must free the string with \c free(). | ||
| 1022 | */ | ||
| 1023 | OBJC_EXPORT char * _Nullable | ||
| 1024 | method_copyArgumentType(Method _Nonnull m, unsigned int index) | ||
| 1025 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1026 | |||
| 1027 | /** | ||
| 1028 | * Returns by reference a string describing a method's return type. | ||
| 1029 | * | ||
| 1030 | * @param m The method you want to inquire about. | ||
| 1031 | * @param dst The reference string to store the description. | ||
| 1032 | * @param dst_len The maximum number of characters that can be stored in \e dst. | ||
| 1033 | * | ||
| 1034 | * @note The method's return type string is copied to \e dst. | ||
| 1035 | * \e dst is filled as if \c strncpy(dst, parameter_type, dst_len) were called. | ||
| 1036 | */ | ||
| 1037 | OBJC_EXPORT void | ||
| 1038 | method_getReturnType(Method _Nonnull m, char * _Nonnull dst, size_t dst_len) | ||
| 1039 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1040 | |||
| 1041 | /** | ||
| 1042 | * Returns by reference a string describing a single parameter type of a method. | ||
| 1043 | * | ||
| 1044 | * @param m The method you want to inquire about. | ||
| 1045 | * @param index The index of the parameter you want to inquire about. | ||
| 1046 | * @param dst The reference string to store the description. | ||
| 1047 | * @param dst_len The maximum number of characters that can be stored in \e dst. | ||
| 1048 | * | ||
| 1049 | * @note The parameter type string is copied to \e dst. \e dst is filled as if \c strncpy(dst, parameter_type, dst_len) | ||
| 1050 | * were called. If the method contains no parameter with that index, \e dst is filled as | ||
| 1051 | * if \c strncpy(dst, "", dst_len) were called. | ||
| 1052 | */ | ||
| 1053 | OBJC_EXPORT void | ||
| 1054 | method_getArgumentType(Method _Nonnull m, unsigned int index, | ||
| 1055 | char * _Nullable dst, size_t dst_len) | ||
| 1056 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1057 | |||
| 1058 | OBJC_EXPORT struct objc_method_description * _Nonnull | ||
| 1059 | method_getDescription(Method _Nonnull m) | ||
| 1060 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1061 | |||
| 1062 | /** | ||
| 1063 | * Sets the implementation of a method. | ||
| 1064 | * | ||
| 1065 | * @param m The method for which to set an implementation. | ||
| 1066 | * @param imp The implemention to set to this method. | ||
| 1067 | * | ||
| 1068 | * @return The previous implementation of the method. | ||
| 1069 | */ | ||
| 1070 | OBJC_EXPORT IMP _Nonnull | ||
| 1071 | method_setImplementation(Method _Nonnull m, IMP _Nonnull imp) | ||
| 1072 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1073 | |||
| 1074 | /** | ||
| 1075 | * Exchanges the implementations of two methods. | ||
| 1076 | * | ||
| 1077 | * @param m1 Method to exchange with second method. | ||
| 1078 | * @param m2 Method to exchange with first method. | ||
| 1079 | * | ||
| 1080 | * @note This is an atomic version of the following: | ||
| 1081 | * \code | ||
| 1082 | * IMP imp1 = method_getImplementation(m1); | ||
| 1083 | * IMP imp2 = method_getImplementation(m2); | ||
| 1084 | * method_setImplementation(m1, imp2); | ||
| 1085 | * method_setImplementation(m2, imp1); | ||
| 1086 | * \endcode | ||
| 1087 | */ | ||
| 1088 | OBJC_EXPORT void | ||
| 1089 | method_exchangeImplementations(Method _Nonnull m1, Method _Nonnull m2) | ||
| 1090 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1091 | |||
| 1092 | |||
| 1093 | /* Working with Instance Variables */ | ||
| 1094 | |||
| 1095 | /** | ||
| 1096 | * Returns the name of an instance variable. | ||
| 1097 | * | ||
| 1098 | * @param v The instance variable you want to enquire about. | ||
| 1099 | * | ||
| 1100 | * @return A C string containing the instance variable's name. | ||
| 1101 | */ | ||
| 1102 | OBJC_EXPORT const char * _Nullable | ||
| 1103 | ivar_getName(Ivar _Nonnull v) | ||
| 1104 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1105 | |||
| 1106 | /** | ||
| 1107 | * Returns the type string of an instance variable. | ||
| 1108 | * | ||
| 1109 | * @param v The instance variable you want to enquire about. | ||
| 1110 | * | ||
| 1111 | * @return A C string containing the instance variable's type encoding. | ||
| 1112 | * | ||
| 1113 | * @note For possible values, see Objective-C Runtime Programming Guide > Type Encodings. | ||
| 1114 | */ | ||
| 1115 | OBJC_EXPORT const char * _Nullable | ||
| 1116 | ivar_getTypeEncoding(Ivar _Nonnull v) | ||
| 1117 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1118 | |||
| 1119 | /** | ||
| 1120 | * Returns the offset of an instance variable. | ||
| 1121 | * | ||
| 1122 | * @param v The instance variable you want to enquire about. | ||
| 1123 | * | ||
| 1124 | * @return The offset of \e v. | ||
| 1125 | * | ||
| 1126 | * @note For instance variables of type \c id or other object types, call \c object_getIvar | ||
| 1127 | * and \c object_setIvar instead of using this offset to access the instance variable data directly. | ||
| 1128 | */ | ||
| 1129 | OBJC_EXPORT ptrdiff_t | ||
| 1130 | ivar_getOffset(Ivar _Nonnull v) | ||
| 1131 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1132 | |||
| 1133 | |||
| 1134 | /* Working with Properties */ | ||
| 1135 | |||
| 1136 | /** | ||
| 1137 | * Returns the name of a property. | ||
| 1138 | * | ||
| 1139 | * @param property The property you want to inquire about. | ||
| 1140 | * | ||
| 1141 | * @return A C string containing the property's name. | ||
| 1142 | */ | ||
| 1143 | OBJC_EXPORT const char * _Nonnull | ||
| 1144 | property_getName(objc_property_t _Nonnull property) | ||
| 1145 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1146 | |||
| 1147 | /** | ||
| 1148 | * Returns the attribute string of a property. | ||
| 1149 | * | ||
| 1150 | * @param property A property. | ||
| 1151 | * | ||
| 1152 | * @return A C string containing the property's attributes. | ||
| 1153 | * | ||
| 1154 | * @note The format of the attribute string is described in Declared Properties in Objective-C Runtime Programming Guide. | ||
| 1155 | */ | ||
| 1156 | OBJC_EXPORT const char * _Nullable | ||
| 1157 | property_getAttributes(objc_property_t _Nonnull property) | ||
| 1158 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1159 | |||
| 1160 | /** | ||
| 1161 | * Returns an array of property attributes for a property. | ||
| 1162 | * | ||
| 1163 | * @param property The property whose attributes you want copied. | ||
| 1164 | * @param outCount The number of attributes returned in the array. | ||
| 1165 | * | ||
| 1166 | * @return An array of property attributes; must be free'd() by the caller. | ||
| 1167 | */ | ||
| 1168 | OBJC_EXPORT objc_property_attribute_t * _Nullable | ||
| 1169 | property_copyAttributeList(objc_property_t _Nonnull property, | ||
| 1170 | unsigned int * _Nullable outCount) | ||
| 1171 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1172 | |||
| 1173 | /** | ||
| 1174 | * Returns the value of a property attribute given the attribute name. | ||
| 1175 | * | ||
| 1176 | * @param property The property whose attribute value you are interested in. | ||
| 1177 | * @param attributeName C string representing the attribute name. | ||
| 1178 | * | ||
| 1179 | * @return The value string of the attribute \e attributeName if it exists in | ||
| 1180 | * \e property, \c nil otherwise. | ||
| 1181 | */ | ||
| 1182 | OBJC_EXPORT char * _Nullable | ||
| 1183 | property_copyAttributeValue(objc_property_t _Nonnull property, | ||
| 1184 | const char * _Nonnull attributeName) | ||
| 1185 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1186 | |||
| 1187 | |||
| 1188 | /* Working with Protocols */ | ||
| 1189 | |||
| 1190 | /** | ||
| 1191 | * Returns a specified protocol. | ||
| 1192 | * | ||
| 1193 | * @param name The name of a protocol. | ||
| 1194 | * | ||
| 1195 | * @return The protocol named \e name, or \c NULL if no protocol named \e name could be found. | ||
| 1196 | * | ||
| 1197 | * @note This function acquires the runtime lock. | ||
| 1198 | */ | ||
| 1199 | OBJC_EXPORT Protocol * _Nullable | ||
| 1200 | objc_getProtocol(const char * _Nonnull name) | ||
| 1201 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1202 | |||
| 1203 | /** | ||
| 1204 | * Returns an array of all the protocols known to the runtime. | ||
| 1205 | * | ||
| 1206 | * @param outCount Upon return, contains the number of protocols in the returned array. | ||
| 1207 | * | ||
| 1208 | * @return A C array of all the protocols known to the runtime. The array contains \c *outCount | ||
| 1209 | * pointers followed by a \c NULL terminator. You must free the list with \c free(). | ||
| 1210 | * | ||
| 1211 | * @note This function acquires the runtime lock. | ||
| 1212 | */ | ||
| 1213 | OBJC_EXPORT Protocol * __unsafe_unretained _Nonnull * _Nullable | ||
| 1214 | objc_copyProtocolList(unsigned int * _Nullable outCount) | ||
| 1215 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1216 | |||
| 1217 | /** | ||
| 1218 | * Returns a Boolean value that indicates whether one protocol conforms to another protocol. | ||
| 1219 | * | ||
| 1220 | * @param proto A protocol. | ||
| 1221 | * @param other A protocol. | ||
| 1222 | * | ||
| 1223 | * @return \c YES if \e proto conforms to \e other, otherwise \c NO. | ||
| 1224 | * | ||
| 1225 | * @note One protocol can incorporate other protocols using the same syntax | ||
| 1226 | * that classes use to adopt a protocol: | ||
| 1227 | * \code | ||
| 1228 | * @protocol ProtocolName < protocol list > | ||
| 1229 | * \endcode | ||
| 1230 | * All the protocols listed between angle brackets are considered part of the ProtocolName protocol. | ||
| 1231 | */ | ||
| 1232 | OBJC_EXPORT BOOL | ||
| 1233 | protocol_conformsToProtocol(Protocol * _Nullable proto, | ||
| 1234 | Protocol * _Nullable other) | ||
| 1235 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1236 | |||
| 1237 | /** | ||
| 1238 | * Returns a Boolean value that indicates whether two protocols are equal. | ||
| 1239 | * | ||
| 1240 | * @param proto A protocol. | ||
| 1241 | * @param other A protocol. | ||
| 1242 | * | ||
| 1243 | * @return \c YES if \e proto is the same as \e other, otherwise \c NO. | ||
| 1244 | */ | ||
| 1245 | OBJC_EXPORT BOOL | ||
| 1246 | protocol_isEqual(Protocol * _Nullable proto, Protocol * _Nullable other) | ||
| 1247 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1248 | |||
| 1249 | /** | ||
| 1250 | * Returns the name of a protocol. | ||
| 1251 | * | ||
| 1252 | * @param proto A protocol. | ||
| 1253 | * | ||
| 1254 | * @return The name of the protocol \e p as a C string. | ||
| 1255 | */ | ||
| 1256 | OBJC_EXPORT const char * _Nonnull | ||
| 1257 | protocol_getName(Protocol * _Nonnull proto) | ||
| 1258 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1259 | |||
| 1260 | /** | ||
| 1261 | * Returns a method description structure for a specified method of a given protocol. | ||
| 1262 | * | ||
| 1263 | * @param proto A protocol. | ||
| 1264 | * @param aSel A selector. | ||
| 1265 | * @param isRequiredMethod A Boolean value that indicates whether aSel is a required method. | ||
| 1266 | * @param isInstanceMethod A Boolean value that indicates whether aSel is an instance method. | ||
| 1267 | * | ||
| 1268 | * @return An \c objc_method_description structure that describes the method specified by \e aSel, | ||
| 1269 | * \e isRequiredMethod, and \e isInstanceMethod for the protocol \e p. | ||
| 1270 | * If the protocol does not contain the specified method, returns an \c objc_method_description structure | ||
| 1271 | * with the value \c {NULL, \c NULL}. | ||
| 1272 | * | ||
| 1273 | * @note This function recursively searches any protocols that this protocol conforms to. | ||
| 1274 | */ | ||
| 1275 | OBJC_EXPORT struct objc_method_description | ||
| 1276 | protocol_getMethodDescription(Protocol * _Nonnull proto, SEL _Nonnull aSel, | ||
| 1277 | BOOL isRequiredMethod, BOOL isInstanceMethod) | ||
| 1278 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1279 | |||
| 1280 | /** | ||
| 1281 | * Returns an array of method descriptions of methods meeting a given specification for a given protocol. | ||
| 1282 | * | ||
| 1283 | * @param proto A protocol. | ||
| 1284 | * @param isRequiredMethod A Boolean value that indicates whether returned methods should | ||
| 1285 | * be required methods (pass YES to specify required methods). | ||
| 1286 | * @param isInstanceMethod A Boolean value that indicates whether returned methods should | ||
| 1287 | * be instance methods (pass YES to specify instance methods). | ||
| 1288 | * @param outCount Upon return, contains the number of method description structures in the returned array. | ||
| 1289 | * | ||
| 1290 | * @return A C array of \c objc_method_description structures containing the names and types of \e p's methods | ||
| 1291 | * specified by \e isRequiredMethod and \e isInstanceMethod. The array contains \c *outCount pointers followed | ||
| 1292 | * by a \c NULL terminator. You must free the list with \c free(). | ||
| 1293 | * If the protocol declares no methods that meet the specification, \c NULL is returned and \c *outCount is 0. | ||
| 1294 | * | ||
| 1295 | * @note Methods in other protocols adopted by this protocol are not included. | ||
| 1296 | */ | ||
| 1297 | OBJC_EXPORT struct objc_method_description * _Nullable | ||
| 1298 | protocol_copyMethodDescriptionList(Protocol * _Nonnull proto, | ||
| 1299 | BOOL isRequiredMethod, | ||
| 1300 | BOOL isInstanceMethod, | ||
| 1301 | unsigned int * _Nullable outCount) | ||
| 1302 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1303 | |||
| 1304 | /** | ||
| 1305 | * Returns the specified property of a given protocol. | ||
| 1306 | * | ||
| 1307 | * @param proto A protocol. | ||
| 1308 | * @param name The name of a property. | ||
| 1309 | * @param isRequiredProperty \c YES searches for a required property, \c NO searches for an optional property. | ||
| 1310 | * @param isInstanceProperty \c YES searches for an instance property, \c NO searches for a class property. | ||
| 1311 | * | ||
| 1312 | * @return The property specified by \e name, \e isRequiredProperty, and \e isInstanceProperty for \e proto, | ||
| 1313 | * or \c NULL if none of \e proto's properties meets the specification. | ||
| 1314 | */ | ||
| 1315 | OBJC_EXPORT objc_property_t _Nullable | ||
| 1316 | protocol_getProperty(Protocol * _Nonnull proto, | ||
| 1317 | const char * _Nonnull name, | ||
| 1318 | BOOL isRequiredProperty, BOOL isInstanceProperty) | ||
| 1319 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1320 | |||
| 1321 | /** | ||
| 1322 | * Returns an array of the required instance properties declared by a protocol. | ||
| 1323 | * | ||
| 1324 | * @note Identical to | ||
| 1325 | * \code | ||
| 1326 | * protocol_copyPropertyList2(proto, outCount, YES, YES); | ||
| 1327 | * \endcode | ||
| 1328 | */ | ||
| 1329 | OBJC_EXPORT objc_property_t _Nonnull * _Nullable | ||
| 1330 | protocol_copyPropertyList(Protocol * _Nonnull proto, | ||
| 1331 | unsigned int * _Nullable outCount) | ||
| 1332 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1333 | |||
| 1334 | /** | ||
| 1335 | * Returns an array of properties declared by a protocol. | ||
| 1336 | * | ||
| 1337 | * @param proto A protocol. | ||
| 1338 | * @param outCount Upon return, contains the number of elements in the returned array. | ||
| 1339 | * @param isRequiredProperty \c YES returns required properties, \c NO returns optional properties. | ||
| 1340 | * @param isInstanceProperty \c YES returns instance properties, \c NO returns class properties. | ||
| 1341 | * | ||
| 1342 | * @return A C array of pointers of type \c objc_property_t describing the properties declared by \e proto. | ||
| 1343 | * Any properties declared by other protocols adopted by this protocol are not included. The array contains | ||
| 1344 | * \c *outCount pointers followed by a \c NULL terminator. You must free the array with \c free(). | ||
| 1345 | * If the protocol declares no matching properties, \c NULL is returned and \c *outCount is \c 0. | ||
| 1346 | */ | ||
| 1347 | OBJC_EXPORT objc_property_t _Nonnull * _Nullable | ||
| 1348 | protocol_copyPropertyList2(Protocol * _Nonnull proto, | ||
| 1349 | unsigned int * _Nullable outCount, | ||
| 1350 | BOOL isRequiredProperty, BOOL isInstanceProperty) | ||
| 1351 | OBJC_AVAILABLE(10.12, 10.0, 10.0, 3.0, 2.0); | ||
| 1352 | |||
| 1353 | /** | ||
| 1354 | * Returns an array of the protocols adopted by a protocol. | ||
| 1355 | * | ||
| 1356 | * @param proto A protocol. | ||
| 1357 | * @param outCount Upon return, contains the number of elements in the returned array. | ||
| 1358 | * | ||
| 1359 | * @return A C array of protocols adopted by \e proto. The array contains \e *outCount pointers | ||
| 1360 | * followed by a \c NULL terminator. You must free the array with \c free(). | ||
| 1361 | * If the protocol adopts no other protocols, \c NULL is returned and \c *outCount is \c 0. | ||
| 1362 | */ | ||
| 1363 | OBJC_EXPORT Protocol * __unsafe_unretained _Nonnull * _Nullable | ||
| 1364 | protocol_copyProtocolList(Protocol * _Nonnull proto, | ||
| 1365 | unsigned int * _Nullable outCount) | ||
| 1366 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1367 | |||
| 1368 | /** | ||
| 1369 | * Creates a new protocol instance that cannot be used until registered with | ||
| 1370 | * \c objc_registerProtocol() | ||
| 1371 | * | ||
| 1372 | * @param name The name of the protocol to create. | ||
| 1373 | * | ||
| 1374 | * @return The Protocol instance on success, \c nil if a protocol | ||
| 1375 | * with the same name already exists. | ||
| 1376 | * @note There is no dispose method for this. | ||
| 1377 | */ | ||
| 1378 | OBJC_EXPORT Protocol * _Nullable | ||
| 1379 | objc_allocateProtocol(const char * _Nonnull name) | ||
| 1380 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1381 | |||
| 1382 | /** | ||
| 1383 | * Registers a newly constructed protocol with the runtime. The protocol | ||
| 1384 | * will be ready for use and is immutable after this. | ||
| 1385 | * | ||
| 1386 | * @param proto The protocol you want to register. | ||
| 1387 | */ | ||
| 1388 | OBJC_EXPORT void | ||
| 1389 | objc_registerProtocol(Protocol * _Nonnull proto) | ||
| 1390 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1391 | |||
| 1392 | /** | ||
| 1393 | * Adds a method to a protocol. The protocol must be under construction. | ||
| 1394 | * | ||
| 1395 | * @param proto The protocol to add a method to. | ||
| 1396 | * @param name The name of the method to add. | ||
| 1397 | * @param types A C string that represents the method signature. | ||
| 1398 | * @param isRequiredMethod YES if the method is not an optional method. | ||
| 1399 | * @param isInstanceMethod YES if the method is an instance method. | ||
| 1400 | */ | ||
| 1401 | OBJC_EXPORT void | ||
| 1402 | protocol_addMethodDescription(Protocol * _Nonnull proto, SEL _Nonnull name, | ||
| 1403 | const char * _Nullable types, | ||
| 1404 | BOOL isRequiredMethod, BOOL isInstanceMethod) | ||
| 1405 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1406 | |||
| 1407 | /** | ||
| 1408 | * Adds an incorporated protocol to another protocol. The protocol being | ||
| 1409 | * added to must still be under construction, while the additional protocol | ||
| 1410 | * must be already constructed. | ||
| 1411 | * | ||
| 1412 | * @param proto The protocol you want to add to, it must be under construction. | ||
| 1413 | * @param addition The protocol you want to incorporate into \e proto, it must be registered. | ||
| 1414 | */ | ||
| 1415 | OBJC_EXPORT void | ||
| 1416 | protocol_addProtocol(Protocol * _Nonnull proto, Protocol * _Nonnull addition) | ||
| 1417 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1418 | |||
| 1419 | /** | ||
| 1420 | * Adds a property to a protocol. The protocol must be under construction. | ||
| 1421 | * | ||
| 1422 | * @param proto The protocol to add a property to. | ||
| 1423 | * @param name The name of the property. | ||
| 1424 | * @param attributes An array of property attributes. | ||
| 1425 | * @param attributeCount The number of attributes in \e attributes. | ||
| 1426 | * @param isRequiredProperty YES if the property (accessor methods) is not optional. | ||
| 1427 | * @param isInstanceProperty YES if the property (accessor methods) are instance methods. | ||
| 1428 | * This is the only case allowed fo a property, as a result, setting this to NO will | ||
| 1429 | * not add the property to the protocol at all. | ||
| 1430 | */ | ||
| 1431 | OBJC_EXPORT void | ||
| 1432 | protocol_addProperty(Protocol * _Nonnull proto, const char * _Nonnull name, | ||
| 1433 | const objc_property_attribute_t * _Nullable attributes, | ||
| 1434 | unsigned int attributeCount, | ||
| 1435 | BOOL isRequiredProperty, BOOL isInstanceProperty) | ||
| 1436 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1437 | |||
| 1438 | |||
| 1439 | /* Working with Libraries */ | ||
| 1440 | |||
| 1441 | /** | ||
| 1442 | * Returns the names of all the loaded Objective-C frameworks and dynamic | ||
| 1443 | * libraries. | ||
| 1444 | * | ||
| 1445 | * @param outCount The number of names returned. | ||
| 1446 | * | ||
| 1447 | * @return An array of C strings of names. Must be free()'d by caller. | ||
| 1448 | */ | ||
| 1449 | OBJC_EXPORT const char * _Nonnull * _Nonnull | ||
| 1450 | objc_copyImageNames(unsigned int * _Nullable outCount) | ||
| 1451 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1452 | |||
| 1453 | /** | ||
| 1454 | * Returns the dynamic library name a class originated from. | ||
| 1455 | * | ||
| 1456 | * @param cls The class you are inquiring about. | ||
| 1457 | * | ||
| 1458 | * @return The name of the library containing this class. | ||
| 1459 | */ | ||
| 1460 | OBJC_EXPORT const char * _Nullable | ||
| 1461 | class_getImageName(Class _Nullable cls) | ||
| 1462 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1463 | |||
| 1464 | /** | ||
| 1465 | * Returns the names of all the classes within a library. | ||
| 1466 | * | ||
| 1467 | * @param image The library or framework you are inquiring about. | ||
| 1468 | * @param outCount The number of class names returned. | ||
| 1469 | * | ||
| 1470 | * @return An array of C strings representing the class names. | ||
| 1471 | */ | ||
| 1472 | OBJC_EXPORT const char * _Nonnull * _Nullable | ||
| 1473 | objc_copyClassNamesForImage(const char * _Nonnull image, | ||
| 1474 | unsigned int * _Nullable outCount) | ||
| 1475 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1476 | |||
| 1477 | |||
| 1478 | /* Working with Selectors */ | ||
| 1479 | |||
| 1480 | /** | ||
| 1481 | * Returns the name of the method specified by a given selector. | ||
| 1482 | * | ||
| 1483 | * @param sel A pointer of type \c SEL. Pass the selector whose name you wish to determine. | ||
| 1484 | * | ||
| 1485 | * @return A C string indicating the name of the selector. | ||
| 1486 | */ | ||
| 1487 | OBJC_EXPORT const char * _Nonnull | ||
| 1488 | sel_getName(SEL _Nonnull sel) | ||
| 1489 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 1490 | |||
| 1491 | |||
| 1492 | /** | ||
| 1493 | * Registers a method with the Objective-C runtime system, maps the method | ||
| 1494 | * name to a selector, and returns the selector value. | ||
| 1495 | * | ||
| 1496 | * @param str A pointer to a C string. Pass the name of the method you wish to register. | ||
| 1497 | * | ||
| 1498 | * @return A pointer of type SEL specifying the selector for the named method. | ||
| 1499 | * | ||
| 1500 | * @note You must register a method name with the Objective-C runtime system to obtain the | ||
| 1501 | * method’s selector before you can add the method to a class definition. If the method name | ||
| 1502 | * has already been registered, this function simply returns the selector. | ||
| 1503 | */ | ||
| 1504 | OBJC_EXPORT SEL _Nonnull | ||
| 1505 | sel_registerName(const char * _Nonnull str) | ||
| 1506 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0); | ||
| 1507 | |||
| 1508 | /** | ||
| 1509 | * Returns a Boolean value that indicates whether two selectors are equal. | ||
| 1510 | * | ||
| 1511 | * @param lhs The selector to compare with rhs. | ||
| 1512 | * @param rhs The selector to compare with lhs. | ||
| 1513 | * | ||
| 1514 | * @return \c YES if \e lhs and \e rhs are equal, otherwise \c NO. | ||
| 1515 | * | ||
| 1516 | * @note sel_isEqual is equivalent to ==. | ||
| 1517 | */ | ||
| 1518 | OBJC_EXPORT BOOL | ||
| 1519 | sel_isEqual(SEL _Nonnull lhs, SEL _Nonnull rhs) | ||
| 1520 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1521 | |||
| 1522 | |||
| 1523 | /* Objective-C Language Features */ | ||
| 1524 | |||
| 1525 | /** | ||
| 1526 | * This function is inserted by the compiler when a mutation | ||
| 1527 | * is detected during a foreach iteration. It gets called | ||
| 1528 | * when a mutation occurs, and the enumerationMutationHandler | ||
| 1529 | * is enacted if it is set up. A fatal error occurs if a handler is not set up. | ||
| 1530 | * | ||
| 1531 | * @param obj The object being mutated. | ||
| 1532 | * | ||
| 1533 | */ | ||
| 1534 | OBJC_EXPORT void | ||
| 1535 | objc_enumerationMutation(id _Nonnull obj) | ||
| 1536 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1537 | |||
| 1538 | /** | ||
| 1539 | * Sets the current mutation handler. | ||
| 1540 | * | ||
| 1541 | * @param handler Function pointer to the new mutation handler. | ||
| 1542 | */ | ||
| 1543 | OBJC_EXPORT void | ||
| 1544 | objc_setEnumerationMutationHandler(void (*_Nullable handler)(id _Nonnull )) | ||
| 1545 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1546 | |||
| 1547 | /** | ||
| 1548 | * Set the function to be called by objc_msgForward. | ||
| 1549 | * | ||
| 1550 | * @param fwd Function to be jumped to by objc_msgForward. | ||
| 1551 | * @param fwd_stret Function to be jumped to by objc_msgForward_stret. | ||
| 1552 | * | ||
| 1553 | * @see message.h::_objc_msgForward | ||
| 1554 | */ | ||
| 1555 | OBJC_EXPORT void | ||
| 1556 | objc_setForwardHandler(void * _Nonnull fwd, void * _Nonnull fwd_stret) | ||
| 1557 | OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 1558 | |||
| 1559 | /** | ||
| 1560 | * Creates a pointer to a function that will call the block | ||
| 1561 | * when the method is called. | ||
| 1562 | * | ||
| 1563 | * @param block The block that implements this method. Its signature should | ||
| 1564 | * be: method_return_type ^(id self, method_args...). | ||
| 1565 | * The selector is not available as a parameter to this block. | ||
| 1566 | * The block is copied with \c Block_copy(). | ||
| 1567 | * | ||
| 1568 | * @return The IMP that calls this block. Must be disposed of with | ||
| 1569 | * \c imp_removeBlock. | ||
| 1570 | */ | ||
| 1571 | OBJC_EXPORT IMP _Nonnull | ||
| 1572 | imp_implementationWithBlock(id _Nonnull block) | ||
| 1573 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1574 | |||
| 1575 | /** | ||
| 1576 | * Return the block associated with an IMP that was created using | ||
| 1577 | * \c imp_implementationWithBlock. | ||
| 1578 | * | ||
| 1579 | * @param anImp The IMP that calls this block. | ||
| 1580 | * | ||
| 1581 | * @return The block called by \e anImp. | ||
| 1582 | */ | ||
| 1583 | OBJC_EXPORT id _Nullable | ||
| 1584 | imp_getBlock(IMP _Nonnull anImp) | ||
| 1585 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1586 | |||
| 1587 | /** | ||
| 1588 | * Disassociates a block from an IMP that was created using | ||
| 1589 | * \c imp_implementationWithBlock and releases the copy of the | ||
| 1590 | * block that was created. | ||
| 1591 | * | ||
| 1592 | * @param anImp An IMP that was created using \c imp_implementationWithBlock. | ||
| 1593 | * | ||
| 1594 | * @return YES if the block was released successfully, NO otherwise. | ||
| 1595 | * (For example, the block might not have been used to create an IMP previously). | ||
| 1596 | */ | ||
| 1597 | OBJC_EXPORT BOOL | ||
| 1598 | imp_removeBlock(IMP _Nonnull anImp) | ||
| 1599 | OBJC_AVAILABLE(10.7, 4.3, 9.0, 1.0, 2.0); | ||
| 1600 | |||
| 1601 | /** | ||
| 1602 | * This loads the object referenced by a weak pointer and returns it, after | ||
| 1603 | * retaining and autoreleasing the object to ensure that it stays alive | ||
| 1604 | * long enough for the caller to use it. This function would be used | ||
| 1605 | * anywhere a __weak variable is used in an expression. | ||
| 1606 | * | ||
| 1607 | * @param location The weak pointer address | ||
| 1608 | * | ||
| 1609 | * @return The object pointed to by \e location, or \c nil if \e *location is \c nil. | ||
| 1610 | */ | ||
| 1611 | OBJC_EXPORT id _Nullable | ||
| 1612 | objc_loadWeak(id _Nullable * _Nonnull location) | ||
| 1613 | OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0); | ||
| 1614 | |||
| 1615 | /** | ||
| 1616 | * This function stores a new value into a __weak variable. It would | ||
| 1617 | * be used anywhere a __weak variable is the target of an assignment. | ||
| 1618 | * | ||
| 1619 | * @param location The address of the weak pointer itself | ||
| 1620 | * @param obj The new object this weak ptr should now point to | ||
| 1621 | * | ||
| 1622 | * @return The value stored into \e location, i.e. \e obj | ||
| 1623 | */ | ||
| 1624 | OBJC_EXPORT id _Nullable | ||
| 1625 | objc_storeWeak(id _Nullable * _Nonnull location, id _Nullable obj) | ||
| 1626 | OBJC_AVAILABLE(10.7, 5.0, 9.0, 1.0, 2.0); | ||
| 1627 | |||
| 1628 | |||
| 1629 | /* Associative References */ | ||
| 1630 | |||
| 1631 | /** | ||
| 1632 | * Policies related to associative references. | ||
| 1633 | * These are options to objc_setAssociatedObject() | ||
| 1634 | */ | ||
| 1635 | typedef OBJC_ENUM(uintptr_t, objc_AssociationPolicy) { | ||
| 1636 | OBJC_ASSOCIATION_ASSIGN = 0, /**< Specifies a weak reference to the associated object. */ | ||
| 1637 | OBJC_ASSOCIATION_RETAIN_NONATOMIC = 1, /**< Specifies a strong reference to the associated object. | ||
| 1638 | * The association is not made atomically. */ | ||
| 1639 | OBJC_ASSOCIATION_COPY_NONATOMIC = 3, /**< Specifies that the associated object is copied. | ||
| 1640 | * The association is not made atomically. */ | ||
| 1641 | OBJC_ASSOCIATION_RETAIN = 01401, /**< Specifies a strong reference to the associated object. | ||
| 1642 | * The association is made atomically. */ | ||
| 1643 | OBJC_ASSOCIATION_COPY = 01403 /**< Specifies that the associated object is copied. | ||
| 1644 | * The association is made atomically. */ | ||
| 1645 | }; | ||
| 1646 | |||
| 1647 | /** | ||
| 1648 | * Sets an associated value for a given object using a given key and association policy. | ||
| 1649 | * | ||
| 1650 | * @param object The source object for the association. | ||
| 1651 | * @param key The key for the association. | ||
| 1652 | * @param value The value to associate with the key key for object. Pass nil to clear an existing association. | ||
| 1653 | * @param policy The policy for the association. For possible values, see “Associative Object Behaviors.” | ||
| 1654 | * | ||
| 1655 | * @see objc_setAssociatedObject | ||
| 1656 | * @see objc_removeAssociatedObjects | ||
| 1657 | */ | ||
| 1658 | OBJC_EXPORT void | ||
| 1659 | objc_setAssociatedObject(id _Nonnull object, const void * _Nonnull key, | ||
| 1660 | id _Nullable value, objc_AssociationPolicy policy) | ||
| 1661 | OBJC_AVAILABLE(10.6, 3.1, 9.0, 1.0, 2.0); | ||
| 1662 | |||
| 1663 | /** | ||
| 1664 | * Returns the value associated with a given object for a given key. | ||
| 1665 | * | ||
| 1666 | * @param object The source object for the association. | ||
| 1667 | * @param key The key for the association. | ||
| 1668 | * | ||
| 1669 | * @return The value associated with the key \e key for \e object. | ||
| 1670 | * | ||
| 1671 | * @see objc_setAssociatedObject | ||
| 1672 | */ | ||
| 1673 | OBJC_EXPORT id _Nullable | ||
| 1674 | objc_getAssociatedObject(id _Nonnull object, const void * _Nonnull key) | ||
| 1675 | OBJC_AVAILABLE(10.6, 3.1, 9.0, 1.0, 2.0); | ||
| 1676 | |||
| 1677 | /** | ||
| 1678 | * Removes all associations for a given object. | ||
| 1679 | * | ||
| 1680 | * @param object An object that maintains associated objects. | ||
| 1681 | * | ||
| 1682 | * @note The main purpose of this function is to make it easy to return an object | ||
| 1683 | * to a "pristine state”. You should not use this function for general removal of | ||
| 1684 | * associations from objects, since it also removes associations that other clients | ||
| 1685 | * may have added to the object. Typically you should use \c objc_setAssociatedObject | ||
| 1686 | * with a nil value to clear an association. | ||
| 1687 | * | ||
| 1688 | * @see objc_setAssociatedObject | ||
| 1689 | * @see objc_getAssociatedObject | ||
| 1690 | */ | ||
| 1691 | OBJC_EXPORT void | ||
| 1692 | objc_removeAssociatedObjects(id _Nonnull object) | ||
| 1693 | OBJC_AVAILABLE(10.6, 3.1, 9.0, 1.0, 2.0); | ||
| 1694 | |||
| 1695 | |||
| 1696 | /* Hooks for Swift */ | ||
| 1697 | |||
| 1698 | /** | ||
| 1699 | * Function type for a hook that intercepts class_getImageName(). | ||
| 1700 | * | ||
| 1701 | * @param cls The class whose image name is being looked up. | ||
| 1702 | * @param outImageName On return, the result of the image name lookup. | ||
| 1703 | * @return YES if an image name for this class was found, NO otherwise. | ||
| 1704 | * | ||
| 1705 | * @see class_getImageName | ||
| 1706 | * @see objc_setHook_getImageName | ||
| 1707 | */ | ||
| 1708 | typedef BOOL (*objc_hook_getImageName)(Class _Nonnull cls, const char * _Nullable * _Nonnull outImageName); | ||
| 1709 | |||
| 1710 | /** | ||
| 1711 | * Install a hook for class_getImageName(). | ||
| 1712 | * | ||
| 1713 | * @param newValue The hook function to install. | ||
| 1714 | * @param outOldValue The address of a function pointer variable. On return, | ||
| 1715 | * the old hook function is stored in the variable. | ||
| 1716 | * | ||
| 1717 | * @note The store to *outOldValue is thread-safe: the variable will be | ||
| 1718 | * updated before class_getImageName() calls your new hook to read it, | ||
| 1719 | * even if your new hook is called from another thread before this | ||
| 1720 | * setter completes. | ||
| 1721 | * @note The first hook in the chain is the native implementation of | ||
| 1722 | * class_getImageName(). Your hook should call the previous hook for | ||
| 1723 | * classes that you do not recognize. | ||
| 1724 | * | ||
| 1725 | * @see class_getImageName | ||
| 1726 | * @see objc_hook_getImageName | ||
| 1727 | */ | ||
| 1728 | OBJC_EXPORT void objc_setHook_getImageName(objc_hook_getImageName _Nonnull newValue, | ||
| 1729 | objc_hook_getImageName _Nullable * _Nonnull outOldValue) | ||
| 1730 | OBJC_AVAILABLE(10.14, 12.0, 12.0, 5.0, 3.0); | ||
| 1731 | |||
| 1732 | /** | ||
| 1733 | * Function type for a hook that assists objc_getClass() and related functions. | ||
| 1734 | * | ||
| 1735 | * @param name The class name to look up. | ||
| 1736 | * @param outClass On return, the result of the class lookup. | ||
| 1737 | * @return YES if a class with this name was found, NO otherwise. | ||
| 1738 | * | ||
| 1739 | * @see objc_getClass | ||
| 1740 | * @see objc_setHook_getClass | ||
| 1741 | */ | ||
| 1742 | typedef BOOL (*objc_hook_getClass)(const char * _Nonnull name, Class _Nullable * _Nonnull outClass); | ||
| 1743 | |||
| 1744 | /** | ||
| 1745 | * Install a hook for objc_getClass() and related functions. | ||
| 1746 | * | ||
| 1747 | * @param newValue The hook function to install. | ||
| 1748 | * @param outOldValue The address of a function pointer variable. On return, | ||
| 1749 | * the old hook function is stored in the variable. | ||
| 1750 | * | ||
| 1751 | * @note The store to *outOldValue is thread-safe: the variable will be | ||
| 1752 | * updated before objc_getClass() calls your new hook to read it, | ||
| 1753 | * even if your new hook is called from another thread before this | ||
| 1754 | * setter completes. | ||
| 1755 | * @note Your hook should call the previous hook for class names | ||
| 1756 | * that you do not recognize. | ||
| 1757 | * | ||
| 1758 | * @see objc_getClass | ||
| 1759 | * @see objc_hook_getClass | ||
| 1760 | */ | ||
| 1761 | #if !(TARGET_OS_OSX && __i386__) | ||
| 1762 | #define OBJC_GETCLASSHOOK_DEFINED 1 | ||
| 1763 | OBJC_EXPORT void objc_setHook_getClass(objc_hook_getClass _Nonnull newValue, | ||
| 1764 | objc_hook_getClass _Nullable * _Nonnull outOldValue) | ||
| 1765 | OBJC_AVAILABLE(10.14.4, 12.2, 12.2, 5.2, 3.2); | ||
| 1766 | #endif | ||
| 1767 | |||
| 1768 | /** | ||
| 1769 | * Function type for a function that is called when an image is loaded. | ||
| 1770 | * | ||
| 1771 | * @param header The newly loaded header. | ||
| 1772 | */ | ||
| 1773 | struct mach_header; | ||
| 1774 | typedef void (*objc_func_loadImage)(const struct mach_header * _Nonnull header); | ||
| 1775 | |||
| 1776 | /** | ||
| 1777 | * Add a function to be called when a new image is loaded. The function is | ||
| 1778 | * called after ObjC has scanned and fixed up the image. It is called | ||
| 1779 | * BEFORE +load methods are invoked. | ||
| 1780 | * | ||
| 1781 | * When adding a new function, that function is immediately called with all | ||
| 1782 | * images that are currently loaded. It is then called as needed for images | ||
| 1783 | * that are loaded afterwards. | ||
| 1784 | * | ||
| 1785 | * Note: the function is called with ObjC's internal runtime lock held. | ||
| 1786 | * Be VERY careful with what the function does to avoid deadlocks or | ||
| 1787 | * poor performance. | ||
| 1788 | * | ||
| 1789 | * @param func The function to add. | ||
| 1790 | */ | ||
| 1791 | #define OBJC_ADDLOADIMAGEFUNC_DEFINED 1 | ||
| 1792 | OBJC_EXPORT void objc_addLoadImageFunc(objc_func_loadImage _Nonnull func) | ||
| 1793 | OBJC_AVAILABLE(10.15, 13.0, 13.0, 6.0, 4.0); | ||
| 1794 | |||
| 1795 | /** | ||
| 1796 | * Function type for a hook that provides a name for lazily named classes. | ||
| 1797 | * | ||
| 1798 | * @param cls The class to generate a name for. | ||
| 1799 | * @return The name of the class, or NULL if the name isn't known or can't me generated. | ||
| 1800 | * | ||
| 1801 | * @see objc_setHook_lazyClassNamer | ||
| 1802 | */ | ||
| 1803 | typedef const char * _Nullable (*objc_hook_lazyClassNamer)(_Nonnull Class cls); | ||
| 1804 | |||
| 1805 | /** | ||
| 1806 | * Install a hook to provide a name for lazily-named classes. | ||
| 1807 | * | ||
| 1808 | * @param newValue The hook function to install. | ||
| 1809 | * @param outOldValue The address of a function pointer variable. On return, | ||
| 1810 | * the old hook function is stored in the variable. | ||
| 1811 | * | ||
| 1812 | * @note The store to *outOldValue is thread-safe: the variable will be | ||
| 1813 | * updated before objc_getClass() calls your new hook to read it, | ||
| 1814 | * even if your new hook is called from another thread before this | ||
| 1815 | * setter completes. | ||
| 1816 | * @note Your hook must call the previous hook for class names | ||
| 1817 | * that you do not recognize. | ||
| 1818 | */ | ||
| 1819 | #if !(TARGET_OS_OSX && __i386__) | ||
| 1820 | #define OBJC_SETHOOK_LAZYCLASSNAMER_DEFINED 1 | ||
| 1821 | OBJC_EXPORT | ||
| 1822 | void objc_setHook_lazyClassNamer(_Nonnull objc_hook_lazyClassNamer newValue, | ||
| 1823 | _Nonnull objc_hook_lazyClassNamer * _Nonnull oldOutValue) | ||
| 1824 | OBJC_AVAILABLE(11.0, 14.0, 14.0, 7.0, 5.0); | ||
| 1825 | #endif | ||
| 1826 | |||
| 1827 | /** | ||
| 1828 | * Callback from Objective-C to Swift to perform Swift class initialization. | ||
| 1829 | */ | ||
| 1830 | #if !(TARGET_OS_OSX && __i386__) | ||
| 1831 | typedef Class _Nullable | ||
| 1832 | (*_objc_swiftMetadataInitializer)(Class _Nonnull cls, void * _Nullable arg); | ||
| 1833 | #endif | ||
| 1834 | |||
| 1835 | |||
| 1836 | /** | ||
| 1837 | * Perform Objective-C initialization of a Swift class. | ||
| 1838 | * Do not call this function. It is provided for the Swift runtime's use only | ||
| 1839 | * and will change without notice or mercy. | ||
| 1840 | */ | ||
| 1841 | #if !(TARGET_OS_OSX && __i386__) | ||
| 1842 | #define OBJC_REALIZECLASSFROMSWIFT_DEFINED 1 | ||
| 1843 | OBJC_EXPORT Class _Nullable | ||
| 1844 | _objc_realizeClassFromSwift(Class _Nullable cls, void * _Nullable previously) | ||
| 1845 | OBJC_AVAILABLE(10.14.4, 12.2, 12.2, 5.2, 3.2); | ||
| 1846 | #endif | ||
| 1847 | |||
| 1848 | |||
| 1849 | #define _C_ID '@' | ||
| 1850 | #define _C_CLASS '#' | ||
| 1851 | #define _C_SEL ':' | ||
| 1852 | #define _C_CHR 'c' | ||
| 1853 | #define _C_UCHR 'C' | ||
| 1854 | #define _C_SHT 's' | ||
| 1855 | #define _C_USHT 'S' | ||
| 1856 | #define _C_INT 'i' | ||
| 1857 | #define _C_UINT 'I' | ||
| 1858 | #define _C_LNG 'l' | ||
| 1859 | #define _C_ULNG 'L' | ||
| 1860 | #define _C_LNG_LNG 'q' | ||
| 1861 | #define _C_ULNG_LNG 'Q' | ||
| 1862 | #define _C_FLT 'f' | ||
| 1863 | #define _C_DBL 'd' | ||
| 1864 | #define _C_BFLD 'b' | ||
| 1865 | #define _C_BOOL 'B' | ||
| 1866 | #define _C_VOID 'v' | ||
| 1867 | #define _C_UNDEF '?' | ||
| 1868 | #define _C_PTR '^' | ||
| 1869 | #define _C_CHARPTR '*' | ||
| 1870 | #define _C_ATOM '%' | ||
| 1871 | #define _C_ARY_B '[' | ||
| 1872 | #define _C_ARY_E ']' | ||
| 1873 | #define _C_UNION_B '(' | ||
| 1874 | #define _C_UNION_E ')' | ||
| 1875 | #define _C_STRUCT_B '{' | ||
| 1876 | #define _C_STRUCT_E '}' | ||
| 1877 | #define _C_VECTOR '!' | ||
| 1878 | #define _C_CONST 'r' | ||
| 1879 | |||
| 1880 | |||
| 1881 | /* Obsolete types */ | ||
| 1882 | |||
| 1883 | #if !__OBJC2__ | ||
| 1884 | |||
| 1885 | #define CLS_GETINFO(cls,infomask) ((cls)->info & (infomask)) | ||
| 1886 | #define CLS_SETINFO(cls,infomask) ((cls)->info |= (infomask)) | ||
| 1887 | |||
| 1888 | // class is not a metaclass | ||
| 1889 | #define CLS_CLASS 0x1 | ||
| 1890 | // class is a metaclass | ||
| 1891 | #define CLS_META 0x2 | ||
| 1892 | // class's +initialize method has completed | ||
| 1893 | #define CLS_INITIALIZED 0x4 | ||
| 1894 | // class is posing | ||
| 1895 | #define CLS_POSING 0x8 | ||
| 1896 | // unused | ||
| 1897 | #define CLS_MAPPED 0x10 | ||
| 1898 | // class and subclasses need cache flush during image loading | ||
| 1899 | #define CLS_FLUSH_CACHE 0x20 | ||
| 1900 | // method cache should grow when full | ||
| 1901 | #define CLS_GROW_CACHE 0x40 | ||
| 1902 | // unused | ||
| 1903 | #define CLS_NEED_BIND 0x80 | ||
| 1904 | // methodLists is array of method lists | ||
| 1905 | #define CLS_METHOD_ARRAY 0x100 | ||
| 1906 | // the JavaBridge constructs classes with these markers | ||
| 1907 | #define CLS_JAVA_HYBRID 0x200 | ||
| 1908 | #define CLS_JAVA_CLASS 0x400 | ||
| 1909 | // thread-safe +initialize | ||
| 1910 | #define CLS_INITIALIZING 0x800 | ||
| 1911 | // bundle unloading | ||
| 1912 | #define CLS_FROM_BUNDLE 0x1000 | ||
| 1913 | // C++ ivar support | ||
| 1914 | #define CLS_HAS_CXX_STRUCTORS 0x2000 | ||
| 1915 | // Lazy method list arrays | ||
| 1916 | #define CLS_NO_METHOD_ARRAY 0x4000 | ||
| 1917 | // +load implementation | ||
| 1918 | #define CLS_HAS_LOAD_METHOD 0x8000 | ||
| 1919 | // objc_allocateClassPair API | ||
| 1920 | #define CLS_CONSTRUCTING 0x10000 | ||
| 1921 | // class compiled with bigger class structure | ||
| 1922 | #define CLS_EXT 0x20000 | ||
| 1923 | |||
| 1924 | |||
| 1925 | struct objc_method_description_list { | ||
| 1926 | int count; | ||
| 1927 | struct objc_method_description list[1]; | ||
| 1928 | }; | ||
| 1929 | |||
| 1930 | |||
| 1931 | struct objc_protocol_list { | ||
| 1932 | struct objc_protocol_list * _Nullable next; | ||
| 1933 | long count; | ||
| 1934 | __unsafe_unretained Protocol * _Nullable list[1]; | ||
| 1935 | }; | ||
| 1936 | |||
| 1937 | |||
| 1938 | struct objc_category { | ||
| 1939 | char * _Nonnull category_name OBJC2_UNAVAILABLE; | ||
| 1940 | char * _Nonnull class_name OBJC2_UNAVAILABLE; | ||
| 1941 | struct objc_method_list * _Nullable instance_methods OBJC2_UNAVAILABLE; | ||
| 1942 | struct objc_method_list * _Nullable class_methods OBJC2_UNAVAILABLE; | ||
| 1943 | struct objc_protocol_list * _Nullable protocols OBJC2_UNAVAILABLE; | ||
| 1944 | } OBJC2_UNAVAILABLE; | ||
| 1945 | |||
| 1946 | |||
| 1947 | struct objc_ivar { | ||
| 1948 | char * _Nullable ivar_name OBJC2_UNAVAILABLE; | ||
| 1949 | char * _Nullable ivar_type OBJC2_UNAVAILABLE; | ||
| 1950 | int ivar_offset OBJC2_UNAVAILABLE; | ||
| 1951 | #ifdef __LP64__ | ||
| 1952 | int space OBJC2_UNAVAILABLE; | ||
| 1953 | #endif | ||
| 1954 | } OBJC2_UNAVAILABLE; | ||
| 1955 | |||
| 1956 | struct objc_ivar_list { | ||
| 1957 | int ivar_count OBJC2_UNAVAILABLE; | ||
| 1958 | #ifdef __LP64__ | ||
| 1959 | int space OBJC2_UNAVAILABLE; | ||
| 1960 | #endif | ||
| 1961 | /* variable length structure */ | ||
| 1962 | struct objc_ivar ivar_list[1] OBJC2_UNAVAILABLE; | ||
| 1963 | } OBJC2_UNAVAILABLE; | ||
| 1964 | |||
| 1965 | |||
| 1966 | struct objc_method { | ||
| 1967 | SEL _Nonnull method_name OBJC2_UNAVAILABLE; | ||
| 1968 | char * _Nullable method_types OBJC2_UNAVAILABLE; | ||
| 1969 | IMP _Nonnull method_imp OBJC2_UNAVAILABLE; | ||
| 1970 | } OBJC2_UNAVAILABLE; | ||
| 1971 | |||
| 1972 | struct objc_method_list { | ||
| 1973 | struct objc_method_list * _Nullable obsolete OBJC2_UNAVAILABLE; | ||
| 1974 | |||
| 1975 | int method_count OBJC2_UNAVAILABLE; | ||
| 1976 | #ifdef __LP64__ | ||
| 1977 | int space OBJC2_UNAVAILABLE; | ||
| 1978 | #endif | ||
| 1979 | /* variable length structure */ | ||
| 1980 | struct objc_method method_list[1] OBJC2_UNAVAILABLE; | ||
| 1981 | } OBJC2_UNAVAILABLE; | ||
| 1982 | |||
| 1983 | |||
| 1984 | typedef struct objc_symtab *Symtab OBJC2_UNAVAILABLE; | ||
| 1985 | |||
| 1986 | struct objc_symtab { | ||
| 1987 | unsigned long sel_ref_cnt OBJC2_UNAVAILABLE; | ||
| 1988 | SEL _Nonnull * _Nullable refs OBJC2_UNAVAILABLE; | ||
| 1989 | unsigned short cls_def_cnt OBJC2_UNAVAILABLE; | ||
| 1990 | unsigned short cat_def_cnt OBJC2_UNAVAILABLE; | ||
| 1991 | void * _Nullable defs[1] /* variable size */ OBJC2_UNAVAILABLE; | ||
| 1992 | } OBJC2_UNAVAILABLE; | ||
| 1993 | |||
| 1994 | |||
| 1995 | typedef struct objc_cache *Cache OBJC2_UNAVAILABLE; | ||
| 1996 | |||
| 1997 | #define CACHE_BUCKET_NAME(B) ((B)->method_name) | ||
| 1998 | #define CACHE_BUCKET_IMP(B) ((B)->method_imp) | ||
| 1999 | #define CACHE_BUCKET_VALID(B) (B) | ||
| 2000 | #ifndef __LP64__ | ||
| 2001 | #define CACHE_HASH(sel, mask) (((uintptr_t)(sel)>>2) & (mask)) | ||
| 2002 | #else | ||
| 2003 | #define CACHE_HASH(sel, mask) (((unsigned int)((uintptr_t)(sel)>>3)) & (mask)) | ||
| 2004 | #endif | ||
| 2005 | struct objc_cache { | ||
| 2006 | unsigned int mask /* total = mask + 1 */ OBJC2_UNAVAILABLE; | ||
| 2007 | unsigned int occupied OBJC2_UNAVAILABLE; | ||
| 2008 | Method _Nullable buckets[1] OBJC2_UNAVAILABLE; | ||
| 2009 | }; | ||
| 2010 | |||
| 2011 | |||
| 2012 | typedef struct objc_module *Module OBJC2_UNAVAILABLE; | ||
| 2013 | |||
| 2014 | struct objc_module { | ||
| 2015 | unsigned long version OBJC2_UNAVAILABLE; | ||
| 2016 | unsigned long size OBJC2_UNAVAILABLE; | ||
| 2017 | const char * _Nullable name OBJC2_UNAVAILABLE; | ||
| 2018 | Symtab _Nullable symtab OBJC2_UNAVAILABLE; | ||
| 2019 | } OBJC2_UNAVAILABLE; | ||
| 2020 | |||
| 2021 | #else | ||
| 2022 | |||
| 2023 | struct objc_method_list; | ||
| 2024 | |||
| 2025 | #endif | ||
| 2026 | |||
| 2027 | |||
| 2028 | /* Obsolete functions */ | ||
| 2029 | |||
| 2030 | OBJC_EXPORT IMP _Nullable | ||
| 2031 | class_lookupMethod(Class _Nullable cls, SEL _Nonnull sel) | ||
| 2032 | __OSX_DEPRECATED(10.0, 10.5, "use class_getMethodImplementation instead") | ||
| 2033 | __IOS_DEPRECATED(2.0, 2.0, "use class_getMethodImplementation instead") | ||
| 2034 | __TVOS_DEPRECATED(9.0, 9.0, "use class_getMethodImplementation instead") | ||
| 2035 | __WATCHOS_DEPRECATED(1.0, 1.0, "use class_getMethodImplementation instead") | ||
| 2036 | |||
| 2037 | ; | ||
| 2038 | OBJC_EXPORT BOOL | ||
| 2039 | class_respondsToMethod(Class _Nullable cls, SEL _Nonnull sel) | ||
| 2040 | __OSX_DEPRECATED(10.0, 10.5, "use class_respondsToSelector instead") | ||
| 2041 | __IOS_DEPRECATED(2.0, 2.0, "use class_respondsToSelector instead") | ||
| 2042 | __TVOS_DEPRECATED(9.0, 9.0, "use class_respondsToSelector instead") | ||
| 2043 | __WATCHOS_DEPRECATED(1.0, 1.0, "use class_respondsToSelector instead") | ||
| 2044 | |||
| 2045 | ; | ||
| 2046 | |||
| 2047 | OBJC_EXPORT void | ||
| 2048 | _objc_flush_caches(Class _Nullable cls) | ||
| 2049 | __OSX_DEPRECATED(10.0, 10.5, "not recommended") | ||
| 2050 | __IOS_DEPRECATED(2.0, 2.0, "not recommended") | ||
| 2051 | __TVOS_DEPRECATED(9.0, 9.0, "not recommended") | ||
| 2052 | __WATCHOS_DEPRECATED(1.0, 1.0, "not recommended") | ||
| 2053 | |||
| 2054 | ; | ||
| 2055 | |||
| 2056 | OBJC_EXPORT id _Nullable | ||
| 2057 | object_copyFromZone(id _Nullable anObject, size_t nBytes, void * _Nullable z) | ||
| 2058 | OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(10.0, 10.5, "use object_copy instead"); | ||
| 2059 | |||
| 2060 | OBJC_EXPORT id _Nullable | ||
| 2061 | object_realloc(id _Nullable anObject, size_t nBytes) | ||
| 2062 | OBJC2_UNAVAILABLE; | ||
| 2063 | |||
| 2064 | OBJC_EXPORT id _Nullable | ||
| 2065 | object_reallocFromZone(id _Nullable anObject, size_t nBytes, void * _Nullable z) | ||
| 2066 | OBJC2_UNAVAILABLE; | ||
| 2067 | |||
| 2068 | #define OBSOLETE_OBJC_GETCLASSES 1 | ||
| 2069 | OBJC_EXPORT void * _Nonnull | ||
| 2070 | objc_getClasses(void) | ||
| 2071 | OBJC2_UNAVAILABLE; | ||
| 2072 | |||
| 2073 | OBJC_EXPORT void | ||
| 2074 | objc_addClass(Class _Nonnull myClass) | ||
| 2075 | OBJC2_UNAVAILABLE; | ||
| 2076 | |||
| 2077 | OBJC_EXPORT void | ||
| 2078 | objc_setClassHandler(int (* _Nullable )(const char * _Nonnull)) | ||
| 2079 | OBJC2_UNAVAILABLE; | ||
| 2080 | |||
| 2081 | OBJC_EXPORT void | ||
| 2082 | objc_setMultithreaded(BOOL flag) | ||
| 2083 | OBJC2_UNAVAILABLE; | ||
| 2084 | |||
| 2085 | OBJC_EXPORT id _Nullable | ||
| 2086 | class_createInstanceFromZone(Class _Nullable, size_t idxIvars, | ||
| 2087 | void * _Nullable z) | ||
| 2088 | OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(10.0, 10.5, "use class_createInstance instead"); | ||
| 2089 | |||
| 2090 | OBJC_EXPORT void | ||
| 2091 | class_addMethods(Class _Nullable, struct objc_method_list * _Nonnull) | ||
| 2092 | OBJC2_UNAVAILABLE; | ||
| 2093 | |||
| 2094 | OBJC_EXPORT void | ||
| 2095 | class_removeMethods(Class _Nullable, struct objc_method_list * _Nonnull) | ||
| 2096 | OBJC2_UNAVAILABLE; | ||
| 2097 | |||
| 2098 | OBJC_EXPORT void | ||
| 2099 | _objc_resolve_categories_for_class(Class _Nonnull cls) | ||
| 2100 | OBJC2_UNAVAILABLE; | ||
| 2101 | |||
| 2102 | OBJC_EXPORT Class _Nonnull | ||
| 2103 | class_poseAs(Class _Nonnull imposter, Class _Nonnull original) | ||
| 2104 | OBJC2_UNAVAILABLE; | ||
| 2105 | |||
| 2106 | OBJC_EXPORT unsigned int | ||
| 2107 | method_getSizeOfArguments(Method _Nonnull m) | ||
| 2108 | OBJC2_UNAVAILABLE; | ||
| 2109 | |||
| 2110 | OBJC_EXPORT unsigned | ||
| 2111 | method_getArgumentInfo(struct objc_method * _Nonnull m, int arg, | ||
| 2112 | const char * _Nullable * _Nonnull type, | ||
| 2113 | int * _Nonnull offset) | ||
| 2114 | UNAVAILABLE_ATTRIBUTE // This function was accidentally deleted in 10.9. | ||
| 2115 | OBJC2_UNAVAILABLE; | ||
| 2116 | |||
| 2117 | OBJC_EXPORT Class _Nullable | ||
| 2118 | objc_getOrigClass(const char * _Nonnull name) | ||
| 2119 | OBJC2_UNAVAILABLE; | ||
| 2120 | |||
| 2121 | #define OBJC_NEXT_METHOD_LIST 1 | ||
| 2122 | OBJC_EXPORT struct objc_method_list * _Nullable | ||
| 2123 | class_nextMethodList(Class _Nullable, void * _Nullable * _Nullable) | ||
| 2124 | OBJC2_UNAVAILABLE; | ||
| 2125 | // usage for nextMethodList | ||
| 2126 | // | ||
| 2127 | // void *iterator = 0; | ||
| 2128 | // struct objc_method_list *mlist; | ||
| 2129 | // while ( mlist = class_nextMethodList( cls, &iterator ) ) | ||
| 2130 | // ; | ||
| 2131 | |||
| 2132 | OBJC_EXPORT id _Nullable | ||
| 2133 | (* _Nonnull _alloc)(Class _Nullable, size_t) | ||
| 2134 | OBJC2_UNAVAILABLE; | ||
| 2135 | |||
| 2136 | OBJC_EXPORT id _Nullable | ||
| 2137 | (* _Nonnull _copy)(id _Nullable, size_t) | ||
| 2138 | OBJC2_UNAVAILABLE; | ||
| 2139 | |||
| 2140 | OBJC_EXPORT id _Nullable | ||
| 2141 | (* _Nonnull _realloc)(id _Nullable, size_t) | ||
| 2142 | OBJC2_UNAVAILABLE; | ||
| 2143 | |||
| 2144 | OBJC_EXPORT id _Nullable | ||
| 2145 | (* _Nonnull _dealloc)(id _Nullable) | ||
| 2146 | OBJC2_UNAVAILABLE; | ||
| 2147 | |||
| 2148 | OBJC_EXPORT id _Nullable | ||
| 2149 | (* _Nonnull _zoneAlloc)(Class _Nullable, size_t, void * _Nullable) | ||
| 2150 | OBJC2_UNAVAILABLE; | ||
| 2151 | |||
| 2152 | OBJC_EXPORT id _Nullable | ||
| 2153 | (* _Nonnull _zoneRealloc)(id _Nullable, size_t, void * _Nullable) | ||
| 2154 | OBJC2_UNAVAILABLE; | ||
| 2155 | |||
| 2156 | OBJC_EXPORT id _Nullable | ||
| 2157 | (* _Nonnull _zoneCopy)(id _Nullable, size_t, void * _Nullable) | ||
| 2158 | OBJC2_UNAVAILABLE; | ||
| 2159 | |||
| 2160 | OBJC_EXPORT void | ||
| 2161 | (* _Nonnull _error)(id _Nullable, const char * _Nonnull, va_list) | ||
| 2162 | OBJC2_UNAVAILABLE; | ||
| 2163 | |||
| 2164 | #endif | ||
lib/libc/include/x86_64-macos-gnu/os/availability.h created+165| ... | @@ -0,0 +1,165 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_AVAILABILITY__ | ||
| 22 | #define __OS_AVAILABILITY__ | ||
| 23 | |||
| 24 | /* | ||
| 25 | * API_TO_BE_DEPRECATED is used as a version number in API that will be deprecated | ||
| 26 | * in an upcoming release. This soft deprecation is an intermediate step before formal | ||
| 27 | * deprecation to notify developers about the API before compiler warnings are generated. | ||
| 28 | * You can find all places in your code that use soft deprecated API by redefining the | ||
| 29 | * value of this macro to your current minimum deployment target, for example: | ||
| 30 | * (macOS) | ||
| 31 | * clang -DAPI_TO_BE_DEPRECATED=10.12 <other compiler flags> | ||
| 32 | * (iOS) | ||
| 33 | * clang -DAPI_TO_BE_DEPRECATED=11.0 <other compiler flags> | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef API_TO_BE_DEPRECATED | ||
| 37 | #define API_TO_BE_DEPRECATED 100000 | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #include <AvailabilityInternal.h> | ||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | #if defined(__has_feature) && defined(__has_attribute) | ||
| 45 | #if __has_attribute(availability) | ||
| 46 | |||
| 47 | /* | ||
| 48 | * API Introductions | ||
| 49 | * | ||
| 50 | * Use to specify the release that a particular API became available. | ||
| 51 | * | ||
| 52 | * Platform names: | ||
| 53 | * macos, ios, tvos, watchos | ||
| 54 | * | ||
| 55 | * Examples: | ||
| 56 | * API_AVAILABLE(macos(10.10)) | ||
| 57 | * API_AVAILABLE(macos(10.9), ios(10.0)) | ||
| 58 | * API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0)) | ||
| 59 | */ | ||
| 60 | |||
| 61 | #define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7, __API_AVAILABLE6, __API_AVAILABLE5, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1, 0)(__VA_ARGS__) | ||
| 62 | |||
| 63 | #define API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6, __API_AVAILABLE_BEGIN5, __API_AVAILABLE_BEGIN4, __API_AVAILABLE_BEGIN3, __API_AVAILABLE_BEGIN2, __API_AVAILABLE_BEGIN1, 0)(__VA_ARGS__) | ||
| 64 | #define API_AVAILABLE_END _Pragma("clang attribute pop") | ||
| 65 | |||
| 66 | /* | ||
| 67 | * API Deprecations | ||
| 68 | * | ||
| 69 | * Use to specify the release that a particular API became unavailable. | ||
| 70 | * | ||
| 71 | * Platform names: | ||
| 72 | * macos, ios, tvos, watchos | ||
| 73 | * | ||
| 74 | * Examples: | ||
| 75 | * | ||
| 76 | * API_DEPRECATED("No longer supported", macos(10.4, 10.8)) | ||
| 77 | * API_DEPRECATED("No longer supported", macos(10.4, 10.8), ios(2.0, 3.0), watchos(2.0, 3.0), tvos(9.0, 10.0)) | ||
| 78 | * | ||
| 79 | * API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0)) | ||
| 80 | * API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0)) | ||
| 81 | */ | ||
| 82 | |||
| 83 | #define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7, __API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1, 0)(__VA_ARGS__) | ||
| 84 | #define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7, __API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1, 0)(__VA_ARGS__) | ||
| 85 | |||
| 86 | #define API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_MSG8,__API_DEPRECATED_BEGIN_MSG7, __API_DEPRECATED_BEGIN_MSG6, __API_DEPRECATED_BEGIN_MSG5, __API_DEPRECATED_BEGIN_MSG4, __API_DEPRECATED_BEGIN_MSG3, __API_DEPRECATED_BEGIN_MSG2, __API_DEPRECATED_BEGIN_MSG1, 0)(__VA_ARGS__) | ||
| 87 | #define API_DEPRECATED_END _Pragma("clang attribute pop") | ||
| 88 | |||
| 89 | #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_REP8,__API_DEPRECATED_BEGIN_REP7, __API_DEPRECATED_BEGIN_REP6, __API_DEPRECATED_BEGIN_REP5, __API_DEPRECATED_BEGIN_REP4, __API_DEPRECATED_BEGIN_REP3, __API_DEPRECATED_BEGIN_REP2, __API_DEPRECATED_BEGIN_REP1, 0)(__VA_ARGS__) | ||
| 90 | #define API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop") | ||
| 91 | |||
| 92 | |||
| 93 | /* | ||
| 94 | * API Unavailability | ||
| 95 | * Use to specify that an API is unavailable for a particular platform. | ||
| 96 | * | ||
| 97 | * Example: | ||
| 98 | * API_UNAVAILABLE(macos) | ||
| 99 | * API_UNAVAILABLE(watchos, tvos) | ||
| 100 | */ | ||
| 101 | |||
| 102 | #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__) | ||
| 103 | |||
| 104 | #define API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6, __API_UNAVAILABLE_BEGIN5, __API_UNAVAILABLE_BEGIN4, __API_UNAVAILABLE_BEGIN3, __API_UNAVAILABLE_BEGIN2, __API_UNAVAILABLE_BEGIN1, 0)(__VA_ARGS__) | ||
| 105 | #define API_UNAVAILABLE_END _Pragma("clang attribute pop") | ||
| 106 | #else | ||
| 107 | |||
| 108 | /* | ||
| 109 | * Evaluate to nothing for compilers that don't support availability. | ||
| 110 | */ | ||
| 111 | |||
| 112 | #define API_AVAILABLE(...) | ||
| 113 | #define API_AVAILABLE_BEGIN(...) | ||
| 114 | #define API_AVAILABLE_END | ||
| 115 | #define API_DEPRECATED(...) | ||
| 116 | #define API_DEPRECATED_WITH_REPLACEMENT(...) | ||
| 117 | #define API_DEPRECATED_BEGIN(...) | ||
| 118 | #define API_DEPRECATED_END | ||
| 119 | #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) | ||
| 120 | #define API_DEPRECATED_WITH_REPLACEMENT_END | ||
| 121 | #define API_UNAVAILABLE(...) | ||
| 122 | #define API_UNAVAILABLE_BEGIN(...) | ||
| 123 | #define API_UNAVAILABLE_END | ||
| 124 | #endif /* __has_attribute(availability) */ | ||
| 125 | #else | ||
| 126 | |||
| 127 | /* | ||
| 128 | * Evaluate to nothing for compilers that don't support clang language extensions. | ||
| 129 | */ | ||
| 130 | |||
| 131 | #define API_AVAILABLE(...) | ||
| 132 | #define API_AVAILABLE_BEGIN(...) | ||
| 133 | #define API_AVAILABLE_END | ||
| 134 | #define API_DEPRECATED(...) | ||
| 135 | #define API_DEPRECATED_WITH_REPLACEMENT(...) | ||
| 136 | #define API_DEPRECATED_BEGIN(...) | ||
| 137 | #define API_DEPRECATED_END | ||
| 138 | #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) | ||
| 139 | #define API_DEPRECATED_WITH_REPLACEMENT_END | ||
| 140 | #define API_UNAVAILABLE(...) | ||
| 141 | #define API_UNAVAILABLE_BEGIN(...) | ||
| 142 | #define API_UNAVAILABLE_END | ||
| 143 | #endif /* #if defined(__has_feature) && defined(__has_attribute) */ | ||
| 144 | |||
| 145 | #if __has_include(<AvailabilityProhibitedInternal.h>) | ||
| 146 | #include <AvailabilityProhibitedInternal.h> | ||
| 147 | #endif | ||
| 148 | |||
| 149 | /* | ||
| 150 | * If SPI decorations have not been defined elsewhere, disable them. | ||
| 151 | */ | ||
| 152 | |||
| 153 | #ifndef SPI_AVAILABLE | ||
| 154 | #define SPI_AVAILABLE(...) | ||
| 155 | #endif | ||
| 156 | |||
| 157 | #ifndef SPI_DEPRECATED | ||
| 158 | #define SPI_DEPRECATED(...) | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #ifndef SPI_DEPRECATED_WITH_REPLACEMENT | ||
| 162 | #define SPI_DEPRECATED_WITH_REPLACEMENT(...) | ||
| 163 | #endif | ||
| 164 | |||
| 165 | #endif /* __OS_AVAILABILITY__ */ | ||
lib/libc/include/x86_64-macos-gnu/os/base.h created+322| ... | @@ -0,0 +1,322 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_BASE__ | ||
| 22 | #define __OS_BASE__ | ||
| 23 | |||
| 24 | #include <sys/cdefs.h> | ||
| 25 | |||
| 26 | |||
| 27 | #ifndef __has_builtin | ||
| 28 | #define __has_builtin(x) 0 | ||
| 29 | #endif | ||
| 30 | #ifndef __has_include | ||
| 31 | #define __has_include(x) 0 | ||
| 32 | #endif | ||
| 33 | #ifndef __has_feature | ||
| 34 | #define __has_feature(x) 0 | ||
| 35 | #endif | ||
| 36 | #ifndef __has_attribute | ||
| 37 | #define __has_attribute(x) 0 | ||
| 38 | #endif | ||
| 39 | #ifndef __has_extension | ||
| 40 | #define __has_extension(x) 0 | ||
| 41 | #endif | ||
| 42 | |||
| 43 | #undef OS_INLINE // <sys/_types/_os_inline.h> | ||
| 44 | #if __GNUC__ | ||
| 45 | #define OS_NORETURN __attribute__((__noreturn__)) | ||
| 46 | #define OS_NOTHROW __attribute__((__nothrow__)) | ||
| 47 | #define OS_NONNULL1 __attribute__((__nonnull__(1))) | ||
| 48 | #define OS_NONNULL2 __attribute__((__nonnull__(2))) | ||
| 49 | #define OS_NONNULL3 __attribute__((__nonnull__(3))) | ||
| 50 | #define OS_NONNULL4 __attribute__((__nonnull__(4))) | ||
| 51 | #define OS_NONNULL5 __attribute__((__nonnull__(5))) | ||
| 52 | #define OS_NONNULL6 __attribute__((__nonnull__(6))) | ||
| 53 | #define OS_NONNULL7 __attribute__((__nonnull__(7))) | ||
| 54 | #define OS_NONNULL8 __attribute__((__nonnull__(8))) | ||
| 55 | #define OS_NONNULL9 __attribute__((__nonnull__(9))) | ||
| 56 | #define OS_NONNULL10 __attribute__((__nonnull__(10))) | ||
| 57 | #define OS_NONNULL11 __attribute__((__nonnull__(11))) | ||
| 58 | #define OS_NONNULL12 __attribute__((__nonnull__(12))) | ||
| 59 | #define OS_NONNULL13 __attribute__((__nonnull__(13))) | ||
| 60 | #define OS_NONNULL14 __attribute__((__nonnull__(14))) | ||
| 61 | #define OS_NONNULL15 __attribute__((__nonnull__(15))) | ||
| 62 | #define OS_NONNULL_ALL __attribute__((__nonnull__)) | ||
| 63 | #define OS_SENTINEL __attribute__((__sentinel__)) | ||
| 64 | #define OS_PURE __attribute__((__pure__)) | ||
| 65 | #define OS_CONST __attribute__((__const__)) | ||
| 66 | #define OS_WARN_RESULT __attribute__((__warn_unused_result__)) | ||
| 67 | #define OS_MALLOC __attribute__((__malloc__)) | ||
| 68 | #define OS_USED __attribute__((__used__)) | ||
| 69 | #define OS_UNUSED __attribute__((__unused__)) | ||
| 70 | #define OS_COLD __attribute__((__cold__)) | ||
| 71 | #define OS_WEAK __attribute__((__weak__)) | ||
| 72 | #define OS_WEAK_IMPORT __attribute__((__weak_import__)) | ||
| 73 | #define OS_NOINLINE __attribute__((__noinline__)) | ||
| 74 | #define OS_ALWAYS_INLINE __attribute__((__always_inline__)) | ||
| 75 | #define OS_TRANSPARENT_UNION __attribute__((__transparent_union__)) | ||
| 76 | #define OS_ALIGNED(n) __attribute__((__aligned__((n)))) | ||
| 77 | #define OS_FORMAT_PRINTF(x, y) __attribute__((__format__(printf,x,y))) | ||
| 78 | #define OS_EXPORT extern __attribute__((__visibility__("default"))) | ||
| 79 | #define OS_INLINE static __inline__ | ||
| 80 | #define OS_EXPECT(x, v) __builtin_expect((x), (v)) | ||
| 81 | #else | ||
| 82 | #define OS_NORETURN | ||
| 83 | #define OS_NOTHROW | ||
| 84 | #define OS_NONNULL1 | ||
| 85 | #define OS_NONNULL2 | ||
| 86 | #define OS_NONNULL3 | ||
| 87 | #define OS_NONNULL4 | ||
| 88 | #define OS_NONNULL5 | ||
| 89 | #define OS_NONNULL6 | ||
| 90 | #define OS_NONNULL7 | ||
| 91 | #define OS_NONNULL8 | ||
| 92 | #define OS_NONNULL9 | ||
| 93 | #define OS_NONNULL10 | ||
| 94 | #define OS_NONNULL11 | ||
| 95 | #define OS_NONNULL12 | ||
| 96 | #define OS_NONNULL13 | ||
| 97 | #define OS_NONNULL14 | ||
| 98 | #define OS_NONNULL15 | ||
| 99 | #define OS_NONNULL_ALL | ||
| 100 | #define OS_SENTINEL | ||
| 101 | #define OS_PURE | ||
| 102 | #define OS_CONST | ||
| 103 | #define OS_WARN_RESULT | ||
| 104 | #define OS_MALLOC | ||
| 105 | #define OS_USED | ||
| 106 | #define OS_UNUSED | ||
| 107 | #define OS_COLD | ||
| 108 | #define OS_WEAK | ||
| 109 | #define OS_WEAK_IMPORT | ||
| 110 | #define OS_NOINLINE | ||
| 111 | #define OS_ALWAYS_INLINE | ||
| 112 | #define OS_TRANSPARENT_UNION | ||
| 113 | #define OS_ALIGNED(n) | ||
| 114 | #define OS_FORMAT_PRINTF(x, y) | ||
| 115 | #define OS_EXPORT extern | ||
| 116 | #define OS_INLINE static inline | ||
| 117 | #define OS_EXPECT(x, v) (x) | ||
| 118 | #endif | ||
| 119 | |||
| 120 | #if __has_attribute(noescape) | ||
| 121 | #define OS_NOESCAPE __attribute__((__noescape__)) | ||
| 122 | #else | ||
| 123 | #define OS_NOESCAPE | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #if defined(__cplusplus) && defined(__clang__) | ||
| 127 | #define OS_FALLTHROUGH [[clang::fallthrough]] | ||
| 128 | #elif __has_attribute(fallthrough) | ||
| 129 | #define OS_FALLTHROUGH __attribute__((__fallthrough__)) | ||
| 130 | #else | ||
| 131 | #define OS_FALLTHROUGH | ||
| 132 | #endif | ||
| 133 | |||
| 134 | #if __has_feature(assume_nonnull) | ||
| 135 | #define OS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") | ||
| 136 | #define OS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") | ||
| 137 | #else | ||
| 138 | #define OS_ASSUME_NONNULL_BEGIN | ||
| 139 | #define OS_ASSUME_NONNULL_END | ||
| 140 | #endif | ||
| 141 | |||
| 142 | #if __has_builtin(__builtin_assume) | ||
| 143 | #define OS_COMPILER_CAN_ASSUME(expr) __builtin_assume(expr) | ||
| 144 | #else | ||
| 145 | #define OS_COMPILER_CAN_ASSUME(expr) ((void)(expr)) | ||
| 146 | #endif | ||
| 147 | |||
| 148 | #if __has_extension(attribute_overloadable) | ||
| 149 | #define OS_OVERLOADABLE __attribute__((__overloadable__)) | ||
| 150 | #else | ||
| 151 | #define OS_OVERLOADABLE | ||
| 152 | #endif | ||
| 153 | |||
| 154 | #if __has_attribute(enum_extensibility) | ||
| 155 | #define __OS_ENUM_ATTR __attribute__((enum_extensibility(open))) | ||
| 156 | #define __OS_ENUM_ATTR_CLOSED __attribute__((enum_extensibility(closed))) | ||
| 157 | #else | ||
| 158 | #define __OS_ENUM_ATTR | ||
| 159 | #define __OS_ENUM_ATTR_CLOSED | ||
| 160 | #endif // __has_attribute(enum_extensibility) | ||
| 161 | |||
| 162 | #if __has_attribute(flag_enum) | ||
| 163 | /*! | ||
| 164 | * Compile with -Wflag-enum and -Wassign-enum to enforce at definition and | ||
| 165 | * assignment, respectively, i.e. -Wflag-enum prevents you from creating new | ||
| 166 | * enumeration values from illegal values within the enum definition, and | ||
| 167 | * -Wassign-enum prevents you from assigning illegal values to a variable of the | ||
| 168 | * enum type. | ||
| 169 | */ | ||
| 170 | #define __OS_OPTIONS_ATTR __attribute__((flag_enum)) | ||
| 171 | #else | ||
| 172 | #define __OS_OPTIONS_ATTR | ||
| 173 | #endif // __has_attribute(flag_enum) | ||
| 174 | |||
| 175 | #if __has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum) || \ | ||
| 176 | __has_extension(cxx_strong_enums) | ||
| 177 | #define OS_ENUM(_name, _type, ...) \ | ||
| 178 | 	typedef enum : _type { __VA_ARGS__ } _name##_t | ||
| 179 | #define OS_CLOSED_ENUM(_name, _type, ...) \ | ||
| 180 | 	typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED _name##_t | ||
| 181 | #define OS_OPTIONS(_name, _type, ...) \ | ||
| 182 | 	typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR __OS_OPTIONS_ATTR _name##_t | ||
| 183 | #define OS_CLOSED_OPTIONS(_name, _type, ...) \ | ||
| 184 | 	typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR _name##_t | ||
| 185 | #else | ||
| 186 | /*! | ||
| 187 | * There is unfortunately no good way in plain C to have both fixed-type enums | ||
| 188 | * and enforcement for clang's enum_extensibility extensions. The primary goal | ||
| 189 | * of these macros is to allow you to define an enum and specify its width in a | ||
| 190 | * single statement, and for plain C that is accomplished by defining an | ||
| 191 | * anonymous enum and then separately typedef'ing the requested type name to the | ||
| 192 | * requested underlying integer type. So the type emitted actually has no | ||
| 193 | * relationship at all to the enum, and therefore while the compiler could | ||
| 194 | * enforce enum extensibility if you used the enum type, it cannot do so if you | ||
| 195 | * use the "_t" type resulting from this expression. | ||
| 196 | * | ||
| 197 | * But we still define a named enum type and decorate it appropriately for you, | ||
| 198 | * so if you really want the enum extensibility enforcement, you can use the | ||
| 199 | * enum type yourself, i.e. when compiling with a C compiler: | ||
| 200 | * | ||
| 201 | * OS_CLOSED_ENUM(my_type, uint64_t, | ||
| 202 | * FOO, | ||
| 203 | * BAR, | ||
| 204 | * BAZ, | ||
| 205 | * ); | ||
| 206 | * | ||
| 207 | * my_type_t mt = 98; // legal | ||
| 208 | * enum my_type emt = 98; // illegal | ||
| 209 | * | ||
| 210 | * But be aware that the underlying enum type's width is subject only to the C | ||
| 211 | * language's guarantees -- namely that it will be compatible with int, char, | ||
| 212 | * and unsigned char. It is not safe to rely on the size of this type. | ||
| 213 | * | ||
| 214 | * When compiling in ObjC or C++, both of the above assignments are illegal. | ||
| 215 | */ | ||
| 216 | #define __OS_ENUM_C_FALLBACK(_name, _type, ...) \ | ||
| 217 | 	typedef _type _name##_t; enum _name { __VA_ARGS__ } | ||
| 218 | |||
| 219 | #define OS_ENUM(_name, _type, ...) \ | ||
| 220 | 	typedef _type _name##_t; enum { __VA_ARGS__ } | ||
| 221 | #define OS_CLOSED_ENUM(_name, _type, ...) \ | ||
| 222 | 	__OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ | ||
| 223 | 	__OS_ENUM_ATTR_CLOSED | ||
| 224 | #define OS_OPTIONS(_name, _type, ...) \ | ||
| 225 | 	__OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ | ||
| 226 | 	__OS_ENUM_ATTR __OS_OPTIONS_ATTR | ||
| 227 | #define OS_CLOSED_OPTIONS(_name, _type, ...) \ | ||
| 228 | 	__OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ | ||
| 229 | 	__OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR | ||
| 230 | #endif // __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) | ||
| 231 | |||
| 232 | #if __has_feature(attribute_availability_swift) | ||
| 233 | // equivalent to __SWIFT_UNAVAILABLE from Availability.h | ||
| 234 | #define OS_SWIFT_UNAVAILABLE(_msg) \ | ||
| 235 | 	__attribute__((__availability__(swift, unavailable, message=_msg))) | ||
| 236 | #else | ||
| 237 | #define OS_SWIFT_UNAVAILABLE(_msg) | ||
| 238 | #endif | ||
| 239 | |||
| 240 | #if __has_attribute(swift_private) | ||
| 241 | # define OS_REFINED_FOR_SWIFT __attribute__((__swift_private__)) | ||
| 242 | #else | ||
| 243 | # define OS_REFINED_FOR_SWIFT | ||
| 244 | #endif | ||
| 245 | |||
| 246 | #if __has_attribute(swift_name) | ||
| 247 | # define OS_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name))) | ||
| 248 | #else | ||
| 249 | # define OS_SWIFT_NAME(_name) | ||
| 250 | #endif | ||
| 251 | |||
| 252 | #define __OS_STRINGIFY(s) #s | ||
| 253 | #define OS_STRINGIFY(s) __OS_STRINGIFY(s) | ||
| 254 | #define __OS_CONCAT(x, y) x ## y | ||
| 255 | #define OS_CONCAT(x, y) __OS_CONCAT(x, y) | ||
| 256 | |||
| 257 | #ifdef __GNUC__ | ||
| 258 | #define os_prevent_tail_call_optimization() __asm__("") | ||
| 259 | #define os_is_compile_time_constant(expr) __builtin_constant_p(expr) | ||
| 260 | #define os_compiler_barrier() __asm__ __volatile__("" ::: "memory") | ||
| 261 | #else | ||
| 262 | #define os_prevent_tail_call_optimization() do { } while (0) | ||
| 263 | #define os_is_compile_time_constant(expr) 0 | ||
| 264 | #define os_compiler_barrier() do { } while (0) | ||
| 265 | #endif | ||
| 266 | |||
| 267 | #if __has_attribute(not_tail_called) | ||
| 268 | #define OS_NOT_TAIL_CALLED __attribute__((__not_tail_called__)) | ||
| 269 | #else | ||
| 270 | #define OS_NOT_TAIL_CALLED | ||
| 271 | #endif | ||
| 272 | |||
| 273 | |||
| 274 | typedef void (*os_function_t)(void *_Nullable); | ||
| 275 | |||
| 276 | #ifdef __BLOCKS__ | ||
| 277 | /*! | ||
| 278 | * @typedef os_block_t | ||
| 279 | * | ||
| 280 | * @abstract | ||
| 281 | * Generic type for a block taking no arguments and returning no value. | ||
| 282 | * | ||
| 283 | * @discussion | ||
| 284 | * When not building with Objective-C ARC, a block object allocated on or | ||
| 285 | * copied to the heap must be released with a -[release] message or the | ||
| 286 | * Block_release() function. | ||
| 287 | * | ||
| 288 | * The declaration of a block literal allocates storage on the stack. | ||
| 289 | * Therefore, this is an invalid construct: | ||
| 290 | * <code> | ||
| 291 | * os_block_t block; | ||
| 292 | * if (x) { | ||
| 293 | * block = ^{ printf("true\n"); }; | ||
| 294 | * } else { | ||
| 295 | * block = ^{ printf("false\n"); }; | ||
| 296 | * } | ||
| 297 | * block(); // unsafe!!! | ||
| 298 | * </code> | ||
| 299 | * | ||
| 300 | * What is happening behind the scenes: | ||
| 301 | * <code> | ||
| 302 | * if (x) { | ||
| 303 | * struct Block __tmp_1 = ...; // setup details | ||
| 304 | * block = &__tmp_1; | ||
| 305 | * } else { | ||
| 306 | * struct Block __tmp_2 = ...; // setup details | ||
| 307 | * block = &__tmp_2; | ||
| 308 | * } | ||
| 309 | * </code> | ||
| 310 | * | ||
| 311 | * As the example demonstrates, the address of a stack variable is escaping the | ||
| 312 | * scope in which it is allocated. That is a classic C bug. | ||
| 313 | * | ||
| 314 | * Instead, the block literal must be copied to the heap with the Block_copy() | ||
| 315 | * function or by sending it a -[copy] message. | ||
| 316 | */ | ||
| 317 | typedef void (^os_block_t)(void); | ||
| 318 | #endif | ||
| 319 | |||
| 320 | |||
| 321 | |||
| 322 | #endif // __OS_BASE__ | ||
lib/libc/include/x86_64-macos-gnu/os/clock.h created+18| ... | @@ -0,0 +1,18 @@ | ||
| 1 | #ifndef __OS_CLOCK__ | ||
| 2 | #define __OS_CLOCK__ | ||
| 3 | |||
| 4 | #include <os/base.h> | ||
| 5 | #include <stdint.h> | ||
| 6 | |||
| 7 | /* | ||
| 8 | * @typedef os_clockid_t | ||
| 9 | * | ||
| 10 | * @abstract | ||
| 11 | * Describes the kind of clock that the workgroup timestamp parameters are | ||
| 12 | * specified in | ||
| 13 | */ | ||
| 14 | OS_ENUM(os_clockid, uint32_t, | ||
| 15 | 		OS_CLOCK_MACH_ABSOLUTE_TIME = 32, | ||
| 16 | ); | ||
| 17 | |||
| 18 | #endif /* __OS_CLOCK__ */ | ||
lib/libc/include/x86_64-macos-gnu/os/lock.h created+189| ... | @@ -0,0 +1,189 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2016 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_LOCK__ | ||
| 22 | #define __OS_LOCK__ | ||
| 23 | |||
| 24 | #include <Availability.h> | ||
| 25 | #include <sys/cdefs.h> | ||
| 26 | #include <stddef.h> | ||
| 27 | #include <stdint.h> | ||
| 28 | #include <stdbool.h> | ||
| 29 | #include <os/base.h> | ||
| 30 | |||
| 31 | OS_ASSUME_NONNULL_BEGIN | ||
| 32 | |||
| 33 | /*! @header | ||
| 34 | * Low-level lock API. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #define OS_LOCK_API_VERSION 20160309 | ||
| 38 | |||
| 39 | __BEGIN_DECLS | ||
| 40 | |||
| 41 | #define OS_UNFAIR_LOCK_AVAILABILITY \ | ||
| 42 | 		__API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) | ||
| 43 | |||
| 44 | /*! | ||
| 45 | * @typedef os_unfair_lock | ||
| 46 | * | ||
| 47 | * @abstract | ||
| 48 | * Low-level lock that allows waiters to block efficiently on contention. | ||
| 49 | * | ||
| 50 | * In general, higher level synchronization primitives such as those provided by | ||
| 51 | * the pthread or dispatch subsystems should be preferred. | ||
| 52 | * | ||
| 53 | * The values stored in the lock should be considered opaque and implementation | ||
| 54 | * defined, they contain thread ownership information that the system may use | ||
| 55 | * to attempt to resolve priority inversions. | ||
| 56 | * | ||
| 57 | * This lock must be unlocked from the same thread that locked it, attempts to | ||
| 58 | * unlock from a different thread will cause an assertion aborting the process. | ||
| 59 | * | ||
| 60 | * This lock must not be accessed from multiple processes or threads via shared | ||
| 61 | * or multiply-mapped memory, the lock implementation relies on the address of | ||
| 62 | * the lock value and owning process. | ||
| 63 | * | ||
| 64 | * Must be initialized with OS_UNFAIR_LOCK_INIT | ||
| 65 | * | ||
| 66 | * @discussion | ||
| 67 | * Replacement for the deprecated OSSpinLock. Does not spin on contention but | ||
| 68 | * waits in the kernel to be woken up by an unlock. | ||
| 69 | * | ||
| 70 | * As with OSSpinLock there is no attempt at fairness or lock ordering, e.g. an | ||
| 71 | * unlocker can potentially immediately reacquire the lock before a woken up | ||
| 72 | * waiter gets an opportunity to attempt to acquire the lock. This may be | ||
| 73 | * advantageous for performance reasons, but also makes starvation of waiters a | ||
| 74 | * possibility. | ||
| 75 | */ | ||
| 76 | OS_UNFAIR_LOCK_AVAILABILITY | ||
| 77 | typedef struct os_unfair_lock_s { | ||
| 78 | 	uint32_t _os_unfair_lock_opaque; | ||
| 79 | } os_unfair_lock, *os_unfair_lock_t; | ||
| 80 | |||
| 81 | #ifndef OS_UNFAIR_LOCK_INIT | ||
| 82 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | ||
| 83 | #define OS_UNFAIR_LOCK_INIT ((os_unfair_lock){0}) | ||
| 84 | #elif defined(__cplusplus) && __cplusplus >= 201103L | ||
| 85 | #define OS_UNFAIR_LOCK_INIT (os_unfair_lock{}) | ||
| 86 | #elif defined(__cplusplus) | ||
| 87 | #define OS_UNFAIR_LOCK_INIT (os_unfair_lock()) | ||
| 88 | #else | ||
| 89 | #define OS_UNFAIR_LOCK_INIT {0} | ||
| 90 | #endif | ||
| 91 | #endif // OS_UNFAIR_LOCK_INIT | ||
| 92 | |||
| 93 | /*! | ||
| 94 | * @function os_unfair_lock_lock | ||
| 95 | * | ||
| 96 | * @abstract | ||
| 97 | * Locks an os_unfair_lock. | ||
| 98 | * | ||
| 99 | * @param lock | ||
| 100 | * Pointer to an os_unfair_lock. | ||
| 101 | */ | ||
| 102 | OS_UNFAIR_LOCK_AVAILABILITY | ||
| 103 | OS_EXPORT OS_NOTHROW OS_NONNULL_ALL | ||
| 104 | void os_unfair_lock_lock(os_unfair_lock_t lock); | ||
| 105 | |||
| 106 | /*! | ||
| 107 | * @function os_unfair_lock_trylock | ||
| 108 | * | ||
| 109 | * @abstract | ||
| 110 | * Locks an os_unfair_lock if it is not already locked. | ||
| 111 | * | ||
| 112 | * @discussion | ||
| 113 | * It is invalid to surround this function with a retry loop, if this function | ||
| 114 | * returns false, the program must be able to proceed without having acquired | ||
| 115 | * the lock, or it must call os_unfair_lock_lock() directly (a retry loop around | ||
| 116 | * os_unfair_lock_trylock() amounts to an inefficient implementation of | ||
| 117 | * os_unfair_lock_lock() that hides the lock waiter from the system and prevents | ||
| 118 | * resolution of priority inversions). | ||
| 119 | * | ||
| 120 | * @param lock | ||
| 121 | * Pointer to an os_unfair_lock. | ||
| 122 | * | ||
| 123 | * @result | ||
| 124 | * Returns true if the lock was succesfully locked and false if the lock was | ||
| 125 | * already locked. | ||
| 126 | */ | ||
| 127 | OS_UNFAIR_LOCK_AVAILABILITY | ||
| 128 | OS_EXPORT OS_NOTHROW OS_WARN_RESULT OS_NONNULL_ALL | ||
| 129 | bool os_unfair_lock_trylock(os_unfair_lock_t lock); | ||
| 130 | |||
| 131 | /*! | ||
| 132 | * @function os_unfair_lock_unlock | ||
| 133 | * | ||
| 134 | * @abstract | ||
| 135 | * Unlocks an os_unfair_lock. | ||
| 136 | * | ||
| 137 | * @param lock | ||
| 138 | * Pointer to an os_unfair_lock. | ||
| 139 | */ | ||
| 140 | OS_UNFAIR_LOCK_AVAILABILITY | ||
| 141 | OS_EXPORT OS_NOTHROW OS_NONNULL_ALL | ||
| 142 | void os_unfair_lock_unlock(os_unfair_lock_t lock); | ||
| 143 | |||
| 144 | /*! | ||
| 145 | * @function os_unfair_lock_assert_owner | ||
| 146 | * | ||
| 147 | * @abstract | ||
| 148 | * Asserts that the calling thread is the current owner of the specified | ||
| 149 | * unfair lock. | ||
| 150 | * | ||
| 151 | * @discussion | ||
| 152 | * If the lock is currently owned by the calling thread, this function returns. | ||
| 153 | * | ||
| 154 | * If the lock is unlocked or owned by a different thread, this function | ||
| 155 | * asserts and terminates the process. | ||
| 156 | * | ||
| 157 | * @param lock | ||
| 158 | * Pointer to an os_unfair_lock. | ||
| 159 | */ | ||
| 160 | OS_UNFAIR_LOCK_AVAILABILITY | ||
| 161 | OS_EXPORT OS_NOTHROW OS_NONNULL_ALL | ||
| 162 | void os_unfair_lock_assert_owner(os_unfair_lock_t lock); | ||
| 163 | |||
| 164 | /*! | ||
| 165 | * @function os_unfair_lock_assert_not_owner | ||
| 166 | * | ||
| 167 | * @abstract | ||
| 168 | * Asserts that the calling thread is not the current owner of the specified | ||
| 169 | * unfair lock. | ||
| 170 | * | ||
| 171 | * @discussion | ||
| 172 | * If the lock is unlocked or owned by a different thread, this function | ||
| 173 | * returns. | ||
| 174 | * | ||
| 175 | * If the lock is currently owned by the current thread, this function asserts | ||
| 176 | * and terminates the process. | ||
| 177 | * | ||
| 178 | * @param lock | ||
| 179 | * Pointer to an os_unfair_lock. | ||
| 180 | */ | ||
| 181 | OS_UNFAIR_LOCK_AVAILABILITY | ||
| 182 | OS_EXPORT OS_NOTHROW OS_NONNULL_ALL | ||
| 183 | void os_unfair_lock_assert_not_owner(os_unfair_lock_t lock); | ||
| 184 | |||
| 185 | __END_DECLS | ||
| 186 | |||
| 187 | OS_ASSUME_NONNULL_END | ||
| 188 | |||
| 189 | #endif // __OS_LOCK__ | ||
lib/libc/include/x86_64-macos-gnu/os/object.h created+303| ... | @@ -0,0 +1,303 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2011-2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_OBJECT__ | ||
| 22 | #define __OS_OBJECT__ | ||
| 23 | |||
| 24 | #ifdef __APPLE__ | ||
| 25 | #include <Availability.h> | ||
| 26 | #include <os/availability.h> | ||
| 27 | #include <TargetConditionals.h> | ||
| 28 | #include <os/base.h> | ||
| 29 | #elif defined(_WIN32) | ||
| 30 | #include <os/generic_win_base.h> | ||
| 31 | #elif defined(__unix__) | ||
| 32 | #include <os/generic_unix_base.h> | ||
| 33 | #endif | ||
| 34 | |||
| 35 | /*! | ||
| 36 | * @header | ||
| 37 | * | ||
| 38 | * @preprocinfo | ||
| 39 | * By default, libSystem objects such as GCD and XPC objects are declared as | ||
| 40 | * Objective-C types when building with an Objective-C compiler. This allows | ||
| 41 | * them to participate in ARC, in RR management by the Blocks runtime and in | ||
| 42 | * leaks checking by the static analyzer, and enables them to be added to Cocoa | ||
| 43 | * collections. | ||
| 44 | * | ||
| 45 | * NOTE: this requires explicit cancellation of dispatch sources and xpc | ||
| 46 | * connections whose handler blocks capture the source/connection object, | ||
| 47 | * resp. ensuring that such captures do not form retain cycles (e.g. by | ||
| 48 | * declaring the source as __weak). | ||
| 49 | * | ||
| 50 | * To opt-out of this default behavior, add -DOS_OBJECT_USE_OBJC=0 to your | ||
| 51 | * compiler flags. | ||
| 52 | * | ||
| 53 | * This mode requires a platform with the modern Objective-C runtime, the | ||
| 54 | * Objective-C GC compiler option to be disabled, and at least a Mac OS X 10.8 | ||
| 55 | * or iOS 6.0 deployment target. | ||
| 56 | */ | ||
| 57 | |||
| 58 | #ifndef OS_OBJECT_HAVE_OBJC_SUPPORT | ||
| 59 | #if !defined(__OBJC__) || defined(__OBJC_GC__) | ||
| 60 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 0 | ||
| 61 | #elif !defined(TARGET_OS_MAC) || !TARGET_OS_MAC | ||
| 62 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 0 | ||
| 63 | #elif TARGET_OS_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 | ||
| 64 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 0 | ||
| 65 | #elif TARGET_OS_MAC && !TARGET_OS_IPHONE | ||
| 66 | # if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 | ||
| 67 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 0 | ||
| 68 | # elif defined(__i386__) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_12 | ||
| 69 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 0 | ||
| 70 | # else | ||
| 71 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 1 | ||
| 72 | # endif | ||
| 73 | #else | ||
| 74 | # define OS_OBJECT_HAVE_OBJC_SUPPORT 1 | ||
| 75 | #endif | ||
| 76 | #endif // OS_OBJECT_HAVE_OBJC_SUPPORT | ||
| 77 | |||
| 78 | #if OS_OBJECT_HAVE_OBJC_SUPPORT | ||
| 79 | #if defined(__swift__) && __swift__ && !OS_OBJECT_USE_OBJC | ||
| 80 | #define OS_OBJECT_USE_OBJC 1 | ||
| 81 | #endif | ||
| 82 | #ifndef OS_OBJECT_USE_OBJC | ||
| 83 | #define OS_OBJECT_USE_OBJC 1 | ||
| 84 | #endif | ||
| 85 | #elif defined(OS_OBJECT_USE_OBJC) && OS_OBJECT_USE_OBJC | ||
| 86 | /* Unsupported platform for OS_OBJECT_USE_OBJC=1 */ | ||
| 87 | #undef OS_OBJECT_USE_OBJC | ||
| 88 | #define OS_OBJECT_USE_OBJC 0 | ||
| 89 | #else | ||
| 90 | #define OS_OBJECT_USE_OBJC 0 | ||
| 91 | #endif | ||
| 92 | |||
| 93 | #ifndef OS_OBJECT_SWIFT3 | ||
| 94 | #ifdef __swift__ | ||
| 95 | #define OS_OBJECT_SWIFT3 1 | ||
| 96 | #else // __swift__ | ||
| 97 | #define OS_OBJECT_SWIFT3 0 | ||
| 98 | #endif // __swift__ | ||
| 99 | #endif // OS_OBJECT_SWIFT3 | ||
| 100 | |||
| 101 | #if __has_feature(assume_nonnull) | ||
| 102 | #define OS_OBJECT_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") | ||
| 103 | #define OS_OBJECT_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") | ||
| 104 | #else | ||
| 105 | #define OS_OBJECT_ASSUME_NONNULL_BEGIN | ||
| 106 | #define OS_OBJECT_ASSUME_NONNULL_END | ||
| 107 | #endif | ||
| 108 | #define OS_OBJECT_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) | ||
| 109 | |||
| 110 | #if OS_OBJECT_USE_OBJC | ||
| 111 | #import <objc/NSObject.h> | ||
| 112 | #if __has_attribute(objc_independent_class) | ||
| 113 | #define OS_OBJC_INDEPENDENT_CLASS __attribute__((objc_independent_class)) | ||
| 114 | #endif // __has_attribute(objc_independent_class) | ||
| 115 | #ifndef OS_OBJC_INDEPENDENT_CLASS | ||
| 116 | #define OS_OBJC_INDEPENDENT_CLASS | ||
| 117 | #endif | ||
| 118 | #define OS_OBJECT_CLASS(name) OS_##name | ||
| 119 | #define OS_OBJECT_DECL_PROTOCOL(name, ...) \ | ||
| 120 | 		@protocol OS_OBJECT_CLASS(name) __VA_ARGS__ \ | ||
| 121 | 		@end | ||
| 122 | #define OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL_IMPL(name, proto) \ | ||
| 123 | 		@interface name () <proto> \ | ||
| 124 | 		@end | ||
| 125 | #define OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, proto) \ | ||
| 126 | 		OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL_IMPL( \ | ||
| 127 | 				OS_OBJECT_CLASS(name), OS_OBJECT_CLASS(proto)) | ||
| 128 | #define OS_OBJECT_DECL_IMPL(name, adhere, ...) \ | ||
| 129 | 		OS_OBJECT_DECL_PROTOCOL(name, __VA_ARGS__) \ | ||
| 130 | 		typedef adhere<OS_OBJECT_CLASS(name)> \ | ||
| 131 | 				* OS_OBJC_INDEPENDENT_CLASS name##_t | ||
| 132 | #define OS_OBJECT_DECL_BASE(name, ...) \ | ||
| 133 | 		@interface OS_OBJECT_CLASS(name) : __VA_ARGS__ \ | ||
| 134 | 		- (instancetype)init OS_SWIFT_UNAVAILABLE("Unavailable in Swift"); \ | ||
| 135 | 		@end | ||
| 136 | #define OS_OBJECT_DECL_IMPL_CLASS(name, ...) \ | ||
| 137 | 		OS_OBJECT_DECL_BASE(name, ## __VA_ARGS__) \ | ||
| 138 | 		typedef OS_OBJECT_CLASS(name) \ | ||
| 139 | 				* OS_OBJC_INDEPENDENT_CLASS name##_t | ||
| 140 | #define OS_OBJECT_DECL(name, ...) \ | ||
| 141 | 		OS_OBJECT_DECL_IMPL(name, NSObject, <NSObject>) | ||
| 142 | #define OS_OBJECT_DECL_SUBCLASS(name, super) \ | ||
| 143 | 		OS_OBJECT_DECL_IMPL(name, NSObject, <OS_OBJECT_CLASS(super)>) | ||
| 144 | #if __has_attribute(ns_returns_retained) | ||
| 145 | #define OS_OBJECT_RETURNS_RETAINED __attribute__((__ns_returns_retained__)) | ||
| 146 | #else | ||
| 147 | #define OS_OBJECT_RETURNS_RETAINED | ||
| 148 | #endif | ||
| 149 | #if __has_attribute(ns_consumed) | ||
| 150 | #define OS_OBJECT_CONSUMED __attribute__((__ns_consumed__)) | ||
| 151 | #else | ||
| 152 | #define OS_OBJECT_CONSUMED | ||
| 153 | #endif | ||
| 154 | #if __has_feature(objc_arc) | ||
| 155 | #define OS_OBJECT_BRIDGE __bridge | ||
| 156 | #define OS_WARN_RESULT_NEEDS_RELEASE | ||
| 157 | #else | ||
| 158 | #define OS_OBJECT_BRIDGE | ||
| 159 | #define OS_WARN_RESULT_NEEDS_RELEASE OS_WARN_RESULT | ||
| 160 | #endif | ||
| 161 | |||
| 162 | |||
| 163 | #if __has_attribute(objc_runtime_visible) && \ | ||
| 164 | 		((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ | ||
| 165 | 		__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_12) || \ | ||
| 166 | 		(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \ | ||
| 167 | 		!defined(__TV_OS_VERSION_MIN_REQUIRED) && \ | ||
| 168 | 		!defined(__WATCH_OS_VERSION_MIN_REQUIRED) && \ | ||
| 169 | 		__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0) || \ | ||
| 170 | 		(defined(__TV_OS_VERSION_MIN_REQUIRED) && \ | ||
| 171 | 		__TV_OS_VERSION_MIN_REQUIRED < __TVOS_10_0) || \ | ||
| 172 | 		(defined(__WATCH_OS_VERSION_MIN_REQUIRED) && \ | ||
| 173 | 		__WATCH_OS_VERSION_MIN_REQUIRED < __WATCHOS_3_0)) | ||
| 174 | /* | ||
| 175 | * To provide backward deployment of ObjC objects in Swift on pre-10.12 | ||
| 176 | * SDKs, OS_object classes can be marked as OS_OBJECT_OBJC_RUNTIME_VISIBLE. | ||
| 177 | * When compiling with a deployment target earlier than OS X 10.12 (iOS 10.0, | ||
| 178 | * tvOS 10.0, watchOS 3.0) the Swift compiler will only refer to this type at | ||
| 179 | * runtime (using the ObjC runtime). | ||
| 180 | */ | ||
| 181 | #define OS_OBJECT_OBJC_RUNTIME_VISIBLE __attribute__((objc_runtime_visible)) | ||
| 182 | #else | ||
| 183 | #define OS_OBJECT_OBJC_RUNTIME_VISIBLE | ||
| 184 | #endif | ||
| 185 | #ifndef OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 186 | #if defined(__clang_analyzer__) | ||
| 187 | #define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 1 | ||
| 188 | #elif __has_feature(objc_arc) && !OS_OBJECT_SWIFT3 | ||
| 189 | #define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 1 | ||
| 190 | #else | ||
| 191 | #define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 0 | ||
| 192 | #endif | ||
| 193 | #endif | ||
| 194 | #if OS_OBJECT_SWIFT3 | ||
| 195 | #define OS_OBJECT_DECL_SWIFT(name) \ | ||
| 196 | 		OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ | ||
| 197 | 		OS_OBJECT_DECL_IMPL_CLASS(name, NSObject) | ||
| 198 | #define OS_OBJECT_DECL_SUBCLASS_SWIFT(name, super) \ | ||
| 199 | 		OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ | ||
| 200 | 		OS_OBJECT_DECL_IMPL_CLASS(name, OS_OBJECT_CLASS(super)) | ||
| 201 | #endif // OS_OBJECT_SWIFT3 | ||
| 202 | OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE | ||
| 203 | OS_OBJECT_DECL_BASE(object, NSObject); | ||
| 204 | #else | ||
| 205 | /*! @parseOnly */ | ||
| 206 | #define OS_OBJECT_RETURNS_RETAINED | ||
| 207 | /*! @parseOnly */ | ||
| 208 | #define OS_OBJECT_CONSUMED | ||
| 209 | /*! @parseOnly */ | ||
| 210 | #define OS_OBJECT_BRIDGE | ||
| 211 | /*! @parseOnly */ | ||
| 212 | #define OS_WARN_RESULT_NEEDS_RELEASE OS_WARN_RESULT | ||
| 213 | /*! @parseOnly */ | ||
| 214 | #define OS_OBJECT_OBJC_RUNTIME_VISIBLE | ||
| 215 | #define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 0 | ||
| 216 | #endif | ||
| 217 | |||
| 218 | #if OS_OBJECT_SWIFT3 | ||
| 219 | #define OS_OBJECT_DECL_CLASS(name) \ | ||
| 220 | 		OS_OBJECT_DECL_SUBCLASS_SWIFT(name, object) | ||
| 221 | #elif OS_OBJECT_USE_OBJC | ||
| 222 | #define OS_OBJECT_DECL_CLASS(name) \ | ||
| 223 | 		OS_OBJECT_DECL(name) | ||
| 224 | #else | ||
| 225 | #define OS_OBJECT_DECL_CLASS(name) \ | ||
| 226 | 		typedef struct name##_s *name##_t | ||
| 227 | #endif | ||
| 228 | |||
| 229 | #if OS_OBJECT_USE_OBJC | ||
| 230 | /* Declares a class of the specific name and exposes the interface and typedefs | ||
| 231 | * name##_t to the pointer to the class */ | ||
| 232 | #define OS_OBJECT_SHOW_CLASS(name, ...) \ | ||
| 233 | 		OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ | ||
| 234 | 		OS_OBJECT_DECL_IMPL_CLASS(name, ## __VA_ARGS__ ) | ||
| 235 | /* Declares a subclass of the same name, and | ||
| 236 | * subclass adheres to protocol specified. Typedefs baseclass<proto> * to subclass##_t */ | ||
| 237 | #define OS_OBJECT_SHOW_SUBCLASS(subclass_name, super, proto_name) \ | ||
| 238 | 		OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ | ||
| 239 | 		OS_OBJECT_DECL_BASE(subclass_name, OS_OBJECT_CLASS(super)<OS_OBJECT_CLASS(proto_name)>); \ | ||
| 240 | 		typedef OS_OBJECT_CLASS(super)<OS_OBJECT_CLASS(proto_name)> \ | ||
| 241 | 				* OS_OBJC_INDEPENDENT_CLASS subclass_name##_t | ||
| 242 | #else /* Plain C */ | ||
| 243 | #define OS_OBJECT_DECL_PROTOCOL(name, ...) | ||
| 244 | #define OS_OBJECT_SHOW_CLASS(name, ...) \ | ||
| 245 | 		typedef struct name##_s *name##_t | ||
| 246 | #define OS_OBJECT_SHOW_SUBCLASS(name, super, ...) \ | ||
| 247 | 		typedef super##_t name##_t | ||
| 248 | #endif | ||
| 249 | |||
| 250 | #define OS_OBJECT_GLOBAL_OBJECT(type, object) ((OS_OBJECT_BRIDGE type)&(object)) | ||
| 251 | |||
| 252 | __BEGIN_DECLS | ||
| 253 | |||
| 254 | /*! | ||
| 255 | * @function os_retain | ||
| 256 | * | ||
| 257 | * @abstract | ||
| 258 | * Increment the reference count of an os_object. | ||
| 259 | * | ||
| 260 | * @discussion | ||
| 261 | * On a platform with the modern Objective-C runtime this is exactly equivalent | ||
| 262 | * to sending the object the -[retain] message. | ||
| 263 | * | ||
| 264 | * @param object | ||
| 265 | * The object to retain. | ||
| 266 | * | ||
| 267 | * @result | ||
| 268 | * The retained object. | ||
| 269 | */ | ||
| 270 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 271 | OS_EXPORT OS_SWIFT_UNAVAILABLE("Can't be used with ARC") | ||
| 272 | void* | ||
| 273 | os_retain(void *object); | ||
| 274 | #if OS_OBJECT_USE_OBJC | ||
| 275 | #undef os_retain | ||
| 276 | #define os_retain(object) [object retain] | ||
| 277 | #endif | ||
| 278 | |||
| 279 | /*! | ||
| 280 | * @function os_release | ||
| 281 | * | ||
| 282 | * @abstract | ||
| 283 | * Decrement the reference count of a os_object. | ||
| 284 | * | ||
| 285 | * @discussion | ||
| 286 | * On a platform with the modern Objective-C runtime this is exactly equivalent | ||
| 287 | * to sending the object the -[release] message. | ||
| 288 | * | ||
| 289 | * @param object | ||
| 290 | * The object to release. | ||
| 291 | */ | ||
| 292 | API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 293 | OS_EXPORT | ||
| 294 | void OS_SWIFT_UNAVAILABLE("Can't be used with ARC") | ||
| 295 | os_release(void *object); | ||
| 296 | #if OS_OBJECT_USE_OBJC | ||
| 297 | #undef os_release | ||
| 298 | #define os_release(object) [object release] | ||
| 299 | #endif | ||
| 300 | |||
| 301 | __END_DECLS | ||
| 302 | |||
| 303 | #endif | ||
lib/libc/include/x86_64-macos-gnu/os/workgroup.h created+37| ... | @@ -0,0 +1,37 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_WORKGROUP__ | ||
| 22 | #define __OS_WORKGROUP__ | ||
| 23 | |||
| 24 | #ifndef __DISPATCH_BUILDING_DISPATCH__ | ||
| 25 | #ifndef __OS_WORKGROUP_INDIRECT__ | ||
| 26 | #define __OS_WORKGROUP_INDIRECT__ | ||
| 27 | #endif /* __OS_WORKGROUP_INDIRECT__ */ | ||
| 28 | |||
| 29 | #include <os/workgroup_base.h> | ||
| 30 | #include <os/workgroup_object.h> | ||
| 31 | #include <os/workgroup_interval.h> | ||
| 32 | #include <os/workgroup_parallel.h> | ||
| 33 | |||
| 34 | #undef __OS_WORKGROUP_INDIRECT__ | ||
| 35 | #endif /* __DISPATCH_BUILDING_DISPATCH__ */ | ||
| 36 | |||
| 37 | #endif /* __OS_WORKGROUP__ */ | ||
lib/libc/include/x86_64-macos-gnu/os/workgroup_base.h created+78| ... | @@ -0,0 +1,78 @@ | ||
| 1 | #ifndef __OS_WORKGROUP_BASE__ | ||
| 2 | #define __OS_WORKGROUP_BASE__ | ||
| 3 | |||
| 4 | #ifndef __OS_WORKGROUP_INDIRECT__ | ||
| 5 | #error "Please #include <os/workgroup.h> instead of this file directly." | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #include <sys/types.h> | ||
| 9 | #include <stddef.h> | ||
| 10 | #include <stdint.h> | ||
| 11 | #include <stdbool.h> | ||
| 12 | #include <string.h> | ||
| 13 | #include <stdlib.h> | ||
| 14 | |||
| 15 | #include <mach/port.h> | ||
| 16 | |||
| 17 | #include <Availability.h> | ||
| 18 | #include <os/base.h> | ||
| 19 | #include <os/object.h> | ||
| 20 | #include <os/clock.h> | ||
| 21 | |||
| 22 | #if __has_feature(assume_nonnull) | ||
| 23 | #define OS_WORKGROUP_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") | ||
| 24 | #define OS_WORKGROUP_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") | ||
| 25 | #else | ||
| 26 | #define OS_WORKGROUP_ASSUME_NONNULL_BEGIN | ||
| 27 | #define OS_WORKGROUP_ASSUME_NONNULL_END | ||
| 28 | #endif | ||
| 29 | #define OS_WORKGROUP_WARN_RESULT __attribute__((__warn_unused_result__)) | ||
| 30 | #define OS_WORKGROUP_EXPORT OS_EXPORT | ||
| 31 | #define OS_WORKGROUP_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED | ||
| 32 | |||
| 33 | #define OS_WORKGROUP_DECL(name, swift_name) \ | ||
| 34 | 	OS_SWIFT_NAME(swift_name) \ | ||
| 35 | 	OS_OBJECT_SHOW_CLASS(name, OS_OBJECT_CLASS(object)) | ||
| 36 | |||
| 37 | #if OS_OBJECT_USE_OBJC | ||
| 38 | #define OS_WORKGROUP_SUBCLASS_DECL_PROTO(name, swift_name, ...) \ | ||
| 39 | 	OS_SWIFT_NAME(swift_name) \ | ||
| 40 | 	OS_OBJECT_DECL_PROTOCOL(name ## __VA_ARGS__ ) | ||
| 41 | #else | ||
| 42 | #define OS_WORKGROUP_SUBCLASS_DECL_PROTO(name, swift_name, ...) | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #define OS_WORKGROUP_SUBCLASS_DECL(name, super, swift_name, ...) \ | ||
| 46 | 	OS_SWIFT_NAME(swift_name) \ | ||
| 47 | 	OS_OBJECT_SHOW_SUBCLASS(name, super, name, ## __VA_ARGS__) | ||
| 48 | |||
| 49 | #if defined(__LP64__) | ||
| 50 | #define __OS_WORKGROUP_ATTR_SIZE__ 60 | ||
| 51 | #define __OS_WORKGROUP_INTERVAL_DATA_SIZE__ 56 | ||
| 52 | #define __OS_WORKGROUP_JOIN_TOKEN_SIZE__ 36 | ||
| 53 | #else | ||
| 54 | #define __OS_WORKGROUP_ATTR_SIZE__ 60 | ||
| 55 | #define __OS_WORKGROUP_INTERVAL_DATA_SIZE__ 56 | ||
| 56 | #define __OS_WORKGROUP_JOIN_TOKEN_SIZE__ 28 | ||
| 57 | #endif | ||
| 58 | |||
| 59 | #define _OS_WORKGROUP_ATTR_SIG_DEFAULT_INIT 0x2FA863B4 | ||
| 60 | #define _OS_WORKGROUP_ATTR_SIG_EMPTY_INIT 0x2FA863C4 | ||
| 61 | |||
| 62 | struct OS_REFINED_FOR_SWIFT os_workgroup_attr_opaque_s { | ||
| 63 | 	uint32_t sig; | ||
| 64 | 	char opaque[__OS_WORKGROUP_ATTR_SIZE__]; | ||
| 65 | }; | ||
| 66 | |||
| 67 | #define _OS_WORKGROUP_INTERVAL_DATA_SIG_INIT 0x52A74C4D | ||
| 68 | struct OS_REFINED_FOR_SWIFT os_workgroup_interval_data_opaque_s { | ||
| 69 | 	uint32_t sig; | ||
| 70 | 	char opaque[__OS_WORKGROUP_INTERVAL_DATA_SIZE__]; | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct OS_REFINED_FOR_SWIFT os_workgroup_join_token_opaque_s { | ||
| 74 | 	uint32_t sig; | ||
| 75 | 	char opaque[__OS_WORKGROUP_JOIN_TOKEN_SIZE__]; | ||
| 76 | }; | ||
| 77 | |||
| 78 | #endif /* __OS_WORKGROUP_BASE__ */ | ||
lib/libc/include/x86_64-macos-gnu/os/workgroup_interval.h created+155| ... | @@ -0,0 +1,155 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_WORKGROUP_INTERVAL__ | ||
| 22 | #define __OS_WORKGROUP_INTERVAL__ | ||
| 23 | |||
| 24 | #ifndef __OS_WORKGROUP_INDIRECT__ | ||
| 25 | #error "Please #include <os/workgroup.h> instead of this file directly." | ||
| 26 | #include <os/workgroup_base.h> // For header doc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | __BEGIN_DECLS | ||
| 30 | |||
| 31 | OS_WORKGROUP_ASSUME_NONNULL_BEGIN | ||
| 32 | |||
| 33 | /*! | ||
| 34 | * @typedef os_workgroup_interval_t | ||
| 35 | * | ||
| 36 | * @abstract | ||
| 37 | * A subclass of an os_workgroup_t for tracking work performed as part of | ||
| 38 | * a repeating interval-driven workload. | ||
| 39 | */ | ||
| 40 | OS_WORKGROUP_SUBCLASS_DECL_PROTO(os_workgroup_interval, Repeatable); | ||
| 41 | OS_WORKGROUP_SUBCLASS_DECL(os_workgroup_interval, os_workgroup, WorkGroupInterval); | ||
| 42 | |||
| 43 | /* During the first instance of this API, the only supported interval | ||
| 44 | * workgroups are for audio workloads. Please refer to the AudioToolbox | ||
| 45 | * framework for more information. | ||
| 46 | */ | ||
| 47 | |||
| 48 | /* | ||
| 49 | * @typedef os_workgroup_interval_data, os_workgroup_interval_data_t | ||
| 50 | * | ||
| 51 | * @abstract | ||
| 52 | * An opaque structure containing additional configuration for the workgroup | ||
| 53 | * interval. | ||
| 54 | */ | ||
| 55 | typedef struct os_workgroup_interval_data_opaque_s os_workgroup_interval_data_s; | ||
| 56 | typedef struct os_workgroup_interval_data_opaque_s *os_workgroup_interval_data_t; | ||
| 57 | #define OS_WORKGROUP_INTERVAL_DATA_INITIALIZER \ | ||
| 58 | 	{ .sig = _OS_WORKGROUP_INTERVAL_DATA_SIG_INIT } | ||
| 59 | |||
| 60 | /*! | ||
| 61 | * @function os_workgroup_interval_start | ||
| 62 | * | ||
| 63 | * @abstract | ||
| 64 | * Indicates to the system that the member threads of this | ||
| 65 | * os_workgroup_interval_t have begun working on an instance of the repeatable | ||
| 66 | * interval workload with the specified timestamps. This function is real time | ||
| 67 | * safe. | ||
| 68 | * | ||
| 69 | * This function will set and return an errno in the following cases: | ||
| 70 | * | ||
| 71 | * - The current thread is not a member of the os_workgroup_interval_t | ||
| 72 | * - The os_workgroup_interval_t has been cancelled | ||
| 73 | * - The timestamps passed in are malformed | ||
| 74 | * - os_workgroup_interval_start() was previously called on the | ||
| 75 | * os_workgroup_interval_t without an intervening os_workgroup_interval_finish() | ||
| 76 | * - A concurrent workgroup interval configuration operation is taking place. | ||
| 77 | * | ||
| 78 | * @param start | ||
| 79 | * Start timestamp specified in the os_clockid_t with which the | ||
| 80 | * os_workgroup_interval_t was created. This is generally a time in the past and | ||
| 81 | * indicates when the workgroup started working on an interval period | ||
| 82 | * | ||
| 83 | * @param deadline | ||
| 84 | * Deadline timestamp specified in the os_clockid_t with which the | ||
| 85 | * os_workgroup_interval_t was created. This specifies the deadline which the | ||
| 86 | * interval period would like to meet. | ||
| 87 | * | ||
| 88 | * @param data | ||
| 89 | * This field is currently unused and should be NULL | ||
| 90 | */ | ||
| 91 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 92 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT | ||
| 93 | int | ||
| 94 | os_workgroup_interval_start(os_workgroup_interval_t wg, uint64_t start, uint64_t | ||
| 95 | 		deadline, os_workgroup_interval_data_t _Nullable data); | ||
| 96 | |||
| 97 | /*! | ||
| 98 | * @function os_workgroup_interval_update | ||
| 99 | * | ||
| 100 | * @abstract | ||
| 101 | * Updates an already started interval workgroup to have the new | ||
| 102 | * deadline specified. This function is real time safe. | ||
| 103 | * | ||
| 104 | * This function will return an error in the following cases: | ||
| 105 | * - The current thread is not a member of the os_workgroup_interval_t | ||
| 106 | * - The os_workgroup_interval_t has been cancelled | ||
| 107 | * - The timestamp passed in is malformed | ||
| 108 | * - os_workgroup_interval_start() was not previously called on the | ||
| 109 | * os_workgroup_interval_t or was already matched with an | ||
| 110 | * os_workgroup_interval_finish() | ||
| 111 | * - A concurrent workgroup interval configuration operation is taking place | ||
| 112 | * | ||
| 113 | * @param deadline | ||
| 114 | * Timestamp specified in the os_clockid_t with | ||
| 115 | * which the os_workgroup_interval_t was created. | ||
| 116 | * | ||
| 117 | * @param data | ||
| 118 | * This field is currently unused and should be NULL | ||
| 119 | */ | ||
| 120 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 121 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT | ||
| 122 | int | ||
| 123 | os_workgroup_interval_update(os_workgroup_interval_t wg, uint64_t deadline, | ||
| 124 | 		os_workgroup_interval_data_t _Nullable data); | ||
| 125 | |||
| 126 | /*! | ||
| 127 | * @function os_workgroup_interval_finish | ||
| 128 | * | ||
| 129 | * @abstract | ||
| 130 | * Indicates to the system that the member threads of | ||
| 131 | * this os_workgroup_interval_t have finished working on the current instance | ||
| 132 | * of the interval workload. This function is real time safe. | ||
| 133 | * | ||
| 134 | * This function will return an error in the following cases: | ||
| 135 | * - The current thread is not a member of the os_workgroup_interval_t | ||
| 136 | * - os_workgroup_interval_start() was not previously called on the | ||
| 137 | * os_workgroup_interval_t or was already matched with an | ||
| 138 | * os_workgroup_interval_finish() | ||
| 139 | * - A concurrent workgroup interval configuration operation is taking place. | ||
| 140 | * | ||
| 141 | * @param data | ||
| 142 | * This field is currently unused and should be NULL | ||
| 143 | * | ||
| 144 | */ | ||
| 145 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 146 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT | ||
| 147 | int | ||
| 148 | os_workgroup_interval_finish(os_workgroup_interval_t wg, | ||
| 149 | 		os_workgroup_interval_data_t _Nullable data); | ||
| 150 | |||
| 151 | OS_WORKGROUP_ASSUME_NONNULL_END | ||
| 152 | |||
| 153 | __END_DECLS | ||
| 154 | |||
| 155 | #endif /* __OS_WORKGROUP_INTERVAL__ */ | ||
lib/libc/include/x86_64-macos-gnu/os/workgroup_object.h created+357| ... | @@ -0,0 +1,357 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_WORKGROUP_OBJECT__ | ||
| 22 | #define __OS_WORKGROUP_OBJECT__ | ||
| 23 | |||
| 24 | #ifndef __OS_WORKGROUP_INDIRECT__ | ||
| 25 | #error "Please #include <os/workgroup.h> instead of this file directly." | ||
| 26 | #include <os/workgroup_base.h> // For header doc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | __BEGIN_DECLS | ||
| 30 | |||
| 31 | OS_WORKGROUP_ASSUME_NONNULL_BEGIN | ||
| 32 | |||
| 33 | /*! | ||
| 34 | * @typedef os_workgroup_t | ||
| 35 | * | ||
| 36 | * @abstract | ||
| 37 | * A reference counted os object representing a workload that needs to | ||
| 38 | * be distinctly recognized and tracked by the system. The workgroup | ||
| 39 | * tracks a collection of threads all working cooperatively. An os_workgroup | ||
| 40 | * object - when not an instance of a specific os_workgroup_t subclass - | ||
| 41 | * represents a generic workload and makes no assumptions about the kind of | ||
| 42 | * work done. | ||
| 43 | * | ||
| 44 | * @discussion | ||
| 45 | * Threads can explicitly join an os_workgroup_t to mark themselves as | ||
| 46 | * participants in the workload. | ||
| 47 | */ | ||
| 48 | OS_WORKGROUP_DECL(os_workgroup, WorkGroup); | ||
| 49 | |||
| 50 | |||
| 51 | /* Attribute creation and specification */ | ||
| 52 | |||
| 53 | /*! | ||
| 54 | * @typedef os_workgroup_attr_t | ||
| 55 | * | ||
| 56 | * @abstract | ||
| 57 | * Pointer to an opaque structure for describing attributes that can be | ||
| 58 | * configured on a workgroup at creation. | ||
| 59 | */ | ||
| 60 | typedef struct os_workgroup_attr_opaque_s os_workgroup_attr_s; | ||
| 61 | typedef struct os_workgroup_attr_opaque_s *os_workgroup_attr_t; | ||
| 62 | |||
| 63 | /* os_workgroup_t attributes need to be initialized before use. This initializer | ||
| 64 | * allows you to create a workgroup with the system default attributes. */ | ||
| 65 | #define OS_WORKGROUP_ATTR_INITIALIZER_DEFAULT \ | ||
| 66 | 	{ .sig = _OS_WORKGROUP_ATTR_SIG_DEFAULT_INIT } | ||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | /* The main use of the workgroup API is through instantiations of the concrete | ||
| 71 | * subclasses - please refer to os/workgroup_interval.h and | ||
| 72 | * os/workgroup_parallel.h for more information on creating workgroups. | ||
| 73 | * | ||
| 74 | * The functions below operate on all subclasses of os_workgroup_t. | ||
| 75 | */ | ||
| 76 | |||
| 77 | /*! | ||
| 78 | * @function os_workgroup_copy_port | ||
| 79 | * | ||
| 80 | * @abstract | ||
| 81 | * Returns a reference to a send right representing this workgroup that is to be | ||
| 82 | * sent to other processes. This port is to be passed to | ||
| 83 | * os_workgroup_create_with_port() to create a workgroup object. | ||
| 84 | * | ||
| 85 | * It is the client's responsibility to release the send right reference. | ||
| 86 | * | ||
| 87 | * If an error is encountered, errno is set and returned. | ||
| 88 | */ | ||
| 89 | API_AVAILABLE(macos(11.0)) | ||
| 90 | API_UNAVAILABLE(ios, tvos, watchos) | ||
| 91 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT | ||
| 92 | int | ||
| 93 | os_workgroup_copy_port(os_workgroup_t wg, mach_port_t *mach_port_out); | ||
| 94 | |||
| 95 | /*! | ||
| 96 | * @function os_workgroup_create_with_port | ||
| 97 | * | ||
| 98 | * @abstract | ||
| 99 | * Create an os_workgroup_t object from a send right returned by a previous | ||
| 100 | * call to os_workgroup_copy_port, potentially in a different process. | ||
| 101 | * | ||
| 102 | * A newly created os_workgroup_t has no initial member threads - in particular | ||
| 103 | * the creating thread does not join the os_workgroup_t implicitly. | ||
| 104 | * | ||
| 105 | * @param name | ||
| 106 | * A client specified string for labelling the workgroup. This parameter is | ||
| 107 | * optional and can be NULL. | ||
| 108 | * | ||
| 109 | * @param mach_port | ||
| 110 | * The send right to create the workgroup from. No reference is consumed | ||
| 111 | * on the specified send right. | ||
| 112 | */ | ||
| 113 | API_AVAILABLE(macos(11.0)) | ||
| 114 | API_UNAVAILABLE(ios, tvos, watchos) | ||
| 115 | OS_SWIFT_NAME(WorkGroup.init(__name:port:)) OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED | ||
| 116 | os_workgroup_t _Nullable | ||
| 117 | os_workgroup_create_with_port(const char *_Nullable name, mach_port_t mach_port); | ||
| 118 | |||
| 119 | /*! | ||
| 120 | * @function os_workgroup_create_with_workgroup | ||
| 121 | * | ||
| 122 | * @abstract | ||
| 123 | * Create a new os_workgroup object from an existing os_workgroup. | ||
| 124 | * | ||
| 125 | * The newly created os_workgroup has no initial member threads - in particular | ||
| 126 | * the creating threaad does not join the os_workgroup_t implicitly. | ||
| 127 | * | ||
| 128 | * @param name | ||
| 129 | * A client specified string for labelling the workgroup. This parameter is | ||
| 130 | * optional and can be NULL. | ||
| 131 | * | ||
| 132 | * @param wg | ||
| 133 | * The existing workgroup to create a new workgroup object from. | ||
| 134 | */ | ||
| 135 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 136 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED | ||
| 137 | os_workgroup_t _Nullable | ||
| 138 | os_workgroup_create_with_workgroup(const char * _Nullable name, os_workgroup_t wg); | ||
| 139 | |||
| 140 | /*! | ||
| 141 | * @typedef os_workgroup_join_token, os_workgroup_join_token_t | ||
| 142 | * | ||
| 143 | * @abstract | ||
| 144 | * An opaque join token which the client needs to pass to os_workgroup_join | ||
| 145 | * and os_workgroup_leave | ||
| 146 | */ | ||
| 147 | OS_REFINED_FOR_SWIFT | ||
| 148 | typedef struct os_workgroup_join_token_opaque_s os_workgroup_join_token_s; | ||
| 149 | OS_REFINED_FOR_SWIFT | ||
| 150 | typedef struct os_workgroup_join_token_opaque_s *os_workgroup_join_token_t; | ||
| 151 | |||
| 152 | |||
| 153 | /*! | ||
| 154 | * @function os_workgroup_join | ||
| 155 | * | ||
| 156 | * @abstract | ||
| 157 | * Joins the current thread to the specified workgroup and populates the join | ||
| 158 | * token that has been passed in. This API is real-time safe. | ||
| 159 | * | ||
| 160 | * @param wg | ||
| 161 | * The workgroup that the current thread would like to join | ||
| 162 | * | ||
| 163 | * @param token_out | ||
| 164 | * Pointer to a client allocated struct which the function will populate | ||
| 165 | * with the join token. This token must be passed in by the thread when it calls | ||
| 166 | * os_workgroup_leave(). | ||
| 167 | * | ||
| 168 | * Errors will be returned in the following cases: | ||
| 169 | * | ||
| 170 | * EALREADY		The thread is already part of a workgroup that the specified | ||
| 171 | *				workgroup does not nest with | ||
| 172 | * EINVAL		The workgroup has been cancelled | ||
| 173 | */ | ||
| 174 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 175 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT | ||
| 176 | int | ||
| 177 | os_workgroup_join(os_workgroup_t wg, os_workgroup_join_token_t token_out); | ||
| 178 | |||
| 179 | /*! | ||
| 180 | * @function os_workgroup_leave | ||
| 181 | * | ||
| 182 | * @abstract | ||
| 183 | * This removes the current thread from a workgroup it has previously | ||
| 184 | * joined. Threads must leave all workgroups in the reverse order that they | ||
| 185 | * have joined them. Failing to do so before exiting will result in undefined | ||
| 186 | * behavior. | ||
| 187 | * | ||
| 188 | * If the join token is malformed, the process will be aborted. | ||
| 189 | * | ||
| 190 | * This API is real time safe. | ||
| 191 | * | ||
| 192 | * @param wg | ||
| 193 | * The workgroup that the current thread would like to leave. | ||
| 194 | * | ||
| 195 | * @param token | ||
| 196 | * This is the join token populated by the most recent call to | ||
| 197 | * os_workgroup_join(). | ||
| 198 | */ | ||
| 199 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 200 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT | ||
| 201 | void | ||
| 202 | os_workgroup_leave(os_workgroup_t wg, os_workgroup_join_token_t token); | ||
| 203 | |||
| 204 | /* Working Arena index of a thread in a workgroup */ | ||
| 205 | typedef uint32_t os_workgroup_index; | ||
| 206 | /* Destructor for Working Arena */ | ||
| 207 | typedef void (*os_workgroup_working_arena_destructor_t)(void * _Nullable); | ||
| 208 | |||
| 209 | /*! | ||
| 210 | * @function os_workgroup_set_working_arena | ||
| 211 | * | ||
| 212 | * @abstract | ||
| 213 | * Associates a client defined working arena with the workgroup. The arena | ||
| 214 | * is local to the workgroup object in the process. This is intended for | ||
| 215 | * distributing a manually managed memory allocation between member threads | ||
| 216 | * of the workgroup. | ||
| 217 | * | ||
| 218 | * This function can be called multiple times and the client specified | ||
| 219 | * destructor will be called on the previously assigned arena, if any. This | ||
| 220 | * function can only be called when no threads have currently joined the | ||
| 221 | * workgroup and all workloops associated with the workgroup are idle. | ||
| 222 | * | ||
| 223 | * @param wg | ||
| 224 | * The workgroup to associate the working arena with | ||
| 225 | * | ||
| 226 | * @param arena | ||
| 227 | * The client managed arena to associate with the workgroup. This value can | ||
| 228 | * be NULL. | ||
| 229 | * | ||
| 230 | * @param max_workers | ||
| 231 | * The maximum number of threads that will ever query the workgroup for the | ||
| 232 | * arena and request an index into it. If the arena is not used to partition | ||
| 233 | * work amongst member threads, then this field can be 0. | ||
| 234 | * | ||
| 235 | * @param destructor | ||
| 236 | * A destructor to call on the previously assigned working arena, if any | ||
| 237 | */ | ||
| 238 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 239 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT | ||
| 240 | int | ||
| 241 | os_workgroup_set_working_arena(os_workgroup_t wg, void * _Nullable arena, | ||
| 242 | 	uint32_t max_workers, os_workgroup_working_arena_destructor_t destructor); | ||
| 243 | |||
| 244 | /*! | ||
| 245 | * @function os_workgroup_get_working_arena | ||
| 246 | * | ||
| 247 | * @abstract | ||
| 248 | * Returns the working arena associated with the workgroup and the current | ||
| 249 | * thread's index in the workgroup. This function can only be called by a member | ||
| 250 | * of the workgroup. Multiple calls to this API by a member thread will return | ||
| 251 | * the same arena and index until the thread leaves the workgroup. | ||
| 252 | * | ||
| 253 | * For workloops with an associated workgroup, every work item on the workloop | ||
| 254 | * will receive the same index in the arena. | ||
| 255 | * | ||
| 256 | * This method returns NULL if no arena is set on the workgroup. The index | ||
| 257 | * returned by this function is zero-based and is namespaced per workgroup | ||
| 258 | * object in the process. The indices provided are strictly monotonic and never | ||
| 259 | * reused until a future call to os_workgroup_set_working_arena. | ||
| 260 | * | ||
| 261 | * @param wg | ||
| 262 | * The workgroup to get the working arena from. | ||
| 263 | * | ||
| 264 | * @param index_out | ||
| 265 | * A pointer to a os_workgroup_index which will be populated by the caller's | ||
| 266 | * index in the workgroup. | ||
| 267 | */ | ||
| 268 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 269 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT | ||
| 270 | void * _Nullable | ||
| 271 | os_workgroup_get_working_arena(os_workgroup_t wg, | ||
| 272 | 		os_workgroup_index * _Nullable index_out); | ||
| 273 | |||
| 274 | /*! | ||
| 275 | * @function os_workgroup_cancel | ||
| 276 | * | ||
| 277 | * @abstract | ||
| 278 | * This API invalidates a workgroup and indicates to the system that the | ||
| 279 | * workload is no longer relevant to the caller. | ||
| 280 | * | ||
| 281 | * No new work should be initiated for a cancelled workgroup and | ||
| 282 | * work that is already underway should periodically check for | ||
| 283 | * cancellation with os_workgroup_testcancel and initiate cleanup if needed. | ||
| 284 | * | ||
| 285 | * Threads currently in the workgroup continue to be tracked together but no | ||
| 286 | * new threads may join this workgroup - the only possible operation allowed is | ||
| 287 | * to leave the workgroup. Other actions may have undefined behavior or | ||
| 288 | * otherwise fail. | ||
| 289 | * | ||
| 290 | * This API is idempotent. Cancellation is local to the workgroup object | ||
| 291 | * it is called on and does not affect other workgroups. | ||
| 292 | * | ||
| 293 | * @param wg | ||
| 294 | * The workgroup that that the thread would like to cancel | ||
| 295 | */ | ||
| 296 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 297 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT | ||
| 298 | void | ||
| 299 | os_workgroup_cancel(os_workgroup_t wg); | ||
| 300 | |||
| 301 | /*! | ||
| 302 | * @function os_workgroup_testcancel | ||
| 303 | * | ||
| 304 | * @abstract | ||
| 305 | * Returns true if the workgroup object has been cancelled. See also | ||
| 306 | * os_workgroup_cancel | ||
| 307 | */ | ||
| 308 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 309 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT | ||
| 310 | bool | ||
| 311 | os_workgroup_testcancel(os_workgroup_t wg); | ||
| 312 | |||
| 313 | /*! | ||
| 314 | * @typedef os_workgroup_max_parallel_threads_attr_t | ||
| 315 | * | ||
| 316 | * @abstract | ||
| 317 | * A pointer to a structure describing the set of properties of a workgroup to | ||
| 318 | * override with the explicitly specified values in the structure. | ||
| 319 | * | ||
| 320 | * See also os_workgroup_max_parallel_threads. | ||
| 321 | */ | ||
| 322 | OS_REFINED_FOR_SWIFT | ||
| 323 | typedef struct os_workgroup_max_parallel_threads_attr_s os_workgroup_mpt_attr_s; | ||
| 324 | OS_REFINED_FOR_SWIFT | ||
| 325 | typedef struct os_workgroup_max_parallel_threads_attr_s *os_workgroup_mpt_attr_t; | ||
| 326 | |||
| 327 | /*! | ||
| 328 | * @function os_workgroup_max_parallel_threads | ||
| 329 | * | ||
| 330 | * @abstract | ||
| 331 | * Returns the system's recommendation for maximum number of threads the client | ||
| 332 | * should make for a multi-threaded workload in a given workgroup. | ||
| 333 | * | ||
| 334 | * This API takes into consideration the current hardware the code is running on | ||
| 335 | * and the attributes of the workgroup. It does not take into consideration the | ||
| 336 | * current load of the system and therefore always provides the most optimal | ||
| 337 | * recommendation for the workload. | ||
| 338 | * | ||
| 339 | * @param wg | ||
| 340 | * The workgroup in which the multi-threaded workload will be performed in. The | ||
| 341 | * threads performing the multi-threaded workload are expected to join this | ||
| 342 | * workgroup. | ||
| 343 | * | ||
| 344 | * @param attr | ||
| 345 | * This value is currently unused and should be NULL. | ||
| 346 | */ | ||
| 347 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 348 | OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT | ||
| 349 | int | ||
| 350 | os_workgroup_max_parallel_threads(os_workgroup_t wg, os_workgroup_mpt_attr_t | ||
| 351 | 		_Nullable attr); | ||
| 352 | |||
| 353 | OS_WORKGROUP_ASSUME_NONNULL_END | ||
| 354 | |||
| 355 | __END_DECLS | ||
| 356 | |||
| 357 | #endif /* __OS_WORKGROUP_OBJECT__ */ | ||
lib/libc/include/x86_64-macos-gnu/os/workgroup_parallel.h created+74| ... | @@ -0,0 +1,74 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2020 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 7 | * you may not use this file except in compliance with the License. | ||
| 8 | * You may obtain a copy of the License at | ||
| 9 | * | ||
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | * | ||
| 12 | * Unless required by applicable law or agreed to in writing, software | ||
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 15 | * See the License for the specific language governing permissions and | ||
| 16 | * limitations under the License. | ||
| 17 | * | ||
| 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __OS_WORKGROUP_PARALLEL__ | ||
| 22 | #define __OS_WORKGROUP_PARALLEL__ | ||
| 23 | |||
| 24 | #ifndef __OS_WORKGROUP_INDIRECT__ | ||
| 25 | #error "Please #include <os/workgroup.h> instead of this file directly." | ||
| 26 | #include <os/workgroup_base.h> // For header doc | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #include <os/workgroup_object.h> | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | |||
| 33 | OS_WORKGROUP_ASSUME_NONNULL_BEGIN | ||
| 34 | |||
| 35 | /*! | ||
| 36 | * @typedef os_workgroup_parallel_t | ||
| 37 | * | ||
| 38 | * @abstract | ||
| 39 | * A subclass of an os_workgroup_t for tracking parallel work. | ||
| 40 | */ | ||
| 41 | OS_WORKGROUP_SUBCLASS_DECL_PROTO(os_workgroup_parallel, Parallelizable); | ||
| 42 | OS_WORKGROUP_SUBCLASS_DECL(os_workgroup_parallel, os_workgroup, WorkGroupParallel); | ||
| 43 | |||
| 44 | /*! | ||
| 45 | * @function os_workgroup_parallel_create | ||
| 46 | * | ||
| 47 | * @abstract | ||
| 48 | * Creates an os_workgroup_t which tracks a parallel workload. | ||
| 49 | * A newly created os_workgroup_interval_t has no initial member threads - | ||
| 50 | * in particular the creating thread does not join the os_workgroup_parallel_t | ||
| 51 | * implicitly. | ||
| 52 | * | ||
| 53 | * See also os_workgroup_max_parallel_threads(). | ||
| 54 | * | ||
| 55 | * @param name | ||
| 56 | * A client specified string for labelling the workgroup. This parameter is | ||
| 57 | * optional and can be NULL. | ||
| 58 | * | ||
| 59 | * @param attr | ||
| 60 | * The requested set of workgroup attributes. NULL is to be specified for the | ||
| 61 | * default set of attributes. | ||
| 62 | */ | ||
| 63 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 64 | OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED | ||
| 65 | OS_SWIFT_NAME(WorkGroupParallel.init(__name:attr:)) | ||
| 66 | os_workgroup_parallel_t _Nullable | ||
| 67 | os_workgroup_parallel_create(const char * _Nullable name, | ||
| 68 | 	os_workgroup_attr_t _Nullable attr); | ||
| 69 | |||
| 70 | OS_WORKGROUP_ASSUME_NONNULL_END | ||
| 71 | |||
| 72 | __END_DECLS | ||
| 73 | |||
| 74 | #endif /* __OS_WORKGROUP_PARALLEL__ */ | ||
lib/libc/include/x86_64-macos-gnu/poll.h created+26| ... | @@ -0,0 +1,26 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #include <sys/poll.h> | ||
| 24 | |||
| 25 | |||
| 26 | |||
lib/libc/include/x86_64-macos-gnu/pthread.h created+592| ... | @@ -0,0 +1,592 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991 | ||
| 25 | * All Rights Reserved | ||
| 26 | * | ||
| 27 | * Permission to use, copy, modify, and distribute this software and | ||
| 28 | * its documentation for any purpose and without fee is hereby granted, | ||
| 29 | * provided that the above copyright notice appears in all copies and | ||
| 30 | * that both the copyright notice and this permission notice appear in | ||
| 31 | * supporting documentation. | ||
| 32 | * | ||
| 33 | * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE | ||
| 34 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
| 35 | * FOR A PARTICULAR PURPOSE. | ||
| 36 | * | ||
| 37 | * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR | ||
| 38 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
| 39 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, | ||
| 40 | * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
| 41 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | /* | ||
| 45 | * MkLinux | ||
| 46 | */ | ||
| 47 | |||
| 48 | /* | ||
| 49 | * POSIX Threads - IEEE 1003.1c | ||
| 50 | */ | ||
| 51 | |||
| 52 | #ifndef _PTHREAD_H | ||
| 53 | #define _PTHREAD_H | ||
| 54 | |||
| 55 | #include <_types.h> | ||
| 56 | #include <pthread/sched.h> | ||
| 57 | #include <time.h> | ||
| 58 | #include <sys/_pthread/_pthread_types.h> | ||
| 59 | #include <sys/_pthread/_pthread_attr_t.h> | ||
| 60 | #include <sys/_pthread/_pthread_cond_t.h> | ||
| 61 | #include <sys/_pthread/_pthread_condattr_t.h> | ||
| 62 | #include <sys/_pthread/_pthread_key_t.h> | ||
| 63 | #include <sys/_pthread/_pthread_mutex_t.h> | ||
| 64 | #include <sys/_pthread/_pthread_mutexattr_t.h> | ||
| 65 | #include <sys/_pthread/_pthread_once_t.h> | ||
| 66 | #include <sys/_pthread/_pthread_rwlock_t.h> | ||
| 67 | #include <sys/_pthread/_pthread_rwlockattr_t.h> | ||
| 68 | #include <sys/_pthread/_pthread_t.h> | ||
| 69 | |||
| 70 | #include <pthread/qos.h> | ||
| 71 | |||
| 72 | #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(__cplusplus) | ||
| 73 | |||
| 74 | #include <sys/_types/_mach_port_t.h> | ||
| 75 | #include <sys/_types/_sigset_t.h> | ||
| 76 | |||
| 77 | #endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */ | ||
| 78 | |||
| 79 | /* | ||
| 80 | * These symbols indicate which [optional] features are available | ||
| 81 | * They can be tested at compile time via '#ifdef XXX' | ||
| 82 | * The way to check for pthreads is like so: | ||
| 83 | |||
| 84 | * #include <unistd.h> | ||
| 85 | * #ifdef _POSIX_THREADS | ||
| 86 | * #include <pthread.h> | ||
| 87 | * #endif | ||
| 88 | |||
| 89 | */ | ||
| 90 | |||
| 91 | /* These will be moved to unistd.h */ | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Note: These data structures are meant to be opaque. Only enough | ||
| 95 | * structure is exposed to support initializers. | ||
| 96 | * All of the typedefs will be moved to <sys/types.h> | ||
| 97 | */ | ||
| 98 | |||
| 99 | #include <sys/cdefs.h> | ||
| 100 | #include <Availability.h> | ||
| 101 | |||
| 102 | #if __has_feature(assume_nonnull) | ||
| 103 | _Pragma("clang assume_nonnull begin") | ||
| 104 | #endif | ||
| 105 | __BEGIN_DECLS | ||
| 106 | /* | ||
| 107 | * Threads | ||
| 108 | */ | ||
| 109 | |||
| 110 | |||
| 111 | /* | ||
| 112 | * Cancel cleanup handler management. Note, since these are implemented as macros, | ||
| 113 | * they *MUST* occur in matched pairs! | ||
| 114 | */ | ||
| 115 | |||
| 116 | #define pthread_cleanup_push(func, val) \ | ||
| 117 | { \ | ||
| 118 | 	 struct __darwin_pthread_handler_rec __handler; \ | ||
| 119 | 	 pthread_t __self = pthread_self(); \ | ||
| 120 | 	 __handler.__routine = func; \ | ||
| 121 | 	 __handler.__arg = val; \ | ||
| 122 | 	 __handler.__next = __self->__cleanup_stack; \ | ||
| 123 | 	 __self->__cleanup_stack = &__handler; | ||
| 124 | |||
| 125 | #define pthread_cleanup_pop(execute) \ | ||
| 126 | 	 /* Note: 'handler' must be in this same lexical context! */ \ | ||
| 127 | 	 __self->__cleanup_stack = __handler.__next; \ | ||
| 128 | 	 if (execute) (__handler.__routine)(__handler.__arg); \ | ||
| 129 | } | ||
| 130 | |||
| 131 | /* | ||
| 132 | * Thread attributes | ||
| 133 | */ | ||
| 134 | |||
| 135 | #define PTHREAD_CREATE_JOINABLE 1 | ||
| 136 | #define PTHREAD_CREATE_DETACHED 2 | ||
| 137 | |||
| 138 | #define PTHREAD_INHERIT_SCHED 1 | ||
| 139 | #define PTHREAD_EXPLICIT_SCHED 2 | ||
| 140 | |||
| 141 | #define PTHREAD_CANCEL_ENABLE 0x01 /* Cancel takes place at next cancellation point */ | ||
| 142 | #define PTHREAD_CANCEL_DISABLE 0x00 /* Cancel postponed */ | ||
| 143 | #define PTHREAD_CANCEL_DEFERRED 0x02 /* Cancel waits until cancellation point */ | ||
| 144 | #define PTHREAD_CANCEL_ASYNCHRONOUS 0x00 /* Cancel occurs immediately */ | ||
| 145 | |||
| 146 | /* Value returned from pthread_join() when a thread is canceled */ | ||
| 147 | #define PTHREAD_CANCELED	 ((void *) 1) | ||
| 148 | |||
| 149 | /* We only support PTHREAD_SCOPE_SYSTEM */ | ||
| 150 | #define PTHREAD_SCOPE_SYSTEM 1 | ||
| 151 | #define PTHREAD_SCOPE_PROCESS 2 | ||
| 152 | |||
| 153 | #define PTHREAD_PROCESS_SHARED 1 | ||
| 154 | #define PTHREAD_PROCESS_PRIVATE 2 | ||
| 155 | |||
| 156 | /* | ||
| 157 | * Mutex protocol attributes | ||
| 158 | */ | ||
| 159 | #define PTHREAD_PRIO_NONE 0 | ||
| 160 | #define PTHREAD_PRIO_INHERIT 1 | ||
| 161 | #define PTHREAD_PRIO_PROTECT 2 | ||
| 162 | |||
| 163 | /* | ||
| 164 | * Mutex type attributes | ||
| 165 | */ | ||
| 166 | #define PTHREAD_MUTEX_NORMAL		0 | ||
| 167 | #define PTHREAD_MUTEX_ERRORCHECK	1 | ||
| 168 | #define PTHREAD_MUTEX_RECURSIVE		2 | ||
| 169 | #define PTHREAD_MUTEX_DEFAULT		PTHREAD_MUTEX_NORMAL | ||
| 170 | |||
| 171 | /* | ||
| 172 | * Mutex policy attributes | ||
| 173 | */ | ||
| 174 | #define PTHREAD_MUTEX_POLICY_FAIRSHARE_NP 1 | ||
| 175 | #define PTHREAD_MUTEX_POLICY_FIRSTFIT_NP 3 | ||
| 176 | |||
| 177 | /* | ||
| 178 | * RWLock variables | ||
| 179 | */ | ||
| 180 | #define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWLOCK_SIG_init, {0}} | ||
| 181 | |||
| 182 | /* | ||
| 183 | * Mutex variables | ||
| 184 | */ | ||
| 185 | #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}} | ||
| 186 | |||
| 187 | /* <rdar://problem/10854763> */ | ||
| 188 | #if ((__MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) || (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000)) || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) | ||
| 189 | #	if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) | ||
| 190 | #		define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {_PTHREAD_ERRORCHECK_MUTEX_SIG_init, {0}} | ||
| 191 | #		define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {_PTHREAD_RECURSIVE_MUTEX_SIG_init, {0}} | ||
| 192 | #	endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */ | ||
| 193 | #endif | ||
| 194 | |||
| 195 | /* <rdar://problem/25944576> */ | ||
| 196 | #define _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT \ | ||
| 197 | 	defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1)) | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Condition variable attributes | ||
| 201 | */ | ||
| 202 | |||
| 203 | /* | ||
| 204 | * Condition variables | ||
| 205 | */ | ||
| 206 | |||
| 207 | #define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}} | ||
| 208 | |||
| 209 | /* | ||
| 210 | * Initialization control (once) variables | ||
| 211 | */ | ||
| 212 | |||
| 213 | #define PTHREAD_ONCE_INIT {_PTHREAD_ONCE_SIG_init, {0}} | ||
| 214 | |||
| 215 | /* | ||
| 216 | * Prototypes for all PTHREAD interfaces | ||
| 217 | */ | ||
| 218 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 219 | int pthread_atfork(void (* _Nullable)(void), void (* _Nullable)(void), | ||
| 220 | 		void (* _Nullable)(void)); | ||
| 221 | |||
| 222 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 223 | int pthread_attr_destroy(pthread_attr_t *); | ||
| 224 | |||
| 225 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 226 | int pthread_attr_getdetachstate(const pthread_attr_t *, int *); | ||
| 227 | |||
| 228 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 229 | int pthread_attr_getguardsize(const pthread_attr_t * __restrict, size_t * __restrict); | ||
| 230 | |||
| 231 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 232 | int pthread_attr_getinheritsched(const pthread_attr_t * __restrict, int * __restrict); | ||
| 233 | |||
| 234 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 235 | int pthread_attr_getschedparam(const pthread_attr_t * __restrict, | ||
| 236 | 		struct sched_param * __restrict); | ||
| 237 | |||
| 238 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 239 | int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict, int * __restrict); | ||
| 240 | |||
| 241 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 242 | int pthread_attr_getscope(const pthread_attr_t * __restrict, int * __restrict); | ||
| 243 | |||
| 244 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 245 | int pthread_attr_getstack(const pthread_attr_t * __restrict, | ||
| 246 | 		void * _Nullable * _Nonnull __restrict, size_t * __restrict); | ||
| 247 | |||
| 248 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 249 | int pthread_attr_getstackaddr(const pthread_attr_t * __restrict, | ||
| 250 | 		void * _Nullable * _Nonnull __restrict); | ||
| 251 | |||
| 252 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 253 | int pthread_attr_getstacksize(const pthread_attr_t * __restrict, size_t * __restrict); | ||
| 254 | |||
| 255 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 256 | int pthread_attr_init(pthread_attr_t *); | ||
| 257 | |||
| 258 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 259 | int pthread_attr_setdetachstate(pthread_attr_t *, int); | ||
| 260 | |||
| 261 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 262 | int pthread_attr_setguardsize(pthread_attr_t *, size_t); | ||
| 263 | |||
| 264 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 265 | int pthread_attr_setinheritsched(pthread_attr_t *, int); | ||
| 266 | |||
| 267 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 268 | int pthread_attr_setschedparam(pthread_attr_t * __restrict, | ||
| 269 | 		const struct sched_param * __restrict); | ||
| 270 | |||
| 271 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 272 | int pthread_attr_setschedpolicy(pthread_attr_t *, int); | ||
| 273 | |||
| 274 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 275 | int pthread_attr_setscope(pthread_attr_t *, int); | ||
| 276 | |||
| 277 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 278 | int pthread_attr_setstack(pthread_attr_t *, void *, size_t); | ||
| 279 | |||
| 280 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 281 | int pthread_attr_setstackaddr(pthread_attr_t *, void *); | ||
| 282 | |||
| 283 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 284 | int pthread_attr_setstacksize(pthread_attr_t *, size_t); | ||
| 285 | |||
| 286 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 287 | int pthread_cancel(pthread_t) __DARWIN_ALIAS(pthread_cancel); | ||
| 288 | |||
| 289 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 290 | int pthread_cond_broadcast(pthread_cond_t *); | ||
| 291 | |||
| 292 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 293 | int pthread_cond_destroy(pthread_cond_t *); | ||
| 294 | |||
| 295 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 296 | int pthread_cond_init( | ||
| 297 | 		pthread_cond_t * __restrict, | ||
| 298 | 		const pthread_condattr_t * _Nullable __restrict) | ||
| 299 | 		__DARWIN_ALIAS(pthread_cond_init); | ||
| 300 | |||
| 301 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 302 | int pthread_cond_signal(pthread_cond_t *); | ||
| 303 | |||
| 304 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 305 | int pthread_cond_timedwait( | ||
| 306 | 		pthread_cond_t * __restrict, pthread_mutex_t * __restrict, | ||
| 307 | 		const struct timespec * _Nullable __restrict) | ||
| 308 | 		__DARWIN_ALIAS_C(pthread_cond_timedwait); | ||
| 309 | |||
| 310 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 311 | int pthread_cond_wait(pthread_cond_t * __restrict, | ||
| 312 | 		pthread_mutex_t * __restrict) __DARWIN_ALIAS_C(pthread_cond_wait); | ||
| 313 | |||
| 314 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 315 | int pthread_condattr_destroy(pthread_condattr_t *); | ||
| 316 | |||
| 317 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 318 | int pthread_condattr_init(pthread_condattr_t *); | ||
| 319 | |||
| 320 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 321 | int pthread_condattr_getpshared(const pthread_condattr_t * __restrict, | ||
| 322 | 		int * __restrict); | ||
| 323 | |||
| 324 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 325 | int pthread_condattr_setpshared(pthread_condattr_t *, int); | ||
| 326 | |||
| 327 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 328 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT | ||
| 329 | int pthread_create(pthread_t _Nullable * _Nonnull __restrict, | ||
| 330 | 		const pthread_attr_t * _Nullable __restrict, | ||
| 331 | 		void * _Nullable (* _Nonnull)(void * _Nullable), | ||
| 332 | 		void * _Nullable __restrict); | ||
| 333 | #else | ||
| 334 | int pthread_create(pthread_t * __restrict, | ||
| 335 | 		const pthread_attr_t * _Nullable __restrict, | ||
| 336 | 		void *(* _Nonnull)(void *), void * _Nullable __restrict); | ||
| 337 | #endif // _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT | ||
| 338 | |||
| 339 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 340 | int pthread_detach(pthread_t); | ||
| 341 | |||
| 342 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 343 | int pthread_equal(pthread_t _Nullable, pthread_t _Nullable); | ||
| 344 | |||
| 345 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 346 | void pthread_exit(void * _Nullable) __dead2; | ||
| 347 | |||
| 348 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 349 | int pthread_getconcurrency(void); | ||
| 350 | |||
| 351 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 352 | int pthread_getschedparam(pthread_t , int * _Nullable __restrict, | ||
| 353 | 		struct sched_param * _Nullable __restrict); | ||
| 354 | |||
| 355 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 356 | void* _Nullable pthread_getspecific(pthread_key_t); | ||
| 357 | |||
| 358 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 359 | int pthread_join(pthread_t , void * _Nullable * _Nullable) | ||
| 360 | 		__DARWIN_ALIAS_C(pthread_join); | ||
| 361 | |||
| 362 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 363 | int pthread_key_create(pthread_key_t *, void (* _Nullable)(void *)); | ||
| 364 | |||
| 365 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 366 | int pthread_key_delete(pthread_key_t); | ||
| 367 | |||
| 368 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 369 | int pthread_mutex_destroy(pthread_mutex_t *); | ||
| 370 | |||
| 371 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 372 | int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict, | ||
| 373 | 		int * __restrict); | ||
| 374 | |||
| 375 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 376 | int pthread_mutex_init(pthread_mutex_t * __restrict, | ||
| 377 | 		const pthread_mutexattr_t * _Nullable __restrict); | ||
| 378 | |||
| 379 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 380 | int pthread_mutex_lock(pthread_mutex_t *); | ||
| 381 | |||
| 382 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 383 | int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict, int, | ||
| 384 | 		int * __restrict); | ||
| 385 | |||
| 386 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 387 | int pthread_mutex_trylock(pthread_mutex_t *); | ||
| 388 | |||
| 389 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 390 | int pthread_mutex_unlock(pthread_mutex_t *); | ||
| 391 | |||
| 392 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 393 | int pthread_mutexattr_destroy(pthread_mutexattr_t *) __DARWIN_ALIAS(pthread_mutexattr_destroy); | ||
| 394 | |||
| 395 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 396 | int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict, | ||
| 397 | 		int * __restrict); | ||
| 398 | |||
| 399 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 400 | int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict, | ||
| 401 | 		int * __restrict); | ||
| 402 | |||
| 403 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 404 | int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __restrict, | ||
| 405 | 		int * __restrict); | ||
| 406 | |||
| 407 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 408 | int pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict, | ||
| 409 | 		int * __restrict); | ||
| 410 | |||
| 411 | __API_AVAILABLE(macos(10.13.4), ios(11.3), watchos(4.3), tvos(11.3)) | ||
| 412 | int pthread_mutexattr_getpolicy_np(const pthread_mutexattr_t * __restrict, | ||
| 413 | 		int * __restrict); | ||
| 414 | |||
| 415 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 416 | int pthread_mutexattr_init(pthread_mutexattr_t *); | ||
| 417 | |||
| 418 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 419 | int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); | ||
| 420 | |||
| 421 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 422 | int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); | ||
| 423 | |||
| 424 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 425 | int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); | ||
| 426 | |||
| 427 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 428 | int pthread_mutexattr_settype(pthread_mutexattr_t *, int); | ||
| 429 | |||
| 430 | __API_AVAILABLE(macos(10.7), ios(5.0)) | ||
| 431 | int pthread_mutexattr_setpolicy_np(pthread_mutexattr_t *, int); | ||
| 432 | |||
| 433 | __SWIFT_UNAVAILABLE_MSG("Use lazily initialized globals instead") | ||
| 434 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 435 | int pthread_once(pthread_once_t *, void (* _Nonnull)(void)); | ||
| 436 | |||
| 437 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 438 | int pthread_rwlock_destroy(pthread_rwlock_t * ) __DARWIN_ALIAS(pthread_rwlock_destroy); | ||
| 439 | |||
| 440 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 441 | int pthread_rwlock_init(pthread_rwlock_t * __restrict, | ||
| 442 | 		const pthread_rwlockattr_t * _Nullable __restrict) | ||
| 443 | 		__DARWIN_ALIAS(pthread_rwlock_init); | ||
| 444 | |||
| 445 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 446 | int pthread_rwlock_rdlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_rdlock); | ||
| 447 | |||
| 448 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 449 | int pthread_rwlock_tryrdlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_tryrdlock); | ||
| 450 | |||
| 451 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 452 | int pthread_rwlock_trywrlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_trywrlock); | ||
| 453 | |||
| 454 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 455 | int pthread_rwlock_wrlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_wrlock); | ||
| 456 | |||
| 457 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 458 | int pthread_rwlock_unlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_unlock); | ||
| 459 | |||
| 460 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 461 | int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); | ||
| 462 | |||
| 463 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 464 | int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * __restrict, | ||
| 465 | 		int * __restrict); | ||
| 466 | |||
| 467 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 468 | int pthread_rwlockattr_init(pthread_rwlockattr_t *); | ||
| 469 | |||
| 470 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 471 | int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); | ||
| 472 | |||
| 473 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 474 | pthread_t pthread_self(void); | ||
| 475 | |||
| 476 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 477 | int pthread_setcancelstate(int , int * _Nullable) | ||
| 478 | 		__DARWIN_ALIAS(pthread_setcancelstate); | ||
| 479 | |||
| 480 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 481 | int pthread_setcanceltype(int , int * _Nullable) | ||
| 482 | 		__DARWIN_ALIAS(pthread_setcanceltype); | ||
| 483 | |||
| 484 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 485 | int pthread_setconcurrency(int); | ||
| 486 | |||
| 487 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 488 | int pthread_setschedparam(pthread_t, int, const struct sched_param *); | ||
| 489 | |||
| 490 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 491 | int pthread_setspecific(pthread_key_t , const void * _Nullable); | ||
| 492 | |||
| 493 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 494 | void pthread_testcancel(void) __DARWIN_ALIAS(pthread_testcancel); | ||
| 495 | |||
| 496 | #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(__cplusplus) | ||
| 497 | |||
| 498 | /* returns non-zero if pthread_create or cthread_fork have been called */ | ||
| 499 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 500 | int pthread_is_threaded_np(void); | ||
| 501 | |||
| 502 | __API_AVAILABLE(macos(10.6), ios(3.2)) | ||
| 503 | int pthread_threadid_np(pthread_t _Nullable,__uint64_t* _Nullable); | ||
| 504 | |||
| 505 | /*SPI to set and get pthread name*/ | ||
| 506 | __API_AVAILABLE(macos(10.6), ios(3.2)) | ||
| 507 | int	pthread_getname_np(pthread_t,char*,size_t); | ||
| 508 | |||
| 509 | __API_AVAILABLE(macos(10.6), ios(3.2)) | ||
| 510 | int	pthread_setname_np(const char*); | ||
| 511 | |||
| 512 | /* returns non-zero if the current thread is the main thread */ | ||
| 513 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 514 | int	pthread_main_np(void); | ||
| 515 | |||
| 516 | /* return the mach thread bound to the pthread */ | ||
| 517 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 518 | mach_port_t pthread_mach_thread_np(pthread_t); | ||
| 519 | |||
| 520 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 521 | size_t pthread_get_stacksize_np(pthread_t); | ||
| 522 | |||
| 523 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 524 | void* pthread_get_stackaddr_np(pthread_t); | ||
| 525 | |||
| 526 | /* Like pthread_cond_signal(), but only wake up the specified pthread */ | ||
| 527 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 528 | int pthread_cond_signal_thread_np(pthread_cond_t *, pthread_t _Nullable); | ||
| 529 | |||
| 530 | /* Like pthread_cond_timedwait, but use a relative timeout */ | ||
| 531 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 532 | int pthread_cond_timedwait_relative_np(pthread_cond_t *, pthread_mutex_t *, | ||
| 533 | 		const struct timespec * _Nullable); | ||
| 534 | |||
| 535 | /* Like pthread_create(), but leaves the thread suspended */ | ||
| 536 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 537 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT | ||
| 538 | int pthread_create_suspended_np( | ||
| 539 | 		pthread_t _Nullable * _Nonnull, const pthread_attr_t * _Nullable, | ||
| 540 | 		void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable); | ||
| 541 | #else | ||
| 542 | int pthread_create_suspended_np(pthread_t *, const pthread_attr_t * _Nullable, | ||
| 543 | 		void *(* _Nonnull)(void *), void * _Nullable); | ||
| 544 | #endif | ||
| 545 | |||
| 546 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 547 | int pthread_kill(pthread_t, int); | ||
| 548 | |||
| 549 | __API_AVAILABLE(macos(10.5), ios(2.0)) | ||
| 550 | _Nullable pthread_t pthread_from_mach_thread_np(mach_port_t); | ||
| 551 | |||
| 552 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 553 | int pthread_sigmask(int, const sigset_t * _Nullable, sigset_t * _Nullable) | ||
| 554 | 		__DARWIN_ALIAS(pthread_sigmask); | ||
| 555 | |||
| 556 | __API_AVAILABLE(macos(10.4), ios(2.0)) | ||
| 557 | void pthread_yield_np(void); | ||
| 558 | |||
| 559 | __API_AVAILABLE(macos(11.0)) | ||
| 560 | __API_UNAVAILABLE(ios, tvos, watchos) | ||
| 561 | void pthread_jit_write_protect_np(int enabled); | ||
| 562 | |||
| 563 | __API_AVAILABLE(macos(11.0)) | ||
| 564 | __API_UNAVAILABLE(ios, tvos, watchos) | ||
| 565 | int pthread_jit_write_protect_supported_np(void); | ||
| 566 | |||
| 567 | /*! | ||
| 568 | * @function pthread_cpu_number_np | ||
| 569 | * | ||
| 570 | * @param cpu_number_out | ||
| 571 | * The CPU number that the thread was running on at the time of query. | ||
| 572 | * This cpu number is in the interval [0, ncpus) (from sysctlbyname("hw.ncpu")) | ||
| 573 | * | ||
| 574 | * @result | ||
| 575 | * This function returns 0 or the value of errno if an error occurred. | ||
| 576 | * | ||
| 577 | * @note | ||
| 578 | * Optimizations of per-CPU datastructures based on the result of this function | ||
| 579 | * still require synchronization since it is not guaranteed that the thread will | ||
| 580 | * still be on the same CPU by the time the function returns. | ||
| 581 | */ | ||
| 582 | __API_AVAILABLE(macos(11.0), ios(14.2), tvos(14.2), watchos(7.1)) | ||
| 583 | int | ||
| 584 | pthread_cpu_number_np(size_t *cpu_number_out); | ||
| 585 | |||
| 586 | #endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */ | ||
| 587 | __END_DECLS | ||
| 588 | #if __has_feature(assume_nonnull) | ||
| 589 | _Pragma("clang assume_nonnull end") | ||
| 590 | #endif | ||
| 591 | |||
| 592 | #endif /* _PTHREAD_H */ | ||
lib/libc/include/x86_64-macos-gnu/pthread/pthread_impl.h created+66| ... | @@ -0,0 +1,66 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _PTHREAD_IMPL_H_ | ||
| 25 | #define _PTHREAD_IMPL_H_ | ||
| 26 | /* | ||
| 27 | * Internal implementation details | ||
| 28 | */ | ||
| 29 | |||
| 30 | /* This whole header file will disappear, so don't depend on it... */ | ||
| 31 | |||
| 32 | #if __has_feature(assume_nonnull) | ||
| 33 | _Pragma("clang assume_nonnull begin") | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #ifndef __POSIX_LIB__ | ||
| 37 | |||
| 38 | /* | ||
| 39 | * [Internal] data structure signatures | ||
| 40 | */ | ||
| 41 | #define _PTHREAD_MUTEX_SIG_init		0x32AAABA7 | ||
| 42 | |||
| 43 | #define _PTHREAD_ERRORCHECK_MUTEX_SIG_init 0x32AAABA1 | ||
| 44 | #define _PTHREAD_RECURSIVE_MUTEX_SIG_init 0x32AAABA2 | ||
| 45 | #define _PTHREAD_FIRSTFIT_MUTEX_SIG_init 0x32AAABA3 | ||
| 46 | |||
| 47 | #define _PTHREAD_COND_SIG_init		0x3CB0B1BB | ||
| 48 | #define _PTHREAD_ONCE_SIG_init		0x30B1BCBA | ||
| 49 | #define _PTHREAD_RWLOCK_SIG_init 0x2DA8B3B4 | ||
| 50 | |||
| 51 | /* | ||
| 52 | * POSIX scheduling policies | ||
| 53 | */ | ||
| 54 | #define SCHED_OTHER 1 | ||
| 55 | #define SCHED_FIFO 4 | ||
| 56 | #define SCHED_RR 2 | ||
| 57 | |||
| 58 | #define __SCHED_PARAM_SIZE__ 4 | ||
| 59 | |||
| 60 | #endif /* __POSIX_LIB__ */ | ||
| 61 | |||
| 62 | #if __has_feature(assume_nonnull) | ||
| 63 | _Pragma("clang assume_nonnull end") | ||
| 64 | #endif | ||
| 65 | |||
| 66 | #endif /* _PTHREAD_IMPL_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/pthread/qos.h created+304| ... | @@ -0,0 +1,304 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2013-2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _PTHREAD_QOS_H | ||
| 25 | #define _PTHREAD_QOS_H | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <sys/_pthread/_pthread_attr_t.h> /* pthread_attr_t */ | ||
| 29 | #include <sys/_pthread/_pthread_t.h> /* pthread_t */ | ||
| 30 | #include <Availability.h> | ||
| 31 | |||
| 32 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 33 | |||
| 34 | #include <sys/qos.h> | ||
| 35 | |||
| 36 | #ifndef KERNEL | ||
| 37 | |||
| 38 | #if __has_feature(assume_nonnull) | ||
| 39 | _Pragma("clang assume_nonnull begin") | ||
| 40 | #endif | ||
| 41 | __BEGIN_DECLS | ||
| 42 | |||
| 43 | /*! | ||
| 44 | * @function pthread_attr_set_qos_class_np | ||
| 45 | * | ||
| 46 | * @abstract | ||
| 47 | * Sets the QOS class and relative priority of a pthread attribute structure | ||
| 48 | * which may be used to specify the requested QOS class of newly created | ||
| 49 | * threads. | ||
| 50 | * | ||
| 51 | * @discussion | ||
| 52 | * The QOS class and relative priority represent an overall combination of | ||
| 53 | * system quality of service attributes on a thread. | ||
| 54 | * | ||
| 55 | * Subsequent calls to interfaces such as pthread_attr_setschedparam() that are | ||
| 56 | * incompatible or in conflict with the QOS class system will unset the QOS | ||
| 57 | * class requested with this interface and pthread_attr_get_qos_class_np() will | ||
| 58 | * return QOS_CLASS_UNSPECIFIED. | ||
| 59 | * | ||
| 60 | * @param __attr | ||
| 61 | * The pthread attribute structure to modify. | ||
| 62 | * | ||
| 63 | * @param __qos_class | ||
| 64 | * A QOS class value: | ||
| 65 | *	- QOS_CLASS_USER_INTERACTIVE | ||
| 66 | *	- QOS_CLASS_USER_INITIATED | ||
| 67 | *	- QOS_CLASS_DEFAULT | ||
| 68 | *	- QOS_CLASS_UTILITY | ||
| 69 | *	- QOS_CLASS_BACKGROUND | ||
| 70 | * EINVAL will be returned if any other value is provided. | ||
| 71 | * | ||
| 72 | * @param __relative_priority | ||
| 73 | * A relative priority within the QOS class. This value is a negative offset | ||
| 74 | * from the maximum supported scheduler priority for the given class. | ||
| 75 | * EINVAL will be returned if the value is greater than zero or less than | ||
| 76 | * QOS_MIN_RELATIVE_PRIORITY. | ||
| 77 | * | ||
| 78 | * @return | ||
| 79 | * Zero if successful, otherwise an errno value. | ||
| 80 | */ | ||
| 81 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 82 | int | ||
| 83 | pthread_attr_set_qos_class_np(pthread_attr_t *__attr, | ||
| 84 | 		qos_class_t __qos_class, int __relative_priority); | ||
| 85 | |||
| 86 | /*! | ||
| 87 | * @function pthread_attr_get_qos_class_np | ||
| 88 | * | ||
| 89 | * @abstract | ||
| 90 | * Gets the QOS class and relative priority of a pthread attribute structure. | ||
| 91 | * | ||
| 92 | * @param __attr | ||
| 93 | * The pthread attribute structure to inspect. | ||
| 94 | * | ||
| 95 | * @param __qos_class | ||
| 96 | * On output, a QOS class value: | ||
| 97 | *	- QOS_CLASS_USER_INTERACTIVE | ||
| 98 | *	- QOS_CLASS_USER_INITIATED | ||
| 99 | *	- QOS_CLASS_DEFAULT | ||
| 100 | *	- QOS_CLASS_UTILITY | ||
| 101 | *	- QOS_CLASS_BACKGROUND | ||
| 102 | *	- QOS_CLASS_UNSPECIFIED | ||
| 103 | * This value may be NULL in which case no value is returned. | ||
| 104 | * | ||
| 105 | * @param __relative_priority | ||
| 106 | * On output, a relative priority offset within the QOS class. | ||
| 107 | * This value may be NULL in which case no value is returned. | ||
| 108 | * | ||
| 109 | * @return | ||
| 110 | * Zero if successful, otherwise an errno value. | ||
| 111 | */ | ||
| 112 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 113 | int | ||
| 114 | pthread_attr_get_qos_class_np(pthread_attr_t * __restrict __attr, | ||
| 115 | 		qos_class_t * _Nullable __restrict __qos_class, | ||
| 116 | 		int * _Nullable __restrict __relative_priority); | ||
| 117 | |||
| 118 | /*! | ||
| 119 | * @function pthread_set_qos_class_self_np | ||
| 120 | * | ||
| 121 | * @abstract | ||
| 122 | * Sets the requested QOS class and relative priority of the current thread. | ||
| 123 | * | ||
| 124 | * @discussion | ||
| 125 | * The QOS class and relative priority represent an overall combination of | ||
| 126 | * system quality of service attributes on a thread. | ||
| 127 | * | ||
| 128 | * Subsequent calls to interfaces such as pthread_setschedparam() that are | ||
| 129 | * incompatible or in conflict with the QOS class system will unset the QOS | ||
| 130 | * class requested with this interface and pthread_get_qos_class_np() will | ||
| 131 | * return QOS_CLASS_UNSPECIFIED thereafter. A thread so modified is permanently | ||
| 132 | * opted-out of the QOS class system and calls to this function to request a QOS | ||
| 133 | * class for such a thread will fail and return EPERM. | ||
| 134 | * | ||
| 135 | * @param __qos_class | ||
| 136 | * A QOS class value: | ||
| 137 | *	- QOS_CLASS_USER_INTERACTIVE | ||
| 138 | *	- QOS_CLASS_USER_INITIATED | ||
| 139 | *	- QOS_CLASS_DEFAULT | ||
| 140 | *	- QOS_CLASS_UTILITY | ||
| 141 | *	- QOS_CLASS_BACKGROUND | ||
| 142 | * EINVAL will be returned if any other value is provided. | ||
| 143 | * | ||
| 144 | * @param __relative_priority | ||
| 145 | * A relative priority within the QOS class. This value is a negative offset | ||
| 146 | * from the maximum supported scheduler priority for the given class. | ||
| 147 | * EINVAL will be returned if the value is greater than zero or less than | ||
| 148 | * QOS_MIN_RELATIVE_PRIORITY. | ||
| 149 | * | ||
| 150 | * @return | ||
| 151 | * Zero if successful, otherwise an errno value. | ||
| 152 | */ | ||
| 153 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 154 | int | ||
| 155 | pthread_set_qos_class_self_np(qos_class_t __qos_class, | ||
| 156 | 		int __relative_priority); | ||
| 157 | |||
| 158 | /*! | ||
| 159 | * @function pthread_get_qos_class_np | ||
| 160 | * | ||
| 161 | * @abstract | ||
| 162 | * Gets the requested QOS class and relative priority of a thread. | ||
| 163 | * | ||
| 164 | * @param __pthread | ||
| 165 | * The target thread to inspect. | ||
| 166 | * | ||
| 167 | * @param __qos_class | ||
| 168 | * On output, a QOS class value: | ||
| 169 | *	- QOS_CLASS_USER_INTERACTIVE | ||
| 170 | *	- QOS_CLASS_USER_INITIATED | ||
| 171 | *	- QOS_CLASS_DEFAULT | ||
| 172 | *	- QOS_CLASS_UTILITY | ||
| 173 | *	- QOS_CLASS_BACKGROUND | ||
| 174 | *	- QOS_CLASS_UNSPECIFIED | ||
| 175 | * This value may be NULL in which case no value is returned. | ||
| 176 | * | ||
| 177 | * @param __relative_priority | ||
| 178 | * On output, a relative priority offset within the QOS class. | ||
| 179 | * This value may be NULL in which case no value is returned. | ||
| 180 | * | ||
| 181 | * @return | ||
| 182 | * Zero if successful, otherwise an errno value. | ||
| 183 | */ | ||
| 184 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 185 | int | ||
| 186 | pthread_get_qos_class_np(pthread_t __pthread, | ||
| 187 | 		qos_class_t * _Nullable __restrict __qos_class, | ||
| 188 | 		int * _Nullable __restrict __relative_priority); | ||
| 189 | |||
| 190 | /*! | ||
| 191 | * @typedef pthread_override_t | ||
| 192 | * | ||
| 193 | * @abstract | ||
| 194 | * An opaque object representing a QOS class override of a thread. | ||
| 195 | * | ||
| 196 | * @discussion | ||
| 197 | * A QOS class override of a target thread expresses that an item of pending | ||
| 198 | * work classified with a specific QOS class and relative priority depends on | ||
| 199 | * the completion of the work currently being executed by the thread (e.g. due | ||
| 200 | * to ordering requirements). | ||
| 201 | * | ||
| 202 | * While overrides are in effect, the target thread will execute at the maximum | ||
| 203 | * QOS class and relative priority of all overrides and of the QOS class | ||
| 204 | * requested by the thread itself. | ||
| 205 | * | ||
| 206 | * A QOS class override does not modify the target thread's requested QOS class | ||
| 207 | * value and the effect of an override is not visible to the qos_class_self() | ||
| 208 | * and pthread_get_qos_class_np() interfaces. | ||
| 209 | */ | ||
| 210 | |||
| 211 | typedef struct pthread_override_s* pthread_override_t; | ||
| 212 | |||
| 213 | /*! | ||
| 214 | * @function pthread_override_qos_class_start_np | ||
| 215 | * | ||
| 216 | * @abstract | ||
| 217 | * Starts a QOS class override of the specified target thread. | ||
| 218 | * | ||
| 219 | * @discussion | ||
| 220 | * Starting a QOS class override of the specified target thread expresses that | ||
| 221 | * an item of pending work classified with the specified QOS class and relative | ||
| 222 | * priority depends on the completion of the work currently being executed by | ||
| 223 | * the thread (e.g. due to ordering requirements). | ||
| 224 | * | ||
| 225 | * While overrides are in effect, the specified target thread will execute at | ||
| 226 | * the maximum QOS class and relative priority of all overrides and of the QOS | ||
| 227 | * class requested by the thread itself. | ||
| 228 | * | ||
| 229 | * Starting a QOS class override does not modify the target thread's requested | ||
| 230 | * QOS class value and the effect of an override is not visible to the | ||
| 231 | * qos_class_self() and pthread_get_qos_class_np() interfaces. | ||
| 232 | * | ||
| 233 | * The returned newly allocated override object is intended to be associated | ||
| 234 | * with the item of pending work in question. Once the dependency has been | ||
| 235 | * satisfied and enabled that work to begin executing, the QOS class override | ||
| 236 | * must be ended by passing the associated override object to | ||
| 237 | * pthread_override_qos_class_end_np(). Failure to do so will result in the | ||
| 238 | * associated resources to be leaked and the target thread to be permanently | ||
| 239 | * executed at an inappropriately elevated QOS class. | ||
| 240 | * | ||
| 241 | * @param __pthread | ||
| 242 | * The target thread to modify. | ||
| 243 | * | ||
| 244 | * @param __qos_class | ||
| 245 | * A QOS class value: | ||
| 246 | *	- QOS_CLASS_USER_INTERACTIVE | ||
| 247 | *	- QOS_CLASS_USER_INITIATED | ||
| 248 | *	- QOS_CLASS_DEFAULT | ||
| 249 | *	- QOS_CLASS_UTILITY | ||
| 250 | *	- QOS_CLASS_BACKGROUND | ||
| 251 | * NULL will be returned if any other value is provided. | ||
| 252 | * | ||
| 253 | * @param __relative_priority | ||
| 254 | * A relative priority within the QOS class. This value is a negative offset | ||
| 255 | * from the maximum supported scheduler priority for the given class. | ||
| 256 | * NULL will be returned if the value is greater than zero or less than | ||
| 257 | * QOS_MIN_RELATIVE_PRIORITY. | ||
| 258 | * | ||
| 259 | * @return | ||
| 260 | * A newly allocated override object if successful, or NULL if the override | ||
| 261 | * could not be started. | ||
| 262 | */ | ||
| 263 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 264 | pthread_override_t | ||
| 265 | pthread_override_qos_class_start_np(pthread_t __pthread, | ||
| 266 | 		qos_class_t __qos_class, int __relative_priority); | ||
| 267 | |||
| 268 | /*! | ||
| 269 | * @function pthread_override_qos_class_end_np | ||
| 270 | * | ||
| 271 | * @abstract | ||
| 272 | * Ends a QOS class override. | ||
| 273 | * | ||
| 274 | * @discussion | ||
| 275 | * Passing an override object returned by pthread_override_qos_class_start_np() | ||
| 276 | * ends the QOS class override started by that call and deallocates all | ||
| 277 | * associated resources as well as the override object itself. | ||
| 278 | * | ||
| 279 | * The thread starting and the thread ending a QOS class override need not be | ||
| 280 | * identical. If the thread ending the override is the the target thread of the | ||
| 281 | * override itself, it should take care to elevate its requested QOS class | ||
| 282 | * appropriately with pthread_set_qos_class_self_np() before ending the | ||
| 283 | * override. | ||
| 284 | * | ||
| 285 | * @param __override | ||
| 286 | * An override object returned by pthread_override_qos_class_start_np(). | ||
| 287 | * | ||
| 288 | * @return | ||
| 289 | * Zero if successful, otherwise an errno value. | ||
| 290 | */ | ||
| 291 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 292 | int | ||
| 293 | pthread_override_qos_class_end_np(pthread_override_t __override); | ||
| 294 | |||
| 295 | __END_DECLS | ||
| 296 | #if __has_feature(assume_nonnull) | ||
| 297 | _Pragma("clang assume_nonnull end") | ||
| 298 | #endif | ||
| 299 | |||
| 300 | #endif // KERNEL | ||
| 301 | |||
| 302 | #endif // __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 303 | |||
| 304 | #endif // _PTHREAD_QOS_H | ||
lib/libc/include/x86_64-macos-gnu/pthread/sched.h created+46| ... | @@ -0,0 +1,46 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _SCHED_H_ | ||
| 25 | #define _SCHED_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <pthread/pthread_impl.h> | ||
| 29 | |||
| 30 | __BEGIN_DECLS | ||
| 31 | /* | ||
| 32 | * Scheduling paramters | ||
| 33 | */ | ||
| 34 | #ifndef __POSIX_LIB__ | ||
| 35 | struct sched_param { int sched_priority; char __opaque[__SCHED_PARAM_SIZE__]; }; | ||
| 36 | #else | ||
| 37 | struct sched_param; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | extern int sched_yield(void); | ||
| 41 | extern int sched_get_priority_min(int); | ||
| 42 | extern int sched_get_priority_max(int); | ||
| 43 | __END_DECLS | ||
| 44 | |||
| 45 | #endif /* _SCHED_H_ */ | ||
| 46 | |||
lib/libc/include/x86_64-macos-gnu/pwd.h created+119| ... | @@ -0,0 +1,119 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 1989, 1993 | ||
| 3 | *	The Regents of the University of California. All rights reserved. | ||
| 4 | * (c) UNIX System Laboratories, Inc. | ||
| 5 | * All or some portions of this file are derived from material licensed | ||
| 6 | * to the University of California by American Telephone and Telegraph | ||
| 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 8 | * the permission of UNIX System Laboratories, Inc. | ||
| 9 | * Portions Copyright(C) 1995, Jason Downs. All rights reserved. | ||
| 10 | * | ||
| 11 | * Redistribution and use in source and binary forms, with or without | ||
| 12 | * modification, are permitted provided that the following conditions | ||
| 13 | * are met: | ||
| 14 | * 1. Redistributions of source code must retain the above copyright | ||
| 15 | * notice, this list of conditions and the following disclaimer. | ||
| 16 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 17 | * notice, this list of conditions and the following disclaimer in the | ||
| 18 | * documentation and/or other materials provided with the distribution. | ||
| 19 | * 3. All advertising materials mentioning features or use of this software | ||
| 20 | * must display the following acknowledgement: | ||
| 21 | *	This product includes software developed by the University of | ||
| 22 | *	California, Berkeley and its contributors. | ||
| 23 | * 4. Neither the name of the University nor the names of its contributors | ||
| 24 | * may be used to endorse or promote products derived from this software | ||
| 25 | * without specific prior written permission. | ||
| 26 | * | ||
| 27 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 28 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 30 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 31 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 32 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 33 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 34 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 35 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 36 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 37 | * SUCH DAMAGE. | ||
| 38 | * | ||
| 39 | *	@(#)pwd.h	8.2 (Berkeley) 1/21/94 | ||
| 40 | */ | ||
| 41 | /* Portions copyright (c) 2000-2011 Apple Inc. All rights reserved. */ | ||
| 42 | |||
| 43 | #ifndef _PWD_H_ | ||
| 44 | #define	_PWD_H_ | ||
| 45 | |||
| 46 | #include <_types.h> | ||
| 47 | #include <sys/_types/_gid_t.h> | ||
| 48 | #include <sys/_types/_size_t.h> | ||
| 49 | #include <sys/_types/_uid_t.h> | ||
| 50 | |||
| 51 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 52 | #define	_PATH_PWD		"/etc" | ||
| 53 | #define	_PATH_PASSWD		"/etc/passwd" | ||
| 54 | #define	_PASSWD			"passwd" | ||
| 55 | #define	_PATH_MASTERPASSWD	"/etc/master.passwd" | ||
| 56 | #define	_PATH_MASTERPASSWD_LOCK	"/etc/ptmp" | ||
| 57 | #define	_MASTERPASSWD		"master.passwd" | ||
| 58 | |||
| 59 | #define	_PATH_MP_DB		"/etc/pwd.db" | ||
| 60 | #define	_MP_DB			"pwd.db" | ||
| 61 | #define	_PATH_SMP_DB		"/etc/spwd.db" | ||
| 62 | #define	_SMP_DB			"spwd.db" | ||
| 63 | |||
| 64 | #define	_PATH_PWD_MKDB		"/usr/sbin/pwd_mkdb" | ||
| 65 | |||
| 66 | #define	_PW_KEYBYNAME		'1'	/* stored by name */ | ||
| 67 | #define	_PW_KEYBYNUM		'2'	/* stored by entry in the "file" */ | ||
| 68 | #define	_PW_KEYBYUID		'3'	/* stored by uid */ | ||
| 69 | |||
| 70 | #define	_PASSWORD_EFMT1		'_'	/* extended encryption format */ | ||
| 71 | |||
| 72 | #define	_PASSWORD_LEN		128	/* max length, not counting NULL */ | ||
| 73 | |||
| 74 | #define _PASSWORD_NOUID		0x01	/* flag for no specified uid. */ | ||
| 75 | #define _PASSWORD_NOGID		0x02	/* flag for no specified gid. */ | ||
| 76 | #define _PASSWORD_NOCHG		0x04	/* flag for no specified change. */ | ||
| 77 | #define _PASSWORD_NOEXP		0x08	/* flag for no specified expire. */ | ||
| 78 | |||
| 79 | #define _PASSWORD_WARNDAYS	14	/* days to warn about expiry */ | ||
| 80 | #define _PASSWORD_CHGNOW	-1	/* special day to force password | ||
| 81 | 					 * change at next login */ | ||
| 82 | #endif | ||
| 83 | |||
| 84 | struct passwd { | ||
| 85 | 	char	*pw_name;		/* user name */ | ||
| 86 | 	char	*pw_passwd;		/* encrypted password */ | ||
| 87 | 	uid_t	pw_uid;			/* user uid */ | ||
| 88 | 	gid_t	pw_gid;			/* user gid */ | ||
| 89 | 	__darwin_time_t pw_change;		/* password change time */ | ||
| 90 | 	char	*pw_class;		/* user access class */ | ||
| 91 | 	char	*pw_gecos;		/* Honeywell login info */ | ||
| 92 | 	char	*pw_dir;		/* home directory */ | ||
| 93 | 	char	*pw_shell;		/* default shell */ | ||
| 94 | 	__darwin_time_t pw_expire;		/* account expiration */ | ||
| 95 | }; | ||
| 96 | |||
| 97 | #include <sys/cdefs.h> | ||
| 98 | |||
| 99 | __BEGIN_DECLS | ||
| 100 | struct passwd	*getpwuid(uid_t); | ||
| 101 | struct passwd	*getpwnam(const char *); | ||
| 102 | int		 getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); | ||
| 103 | int		 getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **); | ||
| 104 | struct passwd	*getpwent(void); | ||
| 105 | void		 setpwent(void); | ||
| 106 | void		 endpwent(void); | ||
| 107 | __END_DECLS | ||
| 108 | |||
| 109 | #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) | ||
| 110 | #include <uuid/uuid.h> | ||
| 111 | __BEGIN_DECLS | ||
| 112 | int		 setpassent(int); | ||
| 113 | char 		*user_from_uid(uid_t, int); | ||
| 114 | struct passwd	*getpwuuid(uuid_t); | ||
| 115 | int		 getpwuuid_r(uuid_t, struct passwd *, char *, size_t, struct passwd **); | ||
| 116 | __END_DECLS | ||
| 117 | #endif | ||
| 118 | |||
| 119 | #endif /* !_PWD_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/regex.h created+217| ... | @@ -0,0 +1,217 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2011 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /* | ||
| 24 | * Copyright (c) 2001-2009 Ville Laurikari <vl@iki.fi> | ||
| 25 | * All rights reserved. | ||
| 26 | * | ||
| 27 | * Redistribution and use in source and binary forms, with or without | ||
| 28 | * modification, are permitted provided that the following conditions | ||
| 29 | * are met: | ||
| 30 | * | ||
| 31 | * 1. Redistributions of source code must retain the above copyright | ||
| 32 | * notice, this list of conditions and the following disclaimer. | ||
| 33 | * | ||
| 34 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 35 | * notice, this list of conditions and the following disclaimer in the | ||
| 36 | * documentation and/or other materials provided with the distribution. | ||
| 37 | * | ||
| 38 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS | ||
| 39 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 40 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 41 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 42 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 43 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 44 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 45 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 46 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 47 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 48 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 49 | */ | ||
| 50 | /*- | ||
| 51 | * Copyright (c) 1992 Henry Spencer. | ||
| 52 | * Copyright (c) 1992, 1993 | ||
| 53 | *	The Regents of the University of California. All rights reserved. | ||
| 54 | * | ||
| 55 | * This code is derived from software contributed to Berkeley by | ||
| 56 | * Henry Spencer of the University of Toronto. | ||
| 57 | * | ||
| 58 | * Redistribution and use in source and binary forms, with or without | ||
| 59 | * modification, are permitted provided that the following conditions | ||
| 60 | * are met: | ||
| 61 | * 1. Redistributions of source code must retain the above copyright | ||
| 62 | * notice, this list of conditions and the following disclaimer. | ||
| 63 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 64 | * notice, this list of conditions and the following disclaimer in the | ||
| 65 | * documentation and/or other materials provided with the distribution. | ||
| 66 | * 3. All advertising materials mentioning features or use of this software | ||
| 67 | * must display the following acknowledgement: | ||
| 68 | *	This product includes software developed by the University of | ||
| 69 | *	California, Berkeley and its contributors. | ||
| 70 | * 4. Neither the name of the University nor the names of its contributors | ||
| 71 | * may be used to endorse or promote products derived from this software | ||
| 72 | * without specific prior written permission. | ||
| 73 | * | ||
| 74 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 75 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 76 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 77 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 78 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 79 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 80 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 81 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 82 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 83 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 84 | * SUCH DAMAGE. | ||
| 85 | * | ||
| 86 | *	@(#)regex.h	8.2 (Berkeley) 1/3/94 | ||
| 87 | */ | ||
| 88 | |||
| 89 | #ifndef _REGEX_H_ | ||
| 90 | #define	_REGEX_H_ | ||
| 91 | |||
| 92 | #include <_regex.h> | ||
| 93 | |||
| 94 | /*******************/ | ||
| 95 | /* regcomp() flags */ | ||
| 96 | /*******************/ | ||
| 97 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 98 | #define	REG_BASIC	0000	/* Basic regular expressions (synonym for 0) */ | ||
| 99 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 100 | |||
| 101 | #define	REG_EXTENDED	0001	/* Extended regular expressions */ | ||
| 102 | #define	REG_ICASE	0002	/* Compile ignoring upper/lower case */ | ||
| 103 | #define	REG_NOSUB	0004	/* Compile only reporting success/failure */ | ||
| 104 | #define	REG_NEWLINE	0010	/* Compile for newline-sensitive matching */ | ||
| 105 | |||
| 106 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 107 | #define	REG_NOSPEC	0020	/* Compile turning off all special characters */ | ||
| 108 | |||
| 109 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ | ||
| 110 | || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ | ||
| 111 | || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) | ||
| 112 | #define	REG_LITERAL	REG_NOSPEC | ||
| 113 | #endif | ||
| 114 | |||
| 115 | #define	REG_PEND	0040	/* Use re_endp as end pointer */ | ||
| 116 | |||
| 117 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ | ||
| 118 | || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ | ||
| 119 | || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) | ||
| 120 | #define	REG_MINIMAL	0100	/* Compile using minimal repetition */ | ||
| 121 | #define	REG_UNGREEDY	REG_MINIMAL | ||
| 122 | #endif | ||
| 123 | |||
| 124 | #define	REG_DUMP	0200	/* Unused */ | ||
| 125 | |||
| 126 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ | ||
| 127 | || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ | ||
| 128 | || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) | ||
| 129 | #define	REG_ENHANCED	0400	/* Additional (non-POSIX) features */ | ||
| 130 | #endif | ||
| 131 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 132 | |||
| 133 | /********************/ | ||
| 134 | /* regerror() flags */ | ||
| 135 | /********************/ | ||
| 136 | #define	REG_ENOSYS	 (-1)	/* Reserved */ | ||
| 137 | #define	REG_NOMATCH	 1	/* regexec() function failed to match */ | ||
| 138 | #define	REG_BADPAT	 2	/* invalid regular expression */ | ||
| 139 | #define	REG_ECOLLATE	 3	/* invalid collating element */ | ||
| 140 | #define	REG_ECTYPE	 4	/* invalid character class */ | ||
| 141 | #define	REG_EESCAPE	 5	/* trailing backslash (\) */ | ||
| 142 | #define	REG_ESUBREG	 6	/* invalid backreference number */ | ||
| 143 | #define	REG_EBRACK	 7	/* brackets ([ ]) not balanced */ | ||
| 144 | #define	REG_EPAREN	 8	/* parentheses not balanced */ | ||
| 145 | #define	REG_EBRACE	 9	/* braces not balanced */ | ||
| 146 | #define	REG_BADBR	10	/* invalid repetition count(s) */ | ||
| 147 | #define	REG_ERANGE	11	/* invalid character range */ | ||
| 148 | #define	REG_ESPACE	12	/* out of memory */ | ||
| 149 | #define	REG_BADRPT	13	/* repetition-operator operand invalid */ | ||
| 150 | |||
| 151 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 152 | #define	REG_EMPTY	14	/* Unused */ | ||
| 153 | #define	REG_ASSERT	15	/* Unused */ | ||
| 154 | #define	REG_INVARG	16	/* invalid argument to regex routine */ | ||
| 155 | #define	REG_ILLSEQ	17	/* illegal byte sequence */ | ||
| 156 | |||
| 157 | #define	REG_ATOI	255	/* convert name to number (!) */ | ||
| 158 | #define	REG_ITOA	0400	/* convert number to name (!) */ | ||
| 159 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 160 | |||
| 161 | /*******************/ | ||
| 162 | /* regexec() flags */ | ||
| 163 | /*******************/ | ||
| 164 | #define	REG_NOTBOL	00001	/* First character not at beginning of line */ | ||
| 165 | #define	REG_NOTEOL	00002	/* Last character not at end of line */ | ||
| 166 | |||
| 167 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 168 | #define	REG_STARTEND	00004	/* String start/end in pmatch[0] */ | ||
| 169 | #define	REG_TRACE	00400	/* Unused */ | ||
| 170 | #define	REG_LARGE	01000	/* Unused */ | ||
| 171 | #define	REG_BACKR	02000	/* force use of backref code */ | ||
| 172 | |||
| 173 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \ | ||
| 174 | || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \ | ||
| 175 | || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) | ||
| 176 | #define	REG_BACKTRACKING_MATCHER	REG_BACKR | ||
| 177 | #endif | ||
| 178 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 179 | |||
| 180 | __BEGIN_DECLS | ||
| 181 | int	regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp); | ||
| 182 | size_t	regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold; | ||
| 183 | /* | ||
| 184 | * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround, | ||
| 185 | * a dummy argument name is added. | ||
| 186 | */ | ||
| 187 | int	regexec(const regex_t * __restrict, const char * __restrict, size_t, | ||
| 188 | 	 regmatch_t __pmatch[ __restrict], int); | ||
| 189 | void	regfree(regex_t *); | ||
| 190 | |||
| 191 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 192 | |||
| 193 | /* Darwin extensions */ | ||
| 194 | int	regncomp(regex_t * __restrict, const char * __restrict, size_t, int) | ||
| 195 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 196 | int	regnexec(const regex_t * __restrict, const char * __restrict, size_t, | ||
| 197 | 	 size_t, regmatch_t __pmatch[ __restrict], int) | ||
| 198 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 199 | int	regwcomp(regex_t * __restrict, const wchar_t * __restrict, int) | ||
| 200 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 201 | int	regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t, | ||
| 202 | 	 regmatch_t __pmatch[ __restrict], int) | ||
| 203 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 204 | int	regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int) | ||
| 205 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 206 | int	regwnexec(const regex_t * __restrict, const wchar_t * __restrict, | ||
| 207 | 	 size_t, size_t, regmatch_t __pmatch[ __restrict], int) | ||
| 208 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 209 | |||
| 210 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 211 | __END_DECLS | ||
| 212 | |||
| 213 | #ifdef _USE_EXTENDED_LOCALES_ | ||
| 214 | #include <xlocale/_regex.h> | ||
| 215 | #endif /* _USE_EXTENDED_LOCALES_ */ | ||
| 216 | |||
| 217 | #endif /* !_REGEX_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sched.h created+46| ... | @@ -0,0 +1,46 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _SCHED_H_ | ||
| 25 | #define _SCHED_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <pthread/pthread_impl.h> | ||
| 29 | |||
| 30 | __BEGIN_DECLS | ||
| 31 | /* | ||
| 32 | * Scheduling paramters | ||
| 33 | */ | ||
| 34 | #ifndef __POSIX_LIB__ | ||
| 35 | struct sched_param { int sched_priority; char __opaque[__SCHED_PARAM_SIZE__]; }; | ||
| 36 | #else | ||
| 37 | struct sched_param; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | extern int sched_yield(void); | ||
| 41 | extern int sched_get_priority_min(int); | ||
| 42 | extern int sched_get_priority_max(int); | ||
| 43 | __END_DECLS | ||
| 44 | |||
| 45 | #endif /* _SCHED_H_ */ | ||
| 46 | |||
lib/libc/include/x86_64-macos-gnu/search.h created+62| ... | @@ -0,0 +1,62 @@ | ||
| 1 | /*- | ||
| 2 | * Written by J.T. Conklin <jtc@netbsd.org> | ||
| 3 | * Public domain. | ||
| 4 | * | ||
| 5 | *	$NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ | ||
| 6 | * $FreeBSD: src/include/search.h,v 1.10 2002/10/16 14:29:23 robert Exp $ | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _SEARCH_H_ | ||
| 10 | #define _SEARCH_H_ | ||
| 11 | |||
| 12 | #include <sys/cdefs.h> | ||
| 13 | #include <_types.h> | ||
| 14 | #include <sys/_types/_size_t.h> | ||
| 15 | |||
| 16 | typedef	struct entry { | ||
| 17 | 	char	*key; | ||
| 18 | 	void	*data; | ||
| 19 | } ENTRY; | ||
| 20 | |||
| 21 | typedef	enum { | ||
| 22 | 	FIND, ENTER | ||
| 23 | } ACTION; | ||
| 24 | |||
| 25 | typedef	enum { | ||
| 26 | 	preorder, | ||
| 27 | 	postorder, | ||
| 28 | 	endorder, | ||
| 29 | 	leaf | ||
| 30 | } VISIT; | ||
| 31 | |||
| 32 | #ifdef _SEARCH_PRIVATE | ||
| 33 | typedef	struct node { | ||
| 34 | 	char *key; | ||
| 35 | 	struct node *llink, *rlink; | ||
| 36 | } node_t; | ||
| 37 | |||
| 38 | struct que_elem { | ||
| 39 | 	struct que_elem *next; | ||
| 40 | 	struct que_elem *prev; | ||
| 41 | }; | ||
| 42 | #endif | ||
| 43 | |||
| 44 | __BEGIN_DECLS | ||
| 45 | int	 hcreate(size_t); | ||
| 46 | void	 hdestroy(void); | ||
| 47 | ENTRY	*hsearch(ENTRY, ACTION); | ||
| 48 | void	 insque(void *, void *); | ||
| 49 | void	*lfind(const void *, const void *, size_t *, size_t, | ||
| 50 | 	 int (*)(const void *, const void *)); | ||
| 51 | void	*lsearch(const void *, void *, size_t *, size_t, | ||
| 52 | 	 int (*)(const void *, const void *)); | ||
| 53 | void	 remque(void *); | ||
| 54 | void	*tdelete(const void * __restrict, void ** __restrict, | ||
| 55 | 	 int (*)(const void *, const void *)); | ||
| 56 | void	*tfind(const void *, void * const *, | ||
| 57 | 	 int (*)(const void *, const void *)); | ||
| 58 | void	*tsearch(const void *, void **, int (*)(const void *, const void *)); | ||
| 59 | void	 twalk(const void *, void (*)(const void *, VISIT, int)); | ||
| 60 | __END_DECLS | ||
| 61 | |||
| 62 | #endif /* !_SEARCH_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/semaphore.h created+31| ... | @@ -0,0 +1,31 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #ifndef _BSD_SEMAPHORE_H | ||
| 24 | #define _BSD_SEMAPHORE_H | ||
| 25 | |||
| 26 | #include <sys/types.h> | ||
| 27 | #include <sys/fcntl.h> | ||
| 28 | |||
| 29 | #include <sys/semaphore.h> | ||
| 30 | |||
| 31 | #endif /* _BSD_SEMAPHORE_H */ | ||
lib/libc/include/x86_64-macos-gnu/signal.h-5| ... | @@ -108,16 +108,11 @@ int	sigvec(int, struct sigvec *, struct sigvec *); | ... | @@ -108,16 +108,11 @@ int	sigvec(int, struct sigvec *, struct sigvec *); |
| 108 | __END_DECLS | 108 | __END_DECLS |
| 109 | 109 | ||
| 110 | /* List definitions after function declarations, or Reiser cpp gets upset. */ | 110 | /* List definitions after function declarations, or Reiser cpp gets upset. */ |
| 111 | #if defined(__i386__) || defined(__x86_64__) | ||
| 112 | /* The left shift operator on intel is modulo 32 */ | ||
| 113 | __header_always_inline int | 111 | __header_always_inline int |
| 114 | __sigbits(int __signo) | 112 | __sigbits(int __signo) |
| 115 | { | 113 | { |
| 116 | return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); | 114 | return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); |
| 117 | } | 115 | } |
| 118 | #else /* !__i386__ && !__x86_64__ */ | ||
| 119 | #define __sigbits(signo)	(1 << ((signo) - 1)) | ||
| 120 | #endif /* __i386__ || __x86_64__ */ | ||
| 121 | 116 | ||
| 122 | #define	sigaddset(set, signo)	(*(set) |= __sigbits(signo), 0) | 117 | #define	sigaddset(set, signo)	(*(set) |= __sigbits(signo), 0) |
| 123 | #define	sigdelset(set, signo)	(*(set) &= ~__sigbits(signo), 0) | 118 | #define	sigdelset(set, signo)	(*(set) &= ~__sigbits(signo), 0) |
lib/libc/include/x86_64-macos-gnu/simd/base.h created+122| ... | @@ -0,0 +1,122 @@ | ||
| 1 | /*! @header | ||
| 2 | * This header defines macros used in the implementation of <simd/simd.h> | ||
| 3 | * types and functions. Even though they are exposed in a public header, | ||
| 4 | * the macros defined in this header are implementation details, and you | ||
| 5 | * should not use or rely on them. They may be changed or removed entirely | ||
| 6 | * in a future release. | ||
| 7 | * | ||
| 8 | * @copyright 2016-2017 Apple, Inc. All rights reserved. | ||
| 9 | * @unsorted */ | ||
| 10 | |||
| 11 | #ifndef SIMD_BASE | ||
| 12 | #define SIMD_BASE | ||
| 13 | |||
| 14 | /* Define __has_attribute and __has_include if they aren't available */ | ||
| 15 | # ifndef __has_attribute | ||
| 16 | # define __has_attribute(__x) 0 | ||
| 17 | # endif | ||
| 18 | # ifndef __has_include | ||
| 19 | # define __has_include(__x) 0 | ||
| 20 | # endif | ||
| 21 | # ifndef __has_feature | ||
| 22 | # define __has_feature(__x) 0 | ||
| 23 | # endif | ||
| 24 | |||
| 25 | # if __has_attribute(__ext_vector_type__) && __has_attribute(__overloadable__) | ||
| 26 | # define SIMD_COMPILER_HAS_REQUIRED_FEATURES 1 | ||
| 27 | # else | ||
| 28 | /* Your compiler is missing one or more features that are hard requirements | ||
| 29 | * for any <simd/simd.h> support. None of the types or functions defined by | ||
| 30 | * the simd headers will be available. */ | ||
| 31 | # define SIMD_COMPILER_HAS_REQUIRED_FEATURES 0 | ||
| 32 | # endif | ||
| 33 | |||
| 34 | # if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 35 | # if __has_include(<Availability.h>) | ||
| 36 | # include <Availability.h> | ||
| 37 | /* A number of new features are added in newer releases; most of these are | ||
| 38 | * inline in the header, which makes them available even when targeting older | ||
| 39 | * OS versions. Those that make external calls, however, are only available | ||
| 40 | * when targeting the release in which they became available. Because of the | ||
| 41 | * way in which simd functions are overloaded, the usual weak-linking tricks | ||
| 42 | * do not work; these functions are simply unavailable when targeting older | ||
| 43 | * versions of the library. */ | ||
| 44 | # if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 || \ | ||
| 45 | __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_11_0 || \ | ||
| 46 | __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_4_0 || \ | ||
| 47 | __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_11_0 || \ | ||
| 48 | __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_19_0 | ||
| 49 | # define SIMD_LIBRARY_VERSION 3 | ||
| 50 | # elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 || \ | ||
| 51 | __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0 || \ | ||
| 52 | __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0 || \ | ||
| 53 | __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0 | ||
| 54 | # define SIMD_LIBRARY_VERSION 2 | ||
| 55 | # elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || \ | ||
| 56 | __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0 | ||
| 57 | # define SIMD_LIBRARY_VERSION 1 | ||
| 58 | # else | ||
| 59 | # define SIMD_LIBRARY_VERSION 0 | ||
| 60 | # endif | ||
| 61 | # else /* !__has_include(<Availability.h>) */ | ||
| 62 | # define SIMD_LIBRARY_VERSION 3 | ||
| 63 | # define __API_AVAILABLE(...) /* Nothing */ | ||
| 64 | # endif | ||
| 65 | |||
| 66 | /* The simd types interoperate with the native simd intrinsic types for each | ||
| 67 | * architecture; the headers that define those types and operations are | ||
| 68 | * automatically included with simd.h */ | ||
| 69 | # if defined __ARM_NEON__ | ||
| 70 | # include <arm_neon.h> | ||
| 71 | # elif defined __i386__ || defined __x86_64__ | ||
| 72 | # include <immintrin.h> | ||
| 73 | # endif | ||
| 74 | |||
| 75 | /* Define a number of function attributes used by the simd functions. */ | ||
| 76 | # if __has_attribute(__always_inline__) | ||
| 77 | # define SIMD_INLINE __attribute__((__always_inline__)) | ||
| 78 | # else | ||
| 79 | # define SIMD_INLINE inline | ||
| 80 | # endif | ||
| 81 | |||
| 82 | # if __has_attribute(__const__) | ||
| 83 | # define SIMD_CONST __attribute__((__const__)) | ||
| 84 | # else | ||
| 85 | # define SIMD_CONST /* nothing */ | ||
| 86 | # endif | ||
| 87 | |||
| 88 | # if __has_attribute(__nodebug__) | ||
| 89 | # define SIMD_NODEBUG __attribute__((__nodebug__)) | ||
| 90 | # else | ||
| 91 | # define SIMD_NODEBUG /* nothing */ | ||
| 92 | # endif | ||
| 93 | |||
| 94 | # if __has_attribute(__deprecated__) | ||
| 95 | # define SIMD_DEPRECATED(message) __attribute__((__deprecated__(message))) | ||
| 96 | # else | ||
| 97 | # define SIMD_DEPRECATED(message) /* nothing */ | ||
| 98 | # endif | ||
| 99 | |||
| 100 | #define SIMD_OVERLOAD __attribute__((__overloadable__)) | ||
| 101 | #define SIMD_CPPFUNC SIMD_INLINE SIMD_CONST SIMD_NODEBUG | ||
| 102 | #define SIMD_CFUNC SIMD_CPPFUNC SIMD_OVERLOAD | ||
| 103 | #define SIMD_NOINLINE SIMD_CONST SIMD_NODEBUG SIMD_OVERLOAD | ||
| 104 | #define SIMD_NONCONST SIMD_INLINE SIMD_NODEBUG SIMD_OVERLOAD | ||
| 105 | #define __SIMD_INLINE__ SIMD_CPPFUNC | ||
| 106 | #define __SIMD_ATTRIBUTES__ SIMD_CFUNC | ||
| 107 | #define __SIMD_OVERLOAD__ SIMD_OVERLOAD | ||
| 108 | |||
| 109 | #if defined __cplusplus | ||
| 110 | /*! @abstract A boolean scalar. */ | ||
| 111 | typedef bool simd_bool; | ||
| 112 | #else | ||
| 113 | /*! @abstract A boolean scalar. */ | ||
| 114 | typedef _Bool simd_bool; | ||
| 115 | #endif | ||
| 116 | /*! @abstract A boolean scalar. | ||
| 117 | * @discussion This type is deprecated; In C or Objective-C sources, use | ||
| 118 | * `_Bool` instead. In C++ sources, use `bool`. */ | ||
| 119 | typedef simd_bool __SIMD_BOOLEAN_TYPE__; | ||
| 120 | |||
| 121 | # endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 122 | #endif /* defined SIMD_BASE */ | ||
lib/libc/include/x86_64-macos-gnu/simd/common.h created+4458| ... | @@ -0,0 +1,4458 @@ | ||
| 1 | /*! @header | ||
| 2 | * The interfaces declared in this header provide "common" elementwise | ||
| 3 | * operations that are neither math nor logic functions. These are available | ||
| 4 | * only for floating-point vectors and scalars, except for min, max, abs, | ||
| 5 | * clamp, and the reduce operations, which also support integer vectors. | ||
| 6 | * | ||
| 7 | * simd_abs(x) Absolute value of x. Also available as fabs | ||
| 8 | * for floating-point vectors. If x is the | ||
| 9 | * smallest signed integer, x is returned. | ||
| 10 | * | ||
| 11 | * simd_max(x,y) Returns the maximum of x and y. Also available | ||
| 12 | * as fmax for floating-point vectors. | ||
| 13 | * | ||
| 14 | * simd_min(x,y) Returns the minimum of x and y. Also available | ||
| 15 | * as fmin for floating-point vectors. | ||
| 16 | * | ||
| 17 | * simd_clamp(x,min,max) x clamped to the range [min, max]. | ||
| 18 | * | ||
| 19 | * simd_sign(x) -1 if x is less than zero, 0 if x is zero or | ||
| 20 | * NaN, and +1 if x is greater than zero. | ||
| 21 | * | ||
| 22 | * simd_mix(x,y,t) If t is not in the range [0,1], the result is | ||
| 23 | * undefined. Otherwise the result is x+(y-x)*t, | ||
| 24 | * which linearly interpolates between x and y. | ||
| 25 | * | ||
| 26 | * simd_recip(x) An approximation to 1/x. If x is very near the | ||
| 27 | * limits of representable values, or is infinity | ||
| 28 | * or NaN, the result is undefined. There are | ||
| 29 | * two variants of this function: | ||
| 30 | * | ||
| 31 | * simd_precise_recip(x) | ||
| 32 | * | ||
| 33 | * and | ||
| 34 | * | ||
| 35 | * simd_fast_recip(x). | ||
| 36 | * | ||
| 37 | * The "precise" variant is accurate to a few ULPs, | ||
| 38 | * whereas the "fast" variant may have as little | ||
| 39 | * as 11 bits of accuracy in float and about 22 | ||
| 40 | * bits in double. | ||
| 41 | * | ||
| 42 | * The function simd_recip(x) resolves to | ||
| 43 | * simd_precise_recip(x) ordinarily, but to | ||
| 44 | * simd_fast_recip(x) when used in a translation | ||
| 45 | * unit compiled with -ffast-math (when | ||
| 46 | * -ffast-math is in effect, you may still use the | ||
| 47 | * precise version of this function by calling it | ||
| 48 | * explicitly by name). | ||
| 49 | * | ||
| 50 | * simd_rsqrt(x) An approximation to 1/sqrt(x). If x is | ||
| 51 | * infinity or NaN, the result is undefined. | ||
| 52 | * There are two variants of this function: | ||
| 53 | * | ||
| 54 | * simd_precise_rsqrt(x) | ||
| 55 | * | ||
| 56 | * and | ||
| 57 | * | ||
| 58 | * simd_fast_rsqrt(x). | ||
| 59 | * | ||
| 60 | * The "precise" variant is accurate to a few ULPs, | ||
| 61 | * whereas the "fast" variant may have as little | ||
| 62 | * as 11 bits of accuracy in float and about 22 | ||
| 63 | * bits in double. | ||
| 64 | * | ||
| 65 | * The function simd_rsqrt(x) resolves to | ||
| 66 | * simd_precise_rsqrt(x) ordinarily, but to | ||
| 67 | * simd_fast_rsqrt(x) when used in a translation | ||
| 68 | * unit compiled with -ffast-math (when | ||
| 69 | * -ffast-math is in effect, you may still use the | ||
| 70 | * precise version of this function by calling it | ||
| 71 | * explicitly by name). | ||
| 72 | * | ||
| 73 | * simd_fract(x) The "fractional part" of x, which lies strictly | ||
| 74 | * in the range [0, 0x1.fffffep-1]. | ||
| 75 | * | ||
| 76 | * simd_step(edge,x) 0 if x < edge, and 1 otherwise. | ||
| 77 | * | ||
| 78 | * simd_smoothstep(edge0,edge1,x) 0 if x <= edge0, 1 if x >= edge1, and | ||
| 79 | * a Hermite interpolation between 0 and 1 if | ||
| 80 | * edge0 < x < edge1. | ||
| 81 | * | ||
| 82 | * simd_reduce_add(x) Sum of the elements of x. | ||
| 83 | * | ||
| 84 | * simd_reduce_min(x) Minimum of the elements of x. | ||
| 85 | * | ||
| 86 | * simd_reduce_max(x) Maximum of the elements of x. | ||
| 87 | * | ||
| 88 | * simd_equal(x,y) True if and only if every lane of x is equal | ||
| 89 | * to the corresponding lane of y. | ||
| 90 | * | ||
| 91 | * The following common functions are available in the simd:: namespace: | ||
| 92 | * | ||
| 93 | * C++ Function Equivalent C Function | ||
| 94 | * -------------------------------------------------------------------- | ||
| 95 | * simd::abs(x) simd_abs(x) | ||
| 96 | * simd::max(x,y) simd_max(x,y) | ||
| 97 | * simd::min(x,y) simd_min(x,y) | ||
| 98 | * simd::clamp(x,min,max) simd_clamp(x,min,max) | ||
| 99 | * simd::sign(x) simd_sign(x) | ||
| 100 | * simd::mix(x,y,t) simd_mix(x,y,t) | ||
| 101 | * simd::recip(x) simd_recip(x) | ||
| 102 | * simd::rsqrt(x) simd_rsqrt(x) | ||
| 103 | * simd::fract(x) simd_fract(x) | ||
| 104 | * simd::step(edge,x) simd_step(edge,x) | ||
| 105 | * simd::smoothstep(e0,e1,x) simd_smoothstep(e0,e1,x) | ||
| 106 | * simd::reduce_add(x) simd_reduce_add(x) | ||
| 107 | * simd::reduce_max(x) simd_reduce_max(x) | ||
| 108 | * simd::reduce_min(x) simd_reduce_min(x) | ||
| 109 | * simd::equal(x,y) simd_equal(x,y) | ||
| 110 | * | ||
| 111 | * simd::precise::recip(x) simd_precise_recip(x) | ||
| 112 | * simd::precise::rsqrt(x) simd_precise_rsqrt(x) | ||
| 113 | * | ||
| 114 | * simd::fast::recip(x) simd_fast_recip(x) | ||
| 115 | * simd::fast::rsqrt(x) simd_fast_rsqrt(x) | ||
| 116 | * | ||
| 117 | * @copyright 2014-2017 Apple, Inc. All rights reserved. | ||
| 118 | * @unsorted */ | ||
| 119 | |||
| 120 | #ifndef SIMD_COMMON_HEADER | ||
| 121 | #define SIMD_COMMON_HEADER | ||
| 122 | |||
| 123 | #include <simd/base.h> | ||
| 124 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 125 | #include <simd/vector_make.h> | ||
| 126 | #include <simd/logic.h> | ||
| 127 | #include <simd/math.h> | ||
| 128 | |||
| 129 | #ifdef __cplusplus | ||
| 130 | extern "C" { | ||
| 131 | #endif | ||
| 132 | |||
| 133 | /*! @abstract The elementwise absolute value of x. */ | ||
| 134 | static inline SIMD_CFUNC simd_char2 simd_abs(simd_char2 x); | ||
| 135 | /*! @abstract The elementwise absolute value of x. */ | ||
| 136 | static inline SIMD_CFUNC simd_char3 simd_abs(simd_char3 x); | ||
| 137 | /*! @abstract The elementwise absolute value of x. */ | ||
| 138 | static inline SIMD_CFUNC simd_char4 simd_abs(simd_char4 x); | ||
| 139 | /*! @abstract The elementwise absolute value of x. */ | ||
| 140 | static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x); | ||
| 141 | /*! @abstract The elementwise absolute value of x. */ | ||
| 142 | static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x); | ||
| 143 | /*! @abstract The elementwise absolute value of x. */ | ||
| 144 | static inline SIMD_CFUNC simd_char32 simd_abs(simd_char32 x); | ||
| 145 | /*! @abstract The elementwise absolute value of x. */ | ||
| 146 | static inline SIMD_CFUNC simd_char64 simd_abs(simd_char64 x); | ||
| 147 | /*! @abstract The elementwise absolute value of x. */ | ||
| 148 | static inline SIMD_CFUNC simd_short2 simd_abs(simd_short2 x); | ||
| 149 | /*! @abstract The elementwise absolute value of x. */ | ||
| 150 | static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x); | ||
| 151 | /*! @abstract The elementwise absolute value of x. */ | ||
| 152 | static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x); | ||
| 153 | /*! @abstract The elementwise absolute value of x. */ | ||
| 154 | static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x); | ||
| 155 | /*! @abstract The elementwise absolute value of x. */ | ||
| 156 | static inline SIMD_CFUNC simd_short16 simd_abs(simd_short16 x); | ||
| 157 | /*! @abstract The elementwise absolute value of x. */ | ||
| 158 | static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x); | ||
| 159 | /*! @abstract The elementwise absolute value of x. */ | ||
| 160 | static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x); | ||
| 161 | /*! @abstract The elementwise absolute value of x. */ | ||
| 162 | static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x); | ||
| 163 | /*! @abstract The elementwise absolute value of x. */ | ||
| 164 | static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x); | ||
| 165 | /*! @abstract The elementwise absolute value of x. */ | ||
| 166 | static inline SIMD_CFUNC simd_int8 simd_abs(simd_int8 x); | ||
| 167 | /*! @abstract The elementwise absolute value of x. */ | ||
| 168 | static inline SIMD_CFUNC simd_int16 simd_abs(simd_int16 x); | ||
| 169 | /*! @abstract The elementwise absolute value of x. */ | ||
| 170 | static inline SIMD_CFUNC simd_float2 simd_abs(simd_float2 x); | ||
| 171 | /*! @abstract The elementwise absolute value of x. */ | ||
| 172 | static inline SIMD_CFUNC simd_float3 simd_abs(simd_float3 x); | ||
| 173 | /*! @abstract The elementwise absolute value of x. */ | ||
| 174 | static inline SIMD_CFUNC simd_float4 simd_abs(simd_float4 x); | ||
| 175 | /*! @abstract The elementwise absolute value of x. */ | ||
| 176 | static inline SIMD_CFUNC simd_float8 simd_abs(simd_float8 x); | ||
| 177 | /*! @abstract The elementwise absolute value of x. */ | ||
| 178 | static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x); | ||
| 179 | /*! @abstract The elementwise absolute value of x. */ | ||
| 180 | static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x); | ||
| 181 | /*! @abstract The elementwise absolute value of x. */ | ||
| 182 | static inline SIMD_CFUNC simd_long3 simd_abs(simd_long3 x); | ||
| 183 | /*! @abstract The elementwise absolute value of x. */ | ||
| 184 | static inline SIMD_CFUNC simd_long4 simd_abs(simd_long4 x); | ||
| 185 | /*! @abstract The elementwise absolute value of x. */ | ||
| 186 | static inline SIMD_CFUNC simd_long8 simd_abs(simd_long8 x); | ||
| 187 | /*! @abstract The elementwise absolute value of x. */ | ||
| 188 | static inline SIMD_CFUNC simd_double2 simd_abs(simd_double2 x); | ||
| 189 | /*! @abstract The elementwise absolute value of x. */ | ||
| 190 | static inline SIMD_CFUNC simd_double3 simd_abs(simd_double3 x); | ||
| 191 | /*! @abstract The elementwise absolute value of x. */ | ||
| 192 | static inline SIMD_CFUNC simd_double4 simd_abs(simd_double4 x); | ||
| 193 | /*! @abstract The elementwise absolute value of x. */ | ||
| 194 | static inline SIMD_CFUNC simd_double8 simd_abs(simd_double8 x); | ||
| 195 | /*! @abstract The elementwise absolute value of x. | ||
| 196 | * @discussion Deprecated. Use simd_abs(x) instead. */ | ||
| 197 | #define vector_abs simd_abs | ||
| 198 | |||
| 199 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 200 | static inline SIMD_CFUNC simd_char2 simd_max(simd_char2 x, simd_char2 y); | ||
| 201 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 202 | static inline SIMD_CFUNC simd_char3 simd_max(simd_char3 x, simd_char3 y); | ||
| 203 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 204 | static inline SIMD_CFUNC simd_char4 simd_max(simd_char4 x, simd_char4 y); | ||
| 205 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 206 | static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y); | ||
| 207 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 208 | static inline SIMD_CFUNC simd_char16 simd_max(simd_char16 x, simd_char16 y); | ||
| 209 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 210 | static inline SIMD_CFUNC simd_char32 simd_max(simd_char32 x, simd_char32 y); | ||
| 211 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 212 | static inline SIMD_CFUNC simd_char64 simd_max(simd_char64 x, simd_char64 y); | ||
| 213 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 214 | static inline SIMD_CFUNC simd_uchar2 simd_max(simd_uchar2 x, simd_uchar2 y); | ||
| 215 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 216 | static inline SIMD_CFUNC simd_uchar3 simd_max(simd_uchar3 x, simd_uchar3 y); | ||
| 217 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 218 | static inline SIMD_CFUNC simd_uchar4 simd_max(simd_uchar4 x, simd_uchar4 y); | ||
| 219 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 220 | static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y); | ||
| 221 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 222 | static inline SIMD_CFUNC simd_uchar16 simd_max(simd_uchar16 x, simd_uchar16 y); | ||
| 223 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 224 | static inline SIMD_CFUNC simd_uchar32 simd_max(simd_uchar32 x, simd_uchar32 y); | ||
| 225 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 226 | static inline SIMD_CFUNC simd_uchar64 simd_max(simd_uchar64 x, simd_uchar64 y); | ||
| 227 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 228 | static inline SIMD_CFUNC simd_short2 simd_max(simd_short2 x, simd_short2 y); | ||
| 229 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 230 | static inline SIMD_CFUNC simd_short3 simd_max(simd_short3 x, simd_short3 y); | ||
| 231 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 232 | static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y); | ||
| 233 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 234 | static inline SIMD_CFUNC simd_short8 simd_max(simd_short8 x, simd_short8 y); | ||
| 235 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 236 | static inline SIMD_CFUNC simd_short16 simd_max(simd_short16 x, simd_short16 y); | ||
| 237 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 238 | static inline SIMD_CFUNC simd_short32 simd_max(simd_short32 x, simd_short32 y); | ||
| 239 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 240 | static inline SIMD_CFUNC simd_ushort2 simd_max(simd_ushort2 x, simd_ushort2 y); | ||
| 241 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 242 | static inline SIMD_CFUNC simd_ushort3 simd_max(simd_ushort3 x, simd_ushort3 y); | ||
| 243 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 244 | static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y); | ||
| 245 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 246 | static inline SIMD_CFUNC simd_ushort8 simd_max(simd_ushort8 x, simd_ushort8 y); | ||
| 247 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 248 | static inline SIMD_CFUNC simd_ushort16 simd_max(simd_ushort16 x, simd_ushort16 y); | ||
| 249 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 250 | static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y); | ||
| 251 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 252 | static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y); | ||
| 253 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 254 | static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y); | ||
| 255 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 256 | static inline SIMD_CFUNC simd_int4 simd_max(simd_int4 x, simd_int4 y); | ||
| 257 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 258 | static inline SIMD_CFUNC simd_int8 simd_max(simd_int8 x, simd_int8 y); | ||
| 259 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 260 | static inline SIMD_CFUNC simd_int16 simd_max(simd_int16 x, simd_int16 y); | ||
| 261 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 262 | static inline SIMD_CFUNC simd_uint2 simd_max(simd_uint2 x, simd_uint2 y); | ||
| 263 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 264 | static inline SIMD_CFUNC simd_uint3 simd_max(simd_uint3 x, simd_uint3 y); | ||
| 265 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 266 | static inline SIMD_CFUNC simd_uint4 simd_max(simd_uint4 x, simd_uint4 y); | ||
| 267 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 268 | static inline SIMD_CFUNC simd_uint8 simd_max(simd_uint8 x, simd_uint8 y); | ||
| 269 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 270 | static inline SIMD_CFUNC simd_uint16 simd_max(simd_uint16 x, simd_uint16 y); | ||
| 271 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 272 | static inline SIMD_CFUNC float simd_max(float x, float y); | ||
| 273 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 274 | static inline SIMD_CFUNC simd_float2 simd_max(simd_float2 x, simd_float2 y); | ||
| 275 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 276 | static inline SIMD_CFUNC simd_float3 simd_max(simd_float3 x, simd_float3 y); | ||
| 277 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 278 | static inline SIMD_CFUNC simd_float4 simd_max(simd_float4 x, simd_float4 y); | ||
| 279 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 280 | static inline SIMD_CFUNC simd_float8 simd_max(simd_float8 x, simd_float8 y); | ||
| 281 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 282 | static inline SIMD_CFUNC simd_float16 simd_max(simd_float16 x, simd_float16 y); | ||
| 283 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 284 | static inline SIMD_CFUNC simd_long2 simd_max(simd_long2 x, simd_long2 y); | ||
| 285 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 286 | static inline SIMD_CFUNC simd_long3 simd_max(simd_long3 x, simd_long3 y); | ||
| 287 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 288 | static inline SIMD_CFUNC simd_long4 simd_max(simd_long4 x, simd_long4 y); | ||
| 289 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 290 | static inline SIMD_CFUNC simd_long8 simd_max(simd_long8 x, simd_long8 y); | ||
| 291 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 292 | static inline SIMD_CFUNC simd_ulong2 simd_max(simd_ulong2 x, simd_ulong2 y); | ||
| 293 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 294 | static inline SIMD_CFUNC simd_ulong3 simd_max(simd_ulong3 x, simd_ulong3 y); | ||
| 295 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 296 | static inline SIMD_CFUNC simd_ulong4 simd_max(simd_ulong4 x, simd_ulong4 y); | ||
| 297 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 298 | static inline SIMD_CFUNC simd_ulong8 simd_max(simd_ulong8 x, simd_ulong8 y); | ||
| 299 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 300 | static inline SIMD_CFUNC double simd_max(double x, double y); | ||
| 301 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 302 | static inline SIMD_CFUNC simd_double2 simd_max(simd_double2 x, simd_double2 y); | ||
| 303 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 304 | static inline SIMD_CFUNC simd_double3 simd_max(simd_double3 x, simd_double3 y); | ||
| 305 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 306 | static inline SIMD_CFUNC simd_double4 simd_max(simd_double4 x, simd_double4 y); | ||
| 307 | /*! @abstract The elementwise maximum of x and y. */ | ||
| 308 | static inline SIMD_CFUNC simd_double8 simd_max(simd_double8 x, simd_double8 y); | ||
| 309 | /*! @abstract The elementwise maximum of x and y. | ||
| 310 | * @discussion Deprecated. Use simd_max(x,y) instead. */ | ||
| 311 | #define vector_max simd_max | ||
| 312 | |||
| 313 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 314 | static inline SIMD_CFUNC simd_char2 simd_min(simd_char2 x, simd_char2 y); | ||
| 315 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 316 | static inline SIMD_CFUNC simd_char3 simd_min(simd_char3 x, simd_char3 y); | ||
| 317 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 318 | static inline SIMD_CFUNC simd_char4 simd_min(simd_char4 x, simd_char4 y); | ||
| 319 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 320 | static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y); | ||
| 321 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 322 | static inline SIMD_CFUNC simd_char16 simd_min(simd_char16 x, simd_char16 y); | ||
| 323 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 324 | static inline SIMD_CFUNC simd_char32 simd_min(simd_char32 x, simd_char32 y); | ||
| 325 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 326 | static inline SIMD_CFUNC simd_char64 simd_min(simd_char64 x, simd_char64 y); | ||
| 327 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 328 | static inline SIMD_CFUNC simd_uchar2 simd_min(simd_uchar2 x, simd_uchar2 y); | ||
| 329 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 330 | static inline SIMD_CFUNC simd_uchar3 simd_min(simd_uchar3 x, simd_uchar3 y); | ||
| 331 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 332 | static inline SIMD_CFUNC simd_uchar4 simd_min(simd_uchar4 x, simd_uchar4 y); | ||
| 333 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 334 | static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y); | ||
| 335 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 336 | static inline SIMD_CFUNC simd_uchar16 simd_min(simd_uchar16 x, simd_uchar16 y); | ||
| 337 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 338 | static inline SIMD_CFUNC simd_uchar32 simd_min(simd_uchar32 x, simd_uchar32 y); | ||
| 339 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 340 | static inline SIMD_CFUNC simd_uchar64 simd_min(simd_uchar64 x, simd_uchar64 y); | ||
| 341 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 342 | static inline SIMD_CFUNC simd_short2 simd_min(simd_short2 x, simd_short2 y); | ||
| 343 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 344 | static inline SIMD_CFUNC simd_short3 simd_min(simd_short3 x, simd_short3 y); | ||
| 345 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 346 | static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y); | ||
| 347 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 348 | static inline SIMD_CFUNC simd_short8 simd_min(simd_short8 x, simd_short8 y); | ||
| 349 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 350 | static inline SIMD_CFUNC simd_short16 simd_min(simd_short16 x, simd_short16 y); | ||
| 351 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 352 | static inline SIMD_CFUNC simd_short32 simd_min(simd_short32 x, simd_short32 y); | ||
| 353 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 354 | static inline SIMD_CFUNC simd_ushort2 simd_min(simd_ushort2 x, simd_ushort2 y); | ||
| 355 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 356 | static inline SIMD_CFUNC simd_ushort3 simd_min(simd_ushort3 x, simd_ushort3 y); | ||
| 357 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 358 | static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y); | ||
| 359 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 360 | static inline SIMD_CFUNC simd_ushort8 simd_min(simd_ushort8 x, simd_ushort8 y); | ||
| 361 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 362 | static inline SIMD_CFUNC simd_ushort16 simd_min(simd_ushort16 x, simd_ushort16 y); | ||
| 363 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 364 | static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y); | ||
| 365 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 366 | static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y); | ||
| 367 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 368 | static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y); | ||
| 369 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 370 | static inline SIMD_CFUNC simd_int4 simd_min(simd_int4 x, simd_int4 y); | ||
| 371 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 372 | static inline SIMD_CFUNC simd_int8 simd_min(simd_int8 x, simd_int8 y); | ||
| 373 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 374 | static inline SIMD_CFUNC simd_int16 simd_min(simd_int16 x, simd_int16 y); | ||
| 375 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 376 | static inline SIMD_CFUNC simd_uint2 simd_min(simd_uint2 x, simd_uint2 y); | ||
| 377 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 378 | static inline SIMD_CFUNC simd_uint3 simd_min(simd_uint3 x, simd_uint3 y); | ||
| 379 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 380 | static inline SIMD_CFUNC simd_uint4 simd_min(simd_uint4 x, simd_uint4 y); | ||
| 381 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 382 | static inline SIMD_CFUNC simd_uint8 simd_min(simd_uint8 x, simd_uint8 y); | ||
| 383 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 384 | static inline SIMD_CFUNC simd_uint16 simd_min(simd_uint16 x, simd_uint16 y); | ||
| 385 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 386 | static inline SIMD_CFUNC float simd_min(float x, float y); | ||
| 387 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 388 | static inline SIMD_CFUNC simd_float2 simd_min(simd_float2 x, simd_float2 y); | ||
| 389 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 390 | static inline SIMD_CFUNC simd_float3 simd_min(simd_float3 x, simd_float3 y); | ||
| 391 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 392 | static inline SIMD_CFUNC simd_float4 simd_min(simd_float4 x, simd_float4 y); | ||
| 393 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 394 | static inline SIMD_CFUNC simd_float8 simd_min(simd_float8 x, simd_float8 y); | ||
| 395 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 396 | static inline SIMD_CFUNC simd_float16 simd_min(simd_float16 x, simd_float16 y); | ||
| 397 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 398 | static inline SIMD_CFUNC simd_long2 simd_min(simd_long2 x, simd_long2 y); | ||
| 399 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 400 | static inline SIMD_CFUNC simd_long3 simd_min(simd_long3 x, simd_long3 y); | ||
| 401 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 402 | static inline SIMD_CFUNC simd_long4 simd_min(simd_long4 x, simd_long4 y); | ||
| 403 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 404 | static inline SIMD_CFUNC simd_long8 simd_min(simd_long8 x, simd_long8 y); | ||
| 405 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 406 | static inline SIMD_CFUNC simd_ulong2 simd_min(simd_ulong2 x, simd_ulong2 y); | ||
| 407 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 408 | static inline SIMD_CFUNC simd_ulong3 simd_min(simd_ulong3 x, simd_ulong3 y); | ||
| 409 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 410 | static inline SIMD_CFUNC simd_ulong4 simd_min(simd_ulong4 x, simd_ulong4 y); | ||
| 411 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 412 | static inline SIMD_CFUNC simd_ulong8 simd_min(simd_ulong8 x, simd_ulong8 y); | ||
| 413 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 414 | static inline SIMD_CFUNC double simd_min(double x, double y); | ||
| 415 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 416 | static inline SIMD_CFUNC simd_double2 simd_min(simd_double2 x, simd_double2 y); | ||
| 417 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 418 | static inline SIMD_CFUNC simd_double3 simd_min(simd_double3 x, simd_double3 y); | ||
| 419 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 420 | static inline SIMD_CFUNC simd_double4 simd_min(simd_double4 x, simd_double4 y); | ||
| 421 | /*! @abstract The elementwise minimum of x and y. */ | ||
| 422 | static inline SIMD_CFUNC simd_double8 simd_min(simd_double8 x, simd_double8 y); | ||
| 423 | /*! @abstract The elementwise minimum of x and y. | ||
| 424 | * @discussion Deprecated. Use simd_min(x,y) instead. */ | ||
| 425 | #define vector_min simd_min | ||
| 426 | |||
| 427 | |||
| 428 | /*! @abstract x clamped to the range [min, max]. | ||
| 429 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 430 | * you can use a scalar value for min and max. */ | ||
| 431 | static inline SIMD_CFUNC simd_char2 simd_clamp(simd_char2 x, simd_char2 min, simd_char2 max); | ||
| 432 | /*! @abstract x clamped to the range [min, max]. | ||
| 433 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 434 | * you can use a scalar value for min and max. */ | ||
| 435 | static inline SIMD_CFUNC simd_char3 simd_clamp(simd_char3 x, simd_char3 min, simd_char3 max); | ||
| 436 | /*! @abstract x clamped to the range [min, max]. | ||
| 437 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 438 | * you can use a scalar value for min and max. */ | ||
| 439 | static inline SIMD_CFUNC simd_char4 simd_clamp(simd_char4 x, simd_char4 min, simd_char4 max); | ||
| 440 | /*! @abstract x clamped to the range [min, max]. | ||
| 441 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 442 | * you can use a scalar value for min and max. */ | ||
| 443 | static inline SIMD_CFUNC simd_char8 simd_clamp(simd_char8 x, simd_char8 min, simd_char8 max); | ||
| 444 | /*! @abstract x clamped to the range [min, max]. | ||
| 445 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 446 | * you can use a scalar value for min and max. */ | ||
| 447 | static inline SIMD_CFUNC simd_char16 simd_clamp(simd_char16 x, simd_char16 min, simd_char16 max); | ||
| 448 | /*! @abstract x clamped to the range [min, max]. | ||
| 449 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 450 | * you can use a scalar value for min and max. */ | ||
| 451 | static inline SIMD_CFUNC simd_char32 simd_clamp(simd_char32 x, simd_char32 min, simd_char32 max); | ||
| 452 | /*! @abstract x clamped to the range [min, max]. | ||
| 453 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 454 | * you can use a scalar value for min and max. */ | ||
| 455 | static inline SIMD_CFUNC simd_char64 simd_clamp(simd_char64 x, simd_char64 min, simd_char64 max); | ||
| 456 | /*! @abstract x clamped to the range [min, max]. | ||
| 457 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 458 | * you can use a scalar value for min and max. */ | ||
| 459 | static inline SIMD_CFUNC simd_uchar2 simd_clamp(simd_uchar2 x, simd_uchar2 min, simd_uchar2 max); | ||
| 460 | /*! @abstract x clamped to the range [min, max]. | ||
| 461 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 462 | * you can use a scalar value for min and max. */ | ||
| 463 | static inline SIMD_CFUNC simd_uchar3 simd_clamp(simd_uchar3 x, simd_uchar3 min, simd_uchar3 max); | ||
| 464 | /*! @abstract x clamped to the range [min, max]. | ||
| 465 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 466 | * you can use a scalar value for min and max. */ | ||
| 467 | static inline SIMD_CFUNC simd_uchar4 simd_clamp(simd_uchar4 x, simd_uchar4 min, simd_uchar4 max); | ||
| 468 | /*! @abstract x clamped to the range [min, max]. | ||
| 469 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 470 | * you can use a scalar value for min and max. */ | ||
| 471 | static inline SIMD_CFUNC simd_uchar8 simd_clamp(simd_uchar8 x, simd_uchar8 min, simd_uchar8 max); | ||
| 472 | /*! @abstract x clamped to the range [min, max]. | ||
| 473 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 474 | * you can use a scalar value for min and max. */ | ||
| 475 | static inline SIMD_CFUNC simd_uchar16 simd_clamp(simd_uchar16 x, simd_uchar16 min, simd_uchar16 max); | ||
| 476 | /*! @abstract x clamped to the range [min, max]. | ||
| 477 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 478 | * you can use a scalar value for min and max. */ | ||
| 479 | static inline SIMD_CFUNC simd_uchar32 simd_clamp(simd_uchar32 x, simd_uchar32 min, simd_uchar32 max); | ||
| 480 | /*! @abstract x clamped to the range [min, max]. | ||
| 481 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 482 | * you can use a scalar value for min and max. */ | ||
| 483 | static inline SIMD_CFUNC simd_uchar64 simd_clamp(simd_uchar64 x, simd_uchar64 min, simd_uchar64 max); | ||
| 484 | /*! @abstract x clamped to the range [min, max]. | ||
| 485 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 486 | * you can use a scalar value for min and max. */ | ||
| 487 | static inline SIMD_CFUNC simd_short2 simd_clamp(simd_short2 x, simd_short2 min, simd_short2 max); | ||
| 488 | /*! @abstract x clamped to the range [min, max]. | ||
| 489 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 490 | * you can use a scalar value for min and max. */ | ||
| 491 | static inline SIMD_CFUNC simd_short3 simd_clamp(simd_short3 x, simd_short3 min, simd_short3 max); | ||
| 492 | /*! @abstract x clamped to the range [min, max]. | ||
| 493 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 494 | * you can use a scalar value for min and max. */ | ||
| 495 | static inline SIMD_CFUNC simd_short4 simd_clamp(simd_short4 x, simd_short4 min, simd_short4 max); | ||
| 496 | /*! @abstract x clamped to the range [min, max]. | ||
| 497 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 498 | * you can use a scalar value for min and max. */ | ||
| 499 | static inline SIMD_CFUNC simd_short8 simd_clamp(simd_short8 x, simd_short8 min, simd_short8 max); | ||
| 500 | /*! @abstract x clamped to the range [min, max]. | ||
| 501 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 502 | * you can use a scalar value for min and max. */ | ||
| 503 | static inline SIMD_CFUNC simd_short16 simd_clamp(simd_short16 x, simd_short16 min, simd_short16 max); | ||
| 504 | /*! @abstract x clamped to the range [min, max]. | ||
| 505 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 506 | * you can use a scalar value for min and max. */ | ||
| 507 | static inline SIMD_CFUNC simd_short32 simd_clamp(simd_short32 x, simd_short32 min, simd_short32 max); | ||
| 508 | /*! @abstract x clamped to the range [min, max]. | ||
| 509 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 510 | * you can use a scalar value for min and max. */ | ||
| 511 | static inline SIMD_CFUNC simd_ushort2 simd_clamp(simd_ushort2 x, simd_ushort2 min, simd_ushort2 max); | ||
| 512 | /*! @abstract x clamped to the range [min, max]. | ||
| 513 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 514 | * you can use a scalar value for min and max. */ | ||
| 515 | static inline SIMD_CFUNC simd_ushort3 simd_clamp(simd_ushort3 x, simd_ushort3 min, simd_ushort3 max); | ||
| 516 | /*! @abstract x clamped to the range [min, max]. | ||
| 517 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 518 | * you can use a scalar value for min and max. */ | ||
| 519 | static inline SIMD_CFUNC simd_ushort4 simd_clamp(simd_ushort4 x, simd_ushort4 min, simd_ushort4 max); | ||
| 520 | /*! @abstract x clamped to the range [min, max]. | ||
| 521 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 522 | * you can use a scalar value for min and max. */ | ||
| 523 | static inline SIMD_CFUNC simd_ushort8 simd_clamp(simd_ushort8 x, simd_ushort8 min, simd_ushort8 max); | ||
| 524 | /*! @abstract x clamped to the range [min, max]. | ||
| 525 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 526 | * you can use a scalar value for min and max. */ | ||
| 527 | static inline SIMD_CFUNC simd_ushort16 simd_clamp(simd_ushort16 x, simd_ushort16 min, simd_ushort16 max); | ||
| 528 | /*! @abstract x clamped to the range [min, max]. | ||
| 529 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 530 | * you can use a scalar value for min and max. */ | ||
| 531 | static inline SIMD_CFUNC simd_ushort32 simd_clamp(simd_ushort32 x, simd_ushort32 min, simd_ushort32 max); | ||
| 532 | /*! @abstract x clamped to the range [min, max]. | ||
| 533 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 534 | * you can use a scalar value for min and max. */ | ||
| 535 | static inline SIMD_CFUNC simd_int2 simd_clamp(simd_int2 x, simd_int2 min, simd_int2 max); | ||
| 536 | /*! @abstract x clamped to the range [min, max]. | ||
| 537 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 538 | * you can use a scalar value for min and max. */ | ||
| 539 | static inline SIMD_CFUNC simd_int3 simd_clamp(simd_int3 x, simd_int3 min, simd_int3 max); | ||
| 540 | /*! @abstract x clamped to the range [min, max]. | ||
| 541 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 542 | * you can use a scalar value for min and max. */ | ||
| 543 | static inline SIMD_CFUNC simd_int4 simd_clamp(simd_int4 x, simd_int4 min, simd_int4 max); | ||
| 544 | /*! @abstract x clamped to the range [min, max]. | ||
| 545 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 546 | * you can use a scalar value for min and max. */ | ||
| 547 | static inline SIMD_CFUNC simd_int8 simd_clamp(simd_int8 x, simd_int8 min, simd_int8 max); | ||
| 548 | /*! @abstract x clamped to the range [min, max]. | ||
| 549 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 550 | * you can use a scalar value for min and max. */ | ||
| 551 | static inline SIMD_CFUNC simd_int16 simd_clamp(simd_int16 x, simd_int16 min, simd_int16 max); | ||
| 552 | /*! @abstract x clamped to the range [min, max]. | ||
| 553 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 554 | * you can use a scalar value for min and max. */ | ||
| 555 | static inline SIMD_CFUNC simd_uint2 simd_clamp(simd_uint2 x, simd_uint2 min, simd_uint2 max); | ||
| 556 | /*! @abstract x clamped to the range [min, max]. | ||
| 557 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 558 | * you can use a scalar value for min and max. */ | ||
| 559 | static inline SIMD_CFUNC simd_uint3 simd_clamp(simd_uint3 x, simd_uint3 min, simd_uint3 max); | ||
| 560 | /*! @abstract x clamped to the range [min, max]. | ||
| 561 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 562 | * you can use a scalar value for min and max. */ | ||
| 563 | static inline SIMD_CFUNC simd_uint4 simd_clamp(simd_uint4 x, simd_uint4 min, simd_uint4 max); | ||
| 564 | /*! @abstract x clamped to the range [min, max]. | ||
| 565 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 566 | * you can use a scalar value for min and max. */ | ||
| 567 | static inline SIMD_CFUNC simd_uint8 simd_clamp(simd_uint8 x, simd_uint8 min, simd_uint8 max); | ||
| 568 | /*! @abstract x clamped to the range [min, max]. | ||
| 569 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 570 | * you can use a scalar value for min and max. */ | ||
| 571 | static inline SIMD_CFUNC simd_uint16 simd_clamp(simd_uint16 x, simd_uint16 min, simd_uint16 max); | ||
| 572 | /*! @abstract x clamped to the range [min, max]. | ||
| 573 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 574 | * you can use a scalar value for min and max. */ | ||
| 575 | static inline SIMD_CFUNC float simd_clamp(float x, float min, float max); | ||
| 576 | /*! @abstract x clamped to the range [min, max]. | ||
| 577 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 578 | * you can use a scalar value for min and max. */ | ||
| 579 | static inline SIMD_CFUNC simd_float2 simd_clamp(simd_float2 x, simd_float2 min, simd_float2 max); | ||
| 580 | /*! @abstract x clamped to the range [min, max]. | ||
| 581 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 582 | * you can use a scalar value for min and max. */ | ||
| 583 | static inline SIMD_CFUNC simd_float3 simd_clamp(simd_float3 x, simd_float3 min, simd_float3 max); | ||
| 584 | /*! @abstract x clamped to the range [min, max]. | ||
| 585 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 586 | * you can use a scalar value for min and max. */ | ||
| 587 | static inline SIMD_CFUNC simd_float4 simd_clamp(simd_float4 x, simd_float4 min, simd_float4 max); | ||
| 588 | /*! @abstract x clamped to the range [min, max]. | ||
| 589 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 590 | * you can use a scalar value for min and max. */ | ||
| 591 | static inline SIMD_CFUNC simd_float8 simd_clamp(simd_float8 x, simd_float8 min, simd_float8 max); | ||
| 592 | /*! @abstract x clamped to the range [min, max]. | ||
| 593 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 594 | * you can use a scalar value for min and max. */ | ||
| 595 | static inline SIMD_CFUNC simd_float16 simd_clamp(simd_float16 x, simd_float16 min, simd_float16 max); | ||
| 596 | /*! @abstract x clamped to the range [min, max]. | ||
| 597 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 598 | * you can use a scalar value for min and max. */ | ||
| 599 | static inline SIMD_CFUNC simd_long2 simd_clamp(simd_long2 x, simd_long2 min, simd_long2 max); | ||
| 600 | /*! @abstract x clamped to the range [min, max]. | ||
| 601 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 602 | * you can use a scalar value for min and max. */ | ||
| 603 | static inline SIMD_CFUNC simd_long3 simd_clamp(simd_long3 x, simd_long3 min, simd_long3 max); | ||
| 604 | /*! @abstract x clamped to the range [min, max]. | ||
| 605 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 606 | * you can use a scalar value for min and max. */ | ||
| 607 | static inline SIMD_CFUNC simd_long4 simd_clamp(simd_long4 x, simd_long4 min, simd_long4 max); | ||
| 608 | /*! @abstract x clamped to the range [min, max]. | ||
| 609 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 610 | * you can use a scalar value for min and max. */ | ||
| 611 | static inline SIMD_CFUNC simd_long8 simd_clamp(simd_long8 x, simd_long8 min, simd_long8 max); | ||
| 612 | /*! @abstract x clamped to the range [min, max]. | ||
| 613 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 614 | * you can use a scalar value for min and max. */ | ||
| 615 | static inline SIMD_CFUNC simd_ulong2 simd_clamp(simd_ulong2 x, simd_ulong2 min, simd_ulong2 max); | ||
| 616 | /*! @abstract x clamped to the range [min, max]. | ||
| 617 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 618 | * you can use a scalar value for min and max. */ | ||
| 619 | static inline SIMD_CFUNC simd_ulong3 simd_clamp(simd_ulong3 x, simd_ulong3 min, simd_ulong3 max); | ||
| 620 | /*! @abstract x clamped to the range [min, max]. | ||
| 621 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 622 | * you can use a scalar value for min and max. */ | ||
| 623 | static inline SIMD_CFUNC simd_ulong4 simd_clamp(simd_ulong4 x, simd_ulong4 min, simd_ulong4 max); | ||
| 624 | /*! @abstract x clamped to the range [min, max]. | ||
| 625 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 626 | * you can use a scalar value for min and max. */ | ||
| 627 | static inline SIMD_CFUNC simd_ulong8 simd_clamp(simd_ulong8 x, simd_ulong8 min, simd_ulong8 max); | ||
| 628 | /*! @abstract x clamped to the range [min, max]. | ||
| 629 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 630 | * you can use a scalar value for min and max. */ | ||
| 631 | static inline SIMD_CFUNC double simd_clamp(double x, double min, double max); | ||
| 632 | /*! @abstract x clamped to the range [min, max]. | ||
| 633 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 634 | * you can use a scalar value for min and max. */ | ||
| 635 | static inline SIMD_CFUNC simd_double2 simd_clamp(simd_double2 x, simd_double2 min, simd_double2 max); | ||
| 636 | /*! @abstract x clamped to the range [min, max]. | ||
| 637 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 638 | * you can use a scalar value for min and max. */ | ||
| 639 | static inline SIMD_CFUNC simd_double3 simd_clamp(simd_double3 x, simd_double3 min, simd_double3 max); | ||
| 640 | /*! @abstract x clamped to the range [min, max]. | ||
| 641 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 642 | * you can use a scalar value for min and max. */ | ||
| 643 | static inline SIMD_CFUNC simd_double4 simd_clamp(simd_double4 x, simd_double4 min, simd_double4 max); | ||
| 644 | /*! @abstract x clamped to the range [min, max]. | ||
| 645 | * @discussion Note that if you want to clamp all lanes to the same range, | ||
| 646 | * you can use a scalar value for min and max. */ | ||
| 647 | static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 min, simd_double8 max); | ||
| 648 | /*! @abstract x clamped to the range [min, max]. | ||
| 649 | * @discussion Deprecated. Use simd_clamp(x,min,max) instead. */ | ||
| 650 | #define vector_clamp simd_clamp | ||
| 651 | |||
| 652 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 653 | static inline SIMD_CFUNC float simd_sign(float x); | ||
| 654 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 655 | static inline SIMD_CFUNC simd_float2 simd_sign(simd_float2 x); | ||
| 656 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 657 | static inline SIMD_CFUNC simd_float3 simd_sign(simd_float3 x); | ||
| 658 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 659 | static inline SIMD_CFUNC simd_float4 simd_sign(simd_float4 x); | ||
| 660 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 661 | static inline SIMD_CFUNC simd_float8 simd_sign(simd_float8 x); | ||
| 662 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 663 | static inline SIMD_CFUNC simd_float16 simd_sign(simd_float16 x); | ||
| 664 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 665 | static inline SIMD_CFUNC double simd_sign(double x); | ||
| 666 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 667 | static inline SIMD_CFUNC simd_double2 simd_sign(simd_double2 x); | ||
| 668 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 669 | static inline SIMD_CFUNC simd_double3 simd_sign(simd_double3 x); | ||
| 670 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 671 | static inline SIMD_CFUNC simd_double4 simd_sign(simd_double4 x); | ||
| 672 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */ | ||
| 673 | static inline SIMD_CFUNC simd_double8 simd_sign(simd_double8 x); | ||
| 674 | /*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. | ||
| 675 | * @discussion Deprecated. Use simd_sign(x) instead. */ | ||
| 676 | #define vector_sign simd_sign | ||
| 677 | |||
| 678 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 679 | * t=0 and y when t=1 */ | ||
| 680 | static inline SIMD_CFUNC float simd_mix(float x, float y, float t); | ||
| 681 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 682 | * t=0 and y when t=1 */ | ||
| 683 | static inline SIMD_CFUNC simd_float2 simd_mix(simd_float2 x, simd_float2 y, simd_float2 t); | ||
| 684 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 685 | * t=0 and y when t=1 */ | ||
| 686 | static inline SIMD_CFUNC simd_float3 simd_mix(simd_float3 x, simd_float3 y, simd_float3 t); | ||
| 687 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 688 | * t=0 and y when t=1 */ | ||
| 689 | static inline SIMD_CFUNC simd_float4 simd_mix(simd_float4 x, simd_float4 y, simd_float4 t); | ||
| 690 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 691 | * t=0 and y when t=1 */ | ||
| 692 | static inline SIMD_CFUNC simd_float8 simd_mix(simd_float8 x, simd_float8 y, simd_float8 t); | ||
| 693 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 694 | * t=0 and y when t=1 */ | ||
| 695 | static inline SIMD_CFUNC simd_float16 simd_mix(simd_float16 x, simd_float16 y, simd_float16 t); | ||
| 696 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 697 | * t=0 and y when t=1 */ | ||
| 698 | static inline SIMD_CFUNC double simd_mix(double x, double y, double t); | ||
| 699 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 700 | * t=0 and y when t=1 */ | ||
| 701 | static inline SIMD_CFUNC simd_double2 simd_mix(simd_double2 x, simd_double2 y, simd_double2 t); | ||
| 702 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 703 | * t=0 and y when t=1 */ | ||
| 704 | static inline SIMD_CFUNC simd_double3 simd_mix(simd_double3 x, simd_double3 y, simd_double3 t); | ||
| 705 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 706 | * t=0 and y when t=1 */ | ||
| 707 | static inline SIMD_CFUNC simd_double4 simd_mix(simd_double4 x, simd_double4 y, simd_double4 t); | ||
| 708 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 709 | * t=0 and y when t=1 */ | ||
| 710 | static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t); | ||
| 711 | /*! @abstract Linearly interpolates between x and y, taking the value x when | ||
| 712 | * t=0 and y when t=1 | ||
| 713 | * @discussion Deprecated. Use simd_mix(x, y, t) instead. */ | ||
| 714 | #define vector_mix simd_mix | ||
| 715 | |||
| 716 | /*! @abstract A good approximation to 1/x. | ||
| 717 | * @discussion If x is very close to the limits of representation, the | ||
| 718 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 719 | * a few units in the last place (ULPs). */ | ||
| 720 | static inline SIMD_CFUNC float simd_precise_recip(float x); | ||
| 721 | /*! @abstract A good approximation to 1/x. | ||
| 722 | * @discussion If x is very close to the limits of representation, the | ||
| 723 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 724 | * a few units in the last place (ULPs). */ | ||
| 725 | static inline SIMD_CFUNC simd_float2 simd_precise_recip(simd_float2 x); | ||
| 726 | /*! @abstract A good approximation to 1/x. | ||
| 727 | * @discussion If x is very close to the limits of representation, the | ||
| 728 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 729 | * a few units in the last place (ULPs). */ | ||
| 730 | static inline SIMD_CFUNC simd_float3 simd_precise_recip(simd_float3 x); | ||
| 731 | /*! @abstract A good approximation to 1/x. | ||
| 732 | * @discussion If x is very close to the limits of representation, the | ||
| 733 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 734 | * a few units in the last place (ULPs). */ | ||
| 735 | static inline SIMD_CFUNC simd_float4 simd_precise_recip(simd_float4 x); | ||
| 736 | /*! @abstract A good approximation to 1/x. | ||
| 737 | * @discussion If x is very close to the limits of representation, the | ||
| 738 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 739 | * a few units in the last place (ULPs). */ | ||
| 740 | static inline SIMD_CFUNC simd_float8 simd_precise_recip(simd_float8 x); | ||
| 741 | /*! @abstract A good approximation to 1/x. | ||
| 742 | * @discussion If x is very close to the limits of representation, the | ||
| 743 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 744 | * a few units in the last place (ULPs). */ | ||
| 745 | static inline SIMD_CFUNC simd_float16 simd_precise_recip(simd_float16 x); | ||
| 746 | /*! @abstract A good approximation to 1/x. | ||
| 747 | * @discussion If x is very close to the limits of representation, the | ||
| 748 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 749 | * a few units in the last place (ULPs). */ | ||
| 750 | static inline SIMD_CFUNC double simd_precise_recip(double x); | ||
| 751 | /*! @abstract A good approximation to 1/x. | ||
| 752 | * @discussion If x is very close to the limits of representation, the | ||
| 753 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 754 | * a few units in the last place (ULPs). */ | ||
| 755 | static inline SIMD_CFUNC simd_double2 simd_precise_recip(simd_double2 x); | ||
| 756 | /*! @abstract A good approximation to 1/x. | ||
| 757 | * @discussion If x is very close to the limits of representation, the | ||
| 758 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 759 | * a few units in the last place (ULPs). */ | ||
| 760 | static inline SIMD_CFUNC simd_double3 simd_precise_recip(simd_double3 x); | ||
| 761 | /*! @abstract A good approximation to 1/x. | ||
| 762 | * @discussion If x is very close to the limits of representation, the | ||
| 763 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 764 | * a few units in the last place (ULPs). */ | ||
| 765 | static inline SIMD_CFUNC simd_double4 simd_precise_recip(simd_double4 x); | ||
| 766 | /*! @abstract A good approximation to 1/x. | ||
| 767 | * @discussion If x is very close to the limits of representation, the | ||
| 768 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 769 | * a few units in the last place (ULPs). */ | ||
| 770 | static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x); | ||
| 771 | /*! @abstract A good approximation to 1/x. | ||
| 772 | * @discussion Deprecated. Use simd_precise_recip(x) instead. */ | ||
| 773 | #define vector_precise_recip simd_precise_recip | ||
| 774 | |||
| 775 | /*! @abstract A fast approximation to 1/x. | ||
| 776 | * @discussion If x is very close to the limits of representation, the | ||
| 777 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 778 | * at least 11 bits for float and 22 bits for double. */ | ||
| 779 | static inline SIMD_CFUNC float simd_fast_recip(float x); | ||
| 780 | /*! @abstract A fast approximation to 1/x. | ||
| 781 | * @discussion If x is very close to the limits of representation, the | ||
| 782 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 783 | * at least 11 bits for float and 22 bits for double. */ | ||
| 784 | static inline SIMD_CFUNC simd_float2 simd_fast_recip(simd_float2 x); | ||
| 785 | /*! @abstract A fast approximation to 1/x. | ||
| 786 | * @discussion If x is very close to the limits of representation, the | ||
| 787 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 788 | * at least 11 bits for float and 22 bits for double. */ | ||
| 789 | static inline SIMD_CFUNC simd_float3 simd_fast_recip(simd_float3 x); | ||
| 790 | /*! @abstract A fast approximation to 1/x. | ||
| 791 | * @discussion If x is very close to the limits of representation, the | ||
| 792 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 793 | * at least 11 bits for float and 22 bits for double. */ | ||
| 794 | static inline SIMD_CFUNC simd_float4 simd_fast_recip(simd_float4 x); | ||
| 795 | /*! @abstract A fast approximation to 1/x. | ||
| 796 | * @discussion If x is very close to the limits of representation, the | ||
| 797 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 798 | * at least 11 bits for float and 22 bits for double. */ | ||
| 799 | static inline SIMD_CFUNC simd_float8 simd_fast_recip(simd_float8 x); | ||
| 800 | /*! @abstract A fast approximation to 1/x. | ||
| 801 | * @discussion If x is very close to the limits of representation, the | ||
| 802 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 803 | * at least 11 bits for float and 22 bits for double. */ | ||
| 804 | static inline SIMD_CFUNC simd_float16 simd_fast_recip(simd_float16 x); | ||
| 805 | /*! @abstract A fast approximation to 1/x. | ||
| 806 | * @discussion If x is very close to the limits of representation, the | ||
| 807 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 808 | * at least 11 bits for float and 22 bits for double. */ | ||
| 809 | static inline SIMD_CFUNC double simd_fast_recip(double x); | ||
| 810 | /*! @abstract A fast approximation to 1/x. | ||
| 811 | * @discussion If x is very close to the limits of representation, the | ||
| 812 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 813 | * at least 11 bits for float and 22 bits for double. */ | ||
| 814 | static inline SIMD_CFUNC simd_double2 simd_fast_recip(simd_double2 x); | ||
| 815 | /*! @abstract A fast approximation to 1/x. | ||
| 816 | * @discussion If x is very close to the limits of representation, the | ||
| 817 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 818 | * at least 11 bits for float and 22 bits for double. */ | ||
| 819 | static inline SIMD_CFUNC simd_double3 simd_fast_recip(simd_double3 x); | ||
| 820 | /*! @abstract A fast approximation to 1/x. | ||
| 821 | * @discussion If x is very close to the limits of representation, the | ||
| 822 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 823 | * at least 11 bits for float and 22 bits for double. */ | ||
| 824 | static inline SIMD_CFUNC simd_double4 simd_fast_recip(simd_double4 x); | ||
| 825 | /*! @abstract A fast approximation to 1/x. | ||
| 826 | * @discussion If x is very close to the limits of representation, the | ||
| 827 | * result may overflow or underflow; otherwise this function is accurate to | ||
| 828 | * at least 11 bits for float and 22 bits for double. */ | ||
| 829 | static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x); | ||
| 830 | /*! @abstract A fast approximation to 1/x. | ||
| 831 | * @discussion Deprecated. Use simd_fast_recip(x) instead. */ | ||
| 832 | #define vector_fast_recip simd_fast_recip | ||
| 833 | |||
| 834 | /*! @abstract An approximation to 1/x. | ||
| 835 | * @discussion If x is very close to the limits of representation, the | ||
| 836 | * result may overflow or underflow. This function maps to | ||
| 837 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 838 | * simd_precise_recip(x) otherwise. */ | ||
| 839 | static inline SIMD_CFUNC float simd_recip(float x); | ||
| 840 | /*! @abstract An approximation to 1/x. | ||
| 841 | * @discussion If x is very close to the limits of representation, the | ||
| 842 | * result may overflow or underflow. This function maps to | ||
| 843 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 844 | * simd_precise_recip(x) otherwise. */ | ||
| 845 | static inline SIMD_CFUNC simd_float2 simd_recip(simd_float2 x); | ||
| 846 | /*! @abstract An approximation to 1/x. | ||
| 847 | * @discussion If x is very close to the limits of representation, the | ||
| 848 | * result may overflow or underflow. This function maps to | ||
| 849 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 850 | * simd_precise_recip(x) otherwise. */ | ||
| 851 | static inline SIMD_CFUNC simd_float3 simd_recip(simd_float3 x); | ||
| 852 | /*! @abstract An approximation to 1/x. | ||
| 853 | * @discussion If x is very close to the limits of representation, the | ||
| 854 | * result may overflow or underflow. This function maps to | ||
| 855 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 856 | * simd_precise_recip(x) otherwise. */ | ||
| 857 | static inline SIMD_CFUNC simd_float4 simd_recip(simd_float4 x); | ||
| 858 | /*! @abstract An approximation to 1/x. | ||
| 859 | * @discussion If x is very close to the limits of representation, the | ||
| 860 | * result may overflow or underflow. This function maps to | ||
| 861 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 862 | * simd_precise_recip(x) otherwise. */ | ||
| 863 | static inline SIMD_CFUNC simd_float8 simd_recip(simd_float8 x); | ||
| 864 | /*! @abstract An approximation to 1/x. | ||
| 865 | * @discussion If x is very close to the limits of representation, the | ||
| 866 | * result may overflow or underflow. This function maps to | ||
| 867 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 868 | * simd_precise_recip(x) otherwise. */ | ||
| 869 | static inline SIMD_CFUNC simd_float16 simd_recip(simd_float16 x); | ||
| 870 | /*! @abstract An approximation to 1/x. | ||
| 871 | * @discussion If x is very close to the limits of representation, the | ||
| 872 | * result may overflow or underflow. This function maps to | ||
| 873 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 874 | * simd_precise_recip(x) otherwise. */ | ||
| 875 | static inline SIMD_CFUNC double simd_recip(double x); | ||
| 876 | /*! @abstract An approximation to 1/x. | ||
| 877 | * @discussion If x is very close to the limits of representation, the | ||
| 878 | * result may overflow or underflow. This function maps to | ||
| 879 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 880 | * simd_precise_recip(x) otherwise. */ | ||
| 881 | static inline SIMD_CFUNC simd_double2 simd_recip(simd_double2 x); | ||
| 882 | /*! @abstract An approximation to 1/x. | ||
| 883 | * @discussion If x is very close to the limits of representation, the | ||
| 884 | * result may overflow or underflow. This function maps to | ||
| 885 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 886 | * simd_precise_recip(x) otherwise. */ | ||
| 887 | static inline SIMD_CFUNC simd_double3 simd_recip(simd_double3 x); | ||
| 888 | /*! @abstract An approximation to 1/x. | ||
| 889 | * @discussion If x is very close to the limits of representation, the | ||
| 890 | * result may overflow or underflow. This function maps to | ||
| 891 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 892 | * simd_precise_recip(x) otherwise. */ | ||
| 893 | static inline SIMD_CFUNC simd_double4 simd_recip(simd_double4 x); | ||
| 894 | /*! @abstract An approximation to 1/x. | ||
| 895 | * @discussion If x is very close to the limits of representation, the | ||
| 896 | * result may overflow or underflow. This function maps to | ||
| 897 | * simd_fast_recip(x) if -ffast-math is specified, and to | ||
| 898 | * simd_precise_recip(x) otherwise. */ | ||
| 899 | static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x); | ||
| 900 | /*! @abstract An approximation to 1/x. | ||
| 901 | * @discussion Deprecated. Use simd_recip(x) instead. */ | ||
| 902 | #define vector_recip simd_recip | ||
| 903 | |||
| 904 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 905 | * @discussion This function is accurate to a few units in the last place | ||
| 906 | * (ULPs). */ | ||
| 907 | static inline SIMD_CFUNC float simd_precise_rsqrt(float x); | ||
| 908 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 909 | * @discussion This function is accurate to a few units in the last place | ||
| 910 | * (ULPs). */ | ||
| 911 | static inline SIMD_CFUNC simd_float2 simd_precise_rsqrt(simd_float2 x); | ||
| 912 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 913 | * @discussion This function is accurate to a few units in the last place | ||
| 914 | * (ULPs). */ | ||
| 915 | static inline SIMD_CFUNC simd_float3 simd_precise_rsqrt(simd_float3 x); | ||
| 916 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 917 | * @discussion This function is accurate to a few units in the last place | ||
| 918 | * (ULPs). */ | ||
| 919 | static inline SIMD_CFUNC simd_float4 simd_precise_rsqrt(simd_float4 x); | ||
| 920 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 921 | * @discussion This function is accurate to a few units in the last place | ||
| 922 | * (ULPs). */ | ||
| 923 | static inline SIMD_CFUNC simd_float8 simd_precise_rsqrt(simd_float8 x); | ||
| 924 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 925 | * @discussion This function is accurate to a few units in the last place | ||
| 926 | * (ULPs). */ | ||
| 927 | static inline SIMD_CFUNC simd_float16 simd_precise_rsqrt(simd_float16 x); | ||
| 928 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 929 | * @discussion This function is accurate to a few units in the last place | ||
| 930 | * (ULPs). */ | ||
| 931 | static inline SIMD_CFUNC double simd_precise_rsqrt(double x); | ||
| 932 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 933 | * @discussion This function is accurate to a few units in the last place | ||
| 934 | * (ULPs). */ | ||
| 935 | static inline SIMD_CFUNC simd_double2 simd_precise_rsqrt(simd_double2 x); | ||
| 936 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 937 | * @discussion This function is accurate to a few units in the last place | ||
| 938 | * (ULPs). */ | ||
| 939 | static inline SIMD_CFUNC simd_double3 simd_precise_rsqrt(simd_double3 x); | ||
| 940 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 941 | * @discussion This function is accurate to a few units in the last place | ||
| 942 | * (ULPs). */ | ||
| 943 | static inline SIMD_CFUNC simd_double4 simd_precise_rsqrt(simd_double4 x); | ||
| 944 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 945 | * @discussion This function is accurate to a few units in the last place | ||
| 946 | * (ULPs). */ | ||
| 947 | static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x); | ||
| 948 | /*! @abstract A good approximation to 1/sqrt(x). | ||
| 949 | * @discussion Deprecated. Use simd_precise_rsqrt(x) instead. */ | ||
| 950 | #define vector_precise_rsqrt simd_precise_rsqrt | ||
| 951 | |||
| 952 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 953 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 954 | * 22 bits for double. */ | ||
| 955 | static inline SIMD_CFUNC float simd_fast_rsqrt(float x); | ||
| 956 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 957 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 958 | * 22 bits for double. */ | ||
| 959 | static inline SIMD_CFUNC simd_float2 simd_fast_rsqrt(simd_float2 x); | ||
| 960 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 961 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 962 | * 22 bits for double. */ | ||
| 963 | static inline SIMD_CFUNC simd_float3 simd_fast_rsqrt(simd_float3 x); | ||
| 964 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 965 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 966 | * 22 bits for double. */ | ||
| 967 | static inline SIMD_CFUNC simd_float4 simd_fast_rsqrt(simd_float4 x); | ||
| 968 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 969 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 970 | * 22 bits for double. */ | ||
| 971 | static inline SIMD_CFUNC simd_float8 simd_fast_rsqrt(simd_float8 x); | ||
| 972 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 973 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 974 | * 22 bits for double. */ | ||
| 975 | static inline SIMD_CFUNC simd_float16 simd_fast_rsqrt(simd_float16 x); | ||
| 976 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 977 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 978 | * 22 bits for double. */ | ||
| 979 | static inline SIMD_CFUNC double simd_fast_rsqrt(double x); | ||
| 980 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 981 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 982 | * 22 bits for double. */ | ||
| 983 | static inline SIMD_CFUNC simd_double2 simd_fast_rsqrt(simd_double2 x); | ||
| 984 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 985 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 986 | * 22 bits for double. */ | ||
| 987 | static inline SIMD_CFUNC simd_double3 simd_fast_rsqrt(simd_double3 x); | ||
| 988 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 989 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 990 | * 22 bits for double. */ | ||
| 991 | static inline SIMD_CFUNC simd_double4 simd_fast_rsqrt(simd_double4 x); | ||
| 992 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 993 | * @discussion This function is accurate to at least 11 bits for float and | ||
| 994 | * 22 bits for double. */ | ||
| 995 | static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x); | ||
| 996 | /*! @abstract A fast approximation to 1/sqrt(x). | ||
| 997 | * @discussion Deprecated. Use simd_fast_rsqrt(x) instead. */ | ||
| 998 | #define vector_fast_rsqrt simd_fast_rsqrt | ||
| 999 | |||
| 1000 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1001 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1002 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1003 | static inline SIMD_CFUNC float simd_rsqrt(float x); | ||
| 1004 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1005 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1006 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1007 | static inline SIMD_CFUNC simd_float2 simd_rsqrt(simd_float2 x); | ||
| 1008 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1009 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1010 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1011 | static inline SIMD_CFUNC simd_float3 simd_rsqrt(simd_float3 x); | ||
| 1012 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1013 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1014 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1015 | static inline SIMD_CFUNC simd_float4 simd_rsqrt(simd_float4 x); | ||
| 1016 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1017 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1018 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1019 | static inline SIMD_CFUNC simd_float8 simd_rsqrt(simd_float8 x); | ||
| 1020 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1021 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1022 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1023 | static inline SIMD_CFUNC simd_float16 simd_rsqrt(simd_float16 x); | ||
| 1024 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1025 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1026 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1027 | static inline SIMD_CFUNC double simd_rsqrt(double x); | ||
| 1028 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1029 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1030 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1031 | static inline SIMD_CFUNC simd_double2 simd_rsqrt(simd_double2 x); | ||
| 1032 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1033 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1034 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1035 | static inline SIMD_CFUNC simd_double3 simd_rsqrt(simd_double3 x); | ||
| 1036 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1037 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1038 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1039 | static inline SIMD_CFUNC simd_double4 simd_rsqrt(simd_double4 x); | ||
| 1040 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1041 | * @discussion This function maps to simd_fast_recip(x) if -ffast-math is | ||
| 1042 | * specified, and to simd_precise_recip(x) otherwise. */ | ||
| 1043 | static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x); | ||
| 1044 | /*! @abstract An approximation to 1/sqrt(x). | ||
| 1045 | * @discussion Deprecated. Use simd_rsqrt(x) instead. */ | ||
| 1046 | #define vector_rsqrt simd_rsqrt | ||
| 1047 | |||
| 1048 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1049 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1050 | * positive and finite, then the two values are exactly equal. */ | ||
| 1051 | static inline SIMD_CFUNC float simd_fract(float x); | ||
| 1052 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1053 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1054 | * positive and finite, then the two values are exactly equal. */ | ||
| 1055 | static inline SIMD_CFUNC simd_float2 simd_fract(simd_float2 x); | ||
| 1056 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1057 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1058 | * positive and finite, then the two values are exactly equal. */ | ||
| 1059 | static inline SIMD_CFUNC simd_float3 simd_fract(simd_float3 x); | ||
| 1060 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1061 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1062 | * positive and finite, then the two values are exactly equal. */ | ||
| 1063 | static inline SIMD_CFUNC simd_float4 simd_fract(simd_float4 x); | ||
| 1064 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1065 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1066 | * positive and finite, then the two values are exactly equal. */ | ||
| 1067 | static inline SIMD_CFUNC simd_float8 simd_fract(simd_float8 x); | ||
| 1068 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1069 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1070 | * positive and finite, then the two values are exactly equal. */ | ||
| 1071 | static inline SIMD_CFUNC simd_float16 simd_fract(simd_float16 x); | ||
| 1072 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1073 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1074 | * positive and finite, then the two values are exactly equal. */ | ||
| 1075 | static inline SIMD_CFUNC double simd_fract(double x); | ||
| 1076 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1077 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1078 | * positive and finite, then the two values are exactly equal. */ | ||
| 1079 | static inline SIMD_CFUNC simd_double2 simd_fract(simd_double2 x); | ||
| 1080 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1081 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1082 | * positive and finite, then the two values are exactly equal. */ | ||
| 1083 | static inline SIMD_CFUNC simd_double3 simd_fract(simd_double3 x); | ||
| 1084 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1085 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1086 | * positive and finite, then the two values are exactly equal. */ | ||
| 1087 | static inline SIMD_CFUNC simd_double4 simd_fract(simd_double4 x); | ||
| 1088 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1089 | * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is | ||
| 1090 | * positive and finite, then the two values are exactly equal. */ | ||
| 1091 | static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x); | ||
| 1092 | /*! @abstract The "fractional part" of x, lying in the range [0, 1). | ||
| 1093 | * @discussion Deprecated. Use simd_fract(x) instead. */ | ||
| 1094 | #define vector_fract simd_fract | ||
| 1095 | |||
| 1096 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1097 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1098 | * threshold to all lanes. */ | ||
| 1099 | static inline SIMD_CFUNC float simd_step(float edge, float x); | ||
| 1100 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1101 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1102 | * threshold to all lanes. */ | ||
| 1103 | static inline SIMD_CFUNC simd_float2 simd_step(simd_float2 edge, simd_float2 x); | ||
| 1104 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1105 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1106 | * threshold to all lanes. */ | ||
| 1107 | static inline SIMD_CFUNC simd_float3 simd_step(simd_float3 edge, simd_float3 x); | ||
| 1108 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1109 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1110 | * threshold to all lanes. */ | ||
| 1111 | static inline SIMD_CFUNC simd_float4 simd_step(simd_float4 edge, simd_float4 x); | ||
| 1112 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1113 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1114 | * threshold to all lanes. */ | ||
| 1115 | static inline SIMD_CFUNC simd_float8 simd_step(simd_float8 edge, simd_float8 x); | ||
| 1116 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1117 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1118 | * threshold to all lanes. */ | ||
| 1119 | static inline SIMD_CFUNC simd_float16 simd_step(simd_float16 edge, simd_float16 x); | ||
| 1120 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1121 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1122 | * threshold to all lanes. */ | ||
| 1123 | static inline SIMD_CFUNC double simd_step(double edge, double x); | ||
| 1124 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1125 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1126 | * threshold to all lanes. */ | ||
| 1127 | static inline SIMD_CFUNC simd_double2 simd_step(simd_double2 edge, simd_double2 x); | ||
| 1128 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1129 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1130 | * threshold to all lanes. */ | ||
| 1131 | static inline SIMD_CFUNC simd_double3 simd_step(simd_double3 edge, simd_double3 x); | ||
| 1132 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1133 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1134 | * threshold to all lanes. */ | ||
| 1135 | static inline SIMD_CFUNC simd_double4 simd_step(simd_double4 edge, simd_double4 x); | ||
| 1136 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1137 | * @discussion Use a scalar value for edge if you want to apply the same | ||
| 1138 | * threshold to all lanes. */ | ||
| 1139 | static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8 x); | ||
| 1140 | /*! @abstract 0 if x < edge, and 1 otherwise. | ||
| 1141 | * @discussion Deprecated. Use simd_step(edge, x) instead. */ | ||
| 1142 | #define vector_step simd_step | ||
| 1143 | |||
| 1144 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1145 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1146 | * to clamp all lanes at the same points. */ | ||
| 1147 | static inline SIMD_CFUNC float simd_smoothstep(float edge0, float edge1, float x); | ||
| 1148 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1149 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1150 | * to clamp all lanes at the same points. */ | ||
| 1151 | static inline SIMD_CFUNC simd_float2 simd_smoothstep(simd_float2 edge0, simd_float2 edge1, simd_float2 x); | ||
| 1152 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1153 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1154 | * to clamp all lanes at the same points. */ | ||
| 1155 | static inline SIMD_CFUNC simd_float3 simd_smoothstep(simd_float3 edge0, simd_float3 edge1, simd_float3 x); | ||
| 1156 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1157 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1158 | * to clamp all lanes at the same points. */ | ||
| 1159 | static inline SIMD_CFUNC simd_float4 simd_smoothstep(simd_float4 edge0, simd_float4 edge1, simd_float4 x); | ||
| 1160 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1161 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1162 | * to clamp all lanes at the same points. */ | ||
| 1163 | static inline SIMD_CFUNC simd_float8 simd_smoothstep(simd_float8 edge0, simd_float8 edge1, simd_float8 x); | ||
| 1164 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1165 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1166 | * to clamp all lanes at the same points. */ | ||
| 1167 | static inline SIMD_CFUNC simd_float16 simd_smoothstep(simd_float16 edge0, simd_float16 edge1, simd_float16 x); | ||
| 1168 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1169 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1170 | * to clamp all lanes at the same points. */ | ||
| 1171 | static inline SIMD_CFUNC double simd_smoothstep(double edge0, double edge1, double x); | ||
| 1172 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1173 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1174 | * to clamp all lanes at the same points. */ | ||
| 1175 | static inline SIMD_CFUNC simd_double2 simd_smoothstep(simd_double2 edge0, simd_double2 edge1, simd_double2 x); | ||
| 1176 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1177 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1178 | * to clamp all lanes at the same points. */ | ||
| 1179 | static inline SIMD_CFUNC simd_double3 simd_smoothstep(simd_double3 edge0, simd_double3 edge1, simd_double3 x); | ||
| 1180 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1181 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1182 | * to clamp all lanes at the same points. */ | ||
| 1183 | static inline SIMD_CFUNC simd_double4 simd_smoothstep(simd_double4 edge0, simd_double4 edge1, simd_double4 x); | ||
| 1184 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1185 | * @discussion You can use a scalar value for edge0 and edge1 if you want | ||
| 1186 | * to clamp all lanes at the same points. */ | ||
| 1187 | static inline SIMD_CFUNC simd_double8 simd_smoothstep(simd_double8 edge0, simd_double8 edge1, simd_double8 x); | ||
| 1188 | /*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1 | ||
| 1189 | * @discussion Deprecated. Use simd_smoothstep(edge0, edge1, x) instead. */ | ||
| 1190 | #define vector_smoothstep simd_smoothstep | ||
| 1191 | |||
| 1192 | /*! @abstract Sum of elements in x. | ||
| 1193 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1194 | * may need to convert to a wider type before reducing. */ | ||
| 1195 | static inline SIMD_CFUNC char simd_reduce_add(simd_char2 x); | ||
| 1196 | /*! @abstract Sum of elements in x. | ||
| 1197 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1198 | * may need to convert to a wider type before reducing. */ | ||
| 1199 | static inline SIMD_CFUNC char simd_reduce_add(simd_char3 x); | ||
| 1200 | /*! @abstract Sum of elements in x. | ||
| 1201 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1202 | * may need to convert to a wider type before reducing. */ | ||
| 1203 | static inline SIMD_CFUNC char simd_reduce_add(simd_char4 x); | ||
| 1204 | /*! @abstract Sum of elements in x. | ||
| 1205 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1206 | * may need to convert to a wider type before reducing. */ | ||
| 1207 | static inline SIMD_CFUNC char simd_reduce_add(simd_char8 x); | ||
| 1208 | /*! @abstract Sum of elements in x. | ||
| 1209 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1210 | * may need to convert to a wider type before reducing. */ | ||
| 1211 | static inline SIMD_CFUNC char simd_reduce_add(simd_char16 x); | ||
| 1212 | /*! @abstract Sum of elements in x. | ||
| 1213 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1214 | * may need to convert to a wider type before reducing. */ | ||
| 1215 | static inline SIMD_CFUNC char simd_reduce_add(simd_char32 x); | ||
| 1216 | /*! @abstract Sum of elements in x. | ||
| 1217 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1218 | * may need to convert to a wider type before reducing. */ | ||
| 1219 | static inline SIMD_CFUNC char simd_reduce_add(simd_char64 x); | ||
| 1220 | /*! @abstract Sum of elements in x. | ||
| 1221 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1222 | * may need to convert to a wider type before reducing. */ | ||
| 1223 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar2 x); | ||
| 1224 | /*! @abstract Sum of elements in x. | ||
| 1225 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1226 | * may need to convert to a wider type before reducing. */ | ||
| 1227 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar3 x); | ||
| 1228 | /*! @abstract Sum of elements in x. | ||
| 1229 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1230 | * may need to convert to a wider type before reducing. */ | ||
| 1231 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar4 x); | ||
| 1232 | /*! @abstract Sum of elements in x. | ||
| 1233 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1234 | * may need to convert to a wider type before reducing. */ | ||
| 1235 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar8 x); | ||
| 1236 | /*! @abstract Sum of elements in x. | ||
| 1237 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1238 | * may need to convert to a wider type before reducing. */ | ||
| 1239 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar16 x); | ||
| 1240 | /*! @abstract Sum of elements in x. | ||
| 1241 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1242 | * may need to convert to a wider type before reducing. */ | ||
| 1243 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar32 x); | ||
| 1244 | /*! @abstract Sum of elements in x. | ||
| 1245 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1246 | * may need to convert to a wider type before reducing. */ | ||
| 1247 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar64 x); | ||
| 1248 | /*! @abstract Sum of elements in x. | ||
| 1249 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1250 | * may need to convert to a wider type before reducing. */ | ||
| 1251 | static inline SIMD_CFUNC short simd_reduce_add(simd_short2 x); | ||
| 1252 | /*! @abstract Sum of elements in x. | ||
| 1253 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1254 | * may need to convert to a wider type before reducing. */ | ||
| 1255 | static inline SIMD_CFUNC short simd_reduce_add(simd_short3 x); | ||
| 1256 | /*! @abstract Sum of elements in x. | ||
| 1257 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1258 | * may need to convert to a wider type before reducing. */ | ||
| 1259 | static inline SIMD_CFUNC short simd_reduce_add(simd_short4 x); | ||
| 1260 | /*! @abstract Sum of elements in x. | ||
| 1261 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1262 | * may need to convert to a wider type before reducing. */ | ||
| 1263 | static inline SIMD_CFUNC short simd_reduce_add(simd_short8 x); | ||
| 1264 | /*! @abstract Sum of elements in x. | ||
| 1265 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1266 | * may need to convert to a wider type before reducing. */ | ||
| 1267 | static inline SIMD_CFUNC short simd_reduce_add(simd_short16 x); | ||
| 1268 | /*! @abstract Sum of elements in x. | ||
| 1269 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1270 | * may need to convert to a wider type before reducing. */ | ||
| 1271 | static inline SIMD_CFUNC short simd_reduce_add(simd_short32 x); | ||
| 1272 | /*! @abstract Sum of elements in x. | ||
| 1273 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1274 | * may need to convert to a wider type before reducing. */ | ||
| 1275 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort2 x); | ||
| 1276 | /*! @abstract Sum of elements in x. | ||
| 1277 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1278 | * may need to convert to a wider type before reducing. */ | ||
| 1279 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort3 x); | ||
| 1280 | /*! @abstract Sum of elements in x. | ||
| 1281 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1282 | * may need to convert to a wider type before reducing. */ | ||
| 1283 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort4 x); | ||
| 1284 | /*! @abstract Sum of elements in x. | ||
| 1285 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1286 | * may need to convert to a wider type before reducing. */ | ||
| 1287 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort8 x); | ||
| 1288 | /*! @abstract Sum of elements in x. | ||
| 1289 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1290 | * may need to convert to a wider type before reducing. */ | ||
| 1291 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort16 x); | ||
| 1292 | /*! @abstract Sum of elements in x. | ||
| 1293 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1294 | * may need to convert to a wider type before reducing. */ | ||
| 1295 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x); | ||
| 1296 | /*! @abstract Sum of elements in x. | ||
| 1297 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1298 | * may need to convert to a wider type before reducing. */ | ||
| 1299 | static inline SIMD_CFUNC int simd_reduce_add(simd_int2 x); | ||
| 1300 | /*! @abstract Sum of elements in x. | ||
| 1301 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1302 | * may need to convert to a wider type before reducing. */ | ||
| 1303 | static inline SIMD_CFUNC int simd_reduce_add(simd_int3 x); | ||
| 1304 | /*! @abstract Sum of elements in x. | ||
| 1305 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1306 | * may need to convert to a wider type before reducing. */ | ||
| 1307 | static inline SIMD_CFUNC int simd_reduce_add(simd_int4 x); | ||
| 1308 | /*! @abstract Sum of elements in x. | ||
| 1309 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1310 | * may need to convert to a wider type before reducing. */ | ||
| 1311 | static inline SIMD_CFUNC int simd_reduce_add(simd_int8 x); | ||
| 1312 | /*! @abstract Sum of elements in x. | ||
| 1313 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1314 | * may need to convert to a wider type before reducing. */ | ||
| 1315 | static inline SIMD_CFUNC int simd_reduce_add(simd_int16 x); | ||
| 1316 | /*! @abstract Sum of elements in x. | ||
| 1317 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1318 | * may need to convert to a wider type before reducing. */ | ||
| 1319 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint2 x); | ||
| 1320 | /*! @abstract Sum of elements in x. | ||
| 1321 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1322 | * may need to convert to a wider type before reducing. */ | ||
| 1323 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint3 x); | ||
| 1324 | /*! @abstract Sum of elements in x. | ||
| 1325 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1326 | * may need to convert to a wider type before reducing. */ | ||
| 1327 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint4 x); | ||
| 1328 | /*! @abstract Sum of elements in x. | ||
| 1329 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1330 | * may need to convert to a wider type before reducing. */ | ||
| 1331 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint8 x); | ||
| 1332 | /*! @abstract Sum of elements in x. | ||
| 1333 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1334 | * may need to convert to a wider type before reducing. */ | ||
| 1335 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint16 x); | ||
| 1336 | /*! @abstract Sum of elements in x. | ||
| 1337 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1338 | * may need to convert to a wider type before reducing. */ | ||
| 1339 | static inline SIMD_CFUNC float simd_reduce_add(simd_float2 x); | ||
| 1340 | /*! @abstract Sum of elements in x. | ||
| 1341 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1342 | * may need to convert to a wider type before reducing. */ | ||
| 1343 | static inline SIMD_CFUNC float simd_reduce_add(simd_float3 x); | ||
| 1344 | /*! @abstract Sum of elements in x. | ||
| 1345 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1346 | * may need to convert to a wider type before reducing. */ | ||
| 1347 | static inline SIMD_CFUNC float simd_reduce_add(simd_float4 x); | ||
| 1348 | /*! @abstract Sum of elements in x. | ||
| 1349 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1350 | * may need to convert to a wider type before reducing. */ | ||
| 1351 | static inline SIMD_CFUNC float simd_reduce_add(simd_float8 x); | ||
| 1352 | /*! @abstract Sum of elements in x. | ||
| 1353 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1354 | * may need to convert to a wider type before reducing. */ | ||
| 1355 | static inline SIMD_CFUNC float simd_reduce_add(simd_float16 x); | ||
| 1356 | /*! @abstract Sum of elements in x. | ||
| 1357 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1358 | * may need to convert to a wider type before reducing. */ | ||
| 1359 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long2 x); | ||
| 1360 | /*! @abstract Sum of elements in x. | ||
| 1361 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1362 | * may need to convert to a wider type before reducing. */ | ||
| 1363 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long3 x); | ||
| 1364 | /*! @abstract Sum of elements in x. | ||
| 1365 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1366 | * may need to convert to a wider type before reducing. */ | ||
| 1367 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long4 x); | ||
| 1368 | /*! @abstract Sum of elements in x. | ||
| 1369 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1370 | * may need to convert to a wider type before reducing. */ | ||
| 1371 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long8 x); | ||
| 1372 | /*! @abstract Sum of elements in x. | ||
| 1373 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1374 | * may need to convert to a wider type before reducing. */ | ||
| 1375 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong2 x); | ||
| 1376 | /*! @abstract Sum of elements in x. | ||
| 1377 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1378 | * may need to convert to a wider type before reducing. */ | ||
| 1379 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong3 x); | ||
| 1380 | /*! @abstract Sum of elements in x. | ||
| 1381 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1382 | * may need to convert to a wider type before reducing. */ | ||
| 1383 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong4 x); | ||
| 1384 | /*! @abstract Sum of elements in x. | ||
| 1385 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1386 | * may need to convert to a wider type before reducing. */ | ||
| 1387 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong8 x); | ||
| 1388 | /*! @abstract Sum of elements in x. | ||
| 1389 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1390 | * may need to convert to a wider type before reducing. */ | ||
| 1391 | static inline SIMD_CFUNC double simd_reduce_add(simd_double2 x); | ||
| 1392 | /*! @abstract Sum of elements in x. | ||
| 1393 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1394 | * may need to convert to a wider type before reducing. */ | ||
| 1395 | static inline SIMD_CFUNC double simd_reduce_add(simd_double3 x); | ||
| 1396 | /*! @abstract Sum of elements in x. | ||
| 1397 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1398 | * may need to convert to a wider type before reducing. */ | ||
| 1399 | static inline SIMD_CFUNC double simd_reduce_add(simd_double4 x); | ||
| 1400 | /*! @abstract Sum of elements in x. | ||
| 1401 | * @discussion This computation may overflow; especial for 8-bit types you | ||
| 1402 | * may need to convert to a wider type before reducing. */ | ||
| 1403 | static inline SIMD_CFUNC double simd_reduce_add(simd_double8 x); | ||
| 1404 | /*! @abstract Sum of elements in x. | ||
| 1405 | * @discussion Deprecated. Use simd_add(x) instead. */ | ||
| 1406 | #define vector_reduce_add simd_reduce_add | ||
| 1407 | |||
| 1408 | /*! @abstract Minimum of elements in x. */ | ||
| 1409 | static inline SIMD_CFUNC char simd_reduce_min(simd_char2 x); | ||
| 1410 | /*! @abstract Minimum of elements in x. */ | ||
| 1411 | static inline SIMD_CFUNC char simd_reduce_min(simd_char3 x); | ||
| 1412 | /*! @abstract Minimum of elements in x. */ | ||
| 1413 | static inline SIMD_CFUNC char simd_reduce_min(simd_char4 x); | ||
| 1414 | /*! @abstract Minimum of elements in x. */ | ||
| 1415 | static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x); | ||
| 1416 | /*! @abstract Minimum of elements in x. */ | ||
| 1417 | static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x); | ||
| 1418 | /*! @abstract Minimum of elements in x. */ | ||
| 1419 | static inline SIMD_CFUNC char simd_reduce_min(simd_char32 x); | ||
| 1420 | /*! @abstract Minimum of elements in x. */ | ||
| 1421 | static inline SIMD_CFUNC char simd_reduce_min(simd_char64 x); | ||
| 1422 | /*! @abstract Minimum of elements in x. */ | ||
| 1423 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar2 x); | ||
| 1424 | /*! @abstract Minimum of elements in x. */ | ||
| 1425 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar3 x); | ||
| 1426 | /*! @abstract Minimum of elements in x. */ | ||
| 1427 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar4 x); | ||
| 1428 | /*! @abstract Minimum of elements in x. */ | ||
| 1429 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar8 x); | ||
| 1430 | /*! @abstract Minimum of elements in x. */ | ||
| 1431 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x); | ||
| 1432 | /*! @abstract Minimum of elements in x. */ | ||
| 1433 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar32 x); | ||
| 1434 | /*! @abstract Minimum of elements in x. */ | ||
| 1435 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar64 x); | ||
| 1436 | /*! @abstract Minimum of elements in x. */ | ||
| 1437 | static inline SIMD_CFUNC short simd_reduce_min(simd_short2 x); | ||
| 1438 | /*! @abstract Minimum of elements in x. */ | ||
| 1439 | static inline SIMD_CFUNC short simd_reduce_min(simd_short3 x); | ||
| 1440 | /*! @abstract Minimum of elements in x. */ | ||
| 1441 | static inline SIMD_CFUNC short simd_reduce_min(simd_short4 x); | ||
| 1442 | /*! @abstract Minimum of elements in x. */ | ||
| 1443 | static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x); | ||
| 1444 | /*! @abstract Minimum of elements in x. */ | ||
| 1445 | static inline SIMD_CFUNC short simd_reduce_min(simd_short16 x); | ||
| 1446 | /*! @abstract Minimum of elements in x. */ | ||
| 1447 | static inline SIMD_CFUNC short simd_reduce_min(simd_short32 x); | ||
| 1448 | /*! @abstract Minimum of elements in x. */ | ||
| 1449 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort2 x); | ||
| 1450 | /*! @abstract Minimum of elements in x. */ | ||
| 1451 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort3 x); | ||
| 1452 | /*! @abstract Minimum of elements in x. */ | ||
| 1453 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort4 x); | ||
| 1454 | /*! @abstract Minimum of elements in x. */ | ||
| 1455 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x); | ||
| 1456 | /*! @abstract Minimum of elements in x. */ | ||
| 1457 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort16 x); | ||
| 1458 | /*! @abstract Minimum of elements in x. */ | ||
| 1459 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x); | ||
| 1460 | /*! @abstract Minimum of elements in x. */ | ||
| 1461 | static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x); | ||
| 1462 | /*! @abstract Minimum of elements in x. */ | ||
| 1463 | static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x); | ||
| 1464 | /*! @abstract Minimum of elements in x. */ | ||
| 1465 | static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x); | ||
| 1466 | /*! @abstract Minimum of elements in x. */ | ||
| 1467 | static inline SIMD_CFUNC int simd_reduce_min(simd_int8 x); | ||
| 1468 | /*! @abstract Minimum of elements in x. */ | ||
| 1469 | static inline SIMD_CFUNC int simd_reduce_min(simd_int16 x); | ||
| 1470 | /*! @abstract Minimum of elements in x. */ | ||
| 1471 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint2 x); | ||
| 1472 | /*! @abstract Minimum of elements in x. */ | ||
| 1473 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint3 x); | ||
| 1474 | /*! @abstract Minimum of elements in x. */ | ||
| 1475 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x); | ||
| 1476 | /*! @abstract Minimum of elements in x. */ | ||
| 1477 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint8 x); | ||
| 1478 | /*! @abstract Minimum of elements in x. */ | ||
| 1479 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint16 x); | ||
| 1480 | /*! @abstract Minimum of elements in x. */ | ||
| 1481 | static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x); | ||
| 1482 | /*! @abstract Minimum of elements in x. */ | ||
| 1483 | static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x); | ||
| 1484 | /*! @abstract Minimum of elements in x. */ | ||
| 1485 | static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x); | ||
| 1486 | /*! @abstract Minimum of elements in x. */ | ||
| 1487 | static inline SIMD_CFUNC float simd_reduce_min(simd_float8 x); | ||
| 1488 | /*! @abstract Minimum of elements in x. */ | ||
| 1489 | static inline SIMD_CFUNC float simd_reduce_min(simd_float16 x); | ||
| 1490 | /*! @abstract Minimum of elements in x. */ | ||
| 1491 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long2 x); | ||
| 1492 | /*! @abstract Minimum of elements in x. */ | ||
| 1493 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long3 x); | ||
| 1494 | /*! @abstract Minimum of elements in x. */ | ||
| 1495 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long4 x); | ||
| 1496 | /*! @abstract Minimum of elements in x. */ | ||
| 1497 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long8 x); | ||
| 1498 | /*! @abstract Minimum of elements in x. */ | ||
| 1499 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong2 x); | ||
| 1500 | /*! @abstract Minimum of elements in x. */ | ||
| 1501 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong3 x); | ||
| 1502 | /*! @abstract Minimum of elements in x. */ | ||
| 1503 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong4 x); | ||
| 1504 | /*! @abstract Minimum of elements in x. */ | ||
| 1505 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong8 x); | ||
| 1506 | /*! @abstract Minimum of elements in x. */ | ||
| 1507 | static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x); | ||
| 1508 | /*! @abstract Minimum of elements in x. */ | ||
| 1509 | static inline SIMD_CFUNC double simd_reduce_min(simd_double3 x); | ||
| 1510 | /*! @abstract Minimum of elements in x. */ | ||
| 1511 | static inline SIMD_CFUNC double simd_reduce_min(simd_double4 x); | ||
| 1512 | /*! @abstract Minimum of elements in x. */ | ||
| 1513 | static inline SIMD_CFUNC double simd_reduce_min(simd_double8 x); | ||
| 1514 | /*! @abstract Minimum of elements in x. | ||
| 1515 | * @discussion Deprecated. Use simd_min(x) instead. */ | ||
| 1516 | #define vector_reduce_min simd_reduce_min | ||
| 1517 | |||
| 1518 | /*! @abstract Maximum of elements in x. */ | ||
| 1519 | static inline SIMD_CFUNC char simd_reduce_max(simd_char2 x); | ||
| 1520 | /*! @abstract Maximum of elements in x. */ | ||
| 1521 | static inline SIMD_CFUNC char simd_reduce_max(simd_char3 x); | ||
| 1522 | /*! @abstract Maximum of elements in x. */ | ||
| 1523 | static inline SIMD_CFUNC char simd_reduce_max(simd_char4 x); | ||
| 1524 | /*! @abstract Maximum of elements in x. */ | ||
| 1525 | static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x); | ||
| 1526 | /*! @abstract Maximum of elements in x. */ | ||
| 1527 | static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x); | ||
| 1528 | /*! @abstract Maximum of elements in x. */ | ||
| 1529 | static inline SIMD_CFUNC char simd_reduce_max(simd_char32 x); | ||
| 1530 | /*! @abstract Maximum of elements in x. */ | ||
| 1531 | static inline SIMD_CFUNC char simd_reduce_max(simd_char64 x); | ||
| 1532 | /*! @abstract Maximum of elements in x. */ | ||
| 1533 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar2 x); | ||
| 1534 | /*! @abstract Maximum of elements in x. */ | ||
| 1535 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar3 x); | ||
| 1536 | /*! @abstract Maximum of elements in x. */ | ||
| 1537 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar4 x); | ||
| 1538 | /*! @abstract Maximum of elements in x. */ | ||
| 1539 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar8 x); | ||
| 1540 | /*! @abstract Maximum of elements in x. */ | ||
| 1541 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x); | ||
| 1542 | /*! @abstract Maximum of elements in x. */ | ||
| 1543 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar32 x); | ||
| 1544 | /*! @abstract Maximum of elements in x. */ | ||
| 1545 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar64 x); | ||
| 1546 | /*! @abstract Maximum of elements in x. */ | ||
| 1547 | static inline SIMD_CFUNC short simd_reduce_max(simd_short2 x); | ||
| 1548 | /*! @abstract Maximum of elements in x. */ | ||
| 1549 | static inline SIMD_CFUNC short simd_reduce_max(simd_short3 x); | ||
| 1550 | /*! @abstract Maximum of elements in x. */ | ||
| 1551 | static inline SIMD_CFUNC short simd_reduce_max(simd_short4 x); | ||
| 1552 | /*! @abstract Maximum of elements in x. */ | ||
| 1553 | static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x); | ||
| 1554 | /*! @abstract Maximum of elements in x. */ | ||
| 1555 | static inline SIMD_CFUNC short simd_reduce_max(simd_short16 x); | ||
| 1556 | /*! @abstract Maximum of elements in x. */ | ||
| 1557 | static inline SIMD_CFUNC short simd_reduce_max(simd_short32 x); | ||
| 1558 | /*! @abstract Maximum of elements in x. */ | ||
| 1559 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort2 x); | ||
| 1560 | /*! @abstract Maximum of elements in x. */ | ||
| 1561 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort3 x); | ||
| 1562 | /*! @abstract Maximum of elements in x. */ | ||
| 1563 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort4 x); | ||
| 1564 | /*! @abstract Maximum of elements in x. */ | ||
| 1565 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x); | ||
| 1566 | /*! @abstract Maximum of elements in x. */ | ||
| 1567 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort16 x); | ||
| 1568 | /*! @abstract Maximum of elements in x. */ | ||
| 1569 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x); | ||
| 1570 | /*! @abstract Maximum of elements in x. */ | ||
| 1571 | static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x); | ||
| 1572 | /*! @abstract Maximum of elements in x. */ | ||
| 1573 | static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x); | ||
| 1574 | /*! @abstract Maximum of elements in x. */ | ||
| 1575 | static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x); | ||
| 1576 | /*! @abstract Maximum of elements in x. */ | ||
| 1577 | static inline SIMD_CFUNC int simd_reduce_max(simd_int8 x); | ||
| 1578 | /*! @abstract Maximum of elements in x. */ | ||
| 1579 | static inline SIMD_CFUNC int simd_reduce_max(simd_int16 x); | ||
| 1580 | /*! @abstract Maximum of elements in x. */ | ||
| 1581 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint2 x); | ||
| 1582 | /*! @abstract Maximum of elements in x. */ | ||
| 1583 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint3 x); | ||
| 1584 | /*! @abstract Maximum of elements in x. */ | ||
| 1585 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x); | ||
| 1586 | /*! @abstract Maximum of elements in x. */ | ||
| 1587 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint8 x); | ||
| 1588 | /*! @abstract Maximum of elements in x. */ | ||
| 1589 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint16 x); | ||
| 1590 | /*! @abstract Maximum of elements in x. */ | ||
| 1591 | static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x); | ||
| 1592 | /*! @abstract Maximum of elements in x. */ | ||
| 1593 | static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x); | ||
| 1594 | /*! @abstract Maximum of elements in x. */ | ||
| 1595 | static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x); | ||
| 1596 | /*! @abstract Maximum of elements in x. */ | ||
| 1597 | static inline SIMD_CFUNC float simd_reduce_max(simd_float8 x); | ||
| 1598 | /*! @abstract Maximum of elements in x. */ | ||
| 1599 | static inline SIMD_CFUNC float simd_reduce_max(simd_float16 x); | ||
| 1600 | /*! @abstract Maximum of elements in x. */ | ||
| 1601 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long2 x); | ||
| 1602 | /*! @abstract Maximum of elements in x. */ | ||
| 1603 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long3 x); | ||
| 1604 | /*! @abstract Maximum of elements in x. */ | ||
| 1605 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long4 x); | ||
| 1606 | /*! @abstract Maximum of elements in x. */ | ||
| 1607 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long8 x); | ||
| 1608 | /*! @abstract Maximum of elements in x. */ | ||
| 1609 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong2 x); | ||
| 1610 | /*! @abstract Maximum of elements in x. */ | ||
| 1611 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong3 x); | ||
| 1612 | /*! @abstract Maximum of elements in x. */ | ||
| 1613 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong4 x); | ||
| 1614 | /*! @abstract Maximum of elements in x. */ | ||
| 1615 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong8 x); | ||
| 1616 | /*! @abstract Maximum of elements in x. */ | ||
| 1617 | static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x); | ||
| 1618 | /*! @abstract Maximum of elements in x. */ | ||
| 1619 | static inline SIMD_CFUNC double simd_reduce_max(simd_double3 x); | ||
| 1620 | /*! @abstract Maximum of elements in x. */ | ||
| 1621 | static inline SIMD_CFUNC double simd_reduce_max(simd_double4 x); | ||
| 1622 | /*! @abstract Maximum of elements in x. */ | ||
| 1623 | static inline SIMD_CFUNC double simd_reduce_max(simd_double8 x); | ||
| 1624 | /*! @abstract Maximum of elements in x. | ||
| 1625 | * @discussion Deprecated. Use simd_max(x) instead. */ | ||
| 1626 | #define vector_reduce_max simd_reduce_max | ||
| 1627 | |||
| 1628 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1629 | * corresponding lane of y. */ | ||
| 1630 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char2 x, simd_char2 y) { | ||
| 1631 | return simd_all(x == y); | ||
| 1632 | } | ||
| 1633 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1634 | * corresponding lane of y. */ | ||
| 1635 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char3 x, simd_char3 y) { | ||
| 1636 | return simd_all(x == y); | ||
| 1637 | } | ||
| 1638 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1639 | * corresponding lane of y. */ | ||
| 1640 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char4 x, simd_char4 y) { | ||
| 1641 | return simd_all(x == y); | ||
| 1642 | } | ||
| 1643 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1644 | * corresponding lane of y. */ | ||
| 1645 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char8 x, simd_char8 y) { | ||
| 1646 | return simd_all(x == y); | ||
| 1647 | } | ||
| 1648 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1649 | * corresponding lane of y. */ | ||
| 1650 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char16 x, simd_char16 y) { | ||
| 1651 | return simd_all(x == y); | ||
| 1652 | } | ||
| 1653 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1654 | * corresponding lane of y. */ | ||
| 1655 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char32 x, simd_char32 y) { | ||
| 1656 | return simd_all(x == y); | ||
| 1657 | } | ||
| 1658 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1659 | * corresponding lane of y. */ | ||
| 1660 | static inline SIMD_CFUNC simd_bool simd_equal(simd_char64 x, simd_char64 y) { | ||
| 1661 | return simd_all(x == y); | ||
| 1662 | } | ||
| 1663 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1664 | * corresponding lane of y. */ | ||
| 1665 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar2 x, simd_uchar2 y) { | ||
| 1666 | return simd_all(x == y); | ||
| 1667 | } | ||
| 1668 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1669 | * corresponding lane of y. */ | ||
| 1670 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar3 x, simd_uchar3 y) { | ||
| 1671 | return simd_all(x == y); | ||
| 1672 | } | ||
| 1673 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1674 | * corresponding lane of y. */ | ||
| 1675 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar4 x, simd_uchar4 y) { | ||
| 1676 | return simd_all(x == y); | ||
| 1677 | } | ||
| 1678 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1679 | * corresponding lane of y. */ | ||
| 1680 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar8 x, simd_uchar8 y) { | ||
| 1681 | return simd_all(x == y); | ||
| 1682 | } | ||
| 1683 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1684 | * corresponding lane of y. */ | ||
| 1685 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar16 x, simd_uchar16 y) { | ||
| 1686 | return simd_all(x == y); | ||
| 1687 | } | ||
| 1688 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1689 | * corresponding lane of y. */ | ||
| 1690 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar32 x, simd_uchar32 y) { | ||
| 1691 | return simd_all(x == y); | ||
| 1692 | } | ||
| 1693 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1694 | * corresponding lane of y. */ | ||
| 1695 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uchar64 x, simd_uchar64 y) { | ||
| 1696 | return simd_all(x == y); | ||
| 1697 | } | ||
| 1698 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1699 | * corresponding lane of y. */ | ||
| 1700 | static inline SIMD_CFUNC simd_bool simd_equal(simd_short2 x, simd_short2 y) { | ||
| 1701 | return simd_all(x == y); | ||
| 1702 | } | ||
| 1703 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1704 | * corresponding lane of y. */ | ||
| 1705 | static inline SIMD_CFUNC simd_bool simd_equal(simd_short3 x, simd_short3 y) { | ||
| 1706 | return simd_all(x == y); | ||
| 1707 | } | ||
| 1708 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1709 | * corresponding lane of y. */ | ||
| 1710 | static inline SIMD_CFUNC simd_bool simd_equal(simd_short4 x, simd_short4 y) { | ||
| 1711 | return simd_all(x == y); | ||
| 1712 | } | ||
| 1713 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1714 | * corresponding lane of y. */ | ||
| 1715 | static inline SIMD_CFUNC simd_bool simd_equal(simd_short8 x, simd_short8 y) { | ||
| 1716 | return simd_all(x == y); | ||
| 1717 | } | ||
| 1718 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1719 | * corresponding lane of y. */ | ||
| 1720 | static inline SIMD_CFUNC simd_bool simd_equal(simd_short16 x, simd_short16 y) { | ||
| 1721 | return simd_all(x == y); | ||
| 1722 | } | ||
| 1723 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1724 | * corresponding lane of y. */ | ||
| 1725 | static inline SIMD_CFUNC simd_bool simd_equal(simd_short32 x, simd_short32 y) { | ||
| 1726 | return simd_all(x == y); | ||
| 1727 | } | ||
| 1728 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1729 | * corresponding lane of y. */ | ||
| 1730 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort2 x, simd_ushort2 y) { | ||
| 1731 | return simd_all(x == y); | ||
| 1732 | } | ||
| 1733 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1734 | * corresponding lane of y. */ | ||
| 1735 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort3 x, simd_ushort3 y) { | ||
| 1736 | return simd_all(x == y); | ||
| 1737 | } | ||
| 1738 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1739 | * corresponding lane of y. */ | ||
| 1740 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort4 x, simd_ushort4 y) { | ||
| 1741 | return simd_all(x == y); | ||
| 1742 | } | ||
| 1743 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1744 | * corresponding lane of y. */ | ||
| 1745 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort8 x, simd_ushort8 y) { | ||
| 1746 | return simd_all(x == y); | ||
| 1747 | } | ||
| 1748 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1749 | * corresponding lane of y. */ | ||
| 1750 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort16 x, simd_ushort16 y) { | ||
| 1751 | return simd_all(x == y); | ||
| 1752 | } | ||
| 1753 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1754 | * corresponding lane of y. */ | ||
| 1755 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort32 x, simd_ushort32 y) { | ||
| 1756 | return simd_all(x == y); | ||
| 1757 | } | ||
| 1758 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1759 | * corresponding lane of y. */ | ||
| 1760 | static inline SIMD_CFUNC simd_bool simd_equal(simd_int2 x, simd_int2 y) { | ||
| 1761 | return simd_all(x == y); | ||
| 1762 | } | ||
| 1763 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1764 | * corresponding lane of y. */ | ||
| 1765 | static inline SIMD_CFUNC simd_bool simd_equal(simd_int3 x, simd_int3 y) { | ||
| 1766 | return simd_all(x == y); | ||
| 1767 | } | ||
| 1768 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1769 | * corresponding lane of y. */ | ||
| 1770 | static inline SIMD_CFUNC simd_bool simd_equal(simd_int4 x, simd_int4 y) { | ||
| 1771 | return simd_all(x == y); | ||
| 1772 | } | ||
| 1773 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1774 | * corresponding lane of y. */ | ||
| 1775 | static inline SIMD_CFUNC simd_bool simd_equal(simd_int8 x, simd_int8 y) { | ||
| 1776 | return simd_all(x == y); | ||
| 1777 | } | ||
| 1778 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1779 | * corresponding lane of y. */ | ||
| 1780 | static inline SIMD_CFUNC simd_bool simd_equal(simd_int16 x, simd_int16 y) { | ||
| 1781 | return simd_all(x == y); | ||
| 1782 | } | ||
| 1783 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1784 | * corresponding lane of y. */ | ||
| 1785 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uint2 x, simd_uint2 y) { | ||
| 1786 | return simd_all(x == y); | ||
| 1787 | } | ||
| 1788 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1789 | * corresponding lane of y. */ | ||
| 1790 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uint3 x, simd_uint3 y) { | ||
| 1791 | return simd_all(x == y); | ||
| 1792 | } | ||
| 1793 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1794 | * corresponding lane of y. */ | ||
| 1795 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uint4 x, simd_uint4 y) { | ||
| 1796 | return simd_all(x == y); | ||
| 1797 | } | ||
| 1798 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1799 | * corresponding lane of y. */ | ||
| 1800 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uint8 x, simd_uint8 y) { | ||
| 1801 | return simd_all(x == y); | ||
| 1802 | } | ||
| 1803 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1804 | * corresponding lane of y. */ | ||
| 1805 | static inline SIMD_CFUNC simd_bool simd_equal(simd_uint16 x, simd_uint16 y) { | ||
| 1806 | return simd_all(x == y); | ||
| 1807 | } | ||
| 1808 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1809 | * corresponding lane of y. */ | ||
| 1810 | static inline SIMD_CFUNC simd_bool simd_equal(simd_float2 x, simd_float2 y) { | ||
| 1811 | return simd_all(x == y); | ||
| 1812 | } | ||
| 1813 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1814 | * corresponding lane of y. */ | ||
| 1815 | static inline SIMD_CFUNC simd_bool simd_equal(simd_float3 x, simd_float3 y) { | ||
| 1816 | return simd_all(x == y); | ||
| 1817 | } | ||
| 1818 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1819 | * corresponding lane of y. */ | ||
| 1820 | static inline SIMD_CFUNC simd_bool simd_equal(simd_float4 x, simd_float4 y) { | ||
| 1821 | return simd_all(x == y); | ||
| 1822 | } | ||
| 1823 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1824 | * corresponding lane of y. */ | ||
| 1825 | static inline SIMD_CFUNC simd_bool simd_equal(simd_float8 x, simd_float8 y) { | ||
| 1826 | return simd_all(x == y); | ||
| 1827 | } | ||
| 1828 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1829 | * corresponding lane of y. */ | ||
| 1830 | static inline SIMD_CFUNC simd_bool simd_equal(simd_float16 x, simd_float16 y) { | ||
| 1831 | return simd_all(x == y); | ||
| 1832 | } | ||
| 1833 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1834 | * corresponding lane of y. */ | ||
| 1835 | static inline SIMD_CFUNC simd_bool simd_equal(simd_long2 x, simd_long2 y) { | ||
| 1836 | return simd_all(x == y); | ||
| 1837 | } | ||
| 1838 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1839 | * corresponding lane of y. */ | ||
| 1840 | static inline SIMD_CFUNC simd_bool simd_equal(simd_long3 x, simd_long3 y) { | ||
| 1841 | return simd_all(x == y); | ||
| 1842 | } | ||
| 1843 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1844 | * corresponding lane of y. */ | ||
| 1845 | static inline SIMD_CFUNC simd_bool simd_equal(simd_long4 x, simd_long4 y) { | ||
| 1846 | return simd_all(x == y); | ||
| 1847 | } | ||
| 1848 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1849 | * corresponding lane of y. */ | ||
| 1850 | static inline SIMD_CFUNC simd_bool simd_equal(simd_long8 x, simd_long8 y) { | ||
| 1851 | return simd_all(x == y); | ||
| 1852 | } | ||
| 1853 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1854 | * corresponding lane of y. */ | ||
| 1855 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ulong2 x, simd_ulong2 y) { | ||
| 1856 | return simd_all(x == y); | ||
| 1857 | } | ||
| 1858 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1859 | * corresponding lane of y. */ | ||
| 1860 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ulong3 x, simd_ulong3 y) { | ||
| 1861 | return simd_all(x == y); | ||
| 1862 | } | ||
| 1863 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1864 | * corresponding lane of y. */ | ||
| 1865 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ulong4 x, simd_ulong4 y) { | ||
| 1866 | return simd_all(x == y); | ||
| 1867 | } | ||
| 1868 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1869 | * corresponding lane of y. */ | ||
| 1870 | static inline SIMD_CFUNC simd_bool simd_equal(simd_ulong8 x, simd_ulong8 y) { | ||
| 1871 | return simd_all(x == y); | ||
| 1872 | } | ||
| 1873 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1874 | * corresponding lane of y. */ | ||
| 1875 | static inline SIMD_CFUNC simd_bool simd_equal(simd_double2 x, simd_double2 y) { | ||
| 1876 | return simd_all(x == y); | ||
| 1877 | } | ||
| 1878 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1879 | * corresponding lane of y. */ | ||
| 1880 | static inline SIMD_CFUNC simd_bool simd_equal(simd_double3 x, simd_double3 y) { | ||
| 1881 | return simd_all(x == y); | ||
| 1882 | } | ||
| 1883 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1884 | * corresponding lane of y. */ | ||
| 1885 | static inline SIMD_CFUNC simd_bool simd_equal(simd_double4 x, simd_double4 y) { | ||
| 1886 | return simd_all(x == y); | ||
| 1887 | } | ||
| 1888 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1889 | * corresponding lane of y. */ | ||
| 1890 | static inline SIMD_CFUNC simd_bool simd_equal(simd_double8 x, simd_double8 y) { | ||
| 1891 | return simd_all(x == y); | ||
| 1892 | } | ||
| 1893 | |||
| 1894 | #ifdef __cplusplus | ||
| 1895 | } /* extern "C" */ | ||
| 1896 | |||
| 1897 | namespace simd { | ||
| 1898 | /*! @abstract The lanewise absolute value of x. */ | ||
| 1899 | template <typename typeN> static SIMD_CPPFUNC typeN abs(const typeN x) { return ::simd_abs(x); } | ||
| 1900 | /*! @abstract The lanewise maximum of x and y. */ | ||
| 1901 | template <typename typeN> static SIMD_CPPFUNC typeN max(const typeN x, const typeN y) { return ::simd_max(x,y); } | ||
| 1902 | /*! @abstract The lanewise minimum of x and y. */ | ||
| 1903 | template <typename typeN> static SIMD_CPPFUNC typeN min(const typeN x, const typeN y) { return ::simd_min(x,y); } | ||
| 1904 | /*! @abstract x clamped to the interval [min, max]. */ | ||
| 1905 | template <typename typeN> static SIMD_CPPFUNC typeN clamp(const typeN x, const typeN min, const typeN max) { return ::simd_clamp(x,min,max); } | ||
| 1906 | /*! @abstract -1 if x < 0, +1 if x > 0, and 0 otherwise. */ | ||
| 1907 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN sign(const fptypeN x) { return ::simd_sign(x); } | ||
| 1908 | /*! @abstract Linearly interpolates between x and y, taking the value x when t=0 and y when t=1 */ | ||
| 1909 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN mix(const fptypeN x, const fptypeN y, const fptypeN t) { return ::simd_mix(x,y,t); } | ||
| 1910 | /*! @abstract An approximation to 1/x. */ | ||
| 1911 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN recip(const fptypeN x) { return simd_recip(x); } | ||
| 1912 | /*! @abstract An approximation to 1/sqrt(x). */ | ||
| 1913 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN rsqrt(const fptypeN x) { return simd_rsqrt(x); } | ||
| 1914 | /*! @abstract The "fracional part" of x, in the range [0,1). */ | ||
| 1915 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN fract(const fptypeN x) { return ::simd_fract(x); } | ||
| 1916 | /*! @abstract 0 if x < edge, 1 otherwise. */ | ||
| 1917 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN step(const fptypeN edge, const fptypeN x) { return ::simd_step(edge,x); } | ||
| 1918 | /*! @abstract smoothly interpolates from 0 at edge0 to 1 at edge1. */ | ||
| 1919 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN smoothstep(const fptypeN edge0, const fptypeN edge1, const fptypeN x) { return ::simd_smoothstep(edge0,edge1,x); } | ||
| 1920 | /*! @abstract True if and only if each lane of x is equal to the | ||
| 1921 | * corresponding lane of y. | ||
| 1922 | * | ||
| 1923 | * @discussion This isn't operator== because that's already defined by | ||
| 1924 | * the compiler to return a lane mask. */ | ||
| 1925 | template <typename fptypeN> static SIMD_CPPFUNC simd_bool equal(const fptypeN x, const fptypeN y) { return ::simd_equal(x, y); } | ||
| 1926 | #if __cpp_decltype_auto | ||
| 1927 | /* If you are targeting an earlier version of the C++ standard that lacks | ||
| 1928 | decltype_auto support, you may use the C-style simd_reduce_* functions | ||
| 1929 | instead. */ | ||
| 1930 | /*! @abstract The sum of the elements in x. May overflow. */ | ||
| 1931 | template <typename typeN> static SIMD_CPPFUNC auto reduce_add(typeN x) { return ::simd_reduce_add(x); } | ||
| 1932 | /*! @abstract The least element in x. */ | ||
| 1933 | template <typename typeN> static SIMD_CPPFUNC auto reduce_min(typeN x) { return ::simd_reduce_min(x); } | ||
| 1934 | /*! @abstract The greatest element in x. */ | ||
| 1935 | template <typename typeN> static SIMD_CPPFUNC auto reduce_max(typeN x) { return ::simd_reduce_max(x); } | ||
| 1936 | #endif | ||
| 1937 | namespace precise { | ||
| 1938 | /*! @abstract An approximation to 1/x. */ | ||
| 1939 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN recip(const fptypeN x) { return ::simd_precise_recip(x); } | ||
| 1940 | /*! @abstract An approximation to 1/sqrt(x). */ | ||
| 1941 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN rsqrt(const fptypeN x) { return ::simd_precise_rsqrt(x); } | ||
| 1942 | } | ||
| 1943 | namespace fast { | ||
| 1944 | /*! @abstract An approximation to 1/x. */ | ||
| 1945 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN recip(const fptypeN x) { return ::simd_fast_recip(x); } | ||
| 1946 | /*! @abstract An approximation to 1/sqrt(x). */ | ||
| 1947 | template <typename fptypeN> static SIMD_CPPFUNC fptypeN rsqrt(const fptypeN x) { return ::simd_fast_rsqrt(x); } | ||
| 1948 | } | ||
| 1949 | } | ||
| 1950 | |||
| 1951 | extern "C" { | ||
| 1952 | #endif /* __cplusplus */ | ||
| 1953 | |||
| 1954 | #pragma mark - Implementation | ||
| 1955 | |||
| 1956 | static inline SIMD_CFUNC simd_char2 simd_abs(simd_char2 x) { | ||
| 1957 | return simd_make_char2(simd_abs(simd_make_char8_undef(x))); | ||
| 1958 | } | ||
| 1959 | |||
| 1960 | static inline SIMD_CFUNC simd_char3 simd_abs(simd_char3 x) { | ||
| 1961 | return simd_make_char3(simd_abs(simd_make_char8_undef(x))); | ||
| 1962 | } | ||
| 1963 | |||
| 1964 | static inline SIMD_CFUNC simd_char4 simd_abs(simd_char4 x) { | ||
| 1965 | return simd_make_char4(simd_abs(simd_make_char8_undef(x))); | ||
| 1966 | } | ||
| 1967 | |||
| 1968 | static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x) { | ||
| 1969 | #if defined __arm__ || defined __arm64__ | ||
| 1970 | return vabs_s8(x); | ||
| 1971 | #else | ||
| 1972 | return simd_make_char8(simd_abs(simd_make_char16_undef(x))); | ||
| 1973 | #endif | ||
| 1974 | } | ||
| 1975 | |||
| 1976 | static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x) { | ||
| 1977 | #if defined __arm__ || defined __arm64__ | ||
| 1978 | return vabsq_s8(x); | ||
| 1979 | #elif defined __SSE4_1__ | ||
| 1980 | return (simd_char16) _mm_abs_epi8((__m128i)x); | ||
| 1981 | #else | ||
| 1982 | simd_char16 mask = x >> 7; return (x ^ mask) - mask; | ||
| 1983 | #endif | ||
| 1984 | } | ||
| 1985 | |||
| 1986 | static inline SIMD_CFUNC simd_char32 simd_abs(simd_char32 x) { | ||
| 1987 | #if defined __AVX2__ | ||
| 1988 | return _mm256_abs_epi8(x); | ||
| 1989 | #else | ||
| 1990 | return simd_make_char32(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 1991 | #endif | ||
| 1992 | } | ||
| 1993 | |||
| 1994 | static inline SIMD_CFUNC simd_char64 simd_abs(simd_char64 x) { | ||
| 1995 | #if defined __AVX512BW__ | ||
| 1996 | return _mm512_abs_epi8(x); | ||
| 1997 | #else | ||
| 1998 | return simd_make_char64(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 1999 | #endif | ||
| 2000 | } | ||
| 2001 | |||
| 2002 | static inline SIMD_CFUNC simd_short2 simd_abs(simd_short2 x) { | ||
| 2003 | return simd_make_short2(simd_abs(simd_make_short4_undef(x))); | ||
| 2004 | } | ||
| 2005 | |||
| 2006 | static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x) { | ||
| 2007 | return simd_make_short3(simd_abs(simd_make_short4_undef(x))); | ||
| 2008 | } | ||
| 2009 | |||
| 2010 | static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x) { | ||
| 2011 | #if defined __arm__ || defined __arm64__ | ||
| 2012 | return vabs_s16(x); | ||
| 2013 | #else | ||
| 2014 | return simd_make_short4(simd_abs(simd_make_short8_undef(x))); | ||
| 2015 | #endif | ||
| 2016 | } | ||
| 2017 | |||
| 2018 | static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x) { | ||
| 2019 | #if defined __arm__ || defined __arm64__ | ||
| 2020 | return vabsq_s16(x); | ||
| 2021 | #elif defined __SSE4_1__ | ||
| 2022 | return (simd_short8) _mm_abs_epi16((__m128i)x); | ||
| 2023 | #else | ||
| 2024 | simd_short8 mask = x >> 15; return (x ^ mask) - mask; | ||
| 2025 | #endif | ||
| 2026 | } | ||
| 2027 | |||
| 2028 | static inline SIMD_CFUNC simd_short16 simd_abs(simd_short16 x) { | ||
| 2029 | #if defined __AVX2__ | ||
| 2030 | return _mm256_abs_epi16(x); | ||
| 2031 | #else | ||
| 2032 | return simd_make_short16(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 2033 | #endif | ||
| 2034 | } | ||
| 2035 | |||
| 2036 | static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x) { | ||
| 2037 | #if defined __AVX512BW__ | ||
| 2038 | return _mm512_abs_epi16(x); | ||
| 2039 | #else | ||
| 2040 | return simd_make_short32(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 2041 | #endif | ||
| 2042 | } | ||
| 2043 | |||
| 2044 | static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x) { | ||
| 2045 | #if defined __arm__ || defined __arm64__ | ||
| 2046 | return vabs_s32(x); | ||
| 2047 | #else | ||
| 2048 | return simd_make_int2(simd_abs(simd_make_int4_undef(x))); | ||
| 2049 | #endif | ||
| 2050 | } | ||
| 2051 | |||
| 2052 | static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x) { | ||
| 2053 | return simd_make_int3(simd_abs(simd_make_int4_undef(x))); | ||
| 2054 | } | ||
| 2055 | |||
| 2056 | static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x) { | ||
| 2057 | #if defined __arm__ || defined __arm64__ | ||
| 2058 | return vabsq_s32(x); | ||
| 2059 | #elif defined __SSE4_1__ | ||
| 2060 | return (simd_int4) _mm_abs_epi32((__m128i)x); | ||
| 2061 | #else | ||
| 2062 | simd_int4 mask = x >> 31; return (x ^ mask) - mask; | ||
| 2063 | #endif | ||
| 2064 | } | ||
| 2065 | |||
| 2066 | static inline SIMD_CFUNC simd_int8 simd_abs(simd_int8 x) { | ||
| 2067 | #if defined __AVX2__ | ||
| 2068 | return _mm256_abs_epi32(x); | ||
| 2069 | #else | ||
| 2070 | return simd_make_int8(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 2071 | #endif | ||
| 2072 | } | ||
| 2073 | |||
| 2074 | static inline SIMD_CFUNC simd_int16 simd_abs(simd_int16 x) { | ||
| 2075 | #if defined __AVX512F__ | ||
| 2076 | return _mm512_abs_epi32(x); | ||
| 2077 | #else | ||
| 2078 | return simd_make_int16(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 2079 | #endif | ||
| 2080 | } | ||
| 2081 | |||
| 2082 | static inline SIMD_CFUNC simd_float2 simd_abs(simd_float2 x) { | ||
| 2083 | return __tg_fabs(x); | ||
| 2084 | } | ||
| 2085 | |||
| 2086 | static inline SIMD_CFUNC simd_float3 simd_abs(simd_float3 x) { | ||
| 2087 | return __tg_fabs(x); | ||
| 2088 | } | ||
| 2089 | |||
| 2090 | static inline SIMD_CFUNC simd_float4 simd_abs(simd_float4 x) { | ||
| 2091 | return __tg_fabs(x); | ||
| 2092 | } | ||
| 2093 | |||
| 2094 | static inline SIMD_CFUNC simd_float8 simd_abs(simd_float8 x) { | ||
| 2095 | return __tg_fabs(x); | ||
| 2096 | } | ||
| 2097 | |||
| 2098 | static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x) { | ||
| 2099 | return __tg_fabs(x); | ||
| 2100 | } | ||
| 2101 | |||
| 2102 | static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x) { | ||
| 2103 | #if defined __arm64__ | ||
| 2104 | return vabsq_s64(x); | ||
| 2105 | #elif defined __SSE4_1__ | ||
| 2106 | return (simd_long2) _mm_abs_epi64((__m128i)x); | ||
| 2107 | #else | ||
| 2108 | simd_long2 mask = x >> 63; return (x ^ mask) - mask; | ||
| 2109 | #endif | ||
| 2110 | } | ||
| 2111 | |||
| 2112 | static inline SIMD_CFUNC simd_long3 simd_abs(simd_long3 x) { | ||
| 2113 | return simd_make_long3(simd_abs(simd_make_long4_undef(x))); | ||
| 2114 | } | ||
| 2115 | |||
| 2116 | static inline SIMD_CFUNC simd_long4 simd_abs(simd_long4 x) { | ||
| 2117 | #if defined __AVX2__ | ||
| 2118 | return _mm256_abs_epi64(x); | ||
| 2119 | #else | ||
| 2120 | return simd_make_long4(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 2121 | #endif | ||
| 2122 | } | ||
| 2123 | |||
| 2124 | static inline SIMD_CFUNC simd_long8 simd_abs(simd_long8 x) { | ||
| 2125 | #if defined __AVX512F__ | ||
| 2126 | return _mm512_abs_epi64(x); | ||
| 2127 | #else | ||
| 2128 | return simd_make_long8(simd_abs(x.lo), simd_abs(x.hi)); | ||
| 2129 | #endif | ||
| 2130 | } | ||
| 2131 | |||
| 2132 | static inline SIMD_CFUNC simd_double2 simd_abs(simd_double2 x) { | ||
| 2133 | return __tg_fabs(x); | ||
| 2134 | } | ||
| 2135 | |||
| 2136 | static inline SIMD_CFUNC simd_double3 simd_abs(simd_double3 x) { | ||
| 2137 | return __tg_fabs(x); | ||
| 2138 | } | ||
| 2139 | |||
| 2140 | static inline SIMD_CFUNC simd_double4 simd_abs(simd_double4 x) { | ||
| 2141 | return __tg_fabs(x); | ||
| 2142 | } | ||
| 2143 | |||
| 2144 | static inline SIMD_CFUNC simd_double8 simd_abs(simd_double8 x) { | ||
| 2145 | return __tg_fabs(x); | ||
| 2146 | } | ||
| 2147 | |||
| 2148 | static inline SIMD_CFUNC simd_char2 simd_min(simd_char2 x, simd_char2 y) { | ||
| 2149 | return simd_make_char2(simd_min(simd_make_char8_undef(x), simd_make_char8_undef(y))); | ||
| 2150 | } | ||
| 2151 | |||
| 2152 | static inline SIMD_CFUNC simd_char3 simd_min(simd_char3 x, simd_char3 y) { | ||
| 2153 | return simd_make_char3(simd_min(simd_make_char8_undef(x), simd_make_char8_undef(y))); | ||
| 2154 | } | ||
| 2155 | |||
| 2156 | static inline SIMD_CFUNC simd_char4 simd_min(simd_char4 x, simd_char4 y) { | ||
| 2157 | return simd_make_char4(simd_min(simd_make_char8_undef(x), simd_make_char8_undef(y))); | ||
| 2158 | } | ||
| 2159 | |||
| 2160 | static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y) { | ||
| 2161 | #if defined __arm__ || defined __arm64__ | ||
| 2162 | return vmin_s8(x, y); | ||
| 2163 | #else | ||
| 2164 | return simd_make_char8(simd_min(simd_make_char16_undef(x), simd_make_char16_undef(y))); | ||
| 2165 | #endif | ||
| 2166 | |||
| 2167 | } | ||
| 2168 | |||
| 2169 | static inline SIMD_CFUNC simd_char16 simd_min(simd_char16 x, simd_char16 y) { | ||
| 2170 | #if defined __arm__ || defined __arm64__ | ||
| 2171 | return vminq_s8(x, y); | ||
| 2172 | #elif defined __SSE4_1__ | ||
| 2173 | return (simd_char16) _mm_min_epi8((__m128i)x, (__m128i)y); | ||
| 2174 | #else | ||
| 2175 | return simd_bitselect(x, y, y < x); | ||
| 2176 | #endif | ||
| 2177 | } | ||
| 2178 | |||
| 2179 | static inline SIMD_CFUNC simd_char32 simd_min(simd_char32 x, simd_char32 y) { | ||
| 2180 | #if defined __AVX2__ | ||
| 2181 | return _mm256_min_epi8(x, y); | ||
| 2182 | #else | ||
| 2183 | return simd_bitselect(x, y, y < x); | ||
| 2184 | #endif | ||
| 2185 | } | ||
| 2186 | |||
| 2187 | static inline SIMD_CFUNC simd_char64 simd_min(simd_char64 x, simd_char64 y) { | ||
| 2188 | #if defined __AVX512BW__ | ||
| 2189 | return _mm512_min_epi8(x, y); | ||
| 2190 | #else | ||
| 2191 | return simd_bitselect(x, y, y < x); | ||
| 2192 | #endif | ||
| 2193 | } | ||
| 2194 | |||
| 2195 | static inline SIMD_CFUNC simd_uchar2 simd_min(simd_uchar2 x, simd_uchar2 y) { | ||
| 2196 | return simd_make_uchar2(simd_min(simd_make_uchar8_undef(x), simd_make_uchar8_undef(y))); | ||
| 2197 | } | ||
| 2198 | |||
| 2199 | static inline SIMD_CFUNC simd_uchar3 simd_min(simd_uchar3 x, simd_uchar3 y) { | ||
| 2200 | return simd_make_uchar3(simd_min(simd_make_uchar8_undef(x), simd_make_uchar8_undef(y))); | ||
| 2201 | } | ||
| 2202 | |||
| 2203 | static inline SIMD_CFUNC simd_uchar4 simd_min(simd_uchar4 x, simd_uchar4 y) { | ||
| 2204 | return simd_make_uchar4(simd_min(simd_make_uchar8_undef(x), simd_make_uchar8_undef(y))); | ||
| 2205 | } | ||
| 2206 | |||
| 2207 | static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y) { | ||
| 2208 | #if defined __arm__ || defined __arm64__ | ||
| 2209 | return vmin_u8(x, y); | ||
| 2210 | #else | ||
| 2211 | return simd_make_uchar8(simd_min(simd_make_uchar16_undef(x), simd_make_uchar16_undef(y))); | ||
| 2212 | #endif | ||
| 2213 | |||
| 2214 | } | ||
| 2215 | |||
| 2216 | static inline SIMD_CFUNC simd_uchar16 simd_min(simd_uchar16 x, simd_uchar16 y) { | ||
| 2217 | #if defined __arm__ || defined __arm64__ | ||
| 2218 | return vminq_u8(x, y); | ||
| 2219 | #elif defined __SSE4_1__ | ||
| 2220 | return (simd_uchar16) _mm_min_epu8((__m128i)x, (__m128i)y); | ||
| 2221 | #else | ||
| 2222 | return simd_bitselect(x, y, y < x); | ||
| 2223 | #endif | ||
| 2224 | } | ||
| 2225 | |||
| 2226 | static inline SIMD_CFUNC simd_uchar32 simd_min(simd_uchar32 x, simd_uchar32 y) { | ||
| 2227 | #if defined __AVX2__ | ||
| 2228 | return _mm256_min_epu8(x, y); | ||
| 2229 | #else | ||
| 2230 | return simd_bitselect(x, y, y < x); | ||
| 2231 | #endif | ||
| 2232 | } | ||
| 2233 | |||
| 2234 | static inline SIMD_CFUNC simd_uchar64 simd_min(simd_uchar64 x, simd_uchar64 y) { | ||
| 2235 | #if defined __AVX512BW__ | ||
| 2236 | return _mm512_min_epu8(x, y); | ||
| 2237 | #else | ||
| 2238 | return simd_bitselect(x, y, y < x); | ||
| 2239 | #endif | ||
| 2240 | } | ||
| 2241 | |||
| 2242 | static inline SIMD_CFUNC simd_short2 simd_min(simd_short2 x, simd_short2 y) { | ||
| 2243 | return simd_make_short2(simd_min(simd_make_short4_undef(x), simd_make_short4_undef(y))); | ||
| 2244 | } | ||
| 2245 | |||
| 2246 | static inline SIMD_CFUNC simd_short3 simd_min(simd_short3 x, simd_short3 y) { | ||
| 2247 | return simd_make_short3(simd_min(simd_make_short4_undef(x), simd_make_short4_undef(y))); | ||
| 2248 | } | ||
| 2249 | |||
| 2250 | static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y) { | ||
| 2251 | #if defined __arm__ || defined __arm64__ | ||
| 2252 | return vmin_s16(x, y); | ||
| 2253 | #else | ||
| 2254 | return simd_make_short4(simd_min(simd_make_short8_undef(x), simd_make_short8_undef(y))); | ||
| 2255 | #endif | ||
| 2256 | |||
| 2257 | } | ||
| 2258 | |||
| 2259 | static inline SIMD_CFUNC simd_short8 simd_min(simd_short8 x, simd_short8 y) { | ||
| 2260 | #if defined __arm__ || defined __arm64__ | ||
| 2261 | return vminq_s16(x, y); | ||
| 2262 | #elif defined __SSE4_1__ | ||
| 2263 | return (simd_short8) _mm_min_epi16((__m128i)x, (__m128i)y); | ||
| 2264 | #else | ||
| 2265 | return simd_bitselect(x, y, y < x); | ||
| 2266 | #endif | ||
| 2267 | } | ||
| 2268 | |||
| 2269 | static inline SIMD_CFUNC simd_short16 simd_min(simd_short16 x, simd_short16 y) { | ||
| 2270 | #if defined __AVX2__ | ||
| 2271 | return _mm256_min_epi16(x, y); | ||
| 2272 | #else | ||
| 2273 | return simd_bitselect(x, y, y < x); | ||
| 2274 | #endif | ||
| 2275 | } | ||
| 2276 | |||
| 2277 | static inline SIMD_CFUNC simd_short32 simd_min(simd_short32 x, simd_short32 y) { | ||
| 2278 | #if defined __AVX512BW__ | ||
| 2279 | return _mm512_min_epi16(x, y); | ||
| 2280 | #else | ||
| 2281 | return simd_bitselect(x, y, y < x); | ||
| 2282 | #endif | ||
| 2283 | } | ||
| 2284 | |||
| 2285 | static inline SIMD_CFUNC simd_ushort2 simd_min(simd_ushort2 x, simd_ushort2 y) { | ||
| 2286 | return simd_make_ushort2(simd_min(simd_make_ushort4_undef(x), simd_make_ushort4_undef(y))); | ||
| 2287 | } | ||
| 2288 | |||
| 2289 | static inline SIMD_CFUNC simd_ushort3 simd_min(simd_ushort3 x, simd_ushort3 y) { | ||
| 2290 | return simd_make_ushort3(simd_min(simd_make_ushort4_undef(x), simd_make_ushort4_undef(y))); | ||
| 2291 | } | ||
| 2292 | |||
| 2293 | static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y) { | ||
| 2294 | #if defined __arm__ || defined __arm64__ | ||
| 2295 | return vmin_u16(x, y); | ||
| 2296 | #else | ||
| 2297 | return simd_make_ushort4(simd_min(simd_make_ushort8_undef(x), simd_make_ushort8_undef(y))); | ||
| 2298 | #endif | ||
| 2299 | |||
| 2300 | } | ||
| 2301 | |||
| 2302 | static inline SIMD_CFUNC simd_ushort8 simd_min(simd_ushort8 x, simd_ushort8 y) { | ||
| 2303 | #if defined __arm__ || defined __arm64__ | ||
| 2304 | return vminq_u16(x, y); | ||
| 2305 | #elif defined __SSE4_1__ | ||
| 2306 | return (simd_ushort8) _mm_min_epu16((__m128i)x, (__m128i)y); | ||
| 2307 | #else | ||
| 2308 | return simd_bitselect(x, y, y < x); | ||
| 2309 | #endif | ||
| 2310 | } | ||
| 2311 | |||
| 2312 | static inline SIMD_CFUNC simd_ushort16 simd_min(simd_ushort16 x, simd_ushort16 y) { | ||
| 2313 | #if defined __AVX2__ | ||
| 2314 | return _mm256_min_epu16(x, y); | ||
| 2315 | #else | ||
| 2316 | return simd_bitselect(x, y, y < x); | ||
| 2317 | #endif | ||
| 2318 | } | ||
| 2319 | |||
| 2320 | static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y) { | ||
| 2321 | #if defined __AVX512BW__ | ||
| 2322 | return _mm512_min_epu16(x, y); | ||
| 2323 | #else | ||
| 2324 | return simd_bitselect(x, y, y < x); | ||
| 2325 | #endif | ||
| 2326 | } | ||
| 2327 | |||
| 2328 | static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y) { | ||
| 2329 | #if defined __arm__ || defined __arm64__ | ||
| 2330 | return vmin_s32(x, y); | ||
| 2331 | #else | ||
| 2332 | return simd_make_int2(simd_min(simd_make_int4_undef(x), simd_make_int4_undef(y))); | ||
| 2333 | #endif | ||
| 2334 | |||
| 2335 | } | ||
| 2336 | |||
| 2337 | static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y) { | ||
| 2338 | return simd_make_int3(simd_min(simd_make_int4_undef(x), simd_make_int4_undef(y))); | ||
| 2339 | } | ||
| 2340 | |||
| 2341 | static inline SIMD_CFUNC simd_int4 simd_min(simd_int4 x, simd_int4 y) { | ||
| 2342 | #if defined __arm__ || defined __arm64__ | ||
| 2343 | return vminq_s32(x, y); | ||
| 2344 | #elif defined __SSE4_1__ | ||
| 2345 | return (simd_int4) _mm_min_epi32((__m128i)x, (__m128i)y); | ||
| 2346 | #else | ||
| 2347 | return simd_bitselect(x, y, y < x); | ||
| 2348 | #endif | ||
| 2349 | } | ||
| 2350 | |||
| 2351 | static inline SIMD_CFUNC simd_int8 simd_min(simd_int8 x, simd_int8 y) { | ||
| 2352 | #if defined __AVX2__ | ||
| 2353 | return _mm256_min_epi32(x, y); | ||
| 2354 | #else | ||
| 2355 | return simd_bitselect(x, y, y < x); | ||
| 2356 | #endif | ||
| 2357 | } | ||
| 2358 | |||
| 2359 | static inline SIMD_CFUNC simd_int16 simd_min(simd_int16 x, simd_int16 y) { | ||
| 2360 | #if defined __AVX512F__ | ||
| 2361 | return _mm512_min_epi32(x, y); | ||
| 2362 | #else | ||
| 2363 | return simd_bitselect(x, y, y < x); | ||
| 2364 | #endif | ||
| 2365 | } | ||
| 2366 | |||
| 2367 | static inline SIMD_CFUNC simd_uint2 simd_min(simd_uint2 x, simd_uint2 y) { | ||
| 2368 | #if defined __arm__ || defined __arm64__ | ||
| 2369 | return vmin_u32(x, y); | ||
| 2370 | #else | ||
| 2371 | return simd_make_uint2(simd_min(simd_make_uint4_undef(x), simd_make_uint4_undef(y))); | ||
| 2372 | #endif | ||
| 2373 | |||
| 2374 | } | ||
| 2375 | |||
| 2376 | static inline SIMD_CFUNC simd_uint3 simd_min(simd_uint3 x, simd_uint3 y) { | ||
| 2377 | return simd_make_uint3(simd_min(simd_make_uint4_undef(x), simd_make_uint4_undef(y))); | ||
| 2378 | } | ||
| 2379 | |||
| 2380 | static inline SIMD_CFUNC simd_uint4 simd_min(simd_uint4 x, simd_uint4 y) { | ||
| 2381 | #if defined __arm__ || defined __arm64__ | ||
| 2382 | return vminq_u32(x, y); | ||
| 2383 | #elif defined __SSE4_1__ | ||
| 2384 | return (simd_uint4) _mm_min_epu32((__m128i)x, (__m128i)y); | ||
| 2385 | #else | ||
| 2386 | return simd_bitselect(x, y, y < x); | ||
| 2387 | #endif | ||
| 2388 | } | ||
| 2389 | |||
| 2390 | static inline SIMD_CFUNC simd_uint8 simd_min(simd_uint8 x, simd_uint8 y) { | ||
| 2391 | #if defined __AVX2__ | ||
| 2392 | return _mm256_min_epu32(x, y); | ||
| 2393 | #else | ||
| 2394 | return simd_bitselect(x, y, y < x); | ||
| 2395 | #endif | ||
| 2396 | } | ||
| 2397 | |||
| 2398 | static inline SIMD_CFUNC simd_uint16 simd_min(simd_uint16 x, simd_uint16 y) { | ||
| 2399 | #if defined __AVX512F__ | ||
| 2400 | return _mm512_min_epu32(x, y); | ||
| 2401 | #else | ||
| 2402 | return simd_bitselect(x, y, y < x); | ||
| 2403 | #endif | ||
| 2404 | } | ||
| 2405 | |||
| 2406 | static inline SIMD_CFUNC float simd_min(float x, float y) { | ||
| 2407 | return __tg_fmin(x,y); | ||
| 2408 | } | ||
| 2409 | |||
| 2410 | static inline SIMD_CFUNC simd_float2 simd_min(simd_float2 x, simd_float2 y) { | ||
| 2411 | return __tg_fmin(x,y); | ||
| 2412 | } | ||
| 2413 | |||
| 2414 | static inline SIMD_CFUNC simd_float3 simd_min(simd_float3 x, simd_float3 y) { | ||
| 2415 | return __tg_fmin(x,y); | ||
| 2416 | } | ||
| 2417 | |||
| 2418 | static inline SIMD_CFUNC simd_float4 simd_min(simd_float4 x, simd_float4 y) { | ||
| 2419 | return __tg_fmin(x,y); | ||
| 2420 | } | ||
| 2421 | |||
| 2422 | static inline SIMD_CFUNC simd_float8 simd_min(simd_float8 x, simd_float8 y) { | ||
| 2423 | return __tg_fmin(x,y); | ||
| 2424 | } | ||
| 2425 | |||
| 2426 | static inline SIMD_CFUNC simd_float16 simd_min(simd_float16 x, simd_float16 y) { | ||
| 2427 | return __tg_fmin(x,y); | ||
| 2428 | } | ||
| 2429 | |||
| 2430 | static inline SIMD_CFUNC simd_long2 simd_min(simd_long2 x, simd_long2 y) { | ||
| 2431 | #if defined __AVX512VL__ | ||
| 2432 | return _mm_min_epi64(x, y); | ||
| 2433 | #else | ||
| 2434 | return simd_bitselect(x, y, y < x); | ||
| 2435 | #endif | ||
| 2436 | } | ||
| 2437 | |||
| 2438 | static inline SIMD_CFUNC simd_long3 simd_min(simd_long3 x, simd_long3 y) { | ||
| 2439 | return simd_make_long3(simd_min(simd_make_long4_undef(x), simd_make_long4_undef(y))); | ||
| 2440 | } | ||
| 2441 | |||
| 2442 | static inline SIMD_CFUNC simd_long4 simd_min(simd_long4 x, simd_long4 y) { | ||
| 2443 | #if defined __AVX512VL__ | ||
| 2444 | return _mm256_min_epi64(x, y); | ||
| 2445 | #else | ||
| 2446 | return simd_bitselect(x, y, y < x); | ||
| 2447 | #endif | ||
| 2448 | } | ||
| 2449 | |||
| 2450 | static inline SIMD_CFUNC simd_long8 simd_min(simd_long8 x, simd_long8 y) { | ||
| 2451 | #if defined __AVX512F__ | ||
| 2452 | return _mm512_min_epi64(x, y); | ||
| 2453 | #else | ||
| 2454 | return simd_bitselect(x, y, y < x); | ||
| 2455 | #endif | ||
| 2456 | } | ||
| 2457 | |||
| 2458 | static inline SIMD_CFUNC simd_ulong2 simd_min(simd_ulong2 x, simd_ulong2 y) { | ||
| 2459 | #if defined __AVX512VL__ | ||
| 2460 | return _mm_min_epu64(x, y); | ||
| 2461 | #else | ||
| 2462 | return simd_bitselect(x, y, y < x); | ||
| 2463 | #endif | ||
| 2464 | } | ||
| 2465 | |||
| 2466 | static inline SIMD_CFUNC simd_ulong3 simd_min(simd_ulong3 x, simd_ulong3 y) { | ||
| 2467 | return simd_make_ulong3(simd_min(simd_make_ulong4_undef(x), simd_make_ulong4_undef(y))); | ||
| 2468 | } | ||
| 2469 | |||
| 2470 | static inline SIMD_CFUNC simd_ulong4 simd_min(simd_ulong4 x, simd_ulong4 y) { | ||
| 2471 | #if defined __AVX512VL__ | ||
| 2472 | return _mm256_min_epu64(x, y); | ||
| 2473 | #else | ||
| 2474 | return simd_bitselect(x, y, y < x); | ||
| 2475 | #endif | ||
| 2476 | } | ||
| 2477 | |||
| 2478 | static inline SIMD_CFUNC simd_ulong8 simd_min(simd_ulong8 x, simd_ulong8 y) { | ||
| 2479 | #if defined __AVX512F__ | ||
| 2480 | return _mm512_min_epu64(x, y); | ||
| 2481 | #else | ||
| 2482 | return simd_bitselect(x, y, y < x); | ||
| 2483 | #endif | ||
| 2484 | } | ||
| 2485 | |||
| 2486 | static inline SIMD_CFUNC double simd_min(double x, double y) { | ||
| 2487 | return __tg_fmin(x,y); | ||
| 2488 | } | ||
| 2489 | |||
| 2490 | static inline SIMD_CFUNC simd_double2 simd_min(simd_double2 x, simd_double2 y) { | ||
| 2491 | return __tg_fmin(x,y); | ||
| 2492 | } | ||
| 2493 | |||
| 2494 | static inline SIMD_CFUNC simd_double3 simd_min(simd_double3 x, simd_double3 y) { | ||
| 2495 | return __tg_fmin(x,y); | ||
| 2496 | } | ||
| 2497 | |||
| 2498 | static inline SIMD_CFUNC simd_double4 simd_min(simd_double4 x, simd_double4 y) { | ||
| 2499 | return __tg_fmin(x,y); | ||
| 2500 | } | ||
| 2501 | |||
| 2502 | static inline SIMD_CFUNC simd_double8 simd_min(simd_double8 x, simd_double8 y) { | ||
| 2503 | return __tg_fmin(x,y); | ||
| 2504 | } | ||
| 2505 | |||
| 2506 | static inline SIMD_CFUNC simd_char2 simd_max(simd_char2 x, simd_char2 y) { | ||
| 2507 | return simd_make_char2(simd_max(simd_make_char8_undef(x), simd_make_char8_undef(y))); | ||
| 2508 | } | ||
| 2509 | |||
| 2510 | static inline SIMD_CFUNC simd_char3 simd_max(simd_char3 x, simd_char3 y) { | ||
| 2511 | return simd_make_char3(simd_max(simd_make_char8_undef(x), simd_make_char8_undef(y))); | ||
| 2512 | } | ||
| 2513 | |||
| 2514 | static inline SIMD_CFUNC simd_char4 simd_max(simd_char4 x, simd_char4 y) { | ||
| 2515 | return simd_make_char4(simd_max(simd_make_char8_undef(x), simd_make_char8_undef(y))); | ||
| 2516 | } | ||
| 2517 | |||
| 2518 | static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y) { | ||
| 2519 | #if defined __arm__ || defined __arm64__ | ||
| 2520 | return vmax_s8(x, y); | ||
| 2521 | #else | ||
| 2522 | return simd_make_char8(simd_max(simd_make_char16_undef(x), simd_make_char16_undef(y))); | ||
| 2523 | #endif | ||
| 2524 | |||
| 2525 | } | ||
| 2526 | |||
| 2527 | static inline SIMD_CFUNC simd_char16 simd_max(simd_char16 x, simd_char16 y) { | ||
| 2528 | #if defined __arm__ || defined __arm64__ | ||
| 2529 | return vmaxq_s8(x, y); | ||
| 2530 | #elif defined __SSE4_1__ | ||
| 2531 | return (simd_char16) _mm_max_epi8((__m128i)x, (__m128i)y); | ||
| 2532 | #else | ||
| 2533 | return simd_bitselect(x, y, x < y); | ||
| 2534 | #endif | ||
| 2535 | } | ||
| 2536 | |||
| 2537 | static inline SIMD_CFUNC simd_char32 simd_max(simd_char32 x, simd_char32 y) { | ||
| 2538 | #if defined __AVX2__ | ||
| 2539 | return _mm256_max_epi8(x, y); | ||
| 2540 | #else | ||
| 2541 | return simd_bitselect(x, y, x < y); | ||
| 2542 | #endif | ||
| 2543 | } | ||
| 2544 | |||
| 2545 | static inline SIMD_CFUNC simd_char64 simd_max(simd_char64 x, simd_char64 y) { | ||
| 2546 | #if defined __AVX512BW__ | ||
| 2547 | return _mm512_max_epi8(x, y); | ||
| 2548 | #else | ||
| 2549 | return simd_bitselect(x, y, x < y); | ||
| 2550 | #endif | ||
| 2551 | } | ||
| 2552 | |||
| 2553 | static inline SIMD_CFUNC simd_uchar2 simd_max(simd_uchar2 x, simd_uchar2 y) { | ||
| 2554 | return simd_make_uchar2(simd_max(simd_make_uchar8_undef(x), simd_make_uchar8_undef(y))); | ||
| 2555 | } | ||
| 2556 | |||
| 2557 | static inline SIMD_CFUNC simd_uchar3 simd_max(simd_uchar3 x, simd_uchar3 y) { | ||
| 2558 | return simd_make_uchar3(simd_max(simd_make_uchar8_undef(x), simd_make_uchar8_undef(y))); | ||
| 2559 | } | ||
| 2560 | |||
| 2561 | static inline SIMD_CFUNC simd_uchar4 simd_max(simd_uchar4 x, simd_uchar4 y) { | ||
| 2562 | return simd_make_uchar4(simd_max(simd_make_uchar8_undef(x), simd_make_uchar8_undef(y))); | ||
| 2563 | } | ||
| 2564 | |||
| 2565 | static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y) { | ||
| 2566 | #if defined __arm__ || defined __arm64__ | ||
| 2567 | return vmax_u8(x, y); | ||
| 2568 | #else | ||
| 2569 | return simd_make_uchar8(simd_max(simd_make_uchar16_undef(x), simd_make_uchar16_undef(y))); | ||
| 2570 | #endif | ||
| 2571 | |||
| 2572 | } | ||
| 2573 | |||
| 2574 | static inline SIMD_CFUNC simd_uchar16 simd_max(simd_uchar16 x, simd_uchar16 y) { | ||
| 2575 | #if defined __arm__ || defined __arm64__ | ||
| 2576 | return vmaxq_u8(x, y); | ||
| 2577 | #elif defined __SSE4_1__ | ||
| 2578 | return (simd_uchar16) _mm_max_epu8((__m128i)x, (__m128i)y); | ||
| 2579 | #else | ||
| 2580 | return simd_bitselect(x, y, x < y); | ||
| 2581 | #endif | ||
| 2582 | } | ||
| 2583 | |||
| 2584 | static inline SIMD_CFUNC simd_uchar32 simd_max(simd_uchar32 x, simd_uchar32 y) { | ||
| 2585 | #if defined __AVX2__ | ||
| 2586 | return _mm256_max_epu8(x, y); | ||
| 2587 | #else | ||
| 2588 | return simd_bitselect(x, y, x < y); | ||
| 2589 | #endif | ||
| 2590 | } | ||
| 2591 | |||
| 2592 | static inline SIMD_CFUNC simd_uchar64 simd_max(simd_uchar64 x, simd_uchar64 y) { | ||
| 2593 | #if defined __AVX512BW__ | ||
| 2594 | return _mm512_max_epu8(x, y); | ||
| 2595 | #else | ||
| 2596 | return simd_bitselect(x, y, x < y); | ||
| 2597 | #endif | ||
| 2598 | } | ||
| 2599 | |||
| 2600 | static inline SIMD_CFUNC simd_short2 simd_max(simd_short2 x, simd_short2 y) { | ||
| 2601 | return simd_make_short2(simd_max(simd_make_short4_undef(x), simd_make_short4_undef(y))); | ||
| 2602 | } | ||
| 2603 | |||
| 2604 | static inline SIMD_CFUNC simd_short3 simd_max(simd_short3 x, simd_short3 y) { | ||
| 2605 | return simd_make_short3(simd_max(simd_make_short4_undef(x), simd_make_short4_undef(y))); | ||
| 2606 | } | ||
| 2607 | |||
| 2608 | static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y) { | ||
| 2609 | #if defined __arm__ || defined __arm64__ | ||
| 2610 | return vmax_s16(x, y); | ||
| 2611 | #else | ||
| 2612 | return simd_make_short4(simd_max(simd_make_short8_undef(x), simd_make_short8_undef(y))); | ||
| 2613 | #endif | ||
| 2614 | |||
| 2615 | } | ||
| 2616 | |||
| 2617 | static inline SIMD_CFUNC simd_short8 simd_max(simd_short8 x, simd_short8 y) { | ||
| 2618 | #if defined __arm__ || defined __arm64__ | ||
| 2619 | return vmaxq_s16(x, y); | ||
| 2620 | #elif defined __SSE4_1__ | ||
| 2621 | return (simd_short8) _mm_max_epi16((__m128i)x, (__m128i)y); | ||
| 2622 | #else | ||
| 2623 | return simd_bitselect(x, y, x < y); | ||
| 2624 | #endif | ||
| 2625 | } | ||
| 2626 | |||
| 2627 | static inline SIMD_CFUNC simd_short16 simd_max(simd_short16 x, simd_short16 y) { | ||
| 2628 | #if defined __AVX2__ | ||
| 2629 | return _mm256_max_epi16(x, y); | ||
| 2630 | #else | ||
| 2631 | return simd_bitselect(x, y, x < y); | ||
| 2632 | #endif | ||
| 2633 | } | ||
| 2634 | |||
| 2635 | static inline SIMD_CFUNC simd_short32 simd_max(simd_short32 x, simd_short32 y) { | ||
| 2636 | #if defined __AVX512BW__ | ||
| 2637 | return _mm512_max_epi16(x, y); | ||
| 2638 | #else | ||
| 2639 | return simd_bitselect(x, y, x < y); | ||
| 2640 | #endif | ||
| 2641 | } | ||
| 2642 | |||
| 2643 | static inline SIMD_CFUNC simd_ushort2 simd_max(simd_ushort2 x, simd_ushort2 y) { | ||
| 2644 | return simd_make_ushort2(simd_max(simd_make_ushort4_undef(x), simd_make_ushort4_undef(y))); | ||
| 2645 | } | ||
| 2646 | |||
| 2647 | static inline SIMD_CFUNC simd_ushort3 simd_max(simd_ushort3 x, simd_ushort3 y) { | ||
| 2648 | return simd_make_ushort3(simd_max(simd_make_ushort4_undef(x), simd_make_ushort4_undef(y))); | ||
| 2649 | } | ||
| 2650 | |||
| 2651 | static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y) { | ||
| 2652 | #if defined __arm__ || defined __arm64__ | ||
| 2653 | return vmax_u16(x, y); | ||
| 2654 | #else | ||
| 2655 | return simd_make_ushort4(simd_max(simd_make_ushort8_undef(x), simd_make_ushort8_undef(y))); | ||
| 2656 | #endif | ||
| 2657 | |||
| 2658 | } | ||
| 2659 | |||
| 2660 | static inline SIMD_CFUNC simd_ushort8 simd_max(simd_ushort8 x, simd_ushort8 y) { | ||
| 2661 | #if defined __arm__ || defined __arm64__ | ||
| 2662 | return vmaxq_u16(x, y); | ||
| 2663 | #elif defined __SSE4_1__ | ||
| 2664 | return (simd_ushort8) _mm_max_epu16((__m128i)x, (__m128i)y); | ||
| 2665 | #else | ||
| 2666 | return simd_bitselect(x, y, x < y); | ||
| 2667 | #endif | ||
| 2668 | } | ||
| 2669 | |||
| 2670 | static inline SIMD_CFUNC simd_ushort16 simd_max(simd_ushort16 x, simd_ushort16 y) { | ||
| 2671 | #if defined __AVX2__ | ||
| 2672 | return _mm256_max_epu16(x, y); | ||
| 2673 | #else | ||
| 2674 | return simd_bitselect(x, y, x < y); | ||
| 2675 | #endif | ||
| 2676 | } | ||
| 2677 | |||
| 2678 | static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y) { | ||
| 2679 | #if defined __AVX512BW__ | ||
| 2680 | return _mm512_max_epu16(x, y); | ||
| 2681 | #else | ||
| 2682 | return simd_bitselect(x, y, x < y); | ||
| 2683 | #endif | ||
| 2684 | } | ||
| 2685 | |||
| 2686 | static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y) { | ||
| 2687 | #if defined __arm__ || defined __arm64__ | ||
| 2688 | return vmax_s32(x, y); | ||
| 2689 | #else | ||
| 2690 | return simd_make_int2(simd_max(simd_make_int4_undef(x), simd_make_int4_undef(y))); | ||
| 2691 | #endif | ||
| 2692 | |||
| 2693 | } | ||
| 2694 | |||
| 2695 | static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y) { | ||
| 2696 | return simd_make_int3(simd_max(simd_make_int4_undef(x), simd_make_int4_undef(y))); | ||
| 2697 | } | ||
| 2698 | |||
| 2699 | static inline SIMD_CFUNC simd_int4 simd_max(simd_int4 x, simd_int4 y) { | ||
| 2700 | #if defined __arm__ || defined __arm64__ | ||
| 2701 | return vmaxq_s32(x, y); | ||
| 2702 | #elif defined __SSE4_1__ | ||
| 2703 | return (simd_int4) _mm_max_epi32((__m128i)x, (__m128i)y); | ||
| 2704 | #else | ||
| 2705 | return simd_bitselect(x, y, x < y); | ||
| 2706 | #endif | ||
| 2707 | } | ||
| 2708 | |||
| 2709 | static inline SIMD_CFUNC simd_int8 simd_max(simd_int8 x, simd_int8 y) { | ||
| 2710 | #if defined __AVX2__ | ||
| 2711 | return _mm256_max_epi32(x, y); | ||
| 2712 | #else | ||
| 2713 | return simd_bitselect(x, y, x < y); | ||
| 2714 | #endif | ||
| 2715 | } | ||
| 2716 | |||
| 2717 | static inline SIMD_CFUNC simd_int16 simd_max(simd_int16 x, simd_int16 y) { | ||
| 2718 | #if defined __AVX512F__ | ||
| 2719 | return _mm512_max_epi32(x, y); | ||
| 2720 | #else | ||
| 2721 | return simd_bitselect(x, y, x < y); | ||
| 2722 | #endif | ||
| 2723 | } | ||
| 2724 | |||
| 2725 | static inline SIMD_CFUNC simd_uint2 simd_max(simd_uint2 x, simd_uint2 y) { | ||
| 2726 | #if defined __arm__ || defined __arm64__ | ||
| 2727 | return vmax_u32(x, y); | ||
| 2728 | #else | ||
| 2729 | return simd_make_uint2(simd_max(simd_make_uint4_undef(x), simd_make_uint4_undef(y))); | ||
| 2730 | #endif | ||
| 2731 | |||
| 2732 | } | ||
| 2733 | |||
| 2734 | static inline SIMD_CFUNC simd_uint3 simd_max(simd_uint3 x, simd_uint3 y) { | ||
| 2735 | return simd_make_uint3(simd_max(simd_make_uint4_undef(x), simd_make_uint4_undef(y))); | ||
| 2736 | } | ||
| 2737 | |||
| 2738 | static inline SIMD_CFUNC simd_uint4 simd_max(simd_uint4 x, simd_uint4 y) { | ||
| 2739 | #if defined __arm__ || defined __arm64__ | ||
| 2740 | return vmaxq_u32(x, y); | ||
| 2741 | #elif defined __SSE4_1__ | ||
| 2742 | return (simd_uint4) _mm_max_epu32((__m128i)x, (__m128i)y); | ||
| 2743 | #else | ||
| 2744 | return simd_bitselect(x, y, x < y); | ||
| 2745 | #endif | ||
| 2746 | } | ||
| 2747 | |||
| 2748 | static inline SIMD_CFUNC simd_uint8 simd_max(simd_uint8 x, simd_uint8 y) { | ||
| 2749 | #if defined __AVX2__ | ||
| 2750 | return _mm256_max_epu32(x, y); | ||
| 2751 | #else | ||
| 2752 | return simd_bitselect(x, y, x < y); | ||
| 2753 | #endif | ||
| 2754 | } | ||
| 2755 | |||
| 2756 | static inline SIMD_CFUNC simd_uint16 simd_max(simd_uint16 x, simd_uint16 y) { | ||
| 2757 | #if defined __AVX512F__ | ||
| 2758 | return _mm512_max_epu32(x, y); | ||
| 2759 | #else | ||
| 2760 | return simd_bitselect(x, y, x < y); | ||
| 2761 | #endif | ||
| 2762 | } | ||
| 2763 | |||
| 2764 | static inline SIMD_CFUNC float simd_max(float x, float y) { | ||
| 2765 | return __tg_fmax(x,y); | ||
| 2766 | } | ||
| 2767 | |||
| 2768 | static inline SIMD_CFUNC simd_float2 simd_max(simd_float2 x, simd_float2 y) { | ||
| 2769 | return __tg_fmax(x,y); | ||
| 2770 | } | ||
| 2771 | |||
| 2772 | static inline SIMD_CFUNC simd_float3 simd_max(simd_float3 x, simd_float3 y) { | ||
| 2773 | return __tg_fmax(x,y); | ||
| 2774 | } | ||
| 2775 | |||
| 2776 | static inline SIMD_CFUNC simd_float4 simd_max(simd_float4 x, simd_float4 y) { | ||
| 2777 | return __tg_fmax(x,y); | ||
| 2778 | } | ||
| 2779 | |||
| 2780 | static inline SIMD_CFUNC simd_float8 simd_max(simd_float8 x, simd_float8 y) { | ||
| 2781 | return __tg_fmax(x,y); | ||
| 2782 | } | ||
| 2783 | |||
| 2784 | static inline SIMD_CFUNC simd_float16 simd_max(simd_float16 x, simd_float16 y) { | ||
| 2785 | return __tg_fmax(x,y); | ||
| 2786 | } | ||
| 2787 | |||
| 2788 | static inline SIMD_CFUNC simd_long2 simd_max(simd_long2 x, simd_long2 y) { | ||
| 2789 | #if defined __AVX512VL__ | ||
| 2790 | return _mm_max_epi64(x, y); | ||
| 2791 | #else | ||
| 2792 | return simd_bitselect(x, y, x < y); | ||
| 2793 | #endif | ||
| 2794 | } | ||
| 2795 | |||
| 2796 | static inline SIMD_CFUNC simd_long3 simd_max(simd_long3 x, simd_long3 y) { | ||
| 2797 | return simd_make_long3(simd_max(simd_make_long4_undef(x), simd_make_long4_undef(y))); | ||
| 2798 | } | ||
| 2799 | |||
| 2800 | static inline SIMD_CFUNC simd_long4 simd_max(simd_long4 x, simd_long4 y) { | ||
| 2801 | #if defined __AVX512VL__ | ||
| 2802 | return _mm256_max_epi64(x, y); | ||
| 2803 | #else | ||
| 2804 | return simd_bitselect(x, y, x < y); | ||
| 2805 | #endif | ||
| 2806 | } | ||
| 2807 | |||
| 2808 | static inline SIMD_CFUNC simd_long8 simd_max(simd_long8 x, simd_long8 y) { | ||
| 2809 | #if defined __AVX512F__ | ||
| 2810 | return _mm512_max_epi64(x, y); | ||
| 2811 | #else | ||
| 2812 | return simd_bitselect(x, y, x < y); | ||
| 2813 | #endif | ||
| 2814 | } | ||
| 2815 | |||
| 2816 | static inline SIMD_CFUNC simd_ulong2 simd_max(simd_ulong2 x, simd_ulong2 y) { | ||
| 2817 | #if defined __AVX512VL__ | ||
| 2818 | return _mm_max_epu64(x, y); | ||
| 2819 | #else | ||
| 2820 | return simd_bitselect(x, y, x < y); | ||
| 2821 | #endif | ||
| 2822 | } | ||
| 2823 | |||
| 2824 | static inline SIMD_CFUNC simd_ulong3 simd_max(simd_ulong3 x, simd_ulong3 y) { | ||
| 2825 | return simd_make_ulong3(simd_max(simd_make_ulong4_undef(x), simd_make_ulong4_undef(y))); | ||
| 2826 | } | ||
| 2827 | |||
| 2828 | static inline SIMD_CFUNC simd_ulong4 simd_max(simd_ulong4 x, simd_ulong4 y) { | ||
| 2829 | #if defined __AVX512VL__ | ||
| 2830 | return _mm256_max_epu64(x, y); | ||
| 2831 | #else | ||
| 2832 | return simd_bitselect(x, y, x < y); | ||
| 2833 | #endif | ||
| 2834 | } | ||
| 2835 | |||
| 2836 | static inline SIMD_CFUNC simd_ulong8 simd_max(simd_ulong8 x, simd_ulong8 y) { | ||
| 2837 | #if defined __AVX512F__ | ||
| 2838 | return _mm512_max_epu64(x, y); | ||
| 2839 | #else | ||
| 2840 | return simd_bitselect(x, y, x < y); | ||
| 2841 | #endif | ||
| 2842 | } | ||
| 2843 | |||
| 2844 | static inline SIMD_CFUNC double simd_max(double x, double y) { | ||
| 2845 | return __tg_fmax(x,y); | ||
| 2846 | } | ||
| 2847 | |||
| 2848 | static inline SIMD_CFUNC simd_double2 simd_max(simd_double2 x, simd_double2 y) { | ||
| 2849 | return __tg_fmax(x,y); | ||
| 2850 | } | ||
| 2851 | |||
| 2852 | static inline SIMD_CFUNC simd_double3 simd_max(simd_double3 x, simd_double3 y) { | ||
| 2853 | return __tg_fmax(x,y); | ||
| 2854 | } | ||
| 2855 | |||
| 2856 | static inline SIMD_CFUNC simd_double4 simd_max(simd_double4 x, simd_double4 y) { | ||
| 2857 | return __tg_fmax(x,y); | ||
| 2858 | } | ||
| 2859 | |||
| 2860 | static inline SIMD_CFUNC simd_double8 simd_max(simd_double8 x, simd_double8 y) { | ||
| 2861 | return __tg_fmax(x,y); | ||
| 2862 | } | ||
| 2863 | |||
| 2864 | static inline SIMD_CFUNC simd_char2 simd_clamp(simd_char2 x, simd_char2 min, simd_char2 max) { | ||
| 2865 | return simd_min(simd_max(x, min), max); | ||
| 2866 | } | ||
| 2867 | |||
| 2868 | static inline SIMD_CFUNC simd_char3 simd_clamp(simd_char3 x, simd_char3 min, simd_char3 max) { | ||
| 2869 | return simd_min(simd_max(x, min), max); | ||
| 2870 | } | ||
| 2871 | |||
| 2872 | static inline SIMD_CFUNC simd_char4 simd_clamp(simd_char4 x, simd_char4 min, simd_char4 max) { | ||
| 2873 | return simd_min(simd_max(x, min), max); | ||
| 2874 | } | ||
| 2875 | |||
| 2876 | static inline SIMD_CFUNC simd_char8 simd_clamp(simd_char8 x, simd_char8 min, simd_char8 max) { | ||
| 2877 | return simd_min(simd_max(x, min), max); | ||
| 2878 | } | ||
| 2879 | |||
| 2880 | static inline SIMD_CFUNC simd_char16 simd_clamp(simd_char16 x, simd_char16 min, simd_char16 max) { | ||
| 2881 | return simd_min(simd_max(x, min), max); | ||
| 2882 | } | ||
| 2883 | |||
| 2884 | static inline SIMD_CFUNC simd_char32 simd_clamp(simd_char32 x, simd_char32 min, simd_char32 max) { | ||
| 2885 | return simd_min(simd_max(x, min), max); | ||
| 2886 | } | ||
| 2887 | |||
| 2888 | static inline SIMD_CFUNC simd_char64 simd_clamp(simd_char64 x, simd_char64 min, simd_char64 max) { | ||
| 2889 | return simd_min(simd_max(x, min), max); | ||
| 2890 | } | ||
| 2891 | |||
| 2892 | static inline SIMD_CFUNC simd_uchar2 simd_clamp(simd_uchar2 x, simd_uchar2 min, simd_uchar2 max) { | ||
| 2893 | return simd_min(simd_max(x, min), max); | ||
| 2894 | } | ||
| 2895 | |||
| 2896 | static inline SIMD_CFUNC simd_uchar3 simd_clamp(simd_uchar3 x, simd_uchar3 min, simd_uchar3 max) { | ||
| 2897 | return simd_min(simd_max(x, min), max); | ||
| 2898 | } | ||
| 2899 | |||
| 2900 | static inline SIMD_CFUNC simd_uchar4 simd_clamp(simd_uchar4 x, simd_uchar4 min, simd_uchar4 max) { | ||
| 2901 | return simd_min(simd_max(x, min), max); | ||
| 2902 | } | ||
| 2903 | |||
| 2904 | static inline SIMD_CFUNC simd_uchar8 simd_clamp(simd_uchar8 x, simd_uchar8 min, simd_uchar8 max) { | ||
| 2905 | return simd_min(simd_max(x, min), max); | ||
| 2906 | } | ||
| 2907 | |||
| 2908 | static inline SIMD_CFUNC simd_uchar16 simd_clamp(simd_uchar16 x, simd_uchar16 min, simd_uchar16 max) { | ||
| 2909 | return simd_min(simd_max(x, min), max); | ||
| 2910 | } | ||
| 2911 | |||
| 2912 | static inline SIMD_CFUNC simd_uchar32 simd_clamp(simd_uchar32 x, simd_uchar32 min, simd_uchar32 max) { | ||
| 2913 | return simd_min(simd_max(x, min), max); | ||
| 2914 | } | ||
| 2915 | |||
| 2916 | static inline SIMD_CFUNC simd_uchar64 simd_clamp(simd_uchar64 x, simd_uchar64 min, simd_uchar64 max) { | ||
| 2917 | return simd_min(simd_max(x, min), max); | ||
| 2918 | } | ||
| 2919 | |||
| 2920 | static inline SIMD_CFUNC simd_short2 simd_clamp(simd_short2 x, simd_short2 min, simd_short2 max) { | ||
| 2921 | return simd_min(simd_max(x, min), max); | ||
| 2922 | } | ||
| 2923 | |||
| 2924 | static inline SIMD_CFUNC simd_short3 simd_clamp(simd_short3 x, simd_short3 min, simd_short3 max) { | ||
| 2925 | return simd_min(simd_max(x, min), max); | ||
| 2926 | } | ||
| 2927 | |||
| 2928 | static inline SIMD_CFUNC simd_short4 simd_clamp(simd_short4 x, simd_short4 min, simd_short4 max) { | ||
| 2929 | return simd_min(simd_max(x, min), max); | ||
| 2930 | } | ||
| 2931 | |||
| 2932 | static inline SIMD_CFUNC simd_short8 simd_clamp(simd_short8 x, simd_short8 min, simd_short8 max) { | ||
| 2933 | return simd_min(simd_max(x, min), max); | ||
| 2934 | } | ||
| 2935 | |||
| 2936 | static inline SIMD_CFUNC simd_short16 simd_clamp(simd_short16 x, simd_short16 min, simd_short16 max) { | ||
| 2937 | return simd_min(simd_max(x, min), max); | ||
| 2938 | } | ||
| 2939 | |||
| 2940 | static inline SIMD_CFUNC simd_short32 simd_clamp(simd_short32 x, simd_short32 min, simd_short32 max) { | ||
| 2941 | return simd_min(simd_max(x, min), max); | ||
| 2942 | } | ||
| 2943 | |||
| 2944 | static inline SIMD_CFUNC simd_ushort2 simd_clamp(simd_ushort2 x, simd_ushort2 min, simd_ushort2 max) { | ||
| 2945 | return simd_min(simd_max(x, min), max); | ||
| 2946 | } | ||
| 2947 | |||
| 2948 | static inline SIMD_CFUNC simd_ushort3 simd_clamp(simd_ushort3 x, simd_ushort3 min, simd_ushort3 max) { | ||
| 2949 | return simd_min(simd_max(x, min), max); | ||
| 2950 | } | ||
| 2951 | |||
| 2952 | static inline SIMD_CFUNC simd_ushort4 simd_clamp(simd_ushort4 x, simd_ushort4 min, simd_ushort4 max) { | ||
| 2953 | return simd_min(simd_max(x, min), max); | ||
| 2954 | } | ||
| 2955 | |||
| 2956 | static inline SIMD_CFUNC simd_ushort8 simd_clamp(simd_ushort8 x, simd_ushort8 min, simd_ushort8 max) { | ||
| 2957 | return simd_min(simd_max(x, min), max); | ||
| 2958 | } | ||
| 2959 | |||
| 2960 | static inline SIMD_CFUNC simd_ushort16 simd_clamp(simd_ushort16 x, simd_ushort16 min, simd_ushort16 max) { | ||
| 2961 | return simd_min(simd_max(x, min), max); | ||
| 2962 | } | ||
| 2963 | |||
| 2964 | static inline SIMD_CFUNC simd_ushort32 simd_clamp(simd_ushort32 x, simd_ushort32 min, simd_ushort32 max) { | ||
| 2965 | return simd_min(simd_max(x, min), max); | ||
| 2966 | } | ||
| 2967 | |||
| 2968 | static inline SIMD_CFUNC simd_int2 simd_clamp(simd_int2 x, simd_int2 min, simd_int2 max) { | ||
| 2969 | return simd_min(simd_max(x, min), max); | ||
| 2970 | } | ||
| 2971 | |||
| 2972 | static inline SIMD_CFUNC simd_int3 simd_clamp(simd_int3 x, simd_int3 min, simd_int3 max) { | ||
| 2973 | return simd_min(simd_max(x, min), max); | ||
| 2974 | } | ||
| 2975 | |||
| 2976 | static inline SIMD_CFUNC simd_int4 simd_clamp(simd_int4 x, simd_int4 min, simd_int4 max) { | ||
| 2977 | return simd_min(simd_max(x, min), max); | ||
| 2978 | } | ||
| 2979 | |||
| 2980 | static inline SIMD_CFUNC simd_int8 simd_clamp(simd_int8 x, simd_int8 min, simd_int8 max) { | ||
| 2981 | return simd_min(simd_max(x, min), max); | ||
| 2982 | } | ||
| 2983 | |||
| 2984 | static inline SIMD_CFUNC simd_int16 simd_clamp(simd_int16 x, simd_int16 min, simd_int16 max) { | ||
| 2985 | return simd_min(simd_max(x, min), max); | ||
| 2986 | } | ||
| 2987 | |||
| 2988 | static inline SIMD_CFUNC simd_uint2 simd_clamp(simd_uint2 x, simd_uint2 min, simd_uint2 max) { | ||
| 2989 | return simd_min(simd_max(x, min), max); | ||
| 2990 | } | ||
| 2991 | |||
| 2992 | static inline SIMD_CFUNC simd_uint3 simd_clamp(simd_uint3 x, simd_uint3 min, simd_uint3 max) { | ||
| 2993 | return simd_min(simd_max(x, min), max); | ||
| 2994 | } | ||
| 2995 | |||
| 2996 | static inline SIMD_CFUNC simd_uint4 simd_clamp(simd_uint4 x, simd_uint4 min, simd_uint4 max) { | ||
| 2997 | return simd_min(simd_max(x, min), max); | ||
| 2998 | } | ||
| 2999 | |||
| 3000 | static inline SIMD_CFUNC simd_uint8 simd_clamp(simd_uint8 x, simd_uint8 min, simd_uint8 max) { | ||
| 3001 | return simd_min(simd_max(x, min), max); | ||
| 3002 | } | ||
| 3003 | |||
| 3004 | static inline SIMD_CFUNC simd_uint16 simd_clamp(simd_uint16 x, simd_uint16 min, simd_uint16 max) { | ||
| 3005 | return simd_min(simd_max(x, min), max); | ||
| 3006 | } | ||
| 3007 | |||
| 3008 | static inline SIMD_CFUNC float simd_clamp(float x, float min, float max) { | ||
| 3009 | return simd_min(simd_max(x, min), max); | ||
| 3010 | } | ||
| 3011 | |||
| 3012 | static inline SIMD_CFUNC simd_float2 simd_clamp(simd_float2 x, simd_float2 min, simd_float2 max) { | ||
| 3013 | return simd_min(simd_max(x, min), max); | ||
| 3014 | } | ||
| 3015 | |||
| 3016 | static inline SIMD_CFUNC simd_float3 simd_clamp(simd_float3 x, simd_float3 min, simd_float3 max) { | ||
| 3017 | return simd_min(simd_max(x, min), max); | ||
| 3018 | } | ||
| 3019 | |||
| 3020 | static inline SIMD_CFUNC simd_float4 simd_clamp(simd_float4 x, simd_float4 min, simd_float4 max) { | ||
| 3021 | return simd_min(simd_max(x, min), max); | ||
| 3022 | } | ||
| 3023 | |||
| 3024 | static inline SIMD_CFUNC simd_float8 simd_clamp(simd_float8 x, simd_float8 min, simd_float8 max) { | ||
| 3025 | return simd_min(simd_max(x, min), max); | ||
| 3026 | } | ||
| 3027 | |||
| 3028 | static inline SIMD_CFUNC simd_float16 simd_clamp(simd_float16 x, simd_float16 min, simd_float16 max) { | ||
| 3029 | return simd_min(simd_max(x, min), max); | ||
| 3030 | } | ||
| 3031 | |||
| 3032 | static inline SIMD_CFUNC simd_long2 simd_clamp(simd_long2 x, simd_long2 min, simd_long2 max) { | ||
| 3033 | return simd_min(simd_max(x, min), max); | ||
| 3034 | } | ||
| 3035 | |||
| 3036 | static inline SIMD_CFUNC simd_long3 simd_clamp(simd_long3 x, simd_long3 min, simd_long3 max) { | ||
| 3037 | return simd_min(simd_max(x, min), max); | ||
| 3038 | } | ||
| 3039 | |||
| 3040 | static inline SIMD_CFUNC simd_long4 simd_clamp(simd_long4 x, simd_long4 min, simd_long4 max) { | ||
| 3041 | return simd_min(simd_max(x, min), max); | ||
| 3042 | } | ||
| 3043 | |||
| 3044 | static inline SIMD_CFUNC simd_long8 simd_clamp(simd_long8 x, simd_long8 min, simd_long8 max) { | ||
| 3045 | return simd_min(simd_max(x, min), max); | ||
| 3046 | } | ||
| 3047 | |||
| 3048 | static inline SIMD_CFUNC simd_ulong2 simd_clamp(simd_ulong2 x, simd_ulong2 min, simd_ulong2 max) { | ||
| 3049 | return simd_min(simd_max(x, min), max); | ||
| 3050 | } | ||
| 3051 | |||
| 3052 | static inline SIMD_CFUNC simd_ulong3 simd_clamp(simd_ulong3 x, simd_ulong3 min, simd_ulong3 max) { | ||
| 3053 | return simd_min(simd_max(x, min), max); | ||
| 3054 | } | ||
| 3055 | |||
| 3056 | static inline SIMD_CFUNC simd_ulong4 simd_clamp(simd_ulong4 x, simd_ulong4 min, simd_ulong4 max) { | ||
| 3057 | return simd_min(simd_max(x, min), max); | ||
| 3058 | } | ||
| 3059 | |||
| 3060 | static inline SIMD_CFUNC simd_ulong8 simd_clamp(simd_ulong8 x, simd_ulong8 min, simd_ulong8 max) { | ||
| 3061 | return simd_min(simd_max(x, min), max); | ||
| 3062 | } | ||
| 3063 | |||
| 3064 | static inline SIMD_CFUNC double simd_clamp(double x, double min, double max) { | ||
| 3065 | return simd_min(simd_max(x, min), max); | ||
| 3066 | } | ||
| 3067 | |||
| 3068 | static inline SIMD_CFUNC simd_double2 simd_clamp(simd_double2 x, simd_double2 min, simd_double2 max) { | ||
| 3069 | return simd_min(simd_max(x, min), max); | ||
| 3070 | } | ||
| 3071 | |||
| 3072 | static inline SIMD_CFUNC simd_double3 simd_clamp(simd_double3 x, simd_double3 min, simd_double3 max) { | ||
| 3073 | return simd_min(simd_max(x, min), max); | ||
| 3074 | } | ||
| 3075 | |||
| 3076 | static inline SIMD_CFUNC simd_double4 simd_clamp(simd_double4 x, simd_double4 min, simd_double4 max) { | ||
| 3077 | return simd_min(simd_max(x, min), max); | ||
| 3078 | } | ||
| 3079 | |||
| 3080 | static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 min, simd_double8 max) { | ||
| 3081 | return simd_min(simd_max(x, min), max); | ||
| 3082 | } | ||
| 3083 | |||
| 3084 | |||
| 3085 | static inline SIMD_CFUNC float simd_sign(float x) { | ||
| 3086 | return (x == 0 | x != x) ? 0 : copysign(1,x); | ||
| 3087 | } | ||
| 3088 | |||
| 3089 | static inline SIMD_CFUNC simd_float2 simd_sign(simd_float2 x) { | ||
| 3090 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3091 | } | ||
| 3092 | |||
| 3093 | static inline SIMD_CFUNC simd_float3 simd_sign(simd_float3 x) { | ||
| 3094 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3095 | } | ||
| 3096 | |||
| 3097 | static inline SIMD_CFUNC simd_float4 simd_sign(simd_float4 x) { | ||
| 3098 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3099 | } | ||
| 3100 | |||
| 3101 | static inline SIMD_CFUNC simd_float8 simd_sign(simd_float8 x) { | ||
| 3102 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3103 | } | ||
| 3104 | |||
| 3105 | static inline SIMD_CFUNC simd_float16 simd_sign(simd_float16 x) { | ||
| 3106 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3107 | } | ||
| 3108 | |||
| 3109 | static inline SIMD_CFUNC double simd_sign(double x) { | ||
| 3110 | return (x == 0 | x != x) ? 0 : copysign(1,x); | ||
| 3111 | } | ||
| 3112 | |||
| 3113 | static inline SIMD_CFUNC simd_double2 simd_sign(simd_double2 x) { | ||
| 3114 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3115 | } | ||
| 3116 | |||
| 3117 | static inline SIMD_CFUNC simd_double3 simd_sign(simd_double3 x) { | ||
| 3118 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3119 | } | ||
| 3120 | |||
| 3121 | static inline SIMD_CFUNC simd_double4 simd_sign(simd_double4 x) { | ||
| 3122 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3123 | } | ||
| 3124 | |||
| 3125 | static inline SIMD_CFUNC simd_double8 simd_sign(simd_double8 x) { | ||
| 3126 | return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x); | ||
| 3127 | } | ||
| 3128 | |||
| 3129 | static inline SIMD_CFUNC float simd_mix(float x, float y, float t) { | ||
| 3130 | return x + t*(y - x); | ||
| 3131 | } | ||
| 3132 | |||
| 3133 | static inline SIMD_CFUNC simd_float2 simd_mix(simd_float2 x, simd_float2 y, simd_float2 t) { | ||
| 3134 | return x + t*(y - x); | ||
| 3135 | } | ||
| 3136 | |||
| 3137 | static inline SIMD_CFUNC simd_float3 simd_mix(simd_float3 x, simd_float3 y, simd_float3 t) { | ||
| 3138 | return x + t*(y - x); | ||
| 3139 | } | ||
| 3140 | |||
| 3141 | static inline SIMD_CFUNC simd_float4 simd_mix(simd_float4 x, simd_float4 y, simd_float4 t) { | ||
| 3142 | return x + t*(y - x); | ||
| 3143 | } | ||
| 3144 | |||
| 3145 | static inline SIMD_CFUNC simd_float8 simd_mix(simd_float8 x, simd_float8 y, simd_float8 t) { | ||
| 3146 | return x + t*(y - x); | ||
| 3147 | } | ||
| 3148 | |||
| 3149 | static inline SIMD_CFUNC simd_float16 simd_mix(simd_float16 x, simd_float16 y, simd_float16 t) { | ||
| 3150 | return x + t*(y - x); | ||
| 3151 | } | ||
| 3152 | |||
| 3153 | static inline SIMD_CFUNC double simd_mix(double x, double y, double t) { | ||
| 3154 | return x + t*(y - x); | ||
| 3155 | } | ||
| 3156 | |||
| 3157 | static inline SIMD_CFUNC simd_double2 simd_mix(simd_double2 x, simd_double2 y, simd_double2 t) { | ||
| 3158 | return x + t*(y - x); | ||
| 3159 | } | ||
| 3160 | |||
| 3161 | static inline SIMD_CFUNC simd_double3 simd_mix(simd_double3 x, simd_double3 y, simd_double3 t) { | ||
| 3162 | return x + t*(y - x); | ||
| 3163 | } | ||
| 3164 | |||
| 3165 | static inline SIMD_CFUNC simd_double4 simd_mix(simd_double4 x, simd_double4 y, simd_double4 t) { | ||
| 3166 | return x + t*(y - x); | ||
| 3167 | } | ||
| 3168 | |||
| 3169 | static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t) { | ||
| 3170 | return x + t*(y - x); | ||
| 3171 | } | ||
| 3172 | |||
| 3173 | static inline SIMD_CFUNC float simd_recip(float x) { | ||
| 3174 | #if __FAST_MATH__ | ||
| 3175 | return simd_fast_recip(x); | ||
| 3176 | #else | ||
| 3177 | return simd_precise_recip(x); | ||
| 3178 | #endif | ||
| 3179 | } | ||
| 3180 | |||
| 3181 | static inline SIMD_CFUNC simd_float2 simd_recip(simd_float2 x) { | ||
| 3182 | #if __FAST_MATH__ | ||
| 3183 | return simd_fast_recip(x); | ||
| 3184 | #else | ||
| 3185 | return simd_precise_recip(x); | ||
| 3186 | #endif | ||
| 3187 | } | ||
| 3188 | |||
| 3189 | static inline SIMD_CFUNC simd_float3 simd_recip(simd_float3 x) { | ||
| 3190 | #if __FAST_MATH__ | ||
| 3191 | return simd_fast_recip(x); | ||
| 3192 | #else | ||
| 3193 | return simd_precise_recip(x); | ||
| 3194 | #endif | ||
| 3195 | } | ||
| 3196 | |||
| 3197 | static inline SIMD_CFUNC simd_float4 simd_recip(simd_float4 x) { | ||
| 3198 | #if __FAST_MATH__ | ||
| 3199 | return simd_fast_recip(x); | ||
| 3200 | #else | ||
| 3201 | return simd_precise_recip(x); | ||
| 3202 | #endif | ||
| 3203 | } | ||
| 3204 | |||
| 3205 | static inline SIMD_CFUNC simd_float8 simd_recip(simd_float8 x) { | ||
| 3206 | #if __FAST_MATH__ | ||
| 3207 | return simd_fast_recip(x); | ||
| 3208 | #else | ||
| 3209 | return simd_precise_recip(x); | ||
| 3210 | #endif | ||
| 3211 | } | ||
| 3212 | |||
| 3213 | static inline SIMD_CFUNC simd_float16 simd_recip(simd_float16 x) { | ||
| 3214 | #if __FAST_MATH__ | ||
| 3215 | return simd_fast_recip(x); | ||
| 3216 | #else | ||
| 3217 | return simd_precise_recip(x); | ||
| 3218 | #endif | ||
| 3219 | } | ||
| 3220 | |||
| 3221 | static inline SIMD_CFUNC double simd_recip(double x) { | ||
| 3222 | #if __FAST_MATH__ | ||
| 3223 | return simd_fast_recip(x); | ||
| 3224 | #else | ||
| 3225 | return simd_precise_recip(x); | ||
| 3226 | #endif | ||
| 3227 | } | ||
| 3228 | |||
| 3229 | static inline SIMD_CFUNC simd_double2 simd_recip(simd_double2 x) { | ||
| 3230 | #if __FAST_MATH__ | ||
| 3231 | return simd_fast_recip(x); | ||
| 3232 | #else | ||
| 3233 | return simd_precise_recip(x); | ||
| 3234 | #endif | ||
| 3235 | } | ||
| 3236 | |||
| 3237 | static inline SIMD_CFUNC simd_double3 simd_recip(simd_double3 x) { | ||
| 3238 | #if __FAST_MATH__ | ||
| 3239 | return simd_fast_recip(x); | ||
| 3240 | #else | ||
| 3241 | return simd_precise_recip(x); | ||
| 3242 | #endif | ||
| 3243 | } | ||
| 3244 | |||
| 3245 | static inline SIMD_CFUNC simd_double4 simd_recip(simd_double4 x) { | ||
| 3246 | #if __FAST_MATH__ | ||
| 3247 | return simd_fast_recip(x); | ||
| 3248 | #else | ||
| 3249 | return simd_precise_recip(x); | ||
| 3250 | #endif | ||
| 3251 | } | ||
| 3252 | |||
| 3253 | static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x) { | ||
| 3254 | #if __FAST_MATH__ | ||
| 3255 | return simd_fast_recip(x); | ||
| 3256 | #else | ||
| 3257 | return simd_precise_recip(x); | ||
| 3258 | #endif | ||
| 3259 | } | ||
| 3260 | |||
| 3261 | static inline SIMD_CFUNC float simd_fast_recip(float x) { | ||
| 3262 | #if defined __AVX512VL__ | ||
| 3263 | simd_float4 x4 = simd_make_float4(x); | ||
| 3264 | return ((simd_float4)_mm_rcp14_ss(x4, x4)).x; | ||
| 3265 | #elif defined __SSE__ | ||
| 3266 | return ((simd_float4)_mm_rcp_ss(simd_make_float4(x))).x; | ||
| 3267 | #elif defined __ARM_NEON__ | ||
| 3268 | return simd_fast_recip(simd_make_float2_undef(x)).x; | ||
| 3269 | #else | ||
| 3270 | return simd_precise_recip(x); | ||
| 3271 | #endif | ||
| 3272 | } | ||
| 3273 | |||
| 3274 | static inline SIMD_CFUNC simd_float2 simd_fast_recip(simd_float2 x) { | ||
| 3275 | #if defined __SSE__ | ||
| 3276 | return simd_make_float2(simd_fast_recip(simd_make_float4_undef(x))); | ||
| 3277 | #elif defined __ARM_NEON__ | ||
| 3278 | simd_float2 r = vrecpe_f32(x); | ||
| 3279 | return r * vrecps_f32(x, r); | ||
| 3280 | #else | ||
| 3281 | return simd_precise_recip(x); | ||
| 3282 | #endif | ||
| 3283 | } | ||
| 3284 | |||
| 3285 | static inline SIMD_CFUNC simd_float3 simd_fast_recip(simd_float3 x) { | ||
| 3286 | return simd_make_float3(simd_fast_recip(simd_make_float4_undef(x))); | ||
| 3287 | } | ||
| 3288 | |||
| 3289 | static inline SIMD_CFUNC simd_float4 simd_fast_recip(simd_float4 x) { | ||
| 3290 | #if defined __AVX512VL__ | ||
| 3291 | return _mm_rcp14_ps(x); | ||
| 3292 | #elif defined __SSE__ | ||
| 3293 | return _mm_rcp_ps(x); | ||
| 3294 | #elif defined __ARM_NEON__ | ||
| 3295 | simd_float4 r = vrecpeq_f32(x); | ||
| 3296 | return r * vrecpsq_f32(x, r); | ||
| 3297 | #else | ||
| 3298 | return simd_precise_recip(x); | ||
| 3299 | #endif | ||
| 3300 | } | ||
| 3301 | |||
| 3302 | static inline SIMD_CFUNC simd_float8 simd_fast_recip(simd_float8 x) { | ||
| 3303 | #if defined __AVX512VL__ | ||
| 3304 | return _mm256_rcp14_ps(x); | ||
| 3305 | #elif defined __AVX__ | ||
| 3306 | return _mm256_rcp_ps(x); | ||
| 3307 | #else | ||
| 3308 | return simd_make_float8(simd_fast_recip(x.lo), simd_fast_recip(x.hi)); | ||
| 3309 | #endif | ||
| 3310 | } | ||
| 3311 | |||
| 3312 | static inline SIMD_CFUNC simd_float16 simd_fast_recip(simd_float16 x) { | ||
| 3313 | #if defined __AVX512F__ | ||
| 3314 | return _mm512_rcp14_ps(x); | ||
| 3315 | #else | ||
| 3316 | return simd_make_float16(simd_fast_recip(x.lo), simd_fast_recip(x.hi)); | ||
| 3317 | #endif | ||
| 3318 | } | ||
| 3319 | |||
| 3320 | static inline SIMD_CFUNC double simd_fast_recip(double x) { | ||
| 3321 | return simd_precise_recip(x); | ||
| 3322 | } | ||
| 3323 | |||
| 3324 | static inline SIMD_CFUNC simd_double2 simd_fast_recip(simd_double2 x) { | ||
| 3325 | return simd_precise_recip(x); | ||
| 3326 | } | ||
| 3327 | |||
| 3328 | static inline SIMD_CFUNC simd_double3 simd_fast_recip(simd_double3 x) { | ||
| 3329 | return simd_precise_recip(x); | ||
| 3330 | } | ||
| 3331 | |||
| 3332 | static inline SIMD_CFUNC simd_double4 simd_fast_recip(simd_double4 x) { | ||
| 3333 | return simd_precise_recip(x); | ||
| 3334 | } | ||
| 3335 | |||
| 3336 | static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x) { | ||
| 3337 | return simd_precise_recip(x); | ||
| 3338 | } | ||
| 3339 | |||
| 3340 | static inline SIMD_CFUNC float simd_precise_recip(float x) { | ||
| 3341 | #if defined __SSE__ | ||
| 3342 | float r = simd_fast_recip(x); | ||
| 3343 | return r*(2 - (x == 0 ? -INFINITY : x)*r); | ||
| 3344 | #elif defined __ARM_NEON__ | ||
| 3345 | return simd_precise_recip(simd_make_float2_undef(x)).x; | ||
| 3346 | #else | ||
| 3347 | return 1/x; | ||
| 3348 | #endif | ||
| 3349 | } | ||
| 3350 | |||
| 3351 | static inline SIMD_CFUNC simd_float2 simd_precise_recip(simd_float2 x) { | ||
| 3352 | #if defined __SSE__ | ||
| 3353 | return simd_make_float2(simd_precise_recip(simd_make_float4_undef(x))); | ||
| 3354 | #elif defined __ARM_NEON__ | ||
| 3355 | simd_float2 r = simd_fast_recip(x); | ||
| 3356 | return r*vrecps_f32(x, r); | ||
| 3357 | #else | ||
| 3358 | return 1/x; | ||
| 3359 | #endif | ||
| 3360 | } | ||
| 3361 | |||
| 3362 | static inline SIMD_CFUNC simd_float3 simd_precise_recip(simd_float3 x) { | ||
| 3363 | return simd_make_float3(simd_precise_recip(simd_make_float4_undef(x))); | ||
| 3364 | } | ||
| 3365 | |||
| 3366 | static inline SIMD_CFUNC simd_float4 simd_precise_recip(simd_float4 x) { | ||
| 3367 | #if defined __SSE__ | ||
| 3368 | simd_float4 r = simd_fast_recip(x); | ||
| 3369 | return r*(2 - simd_bitselect(x, -INFINITY, x == 0)*r); | ||
| 3370 | #elif defined __ARM_NEON__ | ||
| 3371 | simd_float4 r = simd_fast_recip(x); | ||
| 3372 | return r*vrecpsq_f32(x, r); | ||
| 3373 | #else | ||
| 3374 | return 1/x; | ||
| 3375 | #endif | ||
| 3376 | } | ||
| 3377 | |||
| 3378 | static inline SIMD_CFUNC simd_float8 simd_precise_recip(simd_float8 x) { | ||
| 3379 | #if defined __AVX__ | ||
| 3380 | simd_float8 r = simd_fast_recip(x); | ||
| 3381 | return r*(2 - simd_bitselect(x, -INFINITY, x == 0)*r); | ||
| 3382 | #else | ||
| 3383 | return simd_make_float8(simd_precise_recip(x.lo), simd_precise_recip(x.hi)); | ||
| 3384 | #endif | ||
| 3385 | } | ||
| 3386 | |||
| 3387 | static inline SIMD_CFUNC simd_float16 simd_precise_recip(simd_float16 x) { | ||
| 3388 | #if defined __AVX512F__ | ||
| 3389 | simd_float16 r = simd_fast_recip(x); | ||
| 3390 | return r*(2 - simd_bitselect(x, -INFINITY, x == 0)*r); | ||
| 3391 | #else | ||
| 3392 | return simd_make_float16(simd_precise_recip(x.lo), simd_precise_recip(x.hi)); | ||
| 3393 | #endif | ||
| 3394 | } | ||
| 3395 | |||
| 3396 | static inline SIMD_CFUNC double simd_precise_recip(double x) { | ||
| 3397 | return 1/x; | ||
| 3398 | } | ||
| 3399 | |||
| 3400 | static inline SIMD_CFUNC simd_double2 simd_precise_recip(simd_double2 x) { | ||
| 3401 | return 1/x; | ||
| 3402 | } | ||
| 3403 | |||
| 3404 | static inline SIMD_CFUNC simd_double3 simd_precise_recip(simd_double3 x) { | ||
| 3405 | return 1/x; | ||
| 3406 | } | ||
| 3407 | |||
| 3408 | static inline SIMD_CFUNC simd_double4 simd_precise_recip(simd_double4 x) { | ||
| 3409 | return 1/x; | ||
| 3410 | } | ||
| 3411 | |||
| 3412 | static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x) { | ||
| 3413 | return 1/x; | ||
| 3414 | } | ||
| 3415 | |||
| 3416 | static inline SIMD_CFUNC float simd_rsqrt(float x) { | ||
| 3417 | #if __FAST_MATH__ | ||
| 3418 | return simd_fast_rsqrt(x); | ||
| 3419 | #else | ||
| 3420 | return simd_precise_rsqrt(x); | ||
| 3421 | #endif | ||
| 3422 | } | ||
| 3423 | |||
| 3424 | static inline SIMD_CFUNC simd_float2 simd_rsqrt(simd_float2 x) { | ||
| 3425 | #if __FAST_MATH__ | ||
| 3426 | return simd_fast_rsqrt(x); | ||
| 3427 | #else | ||
| 3428 | return simd_precise_rsqrt(x); | ||
| 3429 | #endif | ||
| 3430 | } | ||
| 3431 | |||
| 3432 | static inline SIMD_CFUNC simd_float3 simd_rsqrt(simd_float3 x) { | ||
| 3433 | #if __FAST_MATH__ | ||
| 3434 | return simd_fast_rsqrt(x); | ||
| 3435 | #else | ||
| 3436 | return simd_precise_rsqrt(x); | ||
| 3437 | #endif | ||
| 3438 | } | ||
| 3439 | |||
| 3440 | static inline SIMD_CFUNC simd_float4 simd_rsqrt(simd_float4 x) { | ||
| 3441 | #if __FAST_MATH__ | ||
| 3442 | return simd_fast_rsqrt(x); | ||
| 3443 | #else | ||
| 3444 | return simd_precise_rsqrt(x); | ||
| 3445 | #endif | ||
| 3446 | } | ||
| 3447 | |||
| 3448 | static inline SIMD_CFUNC simd_float8 simd_rsqrt(simd_float8 x) { | ||
| 3449 | #if __FAST_MATH__ | ||
| 3450 | return simd_fast_rsqrt(x); | ||
| 3451 | #else | ||
| 3452 | return simd_precise_rsqrt(x); | ||
| 3453 | #endif | ||
| 3454 | } | ||
| 3455 | |||
| 3456 | static inline SIMD_CFUNC simd_float16 simd_rsqrt(simd_float16 x) { | ||
| 3457 | #if __FAST_MATH__ | ||
| 3458 | return simd_fast_rsqrt(x); | ||
| 3459 | #else | ||
| 3460 | return simd_precise_rsqrt(x); | ||
| 3461 | #endif | ||
| 3462 | } | ||
| 3463 | |||
| 3464 | static inline SIMD_CFUNC double simd_rsqrt(double x) { | ||
| 3465 | #if __FAST_MATH__ | ||
| 3466 | return simd_fast_rsqrt(x); | ||
| 3467 | #else | ||
| 3468 | return simd_precise_rsqrt(x); | ||
| 3469 | #endif | ||
| 3470 | } | ||
| 3471 | |||
| 3472 | static inline SIMD_CFUNC simd_double2 simd_rsqrt(simd_double2 x) { | ||
| 3473 | #if __FAST_MATH__ | ||
| 3474 | return simd_fast_rsqrt(x); | ||
| 3475 | #else | ||
| 3476 | return simd_precise_rsqrt(x); | ||
| 3477 | #endif | ||
| 3478 | } | ||
| 3479 | |||
| 3480 | static inline SIMD_CFUNC simd_double3 simd_rsqrt(simd_double3 x) { | ||
| 3481 | #if __FAST_MATH__ | ||
| 3482 | return simd_fast_rsqrt(x); | ||
| 3483 | #else | ||
| 3484 | return simd_precise_rsqrt(x); | ||
| 3485 | #endif | ||
| 3486 | } | ||
| 3487 | |||
| 3488 | static inline SIMD_CFUNC simd_double4 simd_rsqrt(simd_double4 x) { | ||
| 3489 | #if __FAST_MATH__ | ||
| 3490 | return simd_fast_rsqrt(x); | ||
| 3491 | #else | ||
| 3492 | return simd_precise_rsqrt(x); | ||
| 3493 | #endif | ||
| 3494 | } | ||
| 3495 | |||
| 3496 | static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x) { | ||
| 3497 | #if __FAST_MATH__ | ||
| 3498 | return simd_fast_rsqrt(x); | ||
| 3499 | #else | ||
| 3500 | return simd_precise_rsqrt(x); | ||
| 3501 | #endif | ||
| 3502 | } | ||
| 3503 | |||
| 3504 | static inline SIMD_CFUNC float simd_fast_rsqrt(float x) { | ||
| 3505 | #if defined __AVX512VL__ | ||
| 3506 | simd_float4 x4 = simd_make_float4(x); | ||
| 3507 | return ((simd_float4)_mm_rsqrt14_ss(x4, x4)).x; | ||
| 3508 | #elif defined __SSE__ | ||
| 3509 | return ((simd_float4)_mm_rsqrt_ss(simd_make_float4(x))).x; | ||
| 3510 | #elif defined __ARM_NEON__ | ||
| 3511 | return simd_fast_rsqrt(simd_make_float2_undef(x)).x; | ||
| 3512 | #else | ||
| 3513 | return simd_precise_rsqrt(x); | ||
| 3514 | #endif | ||
| 3515 | } | ||
| 3516 | |||
| 3517 | static inline SIMD_CFUNC simd_float2 simd_fast_rsqrt(simd_float2 x) { | ||
| 3518 | #if defined __SSE__ | ||
| 3519 | return simd_make_float2(simd_fast_rsqrt(simd_make_float4_undef(x))); | ||
| 3520 | #elif defined __ARM_NEON__ | ||
| 3521 | simd_float2 r = vrsqrte_f32(x); | ||
| 3522 | return r * vrsqrts_f32(x, r*r); | ||
| 3523 | #else | ||
| 3524 | return simd_precise_rsqrt(x); | ||
| 3525 | #endif | ||
| 3526 | } | ||
| 3527 | |||
| 3528 | static inline SIMD_CFUNC simd_float3 simd_fast_rsqrt(simd_float3 x) { | ||
| 3529 | return simd_make_float3(simd_fast_rsqrt(simd_make_float4_undef(x))); | ||
| 3530 | } | ||
| 3531 | |||
| 3532 | static inline SIMD_CFUNC simd_float4 simd_fast_rsqrt(simd_float4 x) { | ||
| 3533 | #if defined __AVX512VL__ | ||
| 3534 | return _mm_rsqrt14_ps(x); | ||
| 3535 | #elif defined __SSE__ | ||
| 3536 | return _mm_rsqrt_ps(x); | ||
| 3537 | #elif defined __ARM_NEON__ | ||
| 3538 | simd_float4 r = vrsqrteq_f32(x); | ||
| 3539 | return r * vrsqrtsq_f32(x, r*r); | ||
| 3540 | #else | ||
| 3541 | return simd_precise_rsqrt(x); | ||
| 3542 | #endif | ||
| 3543 | } | ||
| 3544 | |||
| 3545 | static inline SIMD_CFUNC simd_float8 simd_fast_rsqrt(simd_float8 x) { | ||
| 3546 | #if defined __AVX512VL__ | ||
| 3547 | return _mm256_rsqrt14_ps(x); | ||
| 3548 | #elif defined __AVX__ | ||
| 3549 | return _mm256_rsqrt_ps(x); | ||
| 3550 | #else | ||
| 3551 | return simd_make_float8(simd_fast_rsqrt(x.lo), simd_fast_rsqrt(x.hi)); | ||
| 3552 | #endif | ||
| 3553 | } | ||
| 3554 | |||
| 3555 | static inline SIMD_CFUNC simd_float16 simd_fast_rsqrt(simd_float16 x) { | ||
| 3556 | #if defined __AVX512F__ | ||
| 3557 | return _mm512_rsqrt14_ps(x); | ||
| 3558 | #else | ||
| 3559 | return simd_make_float16(simd_fast_rsqrt(x.lo), simd_fast_rsqrt(x.hi)); | ||
| 3560 | #endif | ||
| 3561 | } | ||
| 3562 | |||
| 3563 | static inline SIMD_CFUNC double simd_fast_rsqrt(double x) { | ||
| 3564 | return simd_precise_rsqrt(x); | ||
| 3565 | } | ||
| 3566 | |||
| 3567 | static inline SIMD_CFUNC simd_double2 simd_fast_rsqrt(simd_double2 x) { | ||
| 3568 | return simd_precise_rsqrt(x); | ||
| 3569 | } | ||
| 3570 | |||
| 3571 | static inline SIMD_CFUNC simd_double3 simd_fast_rsqrt(simd_double3 x) { | ||
| 3572 | return simd_precise_rsqrt(x); | ||
| 3573 | } | ||
| 3574 | |||
| 3575 | static inline SIMD_CFUNC simd_double4 simd_fast_rsqrt(simd_double4 x) { | ||
| 3576 | return simd_precise_rsqrt(x); | ||
| 3577 | } | ||
| 3578 | |||
| 3579 | static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x) { | ||
| 3580 | return simd_precise_rsqrt(x); | ||
| 3581 | } | ||
| 3582 | |||
| 3583 | static inline SIMD_CFUNC float simd_precise_rsqrt(float x) { | ||
| 3584 | #if defined __SSE__ | ||
| 3585 | float r = simd_fast_rsqrt(x); | ||
| 3586 | return r*(1.5f - 0.5f*(r == INFINITY ? -INFINITY : x)*r*r); | ||
| 3587 | #elif defined __ARM_NEON__ | ||
| 3588 | return simd_precise_rsqrt(simd_make_float2_undef(x)).x; | ||
| 3589 | #else | ||
| 3590 | return 1/sqrt(x); | ||
| 3591 | #endif | ||
| 3592 | } | ||
| 3593 | |||
| 3594 | static inline SIMD_CFUNC simd_float2 simd_precise_rsqrt(simd_float2 x) { | ||
| 3595 | #if defined __SSE__ | ||
| 3596 | return simd_make_float2(simd_precise_rsqrt(simd_make_float4_undef(x))); | ||
| 3597 | #elif defined __ARM_NEON__ | ||
| 3598 | simd_float2 r = simd_fast_rsqrt(x); | ||
| 3599 | return r*vrsqrts_f32(x, r*r); | ||
| 3600 | #else | ||
| 3601 | return 1/__tg_sqrt(x); | ||
| 3602 | #endif | ||
| 3603 | } | ||
| 3604 | |||
| 3605 | static inline SIMD_CFUNC simd_float3 simd_precise_rsqrt(simd_float3 x) { | ||
| 3606 | return simd_make_float3(simd_precise_rsqrt(simd_make_float4_undef(x))); | ||
| 3607 | } | ||
| 3608 | |||
| 3609 | static inline SIMD_CFUNC simd_float4 simd_precise_rsqrt(simd_float4 x) { | ||
| 3610 | #if defined __SSE__ | ||
| 3611 | simd_float4 r = simd_fast_rsqrt(x); | ||
| 3612 | return r*(1.5 - 0.5*simd_bitselect(x, -INFINITY, r == INFINITY)*r*r); | ||
| 3613 | #elif defined __ARM_NEON__ | ||
| 3614 | simd_float4 r = simd_fast_rsqrt(x); | ||
| 3615 | return r*vrsqrtsq_f32(x, r*r); | ||
| 3616 | #else | ||
| 3617 | return 1/__tg_sqrt(x); | ||
| 3618 | #endif | ||
| 3619 | } | ||
| 3620 | |||
| 3621 | static inline SIMD_CFUNC simd_float8 simd_precise_rsqrt(simd_float8 x) { | ||
| 3622 | #if defined __AVX__ | ||
| 3623 | simd_float8 r = simd_fast_rsqrt(x); | ||
| 3624 | return r*(1.5 - 0.5*simd_bitselect(x, -INFINITY, r == INFINITY)*r*r); | ||
| 3625 | #else | ||
| 3626 | return simd_make_float8(simd_precise_rsqrt(x.lo), simd_precise_rsqrt(x.hi)); | ||
| 3627 | #endif | ||
| 3628 | } | ||
| 3629 | |||
| 3630 | static inline SIMD_CFUNC simd_float16 simd_precise_rsqrt(simd_float16 x) { | ||
| 3631 | #if defined __AVX512F__ | ||
| 3632 | simd_float16 r = simd_fast_rsqrt(x); | ||
| 3633 | return r*(1.5 - 0.5*simd_bitselect(x, -INFINITY, r == INFINITY)*r*r); | ||
| 3634 | #else | ||
| 3635 | return simd_make_float16(simd_precise_rsqrt(x.lo), simd_precise_rsqrt(x.hi)); | ||
| 3636 | #endif | ||
| 3637 | } | ||
| 3638 | |||
| 3639 | static inline SIMD_CFUNC double simd_precise_rsqrt(double x) { | ||
| 3640 | return 1/sqrt(x); | ||
| 3641 | } | ||
| 3642 | |||
| 3643 | static inline SIMD_CFUNC simd_double2 simd_precise_rsqrt(simd_double2 x) { | ||
| 3644 | return 1/__tg_sqrt(x); | ||
| 3645 | } | ||
| 3646 | |||
| 3647 | static inline SIMD_CFUNC simd_double3 simd_precise_rsqrt(simd_double3 x) { | ||
| 3648 | return 1/__tg_sqrt(x); | ||
| 3649 | } | ||
| 3650 | |||
| 3651 | static inline SIMD_CFUNC simd_double4 simd_precise_rsqrt(simd_double4 x) { | ||
| 3652 | return 1/__tg_sqrt(x); | ||
| 3653 | } | ||
| 3654 | |||
| 3655 | static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x) { | ||
| 3656 | return 1/__tg_sqrt(x); | ||
| 3657 | } | ||
| 3658 | |||
| 3659 | static inline SIMD_CFUNC float simd_fract(float x) { | ||
| 3660 | return fmin(x - floor(x), 0x1.fffffep-1f); | ||
| 3661 | } | ||
| 3662 | |||
| 3663 | static inline SIMD_CFUNC simd_float2 simd_fract(simd_float2 x) { | ||
| 3664 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f); | ||
| 3665 | } | ||
| 3666 | |||
| 3667 | static inline SIMD_CFUNC simd_float3 simd_fract(simd_float3 x) { | ||
| 3668 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f); | ||
| 3669 | } | ||
| 3670 | |||
| 3671 | static inline SIMD_CFUNC simd_float4 simd_fract(simd_float4 x) { | ||
| 3672 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f); | ||
| 3673 | } | ||
| 3674 | |||
| 3675 | static inline SIMD_CFUNC simd_float8 simd_fract(simd_float8 x) { | ||
| 3676 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f); | ||
| 3677 | } | ||
| 3678 | |||
| 3679 | static inline SIMD_CFUNC simd_float16 simd_fract(simd_float16 x) { | ||
| 3680 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f); | ||
| 3681 | } | ||
| 3682 | |||
| 3683 | static inline SIMD_CFUNC double simd_fract(double x) { | ||
| 3684 | return fmin(x - floor(x), 0x1.fffffffffffffp-1); | ||
| 3685 | } | ||
| 3686 | |||
| 3687 | static inline SIMD_CFUNC simd_double2 simd_fract(simd_double2 x) { | ||
| 3688 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1); | ||
| 3689 | } | ||
| 3690 | |||
| 3691 | static inline SIMD_CFUNC simd_double3 simd_fract(simd_double3 x) { | ||
| 3692 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1); | ||
| 3693 | } | ||
| 3694 | |||
| 3695 | static inline SIMD_CFUNC simd_double4 simd_fract(simd_double4 x) { | ||
| 3696 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1); | ||
| 3697 | } | ||
| 3698 | |||
| 3699 | static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x) { | ||
| 3700 | return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1); | ||
| 3701 | } | ||
| 3702 | |||
| 3703 | static inline SIMD_CFUNC float simd_step(float edge, float x) { | ||
| 3704 | return !(x < edge); | ||
| 3705 | } | ||
| 3706 | |||
| 3707 | static inline SIMD_CFUNC simd_float2 simd_step(simd_float2 edge, simd_float2 x) { | ||
| 3708 | return simd_bitselect((simd_float2)1, 0, x < edge); | ||
| 3709 | } | ||
| 3710 | |||
| 3711 | static inline SIMD_CFUNC simd_float3 simd_step(simd_float3 edge, simd_float3 x) { | ||
| 3712 | return simd_bitselect((simd_float3)1, 0, x < edge); | ||
| 3713 | } | ||
| 3714 | |||
| 3715 | static inline SIMD_CFUNC simd_float4 simd_step(simd_float4 edge, simd_float4 x) { | ||
| 3716 | return simd_bitselect((simd_float4)1, 0, x < edge); | ||
| 3717 | } | ||
| 3718 | |||
| 3719 | static inline SIMD_CFUNC simd_float8 simd_step(simd_float8 edge, simd_float8 x) { | ||
| 3720 | return simd_bitselect((simd_float8)1, 0, x < edge); | ||
| 3721 | } | ||
| 3722 | |||
| 3723 | static inline SIMD_CFUNC simd_float16 simd_step(simd_float16 edge, simd_float16 x) { | ||
| 3724 | return simd_bitselect((simd_float16)1, 0, x < edge); | ||
| 3725 | } | ||
| 3726 | |||
| 3727 | static inline SIMD_CFUNC double simd_step(double edge, double x) { | ||
| 3728 | return !(x < edge); | ||
| 3729 | } | ||
| 3730 | |||
| 3731 | static inline SIMD_CFUNC simd_double2 simd_step(simd_double2 edge, simd_double2 x) { | ||
| 3732 | return simd_bitselect((simd_double2)1, 0, x < edge); | ||
| 3733 | } | ||
| 3734 | |||
| 3735 | static inline SIMD_CFUNC simd_double3 simd_step(simd_double3 edge, simd_double3 x) { | ||
| 3736 | return simd_bitselect((simd_double3)1, 0, x < edge); | ||
| 3737 | } | ||
| 3738 | |||
| 3739 | static inline SIMD_CFUNC simd_double4 simd_step(simd_double4 edge, simd_double4 x) { | ||
| 3740 | return simd_bitselect((simd_double4)1, 0, x < edge); | ||
| 3741 | } | ||
| 3742 | |||
| 3743 | static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8 x) { | ||
| 3744 | return simd_bitselect((simd_double8)1, 0, x < edge); | ||
| 3745 | } | ||
| 3746 | |||
| 3747 | static inline SIMD_CFUNC float simd_smoothstep(float edge0, float edge1, float x) { | ||
| 3748 | float t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3749 | return t*t*(3 - 2*t); | ||
| 3750 | } | ||
| 3751 | |||
| 3752 | static inline SIMD_CFUNC simd_float2 simd_smoothstep(simd_float2 edge0, simd_float2 edge1, simd_float2 x) { | ||
| 3753 | simd_float2 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3754 | return t*t*(3 - 2*t); | ||
| 3755 | } | ||
| 3756 | |||
| 3757 | static inline SIMD_CFUNC simd_float3 simd_smoothstep(simd_float3 edge0, simd_float3 edge1, simd_float3 x) { | ||
| 3758 | simd_float3 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3759 | return t*t*(3 - 2*t); | ||
| 3760 | } | ||
| 3761 | |||
| 3762 | static inline SIMD_CFUNC simd_float4 simd_smoothstep(simd_float4 edge0, simd_float4 edge1, simd_float4 x) { | ||
| 3763 | simd_float4 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3764 | return t*t*(3 - 2*t); | ||
| 3765 | } | ||
| 3766 | |||
| 3767 | static inline SIMD_CFUNC simd_float8 simd_smoothstep(simd_float8 edge0, simd_float8 edge1, simd_float8 x) { | ||
| 3768 | simd_float8 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3769 | return t*t*(3 - 2*t); | ||
| 3770 | } | ||
| 3771 | |||
| 3772 | static inline SIMD_CFUNC simd_float16 simd_smoothstep(simd_float16 edge0, simd_float16 edge1, simd_float16 x) { | ||
| 3773 | simd_float16 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3774 | return t*t*(3 - 2*t); | ||
| 3775 | } | ||
| 3776 | |||
| 3777 | static inline SIMD_CFUNC double simd_smoothstep(double edge0, double edge1, double x) { | ||
| 3778 | double t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3779 | return t*t*(3 - 2*t); | ||
| 3780 | } | ||
| 3781 | |||
| 3782 | static inline SIMD_CFUNC simd_double2 simd_smoothstep(simd_double2 edge0, simd_double2 edge1, simd_double2 x) { | ||
| 3783 | simd_double2 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3784 | return t*t*(3 - 2*t); | ||
| 3785 | } | ||
| 3786 | |||
| 3787 | static inline SIMD_CFUNC simd_double3 simd_smoothstep(simd_double3 edge0, simd_double3 edge1, simd_double3 x) { | ||
| 3788 | simd_double3 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3789 | return t*t*(3 - 2*t); | ||
| 3790 | } | ||
| 3791 | |||
| 3792 | static inline SIMD_CFUNC simd_double4 simd_smoothstep(simd_double4 edge0, simd_double4 edge1, simd_double4 x) { | ||
| 3793 | simd_double4 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3794 | return t*t*(3 - 2*t); | ||
| 3795 | } | ||
| 3796 | |||
| 3797 | static inline SIMD_CFUNC simd_double8 simd_smoothstep(simd_double8 edge0, simd_double8 edge1, simd_double8 x) { | ||
| 3798 | simd_double8 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1); | ||
| 3799 | return t*t*(3 - 2*t); | ||
| 3800 | } | ||
| 3801 | |||
| 3802 | static inline SIMD_CFUNC char simd_reduce_add(simd_char2 x) { | ||
| 3803 | return x.x + x.y; | ||
| 3804 | } | ||
| 3805 | |||
| 3806 | static inline SIMD_CFUNC char simd_reduce_add(simd_char3 x) { | ||
| 3807 | return x.x + x.y + x.z; | ||
| 3808 | } | ||
| 3809 | |||
| 3810 | static inline SIMD_CFUNC char simd_reduce_add(simd_char4 x) { | ||
| 3811 | return simd_reduce_add(x.lo + x.hi); | ||
| 3812 | } | ||
| 3813 | |||
| 3814 | static inline SIMD_CFUNC char simd_reduce_add(simd_char8 x) { | ||
| 3815 | return simd_reduce_add(x.lo + x.hi); | ||
| 3816 | } | ||
| 3817 | |||
| 3818 | static inline SIMD_CFUNC char simd_reduce_add(simd_char16 x) { | ||
| 3819 | return simd_reduce_add(x.lo + x.hi); | ||
| 3820 | } | ||
| 3821 | |||
| 3822 | static inline SIMD_CFUNC char simd_reduce_add(simd_char32 x) { | ||
| 3823 | return simd_reduce_add(x.lo + x.hi); | ||
| 3824 | } | ||
| 3825 | |||
| 3826 | static inline SIMD_CFUNC char simd_reduce_add(simd_char64 x) { | ||
| 3827 | return simd_reduce_add(x.lo + x.hi); | ||
| 3828 | } | ||
| 3829 | |||
| 3830 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar2 x) { | ||
| 3831 | return x.x + x.y; | ||
| 3832 | } | ||
| 3833 | |||
| 3834 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar3 x) { | ||
| 3835 | return x.x + x.y + x.z; | ||
| 3836 | } | ||
| 3837 | |||
| 3838 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar4 x) { | ||
| 3839 | return simd_reduce_add(x.lo + x.hi); | ||
| 3840 | } | ||
| 3841 | |||
| 3842 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar8 x) { | ||
| 3843 | return simd_reduce_add(x.lo + x.hi); | ||
| 3844 | } | ||
| 3845 | |||
| 3846 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar16 x) { | ||
| 3847 | return simd_reduce_add(x.lo + x.hi); | ||
| 3848 | } | ||
| 3849 | |||
| 3850 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar32 x) { | ||
| 3851 | return simd_reduce_add(x.lo + x.hi); | ||
| 3852 | } | ||
| 3853 | |||
| 3854 | static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar64 x) { | ||
| 3855 | return simd_reduce_add(x.lo + x.hi); | ||
| 3856 | } | ||
| 3857 | |||
| 3858 | static inline SIMD_CFUNC short simd_reduce_add(simd_short2 x) { | ||
| 3859 | return x.x + x.y; | ||
| 3860 | } | ||
| 3861 | |||
| 3862 | static inline SIMD_CFUNC short simd_reduce_add(simd_short3 x) { | ||
| 3863 | return x.x + x.y + x.z; | ||
| 3864 | } | ||
| 3865 | |||
| 3866 | static inline SIMD_CFUNC short simd_reduce_add(simd_short4 x) { | ||
| 3867 | return simd_reduce_add(x.lo + x.hi); | ||
| 3868 | } | ||
| 3869 | |||
| 3870 | static inline SIMD_CFUNC short simd_reduce_add(simd_short8 x) { | ||
| 3871 | return simd_reduce_add(x.lo + x.hi); | ||
| 3872 | } | ||
| 3873 | |||
| 3874 | static inline SIMD_CFUNC short simd_reduce_add(simd_short16 x) { | ||
| 3875 | return simd_reduce_add(x.lo + x.hi); | ||
| 3876 | } | ||
| 3877 | |||
| 3878 | static inline SIMD_CFUNC short simd_reduce_add(simd_short32 x) { | ||
| 3879 | return simd_reduce_add(x.lo + x.hi); | ||
| 3880 | } | ||
| 3881 | |||
| 3882 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort2 x) { | ||
| 3883 | return x.x + x.y; | ||
| 3884 | } | ||
| 3885 | |||
| 3886 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort3 x) { | ||
| 3887 | return x.x + x.y + x.z; | ||
| 3888 | } | ||
| 3889 | |||
| 3890 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort4 x) { | ||
| 3891 | return simd_reduce_add(x.lo + x.hi); | ||
| 3892 | } | ||
| 3893 | |||
| 3894 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort8 x) { | ||
| 3895 | return simd_reduce_add(x.lo + x.hi); | ||
| 3896 | } | ||
| 3897 | |||
| 3898 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort16 x) { | ||
| 3899 | return simd_reduce_add(x.lo + x.hi); | ||
| 3900 | } | ||
| 3901 | |||
| 3902 | static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x) { | ||
| 3903 | return simd_reduce_add(x.lo + x.hi); | ||
| 3904 | } | ||
| 3905 | |||
| 3906 | static inline SIMD_CFUNC int simd_reduce_add(simd_int2 x) { | ||
| 3907 | return x.x + x.y; | ||
| 3908 | } | ||
| 3909 | |||
| 3910 | static inline SIMD_CFUNC int simd_reduce_add(simd_int3 x) { | ||
| 3911 | return x.x + x.y + x.z; | ||
| 3912 | } | ||
| 3913 | |||
| 3914 | static inline SIMD_CFUNC int simd_reduce_add(simd_int4 x) { | ||
| 3915 | return simd_reduce_add(x.lo + x.hi); | ||
| 3916 | } | ||
| 3917 | |||
| 3918 | static inline SIMD_CFUNC int simd_reduce_add(simd_int8 x) { | ||
| 3919 | return simd_reduce_add(x.lo + x.hi); | ||
| 3920 | } | ||
| 3921 | |||
| 3922 | static inline SIMD_CFUNC int simd_reduce_add(simd_int16 x) { | ||
| 3923 | return simd_reduce_add(x.lo + x.hi); | ||
| 3924 | } | ||
| 3925 | |||
| 3926 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint2 x) { | ||
| 3927 | return x.x + x.y; | ||
| 3928 | } | ||
| 3929 | |||
| 3930 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint3 x) { | ||
| 3931 | return x.x + x.y + x.z; | ||
| 3932 | } | ||
| 3933 | |||
| 3934 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint4 x) { | ||
| 3935 | return simd_reduce_add(x.lo + x.hi); | ||
| 3936 | } | ||
| 3937 | |||
| 3938 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint8 x) { | ||
| 3939 | return simd_reduce_add(x.lo + x.hi); | ||
| 3940 | } | ||
| 3941 | |||
| 3942 | static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint16 x) { | ||
| 3943 | return simd_reduce_add(x.lo + x.hi); | ||
| 3944 | } | ||
| 3945 | |||
| 3946 | static inline SIMD_CFUNC float simd_reduce_add(simd_float2 x) { | ||
| 3947 | return x.x + x.y; | ||
| 3948 | } | ||
| 3949 | |||
| 3950 | static inline SIMD_CFUNC float simd_reduce_add(simd_float3 x) { | ||
| 3951 | return x.x + x.y + x.z; | ||
| 3952 | } | ||
| 3953 | |||
| 3954 | static inline SIMD_CFUNC float simd_reduce_add(simd_float4 x) { | ||
| 3955 | return simd_reduce_add(x.lo + x.hi); | ||
| 3956 | } | ||
| 3957 | |||
| 3958 | static inline SIMD_CFUNC float simd_reduce_add(simd_float8 x) { | ||
| 3959 | return simd_reduce_add(x.lo + x.hi); | ||
| 3960 | } | ||
| 3961 | |||
| 3962 | static inline SIMD_CFUNC float simd_reduce_add(simd_float16 x) { | ||
| 3963 | return simd_reduce_add(x.lo + x.hi); | ||
| 3964 | } | ||
| 3965 | |||
| 3966 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long2 x) { | ||
| 3967 | return x.x + x.y; | ||
| 3968 | } | ||
| 3969 | |||
| 3970 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long3 x) { | ||
| 3971 | return x.x + x.y + x.z; | ||
| 3972 | } | ||
| 3973 | |||
| 3974 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long4 x) { | ||
| 3975 | return simd_reduce_add(x.lo + x.hi); | ||
| 3976 | } | ||
| 3977 | |||
| 3978 | static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long8 x) { | ||
| 3979 | return simd_reduce_add(x.lo + x.hi); | ||
| 3980 | } | ||
| 3981 | |||
| 3982 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong2 x) { | ||
| 3983 | return x.x + x.y; | ||
| 3984 | } | ||
| 3985 | |||
| 3986 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong3 x) { | ||
| 3987 | return x.x + x.y + x.z; | ||
| 3988 | } | ||
| 3989 | |||
| 3990 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong4 x) { | ||
| 3991 | return simd_reduce_add(x.lo + x.hi); | ||
| 3992 | } | ||
| 3993 | |||
| 3994 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong8 x) { | ||
| 3995 | return simd_reduce_add(x.lo + x.hi); | ||
| 3996 | } | ||
| 3997 | |||
| 3998 | static inline SIMD_CFUNC double simd_reduce_add(simd_double2 x) { | ||
| 3999 | return x.x + x.y; | ||
| 4000 | } | ||
| 4001 | |||
| 4002 | static inline SIMD_CFUNC double simd_reduce_add(simd_double3 x) { | ||
| 4003 | return x.x + x.y + x.z; | ||
| 4004 | } | ||
| 4005 | |||
| 4006 | static inline SIMD_CFUNC double simd_reduce_add(simd_double4 x) { | ||
| 4007 | return simd_reduce_add(x.lo + x.hi); | ||
| 4008 | } | ||
| 4009 | |||
| 4010 | static inline SIMD_CFUNC double simd_reduce_add(simd_double8 x) { | ||
| 4011 | return simd_reduce_add(x.lo + x.hi); | ||
| 4012 | } | ||
| 4013 | |||
| 4014 | static inline SIMD_CFUNC char simd_reduce_min(simd_char2 x) { | ||
| 4015 | return x.y < x.x ? x.y : x.x; | ||
| 4016 | } | ||
| 4017 | |||
| 4018 | static inline SIMD_CFUNC char simd_reduce_min(simd_char3 x) { | ||
| 4019 | char t = x.z < x.x ? x.z : x.x; | ||
| 4020 | return x.y < t ? x.y : t; | ||
| 4021 | } | ||
| 4022 | |||
| 4023 | static inline SIMD_CFUNC char simd_reduce_min(simd_char4 x) { | ||
| 4024 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4025 | } | ||
| 4026 | |||
| 4027 | static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x) { | ||
| 4028 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4029 | } | ||
| 4030 | |||
| 4031 | static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x) { | ||
| 4032 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4033 | } | ||
| 4034 | |||
| 4035 | static inline SIMD_CFUNC char simd_reduce_min(simd_char32 x) { | ||
| 4036 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4037 | } | ||
| 4038 | |||
| 4039 | static inline SIMD_CFUNC char simd_reduce_min(simd_char64 x) { | ||
| 4040 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4041 | } | ||
| 4042 | |||
| 4043 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar2 x) { | ||
| 4044 | return x.y < x.x ? x.y : x.x; | ||
| 4045 | } | ||
| 4046 | |||
| 4047 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar3 x) { | ||
| 4048 | unsigned char t = x.z < x.x ? x.z : x.x; | ||
| 4049 | return x.y < t ? x.y : t; | ||
| 4050 | } | ||
| 4051 | |||
| 4052 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar4 x) { | ||
| 4053 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4054 | } | ||
| 4055 | |||
| 4056 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar8 x) { | ||
| 4057 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4058 | } | ||
| 4059 | |||
| 4060 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x) { | ||
| 4061 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4062 | } | ||
| 4063 | |||
| 4064 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar32 x) { | ||
| 4065 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4066 | } | ||
| 4067 | |||
| 4068 | static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar64 x) { | ||
| 4069 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4070 | } | ||
| 4071 | |||
| 4072 | static inline SIMD_CFUNC short simd_reduce_min(simd_short2 x) { | ||
| 4073 | return x.y < x.x ? x.y : x.x; | ||
| 4074 | } | ||
| 4075 | |||
| 4076 | static inline SIMD_CFUNC short simd_reduce_min(simd_short3 x) { | ||
| 4077 | short t = x.z < x.x ? x.z : x.x; | ||
| 4078 | return x.y < t ? x.y : t; | ||
| 4079 | } | ||
| 4080 | |||
| 4081 | static inline SIMD_CFUNC short simd_reduce_min(simd_short4 x) { | ||
| 4082 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4083 | } | ||
| 4084 | |||
| 4085 | static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x) { | ||
| 4086 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4087 | } | ||
| 4088 | |||
| 4089 | static inline SIMD_CFUNC short simd_reduce_min(simd_short16 x) { | ||
| 4090 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4091 | } | ||
| 4092 | |||
| 4093 | static inline SIMD_CFUNC short simd_reduce_min(simd_short32 x) { | ||
| 4094 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4095 | } | ||
| 4096 | |||
| 4097 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort2 x) { | ||
| 4098 | return x.y < x.x ? x.y : x.x; | ||
| 4099 | } | ||
| 4100 | |||
| 4101 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort3 x) { | ||
| 4102 | unsigned short t = x.z < x.x ? x.z : x.x; | ||
| 4103 | return x.y < t ? x.y : t; | ||
| 4104 | } | ||
| 4105 | |||
| 4106 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort4 x) { | ||
| 4107 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4108 | } | ||
| 4109 | |||
| 4110 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x) { | ||
| 4111 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4112 | } | ||
| 4113 | |||
| 4114 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort16 x) { | ||
| 4115 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4116 | } | ||
| 4117 | |||
| 4118 | static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x) { | ||
| 4119 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4120 | } | ||
| 4121 | |||
| 4122 | static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x) { | ||
| 4123 | return x.y < x.x ? x.y : x.x; | ||
| 4124 | } | ||
| 4125 | |||
| 4126 | static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x) { | ||
| 4127 | int t = x.z < x.x ? x.z : x.x; | ||
| 4128 | return x.y < t ? x.y : t; | ||
| 4129 | } | ||
| 4130 | |||
| 4131 | static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x) { | ||
| 4132 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4133 | } | ||
| 4134 | |||
| 4135 | static inline SIMD_CFUNC int simd_reduce_min(simd_int8 x) { | ||
| 4136 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4137 | } | ||
| 4138 | |||
| 4139 | static inline SIMD_CFUNC int simd_reduce_min(simd_int16 x) { | ||
| 4140 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4141 | } | ||
| 4142 | |||
| 4143 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint2 x) { | ||
| 4144 | return x.y < x.x ? x.y : x.x; | ||
| 4145 | } | ||
| 4146 | |||
| 4147 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint3 x) { | ||
| 4148 | unsigned int t = x.z < x.x ? x.z : x.x; | ||
| 4149 | return x.y < t ? x.y : t; | ||
| 4150 | } | ||
| 4151 | |||
| 4152 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x) { | ||
| 4153 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4154 | } | ||
| 4155 | |||
| 4156 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint8 x) { | ||
| 4157 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4158 | } | ||
| 4159 | |||
| 4160 | static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint16 x) { | ||
| 4161 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4162 | } | ||
| 4163 | |||
| 4164 | static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x) { | ||
| 4165 | return fmin(x.x, x.y); | ||
| 4166 | } | ||
| 4167 | |||
| 4168 | static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x) { | ||
| 4169 | return fmin(fmin(x.x, x.z), x.y); | ||
| 4170 | } | ||
| 4171 | |||
| 4172 | static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x) { | ||
| 4173 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4174 | } | ||
| 4175 | |||
| 4176 | static inline SIMD_CFUNC float simd_reduce_min(simd_float8 x) { | ||
| 4177 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4178 | } | ||
| 4179 | |||
| 4180 | static inline SIMD_CFUNC float simd_reduce_min(simd_float16 x) { | ||
| 4181 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4182 | } | ||
| 4183 | |||
| 4184 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long2 x) { | ||
| 4185 | return x.y < x.x ? x.y : x.x; | ||
| 4186 | } | ||
| 4187 | |||
| 4188 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long3 x) { | ||
| 4189 | simd_long1 t = x.z < x.x ? x.z : x.x; | ||
| 4190 | return x.y < t ? x.y : t; | ||
| 4191 | } | ||
| 4192 | |||
| 4193 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long4 x) { | ||
| 4194 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4195 | } | ||
| 4196 | |||
| 4197 | static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long8 x) { | ||
| 4198 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4199 | } | ||
| 4200 | |||
| 4201 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong2 x) { | ||
| 4202 | return x.y < x.x ? x.y : x.x; | ||
| 4203 | } | ||
| 4204 | |||
| 4205 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong3 x) { | ||
| 4206 | simd_ulong1 t = x.z < x.x ? x.z : x.x; | ||
| 4207 | return x.y < t ? x.y : t; | ||
| 4208 | } | ||
| 4209 | |||
| 4210 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong4 x) { | ||
| 4211 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4212 | } | ||
| 4213 | |||
| 4214 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong8 x) { | ||
| 4215 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4216 | } | ||
| 4217 | |||
| 4218 | static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x) { | ||
| 4219 | return fmin(x.x, x.y); | ||
| 4220 | } | ||
| 4221 | |||
| 4222 | static inline SIMD_CFUNC double simd_reduce_min(simd_double3 x) { | ||
| 4223 | return fmin(fmin(x.x, x.z), x.y); | ||
| 4224 | } | ||
| 4225 | |||
| 4226 | static inline SIMD_CFUNC double simd_reduce_min(simd_double4 x) { | ||
| 4227 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4228 | } | ||
| 4229 | |||
| 4230 | static inline SIMD_CFUNC double simd_reduce_min(simd_double8 x) { | ||
| 4231 | return simd_reduce_min(simd_min(x.lo, x.hi)); | ||
| 4232 | } | ||
| 4233 | |||
| 4234 | static inline SIMD_CFUNC char simd_reduce_max(simd_char2 x) { | ||
| 4235 | return x.y > x.x ? x.y : x.x; | ||
| 4236 | } | ||
| 4237 | |||
| 4238 | static inline SIMD_CFUNC char simd_reduce_max(simd_char3 x) { | ||
| 4239 | char t = x.z > x.x ? x.z : x.x; | ||
| 4240 | return x.y > t ? x.y : t; | ||
| 4241 | } | ||
| 4242 | |||
| 4243 | static inline SIMD_CFUNC char simd_reduce_max(simd_char4 x) { | ||
| 4244 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4245 | } | ||
| 4246 | |||
| 4247 | static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x) { | ||
| 4248 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4249 | } | ||
| 4250 | |||
| 4251 | static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x) { | ||
| 4252 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4253 | } | ||
| 4254 | |||
| 4255 | static inline SIMD_CFUNC char simd_reduce_max(simd_char32 x) { | ||
| 4256 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4257 | } | ||
| 4258 | |||
| 4259 | static inline SIMD_CFUNC char simd_reduce_max(simd_char64 x) { | ||
| 4260 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4261 | } | ||
| 4262 | |||
| 4263 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar2 x) { | ||
| 4264 | return x.y > x.x ? x.y : x.x; | ||
| 4265 | } | ||
| 4266 | |||
| 4267 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar3 x) { | ||
| 4268 | unsigned char t = x.z > x.x ? x.z : x.x; | ||
| 4269 | return x.y > t ? x.y : t; | ||
| 4270 | } | ||
| 4271 | |||
| 4272 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar4 x) { | ||
| 4273 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4274 | } | ||
| 4275 | |||
| 4276 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar8 x) { | ||
| 4277 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4278 | } | ||
| 4279 | |||
| 4280 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x) { | ||
| 4281 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4282 | } | ||
| 4283 | |||
| 4284 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar32 x) { | ||
| 4285 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4286 | } | ||
| 4287 | |||
| 4288 | static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar64 x) { | ||
| 4289 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4290 | } | ||
| 4291 | |||
| 4292 | static inline SIMD_CFUNC short simd_reduce_max(simd_short2 x) { | ||
| 4293 | return x.y > x.x ? x.y : x.x; | ||
| 4294 | } | ||
| 4295 | |||
| 4296 | static inline SIMD_CFUNC short simd_reduce_max(simd_short3 x) { | ||
| 4297 | short t = x.z > x.x ? x.z : x.x; | ||
| 4298 | return x.y > t ? x.y : t; | ||
| 4299 | } | ||
| 4300 | |||
| 4301 | static inline SIMD_CFUNC short simd_reduce_max(simd_short4 x) { | ||
| 4302 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4303 | } | ||
| 4304 | |||
| 4305 | static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x) { | ||
| 4306 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4307 | } | ||
| 4308 | |||
| 4309 | static inline SIMD_CFUNC short simd_reduce_max(simd_short16 x) { | ||
| 4310 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4311 | } | ||
| 4312 | |||
| 4313 | static inline SIMD_CFUNC short simd_reduce_max(simd_short32 x) { | ||
| 4314 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4315 | } | ||
| 4316 | |||
| 4317 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort2 x) { | ||
| 4318 | return x.y > x.x ? x.y : x.x; | ||
| 4319 | } | ||
| 4320 | |||
| 4321 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort3 x) { | ||
| 4322 | unsigned short t = x.z > x.x ? x.z : x.x; | ||
| 4323 | return x.y > t ? x.y : t; | ||
| 4324 | } | ||
| 4325 | |||
| 4326 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort4 x) { | ||
| 4327 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4328 | } | ||
| 4329 | |||
| 4330 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x) { | ||
| 4331 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4332 | } | ||
| 4333 | |||
| 4334 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort16 x) { | ||
| 4335 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4336 | } | ||
| 4337 | |||
| 4338 | static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x) { | ||
| 4339 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4340 | } | ||
| 4341 | |||
| 4342 | static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x) { | ||
| 4343 | return x.y > x.x ? x.y : x.x; | ||
| 4344 | } | ||
| 4345 | |||
| 4346 | static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x) { | ||
| 4347 | int t = x.z > x.x ? x.z : x.x; | ||
| 4348 | return x.y > t ? x.y : t; | ||
| 4349 | } | ||
| 4350 | |||
| 4351 | static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x) { | ||
| 4352 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4353 | } | ||
| 4354 | |||
| 4355 | static inline SIMD_CFUNC int simd_reduce_max(simd_int8 x) { | ||
| 4356 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4357 | } | ||
| 4358 | |||
| 4359 | static inline SIMD_CFUNC int simd_reduce_max(simd_int16 x) { | ||
| 4360 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4361 | } | ||
| 4362 | |||
| 4363 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint2 x) { | ||
| 4364 | return x.y > x.x ? x.y : x.x; | ||
| 4365 | } | ||
| 4366 | |||
| 4367 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint3 x) { | ||
| 4368 | unsigned int t = x.z > x.x ? x.z : x.x; | ||
| 4369 | return x.y > t ? x.y : t; | ||
| 4370 | } | ||
| 4371 | |||
| 4372 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x) { | ||
| 4373 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4374 | } | ||
| 4375 | |||
| 4376 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint8 x) { | ||
| 4377 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4378 | } | ||
| 4379 | |||
| 4380 | static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint16 x) { | ||
| 4381 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4382 | } | ||
| 4383 | |||
| 4384 | static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x) { | ||
| 4385 | return fmax(x.x, x.y); | ||
| 4386 | } | ||
| 4387 | |||
| 4388 | static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x) { | ||
| 4389 | return fmax(fmax(x.x, x.z), x.y); | ||
| 4390 | } | ||
| 4391 | |||
| 4392 | static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x) { | ||
| 4393 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4394 | } | ||
| 4395 | |||
| 4396 | static inline SIMD_CFUNC float simd_reduce_max(simd_float8 x) { | ||
| 4397 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4398 | } | ||
| 4399 | |||
| 4400 | static inline SIMD_CFUNC float simd_reduce_max(simd_float16 x) { | ||
| 4401 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4402 | } | ||
| 4403 | |||
| 4404 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long2 x) { | ||
| 4405 | return x.y > x.x ? x.y : x.x; | ||
| 4406 | } | ||
| 4407 | |||
| 4408 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long3 x) { | ||
| 4409 | simd_long1 t = x.z > x.x ? x.z : x.x; | ||
| 4410 | return x.y > t ? x.y : t; | ||
| 4411 | } | ||
| 4412 | |||
| 4413 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long4 x) { | ||
| 4414 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4415 | } | ||
| 4416 | |||
| 4417 | static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long8 x) { | ||
| 4418 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4419 | } | ||
| 4420 | |||
| 4421 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong2 x) { | ||
| 4422 | return x.y > x.x ? x.y : x.x; | ||
| 4423 | } | ||
| 4424 | |||
| 4425 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong3 x) { | ||
| 4426 | simd_ulong1 t = x.z > x.x ? x.z : x.x; | ||
| 4427 | return x.y > t ? x.y : t; | ||
| 4428 | } | ||
| 4429 | |||
| 4430 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong4 x) { | ||
| 4431 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4432 | } | ||
| 4433 | |||
| 4434 | static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong8 x) { | ||
| 4435 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4436 | } | ||
| 4437 | |||
| 4438 | static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x) { | ||
| 4439 | return fmax(x.x, x.y); | ||
| 4440 | } | ||
| 4441 | |||
| 4442 | static inline SIMD_CFUNC double simd_reduce_max(simd_double3 x) { | ||
| 4443 | return fmax(fmax(x.x, x.z), x.y); | ||
| 4444 | } | ||
| 4445 | |||
| 4446 | static inline SIMD_CFUNC double simd_reduce_max(simd_double4 x) { | ||
| 4447 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4448 | } | ||
| 4449 | |||
| 4450 | static inline SIMD_CFUNC double simd_reduce_max(simd_double8 x) { | ||
| 4451 | return simd_reduce_max(simd_max(x.lo, x.hi)); | ||
| 4452 | } | ||
| 4453 | |||
| 4454 | #ifdef __cplusplus | ||
| 4455 | } | ||
| 4456 | #endif | ||
| 4457 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 4458 | #endif /* SIMD_COMMON_HEADER */ | ||
lib/libc/include/x86_64-macos-gnu/simd/conversion.h created+1967| ... | @@ -0,0 +1,1967 @@ | ||
| 1 | /* Copyright (c) 2014-2017 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * The interfaces declared in this header provide conversions between vector | ||
| 4 | * types. The following functions are available: | ||
| 5 | * | ||
| 6 | * simd_char(x) simd_uchar(x) | ||
| 7 | * simd_short(x) simd_ushort(x) | ||
| 8 | * simd_int(x) simd_uint(x) | ||
| 9 | * simd_long(x) simd_ulong(x) | ||
| 10 | * simd_float(x) | ||
| 11 | * simd_double(x) | ||
| 12 | * | ||
| 13 | * Each of these functions converts x to a vector whose elements have the | ||
| 14 | * type named by the function, with the same number of elements as x. Unlike | ||
| 15 | * a vector cast, these functions convert the elements to the new element | ||
| 16 | * type. These conversions behave exactly as C scalar conversions, except | ||
| 17 | * that conversions from integer vector types to signed integer vector types | ||
| 18 | * are guaranteed to wrap modulo 2^N (where N is the number of bits in an | ||
| 19 | * element of the result type). | ||
| 20 | * | ||
| 21 | * For integer vector types, saturating conversions are also available: | ||
| 22 | * | ||
| 23 | * simd_char_sat(x) simd_uchar_sat(x) | ||
| 24 | * simd_short_sat(x) simd_ushort_sat(x) | ||
| 25 | * simd_int_sat(x) simd_uint_sat(x) | ||
| 26 | * simd_long_sat(x) simd_ulong_sat(x) | ||
| 27 | * | ||
| 28 | * These conversions clamp x to the representable range of the result type | ||
| 29 | * before converting. | ||
| 30 | * | ||
| 31 | * Unlike most vector operations in <simd/>, there are no abbreviated C++ | ||
| 32 | * names for these functions in the simd:: namespace. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef __SIMD_CONVERSION_HEADER__ | ||
| 36 | #define __SIMD_CONVERSION_HEADER__ | ||
| 37 | |||
| 38 | #include <simd/base.h> | ||
| 39 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 40 | #include <simd/vector_types.h> | ||
| 41 | #include <simd/common.h> | ||
| 42 | #include <simd/logic.h> | ||
| 43 | |||
| 44 | #ifdef __cplusplus | ||
| 45 | extern "C" { | ||
| 46 | #endif | ||
| 47 | |||
| 48 | static simd_char2 SIMD_CFUNC simd_char(simd_char2 __x); | ||
| 49 | static simd_char3 SIMD_CFUNC simd_char(simd_char3 __x); | ||
| 50 | static simd_char4 SIMD_CFUNC simd_char(simd_char4 __x); | ||
| 51 | static simd_char8 SIMD_CFUNC simd_char(simd_char8 __x); | ||
| 52 | static simd_char16 SIMD_CFUNC simd_char(simd_char16 __x); | ||
| 53 | static simd_char32 SIMD_CFUNC simd_char(simd_char32 __x); | ||
| 54 | static simd_char2 SIMD_CFUNC simd_char(simd_uchar2 __x); | ||
| 55 | static simd_char3 SIMD_CFUNC simd_char(simd_uchar3 __x); | ||
| 56 | static simd_char4 SIMD_CFUNC simd_char(simd_uchar4 __x); | ||
| 57 | static simd_char8 SIMD_CFUNC simd_char(simd_uchar8 __x); | ||
| 58 | static simd_char16 SIMD_CFUNC simd_char(simd_uchar16 __x); | ||
| 59 | static simd_char32 SIMD_CFUNC simd_char(simd_uchar32 __x); | ||
| 60 | static simd_char2 SIMD_CFUNC simd_char(simd_short2 __x); | ||
| 61 | static simd_char3 SIMD_CFUNC simd_char(simd_short3 __x); | ||
| 62 | static simd_char4 SIMD_CFUNC simd_char(simd_short4 __x); | ||
| 63 | static simd_char8 SIMD_CFUNC simd_char(simd_short8 __x); | ||
| 64 | static simd_char16 SIMD_CFUNC simd_char(simd_short16 __x); | ||
| 65 | static simd_char32 SIMD_CFUNC simd_char(simd_short32 __x); | ||
| 66 | static simd_char2 SIMD_CFUNC simd_char(simd_ushort2 __x); | ||
| 67 | static simd_char3 SIMD_CFUNC simd_char(simd_ushort3 __x); | ||
| 68 | static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x); | ||
| 69 | static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x); | ||
| 70 | static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x); | ||
| 71 | static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x); | ||
| 72 | static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x); | ||
| 73 | static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x); | ||
| 74 | static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x); | ||
| 75 | static simd_char8 SIMD_CFUNC simd_char(simd_int8 __x); | ||
| 76 | static simd_char16 SIMD_CFUNC simd_char(simd_int16 __x); | ||
| 77 | static simd_char2 SIMD_CFUNC simd_char(simd_uint2 __x); | ||
| 78 | static simd_char3 SIMD_CFUNC simd_char(simd_uint3 __x); | ||
| 79 | static simd_char4 SIMD_CFUNC simd_char(simd_uint4 __x); | ||
| 80 | static simd_char8 SIMD_CFUNC simd_char(simd_uint8 __x); | ||
| 81 | static simd_char16 SIMD_CFUNC simd_char(simd_uint16 __x); | ||
| 82 | static simd_char2 SIMD_CFUNC simd_char(simd_float2 __x); | ||
| 83 | static simd_char3 SIMD_CFUNC simd_char(simd_float3 __x); | ||
| 84 | static simd_char4 SIMD_CFUNC simd_char(simd_float4 __x); | ||
| 85 | static simd_char8 SIMD_CFUNC simd_char(simd_float8 __x); | ||
| 86 | static simd_char16 SIMD_CFUNC simd_char(simd_float16 __x); | ||
| 87 | static simd_char2 SIMD_CFUNC simd_char(simd_long2 __x); | ||
| 88 | static simd_char3 SIMD_CFUNC simd_char(simd_long3 __x); | ||
| 89 | static simd_char4 SIMD_CFUNC simd_char(simd_long4 __x); | ||
| 90 | static simd_char8 SIMD_CFUNC simd_char(simd_long8 __x); | ||
| 91 | static simd_char2 SIMD_CFUNC simd_char(simd_ulong2 __x); | ||
| 92 | static simd_char3 SIMD_CFUNC simd_char(simd_ulong3 __x); | ||
| 93 | static simd_char4 SIMD_CFUNC simd_char(simd_ulong4 __x); | ||
| 94 | static simd_char8 SIMD_CFUNC simd_char(simd_ulong8 __x); | ||
| 95 | static simd_char2 SIMD_CFUNC simd_char(simd_double2 __x); | ||
| 96 | static simd_char3 SIMD_CFUNC simd_char(simd_double3 __x); | ||
| 97 | static simd_char4 SIMD_CFUNC simd_char(simd_double4 __x); | ||
| 98 | static simd_char8 SIMD_CFUNC simd_char(simd_double8 __x); | ||
| 99 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_char2 __x); | ||
| 100 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_char3 __x); | ||
| 101 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_char4 __x); | ||
| 102 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_char8 __x); | ||
| 103 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_char16 __x); | ||
| 104 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_char32 __x); | ||
| 105 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_short2 __x); | ||
| 106 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_short3 __x); | ||
| 107 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x); | ||
| 108 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x); | ||
| 109 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x); | ||
| 110 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x); | ||
| 111 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x); | ||
| 112 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x); | ||
| 113 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x); | ||
| 114 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_int8 __x); | ||
| 115 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_int16 __x); | ||
| 116 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_float2 __x); | ||
| 117 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_float3 __x); | ||
| 118 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_float4 __x); | ||
| 119 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_float8 __x); | ||
| 120 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_float16 __x); | ||
| 121 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_long2 __x); | ||
| 122 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_long3 __x); | ||
| 123 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_long4 __x); | ||
| 124 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_long8 __x); | ||
| 125 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_double2 __x); | ||
| 126 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_double3 __x); | ||
| 127 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_double4 __x); | ||
| 128 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_double8 __x); | ||
| 129 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_uchar2 __x); | ||
| 130 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_uchar3 __x); | ||
| 131 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_uchar4 __x); | ||
| 132 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_uchar8 __x); | ||
| 133 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_uchar16 __x); | ||
| 134 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_uchar32 __x); | ||
| 135 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_ushort2 __x); | ||
| 136 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_ushort3 __x); | ||
| 137 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_ushort4 __x); | ||
| 138 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_ushort8 __x); | ||
| 139 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_ushort16 __x); | ||
| 140 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_ushort32 __x); | ||
| 141 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_uint2 __x); | ||
| 142 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_uint3 __x); | ||
| 143 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_uint4 __x); | ||
| 144 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_uint8 __x); | ||
| 145 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_uint16 __x); | ||
| 146 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_ulong2 __x); | ||
| 147 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_ulong3 __x); | ||
| 148 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_ulong4 __x); | ||
| 149 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_ulong8 __x); | ||
| 150 | #define vector_char simd_char | ||
| 151 | #define vector_char_sat simd_char_sat | ||
| 152 | |||
| 153 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_char2 __x); | ||
| 154 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_char3 __x); | ||
| 155 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_char4 __x); | ||
| 156 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_char8 __x); | ||
| 157 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_char16 __x); | ||
| 158 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_char32 __x); | ||
| 159 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uchar2 __x); | ||
| 160 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uchar3 __x); | ||
| 161 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uchar4 __x); | ||
| 162 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uchar8 __x); | ||
| 163 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uchar16 __x); | ||
| 164 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_uchar32 __x); | ||
| 165 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_short2 __x); | ||
| 166 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_short3 __x); | ||
| 167 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_short4 __x); | ||
| 168 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_short8 __x); | ||
| 169 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_short16 __x); | ||
| 170 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_short32 __x); | ||
| 171 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ushort2 __x); | ||
| 172 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ushort3 __x); | ||
| 173 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x); | ||
| 174 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x); | ||
| 175 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x); | ||
| 176 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x); | ||
| 177 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x); | ||
| 178 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x); | ||
| 179 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x); | ||
| 180 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_int8 __x); | ||
| 181 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_int16 __x); | ||
| 182 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uint2 __x); | ||
| 183 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uint3 __x); | ||
| 184 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uint4 __x); | ||
| 185 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uint8 __x); | ||
| 186 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uint16 __x); | ||
| 187 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_float2 __x); | ||
| 188 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_float3 __x); | ||
| 189 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_float4 __x); | ||
| 190 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_float8 __x); | ||
| 191 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_float16 __x); | ||
| 192 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_long2 __x); | ||
| 193 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_long3 __x); | ||
| 194 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_long4 __x); | ||
| 195 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_long8 __x); | ||
| 196 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ulong2 __x); | ||
| 197 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ulong3 __x); | ||
| 198 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ulong4 __x); | ||
| 199 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ulong8 __x); | ||
| 200 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_double2 __x); | ||
| 201 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_double3 __x); | ||
| 202 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_double4 __x); | ||
| 203 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_double8 __x); | ||
| 204 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_char2 __x); | ||
| 205 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_char3 __x); | ||
| 206 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_char4 __x); | ||
| 207 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_char8 __x); | ||
| 208 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_char16 __x); | ||
| 209 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_char32 __x); | ||
| 210 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_short2 __x); | ||
| 211 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_short3 __x); | ||
| 212 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x); | ||
| 213 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x); | ||
| 214 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x); | ||
| 215 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x); | ||
| 216 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x); | ||
| 217 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x); | ||
| 218 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x); | ||
| 219 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_int8 __x); | ||
| 220 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_int16 __x); | ||
| 221 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_float2 __x); | ||
| 222 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_float3 __x); | ||
| 223 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_float4 __x); | ||
| 224 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_float8 __x); | ||
| 225 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_float16 __x); | ||
| 226 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_long2 __x); | ||
| 227 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_long3 __x); | ||
| 228 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_long4 __x); | ||
| 229 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_long8 __x); | ||
| 230 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_double2 __x); | ||
| 231 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_double3 __x); | ||
| 232 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_double4 __x); | ||
| 233 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_double8 __x); | ||
| 234 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uchar2 __x); | ||
| 235 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uchar3 __x); | ||
| 236 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uchar4 __x); | ||
| 237 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uchar8 __x); | ||
| 238 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uchar16 __x); | ||
| 239 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_uchar32 __x); | ||
| 240 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ushort2 __x); | ||
| 241 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ushort3 __x); | ||
| 242 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ushort4 __x); | ||
| 243 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ushort8 __x); | ||
| 244 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_ushort16 __x); | ||
| 245 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_ushort32 __x); | ||
| 246 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uint2 __x); | ||
| 247 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uint3 __x); | ||
| 248 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uint4 __x); | ||
| 249 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uint8 __x); | ||
| 250 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uint16 __x); | ||
| 251 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ulong2 __x); | ||
| 252 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ulong3 __x); | ||
| 253 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ulong4 __x); | ||
| 254 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ulong8 __x); | ||
| 255 | #define vector_uchar simd_uchar | ||
| 256 | #define vector_uchar_sat simd_uchar_sat | ||
| 257 | |||
| 258 | static simd_short2 SIMD_CFUNC simd_short(simd_char2 __x); | ||
| 259 | static simd_short3 SIMD_CFUNC simd_short(simd_char3 __x); | ||
| 260 | static simd_short4 SIMD_CFUNC simd_short(simd_char4 __x); | ||
| 261 | static simd_short8 SIMD_CFUNC simd_short(simd_char8 __x); | ||
| 262 | static simd_short16 SIMD_CFUNC simd_short(simd_char16 __x); | ||
| 263 | static simd_short32 SIMD_CFUNC simd_short(simd_char32 __x); | ||
| 264 | static simd_short2 SIMD_CFUNC simd_short(simd_uchar2 __x); | ||
| 265 | static simd_short3 SIMD_CFUNC simd_short(simd_uchar3 __x); | ||
| 266 | static simd_short4 SIMD_CFUNC simd_short(simd_uchar4 __x); | ||
| 267 | static simd_short8 SIMD_CFUNC simd_short(simd_uchar8 __x); | ||
| 268 | static simd_short16 SIMD_CFUNC simd_short(simd_uchar16 __x); | ||
| 269 | static simd_short32 SIMD_CFUNC simd_short(simd_uchar32 __x); | ||
| 270 | static simd_short2 SIMD_CFUNC simd_short(simd_short2 __x); | ||
| 271 | static simd_short3 SIMD_CFUNC simd_short(simd_short3 __x); | ||
| 272 | static simd_short4 SIMD_CFUNC simd_short(simd_short4 __x); | ||
| 273 | static simd_short8 SIMD_CFUNC simd_short(simd_short8 __x); | ||
| 274 | static simd_short16 SIMD_CFUNC simd_short(simd_short16 __x); | ||
| 275 | static simd_short32 SIMD_CFUNC simd_short(simd_short32 __x); | ||
| 276 | static simd_short2 SIMD_CFUNC simd_short(simd_ushort2 __x); | ||
| 277 | static simd_short3 SIMD_CFUNC simd_short(simd_ushort3 __x); | ||
| 278 | static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x); | ||
| 279 | static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x); | ||
| 280 | static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x); | ||
| 281 | static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x); | ||
| 282 | static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x); | ||
| 283 | static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x); | ||
| 284 | static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x); | ||
| 285 | static simd_short8 SIMD_CFUNC simd_short(simd_int8 __x); | ||
| 286 | static simd_short16 SIMD_CFUNC simd_short(simd_int16 __x); | ||
| 287 | static simd_short2 SIMD_CFUNC simd_short(simd_uint2 __x); | ||
| 288 | static simd_short3 SIMD_CFUNC simd_short(simd_uint3 __x); | ||
| 289 | static simd_short4 SIMD_CFUNC simd_short(simd_uint4 __x); | ||
| 290 | static simd_short8 SIMD_CFUNC simd_short(simd_uint8 __x); | ||
| 291 | static simd_short16 SIMD_CFUNC simd_short(simd_uint16 __x); | ||
| 292 | static simd_short2 SIMD_CFUNC simd_short(simd_float2 __x); | ||
| 293 | static simd_short3 SIMD_CFUNC simd_short(simd_float3 __x); | ||
| 294 | static simd_short4 SIMD_CFUNC simd_short(simd_float4 __x); | ||
| 295 | static simd_short8 SIMD_CFUNC simd_short(simd_float8 __x); | ||
| 296 | static simd_short16 SIMD_CFUNC simd_short(simd_float16 __x); | ||
| 297 | static simd_short2 SIMD_CFUNC simd_short(simd_long2 __x); | ||
| 298 | static simd_short3 SIMD_CFUNC simd_short(simd_long3 __x); | ||
| 299 | static simd_short4 SIMD_CFUNC simd_short(simd_long4 __x); | ||
| 300 | static simd_short8 SIMD_CFUNC simd_short(simd_long8 __x); | ||
| 301 | static simd_short2 SIMD_CFUNC simd_short(simd_ulong2 __x); | ||
| 302 | static simd_short3 SIMD_CFUNC simd_short(simd_ulong3 __x); | ||
| 303 | static simd_short4 SIMD_CFUNC simd_short(simd_ulong4 __x); | ||
| 304 | static simd_short8 SIMD_CFUNC simd_short(simd_ulong8 __x); | ||
| 305 | static simd_short2 SIMD_CFUNC simd_short(simd_double2 __x); | ||
| 306 | static simd_short3 SIMD_CFUNC simd_short(simd_double3 __x); | ||
| 307 | static simd_short4 SIMD_CFUNC simd_short(simd_double4 __x); | ||
| 308 | static simd_short8 SIMD_CFUNC simd_short(simd_double8 __x); | ||
| 309 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_char2 __x); | ||
| 310 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_char3 __x); | ||
| 311 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_char4 __x); | ||
| 312 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_char8 __x); | ||
| 313 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_char16 __x); | ||
| 314 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_char32 __x); | ||
| 315 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_short2 __x); | ||
| 316 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_short3 __x); | ||
| 317 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x); | ||
| 318 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x); | ||
| 319 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x); | ||
| 320 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x); | ||
| 321 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x); | ||
| 322 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x); | ||
| 323 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x); | ||
| 324 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_int8 __x); | ||
| 325 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_int16 __x); | ||
| 326 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_float2 __x); | ||
| 327 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_float3 __x); | ||
| 328 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_float4 __x); | ||
| 329 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_float8 __x); | ||
| 330 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_float16 __x); | ||
| 331 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_long2 __x); | ||
| 332 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_long3 __x); | ||
| 333 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_long4 __x); | ||
| 334 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_long8 __x); | ||
| 335 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_double2 __x); | ||
| 336 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_double3 __x); | ||
| 337 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_double4 __x); | ||
| 338 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_double8 __x); | ||
| 339 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_uchar2 __x); | ||
| 340 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_uchar3 __x); | ||
| 341 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_uchar4 __x); | ||
| 342 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_uchar8 __x); | ||
| 343 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_uchar16 __x); | ||
| 344 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_uchar32 __x); | ||
| 345 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_ushort2 __x); | ||
| 346 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_ushort3 __x); | ||
| 347 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_ushort4 __x); | ||
| 348 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_ushort8 __x); | ||
| 349 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_ushort16 __x); | ||
| 350 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_ushort32 __x); | ||
| 351 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_uint2 __x); | ||
| 352 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_uint3 __x); | ||
| 353 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_uint4 __x); | ||
| 354 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_uint8 __x); | ||
| 355 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_uint16 __x); | ||
| 356 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x); | ||
| 357 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x); | ||
| 358 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x); | ||
| 359 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x); | ||
| 360 | #define vector_short simd_short | ||
| 361 | #define vector_short_sat simd_short_sat | ||
| 362 | |||
| 363 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x); | ||
| 364 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x); | ||
| 365 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_char4 __x); | ||
| 366 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_char8 __x); | ||
| 367 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_char16 __x); | ||
| 368 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_char32 __x); | ||
| 369 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uchar2 __x); | ||
| 370 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uchar3 __x); | ||
| 371 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uchar4 __x); | ||
| 372 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uchar8 __x); | ||
| 373 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uchar16 __x); | ||
| 374 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_uchar32 __x); | ||
| 375 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_short2 __x); | ||
| 376 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_short3 __x); | ||
| 377 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_short4 __x); | ||
| 378 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_short8 __x); | ||
| 379 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_short16 __x); | ||
| 380 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_short32 __x); | ||
| 381 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ushort2 __x); | ||
| 382 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ushort3 __x); | ||
| 383 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x); | ||
| 384 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x); | ||
| 385 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x); | ||
| 386 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x); | ||
| 387 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x); | ||
| 388 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x); | ||
| 389 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x); | ||
| 390 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_int8 __x); | ||
| 391 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_int16 __x); | ||
| 392 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uint2 __x); | ||
| 393 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uint3 __x); | ||
| 394 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uint4 __x); | ||
| 395 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uint8 __x); | ||
| 396 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uint16 __x); | ||
| 397 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_float2 __x); | ||
| 398 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_float3 __x); | ||
| 399 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_float4 __x); | ||
| 400 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_float8 __x); | ||
| 401 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_float16 __x); | ||
| 402 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_long2 __x); | ||
| 403 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_long3 __x); | ||
| 404 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_long4 __x); | ||
| 405 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_long8 __x); | ||
| 406 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ulong2 __x); | ||
| 407 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ulong3 __x); | ||
| 408 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ulong4 __x); | ||
| 409 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ulong8 __x); | ||
| 410 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_double2 __x); | ||
| 411 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_double3 __x); | ||
| 412 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_double4 __x); | ||
| 413 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_double8 __x); | ||
| 414 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_char2 __x); | ||
| 415 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_char3 __x); | ||
| 416 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_char4 __x); | ||
| 417 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_char8 __x); | ||
| 418 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_char16 __x); | ||
| 419 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_char32 __x); | ||
| 420 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_short2 __x); | ||
| 421 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_short3 __x); | ||
| 422 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x); | ||
| 423 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x); | ||
| 424 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x); | ||
| 425 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x); | ||
| 426 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x); | ||
| 427 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x); | ||
| 428 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x); | ||
| 429 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_int8 __x); | ||
| 430 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_int16 __x); | ||
| 431 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_float2 __x); | ||
| 432 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_float3 __x); | ||
| 433 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_float4 __x); | ||
| 434 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_float8 __x); | ||
| 435 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_float16 __x); | ||
| 436 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_long2 __x); | ||
| 437 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_long3 __x); | ||
| 438 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_long4 __x); | ||
| 439 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_long8 __x); | ||
| 440 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_double2 __x); | ||
| 441 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_double3 __x); | ||
| 442 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_double4 __x); | ||
| 443 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_double8 __x); | ||
| 444 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uchar2 __x); | ||
| 445 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uchar3 __x); | ||
| 446 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uchar4 __x); | ||
| 447 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uchar8 __x); | ||
| 448 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uchar16 __x); | ||
| 449 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_uchar32 __x); | ||
| 450 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ushort2 __x); | ||
| 451 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ushort3 __x); | ||
| 452 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ushort4 __x); | ||
| 453 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ushort8 __x); | ||
| 454 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_ushort16 __x); | ||
| 455 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_ushort32 __x); | ||
| 456 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uint2 __x); | ||
| 457 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uint3 __x); | ||
| 458 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uint4 __x); | ||
| 459 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uint8 __x); | ||
| 460 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uint16 __x); | ||
| 461 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x); | ||
| 462 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x); | ||
| 463 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x); | ||
| 464 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x); | ||
| 465 | #define vector_ushort simd_ushort | ||
| 466 | #define vector_ushort_sat simd_ushort_sat | ||
| 467 | |||
| 468 | static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x); | ||
| 469 | static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x); | ||
| 470 | static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x); | ||
| 471 | static simd_int8 SIMD_CFUNC simd_int(simd_char8 __x); | ||
| 472 | static simd_int16 SIMD_CFUNC simd_int(simd_char16 __x); | ||
| 473 | static simd_int2 SIMD_CFUNC simd_int(simd_uchar2 __x); | ||
| 474 | static simd_int3 SIMD_CFUNC simd_int(simd_uchar3 __x); | ||
| 475 | static simd_int4 SIMD_CFUNC simd_int(simd_uchar4 __x); | ||
| 476 | static simd_int8 SIMD_CFUNC simd_int(simd_uchar8 __x); | ||
| 477 | static simd_int16 SIMD_CFUNC simd_int(simd_uchar16 __x); | ||
| 478 | static simd_int2 SIMD_CFUNC simd_int(simd_short2 __x); | ||
| 479 | static simd_int3 SIMD_CFUNC simd_int(simd_short3 __x); | ||
| 480 | static simd_int4 SIMD_CFUNC simd_int(simd_short4 __x); | ||
| 481 | static simd_int8 SIMD_CFUNC simd_int(simd_short8 __x); | ||
| 482 | static simd_int16 SIMD_CFUNC simd_int(simd_short16 __x); | ||
| 483 | static simd_int2 SIMD_CFUNC simd_int(simd_ushort2 __x); | ||
| 484 | static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x); | ||
| 485 | static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x); | ||
| 486 | static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x); | ||
| 487 | static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x); | ||
| 488 | static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x); | ||
| 489 | static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x); | ||
| 490 | static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x); | ||
| 491 | static simd_int8 SIMD_CFUNC simd_int(simd_int8 __x); | ||
| 492 | static simd_int16 SIMD_CFUNC simd_int(simd_int16 __x); | ||
| 493 | static simd_int2 SIMD_CFUNC simd_int(simd_uint2 __x); | ||
| 494 | static simd_int3 SIMD_CFUNC simd_int(simd_uint3 __x); | ||
| 495 | static simd_int4 SIMD_CFUNC simd_int(simd_uint4 __x); | ||
| 496 | static simd_int8 SIMD_CFUNC simd_int(simd_uint8 __x); | ||
| 497 | static simd_int16 SIMD_CFUNC simd_int(simd_uint16 __x); | ||
| 498 | static simd_int2 SIMD_CFUNC simd_int(simd_float2 __x); | ||
| 499 | static simd_int3 SIMD_CFUNC simd_int(simd_float3 __x); | ||
| 500 | static simd_int4 SIMD_CFUNC simd_int(simd_float4 __x); | ||
| 501 | static simd_int8 SIMD_CFUNC simd_int(simd_float8 __x); | ||
| 502 | static simd_int16 SIMD_CFUNC simd_int(simd_float16 __x); | ||
| 503 | static simd_int2 SIMD_CFUNC simd_int(simd_long2 __x); | ||
| 504 | static simd_int3 SIMD_CFUNC simd_int(simd_long3 __x); | ||
| 505 | static simd_int4 SIMD_CFUNC simd_int(simd_long4 __x); | ||
| 506 | static simd_int8 SIMD_CFUNC simd_int(simd_long8 __x); | ||
| 507 | static simd_int2 SIMD_CFUNC simd_int(simd_ulong2 __x); | ||
| 508 | static simd_int3 SIMD_CFUNC simd_int(simd_ulong3 __x); | ||
| 509 | static simd_int4 SIMD_CFUNC simd_int(simd_ulong4 __x); | ||
| 510 | static simd_int8 SIMD_CFUNC simd_int(simd_ulong8 __x); | ||
| 511 | static simd_int2 SIMD_CFUNC simd_int(simd_double2 __x); | ||
| 512 | static simd_int3 SIMD_CFUNC simd_int(simd_double3 __x); | ||
| 513 | static simd_int4 SIMD_CFUNC simd_int(simd_double4 __x); | ||
| 514 | static simd_int8 SIMD_CFUNC simd_int(simd_double8 __x); | ||
| 515 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_char2 __x); | ||
| 516 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_char3 __x); | ||
| 517 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_char4 __x); | ||
| 518 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_char8 __x); | ||
| 519 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_char16 __x); | ||
| 520 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_short2 __x); | ||
| 521 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x); | ||
| 522 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x); | ||
| 523 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x); | ||
| 524 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x); | ||
| 525 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x); | ||
| 526 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x); | ||
| 527 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x); | ||
| 528 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_int8 __x); | ||
| 529 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_int16 __x); | ||
| 530 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_float2 __x); | ||
| 531 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_float3 __x); | ||
| 532 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_float4 __x); | ||
| 533 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_float8 __x); | ||
| 534 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_float16 __x); | ||
| 535 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_long2 __x); | ||
| 536 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_long3 __x); | ||
| 537 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_long4 __x); | ||
| 538 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_long8 __x); | ||
| 539 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_double2 __x); | ||
| 540 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_double3 __x); | ||
| 541 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_double4 __x); | ||
| 542 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_double8 __x); | ||
| 543 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_uchar2 __x); | ||
| 544 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_uchar3 __x); | ||
| 545 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_uchar4 __x); | ||
| 546 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_uchar8 __x); | ||
| 547 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_uchar16 __x); | ||
| 548 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_ushort2 __x); | ||
| 549 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_ushort3 __x); | ||
| 550 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_ushort4 __x); | ||
| 551 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_ushort8 __x); | ||
| 552 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_ushort16 __x); | ||
| 553 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_uint2 __x); | ||
| 554 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_uint3 __x); | ||
| 555 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_uint4 __x); | ||
| 556 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_uint8 __x); | ||
| 557 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_uint16 __x); | ||
| 558 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_ulong2 __x); | ||
| 559 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_ulong3 __x); | ||
| 560 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x); | ||
| 561 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x); | ||
| 562 | static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x); | ||
| 563 | static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x); | ||
| 564 | static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x); | ||
| 565 | static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x); | ||
| 566 | static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x); | ||
| 567 | #define vector_int simd_int | ||
| 568 | #define vector_int_sat simd_int_sat | ||
| 569 | |||
| 570 | static simd_uint2 SIMD_CFUNC simd_uint(simd_char2 __x); | ||
| 571 | static simd_uint3 SIMD_CFUNC simd_uint(simd_char3 __x); | ||
| 572 | static simd_uint4 SIMD_CFUNC simd_uint(simd_char4 __x); | ||
| 573 | static simd_uint8 SIMD_CFUNC simd_uint(simd_char8 __x); | ||
| 574 | static simd_uint16 SIMD_CFUNC simd_uint(simd_char16 __x); | ||
| 575 | static simd_uint2 SIMD_CFUNC simd_uint(simd_uchar2 __x); | ||
| 576 | static simd_uint3 SIMD_CFUNC simd_uint(simd_uchar3 __x); | ||
| 577 | static simd_uint4 SIMD_CFUNC simd_uint(simd_uchar4 __x); | ||
| 578 | static simd_uint8 SIMD_CFUNC simd_uint(simd_uchar8 __x); | ||
| 579 | static simd_uint16 SIMD_CFUNC simd_uint(simd_uchar16 __x); | ||
| 580 | static simd_uint2 SIMD_CFUNC simd_uint(simd_short2 __x); | ||
| 581 | static simd_uint3 SIMD_CFUNC simd_uint(simd_short3 __x); | ||
| 582 | static simd_uint4 SIMD_CFUNC simd_uint(simd_short4 __x); | ||
| 583 | static simd_uint8 SIMD_CFUNC simd_uint(simd_short8 __x); | ||
| 584 | static simd_uint16 SIMD_CFUNC simd_uint(simd_short16 __x); | ||
| 585 | static simd_uint2 SIMD_CFUNC simd_uint(simd_ushort2 __x); | ||
| 586 | static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x); | ||
| 587 | static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x); | ||
| 588 | static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x); | ||
| 589 | static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x); | ||
| 590 | static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x); | ||
| 591 | static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x); | ||
| 592 | static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x); | ||
| 593 | static simd_uint8 SIMD_CFUNC simd_uint(simd_int8 __x); | ||
| 594 | static simd_uint16 SIMD_CFUNC simd_uint(simd_int16 __x); | ||
| 595 | static simd_uint2 SIMD_CFUNC simd_uint(simd_uint2 __x); | ||
| 596 | static simd_uint3 SIMD_CFUNC simd_uint(simd_uint3 __x); | ||
| 597 | static simd_uint4 SIMD_CFUNC simd_uint(simd_uint4 __x); | ||
| 598 | static simd_uint8 SIMD_CFUNC simd_uint(simd_uint8 __x); | ||
| 599 | static simd_uint16 SIMD_CFUNC simd_uint(simd_uint16 __x); | ||
| 600 | static simd_uint2 SIMD_CFUNC simd_uint(simd_float2 __x); | ||
| 601 | static simd_uint3 SIMD_CFUNC simd_uint(simd_float3 __x); | ||
| 602 | static simd_uint4 SIMD_CFUNC simd_uint(simd_float4 __x); | ||
| 603 | static simd_uint8 SIMD_CFUNC simd_uint(simd_float8 __x); | ||
| 604 | static simd_uint16 SIMD_CFUNC simd_uint(simd_float16 __x); | ||
| 605 | static simd_uint2 SIMD_CFUNC simd_uint(simd_long2 __x); | ||
| 606 | static simd_uint3 SIMD_CFUNC simd_uint(simd_long3 __x); | ||
| 607 | static simd_uint4 SIMD_CFUNC simd_uint(simd_long4 __x); | ||
| 608 | static simd_uint8 SIMD_CFUNC simd_uint(simd_long8 __x); | ||
| 609 | static simd_uint2 SIMD_CFUNC simd_uint(simd_ulong2 __x); | ||
| 610 | static simd_uint3 SIMD_CFUNC simd_uint(simd_ulong3 __x); | ||
| 611 | static simd_uint4 SIMD_CFUNC simd_uint(simd_ulong4 __x); | ||
| 612 | static simd_uint8 SIMD_CFUNC simd_uint(simd_ulong8 __x); | ||
| 613 | static simd_uint2 SIMD_CFUNC simd_uint(simd_double2 __x); | ||
| 614 | static simd_uint3 SIMD_CFUNC simd_uint(simd_double3 __x); | ||
| 615 | static simd_uint4 SIMD_CFUNC simd_uint(simd_double4 __x); | ||
| 616 | static simd_uint8 SIMD_CFUNC simd_uint(simd_double8 __x); | ||
| 617 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_char2 __x); | ||
| 618 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_char3 __x); | ||
| 619 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_char4 __x); | ||
| 620 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_char8 __x); | ||
| 621 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_char16 __x); | ||
| 622 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_short2 __x); | ||
| 623 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x); | ||
| 624 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x); | ||
| 625 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x); | ||
| 626 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x); | ||
| 627 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x); | ||
| 628 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x); | ||
| 629 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x); | ||
| 630 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_int8 __x); | ||
| 631 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_int16 __x); | ||
| 632 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_float2 __x); | ||
| 633 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_float3 __x); | ||
| 634 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_float4 __x); | ||
| 635 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_float8 __x); | ||
| 636 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_float16 __x); | ||
| 637 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_long2 __x); | ||
| 638 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_long3 __x); | ||
| 639 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_long4 __x); | ||
| 640 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_long8 __x); | ||
| 641 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_double2 __x); | ||
| 642 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_double3 __x); | ||
| 643 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_double4 __x); | ||
| 644 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_double8 __x); | ||
| 645 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uchar2 __x); | ||
| 646 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uchar3 __x); | ||
| 647 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uchar4 __x); | ||
| 648 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uchar8 __x); | ||
| 649 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uchar16 __x); | ||
| 650 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ushort2 __x); | ||
| 651 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ushort3 __x); | ||
| 652 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ushort4 __x); | ||
| 653 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ushort8 __x); | ||
| 654 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_ushort16 __x); | ||
| 655 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uint2 __x); | ||
| 656 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uint3 __x); | ||
| 657 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uint4 __x); | ||
| 658 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uint8 __x); | ||
| 659 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uint16 __x); | ||
| 660 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x); | ||
| 661 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x); | ||
| 662 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x); | ||
| 663 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x); | ||
| 664 | #define vector_uint simd_uint | ||
| 665 | #define vector_uint_sat simd_uint_sat | ||
| 666 | |||
| 667 | static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x); | ||
| 668 | static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x); | ||
| 669 | static simd_float4 SIMD_CFUNC simd_float(simd_char4 __x); | ||
| 670 | static simd_float8 SIMD_CFUNC simd_float(simd_char8 __x); | ||
| 671 | static simd_float16 SIMD_CFUNC simd_float(simd_char16 __x); | ||
| 672 | static simd_float2 SIMD_CFUNC simd_float(simd_uchar2 __x); | ||
| 673 | static simd_float3 SIMD_CFUNC simd_float(simd_uchar3 __x); | ||
| 674 | static simd_float4 SIMD_CFUNC simd_float(simd_uchar4 __x); | ||
| 675 | static simd_float8 SIMD_CFUNC simd_float(simd_uchar8 __x); | ||
| 676 | static simd_float16 SIMD_CFUNC simd_float(simd_uchar16 __x); | ||
| 677 | static simd_float2 SIMD_CFUNC simd_float(simd_short2 __x); | ||
| 678 | static simd_float3 SIMD_CFUNC simd_float(simd_short3 __x); | ||
| 679 | static simd_float4 SIMD_CFUNC simd_float(simd_short4 __x); | ||
| 680 | static simd_float8 SIMD_CFUNC simd_float(simd_short8 __x); | ||
| 681 | static simd_float16 SIMD_CFUNC simd_float(simd_short16 __x); | ||
| 682 | static simd_float2 SIMD_CFUNC simd_float(simd_ushort2 __x); | ||
| 683 | static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x); | ||
| 684 | static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x); | ||
| 685 | static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x); | ||
| 686 | static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x); | ||
| 687 | static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x); | ||
| 688 | static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x); | ||
| 689 | static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x); | ||
| 690 | static simd_float8 SIMD_CFUNC simd_float(simd_int8 __x); | ||
| 691 | static simd_float16 SIMD_CFUNC simd_float(simd_int16 __x); | ||
| 692 | static simd_float2 SIMD_CFUNC simd_float(simd_uint2 __x); | ||
| 693 | static simd_float3 SIMD_CFUNC simd_float(simd_uint3 __x); | ||
| 694 | static simd_float4 SIMD_CFUNC simd_float(simd_uint4 __x); | ||
| 695 | static simd_float8 SIMD_CFUNC simd_float(simd_uint8 __x); | ||
| 696 | static simd_float16 SIMD_CFUNC simd_float(simd_uint16 __x); | ||
| 697 | static simd_float2 SIMD_CFUNC simd_float(simd_float2 __x); | ||
| 698 | static simd_float3 SIMD_CFUNC simd_float(simd_float3 __x); | ||
| 699 | static simd_float4 SIMD_CFUNC simd_float(simd_float4 __x); | ||
| 700 | static simd_float8 SIMD_CFUNC simd_float(simd_float8 __x); | ||
| 701 | static simd_float16 SIMD_CFUNC simd_float(simd_float16 __x); | ||
| 702 | static simd_float2 SIMD_CFUNC simd_float(simd_long2 __x); | ||
| 703 | static simd_float3 SIMD_CFUNC simd_float(simd_long3 __x); | ||
| 704 | static simd_float4 SIMD_CFUNC simd_float(simd_long4 __x); | ||
| 705 | static simd_float8 SIMD_CFUNC simd_float(simd_long8 __x); | ||
| 706 | static simd_float2 SIMD_CFUNC simd_float(simd_ulong2 __x); | ||
| 707 | static simd_float3 SIMD_CFUNC simd_float(simd_ulong3 __x); | ||
| 708 | static simd_float4 SIMD_CFUNC simd_float(simd_ulong4 __x); | ||
| 709 | static simd_float8 SIMD_CFUNC simd_float(simd_ulong8 __x); | ||
| 710 | static simd_float2 SIMD_CFUNC simd_float(simd_double2 __x); | ||
| 711 | static simd_float3 SIMD_CFUNC simd_float(simd_double3 __x); | ||
| 712 | static simd_float4 SIMD_CFUNC simd_float(simd_double4 __x); | ||
| 713 | static simd_float8 SIMD_CFUNC simd_float(simd_double8 __x); | ||
| 714 | #define vector_float simd_float | ||
| 715 | |||
| 716 | static simd_long2 SIMD_CFUNC simd_long(simd_char2 __x); | ||
| 717 | static simd_long3 SIMD_CFUNC simd_long(simd_char3 __x); | ||
| 718 | static simd_long4 SIMD_CFUNC simd_long(simd_char4 __x); | ||
| 719 | static simd_long8 SIMD_CFUNC simd_long(simd_char8 __x); | ||
| 720 | static simd_long2 SIMD_CFUNC simd_long(simd_uchar2 __x); | ||
| 721 | static simd_long3 SIMD_CFUNC simd_long(simd_uchar3 __x); | ||
| 722 | static simd_long4 SIMD_CFUNC simd_long(simd_uchar4 __x); | ||
| 723 | static simd_long8 SIMD_CFUNC simd_long(simd_uchar8 __x); | ||
| 724 | static simd_long2 SIMD_CFUNC simd_long(simd_short2 __x); | ||
| 725 | static simd_long3 SIMD_CFUNC simd_long(simd_short3 __x); | ||
| 726 | static simd_long4 SIMD_CFUNC simd_long(simd_short4 __x); | ||
| 727 | static simd_long8 SIMD_CFUNC simd_long(simd_short8 __x); | ||
| 728 | static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x); | ||
| 729 | static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x); | ||
| 730 | static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x); | ||
| 731 | static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x); | ||
| 732 | static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x); | ||
| 733 | static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x); | ||
| 734 | static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x); | ||
| 735 | static simd_long8 SIMD_CFUNC simd_long(simd_int8 __x); | ||
| 736 | static simd_long2 SIMD_CFUNC simd_long(simd_uint2 __x); | ||
| 737 | static simd_long3 SIMD_CFUNC simd_long(simd_uint3 __x); | ||
| 738 | static simd_long4 SIMD_CFUNC simd_long(simd_uint4 __x); | ||
| 739 | static simd_long8 SIMD_CFUNC simd_long(simd_uint8 __x); | ||
| 740 | static simd_long2 SIMD_CFUNC simd_long(simd_float2 __x); | ||
| 741 | static simd_long3 SIMD_CFUNC simd_long(simd_float3 __x); | ||
| 742 | static simd_long4 SIMD_CFUNC simd_long(simd_float4 __x); | ||
| 743 | static simd_long8 SIMD_CFUNC simd_long(simd_float8 __x); | ||
| 744 | static simd_long2 SIMD_CFUNC simd_long(simd_long2 __x); | ||
| 745 | static simd_long3 SIMD_CFUNC simd_long(simd_long3 __x); | ||
| 746 | static simd_long4 SIMD_CFUNC simd_long(simd_long4 __x); | ||
| 747 | static simd_long8 SIMD_CFUNC simd_long(simd_long8 __x); | ||
| 748 | static simd_long2 SIMD_CFUNC simd_long(simd_ulong2 __x); | ||
| 749 | static simd_long3 SIMD_CFUNC simd_long(simd_ulong3 __x); | ||
| 750 | static simd_long4 SIMD_CFUNC simd_long(simd_ulong4 __x); | ||
| 751 | static simd_long8 SIMD_CFUNC simd_long(simd_ulong8 __x); | ||
| 752 | static simd_long2 SIMD_CFUNC simd_long(simd_double2 __x); | ||
| 753 | static simd_long3 SIMD_CFUNC simd_long(simd_double3 __x); | ||
| 754 | static simd_long4 SIMD_CFUNC simd_long(simd_double4 __x); | ||
| 755 | static simd_long8 SIMD_CFUNC simd_long(simd_double8 __x); | ||
| 756 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_char2 __x); | ||
| 757 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_char3 __x); | ||
| 758 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_char4 __x); | ||
| 759 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_char8 __x); | ||
| 760 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x); | ||
| 761 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x); | ||
| 762 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x); | ||
| 763 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x); | ||
| 764 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x); | ||
| 765 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x); | ||
| 766 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x); | ||
| 767 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_int8 __x); | ||
| 768 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_float2 __x); | ||
| 769 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_float3 __x); | ||
| 770 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_float4 __x); | ||
| 771 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_float8 __x); | ||
| 772 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_long2 __x); | ||
| 773 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_long3 __x); | ||
| 774 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_long4 __x); | ||
| 775 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_long8 __x); | ||
| 776 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_double2 __x); | ||
| 777 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_double3 __x); | ||
| 778 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_double4 __x); | ||
| 779 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_double8 __x); | ||
| 780 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_uchar2 __x); | ||
| 781 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_uchar3 __x); | ||
| 782 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_uchar4 __x); | ||
| 783 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_uchar8 __x); | ||
| 784 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_ushort2 __x); | ||
| 785 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_ushort3 __x); | ||
| 786 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_ushort4 __x); | ||
| 787 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_ushort8 __x); | ||
| 788 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_uint2 __x); | ||
| 789 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_uint3 __x); | ||
| 790 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_uint4 __x); | ||
| 791 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_uint8 __x); | ||
| 792 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_ulong2 __x); | ||
| 793 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_ulong3 __x); | ||
| 794 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_ulong4 __x); | ||
| 795 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x); | ||
| 796 | static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x); | ||
| 797 | static simd_long3 SIMD_CFUNC simd_long_rte(simd_double3 __x); | ||
| 798 | static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x); | ||
| 799 | static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x); | ||
| 800 | #define vector_long simd_long | ||
| 801 | #define vector_long_sat simd_long_sat | ||
| 802 | |||
| 803 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_char2 __x); | ||
| 804 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_char3 __x); | ||
| 805 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_char4 __x); | ||
| 806 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_char8 __x); | ||
| 807 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uchar2 __x); | ||
| 808 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uchar3 __x); | ||
| 809 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uchar4 __x); | ||
| 810 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uchar8 __x); | ||
| 811 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_short2 __x); | ||
| 812 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_short3 __x); | ||
| 813 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_short4 __x); | ||
| 814 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_short8 __x); | ||
| 815 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x); | ||
| 816 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x); | ||
| 817 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x); | ||
| 818 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x); | ||
| 819 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x); | ||
| 820 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x); | ||
| 821 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x); | ||
| 822 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_int8 __x); | ||
| 823 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uint2 __x); | ||
| 824 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uint3 __x); | ||
| 825 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uint4 __x); | ||
| 826 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uint8 __x); | ||
| 827 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_float2 __x); | ||
| 828 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_float3 __x); | ||
| 829 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_float4 __x); | ||
| 830 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_float8 __x); | ||
| 831 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_long2 __x); | ||
| 832 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_long3 __x); | ||
| 833 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_long4 __x); | ||
| 834 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_long8 __x); | ||
| 835 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ulong2 __x); | ||
| 836 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ulong3 __x); | ||
| 837 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ulong4 __x); | ||
| 838 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ulong8 __x); | ||
| 839 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_double2 __x); | ||
| 840 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_double3 __x); | ||
| 841 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_double4 __x); | ||
| 842 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_double8 __x); | ||
| 843 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_char2 __x); | ||
| 844 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_char3 __x); | ||
| 845 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_char4 __x); | ||
| 846 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_char8 __x); | ||
| 847 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x); | ||
| 848 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x); | ||
| 849 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x); | ||
| 850 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x); | ||
| 851 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x); | ||
| 852 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x); | ||
| 853 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x); | ||
| 854 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_int8 __x); | ||
| 855 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_float2 __x); | ||
| 856 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_float3 __x); | ||
| 857 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_float4 __x); | ||
| 858 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_float8 __x); | ||
| 859 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_long2 __x); | ||
| 860 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_long3 __x); | ||
| 861 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_long4 __x); | ||
| 862 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_long8 __x); | ||
| 863 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_double2 __x); | ||
| 864 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_double3 __x); | ||
| 865 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_double4 __x); | ||
| 866 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_double8 __x); | ||
| 867 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uchar2 __x); | ||
| 868 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uchar3 __x); | ||
| 869 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uchar4 __x); | ||
| 870 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uchar8 __x); | ||
| 871 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ushort2 __x); | ||
| 872 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ushort3 __x); | ||
| 873 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ushort4 __x); | ||
| 874 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ushort8 __x); | ||
| 875 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uint2 __x); | ||
| 876 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uint3 __x); | ||
| 877 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uint4 __x); | ||
| 878 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uint8 __x); | ||
| 879 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x); | ||
| 880 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x); | ||
| 881 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x); | ||
| 882 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x); | ||
| 883 | #define vector_ulong simd_ulong | ||
| 884 | #define vector_ulong_sat simd_ulong_sat | ||
| 885 | |||
| 886 | static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x); | ||
| 887 | static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x); | ||
| 888 | static simd_double4 SIMD_CFUNC simd_double(simd_char4 __x); | ||
| 889 | static simd_double8 SIMD_CFUNC simd_double(simd_char8 __x); | ||
| 890 | static simd_double2 SIMD_CFUNC simd_double(simd_uchar2 __x); | ||
| 891 | static simd_double3 SIMD_CFUNC simd_double(simd_uchar3 __x); | ||
| 892 | static simd_double4 SIMD_CFUNC simd_double(simd_uchar4 __x); | ||
| 893 | static simd_double8 SIMD_CFUNC simd_double(simd_uchar8 __x); | ||
| 894 | static simd_double2 SIMD_CFUNC simd_double(simd_short2 __x); | ||
| 895 | static simd_double3 SIMD_CFUNC simd_double(simd_short3 __x); | ||
| 896 | static simd_double4 SIMD_CFUNC simd_double(simd_short4 __x); | ||
| 897 | static simd_double8 SIMD_CFUNC simd_double(simd_short8 __x); | ||
| 898 | static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x); | ||
| 899 | static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x); | ||
| 900 | static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x); | ||
| 901 | static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x); | ||
| 902 | static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x); | ||
| 903 | static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x); | ||
| 904 | static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x); | ||
| 905 | static simd_double8 SIMD_CFUNC simd_double(simd_int8 __x); | ||
| 906 | static simd_double2 SIMD_CFUNC simd_double(simd_uint2 __x); | ||
| 907 | static simd_double3 SIMD_CFUNC simd_double(simd_uint3 __x); | ||
| 908 | static simd_double4 SIMD_CFUNC simd_double(simd_uint4 __x); | ||
| 909 | static simd_double8 SIMD_CFUNC simd_double(simd_uint8 __x); | ||
| 910 | static simd_double2 SIMD_CFUNC simd_double(simd_float2 __x); | ||
| 911 | static simd_double3 SIMD_CFUNC simd_double(simd_float3 __x); | ||
| 912 | static simd_double4 SIMD_CFUNC simd_double(simd_float4 __x); | ||
| 913 | static simd_double8 SIMD_CFUNC simd_double(simd_float8 __x); | ||
| 914 | static simd_double2 SIMD_CFUNC simd_double(simd_long2 __x); | ||
| 915 | static simd_double3 SIMD_CFUNC simd_double(simd_long3 __x); | ||
| 916 | static simd_double4 SIMD_CFUNC simd_double(simd_long4 __x); | ||
| 917 | static simd_double8 SIMD_CFUNC simd_double(simd_long8 __x); | ||
| 918 | static simd_double2 SIMD_CFUNC simd_double(simd_ulong2 __x); | ||
| 919 | static simd_double3 SIMD_CFUNC simd_double(simd_ulong3 __x); | ||
| 920 | static simd_double4 SIMD_CFUNC simd_double(simd_ulong4 __x); | ||
| 921 | static simd_double8 SIMD_CFUNC simd_double(simd_ulong8 __x); | ||
| 922 | static simd_double2 SIMD_CFUNC simd_double(simd_double2 __x); | ||
| 923 | static simd_double3 SIMD_CFUNC simd_double(simd_double3 __x); | ||
| 924 | static simd_double4 SIMD_CFUNC simd_double(simd_double4 __x); | ||
| 925 | static simd_double8 SIMD_CFUNC simd_double(simd_double8 __x); | ||
| 926 | #define vector_double simd_double | ||
| 927 | |||
| 928 | static simd_char2 SIMD_CFUNC vector2(char __x, char __y) { return ( simd_char2){__x, __y}; } | ||
| 929 | static simd_uchar2 SIMD_CFUNC vector2(unsigned char __x, unsigned char __y) { return ( simd_uchar2){__x, __y}; } | ||
| 930 | static simd_short2 SIMD_CFUNC vector2(short __x, short __y) { return ( simd_short2){__x, __y}; } | ||
| 931 | static simd_ushort2 SIMD_CFUNC vector2(unsigned short __x, unsigned short __y) { return (simd_ushort2){__x, __y}; } | ||
| 932 | static simd_int2 SIMD_CFUNC vector2(int __x, int __y) { return ( simd_int2){__x, __y}; } | ||
| 933 | static simd_uint2 SIMD_CFUNC vector2(unsigned int __x, unsigned int __y) { return ( simd_uint2){__x, __y}; } | ||
| 934 | static simd_float2 SIMD_CFUNC vector2(float __x, float __y) { return ( simd_float2){__x, __y}; } | ||
| 935 | static simd_long2 SIMD_CFUNC vector2(simd_long1 __x, simd_long1 __y) { return ( simd_long2){__x, __y}; } | ||
| 936 | static simd_ulong2 SIMD_CFUNC vector2(simd_ulong1 __x, simd_ulong1 __y) { return ( simd_ulong2){__x, __y}; } | ||
| 937 | static simd_double2 SIMD_CFUNC vector2(double __x, double __y) { return (simd_double2){__x, __y}; } | ||
| 938 | |||
| 939 | static simd_char3 SIMD_CFUNC vector3(char __x, char __y, char __z) { return ( simd_char3){__x, __y, __z}; } | ||
| 940 | static simd_uchar3 SIMD_CFUNC vector3(unsigned char __x, unsigned char __y, unsigned char __z) { return ( simd_uchar3){__x, __y, __z}; } | ||
| 941 | static simd_short3 SIMD_CFUNC vector3(short __x, short __y, short __z) { return ( simd_short3){__x, __y, __z}; } | ||
| 942 | static simd_ushort3 SIMD_CFUNC vector3(unsigned short __x, unsigned short __y, unsigned short __z) { return (simd_ushort3){__x, __y, __z}; } | ||
| 943 | static simd_int3 SIMD_CFUNC vector3(int __x, int __y, int __z) { return ( simd_int3){__x, __y, __z}; } | ||
| 944 | static simd_uint3 SIMD_CFUNC vector3(unsigned int __x, unsigned int __y, unsigned int __z) { return ( simd_uint3){__x, __y, __z}; } | ||
| 945 | static simd_float3 SIMD_CFUNC vector3(float __x, float __y, float __z) { return ( simd_float3){__x, __y, __z}; } | ||
| 946 | static simd_long3 SIMD_CFUNC vector3(simd_long1 __x, simd_long1 __y, simd_long1 __z) { return ( simd_long3){__x, __y, __z}; } | ||
| 947 | static simd_ulong3 SIMD_CFUNC vector3(simd_ulong1 __x, simd_ulong1 __y, simd_ulong1 __z) { return ( simd_ulong3){__x, __y, __z}; } | ||
| 948 | static simd_double3 SIMD_CFUNC vector3(double __x, double __y, double __z) { return (simd_double3){__x, __y, __z}; } | ||
| 949 | |||
| 950 | static simd_char3 SIMD_CFUNC vector3(simd_char2 __xy, char __z) { simd_char3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 951 | static simd_uchar3 SIMD_CFUNC vector3(simd_uchar2 __xy, unsigned char __z) { simd_uchar3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 952 | static simd_short3 SIMD_CFUNC vector3(simd_short2 __xy, short __z) { simd_short3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 953 | static simd_ushort3 SIMD_CFUNC vector3(simd_ushort2 __xy, unsigned short __z) { simd_ushort3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 954 | static simd_int3 SIMD_CFUNC vector3(simd_int2 __xy, int __z) { simd_int3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 955 | static simd_uint3 SIMD_CFUNC vector3(simd_uint2 __xy, unsigned int __z) { simd_uint3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 956 | static simd_float3 SIMD_CFUNC vector3(simd_float2 __xy, float __z) { simd_float3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 957 | static simd_long3 SIMD_CFUNC vector3(simd_long2 __xy, simd_long1 __z) { simd_long3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 958 | static simd_ulong3 SIMD_CFUNC vector3(simd_ulong2 __xy, simd_ulong1 __z) { simd_ulong3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 959 | static simd_double3 SIMD_CFUNC vector3(simd_double2 __xy, double __z) { simd_double3 __r; __r.xy = __xy; __r.z = __z; return __r; } | ||
| 960 | |||
| 961 | static simd_char4 SIMD_CFUNC vector4(char __x, char __y, char __z, char __w) { return ( simd_char4){__x, __y, __z, __w}; } | ||
| 962 | static simd_uchar4 SIMD_CFUNC vector4(unsigned char __x, unsigned char __y, unsigned char __z, unsigned char __w) { return ( simd_uchar4){__x, __y, __z, __w}; } | ||
| 963 | static simd_short4 SIMD_CFUNC vector4(short __x, short __y, short __z, short __w) { return ( simd_short4){__x, __y, __z, __w}; } | ||
| 964 | static simd_ushort4 SIMD_CFUNC vector4(unsigned short __x, unsigned short __y, unsigned short __z, unsigned short __w) { return (simd_ushort4){__x, __y, __z, __w}; } | ||
| 965 | static simd_int4 SIMD_CFUNC vector4(int __x, int __y, int __z, int __w) { return ( simd_int4){__x, __y, __z, __w}; } | ||
| 966 | static simd_uint4 SIMD_CFUNC vector4(unsigned int __x, unsigned int __y, unsigned int __z, unsigned int __w) { return ( simd_uint4){__x, __y, __z, __w}; } | ||
| 967 | static simd_float4 SIMD_CFUNC vector4(float __x, float __y, float __z, float __w) { return ( simd_float4){__x, __y, __z, __w}; } | ||
| 968 | static simd_long4 SIMD_CFUNC vector4(simd_long1 __x, simd_long1 __y, simd_long1 __z, simd_long1 __w) { return ( simd_long4){__x, __y, __z, __w}; } | ||
| 969 | static simd_ulong4 SIMD_CFUNC vector4(simd_ulong1 __x, simd_ulong1 __y, simd_ulong1 __z, simd_ulong1 __w) { return ( simd_ulong4){__x, __y, __z, __w}; } | ||
| 970 | static simd_double4 SIMD_CFUNC vector4(double __x, double __y, double __z, double __w) { return (simd_double4){__x, __y, __z, __w}; } | ||
| 971 | |||
| 972 | static simd_char4 SIMD_CFUNC vector4(simd_char2 __xy, simd_char2 __zw) { simd_char4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 973 | static simd_uchar4 SIMD_CFUNC vector4(simd_uchar2 __xy, simd_uchar2 __zw) { simd_uchar4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 974 | static simd_short4 SIMD_CFUNC vector4(simd_short2 __xy, simd_short2 __zw) { simd_short4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 975 | static simd_ushort4 SIMD_CFUNC vector4(simd_ushort2 __xy, simd_ushort2 __zw) { simd_ushort4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 976 | static simd_int4 SIMD_CFUNC vector4(simd_int2 __xy, simd_int2 __zw) { simd_int4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 977 | static simd_uint4 SIMD_CFUNC vector4(simd_uint2 __xy, simd_uint2 __zw) { simd_uint4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 978 | static simd_float4 SIMD_CFUNC vector4(simd_float2 __xy, simd_float2 __zw) { simd_float4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 979 | static simd_long4 SIMD_CFUNC vector4(simd_long2 __xy, simd_long2 __zw) { simd_long4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 980 | static simd_ulong4 SIMD_CFUNC vector4(simd_ulong2 __xy, simd_ulong2 __zw) { simd_ulong4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 981 | static simd_double4 SIMD_CFUNC vector4(simd_double2 __xy, simd_double2 __zw) { simd_double4 __r; __r.xy = __xy; __r.zw = __zw; return __r; } | ||
| 982 | |||
| 983 | static simd_char4 SIMD_CFUNC vector4(simd_char3 __xyz, char __w) { simd_char4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 984 | static simd_uchar4 SIMD_CFUNC vector4(simd_uchar3 __xyz, unsigned char __w) { simd_uchar4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 985 | static simd_short4 SIMD_CFUNC vector4(simd_short3 __xyz, short __w) { simd_short4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 986 | static simd_ushort4 SIMD_CFUNC vector4(simd_ushort3 __xyz, unsigned short __w) { simd_ushort4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 987 | static simd_int4 SIMD_CFUNC vector4(simd_int3 __xyz, int __w) { simd_int4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 988 | static simd_uint4 SIMD_CFUNC vector4(simd_uint3 __xyz, unsigned int __w) { simd_uint4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 989 | static simd_float4 SIMD_CFUNC vector4(simd_float3 __xyz, float __w) { simd_float4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 990 | static simd_long4 SIMD_CFUNC vector4(simd_long3 __xyz, simd_long1 __w) { simd_long4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 991 | static simd_ulong4 SIMD_CFUNC vector4(simd_ulong3 __xyz, simd_ulong1 __w) { simd_ulong4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 992 | static simd_double4 SIMD_CFUNC vector4(simd_double3 __xyz, double __w) { simd_double4 __r; __r.xyz = __xyz; __r.w = __w; return __r; } | ||
| 993 | |||
| 994 | static simd_char8 SIMD_CFUNC vector8(simd_char4 __lo, simd_char4 __hi) { simd_char8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 995 | static simd_uchar8 SIMD_CFUNC vector8(simd_uchar4 __lo, simd_uchar4 __hi) { simd_uchar8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 996 | static simd_short8 SIMD_CFUNC vector8(simd_short4 __lo, simd_short4 __hi) { simd_short8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 997 | static simd_ushort8 SIMD_CFUNC vector8(simd_ushort4 __lo, simd_ushort4 __hi) { simd_ushort8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 998 | static simd_int8 SIMD_CFUNC vector8(simd_int4 __lo, simd_int4 __hi) { simd_int8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 999 | static simd_uint8 SIMD_CFUNC vector8(simd_uint4 __lo, simd_uint4 __hi) { simd_uint8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1000 | static simd_float8 SIMD_CFUNC vector8(simd_float4 __lo, simd_float4 __hi) { simd_float8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1001 | static simd_long8 SIMD_CFUNC vector8(simd_long4 __lo, simd_long4 __hi) { simd_long8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1002 | static simd_ulong8 SIMD_CFUNC vector8(simd_ulong4 __lo, simd_ulong4 __hi) { simd_ulong8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1003 | static simd_double8 SIMD_CFUNC vector8(simd_double4 __lo, simd_double4 __hi) { simd_double8 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1004 | |||
| 1005 | static simd_char16 SIMD_CFUNC vector16(simd_char8 __lo, simd_char8 __hi) { simd_char16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1006 | static simd_uchar16 SIMD_CFUNC vector16(simd_uchar8 __lo, simd_uchar8 __hi) { simd_uchar16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1007 | static simd_short16 SIMD_CFUNC vector16(simd_short8 __lo, simd_short8 __hi) { simd_short16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1008 | static simd_ushort16 SIMD_CFUNC vector16(simd_ushort8 __lo, simd_ushort8 __hi) { simd_ushort16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1009 | static simd_int16 SIMD_CFUNC vector16(simd_int8 __lo, simd_int8 __hi) { simd_int16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1010 | static simd_uint16 SIMD_CFUNC vector16(simd_uint8 __lo, simd_uint8 __hi) { simd_uint16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1011 | static simd_float16 SIMD_CFUNC vector16(simd_float8 __lo, simd_float8 __hi) { simd_float16 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1012 | |||
| 1013 | static simd_char32 SIMD_CFUNC vector32(simd_char16 __lo, simd_char16 __hi) { simd_char32 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1014 | static simd_uchar32 SIMD_CFUNC vector32(simd_uchar16 __lo, simd_uchar16 __hi) { simd_uchar32 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1015 | static simd_short32 SIMD_CFUNC vector32(simd_short16 __lo, simd_short16 __hi) { simd_short32 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1016 | static simd_ushort32 SIMD_CFUNC vector32(simd_ushort16 __lo, simd_ushort16 __hi) { simd_ushort32 __r; __r.lo = __lo; __r.hi = __hi; return __r; } | ||
| 1017 | |||
| 1018 | #pragma mark - Implementation | ||
| 1019 | |||
| 1020 | static simd_char2 SIMD_CFUNC simd_char(simd_char2 __x) { return __x; } | ||
| 1021 | static simd_char3 SIMD_CFUNC simd_char(simd_char3 __x) { return __x; } | ||
| 1022 | static simd_char4 SIMD_CFUNC simd_char(simd_char4 __x) { return __x; } | ||
| 1023 | static simd_char8 SIMD_CFUNC simd_char(simd_char8 __x) { return __x; } | ||
| 1024 | static simd_char16 SIMD_CFUNC simd_char(simd_char16 __x) { return __x; } | ||
| 1025 | static simd_char32 SIMD_CFUNC simd_char(simd_char32 __x) { return __x; } | ||
| 1026 | static simd_char2 SIMD_CFUNC simd_char(simd_uchar2 __x) { return (simd_char2)__x; } | ||
| 1027 | static simd_char3 SIMD_CFUNC simd_char(simd_uchar3 __x) { return (simd_char3)__x; } | ||
| 1028 | static simd_char4 SIMD_CFUNC simd_char(simd_uchar4 __x) { return (simd_char4)__x; } | ||
| 1029 | static simd_char8 SIMD_CFUNC simd_char(simd_uchar8 __x) { return (simd_char8)__x; } | ||
| 1030 | static simd_char16 SIMD_CFUNC simd_char(simd_uchar16 __x) { return (simd_char16)__x; } | ||
| 1031 | static simd_char32 SIMD_CFUNC simd_char(simd_uchar32 __x) { return (simd_char32)__x; } | ||
| 1032 | static simd_char2 SIMD_CFUNC simd_char(simd_short2 __x) { return __builtin_convertvector(__x & 0xff, simd_char2); } | ||
| 1033 | static simd_char3 SIMD_CFUNC simd_char(simd_short3 __x) { return __builtin_convertvector(__x & 0xff, simd_char3); } | ||
| 1034 | static simd_char4 SIMD_CFUNC simd_char(simd_short4 __x) { return __builtin_convertvector(__x & 0xff, simd_char4); } | ||
| 1035 | static simd_char8 SIMD_CFUNC simd_char(simd_short8 __x) { return __builtin_convertvector(__x & 0xff, simd_char8); } | ||
| 1036 | static simd_char16 SIMD_CFUNC simd_char(simd_short16 __x) { return __builtin_convertvector(__x & 0xff, simd_char16); } | ||
| 1037 | static simd_char32 SIMD_CFUNC simd_char(simd_short32 __x) { return __builtin_convertvector(__x & 0xff, simd_char32); } | ||
| 1038 | static simd_char2 SIMD_CFUNC simd_char(simd_ushort2 __x) { return simd_char(simd_short(__x)); } | ||
| 1039 | static simd_char3 SIMD_CFUNC simd_char(simd_ushort3 __x) { return simd_char(simd_short(__x)); } | ||
| 1040 | static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x) { return simd_char(simd_short(__x)); } | ||
| 1041 | static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x) { return simd_char(simd_short(__x)); } | ||
| 1042 | static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x) { return simd_char(simd_short(__x)); } | ||
| 1043 | static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x) { return simd_char(simd_short(__x)); } | ||
| 1044 | static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x) { return simd_char(simd_short(__x)); } | ||
| 1045 | static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x) { return simd_char(simd_short(__x)); } | ||
| 1046 | static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x) { return simd_char(simd_short(__x)); } | ||
| 1047 | static simd_char8 SIMD_CFUNC simd_char(simd_int8 __x) { return simd_char(simd_short(__x)); } | ||
| 1048 | static simd_char16 SIMD_CFUNC simd_char(simd_int16 __x) { return simd_char(simd_short(__x)); } | ||
| 1049 | static simd_char2 SIMD_CFUNC simd_char(simd_uint2 __x) { return simd_char(simd_short(__x)); } | ||
| 1050 | static simd_char3 SIMD_CFUNC simd_char(simd_uint3 __x) { return simd_char(simd_short(__x)); } | ||
| 1051 | static simd_char4 SIMD_CFUNC simd_char(simd_uint4 __x) { return simd_char(simd_short(__x)); } | ||
| 1052 | static simd_char8 SIMD_CFUNC simd_char(simd_uint8 __x) { return simd_char(simd_short(__x)); } | ||
| 1053 | static simd_char16 SIMD_CFUNC simd_char(simd_uint16 __x) { return simd_char(simd_short(__x)); } | ||
| 1054 | static simd_char2 SIMD_CFUNC simd_char(simd_float2 __x) { return simd_char(simd_short(__x)); } | ||
| 1055 | static simd_char3 SIMD_CFUNC simd_char(simd_float3 __x) { return simd_char(simd_short(__x)); } | ||
| 1056 | static simd_char4 SIMD_CFUNC simd_char(simd_float4 __x) { return simd_char(simd_short(__x)); } | ||
| 1057 | static simd_char8 SIMD_CFUNC simd_char(simd_float8 __x) { return simd_char(simd_short(__x)); } | ||
| 1058 | static simd_char16 SIMD_CFUNC simd_char(simd_float16 __x) { return simd_char(simd_short(__x)); } | ||
| 1059 | static simd_char2 SIMD_CFUNC simd_char(simd_long2 __x) { return simd_char(simd_short(__x)); } | ||
| 1060 | static simd_char3 SIMD_CFUNC simd_char(simd_long3 __x) { return simd_char(simd_short(__x)); } | ||
| 1061 | static simd_char4 SIMD_CFUNC simd_char(simd_long4 __x) { return simd_char(simd_short(__x)); } | ||
| 1062 | static simd_char8 SIMD_CFUNC simd_char(simd_long8 __x) { return simd_char(simd_short(__x)); } | ||
| 1063 | static simd_char2 SIMD_CFUNC simd_char(simd_ulong2 __x) { return simd_char(simd_short(__x)); } | ||
| 1064 | static simd_char3 SIMD_CFUNC simd_char(simd_ulong3 __x) { return simd_char(simd_short(__x)); } | ||
| 1065 | static simd_char4 SIMD_CFUNC simd_char(simd_ulong4 __x) { return simd_char(simd_short(__x)); } | ||
| 1066 | static simd_char8 SIMD_CFUNC simd_char(simd_ulong8 __x) { return simd_char(simd_short(__x)); } | ||
| 1067 | static simd_char2 SIMD_CFUNC simd_char(simd_double2 __x) { return simd_char(simd_short(__x)); } | ||
| 1068 | static simd_char3 SIMD_CFUNC simd_char(simd_double3 __x) { return simd_char(simd_short(__x)); } | ||
| 1069 | static simd_char4 SIMD_CFUNC simd_char(simd_double4 __x) { return simd_char(simd_short(__x)); } | ||
| 1070 | static simd_char8 SIMD_CFUNC simd_char(simd_double8 __x) { return simd_char(simd_short(__x)); } | ||
| 1071 | |||
| 1072 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_char2 __x) { return __x; } | ||
| 1073 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_char3 __x) { return __x; } | ||
| 1074 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_char4 __x) { return __x; } | ||
| 1075 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_char8 __x) { return __x; } | ||
| 1076 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_char16 __x) { return __x; } | ||
| 1077 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_char32 __x) { return __x; } | ||
| 1078 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_short2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1079 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_short3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1080 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1081 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1082 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1083 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1084 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1085 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1086 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1087 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_int8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1088 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_int16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1089 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_float2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1090 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_float3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1091 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_float4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1092 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_float8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1093 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_float16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1094 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_long2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1095 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_long3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1096 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_long4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1097 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_long8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1098 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_double2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1099 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_double3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1100 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_double4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1101 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_double8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); } | ||
| 1102 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_uchar2 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1103 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_uchar3 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1104 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_uchar4 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1105 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_uchar8 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1106 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_uchar16 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1107 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_uchar32 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1108 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_ushort2 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1109 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_ushort3 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1110 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_ushort4 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1111 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_ushort8 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1112 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_ushort16 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1113 | static simd_char32 SIMD_CFUNC simd_char_sat(simd_ushort32 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1114 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_uint2 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1115 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_uint3 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1116 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_uint4 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1117 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_uint8 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1118 | static simd_char16 SIMD_CFUNC simd_char_sat(simd_uint16 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1119 | static simd_char2 SIMD_CFUNC simd_char_sat(simd_ulong2 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1120 | static simd_char3 SIMD_CFUNC simd_char_sat(simd_ulong3 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1121 | static simd_char4 SIMD_CFUNC simd_char_sat(simd_ulong4 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1122 | static simd_char8 SIMD_CFUNC simd_char_sat(simd_ulong8 __x) { return simd_char(simd_min(__x,0x7f)); } | ||
| 1123 | |||
| 1124 | |||
| 1125 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_char2 __x) { return (simd_uchar2)__x; } | ||
| 1126 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_char3 __x) { return (simd_uchar3)__x; } | ||
| 1127 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_char4 __x) { return (simd_uchar4)__x; } | ||
| 1128 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_char8 __x) { return (simd_uchar8)__x; } | ||
| 1129 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_char16 __x) { return (simd_uchar16)__x; } | ||
| 1130 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_char32 __x) { return (simd_uchar32)__x; } | ||
| 1131 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uchar2 __x) { return __x; } | ||
| 1132 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uchar3 __x) { return __x; } | ||
| 1133 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uchar4 __x) { return __x; } | ||
| 1134 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uchar8 __x) { return __x; } | ||
| 1135 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uchar16 __x) { return __x; } | ||
| 1136 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_uchar32 __x) { return __x; } | ||
| 1137 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_short2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1138 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_short3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1139 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_short4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1140 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_short8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1141 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_short16 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1142 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_short32 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1143 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ushort2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1144 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ushort3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1145 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1146 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1147 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1148 | static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1149 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1150 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1151 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1152 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_int8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1153 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_int16 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1154 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uint2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1155 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uint3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1156 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uint4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1157 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uint8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1158 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uint16 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1159 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_float2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1160 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_float3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1161 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_float4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1162 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_float8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1163 | static simd_uchar16 SIMD_CFUNC simd_uchar(simd_float16 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1164 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_long2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1165 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_long3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1166 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_long4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1167 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_long8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1168 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ulong2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1169 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ulong3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1170 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ulong4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1171 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ulong8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1172 | static simd_uchar2 SIMD_CFUNC simd_uchar(simd_double2 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1173 | static simd_uchar3 SIMD_CFUNC simd_uchar(simd_double3 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1174 | static simd_uchar4 SIMD_CFUNC simd_uchar(simd_double4 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1175 | static simd_uchar8 SIMD_CFUNC simd_uchar(simd_double8 __x) { return simd_uchar(simd_char(__x)); } | ||
| 1176 | |||
| 1177 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_char2 __x) { return simd_uchar(simd_max(0,__x)); } | ||
| 1178 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_char3 __x) { return simd_uchar(simd_max(0,__x)); } | ||
| 1179 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_char4 __x) { return simd_uchar(simd_max(0,__x)); } | ||
| 1180 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_char8 __x) { return simd_uchar(simd_max(0,__x)); } | ||
| 1181 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_char16 __x) { return simd_uchar(simd_max(0,__x)); } | ||
| 1182 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_char32 __x) { return simd_uchar(simd_max(0,__x)); } | ||
| 1183 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_short2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1184 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_short3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1185 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1186 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1187 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1188 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1189 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1190 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1191 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1192 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_int8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1193 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_int16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1194 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_float2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1195 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_float3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1196 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_float4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1197 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_float8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1198 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_float16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1199 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_long2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1200 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_long3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1201 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_long4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1202 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_long8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1203 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_double2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1204 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_double3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1205 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_double4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1206 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_double8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); } | ||
| 1207 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uchar2 __x) { return __x; } | ||
| 1208 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uchar3 __x) { return __x; } | ||
| 1209 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uchar4 __x) { return __x; } | ||
| 1210 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uchar8 __x) { return __x; } | ||
| 1211 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uchar16 __x) { return __x; } | ||
| 1212 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_uchar32 __x) { return __x; } | ||
| 1213 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ushort2 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1214 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ushort3 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1215 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ushort4 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1216 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ushort8 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1217 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_ushort16 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1218 | static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_ushort32 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1219 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uint2 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1220 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uint3 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1221 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uint4 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1222 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uint8 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1223 | static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uint16 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1224 | static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ulong2 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1225 | static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ulong3 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1226 | static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ulong4 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1227 | static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ulong8 __x) { return simd_uchar(simd_min(__x,0xff)); } | ||
| 1228 | |||
| 1229 | |||
| 1230 | static simd_short2 SIMD_CFUNC simd_short(simd_char2 __x) { return __builtin_convertvector(__x, simd_short2); } | ||
| 1231 | static simd_short3 SIMD_CFUNC simd_short(simd_char3 __x) { return __builtin_convertvector(__x, simd_short3); } | ||
| 1232 | static simd_short4 SIMD_CFUNC simd_short(simd_char4 __x) { return __builtin_convertvector(__x, simd_short4); } | ||
| 1233 | static simd_short8 SIMD_CFUNC simd_short(simd_char8 __x) { return __builtin_convertvector(__x, simd_short8); } | ||
| 1234 | static simd_short16 SIMD_CFUNC simd_short(simd_char16 __x) { return __builtin_convertvector(__x, simd_short16); } | ||
| 1235 | static simd_short32 SIMD_CFUNC simd_short(simd_char32 __x) { return __builtin_convertvector(__x, simd_short32); } | ||
| 1236 | static simd_short2 SIMD_CFUNC simd_short(simd_uchar2 __x) { return __builtin_convertvector(__x, simd_short2); } | ||
| 1237 | static simd_short3 SIMD_CFUNC simd_short(simd_uchar3 __x) { return __builtin_convertvector(__x, simd_short3); } | ||
| 1238 | static simd_short4 SIMD_CFUNC simd_short(simd_uchar4 __x) { return __builtin_convertvector(__x, simd_short4); } | ||
| 1239 | static simd_short8 SIMD_CFUNC simd_short(simd_uchar8 __x) { return __builtin_convertvector(__x, simd_short8); } | ||
| 1240 | static simd_short16 SIMD_CFUNC simd_short(simd_uchar16 __x) { return __builtin_convertvector(__x, simd_short16); } | ||
| 1241 | static simd_short32 SIMD_CFUNC simd_short(simd_uchar32 __x) { return __builtin_convertvector(__x, simd_short32); } | ||
| 1242 | static simd_short2 SIMD_CFUNC simd_short(simd_short2 __x) { return __x; } | ||
| 1243 | static simd_short3 SIMD_CFUNC simd_short(simd_short3 __x) { return __x; } | ||
| 1244 | static simd_short4 SIMD_CFUNC simd_short(simd_short4 __x) { return __x; } | ||
| 1245 | static simd_short8 SIMD_CFUNC simd_short(simd_short8 __x) { return __x; } | ||
| 1246 | static simd_short16 SIMD_CFUNC simd_short(simd_short16 __x) { return __x; } | ||
| 1247 | static simd_short32 SIMD_CFUNC simd_short(simd_short32 __x) { return __x; } | ||
| 1248 | static simd_short2 SIMD_CFUNC simd_short(simd_ushort2 __x) { return (simd_short2)__x; } | ||
| 1249 | static simd_short3 SIMD_CFUNC simd_short(simd_ushort3 __x) { return (simd_short3)__x; } | ||
| 1250 | static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x) { return (simd_short4)__x; } | ||
| 1251 | static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x) { return (simd_short8)__x; } | ||
| 1252 | static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x) { return (simd_short16)__x; } | ||
| 1253 | static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x) { return (simd_short32)__x; } | ||
| 1254 | static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x) { return __builtin_convertvector(__x & 0xffff, simd_short2); } | ||
| 1255 | static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x) { return __builtin_convertvector(__x & 0xffff, simd_short3); } | ||
| 1256 | static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x) { return __builtin_convertvector(__x & 0xffff, simd_short4); } | ||
| 1257 | static simd_short8 SIMD_CFUNC simd_short(simd_int8 __x) { return __builtin_convertvector(__x & 0xffff, simd_short8); } | ||
| 1258 | static simd_short16 SIMD_CFUNC simd_short(simd_int16 __x) { return __builtin_convertvector(__x & 0xffff, simd_short16); } | ||
| 1259 | static simd_short2 SIMD_CFUNC simd_short(simd_uint2 __x) { return simd_short(simd_int(__x)); } | ||
| 1260 | static simd_short3 SIMD_CFUNC simd_short(simd_uint3 __x) { return simd_short(simd_int(__x)); } | ||
| 1261 | static simd_short4 SIMD_CFUNC simd_short(simd_uint4 __x) { return simd_short(simd_int(__x)); } | ||
| 1262 | static simd_short8 SIMD_CFUNC simd_short(simd_uint8 __x) { return simd_short(simd_int(__x)); } | ||
| 1263 | static simd_short16 SIMD_CFUNC simd_short(simd_uint16 __x) { return simd_short(simd_int(__x)); } | ||
| 1264 | static simd_short2 SIMD_CFUNC simd_short(simd_float2 __x) { return simd_short(simd_int(__x)); } | ||
| 1265 | static simd_short3 SIMD_CFUNC simd_short(simd_float3 __x) { return simd_short(simd_int(__x)); } | ||
| 1266 | static simd_short4 SIMD_CFUNC simd_short(simd_float4 __x) { return simd_short(simd_int(__x)); } | ||
| 1267 | static simd_short8 SIMD_CFUNC simd_short(simd_float8 __x) { return simd_short(simd_int(__x)); } | ||
| 1268 | static simd_short16 SIMD_CFUNC simd_short(simd_float16 __x) { return simd_short(simd_int(__x)); } | ||
| 1269 | static simd_short2 SIMD_CFUNC simd_short(simd_long2 __x) { return simd_short(simd_int(__x)); } | ||
| 1270 | static simd_short3 SIMD_CFUNC simd_short(simd_long3 __x) { return simd_short(simd_int(__x)); } | ||
| 1271 | static simd_short4 SIMD_CFUNC simd_short(simd_long4 __x) { return simd_short(simd_int(__x)); } | ||
| 1272 | static simd_short8 SIMD_CFUNC simd_short(simd_long8 __x) { return simd_short(simd_int(__x)); } | ||
| 1273 | static simd_short2 SIMD_CFUNC simd_short(simd_ulong2 __x) { return simd_short(simd_int(__x)); } | ||
| 1274 | static simd_short3 SIMD_CFUNC simd_short(simd_ulong3 __x) { return simd_short(simd_int(__x)); } | ||
| 1275 | static simd_short4 SIMD_CFUNC simd_short(simd_ulong4 __x) { return simd_short(simd_int(__x)); } | ||
| 1276 | static simd_short8 SIMD_CFUNC simd_short(simd_ulong8 __x) { return simd_short(simd_int(__x)); } | ||
| 1277 | static simd_short2 SIMD_CFUNC simd_short(simd_double2 __x) { return simd_short(simd_int(__x)); } | ||
| 1278 | static simd_short3 SIMD_CFUNC simd_short(simd_double3 __x) { return simd_short(simd_int(__x)); } | ||
| 1279 | static simd_short4 SIMD_CFUNC simd_short(simd_double4 __x) { return simd_short(simd_int(__x)); } | ||
| 1280 | static simd_short8 SIMD_CFUNC simd_short(simd_double8 __x) { return simd_short(simd_int(__x)); } | ||
| 1281 | |||
| 1282 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_char2 __x) { return simd_short(__x); } | ||
| 1283 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_char3 __x) { return simd_short(__x); } | ||
| 1284 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_char4 __x) { return simd_short(__x); } | ||
| 1285 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_char8 __x) { return simd_short(__x); } | ||
| 1286 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_char16 __x) { return simd_short(__x); } | ||
| 1287 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_char32 __x) { return simd_short(__x); } | ||
| 1288 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_short2 __x) { return __x; } | ||
| 1289 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_short3 __x) { return __x; } | ||
| 1290 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x) { return __x; } | ||
| 1291 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x) { return __x; } | ||
| 1292 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x) { return __x; } | ||
| 1293 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x) { return __x; } | ||
| 1294 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1295 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1296 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1297 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_int8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1298 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_int16 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1299 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_float2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1300 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_float3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1301 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_float4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1302 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_float8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1303 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_float16 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1304 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_long2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1305 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_long3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1306 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_long4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1307 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_long8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1308 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_double2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1309 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_double3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1310 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_double4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1311 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_double8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); } | ||
| 1312 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_uchar2 __x) { return simd_short(__x); } | ||
| 1313 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_uchar3 __x) { return simd_short(__x); } | ||
| 1314 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_uchar4 __x) { return simd_short(__x); } | ||
| 1315 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_uchar8 __x) { return simd_short(__x); } | ||
| 1316 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_uchar16 __x) { return simd_short(__x); } | ||
| 1317 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_uchar32 __x) { return simd_short(__x); } | ||
| 1318 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_ushort2 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1319 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_ushort3 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1320 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_ushort4 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1321 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_ushort8 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1322 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_ushort16 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1323 | static simd_short32 SIMD_CFUNC simd_short_sat(simd_ushort32 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1324 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_uint2 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1325 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_uint3 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1326 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_uint4 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1327 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_uint8 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1328 | static simd_short16 SIMD_CFUNC simd_short_sat(simd_uint16 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1329 | static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1330 | static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1331 | static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1332 | static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x) { return simd_short(simd_min(__x,0x7fff)); } | ||
| 1333 | |||
| 1334 | |||
| 1335 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1336 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1337 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_char4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1338 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_char8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1339 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_char16 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1340 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_char32 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1341 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uchar2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1342 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uchar3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1343 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uchar4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1344 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uchar8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1345 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uchar16 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1346 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_uchar32 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1347 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_short2 __x) { return (simd_ushort2)__x; } | ||
| 1348 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_short3 __x) { return (simd_ushort3)__x; } | ||
| 1349 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_short4 __x) { return (simd_ushort4)__x; } | ||
| 1350 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_short8 __x) { return (simd_ushort8)__x; } | ||
| 1351 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_short16 __x) { return (simd_ushort16)__x; } | ||
| 1352 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_short32 __x) { return (simd_ushort32)__x; } | ||
| 1353 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ushort2 __x) { return __x; } | ||
| 1354 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ushort3 __x) { return __x; } | ||
| 1355 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x) { return __x; } | ||
| 1356 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x) { return __x; } | ||
| 1357 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x) { return __x; } | ||
| 1358 | static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x) { return __x; } | ||
| 1359 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1360 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1361 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1362 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_int8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1363 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_int16 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1364 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uint2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1365 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uint3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1366 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uint4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1367 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uint8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1368 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uint16 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1369 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_float2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1370 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_float3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1371 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_float4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1372 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_float8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1373 | static simd_ushort16 SIMD_CFUNC simd_ushort(simd_float16 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1374 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_long2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1375 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_long3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1376 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_long4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1377 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_long8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1378 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ulong2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1379 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ulong3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1380 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ulong4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1381 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ulong8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1382 | static simd_ushort2 SIMD_CFUNC simd_ushort(simd_double2 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1383 | static simd_ushort3 SIMD_CFUNC simd_ushort(simd_double3 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1384 | static simd_ushort4 SIMD_CFUNC simd_ushort(simd_double4 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1385 | static simd_ushort8 SIMD_CFUNC simd_ushort(simd_double8 __x) { return simd_ushort(simd_short(__x)); } | ||
| 1386 | |||
| 1387 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_char2 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1388 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_char3 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1389 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_char4 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1390 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_char8 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1391 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_char16 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1392 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_char32 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1393 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_short2 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1394 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_short3 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1395 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1396 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1397 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1398 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x) { return simd_ushort(simd_max(__x, 0)); } | ||
| 1399 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1400 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1401 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1402 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_int8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1403 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_int16 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1404 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_float2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1405 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_float3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1406 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_float4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1407 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_float8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1408 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_float16 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1409 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_long2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1410 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_long3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1411 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_long4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1412 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_long8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1413 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_double2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1414 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_double3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1415 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_double4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1416 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_double8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); } | ||
| 1417 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uchar2 __x) { return simd_ushort(__x); } | ||
| 1418 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uchar3 __x) { return simd_ushort(__x); } | ||
| 1419 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uchar4 __x) { return simd_ushort(__x); } | ||
| 1420 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uchar8 __x) { return simd_ushort(__x); } | ||
| 1421 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uchar16 __x) { return simd_ushort(__x); } | ||
| 1422 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_uchar32 __x) { return simd_ushort(__x); } | ||
| 1423 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ushort2 __x) { return __x; } | ||
| 1424 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ushort3 __x) { return __x; } | ||
| 1425 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ushort4 __x) { return __x; } | ||
| 1426 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ushort8 __x) { return __x; } | ||
| 1427 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_ushort16 __x) { return __x; } | ||
| 1428 | static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_ushort32 __x) { return __x; } | ||
| 1429 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uint2 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1430 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uint3 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1431 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uint4 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1432 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uint8 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1433 | static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uint16 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1434 | static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1435 | static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1436 | static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1437 | static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x) { return simd_ushort(simd_min(__x, 0xffff)); } | ||
| 1438 | |||
| 1439 | |||
| 1440 | static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x) { return __builtin_convertvector(__x, simd_int2); } | ||
| 1441 | static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x) { return __builtin_convertvector(__x, simd_int3); } | ||
| 1442 | static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x) { return __builtin_convertvector(__x, simd_int4); } | ||
| 1443 | static simd_int8 SIMD_CFUNC simd_int(simd_char8 __x) { return __builtin_convertvector(__x, simd_int8); } | ||
| 1444 | static simd_int16 SIMD_CFUNC simd_int(simd_char16 __x) { return __builtin_convertvector(__x, simd_int16); } | ||
| 1445 | static simd_int2 SIMD_CFUNC simd_int(simd_uchar2 __x) { return __builtin_convertvector(__x, simd_int2); } | ||
| 1446 | static simd_int3 SIMD_CFUNC simd_int(simd_uchar3 __x) { return __builtin_convertvector(__x, simd_int3); } | ||
| 1447 | static simd_int4 SIMD_CFUNC simd_int(simd_uchar4 __x) { return __builtin_convertvector(__x, simd_int4); } | ||
| 1448 | static simd_int8 SIMD_CFUNC simd_int(simd_uchar8 __x) { return __builtin_convertvector(__x, simd_int8); } | ||
| 1449 | static simd_int16 SIMD_CFUNC simd_int(simd_uchar16 __x) { return __builtin_convertvector(__x, simd_int16); } | ||
| 1450 | static simd_int2 SIMD_CFUNC simd_int(simd_short2 __x) { return __builtin_convertvector(__x, simd_int2); } | ||
| 1451 | static simd_int3 SIMD_CFUNC simd_int(simd_short3 __x) { return __builtin_convertvector(__x, simd_int3); } | ||
| 1452 | static simd_int4 SIMD_CFUNC simd_int(simd_short4 __x) { return __builtin_convertvector(__x, simd_int4); } | ||
| 1453 | static simd_int8 SIMD_CFUNC simd_int(simd_short8 __x) { return __builtin_convertvector(__x, simd_int8); } | ||
| 1454 | static simd_int16 SIMD_CFUNC simd_int(simd_short16 __x) { return __builtin_convertvector(__x, simd_int16); } | ||
| 1455 | static simd_int2 SIMD_CFUNC simd_int(simd_ushort2 __x) { return __builtin_convertvector(__x, simd_int2); } | ||
| 1456 | static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x) { return __builtin_convertvector(__x, simd_int3); } | ||
| 1457 | static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x) { return __builtin_convertvector(__x, simd_int4); } | ||
| 1458 | static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x) { return __builtin_convertvector(__x, simd_int8); } | ||
| 1459 | static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x) { return __builtin_convertvector(__x, simd_int16); } | ||
| 1460 | static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x) { return __x; } | ||
| 1461 | static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x) { return __x; } | ||
| 1462 | static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x) { return __x; } | ||
| 1463 | static simd_int8 SIMD_CFUNC simd_int(simd_int8 __x) { return __x; } | ||
| 1464 | static simd_int16 SIMD_CFUNC simd_int(simd_int16 __x) { return __x; } | ||
| 1465 | static simd_int2 SIMD_CFUNC simd_int(simd_uint2 __x) { return (simd_int2)__x; } | ||
| 1466 | static simd_int3 SIMD_CFUNC simd_int(simd_uint3 __x) { return (simd_int3)__x; } | ||
| 1467 | static simd_int4 SIMD_CFUNC simd_int(simd_uint4 __x) { return (simd_int4)__x; } | ||
| 1468 | static simd_int8 SIMD_CFUNC simd_int(simd_uint8 __x) { return (simd_int8)__x; } | ||
| 1469 | static simd_int16 SIMD_CFUNC simd_int(simd_uint16 __x) { return (simd_int16)__x; } | ||
| 1470 | static simd_int2 SIMD_CFUNC simd_int(simd_float2 __x) { return __builtin_convertvector(__x, simd_int2); } | ||
| 1471 | static simd_int3 SIMD_CFUNC simd_int(simd_float3 __x) { return __builtin_convertvector(__x, simd_int3); } | ||
| 1472 | static simd_int4 SIMD_CFUNC simd_int(simd_float4 __x) { return __builtin_convertvector(__x, simd_int4); } | ||
| 1473 | static simd_int8 SIMD_CFUNC simd_int(simd_float8 __x) { return __builtin_convertvector(__x, simd_int8); } | ||
| 1474 | static simd_int16 SIMD_CFUNC simd_int(simd_float16 __x) { return __builtin_convertvector(__x, simd_int16); } | ||
| 1475 | static simd_int2 SIMD_CFUNC simd_int(simd_long2 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int2); } | ||
| 1476 | static simd_int3 SIMD_CFUNC simd_int(simd_long3 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int3); } | ||
| 1477 | static simd_int4 SIMD_CFUNC simd_int(simd_long4 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int4); } | ||
| 1478 | static simd_int8 SIMD_CFUNC simd_int(simd_long8 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int8); } | ||
| 1479 | static simd_int2 SIMD_CFUNC simd_int(simd_ulong2 __x) { return simd_int(simd_long(__x)); } | ||
| 1480 | static simd_int3 SIMD_CFUNC simd_int(simd_ulong3 __x) { return simd_int(simd_long(__x)); } | ||
| 1481 | static simd_int4 SIMD_CFUNC simd_int(simd_ulong4 __x) { return simd_int(simd_long(__x)); } | ||
| 1482 | static simd_int8 SIMD_CFUNC simd_int(simd_ulong8 __x) { return simd_int(simd_long(__x)); } | ||
| 1483 | static simd_int2 SIMD_CFUNC simd_int(simd_double2 __x) { return __builtin_convertvector(__x, simd_int2); } | ||
| 1484 | static simd_int3 SIMD_CFUNC simd_int(simd_double3 __x) { return __builtin_convertvector(__x, simd_int3); } | ||
| 1485 | static simd_int4 SIMD_CFUNC simd_int(simd_double4 __x) { return __builtin_convertvector(__x, simd_int4); } | ||
| 1486 | static simd_int8 SIMD_CFUNC simd_int(simd_double8 __x) { return __builtin_convertvector(__x, simd_int8); } | ||
| 1487 | |||
| 1488 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_char2 __x) { return simd_int(__x); } | ||
| 1489 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_char3 __x) { return simd_int(__x); } | ||
| 1490 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_char4 __x) { return simd_int(__x); } | ||
| 1491 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_char8 __x) { return simd_int(__x); } | ||
| 1492 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_char16 __x) { return simd_int(__x); } | ||
| 1493 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_short2 __x) { return simd_int(__x); } | ||
| 1494 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x) { return simd_int(__x); } | ||
| 1495 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x) { return simd_int(__x); } | ||
| 1496 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x) { return simd_int(__x); } | ||
| 1497 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x) { return simd_int(__x); } | ||
| 1498 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x) { return __x; } | ||
| 1499 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x) { return __x; } | ||
| 1500 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x) { return __x; } | ||
| 1501 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_int8 __x) { return __x; } | ||
| 1502 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_int16 __x) { return __x; } | ||
| 1503 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_float2 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); } | ||
| 1504 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_float3 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); } | ||
| 1505 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_float4 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); } | ||
| 1506 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_float8 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); } | ||
| 1507 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_float16 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); } | ||
| 1508 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_long2 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); } | ||
| 1509 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_long3 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); } | ||
| 1510 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_long4 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); } | ||
| 1511 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_long8 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); } | ||
| 1512 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_double2 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); } | ||
| 1513 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_double3 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); } | ||
| 1514 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_double4 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); } | ||
| 1515 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_double8 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); } | ||
| 1516 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_uchar2 __x) { return simd_int(__x); } | ||
| 1517 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_uchar3 __x) { return simd_int(__x); } | ||
| 1518 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_uchar4 __x) { return simd_int(__x); } | ||
| 1519 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_uchar8 __x) { return simd_int(__x); } | ||
| 1520 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_uchar16 __x) { return simd_int(__x); } | ||
| 1521 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_ushort2 __x) { return simd_int(__x); } | ||
| 1522 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_ushort3 __x) { return simd_int(__x); } | ||
| 1523 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_ushort4 __x) { return simd_int(__x); } | ||
| 1524 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_ushort8 __x) { return simd_int(__x); } | ||
| 1525 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_ushort16 __x) { return simd_int(__x); } | ||
| 1526 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_uint2 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1527 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_uint3 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1528 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_uint4 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1529 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_uint8 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1530 | static simd_int16 SIMD_CFUNC simd_int_sat(simd_uint16 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1531 | static simd_int2 SIMD_CFUNC simd_int_sat(simd_ulong2 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1532 | static simd_int3 SIMD_CFUNC simd_int_sat(simd_ulong3 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1533 | static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1534 | static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x) { return simd_int(simd_min(__x,0x7fffffff)); } | ||
| 1535 | |||
| 1536 | static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x) { | ||
| 1537 | #if defined __arm64__ | ||
| 1538 | return vcvtn_s32_f32(__x); | ||
| 1539 | #else | ||
| 1540 | return simd_make_int2(simd_int_rte(simd_make_float4_undef(__x))); | ||
| 1541 | #endif | ||
| 1542 | } | ||
| 1543 | |||
| 1544 | static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x) { | ||
| 1545 | return simd_make_int3(simd_int_rte(simd_make_float4_undef(__x))); | ||
| 1546 | } | ||
| 1547 | |||
| 1548 | static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x) { | ||
| 1549 | #if defined __SSE2__ | ||
| 1550 | return _mm_cvtps_epi32(__x); | ||
| 1551 | #elif defined __arm64__ | ||
| 1552 | return vcvtnq_s32_f32(__x); | ||
| 1553 | #else | ||
| 1554 | simd_float4 magic = __tg_copysign(0x1.0p23, __x); | ||
| 1555 | simd_int4 x_is_small = __tg_fabs(__x) < 0x1.0p23; | ||
| 1556 | return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fffffff), simd_int4); | ||
| 1557 | #endif | ||
| 1558 | } | ||
| 1559 | |||
| 1560 | static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x) { | ||
| 1561 | #if defined __AVX__ | ||
| 1562 | return _mm256_cvtps_epi32(__x); | ||
| 1563 | #else | ||
| 1564 | return simd_make_int8(simd_int_rte(__x.lo), simd_int_rte(__x.hi)); | ||
| 1565 | #endif | ||
| 1566 | } | ||
| 1567 | |||
| 1568 | static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x) { | ||
| 1569 | #if defined __AVX512F__ | ||
| 1570 | return _mm512_cvt_roundps_epi32(__x, _MM_FROUND_RINT); | ||
| 1571 | #else | ||
| 1572 | return simd_make_int16(simd_int_rte(__x.lo), simd_int_rte(__x.hi)); | ||
| 1573 | #endif | ||
| 1574 | } | ||
| 1575 | |||
| 1576 | static simd_uint2 SIMD_CFUNC simd_uint(simd_char2 __x) { return simd_uint(simd_int(__x)); } | ||
| 1577 | static simd_uint3 SIMD_CFUNC simd_uint(simd_char3 __x) { return simd_uint(simd_int(__x)); } | ||
| 1578 | static simd_uint4 SIMD_CFUNC simd_uint(simd_char4 __x) { return simd_uint(simd_int(__x)); } | ||
| 1579 | static simd_uint8 SIMD_CFUNC simd_uint(simd_char8 __x) { return simd_uint(simd_int(__x)); } | ||
| 1580 | static simd_uint16 SIMD_CFUNC simd_uint(simd_char16 __x) { return simd_uint(simd_int(__x)); } | ||
| 1581 | static simd_uint2 SIMD_CFUNC simd_uint(simd_uchar2 __x) { return simd_uint(simd_int(__x)); } | ||
| 1582 | static simd_uint3 SIMD_CFUNC simd_uint(simd_uchar3 __x) { return simd_uint(simd_int(__x)); } | ||
| 1583 | static simd_uint4 SIMD_CFUNC simd_uint(simd_uchar4 __x) { return simd_uint(simd_int(__x)); } | ||
| 1584 | static simd_uint8 SIMD_CFUNC simd_uint(simd_uchar8 __x) { return simd_uint(simd_int(__x)); } | ||
| 1585 | static simd_uint16 SIMD_CFUNC simd_uint(simd_uchar16 __x) { return simd_uint(simd_int(__x)); } | ||
| 1586 | static simd_uint2 SIMD_CFUNC simd_uint(simd_short2 __x) { return simd_uint(simd_int(__x)); } | ||
| 1587 | static simd_uint3 SIMD_CFUNC simd_uint(simd_short3 __x) { return simd_uint(simd_int(__x)); } | ||
| 1588 | static simd_uint4 SIMD_CFUNC simd_uint(simd_short4 __x) { return simd_uint(simd_int(__x)); } | ||
| 1589 | static simd_uint8 SIMD_CFUNC simd_uint(simd_short8 __x) { return simd_uint(simd_int(__x)); } | ||
| 1590 | static simd_uint16 SIMD_CFUNC simd_uint(simd_short16 __x) { return simd_uint(simd_int(__x)); } | ||
| 1591 | static simd_uint2 SIMD_CFUNC simd_uint(simd_ushort2 __x) { return simd_uint(simd_int(__x)); } | ||
| 1592 | static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x) { return simd_uint(simd_int(__x)); } | ||
| 1593 | static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x) { return simd_uint(simd_int(__x)); } | ||
| 1594 | static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x) { return simd_uint(simd_int(__x)); } | ||
| 1595 | static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x) { return simd_uint(simd_int(__x)); } | ||
| 1596 | static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x) { return (simd_uint2)__x; } | ||
| 1597 | static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x) { return (simd_uint3)__x; } | ||
| 1598 | static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x) { return (simd_uint4)__x; } | ||
| 1599 | static simd_uint8 SIMD_CFUNC simd_uint(simd_int8 __x) { return (simd_uint8)__x; } | ||
| 1600 | static simd_uint16 SIMD_CFUNC simd_uint(simd_int16 __x) { return (simd_uint16)__x; } | ||
| 1601 | static simd_uint2 SIMD_CFUNC simd_uint(simd_uint2 __x) { return __x; } | ||
| 1602 | static simd_uint3 SIMD_CFUNC simd_uint(simd_uint3 __x) { return __x; } | ||
| 1603 | static simd_uint4 SIMD_CFUNC simd_uint(simd_uint4 __x) { return __x; } | ||
| 1604 | static simd_uint8 SIMD_CFUNC simd_uint(simd_uint8 __x) { return __x; } | ||
| 1605 | static simd_uint16 SIMD_CFUNC simd_uint(simd_uint16 __x) { return __x; } | ||
| 1606 | static simd_uint2 SIMD_CFUNC simd_uint(simd_float2 __x) { simd_int2 __big = __x > 0x1.0p31f; return simd_uint(simd_int(__x - simd_bitselect((simd_float2)0,0x1.0p31f,__big))) + simd_bitselect((simd_uint2)0,0x80000000,__big); } | ||
| 1607 | static simd_uint3 SIMD_CFUNC simd_uint(simd_float3 __x) { simd_int3 __big = __x > 0x1.0p31f; return simd_uint(simd_int(__x - simd_bitselect((simd_float3)0,0x1.0p31f,__big))) + simd_bitselect((simd_uint3)0,0x80000000,__big); } | ||
| 1608 | static simd_uint4 SIMD_CFUNC simd_uint(simd_float4 __x) { simd_int4 __big = __x > 0x1.0p31f; return simd_uint(simd_int(__x - simd_bitselect((simd_float4)0,0x1.0p31f,__big))) + simd_bitselect((simd_uint4)0,0x80000000,__big); } | ||
| 1609 | static simd_uint8 SIMD_CFUNC simd_uint(simd_float8 __x) { simd_int8 __big = __x > 0x1.0p31f; return simd_uint(simd_int(__x - simd_bitselect((simd_float8)0,0x1.0p31f,__big))) + simd_bitselect((simd_uint8)0,0x80000000,__big); } | ||
| 1610 | static simd_uint16 SIMD_CFUNC simd_uint(simd_float16 __x) { simd_int16 __big = __x > 0x1.0p31f; return simd_uint(simd_int(__x - simd_bitselect((simd_float16)0,0x1.0p31f,__big))) + simd_bitselect((simd_uint16)0,0x80000000,__big); } | ||
| 1611 | static simd_uint2 SIMD_CFUNC simd_uint(simd_long2 __x) { return simd_uint(simd_int(__x)); } | ||
| 1612 | static simd_uint3 SIMD_CFUNC simd_uint(simd_long3 __x) { return simd_uint(simd_int(__x)); } | ||
| 1613 | static simd_uint4 SIMD_CFUNC simd_uint(simd_long4 __x) { return simd_uint(simd_int(__x)); } | ||
| 1614 | static simd_uint8 SIMD_CFUNC simd_uint(simd_long8 __x) { return simd_uint(simd_int(__x)); } | ||
| 1615 | static simd_uint2 SIMD_CFUNC simd_uint(simd_ulong2 __x) { return simd_uint(simd_int(__x)); } | ||
| 1616 | static simd_uint3 SIMD_CFUNC simd_uint(simd_ulong3 __x) { return simd_uint(simd_int(__x)); } | ||
| 1617 | static simd_uint4 SIMD_CFUNC simd_uint(simd_ulong4 __x) { return simd_uint(simd_int(__x)); } | ||
| 1618 | static simd_uint8 SIMD_CFUNC simd_uint(simd_ulong8 __x) { return simd_uint(simd_int(__x)); } | ||
| 1619 | static simd_uint2 SIMD_CFUNC simd_uint(simd_double2 __x) { simd_long2 __big = __x > 0x1.fffffffcp30; return simd_uint(simd_int(__x - simd_bitselect((simd_double2)0,0x1.0p31,__big))) + simd_bitselect((simd_uint2)0,0x80000000,simd_int(__big)); } | ||
| 1620 | static simd_uint3 SIMD_CFUNC simd_uint(simd_double3 __x) { simd_long3 __big = __x > 0x1.fffffffcp30; return simd_uint(simd_int(__x - simd_bitselect((simd_double3)0,0x1.0p31,__big))) + simd_bitselect((simd_uint3)0,0x80000000,simd_int(__big)); } | ||
| 1621 | static simd_uint4 SIMD_CFUNC simd_uint(simd_double4 __x) { simd_long4 __big = __x > 0x1.fffffffcp30; return simd_uint(simd_int(__x - simd_bitselect((simd_double4)0,0x1.0p31,__big))) + simd_bitselect((simd_uint4)0,0x80000000,simd_int(__big)); } | ||
| 1622 | static simd_uint8 SIMD_CFUNC simd_uint(simd_double8 __x) { simd_long8 __big = __x > 0x1.fffffffcp30; return simd_uint(simd_int(__x - simd_bitselect((simd_double8)0,0x1.0p31,__big))) + simd_bitselect((simd_uint8)0,0x80000000,simd_int(__big)); } | ||
| 1623 | |||
| 1624 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_char2 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1625 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_char3 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1626 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_char4 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1627 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_char8 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1628 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_char16 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1629 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_short2 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1630 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1631 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1632 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1633 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1634 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1635 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1636 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1637 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_int8 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1638 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_int16 __x) { return simd_uint(simd_max(__x,0)); } | ||
| 1639 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_float2 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); } | ||
| 1640 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_float3 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); } | ||
| 1641 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_float4 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); } | ||
| 1642 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_float8 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); } | ||
| 1643 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_float16 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); } | ||
| 1644 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_long2 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1645 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_long3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1646 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_long4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1647 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_long8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1648 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_double2 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1649 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_double3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1650 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_double4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1651 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_double8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1652 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uchar2 __x) { return simd_uint(__x); } | ||
| 1653 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uchar3 __x) { return simd_uint(__x); } | ||
| 1654 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uchar4 __x) { return simd_uint(__x); } | ||
| 1655 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uchar8 __x) { return simd_uint(__x); } | ||
| 1656 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uchar16 __x) { return simd_uint(__x); } | ||
| 1657 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ushort2 __x) { return simd_uint(__x); } | ||
| 1658 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ushort3 __x) { return simd_uint(__x); } | ||
| 1659 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ushort4 __x) { return simd_uint(__x); } | ||
| 1660 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ushort8 __x) { return simd_uint(__x); } | ||
| 1661 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_ushort16 __x) { return simd_uint(__x); } | ||
| 1662 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uint2 __x) { return __x; } | ||
| 1663 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uint3 __x) { return __x; } | ||
| 1664 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uint4 __x) { return __x; } | ||
| 1665 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uint8 __x) { return __x; } | ||
| 1666 | static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uint16 __x) { return __x; } | ||
| 1667 | static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1668 | static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1669 | static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1670 | static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } | ||
| 1671 | |||
| 1672 | |||
| 1673 | static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1674 | static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1675 | static simd_float4 SIMD_CFUNC simd_float(simd_char4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1676 | static simd_float8 SIMD_CFUNC simd_float(simd_char8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1677 | static simd_float16 SIMD_CFUNC simd_float(simd_char16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1678 | static simd_float2 SIMD_CFUNC simd_float(simd_uchar2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1679 | static simd_float3 SIMD_CFUNC simd_float(simd_uchar3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1680 | static simd_float4 SIMD_CFUNC simd_float(simd_uchar4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1681 | static simd_float8 SIMD_CFUNC simd_float(simd_uchar8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1682 | static simd_float16 SIMD_CFUNC simd_float(simd_uchar16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1683 | static simd_float2 SIMD_CFUNC simd_float(simd_short2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1684 | static simd_float3 SIMD_CFUNC simd_float(simd_short3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1685 | static simd_float4 SIMD_CFUNC simd_float(simd_short4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1686 | static simd_float8 SIMD_CFUNC simd_float(simd_short8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1687 | static simd_float16 SIMD_CFUNC simd_float(simd_short16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1688 | static simd_float2 SIMD_CFUNC simd_float(simd_ushort2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1689 | static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1690 | static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1691 | static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1692 | static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } | ||
| 1693 | static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x) { return __builtin_convertvector(__x,simd_float2); } | ||
| 1694 | static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x) { return __builtin_convertvector(__x,simd_float3); } | ||
| 1695 | static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x) { return __builtin_convertvector(__x,simd_float4); } | ||
| 1696 | static simd_float8 SIMD_CFUNC simd_float(simd_int8 __x) { return __builtin_convertvector(__x,simd_float8); } | ||
| 1697 | static simd_float16 SIMD_CFUNC simd_float(simd_int16 __x) { return __builtin_convertvector(__x,simd_float16); } | ||
| 1698 | static simd_float2 SIMD_CFUNC simd_float(simd_uint2 __x) { return __builtin_convertvector(__x,simd_float2); } | ||
| 1699 | static simd_float3 SIMD_CFUNC simd_float(simd_uint3 __x) { return __builtin_convertvector(__x,simd_float3); } | ||
| 1700 | static simd_float4 SIMD_CFUNC simd_float(simd_uint4 __x) { return __builtin_convertvector(__x,simd_float4); } | ||
| 1701 | static simd_float8 SIMD_CFUNC simd_float(simd_uint8 __x) { return __builtin_convertvector(__x,simd_float8); } | ||
| 1702 | static simd_float16 SIMD_CFUNC simd_float(simd_uint16 __x) { return __builtin_convertvector(__x,simd_float16); } | ||
| 1703 | static simd_float2 SIMD_CFUNC simd_float(simd_float2 __x) { return __x; } | ||
| 1704 | static simd_float3 SIMD_CFUNC simd_float(simd_float3 __x) { return __x; } | ||
| 1705 | static simd_float4 SIMD_CFUNC simd_float(simd_float4 __x) { return __x; } | ||
| 1706 | static simd_float8 SIMD_CFUNC simd_float(simd_float8 __x) { return __x; } | ||
| 1707 | static simd_float16 SIMD_CFUNC simd_float(simd_float16 __x) { return __x; } | ||
| 1708 | static simd_float2 SIMD_CFUNC simd_float(simd_long2 __x) { return __builtin_convertvector(__x,simd_float2); } | ||
| 1709 | static simd_float3 SIMD_CFUNC simd_float(simd_long3 __x) { return __builtin_convertvector(__x,simd_float3); } | ||
| 1710 | static simd_float4 SIMD_CFUNC simd_float(simd_long4 __x) { return __builtin_convertvector(__x,simd_float4); } | ||
| 1711 | static simd_float8 SIMD_CFUNC simd_float(simd_long8 __x) { return __builtin_convertvector(__x,simd_float8); } | ||
| 1712 | static simd_float2 SIMD_CFUNC simd_float(simd_ulong2 __x) { return __builtin_convertvector(__x,simd_float2); } | ||
| 1713 | static simd_float3 SIMD_CFUNC simd_float(simd_ulong3 __x) { return __builtin_convertvector(__x,simd_float3); } | ||
| 1714 | static simd_float4 SIMD_CFUNC simd_float(simd_ulong4 __x) { return __builtin_convertvector(__x,simd_float4); } | ||
| 1715 | static simd_float8 SIMD_CFUNC simd_float(simd_ulong8 __x) { return __builtin_convertvector(__x,simd_float8); } | ||
| 1716 | static simd_float2 SIMD_CFUNC simd_float(simd_double2 __x) { return __builtin_convertvector(__x,simd_float2); } | ||
| 1717 | static simd_float3 SIMD_CFUNC simd_float(simd_double3 __x) { return __builtin_convertvector(__x,simd_float3); } | ||
| 1718 | static simd_float4 SIMD_CFUNC simd_float(simd_double4 __x) { return __builtin_convertvector(__x,simd_float4); } | ||
| 1719 | static simd_float8 SIMD_CFUNC simd_float(simd_double8 __x) { return __builtin_convertvector(__x,simd_float8); } | ||
| 1720 | |||
| 1721 | |||
| 1722 | static simd_long2 SIMD_CFUNC simd_long(simd_char2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1723 | static simd_long3 SIMD_CFUNC simd_long(simd_char3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1724 | static simd_long4 SIMD_CFUNC simd_long(simd_char4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1725 | static simd_long8 SIMD_CFUNC simd_long(simd_char8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1726 | static simd_long2 SIMD_CFUNC simd_long(simd_uchar2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1727 | static simd_long3 SIMD_CFUNC simd_long(simd_uchar3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1728 | static simd_long4 SIMD_CFUNC simd_long(simd_uchar4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1729 | static simd_long8 SIMD_CFUNC simd_long(simd_uchar8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1730 | static simd_long2 SIMD_CFUNC simd_long(simd_short2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1731 | static simd_long3 SIMD_CFUNC simd_long(simd_short3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1732 | static simd_long4 SIMD_CFUNC simd_long(simd_short4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1733 | static simd_long8 SIMD_CFUNC simd_long(simd_short8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1734 | static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1735 | static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1736 | static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1737 | static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1738 | static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1739 | static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1740 | static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1741 | static simd_long8 SIMD_CFUNC simd_long(simd_int8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1742 | static simd_long2 SIMD_CFUNC simd_long(simd_uint2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1743 | static simd_long3 SIMD_CFUNC simd_long(simd_uint3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1744 | static simd_long4 SIMD_CFUNC simd_long(simd_uint4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1745 | static simd_long8 SIMD_CFUNC simd_long(simd_uint8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1746 | static simd_long2 SIMD_CFUNC simd_long(simd_float2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1747 | static simd_long3 SIMD_CFUNC simd_long(simd_float3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1748 | static simd_long4 SIMD_CFUNC simd_long(simd_float4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1749 | static simd_long8 SIMD_CFUNC simd_long(simd_float8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1750 | static simd_long2 SIMD_CFUNC simd_long(simd_long2 __x) { return __x; } | ||
| 1751 | static simd_long3 SIMD_CFUNC simd_long(simd_long3 __x) { return __x; } | ||
| 1752 | static simd_long4 SIMD_CFUNC simd_long(simd_long4 __x) { return __x; } | ||
| 1753 | static simd_long8 SIMD_CFUNC simd_long(simd_long8 __x) { return __x; } | ||
| 1754 | static simd_long2 SIMD_CFUNC simd_long(simd_ulong2 __x) { return (simd_long2)__x; } | ||
| 1755 | static simd_long3 SIMD_CFUNC simd_long(simd_ulong3 __x) { return (simd_long3)__x; } | ||
| 1756 | static simd_long4 SIMD_CFUNC simd_long(simd_ulong4 __x) { return (simd_long4)__x; } | ||
| 1757 | static simd_long8 SIMD_CFUNC simd_long(simd_ulong8 __x) { return (simd_long8)__x; } | ||
| 1758 | static simd_long2 SIMD_CFUNC simd_long(simd_double2 __x) { return __builtin_convertvector(__x,simd_long2); } | ||
| 1759 | static simd_long3 SIMD_CFUNC simd_long(simd_double3 __x) { return __builtin_convertvector(__x,simd_long3); } | ||
| 1760 | static simd_long4 SIMD_CFUNC simd_long(simd_double4 __x) { return __builtin_convertvector(__x,simd_long4); } | ||
| 1761 | static simd_long8 SIMD_CFUNC simd_long(simd_double8 __x) { return __builtin_convertvector(__x,simd_long8); } | ||
| 1762 | |||
| 1763 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_char2 __x) { return simd_long(__x); } | ||
| 1764 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_char3 __x) { return simd_long(__x); } | ||
| 1765 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_char4 __x) { return simd_long(__x); } | ||
| 1766 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_char8 __x) { return simd_long(__x); } | ||
| 1767 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x) { return simd_long(__x); } | ||
| 1768 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x) { return simd_long(__x); } | ||
| 1769 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x) { return simd_long(__x); } | ||
| 1770 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x) { return simd_long(__x); } | ||
| 1771 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x) { return simd_long(__x); } | ||
| 1772 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x) { return simd_long(__x); } | ||
| 1773 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x) { return simd_long(__x); } | ||
| 1774 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_int8 __x) { return simd_long(__x); } | ||
| 1775 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_float2 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63f)), 0x7fffffffffffffff, simd_long(__x >= 0x1.0p63f)); } | ||
| 1776 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_float3 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63f)), 0x7fffffffffffffff, simd_long(__x >= 0x1.0p63f)); } | ||
| 1777 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_float4 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63f)), 0x7fffffffffffffff, simd_long(__x >= 0x1.0p63f)); } | ||
| 1778 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_float8 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63f)), 0x7fffffffffffffff, simd_long(__x >= 0x1.0p63f)); } | ||
| 1779 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_long2 __x) { return __x; } | ||
| 1780 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_long3 __x) { return __x; } | ||
| 1781 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_long4 __x) { return __x; } | ||
| 1782 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_long8 __x) { return __x; } | ||
| 1783 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_double2 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); } | ||
| 1784 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_double3 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); } | ||
| 1785 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_double4 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); } | ||
| 1786 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_double8 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); } | ||
| 1787 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_uchar2 __x) { return simd_long(__x); } | ||
| 1788 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_uchar3 __x) { return simd_long(__x); } | ||
| 1789 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_uchar4 __x) { return simd_long(__x); } | ||
| 1790 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_uchar8 __x) { return simd_long(__x); } | ||
| 1791 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_ushort2 __x) { return simd_long(__x); } | ||
| 1792 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_ushort3 __x) { return simd_long(__x); } | ||
| 1793 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_ushort4 __x) { return simd_long(__x); } | ||
| 1794 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_ushort8 __x) { return simd_long(__x); } | ||
| 1795 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_uint2 __x) { return simd_long(__x); } | ||
| 1796 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_uint3 __x) { return simd_long(__x); } | ||
| 1797 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_uint4 __x) { return simd_long(__x); } | ||
| 1798 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_uint8 __x) { return simd_long(__x); } | ||
| 1799 | static simd_long2 SIMD_CFUNC simd_long_sat(simd_ulong2 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } | ||
| 1800 | static simd_long3 SIMD_CFUNC simd_long_sat(simd_ulong3 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } | ||
| 1801 | static simd_long4 SIMD_CFUNC simd_long_sat(simd_ulong4 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } | ||
| 1802 | static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } | ||
| 1803 | |||
| 1804 | static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x) { | ||
| 1805 | #if defined __AVX512F__ | ||
| 1806 | return _mm_cvtpd_epi64(__x); | ||
| 1807 | #elif defined __arm64__ | ||
| 1808 | return vcvtnq_s64_f64(__x); | ||
| 1809 | #else | ||
| 1810 | simd_double2 magic = __tg_copysign(0x1.0p52, __x); | ||
| 1811 | simd_long2 x_is_small = __tg_fabs(__x) < 0x1.0p52; | ||
| 1812 | return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fffffffffffffff), simd_long2); | ||
| 1813 | #endif | ||
| 1814 | } | ||
| 1815 | |||
| 1816 | static simd_long3 SIMD_CFUNC simd_long_rte(simd_double3 __x) { | ||
| 1817 | return simd_make_long3(simd_long_rte(simd_make_double4_undef(__x))); | ||
| 1818 | } | ||
| 1819 | |||
| 1820 | static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x) { | ||
| 1821 | #if defined __AVX512F__ | ||
| 1822 | return _mm256_cvtpd_epi64(__x); | ||
| 1823 | #else | ||
| 1824 | return simd_make_long4(simd_long_rte(__x.lo), simd_long_rte(__x.hi)); | ||
| 1825 | #endif | ||
| 1826 | } | ||
| 1827 | |||
| 1828 | static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x) { | ||
| 1829 | #if defined __AVX512F__ | ||
| 1830 | return _mm512_cvt_roundpd_epi64(__x, _MM_FROUND_RINT); | ||
| 1831 | #else | ||
| 1832 | return simd_make_long8(simd_long_rte(__x.lo), simd_long_rte(__x.hi)); | ||
| 1833 | #endif | ||
| 1834 | } | ||
| 1835 | |||
| 1836 | |||
| 1837 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_char2 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1838 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_char3 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1839 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_char4 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1840 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_char8 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1841 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uchar2 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1842 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uchar3 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1843 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uchar4 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1844 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uchar8 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1845 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_short2 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1846 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_short3 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1847 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_short4 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1848 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_short8 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1849 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1850 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1851 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1852 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1853 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1854 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1855 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1856 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_int8 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1857 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uint2 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1858 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uint3 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1859 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uint4 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1860 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uint8 __x) { return simd_ulong(simd_long(__x)); } | ||
| 1861 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_float2 __x) { simd_int2 __big = __x >= 0x1.0p63f; return simd_ulong(simd_long(__x - simd_bitselect((simd_float2)0,0x1.0p63f,__big))) + simd_bitselect((simd_ulong2)0,0x8000000000000000,simd_long(__big)); } | ||
| 1862 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_float3 __x) { simd_int3 __big = __x >= 0x1.0p63f; return simd_ulong(simd_long(__x - simd_bitselect((simd_float3)0,0x1.0p63f,__big))) + simd_bitselect((simd_ulong3)0,0x8000000000000000,simd_long(__big)); } | ||
| 1863 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_float4 __x) { simd_int4 __big = __x >= 0x1.0p63f; return simd_ulong(simd_long(__x - simd_bitselect((simd_float4)0,0x1.0p63f,__big))) + simd_bitselect((simd_ulong4)0,0x8000000000000000,simd_long(__big)); } | ||
| 1864 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_float8 __x) { simd_int8 __big = __x >= 0x1.0p63f; return simd_ulong(simd_long(__x - simd_bitselect((simd_float8)0,0x1.0p63f,__big))) + simd_bitselect((simd_ulong8)0,0x8000000000000000,simd_long(__big)); } | ||
| 1865 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_long2 __x) { return (simd_ulong2)__x; } | ||
| 1866 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_long3 __x) { return (simd_ulong3)__x; } | ||
| 1867 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_long4 __x) { return (simd_ulong4)__x; } | ||
| 1868 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_long8 __x) { return (simd_ulong8)__x; } | ||
| 1869 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ulong2 __x) { return __x; } | ||
| 1870 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ulong3 __x) { return __x; } | ||
| 1871 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ulong4 __x) { return __x; } | ||
| 1872 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ulong8 __x) { return __x; } | ||
| 1873 | static simd_ulong2 SIMD_CFUNC simd_ulong(simd_double2 __x) { simd_long2 __big = __x >= 0x1.0p63; return simd_ulong(simd_long(__x - simd_bitselect((simd_double2)0,0x1.0p63,__big))) + simd_bitselect((simd_ulong2)0,0x8000000000000000,__big); } | ||
| 1874 | static simd_ulong3 SIMD_CFUNC simd_ulong(simd_double3 __x) { simd_long3 __big = __x >= 0x1.0p63; return simd_ulong(simd_long(__x - simd_bitselect((simd_double3)0,0x1.0p63,__big))) + simd_bitselect((simd_ulong3)0,0x8000000000000000,__big); } | ||
| 1875 | static simd_ulong4 SIMD_CFUNC simd_ulong(simd_double4 __x) { simd_long4 __big = __x >= 0x1.0p63; return simd_ulong(simd_long(__x - simd_bitselect((simd_double4)0,0x1.0p63,__big))) + simd_bitselect((simd_ulong4)0,0x8000000000000000,__big); } | ||
| 1876 | static simd_ulong8 SIMD_CFUNC simd_ulong(simd_double8 __x) { simd_long8 __big = __x >= 0x1.0p63; return simd_ulong(simd_long(__x - simd_bitselect((simd_double8)0,0x1.0p63,__big))) + simd_bitselect((simd_ulong8)0,0x8000000000000000,__big); } | ||
| 1877 | |||
| 1878 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_char2 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1879 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_char3 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1880 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_char4 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1881 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_char8 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1882 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1883 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1884 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1885 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1886 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1887 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1888 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1889 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_int8 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1890 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_float2 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.f)), 0xffffffffffffffff, simd_long(__x >= 0x1.0p64f)); } | ||
| 1891 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_float3 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.f)), 0xffffffffffffffff, simd_long(__x >= 0x1.0p64f)); } | ||
| 1892 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_float4 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.f)), 0xffffffffffffffff, simd_long(__x >= 0x1.0p64f)); } | ||
| 1893 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_float8 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.f)), 0xffffffffffffffff, simd_long(__x >= 0x1.0p64f)); } | ||
| 1894 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_long2 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1895 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_long3 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1896 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_long4 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1897 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_long8 __x) { return simd_ulong(simd_max(__x,0)); } | ||
| 1898 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_double2 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); } | ||
| 1899 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_double3 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); } | ||
| 1900 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_double4 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); } | ||
| 1901 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_double8 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); } | ||
| 1902 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uchar2 __x) { return simd_ulong(__x); } | ||
| 1903 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uchar3 __x) { return simd_ulong(__x); } | ||
| 1904 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uchar4 __x) { return simd_ulong(__x); } | ||
| 1905 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uchar8 __x) { return simd_ulong(__x); } | ||
| 1906 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ushort2 __x) { return simd_ulong(__x); } | ||
| 1907 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ushort3 __x) { return simd_ulong(__x); } | ||
| 1908 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ushort4 __x) { return simd_ulong(__x); } | ||
| 1909 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ushort8 __x) { return simd_ulong(__x); } | ||
| 1910 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uint2 __x) { return simd_ulong(__x); } | ||
| 1911 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uint3 __x) { return simd_ulong(__x); } | ||
| 1912 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uint4 __x) { return simd_ulong(__x); } | ||
| 1913 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uint8 __x) { return simd_ulong(__x); } | ||
| 1914 | static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x) { return __x; } | ||
| 1915 | static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x) { return __x; } | ||
| 1916 | static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x) { return __x; } | ||
| 1917 | static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x) { return __x; } | ||
| 1918 | |||
| 1919 | |||
| 1920 | static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x) { return simd_double(simd_int(__x)); } | ||
| 1921 | static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x) { return simd_double(simd_int(__x)); } | ||
| 1922 | static simd_double4 SIMD_CFUNC simd_double(simd_char4 __x) { return simd_double(simd_int(__x)); } | ||
| 1923 | static simd_double8 SIMD_CFUNC simd_double(simd_char8 __x) { return simd_double(simd_int(__x)); } | ||
| 1924 | static simd_double2 SIMD_CFUNC simd_double(simd_uchar2 __x) { return simd_double(simd_int(__x)); } | ||
| 1925 | static simd_double3 SIMD_CFUNC simd_double(simd_uchar3 __x) { return simd_double(simd_int(__x)); } | ||
| 1926 | static simd_double4 SIMD_CFUNC simd_double(simd_uchar4 __x) { return simd_double(simd_int(__x)); } | ||
| 1927 | static simd_double8 SIMD_CFUNC simd_double(simd_uchar8 __x) { return simd_double(simd_int(__x)); } | ||
| 1928 | static simd_double2 SIMD_CFUNC simd_double(simd_short2 __x) { return simd_double(simd_int(__x)); } | ||
| 1929 | static simd_double3 SIMD_CFUNC simd_double(simd_short3 __x) { return simd_double(simd_int(__x)); } | ||
| 1930 | static simd_double4 SIMD_CFUNC simd_double(simd_short4 __x) { return simd_double(simd_int(__x)); } | ||
| 1931 | static simd_double8 SIMD_CFUNC simd_double(simd_short8 __x) { return simd_double(simd_int(__x)); } | ||
| 1932 | static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x) { return simd_double(simd_int(__x)); } | ||
| 1933 | static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x) { return simd_double(simd_int(__x)); } | ||
| 1934 | static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x) { return simd_double(simd_int(__x)); } | ||
| 1935 | static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x) { return simd_double(simd_int(__x)); } | ||
| 1936 | static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x) { return __builtin_convertvector(__x, simd_double2); } | ||
| 1937 | static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x) { return __builtin_convertvector(__x, simd_double3); } | ||
| 1938 | static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x) { return __builtin_convertvector(__x, simd_double4); } | ||
| 1939 | static simd_double8 SIMD_CFUNC simd_double(simd_int8 __x) { return __builtin_convertvector(__x, simd_double8); } | ||
| 1940 | static simd_double2 SIMD_CFUNC simd_double(simd_uint2 __x) { return __builtin_convertvector(__x, simd_double2); } | ||
| 1941 | static simd_double3 SIMD_CFUNC simd_double(simd_uint3 __x) { return __builtin_convertvector(__x, simd_double3); } | ||
| 1942 | static simd_double4 SIMD_CFUNC simd_double(simd_uint4 __x) { return __builtin_convertvector(__x, simd_double4); } | ||
| 1943 | static simd_double8 SIMD_CFUNC simd_double(simd_uint8 __x) { return __builtin_convertvector(__x, simd_double8); } | ||
| 1944 | static simd_double2 SIMD_CFUNC simd_double(simd_float2 __x) { return __builtin_convertvector(__x, simd_double2); } | ||
| 1945 | static simd_double3 SIMD_CFUNC simd_double(simd_float3 __x) { return __builtin_convertvector(__x, simd_double3); } | ||
| 1946 | static simd_double4 SIMD_CFUNC simd_double(simd_float4 __x) { return __builtin_convertvector(__x, simd_double4); } | ||
| 1947 | static simd_double8 SIMD_CFUNC simd_double(simd_float8 __x) { return __builtin_convertvector(__x, simd_double8); } | ||
| 1948 | static simd_double2 SIMD_CFUNC simd_double(simd_long2 __x) { return __builtin_convertvector(__x, simd_double2); } | ||
| 1949 | static simd_double3 SIMD_CFUNC simd_double(simd_long3 __x) { return __builtin_convertvector(__x, simd_double3); } | ||
| 1950 | static simd_double4 SIMD_CFUNC simd_double(simd_long4 __x) { return __builtin_convertvector(__x, simd_double4); } | ||
| 1951 | static simd_double8 SIMD_CFUNC simd_double(simd_long8 __x) { return __builtin_convertvector(__x, simd_double8); } | ||
| 1952 | static simd_double2 SIMD_CFUNC simd_double(simd_ulong2 __x) { return __builtin_convertvector(__x, simd_double2); } | ||
| 1953 | static simd_double3 SIMD_CFUNC simd_double(simd_ulong3 __x) { return __builtin_convertvector(__x, simd_double3); } | ||
| 1954 | static simd_double4 SIMD_CFUNC simd_double(simd_ulong4 __x) { return __builtin_convertvector(__x, simd_double4); } | ||
| 1955 | static simd_double8 SIMD_CFUNC simd_double(simd_ulong8 __x) { return __builtin_convertvector(__x, simd_double8); } | ||
| 1956 | static simd_double2 SIMD_CFUNC simd_double(simd_double2 __x) { return __builtin_convertvector(__x, simd_double2); } | ||
| 1957 | static simd_double3 SIMD_CFUNC simd_double(simd_double3 __x) { return __builtin_convertvector(__x, simd_double3); } | ||
| 1958 | static simd_double4 SIMD_CFUNC simd_double(simd_double4 __x) { return __builtin_convertvector(__x, simd_double4); } | ||
| 1959 | static simd_double8 SIMD_CFUNC simd_double(simd_double8 __x) { return __builtin_convertvector(__x, simd_double8); } | ||
| 1960 | |||
| 1961 | |||
| 1962 | #ifdef __cplusplus | ||
| 1963 | } | ||
| 1964 | #endif | ||
| 1965 | #endif // SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 1966 | #endif // __SIMD_CONVERSION_HEADER__ | ||
| 1967 | |||
lib/libc/include/x86_64-macos-gnu/simd/extern.h created+49| ... | @@ -0,0 +1,49 @@ | ||
| 1 | /* Copyright (c) 2014 Apple, Inc. All rights reserved. */ | ||
| 2 | |||
| 3 | #ifndef __SIMD_EXTERN_HEADER__ | ||
| 4 | #define __SIMD_EXTERN_HEADER__ | ||
| 5 | |||
| 6 | #include <simd/base.h> | ||
| 7 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 8 | #include <simd/types.h> | ||
| 9 | |||
| 10 | #ifdef __cplusplus | ||
| 11 | extern "C" { | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #pragma mark - geometry | ||
| 15 | #if SIMD_LIBRARY_VERSION >= 2 | ||
| 16 | extern float _simd_orient_vf2(simd_float2, simd_float2); | ||
| 17 | extern float _simd_orient_pf2(simd_float2, simd_float2, simd_float2); | ||
| 18 | extern float _simd_incircle_pf2(simd_float2, simd_float2, simd_float2, simd_float2); | ||
| 19 | |||
| 20 | extern float _simd_orient_vf3(simd_float3, simd_float3, simd_float3); | ||
| 21 | extern float _simd_orient_pf3(simd_float3, simd_float3, simd_float3, simd_float3); | ||
| 22 | extern float _simd_insphere_pf3(simd_float3, simd_float3, simd_float3, simd_float3, simd_float3); | ||
| 23 | |||
| 24 | extern double _simd_orient_vd2(simd_double2, simd_double2); | ||
| 25 | extern double _simd_orient_pd2(simd_double2, simd_double2, simd_double2); | ||
| 26 | extern double _simd_incircle_pd2(simd_double2, simd_double2, simd_double2, simd_double2); | ||
| 27 | |||
| 28 | /* The double3 variants of these functions take their arguments in a buffer | ||
| 29 | * to workaround the fact that double3 calling conventions are different | ||
| 30 | * depending on whether or not the executable has been compiled with AVX | ||
| 31 | * enabled. */ | ||
| 32 | extern double _simd_orient_vd3(const double *); | ||
| 33 | extern double _simd_orient_pd3(const double *); | ||
| 34 | extern double _simd_insphere_pd3(const double *); | ||
| 35 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 36 | |||
| 37 | #pragma mark - matrix | ||
| 38 | extern simd_float2x2 __invert_f2(simd_float2x2); | ||
| 39 | extern simd_double2x2 __invert_d2(simd_double2x2); | ||
| 40 | extern simd_float3x3 __invert_f3(simd_float3x3); | ||
| 41 | extern simd_double3x3 __invert_d3(simd_double3x3); | ||
| 42 | extern simd_float4x4 __invert_f4(simd_float4x4); | ||
| 43 | extern simd_double4x4 __invert_d4(simd_double4x4); | ||
| 44 | |||
| 45 | #ifdef __cplusplus | ||
| 46 | } | ||
| 47 | #endif | ||
| 48 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 49 | #endif /* __SIMD_EXTERN_HEADER__ */ | ||
lib/libc/include/x86_64-macos-gnu/simd/geometry.h created+1083| ... | @@ -0,0 +1,1083 @@ | ||
| 1 | /* Copyright (c) 2014-2017 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * The interfaces declared in this header provide operations for mathematical | ||
| 4 | * vectors; these functions and macros operate on vectors of floating-point | ||
| 5 | * data only. | ||
| 6 | * | ||
| 7 | * Function Result | ||
| 8 | * ------------------------------------------------------------------ | ||
| 9 | * simd_dot(x,y) The dot product of x and y. | ||
| 10 | * | ||
| 11 | * simd_project(x,y) x projected onto y. There are two variants | ||
| 12 | * of this function, simd_precise_project | ||
| 13 | * and simd_fast_project. simd_project | ||
| 14 | * is equivalent to simd_precise_project | ||
| 15 | * unless you are compiling with -ffast-math | ||
| 16 | * specified, in which case it is equivalent | ||
| 17 | * to simd_fast_project. | ||
| 18 | * | ||
| 19 | * simd_length(x) The length (two-norm) of x. Undefined if | ||
| 20 | * x is poorly scaled such that an | ||
| 21 | * intermediate computation overflows or | ||
| 22 | * underflows. There are two variants | ||
| 23 | * of this function, simd_precise_length | ||
| 24 | * and simd_fast_length. simd_length | ||
| 25 | * is equivalent to simd_precise_length | ||
| 26 | * unless you are compiling with -ffast-math | ||
| 27 | * specified, in which case it is equivalent | ||
| 28 | * to simd_fast_length. | ||
| 29 | * | ||
| 30 | * simd_length_squared(x) The square of the length of x. If you | ||
| 31 | * simply need to compare relative magnitudes, | ||
| 32 | * use this instead of simd_length; it is | ||
| 33 | * faster than simd_fast_length and as | ||
| 34 | * accurate as simd_precise_length. | ||
| 35 | * | ||
| 36 | * simd_norm_one(x) The one-norm (sum of absolute values) of x. | ||
| 37 | * | ||
| 38 | * simd_norm_inf(x) The inf-norm (max absolute value) of x. | ||
| 39 | * | ||
| 40 | * simd_distance(x,y) The distance between x and y. Undefined if | ||
| 41 | * x and y are poorly scaled such that an | ||
| 42 | * intermediate computation overflows | ||
| 43 | * or underflows. There are two variants | ||
| 44 | * of this function, simd_precise_distance | ||
| 45 | * and simd_fast_distance. simd_distance | ||
| 46 | * is equivalent to simd_precise_distance | ||
| 47 | * unless you are compiling with -ffast-math | ||
| 48 | * specified, in which case it is equivalent | ||
| 49 | * to simd_fast_distance. | ||
| 50 | * | ||
| 51 | * simd_distance_squared(x,y) The square of the distance between x and y. | ||
| 52 | * | ||
| 53 | * simd_normalize(x) A vector pointing in the direction of x | ||
| 54 | * with length 1.0. Undefined if x is | ||
| 55 | * the zero vector, or if x is poorly scaled | ||
| 56 | * such that an intermediate computation | ||
| 57 | * overflows or underflows. There are two | ||
| 58 | * variants of this function, | ||
| 59 | * simd_precise_normalize and | ||
| 60 | * simd_fast_normalize. simd_normalize | ||
| 61 | * is equivalent to simd_precise_normalize | ||
| 62 | * unless you are compiling with -ffast-math | ||
| 63 | * specified, in which case it is equivalent | ||
| 64 | * to simd_fast_normalize. | ||
| 65 | * | ||
| 66 | * simd_cross(x,y) If x and y are vectors of dimension 3, | ||
| 67 | * the cross-product of x and y. | ||
| 68 | * | ||
| 69 | * If x and y are vectors of dimension 2, | ||
| 70 | * the cross-product of x and y interpreted as | ||
| 71 | * vectors in the z == 0 plane of a three- | ||
| 72 | * dimensional space. | ||
| 73 | * | ||
| 74 | * If x and y are vectors with a length that | ||
| 75 | * is neither 2 nor 3, this operation is not | ||
| 76 | * available. | ||
| 77 | * | ||
| 78 | * simd_reflect(x,n) Reflects x through the plane perpendicular | ||
| 79 | * to the normal vector n. Only available | ||
| 80 | * for vectors of length 2, 3, or 4. | ||
| 81 | * | ||
| 82 | * simd_refract(x,n,eta) Calculates the refraction direction given | ||
| 83 | * unit incident vector x, unit normal vector | ||
| 84 | * n, and index of refraction eta. If the | ||
| 85 | * angle between the incident vector and the | ||
| 86 | * surface normal is too great for the | ||
| 87 | * specified index of refraction, zero is | ||
| 88 | * returned. | ||
| 89 | * Available for vectors of length 2, 3, or 4. | ||
| 90 | * | ||
| 91 | * In C++ the following geometric functions are available in the simd:: | ||
| 92 | * namespace: | ||
| 93 | * | ||
| 94 | * C++ Function Equivalent C Function | ||
| 95 | * ----------------------------------------------------------- | ||
| 96 | * simd::dot(x,y) simd_dot(x,y) | ||
| 97 | * simd::project(x,y) simd_project(x,y) | ||
| 98 | * simd::length_squared(x) simd_length_squared(x) | ||
| 99 | * simd::length(x) simd_length(x) | ||
| 100 | * simd::distance_squared(x,y) simd_distance_squared(x,y) | ||
| 101 | * simd::norm_one(x) simd_norm_one(x) | ||
| 102 | * simd::norm_inf(x) simd_norm_inf(x) | ||
| 103 | * simd::distance(x,y) simd_distance(x,y) | ||
| 104 | * simd::normalize(x) simd_normalize(x) | ||
| 105 | * simd::cross(x,y) simd_cross(x,y) | ||
| 106 | * simd::reflect(x,n) simd_reflect(x,n) | ||
| 107 | * simd::refract(x,n,eta) simd_refract(x,n,eta) | ||
| 108 | * | ||
| 109 | * simd::precise::project(x,y) simd_precise_project(x,y) | ||
| 110 | * simd::precise::length(x) simd_precise_length(x) | ||
| 111 | * simd::precise::distance(x,y) simd_precise_distance(x,y) | ||
| 112 | * simd::precise::normalize(x) simd_precise_normalize(x) | ||
| 113 | * | ||
| 114 | * simd::fast::project(x,y) simd_fast_project(x,y) | ||
| 115 | * simd::fast::length(x) simd_fast_length(x) | ||
| 116 | * simd::fast::distance(x,y) simd_fast_distance(x,y) | ||
| 117 | * simd::fast::normalize(x) simd_fast_normalize(x) | ||
| 118 | */ | ||
| 119 | |||
| 120 | #ifndef __SIMD_GEOMETRY_HEADER__ | ||
| 121 | #define __SIMD_GEOMETRY_HEADER__ | ||
| 122 | |||
| 123 | #include <simd/base.h> | ||
| 124 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 125 | #include <simd/vector_types.h> | ||
| 126 | #include <simd/common.h> | ||
| 127 | #include <simd/extern.h> | ||
| 128 | |||
| 129 | #ifdef __cplusplus | ||
| 130 | extern "C" { | ||
| 131 | #endif | ||
| 132 | |||
| 133 | static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y); | ||
| 134 | static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y); | ||
| 135 | static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y); | ||
| 136 | static float SIMD_CFUNC simd_dot(simd_float8 __x, simd_float8 __y); | ||
| 137 | static float SIMD_CFUNC simd_dot(simd_float16 __x, simd_float16 __y); | ||
| 138 | static double SIMD_CFUNC simd_dot(simd_double2 __x, simd_double2 __y); | ||
| 139 | static double SIMD_CFUNC simd_dot(simd_double3 __x, simd_double3 __y); | ||
| 140 | static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y); | ||
| 141 | static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y); | ||
| 142 | #define vector_dot simd_dot | ||
| 143 | |||
| 144 | static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y); | ||
| 145 | static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y); | ||
| 146 | static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y); | ||
| 147 | static simd_float8 SIMD_CFUNC simd_precise_project(simd_float8 __x, simd_float8 __y); | ||
| 148 | static simd_float16 SIMD_CFUNC simd_precise_project(simd_float16 __x, simd_float16 __y); | ||
| 149 | static simd_double2 SIMD_CFUNC simd_precise_project(simd_double2 __x, simd_double2 __y); | ||
| 150 | static simd_double3 SIMD_CFUNC simd_precise_project(simd_double3 __x, simd_double3 __y); | ||
| 151 | static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y); | ||
| 152 | static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y); | ||
| 153 | #define vector_precise_project simd_precise_project | ||
| 154 | |||
| 155 | static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y); | ||
| 156 | static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y); | ||
| 157 | static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y); | ||
| 158 | static simd_float8 SIMD_CFUNC simd_fast_project(simd_float8 __x, simd_float8 __y); | ||
| 159 | static simd_float16 SIMD_CFUNC simd_fast_project(simd_float16 __x, simd_float16 __y); | ||
| 160 | static simd_double2 SIMD_CFUNC simd_fast_project(simd_double2 __x, simd_double2 __y); | ||
| 161 | static simd_double3 SIMD_CFUNC simd_fast_project(simd_double3 __x, simd_double3 __y); | ||
| 162 | static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4 __y); | ||
| 163 | static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y); | ||
| 164 | #define vector_fast_project simd_fast_project | ||
| 165 | |||
| 166 | static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y); | ||
| 167 | static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y); | ||
| 168 | static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y); | ||
| 169 | static simd_float8 SIMD_CFUNC simd_project(simd_float8 __x, simd_float8 __y); | ||
| 170 | static simd_float16 SIMD_CFUNC simd_project(simd_float16 __x, simd_float16 __y); | ||
| 171 | static simd_double2 SIMD_CFUNC simd_project(simd_double2 __x, simd_double2 __y); | ||
| 172 | static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y); | ||
| 173 | static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y); | ||
| 174 | static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y); | ||
| 175 | #define vector_project simd_project | ||
| 176 | |||
| 177 | static float SIMD_CFUNC simd_precise_length(simd_float2 __x); | ||
| 178 | static float SIMD_CFUNC simd_precise_length(simd_float3 __x); | ||
| 179 | static float SIMD_CFUNC simd_precise_length(simd_float4 __x); | ||
| 180 | static float SIMD_CFUNC simd_precise_length(simd_float8 __x); | ||
| 181 | static float SIMD_CFUNC simd_precise_length(simd_float16 __x); | ||
| 182 | static double SIMD_CFUNC simd_precise_length(simd_double2 __x); | ||
| 183 | static double SIMD_CFUNC simd_precise_length(simd_double3 __x); | ||
| 184 | static double SIMD_CFUNC simd_precise_length(simd_double4 __x); | ||
| 185 | static double SIMD_CFUNC simd_precise_length(simd_double8 __x); | ||
| 186 | #define vector_precise_length simd_precise_length | ||
| 187 | |||
| 188 | static float SIMD_CFUNC simd_fast_length(simd_float2 __x); | ||
| 189 | static float SIMD_CFUNC simd_fast_length(simd_float3 __x); | ||
| 190 | static float SIMD_CFUNC simd_fast_length(simd_float4 __x); | ||
| 191 | static float SIMD_CFUNC simd_fast_length(simd_float8 __x); | ||
| 192 | static float SIMD_CFUNC simd_fast_length(simd_float16 __x); | ||
| 193 | static double SIMD_CFUNC simd_fast_length(simd_double2 __x); | ||
| 194 | static double SIMD_CFUNC simd_fast_length(simd_double3 __x); | ||
| 195 | static double SIMD_CFUNC simd_fast_length(simd_double4 __x); | ||
| 196 | static double SIMD_CFUNC simd_fast_length(simd_double8 __x); | ||
| 197 | #define vector_fast_length simd_fast_length | ||
| 198 | |||
| 199 | static float SIMD_CFUNC simd_length(simd_float2 __x); | ||
| 200 | static float SIMD_CFUNC simd_length(simd_float3 __x); | ||
| 201 | static float SIMD_CFUNC simd_length(simd_float4 __x); | ||
| 202 | static float SIMD_CFUNC simd_length(simd_float8 __x); | ||
| 203 | static float SIMD_CFUNC simd_length(simd_float16 __x); | ||
| 204 | static double SIMD_CFUNC simd_length(simd_double2 __x); | ||
| 205 | static double SIMD_CFUNC simd_length(simd_double3 __x); | ||
| 206 | static double SIMD_CFUNC simd_length(simd_double4 __x); | ||
| 207 | static double SIMD_CFUNC simd_length(simd_double8 __x); | ||
| 208 | #define vector_length simd_length | ||
| 209 | |||
| 210 | static float SIMD_CFUNC simd_length_squared(simd_float2 __x); | ||
| 211 | static float SIMD_CFUNC simd_length_squared(simd_float3 __x); | ||
| 212 | static float SIMD_CFUNC simd_length_squared(simd_float4 __x); | ||
| 213 | static float SIMD_CFUNC simd_length_squared(simd_float8 __x); | ||
| 214 | static float SIMD_CFUNC simd_length_squared(simd_float16 __x); | ||
| 215 | static double SIMD_CFUNC simd_length_squared(simd_double2 __x); | ||
| 216 | static double SIMD_CFUNC simd_length_squared(simd_double3 __x); | ||
| 217 | static double SIMD_CFUNC simd_length_squared(simd_double4 __x); | ||
| 218 | static double SIMD_CFUNC simd_length_squared(simd_double8 __x); | ||
| 219 | #define vector_length_squared simd_length_squared | ||
| 220 | |||
| 221 | static float SIMD_CFUNC simd_norm_one(simd_float2 __x); | ||
| 222 | static float SIMD_CFUNC simd_norm_one(simd_float3 __x); | ||
| 223 | static float SIMD_CFUNC simd_norm_one(simd_float4 __x); | ||
| 224 | static float SIMD_CFUNC simd_norm_one(simd_float8 __x); | ||
| 225 | static float SIMD_CFUNC simd_norm_one(simd_float16 __x); | ||
| 226 | static double SIMD_CFUNC simd_norm_one(simd_double2 __x); | ||
| 227 | static double SIMD_CFUNC simd_norm_one(simd_double3 __x); | ||
| 228 | static double SIMD_CFUNC simd_norm_one(simd_double4 __x); | ||
| 229 | static double SIMD_CFUNC simd_norm_one(simd_double8 __x); | ||
| 230 | #define vector_norm_one simd_norm_one | ||
| 231 | |||
| 232 | static float SIMD_CFUNC simd_norm_inf(simd_float2 __x); | ||
| 233 | static float SIMD_CFUNC simd_norm_inf(simd_float3 __x); | ||
| 234 | static float SIMD_CFUNC simd_norm_inf(simd_float4 __x); | ||
| 235 | static float SIMD_CFUNC simd_norm_inf(simd_float8 __x); | ||
| 236 | static float SIMD_CFUNC simd_norm_inf(simd_float16 __x); | ||
| 237 | static double SIMD_CFUNC simd_norm_inf(simd_double2 __x); | ||
| 238 | static double SIMD_CFUNC simd_norm_inf(simd_double3 __x); | ||
| 239 | static double SIMD_CFUNC simd_norm_inf(simd_double4 __x); | ||
| 240 | static double SIMD_CFUNC simd_norm_inf(simd_double8 __x); | ||
| 241 | #define vector_norm_inf simd_norm_inf | ||
| 242 | |||
| 243 | static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y); | ||
| 244 | static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y); | ||
| 245 | static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y); | ||
| 246 | static float SIMD_CFUNC simd_precise_distance(simd_float8 __x, simd_float8 __y); | ||
| 247 | static float SIMD_CFUNC simd_precise_distance(simd_float16 __x, simd_float16 __y); | ||
| 248 | static double SIMD_CFUNC simd_precise_distance(simd_double2 __x, simd_double2 __y); | ||
| 249 | static double SIMD_CFUNC simd_precise_distance(simd_double3 __x, simd_double3 __y); | ||
| 250 | static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y); | ||
| 251 | static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y); | ||
| 252 | #define vector_precise_distance simd_precise_distance | ||
| 253 | |||
| 254 | static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y); | ||
| 255 | static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y); | ||
| 256 | static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y); | ||
| 257 | static float SIMD_CFUNC simd_fast_distance(simd_float8 __x, simd_float8 __y); | ||
| 258 | static float SIMD_CFUNC simd_fast_distance(simd_float16 __x, simd_float16 __y); | ||
| 259 | static double SIMD_CFUNC simd_fast_distance(simd_double2 __x, simd_double2 __y); | ||
| 260 | static double SIMD_CFUNC simd_fast_distance(simd_double3 __x, simd_double3 __y); | ||
| 261 | static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y); | ||
| 262 | static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y); | ||
| 263 | #define vector_fast_distance simd_fast_distance | ||
| 264 | |||
| 265 | static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y); | ||
| 266 | static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y); | ||
| 267 | static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y); | ||
| 268 | static float SIMD_CFUNC simd_distance(simd_float8 __x, simd_float8 __y); | ||
| 269 | static float SIMD_CFUNC simd_distance(simd_float16 __x, simd_float16 __y); | ||
| 270 | static double SIMD_CFUNC simd_distance(simd_double2 __x, simd_double2 __y); | ||
| 271 | static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y); | ||
| 272 | static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y); | ||
| 273 | static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y); | ||
| 274 | #define vector_distance simd_distance | ||
| 275 | |||
| 276 | static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y); | ||
| 277 | static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y); | ||
| 278 | static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y); | ||
| 279 | static float SIMD_CFUNC simd_distance_squared(simd_float8 __x, simd_float8 __y); | ||
| 280 | static float SIMD_CFUNC simd_distance_squared(simd_float16 __x, simd_float16 __y); | ||
| 281 | static double SIMD_CFUNC simd_distance_squared(simd_double2 __x, simd_double2 __y); | ||
| 282 | static double SIMD_CFUNC simd_distance_squared(simd_double3 __x, simd_double3 __y); | ||
| 283 | static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y); | ||
| 284 | static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y); | ||
| 285 | #define vector_distance_squared simd_distance_squared | ||
| 286 | |||
| 287 | static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x); | ||
| 288 | static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x); | ||
| 289 | static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x); | ||
| 290 | static simd_float8 SIMD_CFUNC simd_precise_normalize(simd_float8 __x); | ||
| 291 | static simd_float16 SIMD_CFUNC simd_precise_normalize(simd_float16 __x); | ||
| 292 | static simd_double2 SIMD_CFUNC simd_precise_normalize(simd_double2 __x); | ||
| 293 | static simd_double3 SIMD_CFUNC simd_precise_normalize(simd_double3 __x); | ||
| 294 | static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x); | ||
| 295 | static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x); | ||
| 296 | #define vector_precise_normalize simd_precise_normalize | ||
| 297 | |||
| 298 | static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x); | ||
| 299 | static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x); | ||
| 300 | static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x); | ||
| 301 | static simd_float8 SIMD_CFUNC simd_fast_normalize(simd_float8 __x); | ||
| 302 | static simd_float16 SIMD_CFUNC simd_fast_normalize(simd_float16 __x); | ||
| 303 | static simd_double2 SIMD_CFUNC simd_fast_normalize(simd_double2 __x); | ||
| 304 | static simd_double3 SIMD_CFUNC simd_fast_normalize(simd_double3 __x); | ||
| 305 | static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x); | ||
| 306 | static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x); | ||
| 307 | #define vector_fast_normalize simd_fast_normalize | ||
| 308 | |||
| 309 | static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x); | ||
| 310 | static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x); | ||
| 311 | static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x); | ||
| 312 | static simd_float8 SIMD_CFUNC simd_normalize(simd_float8 __x); | ||
| 313 | static simd_float16 SIMD_CFUNC simd_normalize(simd_float16 __x); | ||
| 314 | static simd_double2 SIMD_CFUNC simd_normalize(simd_double2 __x); | ||
| 315 | static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x); | ||
| 316 | static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x); | ||
| 317 | static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x); | ||
| 318 | #define vector_normalize simd_normalize | ||
| 319 | |||
| 320 | static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y); | ||
| 321 | static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y); | ||
| 322 | static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y); | ||
| 323 | static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y); | ||
| 324 | #define vector_cross simd_cross | ||
| 325 | |||
| 326 | static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n); | ||
| 327 | static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n); | ||
| 328 | static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n); | ||
| 329 | static simd_double2 SIMD_CFUNC simd_reflect(simd_double2 __x, simd_double2 __n); | ||
| 330 | static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n); | ||
| 331 | static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n); | ||
| 332 | #define vector_reflect simd_reflect | ||
| 333 | |||
| 334 | static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta); | ||
| 335 | static simd_float3 SIMD_CFUNC simd_refract(simd_float3 __x, simd_float3 __n, float __eta); | ||
| 336 | static simd_float4 SIMD_CFUNC simd_refract(simd_float4 __x, simd_float4 __n, float __eta); | ||
| 337 | static simd_double2 SIMD_CFUNC simd_refract(simd_double2 __x, simd_double2 __n, double __eta); | ||
| 338 | static simd_double3 SIMD_CFUNC simd_refract(simd_double3 __x, simd_double3 __n, double __eta); | ||
| 339 | static simd_double4 SIMD_CFUNC simd_refract(simd_double4 __x, simd_double4 __n, double __eta); | ||
| 340 | #define vector_refract simd_refract | ||
| 341 | |||
| 342 | #if SIMD_LIBRARY_VERSION >= 2 | ||
| 343 | /* These functions require that you are building for OS X 10.12 or later, | ||
| 344 | * iOS 10.0 or later, watchOS 3.0 or later, and tvOS 10.0 or later. On | ||
| 345 | * earlier OS versions, the library functions that implement these | ||
| 346 | * operations are not available. */ | ||
| 347 | |||
| 348 | /*! @functiongroup vector orientation | ||
| 349 | * | ||
| 350 | * @discussion These functions return a positive value if the origin and | ||
| 351 | * their ordered arguments determine a positively oriented parallelepiped, | ||
| 352 | * zero if it is degenerate, and a negative value if it is negatively | ||
| 353 | * oriented. This is equivalent to saying that the matrix with rows equal | ||
| 354 | * to the vectors has a positive, zero, or negative determinant, | ||
| 355 | * respectively. | ||
| 356 | * | ||
| 357 | * Naive evaluation of the determinant is prone to producing incorrect | ||
| 358 | * results if the vectors are nearly degenerate (e.g. floating-point | ||
| 359 | * rounding might cause the determinant to be zero or negative when | ||
| 360 | * the points are very nearly coplanar but positively oriented). If | ||
| 361 | * the vectors are very large or small, computing the determininat is | ||
| 362 | * also prone to premature overflow, which may cause the result to be | ||
| 363 | * NaN even though the vectors contain normal floating-point numbers. | ||
| 364 | * | ||
| 365 | * These routines take care to avoid those issues and always return a | ||
| 366 | * result with correct sign, even when the problem is very ill- | ||
| 367 | * conditioned. */ | ||
| 368 | |||
| 369 | /*! @abstract Test the orientation of two 2d vectors. | ||
| 370 | * | ||
| 371 | * @param __x The first vector. | ||
| 372 | * @param __y The second vector. | ||
| 373 | * | ||
| 374 | * @result Positive if (x, y) are positively oriented, zero if they are | ||
| 375 | * colinear, and negative if they are negatively oriented. | ||
| 376 | * | ||
| 377 | * @discussion For two-dimensional vectors, "positively oriented" is | ||
| 378 | * equivalent to the ordering (0, x, y) proceeding counter-clockwise | ||
| 379 | * when viewed down the z axis, or to the cross product of x and y | ||
| 380 | * extended to three-dimensions having positive z-component. */ | ||
| 381 | static float SIMD_CFUNC simd_orient(simd_float2 __x, simd_float2 __y); | ||
| 382 | |||
| 383 | /*! @abstract Test the orientation of two 2d vectors. | ||
| 384 | * | ||
| 385 | * @param __x The first vector. | ||
| 386 | * @param __y The second vector. | ||
| 387 | * | ||
| 388 | * @result Positive if (x, y) are positively oriented, zero if they are | ||
| 389 | * colinear, and negative if they are negatively oriented. | ||
| 390 | * | ||
| 391 | * @discussion For two-dimensional vectors, "positively oriented" is | ||
| 392 | * equivalent to the ordering (0, x, y) proceeding counter- clockwise | ||
| 393 | * when viewed down the z axis, or to the cross product of x and y | ||
| 394 | * extended to three-dimensions having positive z-component. */ | ||
| 395 | static double SIMD_CFUNC simd_orient(simd_double2 __x, simd_double2 __y); | ||
| 396 | |||
| 397 | /*! @abstract Test the orientation of three 3d vectors. | ||
| 398 | * | ||
| 399 | * @param __x The first vector. | ||
| 400 | * @param __y The second vector. | ||
| 401 | * @param __z The third vector. | ||
| 402 | * | ||
| 403 | * @result Positive if (x, y, z) are positively oriented, zero if they | ||
| 404 | * are coplanar, and negative if they are negatively oriented. | ||
| 405 | * | ||
| 406 | * @discussion For three-dimensional vectors, "positively oriented" is | ||
| 407 | * equivalent to the ordering (x, y, z) following the "right hand rule", | ||
| 408 | * or to the dot product of z with the cross product of x and y being | ||
| 409 | * positive. */ | ||
| 410 | static float SIMD_CFUNC simd_orient(simd_float3 __x, simd_float3 __y, simd_float3 __z); | ||
| 411 | |||
| 412 | /*! @abstract Test the orientation of three 3d vectors. | ||
| 413 | * | ||
| 414 | * @param __x The first vector. | ||
| 415 | * @param __y The second vector. | ||
| 416 | * @param __z The third vector. | ||
| 417 | * | ||
| 418 | * @result Positive if (x, y, c) are positively oriented, zero if they | ||
| 419 | * are coplanar, and negative if they are negatively oriented. | ||
| 420 | * | ||
| 421 | * @discussion For three-dimensional vectors, "positively oriented" is | ||
| 422 | * equivalent to the ordering (x, y, z) following the "right hand rule", | ||
| 423 | * or to the dot product of z with the cross product of x and y being | ||
| 424 | * positive. */ | ||
| 425 | static double SIMD_CFUNC simd_orient(simd_double3 __x, simd_double3 __y, simd_double3 __z); | ||
| 426 | |||
| 427 | /*! @functiongroup point (affine) orientation | ||
| 428 | * | ||
| 429 | * @discussion These functions return a positive value if their ordered | ||
| 430 | * arguments determine a positively oriented parallelepiped, zero if it | ||
| 431 | * is degenerate, and a negative value if it is negatively oriented. | ||
| 432 | * | ||
| 433 | * simd_orient(a, b, c) is formally equivalent to simd_orient(b-a, c-a), | ||
| 434 | * but it is not effected by rounding error from subtraction of points, | ||
| 435 | * as that implementation would be. Care is taken so that the sign of | ||
| 436 | * the result is always correct, even if the problem is ill-conditioned. */ | ||
| 437 | |||
| 438 | /*! @abstract Test the orientation of a triangle in 2d. | ||
| 439 | * | ||
| 440 | * @param __a The first point of the triangle. | ||
| 441 | * @param __b The second point of the triangle. | ||
| 442 | * @param __c The third point of the triangle. | ||
| 443 | * | ||
| 444 | * @result Positive if the triangle is positively oriented, zero if it | ||
| 445 | * is degenerate (three points in a line), and negative if it is negatively | ||
| 446 | * oriented. | ||
| 447 | * | ||
| 448 | * @discussion "Positively oriented" is equivalent to the ordering | ||
| 449 | * (a, b, c) proceeding counter-clockwise when viewed down the z axis, | ||
| 450 | * or to the cross product of a-c and b-c extended to three-dimensions | ||
| 451 | * having positive z-component. */ | ||
| 452 | static float SIMD_CFUNC simd_orient(simd_float2 __a, simd_float2 __b, simd_float2 __c); | ||
| 453 | |||
| 454 | /*! @abstract Test the orientation of a triangle in 2d. | ||
| 455 | * | ||
| 456 | * @param __a The first point of the triangle. | ||
| 457 | * @param __b The second point of the triangle. | ||
| 458 | * @param __c The third point of the triangle. | ||
| 459 | * | ||
| 460 | * @result Positive if the triangle is positively oriented, zero if it | ||
| 461 | * is degenerate (three points in a line), and negative if it is negatively | ||
| 462 | * oriented. | ||
| 463 | * | ||
| 464 | * @discussion "Positively oriented" is equivalent to the ordering | ||
| 465 | * (a, b, c) proceeding counter-clockwise when viewed down the z axis, | ||
| 466 | * or to the cross product of a-c and b-c extended to three-dimensions | ||
| 467 | * having positive z-component. */ | ||
| 468 | static double SIMD_CFUNC simd_orient(simd_double2 __a, simd_double2 __b, simd_double2 __c); | ||
| 469 | |||
| 470 | /*! @abstract Test the orientation of a tetrahedron in 3d. | ||
| 471 | * | ||
| 472 | * @param __a The first point of the tetrahedron. | ||
| 473 | * @param __b The second point of the tetrahedron. | ||
| 474 | * @param __c The third point of the tetrahedron. | ||
| 475 | * @param __d The fourth point of the tetrahedron. | ||
| 476 | * | ||
| 477 | * @result Positive if the tetrahedron is positively oriented, zero if it | ||
| 478 | * is degenerate (four points in a plane), and negative if it is negatively | ||
| 479 | * oriented. | ||
| 480 | * | ||
| 481 | * @discussion "Positively oriented" is equivalent to the vectors | ||
| 482 | * (a-d, b-d, c-d) following the "right hand rule", or to the dot product | ||
| 483 | * of c-d with the the cross product of a-d and b-d being positive. */ | ||
| 484 | static float SIMD_CFUNC simd_orient(simd_float3 __a, simd_float3 __b, simd_float3 __c, simd_float3 __d); | ||
| 485 | |||
| 486 | /*! @abstract Test the orientation of a tetrahedron in 3d. | ||
| 487 | * | ||
| 488 | * @param __a The first point of the tetrahedron. | ||
| 489 | * @param __b The second point of the tetrahedron. | ||
| 490 | * @param __c The third point of the tetrahedron. | ||
| 491 | * @param __d The fourth point of the tetrahedron. | ||
| 492 | * | ||
| 493 | * @result Positive if the tetrahedron is positively oriented, zero if it | ||
| 494 | * is degenerate (four points in a plane), and negative if it is negatively | ||
| 495 | * oriented. | ||
| 496 | * | ||
| 497 | * @discussion "Positively oriented" is equivalent to the vectors | ||
| 498 | * (a-d, b-d, c-d) following the "right hand rule", or to the dot product | ||
| 499 | * of c-d with the the cross product of a-d and b-d being positive. */ | ||
| 500 | static double SIMD_CFUNC simd_orient(simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d); | ||
| 501 | |||
| 502 | /*! @functiongroup incircle (points) tests | ||
| 503 | * | ||
| 504 | * @discussion These functions determine whether the point x is inside, on, | ||
| 505 | * or outside the circle or sphere passing through a group of points. If | ||
| 506 | * x is inside the circle, the result is positive; if x is on the circle, | ||
| 507 | * the result is zero; if x is outside the circle the result is negative. | ||
| 508 | * | ||
| 509 | * These functions are always exact, even if the problem is ill- | ||
| 510 | * conditioned (meaning that the points are nearly co-linear or | ||
| 511 | * co-planar). | ||
| 512 | * | ||
| 513 | * If the points are negatively-oriented, the the notions of "inside" and | ||
| 514 | * "outside" are flipped. If the points are degenerate, then the result | ||
| 515 | * is undefined. */ | ||
| 516 | |||
| 517 | /*! @abstract Test if x lies inside, on, or outside the circle passing | ||
| 518 | * through a, b, and c. | ||
| 519 | * | ||
| 520 | * @param __x The point being tested. | ||
| 521 | * @param __a The first point determining the circle. | ||
| 522 | * @param __b The second point determining the circle. | ||
| 523 | * @param __c The third point determining the circle. | ||
| 524 | * | ||
| 525 | * @result Assuming that (a,b,c) are positively-oriented, positive if x is | ||
| 526 | * inside the circle, zero if x is on the circle, and negative if x is | ||
| 527 | * outside the circle. The sign of the result is flipped if (a,b,c) are | ||
| 528 | * negatively-oriented. */ | ||
| 529 | static float SIMD_CFUNC simd_incircle(simd_float2 __x, simd_float2 __a, simd_float2 __b, simd_float2 __c); | ||
| 530 | |||
| 531 | /*! @abstract Test if x lies inside, on, or outside the circle passing | ||
| 532 | * through a, b, and c. | ||
| 533 | * | ||
| 534 | * @param __x The point being tested. | ||
| 535 | * @param __a The first point determining the circle. | ||
| 536 | * @param __b The second point determining the circle. | ||
| 537 | * @param __c The third point determining the circle. | ||
| 538 | * | ||
| 539 | * @result Assuming that (a,b,c) are positively-oriented, positive if x is | ||
| 540 | * inside the circle, zero if x is on the circle, and negative if x is | ||
| 541 | * outside the circle. The sign of the result is flipped if (a,b,c) are | ||
| 542 | * negatively-oriented. */ | ||
| 543 | static double SIMD_CFUNC simd_incircle(simd_double2 __x, simd_double2 __a, simd_double2 __b, simd_double2 __c); | ||
| 544 | |||
| 545 | /*! @abstract Test if x lies inside, on, or outside the sphere passing | ||
| 546 | * through a, b, c, and d. | ||
| 547 | * | ||
| 548 | * @param __x The point being tested. | ||
| 549 | * @param __a The first point determining the sphere. | ||
| 550 | * @param __b The second point determining the sphere. | ||
| 551 | * @param __c The third point determining the sphere. | ||
| 552 | * @param __d The fourth point determining the sphere. | ||
| 553 | * | ||
| 554 | * @result Assuming that the points are positively-oriented, positive if x | ||
| 555 | * is inside the sphere, zero if x is on the sphere, and negative if x is | ||
| 556 | * outside the sphere. The sign of the result is flipped if the points are | ||
| 557 | * negatively-oriented. */ | ||
| 558 | static float SIMD_CFUNC simd_insphere(simd_float3 __x, simd_float3 __a, simd_float3 __b, simd_float3 __c, simd_float3 __d); | ||
| 559 | |||
| 560 | /*! @abstract Test if x lies inside, on, or outside the sphere passing | ||
| 561 | * through a, b, c, and d. | ||
| 562 | * | ||
| 563 | * @param __x The point being tested. | ||
| 564 | * @param __a The first point determining the sphere. | ||
| 565 | * @param __b The second point determining the sphere. | ||
| 566 | * @param __c The third point determining the sphere. | ||
| 567 | * @param __d The fourth point determining the sphere. | ||
| 568 | * | ||
| 569 | * @result Assuming that the points are positively-oriented, positive if x | ||
| 570 | * is inside the sphere, zero if x is on the sphere, and negative if x is | ||
| 571 | * outside the sphere. The sign of the result is flipped if the points are | ||
| 572 | * negatively-oriented. */ | ||
| 573 | static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d); | ||
| 574 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 575 | |||
| 576 | #ifdef __cplusplus | ||
| 577 | } /* extern "C" */ | ||
| 578 | |||
| 579 | namespace simd { | ||
| 580 | static SIMD_CPPFUNC float dot(const float2 x, const float2 y) { return ::simd_dot(x, y); } | ||
| 581 | static SIMD_CPPFUNC float dot(const float3 x, const float3 y) { return ::simd_dot(x, y); } | ||
| 582 | static SIMD_CPPFUNC float dot(const float4 x, const float4 y) { return ::simd_dot(x, y); } | ||
| 583 | static SIMD_CPPFUNC float dot(const float8 x, const float8 y) { return ::simd_dot(x, y); } | ||
| 584 | static SIMD_CPPFUNC float dot(const float16 x, const float16 y) { return ::simd_dot(x, y); } | ||
| 585 | static SIMD_CPPFUNC double dot(const double2 x, const double2 y) { return ::simd_dot(x, y); } | ||
| 586 | static SIMD_CPPFUNC double dot(const double3 x, const double3 y) { return ::simd_dot(x, y); } | ||
| 587 | static SIMD_CPPFUNC double dot(const double4 x, const double4 y) { return ::simd_dot(x, y); } | ||
| 588 | static SIMD_CPPFUNC double dot(const double8 x, const double8 y) { return ::simd_dot(x, y); } | ||
| 589 | |||
| 590 | static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_project(x, y); } | ||
| 591 | static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_project(x, y); } | ||
| 592 | static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_project(x, y); } | ||
| 593 | static SIMD_CPPFUNC float8 project(const float8 x, const float8 y) { return ::simd_project(x, y); } | ||
| 594 | static SIMD_CPPFUNC float16 project(const float16 x, const float16 y) { return ::simd_project(x, y); } | ||
| 595 | static SIMD_CPPFUNC double2 project(const double2 x, const double2 y) { return ::simd_project(x, y); } | ||
| 596 | static SIMD_CPPFUNC double3 project(const double3 x, const double3 y) { return ::simd_project(x, y); } | ||
| 597 | static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_project(x, y); } | ||
| 598 | static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_project(x, y); } | ||
| 599 | |||
| 600 | static SIMD_CPPFUNC float length_squared(const float2 x) { return ::simd_length_squared(x); } | ||
| 601 | static SIMD_CPPFUNC float length_squared(const float3 x) { return ::simd_length_squared(x); } | ||
| 602 | static SIMD_CPPFUNC float length_squared(const float4 x) { return ::simd_length_squared(x); } | ||
| 603 | static SIMD_CPPFUNC float length_squared(const float8 x) { return ::simd_length_squared(x); } | ||
| 604 | static SIMD_CPPFUNC float length_squared(const float16 x) { return ::simd_length_squared(x); } | ||
| 605 | static SIMD_CPPFUNC double length_squared(const double2 x) { return ::simd_length_squared(x); } | ||
| 606 | static SIMD_CPPFUNC double length_squared(const double3 x) { return ::simd_length_squared(x); } | ||
| 607 | static SIMD_CPPFUNC double length_squared(const double4 x) { return ::simd_length_squared(x); } | ||
| 608 | static SIMD_CPPFUNC double length_squared(const double8 x) { return ::simd_length_squared(x); } | ||
| 609 | |||
| 610 | static SIMD_CPPFUNC float norm_one(const float2 x) { return ::simd_norm_one(x); } | ||
| 611 | static SIMD_CPPFUNC float norm_one(const float3 x) { return ::simd_norm_one(x); } | ||
| 612 | static SIMD_CPPFUNC float norm_one(const float4 x) { return ::simd_norm_one(x); } | ||
| 613 | static SIMD_CPPFUNC float norm_one(const float8 x) { return ::simd_norm_one(x); } | ||
| 614 | static SIMD_CPPFUNC float norm_one(const float16 x) { return ::simd_norm_one(x); } | ||
| 615 | static SIMD_CPPFUNC double norm_one(const double2 x) { return ::simd_norm_one(x); } | ||
| 616 | static SIMD_CPPFUNC double norm_one(const double3 x) { return ::simd_norm_one(x); } | ||
| 617 | static SIMD_CPPFUNC double norm_one(const double4 x) { return ::simd_norm_one(x); } | ||
| 618 | static SIMD_CPPFUNC double norm_one(const double8 x) { return ::simd_norm_one(x); } | ||
| 619 | |||
| 620 | static SIMD_CPPFUNC float norm_inf(const float2 x) { return ::simd_norm_inf(x); } | ||
| 621 | static SIMD_CPPFUNC float norm_inf(const float3 x) { return ::simd_norm_inf(x); } | ||
| 622 | static SIMD_CPPFUNC float norm_inf(const float4 x) { return ::simd_norm_inf(x); } | ||
| 623 | static SIMD_CPPFUNC float norm_inf(const float8 x) { return ::simd_norm_inf(x); } | ||
| 624 | static SIMD_CPPFUNC float norm_inf(const float16 x) { return ::simd_norm_inf(x); } | ||
| 625 | static SIMD_CPPFUNC double norm_inf(const double2 x) { return ::simd_norm_inf(x); } | ||
| 626 | static SIMD_CPPFUNC double norm_inf(const double3 x) { return ::simd_norm_inf(x); } | ||
| 627 | static SIMD_CPPFUNC double norm_inf(const double4 x) { return ::simd_norm_inf(x); } | ||
| 628 | static SIMD_CPPFUNC double norm_inf(const double8 x) { return ::simd_norm_inf(x); } | ||
| 629 | |||
| 630 | static SIMD_CPPFUNC float length(const float2 x) { return ::simd_length(x); } | ||
| 631 | static SIMD_CPPFUNC float length(const float3 x) { return ::simd_length(x); } | ||
| 632 | static SIMD_CPPFUNC float length(const float4 x) { return ::simd_length(x); } | ||
| 633 | static SIMD_CPPFUNC float length(const float8 x) { return ::simd_length(x); } | ||
| 634 | static SIMD_CPPFUNC float length(const float16 x) { return ::simd_length(x); } | ||
| 635 | static SIMD_CPPFUNC double length(const double2 x) { return ::simd_length(x); } | ||
| 636 | static SIMD_CPPFUNC double length(const double3 x) { return ::simd_length(x); } | ||
| 637 | static SIMD_CPPFUNC double length(const double4 x) { return ::simd_length(x); } | ||
| 638 | static SIMD_CPPFUNC double length(const double8 x) { return ::simd_length(x); } | ||
| 639 | |||
| 640 | static SIMD_CPPFUNC float distance_squared(const float2 x, const float2 y) { return ::simd_distance_squared(x, y); } | ||
| 641 | static SIMD_CPPFUNC float distance_squared(const float3 x, const float3 y) { return ::simd_distance_squared(x, y); } | ||
| 642 | static SIMD_CPPFUNC float distance_squared(const float4 x, const float4 y) { return ::simd_distance_squared(x, y); } | ||
| 643 | static SIMD_CPPFUNC float distance_squared(const float8 x, const float8 y) { return ::simd_distance_squared(x, y); } | ||
| 644 | static SIMD_CPPFUNC float distance_squared(const float16 x, const float16 y) { return ::simd_distance_squared(x, y); } | ||
| 645 | static SIMD_CPPFUNC double distance_squared(const double2 x, const double2 y) { return ::simd_distance_squared(x, y); } | ||
| 646 | static SIMD_CPPFUNC double distance_squared(const double3 x, const double3 y) { return ::simd_distance_squared(x, y); } | ||
| 647 | static SIMD_CPPFUNC double distance_squared(const double4 x, const double4 y) { return ::simd_distance_squared(x, y); } | ||
| 648 | static SIMD_CPPFUNC double distance_squared(const double8 x, const double8 y) { return ::simd_distance_squared(x, y); } | ||
| 649 | |||
| 650 | static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_distance(x, y); } | ||
| 651 | static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_distance(x, y); } | ||
| 652 | static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_distance(x, y); } | ||
| 653 | static SIMD_CPPFUNC float distance(const float8 x, const float8 y) { return ::simd_distance(x, y); } | ||
| 654 | static SIMD_CPPFUNC float distance(const float16 x, const float16 y) { return ::simd_distance(x, y); } | ||
| 655 | static SIMD_CPPFUNC double distance(const double2 x, const double2 y) { return ::simd_distance(x, y); } | ||
| 656 | static SIMD_CPPFUNC double distance(const double3 x, const double3 y) { return ::simd_distance(x, y); } | ||
| 657 | static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_distance(x, y); } | ||
| 658 | static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_distance(x, y); } | ||
| 659 | |||
| 660 | static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_normalize(x); } | ||
| 661 | static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_normalize(x); } | ||
| 662 | static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_normalize(x); } | ||
| 663 | static SIMD_CPPFUNC float8 normalize(const float8 x) { return ::simd_normalize(x); } | ||
| 664 | static SIMD_CPPFUNC float16 normalize(const float16 x) { return ::simd_normalize(x); } | ||
| 665 | static SIMD_CPPFUNC double2 normalize(const double2 x) { return ::simd_normalize(x); } | ||
| 666 | static SIMD_CPPFUNC double3 normalize(const double3 x) { return ::simd_normalize(x); } | ||
| 667 | static SIMD_CPPFUNC double4 normalize(const double4 x) { return ::simd_normalize(x); } | ||
| 668 | static SIMD_CPPFUNC double8 normalize(const double8 x) { return ::simd_normalize(x); } | ||
| 669 | |||
| 670 | static SIMD_CPPFUNC float3 cross(const float2 x, const float2 y) { return ::simd_cross(x,y); } | ||
| 671 | static SIMD_CPPFUNC float3 cross(const float3 x, const float3 y) { return ::simd_cross(x,y); } | ||
| 672 | static SIMD_CPPFUNC double3 cross(const double2 x, const double2 y) { return ::simd_cross(x,y); } | ||
| 673 | static SIMD_CPPFUNC double3 cross(const double3 x, const double3 y) { return ::simd_cross(x,y); } | ||
| 674 | |||
| 675 | static SIMD_CPPFUNC float2 reflect(const float2 x, const float2 n) { return ::simd_reflect(x,n); } | ||
| 676 | static SIMD_CPPFUNC float3 reflect(const float3 x, const float3 n) { return ::simd_reflect(x,n); } | ||
| 677 | static SIMD_CPPFUNC float4 reflect(const float4 x, const float4 n) { return ::simd_reflect(x,n); } | ||
| 678 | static SIMD_CPPFUNC double2 reflect(const double2 x, const double2 n) { return ::simd_reflect(x,n); } | ||
| 679 | static SIMD_CPPFUNC double3 reflect(const double3 x, const double3 n) { return ::simd_reflect(x,n); } | ||
| 680 | static SIMD_CPPFUNC double4 reflect(const double4 x, const double4 n) { return ::simd_reflect(x,n); } | ||
| 681 | |||
| 682 | static SIMD_CPPFUNC float2 refract(const float2 x, const float2 n, const float eta) { return ::simd_refract(x,n,eta); } | ||
| 683 | static SIMD_CPPFUNC float3 refract(const float3 x, const float3 n, const float eta) { return ::simd_refract(x,n,eta); } | ||
| 684 | static SIMD_CPPFUNC float4 refract(const float4 x, const float4 n, const float eta) { return ::simd_refract(x,n,eta); } | ||
| 685 | static SIMD_CPPFUNC double2 refract(const double2 x, const double2 n, const float eta) { return ::simd_refract(x,n,eta); } | ||
| 686 | static SIMD_CPPFUNC double3 refract(const double3 x, const double3 n, const float eta) { return ::simd_refract(x,n,eta); } | ||
| 687 | static SIMD_CPPFUNC double4 refract(const double4 x, const double4 n, const float eta) { return ::simd_refract(x,n,eta); } | ||
| 688 | |||
| 689 | /* precise and fast sub-namespaces */ | ||
| 690 | namespace precise { | ||
| 691 | static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_precise_project(x, y); } | ||
| 692 | static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_precise_project(x, y); } | ||
| 693 | static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_precise_project(x, y); } | ||
| 694 | static SIMD_CPPFUNC float8 project(const float8 x, const float8 y) { return ::simd_precise_project(x, y); } | ||
| 695 | static SIMD_CPPFUNC float16 project(const float16 x, const float16 y) { return ::simd_precise_project(x, y); } | ||
| 696 | static SIMD_CPPFUNC double2 project(const double2 x, const double2 y) { return ::simd_precise_project(x, y); } | ||
| 697 | static SIMD_CPPFUNC double3 project(const double3 x, const double3 y) { return ::simd_precise_project(x, y); } | ||
| 698 | static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_precise_project(x, y); } | ||
| 699 | static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_precise_project(x, y); } | ||
| 700 | |||
| 701 | static SIMD_CPPFUNC float length(const float2 x) { return ::simd_precise_length(x); } | ||
| 702 | static SIMD_CPPFUNC float length(const float3 x) { return ::simd_precise_length(x); } | ||
| 703 | static SIMD_CPPFUNC float length(const float4 x) { return ::simd_precise_length(x); } | ||
| 704 | static SIMD_CPPFUNC float length(const float8 x) { return ::simd_precise_length(x); } | ||
| 705 | static SIMD_CPPFUNC float length(const float16 x) { return ::simd_precise_length(x); } | ||
| 706 | static SIMD_CPPFUNC double length(const double2 x) { return ::simd_precise_length(x); } | ||
| 707 | static SIMD_CPPFUNC double length(const double3 x) { return ::simd_precise_length(x); } | ||
| 708 | static SIMD_CPPFUNC double length(const double4 x) { return ::simd_precise_length(x); } | ||
| 709 | static SIMD_CPPFUNC double length(const double8 x) { return ::simd_precise_length(x); } | ||
| 710 | |||
| 711 | static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_precise_distance(x, y); } | ||
| 712 | static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_precise_distance(x, y); } | ||
| 713 | static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_precise_distance(x, y); } | ||
| 714 | static SIMD_CPPFUNC float distance(const float8 x, const float8 y) { return ::simd_precise_distance(x, y); } | ||
| 715 | static SIMD_CPPFUNC float distance(const float16 x, const float16 y) { return ::simd_precise_distance(x, y); } | ||
| 716 | static SIMD_CPPFUNC double distance(const double2 x, const double2 y) { return ::simd_precise_distance(x, y); } | ||
| 717 | static SIMD_CPPFUNC double distance(const double3 x, const double3 y) { return ::simd_precise_distance(x, y); } | ||
| 718 | static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_precise_distance(x, y); } | ||
| 719 | static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_precise_distance(x, y); } | ||
| 720 | |||
| 721 | static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_precise_normalize(x); } | ||
| 722 | static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_precise_normalize(x); } | ||
| 723 | static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_precise_normalize(x); } | ||
| 724 | static SIMD_CPPFUNC float8 normalize(const float8 x) { return ::simd_precise_normalize(x); } | ||
| 725 | static SIMD_CPPFUNC float16 normalize(const float16 x) { return ::simd_precise_normalize(x); } | ||
| 726 | static SIMD_CPPFUNC double2 normalize(const double2 x) { return ::simd_precise_normalize(x); } | ||
| 727 | static SIMD_CPPFUNC double3 normalize(const double3 x) { return ::simd_precise_normalize(x); } | ||
| 728 | static SIMD_CPPFUNC double4 normalize(const double4 x) { return ::simd_precise_normalize(x); } | ||
| 729 | static SIMD_CPPFUNC double8 normalize(const double8 x) { return ::simd_precise_normalize(x); } | ||
| 730 | } | ||
| 731 | |||
| 732 | namespace fast { | ||
| 733 | static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_fast_project(x, y); } | ||
| 734 | static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_fast_project(x, y); } | ||
| 735 | static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_fast_project(x, y); } | ||
| 736 | static SIMD_CPPFUNC float8 project(const float8 x, const float8 y) { return ::simd_fast_project(x, y); } | ||
| 737 | static SIMD_CPPFUNC float16 project(const float16 x, const float16 y) { return ::simd_fast_project(x, y); } | ||
| 738 | static SIMD_CPPFUNC double2 project(const double2 x, const double2 y) { return ::simd_fast_project(x, y); } | ||
| 739 | static SIMD_CPPFUNC double3 project(const double3 x, const double3 y) { return ::simd_fast_project(x, y); } | ||
| 740 | static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_fast_project(x, y); } | ||
| 741 | static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_fast_project(x, y); } | ||
| 742 | |||
| 743 | static SIMD_CPPFUNC float length(const float2 x) { return ::simd_fast_length(x); } | ||
| 744 | static SIMD_CPPFUNC float length(const float3 x) { return ::simd_fast_length(x); } | ||
| 745 | static SIMD_CPPFUNC float length(const float4 x) { return ::simd_fast_length(x); } | ||
| 746 | static SIMD_CPPFUNC float length(const float8 x) { return ::simd_fast_length(x); } | ||
| 747 | static SIMD_CPPFUNC float length(const float16 x) { return ::simd_fast_length(x); } | ||
| 748 | static SIMD_CPPFUNC double length(const double2 x) { return ::simd_fast_length(x); } | ||
| 749 | static SIMD_CPPFUNC double length(const double3 x) { return ::simd_fast_length(x); } | ||
| 750 | static SIMD_CPPFUNC double length(const double4 x) { return ::simd_fast_length(x); } | ||
| 751 | static SIMD_CPPFUNC double length(const double8 x) { return ::simd_fast_length(x); } | ||
| 752 | |||
| 753 | static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_fast_distance(x, y); } | ||
| 754 | static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_fast_distance(x, y); } | ||
| 755 | static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_fast_distance(x, y); } | ||
| 756 | static SIMD_CPPFUNC float distance(const float8 x, const float8 y) { return ::simd_fast_distance(x, y); } | ||
| 757 | static SIMD_CPPFUNC float distance(const float16 x, const float16 y) { return ::simd_fast_distance(x, y); } | ||
| 758 | static SIMD_CPPFUNC double distance(const double2 x, const double2 y) { return ::simd_fast_distance(x, y); } | ||
| 759 | static SIMD_CPPFUNC double distance(const double3 x, const double3 y) { return ::simd_fast_distance(x, y); } | ||
| 760 | static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_fast_distance(x, y); } | ||
| 761 | static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_fast_distance(x, y); } | ||
| 762 | |||
| 763 | static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_fast_normalize(x); } | ||
| 764 | static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_fast_normalize(x); } | ||
| 765 | static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_fast_normalize(x); } | ||
| 766 | static SIMD_CPPFUNC float8 normalize(const float8 x) { return ::simd_fast_normalize(x); } | ||
| 767 | static SIMD_CPPFUNC float16 normalize(const float16 x) { return ::simd_fast_normalize(x); } | ||
| 768 | static SIMD_CPPFUNC double2 normalize(const double2 x) { return ::simd_fast_normalize(x); } | ||
| 769 | static SIMD_CPPFUNC double3 normalize(const double3 x) { return ::simd_fast_normalize(x); } | ||
| 770 | static SIMD_CPPFUNC double4 normalize(const double4 x) { return ::simd_fast_normalize(x); } | ||
| 771 | static SIMD_CPPFUNC double8 normalize(const double8 x) { return ::simd_fast_normalize(x); } | ||
| 772 | } | ||
| 773 | } | ||
| 774 | |||
| 775 | extern "C" { | ||
| 776 | #endif /* __cplusplus */ | ||
| 777 | |||
| 778 | #pragma mark - Implementation | ||
| 779 | |||
| 780 | static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y) { return simd_reduce_add(__x*__y); } | ||
| 781 | static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y) { return simd_reduce_add(__x*__y); } | ||
| 782 | static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y) { return simd_reduce_add(__x*__y); } | ||
| 783 | static float SIMD_CFUNC simd_dot(simd_float8 __x, simd_float8 __y) { return simd_reduce_add(__x*__y); } | ||
| 784 | static float SIMD_CFUNC simd_dot(simd_float16 __x, simd_float16 __y) { return simd_reduce_add(__x*__y); } | ||
| 785 | static double SIMD_CFUNC simd_dot(simd_double2 __x, simd_double2 __y) { return simd_reduce_add(__x*__y); } | ||
| 786 | static double SIMD_CFUNC simd_dot(simd_double3 __x, simd_double3 __y) { return simd_reduce_add(__x*__y); } | ||
| 787 | static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y) { return simd_reduce_add(__x*__y); } | ||
| 788 | static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y) { return simd_reduce_add(__x*__y); } | ||
| 789 | |||
| 790 | static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 791 | static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 792 | static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 793 | static simd_float8 SIMD_CFUNC simd_precise_project(simd_float8 __x, simd_float8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 794 | static simd_float16 SIMD_CFUNC simd_precise_project(simd_float16 __x, simd_float16 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 795 | static simd_double2 SIMD_CFUNC simd_precise_project(simd_double2 __x, simd_double2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 796 | static simd_double3 SIMD_CFUNC simd_precise_project(simd_double3 __x, simd_double3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 797 | static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 798 | static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; } | ||
| 799 | |||
| 800 | static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 801 | static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 802 | static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 803 | static simd_float8 SIMD_CFUNC simd_fast_project(simd_float8 __x, simd_float8 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 804 | static simd_float16 SIMD_CFUNC simd_fast_project(simd_float16 __x, simd_float16 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 805 | static simd_double2 SIMD_CFUNC simd_fast_project(simd_double2 __x, simd_double2 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 806 | static simd_double3 SIMD_CFUNC simd_fast_project(simd_double3 __x, simd_double3 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 807 | static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 808 | static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); } | ||
| 809 | |||
| 810 | #if defined __FAST_MATH__ | ||
| 811 | static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_fast_project(__x,__y); } | ||
| 812 | static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_fast_project(__x,__y); } | ||
| 813 | static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_fast_project(__x,__y); } | ||
| 814 | static simd_float8 SIMD_CFUNC simd_project(simd_float8 __x, simd_float8 __y) { return simd_fast_project(__x,__y); } | ||
| 815 | static simd_float16 SIMD_CFUNC simd_project(simd_float16 __x, simd_float16 __y) { return simd_fast_project(__x,__y); } | ||
| 816 | static simd_double2 SIMD_CFUNC simd_project(simd_double2 __x, simd_double2 __y) { return simd_fast_project(__x,__y); } | ||
| 817 | static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y) { return simd_fast_project(__x,__y); } | ||
| 818 | static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_fast_project(__x,__y); } | ||
| 819 | static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_fast_project(__x,__y); } | ||
| 820 | #else | ||
| 821 | static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_precise_project(__x,__y); } | ||
| 822 | static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_precise_project(__x,__y); } | ||
| 823 | static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_precise_project(__x,__y); } | ||
| 824 | static simd_float8 SIMD_CFUNC simd_project(simd_float8 __x, simd_float8 __y) { return simd_precise_project(__x,__y); } | ||
| 825 | static simd_float16 SIMD_CFUNC simd_project(simd_float16 __x, simd_float16 __y) { return simd_precise_project(__x,__y); } | ||
| 826 | static simd_double2 SIMD_CFUNC simd_project(simd_double2 __x, simd_double2 __y) { return simd_precise_project(__x,__y); } | ||
| 827 | static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y) { return simd_precise_project(__x,__y); } | ||
| 828 | static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_precise_project(__x,__y); } | ||
| 829 | static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_precise_project(__x,__y); } | ||
| 830 | #endif | ||
| 831 | |||
| 832 | static float SIMD_CFUNC simd_precise_length(simd_float2 __x) { return sqrtf(simd_length_squared(__x)); } | ||
| 833 | static float SIMD_CFUNC simd_precise_length(simd_float3 __x) { return sqrtf(simd_length_squared(__x)); } | ||
| 834 | static float SIMD_CFUNC simd_precise_length(simd_float4 __x) { return sqrtf(simd_length_squared(__x)); } | ||
| 835 | static float SIMD_CFUNC simd_precise_length(simd_float8 __x) { return sqrtf(simd_length_squared(__x)); } | ||
| 836 | static float SIMD_CFUNC simd_precise_length(simd_float16 __x) { return sqrtf(simd_length_squared(__x)); } | ||
| 837 | static double SIMD_CFUNC simd_precise_length(simd_double2 __x) { return sqrt(simd_length_squared(__x)); } | ||
| 838 | static double SIMD_CFUNC simd_precise_length(simd_double3 __x) { return sqrt(simd_length_squared(__x)); } | ||
| 839 | static double SIMD_CFUNC simd_precise_length(simd_double4 __x) { return sqrt(simd_length_squared(__x)); } | ||
| 840 | static double SIMD_CFUNC simd_precise_length(simd_double8 __x) { return sqrt(simd_length_squared(__x)); } | ||
| 841 | |||
| 842 | static float SIMD_CFUNC simd_fast_length(simd_float2 __x) { return simd_precise_length(__x); } | ||
| 843 | static float SIMD_CFUNC simd_fast_length(simd_float3 __x) { return simd_precise_length(__x); } | ||
| 844 | static float SIMD_CFUNC simd_fast_length(simd_float4 __x) { return simd_precise_length(__x); } | ||
| 845 | static float SIMD_CFUNC simd_fast_length(simd_float8 __x) { return simd_precise_length(__x); } | ||
| 846 | static float SIMD_CFUNC simd_fast_length(simd_float16 __x) { return simd_precise_length(__x); } | ||
| 847 | static double SIMD_CFUNC simd_fast_length(simd_double2 __x) { return simd_precise_length(__x); } | ||
| 848 | static double SIMD_CFUNC simd_fast_length(simd_double3 __x) { return simd_precise_length(__x); } | ||
| 849 | static double SIMD_CFUNC simd_fast_length(simd_double4 __x) { return simd_precise_length(__x); } | ||
| 850 | static double SIMD_CFUNC simd_fast_length(simd_double8 __x) { return simd_precise_length(__x); } | ||
| 851 | |||
| 852 | #if defined __FAST_MATH__ | ||
| 853 | static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_fast_length(__x); } | ||
| 854 | static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_fast_length(__x); } | ||
| 855 | static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_fast_length(__x); } | ||
| 856 | static float SIMD_CFUNC simd_length(simd_float8 __x) { return simd_fast_length(__x); } | ||
| 857 | static float SIMD_CFUNC simd_length(simd_float16 __x) { return simd_fast_length(__x); } | ||
| 858 | static double SIMD_CFUNC simd_length(simd_double2 __x) { return simd_fast_length(__x); } | ||
| 859 | static double SIMD_CFUNC simd_length(simd_double3 __x) { return simd_fast_length(__x); } | ||
| 860 | static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_fast_length(__x); } | ||
| 861 | static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_fast_length(__x); } | ||
| 862 | #else | ||
| 863 | static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_precise_length(__x); } | ||
| 864 | static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_precise_length(__x); } | ||
| 865 | static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_precise_length(__x); } | ||
| 866 | static float SIMD_CFUNC simd_length(simd_float8 __x) { return simd_precise_length(__x); } | ||
| 867 | static float SIMD_CFUNC simd_length(simd_float16 __x) { return simd_precise_length(__x); } | ||
| 868 | static double SIMD_CFUNC simd_length(simd_double2 __x) { return simd_precise_length(__x); } | ||
| 869 | static double SIMD_CFUNC simd_length(simd_double3 __x) { return simd_precise_length(__x); } | ||
| 870 | static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_precise_length(__x); } | ||
| 871 | static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_precise_length(__x); } | ||
| 872 | #endif | ||
| 873 | |||
| 874 | static float SIMD_CFUNC simd_length_squared(simd_float2 __x) { return simd_dot(__x,__x); } | ||
| 875 | static float SIMD_CFUNC simd_length_squared(simd_float3 __x) { return simd_dot(__x,__x); } | ||
| 876 | static float SIMD_CFUNC simd_length_squared(simd_float4 __x) { return simd_dot(__x,__x); } | ||
| 877 | static float SIMD_CFUNC simd_length_squared(simd_float8 __x) { return simd_dot(__x,__x); } | ||
| 878 | static float SIMD_CFUNC simd_length_squared(simd_float16 __x) { return simd_dot(__x,__x); } | ||
| 879 | static double SIMD_CFUNC simd_length_squared(simd_double2 __x) { return simd_dot(__x,__x); } | ||
| 880 | static double SIMD_CFUNC simd_length_squared(simd_double3 __x) { return simd_dot(__x,__x); } | ||
| 881 | static double SIMD_CFUNC simd_length_squared(simd_double4 __x) { return simd_dot(__x,__x); } | ||
| 882 | static double SIMD_CFUNC simd_length_squared(simd_double8 __x) { return simd_dot(__x,__x); } | ||
| 883 | |||
| 884 | static float SIMD_CFUNC simd_norm_one(simd_float2 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 885 | static float SIMD_CFUNC simd_norm_one(simd_float3 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 886 | static float SIMD_CFUNC simd_norm_one(simd_float4 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 887 | static float SIMD_CFUNC simd_norm_one(simd_float8 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 888 | static float SIMD_CFUNC simd_norm_one(simd_float16 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 889 | static double SIMD_CFUNC simd_norm_one(simd_double2 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 890 | static double SIMD_CFUNC simd_norm_one(simd_double3 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 891 | static double SIMD_CFUNC simd_norm_one(simd_double4 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 892 | static double SIMD_CFUNC simd_norm_one(simd_double8 __x) { return simd_reduce_add(__tg_fabs(__x)); } | ||
| 893 | |||
| 894 | static float SIMD_CFUNC simd_norm_inf(simd_float2 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 895 | static float SIMD_CFUNC simd_norm_inf(simd_float3 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 896 | static float SIMD_CFUNC simd_norm_inf(simd_float4 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 897 | static float SIMD_CFUNC simd_norm_inf(simd_float8 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 898 | static float SIMD_CFUNC simd_norm_inf(simd_float16 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 899 | static double SIMD_CFUNC simd_norm_inf(simd_double2 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 900 | static double SIMD_CFUNC simd_norm_inf(simd_double3 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 901 | static double SIMD_CFUNC simd_norm_inf(simd_double4 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 902 | static double SIMD_CFUNC simd_norm_inf(simd_double8 __x) { return simd_reduce_max(__tg_fabs(__x)); } | ||
| 903 | |||
| 904 | static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_length(__x - __y); } | ||
| 905 | static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_length(__x - __y); } | ||
| 906 | static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_length(__x - __y); } | ||
| 907 | static float SIMD_CFUNC simd_precise_distance(simd_float8 __x, simd_float8 __y) { return simd_precise_length(__x - __y); } | ||
| 908 | static float SIMD_CFUNC simd_precise_distance(simd_float16 __x, simd_float16 __y) { return simd_precise_length(__x - __y); } | ||
| 909 | static double SIMD_CFUNC simd_precise_distance(simd_double2 __x, simd_double2 __y) { return simd_precise_length(__x - __y); } | ||
| 910 | static double SIMD_CFUNC simd_precise_distance(simd_double3 __x, simd_double3 __y) { return simd_precise_length(__x - __y); } | ||
| 911 | static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_length(__x - __y); } | ||
| 912 | static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_length(__x - __y); } | ||
| 913 | |||
| 914 | static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_length(__x - __y); } | ||
| 915 | static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_length(__x - __y); } | ||
| 916 | static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_length(__x - __y); } | ||
| 917 | static float SIMD_CFUNC simd_fast_distance(simd_float8 __x, simd_float8 __y) { return simd_fast_length(__x - __y); } | ||
| 918 | static float SIMD_CFUNC simd_fast_distance(simd_float16 __x, simd_float16 __y) { return simd_fast_length(__x - __y); } | ||
| 919 | static double SIMD_CFUNC simd_fast_distance(simd_double2 __x, simd_double2 __y) { return simd_fast_length(__x - __y); } | ||
| 920 | static double SIMD_CFUNC simd_fast_distance(simd_double3 __x, simd_double3 __y) { return simd_fast_length(__x - __y); } | ||
| 921 | static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_length(__x - __y); } | ||
| 922 | static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_length(__x - __y); } | ||
| 923 | |||
| 924 | #if defined __FAST_MATH__ | ||
| 925 | static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_distance(__x,__y); } | ||
| 926 | static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_distance(__x,__y); } | ||
| 927 | static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_distance(__x,__y); } | ||
| 928 | static float SIMD_CFUNC simd_distance(simd_float8 __x, simd_float8 __y) { return simd_fast_distance(__x,__y); } | ||
| 929 | static float SIMD_CFUNC simd_distance(simd_float16 __x, simd_float16 __y) { return simd_fast_distance(__x,__y); } | ||
| 930 | static double SIMD_CFUNC simd_distance(simd_double2 __x, simd_double2 __y) { return simd_fast_distance(__x,__y); } | ||
| 931 | static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y) { return simd_fast_distance(__x,__y); } | ||
| 932 | static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_distance(__x,__y); } | ||
| 933 | static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_distance(__x,__y); } | ||
| 934 | #else | ||
| 935 | static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_distance(__x,__y); } | ||
| 936 | static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_distance(__x,__y); } | ||
| 937 | static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_distance(__x,__y); } | ||
| 938 | static float SIMD_CFUNC simd_distance(simd_float8 __x, simd_float8 __y) { return simd_precise_distance(__x,__y); } | ||
| 939 | static float SIMD_CFUNC simd_distance(simd_float16 __x, simd_float16 __y) { return simd_precise_distance(__x,__y); } | ||
| 940 | static double SIMD_CFUNC simd_distance(simd_double2 __x, simd_double2 __y) { return simd_precise_distance(__x,__y); } | ||
| 941 | static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y) { return simd_precise_distance(__x,__y); } | ||
| 942 | static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_distance(__x,__y); } | ||
| 943 | static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_distance(__x,__y); } | ||
| 944 | #endif | ||
| 945 | |||
| 946 | static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y) { return simd_length_squared(__x - __y); } | ||
| 947 | static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y) { return simd_length_squared(__x - __y); } | ||
| 948 | static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y) { return simd_length_squared(__x - __y); } | ||
| 949 | static float SIMD_CFUNC simd_distance_squared(simd_float8 __x, simd_float8 __y) { return simd_length_squared(__x - __y); } | ||
| 950 | static float SIMD_CFUNC simd_distance_squared(simd_float16 __x, simd_float16 __y) { return simd_length_squared(__x - __y); } | ||
| 951 | static double SIMD_CFUNC simd_distance_squared(simd_double2 __x, simd_double2 __y) { return simd_length_squared(__x - __y); } | ||
| 952 | static double SIMD_CFUNC simd_distance_squared(simd_double3 __x, simd_double3 __y) { return simd_length_squared(__x - __y); } | ||
| 953 | static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y) { return simd_length_squared(__x - __y); } | ||
| 954 | static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y) { return simd_length_squared(__x - __y); } | ||
| 955 | |||
| 956 | static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 957 | static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 958 | static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 959 | static simd_float8 SIMD_CFUNC simd_precise_normalize(simd_float8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 960 | static simd_float16 SIMD_CFUNC simd_precise_normalize(simd_float16 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 961 | static simd_double2 SIMD_CFUNC simd_precise_normalize(simd_double2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 962 | static simd_double3 SIMD_CFUNC simd_precise_normalize(simd_double3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 963 | static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 964 | static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); } | ||
| 965 | |||
| 966 | static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 967 | static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 968 | static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 969 | static simd_float8 SIMD_CFUNC simd_fast_normalize(simd_float8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 970 | static simd_float16 SIMD_CFUNC simd_fast_normalize(simd_float16 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 971 | static simd_double2 SIMD_CFUNC simd_fast_normalize(simd_double2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 972 | static simd_double3 SIMD_CFUNC simd_fast_normalize(simd_double3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 973 | static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 974 | static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); } | ||
| 975 | |||
| 976 | #if defined __FAST_MATH__ | ||
| 977 | static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_fast_normalize(__x); } | ||
| 978 | static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_fast_normalize(__x); } | ||
| 979 | static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_fast_normalize(__x); } | ||
| 980 | static simd_float8 SIMD_CFUNC simd_normalize(simd_float8 __x) { return simd_fast_normalize(__x); } | ||
| 981 | static simd_float16 SIMD_CFUNC simd_normalize(simd_float16 __x) { return simd_fast_normalize(__x); } | ||
| 982 | static simd_double2 SIMD_CFUNC simd_normalize(simd_double2 __x) { return simd_fast_normalize(__x); } | ||
| 983 | static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x) { return simd_fast_normalize(__x); } | ||
| 984 | static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_fast_normalize(__x); } | ||
| 985 | static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_fast_normalize(__x); } | ||
| 986 | #else | ||
| 987 | static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_precise_normalize(__x); } | ||
| 988 | static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_precise_normalize(__x); } | ||
| 989 | static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_precise_normalize(__x); } | ||
| 990 | static simd_float8 SIMD_CFUNC simd_normalize(simd_float8 __x) { return simd_precise_normalize(__x); } | ||
| 991 | static simd_float16 SIMD_CFUNC simd_normalize(simd_float16 __x) { return simd_precise_normalize(__x); } | ||
| 992 | static simd_double2 SIMD_CFUNC simd_normalize(simd_double2 __x) { return simd_precise_normalize(__x); } | ||
| 993 | static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x) { return simd_precise_normalize(__x); } | ||
| 994 | static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_precise_normalize(__x); } | ||
| 995 | static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_precise_normalize(__x); } | ||
| 996 | #endif | ||
| 997 | |||
| 998 | static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y) { return (simd_float3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; } | ||
| 999 | static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; } | ||
| 1000 | static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y) { return (simd_double3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; } | ||
| 1001 | static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; } | ||
| 1002 | |||
| 1003 | static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n) { return __x - 2*simd_dot(__x,__n)*__n; } | ||
| 1004 | static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n) { return __x - 2*simd_dot(__x,__n)*__n; } | ||
| 1005 | static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n) { return __x - 2*simd_dot(__x,__n)*__n; } | ||
| 1006 | static simd_double2 SIMD_CFUNC simd_reflect(simd_double2 __x, simd_double2 __n) { return __x - 2*simd_dot(__x,__n)*__n; } | ||
| 1007 | static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n) { return __x - 2*simd_dot(__x,__n)*__n; } | ||
| 1008 | static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n) { return __x - 2*simd_dot(__x,__n)*__n; } | ||
| 1009 | |||
| 1010 | static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta) { | ||
| 1011 | const float __k = 1.0f - __eta*__eta*(1.0f - simd_dot(__x,__n)*simd_dot(__x,__n)); | ||
| 1012 | return (__k >= 0.0f) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_float2)0.0f; | ||
| 1013 | } | ||
| 1014 | static simd_float3 SIMD_CFUNC simd_refract(simd_float3 __x, simd_float3 __n, float __eta) { | ||
| 1015 | const float __k = 1.0f - __eta*__eta*(1.0f - simd_dot(__x,__n)*simd_dot(__x,__n)); | ||
| 1016 | return (__k >= 0.0f) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_float3)0.0f; | ||
| 1017 | } | ||
| 1018 | static simd_float4 SIMD_CFUNC simd_refract(simd_float4 __x, simd_float4 __n, float __eta) { | ||
| 1019 | const float __k = 1.0f - __eta*__eta*(1.0f - simd_dot(__x,__n)*simd_dot(__x,__n)); | ||
| 1020 | return (__k >= 0.0f) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_float4)0.0f; | ||
| 1021 | } | ||
| 1022 | static simd_double2 SIMD_CFUNC simd_refract(simd_double2 __x, simd_double2 __n, double __eta) { | ||
| 1023 | const double __k = 1.0 - __eta*__eta*(1.0 - simd_dot(__x,__n)*simd_dot(__x,__n)); | ||
| 1024 | return (__k >= 0.0) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_double2)0.0; | ||
| 1025 | } | ||
| 1026 | static simd_double3 SIMD_CFUNC simd_refract(simd_double3 __x, simd_double3 __n, double __eta) { | ||
| 1027 | const double __k = 1.0 - __eta*__eta*(1.0 - simd_dot(__x,__n)*simd_dot(__x,__n)); | ||
| 1028 | return (__k >= 0.0) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_double3)0.0; | ||
| 1029 | } | ||
| 1030 | static simd_double4 SIMD_CFUNC simd_refract(simd_double4 __x, simd_double4 __n, double __eta) { | ||
| 1031 | const double __k = 1.0 - __eta*__eta*(1.0 - simd_dot(__x,__n)*simd_dot(__x,__n)); | ||
| 1032 | return (__k >= 0.0) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_double4)0.0; | ||
| 1033 | } | ||
| 1034 | |||
| 1035 | #if SIMD_LIBRARY_VERSION >= 2 | ||
| 1036 | static float SIMD_CFUNC simd_orient(simd_float2 __x, simd_float2 __y) { | ||
| 1037 | return _simd_orient_vf2(__x, __y); | ||
| 1038 | } | ||
| 1039 | static double SIMD_CFUNC simd_orient(simd_double2 __x, simd_double2 __y) { | ||
| 1040 | return _simd_orient_vd2(__x, __y); | ||
| 1041 | } | ||
| 1042 | static float SIMD_CFUNC simd_orient(simd_float3 __x, simd_float3 __y, simd_float3 __z) { | ||
| 1043 | return _simd_orient_vf3(__x, __y, __z); | ||
| 1044 | } | ||
| 1045 | static double SIMD_CFUNC simd_orient(simd_double3 __x, simd_double3 __y, simd_double3 __z) { | ||
| 1046 | simd_double3 __args[3] = { __x, __y, __z }; | ||
| 1047 | return _simd_orient_vd3((const double *)__args); | ||
| 1048 | } | ||
| 1049 | |||
| 1050 | static float SIMD_CFUNC simd_orient(simd_float2 __a, simd_float2 __b, simd_float2 __c) { | ||
| 1051 | return _simd_orient_pf2(__a, __b, __c); | ||
| 1052 | } | ||
| 1053 | static double SIMD_CFUNC simd_orient(simd_double2 __a, simd_double2 __b, simd_double2 __c) { | ||
| 1054 | return _simd_orient_pd2(__a, __b, __c); | ||
| 1055 | } | ||
| 1056 | static float SIMD_CFUNC simd_orient(simd_float3 __a, simd_float3 __b, simd_float3 __c, simd_float3 __d) { | ||
| 1057 | return _simd_orient_pf3(__a, __b, __c, __d); | ||
| 1058 | } | ||
| 1059 | static double SIMD_CFUNC simd_orient(simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d) { | ||
| 1060 | simd_double3 __args[4] = { __a, __b, __c, __d }; | ||
| 1061 | return _simd_orient_vd3((const double *)__args); | ||
| 1062 | } | ||
| 1063 | |||
| 1064 | static float SIMD_CFUNC simd_incircle(simd_float2 __x, simd_float2 __a, simd_float2 __b, simd_float2 __c) { | ||
| 1065 | return _simd_incircle_pf2(__x, __a, __b, __c); | ||
| 1066 | } | ||
| 1067 | static double SIMD_CFUNC simd_incircle(simd_double2 __x, simd_double2 __a, simd_double2 __b, simd_double2 __c) { | ||
| 1068 | return _simd_incircle_pd2(__x, __a, __b, __c); | ||
| 1069 | } | ||
| 1070 | static float SIMD_CFUNC simd_insphere(simd_float3 __x, simd_float3 __a, simd_float3 __b, simd_float3 __c, simd_float3 __d) { | ||
| 1071 | return _simd_insphere_pf3(__x, __a, __b, __c, __d); | ||
| 1072 | } | ||
| 1073 | static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d) { | ||
| 1074 | simd_double3 __args[5] = { __x, __a, __b, __c, __d }; | ||
| 1075 | return _simd_insphere_pd3((const double *)__args); | ||
| 1076 | } | ||
| 1077 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 1078 | |||
| 1079 | #ifdef __cplusplus | ||
| 1080 | } | ||
| 1081 | #endif | ||
| 1082 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 1083 | #endif /* __SIMD_COMMON_HEADER__ */ | ||
lib/libc/include/x86_64-macos-gnu/simd/logic.h created+1315| ... | @@ -0,0 +1,1315 @@ | ||
| 1 | /*! @header | ||
| 2 | * The interfaces declared in this header provide logical and bitwise | ||
| 3 | * operations on vectors. Some of these function operate elementwise, | ||
| 4 | * and some produce a scalar result that depends on all lanes of the input. | ||
| 5 | * | ||
| 6 | * For functions returning a boolean value, the return type in C and | ||
| 7 | * Objective-C is _Bool; for C++ it is bool. | ||
| 8 | * | ||
| 9 | * Function Result | ||
| 10 | * ------------------------------------------------------------------ | ||
| 11 | * simd_all(comparison) True if and only if the comparison is true | ||
| 12 | * in every vector lane. e.g.: | ||
| 13 | * | ||
| 14 | * if (simd_all(x == 0.0f)) { | ||
| 15 | * // executed if every lane of x | ||
| 16 | * // contains zero. | ||
| 17 | * } | ||
| 18 | * | ||
| 19 | * The precise function of simd_all is to | ||
| 20 | * return the high-order bit of the result | ||
| 21 | * of a horizontal bitwise AND of all vector | ||
| 22 | * lanes. | ||
| 23 | * | ||
| 24 | * simd_any(comparison) True if and only if the comparison is true | ||
| 25 | * in at least one vector lane. e.g.: | ||
| 26 | * | ||
| 27 | * if (simd_any(x < 0.0f)) { | ||
| 28 | * // executed if any lane of x | ||
| 29 | * // contains a negative value. | ||
| 30 | * } | ||
| 31 | * | ||
| 32 | * The precise function of simd_all is to | ||
| 33 | * return the high-order bit of the result | ||
| 34 | * of a horizontal bitwise OR of all vector | ||
| 35 | * lanes. | ||
| 36 | * | ||
| 37 | * simd_select(x,y,mask) For each lane in the result, selects the | ||
| 38 | * corresponding element of x if the high- | ||
| 39 | * order bit of the corresponding element of | ||
| 40 | * mask is 0, and the corresponding element | ||
| 41 | * of y otherwise. | ||
| 42 | * | ||
| 43 | * simd_bitselect(x,y,mask) For each bit in the result, selects the | ||
| 44 | * corresponding bit of x if the corresponding | ||
| 45 | * bit of mask is clear, and the corresponding | ||
| 46 | * of y otherwise. | ||
| 47 | * | ||
| 48 | * In C++, these functions are available under the simd:: namespace: | ||
| 49 | * | ||
| 50 | * C++ Function Equivalent C Function | ||
| 51 | * -------------------------------------------------------------------- | ||
| 52 | * simd::all(comparison) simd_all(comparison) | ||
| 53 | * simd::any(comparison) simd_any(comparison) | ||
| 54 | * simd::select(x,y,mask) simd_select(x,y,mask) | ||
| 55 | * simd::bitselect(x,y,mask) simd_bitselect(x,y,mask) | ||
| 56 | * | ||
| 57 | * @copyright 2014-2017 Apple, Inc. All rights reserved. | ||
| 58 | * @unsorted */ | ||
| 59 | |||
| 60 | #ifndef SIMD_LOGIC_HEADER | ||
| 61 | #define SIMD_LOGIC_HEADER | ||
| 62 | |||
| 63 | #include <simd/base.h> | ||
| 64 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 65 | #include <simd/vector_make.h> | ||
| 66 | #include <stdint.h> | ||
| 67 | |||
| 68 | #ifdef __cplusplus | ||
| 69 | extern "C" { | ||
| 70 | #endif | ||
| 71 | |||
| 72 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 73 | * vector is set. */ | ||
| 74 | static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x); | ||
| 75 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 76 | * vector is set. */ | ||
| 77 | static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x); | ||
| 78 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 79 | * vector is set. */ | ||
| 80 | static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x); | ||
| 81 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 82 | * vector is set. */ | ||
| 83 | static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x); | ||
| 84 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 85 | * vector is set. */ | ||
| 86 | static inline SIMD_CFUNC simd_bool simd_any(simd_char16 x); | ||
| 87 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 88 | * vector is set. */ | ||
| 89 | static inline SIMD_CFUNC simd_bool simd_any(simd_char32 x); | ||
| 90 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 91 | * vector is set. */ | ||
| 92 | static inline SIMD_CFUNC simd_bool simd_any(simd_char64 x); | ||
| 93 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 94 | * vector is set. */ | ||
| 95 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar2 x); | ||
| 96 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 97 | * vector is set. */ | ||
| 98 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar3 x); | ||
| 99 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 100 | * vector is set. */ | ||
| 101 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar4 x); | ||
| 102 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 103 | * vector is set. */ | ||
| 104 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar8 x); | ||
| 105 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 106 | * vector is set. */ | ||
| 107 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar16 x); | ||
| 108 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 109 | * vector is set. */ | ||
| 110 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar32 x); | ||
| 111 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 112 | * vector is set. */ | ||
| 113 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x); | ||
| 114 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 115 | * vector is set. */ | ||
| 116 | static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x); | ||
| 117 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 118 | * vector is set. */ | ||
| 119 | static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x); | ||
| 120 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 121 | * vector is set. */ | ||
| 122 | static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x); | ||
| 123 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 124 | * vector is set. */ | ||
| 125 | static inline SIMD_CFUNC simd_bool simd_any(simd_short8 x); | ||
| 126 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 127 | * vector is set. */ | ||
| 128 | static inline SIMD_CFUNC simd_bool simd_any(simd_short16 x); | ||
| 129 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 130 | * vector is set. */ | ||
| 131 | static inline SIMD_CFUNC simd_bool simd_any(simd_short32 x); | ||
| 132 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 133 | * vector is set. */ | ||
| 134 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort2 x); | ||
| 135 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 136 | * vector is set. */ | ||
| 137 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort3 x); | ||
| 138 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 139 | * vector is set. */ | ||
| 140 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort4 x); | ||
| 141 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 142 | * vector is set. */ | ||
| 143 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort8 x); | ||
| 144 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 145 | * vector is set. */ | ||
| 146 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort16 x); | ||
| 147 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 148 | * vector is set. */ | ||
| 149 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x); | ||
| 150 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 151 | * vector is set. */ | ||
| 152 | static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x); | ||
| 153 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 154 | * vector is set. */ | ||
| 155 | static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x); | ||
| 156 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 157 | * vector is set. */ | ||
| 158 | static inline SIMD_CFUNC simd_bool simd_any(simd_int4 x); | ||
| 159 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 160 | * vector is set. */ | ||
| 161 | static inline SIMD_CFUNC simd_bool simd_any(simd_int8 x); | ||
| 162 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 163 | * vector is set. */ | ||
| 164 | static inline SIMD_CFUNC simd_bool simd_any(simd_int16 x); | ||
| 165 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 166 | * vector is set. */ | ||
| 167 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint2 x); | ||
| 168 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 169 | * vector is set. */ | ||
| 170 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint3 x); | ||
| 171 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 172 | * vector is set. */ | ||
| 173 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint4 x); | ||
| 174 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 175 | * vector is set. */ | ||
| 176 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint8 x); | ||
| 177 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 178 | * vector is set. */ | ||
| 179 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x); | ||
| 180 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 181 | * vector is set. */ | ||
| 182 | static inline SIMD_CFUNC simd_bool simd_any(simd_long2 x); | ||
| 183 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 184 | * vector is set. */ | ||
| 185 | static inline SIMD_CFUNC simd_bool simd_any(simd_long3 x); | ||
| 186 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 187 | * vector is set. */ | ||
| 188 | static inline SIMD_CFUNC simd_bool simd_any(simd_long4 x); | ||
| 189 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 190 | * vector is set. */ | ||
| 191 | static inline SIMD_CFUNC simd_bool simd_any(simd_long8 x); | ||
| 192 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 193 | * vector is set. */ | ||
| 194 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong2 x); | ||
| 195 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 196 | * vector is set. */ | ||
| 197 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong3 x); | ||
| 198 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 199 | * vector is set. */ | ||
| 200 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong4 x); | ||
| 201 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 202 | * vector is set. */ | ||
| 203 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x); | ||
| 204 | /*! @abstract True if and only if the high-order bit of any lane of the | ||
| 205 | * vector is set. | ||
| 206 | * @discussion Deprecated. Use simd_any instead. */ | ||
| 207 | #define vector_any simd_any | ||
| 208 | |||
| 209 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 210 | * vector is set. */ | ||
| 211 | static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x); | ||
| 212 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 213 | * vector is set. */ | ||
| 214 | static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x); | ||
| 215 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 216 | * vector is set. */ | ||
| 217 | static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x); | ||
| 218 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 219 | * vector is set. */ | ||
| 220 | static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x); | ||
| 221 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 222 | * vector is set. */ | ||
| 223 | static inline SIMD_CFUNC simd_bool simd_all(simd_char16 x); | ||
| 224 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 225 | * vector is set. */ | ||
| 226 | static inline SIMD_CFUNC simd_bool simd_all(simd_char32 x); | ||
| 227 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 228 | * vector is set. */ | ||
| 229 | static inline SIMD_CFUNC simd_bool simd_all(simd_char64 x); | ||
| 230 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 231 | * vector is set. */ | ||
| 232 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar2 x); | ||
| 233 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 234 | * vector is set. */ | ||
| 235 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar3 x); | ||
| 236 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 237 | * vector is set. */ | ||
| 238 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar4 x); | ||
| 239 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 240 | * vector is set. */ | ||
| 241 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar8 x); | ||
| 242 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 243 | * vector is set. */ | ||
| 244 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar16 x); | ||
| 245 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 246 | * vector is set. */ | ||
| 247 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar32 x); | ||
| 248 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 249 | * vector is set. */ | ||
| 250 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x); | ||
| 251 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 252 | * vector is set. */ | ||
| 253 | static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x); | ||
| 254 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 255 | * vector is set. */ | ||
| 256 | static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x); | ||
| 257 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 258 | * vector is set. */ | ||
| 259 | static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x); | ||
| 260 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 261 | * vector is set. */ | ||
| 262 | static inline SIMD_CFUNC simd_bool simd_all(simd_short8 x); | ||
| 263 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 264 | * vector is set. */ | ||
| 265 | static inline SIMD_CFUNC simd_bool simd_all(simd_short16 x); | ||
| 266 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 267 | * vector is set. */ | ||
| 268 | static inline SIMD_CFUNC simd_bool simd_all(simd_short32 x); | ||
| 269 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 270 | * vector is set. */ | ||
| 271 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort2 x); | ||
| 272 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 273 | * vector is set. */ | ||
| 274 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort3 x); | ||
| 275 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 276 | * vector is set. */ | ||
| 277 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort4 x); | ||
| 278 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 279 | * vector is set. */ | ||
| 280 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort8 x); | ||
| 281 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 282 | * vector is set. */ | ||
| 283 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort16 x); | ||
| 284 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 285 | * vector is set. */ | ||
| 286 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x); | ||
| 287 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 288 | * vector is set. */ | ||
| 289 | static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x); | ||
| 290 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 291 | * vector is set. */ | ||
| 292 | static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x); | ||
| 293 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 294 | * vector is set. */ | ||
| 295 | static inline SIMD_CFUNC simd_bool simd_all(simd_int4 x); | ||
| 296 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 297 | * vector is set. */ | ||
| 298 | static inline SIMD_CFUNC simd_bool simd_all(simd_int8 x); | ||
| 299 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 300 | * vector is set. */ | ||
| 301 | static inline SIMD_CFUNC simd_bool simd_all(simd_int16 x); | ||
| 302 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 303 | * vector is set. */ | ||
| 304 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint2 x); | ||
| 305 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 306 | * vector is set. */ | ||
| 307 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint3 x); | ||
| 308 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 309 | * vector is set. */ | ||
| 310 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint4 x); | ||
| 311 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 312 | * vector is set. */ | ||
| 313 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint8 x); | ||
| 314 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 315 | * vector is set. */ | ||
| 316 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x); | ||
| 317 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 318 | * vector is set. */ | ||
| 319 | static inline SIMD_CFUNC simd_bool simd_all(simd_long2 x); | ||
| 320 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 321 | * vector is set. */ | ||
| 322 | static inline SIMD_CFUNC simd_bool simd_all(simd_long3 x); | ||
| 323 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 324 | * vector is set. */ | ||
| 325 | static inline SIMD_CFUNC simd_bool simd_all(simd_long4 x); | ||
| 326 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 327 | * vector is set. */ | ||
| 328 | static inline SIMD_CFUNC simd_bool simd_all(simd_long8 x); | ||
| 329 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 330 | * vector is set. */ | ||
| 331 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong2 x); | ||
| 332 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 333 | * vector is set. */ | ||
| 334 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong3 x); | ||
| 335 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 336 | * vector is set. */ | ||
| 337 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong4 x); | ||
| 338 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 339 | * vector is set. */ | ||
| 340 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x); | ||
| 341 | /*! @abstract True if and only if the high-order bit of every lane of the | ||
| 342 | * vector is set. | ||
| 343 | * @discussion Deprecated. Use simd_all instead. */ | ||
| 344 | #define vector_all simd_all | ||
| 345 | |||
| 346 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 347 | * of x or y according to whether the high-order bit of the corresponding | ||
| 348 | * lane of mask is 0 or 1, respectively. */ | ||
| 349 | static inline SIMD_CFUNC simd_float2 simd_select(simd_float2 x, simd_float2 y, simd_int2 mask); | ||
| 350 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 351 | * of x or y according to whether the high-order bit of the corresponding | ||
| 352 | * lane of mask is 0 or 1, respectively. */ | ||
| 353 | static inline SIMD_CFUNC simd_float3 simd_select(simd_float3 x, simd_float3 y, simd_int3 mask); | ||
| 354 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 355 | * of x or y according to whether the high-order bit of the corresponding | ||
| 356 | * lane of mask is 0 or 1, respectively. */ | ||
| 357 | static inline SIMD_CFUNC simd_float4 simd_select(simd_float4 x, simd_float4 y, simd_int4 mask); | ||
| 358 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 359 | * of x or y according to whether the high-order bit of the corresponding | ||
| 360 | * lane of mask is 0 or 1, respectively. */ | ||
| 361 | static inline SIMD_CFUNC simd_float8 simd_select(simd_float8 x, simd_float8 y, simd_int8 mask); | ||
| 362 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 363 | * of x or y according to whether the high-order bit of the corresponding | ||
| 364 | * lane of mask is 0 or 1, respectively. */ | ||
| 365 | static inline SIMD_CFUNC simd_float16 simd_select(simd_float16 x, simd_float16 y, simd_int16 mask); | ||
| 366 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 367 | * of x or y according to whether the high-order bit of the corresponding | ||
| 368 | * lane of mask is 0 or 1, respectively. */ | ||
| 369 | static inline SIMD_CFUNC simd_double2 simd_select(simd_double2 x, simd_double2 y, simd_long2 mask); | ||
| 370 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 371 | * of x or y according to whether the high-order bit of the corresponding | ||
| 372 | * lane of mask is 0 or 1, respectively. */ | ||
| 373 | static inline SIMD_CFUNC simd_double3 simd_select(simd_double3 x, simd_double3 y, simd_long3 mask); | ||
| 374 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 375 | * of x or y according to whether the high-order bit of the corresponding | ||
| 376 | * lane of mask is 0 or 1, respectively. */ | ||
| 377 | static inline SIMD_CFUNC simd_double4 simd_select(simd_double4 x, simd_double4 y, simd_long4 mask); | ||
| 378 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 379 | * of x or y according to whether the high-order bit of the corresponding | ||
| 380 | * lane of mask is 0 or 1, respectively. */ | ||
| 381 | static inline SIMD_CFUNC simd_double8 simd_select(simd_double8 x, simd_double8 y, simd_long8 mask); | ||
| 382 | /*! @abstract For each lane in the result, selects the corresponding element | ||
| 383 | * of x or y according to whether the high-order bit of the corresponding | ||
| 384 | * lane of mask is 0 or 1, respectively. | ||
| 385 | * @discussion Deprecated. Use simd_select instead. */ | ||
| 386 | #define vector_select simd_select | ||
| 387 | |||
| 388 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 389 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 390 | * respectively. */ | ||
| 391 | static inline SIMD_CFUNC simd_char2 simd_bitselect(simd_char2 x, simd_char2 y, simd_char2 mask); | ||
| 392 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 393 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 394 | * respectively. */ | ||
| 395 | static inline SIMD_CFUNC simd_char3 simd_bitselect(simd_char3 x, simd_char3 y, simd_char3 mask); | ||
| 396 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 397 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 398 | * respectively. */ | ||
| 399 | static inline SIMD_CFUNC simd_char4 simd_bitselect(simd_char4 x, simd_char4 y, simd_char4 mask); | ||
| 400 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 401 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 402 | * respectively. */ | ||
| 403 | static inline SIMD_CFUNC simd_char8 simd_bitselect(simd_char8 x, simd_char8 y, simd_char8 mask); | ||
| 404 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 405 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 406 | * respectively. */ | ||
| 407 | static inline SIMD_CFUNC simd_char16 simd_bitselect(simd_char16 x, simd_char16 y, simd_char16 mask); | ||
| 408 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 409 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 410 | * respectively. */ | ||
| 411 | static inline SIMD_CFUNC simd_char32 simd_bitselect(simd_char32 x, simd_char32 y, simd_char32 mask); | ||
| 412 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 413 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 414 | * respectively. */ | ||
| 415 | static inline SIMD_CFUNC simd_char64 simd_bitselect(simd_char64 x, simd_char64 y, simd_char64 mask); | ||
| 416 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 417 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 418 | * respectively. */ | ||
| 419 | static inline SIMD_CFUNC simd_uchar2 simd_bitselect(simd_uchar2 x, simd_uchar2 y, simd_char2 mask); | ||
| 420 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 421 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 422 | * respectively. */ | ||
| 423 | static inline SIMD_CFUNC simd_uchar3 simd_bitselect(simd_uchar3 x, simd_uchar3 y, simd_char3 mask); | ||
| 424 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 425 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 426 | * respectively. */ | ||
| 427 | static inline SIMD_CFUNC simd_uchar4 simd_bitselect(simd_uchar4 x, simd_uchar4 y, simd_char4 mask); | ||
| 428 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 429 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 430 | * respectively. */ | ||
| 431 | static inline SIMD_CFUNC simd_uchar8 simd_bitselect(simd_uchar8 x, simd_uchar8 y, simd_char8 mask); | ||
| 432 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 433 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 434 | * respectively. */ | ||
| 435 | static inline SIMD_CFUNC simd_uchar16 simd_bitselect(simd_uchar16 x, simd_uchar16 y, simd_char16 mask); | ||
| 436 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 437 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 438 | * respectively. */ | ||
| 439 | static inline SIMD_CFUNC simd_uchar32 simd_bitselect(simd_uchar32 x, simd_uchar32 y, simd_char32 mask); | ||
| 440 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 441 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 442 | * respectively. */ | ||
| 443 | static inline SIMD_CFUNC simd_uchar64 simd_bitselect(simd_uchar64 x, simd_uchar64 y, simd_char64 mask); | ||
| 444 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 445 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 446 | * respectively. */ | ||
| 447 | static inline SIMD_CFUNC simd_short2 simd_bitselect(simd_short2 x, simd_short2 y, simd_short2 mask); | ||
| 448 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 449 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 450 | * respectively. */ | ||
| 451 | static inline SIMD_CFUNC simd_short3 simd_bitselect(simd_short3 x, simd_short3 y, simd_short3 mask); | ||
| 452 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 453 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 454 | * respectively. */ | ||
| 455 | static inline SIMD_CFUNC simd_short4 simd_bitselect(simd_short4 x, simd_short4 y, simd_short4 mask); | ||
| 456 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 457 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 458 | * respectively. */ | ||
| 459 | static inline SIMD_CFUNC simd_short8 simd_bitselect(simd_short8 x, simd_short8 y, simd_short8 mask); | ||
| 460 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 461 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 462 | * respectively. */ | ||
| 463 | static inline SIMD_CFUNC simd_short16 simd_bitselect(simd_short16 x, simd_short16 y, simd_short16 mask); | ||
| 464 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 465 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 466 | * respectively. */ | ||
| 467 | static inline SIMD_CFUNC simd_short32 simd_bitselect(simd_short32 x, simd_short32 y, simd_short32 mask); | ||
| 468 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 469 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 470 | * respectively. */ | ||
| 471 | static inline SIMD_CFUNC simd_ushort2 simd_bitselect(simd_ushort2 x, simd_ushort2 y, simd_short2 mask); | ||
| 472 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 473 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 474 | * respectively. */ | ||
| 475 | static inline SIMD_CFUNC simd_ushort3 simd_bitselect(simd_ushort3 x, simd_ushort3 y, simd_short3 mask); | ||
| 476 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 477 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 478 | * respectively. */ | ||
| 479 | static inline SIMD_CFUNC simd_ushort4 simd_bitselect(simd_ushort4 x, simd_ushort4 y, simd_short4 mask); | ||
| 480 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 481 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 482 | * respectively. */ | ||
| 483 | static inline SIMD_CFUNC simd_ushort8 simd_bitselect(simd_ushort8 x, simd_ushort8 y, simd_short8 mask); | ||
| 484 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 485 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 486 | * respectively. */ | ||
| 487 | static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_ushort16 y, simd_short16 mask); | ||
| 488 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 489 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 490 | * respectively. */ | ||
| 491 | static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask); | ||
| 492 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 493 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 494 | * respectively. */ | ||
| 495 | static inline SIMD_CFUNC simd_int2 simd_bitselect(simd_int2 x, simd_int2 y, simd_int2 mask); | ||
| 496 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 497 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 498 | * respectively. */ | ||
| 499 | static inline SIMD_CFUNC simd_int3 simd_bitselect(simd_int3 x, simd_int3 y, simd_int3 mask); | ||
| 500 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 501 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 502 | * respectively. */ | ||
| 503 | static inline SIMD_CFUNC simd_int4 simd_bitselect(simd_int4 x, simd_int4 y, simd_int4 mask); | ||
| 504 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 505 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 506 | * respectively. */ | ||
| 507 | static inline SIMD_CFUNC simd_int8 simd_bitselect(simd_int8 x, simd_int8 y, simd_int8 mask); | ||
| 508 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 509 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 510 | * respectively. */ | ||
| 511 | static inline SIMD_CFUNC simd_int16 simd_bitselect(simd_int16 x, simd_int16 y, simd_int16 mask); | ||
| 512 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 513 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 514 | * respectively. */ | ||
| 515 | static inline SIMD_CFUNC simd_uint2 simd_bitselect(simd_uint2 x, simd_uint2 y, simd_int2 mask); | ||
| 516 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 517 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 518 | * respectively. */ | ||
| 519 | static inline SIMD_CFUNC simd_uint3 simd_bitselect(simd_uint3 x, simd_uint3 y, simd_int3 mask); | ||
| 520 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 521 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 522 | * respectively. */ | ||
| 523 | static inline SIMD_CFUNC simd_uint4 simd_bitselect(simd_uint4 x, simd_uint4 y, simd_int4 mask); | ||
| 524 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 525 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 526 | * respectively. */ | ||
| 527 | static inline SIMD_CFUNC simd_uint8 simd_bitselect(simd_uint8 x, simd_uint8 y, simd_int8 mask); | ||
| 528 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 529 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 530 | * respectively. */ | ||
| 531 | static inline SIMD_CFUNC simd_uint16 simd_bitselect(simd_uint16 x, simd_uint16 y, simd_int16 mask); | ||
| 532 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 533 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 534 | * respectively. */ | ||
| 535 | static inline SIMD_CFUNC simd_float2 simd_bitselect(simd_float2 x, simd_float2 y, simd_int2 mask); | ||
| 536 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 537 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 538 | * respectively. */ | ||
| 539 | static inline SIMD_CFUNC simd_float3 simd_bitselect(simd_float3 x, simd_float3 y, simd_int3 mask); | ||
| 540 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 541 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 542 | * respectively. */ | ||
| 543 | static inline SIMD_CFUNC simd_float4 simd_bitselect(simd_float4 x, simd_float4 y, simd_int4 mask); | ||
| 544 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 545 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 546 | * respectively. */ | ||
| 547 | static inline SIMD_CFUNC simd_float8 simd_bitselect(simd_float8 x, simd_float8 y, simd_int8 mask); | ||
| 548 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 549 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 550 | * respectively. */ | ||
| 551 | static inline SIMD_CFUNC simd_float16 simd_bitselect(simd_float16 x, simd_float16 y, simd_int16 mask); | ||
| 552 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 553 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 554 | * respectively. */ | ||
| 555 | static inline SIMD_CFUNC simd_long2 simd_bitselect(simd_long2 x, simd_long2 y, simd_long2 mask); | ||
| 556 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 557 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 558 | * respectively. */ | ||
| 559 | static inline SIMD_CFUNC simd_long3 simd_bitselect(simd_long3 x, simd_long3 y, simd_long3 mask); | ||
| 560 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 561 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 562 | * respectively. */ | ||
| 563 | static inline SIMD_CFUNC simd_long4 simd_bitselect(simd_long4 x, simd_long4 y, simd_long4 mask); | ||
| 564 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 565 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 566 | * respectively. */ | ||
| 567 | static inline SIMD_CFUNC simd_long8 simd_bitselect(simd_long8 x, simd_long8 y, simd_long8 mask); | ||
| 568 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 569 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 570 | * respectively. */ | ||
| 571 | static inline SIMD_CFUNC simd_ulong2 simd_bitselect(simd_ulong2 x, simd_ulong2 y, simd_long2 mask); | ||
| 572 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 573 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 574 | * respectively. */ | ||
| 575 | static inline SIMD_CFUNC simd_ulong3 simd_bitselect(simd_ulong3 x, simd_ulong3 y, simd_long3 mask); | ||
| 576 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 577 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 578 | * respectively. */ | ||
| 579 | static inline SIMD_CFUNC simd_ulong4 simd_bitselect(simd_ulong4 x, simd_ulong4 y, simd_long4 mask); | ||
| 580 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 581 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 582 | * respectively. */ | ||
| 583 | static inline SIMD_CFUNC simd_ulong8 simd_bitselect(simd_ulong8 x, simd_ulong8 y, simd_long8 mask); | ||
| 584 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 585 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 586 | * respectively. */ | ||
| 587 | static inline SIMD_CFUNC simd_double2 simd_bitselect(simd_double2 x, simd_double2 y, simd_long2 mask); | ||
| 588 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 589 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 590 | * respectively. */ | ||
| 591 | static inline SIMD_CFUNC simd_double3 simd_bitselect(simd_double3 x, simd_double3 y, simd_long3 mask); | ||
| 592 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 593 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 594 | * respectively. */ | ||
| 595 | static inline SIMD_CFUNC simd_double4 simd_bitselect(simd_double4 x, simd_double4 y, simd_long4 mask); | ||
| 596 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 597 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 598 | * respectively. */ | ||
| 599 | static inline SIMD_CFUNC simd_double8 simd_bitselect(simd_double8 x, simd_double8 y, simd_long8 mask); | ||
| 600 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 601 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 602 | * respectively. | ||
| 603 | * @discussion Deprecated. Use simd_bitselect instead. */ | ||
| 604 | #define vector_bitselect simd_bitselect | ||
| 605 | |||
| 606 | #ifdef __cplusplus | ||
| 607 | } /* extern "C" */ | ||
| 608 | |||
| 609 | namespace simd { | ||
| 610 | /*! @abstract True if and only if the high-order bit of every lane is set. */ | ||
| 611 | template <typename inttypeN> static SIMD_CPPFUNC simd_bool all(const inttypeN predicate) { return ::simd_all(predicate); } | ||
| 612 | /*! @abstract True if and only if the high-order bit of any lane is set. */ | ||
| 613 | template <typename inttypeN> static SIMD_CPPFUNC simd_bool any(const inttypeN predicate) { return ::simd_any(predicate); } | ||
| 614 | /*! @abstract Each lane of the result is selected from the corresponding lane | ||
| 615 | * of x or y according to whether the high-order bit of the corresponding | ||
| 616 | * lane of mask is 0 or 1, respectively. */ | ||
| 617 | template <typename inttypeN, typename fptypeN> static SIMD_CPPFUNC fptypeN select(const fptypeN x, const fptypeN y, const inttypeN predicate) { return ::simd_select(x,y,predicate); } | ||
| 618 | /*! @abstract For each bit in the result, selects the corresponding bit of x | ||
| 619 | * or y according to whether the corresponding bit of mask is 0 or 1, | ||
| 620 | * respectively. */ | ||
| 621 | template <typename inttypeN, typename typeN> static SIMD_CPPFUNC typeN bitselect(const typeN x, const typeN y, const inttypeN mask) { return ::simd_bitselect(x,y,mask); } | ||
| 622 | } | ||
| 623 | |||
| 624 | extern "C" { | ||
| 625 | #endif /* __cplusplus */ | ||
| 626 | |||
| 627 | #pragma mark - Implementations | ||
| 628 | |||
| 629 | static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) { | ||
| 630 | #if defined __SSE2__ | ||
| 631 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3); | ||
| 632 | #elif defined __arm64__ | ||
| 633 | return simd_any(x.xyxy); | ||
| 634 | #else | ||
| 635 | union { uint16_t i; simd_char2 v; } u = { .v = x }; | ||
| 636 | return (u.i & 0x8080); | ||
| 637 | #endif | ||
| 638 | } | ||
| 639 | static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) { | ||
| 640 | #if defined __SSE2__ | ||
| 641 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7); | ||
| 642 | #elif defined __arm64__ | ||
| 643 | return simd_any(x.xyzz); | ||
| 644 | #else | ||
| 645 | union { uint32_t i; simd_char3 v; } u = { .v = x }; | ||
| 646 | return (u.i & 0x808080); | ||
| 647 | #endif | ||
| 648 | } | ||
| 649 | static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) { | ||
| 650 | #if defined __SSE2__ | ||
| 651 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf); | ||
| 652 | #elif defined __arm64__ | ||
| 653 | return simd_any(x.xyzwxyzw); | ||
| 654 | #else | ||
| 655 | union { uint32_t i; simd_char4 v; } u = { .v = x }; | ||
| 656 | return (u.i & 0x80808080); | ||
| 657 | #endif | ||
| 658 | } | ||
| 659 | static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) { | ||
| 660 | #if defined __SSE2__ | ||
| 661 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff); | ||
| 662 | #elif defined __arm64__ | ||
| 663 | return vmaxv_u8(x) & 0x80; | ||
| 664 | #else | ||
| 665 | union { uint64_t i; simd_char8 v; } u = { .v = x }; | ||
| 666 | return (u.i & 0x8080808080808080); | ||
| 667 | #endif | ||
| 668 | } | ||
| 669 | static inline SIMD_CFUNC simd_bool simd_any(simd_char16 x) { | ||
| 670 | #if defined __SSE2__ | ||
| 671 | return _mm_movemask_epi8((__m128i)x); | ||
| 672 | #elif defined __arm64__ | ||
| 673 | return vmaxvq_u8(x) & 0x80; | ||
| 674 | #else | ||
| 675 | return simd_any(x.lo | x.hi); | ||
| 676 | #endif | ||
| 677 | } | ||
| 678 | static inline SIMD_CFUNC simd_bool simd_any(simd_char32 x) { | ||
| 679 | #if defined __AVX2__ | ||
| 680 | return _mm256_movemask_epi8(x); | ||
| 681 | #else | ||
| 682 | return simd_any(x.lo | x.hi); | ||
| 683 | #endif | ||
| 684 | } | ||
| 685 | static inline SIMD_CFUNC simd_bool simd_any(simd_char64 x) { | ||
| 686 | return simd_any(x.lo | x.hi); | ||
| 687 | } | ||
| 688 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar2 x) { | ||
| 689 | return simd_any((simd_char2)x); | ||
| 690 | } | ||
| 691 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar3 x) { | ||
| 692 | return simd_any((simd_char3)x); | ||
| 693 | } | ||
| 694 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar4 x) { | ||
| 695 | return simd_any((simd_char4)x); | ||
| 696 | } | ||
| 697 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar8 x) { | ||
| 698 | return simd_any((simd_char8)x); | ||
| 699 | } | ||
| 700 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar16 x) { | ||
| 701 | return simd_any((simd_char16)x); | ||
| 702 | } | ||
| 703 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar32 x) { | ||
| 704 | return simd_any((simd_char32)x); | ||
| 705 | } | ||
| 706 | static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x) { | ||
| 707 | return simd_any((simd_char64)x); | ||
| 708 | } | ||
| 709 | static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) { | ||
| 710 | #if defined __SSE2__ | ||
| 711 | return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa); | ||
| 712 | #elif defined __arm64__ | ||
| 713 | return simd_any(x.xyxy); | ||
| 714 | #else | ||
| 715 | union { uint32_t i; simd_short2 v; } u = { .v = x }; | ||
| 716 | return (u.i & 0x80008000); | ||
| 717 | #endif | ||
| 718 | } | ||
| 719 | static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) { | ||
| 720 | #if defined __SSE2__ | ||
| 721 | return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a); | ||
| 722 | #elif defined __arm64__ | ||
| 723 | return simd_any(x.xyzz); | ||
| 724 | #else | ||
| 725 | union { uint64_t i; simd_short3 v; } u = { .v = x }; | ||
| 726 | return (u.i & 0x800080008000); | ||
| 727 | #endif | ||
| 728 | } | ||
| 729 | static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) { | ||
| 730 | #if defined __SSE2__ | ||
| 731 | return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa); | ||
| 732 | #elif defined __arm64__ | ||
| 733 | return vmaxv_u16(x) & 0x8000; | ||
| 734 | #else | ||
| 735 | union { uint64_t i; simd_short4 v; } u = { .v = x }; | ||
| 736 | return (u.i & 0x8000800080008000); | ||
| 737 | #endif | ||
| 738 | } | ||
| 739 | static inline SIMD_CFUNC simd_bool simd_any(simd_short8 x) { | ||
| 740 | #if defined __SSE2__ | ||
| 741 | return (_mm_movemask_epi8((__m128i)x) & 0xaaaa); | ||
| 742 | #elif defined __arm64__ | ||
| 743 | return vmaxvq_u16(x) & 0x8000; | ||
| 744 | #else | ||
| 745 | return simd_any(x.lo | x.hi); | ||
| 746 | #endif | ||
| 747 | } | ||
| 748 | static inline SIMD_CFUNC simd_bool simd_any(simd_short16 x) { | ||
| 749 | #if defined __AVX2__ | ||
| 750 | return (_mm256_movemask_epi8(x) & 0xaaaaaaaa); | ||
| 751 | #else | ||
| 752 | return simd_any(x.lo | x.hi); | ||
| 753 | #endif | ||
| 754 | } | ||
| 755 | static inline SIMD_CFUNC simd_bool simd_any(simd_short32 x) { | ||
| 756 | return simd_any(x.lo | x.hi); | ||
| 757 | } | ||
| 758 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort2 x) { | ||
| 759 | return simd_any((simd_short2)x); | ||
| 760 | } | ||
| 761 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort3 x) { | ||
| 762 | return simd_any((simd_short3)x); | ||
| 763 | } | ||
| 764 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort4 x) { | ||
| 765 | return simd_any((simd_short4)x); | ||
| 766 | } | ||
| 767 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort8 x) { | ||
| 768 | return simd_any((simd_short8)x); | ||
| 769 | } | ||
| 770 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort16 x) { | ||
| 771 | return simd_any((simd_short16)x); | ||
| 772 | } | ||
| 773 | static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x) { | ||
| 774 | return simd_any((simd_short32)x); | ||
| 775 | } | ||
| 776 | static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) { | ||
| 777 | #if defined __SSE2__ | ||
| 778 | return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3); | ||
| 779 | #elif defined __arm64__ | ||
| 780 | return vmaxv_u32(x) & 0x80000000; | ||
| 781 | #else | ||
| 782 | union { uint64_t i; simd_int2 v; } u = { .v = x }; | ||
| 783 | return (u.i & 0x8000000080000000); | ||
| 784 | #endif | ||
| 785 | } | ||
| 786 | static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) { | ||
| 787 | #if defined __SSE2__ | ||
| 788 | return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7); | ||
| 789 | #elif defined __arm64__ | ||
| 790 | return simd_any(x.xyzz); | ||
| 791 | #else | ||
| 792 | return (x.x | x.y | x.z) & 0x80000000; | ||
| 793 | #endif | ||
| 794 | } | ||
| 795 | static inline SIMD_CFUNC simd_bool simd_any(simd_int4 x) { | ||
| 796 | #if defined __SSE2__ | ||
| 797 | return _mm_movemask_ps((__m128)x); | ||
| 798 | #elif defined __arm64__ | ||
| 799 | return vmaxvq_u32(x) & 0x80000000; | ||
| 800 | #else | ||
| 801 | return simd_any(x.lo | x.hi); | ||
| 802 | #endif | ||
| 803 | } | ||
| 804 | static inline SIMD_CFUNC simd_bool simd_any(simd_int8 x) { | ||
| 805 | #if defined __AVX__ | ||
| 806 | return _mm256_movemask_ps(x); | ||
| 807 | #else | ||
| 808 | return simd_any(x.lo | x.hi); | ||
| 809 | #endif | ||
| 810 | } | ||
| 811 | static inline SIMD_CFUNC simd_bool simd_any(simd_int16 x) { | ||
| 812 | return simd_any(x.lo | x.hi); | ||
| 813 | } | ||
| 814 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint2 x) { | ||
| 815 | return simd_any((simd_int2)x); | ||
| 816 | } | ||
| 817 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint3 x) { | ||
| 818 | return simd_any((simd_int3)x); | ||
| 819 | } | ||
| 820 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint4 x) { | ||
| 821 | return simd_any((simd_int4)x); | ||
| 822 | } | ||
| 823 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint8 x) { | ||
| 824 | return simd_any((simd_int8)x); | ||
| 825 | } | ||
| 826 | static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x) { | ||
| 827 | return simd_any((simd_int16)x); | ||
| 828 | } | ||
| 829 | static inline SIMD_CFUNC simd_bool simd_any(simd_long2 x) { | ||
| 830 | #if defined __SSE2__ | ||
| 831 | return _mm_movemask_pd((__m128d)x); | ||
| 832 | #elif defined __arm64__ | ||
| 833 | return (x.x | x.y) & 0x8000000000000000U; | ||
| 834 | #else | ||
| 835 | return (x.x | x.y) & 0x8000000000000000U; | ||
| 836 | #endif | ||
| 837 | } | ||
| 838 | static inline SIMD_CFUNC simd_bool simd_any(simd_long3 x) { | ||
| 839 | #if defined __AVX__ | ||
| 840 | return (_mm256_movemask_pd(simd_make_long4_undef(x)) & 0x7); | ||
| 841 | #else | ||
| 842 | return (x.x | x.y | x.z) & 0x8000000000000000U; | ||
| 843 | #endif | ||
| 844 | } | ||
| 845 | static inline SIMD_CFUNC simd_bool simd_any(simd_long4 x) { | ||
| 846 | #if defined __AVX__ | ||
| 847 | return _mm256_movemask_pd(x); | ||
| 848 | #else | ||
| 849 | return simd_any(x.lo | x.hi); | ||
| 850 | #endif | ||
| 851 | } | ||
| 852 | static inline SIMD_CFUNC simd_bool simd_any(simd_long8 x) { | ||
| 853 | return simd_any(x.lo | x.hi); | ||
| 854 | } | ||
| 855 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong2 x) { | ||
| 856 | return simd_any((simd_long2)x); | ||
| 857 | } | ||
| 858 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong3 x) { | ||
| 859 | return simd_any((simd_long3)x); | ||
| 860 | } | ||
| 861 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong4 x) { | ||
| 862 | return simd_any((simd_long4)x); | ||
| 863 | } | ||
| 864 | static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x) { | ||
| 865 | return simd_any((simd_long8)x); | ||
| 866 | } | ||
| 867 | |||
| 868 | static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) { | ||
| 869 | #if defined __SSE2__ | ||
| 870 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3) == 0x3; | ||
| 871 | #elif defined __arm64__ | ||
| 872 | return simd_all(x.xyxy); | ||
| 873 | #else | ||
| 874 | union { uint16_t i; simd_char2 v; } u = { .v = x }; | ||
| 875 | return (u.i & 0x8080) == 0x8080; | ||
| 876 | #endif | ||
| 877 | } | ||
| 878 | static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) { | ||
| 879 | #if defined __SSE2__ | ||
| 880 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7) == 0x7; | ||
| 881 | #elif defined __arm64__ | ||
| 882 | return simd_all(x.xyzz); | ||
| 883 | #else | ||
| 884 | union { uint32_t i; simd_char3 v; } u = { .v = x }; | ||
| 885 | return (u.i & 0x808080) == 0x808080; | ||
| 886 | #endif | ||
| 887 | } | ||
| 888 | static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) { | ||
| 889 | #if defined __SSE2__ | ||
| 890 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf) == 0xf; | ||
| 891 | #elif defined __arm64__ | ||
| 892 | return simd_all(x.xyzwxyzw); | ||
| 893 | #else | ||
| 894 | union { uint32_t i; simd_char4 v; } u = { .v = x }; | ||
| 895 | return (u.i & 0x80808080) == 0x80808080; | ||
| 896 | #endif | ||
| 897 | } | ||
| 898 | static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) { | ||
| 899 | #if defined __SSE2__ | ||
| 900 | return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff) == 0xff; | ||
| 901 | #elif defined __arm64__ | ||
| 902 | return vminv_u8(x) & 0x80; | ||
| 903 | #else | ||
| 904 | union { uint64_t i; simd_char8 v; } u = { .v = x }; | ||
| 905 | return (u.i & 0x8080808080808080) == 0x8080808080808080; | ||
| 906 | #endif | ||
| 907 | } | ||
| 908 | static inline SIMD_CFUNC simd_bool simd_all(simd_char16 x) { | ||
| 909 | #if defined __SSE2__ | ||
| 910 | return _mm_movemask_epi8((__m128i)x) == 0xffff; | ||
| 911 | #elif defined __arm64__ | ||
| 912 | return vminvq_u8(x) & 0x80; | ||
| 913 | #else | ||
| 914 | return simd_all(x.lo & x.hi); | ||
| 915 | #endif | ||
| 916 | } | ||
| 917 | static inline SIMD_CFUNC simd_bool simd_all(simd_char32 x) { | ||
| 918 | #if defined __AVX2__ | ||
| 919 | return _mm256_movemask_epi8(x) == 0xffffffff; | ||
| 920 | #else | ||
| 921 | return simd_all(x.lo & x.hi); | ||
| 922 | #endif | ||
| 923 | } | ||
| 924 | static inline SIMD_CFUNC simd_bool simd_all(simd_char64 x) { | ||
| 925 | return simd_all(x.lo & x.hi); | ||
| 926 | } | ||
| 927 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar2 x) { | ||
| 928 | return simd_all((simd_char2)x); | ||
| 929 | } | ||
| 930 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar3 x) { | ||
| 931 | return simd_all((simd_char3)x); | ||
| 932 | } | ||
| 933 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar4 x) { | ||
| 934 | return simd_all((simd_char4)x); | ||
| 935 | } | ||
| 936 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar8 x) { | ||
| 937 | return simd_all((simd_char8)x); | ||
| 938 | } | ||
| 939 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar16 x) { | ||
| 940 | return simd_all((simd_char16)x); | ||
| 941 | } | ||
| 942 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar32 x) { | ||
| 943 | return simd_all((simd_char32)x); | ||
| 944 | } | ||
| 945 | static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x) { | ||
| 946 | return simd_all((simd_char64)x); | ||
| 947 | } | ||
| 948 | static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) { | ||
| 949 | #if defined __SSE2__ | ||
| 950 | return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa) == 0xa; | ||
| 951 | #elif defined __arm64__ | ||
| 952 | return simd_all(x.xyxy); | ||
| 953 | #else | ||
| 954 | union { uint32_t i; simd_short2 v; } u = { .v = x }; | ||
| 955 | return (u.i & 0x80008000) == 0x80008000; | ||
| 956 | #endif | ||
| 957 | } | ||
| 958 | static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) { | ||
| 959 | #if defined __SSE2__ | ||
| 960 | return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a) == 0x2a; | ||
| 961 | #elif defined __arm64__ | ||
| 962 | return simd_all(x.xyzz); | ||
| 963 | #else | ||
| 964 | union { uint64_t i; simd_short3 v; } u = { .v = x }; | ||
| 965 | return (u.i & 0x800080008000) == 0x800080008000; | ||
| 966 | #endif | ||
| 967 | } | ||
| 968 | static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) { | ||
| 969 | #if defined __SSE2__ | ||
| 970 | return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa) == 0xaa; | ||
| 971 | #elif defined __arm64__ | ||
| 972 | return vminv_u16(x) & 0x8000; | ||
| 973 | #else | ||
| 974 | union { uint64_t i; simd_short4 v; } u = { .v = x }; | ||
| 975 | return (u.i & 0x8000800080008000) == 0x8000800080008000; | ||
| 976 | #endif | ||
| 977 | } | ||
| 978 | static inline SIMD_CFUNC simd_bool simd_all(simd_short8 x) { | ||
| 979 | #if defined __SSE2__ | ||
| 980 | return (_mm_movemask_epi8((__m128i)x) & 0xaaaa) == 0xaaaa; | ||
| 981 | #elif defined __arm64__ | ||
| 982 | return vminvq_u16(x) & 0x8000; | ||
| 983 | #else | ||
| 984 | return simd_all(x.lo & x.hi); | ||
| 985 | #endif | ||
| 986 | } | ||
| 987 | static inline SIMD_CFUNC simd_bool simd_all(simd_short16 x) { | ||
| 988 | #if defined __AVX2__ | ||
| 989 | return (_mm256_movemask_epi8(x) & 0xaaaaaaaa) == 0xaaaaaaaa; | ||
| 990 | #else | ||
| 991 | return simd_all(x.lo & x.hi); | ||
| 992 | #endif | ||
| 993 | } | ||
| 994 | static inline SIMD_CFUNC simd_bool simd_all(simd_short32 x) { | ||
| 995 | return simd_all(x.lo & x.hi); | ||
| 996 | } | ||
| 997 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort2 x) { | ||
| 998 | return simd_all((simd_short2)x); | ||
| 999 | } | ||
| 1000 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort3 x) { | ||
| 1001 | return simd_all((simd_short3)x); | ||
| 1002 | } | ||
| 1003 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort4 x) { | ||
| 1004 | return simd_all((simd_short4)x); | ||
| 1005 | } | ||
| 1006 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort8 x) { | ||
| 1007 | return simd_all((simd_short8)x); | ||
| 1008 | } | ||
| 1009 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort16 x) { | ||
| 1010 | return simd_all((simd_short16)x); | ||
| 1011 | } | ||
| 1012 | static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x) { | ||
| 1013 | return simd_all((simd_short32)x); | ||
| 1014 | } | ||
| 1015 | static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) { | ||
| 1016 | #if defined __SSE2__ | ||
| 1017 | return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3) == 0x3; | ||
| 1018 | #elif defined __arm64__ | ||
| 1019 | return vminv_u32(x) & 0x80000000; | ||
| 1020 | #else | ||
| 1021 | union { uint64_t i; simd_int2 v; } u = { .v = x }; | ||
| 1022 | return (u.i & 0x8000000080000000) == 0x8000000080000000; | ||
| 1023 | #endif | ||
| 1024 | } | ||
| 1025 | static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) { | ||
| 1026 | #if defined __SSE2__ | ||
| 1027 | return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7) == 0x7; | ||
| 1028 | #elif defined __arm64__ | ||
| 1029 | return simd_all(x.xyzz); | ||
| 1030 | #else | ||
| 1031 | return (x.x & x.y & x.z) & 0x80000000; | ||
| 1032 | #endif | ||
| 1033 | } | ||
| 1034 | static inline SIMD_CFUNC simd_bool simd_all(simd_int4 x) { | ||
| 1035 | #if defined __SSE2__ | ||
| 1036 | return _mm_movemask_ps((__m128)x) == 0xf; | ||
| 1037 | #elif defined __arm64__ | ||
| 1038 | return vminvq_u32(x) & 0x80000000; | ||
| 1039 | #else | ||
| 1040 | return simd_all(x.lo & x.hi); | ||
| 1041 | #endif | ||
| 1042 | } | ||
| 1043 | static inline SIMD_CFUNC simd_bool simd_all(simd_int8 x) { | ||
| 1044 | #if defined __AVX__ | ||
| 1045 | return _mm256_movemask_ps(x) == 0xff; | ||
| 1046 | #else | ||
| 1047 | return simd_all(x.lo & x.hi); | ||
| 1048 | #endif | ||
| 1049 | } | ||
| 1050 | static inline SIMD_CFUNC simd_bool simd_all(simd_int16 x) { | ||
| 1051 | return simd_all(x.lo & x.hi); | ||
| 1052 | } | ||
| 1053 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint2 x) { | ||
| 1054 | return simd_all((simd_int2)x); | ||
| 1055 | } | ||
| 1056 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint3 x) { | ||
| 1057 | return simd_all((simd_int3)x); | ||
| 1058 | } | ||
| 1059 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint4 x) { | ||
| 1060 | return simd_all((simd_int4)x); | ||
| 1061 | } | ||
| 1062 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint8 x) { | ||
| 1063 | return simd_all((simd_int8)x); | ||
| 1064 | } | ||
| 1065 | static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x) { | ||
| 1066 | return simd_all((simd_int16)x); | ||
| 1067 | } | ||
| 1068 | static inline SIMD_CFUNC simd_bool simd_all(simd_long2 x) { | ||
| 1069 | #if defined __SSE2__ | ||
| 1070 | return _mm_movemask_pd((__m128d)x) == 0x3; | ||
| 1071 | #elif defined __arm64__ | ||
| 1072 | return (x.x & x.y) & 0x8000000000000000U; | ||
| 1073 | #else | ||
| 1074 | return (x.x & x.y) & 0x8000000000000000U; | ||
| 1075 | #endif | ||
| 1076 | } | ||
| 1077 | static inline SIMD_CFUNC simd_bool simd_all(simd_long3 x) { | ||
| 1078 | #if defined __AVX__ | ||
| 1079 | return (_mm256_movemask_pd(simd_make_long4_undef(x)) & 0x7) == 0x7; | ||
| 1080 | #else | ||
| 1081 | return (x.x & x.y & x.z) & 0x8000000000000000U; | ||
| 1082 | #endif | ||
| 1083 | } | ||
| 1084 | static inline SIMD_CFUNC simd_bool simd_all(simd_long4 x) { | ||
| 1085 | #if defined __AVX__ | ||
| 1086 | return _mm256_movemask_pd(x) == 0xf; | ||
| 1087 | #else | ||
| 1088 | return simd_all(x.lo & x.hi); | ||
| 1089 | #endif | ||
| 1090 | } | ||
| 1091 | static inline SIMD_CFUNC simd_bool simd_all(simd_long8 x) { | ||
| 1092 | return simd_all(x.lo & x.hi); | ||
| 1093 | } | ||
| 1094 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong2 x) { | ||
| 1095 | return simd_all((simd_long2)x); | ||
| 1096 | } | ||
| 1097 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong3 x) { | ||
| 1098 | return simd_all((simd_long3)x); | ||
| 1099 | } | ||
| 1100 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong4 x) { | ||
| 1101 | return simd_all((simd_long4)x); | ||
| 1102 | } | ||
| 1103 | static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x) { | ||
| 1104 | return simd_all((simd_long8)x); | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | static inline SIMD_CFUNC simd_float2 simd_select(simd_float2 x, simd_float2 y, simd_int2 mask) { | ||
| 1108 | return simd_make_float2(simd_select(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_int4_undef(mask))); | ||
| 1109 | } | ||
| 1110 | static inline SIMD_CFUNC simd_float3 simd_select(simd_float3 x, simd_float3 y, simd_int3 mask) { | ||
| 1111 | return simd_make_float3(simd_select(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_int4_undef(mask))); | ||
| 1112 | } | ||
| 1113 | static inline SIMD_CFUNC simd_float4 simd_select(simd_float4 x, simd_float4 y, simd_int4 mask) { | ||
| 1114 | #if defined __SSE4_1__ | ||
| 1115 | return _mm_blendv_ps(x, y, (__m128)mask); | ||
| 1116 | #else | ||
| 1117 | return simd_bitselect(x, y, mask >> 31); | ||
| 1118 | #endif | ||
| 1119 | } | ||
| 1120 | static inline SIMD_CFUNC simd_float8 simd_select(simd_float8 x, simd_float8 y, simd_int8 mask) { | ||
| 1121 | #if defined __AVX__ | ||
| 1122 | return _mm256_blendv_ps(x, y, mask); | ||
| 1123 | #else | ||
| 1124 | return simd_bitselect(x, y, mask >> 31); | ||
| 1125 | #endif | ||
| 1126 | } | ||
| 1127 | static inline SIMD_CFUNC simd_float16 simd_select(simd_float16 x, simd_float16 y, simd_int16 mask) { | ||
| 1128 | return simd_bitselect(x, y, mask >> 31); | ||
| 1129 | } | ||
| 1130 | static inline SIMD_CFUNC simd_double2 simd_select(simd_double2 x, simd_double2 y, simd_long2 mask) { | ||
| 1131 | #if defined __SSE4_1__ | ||
| 1132 | return _mm_blendv_pd(x, y, (__m128d)mask); | ||
| 1133 | #else | ||
| 1134 | return simd_bitselect(x, y, mask >> 63); | ||
| 1135 | #endif | ||
| 1136 | } | ||
| 1137 | static inline SIMD_CFUNC simd_double3 simd_select(simd_double3 x, simd_double3 y, simd_long3 mask) { | ||
| 1138 | return simd_make_double3(simd_select(simd_make_double4_undef(x), simd_make_double4_undef(y), simd_make_long4_undef(mask))); | ||
| 1139 | } | ||
| 1140 | static inline SIMD_CFUNC simd_double4 simd_select(simd_double4 x, simd_double4 y, simd_long4 mask) { | ||
| 1141 | #if defined __AVX__ | ||
| 1142 | return _mm256_blendv_pd(x, y, mask); | ||
| 1143 | #else | ||
| 1144 | return simd_bitselect(x, y, mask >> 63); | ||
| 1145 | #endif | ||
| 1146 | } | ||
| 1147 | static inline SIMD_CFUNC simd_double8 simd_select(simd_double8 x, simd_double8 y, simd_long8 mask) { | ||
| 1148 | return simd_bitselect(x, y, mask >> 63); | ||
| 1149 | } | ||
| 1150 | |||
| 1151 | static inline SIMD_CFUNC simd_char2 simd_bitselect(simd_char2 x, simd_char2 y, simd_char2 mask) { | ||
| 1152 | return (x & ~mask) | (y & mask); | ||
| 1153 | } | ||
| 1154 | static inline SIMD_CFUNC simd_char3 simd_bitselect(simd_char3 x, simd_char3 y, simd_char3 mask) { | ||
| 1155 | return (x & ~mask) | (y & mask); | ||
| 1156 | } | ||
| 1157 | static inline SIMD_CFUNC simd_char4 simd_bitselect(simd_char4 x, simd_char4 y, simd_char4 mask) { | ||
| 1158 | return (x & ~mask) | (y & mask); | ||
| 1159 | } | ||
| 1160 | static inline SIMD_CFUNC simd_char8 simd_bitselect(simd_char8 x, simd_char8 y, simd_char8 mask) { | ||
| 1161 | return (x & ~mask) | (y & mask); | ||
| 1162 | } | ||
| 1163 | static inline SIMD_CFUNC simd_char16 simd_bitselect(simd_char16 x, simd_char16 y, simd_char16 mask) { | ||
| 1164 | return (x & ~mask) | (y & mask); | ||
| 1165 | } | ||
| 1166 | static inline SIMD_CFUNC simd_char32 simd_bitselect(simd_char32 x, simd_char32 y, simd_char32 mask) { | ||
| 1167 | return (x & ~mask) | (y & mask); | ||
| 1168 | } | ||
| 1169 | static inline SIMD_CFUNC simd_char64 simd_bitselect(simd_char64 x, simd_char64 y, simd_char64 mask) { | ||
| 1170 | return (x & ~mask) | (y & mask); | ||
| 1171 | } | ||
| 1172 | static inline SIMD_CFUNC simd_uchar2 simd_bitselect(simd_uchar2 x, simd_uchar2 y, simd_char2 mask) { | ||
| 1173 | return (simd_uchar2)simd_bitselect((simd_char2)x, (simd_char2)y, mask); | ||
| 1174 | } | ||
| 1175 | static inline SIMD_CFUNC simd_uchar3 simd_bitselect(simd_uchar3 x, simd_uchar3 y, simd_char3 mask) { | ||
| 1176 | return (simd_uchar3)simd_bitselect((simd_char3)x, (simd_char3)y, mask); | ||
| 1177 | } | ||
| 1178 | static inline SIMD_CFUNC simd_uchar4 simd_bitselect(simd_uchar4 x, simd_uchar4 y, simd_char4 mask) { | ||
| 1179 | return (simd_uchar4)simd_bitselect((simd_char4)x, (simd_char4)y, mask); | ||
| 1180 | } | ||
| 1181 | static inline SIMD_CFUNC simd_uchar8 simd_bitselect(simd_uchar8 x, simd_uchar8 y, simd_char8 mask) { | ||
| 1182 | return (simd_uchar8)simd_bitselect((simd_char8)x, (simd_char8)y, mask); | ||
| 1183 | } | ||
| 1184 | static inline SIMD_CFUNC simd_uchar16 simd_bitselect(simd_uchar16 x, simd_uchar16 y, simd_char16 mask) { | ||
| 1185 | return (simd_uchar16)simd_bitselect((simd_char16)x, (simd_char16)y, mask); | ||
| 1186 | } | ||
| 1187 | static inline SIMD_CFUNC simd_uchar32 simd_bitselect(simd_uchar32 x, simd_uchar32 y, simd_char32 mask) { | ||
| 1188 | return (simd_uchar32)simd_bitselect((simd_char32)x, (simd_char32)y, mask); | ||
| 1189 | } | ||
| 1190 | static inline SIMD_CFUNC simd_uchar64 simd_bitselect(simd_uchar64 x, simd_uchar64 y, simd_char64 mask) { | ||
| 1191 | return (simd_uchar64)simd_bitselect((simd_char64)x, (simd_char64)y, mask); | ||
| 1192 | } | ||
| 1193 | static inline SIMD_CFUNC simd_short2 simd_bitselect(simd_short2 x, simd_short2 y, simd_short2 mask) { | ||
| 1194 | return (x & ~mask) | (y & mask); | ||
| 1195 | } | ||
| 1196 | static inline SIMD_CFUNC simd_short3 simd_bitselect(simd_short3 x, simd_short3 y, simd_short3 mask) { | ||
| 1197 | return (x & ~mask) | (y & mask); | ||
| 1198 | } | ||
| 1199 | static inline SIMD_CFUNC simd_short4 simd_bitselect(simd_short4 x, simd_short4 y, simd_short4 mask) { | ||
| 1200 | return (x & ~mask) | (y & mask); | ||
| 1201 | } | ||
| 1202 | static inline SIMD_CFUNC simd_short8 simd_bitselect(simd_short8 x, simd_short8 y, simd_short8 mask) { | ||
| 1203 | return (x & ~mask) | (y & mask); | ||
| 1204 | } | ||
| 1205 | static inline SIMD_CFUNC simd_short16 simd_bitselect(simd_short16 x, simd_short16 y, simd_short16 mask) { | ||
| 1206 | return (x & ~mask) | (y & mask); | ||
| 1207 | } | ||
| 1208 | static inline SIMD_CFUNC simd_short32 simd_bitselect(simd_short32 x, simd_short32 y, simd_short32 mask) { | ||
| 1209 | return (x & ~mask) | (y & mask); | ||
| 1210 | } | ||
| 1211 | static inline SIMD_CFUNC simd_ushort2 simd_bitselect(simd_ushort2 x, simd_ushort2 y, simd_short2 mask) { | ||
| 1212 | return (simd_ushort2)simd_bitselect((simd_short2)x, (simd_short2)y, mask); | ||
| 1213 | } | ||
| 1214 | static inline SIMD_CFUNC simd_ushort3 simd_bitselect(simd_ushort3 x, simd_ushort3 y, simd_short3 mask) { | ||
| 1215 | return (simd_ushort3)simd_bitselect((simd_short3)x, (simd_short3)y, mask); | ||
| 1216 | } | ||
| 1217 | static inline SIMD_CFUNC simd_ushort4 simd_bitselect(simd_ushort4 x, simd_ushort4 y, simd_short4 mask) { | ||
| 1218 | return (simd_ushort4)simd_bitselect((simd_short4)x, (simd_short4)y, mask); | ||
| 1219 | } | ||
| 1220 | static inline SIMD_CFUNC simd_ushort8 simd_bitselect(simd_ushort8 x, simd_ushort8 y, simd_short8 mask) { | ||
| 1221 | return (simd_ushort8)simd_bitselect((simd_short8)x, (simd_short8)y, mask); | ||
| 1222 | } | ||
| 1223 | static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_ushort16 y, simd_short16 mask) { | ||
| 1224 | return (simd_ushort16)simd_bitselect((simd_short16)x, (simd_short16)y, mask); | ||
| 1225 | } | ||
| 1226 | static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask) { | ||
| 1227 | return (simd_ushort32)simd_bitselect((simd_short32)x, (simd_short32)y, mask); | ||
| 1228 | } | ||
| 1229 | static inline SIMD_CFUNC simd_int2 simd_bitselect(simd_int2 x, simd_int2 y, simd_int2 mask) { | ||
| 1230 | return (x & ~mask) | (y & mask); | ||
| 1231 | } | ||
| 1232 | static inline SIMD_CFUNC simd_int3 simd_bitselect(simd_int3 x, simd_int3 y, simd_int3 mask) { | ||
| 1233 | return (x & ~mask) | (y & mask); | ||
| 1234 | } | ||
| 1235 | static inline SIMD_CFUNC simd_int4 simd_bitselect(simd_int4 x, simd_int4 y, simd_int4 mask) { | ||
| 1236 | return (x & ~mask) | (y & mask); | ||
| 1237 | } | ||
| 1238 | static inline SIMD_CFUNC simd_int8 simd_bitselect(simd_int8 x, simd_int8 y, simd_int8 mask) { | ||
| 1239 | return (x & ~mask) | (y & mask); | ||
| 1240 | } | ||
| 1241 | static inline SIMD_CFUNC simd_int16 simd_bitselect(simd_int16 x, simd_int16 y, simd_int16 mask) { | ||
| 1242 | return (x & ~mask) | (y & mask); | ||
| 1243 | } | ||
| 1244 | static inline SIMD_CFUNC simd_uint2 simd_bitselect(simd_uint2 x, simd_uint2 y, simd_int2 mask) { | ||
| 1245 | return (simd_uint2)simd_bitselect((simd_int2)x, (simd_int2)y, mask); | ||
| 1246 | } | ||
| 1247 | static inline SIMD_CFUNC simd_uint3 simd_bitselect(simd_uint3 x, simd_uint3 y, simd_int3 mask) { | ||
| 1248 | return (simd_uint3)simd_bitselect((simd_int3)x, (simd_int3)y, mask); | ||
| 1249 | } | ||
| 1250 | static inline SIMD_CFUNC simd_uint4 simd_bitselect(simd_uint4 x, simd_uint4 y, simd_int4 mask) { | ||
| 1251 | return (simd_uint4)simd_bitselect((simd_int4)x, (simd_int4)y, mask); | ||
| 1252 | } | ||
| 1253 | static inline SIMD_CFUNC simd_uint8 simd_bitselect(simd_uint8 x, simd_uint8 y, simd_int8 mask) { | ||
| 1254 | return (simd_uint8)simd_bitselect((simd_int8)x, (simd_int8)y, mask); | ||
| 1255 | } | ||
| 1256 | static inline SIMD_CFUNC simd_uint16 simd_bitselect(simd_uint16 x, simd_uint16 y, simd_int16 mask) { | ||
| 1257 | return (simd_uint16)simd_bitselect((simd_int16)x, (simd_int16)y, mask); | ||
| 1258 | } | ||
| 1259 | static inline SIMD_CFUNC simd_float2 simd_bitselect(simd_float2 x, simd_float2 y, simd_int2 mask) { | ||
| 1260 | return (simd_float2)simd_bitselect((simd_int2)x, (simd_int2)y, mask); | ||
| 1261 | } | ||
| 1262 | static inline SIMD_CFUNC simd_float3 simd_bitselect(simd_float3 x, simd_float3 y, simd_int3 mask) { | ||
| 1263 | return (simd_float3)simd_bitselect((simd_int3)x, (simd_int3)y, mask); | ||
| 1264 | } | ||
| 1265 | static inline SIMD_CFUNC simd_float4 simd_bitselect(simd_float4 x, simd_float4 y, simd_int4 mask) { | ||
| 1266 | return (simd_float4)simd_bitselect((simd_int4)x, (simd_int4)y, mask); | ||
| 1267 | } | ||
| 1268 | static inline SIMD_CFUNC simd_float8 simd_bitselect(simd_float8 x, simd_float8 y, simd_int8 mask) { | ||
| 1269 | return (simd_float8)simd_bitselect((simd_int8)x, (simd_int8)y, mask); | ||
| 1270 | } | ||
| 1271 | static inline SIMD_CFUNC simd_float16 simd_bitselect(simd_float16 x, simd_float16 y, simd_int16 mask) { | ||
| 1272 | return (simd_float16)simd_bitselect((simd_int16)x, (simd_int16)y, mask); | ||
| 1273 | } | ||
| 1274 | static inline SIMD_CFUNC simd_long2 simd_bitselect(simd_long2 x, simd_long2 y, simd_long2 mask) { | ||
| 1275 | return (x & ~mask) | (y & mask); | ||
| 1276 | } | ||
| 1277 | static inline SIMD_CFUNC simd_long3 simd_bitselect(simd_long3 x, simd_long3 y, simd_long3 mask) { | ||
| 1278 | return (x & ~mask) | (y & mask); | ||
| 1279 | } | ||
| 1280 | static inline SIMD_CFUNC simd_long4 simd_bitselect(simd_long4 x, simd_long4 y, simd_long4 mask) { | ||
| 1281 | return (x & ~mask) | (y & mask); | ||
| 1282 | } | ||
| 1283 | static inline SIMD_CFUNC simd_long8 simd_bitselect(simd_long8 x, simd_long8 y, simd_long8 mask) { | ||
| 1284 | return (x & ~mask) | (y & mask); | ||
| 1285 | } | ||
| 1286 | static inline SIMD_CFUNC simd_ulong2 simd_bitselect(simd_ulong2 x, simd_ulong2 y, simd_long2 mask) { | ||
| 1287 | return (simd_ulong2)simd_bitselect((simd_long2)x, (simd_long2)y, mask); | ||
| 1288 | } | ||
| 1289 | static inline SIMD_CFUNC simd_ulong3 simd_bitselect(simd_ulong3 x, simd_ulong3 y, simd_long3 mask) { | ||
| 1290 | return (simd_ulong3)simd_bitselect((simd_long3)x, (simd_long3)y, mask); | ||
| 1291 | } | ||
| 1292 | static inline SIMD_CFUNC simd_ulong4 simd_bitselect(simd_ulong4 x, simd_ulong4 y, simd_long4 mask) { | ||
| 1293 | return (simd_ulong4)simd_bitselect((simd_long4)x, (simd_long4)y, mask); | ||
| 1294 | } | ||
| 1295 | static inline SIMD_CFUNC simd_ulong8 simd_bitselect(simd_ulong8 x, simd_ulong8 y, simd_long8 mask) { | ||
| 1296 | return (simd_ulong8)simd_bitselect((simd_long8)x, (simd_long8)y, mask); | ||
| 1297 | } | ||
| 1298 | static inline SIMD_CFUNC simd_double2 simd_bitselect(simd_double2 x, simd_double2 y, simd_long2 mask) { | ||
| 1299 | return (simd_double2)simd_bitselect((simd_long2)x, (simd_long2)y, mask); | ||
| 1300 | } | ||
| 1301 | static inline SIMD_CFUNC simd_double3 simd_bitselect(simd_double3 x, simd_double3 y, simd_long3 mask) { | ||
| 1302 | return (simd_double3)simd_bitselect((simd_long3)x, (simd_long3)y, mask); | ||
| 1303 | } | ||
| 1304 | static inline SIMD_CFUNC simd_double4 simd_bitselect(simd_double4 x, simd_double4 y, simd_long4 mask) { | ||
| 1305 | return (simd_double4)simd_bitselect((simd_long4)x, (simd_long4)y, mask); | ||
| 1306 | } | ||
| 1307 | static inline SIMD_CFUNC simd_double8 simd_bitselect(simd_double8 x, simd_double8 y, simd_long8 mask) { | ||
| 1308 | return (simd_double8)simd_bitselect((simd_long8)x, (simd_long8)y, mask); | ||
| 1309 | } | ||
| 1310 | |||
| 1311 | #ifdef __cplusplus | ||
| 1312 | } | ||
| 1313 | #endif | ||
| 1314 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 1315 | #endif /* __SIMD_LOGIC_HEADER__ */ | ||
lib/libc/include/x86_64-macos-gnu/simd/math.h created+5380| ... | @@ -0,0 +1,5380 @@ | ||
| 1 | /*! @header | ||
| 2 | * The interfaces declared in this header provide elementwise math operations | ||
| 3 | * on vectors; each lane of the result vector depends only on the data in the | ||
| 4 | * corresponding lane of the argument(s) to the function. | ||
| 5 | * | ||
| 6 | * You should not use the C functions declared in this header directly (these | ||
| 7 | * are functions with names like `__tg_cos(x)`). These are merely | ||
| 8 | * implementation details of <tgmath.h> overloading; instead of calling | ||
| 9 | * `__tg_cos(x)`, call `cos(x)`. If you are writing C++, use `simd::cos(x)`. | ||
| 10 | * | ||
| 11 | * Note that while these vector functions are relatively recent additions, | ||
| 12 | * scalar fallback is provided for all of them, so they are available even | ||
| 13 | * when targeting older OS versions. | ||
| 14 | * | ||
| 15 | * The following functions are available: | ||
| 16 | * | ||
| 17 | * C name C++ name Notes | ||
| 18 | * ---------------------------------------------------------------------- | ||
| 19 | * acos(x) simd::acos(x) | ||
| 20 | * asin(x) simd::asin(x) | ||
| 21 | * atan(x) simd::atan(x) | ||
| 22 | * atan2(y,x) simd::atan2(y,x) The argument order matches the scalar | ||
| 23 | * atan2 function, which gives the angle | ||
| 24 | * of a line with slope y/x. | ||
| 25 | * cos(x) simd::cos(x) | ||
| 26 | * sin(x) simd::sin(x) | ||
| 27 | * tan(x) simd::tan(x) | ||
| 28 | * | ||
| 29 | * cospi(x) simd::cospi(x) Returns cos(pi*x), sin(pi*x), tan(pi*x) | ||
| 30 | * sinpi(x) simd::sinpi(x) more efficiently and accurately than | ||
| 31 | * tanpi(x) simd::tanpi(x) would otherwise be possible | ||
| 32 | * | ||
| 33 | * acosh(x) simd::acosh(x) | ||
| 34 | * asinh(x) simd::asinh(x) | ||
| 35 | * atanh(x) simd::atanh(x) | ||
| 36 | * | ||
| 37 | * cosh(x) simd::cosh(x) | ||
| 38 | * sinh(x) simd::sinh(x) | ||
| 39 | * tanh(x) simd::tanh(x) | ||
| 40 | * | ||
| 41 | * exp(x) simd::exp(x) | ||
| 42 | * exp2(x) simd::exp2(x) | ||
| 43 | * exp10(x) simd::exp10(x) More efficient that pow(10,x). | ||
| 44 | * expm1(x) simd::expm1(x) exp(x)-1, accurate even for tiny x. | ||
| 45 | * | ||
| 46 | * log(x) simd::log(x) | ||
| 47 | * log2(x) simd::log2(x) | ||
| 48 | * log10(x) simd::log10(x) | ||
| 49 | * log1p(x) simd::log1p(x) log(1+x), accurate even for tiny x. | ||
| 50 | * | ||
| 51 | * fabs(x) simd::fabs(x) | ||
| 52 | * cbrt(x) simd::cbrt(x) | ||
| 53 | * sqrt(x) simd::sqrt(x) | ||
| 54 | * pow(x,y) simd::pow(x,y) | ||
| 55 | * copysign(x,y) simd::copysign(x,y) | ||
| 56 | * hypot(x,y) simd::hypot(x,y) sqrt(x*x + y*y), computed without | ||
| 57 | * overflow.1 | ||
| 58 | * erf(x) simd::erf(x) | ||
| 59 | * erfc(x) simd::erfc(x) | ||
| 60 | * tgamma(x) simd::tgamma(x) | ||
| 61 | * | ||
| 62 | * fmod(x,y) simd::fmod(x,y) | ||
| 63 | * remainder(x,y) simd::remainder(x,y) | ||
| 64 | * | ||
| 65 | * ceil(x) simd::ceil(x) | ||
| 66 | * floor(x) simd::floor(x) | ||
| 67 | * rint(x) simd::rint(x) | ||
| 68 | * round(x) simd::round(x) | ||
| 69 | * trunc(x) simd::trunc(x) | ||
| 70 | * | ||
| 71 | * fdim(x,y) simd::fdim(x,y) | ||
| 72 | * fmax(x,y) simd::fmax(x,y) When one argument to fmin or fmax is | ||
| 73 | * fmin(x,y) simd::fmin(x,y) constant, use it as the *second* (y) | ||
| 74 | * argument to get better codegen on some | ||
| 75 | * architectures. E.g., write fmin(x,2) | ||
| 76 | * instead of fmin(2,x). | ||
| 77 | * fma(x,y,z) simd::fma(x,y,z) Fast on arm64 and when targeting AVX2 | ||
| 78 | * and later; may be quite expensive on | ||
| 79 | * older hardware. | ||
| 80 | * simd_muladd(x,y,z) simd::muladd(x,y,z) | ||
| 81 | * | ||
| 82 | * @copyright 2014-2017 Apple, Inc. All rights reserved. | ||
| 83 | * @unsorted */ | ||
| 84 | |||
| 85 | #ifndef SIMD_MATH_HEADER | ||
| 86 | #define SIMD_MATH_HEADER | ||
| 87 | |||
| 88 | #include <simd/base.h> | ||
| 89 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 90 | #include <simd/vector_make.h> | ||
| 91 | #include <simd/logic.h> | ||
| 92 | |||
| 93 | #ifdef __cplusplus | ||
| 94 | extern "C" { | ||
| 95 | #endif | ||
| 96 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 97 | * Objective-C, and `simd::acos` in C++. */ | ||
| 98 | static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x); | ||
| 99 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 100 | * Objective-C, and `simd::acos` in C++. */ | ||
| 101 | static inline SIMD_CFUNC simd_float3 __tg_acos(simd_float3 x); | ||
| 102 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 103 | * Objective-C, and `simd::acos` in C++. */ | ||
| 104 | static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x); | ||
| 105 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 106 | * Objective-C, and `simd::acos` in C++. */ | ||
| 107 | static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x); | ||
| 108 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 109 | * Objective-C, and `simd::acos` in C++. */ | ||
| 110 | static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x); | ||
| 111 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 112 | * Objective-C, and `simd::acos` in C++. */ | ||
| 113 | static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x); | ||
| 114 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 115 | * Objective-C, and `simd::acos` in C++. */ | ||
| 116 | static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x); | ||
| 117 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 118 | * Objective-C, and `simd::acos` in C++. */ | ||
| 119 | static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x); | ||
| 120 | /*! @abstract Do not call this function; instead use `acos` in C and | ||
| 121 | * Objective-C, and `simd::acos` in C++. */ | ||
| 122 | static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x); | ||
| 123 | |||
| 124 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 125 | * Objective-C, and `simd::asin` in C++. */ | ||
| 126 | static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x); | ||
| 127 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 128 | * Objective-C, and `simd::asin` in C++. */ | ||
| 129 | static inline SIMD_CFUNC simd_float3 __tg_asin(simd_float3 x); | ||
| 130 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 131 | * Objective-C, and `simd::asin` in C++. */ | ||
| 132 | static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x); | ||
| 133 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 134 | * Objective-C, and `simd::asin` in C++. */ | ||
| 135 | static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x); | ||
| 136 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 137 | * Objective-C, and `simd::asin` in C++. */ | ||
| 138 | static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x); | ||
| 139 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 140 | * Objective-C, and `simd::asin` in C++. */ | ||
| 141 | static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x); | ||
| 142 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 143 | * Objective-C, and `simd::asin` in C++. */ | ||
| 144 | static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x); | ||
| 145 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 146 | * Objective-C, and `simd::asin` in C++. */ | ||
| 147 | static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x); | ||
| 148 | /*! @abstract Do not call this function; instead use `asin` in C and | ||
| 149 | * Objective-C, and `simd::asin` in C++. */ | ||
| 150 | static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x); | ||
| 151 | |||
| 152 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 153 | * Objective-C, and `simd::atan` in C++. */ | ||
| 154 | static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x); | ||
| 155 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 156 | * Objective-C, and `simd::atan` in C++. */ | ||
| 157 | static inline SIMD_CFUNC simd_float3 __tg_atan(simd_float3 x); | ||
| 158 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 159 | * Objective-C, and `simd::atan` in C++. */ | ||
| 160 | static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x); | ||
| 161 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 162 | * Objective-C, and `simd::atan` in C++. */ | ||
| 163 | static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x); | ||
| 164 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 165 | * Objective-C, and `simd::atan` in C++. */ | ||
| 166 | static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x); | ||
| 167 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 168 | * Objective-C, and `simd::atan` in C++. */ | ||
| 169 | static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x); | ||
| 170 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 171 | * Objective-C, and `simd::atan` in C++. */ | ||
| 172 | static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x); | ||
| 173 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 174 | * Objective-C, and `simd::atan` in C++. */ | ||
| 175 | static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x); | ||
| 176 | /*! @abstract Do not call this function; instead use `atan` in C and | ||
| 177 | * Objective-C, and `simd::atan` in C++. */ | ||
| 178 | static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x); | ||
| 179 | |||
| 180 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 181 | * Objective-C, and `simd::cos` in C++. */ | ||
| 182 | static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x); | ||
| 183 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 184 | * Objective-C, and `simd::cos` in C++. */ | ||
| 185 | static inline SIMD_CFUNC simd_float3 __tg_cos(simd_float3 x); | ||
| 186 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 187 | * Objective-C, and `simd::cos` in C++. */ | ||
| 188 | static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x); | ||
| 189 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 190 | * Objective-C, and `simd::cos` in C++. */ | ||
| 191 | static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x); | ||
| 192 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 193 | * Objective-C, and `simd::cos` in C++. */ | ||
| 194 | static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x); | ||
| 195 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 196 | * Objective-C, and `simd::cos` in C++. */ | ||
| 197 | static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x); | ||
| 198 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 199 | * Objective-C, and `simd::cos` in C++. */ | ||
| 200 | static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x); | ||
| 201 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 202 | * Objective-C, and `simd::cos` in C++. */ | ||
| 203 | static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x); | ||
| 204 | /*! @abstract Do not call this function; instead use `cos` in C and | ||
| 205 | * Objective-C, and `simd::cos` in C++. */ | ||
| 206 | static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x); | ||
| 207 | |||
| 208 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 209 | * Objective-C, and `simd::sin` in C++. */ | ||
| 210 | static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x); | ||
| 211 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 212 | * Objective-C, and `simd::sin` in C++. */ | ||
| 213 | static inline SIMD_CFUNC simd_float3 __tg_sin(simd_float3 x); | ||
| 214 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 215 | * Objective-C, and `simd::sin` in C++. */ | ||
| 216 | static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x); | ||
| 217 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 218 | * Objective-C, and `simd::sin` in C++. */ | ||
| 219 | static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x); | ||
| 220 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 221 | * Objective-C, and `simd::sin` in C++. */ | ||
| 222 | static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x); | ||
| 223 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 224 | * Objective-C, and `simd::sin` in C++. */ | ||
| 225 | static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x); | ||
| 226 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 227 | * Objective-C, and `simd::sin` in C++. */ | ||
| 228 | static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x); | ||
| 229 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 230 | * Objective-C, and `simd::sin` in C++. */ | ||
| 231 | static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x); | ||
| 232 | /*! @abstract Do not call this function; instead use `sin` in C and | ||
| 233 | * Objective-C, and `simd::sin` in C++. */ | ||
| 234 | static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x); | ||
| 235 | |||
| 236 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 237 | * Objective-C, and `simd::tan` in C++. */ | ||
| 238 | static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x); | ||
| 239 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 240 | * Objective-C, and `simd::tan` in C++. */ | ||
| 241 | static inline SIMD_CFUNC simd_float3 __tg_tan(simd_float3 x); | ||
| 242 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 243 | * Objective-C, and `simd::tan` in C++. */ | ||
| 244 | static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x); | ||
| 245 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 246 | * Objective-C, and `simd::tan` in C++. */ | ||
| 247 | static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x); | ||
| 248 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 249 | * Objective-C, and `simd::tan` in C++. */ | ||
| 250 | static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x); | ||
| 251 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 252 | * Objective-C, and `simd::tan` in C++. */ | ||
| 253 | static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x); | ||
| 254 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 255 | * Objective-C, and `simd::tan` in C++. */ | ||
| 256 | static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x); | ||
| 257 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 258 | * Objective-C, and `simd::tan` in C++. */ | ||
| 259 | static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x); | ||
| 260 | /*! @abstract Do not call this function; instead use `tan` in C and | ||
| 261 | * Objective-C, and `simd::tan` in C++. */ | ||
| 262 | static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x); | ||
| 263 | |||
| 264 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 265 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 266 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 267 | static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x); | ||
| 268 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 269 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 270 | static inline SIMD_CFUNC simd_float3 __tg_cospi(simd_float3 x); | ||
| 271 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 272 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 273 | static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x); | ||
| 274 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 275 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 276 | static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x); | ||
| 277 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 278 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 279 | static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x); | ||
| 280 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 281 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 282 | static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x); | ||
| 283 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 284 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 285 | static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x); | ||
| 286 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 287 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 288 | static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x); | ||
| 289 | /*! @abstract Do not call this function; instead use `cospi` in C and | ||
| 290 | * Objective-C, and `simd::cospi` in C++. */ | ||
| 291 | static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x); | ||
| 292 | #endif | ||
| 293 | |||
| 294 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 295 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 296 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 297 | static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x); | ||
| 298 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 299 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 300 | static inline SIMD_CFUNC simd_float3 __tg_sinpi(simd_float3 x); | ||
| 301 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 302 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 303 | static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x); | ||
| 304 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 305 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 306 | static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x); | ||
| 307 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 308 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 309 | static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x); | ||
| 310 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 311 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 312 | static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x); | ||
| 313 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 314 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 315 | static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x); | ||
| 316 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 317 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 318 | static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x); | ||
| 319 | /*! @abstract Do not call this function; instead use `sinpi` in C and | ||
| 320 | * Objective-C, and `simd::sinpi` in C++. */ | ||
| 321 | static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x); | ||
| 322 | #endif | ||
| 323 | |||
| 324 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 325 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 326 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 327 | static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x); | ||
| 328 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 329 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 330 | static inline SIMD_CFUNC simd_float3 __tg_tanpi(simd_float3 x); | ||
| 331 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 332 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 333 | static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x); | ||
| 334 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 335 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 336 | static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x); | ||
| 337 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 338 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 339 | static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x); | ||
| 340 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 341 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 342 | static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x); | ||
| 343 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 344 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 345 | static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x); | ||
| 346 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 347 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 348 | static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x); | ||
| 349 | /*! @abstract Do not call this function; instead use `tanpi` in C and | ||
| 350 | * Objective-C, and `simd::tanpi` in C++. */ | ||
| 351 | static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x); | ||
| 352 | #endif | ||
| 353 | |||
| 354 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 355 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 356 | static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x); | ||
| 357 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 358 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 359 | static inline SIMD_CFUNC simd_float3 __tg_acosh(simd_float3 x); | ||
| 360 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 361 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 362 | static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x); | ||
| 363 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 364 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 365 | static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x); | ||
| 366 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 367 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 368 | static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x); | ||
| 369 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 370 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 371 | static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x); | ||
| 372 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 373 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 374 | static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x); | ||
| 375 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 376 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 377 | static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x); | ||
| 378 | /*! @abstract Do not call this function; instead use `acosh` in C and | ||
| 379 | * Objective-C, and `simd::acosh` in C++. */ | ||
| 380 | static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x); | ||
| 381 | |||
| 382 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 383 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 384 | static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x); | ||
| 385 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 386 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 387 | static inline SIMD_CFUNC simd_float3 __tg_asinh(simd_float3 x); | ||
| 388 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 389 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 390 | static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x); | ||
| 391 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 392 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 393 | static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x); | ||
| 394 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 395 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 396 | static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x); | ||
| 397 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 398 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 399 | static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x); | ||
| 400 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 401 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 402 | static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x); | ||
| 403 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 404 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 405 | static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x); | ||
| 406 | /*! @abstract Do not call this function; instead use `asinh` in C and | ||
| 407 | * Objective-C, and `simd::asinh` in C++. */ | ||
| 408 | static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x); | ||
| 409 | |||
| 410 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 411 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 412 | static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x); | ||
| 413 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 414 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 415 | static inline SIMD_CFUNC simd_float3 __tg_atanh(simd_float3 x); | ||
| 416 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 417 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 418 | static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x); | ||
| 419 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 420 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 421 | static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x); | ||
| 422 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 423 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 424 | static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x); | ||
| 425 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 426 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 427 | static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x); | ||
| 428 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 429 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 430 | static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x); | ||
| 431 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 432 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 433 | static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x); | ||
| 434 | /*! @abstract Do not call this function; instead use `atanh` in C and | ||
| 435 | * Objective-C, and `simd::atanh` in C++. */ | ||
| 436 | static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x); | ||
| 437 | |||
| 438 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 439 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 440 | static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x); | ||
| 441 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 442 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 443 | static inline SIMD_CFUNC simd_float3 __tg_cosh(simd_float3 x); | ||
| 444 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 445 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 446 | static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x); | ||
| 447 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 448 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 449 | static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x); | ||
| 450 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 451 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 452 | static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x); | ||
| 453 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 454 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 455 | static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x); | ||
| 456 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 457 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 458 | static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x); | ||
| 459 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 460 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 461 | static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x); | ||
| 462 | /*! @abstract Do not call this function; instead use `cosh` in C and | ||
| 463 | * Objective-C, and `simd::cosh` in C++. */ | ||
| 464 | static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x); | ||
| 465 | |||
| 466 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 467 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 468 | static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x); | ||
| 469 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 470 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 471 | static inline SIMD_CFUNC simd_float3 __tg_sinh(simd_float3 x); | ||
| 472 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 473 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 474 | static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x); | ||
| 475 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 476 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 477 | static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x); | ||
| 478 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 479 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 480 | static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x); | ||
| 481 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 482 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 483 | static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x); | ||
| 484 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 485 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 486 | static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x); | ||
| 487 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 488 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 489 | static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x); | ||
| 490 | /*! @abstract Do not call this function; instead use `sinh` in C and | ||
| 491 | * Objective-C, and `simd::sinh` in C++. */ | ||
| 492 | static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x); | ||
| 493 | |||
| 494 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 495 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 496 | static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x); | ||
| 497 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 498 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 499 | static inline SIMD_CFUNC simd_float3 __tg_tanh(simd_float3 x); | ||
| 500 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 501 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 502 | static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x); | ||
| 503 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 504 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 505 | static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x); | ||
| 506 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 507 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 508 | static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x); | ||
| 509 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 510 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 511 | static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x); | ||
| 512 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 513 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 514 | static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x); | ||
| 515 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 516 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 517 | static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x); | ||
| 518 | /*! @abstract Do not call this function; instead use `tanh` in C and | ||
| 519 | * Objective-C, and `simd::tanh` in C++. */ | ||
| 520 | static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x); | ||
| 521 | |||
| 522 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 523 | * Objective-C, and `simd::exp` in C++. */ | ||
| 524 | static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x); | ||
| 525 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 526 | * Objective-C, and `simd::exp` in C++. */ | ||
| 527 | static inline SIMD_CFUNC simd_float3 __tg_exp(simd_float3 x); | ||
| 528 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 529 | * Objective-C, and `simd::exp` in C++. */ | ||
| 530 | static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x); | ||
| 531 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 532 | * Objective-C, and `simd::exp` in C++. */ | ||
| 533 | static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x); | ||
| 534 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 535 | * Objective-C, and `simd::exp` in C++. */ | ||
| 536 | static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x); | ||
| 537 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 538 | * Objective-C, and `simd::exp` in C++. */ | ||
| 539 | static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x); | ||
| 540 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 541 | * Objective-C, and `simd::exp` in C++. */ | ||
| 542 | static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x); | ||
| 543 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 544 | * Objective-C, and `simd::exp` in C++. */ | ||
| 545 | static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x); | ||
| 546 | /*! @abstract Do not call this function; instead use `exp` in C and | ||
| 547 | * Objective-C, and `simd::exp` in C++. */ | ||
| 548 | static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x); | ||
| 549 | |||
| 550 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 551 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 552 | static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x); | ||
| 553 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 554 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 555 | static inline SIMD_CFUNC simd_float3 __tg_exp2(simd_float3 x); | ||
| 556 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 557 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 558 | static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x); | ||
| 559 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 560 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 561 | static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x); | ||
| 562 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 563 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 564 | static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x); | ||
| 565 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 566 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 567 | static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x); | ||
| 568 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 569 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 570 | static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x); | ||
| 571 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 572 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 573 | static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x); | ||
| 574 | /*! @abstract Do not call this function; instead use `exp2` in C and | ||
| 575 | * Objective-C, and `simd::exp2` in C++. */ | ||
| 576 | static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x); | ||
| 577 | |||
| 578 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 579 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 580 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 581 | static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x); | ||
| 582 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 583 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 584 | static inline SIMD_CFUNC simd_float3 __tg_exp10(simd_float3 x); | ||
| 585 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 586 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 587 | static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x); | ||
| 588 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 589 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 590 | static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x); | ||
| 591 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 592 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 593 | static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x); | ||
| 594 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 595 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 596 | static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x); | ||
| 597 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 598 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 599 | static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x); | ||
| 600 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 601 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 602 | static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x); | ||
| 603 | /*! @abstract Do not call this function; instead use `exp10` in C and | ||
| 604 | * Objective-C, and `simd::exp10` in C++. */ | ||
| 605 | static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x); | ||
| 606 | #endif | ||
| 607 | |||
| 608 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 609 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 610 | static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x); | ||
| 611 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 612 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 613 | static inline SIMD_CFUNC simd_float3 __tg_expm1(simd_float3 x); | ||
| 614 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 615 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 616 | static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x); | ||
| 617 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 618 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 619 | static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x); | ||
| 620 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 621 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 622 | static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x); | ||
| 623 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 624 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 625 | static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x); | ||
| 626 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 627 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 628 | static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x); | ||
| 629 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 630 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 631 | static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x); | ||
| 632 | /*! @abstract Do not call this function; instead use `expm1` in C and | ||
| 633 | * Objective-C, and `simd::expm1` in C++. */ | ||
| 634 | static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x); | ||
| 635 | |||
| 636 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 637 | * Objective-C, and `simd::log` in C++. */ | ||
| 638 | static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x); | ||
| 639 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 640 | * Objective-C, and `simd::log` in C++. */ | ||
| 641 | static inline SIMD_CFUNC simd_float3 __tg_log(simd_float3 x); | ||
| 642 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 643 | * Objective-C, and `simd::log` in C++. */ | ||
| 644 | static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x); | ||
| 645 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 646 | * Objective-C, and `simd::log` in C++. */ | ||
| 647 | static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x); | ||
| 648 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 649 | * Objective-C, and `simd::log` in C++. */ | ||
| 650 | static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x); | ||
| 651 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 652 | * Objective-C, and `simd::log` in C++. */ | ||
| 653 | static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x); | ||
| 654 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 655 | * Objective-C, and `simd::log` in C++. */ | ||
| 656 | static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x); | ||
| 657 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 658 | * Objective-C, and `simd::log` in C++. */ | ||
| 659 | static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x); | ||
| 660 | /*! @abstract Do not call this function; instead use `log` in C and | ||
| 661 | * Objective-C, and `simd::log` in C++. */ | ||
| 662 | static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x); | ||
| 663 | |||
| 664 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 665 | * Objective-C, and `simd::log2` in C++. */ | ||
| 666 | static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x); | ||
| 667 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 668 | * Objective-C, and `simd::log2` in C++. */ | ||
| 669 | static inline SIMD_CFUNC simd_float3 __tg_log2(simd_float3 x); | ||
| 670 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 671 | * Objective-C, and `simd::log2` in C++. */ | ||
| 672 | static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x); | ||
| 673 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 674 | * Objective-C, and `simd::log2` in C++. */ | ||
| 675 | static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x); | ||
| 676 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 677 | * Objective-C, and `simd::log2` in C++. */ | ||
| 678 | static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x); | ||
| 679 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 680 | * Objective-C, and `simd::log2` in C++. */ | ||
| 681 | static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x); | ||
| 682 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 683 | * Objective-C, and `simd::log2` in C++. */ | ||
| 684 | static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x); | ||
| 685 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 686 | * Objective-C, and `simd::log2` in C++. */ | ||
| 687 | static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x); | ||
| 688 | /*! @abstract Do not call this function; instead use `log2` in C and | ||
| 689 | * Objective-C, and `simd::log2` in C++. */ | ||
| 690 | static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x); | ||
| 691 | |||
| 692 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 693 | * Objective-C, and `simd::log10` in C++. */ | ||
| 694 | static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x); | ||
| 695 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 696 | * Objective-C, and `simd::log10` in C++. */ | ||
| 697 | static inline SIMD_CFUNC simd_float3 __tg_log10(simd_float3 x); | ||
| 698 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 699 | * Objective-C, and `simd::log10` in C++. */ | ||
| 700 | static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x); | ||
| 701 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 702 | * Objective-C, and `simd::log10` in C++. */ | ||
| 703 | static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x); | ||
| 704 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 705 | * Objective-C, and `simd::log10` in C++. */ | ||
| 706 | static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x); | ||
| 707 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 708 | * Objective-C, and `simd::log10` in C++. */ | ||
| 709 | static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x); | ||
| 710 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 711 | * Objective-C, and `simd::log10` in C++. */ | ||
| 712 | static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x); | ||
| 713 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 714 | * Objective-C, and `simd::log10` in C++. */ | ||
| 715 | static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x); | ||
| 716 | /*! @abstract Do not call this function; instead use `log10` in C and | ||
| 717 | * Objective-C, and `simd::log10` in C++. */ | ||
| 718 | static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x); | ||
| 719 | |||
| 720 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 721 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 722 | static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x); | ||
| 723 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 724 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 725 | static inline SIMD_CFUNC simd_float3 __tg_log1p(simd_float3 x); | ||
| 726 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 727 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 728 | static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x); | ||
| 729 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 730 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 731 | static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x); | ||
| 732 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 733 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 734 | static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x); | ||
| 735 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 736 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 737 | static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x); | ||
| 738 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 739 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 740 | static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x); | ||
| 741 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 742 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 743 | static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x); | ||
| 744 | /*! @abstract Do not call this function; instead use `log1p` in C and | ||
| 745 | * Objective-C, and `simd::log1p` in C++. */ | ||
| 746 | static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x); | ||
| 747 | |||
| 748 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 749 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 750 | static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x); | ||
| 751 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 752 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 753 | static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x); | ||
| 754 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 755 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 756 | static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x); | ||
| 757 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 758 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 759 | static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x); | ||
| 760 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 761 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 762 | static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x); | ||
| 763 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 764 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 765 | static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x); | ||
| 766 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 767 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 768 | static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x); | ||
| 769 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 770 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 771 | static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x); | ||
| 772 | /*! @abstract Do not call this function; instead use `fabs` in C and | ||
| 773 | * Objective-C, and `simd::fabs` in C++. */ | ||
| 774 | static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x); | ||
| 775 | |||
| 776 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 777 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 778 | static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x); | ||
| 779 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 780 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 781 | static inline SIMD_CFUNC simd_float3 __tg_cbrt(simd_float3 x); | ||
| 782 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 783 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 784 | static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x); | ||
| 785 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 786 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 787 | static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x); | ||
| 788 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 789 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 790 | static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x); | ||
| 791 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 792 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 793 | static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x); | ||
| 794 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 795 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 796 | static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x); | ||
| 797 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 798 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 799 | static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x); | ||
| 800 | /*! @abstract Do not call this function; instead use `cbrt` in C and | ||
| 801 | * Objective-C, and `simd::cbrt` in C++. */ | ||
| 802 | static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x); | ||
| 803 | |||
| 804 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 805 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 806 | static inline SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x); | ||
| 807 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 808 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 809 | static inline SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x); | ||
| 810 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 811 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 812 | static inline SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x); | ||
| 813 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 814 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 815 | static inline SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x); | ||
| 816 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 817 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 818 | static inline SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x); | ||
| 819 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 820 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 821 | static inline SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x); | ||
| 822 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 823 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 824 | static inline SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x); | ||
| 825 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 826 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 827 | static inline SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x); | ||
| 828 | /*! @abstract Do not call this function; instead use `sqrt` in C and | ||
| 829 | * Objective-C, and `simd::sqrt` in C++. */ | ||
| 830 | static inline SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x); | ||
| 831 | |||
| 832 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 833 | * Objective-C, and `simd::erf` in C++. */ | ||
| 834 | static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x); | ||
| 835 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 836 | * Objective-C, and `simd::erf` in C++. */ | ||
| 837 | static inline SIMD_CFUNC simd_float3 __tg_erf(simd_float3 x); | ||
| 838 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 839 | * Objective-C, and `simd::erf` in C++. */ | ||
| 840 | static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x); | ||
| 841 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 842 | * Objective-C, and `simd::erf` in C++. */ | ||
| 843 | static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x); | ||
| 844 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 845 | * Objective-C, and `simd::erf` in C++. */ | ||
| 846 | static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x); | ||
| 847 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 848 | * Objective-C, and `simd::erf` in C++. */ | ||
| 849 | static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x); | ||
| 850 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 851 | * Objective-C, and `simd::erf` in C++. */ | ||
| 852 | static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x); | ||
| 853 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 854 | * Objective-C, and `simd::erf` in C++. */ | ||
| 855 | static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x); | ||
| 856 | /*! @abstract Do not call this function; instead use `erf` in C and | ||
| 857 | * Objective-C, and `simd::erf` in C++. */ | ||
| 858 | static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x); | ||
| 859 | |||
| 860 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 861 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 862 | static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x); | ||
| 863 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 864 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 865 | static inline SIMD_CFUNC simd_float3 __tg_erfc(simd_float3 x); | ||
| 866 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 867 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 868 | static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x); | ||
| 869 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 870 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 871 | static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x); | ||
| 872 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 873 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 874 | static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x); | ||
| 875 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 876 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 877 | static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x); | ||
| 878 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 879 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 880 | static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x); | ||
| 881 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 882 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 883 | static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x); | ||
| 884 | /*! @abstract Do not call this function; instead use `erfc` in C and | ||
| 885 | * Objective-C, and `simd::erfc` in C++. */ | ||
| 886 | static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x); | ||
| 887 | |||
| 888 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 889 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 890 | static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x); | ||
| 891 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 892 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 893 | static inline SIMD_CFUNC simd_float3 __tg_tgamma(simd_float3 x); | ||
| 894 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 895 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 896 | static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x); | ||
| 897 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 898 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 899 | static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x); | ||
| 900 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 901 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 902 | static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x); | ||
| 903 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 904 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 905 | static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x); | ||
| 906 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 907 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 908 | static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x); | ||
| 909 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 910 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 911 | static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x); | ||
| 912 | /*! @abstract Do not call this function; instead use `tgamma` in C and | ||
| 913 | * Objective-C, and `simd::tgamma` in C++. */ | ||
| 914 | static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x); | ||
| 915 | |||
| 916 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 917 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 918 | static inline SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x); | ||
| 919 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 920 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 921 | static inline SIMD_CFUNC simd_float3 __tg_ceil(simd_float3 x); | ||
| 922 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 923 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 924 | static inline SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x); | ||
| 925 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 926 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 927 | static inline SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x); | ||
| 928 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 929 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 930 | static inline SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x); | ||
| 931 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 932 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 933 | static inline SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x); | ||
| 934 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 935 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 936 | static inline SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x); | ||
| 937 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 938 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 939 | static inline SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x); | ||
| 940 | /*! @abstract Do not call this function; instead use `ceil` in C and | ||
| 941 | * Objective-C, and `simd::ceil` in C++. */ | ||
| 942 | static inline SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x); | ||
| 943 | |||
| 944 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 945 | * Objective-C, and `simd::floor` in C++. */ | ||
| 946 | static inline SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x); | ||
| 947 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 948 | * Objective-C, and `simd::floor` in C++. */ | ||
| 949 | static inline SIMD_CFUNC simd_float3 __tg_floor(simd_float3 x); | ||
| 950 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 951 | * Objective-C, and `simd::floor` in C++. */ | ||
| 952 | static inline SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x); | ||
| 953 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 954 | * Objective-C, and `simd::floor` in C++. */ | ||
| 955 | static inline SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x); | ||
| 956 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 957 | * Objective-C, and `simd::floor` in C++. */ | ||
| 958 | static inline SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x); | ||
| 959 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 960 | * Objective-C, and `simd::floor` in C++. */ | ||
| 961 | static inline SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x); | ||
| 962 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 963 | * Objective-C, and `simd::floor` in C++. */ | ||
| 964 | static inline SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x); | ||
| 965 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 966 | * Objective-C, and `simd::floor` in C++. */ | ||
| 967 | static inline SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x); | ||
| 968 | /*! @abstract Do not call this function; instead use `floor` in C and | ||
| 969 | * Objective-C, and `simd::floor` in C++. */ | ||
| 970 | static inline SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x); | ||
| 971 | |||
| 972 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 973 | * Objective-C, and `simd::rint` in C++. */ | ||
| 974 | static inline SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x); | ||
| 975 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 976 | * Objective-C, and `simd::rint` in C++. */ | ||
| 977 | static inline SIMD_CFUNC simd_float3 __tg_rint(simd_float3 x); | ||
| 978 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 979 | * Objective-C, and `simd::rint` in C++. */ | ||
| 980 | static inline SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x); | ||
| 981 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 982 | * Objective-C, and `simd::rint` in C++. */ | ||
| 983 | static inline SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x); | ||
| 984 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 985 | * Objective-C, and `simd::rint` in C++. */ | ||
| 986 | static inline SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x); | ||
| 987 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 988 | * Objective-C, and `simd::rint` in C++. */ | ||
| 989 | static inline SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x); | ||
| 990 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 991 | * Objective-C, and `simd::rint` in C++. */ | ||
| 992 | static inline SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x); | ||
| 993 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 994 | * Objective-C, and `simd::rint` in C++. */ | ||
| 995 | static inline SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x); | ||
| 996 | /*! @abstract Do not call this function; instead use `rint` in C and | ||
| 997 | * Objective-C, and `simd::rint` in C++. */ | ||
| 998 | static inline SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x); | ||
| 999 | |||
| 1000 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1001 | * Objective-C, and `simd::round` in C++. */ | ||
| 1002 | static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x); | ||
| 1003 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1004 | * Objective-C, and `simd::round` in C++. */ | ||
| 1005 | static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x); | ||
| 1006 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1007 | * Objective-C, and `simd::round` in C++. */ | ||
| 1008 | static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x); | ||
| 1009 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1010 | * Objective-C, and `simd::round` in C++. */ | ||
| 1011 | static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x); | ||
| 1012 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1013 | * Objective-C, and `simd::round` in C++. */ | ||
| 1014 | static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x); | ||
| 1015 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1016 | * Objective-C, and `simd::round` in C++. */ | ||
| 1017 | static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x); | ||
| 1018 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1019 | * Objective-C, and `simd::round` in C++. */ | ||
| 1020 | static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x); | ||
| 1021 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1022 | * Objective-C, and `simd::round` in C++. */ | ||
| 1023 | static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x); | ||
| 1024 | /*! @abstract Do not call this function; instead use `round` in C and | ||
| 1025 | * Objective-C, and `simd::round` in C++. */ | ||
| 1026 | static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x); | ||
| 1027 | |||
| 1028 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1029 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1030 | static inline SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x); | ||
| 1031 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1032 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1033 | static inline SIMD_CFUNC simd_float3 __tg_trunc(simd_float3 x); | ||
| 1034 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1035 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1036 | static inline SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x); | ||
| 1037 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1038 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1039 | static inline SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x); | ||
| 1040 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1041 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1042 | static inline SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x); | ||
| 1043 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1044 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1045 | static inline SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x); | ||
| 1046 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1047 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1048 | static inline SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x); | ||
| 1049 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1050 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1051 | static inline SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x); | ||
| 1052 | /*! @abstract Do not call this function; instead use `trunc` in C and | ||
| 1053 | * Objective-C, and `simd::trunc` in C++. */ | ||
| 1054 | static inline SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x); | ||
| 1055 | |||
| 1056 | |||
| 1057 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1058 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1059 | static inline SIMD_CFUNC simd_float2 __tg_atan2(simd_float2 y, simd_float2 x); | ||
| 1060 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1061 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1062 | static inline SIMD_CFUNC simd_float3 __tg_atan2(simd_float3 y, simd_float3 x); | ||
| 1063 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1064 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1065 | static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x); | ||
| 1066 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1067 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1068 | static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x); | ||
| 1069 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1070 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1071 | static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x); | ||
| 1072 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1073 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1074 | static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x); | ||
| 1075 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1076 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1077 | static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x); | ||
| 1078 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1079 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1080 | static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x); | ||
| 1081 | /*! @abstract Do not call this function; instead use `atan2` in C and | ||
| 1082 | * Objective-C, and `simd::atan2` in C++. */ | ||
| 1083 | static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x); | ||
| 1084 | |||
| 1085 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1086 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1087 | static inline SIMD_CFUNC simd_float2 __tg_hypot(simd_float2 x, simd_float2 y); | ||
| 1088 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1089 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1090 | static inline SIMD_CFUNC simd_float3 __tg_hypot(simd_float3 x, simd_float3 y); | ||
| 1091 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1092 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1093 | static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y); | ||
| 1094 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1095 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1096 | static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y); | ||
| 1097 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1098 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1099 | static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y); | ||
| 1100 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1101 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1102 | static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y); | ||
| 1103 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1104 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1105 | static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y); | ||
| 1106 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1107 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1108 | static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y); | ||
| 1109 | /*! @abstract Do not call this function; instead use `hypot` in C and | ||
| 1110 | * Objective-C, and `simd::hypot` in C++. */ | ||
| 1111 | static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y); | ||
| 1112 | |||
| 1113 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1114 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1115 | static inline SIMD_CFUNC simd_float2 __tg_pow(simd_float2 x, simd_float2 y); | ||
| 1116 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1117 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1118 | static inline SIMD_CFUNC simd_float3 __tg_pow(simd_float3 x, simd_float3 y); | ||
| 1119 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1120 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1121 | static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y); | ||
| 1122 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1123 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1124 | static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y); | ||
| 1125 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1126 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1127 | static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y); | ||
| 1128 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1129 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1130 | static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y); | ||
| 1131 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1132 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1133 | static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y); | ||
| 1134 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1135 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1136 | static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y); | ||
| 1137 | /*! @abstract Do not call this function; instead use `pow` in C and | ||
| 1138 | * Objective-C, and `simd::pow` in C++. */ | ||
| 1139 | static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y); | ||
| 1140 | |||
| 1141 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1142 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1143 | static inline SIMD_CFUNC simd_float2 __tg_fmod(simd_float2 x, simd_float2 y); | ||
| 1144 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1145 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1146 | static inline SIMD_CFUNC simd_float3 __tg_fmod(simd_float3 x, simd_float3 y); | ||
| 1147 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1148 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1149 | static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y); | ||
| 1150 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1151 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1152 | static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y); | ||
| 1153 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1154 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1155 | static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y); | ||
| 1156 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1157 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1158 | static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y); | ||
| 1159 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1160 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1161 | static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y); | ||
| 1162 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1163 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1164 | static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y); | ||
| 1165 | /*! @abstract Do not call this function; instead use `fmod` in C and | ||
| 1166 | * Objective-C, and `simd::fmod` in C++. */ | ||
| 1167 | static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y); | ||
| 1168 | |||
| 1169 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1170 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1171 | static inline SIMD_CFUNC simd_float2 __tg_remainder(simd_float2 x, simd_float2 y); | ||
| 1172 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1173 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1174 | static inline SIMD_CFUNC simd_float3 __tg_remainder(simd_float3 x, simd_float3 y); | ||
| 1175 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1176 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1177 | static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y); | ||
| 1178 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1179 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1180 | static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y); | ||
| 1181 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1182 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1183 | static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y); | ||
| 1184 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1185 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1186 | static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y); | ||
| 1187 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1188 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1189 | static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double3 y); | ||
| 1190 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1191 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1192 | static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y); | ||
| 1193 | /*! @abstract Do not call this function; instead use `remainder` in C and | ||
| 1194 | * Objective-C, and `simd::remainder` in C++. */ | ||
| 1195 | static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y); | ||
| 1196 | |||
| 1197 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1198 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1199 | static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y); | ||
| 1200 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1201 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1202 | static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y); | ||
| 1203 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1204 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1205 | static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y); | ||
| 1206 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1207 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1208 | static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y); | ||
| 1209 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1210 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1211 | static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y); | ||
| 1212 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1213 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1214 | static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y); | ||
| 1215 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1216 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1217 | static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y); | ||
| 1218 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1219 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1220 | static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y); | ||
| 1221 | /*! @abstract Do not call this function; instead use `copysign` in C and | ||
| 1222 | * Objective-C, and `simd::copysign` in C++. */ | ||
| 1223 | static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y); | ||
| 1224 | |||
| 1225 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1226 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1227 | static inline SIMD_CFUNC simd_float2 __tg_nextafter(simd_float2 x, simd_float2 y); | ||
| 1228 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1229 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1230 | static inline SIMD_CFUNC simd_float3 __tg_nextafter(simd_float3 x, simd_float3 y); | ||
| 1231 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1232 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1233 | static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y); | ||
| 1234 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1235 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1236 | static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y); | ||
| 1237 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1238 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1239 | static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y); | ||
| 1240 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1241 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1242 | static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y); | ||
| 1243 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1244 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1245 | static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double3 y); | ||
| 1246 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1247 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1248 | static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y); | ||
| 1249 | /*! @abstract Do not call this function; instead use `nextafter` in C and | ||
| 1250 | * Objective-C, and `simd::nextafter` in C++. */ | ||
| 1251 | static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y); | ||
| 1252 | |||
| 1253 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1254 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1255 | static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y); | ||
| 1256 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1257 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1258 | static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y); | ||
| 1259 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1260 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1261 | static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y); | ||
| 1262 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1263 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1264 | static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y); | ||
| 1265 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1266 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1267 | static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y); | ||
| 1268 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1269 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1270 | static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y); | ||
| 1271 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1272 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1273 | static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y); | ||
| 1274 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1275 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1276 | static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y); | ||
| 1277 | /*! @abstract Do not call this function; instead use `fdim` in C and | ||
| 1278 | * Objective-C, and `simd::fdim` in C++. */ | ||
| 1279 | static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y); | ||
| 1280 | |||
| 1281 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1282 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1283 | static inline SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y); | ||
| 1284 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1285 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1286 | static inline SIMD_CFUNC simd_float3 __tg_fmax(simd_float3 x, simd_float3 y); | ||
| 1287 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1288 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1289 | static inline SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y); | ||
| 1290 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1291 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1292 | static inline SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y); | ||
| 1293 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1294 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1295 | static inline SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y); | ||
| 1296 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1297 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1298 | static inline SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y); | ||
| 1299 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1300 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1301 | static inline SIMD_CFUNC simd_double3 __tg_fmax(simd_double3 x, simd_double3 y); | ||
| 1302 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1303 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1304 | static inline SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y); | ||
| 1305 | /*! @abstract Do not call this function; instead use `fmax` in C and | ||
| 1306 | * Objective-C, and `simd::fmax` in C++. */ | ||
| 1307 | static inline SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y); | ||
| 1308 | |||
| 1309 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1310 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1311 | static inline SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y); | ||
| 1312 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1313 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1314 | static inline SIMD_CFUNC simd_float3 __tg_fmin(simd_float3 x, simd_float3 y); | ||
| 1315 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1316 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1317 | static inline SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y); | ||
| 1318 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1319 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1320 | static inline SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y); | ||
| 1321 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1322 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1323 | static inline SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y); | ||
| 1324 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1325 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1326 | static inline SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y); | ||
| 1327 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1328 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1329 | static inline SIMD_CFUNC simd_double3 __tg_fmin(simd_double3 x, simd_double3 y); | ||
| 1330 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1331 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1332 | static inline SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y); | ||
| 1333 | /*! @abstract Do not call this function; instead use `fmin` in C and | ||
| 1334 | * Objective-C, and `simd::fmin` in C++. */ | ||
| 1335 | static inline SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y); | ||
| 1336 | |||
| 1337 | |||
| 1338 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1339 | * and `simd::fma` in C++. */ | ||
| 1340 | static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z); | ||
| 1341 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1342 | * and `simd::fma` in C++. */ | ||
| 1343 | static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd_float3 z); | ||
| 1344 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1345 | * and `simd::fma` in C++. */ | ||
| 1346 | static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z); | ||
| 1347 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1348 | * and `simd::fma` in C++. */ | ||
| 1349 | static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd_float8 z); | ||
| 1350 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1351 | * and `simd::fma` in C++. */ | ||
| 1352 | static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z); | ||
| 1353 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1354 | * and `simd::fma` in C++. */ | ||
| 1355 | static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z); | ||
| 1356 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1357 | * and `simd::fma` in C++. */ | ||
| 1358 | static inline SIMD_CFUNC simd_double3 __tg_fma(simd_double3 x, simd_double3 y, simd_double3 z); | ||
| 1359 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1360 | * and `simd::fma` in C++. */ | ||
| 1361 | static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, simd_double4 z); | ||
| 1362 | /*! @abstract Do not call this function; instead use `fma` in C and Objective-C, | ||
| 1363 | * and `simd::fma` in C++. */ | ||
| 1364 | static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z); | ||
| 1365 | |||
| 1366 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1367 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1368 | static inline SIMD_CFUNC float simd_muladd(float x, float y, float z); | ||
| 1369 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1370 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1371 | static inline SIMD_CFUNC simd_float2 simd_muladd(simd_float2 x, simd_float2 y, simd_float2 z); | ||
| 1372 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1373 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1374 | static inline SIMD_CFUNC simd_float3 simd_muladd(simd_float3 x, simd_float3 y, simd_float3 z); | ||
| 1375 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1376 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1377 | static inline SIMD_CFUNC simd_float4 simd_muladd(simd_float4 x, simd_float4 y, simd_float4 z); | ||
| 1378 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1379 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1380 | static inline SIMD_CFUNC simd_float8 simd_muladd(simd_float8 x, simd_float8 y, simd_float8 z); | ||
| 1381 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1382 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1383 | static inline SIMD_CFUNC simd_float16 simd_muladd(simd_float16 x, simd_float16 y, simd_float16 z); | ||
| 1384 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1385 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1386 | static inline SIMD_CFUNC double simd_muladd(double x, double y, double z); | ||
| 1387 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1388 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1389 | static inline SIMD_CFUNC simd_double2 simd_muladd(simd_double2 x, simd_double2 y, simd_double2 z); | ||
| 1390 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1391 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1392 | static inline SIMD_CFUNC simd_double3 simd_muladd(simd_double3 x, simd_double3 y, simd_double3 z); | ||
| 1393 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1394 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1395 | static inline SIMD_CFUNC simd_double4 simd_muladd(simd_double4 x, simd_double4 y, simd_double4 z); | ||
| 1396 | /*! @abstract Computes accum + x*y by the most efficient means available; | ||
| 1397 | * either a fused multiply add or separate multiply and add instructions. */ | ||
| 1398 | static inline SIMD_CFUNC simd_double8 simd_muladd(simd_double8 x, simd_double8 y, simd_double8 z); | ||
| 1399 | |||
| 1400 | #ifdef __cplusplus | ||
| 1401 | } /* extern "C" */ | ||
| 1402 | |||
| 1403 | #include <cmath> | ||
| 1404 | /*! @abstract Do not call this function directly; use simd::acos instead. */ | ||
| 1405 | static SIMD_CPPFUNC float __tg_acos(float x) { return ::acos(x); } | ||
| 1406 | /*! @abstract Do not call this function directly; use simd::acos instead. */ | ||
| 1407 | static SIMD_CPPFUNC double __tg_acos(double x) { return ::acos(x); } | ||
| 1408 | /*! @abstract Do not call this function directly; use simd::asin instead. */ | ||
| 1409 | static SIMD_CPPFUNC float __tg_asin(float x) { return ::asin(x); } | ||
| 1410 | /*! @abstract Do not call this function directly; use simd::asin instead. */ | ||
| 1411 | static SIMD_CPPFUNC double __tg_asin(double x) { return ::asin(x); } | ||
| 1412 | /*! @abstract Do not call this function directly; use simd::atan instead. */ | ||
| 1413 | static SIMD_CPPFUNC float __tg_atan(float x) { return ::atan(x); } | ||
| 1414 | /*! @abstract Do not call this function directly; use simd::atan instead. */ | ||
| 1415 | static SIMD_CPPFUNC double __tg_atan(double x) { return ::atan(x); } | ||
| 1416 | /*! @abstract Do not call this function directly; use simd::cos instead. */ | ||
| 1417 | static SIMD_CPPFUNC float __tg_cos(float x) { return ::cos(x); } | ||
| 1418 | /*! @abstract Do not call this function directly; use simd::cos instead. */ | ||
| 1419 | static SIMD_CPPFUNC double __tg_cos(double x) { return ::cos(x); } | ||
| 1420 | /*! @abstract Do not call this function directly; use simd::sin instead. */ | ||
| 1421 | static SIMD_CPPFUNC float __tg_sin(float x) { return ::sin(x); } | ||
| 1422 | /*! @abstract Do not call this function directly; use simd::sin instead. */ | ||
| 1423 | static SIMD_CPPFUNC double __tg_sin(double x) { return ::sin(x); } | ||
| 1424 | /*! @abstract Do not call this function directly; use simd::tan instead. */ | ||
| 1425 | static SIMD_CPPFUNC float __tg_tan(float x) { return ::tan(x); } | ||
| 1426 | /*! @abstract Do not call this function directly; use simd::tan instead. */ | ||
| 1427 | static SIMD_CPPFUNC double __tg_tan(double x) { return ::tan(x); } | ||
| 1428 | /*! @abstract Do not call this function directly; use simd::cospi instead. */ | ||
| 1429 | static SIMD_CPPFUNC float __tg_cospi(float x) { return ::__cospi(x); } | ||
| 1430 | /*! @abstract Do not call this function directly; use simd::cospi instead. */ | ||
| 1431 | static SIMD_CPPFUNC double __tg_cospi(double x) { return ::__cospi(x); } | ||
| 1432 | /*! @abstract Do not call this function directly; use simd::sinpi instead. */ | ||
| 1433 | static SIMD_CPPFUNC float __tg_sinpi(float x) { return ::__sinpi(x); } | ||
| 1434 | /*! @abstract Do not call this function directly; use simd::sinpi instead. */ | ||
| 1435 | static SIMD_CPPFUNC double __tg_sinpi(double x) { return ::__sinpi(x); } | ||
| 1436 | /*! @abstract Do not call this function directly; use simd::tanpi instead. */ | ||
| 1437 | static SIMD_CPPFUNC float __tg_tanpi(float x) { return ::__tanpi(x); } | ||
| 1438 | /*! @abstract Do not call this function directly; use simd::tanpi instead. */ | ||
| 1439 | static SIMD_CPPFUNC double __tg_tanpi(double x) { return ::__tanpi(x); } | ||
| 1440 | /*! @abstract Do not call this function directly; use simd::acosh instead. */ | ||
| 1441 | static SIMD_CPPFUNC float __tg_acosh(float x) { return ::acosh(x); } | ||
| 1442 | /*! @abstract Do not call this function directly; use simd::acosh instead. */ | ||
| 1443 | static SIMD_CPPFUNC double __tg_acosh(double x) { return ::acosh(x); } | ||
| 1444 | /*! @abstract Do not call this function directly; use simd::asinh instead. */ | ||
| 1445 | static SIMD_CPPFUNC float __tg_asinh(float x) { return ::asinh(x); } | ||
| 1446 | /*! @abstract Do not call this function directly; use simd::asinh instead. */ | ||
| 1447 | static SIMD_CPPFUNC double __tg_asinh(double x) { return ::asinh(x); } | ||
| 1448 | /*! @abstract Do not call this function directly; use simd::atanh instead. */ | ||
| 1449 | static SIMD_CPPFUNC float __tg_atanh(float x) { return ::atanh(x); } | ||
| 1450 | /*! @abstract Do not call this function directly; use simd::atanh instead. */ | ||
| 1451 | static SIMD_CPPFUNC double __tg_atanh(double x) { return ::atanh(x); } | ||
| 1452 | /*! @abstract Do not call this function directly; use simd::cosh instead. */ | ||
| 1453 | static SIMD_CPPFUNC float __tg_cosh(float x) { return ::cosh(x); } | ||
| 1454 | /*! @abstract Do not call this function directly; use simd::cosh instead. */ | ||
| 1455 | static SIMD_CPPFUNC double __tg_cosh(double x) { return ::cosh(x); } | ||
| 1456 | /*! @abstract Do not call this function directly; use simd::sinh instead. */ | ||
| 1457 | static SIMD_CPPFUNC float __tg_sinh(float x) { return ::sinh(x); } | ||
| 1458 | /*! @abstract Do not call this function directly; use simd::sinh instead. */ | ||
| 1459 | static SIMD_CPPFUNC double __tg_sinh(double x) { return ::sinh(x); } | ||
| 1460 | /*! @abstract Do not call this function directly; use simd::tanh instead. */ | ||
| 1461 | static SIMD_CPPFUNC float __tg_tanh(float x) { return ::tanh(x); } | ||
| 1462 | /*! @abstract Do not call this function directly; use simd::tanh instead. */ | ||
| 1463 | static SIMD_CPPFUNC double __tg_tanh(double x) { return ::tanh(x); } | ||
| 1464 | /*! @abstract Do not call this function directly; use simd::exp instead. */ | ||
| 1465 | static SIMD_CPPFUNC float __tg_exp(float x) { return ::exp(x); } | ||
| 1466 | /*! @abstract Do not call this function directly; use simd::exp instead. */ | ||
| 1467 | static SIMD_CPPFUNC double __tg_exp(double x) { return ::exp(x); } | ||
| 1468 | /*! @abstract Do not call this function directly; use simd::exp2 instead. */ | ||
| 1469 | static SIMD_CPPFUNC float __tg_exp2(float x) { return ::exp2(x); } | ||
| 1470 | /*! @abstract Do not call this function directly; use simd::exp2 instead. */ | ||
| 1471 | static SIMD_CPPFUNC double __tg_exp2(double x) { return ::exp2(x); } | ||
| 1472 | /*! @abstract Do not call this function directly; use simd::exp10 instead. */ | ||
| 1473 | static SIMD_CPPFUNC float __tg_exp10(float x) { return ::__exp10(x); } | ||
| 1474 | /*! @abstract Do not call this function directly; use simd::exp10 instead. */ | ||
| 1475 | static SIMD_CPPFUNC double __tg_exp10(double x) { return ::__exp10(x); } | ||
| 1476 | /*! @abstract Do not call this function directly; use simd::expm1 instead. */ | ||
| 1477 | static SIMD_CPPFUNC float __tg_expm1(float x) { return ::expm1(x); } | ||
| 1478 | /*! @abstract Do not call this function directly; use simd::expm1 instead. */ | ||
| 1479 | static SIMD_CPPFUNC double __tg_expm1(double x) { return ::expm1(x); } | ||
| 1480 | /*! @abstract Do not call this function directly; use simd::log instead. */ | ||
| 1481 | static SIMD_CPPFUNC float __tg_log(float x) { return ::log(x); } | ||
| 1482 | /*! @abstract Do not call this function directly; use simd::log instead. */ | ||
| 1483 | static SIMD_CPPFUNC double __tg_log(double x) { return ::log(x); } | ||
| 1484 | /*! @abstract Do not call this function directly; use simd::log2 instead. */ | ||
| 1485 | static SIMD_CPPFUNC float __tg_log2(float x) { return ::log2(x); } | ||
| 1486 | /*! @abstract Do not call this function directly; use simd::log2 instead. */ | ||
| 1487 | static SIMD_CPPFUNC double __tg_log2(double x) { return ::log2(x); } | ||
| 1488 | /*! @abstract Do not call this function directly; use simd::log10 instead. */ | ||
| 1489 | static SIMD_CPPFUNC float __tg_log10(float x) { return ::log10(x); } | ||
| 1490 | /*! @abstract Do not call this function directly; use simd::log10 instead. */ | ||
| 1491 | static SIMD_CPPFUNC double __tg_log10(double x) { return ::log10(x); } | ||
| 1492 | /*! @abstract Do not call this function directly; use simd::log1p instead. */ | ||
| 1493 | static SIMD_CPPFUNC float __tg_log1p(float x) { return ::log1p(x); } | ||
| 1494 | /*! @abstract Do not call this function directly; use simd::log1p instead. */ | ||
| 1495 | static SIMD_CPPFUNC double __tg_log1p(double x) { return ::log1p(x); } | ||
| 1496 | /*! @abstract Do not call this function directly; use simd::fabs instead. */ | ||
| 1497 | static SIMD_CPPFUNC float __tg_fabs(float x) { return ::fabs(x); } | ||
| 1498 | /*! @abstract Do not call this function directly; use simd::fabs instead. */ | ||
| 1499 | static SIMD_CPPFUNC double __tg_fabs(double x) { return ::fabs(x); } | ||
| 1500 | /*! @abstract Do not call this function directly; use simd::cbrt instead. */ | ||
| 1501 | static SIMD_CPPFUNC float __tg_cbrt(float x) { return ::cbrt(x); } | ||
| 1502 | /*! @abstract Do not call this function directly; use simd::cbrt instead. */ | ||
| 1503 | static SIMD_CPPFUNC double __tg_cbrt(double x) { return ::cbrt(x); } | ||
| 1504 | /*! @abstract Do not call this function directly; use simd::sqrt instead. */ | ||
| 1505 | static SIMD_CPPFUNC float __tg_sqrt(float x) { return ::sqrt(x); } | ||
| 1506 | /*! @abstract Do not call this function directly; use simd::sqrt instead. */ | ||
| 1507 | static SIMD_CPPFUNC double __tg_sqrt(double x) { return ::sqrt(x); } | ||
| 1508 | /*! @abstract Do not call this function directly; use simd::erf instead. */ | ||
| 1509 | static SIMD_CPPFUNC float __tg_erf(float x) { return ::erf(x); } | ||
| 1510 | /*! @abstract Do not call this function directly; use simd::erf instead. */ | ||
| 1511 | static SIMD_CPPFUNC double __tg_erf(double x) { return ::erf(x); } | ||
| 1512 | /*! @abstract Do not call this function directly; use simd::erfc instead. */ | ||
| 1513 | static SIMD_CPPFUNC float __tg_erfc(float x) { return ::erfc(x); } | ||
| 1514 | /*! @abstract Do not call this function directly; use simd::erfc instead. */ | ||
| 1515 | static SIMD_CPPFUNC double __tg_erfc(double x) { return ::erfc(x); } | ||
| 1516 | /*! @abstract Do not call this function directly; use simd::tgamma instead. */ | ||
| 1517 | static SIMD_CPPFUNC float __tg_tgamma(float x) { return ::tgamma(x); } | ||
| 1518 | /*! @abstract Do not call this function directly; use simd::tgamma instead. */ | ||
| 1519 | static SIMD_CPPFUNC double __tg_tgamma(double x) { return ::tgamma(x); } | ||
| 1520 | /*! @abstract Do not call this function directly; use simd::ceil instead. */ | ||
| 1521 | static SIMD_CPPFUNC float __tg_ceil(float x) { return ::ceil(x); } | ||
| 1522 | /*! @abstract Do not call this function directly; use simd::ceil instead. */ | ||
| 1523 | static SIMD_CPPFUNC double __tg_ceil(double x) { return ::ceil(x); } | ||
| 1524 | /*! @abstract Do not call this function directly; use simd::floor instead. */ | ||
| 1525 | static SIMD_CPPFUNC float __tg_floor(float x) { return ::floor(x); } | ||
| 1526 | /*! @abstract Do not call this function directly; use simd::floor instead. */ | ||
| 1527 | static SIMD_CPPFUNC double __tg_floor(double x) { return ::floor(x); } | ||
| 1528 | /*! @abstract Do not call this function directly; use simd::rint instead. */ | ||
| 1529 | static SIMD_CPPFUNC float __tg_rint(float x) { return ::rint(x); } | ||
| 1530 | /*! @abstract Do not call this function directly; use simd::rint instead. */ | ||
| 1531 | static SIMD_CPPFUNC double __tg_rint(double x) { return ::rint(x); } | ||
| 1532 | /*! @abstract Do not call this function directly; use simd::round instead. */ | ||
| 1533 | static SIMD_CPPFUNC float __tg_round(float x) { return ::round(x); } | ||
| 1534 | /*! @abstract Do not call this function directly; use simd::round instead. */ | ||
| 1535 | static SIMD_CPPFUNC double __tg_round(double x) { return ::round(x); } | ||
| 1536 | /*! @abstract Do not call this function directly; use simd::trunc instead. */ | ||
| 1537 | static SIMD_CPPFUNC float __tg_trunc(float x) { return ::trunc(x); } | ||
| 1538 | /*! @abstract Do not call this function directly; use simd::trunc instead. */ | ||
| 1539 | static SIMD_CPPFUNC double __tg_trunc(double x) { return ::trunc(x); } | ||
| 1540 | /*! @abstract Do not call this function directly; use simd::atan2 instead. */ | ||
| 1541 | static SIMD_CPPFUNC float __tg_atan2(float x, float y) { return ::atan2(x, y); } | ||
| 1542 | /*! @abstract Do not call this function directly; use simd::atan2 instead. */ | ||
| 1543 | static SIMD_CPPFUNC double __tg_atan2(double x, float y) { return ::atan2(x, y); } | ||
| 1544 | /*! @abstract Do not call this function directly; use simd::hypot instead. */ | ||
| 1545 | static SIMD_CPPFUNC float __tg_hypot(float x, float y) { return ::hypot(x, y); } | ||
| 1546 | /*! @abstract Do not call this function directly; use simd::hypot instead. */ | ||
| 1547 | static SIMD_CPPFUNC double __tg_hypot(double x, float y) { return ::hypot(x, y); } | ||
| 1548 | /*! @abstract Do not call this function directly; use simd::pow instead. */ | ||
| 1549 | static SIMD_CPPFUNC float __tg_pow(float x, float y) { return ::pow(x, y); } | ||
| 1550 | /*! @abstract Do not call this function directly; use simd::pow instead. */ | ||
| 1551 | static SIMD_CPPFUNC double __tg_pow(double x, float y) { return ::pow(x, y); } | ||
| 1552 | /*! @abstract Do not call this function directly; use simd::fmod instead. */ | ||
| 1553 | static SIMD_CPPFUNC float __tg_fmod(float x, float y) { return ::fmod(x, y); } | ||
| 1554 | /*! @abstract Do not call this function directly; use simd::fmod instead. */ | ||
| 1555 | static SIMD_CPPFUNC double __tg_fmod(double x, float y) { return ::fmod(x, y); } | ||
| 1556 | /*! @abstract Do not call this function directly; use simd::remainder | ||
| 1557 | * instead. */ | ||
| 1558 | static SIMD_CPPFUNC float __tg_remainder(float x, float y) { return ::remainder(x, y); } | ||
| 1559 | /*! @abstract Do not call this function directly; use simd::remainder | ||
| 1560 | * instead. */ | ||
| 1561 | static SIMD_CPPFUNC double __tg_remainder(double x, float y) { return ::remainder(x, y); } | ||
| 1562 | /*! @abstract Do not call this function directly; use simd::copysign | ||
| 1563 | * instead. */ | ||
| 1564 | static SIMD_CPPFUNC float __tg_copysign(float x, float y) { return ::copysign(x, y); } | ||
| 1565 | /*! @abstract Do not call this function directly; use simd::copysign | ||
| 1566 | * instead. */ | ||
| 1567 | static SIMD_CPPFUNC double __tg_copysign(double x, float y) { return ::copysign(x, y); } | ||
| 1568 | /*! @abstract Do not call this function directly; use simd::nextafter | ||
| 1569 | * instead. */ | ||
| 1570 | static SIMD_CPPFUNC float __tg_nextafter(float x, float y) { return ::nextafter(x, y); } | ||
| 1571 | /*! @abstract Do not call this function directly; use simd::nextafter | ||
| 1572 | * instead. */ | ||
| 1573 | static SIMD_CPPFUNC double __tg_nextafter(double x, float y) { return ::nextafter(x, y); } | ||
| 1574 | /*! @abstract Do not call this function directly; use simd::fdim instead. */ | ||
| 1575 | static SIMD_CPPFUNC float __tg_fdim(float x, float y) { return ::fdim(x, y); } | ||
| 1576 | /*! @abstract Do not call this function directly; use simd::fdim instead. */ | ||
| 1577 | static SIMD_CPPFUNC double __tg_fdim(double x, float y) { return ::fdim(x, y); } | ||
| 1578 | /*! @abstract Do not call this function directly; use simd::fmax instead. */ | ||
| 1579 | static SIMD_CPPFUNC float __tg_fmax(float x, float y) { return ::fmax(x, y); } | ||
| 1580 | /*! @abstract Do not call this function directly; use simd::fmax instead. */ | ||
| 1581 | static SIMD_CPPFUNC double __tg_fmax(double x, float y) { return ::fmax(x, y); } | ||
| 1582 | /*! @abstract Do not call this function directly; use simd::fmin instead. */ | ||
| 1583 | static SIMD_CPPFUNC float __tg_fmin(float x, float y) { return ::fmin(x, y); } | ||
| 1584 | /*! @abstract Do not call this function directly; use simd::fmin instead. */ | ||
| 1585 | static SIMD_CPPFUNC double __tg_fmin(double x, float y) { return ::fmin(x, y); } | ||
| 1586 | /*! @abstract Do not call this function directly; use simd::fma instead. */ | ||
| 1587 | static SIMD_CPPFUNC float __tg_fma(float x, float y, float z) { return ::fma(x, y, z); } | ||
| 1588 | /*! @abstract Do not call this function directly; use simd::fma instead. */ | ||
| 1589 | static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); } | ||
| 1590 | |||
| 1591 | namespace simd { | ||
| 1592 | /*! @abstract Generalizes the <cmath> function acos to operate on vectors of | ||
| 1593 | * floats and doubles. */ | ||
| 1594 | template <typename fptypeN> | ||
| 1595 | static SIMD_CPPFUNC fptypeN acos(fptypeN x) { return ::__tg_acos(x); } | ||
| 1596 | |||
| 1597 | /*! @abstract Generalizes the <cmath> function asin to operate on vectors of | ||
| 1598 | * floats and doubles. */ | ||
| 1599 | template <typename fptypeN> | ||
| 1600 | static SIMD_CPPFUNC fptypeN asin(fptypeN x) { return ::__tg_asin(x); } | ||
| 1601 | |||
| 1602 | /*! @abstract Generalizes the <cmath> function atan to operate on vectors of | ||
| 1603 | * floats and doubles. */ | ||
| 1604 | template <typename fptypeN> | ||
| 1605 | static SIMD_CPPFUNC fptypeN atan(fptypeN x) { return ::__tg_atan(x); } | ||
| 1606 | |||
| 1607 | /*! @abstract Generalizes the <cmath> function cos to operate on vectors of | ||
| 1608 | * floats and doubles. */ | ||
| 1609 | template <typename fptypeN> | ||
| 1610 | static SIMD_CPPFUNC fptypeN cos(fptypeN x) { return ::__tg_cos(x); } | ||
| 1611 | |||
| 1612 | /*! @abstract Generalizes the <cmath> function sin to operate on vectors of | ||
| 1613 | * floats and doubles. */ | ||
| 1614 | template <typename fptypeN> | ||
| 1615 | static SIMD_CPPFUNC fptypeN sin(fptypeN x) { return ::__tg_sin(x); } | ||
| 1616 | |||
| 1617 | /*! @abstract Generalizes the <cmath> function tan to operate on vectors of | ||
| 1618 | * floats and doubles. */ | ||
| 1619 | template <typename fptypeN> | ||
| 1620 | static SIMD_CPPFUNC fptypeN tan(fptypeN x) { return ::__tg_tan(x); } | ||
| 1621 | |||
| 1622 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 1623 | /*! @abstract Generalizes the <cmath> function cospi to operate on vectors | ||
| 1624 | * of floats and doubles. */ | ||
| 1625 | template <typename fptypeN> | ||
| 1626 | static SIMD_CPPFUNC fptypeN cospi(fptypeN x) { return ::__tg_cospi(x); } | ||
| 1627 | #endif | ||
| 1628 | |||
| 1629 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 1630 | /*! @abstract Generalizes the <cmath> function sinpi to operate on vectors | ||
| 1631 | * of floats and doubles. */ | ||
| 1632 | template <typename fptypeN> | ||
| 1633 | static SIMD_CPPFUNC fptypeN sinpi(fptypeN x) { return ::__tg_sinpi(x); } | ||
| 1634 | #endif | ||
| 1635 | |||
| 1636 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 1637 | /*! @abstract Generalizes the <cmath> function tanpi to operate on vectors | ||
| 1638 | * of floats and doubles. */ | ||
| 1639 | template <typename fptypeN> | ||
| 1640 | static SIMD_CPPFUNC fptypeN tanpi(fptypeN x) { return ::__tg_tanpi(x); } | ||
| 1641 | #endif | ||
| 1642 | |||
| 1643 | /*! @abstract Generalizes the <cmath> function acosh to operate on vectors | ||
| 1644 | * of floats and doubles. */ | ||
| 1645 | template <typename fptypeN> | ||
| 1646 | static SIMD_CPPFUNC fptypeN acosh(fptypeN x) { return ::__tg_acosh(x); } | ||
| 1647 | |||
| 1648 | /*! @abstract Generalizes the <cmath> function asinh to operate on vectors | ||
| 1649 | * of floats and doubles. */ | ||
| 1650 | template <typename fptypeN> | ||
| 1651 | static SIMD_CPPFUNC fptypeN asinh(fptypeN x) { return ::__tg_asinh(x); } | ||
| 1652 | |||
| 1653 | /*! @abstract Generalizes the <cmath> function atanh to operate on vectors | ||
| 1654 | * of floats and doubles. */ | ||
| 1655 | template <typename fptypeN> | ||
| 1656 | static SIMD_CPPFUNC fptypeN atanh(fptypeN x) { return ::__tg_atanh(x); } | ||
| 1657 | |||
| 1658 | /*! @abstract Generalizes the <cmath> function cosh to operate on vectors of | ||
| 1659 | * floats and doubles. */ | ||
| 1660 | template <typename fptypeN> | ||
| 1661 | static SIMD_CPPFUNC fptypeN cosh(fptypeN x) { return ::__tg_cosh(x); } | ||
| 1662 | |||
| 1663 | /*! @abstract Generalizes the <cmath> function sinh to operate on vectors of | ||
| 1664 | * floats and doubles. */ | ||
| 1665 | template <typename fptypeN> | ||
| 1666 | static SIMD_CPPFUNC fptypeN sinh(fptypeN x) { return ::__tg_sinh(x); } | ||
| 1667 | |||
| 1668 | /*! @abstract Generalizes the <cmath> function tanh to operate on vectors of | ||
| 1669 | * floats and doubles. */ | ||
| 1670 | template <typename fptypeN> | ||
| 1671 | static SIMD_CPPFUNC fptypeN tanh(fptypeN x) { return ::__tg_tanh(x); } | ||
| 1672 | |||
| 1673 | /*! @abstract Generalizes the <cmath> function exp to operate on vectors of | ||
| 1674 | * floats and doubles. */ | ||
| 1675 | template <typename fptypeN> | ||
| 1676 | static SIMD_CPPFUNC fptypeN exp(fptypeN x) { return ::__tg_exp(x); } | ||
| 1677 | |||
| 1678 | /*! @abstract Generalizes the <cmath> function exp2 to operate on vectors of | ||
| 1679 | * floats and doubles. */ | ||
| 1680 | template <typename fptypeN> | ||
| 1681 | static SIMD_CPPFUNC fptypeN exp2(fptypeN x) { return ::__tg_exp2(x); } | ||
| 1682 | |||
| 1683 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 1684 | /*! @abstract Generalizes the <cmath> function exp10 to operate on vectors | ||
| 1685 | * of floats and doubles. */ | ||
| 1686 | template <typename fptypeN> | ||
| 1687 | static SIMD_CPPFUNC fptypeN exp10(fptypeN x) { return ::__tg_exp10(x); } | ||
| 1688 | #endif | ||
| 1689 | |||
| 1690 | /*! @abstract Generalizes the <cmath> function expm1 to operate on vectors | ||
| 1691 | * of floats and doubles. */ | ||
| 1692 | template <typename fptypeN> | ||
| 1693 | static SIMD_CPPFUNC fptypeN expm1(fptypeN x) { return ::__tg_expm1(x); } | ||
| 1694 | |||
| 1695 | /*! @abstract Generalizes the <cmath> function log to operate on vectors of | ||
| 1696 | * floats and doubles. */ | ||
| 1697 | template <typename fptypeN> | ||
| 1698 | static SIMD_CPPFUNC fptypeN log(fptypeN x) { return ::__tg_log(x); } | ||
| 1699 | |||
| 1700 | /*! @abstract Generalizes the <cmath> function log2 to operate on vectors of | ||
| 1701 | * floats and doubles. */ | ||
| 1702 | template <typename fptypeN> | ||
| 1703 | static SIMD_CPPFUNC fptypeN log2(fptypeN x) { return ::__tg_log2(x); } | ||
| 1704 | |||
| 1705 | /*! @abstract Generalizes the <cmath> function log10 to operate on vectors | ||
| 1706 | * of floats and doubles. */ | ||
| 1707 | template <typename fptypeN> | ||
| 1708 | static SIMD_CPPFUNC fptypeN log10(fptypeN x) { return ::__tg_log10(x); } | ||
| 1709 | |||
| 1710 | /*! @abstract Generalizes the <cmath> function log1p to operate on vectors | ||
| 1711 | * of floats and doubles. */ | ||
| 1712 | template <typename fptypeN> | ||
| 1713 | static SIMD_CPPFUNC fptypeN log1p(fptypeN x) { return ::__tg_log1p(x); } | ||
| 1714 | |||
| 1715 | /*! @abstract Generalizes the <cmath> function fabs to operate on vectors of | ||
| 1716 | * floats and doubles. */ | ||
| 1717 | template <typename fptypeN> | ||
| 1718 | static SIMD_CPPFUNC fptypeN fabs(fptypeN x) { return ::__tg_fabs(x); } | ||
| 1719 | |||
| 1720 | /*! @abstract Generalizes the <cmath> function cbrt to operate on vectors of | ||
| 1721 | * floats and doubles. */ | ||
| 1722 | template <typename fptypeN> | ||
| 1723 | static SIMD_CPPFUNC fptypeN cbrt(fptypeN x) { return ::__tg_cbrt(x); } | ||
| 1724 | |||
| 1725 | /*! @abstract Generalizes the <cmath> function sqrt to operate on vectors of | ||
| 1726 | * floats and doubles. */ | ||
| 1727 | template <typename fptypeN> | ||
| 1728 | static SIMD_CPPFUNC fptypeN sqrt(fptypeN x) { return ::__tg_sqrt(x); } | ||
| 1729 | |||
| 1730 | /*! @abstract Generalizes the <cmath> function erf to operate on vectors of | ||
| 1731 | * floats and doubles. */ | ||
| 1732 | template <typename fptypeN> | ||
| 1733 | static SIMD_CPPFUNC fptypeN erf(fptypeN x) { return ::__tg_erf(x); } | ||
| 1734 | |||
| 1735 | /*! @abstract Generalizes the <cmath> function erfc to operate on vectors of | ||
| 1736 | * floats and doubles. */ | ||
| 1737 | template <typename fptypeN> | ||
| 1738 | static SIMD_CPPFUNC fptypeN erfc(fptypeN x) { return ::__tg_erfc(x); } | ||
| 1739 | |||
| 1740 | /*! @abstract Generalizes the <cmath> function tgamma to operate on vectors | ||
| 1741 | * of floats and doubles. */ | ||
| 1742 | template <typename fptypeN> | ||
| 1743 | static SIMD_CPPFUNC fptypeN tgamma(fptypeN x) { return ::__tg_tgamma(x); } | ||
| 1744 | |||
| 1745 | /*! @abstract Generalizes the <cmath> function ceil to operate on vectors of | ||
| 1746 | * floats and doubles. */ | ||
| 1747 | template <typename fptypeN> | ||
| 1748 | static SIMD_CPPFUNC fptypeN ceil(fptypeN x) { return ::__tg_ceil(x); } | ||
| 1749 | |||
| 1750 | /*! @abstract Generalizes the <cmath> function floor to operate on vectors | ||
| 1751 | * of floats and doubles. */ | ||
| 1752 | template <typename fptypeN> | ||
| 1753 | static SIMD_CPPFUNC fptypeN floor(fptypeN x) { return ::__tg_floor(x); } | ||
| 1754 | |||
| 1755 | /*! @abstract Generalizes the <cmath> function rint to operate on vectors of | ||
| 1756 | * floats and doubles. */ | ||
| 1757 | template <typename fptypeN> | ||
| 1758 | static SIMD_CPPFUNC fptypeN rint(fptypeN x) { return ::__tg_rint(x); } | ||
| 1759 | |||
| 1760 | /*! @abstract Generalizes the <cmath> function round to operate on vectors | ||
| 1761 | * of floats and doubles. */ | ||
| 1762 | template <typename fptypeN> | ||
| 1763 | static SIMD_CPPFUNC fptypeN round(fptypeN x) { return ::__tg_round(x); } | ||
| 1764 | |||
| 1765 | /*! @abstract Generalizes the <cmath> function trunc to operate on vectors | ||
| 1766 | * of floats and doubles. */ | ||
| 1767 | template <typename fptypeN> | ||
| 1768 | static SIMD_CPPFUNC fptypeN trunc(fptypeN x) { return ::__tg_trunc(x); } | ||
| 1769 | |||
| 1770 | /*! @abstract Generalizes the <cmath> function atan2 to operate on vectors | ||
| 1771 | * of floats and doubles. */ | ||
| 1772 | template <typename fptypeN> | ||
| 1773 | static SIMD_CPPFUNC fptypeN atan2(fptypeN y, fptypeN x) { return ::__tg_atan2(y, x); } | ||
| 1774 | |||
| 1775 | /*! @abstract Generalizes the <cmath> function hypot to operate on vectors | ||
| 1776 | * of floats and doubles. */ | ||
| 1777 | template <typename fptypeN> | ||
| 1778 | static SIMD_CPPFUNC fptypeN hypot(fptypeN x, fptypeN y) { return ::__tg_hypot(x, y); } | ||
| 1779 | |||
| 1780 | /*! @abstract Generalizes the <cmath> function pow to operate on vectors of | ||
| 1781 | * floats and doubles. */ | ||
| 1782 | template <typename fptypeN> | ||
| 1783 | static SIMD_CPPFUNC fptypeN pow(fptypeN x, fptypeN y) { return ::__tg_pow(x, y); } | ||
| 1784 | |||
| 1785 | /*! @abstract Generalizes the <cmath> function fmod to operate on vectors of | ||
| 1786 | * floats and doubles. */ | ||
| 1787 | template <typename fptypeN> | ||
| 1788 | static SIMD_CPPFUNC fptypeN fmod(fptypeN x, fptypeN y) { return ::__tg_fmod(x, y); } | ||
| 1789 | |||
| 1790 | /*! @abstract Generalizes the <cmath> function remainder to operate on | ||
| 1791 | * vectors of floats and doubles. */ | ||
| 1792 | template <typename fptypeN> | ||
| 1793 | static SIMD_CPPFUNC fptypeN remainder(fptypeN x, fptypeN y) { return ::__tg_remainder(x, y); } | ||
| 1794 | |||
| 1795 | /*! @abstract Generalizes the <cmath> function copysign to operate on | ||
| 1796 | * vectors of floats and doubles. */ | ||
| 1797 | template <typename fptypeN> | ||
| 1798 | static SIMD_CPPFUNC fptypeN copysign(fptypeN x, fptypeN y) { return ::__tg_copysign(x, y); } | ||
| 1799 | |||
| 1800 | /*! @abstract Generalizes the <cmath> function nextafter to operate on | ||
| 1801 | * vectors of floats and doubles. */ | ||
| 1802 | template <typename fptypeN> | ||
| 1803 | static SIMD_CPPFUNC fptypeN nextafter(fptypeN x, fptypeN y) { return ::__tg_nextafter(x, y); } | ||
| 1804 | |||
| 1805 | /*! @abstract Generalizes the <cmath> function fdim to operate on vectors of | ||
| 1806 | * floats and doubles. */ | ||
| 1807 | template <typename fptypeN> | ||
| 1808 | static SIMD_CPPFUNC fptypeN fdim(fptypeN x, fptypeN y) { return ::__tg_fdim(x, y); } | ||
| 1809 | |||
| 1810 | /*! @abstract Generalizes the <cmath> function fmax to operate on vectors of | ||
| 1811 | * floats and doubles. */ | ||
| 1812 | template <typename fptypeN> | ||
| 1813 | static SIMD_CPPFUNC fptypeN fmax(fptypeN x, fptypeN y) { return ::__tg_fmax(x, y); } | ||
| 1814 | |||
| 1815 | /*! @abstract Generalizes the <cmath> function fmin to operate on vectors of | ||
| 1816 | * floats and doubles. */ | ||
| 1817 | template <typename fptypeN> | ||
| 1818 | static SIMD_CPPFUNC fptypeN fmin(fptypeN x, fptypeN y) { return ::__tg_fmin(x, y); } | ||
| 1819 | |||
| 1820 | /*! @abstract Generalizes the <cmath> function fma to operate on vectors of | ||
| 1821 | * floats and doubles. */ | ||
| 1822 | template <typename fptypeN> | ||
| 1823 | static SIMD_CPPFUNC fptypeN fma(fptypeN x, fptypeN y, fptypeN z) { return ::__tg_fma(x, y, z); } | ||
| 1824 | |||
| 1825 | /*! @abstract Computes x*y + z by the most efficient means available; either | ||
| 1826 | * a fused multiply add or separate multiply and add. */ | ||
| 1827 | template <typename fptypeN> | ||
| 1828 | static SIMD_CPPFUNC fptypeN muladd(fptypeN x, fptypeN y, fptypeN z) { return ::simd_muladd(x, y, z); } | ||
| 1829 | }; | ||
| 1830 | |||
| 1831 | extern "C" { | ||
| 1832 | #else | ||
| 1833 | #include <tgmath.h> | ||
| 1834 | /* C and Objective-C, we need some infrastructure to piggyback on tgmath.h */ | ||
| 1835 | static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2); | ||
| 1836 | static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3); | ||
| 1837 | static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4); | ||
| 1838 | static SIMD_OVERLOAD simd_float8 __tg_promote(simd_float8); | ||
| 1839 | static SIMD_OVERLOAD simd_float16 __tg_promote(simd_float16); | ||
| 1840 | static SIMD_OVERLOAD simd_double2 __tg_promote(simd_double2); | ||
| 1841 | static SIMD_OVERLOAD simd_double3 __tg_promote(simd_double3); | ||
| 1842 | static SIMD_OVERLOAD simd_double4 __tg_promote(simd_double4); | ||
| 1843 | static SIMD_OVERLOAD simd_double8 __tg_promote(simd_double8); | ||
| 1844 | |||
| 1845 | /* Apple extensions to <math.h>, added in macOS 10.9 and iOS 7.0 */ | ||
| 1846 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 || \ | ||
| 1847 | __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0 || \ | ||
| 1848 | __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_19_0 | ||
| 1849 | static inline SIMD_CFUNC float __tg_cospi(float x) { return __cospif(x); } | ||
| 1850 | static inline SIMD_CFUNC double __tg_cospi(double x) { return __cospi(x); } | ||
| 1851 | #undef cospi | ||
| 1852 | /*! @abstract `cospi(x)` computes `cos(pi * x)` without intermediate rounding. | ||
| 1853 | * | ||
| 1854 | * @discussion Both faster and more accurate than multiplying by `pi` and then | ||
| 1855 | * calling `cos`. Defined for `float` and `double` as well as vectors of | ||
| 1856 | * floats and doubles as provided by `<simd/simd.h>`. */ | ||
| 1857 | #define cospi(__x) __tg_cospi(__tg_promote1((__x))(__x)) | ||
| 1858 | |||
| 1859 | static inline SIMD_CFUNC float __tg_sinpi(float x) { return __sinpif(x); } | ||
| 1860 | static inline SIMD_CFUNC double __tg_sinpi(double x) { return __sinpi(x); } | ||
| 1861 | #undef sinpi | ||
| 1862 | /*! @abstract `sinpi(x)` computes `sin(pi * x)` without intermediate rounding. | ||
| 1863 | * | ||
| 1864 | * @discussion Both faster and more accurate than multiplying by `pi` and then | ||
| 1865 | * calling `sin`. Defined for `float` and `double` as well as vectors | ||
| 1866 | * of floats and doubles as provided by `<simd/simd.h>`. */ | ||
| 1867 | #define sinpi(__x) __tg_sinpi(__tg_promote1((__x))(__x)) | ||
| 1868 | |||
| 1869 | static inline SIMD_CFUNC float __tg_tanpi(float x) { return __tanpif(x); } | ||
| 1870 | static inline SIMD_CFUNC double __tg_tanpi(double x) { return __tanpi(x); } | ||
| 1871 | #undef tanpi | ||
| 1872 | /*! @abstract `tanpi(x)` computes `tan(pi * x)` without intermediate rounding. | ||
| 1873 | * | ||
| 1874 | * @discussion Both faster and more accurate than multiplying by `pi` and then | ||
| 1875 | * calling `tan`. Defined for `float` and `double` as well as vectors of | ||
| 1876 | * floats and doubles as provided by `<simd/simd.h>`. */ | ||
| 1877 | #define tanpi(__x) __tg_tanpi(__tg_promote1((__x))(__x)) | ||
| 1878 | |||
| 1879 | static inline SIMD_CFUNC float __tg_exp10(float x) { return __exp10f(x); } | ||
| 1880 | static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); } | ||
| 1881 | #undef exp10 | ||
| 1882 | /*! @abstract `exp10(x)` computes `10**x` more efficiently and accurately | ||
| 1883 | * than `pow(10, x)`. | ||
| 1884 | * | ||
| 1885 | * @discussion Defined for `float` and `double` as well as vectors of floats | ||
| 1886 | * and doubles as provided by `<simd/simd.h>`. */ | ||
| 1887 | #define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x)) | ||
| 1888 | #endif | ||
| 1889 | |||
| 1890 | |||
| 1891 | #endif /* !__cplusplus */ | ||
| 1892 | |||
| 1893 | #pragma mark - fabs implementation | ||
| 1894 | static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); } | ||
| 1895 | static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); } | ||
| 1896 | static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x) { return simd_bitselect(0.0, x, 0x7fffffff); } | ||
| 1897 | static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x) { return simd_bitselect(0.0, x, 0x7fffffff); } | ||
| 1898 | static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x) { return simd_bitselect(0.0, x, 0x7fffffff); } | ||
| 1899 | static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); } | ||
| 1900 | static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); } | ||
| 1901 | static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); } | ||
| 1902 | static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); } | ||
| 1903 | |||
| 1904 | #pragma mark - fmin, fmax implementation | ||
| 1905 | static SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y) { | ||
| 1906 | #if defined __SSE2__ | ||
| 1907 | return simd_make_float2(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y))); | ||
| 1908 | #elif defined __arm64__ | ||
| 1909 | return vminnm_f32(x, y); | ||
| 1910 | #elif defined __arm__ && __FINITE_MATH_ONLY__ | ||
| 1911 | return vmin_f32(x, y); | ||
| 1912 | #else | ||
| 1913 | return simd_bitselect(y, x, (x <= y) | (y != y)); | ||
| 1914 | #endif | ||
| 1915 | } | ||
| 1916 | |||
| 1917 | static SIMD_CFUNC simd_float3 __tg_fmin(simd_float3 x, simd_float3 y) { | ||
| 1918 | return simd_make_float3(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y))); | ||
| 1919 | } | ||
| 1920 | |||
| 1921 | static SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y) { | ||
| 1922 | #if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__ | ||
| 1923 | return _mm_range_ps(x, y, 4); | ||
| 1924 | #elif defined __SSE2__ && __FINITE_MATH_ONLY__ | ||
| 1925 | return _mm_min_ps(x, y); | ||
| 1926 | #elif defined __SSE2__ | ||
| 1927 | return simd_bitselect(_mm_min_ps(x, y), x, y != y); | ||
| 1928 | #elif defined __arm64__ | ||
| 1929 | return vminnmq_f32(x, y); | ||
| 1930 | #elif defined __arm__ && __FINITE_MATH_ONLY__ | ||
| 1931 | return vminq_f32(x, y); | ||
| 1932 | #else | ||
| 1933 | return simd_bitselect(y, x, (x <= y) | (y != y)); | ||
| 1934 | #endif | ||
| 1935 | } | ||
| 1936 | |||
| 1937 | static SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y) { | ||
| 1938 | #if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__ | ||
| 1939 | return _mm256_range_ps(x, y, 4); | ||
| 1940 | #elif defined __AVX__ && __FINITE_MATH_ONLY__ | ||
| 1941 | return _mm256_min_ps(x, y); | ||
| 1942 | #elif defined __AVX__ | ||
| 1943 | return simd_bitselect(_mm256_min_ps(x, y), x, y != y); | ||
| 1944 | #else | ||
| 1945 | return simd_make_float8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi)); | ||
| 1946 | #endif | ||
| 1947 | } | ||
| 1948 | |||
| 1949 | static SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y) { | ||
| 1950 | #if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__ | ||
| 1951 | return _mm512_range_ps(x, y, 4); | ||
| 1952 | #elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ | ||
| 1953 | return _mm512_min_ps(x, y); | ||
| 1954 | #elif defined __x86_64__ && defined __AVX512F__ | ||
| 1955 | return simd_bitselect(_mm512_min_ps(x, y), x, y != y); | ||
| 1956 | #else | ||
| 1957 | return simd_make_float16(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi)); | ||
| 1958 | #endif | ||
| 1959 | } | ||
| 1960 | |||
| 1961 | static SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y) { | ||
| 1962 | #if defined __AVX512DQ__ && defined __AVX512VL__ | ||
| 1963 | return _mm_range_pd(x, y, 4); | ||
| 1964 | #elif defined __SSE2__ && __FINITE_MATH_ONLY__ | ||
| 1965 | return _mm_min_pd(x, y); | ||
| 1966 | #elif defined __SSE2__ | ||
| 1967 | return simd_bitselect(_mm_min_pd(x, y), x, y != y); | ||
| 1968 | #elif defined __arm64__ | ||
| 1969 | return vminnmq_f64(x, y); | ||
| 1970 | #else | ||
| 1971 | return simd_bitselect(y, x, (x <= y) | (y != y)); | ||
| 1972 | #endif | ||
| 1973 | } | ||
| 1974 | |||
| 1975 | static SIMD_CFUNC simd_double3 __tg_fmin(simd_double3 x, simd_double3 y) { | ||
| 1976 | return simd_make_double3(__tg_fmin(simd_make_double4_undef(x), simd_make_double4_undef(y))); | ||
| 1977 | } | ||
| 1978 | |||
| 1979 | static SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y) { | ||
| 1980 | #if defined __AVX512DQ__ && defined __AVX512VL__ | ||
| 1981 | return _mm256_range_pd(x, y, 4); | ||
| 1982 | #elif defined __AVX__ && __FINITE_MATH_ONLY__ | ||
| 1983 | return _mm256_min_pd(x, y); | ||
| 1984 | #elif defined __AVX__ | ||
| 1985 | return simd_bitselect(_mm256_min_pd(x, y), x, y != y); | ||
| 1986 | #else | ||
| 1987 | return simd_make_double4(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi)); | ||
| 1988 | #endif | ||
| 1989 | } | ||
| 1990 | |||
| 1991 | static SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y) { | ||
| 1992 | #if defined __x86_64__ && defined __AVX512DQ__ | ||
| 1993 | return _mm512_range_pd(x, y, 4); | ||
| 1994 | #elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ | ||
| 1995 | return _mm512_min_pd(x, y); | ||
| 1996 | #elif defined __x86_64__ && defined __AVX512F__ | ||
| 1997 | return simd_bitselect(_mm512_min_pd(x, y), x, y != y); | ||
| 1998 | #else | ||
| 1999 | return simd_make_double8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi)); | ||
| 2000 | #endif | ||
| 2001 | } | ||
| 2002 | |||
| 2003 | static SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y) { | ||
| 2004 | #if defined __SSE2__ | ||
| 2005 | return simd_make_float2(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y))); | ||
| 2006 | #elif defined __arm64__ | ||
| 2007 | return vmaxnm_f32(x, y); | ||
| 2008 | #elif defined __arm__ && __FINITE_MATH_ONLY__ | ||
| 2009 | return vmax_f32(x, y); | ||
| 2010 | #else | ||
| 2011 | return simd_bitselect(y, x, (x >= y) | (y != y)); | ||
| 2012 | #endif | ||
| 2013 | } | ||
| 2014 | |||
| 2015 | static SIMD_CFUNC simd_float3 __tg_fmax(simd_float3 x, simd_float3 y) { | ||
| 2016 | return simd_make_float3(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y))); | ||
| 2017 | } | ||
| 2018 | |||
| 2019 | static SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y) { | ||
| 2020 | #if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__ | ||
| 2021 | return _mm_range_ps(x, y, 5); | ||
| 2022 | #elif defined __SSE2__ && __FINITE_MATH_ONLY__ | ||
| 2023 | return _mm_max_ps(x, y); | ||
| 2024 | #elif defined __SSE2__ | ||
| 2025 | return simd_bitselect(_mm_max_ps(x, y), x, y != y); | ||
| 2026 | #elif defined __arm64__ | ||
| 2027 | return vmaxnmq_f32(x, y); | ||
| 2028 | #elif defined __arm__ && __FINITE_MATH_ONLY__ | ||
| 2029 | return vmaxq_f32(x, y); | ||
| 2030 | #else | ||
| 2031 | return simd_bitselect(y, x, (x >= y) | (y != y)); | ||
| 2032 | #endif | ||
| 2033 | } | ||
| 2034 | |||
| 2035 | static SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y) { | ||
| 2036 | #if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__ | ||
| 2037 | return _mm256_range_ps(x, y, 5); | ||
| 2038 | #elif defined __AVX__ && __FINITE_MATH_ONLY__ | ||
| 2039 | return _mm256_max_ps(x, y); | ||
| 2040 | #elif defined __AVX__ | ||
| 2041 | return simd_bitselect(_mm256_max_ps(x, y), x, y != y); | ||
| 2042 | #else | ||
| 2043 | return simd_make_float8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi)); | ||
| 2044 | #endif | ||
| 2045 | } | ||
| 2046 | |||
| 2047 | static SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y) { | ||
| 2048 | #if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__ | ||
| 2049 | return _mm512_range_ps(x, y, 5); | ||
| 2050 | #elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ | ||
| 2051 | return _mm512_max_ps(x, y); | ||
| 2052 | #elif defined __x86_64__ && defined __AVX512F__ | ||
| 2053 | return simd_bitselect(_mm512_max_ps(x, y), x, y != y); | ||
| 2054 | #else | ||
| 2055 | return simd_make_float16(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi)); | ||
| 2056 | #endif | ||
| 2057 | } | ||
| 2058 | |||
| 2059 | static SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y) { | ||
| 2060 | #if defined __AVX512DQ__ && defined __AVX512VL__ | ||
| 2061 | return _mm_range_pd(x, y, 5); | ||
| 2062 | #elif defined __SSE2__ && __FINITE_MATH_ONLY__ | ||
| 2063 | return _mm_max_pd(x, y); | ||
| 2064 | #elif defined __SSE2__ | ||
| 2065 | return simd_bitselect(_mm_max_pd(x, y), x, y != y); | ||
| 2066 | #elif defined __arm64__ | ||
| 2067 | return vmaxnmq_f64(x, y); | ||
| 2068 | #else | ||
| 2069 | return simd_bitselect(y, x, (x >= y) | (y != y)); | ||
| 2070 | #endif | ||
| 2071 | } | ||
| 2072 | |||
| 2073 | static SIMD_CFUNC simd_double3 __tg_fmax(simd_double3 x, simd_double3 y) { | ||
| 2074 | return simd_make_double3(__tg_fmax(simd_make_double4_undef(x), simd_make_double4_undef(y))); | ||
| 2075 | } | ||
| 2076 | |||
| 2077 | static SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y) { | ||
| 2078 | #if defined __AVX512DQ__ && defined __AVX512VL__ | ||
| 2079 | return _mm256_range_pd(x, y, 5); | ||
| 2080 | #elif defined __AVX__ && __FINITE_MATH_ONLY__ | ||
| 2081 | return _mm256_max_pd(x, y); | ||
| 2082 | #elif defined __AVX__ | ||
| 2083 | return simd_bitselect(_mm256_max_pd(x, y), x, y != y); | ||
| 2084 | #else | ||
| 2085 | return simd_make_double4(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi)); | ||
| 2086 | #endif | ||
| 2087 | } | ||
| 2088 | |||
| 2089 | static SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y) { | ||
| 2090 | #if defined __x86_64__ && defined __AVX512DQ__ | ||
| 2091 | return _mm512_range_pd(x, y, 5); | ||
| 2092 | #elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ | ||
| 2093 | return _mm512_max_pd(x, y); | ||
| 2094 | #elif defined __x86_64__ && defined __AVX512F__ | ||
| 2095 | return simd_bitselect(_mm512_max_pd(x, y), x, y != y); | ||
| 2096 | #else | ||
| 2097 | return simd_make_double8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi)); | ||
| 2098 | #endif | ||
| 2099 | } | ||
| 2100 | |||
| 2101 | #pragma mark - copysign implementation | ||
| 2102 | static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); } | ||
| 2103 | static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); } | ||
| 2104 | static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y) { return simd_bitselect(y, x, 0x7fffffff); } | ||
| 2105 | static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y) { return simd_bitselect(y, x, 0x7fffffff); } | ||
| 2106 | static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y) { return simd_bitselect(y, x, 0x7fffffff); } | ||
| 2107 | static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); } | ||
| 2108 | static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); } | ||
| 2109 | static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); } | ||
| 2110 | static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); } | ||
| 2111 | |||
| 2112 | #pragma mark - sqrt implementation | ||
| 2113 | static SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x) { | ||
| 2114 | #if defined __SSE2__ | ||
| 2115 | return simd_make_float2(__tg_sqrt(simd_make_float4_undef(x))); | ||
| 2116 | #elif defined __arm64__ | ||
| 2117 | return vsqrt_f32(x); | ||
| 2118 | #else | ||
| 2119 | return simd_make_float2(sqrt(x.x), sqrt(x.y)); | ||
| 2120 | #endif | ||
| 2121 | } | ||
| 2122 | |||
| 2123 | static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) { | ||
| 2124 | return simd_make_float3(__tg_sqrt(simd_make_float4_undef(x))); | ||
| 2125 | } | ||
| 2126 | |||
| 2127 | static SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x) { | ||
| 2128 | #if defined __SSE2__ | ||
| 2129 | return _mm_sqrt_ps(x); | ||
| 2130 | #elif defined __arm64__ | ||
| 2131 | return vsqrtq_f32(x); | ||
| 2132 | #else | ||
| 2133 | return simd_make_float4(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); | ||
| 2134 | #endif | ||
| 2135 | } | ||
| 2136 | |||
| 2137 | static SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x) { | ||
| 2138 | #if defined __AVX__ | ||
| 2139 | return _mm256_sqrt_ps(x); | ||
| 2140 | #else | ||
| 2141 | return simd_make_float8(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); | ||
| 2142 | #endif | ||
| 2143 | } | ||
| 2144 | |||
| 2145 | static SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x) { | ||
| 2146 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2147 | return _mm512_sqrt_ps(x); | ||
| 2148 | #else | ||
| 2149 | return simd_make_float16(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); | ||
| 2150 | #endif | ||
| 2151 | } | ||
| 2152 | |||
| 2153 | static SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x) { | ||
| 2154 | #if defined __SSE2__ | ||
| 2155 | return _mm_sqrt_pd(x); | ||
| 2156 | #elif defined __arm64__ | ||
| 2157 | return vsqrtq_f64(x); | ||
| 2158 | #else | ||
| 2159 | return simd_make_double2(sqrt(x.x), sqrt(x.y)); | ||
| 2160 | #endif | ||
| 2161 | } | ||
| 2162 | |||
| 2163 | static SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x) { | ||
| 2164 | return simd_make_double3(__tg_sqrt(simd_make_double4_undef(x))); | ||
| 2165 | } | ||
| 2166 | |||
| 2167 | static SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x) { | ||
| 2168 | #if defined __AVX__ | ||
| 2169 | return _mm256_sqrt_pd(x); | ||
| 2170 | #else | ||
| 2171 | return simd_make_double4(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); | ||
| 2172 | #endif | ||
| 2173 | } | ||
| 2174 | |||
| 2175 | static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) { | ||
| 2176 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2177 | return _mm512_sqrt_pd(x); | ||
| 2178 | #else | ||
| 2179 | return simd_make_double8(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); | ||
| 2180 | #endif | ||
| 2181 | } | ||
| 2182 | |||
| 2183 | #pragma mark - ceil, floor, rint, trunc implementation | ||
| 2184 | static SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x) { | ||
| 2185 | #if defined __arm64__ | ||
| 2186 | return vrndp_f32(x); | ||
| 2187 | #else | ||
| 2188 | return simd_make_float2(__tg_ceil(simd_make_float4_undef(x))); | ||
| 2189 | #endif | ||
| 2190 | } | ||
| 2191 | |||
| 2192 | static SIMD_CFUNC simd_float3 __tg_ceil(simd_float3 x) { | ||
| 2193 | return simd_make_float3(__tg_ceil(simd_make_float4_undef(x))); | ||
| 2194 | } | ||
| 2195 | |||
| 2196 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2197 | extern simd_float4 _simd_ceil_f4(simd_float4 x); | ||
| 2198 | #endif | ||
| 2199 | |||
| 2200 | static SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x) { | ||
| 2201 | #if defined __SSE4_1__ | ||
| 2202 | return _mm_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); | ||
| 2203 | #elif defined __arm64__ | ||
| 2204 | return vrndpq_f32(x); | ||
| 2205 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2206 | return _simd_ceil_f4(x); | ||
| 2207 | #else | ||
| 2208 | simd_float4 truncated = __tg_trunc(x); | ||
| 2209 | simd_float4 adjust = simd_bitselect((simd_float4)0, 1, truncated < x); | ||
| 2210 | return __tg_copysign(truncated + adjust, x); | ||
| 2211 | #endif | ||
| 2212 | } | ||
| 2213 | |||
| 2214 | static SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x) { | ||
| 2215 | #if defined __AVX__ | ||
| 2216 | return _mm256_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); | ||
| 2217 | #else | ||
| 2218 | return simd_make_float8(__tg_ceil(x.lo), __tg_ceil(x.hi)); | ||
| 2219 | #endif | ||
| 2220 | } | ||
| 2221 | |||
| 2222 | static SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x) { | ||
| 2223 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2224 | return _mm512_roundscale_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); | ||
| 2225 | #else | ||
| 2226 | return simd_make_float16(__tg_ceil(x.lo), __tg_ceil(x.hi)); | ||
| 2227 | #endif | ||
| 2228 | } | ||
| 2229 | |||
| 2230 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2231 | extern simd_double2 _simd_ceil_d2(simd_double2 x); | ||
| 2232 | #endif | ||
| 2233 | |||
| 2234 | static SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x) { | ||
| 2235 | #if defined __SSE4_1__ | ||
| 2236 | return _mm_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); | ||
| 2237 | #elif defined __arm64__ | ||
| 2238 | return vrndpq_f64(x); | ||
| 2239 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2240 | return _simd_ceil_d2(x); | ||
| 2241 | #else | ||
| 2242 | simd_double2 truncated = __tg_trunc(x); | ||
| 2243 | simd_double2 adjust = simd_bitselect((simd_double2)0, 1, truncated < x); | ||
| 2244 | return __tg_copysign(truncated + adjust, x); | ||
| 2245 | #endif | ||
| 2246 | } | ||
| 2247 | |||
| 2248 | static SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x) { | ||
| 2249 | return simd_make_double3(__tg_ceil(simd_make_double4_undef(x))); | ||
| 2250 | } | ||
| 2251 | |||
| 2252 | static SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x) { | ||
| 2253 | #if defined __AVX__ | ||
| 2254 | return _mm256_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); | ||
| 2255 | #else | ||
| 2256 | return simd_make_double4(__tg_ceil(x.lo), __tg_ceil(x.hi)); | ||
| 2257 | #endif | ||
| 2258 | } | ||
| 2259 | |||
| 2260 | static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) { | ||
| 2261 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2262 | return _mm512_roundscale_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); | ||
| 2263 | #else | ||
| 2264 | return simd_make_double8(__tg_ceil(x.lo), __tg_ceil(x.hi)); | ||
| 2265 | #endif | ||
| 2266 | } | ||
| 2267 | |||
| 2268 | static SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x) { | ||
| 2269 | #if defined __arm64__ | ||
| 2270 | return vrndm_f32(x); | ||
| 2271 | #else | ||
| 2272 | return simd_make_float2(__tg_floor(simd_make_float4_undef(x))); | ||
| 2273 | #endif | ||
| 2274 | } | ||
| 2275 | |||
| 2276 | static SIMD_CFUNC simd_float3 __tg_floor(simd_float3 x) { | ||
| 2277 | return simd_make_float3(__tg_floor(simd_make_float4_undef(x))); | ||
| 2278 | } | ||
| 2279 | |||
| 2280 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2281 | extern simd_float4 _simd_floor_f4(simd_float4 x); | ||
| 2282 | #endif | ||
| 2283 | |||
| 2284 | static SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x) { | ||
| 2285 | #if defined __SSE4_1__ | ||
| 2286 | return _mm_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); | ||
| 2287 | #elif defined __arm64__ | ||
| 2288 | return vrndmq_f32(x); | ||
| 2289 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2290 | return _simd_floor_f4(x); | ||
| 2291 | #else | ||
| 2292 | simd_float4 truncated = __tg_trunc(x); | ||
| 2293 | simd_float4 adjust = simd_bitselect((simd_float4)0, 1, truncated > x); | ||
| 2294 | return truncated - adjust; | ||
| 2295 | #endif | ||
| 2296 | } | ||
| 2297 | |||
| 2298 | static SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x) { | ||
| 2299 | #if defined __AVX__ | ||
| 2300 | return _mm256_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); | ||
| 2301 | #else | ||
| 2302 | return simd_make_float8(__tg_floor(x.lo), __tg_floor(x.hi)); | ||
| 2303 | #endif | ||
| 2304 | } | ||
| 2305 | |||
| 2306 | static SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x) { | ||
| 2307 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2308 | return _mm512_roundscale_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); | ||
| 2309 | #else | ||
| 2310 | return simd_make_float16(__tg_floor(x.lo), __tg_floor(x.hi)); | ||
| 2311 | #endif | ||
| 2312 | } | ||
| 2313 | |||
| 2314 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2315 | extern simd_double2 _simd_floor_d2(simd_double2 x); | ||
| 2316 | #endif | ||
| 2317 | |||
| 2318 | static SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x) { | ||
| 2319 | #if defined __SSE4_1__ | ||
| 2320 | return _mm_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); | ||
| 2321 | #elif defined __arm64__ | ||
| 2322 | return vrndmq_f64(x); | ||
| 2323 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2324 | return _simd_floor_d2(x); | ||
| 2325 | #else | ||
| 2326 | simd_double2 truncated = __tg_trunc(x); | ||
| 2327 | simd_double2 adjust = simd_bitselect((simd_double2)0, 1, truncated > x); | ||
| 2328 | return truncated - adjust; | ||
| 2329 | #endif | ||
| 2330 | } | ||
| 2331 | |||
| 2332 | static SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x) { | ||
| 2333 | return simd_make_double3(__tg_floor(simd_make_double4_undef(x))); | ||
| 2334 | } | ||
| 2335 | |||
| 2336 | static SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x) { | ||
| 2337 | #if defined __AVX__ | ||
| 2338 | return _mm256_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); | ||
| 2339 | #else | ||
| 2340 | return simd_make_double4(__tg_floor(x.lo), __tg_floor(x.hi)); | ||
| 2341 | #endif | ||
| 2342 | } | ||
| 2343 | |||
| 2344 | static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) { | ||
| 2345 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2346 | return _mm512_roundscale_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); | ||
| 2347 | #else | ||
| 2348 | return simd_make_double8(__tg_floor(x.lo), __tg_floor(x.hi)); | ||
| 2349 | #endif | ||
| 2350 | } | ||
| 2351 | |||
| 2352 | static SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x) { | ||
| 2353 | #if defined __arm64__ | ||
| 2354 | return vrndx_f32(x); | ||
| 2355 | #else | ||
| 2356 | return simd_make_float2(__tg_rint(simd_make_float4_undef(x))); | ||
| 2357 | #endif | ||
| 2358 | } | ||
| 2359 | |||
| 2360 | static SIMD_CFUNC simd_float3 __tg_rint(simd_float3 x) { | ||
| 2361 | return simd_make_float3(__tg_rint(simd_make_float4_undef(x))); | ||
| 2362 | } | ||
| 2363 | |||
| 2364 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2365 | extern simd_float4 _simd_rint_f4(simd_float4 x); | ||
| 2366 | #endif | ||
| 2367 | |||
| 2368 | static SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x) { | ||
| 2369 | #if defined __SSE4_1__ | ||
| 2370 | return _mm_round_ps(x, _MM_FROUND_RINT); | ||
| 2371 | #elif defined __arm64__ | ||
| 2372 | return vrndxq_f32(x); | ||
| 2373 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2374 | return _simd_rint_f4(x); | ||
| 2375 | #else | ||
| 2376 | simd_float4 magic = __tg_copysign(0x1.0p23, x); | ||
| 2377 | simd_int4 x_is_small = __tg_fabs(x) < 0x1.0p23; | ||
| 2378 | return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fffffff); | ||
| 2379 | #endif | ||
| 2380 | } | ||
| 2381 | |||
| 2382 | static SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x) { | ||
| 2383 | #if defined __AVX__ | ||
| 2384 | return _mm256_round_ps(x, _MM_FROUND_RINT); | ||
| 2385 | #else | ||
| 2386 | return simd_make_float8(__tg_rint(x.lo), __tg_rint(x.hi)); | ||
| 2387 | #endif | ||
| 2388 | } | ||
| 2389 | |||
| 2390 | static SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x) { | ||
| 2391 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2392 | return _mm512_roundscale_ps(x, _MM_FROUND_RINT); | ||
| 2393 | #else | ||
| 2394 | return simd_make_float16(__tg_rint(x.lo), __tg_rint(x.hi)); | ||
| 2395 | #endif | ||
| 2396 | } | ||
| 2397 | |||
| 2398 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2399 | extern simd_double2 _simd_rint_d2(simd_double2 x); | ||
| 2400 | #endif | ||
| 2401 | |||
| 2402 | static SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x) { | ||
| 2403 | #if defined __SSE4_1__ | ||
| 2404 | return _mm_round_pd(x, _MM_FROUND_RINT); | ||
| 2405 | #elif defined __arm64__ | ||
| 2406 | return vrndxq_f64(x); | ||
| 2407 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2408 | return _simd_rint_d2(x); | ||
| 2409 | #else | ||
| 2410 | simd_double2 magic = __tg_copysign(0x1.0p52, x); | ||
| 2411 | simd_long2 x_is_small = __tg_fabs(x) < 0x1.0p52; | ||
| 2412 | return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fffffffffffffff); | ||
| 2413 | #endif | ||
| 2414 | } | ||
| 2415 | |||
| 2416 | static SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x) { | ||
| 2417 | return simd_make_double3(__tg_rint(simd_make_double4_undef(x))); | ||
| 2418 | } | ||
| 2419 | |||
| 2420 | static SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x) { | ||
| 2421 | #if defined __AVX__ | ||
| 2422 | return _mm256_round_pd(x, _MM_FROUND_RINT); | ||
| 2423 | #else | ||
| 2424 | return simd_make_double4(__tg_rint(x.lo), __tg_rint(x.hi)); | ||
| 2425 | #endif | ||
| 2426 | } | ||
| 2427 | |||
| 2428 | static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) { | ||
| 2429 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2430 | return _mm512_roundscale_pd(x, _MM_FROUND_RINT); | ||
| 2431 | #else | ||
| 2432 | return simd_make_double8(__tg_rint(x.lo), __tg_rint(x.hi)); | ||
| 2433 | #endif | ||
| 2434 | } | ||
| 2435 | |||
| 2436 | static SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x) { | ||
| 2437 | #if defined __arm64__ | ||
| 2438 | return vrnd_f32(x); | ||
| 2439 | #else | ||
| 2440 | return simd_make_float2(__tg_trunc(simd_make_float4_undef(x))); | ||
| 2441 | #endif | ||
| 2442 | } | ||
| 2443 | |||
| 2444 | static SIMD_CFUNC simd_float3 __tg_trunc(simd_float3 x) { | ||
| 2445 | return simd_make_float3(__tg_trunc(simd_make_float4_undef(x))); | ||
| 2446 | } | ||
| 2447 | |||
| 2448 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2449 | extern simd_float4 _simd_trunc_f4(simd_float4 x); | ||
| 2450 | #endif | ||
| 2451 | |||
| 2452 | static SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x) { | ||
| 2453 | #if defined __SSE4_1__ | ||
| 2454 | return _mm_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); | ||
| 2455 | #elif defined __arm64__ | ||
| 2456 | return vrndq_f32(x); | ||
| 2457 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2458 | return _simd_trunc_f4(x); | ||
| 2459 | #else | ||
| 2460 | simd_float4 binade = simd_bitselect(0, x, 0x7f800000); | ||
| 2461 | simd_int4 mask = (simd_int4)__tg_fmin(-2*binade + 1, -0); | ||
| 2462 | simd_float4 result = simd_bitselect(0, x, mask); | ||
| 2463 | return simd_bitselect(x, result, binade < 0x1.0p23); | ||
| 2464 | #endif | ||
| 2465 | } | ||
| 2466 | |||
| 2467 | static SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x) { | ||
| 2468 | #if defined __AVX__ | ||
| 2469 | return _mm256_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); | ||
| 2470 | #else | ||
| 2471 | return simd_make_float8(__tg_trunc(x.lo), __tg_trunc(x.hi)); | ||
| 2472 | #endif | ||
| 2473 | } | ||
| 2474 | |||
| 2475 | static SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x) { | ||
| 2476 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2477 | return _mm512_roundscale_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); | ||
| 2478 | #else | ||
| 2479 | return simd_make_float16(__tg_trunc(x.lo), __tg_trunc(x.hi)); | ||
| 2480 | #endif | ||
| 2481 | } | ||
| 2482 | |||
| 2483 | #if defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2484 | extern simd_double2 _simd_trunc_d2(simd_double2 x); | ||
| 2485 | #endif | ||
| 2486 | |||
| 2487 | static SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x) { | ||
| 2488 | #if defined __SSE4_1__ | ||
| 2489 | return _mm_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); | ||
| 2490 | #elif defined __arm64__ | ||
| 2491 | return vrndq_f64(x); | ||
| 2492 | #elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3 | ||
| 2493 | return _simd_trunc_d2(x); | ||
| 2494 | #else | ||
| 2495 | simd_double2 binade = simd_bitselect(0, x, 0x7ff0000000000000); | ||
| 2496 | simd_long2 mask = (simd_long2)__tg_fmin(-2*binade + 1, -0); | ||
| 2497 | simd_double2 result = simd_bitselect(0, x, mask); | ||
| 2498 | return simd_bitselect(x, result, binade < 0x1.0p52); | ||
| 2499 | #endif | ||
| 2500 | } | ||
| 2501 | |||
| 2502 | static SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x) { | ||
| 2503 | return simd_make_double3(__tg_trunc(simd_make_double4_undef(x))); | ||
| 2504 | } | ||
| 2505 | |||
| 2506 | static SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x) { | ||
| 2507 | #if defined __AVX__ | ||
| 2508 | return _mm256_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); | ||
| 2509 | #else | ||
| 2510 | return simd_make_double4(__tg_trunc(x.lo), __tg_trunc(x.hi)); | ||
| 2511 | #endif | ||
| 2512 | } | ||
| 2513 | |||
| 2514 | static SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x) { | ||
| 2515 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 2516 | return _mm512_roundscale_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); | ||
| 2517 | #else | ||
| 2518 | return simd_make_double8(__tg_trunc(x.lo), __tg_trunc(x.hi)); | ||
| 2519 | #endif | ||
| 2520 | } | ||
| 2521 | |||
| 2522 | #pragma mark - sine, cosine implementation | ||
| 2523 | static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x) { | ||
| 2524 | return simd_make_float2(__tg_sin(simd_make_float4(x))); | ||
| 2525 | } | ||
| 2526 | |||
| 2527 | static inline SIMD_CFUNC simd_float3 __tg_sin(simd_float3 x) { | ||
| 2528 | return simd_make_float3(__tg_sin(simd_make_float4(x))); | ||
| 2529 | } | ||
| 2530 | |||
| 2531 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2532 | extern simd_float4 _simd_sin_f4(simd_float4 x); | ||
| 2533 | static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) { | ||
| 2534 | return _simd_sin_f4(x); | ||
| 2535 | } | ||
| 2536 | #elif SIMD_LIBRARY_VERSION == 1 | ||
| 2537 | extern simd_float4 __sin_f4(simd_float4 x); | ||
| 2538 | static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) { | ||
| 2539 | return __sin_f4(x); | ||
| 2540 | } | ||
| 2541 | #else | ||
| 2542 | static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) { | ||
| 2543 | return simd_make_float4(sin(x.x), sin(x.y), sin(x.z), sin(x.w)); | ||
| 2544 | } | ||
| 2545 | #endif | ||
| 2546 | |||
| 2547 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2548 | extern simd_float8 _simd_sin_f8(simd_float8 x); | ||
| 2549 | static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) { | ||
| 2550 | return _simd_sin_f8(x); | ||
| 2551 | } | ||
| 2552 | #else | ||
| 2553 | static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) { | ||
| 2554 | return simd_make_float8(__tg_sin(x.lo), __tg_sin(x.hi)); | ||
| 2555 | } | ||
| 2556 | #endif | ||
| 2557 | |||
| 2558 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2559 | extern simd_float16 _simd_sin_f16(simd_float16 x); | ||
| 2560 | static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) { | ||
| 2561 | return _simd_sin_f16(x); | ||
| 2562 | } | ||
| 2563 | #else | ||
| 2564 | static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) { | ||
| 2565 | return simd_make_float16(__tg_sin(x.lo), __tg_sin(x.hi)); | ||
| 2566 | } | ||
| 2567 | #endif | ||
| 2568 | |||
| 2569 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2570 | extern simd_double2 _simd_sin_d2(simd_double2 x); | ||
| 2571 | static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) { | ||
| 2572 | return _simd_sin_d2(x); | ||
| 2573 | } | ||
| 2574 | #elif SIMD_LIBRARY_VERSION == 1 | ||
| 2575 | extern simd_double2 __sin_d2(simd_double2 x); | ||
| 2576 | static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) { | ||
| 2577 | return __sin_d2(x); | ||
| 2578 | } | ||
| 2579 | #else | ||
| 2580 | static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) { | ||
| 2581 | return simd_make_double2(sin(x.x), sin(x.y)); | ||
| 2582 | } | ||
| 2583 | #endif | ||
| 2584 | |||
| 2585 | static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x) { | ||
| 2586 | return simd_make_double3(__tg_sin(simd_make_double4(x))); | ||
| 2587 | } | ||
| 2588 | |||
| 2589 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2590 | extern simd_double4 _simd_sin_d4(simd_double4 x); | ||
| 2591 | static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) { | ||
| 2592 | return _simd_sin_d4(x); | ||
| 2593 | } | ||
| 2594 | #else | ||
| 2595 | static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) { | ||
| 2596 | return simd_make_double4(__tg_sin(x.lo), __tg_sin(x.hi)); | ||
| 2597 | } | ||
| 2598 | #endif | ||
| 2599 | |||
| 2600 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2601 | extern simd_double8 _simd_sin_d8(simd_double8 x); | ||
| 2602 | static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) { | ||
| 2603 | return _simd_sin_d8(x); | ||
| 2604 | } | ||
| 2605 | #else | ||
| 2606 | static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) { | ||
| 2607 | return simd_make_double8(__tg_sin(x.lo), __tg_sin(x.hi)); | ||
| 2608 | } | ||
| 2609 | #endif | ||
| 2610 | |||
| 2611 | static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x) { | ||
| 2612 | return simd_make_float2(__tg_cos(simd_make_float4(x))); | ||
| 2613 | } | ||
| 2614 | |||
| 2615 | static inline SIMD_CFUNC simd_float3 __tg_cos(simd_float3 x) { | ||
| 2616 | return simd_make_float3(__tg_cos(simd_make_float4(x))); | ||
| 2617 | } | ||
| 2618 | |||
| 2619 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2620 | extern simd_float4 _simd_cos_f4(simd_float4 x); | ||
| 2621 | static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) { | ||
| 2622 | return _simd_cos_f4(x); | ||
| 2623 | } | ||
| 2624 | #elif SIMD_LIBRARY_VERSION == 1 | ||
| 2625 | extern simd_float4 __cos_f4(simd_float4 x); | ||
| 2626 | static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) { | ||
| 2627 | return __cos_f4(x); | ||
| 2628 | } | ||
| 2629 | #else | ||
| 2630 | static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) { | ||
| 2631 | return simd_make_float4(cos(x.x), cos(x.y), cos(x.z), cos(x.w)); | ||
| 2632 | } | ||
| 2633 | #endif | ||
| 2634 | |||
| 2635 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2636 | extern simd_float8 _simd_cos_f8(simd_float8 x); | ||
| 2637 | static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) { | ||
| 2638 | return _simd_cos_f8(x); | ||
| 2639 | } | ||
| 2640 | #else | ||
| 2641 | static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) { | ||
| 2642 | return simd_make_float8(__tg_cos(x.lo), __tg_cos(x.hi)); | ||
| 2643 | } | ||
| 2644 | #endif | ||
| 2645 | |||
| 2646 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2647 | extern simd_float16 _simd_cos_f16(simd_float16 x); | ||
| 2648 | static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) { | ||
| 2649 | return _simd_cos_f16(x); | ||
| 2650 | } | ||
| 2651 | #else | ||
| 2652 | static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) { | ||
| 2653 | return simd_make_float16(__tg_cos(x.lo), __tg_cos(x.hi)); | ||
| 2654 | } | ||
| 2655 | #endif | ||
| 2656 | |||
| 2657 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2658 | extern simd_double2 _simd_cos_d2(simd_double2 x); | ||
| 2659 | static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) { | ||
| 2660 | return _simd_cos_d2(x); | ||
| 2661 | } | ||
| 2662 | #elif SIMD_LIBRARY_VERSION == 1 | ||
| 2663 | extern simd_double2 __cos_d2(simd_double2 x); | ||
| 2664 | static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) { | ||
| 2665 | return __cos_d2(x); | ||
| 2666 | } | ||
| 2667 | #else | ||
| 2668 | static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) { | ||
| 2669 | return simd_make_double2(cos(x.x), cos(x.y)); | ||
| 2670 | } | ||
| 2671 | #endif | ||
| 2672 | |||
| 2673 | static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x) { | ||
| 2674 | return simd_make_double3(__tg_cos(simd_make_double4(x))); | ||
| 2675 | } | ||
| 2676 | |||
| 2677 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2678 | extern simd_double4 _simd_cos_d4(simd_double4 x); | ||
| 2679 | static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) { | ||
| 2680 | return _simd_cos_d4(x); | ||
| 2681 | } | ||
| 2682 | #else | ||
| 2683 | static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) { | ||
| 2684 | return simd_make_double4(__tg_cos(x.lo), __tg_cos(x.hi)); | ||
| 2685 | } | ||
| 2686 | #endif | ||
| 2687 | |||
| 2688 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2689 | extern simd_double8 _simd_cos_d8(simd_double8 x); | ||
| 2690 | static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) { | ||
| 2691 | return _simd_cos_d8(x); | ||
| 2692 | } | ||
| 2693 | #else | ||
| 2694 | static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) { | ||
| 2695 | return simd_make_double8(__tg_cos(x.lo), __tg_cos(x.hi)); | ||
| 2696 | } | ||
| 2697 | #endif | ||
| 2698 | |||
| 2699 | |||
| 2700 | #pragma mark - acos implementation | ||
| 2701 | static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x) { | ||
| 2702 | return simd_make_float2(__tg_acos(simd_make_float4(x))); | ||
| 2703 | } | ||
| 2704 | |||
| 2705 | static inline SIMD_CFUNC simd_float3 __tg_acos(simd_float3 x) { | ||
| 2706 | return simd_make_float3(__tg_acos(simd_make_float4(x))); | ||
| 2707 | } | ||
| 2708 | |||
| 2709 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2710 | extern simd_float4 _simd_acos_f4(simd_float4 x); | ||
| 2711 | static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) { | ||
| 2712 | return _simd_acos_f4(x); | ||
| 2713 | } | ||
| 2714 | #else | ||
| 2715 | static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) { | ||
| 2716 | return simd_make_float4(acos(x.x), acos(x.y), acos(x.z), acos(x.w)); | ||
| 2717 | } | ||
| 2718 | #endif | ||
| 2719 | |||
| 2720 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2721 | extern simd_float8 _simd_acos_f8(simd_float8 x); | ||
| 2722 | static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) { | ||
| 2723 | return _simd_acos_f8(x); | ||
| 2724 | } | ||
| 2725 | #else | ||
| 2726 | static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) { | ||
| 2727 | return simd_make_float8(__tg_acos(x.lo), __tg_acos(x.hi)); | ||
| 2728 | } | ||
| 2729 | #endif | ||
| 2730 | |||
| 2731 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2732 | extern simd_float16 _simd_acos_f16(simd_float16 x); | ||
| 2733 | static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) { | ||
| 2734 | return _simd_acos_f16(x); | ||
| 2735 | } | ||
| 2736 | #else | ||
| 2737 | static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) { | ||
| 2738 | return simd_make_float16(__tg_acos(x.lo), __tg_acos(x.hi)); | ||
| 2739 | } | ||
| 2740 | #endif | ||
| 2741 | |||
| 2742 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2743 | extern simd_double2 _simd_acos_d2(simd_double2 x); | ||
| 2744 | static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) { | ||
| 2745 | return _simd_acos_d2(x); | ||
| 2746 | } | ||
| 2747 | #else | ||
| 2748 | static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) { | ||
| 2749 | return simd_make_double2(acos(x.x), acos(x.y)); | ||
| 2750 | } | ||
| 2751 | #endif | ||
| 2752 | |||
| 2753 | static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x) { | ||
| 2754 | return simd_make_double3(__tg_acos(simd_make_double4(x))); | ||
| 2755 | } | ||
| 2756 | |||
| 2757 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2758 | extern simd_double4 _simd_acos_d4(simd_double4 x); | ||
| 2759 | static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) { | ||
| 2760 | return _simd_acos_d4(x); | ||
| 2761 | } | ||
| 2762 | #else | ||
| 2763 | static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) { | ||
| 2764 | return simd_make_double4(__tg_acos(x.lo), __tg_acos(x.hi)); | ||
| 2765 | } | ||
| 2766 | #endif | ||
| 2767 | |||
| 2768 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2769 | extern simd_double8 _simd_acos_d8(simd_double8 x); | ||
| 2770 | static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) { | ||
| 2771 | return _simd_acos_d8(x); | ||
| 2772 | } | ||
| 2773 | #else | ||
| 2774 | static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) { | ||
| 2775 | return simd_make_double8(__tg_acos(x.lo), __tg_acos(x.hi)); | ||
| 2776 | } | ||
| 2777 | #endif | ||
| 2778 | |||
| 2779 | #pragma mark - asin implementation | ||
| 2780 | static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x) { | ||
| 2781 | return simd_make_float2(__tg_asin(simd_make_float4(x))); | ||
| 2782 | } | ||
| 2783 | |||
| 2784 | static inline SIMD_CFUNC simd_float3 __tg_asin(simd_float3 x) { | ||
| 2785 | return simd_make_float3(__tg_asin(simd_make_float4(x))); | ||
| 2786 | } | ||
| 2787 | |||
| 2788 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2789 | extern simd_float4 _simd_asin_f4(simd_float4 x); | ||
| 2790 | static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) { | ||
| 2791 | return _simd_asin_f4(x); | ||
| 2792 | } | ||
| 2793 | #else | ||
| 2794 | static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) { | ||
| 2795 | return simd_make_float4(asin(x.x), asin(x.y), asin(x.z), asin(x.w)); | ||
| 2796 | } | ||
| 2797 | #endif | ||
| 2798 | |||
| 2799 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2800 | extern simd_float8 _simd_asin_f8(simd_float8 x); | ||
| 2801 | static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) { | ||
| 2802 | return _simd_asin_f8(x); | ||
| 2803 | } | ||
| 2804 | #else | ||
| 2805 | static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) { | ||
| 2806 | return simd_make_float8(__tg_asin(x.lo), __tg_asin(x.hi)); | ||
| 2807 | } | ||
| 2808 | #endif | ||
| 2809 | |||
| 2810 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2811 | extern simd_float16 _simd_asin_f16(simd_float16 x); | ||
| 2812 | static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) { | ||
| 2813 | return _simd_asin_f16(x); | ||
| 2814 | } | ||
| 2815 | #else | ||
| 2816 | static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) { | ||
| 2817 | return simd_make_float16(__tg_asin(x.lo), __tg_asin(x.hi)); | ||
| 2818 | } | ||
| 2819 | #endif | ||
| 2820 | |||
| 2821 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2822 | extern simd_double2 _simd_asin_d2(simd_double2 x); | ||
| 2823 | static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) { | ||
| 2824 | return _simd_asin_d2(x); | ||
| 2825 | } | ||
| 2826 | #else | ||
| 2827 | static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) { | ||
| 2828 | return simd_make_double2(asin(x.x), asin(x.y)); | ||
| 2829 | } | ||
| 2830 | #endif | ||
| 2831 | |||
| 2832 | static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x) { | ||
| 2833 | return simd_make_double3(__tg_asin(simd_make_double4(x))); | ||
| 2834 | } | ||
| 2835 | |||
| 2836 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2837 | extern simd_double4 _simd_asin_d4(simd_double4 x); | ||
| 2838 | static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) { | ||
| 2839 | return _simd_asin_d4(x); | ||
| 2840 | } | ||
| 2841 | #else | ||
| 2842 | static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) { | ||
| 2843 | return simd_make_double4(__tg_asin(x.lo), __tg_asin(x.hi)); | ||
| 2844 | } | ||
| 2845 | #endif | ||
| 2846 | |||
| 2847 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2848 | extern simd_double8 _simd_asin_d8(simd_double8 x); | ||
| 2849 | static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) { | ||
| 2850 | return _simd_asin_d8(x); | ||
| 2851 | } | ||
| 2852 | #else | ||
| 2853 | static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) { | ||
| 2854 | return simd_make_double8(__tg_asin(x.lo), __tg_asin(x.hi)); | ||
| 2855 | } | ||
| 2856 | #endif | ||
| 2857 | |||
| 2858 | #pragma mark - atan implementation | ||
| 2859 | static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x) { | ||
| 2860 | return simd_make_float2(__tg_atan(simd_make_float4(x))); | ||
| 2861 | } | ||
| 2862 | |||
| 2863 | static inline SIMD_CFUNC simd_float3 __tg_atan(simd_float3 x) { | ||
| 2864 | return simd_make_float3(__tg_atan(simd_make_float4(x))); | ||
| 2865 | } | ||
| 2866 | |||
| 2867 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2868 | extern simd_float4 _simd_atan_f4(simd_float4 x); | ||
| 2869 | static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) { | ||
| 2870 | return _simd_atan_f4(x); | ||
| 2871 | } | ||
| 2872 | #else | ||
| 2873 | static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) { | ||
| 2874 | return simd_make_float4(atan(x.x), atan(x.y), atan(x.z), atan(x.w)); | ||
| 2875 | } | ||
| 2876 | #endif | ||
| 2877 | |||
| 2878 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2879 | extern simd_float8 _simd_atan_f8(simd_float8 x); | ||
| 2880 | static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) { | ||
| 2881 | return _simd_atan_f8(x); | ||
| 2882 | } | ||
| 2883 | #else | ||
| 2884 | static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) { | ||
| 2885 | return simd_make_float8(__tg_atan(x.lo), __tg_atan(x.hi)); | ||
| 2886 | } | ||
| 2887 | #endif | ||
| 2888 | |||
| 2889 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2890 | extern simd_float16 _simd_atan_f16(simd_float16 x); | ||
| 2891 | static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) { | ||
| 2892 | return _simd_atan_f16(x); | ||
| 2893 | } | ||
| 2894 | #else | ||
| 2895 | static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) { | ||
| 2896 | return simd_make_float16(__tg_atan(x.lo), __tg_atan(x.hi)); | ||
| 2897 | } | ||
| 2898 | #endif | ||
| 2899 | |||
| 2900 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2901 | extern simd_double2 _simd_atan_d2(simd_double2 x); | ||
| 2902 | static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) { | ||
| 2903 | return _simd_atan_d2(x); | ||
| 2904 | } | ||
| 2905 | #else | ||
| 2906 | static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) { | ||
| 2907 | return simd_make_double2(atan(x.x), atan(x.y)); | ||
| 2908 | } | ||
| 2909 | #endif | ||
| 2910 | |||
| 2911 | static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x) { | ||
| 2912 | return simd_make_double3(__tg_atan(simd_make_double4(x))); | ||
| 2913 | } | ||
| 2914 | |||
| 2915 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2916 | extern simd_double4 _simd_atan_d4(simd_double4 x); | ||
| 2917 | static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) { | ||
| 2918 | return _simd_atan_d4(x); | ||
| 2919 | } | ||
| 2920 | #else | ||
| 2921 | static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) { | ||
| 2922 | return simd_make_double4(__tg_atan(x.lo), __tg_atan(x.hi)); | ||
| 2923 | } | ||
| 2924 | #endif | ||
| 2925 | |||
| 2926 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2927 | extern simd_double8 _simd_atan_d8(simd_double8 x); | ||
| 2928 | static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) { | ||
| 2929 | return _simd_atan_d8(x); | ||
| 2930 | } | ||
| 2931 | #else | ||
| 2932 | static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) { | ||
| 2933 | return simd_make_double8(__tg_atan(x.lo), __tg_atan(x.hi)); | ||
| 2934 | } | ||
| 2935 | #endif | ||
| 2936 | |||
| 2937 | #pragma mark - tan implementation | ||
| 2938 | static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x) { | ||
| 2939 | return simd_make_float2(__tg_tan(simd_make_float4(x))); | ||
| 2940 | } | ||
| 2941 | |||
| 2942 | static inline SIMD_CFUNC simd_float3 __tg_tan(simd_float3 x) { | ||
| 2943 | return simd_make_float3(__tg_tan(simd_make_float4(x))); | ||
| 2944 | } | ||
| 2945 | |||
| 2946 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2947 | extern simd_float4 _simd_tan_f4(simd_float4 x); | ||
| 2948 | static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) { | ||
| 2949 | return _simd_tan_f4(x); | ||
| 2950 | } | ||
| 2951 | #else | ||
| 2952 | static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) { | ||
| 2953 | return simd_make_float4(tan(x.x), tan(x.y), tan(x.z), tan(x.w)); | ||
| 2954 | } | ||
| 2955 | #endif | ||
| 2956 | |||
| 2957 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2958 | extern simd_float8 _simd_tan_f8(simd_float8 x); | ||
| 2959 | static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) { | ||
| 2960 | return _simd_tan_f8(x); | ||
| 2961 | } | ||
| 2962 | #else | ||
| 2963 | static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) { | ||
| 2964 | return simd_make_float8(__tg_tan(x.lo), __tg_tan(x.hi)); | ||
| 2965 | } | ||
| 2966 | #endif | ||
| 2967 | |||
| 2968 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 2969 | extern simd_float16 _simd_tan_f16(simd_float16 x); | ||
| 2970 | static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) { | ||
| 2971 | return _simd_tan_f16(x); | ||
| 2972 | } | ||
| 2973 | #else | ||
| 2974 | static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) { | ||
| 2975 | return simd_make_float16(__tg_tan(x.lo), __tg_tan(x.hi)); | ||
| 2976 | } | ||
| 2977 | #endif | ||
| 2978 | |||
| 2979 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 2980 | extern simd_double2 _simd_tan_d2(simd_double2 x); | ||
| 2981 | static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) { | ||
| 2982 | return _simd_tan_d2(x); | ||
| 2983 | } | ||
| 2984 | #else | ||
| 2985 | static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) { | ||
| 2986 | return simd_make_double2(tan(x.x), tan(x.y)); | ||
| 2987 | } | ||
| 2988 | #endif | ||
| 2989 | |||
| 2990 | static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x) { | ||
| 2991 | return simd_make_double3(__tg_tan(simd_make_double4(x))); | ||
| 2992 | } | ||
| 2993 | |||
| 2994 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 2995 | extern simd_double4 _simd_tan_d4(simd_double4 x); | ||
| 2996 | static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) { | ||
| 2997 | return _simd_tan_d4(x); | ||
| 2998 | } | ||
| 2999 | #else | ||
| 3000 | static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) { | ||
| 3001 | return simd_make_double4(__tg_tan(x.lo), __tg_tan(x.hi)); | ||
| 3002 | } | ||
| 3003 | #endif | ||
| 3004 | |||
| 3005 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3006 | extern simd_double8 _simd_tan_d8(simd_double8 x); | ||
| 3007 | static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) { | ||
| 3008 | return _simd_tan_d8(x); | ||
| 3009 | } | ||
| 3010 | #else | ||
| 3011 | static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) { | ||
| 3012 | return simd_make_double8(__tg_tan(x.lo), __tg_tan(x.hi)); | ||
| 3013 | } | ||
| 3014 | #endif | ||
| 3015 | |||
| 3016 | #pragma mark - cospi implementation | ||
| 3017 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 3018 | static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x) { | ||
| 3019 | return simd_make_float2(__tg_cospi(simd_make_float4(x))); | ||
| 3020 | } | ||
| 3021 | |||
| 3022 | static inline SIMD_CFUNC simd_float3 __tg_cospi(simd_float3 x) { | ||
| 3023 | return simd_make_float3(__tg_cospi(simd_make_float4(x))); | ||
| 3024 | } | ||
| 3025 | |||
| 3026 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3027 | extern simd_float4 _simd_cospi_f4(simd_float4 x); | ||
| 3028 | static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) { | ||
| 3029 | return _simd_cospi_f4(x); | ||
| 3030 | } | ||
| 3031 | #else | ||
| 3032 | static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) { | ||
| 3033 | return simd_make_float4(__cospi(x.x), __cospi(x.y), __cospi(x.z), __cospi(x.w)); | ||
| 3034 | } | ||
| 3035 | #endif | ||
| 3036 | |||
| 3037 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3038 | extern simd_float8 _simd_cospi_f8(simd_float8 x); | ||
| 3039 | static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) { | ||
| 3040 | return _simd_cospi_f8(x); | ||
| 3041 | } | ||
| 3042 | #else | ||
| 3043 | static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) { | ||
| 3044 | return simd_make_float8(__tg_cospi(x.lo), __tg_cospi(x.hi)); | ||
| 3045 | } | ||
| 3046 | #endif | ||
| 3047 | |||
| 3048 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3049 | extern simd_float16 _simd_cospi_f16(simd_float16 x); | ||
| 3050 | static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) { | ||
| 3051 | return _simd_cospi_f16(x); | ||
| 3052 | } | ||
| 3053 | #else | ||
| 3054 | static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) { | ||
| 3055 | return simd_make_float16(__tg_cospi(x.lo), __tg_cospi(x.hi)); | ||
| 3056 | } | ||
| 3057 | #endif | ||
| 3058 | |||
| 3059 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3060 | extern simd_double2 _simd_cospi_d2(simd_double2 x); | ||
| 3061 | static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) { | ||
| 3062 | return _simd_cospi_d2(x); | ||
| 3063 | } | ||
| 3064 | #else | ||
| 3065 | static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) { | ||
| 3066 | return simd_make_double2(__cospi(x.x), __cospi(x.y)); | ||
| 3067 | } | ||
| 3068 | #endif | ||
| 3069 | |||
| 3070 | static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x) { | ||
| 3071 | return simd_make_double3(__tg_cospi(simd_make_double4(x))); | ||
| 3072 | } | ||
| 3073 | |||
| 3074 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3075 | extern simd_double4 _simd_cospi_d4(simd_double4 x); | ||
| 3076 | static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) { | ||
| 3077 | return _simd_cospi_d4(x); | ||
| 3078 | } | ||
| 3079 | #else | ||
| 3080 | static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) { | ||
| 3081 | return simd_make_double4(__tg_cospi(x.lo), __tg_cospi(x.hi)); | ||
| 3082 | } | ||
| 3083 | #endif | ||
| 3084 | |||
| 3085 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3086 | extern simd_double8 _simd_cospi_d8(simd_double8 x); | ||
| 3087 | static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) { | ||
| 3088 | return _simd_cospi_d8(x); | ||
| 3089 | } | ||
| 3090 | #else | ||
| 3091 | static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) { | ||
| 3092 | return simd_make_double8(__tg_cospi(x.lo), __tg_cospi(x.hi)); | ||
| 3093 | } | ||
| 3094 | #endif | ||
| 3095 | |||
| 3096 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 3097 | #pragma mark - sinpi implementation | ||
| 3098 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 3099 | static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x) { | ||
| 3100 | return simd_make_float2(__tg_sinpi(simd_make_float4(x))); | ||
| 3101 | } | ||
| 3102 | |||
| 3103 | static inline SIMD_CFUNC simd_float3 __tg_sinpi(simd_float3 x) { | ||
| 3104 | return simd_make_float3(__tg_sinpi(simd_make_float4(x))); | ||
| 3105 | } | ||
| 3106 | |||
| 3107 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3108 | extern simd_float4 _simd_sinpi_f4(simd_float4 x); | ||
| 3109 | static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) { | ||
| 3110 | return _simd_sinpi_f4(x); | ||
| 3111 | } | ||
| 3112 | #else | ||
| 3113 | static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) { | ||
| 3114 | return simd_make_float4(__sinpi(x.x), __sinpi(x.y), __sinpi(x.z), __sinpi(x.w)); | ||
| 3115 | } | ||
| 3116 | #endif | ||
| 3117 | |||
| 3118 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3119 | extern simd_float8 _simd_sinpi_f8(simd_float8 x); | ||
| 3120 | static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) { | ||
| 3121 | return _simd_sinpi_f8(x); | ||
| 3122 | } | ||
| 3123 | #else | ||
| 3124 | static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) { | ||
| 3125 | return simd_make_float8(__tg_sinpi(x.lo), __tg_sinpi(x.hi)); | ||
| 3126 | } | ||
| 3127 | #endif | ||
| 3128 | |||
| 3129 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3130 | extern simd_float16 _simd_sinpi_f16(simd_float16 x); | ||
| 3131 | static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) { | ||
| 3132 | return _simd_sinpi_f16(x); | ||
| 3133 | } | ||
| 3134 | #else | ||
| 3135 | static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) { | ||
| 3136 | return simd_make_float16(__tg_sinpi(x.lo), __tg_sinpi(x.hi)); | ||
| 3137 | } | ||
| 3138 | #endif | ||
| 3139 | |||
| 3140 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3141 | extern simd_double2 _simd_sinpi_d2(simd_double2 x); | ||
| 3142 | static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) { | ||
| 3143 | return _simd_sinpi_d2(x); | ||
| 3144 | } | ||
| 3145 | #else | ||
| 3146 | static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) { | ||
| 3147 | return simd_make_double2(__sinpi(x.x), __sinpi(x.y)); | ||
| 3148 | } | ||
| 3149 | #endif | ||
| 3150 | |||
| 3151 | static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x) { | ||
| 3152 | return simd_make_double3(__tg_sinpi(simd_make_double4(x))); | ||
| 3153 | } | ||
| 3154 | |||
| 3155 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3156 | extern simd_double4 _simd_sinpi_d4(simd_double4 x); | ||
| 3157 | static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) { | ||
| 3158 | return _simd_sinpi_d4(x); | ||
| 3159 | } | ||
| 3160 | #else | ||
| 3161 | static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) { | ||
| 3162 | return simd_make_double4(__tg_sinpi(x.lo), __tg_sinpi(x.hi)); | ||
| 3163 | } | ||
| 3164 | #endif | ||
| 3165 | |||
| 3166 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3167 | extern simd_double8 _simd_sinpi_d8(simd_double8 x); | ||
| 3168 | static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) { | ||
| 3169 | return _simd_sinpi_d8(x); | ||
| 3170 | } | ||
| 3171 | #else | ||
| 3172 | static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) { | ||
| 3173 | return simd_make_double8(__tg_sinpi(x.lo), __tg_sinpi(x.hi)); | ||
| 3174 | } | ||
| 3175 | #endif | ||
| 3176 | |||
| 3177 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 3178 | #pragma mark - tanpi implementation | ||
| 3179 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 3180 | static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x) { | ||
| 3181 | return simd_make_float2(__tg_tanpi(simd_make_float4(x))); | ||
| 3182 | } | ||
| 3183 | |||
| 3184 | static inline SIMD_CFUNC simd_float3 __tg_tanpi(simd_float3 x) { | ||
| 3185 | return simd_make_float3(__tg_tanpi(simd_make_float4(x))); | ||
| 3186 | } | ||
| 3187 | |||
| 3188 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3189 | extern simd_float4 _simd_tanpi_f4(simd_float4 x); | ||
| 3190 | static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) { | ||
| 3191 | return _simd_tanpi_f4(x); | ||
| 3192 | } | ||
| 3193 | #else | ||
| 3194 | static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) { | ||
| 3195 | return simd_make_float4(__tanpi(x.x), __tanpi(x.y), __tanpi(x.z), __tanpi(x.w)); | ||
| 3196 | } | ||
| 3197 | #endif | ||
| 3198 | |||
| 3199 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3200 | extern simd_float8 _simd_tanpi_f8(simd_float8 x); | ||
| 3201 | static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) { | ||
| 3202 | return _simd_tanpi_f8(x); | ||
| 3203 | } | ||
| 3204 | #else | ||
| 3205 | static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) { | ||
| 3206 | return simd_make_float8(__tg_tanpi(x.lo), __tg_tanpi(x.hi)); | ||
| 3207 | } | ||
| 3208 | #endif | ||
| 3209 | |||
| 3210 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3211 | extern simd_float16 _simd_tanpi_f16(simd_float16 x); | ||
| 3212 | static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) { | ||
| 3213 | return _simd_tanpi_f16(x); | ||
| 3214 | } | ||
| 3215 | #else | ||
| 3216 | static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) { | ||
| 3217 | return simd_make_float16(__tg_tanpi(x.lo), __tg_tanpi(x.hi)); | ||
| 3218 | } | ||
| 3219 | #endif | ||
| 3220 | |||
| 3221 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3222 | extern simd_double2 _simd_tanpi_d2(simd_double2 x); | ||
| 3223 | static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) { | ||
| 3224 | return _simd_tanpi_d2(x); | ||
| 3225 | } | ||
| 3226 | #else | ||
| 3227 | static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) { | ||
| 3228 | return simd_make_double2(__tanpi(x.x), __tanpi(x.y)); | ||
| 3229 | } | ||
| 3230 | #endif | ||
| 3231 | |||
| 3232 | static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x) { | ||
| 3233 | return simd_make_double3(__tg_tanpi(simd_make_double4(x))); | ||
| 3234 | } | ||
| 3235 | |||
| 3236 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3237 | extern simd_double4 _simd_tanpi_d4(simd_double4 x); | ||
| 3238 | static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) { | ||
| 3239 | return _simd_tanpi_d4(x); | ||
| 3240 | } | ||
| 3241 | #else | ||
| 3242 | static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) { | ||
| 3243 | return simd_make_double4(__tg_tanpi(x.lo), __tg_tanpi(x.hi)); | ||
| 3244 | } | ||
| 3245 | #endif | ||
| 3246 | |||
| 3247 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3248 | extern simd_double8 _simd_tanpi_d8(simd_double8 x); | ||
| 3249 | static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) { | ||
| 3250 | return _simd_tanpi_d8(x); | ||
| 3251 | } | ||
| 3252 | #else | ||
| 3253 | static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) { | ||
| 3254 | return simd_make_double8(__tg_tanpi(x.lo), __tg_tanpi(x.hi)); | ||
| 3255 | } | ||
| 3256 | #endif | ||
| 3257 | |||
| 3258 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 3259 | #pragma mark - acosh implementation | ||
| 3260 | static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x) { | ||
| 3261 | return simd_make_float2(__tg_acosh(simd_make_float4(x))); | ||
| 3262 | } | ||
| 3263 | |||
| 3264 | static inline SIMD_CFUNC simd_float3 __tg_acosh(simd_float3 x) { | ||
| 3265 | return simd_make_float3(__tg_acosh(simd_make_float4(x))); | ||
| 3266 | } | ||
| 3267 | |||
| 3268 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3269 | extern simd_float4 _simd_acosh_f4(simd_float4 x); | ||
| 3270 | static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) { | ||
| 3271 | return _simd_acosh_f4(x); | ||
| 3272 | } | ||
| 3273 | #else | ||
| 3274 | static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) { | ||
| 3275 | return simd_make_float4(acosh(x.x), acosh(x.y), acosh(x.z), acosh(x.w)); | ||
| 3276 | } | ||
| 3277 | #endif | ||
| 3278 | |||
| 3279 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3280 | extern simd_float8 _simd_acosh_f8(simd_float8 x); | ||
| 3281 | static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) { | ||
| 3282 | return _simd_acosh_f8(x); | ||
| 3283 | } | ||
| 3284 | #else | ||
| 3285 | static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) { | ||
| 3286 | return simd_make_float8(__tg_acosh(x.lo), __tg_acosh(x.hi)); | ||
| 3287 | } | ||
| 3288 | #endif | ||
| 3289 | |||
| 3290 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3291 | extern simd_float16 _simd_acosh_f16(simd_float16 x); | ||
| 3292 | static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) { | ||
| 3293 | return _simd_acosh_f16(x); | ||
| 3294 | } | ||
| 3295 | #else | ||
| 3296 | static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) { | ||
| 3297 | return simd_make_float16(__tg_acosh(x.lo), __tg_acosh(x.hi)); | ||
| 3298 | } | ||
| 3299 | #endif | ||
| 3300 | |||
| 3301 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3302 | extern simd_double2 _simd_acosh_d2(simd_double2 x); | ||
| 3303 | static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) { | ||
| 3304 | return _simd_acosh_d2(x); | ||
| 3305 | } | ||
| 3306 | #else | ||
| 3307 | static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) { | ||
| 3308 | return simd_make_double2(acosh(x.x), acosh(x.y)); | ||
| 3309 | } | ||
| 3310 | #endif | ||
| 3311 | |||
| 3312 | static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x) { | ||
| 3313 | return simd_make_double3(__tg_acosh(simd_make_double4(x))); | ||
| 3314 | } | ||
| 3315 | |||
| 3316 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3317 | extern simd_double4 _simd_acosh_d4(simd_double4 x); | ||
| 3318 | static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) { | ||
| 3319 | return _simd_acosh_d4(x); | ||
| 3320 | } | ||
| 3321 | #else | ||
| 3322 | static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) { | ||
| 3323 | return simd_make_double4(__tg_acosh(x.lo), __tg_acosh(x.hi)); | ||
| 3324 | } | ||
| 3325 | #endif | ||
| 3326 | |||
| 3327 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3328 | extern simd_double8 _simd_acosh_d8(simd_double8 x); | ||
| 3329 | static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) { | ||
| 3330 | return _simd_acosh_d8(x); | ||
| 3331 | } | ||
| 3332 | #else | ||
| 3333 | static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) { | ||
| 3334 | return simd_make_double8(__tg_acosh(x.lo), __tg_acosh(x.hi)); | ||
| 3335 | } | ||
| 3336 | #endif | ||
| 3337 | |||
| 3338 | #pragma mark - asinh implementation | ||
| 3339 | static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x) { | ||
| 3340 | return simd_make_float2(__tg_asinh(simd_make_float4(x))); | ||
| 3341 | } | ||
| 3342 | |||
| 3343 | static inline SIMD_CFUNC simd_float3 __tg_asinh(simd_float3 x) { | ||
| 3344 | return simd_make_float3(__tg_asinh(simd_make_float4(x))); | ||
| 3345 | } | ||
| 3346 | |||
| 3347 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3348 | extern simd_float4 _simd_asinh_f4(simd_float4 x); | ||
| 3349 | static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) { | ||
| 3350 | return _simd_asinh_f4(x); | ||
| 3351 | } | ||
| 3352 | #else | ||
| 3353 | static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) { | ||
| 3354 | return simd_make_float4(asinh(x.x), asinh(x.y), asinh(x.z), asinh(x.w)); | ||
| 3355 | } | ||
| 3356 | #endif | ||
| 3357 | |||
| 3358 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3359 | extern simd_float8 _simd_asinh_f8(simd_float8 x); | ||
| 3360 | static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) { | ||
| 3361 | return _simd_asinh_f8(x); | ||
| 3362 | } | ||
| 3363 | #else | ||
| 3364 | static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) { | ||
| 3365 | return simd_make_float8(__tg_asinh(x.lo), __tg_asinh(x.hi)); | ||
| 3366 | } | ||
| 3367 | #endif | ||
| 3368 | |||
| 3369 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3370 | extern simd_float16 _simd_asinh_f16(simd_float16 x); | ||
| 3371 | static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) { | ||
| 3372 | return _simd_asinh_f16(x); | ||
| 3373 | } | ||
| 3374 | #else | ||
| 3375 | static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) { | ||
| 3376 | return simd_make_float16(__tg_asinh(x.lo), __tg_asinh(x.hi)); | ||
| 3377 | } | ||
| 3378 | #endif | ||
| 3379 | |||
| 3380 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3381 | extern simd_double2 _simd_asinh_d2(simd_double2 x); | ||
| 3382 | static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) { | ||
| 3383 | return _simd_asinh_d2(x); | ||
| 3384 | } | ||
| 3385 | #else | ||
| 3386 | static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) { | ||
| 3387 | return simd_make_double2(asinh(x.x), asinh(x.y)); | ||
| 3388 | } | ||
| 3389 | #endif | ||
| 3390 | |||
| 3391 | static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x) { | ||
| 3392 | return simd_make_double3(__tg_asinh(simd_make_double4(x))); | ||
| 3393 | } | ||
| 3394 | |||
| 3395 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3396 | extern simd_double4 _simd_asinh_d4(simd_double4 x); | ||
| 3397 | static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) { | ||
| 3398 | return _simd_asinh_d4(x); | ||
| 3399 | } | ||
| 3400 | #else | ||
| 3401 | static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) { | ||
| 3402 | return simd_make_double4(__tg_asinh(x.lo), __tg_asinh(x.hi)); | ||
| 3403 | } | ||
| 3404 | #endif | ||
| 3405 | |||
| 3406 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3407 | extern simd_double8 _simd_asinh_d8(simd_double8 x); | ||
| 3408 | static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) { | ||
| 3409 | return _simd_asinh_d8(x); | ||
| 3410 | } | ||
| 3411 | #else | ||
| 3412 | static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) { | ||
| 3413 | return simd_make_double8(__tg_asinh(x.lo), __tg_asinh(x.hi)); | ||
| 3414 | } | ||
| 3415 | #endif | ||
| 3416 | |||
| 3417 | #pragma mark - atanh implementation | ||
| 3418 | static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x) { | ||
| 3419 | return simd_make_float2(__tg_atanh(simd_make_float4(x))); | ||
| 3420 | } | ||
| 3421 | |||
| 3422 | static inline SIMD_CFUNC simd_float3 __tg_atanh(simd_float3 x) { | ||
| 3423 | return simd_make_float3(__tg_atanh(simd_make_float4(x))); | ||
| 3424 | } | ||
| 3425 | |||
| 3426 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3427 | extern simd_float4 _simd_atanh_f4(simd_float4 x); | ||
| 3428 | static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) { | ||
| 3429 | return _simd_atanh_f4(x); | ||
| 3430 | } | ||
| 3431 | #else | ||
| 3432 | static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) { | ||
| 3433 | return simd_make_float4(atanh(x.x), atanh(x.y), atanh(x.z), atanh(x.w)); | ||
| 3434 | } | ||
| 3435 | #endif | ||
| 3436 | |||
| 3437 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3438 | extern simd_float8 _simd_atanh_f8(simd_float8 x); | ||
| 3439 | static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) { | ||
| 3440 | return _simd_atanh_f8(x); | ||
| 3441 | } | ||
| 3442 | #else | ||
| 3443 | static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) { | ||
| 3444 | return simd_make_float8(__tg_atanh(x.lo), __tg_atanh(x.hi)); | ||
| 3445 | } | ||
| 3446 | #endif | ||
| 3447 | |||
| 3448 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3449 | extern simd_float16 _simd_atanh_f16(simd_float16 x); | ||
| 3450 | static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) { | ||
| 3451 | return _simd_atanh_f16(x); | ||
| 3452 | } | ||
| 3453 | #else | ||
| 3454 | static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) { | ||
| 3455 | return simd_make_float16(__tg_atanh(x.lo), __tg_atanh(x.hi)); | ||
| 3456 | } | ||
| 3457 | #endif | ||
| 3458 | |||
| 3459 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3460 | extern simd_double2 _simd_atanh_d2(simd_double2 x); | ||
| 3461 | static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) { | ||
| 3462 | return _simd_atanh_d2(x); | ||
| 3463 | } | ||
| 3464 | #else | ||
| 3465 | static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) { | ||
| 3466 | return simd_make_double2(atanh(x.x), atanh(x.y)); | ||
| 3467 | } | ||
| 3468 | #endif | ||
| 3469 | |||
| 3470 | static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x) { | ||
| 3471 | return simd_make_double3(__tg_atanh(simd_make_double4(x))); | ||
| 3472 | } | ||
| 3473 | |||
| 3474 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3475 | extern simd_double4 _simd_atanh_d4(simd_double4 x); | ||
| 3476 | static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) { | ||
| 3477 | return _simd_atanh_d4(x); | ||
| 3478 | } | ||
| 3479 | #else | ||
| 3480 | static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) { | ||
| 3481 | return simd_make_double4(__tg_atanh(x.lo), __tg_atanh(x.hi)); | ||
| 3482 | } | ||
| 3483 | #endif | ||
| 3484 | |||
| 3485 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3486 | extern simd_double8 _simd_atanh_d8(simd_double8 x); | ||
| 3487 | static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) { | ||
| 3488 | return _simd_atanh_d8(x); | ||
| 3489 | } | ||
| 3490 | #else | ||
| 3491 | static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) { | ||
| 3492 | return simd_make_double8(__tg_atanh(x.lo), __tg_atanh(x.hi)); | ||
| 3493 | } | ||
| 3494 | #endif | ||
| 3495 | |||
| 3496 | #pragma mark - cosh implementation | ||
| 3497 | static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x) { | ||
| 3498 | return simd_make_float2(__tg_cosh(simd_make_float4(x))); | ||
| 3499 | } | ||
| 3500 | |||
| 3501 | static inline SIMD_CFUNC simd_float3 __tg_cosh(simd_float3 x) { | ||
| 3502 | return simd_make_float3(__tg_cosh(simd_make_float4(x))); | ||
| 3503 | } | ||
| 3504 | |||
| 3505 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3506 | extern simd_float4 _simd_cosh_f4(simd_float4 x); | ||
| 3507 | static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) { | ||
| 3508 | return _simd_cosh_f4(x); | ||
| 3509 | } | ||
| 3510 | #else | ||
| 3511 | static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) { | ||
| 3512 | return simd_make_float4(cosh(x.x), cosh(x.y), cosh(x.z), cosh(x.w)); | ||
| 3513 | } | ||
| 3514 | #endif | ||
| 3515 | |||
| 3516 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3517 | extern simd_float8 _simd_cosh_f8(simd_float8 x); | ||
| 3518 | static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) { | ||
| 3519 | return _simd_cosh_f8(x); | ||
| 3520 | } | ||
| 3521 | #else | ||
| 3522 | static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) { | ||
| 3523 | return simd_make_float8(__tg_cosh(x.lo), __tg_cosh(x.hi)); | ||
| 3524 | } | ||
| 3525 | #endif | ||
| 3526 | |||
| 3527 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3528 | extern simd_float16 _simd_cosh_f16(simd_float16 x); | ||
| 3529 | static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) { | ||
| 3530 | return _simd_cosh_f16(x); | ||
| 3531 | } | ||
| 3532 | #else | ||
| 3533 | static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) { | ||
| 3534 | return simd_make_float16(__tg_cosh(x.lo), __tg_cosh(x.hi)); | ||
| 3535 | } | ||
| 3536 | #endif | ||
| 3537 | |||
| 3538 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3539 | extern simd_double2 _simd_cosh_d2(simd_double2 x); | ||
| 3540 | static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) { | ||
| 3541 | return _simd_cosh_d2(x); | ||
| 3542 | } | ||
| 3543 | #else | ||
| 3544 | static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) { | ||
| 3545 | return simd_make_double2(cosh(x.x), cosh(x.y)); | ||
| 3546 | } | ||
| 3547 | #endif | ||
| 3548 | |||
| 3549 | static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x) { | ||
| 3550 | return simd_make_double3(__tg_cosh(simd_make_double4(x))); | ||
| 3551 | } | ||
| 3552 | |||
| 3553 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3554 | extern simd_double4 _simd_cosh_d4(simd_double4 x); | ||
| 3555 | static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) { | ||
| 3556 | return _simd_cosh_d4(x); | ||
| 3557 | } | ||
| 3558 | #else | ||
| 3559 | static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) { | ||
| 3560 | return simd_make_double4(__tg_cosh(x.lo), __tg_cosh(x.hi)); | ||
| 3561 | } | ||
| 3562 | #endif | ||
| 3563 | |||
| 3564 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3565 | extern simd_double8 _simd_cosh_d8(simd_double8 x); | ||
| 3566 | static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) { | ||
| 3567 | return _simd_cosh_d8(x); | ||
| 3568 | } | ||
| 3569 | #else | ||
| 3570 | static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) { | ||
| 3571 | return simd_make_double8(__tg_cosh(x.lo), __tg_cosh(x.hi)); | ||
| 3572 | } | ||
| 3573 | #endif | ||
| 3574 | |||
| 3575 | #pragma mark - sinh implementation | ||
| 3576 | static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x) { | ||
| 3577 | return simd_make_float2(__tg_sinh(simd_make_float4(x))); | ||
| 3578 | } | ||
| 3579 | |||
| 3580 | static inline SIMD_CFUNC simd_float3 __tg_sinh(simd_float3 x) { | ||
| 3581 | return simd_make_float3(__tg_sinh(simd_make_float4(x))); | ||
| 3582 | } | ||
| 3583 | |||
| 3584 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3585 | extern simd_float4 _simd_sinh_f4(simd_float4 x); | ||
| 3586 | static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) { | ||
| 3587 | return _simd_sinh_f4(x); | ||
| 3588 | } | ||
| 3589 | #else | ||
| 3590 | static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) { | ||
| 3591 | return simd_make_float4(sinh(x.x), sinh(x.y), sinh(x.z), sinh(x.w)); | ||
| 3592 | } | ||
| 3593 | #endif | ||
| 3594 | |||
| 3595 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3596 | extern simd_float8 _simd_sinh_f8(simd_float8 x); | ||
| 3597 | static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) { | ||
| 3598 | return _simd_sinh_f8(x); | ||
| 3599 | } | ||
| 3600 | #else | ||
| 3601 | static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) { | ||
| 3602 | return simd_make_float8(__tg_sinh(x.lo), __tg_sinh(x.hi)); | ||
| 3603 | } | ||
| 3604 | #endif | ||
| 3605 | |||
| 3606 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3607 | extern simd_float16 _simd_sinh_f16(simd_float16 x); | ||
| 3608 | static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) { | ||
| 3609 | return _simd_sinh_f16(x); | ||
| 3610 | } | ||
| 3611 | #else | ||
| 3612 | static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) { | ||
| 3613 | return simd_make_float16(__tg_sinh(x.lo), __tg_sinh(x.hi)); | ||
| 3614 | } | ||
| 3615 | #endif | ||
| 3616 | |||
| 3617 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3618 | extern simd_double2 _simd_sinh_d2(simd_double2 x); | ||
| 3619 | static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) { | ||
| 3620 | return _simd_sinh_d2(x); | ||
| 3621 | } | ||
| 3622 | #else | ||
| 3623 | static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) { | ||
| 3624 | return simd_make_double2(sinh(x.x), sinh(x.y)); | ||
| 3625 | } | ||
| 3626 | #endif | ||
| 3627 | |||
| 3628 | static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x) { | ||
| 3629 | return simd_make_double3(__tg_sinh(simd_make_double4(x))); | ||
| 3630 | } | ||
| 3631 | |||
| 3632 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3633 | extern simd_double4 _simd_sinh_d4(simd_double4 x); | ||
| 3634 | static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) { | ||
| 3635 | return _simd_sinh_d4(x); | ||
| 3636 | } | ||
| 3637 | #else | ||
| 3638 | static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) { | ||
| 3639 | return simd_make_double4(__tg_sinh(x.lo), __tg_sinh(x.hi)); | ||
| 3640 | } | ||
| 3641 | #endif | ||
| 3642 | |||
| 3643 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3644 | extern simd_double8 _simd_sinh_d8(simd_double8 x); | ||
| 3645 | static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) { | ||
| 3646 | return _simd_sinh_d8(x); | ||
| 3647 | } | ||
| 3648 | #else | ||
| 3649 | static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) { | ||
| 3650 | return simd_make_double8(__tg_sinh(x.lo), __tg_sinh(x.hi)); | ||
| 3651 | } | ||
| 3652 | #endif | ||
| 3653 | |||
| 3654 | #pragma mark - tanh implementation | ||
| 3655 | static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x) { | ||
| 3656 | return simd_make_float2(__tg_tanh(simd_make_float4(x))); | ||
| 3657 | } | ||
| 3658 | |||
| 3659 | static inline SIMD_CFUNC simd_float3 __tg_tanh(simd_float3 x) { | ||
| 3660 | return simd_make_float3(__tg_tanh(simd_make_float4(x))); | ||
| 3661 | } | ||
| 3662 | |||
| 3663 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3664 | extern simd_float4 _simd_tanh_f4(simd_float4 x); | ||
| 3665 | static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) { | ||
| 3666 | return _simd_tanh_f4(x); | ||
| 3667 | } | ||
| 3668 | #else | ||
| 3669 | static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) { | ||
| 3670 | return simd_make_float4(tanh(x.x), tanh(x.y), tanh(x.z), tanh(x.w)); | ||
| 3671 | } | ||
| 3672 | #endif | ||
| 3673 | |||
| 3674 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3675 | extern simd_float8 _simd_tanh_f8(simd_float8 x); | ||
| 3676 | static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) { | ||
| 3677 | return _simd_tanh_f8(x); | ||
| 3678 | } | ||
| 3679 | #else | ||
| 3680 | static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) { | ||
| 3681 | return simd_make_float8(__tg_tanh(x.lo), __tg_tanh(x.hi)); | ||
| 3682 | } | ||
| 3683 | #endif | ||
| 3684 | |||
| 3685 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3686 | extern simd_float16 _simd_tanh_f16(simd_float16 x); | ||
| 3687 | static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) { | ||
| 3688 | return _simd_tanh_f16(x); | ||
| 3689 | } | ||
| 3690 | #else | ||
| 3691 | static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) { | ||
| 3692 | return simd_make_float16(__tg_tanh(x.lo), __tg_tanh(x.hi)); | ||
| 3693 | } | ||
| 3694 | #endif | ||
| 3695 | |||
| 3696 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3697 | extern simd_double2 _simd_tanh_d2(simd_double2 x); | ||
| 3698 | static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) { | ||
| 3699 | return _simd_tanh_d2(x); | ||
| 3700 | } | ||
| 3701 | #else | ||
| 3702 | static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) { | ||
| 3703 | return simd_make_double2(tanh(x.x), tanh(x.y)); | ||
| 3704 | } | ||
| 3705 | #endif | ||
| 3706 | |||
| 3707 | static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x) { | ||
| 3708 | return simd_make_double3(__tg_tanh(simd_make_double4(x))); | ||
| 3709 | } | ||
| 3710 | |||
| 3711 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3712 | extern simd_double4 _simd_tanh_d4(simd_double4 x); | ||
| 3713 | static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) { | ||
| 3714 | return _simd_tanh_d4(x); | ||
| 3715 | } | ||
| 3716 | #else | ||
| 3717 | static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) { | ||
| 3718 | return simd_make_double4(__tg_tanh(x.lo), __tg_tanh(x.hi)); | ||
| 3719 | } | ||
| 3720 | #endif | ||
| 3721 | |||
| 3722 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3723 | extern simd_double8 _simd_tanh_d8(simd_double8 x); | ||
| 3724 | static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) { | ||
| 3725 | return _simd_tanh_d8(x); | ||
| 3726 | } | ||
| 3727 | #else | ||
| 3728 | static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) { | ||
| 3729 | return simd_make_double8(__tg_tanh(x.lo), __tg_tanh(x.hi)); | ||
| 3730 | } | ||
| 3731 | #endif | ||
| 3732 | |||
| 3733 | #pragma mark - exp implementation | ||
| 3734 | static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x) { | ||
| 3735 | return simd_make_float2(__tg_exp(simd_make_float4(x))); | ||
| 3736 | } | ||
| 3737 | |||
| 3738 | static inline SIMD_CFUNC simd_float3 __tg_exp(simd_float3 x) { | ||
| 3739 | return simd_make_float3(__tg_exp(simd_make_float4(x))); | ||
| 3740 | } | ||
| 3741 | |||
| 3742 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3743 | extern simd_float4 _simd_exp_f4(simd_float4 x); | ||
| 3744 | static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) { | ||
| 3745 | return _simd_exp_f4(x); | ||
| 3746 | } | ||
| 3747 | #else | ||
| 3748 | static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) { | ||
| 3749 | return simd_make_float4(exp(x.x), exp(x.y), exp(x.z), exp(x.w)); | ||
| 3750 | } | ||
| 3751 | #endif | ||
| 3752 | |||
| 3753 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3754 | extern simd_float8 _simd_exp_f8(simd_float8 x); | ||
| 3755 | static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) { | ||
| 3756 | return _simd_exp_f8(x); | ||
| 3757 | } | ||
| 3758 | #else | ||
| 3759 | static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) { | ||
| 3760 | return simd_make_float8(__tg_exp(x.lo), __tg_exp(x.hi)); | ||
| 3761 | } | ||
| 3762 | #endif | ||
| 3763 | |||
| 3764 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3765 | extern simd_float16 _simd_exp_f16(simd_float16 x); | ||
| 3766 | static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) { | ||
| 3767 | return _simd_exp_f16(x); | ||
| 3768 | } | ||
| 3769 | #else | ||
| 3770 | static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) { | ||
| 3771 | return simd_make_float16(__tg_exp(x.lo), __tg_exp(x.hi)); | ||
| 3772 | } | ||
| 3773 | #endif | ||
| 3774 | |||
| 3775 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3776 | extern simd_double2 _simd_exp_d2(simd_double2 x); | ||
| 3777 | static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) { | ||
| 3778 | return _simd_exp_d2(x); | ||
| 3779 | } | ||
| 3780 | #else | ||
| 3781 | static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) { | ||
| 3782 | return simd_make_double2(exp(x.x), exp(x.y)); | ||
| 3783 | } | ||
| 3784 | #endif | ||
| 3785 | |||
| 3786 | static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x) { | ||
| 3787 | return simd_make_double3(__tg_exp(simd_make_double4(x))); | ||
| 3788 | } | ||
| 3789 | |||
| 3790 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3791 | extern simd_double4 _simd_exp_d4(simd_double4 x); | ||
| 3792 | static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) { | ||
| 3793 | return _simd_exp_d4(x); | ||
| 3794 | } | ||
| 3795 | #else | ||
| 3796 | static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) { | ||
| 3797 | return simd_make_double4(__tg_exp(x.lo), __tg_exp(x.hi)); | ||
| 3798 | } | ||
| 3799 | #endif | ||
| 3800 | |||
| 3801 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3802 | extern simd_double8 _simd_exp_d8(simd_double8 x); | ||
| 3803 | static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) { | ||
| 3804 | return _simd_exp_d8(x); | ||
| 3805 | } | ||
| 3806 | #else | ||
| 3807 | static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) { | ||
| 3808 | return simd_make_double8(__tg_exp(x.lo), __tg_exp(x.hi)); | ||
| 3809 | } | ||
| 3810 | #endif | ||
| 3811 | |||
| 3812 | #pragma mark - exp2 implementation | ||
| 3813 | static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x) { | ||
| 3814 | return simd_make_float2(__tg_exp2(simd_make_float4(x))); | ||
| 3815 | } | ||
| 3816 | |||
| 3817 | static inline SIMD_CFUNC simd_float3 __tg_exp2(simd_float3 x) { | ||
| 3818 | return simd_make_float3(__tg_exp2(simd_make_float4(x))); | ||
| 3819 | } | ||
| 3820 | |||
| 3821 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3822 | extern simd_float4 _simd_exp2_f4(simd_float4 x); | ||
| 3823 | static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) { | ||
| 3824 | return _simd_exp2_f4(x); | ||
| 3825 | } | ||
| 3826 | #else | ||
| 3827 | static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) { | ||
| 3828 | return simd_make_float4(exp2(x.x), exp2(x.y), exp2(x.z), exp2(x.w)); | ||
| 3829 | } | ||
| 3830 | #endif | ||
| 3831 | |||
| 3832 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3833 | extern simd_float8 _simd_exp2_f8(simd_float8 x); | ||
| 3834 | static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) { | ||
| 3835 | return _simd_exp2_f8(x); | ||
| 3836 | } | ||
| 3837 | #else | ||
| 3838 | static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) { | ||
| 3839 | return simd_make_float8(__tg_exp2(x.lo), __tg_exp2(x.hi)); | ||
| 3840 | } | ||
| 3841 | #endif | ||
| 3842 | |||
| 3843 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3844 | extern simd_float16 _simd_exp2_f16(simd_float16 x); | ||
| 3845 | static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) { | ||
| 3846 | return _simd_exp2_f16(x); | ||
| 3847 | } | ||
| 3848 | #else | ||
| 3849 | static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) { | ||
| 3850 | return simd_make_float16(__tg_exp2(x.lo), __tg_exp2(x.hi)); | ||
| 3851 | } | ||
| 3852 | #endif | ||
| 3853 | |||
| 3854 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3855 | extern simd_double2 _simd_exp2_d2(simd_double2 x); | ||
| 3856 | static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) { | ||
| 3857 | return _simd_exp2_d2(x); | ||
| 3858 | } | ||
| 3859 | #else | ||
| 3860 | static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) { | ||
| 3861 | return simd_make_double2(exp2(x.x), exp2(x.y)); | ||
| 3862 | } | ||
| 3863 | #endif | ||
| 3864 | |||
| 3865 | static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x) { | ||
| 3866 | return simd_make_double3(__tg_exp2(simd_make_double4(x))); | ||
| 3867 | } | ||
| 3868 | |||
| 3869 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3870 | extern simd_double4 _simd_exp2_d4(simd_double4 x); | ||
| 3871 | static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) { | ||
| 3872 | return _simd_exp2_d4(x); | ||
| 3873 | } | ||
| 3874 | #else | ||
| 3875 | static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) { | ||
| 3876 | return simd_make_double4(__tg_exp2(x.lo), __tg_exp2(x.hi)); | ||
| 3877 | } | ||
| 3878 | #endif | ||
| 3879 | |||
| 3880 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3881 | extern simd_double8 _simd_exp2_d8(simd_double8 x); | ||
| 3882 | static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) { | ||
| 3883 | return _simd_exp2_d8(x); | ||
| 3884 | } | ||
| 3885 | #else | ||
| 3886 | static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) { | ||
| 3887 | return simd_make_double8(__tg_exp2(x.lo), __tg_exp2(x.hi)); | ||
| 3888 | } | ||
| 3889 | #endif | ||
| 3890 | |||
| 3891 | #pragma mark - exp10 implementation | ||
| 3892 | #if SIMD_LIBRARY_VERSION >= 1 | ||
| 3893 | static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x) { | ||
| 3894 | return simd_make_float2(__tg_exp10(simd_make_float4(x))); | ||
| 3895 | } | ||
| 3896 | |||
| 3897 | static inline SIMD_CFUNC simd_float3 __tg_exp10(simd_float3 x) { | ||
| 3898 | return simd_make_float3(__tg_exp10(simd_make_float4(x))); | ||
| 3899 | } | ||
| 3900 | |||
| 3901 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3902 | extern simd_float4 _simd_exp10_f4(simd_float4 x); | ||
| 3903 | static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) { | ||
| 3904 | return _simd_exp10_f4(x); | ||
| 3905 | } | ||
| 3906 | #else | ||
| 3907 | static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) { | ||
| 3908 | return simd_make_float4(__exp10(x.x), __exp10(x.y), __exp10(x.z), __exp10(x.w)); | ||
| 3909 | } | ||
| 3910 | #endif | ||
| 3911 | |||
| 3912 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3913 | extern simd_float8 _simd_exp10_f8(simd_float8 x); | ||
| 3914 | static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) { | ||
| 3915 | return _simd_exp10_f8(x); | ||
| 3916 | } | ||
| 3917 | #else | ||
| 3918 | static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) { | ||
| 3919 | return simd_make_float8(__tg_exp10(x.lo), __tg_exp10(x.hi)); | ||
| 3920 | } | ||
| 3921 | #endif | ||
| 3922 | |||
| 3923 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3924 | extern simd_float16 _simd_exp10_f16(simd_float16 x); | ||
| 3925 | static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) { | ||
| 3926 | return _simd_exp10_f16(x); | ||
| 3927 | } | ||
| 3928 | #else | ||
| 3929 | static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) { | ||
| 3930 | return simd_make_float16(__tg_exp10(x.lo), __tg_exp10(x.hi)); | ||
| 3931 | } | ||
| 3932 | #endif | ||
| 3933 | |||
| 3934 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3935 | extern simd_double2 _simd_exp10_d2(simd_double2 x); | ||
| 3936 | static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) { | ||
| 3937 | return _simd_exp10_d2(x); | ||
| 3938 | } | ||
| 3939 | #else | ||
| 3940 | static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) { | ||
| 3941 | return simd_make_double2(__exp10(x.x), __exp10(x.y)); | ||
| 3942 | } | ||
| 3943 | #endif | ||
| 3944 | |||
| 3945 | static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x) { | ||
| 3946 | return simd_make_double3(__tg_exp10(simd_make_double4(x))); | ||
| 3947 | } | ||
| 3948 | |||
| 3949 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3950 | extern simd_double4 _simd_exp10_d4(simd_double4 x); | ||
| 3951 | static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) { | ||
| 3952 | return _simd_exp10_d4(x); | ||
| 3953 | } | ||
| 3954 | #else | ||
| 3955 | static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) { | ||
| 3956 | return simd_make_double4(__tg_exp10(x.lo), __tg_exp10(x.hi)); | ||
| 3957 | } | ||
| 3958 | #endif | ||
| 3959 | |||
| 3960 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 3961 | extern simd_double8 _simd_exp10_d8(simd_double8 x); | ||
| 3962 | static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) { | ||
| 3963 | return _simd_exp10_d8(x); | ||
| 3964 | } | ||
| 3965 | #else | ||
| 3966 | static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) { | ||
| 3967 | return simd_make_double8(__tg_exp10(x.lo), __tg_exp10(x.hi)); | ||
| 3968 | } | ||
| 3969 | #endif | ||
| 3970 | |||
| 3971 | #endif /* SIMD_LIBRARY_VERSION */ | ||
| 3972 | #pragma mark - expm1 implementation | ||
| 3973 | static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x) { | ||
| 3974 | return simd_make_float2(__tg_expm1(simd_make_float4(x))); | ||
| 3975 | } | ||
| 3976 | |||
| 3977 | static inline SIMD_CFUNC simd_float3 __tg_expm1(simd_float3 x) { | ||
| 3978 | return simd_make_float3(__tg_expm1(simd_make_float4(x))); | ||
| 3979 | } | ||
| 3980 | |||
| 3981 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 3982 | extern simd_float4 _simd_expm1_f4(simd_float4 x); | ||
| 3983 | static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) { | ||
| 3984 | return _simd_expm1_f4(x); | ||
| 3985 | } | ||
| 3986 | #else | ||
| 3987 | static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) { | ||
| 3988 | return simd_make_float4(expm1(x.x), expm1(x.y), expm1(x.z), expm1(x.w)); | ||
| 3989 | } | ||
| 3990 | #endif | ||
| 3991 | |||
| 3992 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 3993 | extern simd_float8 _simd_expm1_f8(simd_float8 x); | ||
| 3994 | static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) { | ||
| 3995 | return _simd_expm1_f8(x); | ||
| 3996 | } | ||
| 3997 | #else | ||
| 3998 | static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) { | ||
| 3999 | return simd_make_float8(__tg_expm1(x.lo), __tg_expm1(x.hi)); | ||
| 4000 | } | ||
| 4001 | #endif | ||
| 4002 | |||
| 4003 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4004 | extern simd_float16 _simd_expm1_f16(simd_float16 x); | ||
| 4005 | static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) { | ||
| 4006 | return _simd_expm1_f16(x); | ||
| 4007 | } | ||
| 4008 | #else | ||
| 4009 | static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) { | ||
| 4010 | return simd_make_float16(__tg_expm1(x.lo), __tg_expm1(x.hi)); | ||
| 4011 | } | ||
| 4012 | #endif | ||
| 4013 | |||
| 4014 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4015 | extern simd_double2 _simd_expm1_d2(simd_double2 x); | ||
| 4016 | static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) { | ||
| 4017 | return _simd_expm1_d2(x); | ||
| 4018 | } | ||
| 4019 | #else | ||
| 4020 | static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) { | ||
| 4021 | return simd_make_double2(expm1(x.x), expm1(x.y)); | ||
| 4022 | } | ||
| 4023 | #endif | ||
| 4024 | |||
| 4025 | static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x) { | ||
| 4026 | return simd_make_double3(__tg_expm1(simd_make_double4(x))); | ||
| 4027 | } | ||
| 4028 | |||
| 4029 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4030 | extern simd_double4 _simd_expm1_d4(simd_double4 x); | ||
| 4031 | static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) { | ||
| 4032 | return _simd_expm1_d4(x); | ||
| 4033 | } | ||
| 4034 | #else | ||
| 4035 | static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) { | ||
| 4036 | return simd_make_double4(__tg_expm1(x.lo), __tg_expm1(x.hi)); | ||
| 4037 | } | ||
| 4038 | #endif | ||
| 4039 | |||
| 4040 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4041 | extern simd_double8 _simd_expm1_d8(simd_double8 x); | ||
| 4042 | static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) { | ||
| 4043 | return _simd_expm1_d8(x); | ||
| 4044 | } | ||
| 4045 | #else | ||
| 4046 | static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) { | ||
| 4047 | return simd_make_double8(__tg_expm1(x.lo), __tg_expm1(x.hi)); | ||
| 4048 | } | ||
| 4049 | #endif | ||
| 4050 | |||
| 4051 | #pragma mark - log implementation | ||
| 4052 | static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x) { | ||
| 4053 | return simd_make_float2(__tg_log(simd_make_float4(x))); | ||
| 4054 | } | ||
| 4055 | |||
| 4056 | static inline SIMD_CFUNC simd_float3 __tg_log(simd_float3 x) { | ||
| 4057 | return simd_make_float3(__tg_log(simd_make_float4(x))); | ||
| 4058 | } | ||
| 4059 | |||
| 4060 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4061 | extern simd_float4 _simd_log_f4(simd_float4 x); | ||
| 4062 | static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) { | ||
| 4063 | return _simd_log_f4(x); | ||
| 4064 | } | ||
| 4065 | #else | ||
| 4066 | static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) { | ||
| 4067 | return simd_make_float4(log(x.x), log(x.y), log(x.z), log(x.w)); | ||
| 4068 | } | ||
| 4069 | #endif | ||
| 4070 | |||
| 4071 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4072 | extern simd_float8 _simd_log_f8(simd_float8 x); | ||
| 4073 | static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) { | ||
| 4074 | return _simd_log_f8(x); | ||
| 4075 | } | ||
| 4076 | #else | ||
| 4077 | static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) { | ||
| 4078 | return simd_make_float8(__tg_log(x.lo), __tg_log(x.hi)); | ||
| 4079 | } | ||
| 4080 | #endif | ||
| 4081 | |||
| 4082 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4083 | extern simd_float16 _simd_log_f16(simd_float16 x); | ||
| 4084 | static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) { | ||
| 4085 | return _simd_log_f16(x); | ||
| 4086 | } | ||
| 4087 | #else | ||
| 4088 | static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) { | ||
| 4089 | return simd_make_float16(__tg_log(x.lo), __tg_log(x.hi)); | ||
| 4090 | } | ||
| 4091 | #endif | ||
| 4092 | |||
| 4093 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4094 | extern simd_double2 _simd_log_d2(simd_double2 x); | ||
| 4095 | static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) { | ||
| 4096 | return _simd_log_d2(x); | ||
| 4097 | } | ||
| 4098 | #else | ||
| 4099 | static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) { | ||
| 4100 | return simd_make_double2(log(x.x), log(x.y)); | ||
| 4101 | } | ||
| 4102 | #endif | ||
| 4103 | |||
| 4104 | static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x) { | ||
| 4105 | return simd_make_double3(__tg_log(simd_make_double4(x))); | ||
| 4106 | } | ||
| 4107 | |||
| 4108 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4109 | extern simd_double4 _simd_log_d4(simd_double4 x); | ||
| 4110 | static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) { | ||
| 4111 | return _simd_log_d4(x); | ||
| 4112 | } | ||
| 4113 | #else | ||
| 4114 | static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) { | ||
| 4115 | return simd_make_double4(__tg_log(x.lo), __tg_log(x.hi)); | ||
| 4116 | } | ||
| 4117 | #endif | ||
| 4118 | |||
| 4119 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4120 | extern simd_double8 _simd_log_d8(simd_double8 x); | ||
| 4121 | static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) { | ||
| 4122 | return _simd_log_d8(x); | ||
| 4123 | } | ||
| 4124 | #else | ||
| 4125 | static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) { | ||
| 4126 | return simd_make_double8(__tg_log(x.lo), __tg_log(x.hi)); | ||
| 4127 | } | ||
| 4128 | #endif | ||
| 4129 | |||
| 4130 | #pragma mark - log2 implementation | ||
| 4131 | static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x) { | ||
| 4132 | return simd_make_float2(__tg_log2(simd_make_float4(x))); | ||
| 4133 | } | ||
| 4134 | |||
| 4135 | static inline SIMD_CFUNC simd_float3 __tg_log2(simd_float3 x) { | ||
| 4136 | return simd_make_float3(__tg_log2(simd_make_float4(x))); | ||
| 4137 | } | ||
| 4138 | |||
| 4139 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4140 | extern simd_float4 _simd_log2_f4(simd_float4 x); | ||
| 4141 | static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) { | ||
| 4142 | return _simd_log2_f4(x); | ||
| 4143 | } | ||
| 4144 | #else | ||
| 4145 | static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) { | ||
| 4146 | return simd_make_float4(log2(x.x), log2(x.y), log2(x.z), log2(x.w)); | ||
| 4147 | } | ||
| 4148 | #endif | ||
| 4149 | |||
| 4150 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4151 | extern simd_float8 _simd_log2_f8(simd_float8 x); | ||
| 4152 | static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) { | ||
| 4153 | return _simd_log2_f8(x); | ||
| 4154 | } | ||
| 4155 | #else | ||
| 4156 | static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) { | ||
| 4157 | return simd_make_float8(__tg_log2(x.lo), __tg_log2(x.hi)); | ||
| 4158 | } | ||
| 4159 | #endif | ||
| 4160 | |||
| 4161 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4162 | extern simd_float16 _simd_log2_f16(simd_float16 x); | ||
| 4163 | static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) { | ||
| 4164 | return _simd_log2_f16(x); | ||
| 4165 | } | ||
| 4166 | #else | ||
| 4167 | static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) { | ||
| 4168 | return simd_make_float16(__tg_log2(x.lo), __tg_log2(x.hi)); | ||
| 4169 | } | ||
| 4170 | #endif | ||
| 4171 | |||
| 4172 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4173 | extern simd_double2 _simd_log2_d2(simd_double2 x); | ||
| 4174 | static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) { | ||
| 4175 | return _simd_log2_d2(x); | ||
| 4176 | } | ||
| 4177 | #else | ||
| 4178 | static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) { | ||
| 4179 | return simd_make_double2(log2(x.x), log2(x.y)); | ||
| 4180 | } | ||
| 4181 | #endif | ||
| 4182 | |||
| 4183 | static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x) { | ||
| 4184 | return simd_make_double3(__tg_log2(simd_make_double4(x))); | ||
| 4185 | } | ||
| 4186 | |||
| 4187 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4188 | extern simd_double4 _simd_log2_d4(simd_double4 x); | ||
| 4189 | static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) { | ||
| 4190 | return _simd_log2_d4(x); | ||
| 4191 | } | ||
| 4192 | #else | ||
| 4193 | static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) { | ||
| 4194 | return simd_make_double4(__tg_log2(x.lo), __tg_log2(x.hi)); | ||
| 4195 | } | ||
| 4196 | #endif | ||
| 4197 | |||
| 4198 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4199 | extern simd_double8 _simd_log2_d8(simd_double8 x); | ||
| 4200 | static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) { | ||
| 4201 | return _simd_log2_d8(x); | ||
| 4202 | } | ||
| 4203 | #else | ||
| 4204 | static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) { | ||
| 4205 | return simd_make_double8(__tg_log2(x.lo), __tg_log2(x.hi)); | ||
| 4206 | } | ||
| 4207 | #endif | ||
| 4208 | |||
| 4209 | #pragma mark - log10 implementation | ||
| 4210 | static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x) { | ||
| 4211 | return simd_make_float2(__tg_log10(simd_make_float4(x))); | ||
| 4212 | } | ||
| 4213 | |||
| 4214 | static inline SIMD_CFUNC simd_float3 __tg_log10(simd_float3 x) { | ||
| 4215 | return simd_make_float3(__tg_log10(simd_make_float4(x))); | ||
| 4216 | } | ||
| 4217 | |||
| 4218 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4219 | extern simd_float4 _simd_log10_f4(simd_float4 x); | ||
| 4220 | static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) { | ||
| 4221 | return _simd_log10_f4(x); | ||
| 4222 | } | ||
| 4223 | #else | ||
| 4224 | static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) { | ||
| 4225 | return simd_make_float4(log10(x.x), log10(x.y), log10(x.z), log10(x.w)); | ||
| 4226 | } | ||
| 4227 | #endif | ||
| 4228 | |||
| 4229 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4230 | extern simd_float8 _simd_log10_f8(simd_float8 x); | ||
| 4231 | static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) { | ||
| 4232 | return _simd_log10_f8(x); | ||
| 4233 | } | ||
| 4234 | #else | ||
| 4235 | static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) { | ||
| 4236 | return simd_make_float8(__tg_log10(x.lo), __tg_log10(x.hi)); | ||
| 4237 | } | ||
| 4238 | #endif | ||
| 4239 | |||
| 4240 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4241 | extern simd_float16 _simd_log10_f16(simd_float16 x); | ||
| 4242 | static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) { | ||
| 4243 | return _simd_log10_f16(x); | ||
| 4244 | } | ||
| 4245 | #else | ||
| 4246 | static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) { | ||
| 4247 | return simd_make_float16(__tg_log10(x.lo), __tg_log10(x.hi)); | ||
| 4248 | } | ||
| 4249 | #endif | ||
| 4250 | |||
| 4251 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4252 | extern simd_double2 _simd_log10_d2(simd_double2 x); | ||
| 4253 | static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) { | ||
| 4254 | return _simd_log10_d2(x); | ||
| 4255 | } | ||
| 4256 | #else | ||
| 4257 | static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) { | ||
| 4258 | return simd_make_double2(log10(x.x), log10(x.y)); | ||
| 4259 | } | ||
| 4260 | #endif | ||
| 4261 | |||
| 4262 | static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x) { | ||
| 4263 | return simd_make_double3(__tg_log10(simd_make_double4(x))); | ||
| 4264 | } | ||
| 4265 | |||
| 4266 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4267 | extern simd_double4 _simd_log10_d4(simd_double4 x); | ||
| 4268 | static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) { | ||
| 4269 | return _simd_log10_d4(x); | ||
| 4270 | } | ||
| 4271 | #else | ||
| 4272 | static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) { | ||
| 4273 | return simd_make_double4(__tg_log10(x.lo), __tg_log10(x.hi)); | ||
| 4274 | } | ||
| 4275 | #endif | ||
| 4276 | |||
| 4277 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4278 | extern simd_double8 _simd_log10_d8(simd_double8 x); | ||
| 4279 | static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) { | ||
| 4280 | return _simd_log10_d8(x); | ||
| 4281 | } | ||
| 4282 | #else | ||
| 4283 | static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) { | ||
| 4284 | return simd_make_double8(__tg_log10(x.lo), __tg_log10(x.hi)); | ||
| 4285 | } | ||
| 4286 | #endif | ||
| 4287 | |||
| 4288 | #pragma mark - log1p implementation | ||
| 4289 | static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x) { | ||
| 4290 | return simd_make_float2(__tg_log1p(simd_make_float4(x))); | ||
| 4291 | } | ||
| 4292 | |||
| 4293 | static inline SIMD_CFUNC simd_float3 __tg_log1p(simd_float3 x) { | ||
| 4294 | return simd_make_float3(__tg_log1p(simd_make_float4(x))); | ||
| 4295 | } | ||
| 4296 | |||
| 4297 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4298 | extern simd_float4 _simd_log1p_f4(simd_float4 x); | ||
| 4299 | static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) { | ||
| 4300 | return _simd_log1p_f4(x); | ||
| 4301 | } | ||
| 4302 | #else | ||
| 4303 | static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) { | ||
| 4304 | return simd_make_float4(log1p(x.x), log1p(x.y), log1p(x.z), log1p(x.w)); | ||
| 4305 | } | ||
| 4306 | #endif | ||
| 4307 | |||
| 4308 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4309 | extern simd_float8 _simd_log1p_f8(simd_float8 x); | ||
| 4310 | static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) { | ||
| 4311 | return _simd_log1p_f8(x); | ||
| 4312 | } | ||
| 4313 | #else | ||
| 4314 | static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) { | ||
| 4315 | return simd_make_float8(__tg_log1p(x.lo), __tg_log1p(x.hi)); | ||
| 4316 | } | ||
| 4317 | #endif | ||
| 4318 | |||
| 4319 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4320 | extern simd_float16 _simd_log1p_f16(simd_float16 x); | ||
| 4321 | static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) { | ||
| 4322 | return _simd_log1p_f16(x); | ||
| 4323 | } | ||
| 4324 | #else | ||
| 4325 | static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) { | ||
| 4326 | return simd_make_float16(__tg_log1p(x.lo), __tg_log1p(x.hi)); | ||
| 4327 | } | ||
| 4328 | #endif | ||
| 4329 | |||
| 4330 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4331 | extern simd_double2 _simd_log1p_d2(simd_double2 x); | ||
| 4332 | static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) { | ||
| 4333 | return _simd_log1p_d2(x); | ||
| 4334 | } | ||
| 4335 | #else | ||
| 4336 | static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) { | ||
| 4337 | return simd_make_double2(log1p(x.x), log1p(x.y)); | ||
| 4338 | } | ||
| 4339 | #endif | ||
| 4340 | |||
| 4341 | static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x) { | ||
| 4342 | return simd_make_double3(__tg_log1p(simd_make_double4(x))); | ||
| 4343 | } | ||
| 4344 | |||
| 4345 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4346 | extern simd_double4 _simd_log1p_d4(simd_double4 x); | ||
| 4347 | static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) { | ||
| 4348 | return _simd_log1p_d4(x); | ||
| 4349 | } | ||
| 4350 | #else | ||
| 4351 | static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) { | ||
| 4352 | return simd_make_double4(__tg_log1p(x.lo), __tg_log1p(x.hi)); | ||
| 4353 | } | ||
| 4354 | #endif | ||
| 4355 | |||
| 4356 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4357 | extern simd_double8 _simd_log1p_d8(simd_double8 x); | ||
| 4358 | static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) { | ||
| 4359 | return _simd_log1p_d8(x); | ||
| 4360 | } | ||
| 4361 | #else | ||
| 4362 | static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) { | ||
| 4363 | return simd_make_double8(__tg_log1p(x.lo), __tg_log1p(x.hi)); | ||
| 4364 | } | ||
| 4365 | #endif | ||
| 4366 | |||
| 4367 | #pragma mark - cbrt implementation | ||
| 4368 | static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x) { | ||
| 4369 | return simd_make_float2(__tg_cbrt(simd_make_float4(x))); | ||
| 4370 | } | ||
| 4371 | |||
| 4372 | static inline SIMD_CFUNC simd_float3 __tg_cbrt(simd_float3 x) { | ||
| 4373 | return simd_make_float3(__tg_cbrt(simd_make_float4(x))); | ||
| 4374 | } | ||
| 4375 | |||
| 4376 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4377 | extern simd_float4 _simd_cbrt_f4(simd_float4 x); | ||
| 4378 | static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) { | ||
| 4379 | return _simd_cbrt_f4(x); | ||
| 4380 | } | ||
| 4381 | #else | ||
| 4382 | static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) { | ||
| 4383 | return simd_make_float4(cbrt(x.x), cbrt(x.y), cbrt(x.z), cbrt(x.w)); | ||
| 4384 | } | ||
| 4385 | #endif | ||
| 4386 | |||
| 4387 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4388 | extern simd_float8 _simd_cbrt_f8(simd_float8 x); | ||
| 4389 | static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) { | ||
| 4390 | return _simd_cbrt_f8(x); | ||
| 4391 | } | ||
| 4392 | #else | ||
| 4393 | static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) { | ||
| 4394 | return simd_make_float8(__tg_cbrt(x.lo), __tg_cbrt(x.hi)); | ||
| 4395 | } | ||
| 4396 | #endif | ||
| 4397 | |||
| 4398 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4399 | extern simd_float16 _simd_cbrt_f16(simd_float16 x); | ||
| 4400 | static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) { | ||
| 4401 | return _simd_cbrt_f16(x); | ||
| 4402 | } | ||
| 4403 | #else | ||
| 4404 | static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) { | ||
| 4405 | return simd_make_float16(__tg_cbrt(x.lo), __tg_cbrt(x.hi)); | ||
| 4406 | } | ||
| 4407 | #endif | ||
| 4408 | |||
| 4409 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4410 | extern simd_double2 _simd_cbrt_d2(simd_double2 x); | ||
| 4411 | static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) { | ||
| 4412 | return _simd_cbrt_d2(x); | ||
| 4413 | } | ||
| 4414 | #else | ||
| 4415 | static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) { | ||
| 4416 | return simd_make_double2(cbrt(x.x), cbrt(x.y)); | ||
| 4417 | } | ||
| 4418 | #endif | ||
| 4419 | |||
| 4420 | static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x) { | ||
| 4421 | return simd_make_double3(__tg_cbrt(simd_make_double4(x))); | ||
| 4422 | } | ||
| 4423 | |||
| 4424 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4425 | extern simd_double4 _simd_cbrt_d4(simd_double4 x); | ||
| 4426 | static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) { | ||
| 4427 | return _simd_cbrt_d4(x); | ||
| 4428 | } | ||
| 4429 | #else | ||
| 4430 | static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) { | ||
| 4431 | return simd_make_double4(__tg_cbrt(x.lo), __tg_cbrt(x.hi)); | ||
| 4432 | } | ||
| 4433 | #endif | ||
| 4434 | |||
| 4435 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4436 | extern simd_double8 _simd_cbrt_d8(simd_double8 x); | ||
| 4437 | static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) { | ||
| 4438 | return _simd_cbrt_d8(x); | ||
| 4439 | } | ||
| 4440 | #else | ||
| 4441 | static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) { | ||
| 4442 | return simd_make_double8(__tg_cbrt(x.lo), __tg_cbrt(x.hi)); | ||
| 4443 | } | ||
| 4444 | #endif | ||
| 4445 | |||
| 4446 | #pragma mark - erf implementation | ||
| 4447 | static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x) { | ||
| 4448 | return simd_make_float2(__tg_erf(simd_make_float4(x))); | ||
| 4449 | } | ||
| 4450 | |||
| 4451 | static inline SIMD_CFUNC simd_float3 __tg_erf(simd_float3 x) { | ||
| 4452 | return simd_make_float3(__tg_erf(simd_make_float4(x))); | ||
| 4453 | } | ||
| 4454 | |||
| 4455 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4456 | extern simd_float4 _simd_erf_f4(simd_float4 x); | ||
| 4457 | static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) { | ||
| 4458 | return _simd_erf_f4(x); | ||
| 4459 | } | ||
| 4460 | #else | ||
| 4461 | static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) { | ||
| 4462 | return simd_make_float4(erf(x.x), erf(x.y), erf(x.z), erf(x.w)); | ||
| 4463 | } | ||
| 4464 | #endif | ||
| 4465 | |||
| 4466 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4467 | extern simd_float8 _simd_erf_f8(simd_float8 x); | ||
| 4468 | static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) { | ||
| 4469 | return _simd_erf_f8(x); | ||
| 4470 | } | ||
| 4471 | #else | ||
| 4472 | static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) { | ||
| 4473 | return simd_make_float8(__tg_erf(x.lo), __tg_erf(x.hi)); | ||
| 4474 | } | ||
| 4475 | #endif | ||
| 4476 | |||
| 4477 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4478 | extern simd_float16 _simd_erf_f16(simd_float16 x); | ||
| 4479 | static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) { | ||
| 4480 | return _simd_erf_f16(x); | ||
| 4481 | } | ||
| 4482 | #else | ||
| 4483 | static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) { | ||
| 4484 | return simd_make_float16(__tg_erf(x.lo), __tg_erf(x.hi)); | ||
| 4485 | } | ||
| 4486 | #endif | ||
| 4487 | |||
| 4488 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4489 | extern simd_double2 _simd_erf_d2(simd_double2 x); | ||
| 4490 | static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) { | ||
| 4491 | return _simd_erf_d2(x); | ||
| 4492 | } | ||
| 4493 | #else | ||
| 4494 | static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) { | ||
| 4495 | return simd_make_double2(erf(x.x), erf(x.y)); | ||
| 4496 | } | ||
| 4497 | #endif | ||
| 4498 | |||
| 4499 | static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x) { | ||
| 4500 | return simd_make_double3(__tg_erf(simd_make_double4(x))); | ||
| 4501 | } | ||
| 4502 | |||
| 4503 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4504 | extern simd_double4 _simd_erf_d4(simd_double4 x); | ||
| 4505 | static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) { | ||
| 4506 | return _simd_erf_d4(x); | ||
| 4507 | } | ||
| 4508 | #else | ||
| 4509 | static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) { | ||
| 4510 | return simd_make_double4(__tg_erf(x.lo), __tg_erf(x.hi)); | ||
| 4511 | } | ||
| 4512 | #endif | ||
| 4513 | |||
| 4514 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4515 | extern simd_double8 _simd_erf_d8(simd_double8 x); | ||
| 4516 | static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) { | ||
| 4517 | return _simd_erf_d8(x); | ||
| 4518 | } | ||
| 4519 | #else | ||
| 4520 | static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) { | ||
| 4521 | return simd_make_double8(__tg_erf(x.lo), __tg_erf(x.hi)); | ||
| 4522 | } | ||
| 4523 | #endif | ||
| 4524 | |||
| 4525 | #pragma mark - erfc implementation | ||
| 4526 | static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x) { | ||
| 4527 | return simd_make_float2(__tg_erfc(simd_make_float4(x))); | ||
| 4528 | } | ||
| 4529 | |||
| 4530 | static inline SIMD_CFUNC simd_float3 __tg_erfc(simd_float3 x) { | ||
| 4531 | return simd_make_float3(__tg_erfc(simd_make_float4(x))); | ||
| 4532 | } | ||
| 4533 | |||
| 4534 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4535 | extern simd_float4 _simd_erfc_f4(simd_float4 x); | ||
| 4536 | static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) { | ||
| 4537 | return _simd_erfc_f4(x); | ||
| 4538 | } | ||
| 4539 | #else | ||
| 4540 | static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) { | ||
| 4541 | return simd_make_float4(erfc(x.x), erfc(x.y), erfc(x.z), erfc(x.w)); | ||
| 4542 | } | ||
| 4543 | #endif | ||
| 4544 | |||
| 4545 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4546 | extern simd_float8 _simd_erfc_f8(simd_float8 x); | ||
| 4547 | static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) { | ||
| 4548 | return _simd_erfc_f8(x); | ||
| 4549 | } | ||
| 4550 | #else | ||
| 4551 | static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) { | ||
| 4552 | return simd_make_float8(__tg_erfc(x.lo), __tg_erfc(x.hi)); | ||
| 4553 | } | ||
| 4554 | #endif | ||
| 4555 | |||
| 4556 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4557 | extern simd_float16 _simd_erfc_f16(simd_float16 x); | ||
| 4558 | static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) { | ||
| 4559 | return _simd_erfc_f16(x); | ||
| 4560 | } | ||
| 4561 | #else | ||
| 4562 | static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) { | ||
| 4563 | return simd_make_float16(__tg_erfc(x.lo), __tg_erfc(x.hi)); | ||
| 4564 | } | ||
| 4565 | #endif | ||
| 4566 | |||
| 4567 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4568 | extern simd_double2 _simd_erfc_d2(simd_double2 x); | ||
| 4569 | static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) { | ||
| 4570 | return _simd_erfc_d2(x); | ||
| 4571 | } | ||
| 4572 | #else | ||
| 4573 | static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) { | ||
| 4574 | return simd_make_double2(erfc(x.x), erfc(x.y)); | ||
| 4575 | } | ||
| 4576 | #endif | ||
| 4577 | |||
| 4578 | static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x) { | ||
| 4579 | return simd_make_double3(__tg_erfc(simd_make_double4(x))); | ||
| 4580 | } | ||
| 4581 | |||
| 4582 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4583 | extern simd_double4 _simd_erfc_d4(simd_double4 x); | ||
| 4584 | static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) { | ||
| 4585 | return _simd_erfc_d4(x); | ||
| 4586 | } | ||
| 4587 | #else | ||
| 4588 | static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) { | ||
| 4589 | return simd_make_double4(__tg_erfc(x.lo), __tg_erfc(x.hi)); | ||
| 4590 | } | ||
| 4591 | #endif | ||
| 4592 | |||
| 4593 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4594 | extern simd_double8 _simd_erfc_d8(simd_double8 x); | ||
| 4595 | static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) { | ||
| 4596 | return _simd_erfc_d8(x); | ||
| 4597 | } | ||
| 4598 | #else | ||
| 4599 | static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) { | ||
| 4600 | return simd_make_double8(__tg_erfc(x.lo), __tg_erfc(x.hi)); | ||
| 4601 | } | ||
| 4602 | #endif | ||
| 4603 | |||
| 4604 | #pragma mark - tgamma implementation | ||
| 4605 | static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x) { | ||
| 4606 | return simd_make_float2(__tg_tgamma(simd_make_float4(x))); | ||
| 4607 | } | ||
| 4608 | |||
| 4609 | static inline SIMD_CFUNC simd_float3 __tg_tgamma(simd_float3 x) { | ||
| 4610 | return simd_make_float3(__tg_tgamma(simd_make_float4(x))); | ||
| 4611 | } | ||
| 4612 | |||
| 4613 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4614 | extern simd_float4 _simd_tgamma_f4(simd_float4 x); | ||
| 4615 | static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) { | ||
| 4616 | return _simd_tgamma_f4(x); | ||
| 4617 | } | ||
| 4618 | #else | ||
| 4619 | static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) { | ||
| 4620 | return simd_make_float4(tgamma(x.x), tgamma(x.y), tgamma(x.z), tgamma(x.w)); | ||
| 4621 | } | ||
| 4622 | #endif | ||
| 4623 | |||
| 4624 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4625 | extern simd_float8 _simd_tgamma_f8(simd_float8 x); | ||
| 4626 | static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) { | ||
| 4627 | return _simd_tgamma_f8(x); | ||
| 4628 | } | ||
| 4629 | #else | ||
| 4630 | static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) { | ||
| 4631 | return simd_make_float8(__tg_tgamma(x.lo), __tg_tgamma(x.hi)); | ||
| 4632 | } | ||
| 4633 | #endif | ||
| 4634 | |||
| 4635 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4636 | extern simd_float16 _simd_tgamma_f16(simd_float16 x); | ||
| 4637 | static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) { | ||
| 4638 | return _simd_tgamma_f16(x); | ||
| 4639 | } | ||
| 4640 | #else | ||
| 4641 | static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) { | ||
| 4642 | return simd_make_float16(__tg_tgamma(x.lo), __tg_tgamma(x.hi)); | ||
| 4643 | } | ||
| 4644 | #endif | ||
| 4645 | |||
| 4646 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4647 | extern simd_double2 _simd_tgamma_d2(simd_double2 x); | ||
| 4648 | static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) { | ||
| 4649 | return _simd_tgamma_d2(x); | ||
| 4650 | } | ||
| 4651 | #else | ||
| 4652 | static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) { | ||
| 4653 | return simd_make_double2(tgamma(x.x), tgamma(x.y)); | ||
| 4654 | } | ||
| 4655 | #endif | ||
| 4656 | |||
| 4657 | static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x) { | ||
| 4658 | return simd_make_double3(__tg_tgamma(simd_make_double4(x))); | ||
| 4659 | } | ||
| 4660 | |||
| 4661 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4662 | extern simd_double4 _simd_tgamma_d4(simd_double4 x); | ||
| 4663 | static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) { | ||
| 4664 | return _simd_tgamma_d4(x); | ||
| 4665 | } | ||
| 4666 | #else | ||
| 4667 | static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) { | ||
| 4668 | return simd_make_double4(__tg_tgamma(x.lo), __tg_tgamma(x.hi)); | ||
| 4669 | } | ||
| 4670 | #endif | ||
| 4671 | |||
| 4672 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4673 | extern simd_double8 _simd_tgamma_d8(simd_double8 x); | ||
| 4674 | static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) { | ||
| 4675 | return _simd_tgamma_d8(x); | ||
| 4676 | } | ||
| 4677 | #else | ||
| 4678 | static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) { | ||
| 4679 | return simd_make_double8(__tg_tgamma(x.lo), __tg_tgamma(x.hi)); | ||
| 4680 | } | ||
| 4681 | #endif | ||
| 4682 | |||
| 4683 | #pragma mark - round implementation | ||
| 4684 | static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x) { | ||
| 4685 | return simd_make_float2(__tg_round(simd_make_float4(x))); | ||
| 4686 | } | ||
| 4687 | |||
| 4688 | static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x) { | ||
| 4689 | return simd_make_float3(__tg_round(simd_make_float4(x))); | ||
| 4690 | } | ||
| 4691 | |||
| 4692 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4693 | extern simd_float4 _simd_round_f4(simd_float4 x); | ||
| 4694 | static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) { | ||
| 4695 | #if defined __arm64__ | ||
| 4696 | return vrndaq_f32(x); | ||
| 4697 | #else | ||
| 4698 | return _simd_round_f4(x); | ||
| 4699 | #endif | ||
| 4700 | } | ||
| 4701 | #else | ||
| 4702 | static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) { | ||
| 4703 | return simd_make_float4(round(x.x), round(x.y), round(x.z), round(x.w)); | ||
| 4704 | } | ||
| 4705 | #endif | ||
| 4706 | |||
| 4707 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4708 | extern simd_float8 _simd_round_f8(simd_float8 x); | ||
| 4709 | static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) { | ||
| 4710 | return _simd_round_f8(x); | ||
| 4711 | } | ||
| 4712 | #else | ||
| 4713 | static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) { | ||
| 4714 | return simd_make_float8(__tg_round(x.lo), __tg_round(x.hi)); | ||
| 4715 | } | ||
| 4716 | #endif | ||
| 4717 | |||
| 4718 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4719 | extern simd_float16 _simd_round_f16(simd_float16 x); | ||
| 4720 | static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) { | ||
| 4721 | return _simd_round_f16(x); | ||
| 4722 | } | ||
| 4723 | #else | ||
| 4724 | static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) { | ||
| 4725 | return simd_make_float16(__tg_round(x.lo), __tg_round(x.hi)); | ||
| 4726 | } | ||
| 4727 | #endif | ||
| 4728 | |||
| 4729 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4730 | extern simd_double2 _simd_round_d2(simd_double2 x); | ||
| 4731 | static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) { | ||
| 4732 | #if defined __arm64__ | ||
| 4733 | return vrndaq_f64(x); | ||
| 4734 | #else | ||
| 4735 | return _simd_round_d2(x); | ||
| 4736 | #endif | ||
| 4737 | } | ||
| 4738 | #else | ||
| 4739 | static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) { | ||
| 4740 | return simd_make_double2(round(x.x), round(x.y)); | ||
| 4741 | } | ||
| 4742 | #endif | ||
| 4743 | |||
| 4744 | static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x) { | ||
| 4745 | return simd_make_double3(__tg_round(simd_make_double4(x))); | ||
| 4746 | } | ||
| 4747 | |||
| 4748 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4749 | extern simd_double4 _simd_round_d4(simd_double4 x); | ||
| 4750 | static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) { | ||
| 4751 | return _simd_round_d4(x); | ||
| 4752 | } | ||
| 4753 | #else | ||
| 4754 | static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) { | ||
| 4755 | return simd_make_double4(__tg_round(x.lo), __tg_round(x.hi)); | ||
| 4756 | } | ||
| 4757 | #endif | ||
| 4758 | |||
| 4759 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4760 | extern simd_double8 _simd_round_d8(simd_double8 x); | ||
| 4761 | static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) { | ||
| 4762 | return _simd_round_d8(x); | ||
| 4763 | } | ||
| 4764 | #else | ||
| 4765 | static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) { | ||
| 4766 | return simd_make_double8(__tg_round(x.lo), __tg_round(x.hi)); | ||
| 4767 | } | ||
| 4768 | #endif | ||
| 4769 | |||
| 4770 | #pragma mark - atan2 implementation | ||
| 4771 | static inline SIMD_CFUNC simd_float2 __tg_atan2(simd_float2 y, simd_float2 x) { | ||
| 4772 | return simd_make_float2(__tg_atan2(simd_make_float4(y), simd_make_float4(x))); | ||
| 4773 | } | ||
| 4774 | |||
| 4775 | static inline SIMD_CFUNC simd_float3 __tg_atan2(simd_float3 y, simd_float3 x) { | ||
| 4776 | return simd_make_float3(__tg_atan2(simd_make_float4(y), simd_make_float4(x))); | ||
| 4777 | } | ||
| 4778 | |||
| 4779 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4780 | extern simd_float4 _simd_atan2_f4(simd_float4 y, simd_float4 x); | ||
| 4781 | static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) { | ||
| 4782 | return _simd_atan2_f4(y, x); | ||
| 4783 | } | ||
| 4784 | #else | ||
| 4785 | static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) { | ||
| 4786 | return simd_make_float4(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z), atan2(y.w, x.w)); | ||
| 4787 | } | ||
| 4788 | #endif | ||
| 4789 | |||
| 4790 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4791 | extern simd_float8 _simd_atan2_f8(simd_float8 y, simd_float8 x); | ||
| 4792 | static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) { | ||
| 4793 | return _simd_atan2_f8(y, x); | ||
| 4794 | } | ||
| 4795 | #else | ||
| 4796 | static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) { | ||
| 4797 | return simd_make_float8(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi)); | ||
| 4798 | } | ||
| 4799 | #endif | ||
| 4800 | |||
| 4801 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4802 | extern simd_float16 _simd_atan2_f16(simd_float16 y, simd_float16 x); | ||
| 4803 | static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) { | ||
| 4804 | return _simd_atan2_f16(y, x); | ||
| 4805 | } | ||
| 4806 | #else | ||
| 4807 | static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) { | ||
| 4808 | return simd_make_float16(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi)); | ||
| 4809 | } | ||
| 4810 | #endif | ||
| 4811 | |||
| 4812 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4813 | extern simd_double2 _simd_atan2_d2(simd_double2 y, simd_double2 x); | ||
| 4814 | static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) { | ||
| 4815 | return _simd_atan2_d2(y, x); | ||
| 4816 | } | ||
| 4817 | #else | ||
| 4818 | static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) { | ||
| 4819 | return simd_make_double2(atan2(y.x, x.x), atan2(y.y, x.y)); | ||
| 4820 | } | ||
| 4821 | #endif | ||
| 4822 | |||
| 4823 | static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x) { | ||
| 4824 | return simd_make_double3(__tg_atan2(simd_make_double4(y), simd_make_double4(x))); | ||
| 4825 | } | ||
| 4826 | |||
| 4827 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4828 | extern simd_double4 _simd_atan2_d4(simd_double4 y, simd_double4 x); | ||
| 4829 | static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) { | ||
| 4830 | return _simd_atan2_d4(y, x); | ||
| 4831 | } | ||
| 4832 | #else | ||
| 4833 | static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) { | ||
| 4834 | return simd_make_double4(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi)); | ||
| 4835 | } | ||
| 4836 | #endif | ||
| 4837 | |||
| 4838 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4839 | extern simd_double8 _simd_atan2_d8(simd_double8 y, simd_double8 x); | ||
| 4840 | static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) { | ||
| 4841 | return _simd_atan2_d8(y, x); | ||
| 4842 | } | ||
| 4843 | #else | ||
| 4844 | static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) { | ||
| 4845 | return simd_make_double8(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi)); | ||
| 4846 | } | ||
| 4847 | #endif | ||
| 4848 | |||
| 4849 | #pragma mark - hypot implementation | ||
| 4850 | static inline SIMD_CFUNC simd_float2 __tg_hypot(simd_float2 x, simd_float2 y) { | ||
| 4851 | return simd_make_float2(__tg_hypot(simd_make_float4(x), simd_make_float4(y))); | ||
| 4852 | } | ||
| 4853 | |||
| 4854 | static inline SIMD_CFUNC simd_float3 __tg_hypot(simd_float3 x, simd_float3 y) { | ||
| 4855 | return simd_make_float3(__tg_hypot(simd_make_float4(x), simd_make_float4(y))); | ||
| 4856 | } | ||
| 4857 | |||
| 4858 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4859 | extern simd_float4 _simd_hypot_f4(simd_float4 x, simd_float4 y); | ||
| 4860 | static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) { | ||
| 4861 | return _simd_hypot_f4(x, y); | ||
| 4862 | } | ||
| 4863 | #else | ||
| 4864 | static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) { | ||
| 4865 | return simd_make_float4(hypot(x.x, y.x), hypot(x.y, y.y), hypot(x.z, y.z), hypot(x.w, y.w)); | ||
| 4866 | } | ||
| 4867 | #endif | ||
| 4868 | |||
| 4869 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4870 | extern simd_float8 _simd_hypot_f8(simd_float8 x, simd_float8 y); | ||
| 4871 | static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) { | ||
| 4872 | return _simd_hypot_f8(x, y); | ||
| 4873 | } | ||
| 4874 | #else | ||
| 4875 | static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) { | ||
| 4876 | return simd_make_float8(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi)); | ||
| 4877 | } | ||
| 4878 | #endif | ||
| 4879 | |||
| 4880 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4881 | extern simd_float16 _simd_hypot_f16(simd_float16 x, simd_float16 y); | ||
| 4882 | static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) { | ||
| 4883 | return _simd_hypot_f16(x, y); | ||
| 4884 | } | ||
| 4885 | #else | ||
| 4886 | static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) { | ||
| 4887 | return simd_make_float16(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi)); | ||
| 4888 | } | ||
| 4889 | #endif | ||
| 4890 | |||
| 4891 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4892 | extern simd_double2 _simd_hypot_d2(simd_double2 x, simd_double2 y); | ||
| 4893 | static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) { | ||
| 4894 | return _simd_hypot_d2(x, y); | ||
| 4895 | } | ||
| 4896 | #else | ||
| 4897 | static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) { | ||
| 4898 | return simd_make_double2(hypot(x.x, y.x), hypot(x.y, y.y)); | ||
| 4899 | } | ||
| 4900 | #endif | ||
| 4901 | |||
| 4902 | static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y) { | ||
| 4903 | return simd_make_double3(__tg_hypot(simd_make_double4(x), simd_make_double4(y))); | ||
| 4904 | } | ||
| 4905 | |||
| 4906 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4907 | extern simd_double4 _simd_hypot_d4(simd_double4 x, simd_double4 y); | ||
| 4908 | static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) { | ||
| 4909 | return _simd_hypot_d4(x, y); | ||
| 4910 | } | ||
| 4911 | #else | ||
| 4912 | static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) { | ||
| 4913 | return simd_make_double4(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi)); | ||
| 4914 | } | ||
| 4915 | #endif | ||
| 4916 | |||
| 4917 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4918 | extern simd_double8 _simd_hypot_d8(simd_double8 x, simd_double8 y); | ||
| 4919 | static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) { | ||
| 4920 | return _simd_hypot_d8(x, y); | ||
| 4921 | } | ||
| 4922 | #else | ||
| 4923 | static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) { | ||
| 4924 | return simd_make_double8(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi)); | ||
| 4925 | } | ||
| 4926 | #endif | ||
| 4927 | |||
| 4928 | #pragma mark - pow implementation | ||
| 4929 | static inline SIMD_CFUNC simd_float2 __tg_pow(simd_float2 x, simd_float2 y) { | ||
| 4930 | return simd_make_float2(__tg_pow(simd_make_float4(x), simd_make_float4(y))); | ||
| 4931 | } | ||
| 4932 | |||
| 4933 | static inline SIMD_CFUNC simd_float3 __tg_pow(simd_float3 x, simd_float3 y) { | ||
| 4934 | return simd_make_float3(__tg_pow(simd_make_float4(x), simd_make_float4(y))); | ||
| 4935 | } | ||
| 4936 | |||
| 4937 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4938 | extern simd_float4 _simd_pow_f4(simd_float4 x, simd_float4 y); | ||
| 4939 | static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) { | ||
| 4940 | return _simd_pow_f4(x, y); | ||
| 4941 | } | ||
| 4942 | #else | ||
| 4943 | static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) { | ||
| 4944 | return simd_make_float4(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z), pow(x.w, y.w)); | ||
| 4945 | } | ||
| 4946 | #endif | ||
| 4947 | |||
| 4948 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4949 | extern simd_float8 _simd_pow_f8(simd_float8 x, simd_float8 y); | ||
| 4950 | static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) { | ||
| 4951 | return _simd_pow_f8(x, y); | ||
| 4952 | } | ||
| 4953 | #else | ||
| 4954 | static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) { | ||
| 4955 | return simd_make_float8(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi)); | ||
| 4956 | } | ||
| 4957 | #endif | ||
| 4958 | |||
| 4959 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4960 | extern simd_float16 _simd_pow_f16(simd_float16 x, simd_float16 y); | ||
| 4961 | static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) { | ||
| 4962 | return _simd_pow_f16(x, y); | ||
| 4963 | } | ||
| 4964 | #else | ||
| 4965 | static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) { | ||
| 4966 | return simd_make_float16(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi)); | ||
| 4967 | } | ||
| 4968 | #endif | ||
| 4969 | |||
| 4970 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 4971 | extern simd_double2 _simd_pow_d2(simd_double2 x, simd_double2 y); | ||
| 4972 | static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) { | ||
| 4973 | return _simd_pow_d2(x, y); | ||
| 4974 | } | ||
| 4975 | #else | ||
| 4976 | static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) { | ||
| 4977 | return simd_make_double2(pow(x.x, y.x), pow(x.y, y.y)); | ||
| 4978 | } | ||
| 4979 | #endif | ||
| 4980 | |||
| 4981 | static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y) { | ||
| 4982 | return simd_make_double3(__tg_pow(simd_make_double4(x), simd_make_double4(y))); | ||
| 4983 | } | ||
| 4984 | |||
| 4985 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 4986 | extern simd_double4 _simd_pow_d4(simd_double4 x, simd_double4 y); | ||
| 4987 | static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) { | ||
| 4988 | return _simd_pow_d4(x, y); | ||
| 4989 | } | ||
| 4990 | #else | ||
| 4991 | static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) { | ||
| 4992 | return simd_make_double4(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi)); | ||
| 4993 | } | ||
| 4994 | #endif | ||
| 4995 | |||
| 4996 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 4997 | extern simd_double8 _simd_pow_d8(simd_double8 x, simd_double8 y); | ||
| 4998 | static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) { | ||
| 4999 | return _simd_pow_d8(x, y); | ||
| 5000 | } | ||
| 5001 | #else | ||
| 5002 | static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) { | ||
| 5003 | return simd_make_double8(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi)); | ||
| 5004 | } | ||
| 5005 | #endif | ||
| 5006 | |||
| 5007 | #pragma mark - fmod implementation | ||
| 5008 | static inline SIMD_CFUNC simd_float2 __tg_fmod(simd_float2 x, simd_float2 y) { | ||
| 5009 | return simd_make_float2(__tg_fmod(simd_make_float4(x), simd_make_float4(y))); | ||
| 5010 | } | ||
| 5011 | |||
| 5012 | static inline SIMD_CFUNC simd_float3 __tg_fmod(simd_float3 x, simd_float3 y) { | ||
| 5013 | return simd_make_float3(__tg_fmod(simd_make_float4(x), simd_make_float4(y))); | ||
| 5014 | } | ||
| 5015 | |||
| 5016 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5017 | extern simd_float4 _simd_fmod_f4(simd_float4 x, simd_float4 y); | ||
| 5018 | static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) { | ||
| 5019 | return _simd_fmod_f4(x, y); | ||
| 5020 | } | ||
| 5021 | #else | ||
| 5022 | static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) { | ||
| 5023 | return simd_make_float4(fmod(x.x, y.x), fmod(x.y, y.y), fmod(x.z, y.z), fmod(x.w, y.w)); | ||
| 5024 | } | ||
| 5025 | #endif | ||
| 5026 | |||
| 5027 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 5028 | extern simd_float8 _simd_fmod_f8(simd_float8 x, simd_float8 y); | ||
| 5029 | static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) { | ||
| 5030 | return _simd_fmod_f8(x, y); | ||
| 5031 | } | ||
| 5032 | #else | ||
| 5033 | static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) { | ||
| 5034 | return simd_make_float8(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi)); | ||
| 5035 | } | ||
| 5036 | #endif | ||
| 5037 | |||
| 5038 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 5039 | extern simd_float16 _simd_fmod_f16(simd_float16 x, simd_float16 y); | ||
| 5040 | static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) { | ||
| 5041 | return _simd_fmod_f16(x, y); | ||
| 5042 | } | ||
| 5043 | #else | ||
| 5044 | static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) { | ||
| 5045 | return simd_make_float16(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi)); | ||
| 5046 | } | ||
| 5047 | #endif | ||
| 5048 | |||
| 5049 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5050 | extern simd_double2 _simd_fmod_d2(simd_double2 x, simd_double2 y); | ||
| 5051 | static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) { | ||
| 5052 | return _simd_fmod_d2(x, y); | ||
| 5053 | } | ||
| 5054 | #else | ||
| 5055 | static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) { | ||
| 5056 | return simd_make_double2(fmod(x.x, y.x), fmod(x.y, y.y)); | ||
| 5057 | } | ||
| 5058 | #endif | ||
| 5059 | |||
| 5060 | static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y) { | ||
| 5061 | return simd_make_double3(__tg_fmod(simd_make_double4(x), simd_make_double4(y))); | ||
| 5062 | } | ||
| 5063 | |||
| 5064 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 5065 | extern simd_double4 _simd_fmod_d4(simd_double4 x, simd_double4 y); | ||
| 5066 | static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) { | ||
| 5067 | return _simd_fmod_d4(x, y); | ||
| 5068 | } | ||
| 5069 | #else | ||
| 5070 | static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) { | ||
| 5071 | return simd_make_double4(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi)); | ||
| 5072 | } | ||
| 5073 | #endif | ||
| 5074 | |||
| 5075 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 5076 | extern simd_double8 _simd_fmod_d8(simd_double8 x, simd_double8 y); | ||
| 5077 | static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) { | ||
| 5078 | return _simd_fmod_d8(x, y); | ||
| 5079 | } | ||
| 5080 | #else | ||
| 5081 | static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) { | ||
| 5082 | return simd_make_double8(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi)); | ||
| 5083 | } | ||
| 5084 | #endif | ||
| 5085 | |||
| 5086 | #pragma mark - remainder implementation | ||
| 5087 | static inline SIMD_CFUNC simd_float2 __tg_remainder(simd_float2 x, simd_float2 y) { | ||
| 5088 | return simd_make_float2(__tg_remainder(simd_make_float4(x), simd_make_float4(y))); | ||
| 5089 | } | ||
| 5090 | |||
| 5091 | static inline SIMD_CFUNC simd_float3 __tg_remainder(simd_float3 x, simd_float3 y) { | ||
| 5092 | return simd_make_float3(__tg_remainder(simd_make_float4(x), simd_make_float4(y))); | ||
| 5093 | } | ||
| 5094 | |||
| 5095 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5096 | extern simd_float4 _simd_remainder_f4(simd_float4 x, simd_float4 y); | ||
| 5097 | static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) { | ||
| 5098 | return _simd_remainder_f4(x, y); | ||
| 5099 | } | ||
| 5100 | #else | ||
| 5101 | static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) { | ||
| 5102 | return simd_make_float4(remainder(x.x, y.x), remainder(x.y, y.y), remainder(x.z, y.z), remainder(x.w, y.w)); | ||
| 5103 | } | ||
| 5104 | #endif | ||
| 5105 | |||
| 5106 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 5107 | extern simd_float8 _simd_remainder_f8(simd_float8 x, simd_float8 y); | ||
| 5108 | static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) { | ||
| 5109 | return _simd_remainder_f8(x, y); | ||
| 5110 | } | ||
| 5111 | #else | ||
| 5112 | static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) { | ||
| 5113 | return simd_make_float8(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi)); | ||
| 5114 | } | ||
| 5115 | #endif | ||
| 5116 | |||
| 5117 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 5118 | extern simd_float16 _simd_remainder_f16(simd_float16 x, simd_float16 y); | ||
| 5119 | static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) { | ||
| 5120 | return _simd_remainder_f16(x, y); | ||
| 5121 | } | ||
| 5122 | #else | ||
| 5123 | static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) { | ||
| 5124 | return simd_make_float16(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi)); | ||
| 5125 | } | ||
| 5126 | #endif | ||
| 5127 | |||
| 5128 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5129 | extern simd_double2 _simd_remainder_d2(simd_double2 x, simd_double2 y); | ||
| 5130 | static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) { | ||
| 5131 | return _simd_remainder_d2(x, y); | ||
| 5132 | } | ||
| 5133 | #else | ||
| 5134 | static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) { | ||
| 5135 | return simd_make_double2(remainder(x.x, y.x), remainder(x.y, y.y)); | ||
| 5136 | } | ||
| 5137 | #endif | ||
| 5138 | |||
| 5139 | static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double3 y) { | ||
| 5140 | return simd_make_double3(__tg_remainder(simd_make_double4(x), simd_make_double4(y))); | ||
| 5141 | } | ||
| 5142 | |||
| 5143 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 5144 | extern simd_double4 _simd_remainder_d4(simd_double4 x, simd_double4 y); | ||
| 5145 | static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) { | ||
| 5146 | return _simd_remainder_d4(x, y); | ||
| 5147 | } | ||
| 5148 | #else | ||
| 5149 | static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) { | ||
| 5150 | return simd_make_double4(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi)); | ||
| 5151 | } | ||
| 5152 | #endif | ||
| 5153 | |||
| 5154 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 5155 | extern simd_double8 _simd_remainder_d8(simd_double8 x, simd_double8 y); | ||
| 5156 | static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) { | ||
| 5157 | return _simd_remainder_d8(x, y); | ||
| 5158 | } | ||
| 5159 | #else | ||
| 5160 | static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) { | ||
| 5161 | return simd_make_double8(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi)); | ||
| 5162 | } | ||
| 5163 | #endif | ||
| 5164 | |||
| 5165 | #pragma mark - nextafter implementation | ||
| 5166 | static inline SIMD_CFUNC simd_float2 __tg_nextafter(simd_float2 x, simd_float2 y) { | ||
| 5167 | return simd_make_float2(__tg_nextafter(simd_make_float4(x), simd_make_float4(y))); | ||
| 5168 | } | ||
| 5169 | |||
| 5170 | static inline SIMD_CFUNC simd_float3 __tg_nextafter(simd_float3 x, simd_float3 y) { | ||
| 5171 | return simd_make_float3(__tg_nextafter(simd_make_float4(x), simd_make_float4(y))); | ||
| 5172 | } | ||
| 5173 | |||
| 5174 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5175 | extern simd_float4 _simd_nextafter_f4(simd_float4 x, simd_float4 y); | ||
| 5176 | static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) { | ||
| 5177 | return _simd_nextafter_f4(x, y); | ||
| 5178 | } | ||
| 5179 | #else | ||
| 5180 | static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) { | ||
| 5181 | return simd_make_float4(nextafter(x.x, y.x), nextafter(x.y, y.y), nextafter(x.z, y.z), nextafter(x.w, y.w)); | ||
| 5182 | } | ||
| 5183 | #endif | ||
| 5184 | |||
| 5185 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 5186 | extern simd_float8 _simd_nextafter_f8(simd_float8 x, simd_float8 y); | ||
| 5187 | static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) { | ||
| 5188 | return _simd_nextafter_f8(x, y); | ||
| 5189 | } | ||
| 5190 | #else | ||
| 5191 | static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) { | ||
| 5192 | return simd_make_float8(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi)); | ||
| 5193 | } | ||
| 5194 | #endif | ||
| 5195 | |||
| 5196 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 5197 | extern simd_float16 _simd_nextafter_f16(simd_float16 x, simd_float16 y); | ||
| 5198 | static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) { | ||
| 5199 | return _simd_nextafter_f16(x, y); | ||
| 5200 | } | ||
| 5201 | #else | ||
| 5202 | static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) { | ||
| 5203 | return simd_make_float16(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi)); | ||
| 5204 | } | ||
| 5205 | #endif | ||
| 5206 | |||
| 5207 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5208 | extern simd_double2 _simd_nextafter_d2(simd_double2 x, simd_double2 y); | ||
| 5209 | static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) { | ||
| 5210 | return _simd_nextafter_d2(x, y); | ||
| 5211 | } | ||
| 5212 | #else | ||
| 5213 | static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) { | ||
| 5214 | return simd_make_double2(nextafter(x.x, y.x), nextafter(x.y, y.y)); | ||
| 5215 | } | ||
| 5216 | #endif | ||
| 5217 | |||
| 5218 | static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double3 y) { | ||
| 5219 | return simd_make_double3(__tg_nextafter(simd_make_double4(x), simd_make_double4(y))); | ||
| 5220 | } | ||
| 5221 | |||
| 5222 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ | ||
| 5223 | extern simd_double4 _simd_nextafter_d4(simd_double4 x, simd_double4 y); | ||
| 5224 | static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) { | ||
| 5225 | return _simd_nextafter_d4(x, y); | ||
| 5226 | } | ||
| 5227 | #else | ||
| 5228 | static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) { | ||
| 5229 | return simd_make_double4(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi)); | ||
| 5230 | } | ||
| 5231 | #endif | ||
| 5232 | |||
| 5233 | #if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ | ||
| 5234 | extern simd_double8 _simd_nextafter_d8(simd_double8 x, simd_double8 y); | ||
| 5235 | static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) { | ||
| 5236 | return _simd_nextafter_d8(x, y); | ||
| 5237 | } | ||
| 5238 | #else | ||
| 5239 | static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) { | ||
| 5240 | return simd_make_double8(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi)); | ||
| 5241 | } | ||
| 5242 | #endif | ||
| 5243 | |||
| 5244 | static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5245 | static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5246 | static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5247 | static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5248 | static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5249 | static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5250 | static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5251 | static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5252 | static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); } | ||
| 5253 | |||
| 5254 | static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z) { | ||
| 5255 | #if defined __arm64__ || defined __ARM_VFPV4__ | ||
| 5256 | return vfma_f32(z, x, y); | ||
| 5257 | #else | ||
| 5258 | return simd_make_float2(__tg_fma(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_float4_undef(z))); | ||
| 5259 | #endif | ||
| 5260 | } | ||
| 5261 | |||
| 5262 | static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd_float3 z) { | ||
| 5263 | return simd_make_float3(__tg_fma(simd_make_float4(x), simd_make_float4(y), simd_make_float4(z))); | ||
| 5264 | } | ||
| 5265 | |||
| 5266 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5267 | extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z); | ||
| 5268 | #endif | ||
| 5269 | static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z) { | ||
| 5270 | #if defined __arm64__ || defined __ARM_VFPV4__ | ||
| 5271 | return vfmaq_f32(z, x, y); | ||
| 5272 | #elif (defined __i386__ || defined __x86_64__) && defined __FMA__ | ||
| 5273 | return _mm_fmadd_ps(x, y, z); | ||
| 5274 | #elif SIMD_LIBRARY_VERSION >= 3 | ||
| 5275 | return _simd_fma_f4(x, y, z); | ||
| 5276 | #else | ||
| 5277 | return simd_make_float4(fma(x.x, y.x, z.x), fma(x.y, y.y, z.y), fma(x.z, y.z, z.z), fma(x.w, y.w, z.w)); | ||
| 5278 | #endif | ||
| 5279 | } | ||
| 5280 | |||
| 5281 | static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd_float8 z) { | ||
| 5282 | #if (defined __i386__ || defined __x86_64__) && defined __FMA__ | ||
| 5283 | return _mm256_fmadd_ps(x, y, z); | ||
| 5284 | #else | ||
| 5285 | return simd_make_float8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi)); | ||
| 5286 | #endif | ||
| 5287 | } | ||
| 5288 | |||
| 5289 | static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z) { | ||
| 5290 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 5291 | return _mm512_fmadd_ps(x, y, z); | ||
| 5292 | #else | ||
| 5293 | return simd_make_float16(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi)); | ||
| 5294 | #endif | ||
| 5295 | } | ||
| 5296 | |||
| 5297 | #if SIMD_LIBRARY_VERSION >= 3 | ||
| 5298 | extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z); | ||
| 5299 | #endif | ||
| 5300 | static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z) { | ||
| 5301 | #if defined __arm64__ | ||
| 5302 | return vfmaq_f64(z, x, y); | ||
| 5303 | #elif (defined __i386__ || defined __x86_64__) && defined __FMA__ | ||
| 5304 | return _mm_fmadd_pd(x, y, z); | ||
| 5305 | #elif SIMD_LIBRARY_VERSION >= 3 | ||
| 5306 | return _simd_fma_d2(x, y, z); | ||
| 5307 | #else | ||
| 5308 | return simd_make_double2(fma(x.x, y.x, z.x), fma(x.y, y.y, z.y)); | ||
| 5309 | #endif | ||
| 5310 | } | ||
| 5311 | |||
| 5312 | static inline SIMD_CFUNC simd_double3 __tg_fma(simd_double3 x, simd_double3 y, simd_double3 z) { | ||
| 5313 | return simd_make_double3(__tg_fma(simd_make_double4(x), simd_make_double4(y), simd_make_double4(z))); | ||
| 5314 | } | ||
| 5315 | |||
| 5316 | static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, simd_double4 z) { | ||
| 5317 | #if (defined __i386__ || defined __x86_64__) && defined __FMA__ | ||
| 5318 | return _mm256_fmadd_pd(x, y, z); | ||
| 5319 | #else | ||
| 5320 | return simd_make_double4(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi)); | ||
| 5321 | #endif | ||
| 5322 | } | ||
| 5323 | |||
| 5324 | static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z) { | ||
| 5325 | #if defined __x86_64__ && defined __AVX512F__ | ||
| 5326 | return _mm512_fmadd_pd(x, y, z); | ||
| 5327 | #else | ||
| 5328 | return simd_make_double8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi)); | ||
| 5329 | #endif | ||
| 5330 | } | ||
| 5331 | |||
| 5332 | static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) { | ||
| 5333 | #pragma STDC FP_CONTRACT ON | ||
| 5334 | return x*y + z; | ||
| 5335 | } | ||
| 5336 | static inline SIMD_CFUNC simd_float2 simd_muladd(simd_float2 x, simd_float2 y, simd_float2 z) { | ||
| 5337 | #pragma STDC FP_CONTRACT ON | ||
| 5338 | return x*y + z; | ||
| 5339 | } | ||
| 5340 | static inline SIMD_CFUNC simd_float3 simd_muladd(simd_float3 x, simd_float3 y, simd_float3 z) { | ||
| 5341 | #pragma STDC FP_CONTRACT ON | ||
| 5342 | return x*y + z; | ||
| 5343 | } | ||
| 5344 | static inline SIMD_CFUNC simd_float4 simd_muladd(simd_float4 x, simd_float4 y, simd_float4 z) { | ||
| 5345 | #pragma STDC FP_CONTRACT ON | ||
| 5346 | return x*y + z; | ||
| 5347 | } | ||
| 5348 | static inline SIMD_CFUNC simd_float8 simd_muladd(simd_float8 x, simd_float8 y, simd_float8 z) { | ||
| 5349 | #pragma STDC FP_CONTRACT ON | ||
| 5350 | return x*y + z; | ||
| 5351 | } | ||
| 5352 | static inline SIMD_CFUNC simd_float16 simd_muladd(simd_float16 x, simd_float16 y, simd_float16 z) { | ||
| 5353 | #pragma STDC FP_CONTRACT ON | ||
| 5354 | return x*y + z; | ||
| 5355 | } | ||
| 5356 | static inline SIMD_CFUNC double simd_muladd(double x, double y, double z) { | ||
| 5357 | #pragma STDC FP_CONTRACT ON | ||
| 5358 | return x*y + z; | ||
| 5359 | } | ||
| 5360 | static inline SIMD_CFUNC simd_double2 simd_muladd(simd_double2 x, simd_double2 y, simd_double2 z) { | ||
| 5361 | #pragma STDC FP_CONTRACT ON | ||
| 5362 | return x*y + z; | ||
| 5363 | } | ||
| 5364 | static inline SIMD_CFUNC simd_double3 simd_muladd(simd_double3 x, simd_double3 y, simd_double3 z) { | ||
| 5365 | #pragma STDC FP_CONTRACT ON | ||
| 5366 | return x*y + z; | ||
| 5367 | } | ||
| 5368 | static inline SIMD_CFUNC simd_double4 simd_muladd(simd_double4 x, simd_double4 y, simd_double4 z) { | ||
| 5369 | #pragma STDC FP_CONTRACT ON | ||
| 5370 | return x*y + z; | ||
| 5371 | } | ||
| 5372 | static inline SIMD_CFUNC simd_double8 simd_muladd(simd_double8 x, simd_double8 y, simd_double8 z) { | ||
| 5373 | #pragma STDC FP_CONTRACT ON | ||
| 5374 | return x*y + z; | ||
| 5375 | } | ||
| 5376 | #ifdef __cplusplus | ||
| 5377 | } /* extern "C" */ | ||
| 5378 | #endif | ||
| 5379 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 5380 | #endif /* SIMD_MATH_HEADER */ | ||
lib/libc/include/x86_64-macos-gnu/simd/matrix.h created+1786| ... | @@ -0,0 +1,1786 @@ | ||
| 1 | /* Copyright (c) 2014-2017 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * Function Result | ||
| 4 | * ------------------------------------------------------------------ | ||
| 5 | * | ||
| 6 | * simd_diagonal_matrix(x) A square matrix with the vector x | ||
| 7 | * as its diagonal. | ||
| 8 | * | ||
| 9 | * simd_matrix(c0, c1, ... ) A matrix with the specified vectors | ||
| 10 | * as columns. | ||
| 11 | * | ||
| 12 | * simd_matrix_from_rows(r0, r1, ... ) A matrix with the specified vectors | ||
| 13 | * as rows. | ||
| 14 | * | ||
| 15 | * simd_mul(a,x) Scalar product a*x. | ||
| 16 | * | ||
| 17 | * simd_linear_combination(a,x,b,y) a*x + b*y. | ||
| 18 | * | ||
| 19 | * simd_add(x,y) Macro wrapping linear_combination | ||
| 20 | * to compute x + y. | ||
| 21 | * | ||
| 22 | * simd_sub(x,y) Macro wrapping linear_combination | ||
| 23 | * to compute x - y. | ||
| 24 | * | ||
| 25 | * simd_transpose(x) Transpose of the matrix x. | ||
| 26 | * | ||
| 27 | * simd_inverse(x) Inverse of x if x is non-singular. If | ||
| 28 | * x is singular, the result is undefined. | ||
| 29 | * | ||
| 30 | * simd_mul(x,y) If x is a matrix, returns the matrix | ||
| 31 | * product x*y, where y is either a matrix | ||
| 32 | * or a column vector. If x is a vector, | ||
| 33 | * returns the product x*y where x is | ||
| 34 | * interpreted as a row vector. | ||
| 35 | * | ||
| 36 | * simd_equal(x,y) Returns true if and only if every | ||
| 37 | * element of x is exactly equal to the | ||
| 38 | * corresponding element of y. | ||
| 39 | * | ||
| 40 | * simd_almost_equal_elements(x,y,tol) | ||
| 41 | * Returns true if and only if for each | ||
| 42 | * entry xij in x, the corresponding | ||
| 43 | * element yij in y satisfies | ||
| 44 | * |xij - yij| <= tol. | ||
| 45 | * | ||
| 46 | * simd_almost_equal_elements_relative(x,y,tol) | ||
| 47 | * Returns true if and only if for each | ||
| 48 | * entry xij in x, the corresponding | ||
| 49 | * element yij in y satisfies | ||
| 50 | * |xij - yij| <= tol*|xij|. | ||
| 51 | * | ||
| 52 | * The header also defines a few useful global matrix objects: | ||
| 53 | * matrix_identity_floatNxM and matrix_identity_doubleNxM, may be used to get | ||
| 54 | * an identity matrix of the specified size. | ||
| 55 | * | ||
| 56 | * In C++, we are able to use namespacing to make the functions more concise; | ||
| 57 | * we also overload some common arithmetic operators to work with the matrix | ||
| 58 | * types: | ||
| 59 | * | ||
| 60 | * C++ Function Equivalent C Function | ||
| 61 | * -------------------------------------------------------------------- | ||
| 62 | * simd::inverse simd_inverse | ||
| 63 | * simd::transpose simd_transpose | ||
| 64 | * operator+ simd_add | ||
| 65 | * operator- simd_sub | ||
| 66 | * operator+= N/A | ||
| 67 | * operator-= N/A | ||
| 68 | * operator* simd_mul or simd_mul | ||
| 69 | * operator*= simd_mul or simd_mul | ||
| 70 | * operator== simd_equal | ||
| 71 | * operator!= !simd_equal | ||
| 72 | * simd::almost_equal_elements simd_almost_equal_elements | ||
| 73 | * simd::almost_equal_elements_relative simd_almost_equal_elements_relative | ||
| 74 | * | ||
| 75 | * <simd/matrix_types.h> provides constructors for C++ matrix types. | ||
| 76 | */ | ||
| 77 | |||
| 78 | #ifndef SIMD_MATRIX_HEADER | ||
| 79 | #define SIMD_MATRIX_HEADER | ||
| 80 | |||
| 81 | #include <simd/base.h> | ||
| 82 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 83 | #include <simd/matrix_types.h> | ||
| 84 | #include <simd/geometry.h> | ||
| 85 | #include <simd/extern.h> | ||
| 86 | #include <simd/logic.h> | ||
| 87 | |||
| 88 | #ifdef __cplusplus | ||
| 89 | extern "C" { | ||
| 90 | #endif | ||
| 91 | |||
| 92 | extern const simd_float2x2 matrix_identity_float2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 93 | extern const simd_float3x3 matrix_identity_float3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 94 | extern const simd_float4x4 matrix_identity_float4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 95 | extern const simd_double2x2 matrix_identity_double2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 96 | extern const simd_double3x3 matrix_identity_double3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 97 | extern const simd_double4x4 matrix_identity_double4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 98 | |||
| 99 | static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x); | ||
| 100 | static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x); | ||
| 101 | static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x); | ||
| 102 | static simd_double2x2 SIMD_CFUNC simd_diagonal_matrix(simd_double2 __x); | ||
| 103 | static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x); | ||
| 104 | static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x); | ||
| 105 | #define matrix_from_diagonal simd_diagonal_matrix | ||
| 106 | |||
| 107 | static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1); | ||
| 108 | static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2); | ||
| 109 | static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3); | ||
| 110 | static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1); | ||
| 111 | static simd_float3x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2); | ||
| 112 | static simd_float4x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2, simd_float3 col3); | ||
| 113 | static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1); | ||
| 114 | static simd_float3x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2); | ||
| 115 | static simd_float4x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2, simd_float4 col3); | ||
| 116 | static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1); | ||
| 117 | static simd_double3x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2); | ||
| 118 | static simd_double4x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2, simd_double2 col3); | ||
| 119 | static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1); | ||
| 120 | static simd_double3x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2); | ||
| 121 | static simd_double4x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2, simd_double3 col3); | ||
| 122 | static simd_double2x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1); | ||
| 123 | static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2); | ||
| 124 | static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3); | ||
| 125 | #define matrix_from_columns simd_matrix | ||
| 126 | |||
| 127 | static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1); | ||
| 128 | static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2); | ||
| 129 | static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3); | ||
| 130 | static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1); | ||
| 131 | static simd_float3x3 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2); | ||
| 132 | static simd_float3x4 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2, simd_float3 row3); | ||
| 133 | static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1); | ||
| 134 | static simd_float4x3 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2); | ||
| 135 | static simd_float4x4 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2, simd_float4 row3); | ||
| 136 | static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1); | ||
| 137 | static simd_double2x3 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2); | ||
| 138 | static simd_double2x4 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2, simd_double2 row3); | ||
| 139 | static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1); | ||
| 140 | static simd_double3x3 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2); | ||
| 141 | static simd_double3x4 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2, simd_double3 row3); | ||
| 142 | static simd_double4x2 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1); | ||
| 143 | static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2); | ||
| 144 | static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3); | ||
| 145 | #define matrix_from_rows simd_matrix_from_rows | ||
| 146 | |||
| 147 | static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q); | ||
| 148 | static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q); | ||
| 149 | static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q); | ||
| 150 | static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q); | ||
| 151 | |||
| 152 | static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x); | ||
| 153 | static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x); | ||
| 154 | static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x); | ||
| 155 | static simd_float2x3 SIMD_CFUNC simd_mul(float __a, simd_float2x3 __x); | ||
| 156 | static simd_float3x3 SIMD_CFUNC simd_mul(float __a, simd_float3x3 __x); | ||
| 157 | static simd_float4x3 SIMD_CFUNC simd_mul(float __a, simd_float4x3 __x); | ||
| 158 | static simd_float2x4 SIMD_CFUNC simd_mul(float __a, simd_float2x4 __x); | ||
| 159 | static simd_float3x4 SIMD_CFUNC simd_mul(float __a, simd_float3x4 __x); | ||
| 160 | static simd_float4x4 SIMD_CFUNC simd_mul(float __a, simd_float4x4 __x); | ||
| 161 | static simd_double2x2 SIMD_CFUNC simd_mul(double __a, simd_double2x2 __x); | ||
| 162 | static simd_double3x2 SIMD_CFUNC simd_mul(double __a, simd_double3x2 __x); | ||
| 163 | static simd_double4x2 SIMD_CFUNC simd_mul(double __a, simd_double4x2 __x); | ||
| 164 | static simd_double2x3 SIMD_CFUNC simd_mul(double __a, simd_double2x3 __x); | ||
| 165 | static simd_double3x3 SIMD_CFUNC simd_mul(double __a, simd_double3x3 __x); | ||
| 166 | static simd_double4x3 SIMD_CFUNC simd_mul(double __a, simd_double4x3 __x); | ||
| 167 | static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x); | ||
| 168 | static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x); | ||
| 169 | static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x); | ||
| 170 | |||
| 171 | static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y); | ||
| 172 | static simd_float3x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x2 __x, float __b, simd_float3x2 __y); | ||
| 173 | static simd_float4x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x2 __x, float __b, simd_float4x2 __y); | ||
| 174 | static simd_float2x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x3 __x, float __b, simd_float2x3 __y); | ||
| 175 | static simd_float3x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x3 __x, float __b, simd_float3x3 __y); | ||
| 176 | static simd_float4x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x3 __x, float __b, simd_float4x3 __y); | ||
| 177 | static simd_float2x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x4 __x, float __b, simd_float2x4 __y); | ||
| 178 | static simd_float3x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x4 __x, float __b, simd_float3x4 __y); | ||
| 179 | static simd_float4x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x4 __x, float __b, simd_float4x4 __y); | ||
| 180 | static simd_double2x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x2 __x, double __b, simd_double2x2 __y); | ||
| 181 | static simd_double3x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x2 __x, double __b, simd_double3x2 __y); | ||
| 182 | static simd_double4x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x2 __x, double __b, simd_double4x2 __y); | ||
| 183 | static simd_double2x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x3 __x, double __b, simd_double2x3 __y); | ||
| 184 | static simd_double3x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x3 __x, double __b, simd_double3x3 __y); | ||
| 185 | static simd_double4x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x3 __x, double __b, simd_double4x3 __y); | ||
| 186 | static simd_double2x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x4 __x, double __b, simd_double2x4 __y); | ||
| 187 | static simd_double3x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x4 __x, double __b, simd_double3x4 __y); | ||
| 188 | static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x4 __x, double __b, simd_double4x4 __y); | ||
| 189 | #define matrix_linear_combination simd_linear_combination | ||
| 190 | |||
| 191 | static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y); | ||
| 192 | static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y); | ||
| 193 | static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y); | ||
| 194 | static simd_float2x3 SIMD_CFUNC simd_add(simd_float2x3 __x, simd_float2x3 __y); | ||
| 195 | static simd_float3x3 SIMD_CFUNC simd_add(simd_float3x3 __x, simd_float3x3 __y); | ||
| 196 | static simd_float4x3 SIMD_CFUNC simd_add(simd_float4x3 __x, simd_float4x3 __y); | ||
| 197 | static simd_float2x4 SIMD_CFUNC simd_add(simd_float2x4 __x, simd_float2x4 __y); | ||
| 198 | static simd_float3x4 SIMD_CFUNC simd_add(simd_float3x4 __x, simd_float3x4 __y); | ||
| 199 | static simd_float4x4 SIMD_CFUNC simd_add(simd_float4x4 __x, simd_float4x4 __y); | ||
| 200 | static simd_double2x2 SIMD_CFUNC simd_add(simd_double2x2 __x, simd_double2x2 __y); | ||
| 201 | static simd_double3x2 SIMD_CFUNC simd_add(simd_double3x2 __x, simd_double3x2 __y); | ||
| 202 | static simd_double4x2 SIMD_CFUNC simd_add(simd_double4x2 __x, simd_double4x2 __y); | ||
| 203 | static simd_double2x3 SIMD_CFUNC simd_add(simd_double2x3 __x, simd_double2x3 __y); | ||
| 204 | static simd_double3x3 SIMD_CFUNC simd_add(simd_double3x3 __x, simd_double3x3 __y); | ||
| 205 | static simd_double4x3 SIMD_CFUNC simd_add(simd_double4x3 __x, simd_double4x3 __y); | ||
| 206 | static simd_double2x4 SIMD_CFUNC simd_add(simd_double2x4 __x, simd_double2x4 __y); | ||
| 207 | static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y); | ||
| 208 | static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y); | ||
| 209 | #define matrix_add simd_add | ||
| 210 | |||
| 211 | static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y); | ||
| 212 | static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y); | ||
| 213 | static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y); | ||
| 214 | static simd_float2x3 SIMD_CFUNC simd_sub(simd_float2x3 __x, simd_float2x3 __y); | ||
| 215 | static simd_float3x3 SIMD_CFUNC simd_sub(simd_float3x3 __x, simd_float3x3 __y); | ||
| 216 | static simd_float4x3 SIMD_CFUNC simd_sub(simd_float4x3 __x, simd_float4x3 __y); | ||
| 217 | static simd_float2x4 SIMD_CFUNC simd_sub(simd_float2x4 __x, simd_float2x4 __y); | ||
| 218 | static simd_float3x4 SIMD_CFUNC simd_sub(simd_float3x4 __x, simd_float3x4 __y); | ||
| 219 | static simd_float4x4 SIMD_CFUNC simd_sub(simd_float4x4 __x, simd_float4x4 __y); | ||
| 220 | static simd_double2x2 SIMD_CFUNC simd_sub(simd_double2x2 __x, simd_double2x2 __y); | ||
| 221 | static simd_double3x2 SIMD_CFUNC simd_sub(simd_double3x2 __x, simd_double3x2 __y); | ||
| 222 | static simd_double4x2 SIMD_CFUNC simd_sub(simd_double4x2 __x, simd_double4x2 __y); | ||
| 223 | static simd_double2x3 SIMD_CFUNC simd_sub(simd_double2x3 __x, simd_double2x3 __y); | ||
| 224 | static simd_double3x3 SIMD_CFUNC simd_sub(simd_double3x3 __x, simd_double3x3 __y); | ||
| 225 | static simd_double4x3 SIMD_CFUNC simd_sub(simd_double4x3 __x, simd_double4x3 __y); | ||
| 226 | static simd_double2x4 SIMD_CFUNC simd_sub(simd_double2x4 __x, simd_double2x4 __y); | ||
| 227 | static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y); | ||
| 228 | static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y); | ||
| 229 | #define matrix_sub simd_sub | ||
| 230 | |||
| 231 | static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x); | ||
| 232 | static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x); | ||
| 233 | static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x); | ||
| 234 | static simd_float3x2 SIMD_CFUNC simd_transpose(simd_float2x3 __x); | ||
| 235 | static simd_float3x3 SIMD_CFUNC simd_transpose(simd_float3x3 __x); | ||
| 236 | static simd_float3x4 SIMD_CFUNC simd_transpose(simd_float4x3 __x); | ||
| 237 | static simd_float4x2 SIMD_CFUNC simd_transpose(simd_float2x4 __x); | ||
| 238 | static simd_float4x3 SIMD_CFUNC simd_transpose(simd_float3x4 __x); | ||
| 239 | static simd_float4x4 SIMD_CFUNC simd_transpose(simd_float4x4 __x); | ||
| 240 | static simd_double2x2 SIMD_CFUNC simd_transpose(simd_double2x2 __x); | ||
| 241 | static simd_double2x3 SIMD_CFUNC simd_transpose(simd_double3x2 __x); | ||
| 242 | static simd_double2x4 SIMD_CFUNC simd_transpose(simd_double4x2 __x); | ||
| 243 | static simd_double3x2 SIMD_CFUNC simd_transpose(simd_double2x3 __x); | ||
| 244 | static simd_double3x3 SIMD_CFUNC simd_transpose(simd_double3x3 __x); | ||
| 245 | static simd_double3x4 SIMD_CFUNC simd_transpose(simd_double4x3 __x); | ||
| 246 | static simd_double4x2 SIMD_CFUNC simd_transpose(simd_double2x4 __x); | ||
| 247 | static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x); | ||
| 248 | static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x); | ||
| 249 | #define matrix_transpose simd_transpose | ||
| 250 | |||
| 251 | static float SIMD_CFUNC simd_determinant(simd_float2x2 __x); | ||
| 252 | static float SIMD_CFUNC simd_determinant(simd_float3x3 __x); | ||
| 253 | static float SIMD_CFUNC simd_determinant(simd_float4x4 __x); | ||
| 254 | static double SIMD_CFUNC simd_determinant(simd_double2x2 __x); | ||
| 255 | static double SIMD_CFUNC simd_determinant(simd_double3x3 __x); | ||
| 256 | static double SIMD_CFUNC simd_determinant(simd_double4x4 __x); | ||
| 257 | #define matrix_determinant simd_determinant | ||
| 258 | |||
| 259 | static simd_float2x2 SIMD_CFUNC simd_inverse(simd_float2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 260 | static simd_float3x3 SIMD_CFUNC simd_inverse(simd_float3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 261 | static simd_float4x4 SIMD_CFUNC simd_inverse(simd_float4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 262 | static simd_double2x2 SIMD_CFUNC simd_inverse(simd_double2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 263 | static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 264 | static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); | ||
| 265 | #define matrix_invert simd_inverse | ||
| 266 | |||
| 267 | static simd_float2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2 __y); | ||
| 268 | static simd_float2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3 __y); | ||
| 269 | static simd_float2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4 __y); | ||
| 270 | static simd_float3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float2 __y); | ||
| 271 | static simd_float3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float3 __y); | ||
| 272 | static simd_float3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float4 __y); | ||
| 273 | static simd_float4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float2 __y); | ||
| 274 | static simd_float4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float3 __y); | ||
| 275 | static simd_float4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float4 __y); | ||
| 276 | static simd_double2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2 __y); | ||
| 277 | static simd_double2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3 __y); | ||
| 278 | static simd_double2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4 __y); | ||
| 279 | static simd_double3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2 __y); | ||
| 280 | static simd_double3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3 __y); | ||
| 281 | static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y); | ||
| 282 | static simd_double4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2 __y); | ||
| 283 | static simd_double4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3 __y); | ||
| 284 | static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y); | ||
| 285 | static simd_float2 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float2x2 __y); | ||
| 286 | static simd_float3 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float3x2 __y); | ||
| 287 | static simd_float4 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float4x2 __y); | ||
| 288 | static simd_float2 SIMD_CFUNC simd_mul(simd_float3 __x, simd_float2x3 __y); | ||
| 289 | static simd_float3 SIMD_CFUNC simd_mul(simd_float3 __x, simd_float3x3 __y); | ||
| 290 | static simd_float4 SIMD_CFUNC simd_mul(simd_float3 __x, simd_float4x3 __y); | ||
| 291 | static simd_float2 SIMD_CFUNC simd_mul(simd_float4 __x, simd_float2x4 __y); | ||
| 292 | static simd_float3 SIMD_CFUNC simd_mul(simd_float4 __x, simd_float3x4 __y); | ||
| 293 | static simd_float4 SIMD_CFUNC simd_mul(simd_float4 __x, simd_float4x4 __y); | ||
| 294 | static simd_double2 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double2x2 __y); | ||
| 295 | static simd_double3 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double3x2 __y); | ||
| 296 | static simd_double4 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double4x2 __y); | ||
| 297 | static simd_double2 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double2x3 __y); | ||
| 298 | static simd_double3 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double3x3 __y); | ||
| 299 | static simd_double4 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double4x3 __y); | ||
| 300 | static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y); | ||
| 301 | static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y); | ||
| 302 | static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y); | ||
| 303 | static simd_float2x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2x2 __y); | ||
| 304 | static simd_float3x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float3x2 __y); | ||
| 305 | static simd_float4x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float4x2 __y); | ||
| 306 | static simd_float2x3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float2x2 __y); | ||
| 307 | static simd_float3x3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float3x2 __y); | ||
| 308 | static simd_float4x3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float4x2 __y); | ||
| 309 | static simd_float2x4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float2x2 __y); | ||
| 310 | static simd_float3x4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float3x2 __y); | ||
| 311 | static simd_float4x4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float4x2 __y); | ||
| 312 | static simd_double2x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2x2 __y); | ||
| 313 | static simd_double3x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double3x2 __y); | ||
| 314 | static simd_double4x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double4x2 __y); | ||
| 315 | static simd_double2x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2x2 __y); | ||
| 316 | static simd_double3x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double3x2 __y); | ||
| 317 | static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y); | ||
| 318 | static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y); | ||
| 319 | static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y); | ||
| 320 | static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y); | ||
| 321 | static simd_float2x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float2x3 __y); | ||
| 322 | static simd_float3x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3x3 __y); | ||
| 323 | static simd_float4x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float4x3 __y); | ||
| 324 | static simd_float2x3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float2x3 __y); | ||
| 325 | static simd_float3x3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float3x3 __y); | ||
| 326 | static simd_float4x3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float4x3 __y); | ||
| 327 | static simd_float2x4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float2x3 __y); | ||
| 328 | static simd_float3x4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float3x3 __y); | ||
| 329 | static simd_float4x4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float4x3 __y); | ||
| 330 | static simd_double2x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double2x3 __y); | ||
| 331 | static simd_double3x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3x3 __y); | ||
| 332 | static simd_double4x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double4x3 __y); | ||
| 333 | static simd_double2x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double2x3 __y); | ||
| 334 | static simd_double3x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3x3 __y); | ||
| 335 | static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y); | ||
| 336 | static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y); | ||
| 337 | static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y); | ||
| 338 | static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y); | ||
| 339 | static simd_float2x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float2x4 __y); | ||
| 340 | static simd_float3x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float3x4 __y); | ||
| 341 | static simd_float4x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4x4 __y); | ||
| 342 | static simd_float2x3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float2x4 __y); | ||
| 343 | static simd_float3x3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float3x4 __y); | ||
| 344 | static simd_float4x3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float4x4 __y); | ||
| 345 | static simd_float2x4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float2x4 __y); | ||
| 346 | static simd_float3x4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float3x4 __y); | ||
| 347 | static simd_float4x4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float4x4 __y); | ||
| 348 | static simd_double2x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double2x4 __y); | ||
| 349 | static simd_double3x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double3x4 __y); | ||
| 350 | static simd_double4x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4x4 __y); | ||
| 351 | static simd_double2x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double2x4 __y); | ||
| 352 | static simd_double3x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double3x4 __y); | ||
| 353 | static simd_double4x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4x4 __y); | ||
| 354 | static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y); | ||
| 355 | static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y); | ||
| 356 | static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y); | ||
| 357 | |||
| 358 | static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y); | ||
| 359 | static simd_bool SIMD_CFUNC simd_equal(simd_float2x3 __x, simd_float2x3 __y); | ||
| 360 | static simd_bool SIMD_CFUNC simd_equal(simd_float2x4 __x, simd_float2x4 __y); | ||
| 361 | static simd_bool SIMD_CFUNC simd_equal(simd_float3x2 __x, simd_float3x2 __y); | ||
| 362 | static simd_bool SIMD_CFUNC simd_equal(simd_float3x3 __x, simd_float3x3 __y); | ||
| 363 | static simd_bool SIMD_CFUNC simd_equal(simd_float3x4 __x, simd_float3x4 __y); | ||
| 364 | static simd_bool SIMD_CFUNC simd_equal(simd_float4x2 __x, simd_float4x2 __y); | ||
| 365 | static simd_bool SIMD_CFUNC simd_equal(simd_float4x3 __x, simd_float4x3 __y); | ||
| 366 | static simd_bool SIMD_CFUNC simd_equal(simd_float4x4 __x, simd_float4x4 __y); | ||
| 367 | static simd_bool SIMD_CFUNC simd_equal(simd_double2x2 __x, simd_double2x2 __y); | ||
| 368 | static simd_bool SIMD_CFUNC simd_equal(simd_double2x3 __x, simd_double2x3 __y); | ||
| 369 | static simd_bool SIMD_CFUNC simd_equal(simd_double2x4 __x, simd_double2x4 __y); | ||
| 370 | static simd_bool SIMD_CFUNC simd_equal(simd_double3x2 __x, simd_double3x2 __y); | ||
| 371 | static simd_bool SIMD_CFUNC simd_equal(simd_double3x3 __x, simd_double3x3 __y); | ||
| 372 | static simd_bool SIMD_CFUNC simd_equal(simd_double3x4 __x, simd_double3x4 __y); | ||
| 373 | static simd_bool SIMD_CFUNC simd_equal(simd_double4x2 __x, simd_double4x2 __y); | ||
| 374 | static simd_bool SIMD_CFUNC simd_equal(simd_double4x3 __x, simd_double4x3 __y); | ||
| 375 | static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y); | ||
| 376 | #define matrix_equal simd_equal | ||
| 377 | |||
| 378 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol); | ||
| 379 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x3 __x, simd_float2x3 __y, float __tol); | ||
| 380 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x4 __x, simd_float2x4 __y, float __tol); | ||
| 381 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x2 __x, simd_float3x2 __y, float __tol); | ||
| 382 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x3 __x, simd_float3x3 __y, float __tol); | ||
| 383 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x4 __x, simd_float3x4 __y, float __tol); | ||
| 384 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x2 __x, simd_float4x2 __y, float __tol); | ||
| 385 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x3 __x, simd_float4x3 __y, float __tol); | ||
| 386 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x4 __x, simd_float4x4 __y, float __tol); | ||
| 387 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x2 __x, simd_double2x2 __y, double __tol); | ||
| 388 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x3 __x, simd_double2x3 __y, double __tol); | ||
| 389 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x4 __x, simd_double2x4 __y, double __tol); | ||
| 390 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x2 __x, simd_double3x2 __y, double __tol); | ||
| 391 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x3 __x, simd_double3x3 __y, double __tol); | ||
| 392 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x4 __x, simd_double3x4 __y, double __tol); | ||
| 393 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x2 __x, simd_double4x2 __y, double __tol); | ||
| 394 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x3 __x, simd_double4x3 __y, double __tol); | ||
| 395 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_double4x4 __y, double __tol); | ||
| 396 | #define matrix_almost_equal_elements simd_almost_equal_elements | ||
| 397 | |||
| 398 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol); | ||
| 399 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x3 __x, simd_float2x3 __y, float __tol); | ||
| 400 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x4 __x, simd_float2x4 __y, float __tol); | ||
| 401 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x2 __x, simd_float3x2 __y, float __tol); | ||
| 402 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x3 __x, simd_float3x3 __y, float __tol); | ||
| 403 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x4 __x, simd_float3x4 __y, float __tol); | ||
| 404 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x2 __x, simd_float4x2 __y, float __tol); | ||
| 405 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x3 __x, simd_float4x3 __y, float __tol); | ||
| 406 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x4 __x, simd_float4x4 __y, float __tol); | ||
| 407 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x2 __x, simd_double2x2 __y, double __tol); | ||
| 408 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x3 __x, simd_double2x3 __y, double __tol); | ||
| 409 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x4 __x, simd_double2x4 __y, double __tol); | ||
| 410 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x2 __x, simd_double3x2 __y, double __tol); | ||
| 411 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x3 __x, simd_double3x3 __y, double __tol); | ||
| 412 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x4 __x, simd_double3x4 __y, double __tol); | ||
| 413 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x2 __x, simd_double4x2 __y, double __tol); | ||
| 414 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x3 __x, simd_double4x3 __y, double __tol); | ||
| 415 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x4 __x, simd_double4x4 __y, double __tol); | ||
| 416 | #define matrix_almost_equal_elements_relative simd_almost_equal_elements_relative | ||
| 417 | |||
| 418 | #ifdef __cplusplus | ||
| 419 | } /* extern "C" */ | ||
| 420 | |||
| 421 | namespace simd { | ||
| 422 | static SIMD_CPPFUNC float2x2 operator+(const float2x2 x, const float2x2 y) { return float2x2(::simd_linear_combination(1, x, 1, y)); } | ||
| 423 | static SIMD_CPPFUNC float2x3 operator+(const float2x3 x, const float2x3 y) { return float2x3(::simd_linear_combination(1, x, 1, y)); } | ||
| 424 | static SIMD_CPPFUNC float2x4 operator+(const float2x4 x, const float2x4 y) { return float2x4(::simd_linear_combination(1, x, 1, y)); } | ||
| 425 | static SIMD_CPPFUNC float3x2 operator+(const float3x2 x, const float3x2 y) { return float3x2(::simd_linear_combination(1, x, 1, y)); } | ||
| 426 | static SIMD_CPPFUNC float3x3 operator+(const float3x3 x, const float3x3 y) { return float3x3(::simd_linear_combination(1, x, 1, y)); } | ||
| 427 | static SIMD_CPPFUNC float3x4 operator+(const float3x4 x, const float3x4 y) { return float3x4(::simd_linear_combination(1, x, 1, y)); } | ||
| 428 | static SIMD_CPPFUNC float4x2 operator+(const float4x2 x, const float4x2 y) { return float4x2(::simd_linear_combination(1, x, 1, y)); } | ||
| 429 | static SIMD_CPPFUNC float4x3 operator+(const float4x3 x, const float4x3 y) { return float4x3(::simd_linear_combination(1, x, 1, y)); } | ||
| 430 | static SIMD_CPPFUNC float4x4 operator+(const float4x4 x, const float4x4 y) { return float4x4(::simd_linear_combination(1, x, 1, y)); } | ||
| 431 | |||
| 432 | static SIMD_CPPFUNC float2x2 operator-(const float2x2 x, const float2x2 y) { return float2x2(::simd_linear_combination(1, x, -1, y)); } | ||
| 433 | static SIMD_CPPFUNC float2x3 operator-(const float2x3 x, const float2x3 y) { return float2x3(::simd_linear_combination(1, x, -1, y)); } | ||
| 434 | static SIMD_CPPFUNC float2x4 operator-(const float2x4 x, const float2x4 y) { return float2x4(::simd_linear_combination(1, x, -1, y)); } | ||
| 435 | static SIMD_CPPFUNC float3x2 operator-(const float3x2 x, const float3x2 y) { return float3x2(::simd_linear_combination(1, x, -1, y)); } | ||
| 436 | static SIMD_CPPFUNC float3x3 operator-(const float3x3 x, const float3x3 y) { return float3x3(::simd_linear_combination(1, x, -1, y)); } | ||
| 437 | static SIMD_CPPFUNC float3x4 operator-(const float3x4 x, const float3x4 y) { return float3x4(::simd_linear_combination(1, x, -1, y)); } | ||
| 438 | static SIMD_CPPFUNC float4x2 operator-(const float4x2 x, const float4x2 y) { return float4x2(::simd_linear_combination(1, x, -1, y)); } | ||
| 439 | static SIMD_CPPFUNC float4x3 operator-(const float4x3 x, const float4x3 y) { return float4x3(::simd_linear_combination(1, x, -1, y)); } | ||
| 440 | static SIMD_CPPFUNC float4x4 operator-(const float4x4 x, const float4x4 y) { return float4x4(::simd_linear_combination(1, x, -1, y)); } | ||
| 441 | |||
| 442 | static SIMD_CPPFUNC float2x2& operator+=(float2x2& x, const float2x2 y) { x = x + y; return x; } | ||
| 443 | static SIMD_CPPFUNC float2x3& operator+=(float2x3& x, const float2x3 y) { x = x + y; return x; } | ||
| 444 | static SIMD_CPPFUNC float2x4& operator+=(float2x4& x, const float2x4 y) { x = x + y; return x; } | ||
| 445 | static SIMD_CPPFUNC float3x2& operator+=(float3x2& x, const float3x2 y) { x = x + y; return x; } | ||
| 446 | static SIMD_CPPFUNC float3x3& operator+=(float3x3& x, const float3x3 y) { x = x + y; return x; } | ||
| 447 | static SIMD_CPPFUNC float3x4& operator+=(float3x4& x, const float3x4 y) { x = x + y; return x; } | ||
| 448 | static SIMD_CPPFUNC float4x2& operator+=(float4x2& x, const float4x2 y) { x = x + y; return x; } | ||
| 449 | static SIMD_CPPFUNC float4x3& operator+=(float4x3& x, const float4x3 y) { x = x + y; return x; } | ||
| 450 | static SIMD_CPPFUNC float4x4& operator+=(float4x4& x, const float4x4 y) { x = x + y; return x; } | ||
| 451 | |||
| 452 | static SIMD_CPPFUNC float2x2& operator-=(float2x2& x, const float2x2 y) { x = x - y; return x; } | ||
| 453 | static SIMD_CPPFUNC float2x3& operator-=(float2x3& x, const float2x3 y) { x = x - y; return x; } | ||
| 454 | static SIMD_CPPFUNC float2x4& operator-=(float2x4& x, const float2x4 y) { x = x - y; return x; } | ||
| 455 | static SIMD_CPPFUNC float3x2& operator-=(float3x2& x, const float3x2 y) { x = x - y; return x; } | ||
| 456 | static SIMD_CPPFUNC float3x3& operator-=(float3x3& x, const float3x3 y) { x = x - y; return x; } | ||
| 457 | static SIMD_CPPFUNC float3x4& operator-=(float3x4& x, const float3x4 y) { x = x - y; return x; } | ||
| 458 | static SIMD_CPPFUNC float4x2& operator-=(float4x2& x, const float4x2 y) { x = x - y; return x; } | ||
| 459 | static SIMD_CPPFUNC float4x3& operator-=(float4x3& x, const float4x3 y) { x = x - y; return x; } | ||
| 460 | static SIMD_CPPFUNC float4x4& operator-=(float4x4& x, const float4x4 y) { x = x - y; return x; } | ||
| 461 | |||
| 462 | static SIMD_CPPFUNC float2x2 transpose(const float2x2 x) { return ::simd_transpose(x); } | ||
| 463 | static SIMD_CPPFUNC float2x3 transpose(const float3x2 x) { return ::simd_transpose(x); } | ||
| 464 | static SIMD_CPPFUNC float2x4 transpose(const float4x2 x) { return ::simd_transpose(x); } | ||
| 465 | static SIMD_CPPFUNC float3x2 transpose(const float2x3 x) { return ::simd_transpose(x); } | ||
| 466 | static SIMD_CPPFUNC float3x3 transpose(const float3x3 x) { return ::simd_transpose(x); } | ||
| 467 | static SIMD_CPPFUNC float3x4 transpose(const float4x3 x) { return ::simd_transpose(x); } | ||
| 468 | static SIMD_CPPFUNC float4x2 transpose(const float2x4 x) { return ::simd_transpose(x); } | ||
| 469 | static SIMD_CPPFUNC float4x3 transpose(const float3x4 x) { return ::simd_transpose(x); } | ||
| 470 | static SIMD_CPPFUNC float4x4 transpose(const float4x4 x) { return ::simd_transpose(x); } | ||
| 471 | |||
| 472 | static SIMD_CPPFUNC float determinant(const float2x2 x) { return ::simd_determinant(x); } | ||
| 473 | static SIMD_CPPFUNC float determinant(const float3x3 x) { return ::simd_determinant(x); } | ||
| 474 | static SIMD_CPPFUNC float determinant(const float4x4 x) { return ::simd_determinant(x); } | ||
| 475 | |||
| 476 | #pragma clang diagnostic push | ||
| 477 | #pragma clang diagnostic ignored "-Wgcc-compat" | ||
| 478 | static SIMD_CPPFUNC float2x2 inverse(const float2x2 x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) { return ::simd_inverse(x); } | ||
| 479 | static SIMD_CPPFUNC float3x3 inverse(const float3x3 x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) { return ::simd_inverse(x); } | ||
| 480 | static SIMD_CPPFUNC float4x4 inverse(const float4x4 x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) { return ::simd_inverse(x); } | ||
| 481 | #pragma clang diagnostic pop | ||
| 482 | |||
| 483 | static SIMD_CPPFUNC float2x2 operator*(const float a, const float2x2 x) { return ::simd_mul(a, x); } | ||
| 484 | static SIMD_CPPFUNC float2x3 operator*(const float a, const float2x3 x) { return ::simd_mul(a, x); } | ||
| 485 | static SIMD_CPPFUNC float2x4 operator*(const float a, const float2x4 x) { return ::simd_mul(a, x); } | ||
| 486 | static SIMD_CPPFUNC float3x2 operator*(const float a, const float3x2 x) { return ::simd_mul(a, x); } | ||
| 487 | static SIMD_CPPFUNC float3x3 operator*(const float a, const float3x3 x) { return ::simd_mul(a, x); } | ||
| 488 | static SIMD_CPPFUNC float3x4 operator*(const float a, const float3x4 x) { return ::simd_mul(a, x); } | ||
| 489 | static SIMD_CPPFUNC float4x2 operator*(const float a, const float4x2 x) { return ::simd_mul(a, x); } | ||
| 490 | static SIMD_CPPFUNC float4x3 operator*(const float a, const float4x3 x) { return ::simd_mul(a, x); } | ||
| 491 | static SIMD_CPPFUNC float4x4 operator*(const float a, const float4x4 x) { return ::simd_mul(a, x); } | ||
| 492 | static SIMD_CPPFUNC float2x2 operator*(const float2x2 x, const float a) { return ::simd_mul(a, x); } | ||
| 493 | static SIMD_CPPFUNC float2x3 operator*(const float2x3 x, const float a) { return ::simd_mul(a, x); } | ||
| 494 | static SIMD_CPPFUNC float2x4 operator*(const float2x4 x, const float a) { return ::simd_mul(a, x); } | ||
| 495 | static SIMD_CPPFUNC float3x2 operator*(const float3x2 x, const float a) { return ::simd_mul(a, x); } | ||
| 496 | static SIMD_CPPFUNC float3x3 operator*(const float3x3 x, const float a) { return ::simd_mul(a, x); } | ||
| 497 | static SIMD_CPPFUNC float3x4 operator*(const float3x4 x, const float a) { return ::simd_mul(a, x); } | ||
| 498 | static SIMD_CPPFUNC float4x2 operator*(const float4x2 x, const float a) { return ::simd_mul(a, x); } | ||
| 499 | static SIMD_CPPFUNC float4x3 operator*(const float4x3 x, const float a) { return ::simd_mul(a, x); } | ||
| 500 | static SIMD_CPPFUNC float4x4 operator*(const float4x4 x, const float a) { return ::simd_mul(a, x); } | ||
| 501 | static SIMD_CPPFUNC float2x2& operator*=(float2x2& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 502 | static SIMD_CPPFUNC float2x3& operator*=(float2x3& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 503 | static SIMD_CPPFUNC float2x4& operator*=(float2x4& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 504 | static SIMD_CPPFUNC float3x2& operator*=(float3x2& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 505 | static SIMD_CPPFUNC float3x3& operator*=(float3x3& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 506 | static SIMD_CPPFUNC float3x4& operator*=(float3x4& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 507 | static SIMD_CPPFUNC float4x2& operator*=(float4x2& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 508 | static SIMD_CPPFUNC float4x3& operator*=(float4x3& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 509 | static SIMD_CPPFUNC float4x4& operator*=(float4x4& x, const float a) { x = ::simd_mul(a, x); return x; } | ||
| 510 | |||
| 511 | static SIMD_CPPFUNC float2 operator*(const float2 x, const float2x2 y) { return ::simd_mul(x, y); } | ||
| 512 | static SIMD_CPPFUNC float3 operator*(const float2 x, const float3x2 y) { return ::simd_mul(x, y); } | ||
| 513 | static SIMD_CPPFUNC float4 operator*(const float2 x, const float4x2 y) { return ::simd_mul(x, y); } | ||
| 514 | static SIMD_CPPFUNC float2 operator*(const float3 x, const float2x3 y) { return ::simd_mul(x, y); } | ||
| 515 | static SIMD_CPPFUNC float3 operator*(const float3 x, const float3x3 y) { return ::simd_mul(x, y); } | ||
| 516 | static SIMD_CPPFUNC float4 operator*(const float3 x, const float4x3 y) { return ::simd_mul(x, y); } | ||
| 517 | static SIMD_CPPFUNC float2 operator*(const float4 x, const float2x4 y) { return ::simd_mul(x, y); } | ||
| 518 | static SIMD_CPPFUNC float3 operator*(const float4 x, const float3x4 y) { return ::simd_mul(x, y); } | ||
| 519 | static SIMD_CPPFUNC float4 operator*(const float4 x, const float4x4 y) { return ::simd_mul(x, y); } | ||
| 520 | static SIMD_CPPFUNC float2 operator*(const float2x2 x, const float2 y) { return ::simd_mul(x, y); } | ||
| 521 | static SIMD_CPPFUNC float2 operator*(const float3x2 x, const float3 y) { return ::simd_mul(x, y); } | ||
| 522 | static SIMD_CPPFUNC float2 operator*(const float4x2 x, const float4 y) { return ::simd_mul(x, y); } | ||
| 523 | static SIMD_CPPFUNC float3 operator*(const float2x3 x, const float2 y) { return ::simd_mul(x, y); } | ||
| 524 | static SIMD_CPPFUNC float3 operator*(const float3x3 x, const float3 y) { return ::simd_mul(x, y); } | ||
| 525 | static SIMD_CPPFUNC float3 operator*(const float4x3 x, const float4 y) { return ::simd_mul(x, y); } | ||
| 526 | static SIMD_CPPFUNC float4 operator*(const float2x4 x, const float2 y) { return ::simd_mul(x, y); } | ||
| 527 | static SIMD_CPPFUNC float4 operator*(const float3x4 x, const float3 y) { return ::simd_mul(x, y); } | ||
| 528 | static SIMD_CPPFUNC float4 operator*(const float4x4 x, const float4 y) { return ::simd_mul(x, y); } | ||
| 529 | static SIMD_CPPFUNC float2& operator*=(float2& x, const float2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 530 | static SIMD_CPPFUNC float3& operator*=(float3& x, const float3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 531 | static SIMD_CPPFUNC float4& operator*=(float4& x, const float4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 532 | |||
| 533 | static SIMD_CPPFUNC float2x2 operator*(const float2x2 x, const float2x2 y) { return ::simd_mul(x, y); } | ||
| 534 | static SIMD_CPPFUNC float3x2 operator*(const float2x2 x, const float3x2 y) { return ::simd_mul(x, y); } | ||
| 535 | static SIMD_CPPFUNC float4x2 operator*(const float2x2 x, const float4x2 y) { return ::simd_mul(x, y); } | ||
| 536 | static SIMD_CPPFUNC float2x3 operator*(const float2x3 x, const float2x2 y) { return ::simd_mul(x, y); } | ||
| 537 | static SIMD_CPPFUNC float3x3 operator*(const float2x3 x, const float3x2 y) { return ::simd_mul(x, y); } | ||
| 538 | static SIMD_CPPFUNC float4x3 operator*(const float2x3 x, const float4x2 y) { return ::simd_mul(x, y); } | ||
| 539 | static SIMD_CPPFUNC float2x4 operator*(const float2x4 x, const float2x2 y) { return ::simd_mul(x, y); } | ||
| 540 | static SIMD_CPPFUNC float3x4 operator*(const float2x4 x, const float3x2 y) { return ::simd_mul(x, y); } | ||
| 541 | static SIMD_CPPFUNC float4x4 operator*(const float2x4 x, const float4x2 y) { return ::simd_mul(x, y); } | ||
| 542 | static SIMD_CPPFUNC float2x2 operator*(const float3x2 x, const float2x3 y) { return ::simd_mul(x, y); } | ||
| 543 | static SIMD_CPPFUNC float3x2 operator*(const float3x2 x, const float3x3 y) { return ::simd_mul(x, y); } | ||
| 544 | static SIMD_CPPFUNC float4x2 operator*(const float3x2 x, const float4x3 y) { return ::simd_mul(x, y); } | ||
| 545 | static SIMD_CPPFUNC float2x3 operator*(const float3x3 x, const float2x3 y) { return ::simd_mul(x, y); } | ||
| 546 | static SIMD_CPPFUNC float3x3 operator*(const float3x3 x, const float3x3 y) { return ::simd_mul(x, y); } | ||
| 547 | static SIMD_CPPFUNC float4x3 operator*(const float3x3 x, const float4x3 y) { return ::simd_mul(x, y); } | ||
| 548 | static SIMD_CPPFUNC float2x4 operator*(const float3x4 x, const float2x3 y) { return ::simd_mul(x, y); } | ||
| 549 | static SIMD_CPPFUNC float3x4 operator*(const float3x4 x, const float3x3 y) { return ::simd_mul(x, y); } | ||
| 550 | static SIMD_CPPFUNC float4x4 operator*(const float3x4 x, const float4x3 y) { return ::simd_mul(x, y); } | ||
| 551 | static SIMD_CPPFUNC float2x2 operator*(const float4x2 x, const float2x4 y) { return ::simd_mul(x, y); } | ||
| 552 | static SIMD_CPPFUNC float3x2 operator*(const float4x2 x, const float3x4 y) { return ::simd_mul(x, y); } | ||
| 553 | static SIMD_CPPFUNC float4x2 operator*(const float4x2 x, const float4x4 y) { return ::simd_mul(x, y); } | ||
| 554 | static SIMD_CPPFUNC float2x3 operator*(const float4x3 x, const float2x4 y) { return ::simd_mul(x, y); } | ||
| 555 | static SIMD_CPPFUNC float3x3 operator*(const float4x3 x, const float3x4 y) { return ::simd_mul(x, y); } | ||
| 556 | static SIMD_CPPFUNC float4x3 operator*(const float4x3 x, const float4x4 y) { return ::simd_mul(x, y); } | ||
| 557 | static SIMD_CPPFUNC float2x4 operator*(const float4x4 x, const float2x4 y) { return ::simd_mul(x, y); } | ||
| 558 | static SIMD_CPPFUNC float3x4 operator*(const float4x4 x, const float3x4 y) { return ::simd_mul(x, y); } | ||
| 559 | static SIMD_CPPFUNC float4x4 operator*(const float4x4 x, const float4x4 y) { return ::simd_mul(x, y); } | ||
| 560 | static SIMD_CPPFUNC float2x2& operator*=(float2x2& x, const float2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 561 | static SIMD_CPPFUNC float2x3& operator*=(float2x3& x, const float2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 562 | static SIMD_CPPFUNC float2x4& operator*=(float2x4& x, const float2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 563 | static SIMD_CPPFUNC float3x2& operator*=(float3x2& x, const float3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 564 | static SIMD_CPPFUNC float3x3& operator*=(float3x3& x, const float3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 565 | static SIMD_CPPFUNC float3x4& operator*=(float3x4& x, const float3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 566 | static SIMD_CPPFUNC float4x2& operator*=(float4x2& x, const float4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 567 | static SIMD_CPPFUNC float4x3& operator*=(float4x3& x, const float4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 568 | static SIMD_CPPFUNC float4x4& operator*=(float4x4& x, const float4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 569 | |||
| 570 | static SIMD_CPPFUNC bool operator==(const float2x2& x, const float2x2& y) { return ::simd_equal(x, y); } | ||
| 571 | static SIMD_CPPFUNC bool operator==(const float2x3& x, const float2x3& y) { return ::simd_equal(x, y); } | ||
| 572 | static SIMD_CPPFUNC bool operator==(const float2x4& x, const float2x4& y) { return ::simd_equal(x, y); } | ||
| 573 | static SIMD_CPPFUNC bool operator==(const float3x2& x, const float3x2& y) { return ::simd_equal(x, y); } | ||
| 574 | static SIMD_CPPFUNC bool operator==(const float3x3& x, const float3x3& y) { return ::simd_equal(x, y); } | ||
| 575 | static SIMD_CPPFUNC bool operator==(const float3x4& x, const float3x4& y) { return ::simd_equal(x, y); } | ||
| 576 | static SIMD_CPPFUNC bool operator==(const float4x2& x, const float4x2& y) { return ::simd_equal(x, y); } | ||
| 577 | static SIMD_CPPFUNC bool operator==(const float4x3& x, const float4x3& y) { return ::simd_equal(x, y); } | ||
| 578 | static SIMD_CPPFUNC bool operator==(const float4x4& x, const float4x4& y) { return ::simd_equal(x, y); } | ||
| 579 | |||
| 580 | static SIMD_CPPFUNC bool operator!=(const float2x2& x, const float2x2& y) { return !(x == y); } | ||
| 581 | static SIMD_CPPFUNC bool operator!=(const float2x3& x, const float2x3& y) { return !(x == y); } | ||
| 582 | static SIMD_CPPFUNC bool operator!=(const float2x4& x, const float2x4& y) { return !(x == y); } | ||
| 583 | static SIMD_CPPFUNC bool operator!=(const float3x2& x, const float3x2& y) { return !(x == y); } | ||
| 584 | static SIMD_CPPFUNC bool operator!=(const float3x3& x, const float3x3& y) { return !(x == y); } | ||
| 585 | static SIMD_CPPFUNC bool operator!=(const float3x4& x, const float3x4& y) { return !(x == y); } | ||
| 586 | static SIMD_CPPFUNC bool operator!=(const float4x2& x, const float4x2& y) { return !(x == y); } | ||
| 587 | static SIMD_CPPFUNC bool operator!=(const float4x3& x, const float4x3& y) { return !(x == y); } | ||
| 588 | static SIMD_CPPFUNC bool operator!=(const float4x4& x, const float4x4& y) { return !(x == y); } | ||
| 589 | |||
| 590 | static SIMD_CPPFUNC bool almost_equal_elements(const float2x2 x, const float2x2 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 591 | static SIMD_CPPFUNC bool almost_equal_elements(const float2x3 x, const float2x3 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 592 | static SIMD_CPPFUNC bool almost_equal_elements(const float2x4 x, const float2x4 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 593 | static SIMD_CPPFUNC bool almost_equal_elements(const float3x2 x, const float3x2 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 594 | static SIMD_CPPFUNC bool almost_equal_elements(const float3x3 x, const float3x3 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 595 | static SIMD_CPPFUNC bool almost_equal_elements(const float3x4 x, const float3x4 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 596 | static SIMD_CPPFUNC bool almost_equal_elements(const float4x2 x, const float4x2 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 597 | static SIMD_CPPFUNC bool almost_equal_elements(const float4x3 x, const float4x3 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 598 | static SIMD_CPPFUNC bool almost_equal_elements(const float4x4 x, const float4x4 y, const float tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 599 | |||
| 600 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float2x2 x, const float2x2 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 601 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float2x3 x, const float2x3 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 602 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float2x4 x, const float2x4 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 603 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float3x2 x, const float3x2 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 604 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float3x3 x, const float3x3 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 605 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float3x4 x, const float3x4 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 606 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float4x2 x, const float4x2 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 607 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float4x3 x, const float4x3 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 608 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const float4x4 x, const float4x4 y, const float tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 609 | |||
| 610 | static SIMD_CPPFUNC double2x2 operator+(const double2x2 x, const double2x2 y) { return double2x2(::simd_linear_combination(1, x, 1, y)); } | ||
| 611 | static SIMD_CPPFUNC double2x3 operator+(const double2x3 x, const double2x3 y) { return double2x3(::simd_linear_combination(1, x, 1, y)); } | ||
| 612 | static SIMD_CPPFUNC double2x4 operator+(const double2x4 x, const double2x4 y) { return double2x4(::simd_linear_combination(1, x, 1, y)); } | ||
| 613 | static SIMD_CPPFUNC double3x2 operator+(const double3x2 x, const double3x2 y) { return double3x2(::simd_linear_combination(1, x, 1, y)); } | ||
| 614 | static SIMD_CPPFUNC double3x3 operator+(const double3x3 x, const double3x3 y) { return double3x3(::simd_linear_combination(1, x, 1, y)); } | ||
| 615 | static SIMD_CPPFUNC double3x4 operator+(const double3x4 x, const double3x4 y) { return double3x4(::simd_linear_combination(1, x, 1, y)); } | ||
| 616 | static SIMD_CPPFUNC double4x2 operator+(const double4x2 x, const double4x2 y) { return double4x2(::simd_linear_combination(1, x, 1, y)); } | ||
| 617 | static SIMD_CPPFUNC double4x3 operator+(const double4x3 x, const double4x3 y) { return double4x3(::simd_linear_combination(1, x, 1, y)); } | ||
| 618 | static SIMD_CPPFUNC double4x4 operator+(const double4x4 x, const double4x4 y) { return double4x4(::simd_linear_combination(1, x, 1, y)); } | ||
| 619 | |||
| 620 | static SIMD_CPPFUNC double2x2 operator-(const double2x2 x, const double2x2 y) { return double2x2(::simd_linear_combination(1, x, -1, y)); } | ||
| 621 | static SIMD_CPPFUNC double2x3 operator-(const double2x3 x, const double2x3 y) { return double2x3(::simd_linear_combination(1, x, -1, y)); } | ||
| 622 | static SIMD_CPPFUNC double2x4 operator-(const double2x4 x, const double2x4 y) { return double2x4(::simd_linear_combination(1, x, -1, y)); } | ||
| 623 | static SIMD_CPPFUNC double3x2 operator-(const double3x2 x, const double3x2 y) { return double3x2(::simd_linear_combination(1, x, -1, y)); } | ||
| 624 | static SIMD_CPPFUNC double3x3 operator-(const double3x3 x, const double3x3 y) { return double3x3(::simd_linear_combination(1, x, -1, y)); } | ||
| 625 | static SIMD_CPPFUNC double3x4 operator-(const double3x4 x, const double3x4 y) { return double3x4(::simd_linear_combination(1, x, -1, y)); } | ||
| 626 | static SIMD_CPPFUNC double4x2 operator-(const double4x2 x, const double4x2 y) { return double4x2(::simd_linear_combination(1, x, -1, y)); } | ||
| 627 | static SIMD_CPPFUNC double4x3 operator-(const double4x3 x, const double4x3 y) { return double4x3(::simd_linear_combination(1, x, -1, y)); } | ||
| 628 | static SIMD_CPPFUNC double4x4 operator-(const double4x4 x, const double4x4 y) { return double4x4(::simd_linear_combination(1, x, -1, y)); } | ||
| 629 | |||
| 630 | static SIMD_CPPFUNC double2x2& operator+=(double2x2& x, const double2x2 y) { x = x + y; return x; } | ||
| 631 | static SIMD_CPPFUNC double2x3& operator+=(double2x3& x, const double2x3 y) { x = x + y; return x; } | ||
| 632 | static SIMD_CPPFUNC double2x4& operator+=(double2x4& x, const double2x4 y) { x = x + y; return x; } | ||
| 633 | static SIMD_CPPFUNC double3x2& operator+=(double3x2& x, const double3x2 y) { x = x + y; return x; } | ||
| 634 | static SIMD_CPPFUNC double3x3& operator+=(double3x3& x, const double3x3 y) { x = x + y; return x; } | ||
| 635 | static SIMD_CPPFUNC double3x4& operator+=(double3x4& x, const double3x4 y) { x = x + y; return x; } | ||
| 636 | static SIMD_CPPFUNC double4x2& operator+=(double4x2& x, const double4x2 y) { x = x + y; return x; } | ||
| 637 | static SIMD_CPPFUNC double4x3& operator+=(double4x3& x, const double4x3 y) { x = x + y; return x; } | ||
| 638 | static SIMD_CPPFUNC double4x4& operator+=(double4x4& x, const double4x4 y) { x = x + y; return x; } | ||
| 639 | |||
| 640 | static SIMD_CPPFUNC double2x2& operator-=(double2x2& x, const double2x2 y) { x = x - y; return x; } | ||
| 641 | static SIMD_CPPFUNC double2x3& operator-=(double2x3& x, const double2x3 y) { x = x - y; return x; } | ||
| 642 | static SIMD_CPPFUNC double2x4& operator-=(double2x4& x, const double2x4 y) { x = x - y; return x; } | ||
| 643 | static SIMD_CPPFUNC double3x2& operator-=(double3x2& x, const double3x2 y) { x = x - y; return x; } | ||
| 644 | static SIMD_CPPFUNC double3x3& operator-=(double3x3& x, const double3x3 y) { x = x - y; return x; } | ||
| 645 | static SIMD_CPPFUNC double3x4& operator-=(double3x4& x, const double3x4 y) { x = x - y; return x; } | ||
| 646 | static SIMD_CPPFUNC double4x2& operator-=(double4x2& x, const double4x2 y) { x = x - y; return x; } | ||
| 647 | static SIMD_CPPFUNC double4x3& operator-=(double4x3& x, const double4x3 y) { x = x - y; return x; } | ||
| 648 | static SIMD_CPPFUNC double4x4& operator-=(double4x4& x, const double4x4 y) { x = x - y; return x; } | ||
| 649 | |||
| 650 | static SIMD_CPPFUNC double2x2 transpose(const double2x2 x) { return ::simd_transpose(x); } | ||
| 651 | static SIMD_CPPFUNC double2x3 transpose(const double3x2 x) { return ::simd_transpose(x); } | ||
| 652 | static SIMD_CPPFUNC double2x4 transpose(const double4x2 x) { return ::simd_transpose(x); } | ||
| 653 | static SIMD_CPPFUNC double3x2 transpose(const double2x3 x) { return ::simd_transpose(x); } | ||
| 654 | static SIMD_CPPFUNC double3x3 transpose(const double3x3 x) { return ::simd_transpose(x); } | ||
| 655 | static SIMD_CPPFUNC double3x4 transpose(const double4x3 x) { return ::simd_transpose(x); } | ||
| 656 | static SIMD_CPPFUNC double4x2 transpose(const double2x4 x) { return ::simd_transpose(x); } | ||
| 657 | static SIMD_CPPFUNC double4x3 transpose(const double3x4 x) { return ::simd_transpose(x); } | ||
| 658 | static SIMD_CPPFUNC double4x4 transpose(const double4x4 x) { return ::simd_transpose(x); } | ||
| 659 | |||
| 660 | static SIMD_CPPFUNC double determinant(const double2x2 x) { return ::simd_determinant(x); } | ||
| 661 | static SIMD_CPPFUNC double determinant(const double3x3 x) { return ::simd_determinant(x); } | ||
| 662 | static SIMD_CPPFUNC double determinant(const double4x4 x) { return ::simd_determinant(x); } | ||
| 663 | |||
| 664 | #pragma clang diagnostic push | ||
| 665 | #pragma clang diagnostic ignored "-Wgcc-compat" | ||
| 666 | static SIMD_CPPFUNC double2x2 inverse(const double2x2 x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) { return ::simd_inverse(x); } | ||
| 667 | static SIMD_CPPFUNC double3x3 inverse(const double3x3 x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) { return ::simd_inverse(x); } | ||
| 668 | static SIMD_CPPFUNC double4x4 inverse(const double4x4 x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) { return ::simd_inverse(x); } | ||
| 669 | #pragma clang diagnostic pop | ||
| 670 | |||
| 671 | static SIMD_CPPFUNC double2x2 operator*(const double a, const double2x2 x) { return ::simd_mul(a, x); } | ||
| 672 | static SIMD_CPPFUNC double2x3 operator*(const double a, const double2x3 x) { return ::simd_mul(a, x); } | ||
| 673 | static SIMD_CPPFUNC double2x4 operator*(const double a, const double2x4 x) { return ::simd_mul(a, x); } | ||
| 674 | static SIMD_CPPFUNC double3x2 operator*(const double a, const double3x2 x) { return ::simd_mul(a, x); } | ||
| 675 | static SIMD_CPPFUNC double3x3 operator*(const double a, const double3x3 x) { return ::simd_mul(a, x); } | ||
| 676 | static SIMD_CPPFUNC double3x4 operator*(const double a, const double3x4 x) { return ::simd_mul(a, x); } | ||
| 677 | static SIMD_CPPFUNC double4x2 operator*(const double a, const double4x2 x) { return ::simd_mul(a, x); } | ||
| 678 | static SIMD_CPPFUNC double4x3 operator*(const double a, const double4x3 x) { return ::simd_mul(a, x); } | ||
| 679 | static SIMD_CPPFUNC double4x4 operator*(const double a, const double4x4 x) { return ::simd_mul(a, x); } | ||
| 680 | static SIMD_CPPFUNC double2x2 operator*(const double2x2 x, const double a) { return ::simd_mul(a, x); } | ||
| 681 | static SIMD_CPPFUNC double2x3 operator*(const double2x3 x, const double a) { return ::simd_mul(a, x); } | ||
| 682 | static SIMD_CPPFUNC double2x4 operator*(const double2x4 x, const double a) { return ::simd_mul(a, x); } | ||
| 683 | static SIMD_CPPFUNC double3x2 operator*(const double3x2 x, const double a) { return ::simd_mul(a, x); } | ||
| 684 | static SIMD_CPPFUNC double3x3 operator*(const double3x3 x, const double a) { return ::simd_mul(a, x); } | ||
| 685 | static SIMD_CPPFUNC double3x4 operator*(const double3x4 x, const double a) { return ::simd_mul(a, x); } | ||
| 686 | static SIMD_CPPFUNC double4x2 operator*(const double4x2 x, const double a) { return ::simd_mul(a, x); } | ||
| 687 | static SIMD_CPPFUNC double4x3 operator*(const double4x3 x, const double a) { return ::simd_mul(a, x); } | ||
| 688 | static SIMD_CPPFUNC double4x4 operator*(const double4x4 x, const double a) { return ::simd_mul(a, x); } | ||
| 689 | static SIMD_CPPFUNC double2x2& operator*=(double2x2& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 690 | static SIMD_CPPFUNC double2x3& operator*=(double2x3& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 691 | static SIMD_CPPFUNC double2x4& operator*=(double2x4& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 692 | static SIMD_CPPFUNC double3x2& operator*=(double3x2& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 693 | static SIMD_CPPFUNC double3x3& operator*=(double3x3& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 694 | static SIMD_CPPFUNC double3x4& operator*=(double3x4& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 695 | static SIMD_CPPFUNC double4x2& operator*=(double4x2& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 696 | static SIMD_CPPFUNC double4x3& operator*=(double4x3& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 697 | static SIMD_CPPFUNC double4x4& operator*=(double4x4& x, const double a) { x = ::simd_mul(a, x); return x; } | ||
| 698 | |||
| 699 | static SIMD_CPPFUNC double2 operator*(const double2 x, const double2x2 y) { return ::simd_mul(x, y); } | ||
| 700 | static SIMD_CPPFUNC double3 operator*(const double2 x, const double3x2 y) { return ::simd_mul(x, y); } | ||
| 701 | static SIMD_CPPFUNC double4 operator*(const double2 x, const double4x2 y) { return ::simd_mul(x, y); } | ||
| 702 | static SIMD_CPPFUNC double2 operator*(const double3 x, const double2x3 y) { return ::simd_mul(x, y); } | ||
| 703 | static SIMD_CPPFUNC double3 operator*(const double3 x, const double3x3 y) { return ::simd_mul(x, y); } | ||
| 704 | static SIMD_CPPFUNC double4 operator*(const double3 x, const double4x3 y) { return ::simd_mul(x, y); } | ||
| 705 | static SIMD_CPPFUNC double2 operator*(const double4 x, const double2x4 y) { return ::simd_mul(x, y); } | ||
| 706 | static SIMD_CPPFUNC double3 operator*(const double4 x, const double3x4 y) { return ::simd_mul(x, y); } | ||
| 707 | static SIMD_CPPFUNC double4 operator*(const double4 x, const double4x4 y) { return ::simd_mul(x, y); } | ||
| 708 | static SIMD_CPPFUNC double2 operator*(const double2x2 x, const double2 y) { return ::simd_mul(x, y); } | ||
| 709 | static SIMD_CPPFUNC double2 operator*(const double3x2 x, const double3 y) { return ::simd_mul(x, y); } | ||
| 710 | static SIMD_CPPFUNC double2 operator*(const double4x2 x, const double4 y) { return ::simd_mul(x, y); } | ||
| 711 | static SIMD_CPPFUNC double3 operator*(const double2x3 x, const double2 y) { return ::simd_mul(x, y); } | ||
| 712 | static SIMD_CPPFUNC double3 operator*(const double3x3 x, const double3 y) { return ::simd_mul(x, y); } | ||
| 713 | static SIMD_CPPFUNC double3 operator*(const double4x3 x, const double4 y) { return ::simd_mul(x, y); } | ||
| 714 | static SIMD_CPPFUNC double4 operator*(const double2x4 x, const double2 y) { return ::simd_mul(x, y); } | ||
| 715 | static SIMD_CPPFUNC double4 operator*(const double3x4 x, const double3 y) { return ::simd_mul(x, y); } | ||
| 716 | static SIMD_CPPFUNC double4 operator*(const double4x4 x, const double4 y) { return ::simd_mul(x, y); } | ||
| 717 | static SIMD_CPPFUNC double2& operator*=(double2& x, const double2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 718 | static SIMD_CPPFUNC double3& operator*=(double3& x, const double3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 719 | static SIMD_CPPFUNC double4& operator*=(double4& x, const double4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 720 | |||
| 721 | static SIMD_CPPFUNC double2x2 operator*(const double2x2 x, const double2x2 y) { return ::simd_mul(x, y); } | ||
| 722 | static SIMD_CPPFUNC double3x2 operator*(const double2x2 x, const double3x2 y) { return ::simd_mul(x, y); } | ||
| 723 | static SIMD_CPPFUNC double4x2 operator*(const double2x2 x, const double4x2 y) { return ::simd_mul(x, y); } | ||
| 724 | static SIMD_CPPFUNC double2x3 operator*(const double2x3 x, const double2x2 y) { return ::simd_mul(x, y); } | ||
| 725 | static SIMD_CPPFUNC double3x3 operator*(const double2x3 x, const double3x2 y) { return ::simd_mul(x, y); } | ||
| 726 | static SIMD_CPPFUNC double4x3 operator*(const double2x3 x, const double4x2 y) { return ::simd_mul(x, y); } | ||
| 727 | static SIMD_CPPFUNC double2x4 operator*(const double2x4 x, const double2x2 y) { return ::simd_mul(x, y); } | ||
| 728 | static SIMD_CPPFUNC double3x4 operator*(const double2x4 x, const double3x2 y) { return ::simd_mul(x, y); } | ||
| 729 | static SIMD_CPPFUNC double4x4 operator*(const double2x4 x, const double4x2 y) { return ::simd_mul(x, y); } | ||
| 730 | static SIMD_CPPFUNC double2x2 operator*(const double3x2 x, const double2x3 y) { return ::simd_mul(x, y); } | ||
| 731 | static SIMD_CPPFUNC double3x2 operator*(const double3x2 x, const double3x3 y) { return ::simd_mul(x, y); } | ||
| 732 | static SIMD_CPPFUNC double4x2 operator*(const double3x2 x, const double4x3 y) { return ::simd_mul(x, y); } | ||
| 733 | static SIMD_CPPFUNC double2x3 operator*(const double3x3 x, const double2x3 y) { return ::simd_mul(x, y); } | ||
| 734 | static SIMD_CPPFUNC double3x3 operator*(const double3x3 x, const double3x3 y) { return ::simd_mul(x, y); } | ||
| 735 | static SIMD_CPPFUNC double4x3 operator*(const double3x3 x, const double4x3 y) { return ::simd_mul(x, y); } | ||
| 736 | static SIMD_CPPFUNC double2x4 operator*(const double3x4 x, const double2x3 y) { return ::simd_mul(x, y); } | ||
| 737 | static SIMD_CPPFUNC double3x4 operator*(const double3x4 x, const double3x3 y) { return ::simd_mul(x, y); } | ||
| 738 | static SIMD_CPPFUNC double4x4 operator*(const double3x4 x, const double4x3 y) { return ::simd_mul(x, y); } | ||
| 739 | static SIMD_CPPFUNC double2x2 operator*(const double4x2 x, const double2x4 y) { return ::simd_mul(x, y); } | ||
| 740 | static SIMD_CPPFUNC double3x2 operator*(const double4x2 x, const double3x4 y) { return ::simd_mul(x, y); } | ||
| 741 | static SIMD_CPPFUNC double4x2 operator*(const double4x2 x, const double4x4 y) { return ::simd_mul(x, y); } | ||
| 742 | static SIMD_CPPFUNC double2x3 operator*(const double4x3 x, const double2x4 y) { return ::simd_mul(x, y); } | ||
| 743 | static SIMD_CPPFUNC double3x3 operator*(const double4x3 x, const double3x4 y) { return ::simd_mul(x, y); } | ||
| 744 | static SIMD_CPPFUNC double4x3 operator*(const double4x3 x, const double4x4 y) { return ::simd_mul(x, y); } | ||
| 745 | static SIMD_CPPFUNC double2x4 operator*(const double4x4 x, const double2x4 y) { return ::simd_mul(x, y); } | ||
| 746 | static SIMD_CPPFUNC double3x4 operator*(const double4x4 x, const double3x4 y) { return ::simd_mul(x, y); } | ||
| 747 | static SIMD_CPPFUNC double4x4 operator*(const double4x4 x, const double4x4 y) { return ::simd_mul(x, y); } | ||
| 748 | static SIMD_CPPFUNC double2x2& operator*=(double2x2& x, const double2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 749 | static SIMD_CPPFUNC double2x3& operator*=(double2x3& x, const double2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 750 | static SIMD_CPPFUNC double2x4& operator*=(double2x4& x, const double2x2 y) { x = ::simd_mul(x, y); return x; } | ||
| 751 | static SIMD_CPPFUNC double3x2& operator*=(double3x2& x, const double3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 752 | static SIMD_CPPFUNC double3x3& operator*=(double3x3& x, const double3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 753 | static SIMD_CPPFUNC double3x4& operator*=(double3x4& x, const double3x3 y) { x = ::simd_mul(x, y); return x; } | ||
| 754 | static SIMD_CPPFUNC double4x2& operator*=(double4x2& x, const double4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 755 | static SIMD_CPPFUNC double4x3& operator*=(double4x3& x, const double4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 756 | static SIMD_CPPFUNC double4x4& operator*=(double4x4& x, const double4x4 y) { x = ::simd_mul(x, y); return x; } | ||
| 757 | |||
| 758 | static SIMD_CPPFUNC bool operator==(const double2x2& x, const double2x2& y) { return ::simd_equal(x, y); } | ||
| 759 | static SIMD_CPPFUNC bool operator==(const double2x3& x, const double2x3& y) { return ::simd_equal(x, y); } | ||
| 760 | static SIMD_CPPFUNC bool operator==(const double2x4& x, const double2x4& y) { return ::simd_equal(x, y); } | ||
| 761 | static SIMD_CPPFUNC bool operator==(const double3x2& x, const double3x2& y) { return ::simd_equal(x, y); } | ||
| 762 | static SIMD_CPPFUNC bool operator==(const double3x3& x, const double3x3& y) { return ::simd_equal(x, y); } | ||
| 763 | static SIMD_CPPFUNC bool operator==(const double3x4& x, const double3x4& y) { return ::simd_equal(x, y); } | ||
| 764 | static SIMD_CPPFUNC bool operator==(const double4x2& x, const double4x2& y) { return ::simd_equal(x, y); } | ||
| 765 | static SIMD_CPPFUNC bool operator==(const double4x3& x, const double4x3& y) { return ::simd_equal(x, y); } | ||
| 766 | static SIMD_CPPFUNC bool operator==(const double4x4& x, const double4x4& y) { return ::simd_equal(x, y); } | ||
| 767 | |||
| 768 | static SIMD_CPPFUNC bool operator!=(const double2x2& x, const double2x2& y) { return !(x == y); } | ||
| 769 | static SIMD_CPPFUNC bool operator!=(const double2x3& x, const double2x3& y) { return !(x == y); } | ||
| 770 | static SIMD_CPPFUNC bool operator!=(const double2x4& x, const double2x4& y) { return !(x == y); } | ||
| 771 | static SIMD_CPPFUNC bool operator!=(const double3x2& x, const double3x2& y) { return !(x == y); } | ||
| 772 | static SIMD_CPPFUNC bool operator!=(const double3x3& x, const double3x3& y) { return !(x == y); } | ||
| 773 | static SIMD_CPPFUNC bool operator!=(const double3x4& x, const double3x4& y) { return !(x == y); } | ||
| 774 | static SIMD_CPPFUNC bool operator!=(const double4x2& x, const double4x2& y) { return !(x == y); } | ||
| 775 | static SIMD_CPPFUNC bool operator!=(const double4x3& x, const double4x3& y) { return !(x == y); } | ||
| 776 | static SIMD_CPPFUNC bool operator!=(const double4x4& x, const double4x4& y) { return !(x == y); } | ||
| 777 | |||
| 778 | static SIMD_CPPFUNC bool almost_equal_elements(const double2x2 x, const double2x2 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 779 | static SIMD_CPPFUNC bool almost_equal_elements(const double2x3 x, const double2x3 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 780 | static SIMD_CPPFUNC bool almost_equal_elements(const double2x4 x, const double2x4 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 781 | static SIMD_CPPFUNC bool almost_equal_elements(const double3x2 x, const double3x2 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 782 | static SIMD_CPPFUNC bool almost_equal_elements(const double3x3 x, const double3x3 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 783 | static SIMD_CPPFUNC bool almost_equal_elements(const double3x4 x, const double3x4 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 784 | static SIMD_CPPFUNC bool almost_equal_elements(const double4x2 x, const double4x2 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 785 | static SIMD_CPPFUNC bool almost_equal_elements(const double4x3 x, const double4x3 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 786 | static SIMD_CPPFUNC bool almost_equal_elements(const double4x4 x, const double4x4 y, const double tol) { return ::simd_almost_equal_elements(x, y, tol); } | ||
| 787 | |||
| 788 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double2x2 x, const double2x2 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 789 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double2x3 x, const double2x3 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 790 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double2x4 x, const double2x4 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 791 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double3x2 x, const double3x2 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 792 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double3x3 x, const double3x3 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 793 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double3x4 x, const double3x4 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 794 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double4x2 x, const double4x2 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 795 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double4x3 x, const double4x3 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 796 | static SIMD_CPPFUNC bool almost_equal_elements_relative(const double4x4 x, const double4x4 y, const double tol) { return ::simd_almost_equal_elements_relative(x, y, tol); } | ||
| 797 | } | ||
| 798 | |||
| 799 | extern "C" { | ||
| 800 | #endif /* __cplusplus */ | ||
| 801 | |||
| 802 | #pragma mark - Implementation | ||
| 803 | |||
| 804 | static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x) { simd_float2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; } | ||
| 805 | static simd_double2x2 SIMD_CFUNC simd_diagonal_matrix(simd_double2 __x) { simd_double2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; } | ||
| 806 | static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x) { simd_float3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; } | ||
| 807 | static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x) { simd_double3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; } | ||
| 808 | static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x) { simd_float4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; } | ||
| 809 | static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x) { simd_double4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; } | ||
| 810 | |||
| 811 | static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1) { simd_float2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; } | ||
| 812 | static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1) { simd_float2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; } | ||
| 813 | static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1) { simd_float2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; } | ||
| 814 | static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1) { simd_double2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; } | ||
| 815 | static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1) { simd_double2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; } | ||
| 816 | static simd_double2x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1) { simd_double2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; } | ||
| 817 | static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2) { simd_float3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; } | ||
| 818 | static simd_float3x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2) { simd_float3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; } | ||
| 819 | static simd_float3x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2) { simd_float3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; } | ||
| 820 | static simd_double3x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2) { simd_double3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; } | ||
| 821 | static simd_double3x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2) { simd_double3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; } | ||
| 822 | static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2) { simd_double3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; } | ||
| 823 | static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3) { simd_float4x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; } | ||
| 824 | static simd_float4x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2, simd_float3 col3) { simd_float4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; } | ||
| 825 | static simd_float4x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2, simd_float4 col3) { simd_float4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; } | ||
| 826 | static simd_double4x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2, simd_double2 col3) { simd_double4x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; } | ||
| 827 | static simd_double4x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2, simd_double3 col3) { simd_double4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; } | ||
| 828 | static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3) { simd_double4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; } | ||
| 829 | |||
| 830 | static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1) { return simd_transpose(simd_matrix(row0, row1)); } | ||
| 831 | static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1) { return simd_transpose(simd_matrix(row0, row1)); } | ||
| 832 | static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1) { return simd_transpose(simd_matrix(row0, row1)); } | ||
| 833 | static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1) { return simd_transpose(simd_matrix(row0, row1)); } | ||
| 834 | static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1) { return simd_transpose(simd_matrix(row0, row1)); } | ||
| 835 | static simd_double4x2 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1) { return simd_transpose(simd_matrix(row0, row1)); } | ||
| 836 | static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); } | ||
| 837 | static simd_float3x3 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); } | ||
| 838 | static simd_float4x3 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); } | ||
| 839 | static simd_double2x3 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); } | ||
| 840 | static simd_double3x3 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); } | ||
| 841 | static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); } | ||
| 842 | static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); } | ||
| 843 | static simd_float3x4 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2, simd_float3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); } | ||
| 844 | static simd_float4x4 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2, simd_float4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); } | ||
| 845 | static simd_double2x4 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2, simd_double2 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); } | ||
| 846 | static simd_double3x4 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2, simd_double3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); } | ||
| 847 | static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); } | ||
| 848 | |||
| 849 | static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q) { | ||
| 850 | simd_float4x4 r = simd_matrix4x4(q); | ||
| 851 | return (simd_float3x3){ r.columns[0].xyz, r.columns[1].xyz, r.columns[2].xyz }; | ||
| 852 | } | ||
| 853 | |||
| 854 | static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q) { | ||
| 855 | simd_float4 v = q.vector; | ||
| 856 | simd_float4x4 r = { | ||
| 857 | .columns[0] = { 1 - 2*(v.y*v.y + v.z*v.z), | ||
| 858 | 2*(v.x*v.y + v.z*v.w), | ||
| 859 | 2*(v.x*v.z - v.y*v.w), 0 }, | ||
| 860 | .columns[1] = { 2*(v.x*v.y - v.z*v.w), | ||
| 861 | 1 - 2*(v.z*v.z + v.x*v.x), | ||
| 862 | 2*(v.y*v.z + v.x*v.w), 0 }, | ||
| 863 | .columns[2] = { 2*(v.z*v.x + v.y*v.w), | ||
| 864 | 2*(v.y*v.z - v.x*v.w), | ||
| 865 | 1 - 2*(v.y*v.y + v.x*v.x), 0 }, | ||
| 866 | .columns[3] = { 0, 0, 0, 1 } | ||
| 867 | }; | ||
| 868 | return r; | ||
| 869 | } | ||
| 870 | |||
| 871 | static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q) { | ||
| 872 | simd_double4x4 r = simd_matrix4x4(q); | ||
| 873 | return (simd_double3x3){ r.columns[0].xyz, r.columns[1].xyz, r.columns[2].xyz }; | ||
| 874 | } | ||
| 875 | |||
| 876 | static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q) { | ||
| 877 | simd_double4 v = q.vector; | ||
| 878 | simd_double4x4 r = { | ||
| 879 | .columns[0] = { 1 - 2*(v.y*v.y + v.z*v.z), | ||
| 880 | 2*(v.x*v.y + v.z*v.w), | ||
| 881 | 2*(v.x*v.z - v.y*v.w), 0 }, | ||
| 882 | .columns[1] = { 2*(v.x*v.y - v.z*v.w), | ||
| 883 | 1 - 2*(v.z*v.z + v.x*v.x), | ||
| 884 | 2*(v.y*v.z + v.x*v.w), 0 }, | ||
| 885 | .columns[2] = { 2*(v.z*v.x + v.y*v.w), | ||
| 886 | 2*(v.y*v.z - v.x*v.w), | ||
| 887 | 1 - 2*(v.y*v.y + v.x*v.x), 0 }, | ||
| 888 | .columns[3] = { 0, 0, 0, 1 } | ||
| 889 | }; | ||
| 890 | return r; | ||
| 891 | } | ||
| 892 | |||
| 893 | static simd_float2x2 SIMD_CFUNC matrix_scale(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 894 | static simd_float3x2 SIMD_CFUNC matrix_scale(float __a, simd_float3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 895 | static simd_float4x2 SIMD_CFUNC matrix_scale(float __a, simd_float4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 896 | static simd_float2x3 SIMD_CFUNC matrix_scale(float __a, simd_float2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 897 | static simd_float3x3 SIMD_CFUNC matrix_scale(float __a, simd_float3x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 898 | static simd_float4x3 SIMD_CFUNC matrix_scale(float __a, simd_float4x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 899 | static simd_float2x4 SIMD_CFUNC matrix_scale(float __a, simd_float2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 900 | static simd_float3x4 SIMD_CFUNC matrix_scale(float __a, simd_float3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 901 | static simd_float4x4 SIMD_CFUNC matrix_scale(float __a, simd_float4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 902 | static simd_double2x2 SIMD_CFUNC matrix_scale(double __a, simd_double2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 903 | static simd_double3x2 SIMD_CFUNC matrix_scale(double __a, simd_double3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 904 | static simd_double4x2 SIMD_CFUNC matrix_scale(double __a, simd_double4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 905 | static simd_double2x3 SIMD_CFUNC matrix_scale(double __a, simd_double2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 906 | static simd_double3x3 SIMD_CFUNC matrix_scale(double __a, simd_double3x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 907 | static simd_double4x3 SIMD_CFUNC matrix_scale(double __a, simd_double4x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 908 | static simd_double2x4 SIMD_CFUNC matrix_scale(double __a, simd_double2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 909 | static simd_double3x4 SIMD_CFUNC matrix_scale(double __a, simd_double3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 910 | static simd_double4x4 SIMD_CFUNC matrix_scale(double __a, simd_double4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 911 | |||
| 912 | static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 913 | static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 914 | static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 915 | static simd_float2x3 SIMD_CFUNC simd_mul(float __a, simd_float2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 916 | static simd_float3x3 SIMD_CFUNC simd_mul(float __a, simd_float3x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 917 | static simd_float4x3 SIMD_CFUNC simd_mul(float __a, simd_float4x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 918 | static simd_float2x4 SIMD_CFUNC simd_mul(float __a, simd_float2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 919 | static simd_float3x4 SIMD_CFUNC simd_mul(float __a, simd_float3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 920 | static simd_float4x4 SIMD_CFUNC simd_mul(float __a, simd_float4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 921 | static simd_double2x2 SIMD_CFUNC simd_mul(double __a, simd_double2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 922 | static simd_double3x2 SIMD_CFUNC simd_mul(double __a, simd_double3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 923 | static simd_double4x2 SIMD_CFUNC simd_mul(double __a, simd_double4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 924 | static simd_double2x3 SIMD_CFUNC simd_mul(double __a, simd_double2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 925 | static simd_double3x3 SIMD_CFUNC simd_mul(double __a, simd_double3x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 926 | static simd_double4x3 SIMD_CFUNC simd_mul(double __a, simd_double4x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 927 | static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; } | ||
| 928 | static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; } | ||
| 929 | static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; } | ||
| 930 | |||
| 931 | static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y) { | ||
| 932 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 933 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 934 | return __x; | ||
| 935 | } | ||
| 936 | static simd_float3x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x2 __x, float __b, simd_float3x2 __y) { | ||
| 937 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 938 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 939 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 940 | return __x; | ||
| 941 | } | ||
| 942 | static simd_float4x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x2 __x, float __b, simd_float4x2 __y) { | ||
| 943 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 944 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 945 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 946 | __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3]; | ||
| 947 | return __x; | ||
| 948 | } | ||
| 949 | static simd_float2x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x3 __x, float __b, simd_float2x3 __y) { | ||
| 950 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 951 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 952 | return __x; | ||
| 953 | } | ||
| 954 | static simd_float3x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x3 __x, float __b, simd_float3x3 __y) { | ||
| 955 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 956 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 957 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 958 | return __x; | ||
| 959 | } | ||
| 960 | static simd_float4x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x3 __x, float __b, simd_float4x3 __y) { | ||
| 961 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 962 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 963 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 964 | __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3]; | ||
| 965 | return __x; | ||
| 966 | } | ||
| 967 | static simd_float2x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x4 __x, float __b, simd_float2x4 __y) { | ||
| 968 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 969 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 970 | return __x; | ||
| 971 | } | ||
| 972 | static simd_float3x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x4 __x, float __b, simd_float3x4 __y) { | ||
| 973 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 974 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 975 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 976 | return __x; | ||
| 977 | } | ||
| 978 | static simd_float4x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x4 __x, float __b, simd_float4x4 __y) { | ||
| 979 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 980 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 981 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 982 | __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3]; | ||
| 983 | return __x; | ||
| 984 | } | ||
| 985 | static simd_double2x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x2 __x, double __b, simd_double2x2 __y) { | ||
| 986 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 987 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 988 | return __x; | ||
| 989 | } | ||
| 990 | static simd_double3x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x2 __x, double __b, simd_double3x2 __y) { | ||
| 991 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 992 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 993 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 994 | return __x; | ||
| 995 | } | ||
| 996 | static simd_double4x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x2 __x, double __b, simd_double4x2 __y) { | ||
| 997 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 998 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 999 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 1000 | __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3]; | ||
| 1001 | return __x; | ||
| 1002 | } | ||
| 1003 | static simd_double2x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x3 __x, double __b, simd_double2x3 __y) { | ||
| 1004 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 1005 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 1006 | return __x; | ||
| 1007 | } | ||
| 1008 | static simd_double3x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x3 __x, double __b, simd_double3x3 __y) { | ||
| 1009 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 1010 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 1011 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 1012 | return __x; | ||
| 1013 | } | ||
| 1014 | static simd_double4x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x3 __x, double __b, simd_double4x3 __y) { | ||
| 1015 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 1016 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 1017 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 1018 | __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3]; | ||
| 1019 | return __x; | ||
| 1020 | } | ||
| 1021 | static simd_double2x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x4 __x, double __b, simd_double2x4 __y) { | ||
| 1022 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 1023 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 1024 | return __x; | ||
| 1025 | } | ||
| 1026 | static simd_double3x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x4 __x, double __b, simd_double3x4 __y) { | ||
| 1027 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 1028 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 1029 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 1030 | return __x; | ||
| 1031 | } | ||
| 1032 | static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x4 __x, double __b, simd_double4x4 __y) { | ||
| 1033 | __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0]; | ||
| 1034 | __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1]; | ||
| 1035 | __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2]; | ||
| 1036 | __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3]; | ||
| 1037 | return __x; | ||
| 1038 | } | ||
| 1039 | |||
| 1040 | static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1041 | static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1042 | static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1043 | static simd_float2x3 SIMD_CFUNC simd_add(simd_float2x3 __x, simd_float2x3 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1044 | static simd_float3x3 SIMD_CFUNC simd_add(simd_float3x3 __x, simd_float3x3 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1045 | static simd_float4x3 SIMD_CFUNC simd_add(simd_float4x3 __x, simd_float4x3 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1046 | static simd_float2x4 SIMD_CFUNC simd_add(simd_float2x4 __x, simd_float2x4 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1047 | static simd_float3x4 SIMD_CFUNC simd_add(simd_float3x4 __x, simd_float3x4 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1048 | static simd_float4x4 SIMD_CFUNC simd_add(simd_float4x4 __x, simd_float4x4 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1049 | static simd_double2x2 SIMD_CFUNC simd_add(simd_double2x2 __x, simd_double2x2 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1050 | static simd_double3x2 SIMD_CFUNC simd_add(simd_double3x2 __x, simd_double3x2 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1051 | static simd_double4x2 SIMD_CFUNC simd_add(simd_double4x2 __x, simd_double4x2 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1052 | static simd_double2x3 SIMD_CFUNC simd_add(simd_double2x3 __x, simd_double2x3 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1053 | static simd_double3x3 SIMD_CFUNC simd_add(simd_double3x3 __x, simd_double3x3 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1054 | static simd_double4x3 SIMD_CFUNC simd_add(simd_double4x3 __x, simd_double4x3 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1055 | static simd_double2x4 SIMD_CFUNC simd_add(simd_double2x4 __x, simd_double2x4 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1056 | static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1057 | static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, 1, __y); } | ||
| 1058 | |||
| 1059 | static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1060 | static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1061 | static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1062 | static simd_float2x3 SIMD_CFUNC simd_sub(simd_float2x3 __x, simd_float2x3 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1063 | static simd_float3x3 SIMD_CFUNC simd_sub(simd_float3x3 __x, simd_float3x3 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1064 | static simd_float4x3 SIMD_CFUNC simd_sub(simd_float4x3 __x, simd_float4x3 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1065 | static simd_float2x4 SIMD_CFUNC simd_sub(simd_float2x4 __x, simd_float2x4 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1066 | static simd_float3x4 SIMD_CFUNC simd_sub(simd_float3x4 __x, simd_float3x4 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1067 | static simd_float4x4 SIMD_CFUNC simd_sub(simd_float4x4 __x, simd_float4x4 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1068 | static simd_double2x2 SIMD_CFUNC simd_sub(simd_double2x2 __x, simd_double2x2 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1069 | static simd_double3x2 SIMD_CFUNC simd_sub(simd_double3x2 __x, simd_double3x2 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1070 | static simd_double4x2 SIMD_CFUNC simd_sub(simd_double4x2 __x, simd_double4x2 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1071 | static simd_double2x3 SIMD_CFUNC simd_sub(simd_double2x3 __x, simd_double2x3 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1072 | static simd_double3x3 SIMD_CFUNC simd_sub(simd_double3x3 __x, simd_double3x3 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1073 | static simd_double4x3 SIMD_CFUNC simd_sub(simd_double4x3 __x, simd_double4x3 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1074 | static simd_double2x4 SIMD_CFUNC simd_sub(simd_double2x4 __x, simd_double2x4 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1075 | static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1076 | static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, -1, __y); } | ||
| 1077 | |||
| 1078 | static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x) { | ||
| 1079 | #if defined __SSE__ | ||
| 1080 | simd_float4 __x0, __x1; | ||
| 1081 | __x0.xy = __x.columns[0]; | ||
| 1082 | __x1.xy = __x.columns[1]; | ||
| 1083 | simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1); | ||
| 1084 | return simd_matrix(__r01.lo, __r01.hi); | ||
| 1085 | #else | ||
| 1086 | return simd_matrix((simd_float2){__x.columns[0][0], __x.columns[1][0]}, | ||
| 1087 | (simd_float2){__x.columns[0][1], __x.columns[1][1]}); | ||
| 1088 | #endif | ||
| 1089 | } | ||
| 1090 | |||
| 1091 | static simd_float3x2 SIMD_CFUNC simd_transpose(simd_float2x3 __x) { | ||
| 1092 | #if defined __SSE__ | ||
| 1093 | simd_float4 __x0, __x1; | ||
| 1094 | __x0.xyz = __x.columns[0]; | ||
| 1095 | __x1.xyz = __x.columns[1]; | ||
| 1096 | simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1); | ||
| 1097 | simd_float4 __r2x = _mm_unpackhi_ps(__x0, __x1); | ||
| 1098 | return simd_matrix(__r01.lo, __r01.hi, __r2x.lo); | ||
| 1099 | #else | ||
| 1100 | return simd_matrix((simd_float2){__x.columns[0][0], __x.columns[1][0]}, | ||
| 1101 | (simd_float2){__x.columns[0][1], __x.columns[1][1]}, | ||
| 1102 | (simd_float2){__x.columns[0][2], __x.columns[1][2]}); | ||
| 1103 | #endif | ||
| 1104 | } | ||
| 1105 | |||
| 1106 | static simd_float4x2 SIMD_CFUNC simd_transpose(simd_float2x4 __x) { | ||
| 1107 | #if defined __SSE__ | ||
| 1108 | simd_float4 __r01 = _mm_unpacklo_ps(__x.columns[0], __x.columns[1]); | ||
| 1109 | simd_float4 __r23 = _mm_unpackhi_ps(__x.columns[0], __x.columns[1]); | ||
| 1110 | return simd_matrix(__r01.lo, __r01.hi, __r23.lo, __r23.hi); | ||
| 1111 | #else | ||
| 1112 | return simd_matrix((simd_float2){__x.columns[0][0], __x.columns[1][0]}, | ||
| 1113 | (simd_float2){__x.columns[0][1], __x.columns[1][1]}, | ||
| 1114 | (simd_float2){__x.columns[0][2], __x.columns[1][2]}, | ||
| 1115 | (simd_float2){__x.columns[0][3], __x.columns[1][3]}); | ||
| 1116 | #endif | ||
| 1117 | } | ||
| 1118 | |||
| 1119 | static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x) { | ||
| 1120 | #if defined __SSE__ | ||
| 1121 | simd_float4 __x0, __x1, __x2; | ||
| 1122 | __x0.xy = __x.columns[0]; | ||
| 1123 | __x1.xy = __x.columns[1]; | ||
| 1124 | __x2.xy = __x.columns[2]; | ||
| 1125 | simd_float4 __t = _mm_unpacklo_ps(__x0, __x1); | ||
| 1126 | simd_float4 __r0 = _mm_shuffle_ps(__t,__x2,0xc4); | ||
| 1127 | simd_float4 __r1 = _mm_shuffle_ps(__t,__x2,0xde); | ||
| 1128 | return simd_matrix(__r0.xyz, __r1.xyz); | ||
| 1129 | #else | ||
| 1130 | return simd_matrix((simd_float3){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]}, | ||
| 1131 | (simd_float3){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]}); | ||
| 1132 | #endif | ||
| 1133 | } | ||
| 1134 | |||
| 1135 | static simd_float3x3 SIMD_CFUNC simd_transpose(simd_float3x3 __x) { | ||
| 1136 | #if defined __SSE__ | ||
| 1137 | simd_float4 __x0, __x1, __x2; | ||
| 1138 | __x0.xyz = __x.columns[0]; | ||
| 1139 | __x1.xyz = __x.columns[1]; | ||
| 1140 | __x2.xyz = __x.columns[2]; | ||
| 1141 | simd_float4 __t0 = _mm_unpacklo_ps(__x0, __x1); | ||
| 1142 | simd_float4 __t1 = _mm_unpackhi_ps(__x0, __x1); | ||
| 1143 | simd_float4 __r0 = __t0; __r0.hi = __x2.lo; | ||
| 1144 | simd_float4 __r1 = _mm_shuffle_ps(__t0, __x2, 0xde); | ||
| 1145 | simd_float4 __r2 = __x2; __r2.lo = __t1.lo; | ||
| 1146 | return simd_matrix(__r0.xyz, __r1.xyz, __r2.xyz); | ||
| 1147 | #else | ||
| 1148 | return simd_matrix((simd_float3){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]}, | ||
| 1149 | (simd_float3){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]}, | ||
| 1150 | (simd_float3){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2]}); | ||
| 1151 | #endif | ||
| 1152 | } | ||
| 1153 | |||
| 1154 | static simd_float4x3 SIMD_CFUNC simd_transpose(simd_float3x4 __x) { | ||
| 1155 | #if defined __SSE__ | ||
| 1156 | simd_float4 __t0 = _mm_unpacklo_ps(__x.columns[0],__x.columns[1]); /* 00 10 01 11 */ | ||
| 1157 | simd_float4 __t1 = _mm_unpackhi_ps(__x.columns[0],__x.columns[1]); /* 02 12 03 13 */ | ||
| 1158 | simd_float4 __r0 = __t0; __r0.hi = __x.columns[2].lo; | ||
| 1159 | simd_float4 __r1 = _mm_shuffle_ps(__t0, __x.columns[2], 0xde); | ||
| 1160 | simd_float4 __r2 = __x.columns[2]; __r2.lo = __t1.lo; | ||
| 1161 | simd_float4 __r3 = _mm_shuffle_ps(__t1, __x.columns[2], 0xfe); | ||
| 1162 | return simd_matrix(__r0.xyz, __r1.xyz, __r2.xyz, __r3.xyz); | ||
| 1163 | #else | ||
| 1164 | return simd_matrix((simd_float3){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]}, | ||
| 1165 | (simd_float3){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]}, | ||
| 1166 | (simd_float3){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2]}, | ||
| 1167 | (simd_float3){__x.columns[0][3], __x.columns[1][3], __x.columns[2][3]}); | ||
| 1168 | #endif | ||
| 1169 | } | ||
| 1170 | |||
| 1171 | static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x) { | ||
| 1172 | #if defined __SSE__ | ||
| 1173 | simd_float4 __x0, __x1, __x2, __x3; | ||
| 1174 | __x0.xy = __x.columns[0]; | ||
| 1175 | __x1.xy = __x.columns[1]; | ||
| 1176 | __x2.xy = __x.columns[2]; | ||
| 1177 | __x3.xy = __x.columns[3]; | ||
| 1178 | simd_float4 __t0 = _mm_unpacklo_ps(__x0,__x2); | ||
| 1179 | simd_float4 __t1 = _mm_unpacklo_ps(__x1,__x3); | ||
| 1180 | simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t1); | ||
| 1181 | simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t1); | ||
| 1182 | return simd_matrix(__r0,__r1); | ||
| 1183 | #else | ||
| 1184 | return simd_matrix((simd_float4){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]}, | ||
| 1185 | (simd_float4){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]}); | ||
| 1186 | #endif | ||
| 1187 | } | ||
| 1188 | |||
| 1189 | static simd_float3x4 SIMD_CFUNC simd_transpose(simd_float4x3 __x) { | ||
| 1190 | #if defined __SSE__ | ||
| 1191 | simd_float4 __x0, __x1, __x2, __x3; | ||
| 1192 | __x0.xyz = __x.columns[0]; | ||
| 1193 | __x1.xyz = __x.columns[1]; | ||
| 1194 | __x2.xyz = __x.columns[2]; | ||
| 1195 | __x3.xyz = __x.columns[3]; | ||
| 1196 | simd_float4 __t0 = _mm_unpacklo_ps(__x0,__x2); | ||
| 1197 | simd_float4 __t1 = _mm_unpackhi_ps(__x0,__x2); | ||
| 1198 | simd_float4 __t2 = _mm_unpacklo_ps(__x1,__x3); | ||
| 1199 | simd_float4 __t3 = _mm_unpackhi_ps(__x1,__x3); | ||
| 1200 | simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t2); | ||
| 1201 | simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2); | ||
| 1202 | simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3); | ||
| 1203 | return simd_matrix(__r0,__r1,__r2); | ||
| 1204 | #else | ||
| 1205 | return simd_matrix((simd_float4){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]}, | ||
| 1206 | (simd_float4){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]}, | ||
| 1207 | (simd_float4){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2], __x.columns[3][2]}); | ||
| 1208 | #endif | ||
| 1209 | } | ||
| 1210 | |||
| 1211 | static simd_float4x4 SIMD_CFUNC simd_transpose(simd_float4x4 __x) { | ||
| 1212 | #if defined __SSE__ | ||
| 1213 | simd_float4 __t0 = _mm_unpacklo_ps(__x.columns[0],__x.columns[2]); | ||
| 1214 | simd_float4 __t1 = _mm_unpackhi_ps(__x.columns[0],__x.columns[2]); | ||
| 1215 | simd_float4 __t2 = _mm_unpacklo_ps(__x.columns[1],__x.columns[3]); | ||
| 1216 | simd_float4 __t3 = _mm_unpackhi_ps(__x.columns[1],__x.columns[3]); | ||
| 1217 | simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t2); | ||
| 1218 | simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2); | ||
| 1219 | simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3); | ||
| 1220 | simd_float4 __r3 = _mm_unpackhi_ps(__t1,__t3); | ||
| 1221 | return simd_matrix(__r0,__r1,__r2,__r3); | ||
| 1222 | #else | ||
| 1223 | return simd_matrix((simd_float4){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]}, | ||
| 1224 | (simd_float4){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]}, | ||
| 1225 | (simd_float4){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2], __x.columns[3][2]}, | ||
| 1226 | (simd_float4){__x.columns[0][3], __x.columns[1][3], __x.columns[2][3], __x.columns[3][3]}); | ||
| 1227 | #endif | ||
| 1228 | } | ||
| 1229 | |||
| 1230 | static simd_double2x2 SIMD_CFUNC simd_transpose(simd_double2x2 __x) { | ||
| 1231 | return simd_matrix((simd_double2){__x.columns[0][0], __x.columns[1][0]}, | ||
| 1232 | (simd_double2){__x.columns[0][1], __x.columns[1][1]}); | ||
| 1233 | } | ||
| 1234 | |||
| 1235 | static simd_double3x2 SIMD_CFUNC simd_transpose(simd_double2x3 __x) { | ||
| 1236 | return simd_matrix((simd_double2){__x.columns[0][0], __x.columns[1][0]}, | ||
| 1237 | (simd_double2){__x.columns[0][1], __x.columns[1][1]}, | ||
| 1238 | (simd_double2){__x.columns[0][2], __x.columns[1][2]}); | ||
| 1239 | } | ||
| 1240 | |||
| 1241 | static simd_double4x2 SIMD_CFUNC simd_transpose(simd_double2x4 __x) { | ||
| 1242 | return simd_matrix((simd_double2){__x.columns[0][0], __x.columns[1][0]}, | ||
| 1243 | (simd_double2){__x.columns[0][1], __x.columns[1][1]}, | ||
| 1244 | (simd_double2){__x.columns[0][2], __x.columns[1][2]}, | ||
| 1245 | (simd_double2){__x.columns[0][3], __x.columns[1][3]}); | ||
| 1246 | } | ||
| 1247 | |||
| 1248 | static simd_double2x3 SIMD_CFUNC simd_transpose(simd_double3x2 __x) { | ||
| 1249 | return simd_matrix((simd_double3){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]}, | ||
| 1250 | (simd_double3){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]}); | ||
| 1251 | } | ||
| 1252 | |||
| 1253 | static simd_double3x3 SIMD_CFUNC simd_transpose(simd_double3x3 __x) { | ||
| 1254 | return simd_matrix((simd_double3){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]}, | ||
| 1255 | (simd_double3){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]}, | ||
| 1256 | (simd_double3){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2]}); | ||
| 1257 | } | ||
| 1258 | |||
| 1259 | static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x) { | ||
| 1260 | return simd_matrix((simd_double3){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]}, | ||
| 1261 | (simd_double3){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]}, | ||
| 1262 | (simd_double3){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2]}, | ||
| 1263 | (simd_double3){__x.columns[0][3], __x.columns[1][3], __x.columns[2][3]}); | ||
| 1264 | } | ||
| 1265 | |||
| 1266 | static simd_double2x4 SIMD_CFUNC simd_transpose(simd_double4x2 __x) { | ||
| 1267 | return simd_matrix((simd_double4){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]}, | ||
| 1268 | (simd_double4){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]}); | ||
| 1269 | } | ||
| 1270 | |||
| 1271 | static simd_double3x4 SIMD_CFUNC simd_transpose(simd_double4x3 __x) { | ||
| 1272 | return simd_matrix((simd_double4){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]}, | ||
| 1273 | (simd_double4){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]}, | ||
| 1274 | (simd_double4){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2], __x.columns[3][2]}); | ||
| 1275 | } | ||
| 1276 | |||
| 1277 | static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) { | ||
| 1278 | return simd_matrix((simd_double4){__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]}, | ||
| 1279 | (simd_double4){__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]}, | ||
| 1280 | (simd_double4){__x.columns[0][2], __x.columns[1][2], __x.columns[2][2], __x.columns[3][2]}, | ||
| 1281 | (simd_double4){__x.columns[0][3], __x.columns[1][3], __x.columns[2][3], __x.columns[3][3]}); | ||
| 1282 | } | ||
| 1283 | |||
| 1284 | static simd_float3 SIMD_CFUNC __rotate1( simd_float3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); } | ||
| 1285 | static simd_float3 SIMD_CFUNC __rotate2( simd_float3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); } | ||
| 1286 | static simd_float4 SIMD_CFUNC __rotate1( simd_float4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); } | ||
| 1287 | static simd_float4 SIMD_CFUNC __rotate2( simd_float4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); } | ||
| 1288 | static simd_float4 SIMD_CFUNC __rotate3( simd_float4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); } | ||
| 1289 | static simd_double3 SIMD_CFUNC __rotate1(simd_double3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); } | ||
| 1290 | static simd_double3 SIMD_CFUNC __rotate2(simd_double3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); } | ||
| 1291 | static simd_double4 SIMD_CFUNC __rotate1(simd_double4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); } | ||
| 1292 | static simd_double4 SIMD_CFUNC __rotate2(simd_double4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); } | ||
| 1293 | static simd_double4 SIMD_CFUNC __rotate3(simd_double4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); } | ||
| 1294 | |||
| 1295 | static float SIMD_CFUNC simd_determinant( simd_float2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; } | ||
| 1296 | static double SIMD_CFUNC simd_determinant(simd_double2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; } | ||
| 1297 | static float SIMD_CFUNC simd_determinant( simd_float3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); } | ||
| 1298 | static double SIMD_CFUNC simd_determinant(simd_double3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); } | ||
| 1299 | static float SIMD_CFUNC simd_determinant( simd_float4x4 __x) { | ||
| 1300 | simd_float4 codet = __x.columns[0]*(__rotate1(__x.columns[1])*(__rotate2(__x.columns[2])*__rotate3(__x.columns[3])-__rotate3(__x.columns[2])*__rotate2(__x.columns[3])) + | ||
| 1301 | __rotate2(__x.columns[1])*(__rotate3(__x.columns[2])*__rotate1(__x.columns[3])-__rotate1(__x.columns[2])*__rotate3(__x.columns[3])) + | ||
| 1302 | __rotate3(__x.columns[1])*(__rotate1(__x.columns[2])*__rotate2(__x.columns[3])-__rotate2(__x.columns[2])*__rotate1(__x.columns[3]))); | ||
| 1303 | return simd_reduce_add(codet.even - codet.odd); | ||
| 1304 | } | ||
| 1305 | static double SIMD_CFUNC simd_determinant(simd_double4x4 __x) { | ||
| 1306 | simd_double4 codet = __x.columns[0]*(__rotate1(__x.columns[1])*(__rotate2(__x.columns[2])*__rotate3(__x.columns[3])-__rotate3(__x.columns[2])*__rotate2(__x.columns[3])) + | ||
| 1307 | __rotate2(__x.columns[1])*(__rotate3(__x.columns[2])*__rotate1(__x.columns[3])-__rotate1(__x.columns[2])*__rotate3(__x.columns[3])) + | ||
| 1308 | __rotate3(__x.columns[1])*(__rotate1(__x.columns[2])*__rotate2(__x.columns[3])-__rotate2(__x.columns[2])*__rotate1(__x.columns[3]))); | ||
| 1309 | return simd_reduce_add(codet.even - codet.odd); | ||
| 1310 | } | ||
| 1311 | |||
| 1312 | static simd_float2x2 SIMD_CFUNC simd_inverse( simd_float2x2 __x) { return __invert_f2(__x); } | ||
| 1313 | static simd_float3x3 SIMD_CFUNC simd_inverse( simd_float3x3 __x) { return __invert_f3(__x); } | ||
| 1314 | static simd_float4x4 SIMD_CFUNC simd_inverse( simd_float4x4 __x) { return __invert_f4(__x); } | ||
| 1315 | static simd_double2x2 SIMD_CFUNC simd_inverse(simd_double2x2 __x) { return __invert_d2(__x); } | ||
| 1316 | static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) { return __invert_d3(__x); } | ||
| 1317 | static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) { return __invert_d4(__x); } | ||
| 1318 | |||
| 1319 | static simd_float2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float2 __y) { simd_float2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; } | ||
| 1320 | static simd_float3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float2 __y) { simd_float3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; } | ||
| 1321 | static simd_float4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float2 __y) { simd_float4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; } | ||
| 1322 | static simd_float2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float3 __y) { simd_float2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; } | ||
| 1323 | static simd_float3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float3 __y) { simd_float3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; } | ||
| 1324 | static simd_float4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float3 __y) { simd_float4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; } | ||
| 1325 | static simd_float2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float4 __y) { simd_float2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; } | ||
| 1326 | static simd_float3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float4 __y) { simd_float3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; } | ||
| 1327 | static simd_float4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float4 __y) { simd_float4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; } | ||
| 1328 | static simd_double2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2 __y) { simd_double2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; } | ||
| 1329 | static simd_double3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2 __y) { simd_double3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; } | ||
| 1330 | static simd_double4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2 __y) { simd_double4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; } | ||
| 1331 | static simd_double2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3 __y) { simd_double2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; } | ||
| 1332 | static simd_double3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3 __y) { simd_double3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; } | ||
| 1333 | static simd_double4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3 __y) { simd_double4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; } | ||
| 1334 | static simd_double2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4 __y) { simd_double2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; } | ||
| 1335 | static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y) { simd_double3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; } | ||
| 1336 | static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y) { simd_double4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; } | ||
| 1337 | |||
| 1338 | static simd_float2 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float2x2 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1339 | static simd_float3 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float3x2 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1340 | static simd_float4 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float4x2 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1341 | static simd_float2 SIMD_CFUNC simd_mul( simd_float3 __x, simd_float2x3 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1342 | static simd_float3 SIMD_CFUNC simd_mul( simd_float3 __x, simd_float3x3 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1343 | static simd_float4 SIMD_CFUNC simd_mul( simd_float3 __x, simd_float4x3 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1344 | static simd_float2 SIMD_CFUNC simd_mul( simd_float4 __x, simd_float2x4 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1345 | static simd_float3 SIMD_CFUNC simd_mul( simd_float4 __x, simd_float3x4 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1346 | static simd_float4 SIMD_CFUNC simd_mul( simd_float4 __x, simd_float4x4 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1347 | static simd_double2 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double2x2 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1348 | static simd_double3 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double3x2 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1349 | static simd_double4 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double4x2 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1350 | static simd_double2 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double2x3 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1351 | static simd_double3 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double3x3 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1352 | static simd_double4 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double4x3 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1353 | static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1354 | static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1355 | static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y) { return simd_mul(simd_transpose(__y), __x); } | ||
| 1356 | |||
| 1357 | static simd_float2x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float2x2 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1358 | static simd_double2x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2x2 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1359 | static simd_float2x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float2x2 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1360 | static simd_double2x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2x2 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1361 | static simd_float2x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float2x2 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1362 | static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1363 | static simd_float2x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float2x3 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1364 | static simd_double2x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double2x3 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1365 | static simd_float2x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float2x3 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1366 | static simd_double2x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double2x3 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1367 | static simd_float2x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float2x3 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1368 | static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1369 | static simd_float2x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float2x4 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1370 | static simd_double2x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double2x4 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1371 | static simd_float2x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float2x4 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1372 | static simd_double2x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double2x4 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1373 | static simd_float2x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float2x4 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1374 | static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1375 | |||
| 1376 | static simd_float3x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float3x2 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1377 | static simd_double3x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double3x2 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1378 | static simd_float3x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float3x2 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1379 | static simd_double3x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double3x2 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1380 | static simd_float3x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float3x2 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1381 | static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1382 | static simd_float3x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float3x3 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1383 | static simd_double3x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3x3 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1384 | static simd_float3x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float3x3 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1385 | static simd_double3x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3x3 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1386 | static simd_float3x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float3x3 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1387 | static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1388 | static simd_float3x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float3x4 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1389 | static simd_double3x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double3x4 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1390 | static simd_float3x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float3x4 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1391 | static simd_double3x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double3x4 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1392 | static simd_float3x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float3x4 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1393 | static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1394 | |||
| 1395 | static simd_float4x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float4x2 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1396 | static simd_double4x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double4x2 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1397 | static simd_float4x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float4x2 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1398 | static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1399 | static simd_float4x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float4x2 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1400 | static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1401 | static simd_float4x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float4x3 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1402 | static simd_double4x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double4x3 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1403 | static simd_float4x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float4x3 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1404 | static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1405 | static simd_float4x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float4x3 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1406 | static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1407 | static simd_float4x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float4x4 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1408 | static simd_double4x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4x4 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1409 | static simd_float4x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float4x4 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1410 | static simd_double4x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4x4 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1411 | static simd_float4x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float4x4 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1412 | static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; } | ||
| 1413 | |||
| 1414 | static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2 __y) { return simd_mul(__x, __y); } | ||
| 1415 | static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2 __y) { return simd_mul(__x, __y); } | ||
| 1416 | static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2 __y) { return simd_mul(__x, __y); } | ||
| 1417 | static simd_float2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3 __y) { return simd_mul(__x, __y); } | ||
| 1418 | static simd_float3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3 __y) { return simd_mul(__x, __y); } | ||
| 1419 | static simd_float4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3 __y) { return simd_mul(__x, __y); } | ||
| 1420 | static simd_float2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4 __y) { return simd_mul(__x, __y); } | ||
| 1421 | static simd_float3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4 __y) { return simd_mul(__x, __y); } | ||
| 1422 | static simd_float4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4 __y) { return simd_mul(__x, __y); } | ||
| 1423 | static simd_double2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double2 __y) { return simd_mul(__x, __y); } | ||
| 1424 | static simd_double3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double2 __y) { return simd_mul(__x, __y); } | ||
| 1425 | static simd_double4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double2 __y) { return simd_mul(__x, __y); } | ||
| 1426 | static simd_double2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double3 __y) { return simd_mul(__x, __y); } | ||
| 1427 | static simd_double3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double3 __y) { return simd_mul(__x, __y); } | ||
| 1428 | static simd_double4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double3 __y) { return simd_mul(__x, __y); } | ||
| 1429 | static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4 __y) { return simd_mul(__x, __y); } | ||
| 1430 | static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4 __y) { return simd_mul(__x, __y); } | ||
| 1431 | static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4 __y) { return simd_mul(__x, __y); } | ||
| 1432 | |||
| 1433 | static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); } | ||
| 1434 | static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); } | ||
| 1435 | static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); } | ||
| 1436 | static simd_float2 SIMD_CFUNC matrix_multiply( simd_float3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); } | ||
| 1437 | static simd_float3 SIMD_CFUNC matrix_multiply( simd_float3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); } | ||
| 1438 | static simd_float4 SIMD_CFUNC matrix_multiply( simd_float3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); } | ||
| 1439 | static simd_float2 SIMD_CFUNC matrix_multiply( simd_float4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); } | ||
| 1440 | static simd_float3 SIMD_CFUNC matrix_multiply( simd_float4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); } | ||
| 1441 | static simd_float4 SIMD_CFUNC matrix_multiply( simd_float4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); } | ||
| 1442 | static simd_double2 SIMD_CFUNC matrix_multiply(simd_double2 __x, simd_double2x2 __y) { return simd_mul(__x, __y); } | ||
| 1443 | static simd_double3 SIMD_CFUNC matrix_multiply(simd_double2 __x, simd_double3x2 __y) { return simd_mul(__x, __y); } | ||
| 1444 | static simd_double4 SIMD_CFUNC matrix_multiply(simd_double2 __x, simd_double4x2 __y) { return simd_mul(__x, __y); } | ||
| 1445 | static simd_double2 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double2x3 __y) { return simd_mul(__x, __y); } | ||
| 1446 | static simd_double3 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double3x3 __y) { return simd_mul(__x, __y); } | ||
| 1447 | static simd_double4 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double4x3 __y) { return simd_mul(__x, __y); } | ||
| 1448 | static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); } | ||
| 1449 | static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); } | ||
| 1450 | static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); } | ||
| 1451 | |||
| 1452 | static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); } | ||
| 1453 | static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double2x2 __y) { return simd_mul(__x, __y); } | ||
| 1454 | static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2x2 __y) { return simd_mul(__x, __y); } | ||
| 1455 | static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double2x2 __y) { return simd_mul(__x, __y); } | ||
| 1456 | static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2x2 __y) { return simd_mul(__x, __y); } | ||
| 1457 | static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double2x2 __y) { return simd_mul(__x, __y); } | ||
| 1458 | static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float2x3 __y) { return simd_mul(__x, __y); } | ||
| 1459 | static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double2x3 __y) { return simd_mul(__x, __y); } | ||
| 1460 | static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); } | ||
| 1461 | static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double2x3 __y) { return simd_mul(__x, __y); } | ||
| 1462 | static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float2x3 __y) { return simd_mul(__x, __y); } | ||
| 1463 | static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double2x3 __y) { return simd_mul(__x, __y); } | ||
| 1464 | static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float2x4 __y) { return simd_mul(__x, __y); } | ||
| 1465 | static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double2x4 __y) { return simd_mul(__x, __y); } | ||
| 1466 | static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float2x4 __y) { return simd_mul(__x, __y); } | ||
| 1467 | static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double2x4 __y) { return simd_mul(__x, __y); } | ||
| 1468 | static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); } | ||
| 1469 | static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); } | ||
| 1470 | |||
| 1471 | static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); } | ||
| 1472 | static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double3x2 __y) { return simd_mul(__x, __y); } | ||
| 1473 | static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float3x2 __y) { return simd_mul(__x, __y); } | ||
| 1474 | static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double3x2 __y) { return simd_mul(__x, __y); } | ||
| 1475 | static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float3x2 __y) { return simd_mul(__x, __y); } | ||
| 1476 | static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double3x2 __y) { return simd_mul(__x, __y); } | ||
| 1477 | static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3x3 __y) { return simd_mul(__x, __y); } | ||
| 1478 | static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double3x3 __y) { return simd_mul(__x, __y); } | ||
| 1479 | static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); } | ||
| 1480 | static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double3x3 __y) { return simd_mul(__x, __y); } | ||
| 1481 | static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3x3 __y) { return simd_mul(__x, __y); } | ||
| 1482 | static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double3x3 __y) { return simd_mul(__x, __y); } | ||
| 1483 | static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float3x4 __y) { return simd_mul(__x, __y); } | ||
| 1484 | static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double3x4 __y) { return simd_mul(__x, __y); } | ||
| 1485 | static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float3x4 __y) { return simd_mul(__x, __y); } | ||
| 1486 | static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double3x4 __y) { return simd_mul(__x, __y); } | ||
| 1487 | static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); } | ||
| 1488 | static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); } | ||
| 1489 | |||
| 1490 | static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); } | ||
| 1491 | static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double4x2 __y) { return simd_mul(__x, __y); } | ||
| 1492 | static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float4x2 __y) { return simd_mul(__x, __y); } | ||
| 1493 | static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double4x2 __y) { return simd_mul(__x, __y); } | ||
| 1494 | static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float4x2 __y) { return simd_mul(__x, __y); } | ||
| 1495 | static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double4x2 __y) { return simd_mul(__x, __y); } | ||
| 1496 | static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float4x3 __y) { return simd_mul(__x, __y); } | ||
| 1497 | static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double4x3 __y) { return simd_mul(__x, __y); } | ||
| 1498 | static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); } | ||
| 1499 | static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double4x3 __y) { return simd_mul(__x, __y); } | ||
| 1500 | static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float4x3 __y) { return simd_mul(__x, __y); } | ||
| 1501 | static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double4x3 __y) { return simd_mul(__x, __y); } | ||
| 1502 | static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4x4 __y) { return simd_mul(__x, __y); } | ||
| 1503 | static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4x4 __y) { return simd_mul(__x, __y); } | ||
| 1504 | static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4x4 __y) { return simd_mul(__x, __y); } | ||
| 1505 | static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4x4 __y) { return simd_mul(__x, __y); } | ||
| 1506 | static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); } | ||
| 1507 | static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); } | ||
| 1508 | |||
| 1509 | static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y) { | ||
| 1510 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1511 | (__x.columns[1] == __y.columns[1])); | ||
| 1512 | } | ||
| 1513 | static simd_bool SIMD_CFUNC simd_equal(simd_float2x3 __x, simd_float2x3 __y) { | ||
| 1514 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1515 | (__x.columns[1] == __y.columns[1])); | ||
| 1516 | } | ||
| 1517 | static simd_bool SIMD_CFUNC simd_equal(simd_float2x4 __x, simd_float2x4 __y) { | ||
| 1518 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1519 | (__x.columns[1] == __y.columns[1])); | ||
| 1520 | } | ||
| 1521 | static simd_bool SIMD_CFUNC simd_equal(simd_float3x2 __x, simd_float3x2 __y) { | ||
| 1522 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1523 | (__x.columns[1] == __y.columns[1]) & | ||
| 1524 | (__x.columns[2] == __y.columns[2])); | ||
| 1525 | } | ||
| 1526 | static simd_bool SIMD_CFUNC simd_equal(simd_float3x3 __x, simd_float3x3 __y) { | ||
| 1527 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1528 | (__x.columns[1] == __y.columns[1]) & | ||
| 1529 | (__x.columns[2] == __y.columns[2])); | ||
| 1530 | } | ||
| 1531 | static simd_bool SIMD_CFUNC simd_equal(simd_float3x4 __x, simd_float3x4 __y) { | ||
| 1532 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1533 | (__x.columns[1] == __y.columns[1]) & | ||
| 1534 | (__x.columns[2] == __y.columns[2])); | ||
| 1535 | } | ||
| 1536 | static simd_bool SIMD_CFUNC simd_equal(simd_float4x2 __x, simd_float4x2 __y) { | ||
| 1537 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1538 | (__x.columns[1] == __y.columns[1]) & | ||
| 1539 | (__x.columns[2] == __y.columns[2]) & | ||
| 1540 | (__x.columns[3] == __y.columns[3])); | ||
| 1541 | } | ||
| 1542 | static simd_bool SIMD_CFUNC simd_equal(simd_float4x3 __x, simd_float4x3 __y) { | ||
| 1543 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1544 | (__x.columns[1] == __y.columns[1]) & | ||
| 1545 | (__x.columns[2] == __y.columns[2]) & | ||
| 1546 | (__x.columns[3] == __y.columns[3])); | ||
| 1547 | } | ||
| 1548 | static simd_bool SIMD_CFUNC simd_equal(simd_float4x4 __x, simd_float4x4 __y) { | ||
| 1549 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1550 | (__x.columns[1] == __y.columns[1]) & | ||
| 1551 | (__x.columns[2] == __y.columns[2]) & | ||
| 1552 | (__x.columns[3] == __y.columns[3])); | ||
| 1553 | } | ||
| 1554 | static simd_bool SIMD_CFUNC simd_equal(simd_double2x2 __x, simd_double2x2 __y) { | ||
| 1555 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1556 | (__x.columns[1] == __y.columns[1])); | ||
| 1557 | } | ||
| 1558 | static simd_bool SIMD_CFUNC simd_equal(simd_double2x3 __x, simd_double2x3 __y) { | ||
| 1559 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1560 | (__x.columns[1] == __y.columns[1])); | ||
| 1561 | } | ||
| 1562 | static simd_bool SIMD_CFUNC simd_equal(simd_double2x4 __x, simd_double2x4 __y) { | ||
| 1563 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1564 | (__x.columns[1] == __y.columns[1])); | ||
| 1565 | } | ||
| 1566 | static simd_bool SIMD_CFUNC simd_equal(simd_double3x2 __x, simd_double3x2 __y) { | ||
| 1567 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1568 | (__x.columns[1] == __y.columns[1]) & | ||
| 1569 | (__x.columns[2] == __y.columns[2])); | ||
| 1570 | } | ||
| 1571 | static simd_bool SIMD_CFUNC simd_equal(simd_double3x3 __x, simd_double3x3 __y) { | ||
| 1572 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1573 | (__x.columns[1] == __y.columns[1]) & | ||
| 1574 | (__x.columns[2] == __y.columns[2])); | ||
| 1575 | } | ||
| 1576 | static simd_bool SIMD_CFUNC simd_equal(simd_double3x4 __x, simd_double3x4 __y) { | ||
| 1577 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1578 | (__x.columns[1] == __y.columns[1]) & | ||
| 1579 | (__x.columns[2] == __y.columns[2])); | ||
| 1580 | } | ||
| 1581 | static simd_bool SIMD_CFUNC simd_equal(simd_double4x2 __x, simd_double4x2 __y) { | ||
| 1582 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1583 | (__x.columns[1] == __y.columns[1]) & | ||
| 1584 | (__x.columns[2] == __y.columns[2]) & | ||
| 1585 | (__x.columns[3] == __y.columns[3])); | ||
| 1586 | } | ||
| 1587 | static simd_bool SIMD_CFUNC simd_equal(simd_double4x3 __x, simd_double4x3 __y) { | ||
| 1588 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1589 | (__x.columns[1] == __y.columns[1]) & | ||
| 1590 | (__x.columns[2] == __y.columns[2]) & | ||
| 1591 | (__x.columns[3] == __y.columns[3])); | ||
| 1592 | } | ||
| 1593 | static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y) { | ||
| 1594 | return simd_all((__x.columns[0] == __y.columns[0]) & | ||
| 1595 | (__x.columns[1] == __y.columns[1]) & | ||
| 1596 | (__x.columns[2] == __y.columns[2]) & | ||
| 1597 | (__x.columns[3] == __y.columns[3])); | ||
| 1598 | } | ||
| 1599 | |||
| 1600 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol) { | ||
| 1601 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1602 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol)); | ||
| 1603 | } | ||
| 1604 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x3 __x, simd_float2x3 __y, float __tol) { | ||
| 1605 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1606 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol)); | ||
| 1607 | } | ||
| 1608 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x4 __x, simd_float2x4 __y, float __tol) { | ||
| 1609 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1610 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol)); | ||
| 1611 | } | ||
| 1612 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x2 __x, simd_float3x2 __y, float __tol) { | ||
| 1613 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1614 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1615 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol)); | ||
| 1616 | } | ||
| 1617 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x3 __x, simd_float3x3 __y, float __tol) { | ||
| 1618 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1619 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1620 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol)); | ||
| 1621 | } | ||
| 1622 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x4 __x, simd_float3x4 __y, float __tol) { | ||
| 1623 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1624 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1625 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol)); | ||
| 1626 | } | ||
| 1627 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x2 __x, simd_float4x2 __y, float __tol) { | ||
| 1628 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1629 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1630 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) & | ||
| 1631 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol)); | ||
| 1632 | } | ||
| 1633 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x3 __x, simd_float4x3 __y, float __tol) { | ||
| 1634 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1635 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1636 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) & | ||
| 1637 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol)); | ||
| 1638 | } | ||
| 1639 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x4 __x, simd_float4x4 __y, float __tol) { | ||
| 1640 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1641 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1642 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) & | ||
| 1643 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol)); | ||
| 1644 | } | ||
| 1645 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x2 __x, simd_double2x2 __y, double __tol) { | ||
| 1646 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1647 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol)); | ||
| 1648 | } | ||
| 1649 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x3 __x, simd_double2x3 __y, double __tol) { | ||
| 1650 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1651 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol)); | ||
| 1652 | } | ||
| 1653 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x4 __x, simd_double2x4 __y, double __tol) { | ||
| 1654 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1655 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol)); | ||
| 1656 | } | ||
| 1657 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x2 __x, simd_double3x2 __y, double __tol) { | ||
| 1658 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1659 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1660 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol)); | ||
| 1661 | } | ||
| 1662 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x3 __x, simd_double3x3 __y, double __tol) { | ||
| 1663 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1664 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1665 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol)); | ||
| 1666 | } | ||
| 1667 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x4 __x, simd_double3x4 __y, double __tol) { | ||
| 1668 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1669 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1670 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol)); | ||
| 1671 | } | ||
| 1672 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x2 __x, simd_double4x2 __y, double __tol) { | ||
| 1673 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1674 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1675 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) & | ||
| 1676 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol)); | ||
| 1677 | } | ||
| 1678 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x3 __x, simd_double4x3 __y, double __tol) { | ||
| 1679 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1680 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1681 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) & | ||
| 1682 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol)); | ||
| 1683 | } | ||
| 1684 | static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_double4x4 __y, double __tol) { | ||
| 1685 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) & | ||
| 1686 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) & | ||
| 1687 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) & | ||
| 1688 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol)); | ||
| 1689 | } | ||
| 1690 | |||
| 1691 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol) { | ||
| 1692 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1693 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1]))); | ||
| 1694 | } | ||
| 1695 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x3 __x, simd_float2x3 __y, float __tol) { | ||
| 1696 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1697 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1]))); | ||
| 1698 | } | ||
| 1699 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x4 __x, simd_float2x4 __y, float __tol) { | ||
| 1700 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1701 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1]))); | ||
| 1702 | } | ||
| 1703 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x2 __x, simd_float3x2 __y, float __tol) { | ||
| 1704 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1705 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1706 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2]))); | ||
| 1707 | } | ||
| 1708 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x3 __x, simd_float3x3 __y, float __tol) { | ||
| 1709 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1710 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1711 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2]))); | ||
| 1712 | } | ||
| 1713 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x4 __x, simd_float3x4 __y, float __tol) { | ||
| 1714 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1715 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1716 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2]))); | ||
| 1717 | } | ||
| 1718 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x2 __x, simd_float4x2 __y, float __tol) { | ||
| 1719 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1720 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1721 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) & | ||
| 1722 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3]))); | ||
| 1723 | } | ||
| 1724 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x3 __x, simd_float4x3 __y, float __tol) { | ||
| 1725 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1726 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1727 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) & | ||
| 1728 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3]))); | ||
| 1729 | } | ||
| 1730 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x4 __x, simd_float4x4 __y, float __tol) { | ||
| 1731 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1732 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1733 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) & | ||
| 1734 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3]))); | ||
| 1735 | } | ||
| 1736 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x2 __x, simd_double2x2 __y, double __tol) { | ||
| 1737 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1738 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1]))); | ||
| 1739 | } | ||
| 1740 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x3 __x, simd_double2x3 __y, double __tol) { | ||
| 1741 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1742 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1]))); | ||
| 1743 | } | ||
| 1744 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x4 __x, simd_double2x4 __y, double __tol) { | ||
| 1745 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1746 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1]))); | ||
| 1747 | } | ||
| 1748 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x2 __x, simd_double3x2 __y, double __tol) { | ||
| 1749 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1750 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1751 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2]))); | ||
| 1752 | } | ||
| 1753 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x3 __x, simd_double3x3 __y, double __tol) { | ||
| 1754 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1755 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1756 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2]))); | ||
| 1757 | } | ||
| 1758 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x4 __x, simd_double3x4 __y, double __tol) { | ||
| 1759 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1760 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1761 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2]))); | ||
| 1762 | } | ||
| 1763 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x2 __x, simd_double4x2 __y, double __tol) { | ||
| 1764 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1765 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1766 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) & | ||
| 1767 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3]))); | ||
| 1768 | } | ||
| 1769 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x3 __x, simd_double4x3 __y, double __tol) { | ||
| 1770 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1771 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1772 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) & | ||
| 1773 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3]))); | ||
| 1774 | } | ||
| 1775 | static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x4 __x, simd_double4x4 __y, double __tol) { | ||
| 1776 | return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) & | ||
| 1777 | (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) & | ||
| 1778 | (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) & | ||
| 1779 | (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3]))); | ||
| 1780 | } | ||
| 1781 | |||
| 1782 | #ifdef __cplusplus | ||
| 1783 | } | ||
| 1784 | #endif | ||
| 1785 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 1786 | #endif /* __SIMD_HEADER__ */ | ||
lib/libc/include/x86_64-macos-gnu/simd/matrix_types.h created+264| ... | @@ -0,0 +1,264 @@ | ||
| 1 | /* Copyright (c) 2014-2017 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * This header defines nine matrix types for each of float and double, which | ||
| 4 | * are intended for use together with the vector types defined in | ||
| 5 | * <simd/vector_types.h>. | ||
| 6 | * | ||
| 7 | * For compatibility with common graphics libraries, these matrices are stored | ||
| 8 | * in column-major order, and implemented as arrays of column vectors. | ||
| 9 | * Column-major storage order may seem a little strange if you aren't used to | ||
| 10 | * it, but for most usage the memory layout of the matrices shouldn't matter | ||
| 11 | * at all; instead you should think of matrices as abstract mathematical | ||
| 12 | * objects that you use to perform arithmetic without worrying about the | ||
| 13 | * details of the underlying representation. | ||
| 14 | * | ||
| 15 | * WARNING: vectors of length three are internally represented as length four | ||
| 16 | * vectors with one element of padding (for alignment purposes). This means | ||
| 17 | * that when a floatNx3 or doubleNx3 is viewed as a vector, it appears to | ||
| 18 | * have 4*N elements instead of the expected 3*N (with one padding element | ||
| 19 | * at the end of each column). The matrix elements are laid out in memory | ||
| 20 | * as follows: | ||
| 21 | * | ||
| 22 | * { 0, 1, 2, x, 3, 4, 5, x, ... } | ||
| 23 | * | ||
| 24 | * (where the scalar indices used above indicate the conceptual column- | ||
| 25 | * major storage order). If you aren't monkeying around with the internal | ||
| 26 | * storage details of matrices, you don't need to worry about this at all. | ||
| 27 | * Consider this yet another good reason to avoid doing so. */ | ||
| 28 | |||
| 29 | #ifndef SIMD_MATRIX_TYPES_HEADER | ||
| 30 | #define SIMD_MATRIX_TYPES_HEADER | ||
| 31 | |||
| 32 | #include <simd/types.h> | ||
| 33 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 34 | |||
| 35 | /* Matrix types available in C, Objective-C, and C++ */ | ||
| 36 | typedef simd_float2x2 matrix_float2x2; | ||
| 37 | typedef simd_float3x2 matrix_float3x2; | ||
| 38 | typedef simd_float4x2 matrix_float4x2; | ||
| 39 | |||
| 40 | typedef simd_float2x3 matrix_float2x3; | ||
| 41 | typedef simd_float3x3 matrix_float3x3; | ||
| 42 | typedef simd_float4x3 matrix_float4x3; | ||
| 43 | |||
| 44 | typedef simd_float2x4 matrix_float2x4; | ||
| 45 | typedef simd_float3x4 matrix_float3x4; | ||
| 46 | typedef simd_float4x4 matrix_float4x4; | ||
| 47 | |||
| 48 | typedef simd_double2x2 matrix_double2x2; | ||
| 49 | typedef simd_double3x2 matrix_double3x2; | ||
| 50 | typedef simd_double4x2 matrix_double4x2; | ||
| 51 | |||
| 52 | typedef simd_double2x3 matrix_double2x3; | ||
| 53 | typedef simd_double3x3 matrix_double3x3; | ||
| 54 | typedef simd_double4x3 matrix_double4x3; | ||
| 55 | |||
| 56 | typedef simd_double2x4 matrix_double2x4; | ||
| 57 | typedef simd_double3x4 matrix_double3x4; | ||
| 58 | typedef simd_double4x4 matrix_double4x4; | ||
| 59 | |||
| 60 | #ifdef __cplusplus | ||
| 61 | #if defined SIMD_MATRIX_HEADER | ||
| 62 | static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q); | ||
| 63 | static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q); | ||
| 64 | static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q); | ||
| 65 | static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q); | ||
| 66 | #endif | ||
| 67 | |||
| 68 | namespace simd { | ||
| 69 | |||
| 70 | struct float2x2 : ::simd_float2x2 { | ||
| 71 | float2x2() { columns[0] = 0; columns[1] = 0; } | ||
| 72 | #if __has_feature(cxx_delegating_constructors) | ||
| 73 | float2x2(float diagonal) : float2x2((float2)diagonal) { } | ||
| 74 | #endif | ||
| 75 | float2x2(float2 v) { columns[0] = (float2){v.x,0}; columns[1] = (float2){0,v.y}; } | ||
| 76 | float2x2(float2 c0, float2 c1) { columns[0] = c0; columns[1] = c1; } | ||
| 77 | float2x2(::simd_float2x2 m) : ::simd_float2x2(m) { } | ||
| 78 | }; | ||
| 79 | |||
| 80 | struct float3x2 : ::simd_float3x2 { | ||
| 81 | float3x2() { columns[0] = 0; columns[1] = 0; columns[2] = 0; } | ||
| 82 | #if __has_feature(cxx_delegating_constructors) | ||
| 83 | float3x2(float diagonal) : float3x2((float2)diagonal) { } | ||
| 84 | #endif | ||
| 85 | float3x2(float2 v) { columns[0] = (float2){v.x,0}; columns[1] = (float2){0,v.y}; columns[2] = 0; } | ||
| 86 | float3x2(float2 c0, float2 c1, float2 c2) { columns[0] = c0; columns[1] = c1; columns[2] = c2; } | ||
| 87 | float3x2(::simd_float3x2 m) : ::simd_float3x2(m) { } | ||
| 88 | }; | ||
| 89 | |||
| 90 | struct float4x2 : ::simd_float4x2 { | ||
| 91 | float4x2() { columns[0] = 0; columns[1] = 0; columns[2] = 0; columns[3] = 0; } | ||
| 92 | #if __has_feature(cxx_delegating_constructors) | ||
| 93 | float4x2(float diagonal) : float4x2((float2)diagonal) { } | ||
| 94 | #endif | ||
| 95 | float4x2(float2 v) { columns[0] = (float2){v.x,0}; columns[1] = (float2){0,v.y}; columns[2] = 0; columns[3] = 0; } | ||
| 96 | float4x2(float2 c0, float2 c1, float2 c2, float2 c3) { columns[0] = c0; columns[1] = c1; columns[2] = c2; columns[3] = c3; } | ||
| 97 | float4x2(::simd_float4x2 m) : ::simd_float4x2(m) { } | ||
| 98 | }; | ||
| 99 | |||
| 100 | struct float2x3 : ::simd_float2x3 { | ||
| 101 | float2x3() { columns[0] = 0; columns[1] = 0; } | ||
| 102 | #if __has_feature(cxx_delegating_constructors) | ||
| 103 | float2x3(float diagonal) : float2x3((float2)diagonal) { } | ||
| 104 | #endif | ||
| 105 | float2x3(float2 v) { columns[0] = (float3){v.x,0,0}; columns[1] = (float3){0,v.y,0}; } | ||
| 106 | float2x3(float3 c0, float3 c1) { columns[0] = c0; columns[1] = c1; } | ||
| 107 | float2x3(::simd_float2x3 m) : ::simd_float2x3(m) { } | ||
| 108 | }; | ||
| 109 | |||
| 110 | struct float3x3 : ::simd_float3x3 { | ||
| 111 | float3x3() { columns[0] = 0; columns[1] = 0; columns[2] = 0; } | ||
| 112 | #if __has_feature(cxx_delegating_constructors) | ||
| 113 | float3x3(float diagonal) : float3x3((float3)diagonal) { } | ||
| 114 | #endif | ||
| 115 | float3x3(float3 v) { columns[0] = (float3){v.x,0,0}; columns[1] = (float3){0,v.y,0}; columns[2] = (float3){0,0,v.z}; } | ||
| 116 | float3x3(float3 c0, float3 c1, float3 c2) { columns[0] = c0; columns[1] = c1; columns[2] = c2; } | ||
| 117 | float3x3(::simd_float3x3 m) : ::simd_float3x3(m) { } | ||
| 118 | #if defined SIMD_MATRIX_HEADER | ||
| 119 | float3x3(::simd_quatf q) : ::simd_float3x3(::simd_matrix3x3(q)) { } | ||
| 120 | #endif | ||
| 121 | }; | ||
| 122 | |||
| 123 | struct float4x3 : ::simd_float4x3 { | ||
| 124 | float4x3() { columns[0] = 0; columns[1] = 0; columns[2] = 0; columns[3] = 0; } | ||
| 125 | #if __has_feature(cxx_delegating_constructors) | ||
| 126 | float4x3(float diagonal) : float4x3((float3)diagonal) { } | ||
| 127 | #endif | ||
| 128 | float4x3(float3 v) { columns[0] = (float3){v.x,0,0}; columns[1] = (float3){0,v.y,0}; columns[2] = (float3){0,0,v.z}; columns[3] = 0; } | ||
| 129 | float4x3(float3 c0, float3 c1, float3 c2, float3 c3) { columns[0] = c0; columns[1] = c1; columns[2] = c2; columns[3] = c3; } | ||
| 130 | float4x3(::simd_float4x3 m) : ::simd_float4x3(m) { } | ||
| 131 | }; | ||
| 132 | |||
| 133 | struct float2x4 : ::simd_float2x4 { | ||
| 134 | float2x4() { columns[0] = 0; columns[1] = 0; } | ||
| 135 | #if __has_feature(cxx_delegating_constructors) | ||
| 136 | float2x4(float diagonal) : float2x4((float2)diagonal) { } | ||
| 137 | #endif | ||
| 138 | float2x4(float2 v) { columns[0] = (float4){v.x,0,0,0}; columns[1] = (float4){0,v.y,0,0}; } | ||
| 139 | float2x4(float4 c0, float4 c1) { columns[0] = c0; columns[1] = c1; } | ||
| 140 | float2x4(::simd_float2x4 m) : ::simd_float2x4(m) { } | ||
| 141 | }; | ||
| 142 | |||
| 143 | struct float3x4 : ::simd_float3x4 { | ||
| 144 | float3x4() { columns[0] = 0; columns[1] = 0; columns[2] = 0; } | ||
| 145 | #if __has_feature(cxx_delegating_constructors) | ||
| 146 | float3x4(float diagonal) : float3x4((float3)diagonal) { } | ||
| 147 | #endif | ||
| 148 | float3x4(float3 v) { columns[0] = (float4){v.x,0,0,0}; columns[1] = (float4){0,v.y,0,0}; columns[2] = (float4){0,0,v.z,0}; } | ||
| 149 | float3x4(float4 c0, float4 c1, float4 c2) { columns[0] = c0; columns[1] = c1; columns[2] = c2; } | ||
| 150 | float3x4(::simd_float3x4 m) : ::simd_float3x4(m) { } | ||
| 151 | }; | ||
| 152 | |||
| 153 | struct float4x4 : ::simd_float4x4 { | ||
| 154 | float4x4() { columns[0] = 0; columns[1] = 0; columns[2] = 0; columns[3] = 0; } | ||
| 155 | #if __has_feature(cxx_delegating_constructors) | ||
| 156 | float4x4(float diagonal) : float4x4((float4)diagonal) { } | ||
| 157 | #endif | ||
| 158 | float4x4(float4 v) { columns[0] = (float4){v.x,0,0,0}; columns[1] = (float4){0,v.y,0,0}; columns[2] = (float4){0,0,v.z,0}; columns[3] = (float4){0,0,0,v.w}; } | ||
| 159 | float4x4(float4 c0, float4 c1, float4 c2, float4 c3) { columns[0] = c0; columns[1] = c1; columns[2] = c2; columns[3] = c3; } | ||
| 160 | float4x4(::simd_float4x4 m) : ::simd_float4x4(m) { } | ||
| 161 | #if defined SIMD_MATRIX_HEADER | ||
| 162 | float4x4(::simd_quatf q) : ::simd_float4x4(::simd_matrix4x4(q)) { } | ||
| 163 | #endif | ||
| 164 | }; | ||
| 165 | |||
| 166 | struct double2x2 : ::simd_double2x2 { | ||
| 167 | double2x2() { columns[0] = 0; columns[1] = 0; } | ||
| 168 | #if __has_feature(cxx_delegating_constructors) | ||
| 169 | double2x2(double diagonal) : double2x2((double2)diagonal) { } | ||
| 170 | #endif | ||
| 171 | double2x2(double2 v) { columns[0] = (double2){v.x,0}; columns[1] = (double2){0,v.y}; } | ||
| 172 | double2x2(double2 c0, double2 c1) { columns[0] = c0; columns[1] = c1; } | ||
| 173 | double2x2(::simd_double2x2 m) : ::simd_double2x2(m) { } | ||
| 174 | }; | ||
| 175 | |||
| 176 | struct double3x2 : ::simd_double3x2 { | ||
| 177 | double3x2() { columns[0] = 0; columns[1] = 0; columns[2] = 0; } | ||
| 178 | #if __has_feature(cxx_delegating_constructors) | ||
| 179 | double3x2(double diagonal) : double3x2((double2)diagonal) { } | ||
| 180 | #endif | ||
| 181 | double3x2(double2 v) { columns[0] = (double2){v.x,0}; columns[1] = (double2){0,v.y}; columns[2] = 0; } | ||
| 182 | double3x2(double2 c0, double2 c1, double2 c2) { columns[0] = c0; columns[1] = c1; columns[2] = c2; } | ||
| 183 | double3x2(::simd_double3x2 m) : ::simd_double3x2(m) { } | ||
| 184 | }; | ||
| 185 | |||
| 186 | struct double4x2 : ::simd_double4x2 { | ||
| 187 | double4x2() { columns[0] = 0; columns[1] = 0; columns[2] = 0; columns[3] = 0; } | ||
| 188 | #if __has_feature(cxx_delegating_constructors) | ||
| 189 | double4x2(double diagonal) : double4x2((double2)diagonal) { } | ||
| 190 | #endif | ||
| 191 | double4x2(double2 v) { columns[0] = (double2){v.x,0}; columns[1] = (double2){0,v.y}; columns[2] = 0; columns[3] = 0; } | ||
| 192 | double4x2(double2 c0, double2 c1, double2 c2, double2 c3) { columns[0] = c0; columns[1] = c1; columns[2] = c2; columns[3] = c3; } | ||
| 193 | double4x2(::simd_double4x2 m) : ::simd_double4x2(m) { } | ||
| 194 | }; | ||
| 195 | |||
| 196 | struct double2x3 : ::simd_double2x3 { | ||
| 197 | double2x3() { columns[0] = 0; columns[1] = 0; } | ||
| 198 | #if __has_feature(cxx_delegating_constructors) | ||
| 199 | double2x3(double diagonal) : double2x3((double2)diagonal) { } | ||
| 200 | #endif | ||
| 201 | double2x3(double2 v) { columns[0] = (double3){v.x,0,0}; columns[1] = (double3){0,v.y,0}; } | ||
| 202 | double2x3(double3 c0, double3 c1) { columns[0] = c0; columns[1] = c1; } | ||
| 203 | double2x3(::simd_double2x3 m) : ::simd_double2x3(m) { } | ||
| 204 | }; | ||
| 205 | |||
| 206 | struct double3x3 : ::simd_double3x3 { | ||
| 207 | double3x3() { columns[0] = 0; columns[1] = 0; columns[2] = 0; } | ||
| 208 | #if __has_feature(cxx_delegating_constructors) | ||
| 209 | double3x3(double diagonal) : double3x3((double3)diagonal) { } | ||
| 210 | #endif | ||
| 211 | double3x3(double3 v) { columns[0] = (double3){v.x,0,0}; columns[1] = (double3){0,v.y,0}; columns[2] = (double3){0,0,v.z}; } | ||
| 212 | double3x3(double3 c0, double3 c1, double3 c2) { columns[0] = c0; columns[1] = c1; columns[2] = c2; } | ||
| 213 | double3x3(::simd_double3x3 m) : ::simd_double3x3(m) { } | ||
| 214 | #if defined SIMD_MATRIX_HEADER | ||
| 215 | double3x3(::simd_quatd q) : ::simd_double3x3(::simd_matrix3x3(q)) { } | ||
| 216 | #endif | ||
| 217 | }; | ||
| 218 | |||
| 219 | struct double4x3 : ::simd_double4x3 { | ||
| 220 | double4x3() { columns[0] = 0; columns[1] = 0; columns[2] = 0; columns[3] = 0; } | ||
| 221 | #if __has_feature(cxx_delegating_constructors) | ||
| 222 | double4x3(double diagonal) : double4x3((double3)diagonal) { } | ||
| 223 | #endif | ||
| 224 | double4x3(double3 v) { columns[0] = (double3){v.x,0,0}; columns[1] = (double3){0,v.y,0}; columns[2] = (double3){0,0,v.z}; columns[3] = 0; } | ||
| 225 | double4x3(double3 c0, double3 c1, double3 c2, double3 c3) { columns[0] = c0; columns[1] = c1; columns[2] = c2; columns[3] = c3; } | ||
| 226 | double4x3(::simd_double4x3 m) : ::simd_double4x3(m) { } | ||
| 227 | }; | ||
| 228 | |||
| 229 | struct double2x4 : ::simd_double2x4 { | ||
| 230 | double2x4() { columns[0] = 0; columns[1] = 0; } | ||
| 231 | #if __has_feature(cxx_delegating_constructors) | ||
| 232 | double2x4(double diagonal) : double2x4((double2)diagonal) { } | ||
| 233 | #endif | ||
| 234 | double2x4(double2 v) { columns[0] = (double4){v.x,0,0,0}; columns[1] = (double4){0,v.y,0,0}; } | ||
| 235 | double2x4(double4 c0, double4 c1) { columns[0] = c0; columns[1] = c1; } | ||
| 236 | double2x4(::simd_double2x4 m) : ::simd_double2x4(m) { } | ||
| 237 | }; | ||
| 238 | |||
| 239 | struct double3x4 : ::simd_double3x4 { | ||
| 240 | double3x4() { columns[0] = 0; columns[1] = 0; columns[2] = 0; } | ||
| 241 | #if __has_feature(cxx_delegating_constructors) | ||
| 242 | double3x4(double diagonal) : double3x4((double3)diagonal) { } | ||
| 243 | #endif | ||
| 244 | double3x4(double3 v) { columns[0] = (double4){v.x,0,0,0}; columns[1] = (double4){0,v.y,0,0}; columns[2] = (double4){0,0,v.z,0}; } | ||
| 245 | double3x4(double4 c0, double4 c1, double4 c2) { columns[0] = c0; columns[1] = c1; columns[2] = c2; } | ||
| 246 | double3x4(::simd_double3x4 m) : ::simd_double3x4(m) { } | ||
| 247 | }; | ||
| 248 | |||
| 249 | struct double4x4 : ::simd_double4x4 { | ||
| 250 | double4x4() { columns[0] = 0; columns[1] = 0; columns[2] = 0; columns[3] = 0; } | ||
| 251 | #if __has_feature(cxx_delegating_constructors) | ||
| 252 | double4x4(double diagonal) : double4x4((double4)diagonal) { } | ||
| 253 | #endif | ||
| 254 | double4x4(double4 v) { columns[0] = (double4){v.x,0,0,0}; columns[1] = (double4){0,v.y,0,0}; columns[2] = (double4){0,0,v.z,0}; columns[3] = (double4){0,0,0,v.w}; } | ||
| 255 | double4x4(double4 c0, double4 c1, double4 c2, double4 c3) { columns[0] = c0; columns[1] = c1; columns[2] = c2; columns[3] = c3; } | ||
| 256 | double4x4(::simd_double4x4 m) : ::simd_double4x4(m) { } | ||
| 257 | #if defined SIMD_MATRIX_HEADER | ||
| 258 | double4x4(::simd_quatd q) : ::simd_double4x4(::simd_matrix4x4(q)) { } | ||
| 259 | #endif | ||
| 260 | }; | ||
| 261 | } | ||
| 262 | #endif /* __cplusplus */ | ||
| 263 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 264 | #endif /* SIMD_MATRIX_TYPES_HEADER */ | ||
lib/libc/include/x86_64-macos-gnu/simd/packed.h created+1031| ... | @@ -0,0 +1,1031 @@ | ||
| 1 | /*! @header | ||
| 2 | * This header defines fixed size vector types with relaxed alignment. For | ||
| 3 | * each vector type defined by <simd/vector_types.h> that is not a 1- or 3- | ||
| 4 | * element vector, there is a corresponding type defined by this header that | ||
| 5 | * requires only the alignment matching that of the underlying scalar type. | ||
| 6 | * | ||
| 7 | * These types should be used to access buffers that may not be sufficiently | ||
| 8 | * aligned to allow them to be accessed using the "normal" simd vector types. | ||
| 9 | * As an example of this usage, suppose that you want to load a vector of | ||
| 10 | * four floats from an array of floats. The type simd_float4 has sixteen byte | ||
| 11 | * alignment, whereas an array of floats has only four byte alignment. | ||
| 12 | * Thus, naively casting a pointer into the array to (simd_float4 *) would | ||
| 13 | * invoke undefined behavior, and likely produce an alignment fault at | ||
| 14 | * runtime. Instead, use the corresponding packed type to load from the array: | ||
| 15 | * | ||
| 16 | * <pre> | ||
| 17 | * @textblock | ||
| 18 | * simd_float4 vector = *(packed_simd_float4 *)&array[i]; | ||
| 19 | * // do something with vector ... | ||
| 20 | * @/textblock | ||
| 21 | * </pre> | ||
| 22 | * | ||
| 23 | * It's important to note that the packed_ types are only needed to work with | ||
| 24 | * memory; once the data is loaded, we simply operate on it as usual using | ||
| 25 | * the simd_float4 type, as illustrated above. | ||
| 26 | * | ||
| 27 | * @copyright 2014-2017 Apple, Inc. All rights reserved. | ||
| 28 | * @unsorted */ | ||
| 29 | |||
| 30 | #ifndef SIMD_PACKED_TYPES | ||
| 31 | #define SIMD_PACKED_TYPES | ||
| 32 | |||
| 33 | # include <simd/vector_types.h> | ||
| 34 | # if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 35 | /*! @abstract A vector of two 8-bit signed (twos-complement) integers with | ||
| 36 | * relaxed alignment. | ||
| 37 | * @description In C++ and Metal, this type is also available as | ||
| 38 | * simd::packed::char2. The alignment of this type is that of the | ||
| 39 | * underlying scalar element type, so you can use it to load or store from | ||
| 40 | * an array of that type. */ | ||
| 41 | typedef __attribute__((__ext_vector_type__(2),__aligned__(1))) char simd_packed_char2; | ||
| 42 | |||
| 43 | /*! @abstract A vector of four 8-bit signed (twos-complement) integers with | ||
| 44 | * relaxed alignment. | ||
| 45 | * @description In C++ and Metal, this type is also available as | ||
| 46 | * simd::packed::char4. The alignment of this type is that of the | ||
| 47 | * underlying scalar element type, so you can use it to load or store from | ||
| 48 | * an array of that type. */ | ||
| 49 | typedef __attribute__((__ext_vector_type__(4),__aligned__(1))) char simd_packed_char4; | ||
| 50 | |||
| 51 | /*! @abstract A vector of eight 8-bit signed (twos-complement) integers with | ||
| 52 | * relaxed alignment. | ||
| 53 | * @description In C++ this type is also available as simd::packed::char8. | ||
| 54 | * This type is not available in Metal. The alignment of this type is only | ||
| 55 | * that of the underlying scalar element type, so you can use it to load or | ||
| 56 | * store from an array of that type. */ | ||
| 57 | typedef __attribute__((__ext_vector_type__(8),__aligned__(1))) char simd_packed_char8; | ||
| 58 | |||
| 59 | /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers | ||
| 60 | * with relaxed alignment. | ||
| 61 | * @description In C++ this type is also available as simd::packed::char16. | ||
| 62 | * This type is not available in Metal. The alignment of this type is only | ||
| 63 | * that of the underlying scalar element type, so you can use it to load or | ||
| 64 | * store from an array of that type. */ | ||
| 65 | typedef __attribute__((__ext_vector_type__(16),__aligned__(1))) char simd_packed_char16; | ||
| 66 | |||
| 67 | /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) integers | ||
| 68 | * with relaxed alignment. | ||
| 69 | * @description In C++ this type is also available as simd::packed::char32. | ||
| 70 | * This type is not available in Metal. The alignment of this type is only | ||
| 71 | * that of the underlying scalar element type, so you can use it to load or | ||
| 72 | * store from an array of that type. */ | ||
| 73 | typedef __attribute__((__ext_vector_type__(32),__aligned__(1))) char simd_packed_char32; | ||
| 74 | |||
| 75 | /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) integers | ||
| 76 | * with relaxed alignment. | ||
| 77 | * @description In C++ this type is also available as simd::packed::char64. | ||
| 78 | * This type is not available in Metal. The alignment of this type is only | ||
| 79 | * that of the underlying scalar element type, so you can use it to load or | ||
| 80 | * store from an array of that type. */ | ||
| 81 | typedef __attribute__((__ext_vector_type__(64),__aligned__(1))) char simd_packed_char64; | ||
| 82 | |||
| 83 | /*! @abstract A vector of two 8-bit unsigned integers with relaxed | ||
| 84 | * alignment. | ||
| 85 | * @description In C++ and Metal, this type is also available as | ||
| 86 | * simd::packed::uchar2. The alignment of this type is that of the | ||
| 87 | * underlying scalar element type, so you can use it to load or store from | ||
| 88 | * an array of that type. */ | ||
| 89 | typedef __attribute__((__ext_vector_type__(2),__aligned__(1))) unsigned char simd_packed_uchar2; | ||
| 90 | |||
| 91 | /*! @abstract A vector of four 8-bit unsigned integers with relaxed | ||
| 92 | * alignment. | ||
| 93 | * @description In C++ and Metal, this type is also available as | ||
| 94 | * simd::packed::uchar4. The alignment of this type is that of the | ||
| 95 | * underlying scalar element type, so you can use it to load or store from | ||
| 96 | * an array of that type. */ | ||
| 97 | typedef __attribute__((__ext_vector_type__(4),__aligned__(1))) unsigned char simd_packed_uchar4; | ||
| 98 | |||
| 99 | /*! @abstract A vector of eight 8-bit unsigned integers with relaxed | ||
| 100 | * alignment. | ||
| 101 | * @description In C++ this type is also available as simd::packed::uchar8. | ||
| 102 | * This type is not available in Metal. The alignment of this type is only | ||
| 103 | * that of the underlying scalar element type, so you can use it to load or | ||
| 104 | * store from an array of that type. */ | ||
| 105 | typedef __attribute__((__ext_vector_type__(8),__aligned__(1))) unsigned char simd_packed_uchar8; | ||
| 106 | |||
| 107 | /*! @abstract A vector of sixteen 8-bit unsigned integers with relaxed | ||
| 108 | * alignment. | ||
| 109 | * @description In C++ this type is also available as | ||
| 110 | * simd::packed::uchar16. This type is not available in Metal. The | ||
| 111 | * alignment of this type is only that of the underlying scalar element | ||
| 112 | * type, so you can use it to load or store from an array of that type. */ | ||
| 113 | typedef __attribute__((__ext_vector_type__(16),__aligned__(1))) unsigned char simd_packed_uchar16; | ||
| 114 | |||
| 115 | /*! @abstract A vector of thirty-two 8-bit unsigned integers with relaxed | ||
| 116 | * alignment. | ||
| 117 | * @description In C++ this type is also available as | ||
| 118 | * simd::packed::uchar32. This type is not available in Metal. The | ||
| 119 | * alignment of this type is only that of the underlying scalar element | ||
| 120 | * type, so you can use it to load or store from an array of that type. */ | ||
| 121 | typedef __attribute__((__ext_vector_type__(32),__aligned__(1))) unsigned char simd_packed_uchar32; | ||
| 122 | |||
| 123 | /*! @abstract A vector of sixty-four 8-bit unsigned integers with relaxed | ||
| 124 | * alignment. | ||
| 125 | * @description In C++ this type is also available as | ||
| 126 | * simd::packed::uchar64. This type is not available in Metal. The | ||
| 127 | * alignment of this type is only that of the underlying scalar element | ||
| 128 | * type, so you can use it to load or store from an array of that type. */ | ||
| 129 | typedef __attribute__((__ext_vector_type__(64),__aligned__(1))) unsigned char simd_packed_uchar64; | ||
| 130 | |||
| 131 | /*! @abstract A vector of two 16-bit signed (twos-complement) integers with | ||
| 132 | * relaxed alignment. | ||
| 133 | * @description In C++ and Metal, this type is also available as | ||
| 134 | * simd::packed::short2. The alignment of this type is that of the | ||
| 135 | * underlying scalar element type, so you can use it to load or store from | ||
| 136 | * an array of that type. */ | ||
| 137 | typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) short simd_packed_short2; | ||
| 138 | |||
| 139 | /*! @abstract A vector of four 16-bit signed (twos-complement) integers with | ||
| 140 | * relaxed alignment. | ||
| 141 | * @description In C++ and Metal, this type is also available as | ||
| 142 | * simd::packed::short4. The alignment of this type is that of the | ||
| 143 | * underlying scalar element type, so you can use it to load or store from | ||
| 144 | * an array of that type. */ | ||
| 145 | typedef __attribute__((__ext_vector_type__(4),__aligned__(2))) short simd_packed_short4; | ||
| 146 | |||
| 147 | /*! @abstract A vector of eight 16-bit signed (twos-complement) integers | ||
| 148 | * with relaxed alignment. | ||
| 149 | * @description In C++ this type is also available as simd::packed::short8. | ||
| 150 | * This type is not available in Metal. The alignment of this type is only | ||
| 151 | * that of the underlying scalar element type, so you can use it to load or | ||
| 152 | * store from an array of that type. */ | ||
| 153 | typedef __attribute__((__ext_vector_type__(8),__aligned__(2))) short simd_packed_short8; | ||
| 154 | |||
| 155 | /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers | ||
| 156 | * with relaxed alignment. | ||
| 157 | * @description In C++ this type is also available as | ||
| 158 | * simd::packed::short16. This type is not available in Metal. The | ||
| 159 | * alignment of this type is only that of the underlying scalar element | ||
| 160 | * type, so you can use it to load or store from an array of that type. */ | ||
| 161 | typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) short simd_packed_short16; | ||
| 162 | |||
| 163 | /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) | ||
| 164 | * integers with relaxed alignment. | ||
| 165 | * @description In C++ this type is also available as | ||
| 166 | * simd::packed::short32. This type is not available in Metal. The | ||
| 167 | * alignment of this type is only that of the underlying scalar element | ||
| 168 | * type, so you can use it to load or store from an array of that type. */ | ||
| 169 | typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) short simd_packed_short32; | ||
| 170 | |||
| 171 | /*! @abstract A vector of two 16-bit unsigned integers with relaxed | ||
| 172 | * alignment. | ||
| 173 | * @description In C++ and Metal, this type is also available as | ||
| 174 | * simd::packed::ushort2. The alignment of this type is that of the | ||
| 175 | * underlying scalar element type, so you can use it to load or store from | ||
| 176 | * an array of that type. */ | ||
| 177 | typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) unsigned short simd_packed_ushort2; | ||
| 178 | |||
| 179 | /*! @abstract A vector of four 16-bit unsigned integers with relaxed | ||
| 180 | * alignment. | ||
| 181 | * @description In C++ and Metal, this type is also available as | ||
| 182 | * simd::packed::ushort4. The alignment of this type is that of the | ||
| 183 | * underlying scalar element type, so you can use it to load or store from | ||
| 184 | * an array of that type. */ | ||
| 185 | typedef __attribute__((__ext_vector_type__(4),__aligned__(2))) unsigned short simd_packed_ushort4; | ||
| 186 | |||
| 187 | /*! @abstract A vector of eight 16-bit unsigned integers with relaxed | ||
| 188 | * alignment. | ||
| 189 | * @description In C++ this type is also available as | ||
| 190 | * simd::packed::ushort8. This type is not available in Metal. The | ||
| 191 | * alignment of this type is only that of the underlying scalar element | ||
| 192 | * type, so you can use it to load or store from an array of that type. */ | ||
| 193 | typedef __attribute__((__ext_vector_type__(8),__aligned__(2))) unsigned short simd_packed_ushort8; | ||
| 194 | |||
| 195 | /*! @abstract A vector of sixteen 16-bit unsigned integers with relaxed | ||
| 196 | * alignment. | ||
| 197 | * @description In C++ this type is also available as | ||
| 198 | * simd::packed::ushort16. This type is not available in Metal. The | ||
| 199 | * alignment of this type is only that of the underlying scalar element | ||
| 200 | * type, so you can use it to load or store from an array of that type. */ | ||
| 201 | typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) unsigned short simd_packed_ushort16; | ||
| 202 | |||
| 203 | /*! @abstract A vector of thirty-two 16-bit unsigned integers with relaxed | ||
| 204 | * alignment. | ||
| 205 | * @description In C++ this type is also available as | ||
| 206 | * simd::packed::ushort32. This type is not available in Metal. The | ||
| 207 | * alignment of this type is only that of the underlying scalar element | ||
| 208 | * type, so you can use it to load or store from an array of that type. */ | ||
| 209 | typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) unsigned short simd_packed_ushort32; | ||
| 210 | |||
| 211 | /*! @abstract A vector of two 32-bit signed (twos-complement) integers with | ||
| 212 | * relaxed alignment. | ||
| 213 | * @description In C++ and Metal, this type is also available as | ||
| 214 | * simd::packed::int2. The alignment of this type is that of the underlying | ||
| 215 | * scalar element type, so you can use it to load or store from an array of | ||
| 216 | * that type. */ | ||
| 217 | typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) int simd_packed_int2; | ||
| 218 | |||
| 219 | /*! @abstract A vector of four 32-bit signed (twos-complement) integers with | ||
| 220 | * relaxed alignment. | ||
| 221 | * @description In C++ and Metal, this type is also available as | ||
| 222 | * simd::packed::int4. The alignment of this type is that of the underlying | ||
| 223 | * scalar element type, so you can use it to load or store from an array of | ||
| 224 | * that type. */ | ||
| 225 | typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) int simd_packed_int4; | ||
| 226 | |||
| 227 | /*! @abstract A vector of eight 32-bit signed (twos-complement) integers | ||
| 228 | * with relaxed alignment. | ||
| 229 | * @description In C++ this type is also available as simd::packed::int8. | ||
| 230 | * This type is not available in Metal. The alignment of this type is only | ||
| 231 | * that of the underlying scalar element type, so you can use it to load or | ||
| 232 | * store from an array of that type. */ | ||
| 233 | typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) int simd_packed_int8; | ||
| 234 | |||
| 235 | /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers | ||
| 236 | * with relaxed alignment. | ||
| 237 | * @description In C++ this type is also available as simd::packed::int16. | ||
| 238 | * This type is not available in Metal. The alignment of this type is only | ||
| 239 | * that of the underlying scalar element type, so you can use it to load or | ||
| 240 | * store from an array of that type. */ | ||
| 241 | typedef __attribute__((__ext_vector_type__(16),__aligned__(4))) int simd_packed_int16; | ||
| 242 | |||
| 243 | /*! @abstract A vector of two 32-bit unsigned integers with relaxed | ||
| 244 | * alignment. | ||
| 245 | * @description In C++ and Metal, this type is also available as | ||
| 246 | * simd::packed::uint2. The alignment of this type is that of the | ||
| 247 | * underlying scalar element type, so you can use it to load or store from | ||
| 248 | * an array of that type. */ | ||
| 249 | typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) unsigned int simd_packed_uint2; | ||
| 250 | |||
| 251 | /*! @abstract A vector of four 32-bit unsigned integers with relaxed | ||
| 252 | * alignment. | ||
| 253 | * @description In C++ and Metal, this type is also available as | ||
| 254 | * simd::packed::uint4. The alignment of this type is that of the | ||
| 255 | * underlying scalar element type, so you can use it to load or store from | ||
| 256 | * an array of that type. */ | ||
| 257 | typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) unsigned int simd_packed_uint4; | ||
| 258 | |||
| 259 | /*! @abstract A vector of eight 32-bit unsigned integers with relaxed | ||
| 260 | * alignment. | ||
| 261 | * @description In C++ this type is also available as simd::packed::uint8. | ||
| 262 | * This type is not available in Metal. The alignment of this type is only | ||
| 263 | * that of the underlying scalar element type, so you can use it to load or | ||
| 264 | * store from an array of that type. */ | ||
| 265 | typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) unsigned int simd_packed_uint8; | ||
| 266 | |||
| 267 | /*! @abstract A vector of sixteen 32-bit unsigned integers with relaxed | ||
| 268 | * alignment. | ||
| 269 | * @description In C++ this type is also available as simd::packed::uint16. | ||
| 270 | * This type is not available in Metal. The alignment of this type is only | ||
| 271 | * that of the underlying scalar element type, so you can use it to load or | ||
| 272 | * store from an array of that type. */ | ||
| 273 | typedef __attribute__((__ext_vector_type__(16),__aligned__(4))) unsigned int simd_packed_uint16; | ||
| 274 | |||
| 275 | /*! @abstract A vector of two 32-bit floating-point numbers with relaxed | ||
| 276 | * alignment. | ||
| 277 | * @description In C++ and Metal, this type is also available as | ||
| 278 | * simd::packed::float2. The alignment of this type is that of the | ||
| 279 | * underlying scalar element type, so you can use it to load or store from | ||
| 280 | * an array of that type. */ | ||
| 281 | typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) float simd_packed_float2; | ||
| 282 | |||
| 283 | /*! @abstract A vector of four 32-bit floating-point numbers with relaxed | ||
| 284 | * alignment. | ||
| 285 | * @description In C++ and Metal, this type is also available as | ||
| 286 | * simd::packed::float4. The alignment of this type is that of the | ||
| 287 | * underlying scalar element type, so you can use it to load or store from | ||
| 288 | * an array of that type. */ | ||
| 289 | typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) float simd_packed_float4; | ||
| 290 | |||
| 291 | /*! @abstract A vector of eight 32-bit floating-point numbers with relaxed | ||
| 292 | * alignment. | ||
| 293 | * @description In C++ this type is also available as simd::packed::float8. | ||
| 294 | * This type is not available in Metal. The alignment of this type is only | ||
| 295 | * that of the underlying scalar element type, so you can use it to load or | ||
| 296 | * store from an array of that type. */ | ||
| 297 | typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) float simd_packed_float8; | ||
| 298 | |||
| 299 | /*! @abstract A vector of sixteen 32-bit floating-point numbers with relaxed | ||
| 300 | * alignment. | ||
| 301 | * @description In C++ this type is also available as | ||
| 302 | * simd::packed::float16. This type is not available in Metal. The | ||
| 303 | * alignment of this type is only that of the underlying scalar element | ||
| 304 | * type, so you can use it to load or store from an array of that type. */ | ||
| 305 | typedef __attribute__((__ext_vector_type__(16),__aligned__(4))) float simd_packed_float16; | ||
| 306 | |||
| 307 | /*! @abstract A vector of two 64-bit signed (twos-complement) integers with | ||
| 308 | * relaxed alignment. | ||
| 309 | * @description In C++ and Metal, this type is also available as | ||
| 310 | * simd::packed::long2. The alignment of this type is that of the | ||
| 311 | * underlying scalar element type, so you can use it to load or store from | ||
| 312 | * an array of that type. */ | ||
| 313 | #if defined __LP64__ | ||
| 314 | typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) simd_long1 simd_packed_long2; | ||
| 315 | #else | ||
| 316 | typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) simd_long1 simd_packed_long2; | ||
| 317 | #endif | ||
| 318 | |||
| 319 | /*! @abstract A vector of four 64-bit signed (twos-complement) integers with | ||
| 320 | * relaxed alignment. | ||
| 321 | * @description In C++ and Metal, this type is also available as | ||
| 322 | * simd::packed::long4. The alignment of this type is that of the | ||
| 323 | * underlying scalar element type, so you can use it to load or store from | ||
| 324 | * an array of that type. */ | ||
| 325 | #if defined __LP64__ | ||
| 326 | typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) simd_long1 simd_packed_long4; | ||
| 327 | #else | ||
| 328 | typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) simd_long1 simd_packed_long4; | ||
| 329 | #endif | ||
| 330 | |||
| 331 | /*! @abstract A vector of eight 64-bit signed (twos-complement) integers | ||
| 332 | * with relaxed alignment. | ||
| 333 | * @description In C++ this type is also available as simd::packed::long8. | ||
| 334 | * This type is not available in Metal. The alignment of this type is only | ||
| 335 | * that of the underlying scalar element type, so you can use it to load or | ||
| 336 | * store from an array of that type. */ | ||
| 337 | #if defined __LP64__ | ||
| 338 | typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) simd_long1 simd_packed_long8; | ||
| 339 | #else | ||
| 340 | typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) simd_long1 simd_packed_long8; | ||
| 341 | #endif | ||
| 342 | |||
| 343 | /*! @abstract A vector of two 64-bit unsigned integers with relaxed | ||
| 344 | * alignment. | ||
| 345 | * @description In C++ and Metal, this type is also available as | ||
| 346 | * simd::packed::ulong2. The alignment of this type is that of the | ||
| 347 | * underlying scalar element type, so you can use it to load or store from | ||
| 348 | * an array of that type. */ | ||
| 349 | #if defined __LP64__ | ||
| 350 | typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) simd_ulong1 simd_packed_ulong2; | ||
| 351 | #else | ||
| 352 | typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) simd_ulong1 simd_packed_ulong2; | ||
| 353 | #endif | ||
| 354 | |||
| 355 | /*! @abstract A vector of four 64-bit unsigned integers with relaxed | ||
| 356 | * alignment. | ||
| 357 | * @description In C++ and Metal, this type is also available as | ||
| 358 | * simd::packed::ulong4. The alignment of this type is that of the | ||
| 359 | * underlying scalar element type, so you can use it to load or store from | ||
| 360 | * an array of that type. */ | ||
| 361 | #if defined __LP64__ | ||
| 362 | typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) simd_ulong1 simd_packed_ulong4; | ||
| 363 | #else | ||
| 364 | typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) simd_ulong1 simd_packed_ulong4; | ||
| 365 | #endif | ||
| 366 | |||
| 367 | /*! @abstract A vector of eight 64-bit unsigned integers with relaxed | ||
| 368 | * alignment. | ||
| 369 | * @description In C++ this type is also available as simd::packed::ulong8. | ||
| 370 | * This type is not available in Metal. The alignment of this type is only | ||
| 371 | * that of the underlying scalar element type, so you can use it to load or | ||
| 372 | * store from an array of that type. */ | ||
| 373 | #if defined __LP64__ | ||
| 374 | typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) simd_ulong1 simd_packed_ulong8; | ||
| 375 | #else | ||
| 376 | typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) simd_ulong1 simd_packed_ulong8; | ||
| 377 | #endif | ||
| 378 | |||
| 379 | /*! @abstract A vector of two 64-bit floating-point numbers with relaxed | ||
| 380 | * alignment. | ||
| 381 | * @description In C++ and Metal, this type is also available as | ||
| 382 | * simd::packed::double2. The alignment of this type is that of the | ||
| 383 | * underlying scalar element type, so you can use it to load or store from | ||
| 384 | * an array of that type. */ | ||
| 385 | #if defined __LP64__ | ||
| 386 | typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) double simd_packed_double2; | ||
| 387 | #else | ||
| 388 | typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) double simd_packed_double2; | ||
| 389 | #endif | ||
| 390 | |||
| 391 | /*! @abstract A vector of four 64-bit floating-point numbers with relaxed | ||
| 392 | * alignment. | ||
| 393 | * @description In C++ and Metal, this type is also available as | ||
| 394 | * simd::packed::double4. The alignment of this type is that of the | ||
| 395 | * underlying scalar element type, so you can use it to load or store from | ||
| 396 | * an array of that type. */ | ||
| 397 | #if defined __LP64__ | ||
| 398 | typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) double simd_packed_double4; | ||
| 399 | #else | ||
| 400 | typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) double simd_packed_double4; | ||
| 401 | #endif | ||
| 402 | |||
| 403 | /*! @abstract A vector of eight 64-bit floating-point numbers with relaxed | ||
| 404 | * alignment. | ||
| 405 | * @description In C++ this type is also available as | ||
| 406 | * simd::packed::double8. This type is not available in Metal. The | ||
| 407 | * alignment of this type is only that of the underlying scalar element | ||
| 408 | * type, so you can use it to load or store from an array of that type. */ | ||
| 409 | #if defined __LP64__ | ||
| 410 | typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) double simd_packed_double8; | ||
| 411 | #else | ||
| 412 | typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) double simd_packed_double8; | ||
| 413 | #endif | ||
| 414 | |||
| 415 | /* MARK: C++ vector types */ | ||
| 416 | #if defined __cplusplus | ||
| 417 | namespace simd { | ||
| 418 | namespace packed { | ||
| 419 | /*! @abstract A vector of two 8-bit signed (twos-complement) integers | ||
| 420 | * with relaxed alignment. | ||
| 421 | * @description In C or Objective-C, this type is available as | ||
| 422 | * simd_packed_char2. The alignment of this type is only that of the | ||
| 423 | * underlying scalar element type, so you can use it to load or store | ||
| 424 | * from an array of that type. */ | ||
| 425 | typedef ::simd_packed_char2 char2; | ||
| 426 | |||
| 427 | /*! @abstract A vector of four 8-bit signed (twos-complement) integers | ||
| 428 | * with relaxed alignment. | ||
| 429 | * @description In C or Objective-C, this type is available as | ||
| 430 | * simd_packed_char4. The alignment of this type is only that of the | ||
| 431 | * underlying scalar element type, so you can use it to load or store | ||
| 432 | * from an array of that type. */ | ||
| 433 | typedef ::simd_packed_char4 char4; | ||
| 434 | |||
| 435 | /*! @abstract A vector of eight 8-bit signed (twos-complement) integers | ||
| 436 | * with relaxed alignment. | ||
| 437 | * @description This type is not available in Metal. In C or | ||
| 438 | * Objective-C, this type is available as simd_packed_char8. The | ||
| 439 | * alignment of this type is only that of the underlying scalar element | ||
| 440 | * type, so you can use it to load or store from an array of that type. */ | ||
| 441 | typedef ::simd_packed_char8 char8; | ||
| 442 | |||
| 443 | /*! @abstract A vector of sixteen 8-bit signed (twos-complement) | ||
| 444 | * integers with relaxed alignment. | ||
| 445 | * @description This type is not available in Metal. In C or | ||
| 446 | * Objective-C, this type is available as simd_packed_char16. The | ||
| 447 | * alignment of this type is only that of the underlying scalar element | ||
| 448 | * type, so you can use it to load or store from an array of that type. */ | ||
| 449 | typedef ::simd_packed_char16 char16; | ||
| 450 | |||
| 451 | /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) | ||
| 452 | * integers with relaxed alignment. | ||
| 453 | * @description This type is not available in Metal. In C or | ||
| 454 | * Objective-C, this type is available as simd_packed_char32. The | ||
| 455 | * alignment of this type is only that of the underlying scalar element | ||
| 456 | * type, so you can use it to load or store from an array of that type. */ | ||
| 457 | typedef ::simd_packed_char32 char32; | ||
| 458 | |||
| 459 | /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) | ||
| 460 | * integers with relaxed alignment. | ||
| 461 | * @description This type is not available in Metal. In C or | ||
| 462 | * Objective-C, this type is available as simd_packed_char64. The | ||
| 463 | * alignment of this type is only that of the underlying scalar element | ||
| 464 | * type, so you can use it to load or store from an array of that type. */ | ||
| 465 | typedef ::simd_packed_char64 char64; | ||
| 466 | |||
| 467 | /*! @abstract A vector of two 8-bit unsigned integers with relaxed | ||
| 468 | * alignment. | ||
| 469 | * @description In C or Objective-C, this type is available as | ||
| 470 | * simd_packed_uchar2. The alignment of this type is only that of the | ||
| 471 | * underlying scalar element type, so you can use it to load or store | ||
| 472 | * from an array of that type. */ | ||
| 473 | typedef ::simd_packed_uchar2 uchar2; | ||
| 474 | |||
| 475 | /*! @abstract A vector of four 8-bit unsigned integers with relaxed | ||
| 476 | * alignment. | ||
| 477 | * @description In C or Objective-C, this type is available as | ||
| 478 | * simd_packed_uchar4. The alignment of this type is only that of the | ||
| 479 | * underlying scalar element type, so you can use it to load or store | ||
| 480 | * from an array of that type. */ | ||
| 481 | typedef ::simd_packed_uchar4 uchar4; | ||
| 482 | |||
| 483 | /*! @abstract A vector of eight 8-bit unsigned integers with relaxed | ||
| 484 | * alignment. | ||
| 485 | * @description This type is not available in Metal. In C or | ||
| 486 | * Objective-C, this type is available as simd_packed_uchar8. The | ||
| 487 | * alignment of this type is only that of the underlying scalar element | ||
| 488 | * type, so you can use it to load or store from an array of that type. */ | ||
| 489 | typedef ::simd_packed_uchar8 uchar8; | ||
| 490 | |||
| 491 | /*! @abstract A vector of sixteen 8-bit unsigned integers with relaxed | ||
| 492 | * alignment. | ||
| 493 | * @description This type is not available in Metal. In C or | ||
| 494 | * Objective-C, this type is available as simd_packed_uchar16. The | ||
| 495 | * alignment of this type is only that of the underlying scalar element | ||
| 496 | * type, so you can use it to load or store from an array of that type. */ | ||
| 497 | typedef ::simd_packed_uchar16 uchar16; | ||
| 498 | |||
| 499 | /*! @abstract A vector of thirty-two 8-bit unsigned integers with | ||
| 500 | * relaxed alignment. | ||
| 501 | * @description This type is not available in Metal. In C or | ||
| 502 | * Objective-C, this type is available as simd_packed_uchar32. The | ||
| 503 | * alignment of this type is only that of the underlying scalar element | ||
| 504 | * type, so you can use it to load or store from an array of that type. */ | ||
| 505 | typedef ::simd_packed_uchar32 uchar32; | ||
| 506 | |||
| 507 | /*! @abstract A vector of sixty-four 8-bit unsigned integers with | ||
| 508 | * relaxed alignment. | ||
| 509 | * @description This type is not available in Metal. In C or | ||
| 510 | * Objective-C, this type is available as simd_packed_uchar64. The | ||
| 511 | * alignment of this type is only that of the underlying scalar element | ||
| 512 | * type, so you can use it to load or store from an array of that type. */ | ||
| 513 | typedef ::simd_packed_uchar64 uchar64; | ||
| 514 | |||
| 515 | /*! @abstract A vector of two 16-bit signed (twos-complement) integers | ||
| 516 | * with relaxed alignment. | ||
| 517 | * @description In C or Objective-C, this type is available as | ||
| 518 | * simd_packed_short2. The alignment of this type is only that of the | ||
| 519 | * underlying scalar element type, so you can use it to load or store | ||
| 520 | * from an array of that type. */ | ||
| 521 | typedef ::simd_packed_short2 short2; | ||
| 522 | |||
| 523 | /*! @abstract A vector of four 16-bit signed (twos-complement) integers | ||
| 524 | * with relaxed alignment. | ||
| 525 | * @description In C or Objective-C, this type is available as | ||
| 526 | * simd_packed_short4. The alignment of this type is only that of the | ||
| 527 | * underlying scalar element type, so you can use it to load or store | ||
| 528 | * from an array of that type. */ | ||
| 529 | typedef ::simd_packed_short4 short4; | ||
| 530 | |||
| 531 | /*! @abstract A vector of eight 16-bit signed (twos-complement) integers | ||
| 532 | * with relaxed alignment. | ||
| 533 | * @description This type is not available in Metal. In C or | ||
| 534 | * Objective-C, this type is available as simd_packed_short8. The | ||
| 535 | * alignment of this type is only that of the underlying scalar element | ||
| 536 | * type, so you can use it to load or store from an array of that type. */ | ||
| 537 | typedef ::simd_packed_short8 short8; | ||
| 538 | |||
| 539 | /*! @abstract A vector of sixteen 16-bit signed (twos-complement) | ||
| 540 | * integers with relaxed alignment. | ||
| 541 | * @description This type is not available in Metal. In C or | ||
| 542 | * Objective-C, this type is available as simd_packed_short16. The | ||
| 543 | * alignment of this type is only that of the underlying scalar element | ||
| 544 | * type, so you can use it to load or store from an array of that type. */ | ||
| 545 | typedef ::simd_packed_short16 short16; | ||
| 546 | |||
| 547 | /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) | ||
| 548 | * integers with relaxed alignment. | ||
| 549 | * @description This type is not available in Metal. In C or | ||
| 550 | * Objective-C, this type is available as simd_packed_short32. The | ||
| 551 | * alignment of this type is only that of the underlying scalar element | ||
| 552 | * type, so you can use it to load or store from an array of that type. */ | ||
| 553 | typedef ::simd_packed_short32 short32; | ||
| 554 | |||
| 555 | /*! @abstract A vector of two 16-bit unsigned integers with relaxed | ||
| 556 | * alignment. | ||
| 557 | * @description In C or Objective-C, this type is available as | ||
| 558 | * simd_packed_ushort2. The alignment of this type is only that of the | ||
| 559 | * underlying scalar element type, so you can use it to load or store | ||
| 560 | * from an array of that type. */ | ||
| 561 | typedef ::simd_packed_ushort2 ushort2; | ||
| 562 | |||
| 563 | /*! @abstract A vector of four 16-bit unsigned integers with relaxed | ||
| 564 | * alignment. | ||
| 565 | * @description In C or Objective-C, this type is available as | ||
| 566 | * simd_packed_ushort4. The alignment of this type is only that of the | ||
| 567 | * underlying scalar element type, so you can use it to load or store | ||
| 568 | * from an array of that type. */ | ||
| 569 | typedef ::simd_packed_ushort4 ushort4; | ||
| 570 | |||
| 571 | /*! @abstract A vector of eight 16-bit unsigned integers with relaxed | ||
| 572 | * alignment. | ||
| 573 | * @description This type is not available in Metal. In C or | ||
| 574 | * Objective-C, this type is available as simd_packed_ushort8. The | ||
| 575 | * alignment of this type is only that of the underlying scalar element | ||
| 576 | * type, so you can use it to load or store from an array of that type. */ | ||
| 577 | typedef ::simd_packed_ushort8 ushort8; | ||
| 578 | |||
| 579 | /*! @abstract A vector of sixteen 16-bit unsigned integers with relaxed | ||
| 580 | * alignment. | ||
| 581 | * @description This type is not available in Metal. In C or | ||
| 582 | * Objective-C, this type is available as simd_packed_ushort16. The | ||
| 583 | * alignment of this type is only that of the underlying scalar element | ||
| 584 | * type, so you can use it to load or store from an array of that type. */ | ||
| 585 | typedef ::simd_packed_ushort16 ushort16; | ||
| 586 | |||
| 587 | /*! @abstract A vector of thirty-two 16-bit unsigned integers with | ||
| 588 | * relaxed alignment. | ||
| 589 | * @description This type is not available in Metal. In C or | ||
| 590 | * Objective-C, this type is available as simd_packed_ushort32. The | ||
| 591 | * alignment of this type is only that of the underlying scalar element | ||
| 592 | * type, so you can use it to load or store from an array of that type. */ | ||
| 593 | typedef ::simd_packed_ushort32 ushort32; | ||
| 594 | |||
| 595 | /*! @abstract A vector of two 32-bit signed (twos-complement) integers | ||
| 596 | * with relaxed alignment. | ||
| 597 | * @description In C or Objective-C, this type is available as | ||
| 598 | * simd_packed_int2. The alignment of this type is only that of the | ||
| 599 | * underlying scalar element type, so you can use it to load or store | ||
| 600 | * from an array of that type. */ | ||
| 601 | typedef ::simd_packed_int2 int2; | ||
| 602 | |||
| 603 | /*! @abstract A vector of four 32-bit signed (twos-complement) integers | ||
| 604 | * with relaxed alignment. | ||
| 605 | * @description In C or Objective-C, this type is available as | ||
| 606 | * simd_packed_int4. The alignment of this type is only that of the | ||
| 607 | * underlying scalar element type, so you can use it to load or store | ||
| 608 | * from an array of that type. */ | ||
| 609 | typedef ::simd_packed_int4 int4; | ||
| 610 | |||
| 611 | /*! @abstract A vector of eight 32-bit signed (twos-complement) integers | ||
| 612 | * with relaxed alignment. | ||
| 613 | * @description This type is not available in Metal. In C or | ||
| 614 | * Objective-C, this type is available as simd_packed_int8. The | ||
| 615 | * alignment of this type is only that of the underlying scalar element | ||
| 616 | * type, so you can use it to load or store from an array of that type. */ | ||
| 617 | typedef ::simd_packed_int8 int8; | ||
| 618 | |||
| 619 | /*! @abstract A vector of sixteen 32-bit signed (twos-complement) | ||
| 620 | * integers with relaxed alignment. | ||
| 621 | * @description This type is not available in Metal. In C or | ||
| 622 | * Objective-C, this type is available as simd_packed_int16. The | ||
| 623 | * alignment of this type is only that of the underlying scalar element | ||
| 624 | * type, so you can use it to load or store from an array of that type. */ | ||
| 625 | typedef ::simd_packed_int16 int16; | ||
| 626 | |||
| 627 | /*! @abstract A vector of two 32-bit unsigned integers with relaxed | ||
| 628 | * alignment. | ||
| 629 | * @description In C or Objective-C, this type is available as | ||
| 630 | * simd_packed_uint2. The alignment of this type is only that of the | ||
| 631 | * underlying scalar element type, so you can use it to load or store | ||
| 632 | * from an array of that type. */ | ||
| 633 | typedef ::simd_packed_uint2 uint2; | ||
| 634 | |||
| 635 | /*! @abstract A vector of four 32-bit unsigned integers with relaxed | ||
| 636 | * alignment. | ||
| 637 | * @description In C or Objective-C, this type is available as | ||
| 638 | * simd_packed_uint4. The alignment of this type is only that of the | ||
| 639 | * underlying scalar element type, so you can use it to load or store | ||
| 640 | * from an array of that type. */ | ||
| 641 | typedef ::simd_packed_uint4 uint4; | ||
| 642 | |||
| 643 | /*! @abstract A vector of eight 32-bit unsigned integers with relaxed | ||
| 644 | * alignment. | ||
| 645 | * @description This type is not available in Metal. In C or | ||
| 646 | * Objective-C, this type is available as simd_packed_uint8. The | ||
| 647 | * alignment of this type is only that of the underlying scalar element | ||
| 648 | * type, so you can use it to load or store from an array of that type. */ | ||
| 649 | typedef ::simd_packed_uint8 uint8; | ||
| 650 | |||
| 651 | /*! @abstract A vector of sixteen 32-bit unsigned integers with relaxed | ||
| 652 | * alignment. | ||
| 653 | * @description This type is not available in Metal. In C or | ||
| 654 | * Objective-C, this type is available as simd_packed_uint16. The | ||
| 655 | * alignment of this type is only that of the underlying scalar element | ||
| 656 | * type, so you can use it to load or store from an array of that type. */ | ||
| 657 | typedef ::simd_packed_uint16 uint16; | ||
| 658 | |||
| 659 | /*! @abstract A vector of two 32-bit floating-point numbers with relaxed | ||
| 660 | * alignment. | ||
| 661 | * @description In C or Objective-C, this type is available as | ||
| 662 | * simd_packed_float2. The alignment of this type is only that of the | ||
| 663 | * underlying scalar element type, so you can use it to load or store | ||
| 664 | * from an array of that type. */ | ||
| 665 | typedef ::simd_packed_float2 float2; | ||
| 666 | |||
| 667 | /*! @abstract A vector of four 32-bit floating-point numbers with | ||
| 668 | * relaxed alignment. | ||
| 669 | * @description In C or Objective-C, this type is available as | ||
| 670 | * simd_packed_float4. The alignment of this type is only that of the | ||
| 671 | * underlying scalar element type, so you can use it to load or store | ||
| 672 | * from an array of that type. */ | ||
| 673 | typedef ::simd_packed_float4 float4; | ||
| 674 | |||
| 675 | /*! @abstract A vector of eight 32-bit floating-point numbers with | ||
| 676 | * relaxed alignment. | ||
| 677 | * @description This type is not available in Metal. In C or | ||
| 678 | * Objective-C, this type is available as simd_packed_float8. The | ||
| 679 | * alignment of this type is only that of the underlying scalar element | ||
| 680 | * type, so you can use it to load or store from an array of that type. */ | ||
| 681 | typedef ::simd_packed_float8 float8; | ||
| 682 | |||
| 683 | /*! @abstract A vector of sixteen 32-bit floating-point numbers with | ||
| 684 | * relaxed alignment. | ||
| 685 | * @description This type is not available in Metal. In C or | ||
| 686 | * Objective-C, this type is available as simd_packed_float16. The | ||
| 687 | * alignment of this type is only that of the underlying scalar element | ||
| 688 | * type, so you can use it to load or store from an array of that type. */ | ||
| 689 | typedef ::simd_packed_float16 float16; | ||
| 690 | |||
| 691 | /*! @abstract A vector of two 64-bit signed (twos-complement) integers | ||
| 692 | * with relaxed alignment. | ||
| 693 | * @description In C or Objective-C, this type is available as | ||
| 694 | * simd_packed_long2. The alignment of this type is only that of the | ||
| 695 | * underlying scalar element type, so you can use it to load or store | ||
| 696 | * from an array of that type. */ | ||
| 697 | typedef ::simd_packed_long2 long2; | ||
| 698 | |||
| 699 | /*! @abstract A vector of four 64-bit signed (twos-complement) integers | ||
| 700 | * with relaxed alignment. | ||
| 701 | * @description In C or Objective-C, this type is available as | ||
| 702 | * simd_packed_long4. The alignment of this type is only that of the | ||
| 703 | * underlying scalar element type, so you can use it to load or store | ||
| 704 | * from an array of that type. */ | ||
| 705 | typedef ::simd_packed_long4 long4; | ||
| 706 | |||
| 707 | /*! @abstract A vector of eight 64-bit signed (twos-complement) integers | ||
| 708 | * with relaxed alignment. | ||
| 709 | * @description This type is not available in Metal. In C or | ||
| 710 | * Objective-C, this type is available as simd_packed_long8. The | ||
| 711 | * alignment of this type is only that of the underlying scalar element | ||
| 712 | * type, so you can use it to load or store from an array of that type. */ | ||
| 713 | typedef ::simd_packed_long8 long8; | ||
| 714 | |||
| 715 | /*! @abstract A vector of two 64-bit unsigned integers with relaxed | ||
| 716 | * alignment. | ||
| 717 | * @description In C or Objective-C, this type is available as | ||
| 718 | * simd_packed_ulong2. The alignment of this type is only that of the | ||
| 719 | * underlying scalar element type, so you can use it to load or store | ||
| 720 | * from an array of that type. */ | ||
| 721 | typedef ::simd_packed_ulong2 ulong2; | ||
| 722 | |||
| 723 | /*! @abstract A vector of four 64-bit unsigned integers with relaxed | ||
| 724 | * alignment. | ||
| 725 | * @description In C or Objective-C, this type is available as | ||
| 726 | * simd_packed_ulong4. The alignment of this type is only that of the | ||
| 727 | * underlying scalar element type, so you can use it to load or store | ||
| 728 | * from an array of that type. */ | ||
| 729 | typedef ::simd_packed_ulong4 ulong4; | ||
| 730 | |||
| 731 | /*! @abstract A vector of eight 64-bit unsigned integers with relaxed | ||
| 732 | * alignment. | ||
| 733 | * @description This type is not available in Metal. In C or | ||
| 734 | * Objective-C, this type is available as simd_packed_ulong8. The | ||
| 735 | * alignment of this type is only that of the underlying scalar element | ||
| 736 | * type, so you can use it to load or store from an array of that type. */ | ||
| 737 | typedef ::simd_packed_ulong8 ulong8; | ||
| 738 | |||
| 739 | /*! @abstract A vector of two 64-bit floating-point numbers with relaxed | ||
| 740 | * alignment. | ||
| 741 | * @description In C or Objective-C, this type is available as | ||
| 742 | * simd_packed_double2. The alignment of this type is only that of the | ||
| 743 | * underlying scalar element type, so you can use it to load or store | ||
| 744 | * from an array of that type. */ | ||
| 745 | typedef ::simd_packed_double2 double2; | ||
| 746 | |||
| 747 | /*! @abstract A vector of four 64-bit floating-point numbers with | ||
| 748 | * relaxed alignment. | ||
| 749 | * @description In C or Objective-C, this type is available as | ||
| 750 | * simd_packed_double4. The alignment of this type is only that of the | ||
| 751 | * underlying scalar element type, so you can use it to load or store | ||
| 752 | * from an array of that type. */ | ||
| 753 | typedef ::simd_packed_double4 double4; | ||
| 754 | |||
| 755 | /*! @abstract A vector of eight 64-bit floating-point numbers with | ||
| 756 | * relaxed alignment. | ||
| 757 | * @description This type is not available in Metal. In C or | ||
| 758 | * Objective-C, this type is available as simd_packed_double8. The | ||
| 759 | * alignment of this type is only that of the underlying scalar element | ||
| 760 | * type, so you can use it to load or store from an array of that type. */ | ||
| 761 | typedef ::simd_packed_double8 double8; | ||
| 762 | |||
| 763 | } /* namespace simd::packed:: */ | ||
| 764 | } /* namespace simd:: */ | ||
| 765 | #endif /* __cplusplus */ | ||
| 766 | |||
| 767 | /* MARK: Deprecated vector types */ | ||
| 768 | /*! @group Deprecated vector types | ||
| 769 | * @discussion These are the original types used by earlier versions of the | ||
| 770 | * simd library; they are provided here for compatability with existing source | ||
| 771 | * files. Use the new ("simd_"-prefixed) types for future development. */ | ||
| 772 | /*! @abstract A vector of two 8-bit signed (twos-complement) integers with | ||
| 773 | * relaxed alignment. | ||
| 774 | * @description This type is deprecated; you should use simd_packed_char2 | ||
| 775 | * or simd::packed::char2 instead. */ | ||
| 776 | typedef simd_packed_char2 packed_char2; | ||
| 777 | |||
| 778 | /*! @abstract A vector of four 8-bit signed (twos-complement) integers with | ||
| 779 | * relaxed alignment. | ||
| 780 | * @description This type is deprecated; you should use simd_packed_char4 | ||
| 781 | * or simd::packed::char4 instead. */ | ||
| 782 | typedef simd_packed_char4 packed_char4; | ||
| 783 | |||
| 784 | /*! @abstract A vector of eight 8-bit signed (twos-complement) integers with | ||
| 785 | * relaxed alignment. | ||
| 786 | * @description This type is deprecated; you should use simd_packed_char8 | ||
| 787 | * or simd::packed::char8 instead. */ | ||
| 788 | typedef simd_packed_char8 packed_char8; | ||
| 789 | |||
| 790 | /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers | ||
| 791 | * with relaxed alignment. | ||
| 792 | * @description This type is deprecated; you should use simd_packed_char16 | ||
| 793 | * or simd::packed::char16 instead. */ | ||
| 794 | typedef simd_packed_char16 packed_char16; | ||
| 795 | |||
| 796 | /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) integers | ||
| 797 | * with relaxed alignment. | ||
| 798 | * @description This type is deprecated; you should use simd_packed_char32 | ||
| 799 | * or simd::packed::char32 instead. */ | ||
| 800 | typedef simd_packed_char32 packed_char32; | ||
| 801 | |||
| 802 | /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) integers | ||
| 803 | * with relaxed alignment. | ||
| 804 | * @description This type is deprecated; you should use simd_packed_char64 | ||
| 805 | * or simd::packed::char64 instead. */ | ||
| 806 | typedef simd_packed_char64 packed_char64; | ||
| 807 | |||
| 808 | /*! @abstract A vector of two 8-bit unsigned integers with relaxed | ||
| 809 | * alignment. | ||
| 810 | * @description This type is deprecated; you should use simd_packed_uchar2 | ||
| 811 | * or simd::packed::uchar2 instead. */ | ||
| 812 | typedef simd_packed_uchar2 packed_uchar2; | ||
| 813 | |||
| 814 | /*! @abstract A vector of four 8-bit unsigned integers with relaxed | ||
| 815 | * alignment. | ||
| 816 | * @description This type is deprecated; you should use simd_packed_uchar4 | ||
| 817 | * or simd::packed::uchar4 instead. */ | ||
| 818 | typedef simd_packed_uchar4 packed_uchar4; | ||
| 819 | |||
| 820 | /*! @abstract A vector of eight 8-bit unsigned integers with relaxed | ||
| 821 | * alignment. | ||
| 822 | * @description This type is deprecated; you should use simd_packed_uchar8 | ||
| 823 | * or simd::packed::uchar8 instead. */ | ||
| 824 | typedef simd_packed_uchar8 packed_uchar8; | ||
| 825 | |||
| 826 | /*! @abstract A vector of sixteen 8-bit unsigned integers with relaxed | ||
| 827 | * alignment. | ||
| 828 | * @description This type is deprecated; you should use simd_packed_uchar16 | ||
| 829 | * or simd::packed::uchar16 instead. */ | ||
| 830 | typedef simd_packed_uchar16 packed_uchar16; | ||
| 831 | |||
| 832 | /*! @abstract A vector of thirty-two 8-bit unsigned integers with relaxed | ||
| 833 | * alignment. | ||
| 834 | * @description This type is deprecated; you should use simd_packed_uchar32 | ||
| 835 | * or simd::packed::uchar32 instead. */ | ||
| 836 | typedef simd_packed_uchar32 packed_uchar32; | ||
| 837 | |||
| 838 | /*! @abstract A vector of sixty-four 8-bit unsigned integers with relaxed | ||
| 839 | * alignment. | ||
| 840 | * @description This type is deprecated; you should use simd_packed_uchar64 | ||
| 841 | * or simd::packed::uchar64 instead. */ | ||
| 842 | typedef simd_packed_uchar64 packed_uchar64; | ||
| 843 | |||
| 844 | /*! @abstract A vector of two 16-bit signed (twos-complement) integers with | ||
| 845 | * relaxed alignment. | ||
| 846 | * @description This type is deprecated; you should use simd_packed_short2 | ||
| 847 | * or simd::packed::short2 instead. */ | ||
| 848 | typedef simd_packed_short2 packed_short2; | ||
| 849 | |||
| 850 | /*! @abstract A vector of four 16-bit signed (twos-complement) integers with | ||
| 851 | * relaxed alignment. | ||
| 852 | * @description This type is deprecated; you should use simd_packed_short4 | ||
| 853 | * or simd::packed::short4 instead. */ | ||
| 854 | typedef simd_packed_short4 packed_short4; | ||
| 855 | |||
| 856 | /*! @abstract A vector of eight 16-bit signed (twos-complement) integers | ||
| 857 | * with relaxed alignment. | ||
| 858 | * @description This type is deprecated; you should use simd_packed_short8 | ||
| 859 | * or simd::packed::short8 instead. */ | ||
| 860 | typedef simd_packed_short8 packed_short8; | ||
| 861 | |||
| 862 | /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers | ||
| 863 | * with relaxed alignment. | ||
| 864 | * @description This type is deprecated; you should use simd_packed_short16 | ||
| 865 | * or simd::packed::short16 instead. */ | ||
| 866 | typedef simd_packed_short16 packed_short16; | ||
| 867 | |||
| 868 | /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) | ||
| 869 | * integers with relaxed alignment. | ||
| 870 | * @description This type is deprecated; you should use simd_packed_short32 | ||
| 871 | * or simd::packed::short32 instead. */ | ||
| 872 | typedef simd_packed_short32 packed_short32; | ||
| 873 | |||
| 874 | /*! @abstract A vector of two 16-bit unsigned integers with relaxed | ||
| 875 | * alignment. | ||
| 876 | * @description This type is deprecated; you should use simd_packed_ushort2 | ||
| 877 | * or simd::packed::ushort2 instead. */ | ||
| 878 | typedef simd_packed_ushort2 packed_ushort2; | ||
| 879 | |||
| 880 | /*! @abstract A vector of four 16-bit unsigned integers with relaxed | ||
| 881 | * alignment. | ||
| 882 | * @description This type is deprecated; you should use simd_packed_ushort4 | ||
| 883 | * or simd::packed::ushort4 instead. */ | ||
| 884 | typedef simd_packed_ushort4 packed_ushort4; | ||
| 885 | |||
| 886 | /*! @abstract A vector of eight 16-bit unsigned integers with relaxed | ||
| 887 | * alignment. | ||
| 888 | * @description This type is deprecated; you should use simd_packed_ushort8 | ||
| 889 | * or simd::packed::ushort8 instead. */ | ||
| 890 | typedef simd_packed_ushort8 packed_ushort8; | ||
| 891 | |||
| 892 | /*! @abstract A vector of sixteen 16-bit unsigned integers with relaxed | ||
| 893 | * alignment. | ||
| 894 | * @description This type is deprecated; you should use | ||
| 895 | * simd_packed_ushort16 or simd::packed::ushort16 instead. */ | ||
| 896 | typedef simd_packed_ushort16 packed_ushort16; | ||
| 897 | |||
| 898 | /*! @abstract A vector of thirty-two 16-bit unsigned integers with relaxed | ||
| 899 | * alignment. | ||
| 900 | * @description This type is deprecated; you should use | ||
| 901 | * simd_packed_ushort32 or simd::packed::ushort32 instead. */ | ||
| 902 | typedef simd_packed_ushort32 packed_ushort32; | ||
| 903 | |||
| 904 | /*! @abstract A vector of two 32-bit signed (twos-complement) integers with | ||
| 905 | * relaxed alignment. | ||
| 906 | * @description This type is deprecated; you should use simd_packed_int2 or | ||
| 907 | * simd::packed::int2 instead. */ | ||
| 908 | typedef simd_packed_int2 packed_int2; | ||
| 909 | |||
| 910 | /*! @abstract A vector of four 32-bit signed (twos-complement) integers with | ||
| 911 | * relaxed alignment. | ||
| 912 | * @description This type is deprecated; you should use simd_packed_int4 or | ||
| 913 | * simd::packed::int4 instead. */ | ||
| 914 | typedef simd_packed_int4 packed_int4; | ||
| 915 | |||
| 916 | /*! @abstract A vector of eight 32-bit signed (twos-complement) integers | ||
| 917 | * with relaxed alignment. | ||
| 918 | * @description This type is deprecated; you should use simd_packed_int8 or | ||
| 919 | * simd::packed::int8 instead. */ | ||
| 920 | typedef simd_packed_int8 packed_int8; | ||
| 921 | |||
| 922 | /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers | ||
| 923 | * with relaxed alignment. | ||
| 924 | * @description This type is deprecated; you should use simd_packed_int16 | ||
| 925 | * or simd::packed::int16 instead. */ | ||
| 926 | typedef simd_packed_int16 packed_int16; | ||
| 927 | |||
| 928 | /*! @abstract A vector of two 32-bit unsigned integers with relaxed | ||
| 929 | * alignment. | ||
| 930 | * @description This type is deprecated; you should use simd_packed_uint2 | ||
| 931 | * or simd::packed::uint2 instead. */ | ||
| 932 | typedef simd_packed_uint2 packed_uint2; | ||
| 933 | |||
| 934 | /*! @abstract A vector of four 32-bit unsigned integers with relaxed | ||
| 935 | * alignment. | ||
| 936 | * @description This type is deprecated; you should use simd_packed_uint4 | ||
| 937 | * or simd::packed::uint4 instead. */ | ||
| 938 | typedef simd_packed_uint4 packed_uint4; | ||
| 939 | |||
| 940 | /*! @abstract A vector of eight 32-bit unsigned integers with relaxed | ||
| 941 | * alignment. | ||
| 942 | * @description This type is deprecated; you should use simd_packed_uint8 | ||
| 943 | * or simd::packed::uint8 instead. */ | ||
| 944 | typedef simd_packed_uint8 packed_uint8; | ||
| 945 | |||
| 946 | /*! @abstract A vector of sixteen 32-bit unsigned integers with relaxed | ||
| 947 | * alignment. | ||
| 948 | * @description This type is deprecated; you should use simd_packed_uint16 | ||
| 949 | * or simd::packed::uint16 instead. */ | ||
| 950 | typedef simd_packed_uint16 packed_uint16; | ||
| 951 | |||
| 952 | /*! @abstract A vector of two 32-bit floating-point numbers with relaxed | ||
| 953 | * alignment. | ||
| 954 | * @description This type is deprecated; you should use simd_packed_float2 | ||
| 955 | * or simd::packed::float2 instead. */ | ||
| 956 | typedef simd_packed_float2 packed_float2; | ||
| 957 | |||
| 958 | /*! @abstract A vector of four 32-bit floating-point numbers with relaxed | ||
| 959 | * alignment. | ||
| 960 | * @description This type is deprecated; you should use simd_packed_float4 | ||
| 961 | * or simd::packed::float4 instead. */ | ||
| 962 | typedef simd_packed_float4 packed_float4; | ||
| 963 | |||
| 964 | /*! @abstract A vector of eight 32-bit floating-point numbers with relaxed | ||
| 965 | * alignment. | ||
| 966 | * @description This type is deprecated; you should use simd_packed_float8 | ||
| 967 | * or simd::packed::float8 instead. */ | ||
| 968 | typedef simd_packed_float8 packed_float8; | ||
| 969 | |||
| 970 | /*! @abstract A vector of sixteen 32-bit floating-point numbers with relaxed | ||
| 971 | * alignment. | ||
| 972 | * @description This type is deprecated; you should use simd_packed_float16 | ||
| 973 | * or simd::packed::float16 instead. */ | ||
| 974 | typedef simd_packed_float16 packed_float16; | ||
| 975 | |||
| 976 | /*! @abstract A vector of two 64-bit signed (twos-complement) integers with | ||
| 977 | * relaxed alignment. | ||
| 978 | * @description This type is deprecated; you should use simd_packed_long2 | ||
| 979 | * or simd::packed::long2 instead. */ | ||
| 980 | typedef simd_packed_long2 packed_long2; | ||
| 981 | |||
| 982 | /*! @abstract A vector of four 64-bit signed (twos-complement) integers with | ||
| 983 | * relaxed alignment. | ||
| 984 | * @description This type is deprecated; you should use simd_packed_long4 | ||
| 985 | * or simd::packed::long4 instead. */ | ||
| 986 | typedef simd_packed_long4 packed_long4; | ||
| 987 | |||
| 988 | /*! @abstract A vector of eight 64-bit signed (twos-complement) integers | ||
| 989 | * with relaxed alignment. | ||
| 990 | * @description This type is deprecated; you should use simd_packed_long8 | ||
| 991 | * or simd::packed::long8 instead. */ | ||
| 992 | typedef simd_packed_long8 packed_long8; | ||
| 993 | |||
| 994 | /*! @abstract A vector of two 64-bit unsigned integers with relaxed | ||
| 995 | * alignment. | ||
| 996 | * @description This type is deprecated; you should use simd_packed_ulong2 | ||
| 997 | * or simd::packed::ulong2 instead. */ | ||
| 998 | typedef simd_packed_ulong2 packed_ulong2; | ||
| 999 | |||
| 1000 | /*! @abstract A vector of four 64-bit unsigned integers with relaxed | ||
| 1001 | * alignment. | ||
| 1002 | * @description This type is deprecated; you should use simd_packed_ulong4 | ||
| 1003 | * or simd::packed::ulong4 instead. */ | ||
| 1004 | typedef simd_packed_ulong4 packed_ulong4; | ||
| 1005 | |||
| 1006 | /*! @abstract A vector of eight 64-bit unsigned integers with relaxed | ||
| 1007 | * alignment. | ||
| 1008 | * @description This type is deprecated; you should use simd_packed_ulong8 | ||
| 1009 | * or simd::packed::ulong8 instead. */ | ||
| 1010 | typedef simd_packed_ulong8 packed_ulong8; | ||
| 1011 | |||
| 1012 | /*! @abstract A vector of two 64-bit floating-point numbers with relaxed | ||
| 1013 | * alignment. | ||
| 1014 | * @description This type is deprecated; you should use simd_packed_double2 | ||
| 1015 | * or simd::packed::double2 instead. */ | ||
| 1016 | typedef simd_packed_double2 packed_double2; | ||
| 1017 | |||
| 1018 | /*! @abstract A vector of four 64-bit floating-point numbers with relaxed | ||
| 1019 | * alignment. | ||
| 1020 | * @description This type is deprecated; you should use simd_packed_double4 | ||
| 1021 | * or simd::packed::double4 instead. */ | ||
| 1022 | typedef simd_packed_double4 packed_double4; | ||
| 1023 | |||
| 1024 | /*! @abstract A vector of eight 64-bit floating-point numbers with relaxed | ||
| 1025 | * alignment. | ||
| 1026 | * @description This type is deprecated; you should use simd_packed_double8 | ||
| 1027 | * or simd::packed::double8 instead. */ | ||
| 1028 | typedef simd_packed_double8 packed_double8; | ||
| 1029 | |||
| 1030 | # endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 1031 | #endif | ||
lib/libc/include/x86_64-macos-gnu/simd/quaternion.h created+1194| ... | @@ -0,0 +1,1194 @@ | ||
| 1 | /*! @header | ||
| 2 | * This header defines functions for constructing and using quaternions. | ||
| 3 | * @copyright 2015-2016 Apple, Inc. All rights reserved. | ||
| 4 | * @unsorted */ | ||
| 5 | |||
| 6 | #ifndef SIMD_QUATERNIONS | ||
| 7 | #define SIMD_QUATERNIONS | ||
| 8 | |||
| 9 | #include <simd/base.h> | ||
| 10 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 11 | #include <simd/vector.h> | ||
| 12 | #include <simd/types.h> | ||
| 13 | |||
| 14 | #ifdef __cplusplus | ||
| 15 | extern "C" { | ||
| 16 | #endif | ||
| 17 | |||
| 18 | /* MARK: - C and Objective-C float interfaces */ | ||
| 19 | |||
| 20 | /*! @abstract Constructs a quaternion from four scalar values. | ||
| 21 | * | ||
| 22 | * @param ix The first component of the imaginary (vector) part. | ||
| 23 | * @param iy The second component of the imaginary (vector) part. | ||
| 24 | * @param iz The third component of the imaginary (vector) part. | ||
| 25 | * | ||
| 26 | * @param r The real (scalar) part. */ | ||
| 27 | static inline SIMD_CFUNC simd_quatf simd_quaternion(float ix, float iy, float iz, float r) { | ||
| 28 | return (simd_quatf){ { ix, iy, iz, r } }; | ||
| 29 | } | ||
| 30 | |||
| 31 | /*! @abstract Constructs a quaternion from an array of four scalars. | ||
| 32 | * | ||
| 33 | * @discussion Note that the imaginary part of the quaternion comes from | ||
| 34 | * array elements 0, 1, and 2, and the real part comes from element 3. */ | ||
| 35 | static inline SIMD_NONCONST simd_quatf simd_quaternion(const float xyzr[4]) { | ||
| 36 | return (simd_quatf){ *(const simd_packed_float4 *)xyzr }; | ||
| 37 | } | ||
| 38 | |||
| 39 | /*! @abstract Constructs a quaternion from a four-element vector. | ||
| 40 | * | ||
| 41 | * @discussion Note that the imaginary (vector) part of the quaternion comes | ||
| 42 | * from lanes 0, 1, and 2 of the vector, and the real (scalar) part comes from | ||
| 43 | * lane 3. */ | ||
| 44 | static inline SIMD_CFUNC simd_quatf simd_quaternion(simd_float4 xyzr) { | ||
| 45 | return (simd_quatf){ xyzr }; | ||
| 46 | } | ||
| 47 | |||
| 48 | /*! @abstract Constructs a quaternion that rotates by `angle` radians about | ||
| 49 | * `axis`. */ | ||
| 50 | static inline SIMD_CFUNC simd_quatf simd_quaternion(float angle, simd_float3 axis); | ||
| 51 | |||
| 52 | /*! @abstract Construct a quaternion that rotates from one vector to another. | ||
| 53 | * | ||
| 54 | * @param from A normalized three-element vector. | ||
| 55 | * @param to A normalized three-element vector. | ||
| 56 | * | ||
| 57 | * @discussion The rotation axis is `simd_cross(from, to)`. If `from` and | ||
| 58 | * `to` point in opposite directions (to within machine precision), an | ||
| 59 | * arbitrary rotation axis is chosen, and the angle is pi radians. */ | ||
| 60 | static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float3 from, simd_float3 to); | ||
| 61 | |||
| 62 | /*! @abstract Construct a quaternion from a 3x3 rotation `matrix`. | ||
| 63 | * | ||
| 64 | * @discussion If `matrix` is not orthogonal with determinant 1, the result | ||
| 65 | * is undefined. */ | ||
| 66 | static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float3x3 matrix); | ||
| 67 | |||
| 68 | /*! @abstract Construct a quaternion from a 4x4 rotation `matrix`. | ||
| 69 | * | ||
| 70 | * @discussion The last row and column of the matrix are ignored. This | ||
| 71 | * function is equivalent to calling simd_quaternion with the upper-left 3x3 | ||
| 72 | * submatrix . */ | ||
| 73 | static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float4x4 matrix); | ||
| 74 | |||
| 75 | /*! @abstract The real (scalar) part of the quaternion `q`. */ | ||
| 76 | static inline SIMD_CFUNC float simd_real(simd_quatf q) { | ||
| 77 | return q.vector.w; | ||
| 78 | } | ||
| 79 | |||
| 80 | /*! @abstract The imaginary (vector) part of the quaternion `q`. */ | ||
| 81 | static inline SIMD_CFUNC simd_float3 simd_imag(simd_quatf q) { | ||
| 82 | return q.vector.xyz; | ||
| 83 | } | ||
| 84 | |||
| 85 | /*! @abstract The angle (in radians) of rotation represented by `q`. */ | ||
| 86 | static inline SIMD_CFUNC float simd_angle(simd_quatf q); | ||
| 87 | |||
| 88 | /*! @abstract The normalized axis (a 3-element vector) around which the | ||
| 89 | * action of the quaternion `q` rotates. */ | ||
| 90 | static inline SIMD_CFUNC simd_float3 simd_axis(simd_quatf q); | ||
| 91 | |||
| 92 | /*! @abstract The sum of the quaternions `p` and `q`. */ | ||
| 93 | static inline SIMD_CFUNC simd_quatf simd_add(simd_quatf p, simd_quatf q); | ||
| 94 | |||
| 95 | /*! @abstract The difference of the quaternions `p` and `q`. */ | ||
| 96 | static inline SIMD_CFUNC simd_quatf simd_sub(simd_quatf p, simd_quatf q); | ||
| 97 | |||
| 98 | /*! @abstract The product of the quaternions `p` and `q`. */ | ||
| 99 | static inline SIMD_CFUNC simd_quatf simd_mul(simd_quatf p, simd_quatf q); | ||
| 100 | |||
| 101 | /*! @abstract The quaternion `q` scaled by the real value `a`. */ | ||
| 102 | static inline SIMD_CFUNC simd_quatf simd_mul(simd_quatf q, float a); | ||
| 103 | |||
| 104 | /*! @abstract The quaternion `q` scaled by the real value `a`. */ | ||
| 105 | static inline SIMD_CFUNC simd_quatf simd_mul(float a, simd_quatf q); | ||
| 106 | |||
| 107 | /*! @abstract The conjugate of the quaternion `q`. */ | ||
| 108 | static inline SIMD_CFUNC simd_quatf simd_conjugate(simd_quatf q); | ||
| 109 | |||
| 110 | /*! @abstract The (multiplicative) inverse of the quaternion `q`. */ | ||
| 111 | static inline SIMD_CFUNC simd_quatf simd_inverse(simd_quatf q); | ||
| 112 | |||
| 113 | /*! @abstract The negation (additive inverse) of the quaternion `q`. */ | ||
| 114 | static inline SIMD_CFUNC simd_quatf simd_negate(simd_quatf q); | ||
| 115 | |||
| 116 | /*! @abstract The dot product of the quaternions `p` and `q` interpreted as | ||
| 117 | * four-dimensional vectors. */ | ||
| 118 | static inline SIMD_CFUNC float simd_dot(simd_quatf p, simd_quatf q); | ||
| 119 | |||
| 120 | /*! @abstract The length of the quaternion `q`. */ | ||
| 121 | static inline SIMD_CFUNC float simd_length(simd_quatf q); | ||
| 122 | |||
| 123 | /*! @abstract The unit quaternion obtained by normalizing `q`. */ | ||
| 124 | static inline SIMD_CFUNC simd_quatf simd_normalize(simd_quatf q); | ||
| 125 | |||
| 126 | /*! @abstract Rotates the vector `v` by the quaternion `q`. */ | ||
| 127 | static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v); | ||
| 128 | |||
| 129 | /*! @abstract Logarithm of the quaternion `q`. | ||
| 130 | * @discussion Do not call this function directly; use `log(q)` instead. | ||
| 131 | * | ||
| 132 | * We can write a quaternion `q` in the form: `r(cos(t) + sin(t)v)` where | ||
| 133 | * `r` is the length of `q`, `t` is an angle, and `v` is a unit 3-vector. | ||
| 134 | * The logarithm of `q` is `log(r) + tv`, just like the logarithm of the | ||
| 135 | * complex number `r*(cos(t) + i sin(t))` is `log(r) + it`. | ||
| 136 | * | ||
| 137 | * Note that this function is not robust against poorly-scaled non-unit | ||
| 138 | * quaternions, because it is primarily used for spline interpolation of | ||
| 139 | * unit quaternions. If you need to compute a robust logarithm of general | ||
| 140 | * quaternions, you can use the following approach: | ||
| 141 | * | ||
| 142 | * scale = simd_reduce_max(simd_abs(q.vector)); | ||
| 143 | * logq = log(simd_recip(scale)*q); | ||
| 144 | * logq.real += log(scale); | ||
| 145 | * return logq; */ | ||
| 146 | static SIMD_NOINLINE simd_quatf __tg_log(simd_quatf q); | ||
| 147 | |||
| 148 | /*! @abstract Inverse of `log( )`; the exponential map on quaternions. | ||
| 149 | * @discussion Do not call this function directly; use `exp(q)` instead. */ | ||
| 150 | static SIMD_NOINLINE simd_quatf __tg_exp(simd_quatf q); | ||
| 151 | |||
| 152 | /*! @abstract Spherical linear interpolation along the shortest arc between | ||
| 153 | * quaternions `q0` and `q1`. */ | ||
| 154 | static SIMD_NOINLINE simd_quatf simd_slerp(simd_quatf q0, simd_quatf q1, float t); | ||
| 155 | |||
| 156 | /*! @abstract Spherical linear interpolation along the longest arc between | ||
| 157 | * quaternions `q0` and `q1`. */ | ||
| 158 | static SIMD_NOINLINE simd_quatf simd_slerp_longest(simd_quatf q0, simd_quatf q1, float t); | ||
| 159 | |||
| 160 | /*! @abstract Interpolate between quaternions along a spherical cubic spline. | ||
| 161 | * | ||
| 162 | * @discussion The function interpolates between q1 and q2. q0 is the left | ||
| 163 | * endpoint of the previous interval, and q3 is the right endpoint of the next | ||
| 164 | * interval. Use this function to smoothly interpolate between a sequence of | ||
| 165 | * rotations. */ | ||
| 166 | static SIMD_NOINLINE simd_quatf simd_spline(simd_quatf q0, simd_quatf q1, simd_quatf q2, simd_quatf q3, float t); | ||
| 167 | |||
| 168 | /*! @abstract Spherical cubic Bezier interpolation between quaternions. | ||
| 169 | * | ||
| 170 | * @discussion The function treats q0 ... q3 as control points and uses slerp | ||
| 171 | * in place of lerp in the De Castlejeau algorithm. The endpoints of | ||
| 172 | * interpolation are thus q0 and q3, and the curve will not generally pass | ||
| 173 | * through q1 or q2. Note that the convex hull property of "standard" Bezier | ||
| 174 | * curve does not hold on the sphere. */ | ||
| 175 | static SIMD_NOINLINE simd_quatf simd_bezier(simd_quatf q0, simd_quatf q1, simd_quatf q2, simd_quatf q3, float t); | ||
| 176 | |||
| 177 | #ifdef __cplusplus | ||
| 178 | } /* extern "C" */ | ||
| 179 | /* MARK: - C++ float interfaces */ | ||
| 180 | |||
| 181 | namespace simd { | ||
| 182 | struct quatf : ::simd_quatf { | ||
| 183 | /*! @abstract The identity quaternion. */ | ||
| 184 | quatf( ) : ::simd_quatf(::simd_quaternion((float4){0,0,0,1})) { } | ||
| 185 | |||
| 186 | /*! @abstract Constructs a C++ quaternion from a C quaternion. */ | ||
| 187 | quatf(::simd_quatf q) : ::simd_quatf(q) { } | ||
| 188 | |||
| 189 | /*! @abstract Constructs a quaternion from components. */ | ||
| 190 | quatf(float ix, float iy, float iz, float r) : ::simd_quatf(::simd_quaternion(ix, iy, iz, r)) { } | ||
| 191 | |||
| 192 | /*! @abstract Constructs a quaternion from an array of scalars. */ | ||
| 193 | quatf(const float xyzr[4]) : ::simd_quatf(::simd_quaternion(xyzr)) { } | ||
| 194 | |||
| 195 | /*! @abstract Constructs a quaternion from a vector. */ | ||
| 196 | quatf(float4 xyzr) : ::simd_quatf(::simd_quaternion(xyzr)) { } | ||
| 197 | |||
| 198 | /*! @abstract Quaternion representing rotation about `axis` by `angle` | ||
| 199 | * radians. */ | ||
| 200 | quatf(float angle, float3 axis) : ::simd_quatf(::simd_quaternion(angle, axis)) { } | ||
| 201 | |||
| 202 | /*! @abstract Quaternion that rotates `from` into `to`. */ | ||
| 203 | quatf(float3 from, float3 to) : ::simd_quatf(::simd_quaternion(from, to)) { } | ||
| 204 | |||
| 205 | /*! @abstract Constructs a quaternion from a rotation matrix. */ | ||
| 206 | quatf(::simd_float3x3 matrix) : ::simd_quatf(::simd_quaternion(matrix)) { } | ||
| 207 | |||
| 208 | /*! @abstract Constructs a quaternion from a rotation matrix. */ | ||
| 209 | quatf(::simd_float4x4 matrix) : ::simd_quatf(::simd_quaternion(matrix)) { } | ||
| 210 | |||
| 211 | /*! @abstract The real (scalar) part of the quaternion. */ | ||
| 212 | float real(void) const { return ::simd_real(*this); } | ||
| 213 | |||
| 214 | /*! @abstract The imaginary (vector) part of the quaternion. */ | ||
| 215 | float3 imag(void) const { return ::simd_imag(*this); } | ||
| 216 | |||
| 217 | /*! @abstract The angle the quaternion rotates by. */ | ||
| 218 | float angle(void) const { return ::simd_angle(*this); } | ||
| 219 | |||
| 220 | /*! @abstract The axis the quaternion rotates about. */ | ||
| 221 | float3 axis(void) const { return ::simd_axis(*this); } | ||
| 222 | |||
| 223 | /*! @abstract The length of the quaternion. */ | ||
| 224 | float length(void) const { return ::simd_length(*this); } | ||
| 225 | |||
| 226 | /*! @abstract Act on the vector `v` by rotation. */ | ||
| 227 | float3 operator()(const ::simd_float3 v) const { return ::simd_act(*this, v); } | ||
| 228 | }; | ||
| 229 | |||
| 230 | static SIMD_CPPFUNC quatf operator+(const ::simd_quatf p, const ::simd_quatf q) { return ::simd_add(p, q); } | ||
| 231 | static SIMD_CPPFUNC quatf operator-(const ::simd_quatf p, const ::simd_quatf q) { return ::simd_sub(p, q); } | ||
| 232 | static SIMD_CPPFUNC quatf operator-(const ::simd_quatf p) { return ::simd_negate(p); } | ||
| 233 | static SIMD_CPPFUNC quatf operator*(const float r, const ::simd_quatf p) { return ::simd_mul(r, p); } | ||
| 234 | static SIMD_CPPFUNC quatf operator*(const ::simd_quatf p, const float r) { return ::simd_mul(p, r); } | ||
| 235 | static SIMD_CPPFUNC quatf operator*(const ::simd_quatf p, const ::simd_quatf q) { return ::simd_mul(p, q); } | ||
| 236 | static SIMD_CPPFUNC quatf operator/(const ::simd_quatf p, const ::simd_quatf q) { return ::simd_mul(p, ::simd_inverse(q)); } | ||
| 237 | static SIMD_CPPFUNC quatf operator+=(quatf &p, const ::simd_quatf q) { return p = p+q; } | ||
| 238 | static SIMD_CPPFUNC quatf operator-=(quatf &p, const ::simd_quatf q) { return p = p-q; } | ||
| 239 | static SIMD_CPPFUNC quatf operator*=(quatf &p, const float r) { return p = p*r; } | ||
| 240 | static SIMD_CPPFUNC quatf operator*=(quatf &p, const ::simd_quatf q) { return p = p*q; } | ||
| 241 | static SIMD_CPPFUNC quatf operator/=(quatf &p, const ::simd_quatf q) { return p = p/q; } | ||
| 242 | |||
| 243 | /*! @abstract The conjugate of the quaternion `q`. */ | ||
| 244 | static SIMD_CPPFUNC quatf conjugate(const ::simd_quatf p) { return ::simd_conjugate(p); } | ||
| 245 | |||
| 246 | /*! @abstract The (multiplicative) inverse of the quaternion `q`. */ | ||
| 247 | static SIMD_CPPFUNC quatf inverse(const ::simd_quatf p) { return ::simd_inverse(p); } | ||
| 248 | |||
| 249 | /*! @abstract The dot product of the quaternions `p` and `q` interpreted as | ||
| 250 | * four-dimensional vectors. */ | ||
| 251 | static SIMD_CPPFUNC float dot(const ::simd_quatf p, const ::simd_quatf q) { return ::simd_dot(p, q); } | ||
| 252 | |||
| 253 | /*! @abstract The unit quaternion obtained by normalizing `q`. */ | ||
| 254 | static SIMD_CPPFUNC quatf normalize(const ::simd_quatf p) { return ::simd_normalize(p); } | ||
| 255 | |||
| 256 | /*! @abstract logarithm of the quaternion `q`. */ | ||
| 257 | static SIMD_CPPFUNC quatf log(const ::simd_quatf q) { return ::__tg_log(q); } | ||
| 258 | |||
| 259 | /*! @abstract exponential map of quaterion `q`. */ | ||
| 260 | static SIMD_CPPFUNC quatf exp(const ::simd_quatf q) { return ::__tg_exp(q); } | ||
| 261 | |||
| 262 | /*! @abstract Spherical linear interpolation along the shortest arc between | ||
| 263 | * quaternions `q0` and `q1`. */ | ||
| 264 | static SIMD_CPPFUNC quatf slerp(const ::simd_quatf p0, const ::simd_quatf p1, float t) { return ::simd_slerp(p0, p1, t); } | ||
| 265 | |||
| 266 | /*! @abstract Spherical linear interpolation along the longest arc between | ||
| 267 | * quaternions `q0` and `q1`. */ | ||
| 268 | static SIMD_CPPFUNC quatf slerp_longest(const ::simd_quatf p0, const ::simd_quatf p1, float t) { return ::simd_slerp_longest(p0, p1, t); } | ||
| 269 | |||
| 270 | /*! @abstract Interpolate between quaternions along a spherical cubic spline. | ||
| 271 | * | ||
| 272 | * @discussion The function interpolates between q1 and q2. q0 is the left | ||
| 273 | * endpoint of the previous interval, and q3 is the right endpoint of the next | ||
| 274 | * interval. Use this function to smoothly interpolate between a sequence of | ||
| 275 | * rotations. */ | ||
| 276 | static SIMD_CPPFUNC quatf spline(const ::simd_quatf p0, const ::simd_quatf p1, const ::simd_quatf p2, const ::simd_quatf p3, float t) { return ::simd_spline(p0, p1, p2, p3, t); } | ||
| 277 | |||
| 278 | /*! @abstract Spherical cubic Bezier interpolation between quaternions. | ||
| 279 | * | ||
| 280 | * @discussion The function treats q0 ... q3 as control points and uses slerp | ||
| 281 | * in place of lerp in the De Castlejeau algorithm. The endpoints of | ||
| 282 | * interpolation are thus q0 and q3, and the curve will not generally pass | ||
| 283 | * through q1 or q2. Note that the convex hull property of "standard" Bezier | ||
| 284 | * curve does not hold on the sphere. */ | ||
| 285 | static SIMD_CPPFUNC quatf bezier(const ::simd_quatf p0, const ::simd_quatf p1, const ::simd_quatf p2, const ::simd_quatf p3, float t) { return ::simd_bezier(p0, p1, p2, p3, t); } | ||
| 286 | } | ||
| 287 | |||
| 288 | extern "C" { | ||
| 289 | #endif /* __cplusplus */ | ||
| 290 | |||
| 291 | /* MARK: - float implementations */ | ||
| 292 | |||
| 293 | #include <simd/math.h> | ||
| 294 | #include <simd/geometry.h> | ||
| 295 | |||
| 296 | /* tg_promote is implementation gobbledygook that enables the compile-time | ||
| 297 | * dispatching in tgmath.h to work its magic. */ | ||
| 298 | static simd_quatf __attribute__((__overloadable__)) __tg_promote(simd_quatf); | ||
| 299 | |||
| 300 | /*! @abstract Constructs a quaternion from imaginary and real parts. | ||
| 301 | * @discussion This function is hidden behind an underscore to avoid confusion | ||
| 302 | * with the angle-axis constructor. */ | ||
| 303 | static inline SIMD_CFUNC simd_quatf _simd_quaternion(simd_float3 imag, float real) { | ||
| 304 | return simd_quaternion(simd_make_float4(imag, real)); | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline SIMD_CFUNC simd_quatf simd_quaternion(float angle, simd_float3 axis) { | ||
| 308 | return _simd_quaternion(sin(angle/2) * axis, cos(angle/2)); | ||
| 309 | } | ||
| 310 | |||
| 311 | static inline SIMD_CFUNC float simd_angle(simd_quatf q) { | ||
| 312 | return 2*atan2(simd_length(q.vector.xyz), q.vector.w); | ||
| 313 | } | ||
| 314 | |||
| 315 | static inline SIMD_CFUNC simd_float3 simd_axis(simd_quatf q) { | ||
| 316 | return simd_normalize(q.vector.xyz); | ||
| 317 | } | ||
| 318 | |||
| 319 | static inline SIMD_CFUNC simd_quatf simd_add(simd_quatf p, simd_quatf q) { | ||
| 320 | return simd_quaternion(p.vector + q.vector); | ||
| 321 | } | ||
| 322 | |||
| 323 | static inline SIMD_CFUNC simd_quatf simd_sub(simd_quatf p, simd_quatf q) { | ||
| 324 | return simd_quaternion(p.vector - q.vector); | ||
| 325 | } | ||
| 326 | |||
| 327 | static inline SIMD_CFUNC simd_quatf simd_mul(simd_quatf p, simd_quatf q) { | ||
| 328 | #pragma STDC FP_CONTRACT ON | ||
| 329 | return simd_quaternion((p.vector.x * __builtin_shufflevector(q.vector, -q.vector, 3,6,1,4) + | ||
| 330 | p.vector.y * __builtin_shufflevector(q.vector, -q.vector, 2,3,4,5)) + | ||
| 331 | (p.vector.z * __builtin_shufflevector(q.vector, -q.vector, 5,0,3,6) + | ||
| 332 | p.vector.w * q.vector)); | ||
| 333 | } | ||
| 334 | |||
| 335 | static inline SIMD_CFUNC simd_quatf simd_mul(simd_quatf q, float a) { | ||
| 336 | return simd_quaternion(a * q.vector); | ||
| 337 | } | ||
| 338 | |||
| 339 | static inline SIMD_CFUNC simd_quatf simd_mul(float a, simd_quatf q) { | ||
| 340 | return simd_mul(q,a); | ||
| 341 | } | ||
| 342 | |||
| 343 | static inline SIMD_CFUNC simd_quatf simd_conjugate(simd_quatf q) { | ||
| 344 | return simd_quaternion(q.vector * (simd_float4){-1,-1,-1, 1}); | ||
| 345 | } | ||
| 346 | |||
| 347 | static inline SIMD_CFUNC simd_quatf simd_inverse(simd_quatf q) { | ||
| 348 | return simd_quaternion(simd_conjugate(q).vector * simd_recip(simd_length_squared(q.vector))); | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline SIMD_CFUNC simd_quatf simd_negate(simd_quatf q) { | ||
| 352 | return simd_quaternion(-q.vector); | ||
| 353 | } | ||
| 354 | |||
| 355 | static inline SIMD_CFUNC float simd_dot(simd_quatf p, simd_quatf q) { | ||
| 356 | return simd_dot(p.vector, q.vector); | ||
| 357 | } | ||
| 358 | |||
| 359 | static inline SIMD_CFUNC float simd_length(simd_quatf q) { | ||
| 360 | return simd_length(q.vector); | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline SIMD_CFUNC simd_quatf simd_normalize(simd_quatf q) { | ||
| 364 | float length_squared = simd_length_squared(q.vector); | ||
| 365 | if (length_squared == 0) { | ||
| 366 | return simd_quaternion((simd_float4){0,0,0,1}); | ||
| 367 | } | ||
| 368 | return simd_quaternion(q.vector * simd_rsqrt(length_squared)); | ||
| 369 | } | ||
| 370 | |||
| 371 | #if defined __arm__ || defined __arm64__ | ||
| 372 | /*! @abstract Multiplies the vector `v` by the quaternion `q`. | ||
| 373 | * | ||
| 374 | * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation | ||
| 375 | * by `q`. That operation is provided by `simd_act(q, v)`. This function is an | ||
| 376 | * implementation detail and you should not call it directly. It may be | ||
| 377 | * removed or modified in future versions of the simd module. */ | ||
| 378 | static inline SIMD_CFUNC simd_quatf _simd_mul_vq(simd_float3 v, simd_quatf q) { | ||
| 379 | #pragma STDC FP_CONTRACT ON | ||
| 380 | return simd_quaternion(v.x * __builtin_shufflevector(q.vector, -q.vector, 3,6,1,4) + | ||
| 381 | v.y * __builtin_shufflevector(q.vector, -q.vector, 2,3,4,5) + | ||
| 382 | v.z * __builtin_shufflevector(q.vector, -q.vector, 5,0,3,6)); | ||
| 383 | } | ||
| 384 | #endif | ||
| 385 | |||
| 386 | static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v) { | ||
| 387 | #if defined __arm__ || defined __arm64__ | ||
| 388 | return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz; | ||
| 389 | #else | ||
| 390 | #pragma STDC FP_CONTRACT ON | ||
| 391 | simd_float3 t = 2*simd_cross(simd_imag(q),v); | ||
| 392 | return v + simd_real(q)*t + simd_cross(simd_imag(q), t); | ||
| 393 | #endif | ||
| 394 | } | ||
| 395 | |||
| 396 | static SIMD_NOINLINE simd_quatf __tg_log(simd_quatf q) { | ||
| 397 | float real = __tg_log(simd_length_squared(q.vector))/2; | ||
| 398 | if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real); | ||
| 399 | simd_float3 imag = __tg_acos(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q)); | ||
| 400 | return _simd_quaternion(imag, real); | ||
| 401 | } | ||
| 402 | |||
| 403 | static SIMD_NOINLINE simd_quatf __tg_exp(simd_quatf q) { | ||
| 404 | // angle is actually *twice* the angle of the rotation corresponding to | ||
| 405 | // the resulting quaternion, which is why we don't simply use the (angle, | ||
| 406 | // axis) constructor to generate `unit`. | ||
| 407 | float angle = simd_length(simd_imag(q)); | ||
| 408 | if (angle == 0) return _simd_quaternion(0, exp(simd_real(q))); | ||
| 409 | simd_float3 axis = simd_normalize(simd_imag(q)); | ||
| 410 | simd_quatf unit = _simd_quaternion(sin(angle)*axis, cosf(angle)); | ||
| 411 | return simd_mul(exp(simd_real(q)), unit); | ||
| 412 | } | ||
| 413 | |||
| 414 | /*! @abstract Implementation detail of the `simd_quaternion(from, to)` | ||
| 415 | * initializer. | ||
| 416 | * | ||
| 417 | * @discussion Computes the quaternion rotation `from` to `to` if they are | ||
| 418 | * separated by less than 90 degrees. Not numerically stable for larger | ||
| 419 | * angles. This function is an implementation detail and you should not | ||
| 420 | * call it directly. It may be removed or modified in future versions of the | ||
| 421 | * simd module. */ | ||
| 422 | static inline SIMD_CFUNC simd_quatf _simd_quaternion_reduced(simd_float3 from, simd_float3 to) { | ||
| 423 | simd_float3 half = simd_normalize(from + to); | ||
| 424 | return _simd_quaternion(simd_cross(from, half), simd_dot(from, half)); | ||
| 425 | } | ||
| 426 | |||
| 427 | static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float3 from, simd_float3 to) { | ||
| 428 | |||
| 429 | // If the angle between from and to is not too big, we can compute the | ||
| 430 | // rotation accurately using a simple implementation. | ||
| 431 | if (simd_dot(from, to) >= 0) { | ||
| 432 | return _simd_quaternion_reduced(from, to); | ||
| 433 | } | ||
| 434 | |||
| 435 | // Because from and to are more than 90 degrees apart, we compute the | ||
| 436 | // rotation in two stages (from -> half), (half -> to) to preserve numerical | ||
| 437 | // accuracy. | ||
| 438 | simd_float3 half = from + to; | ||
| 439 | |||
| 440 | if (simd_length_squared(half) == 0) { | ||
| 441 | // half is nearly zero, so from and to point in nearly opposite directions | ||
| 442 | // and the rotation is numerically underspecified. Pick an axis orthogonal | ||
| 443 | // to the vectors, and use an angle of pi radians. | ||
| 444 | simd_float3 abs_from = simd_abs(from); | ||
| 445 | if (abs_from.x <= abs_from.y && abs_from.x <= abs_from.z) | ||
| 446 | return _simd_quaternion(simd_normalize(simd_cross(from, (simd_float3){1,0,0})), 0.f); | ||
| 447 | else if (abs_from.y <= abs_from.z) | ||
| 448 | return _simd_quaternion(simd_normalize(simd_cross(from, (simd_float3){0,1,0})), 0.f); | ||
| 449 | else | ||
| 450 | return _simd_quaternion(simd_normalize(simd_cross(from, (simd_float3){0,0,1})), 0.f); | ||
| 451 | } | ||
| 452 | |||
| 453 | // Compute the two-step rotation. */ | ||
| 454 | half = simd_normalize(half); | ||
| 455 | return simd_mul(_simd_quaternion_reduced(from, half), | ||
| 456 | _simd_quaternion_reduced(half, to)); | ||
| 457 | } | ||
| 458 | |||
| 459 | static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float3x3 matrix) { | ||
| 460 | const simd_float3 *mat = matrix.columns; | ||
| 461 | float trace = mat[0][0] + mat[1][1] + mat[2][2]; | ||
| 462 | if (trace >= 0.0) { | ||
| 463 | float r = 2*sqrt(1 + trace); | ||
| 464 | float rinv = simd_recip(r); | ||
| 465 | return simd_quaternion(rinv*(mat[1][2] - mat[2][1]), | ||
| 466 | rinv*(mat[2][0] - mat[0][2]), | ||
| 467 | rinv*(mat[0][1] - mat[1][0]), | ||
| 468 | r/4); | ||
| 469 | } else if (mat[0][0] >= mat[1][1] && mat[0][0] >= mat[2][2]) { | ||
| 470 | float r = 2*sqrt(1 - mat[1][1] - mat[2][2] + mat[0][0]); | ||
| 471 | float rinv = simd_recip(r); | ||
| 472 | return simd_quaternion(r/4, | ||
| 473 | rinv*(mat[0][1] + mat[1][0]), | ||
| 474 | rinv*(mat[0][2] + mat[2][0]), | ||
| 475 | rinv*(mat[1][2] - mat[2][1])); | ||
| 476 | } else if (mat[1][1] >= mat[2][2]) { | ||
| 477 | float r = 2*sqrt(1 - mat[0][0] - mat[2][2] + mat[1][1]); | ||
| 478 | float rinv = simd_recip(r); | ||
| 479 | return simd_quaternion(rinv*(mat[0][1] + mat[1][0]), | ||
| 480 | r/4, | ||
| 481 | rinv*(mat[1][2] + mat[2][1]), | ||
| 482 | rinv*(mat[2][0] - mat[0][2])); | ||
| 483 | } else { | ||
| 484 | float r = 2*sqrt(1 - mat[0][0] - mat[1][1] + mat[2][2]); | ||
| 485 | float rinv = simd_recip(r); | ||
| 486 | return simd_quaternion(rinv*(mat[0][2] + mat[2][0]), | ||
| 487 | rinv*(mat[1][2] + mat[2][1]), | ||
| 488 | r/4, | ||
| 489 | rinv*(mat[0][1] - mat[1][0])); | ||
| 490 | } | ||
| 491 | } | ||
| 492 | |||
| 493 | static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float4x4 matrix) { | ||
| 494 | const simd_float4 *mat = matrix.columns; | ||
| 495 | float trace = mat[0][0] + mat[1][1] + mat[2][2]; | ||
| 496 | if (trace >= 0.0) { | ||
| 497 | float r = 2*sqrt(1 + trace); | ||
| 498 | float rinv = simd_recip(r); | ||
| 499 | return simd_quaternion(rinv*(mat[1][2] - mat[2][1]), | ||
| 500 | rinv*(mat[2][0] - mat[0][2]), | ||
| 501 | rinv*(mat[0][1] - mat[1][0]), | ||
| 502 | r/4); | ||
| 503 | } else if (mat[0][0] >= mat[1][1] && mat[0][0] >= mat[2][2]) { | ||
| 504 | float r = 2*sqrt(1 - mat[1][1] - mat[2][2] + mat[0][0]); | ||
| 505 | float rinv = simd_recip(r); | ||
| 506 | return simd_quaternion(r/4, | ||
| 507 | rinv*(mat[0][1] + mat[1][0]), | ||
| 508 | rinv*(mat[0][2] + mat[2][0]), | ||
| 509 | rinv*(mat[1][2] - mat[2][1])); | ||
| 510 | } else if (mat[1][1] >= mat[2][2]) { | ||
| 511 | float r = 2*sqrt(1 - mat[0][0] - mat[2][2] + mat[1][1]); | ||
| 512 | float rinv = simd_recip(r); | ||
| 513 | return simd_quaternion(rinv*(mat[0][1] + mat[1][0]), | ||
| 514 | r/4, | ||
| 515 | rinv*(mat[1][2] + mat[2][1]), | ||
| 516 | rinv*(mat[2][0] - mat[0][2])); | ||
| 517 | } else { | ||
| 518 | float r = 2*sqrt(1 - mat[0][0] - mat[1][1] + mat[2][2]); | ||
| 519 | float rinv = simd_recip(r); | ||
| 520 | return simd_quaternion(rinv*(mat[0][2] + mat[2][0]), | ||
| 521 | rinv*(mat[1][2] + mat[2][1]), | ||
| 522 | r/4, | ||
| 523 | rinv*(mat[0][1] - mat[1][0])); | ||
| 524 | } | ||
| 525 | } | ||
| 526 | |||
| 527 | /*! @abstract The angle between p and q interpreted as 4-dimensional vectors. | ||
| 528 | * | ||
| 529 | * @discussion This function is an implementation detail and you should not | ||
| 530 | * call it directly. It may be removed or modified in future versions of the | ||
| 531 | * simd module. */ | ||
| 532 | static SIMD_NOINLINE float _simd_angle(simd_quatf p, simd_quatf q) { | ||
| 533 | return 2*atan2(simd_length(p.vector - q.vector), simd_length(p.vector + q.vector)); | ||
| 534 | } | ||
| 535 | |||
| 536 | /*! @abstract sin(x)/x. | ||
| 537 | * | ||
| 538 | * @discussion This function is an implementation detail and you should not | ||
| 539 | * call it directly. It may be removed or modified in future versions of the | ||
| 540 | * simd module. */ | ||
| 541 | static SIMD_CFUNC float _simd_sinc(float x) { | ||
| 542 | if (x == 0) return 1; | ||
| 543 | return sin(x)/x; | ||
| 544 | } | ||
| 545 | |||
| 546 | /*! @abstract Spherical lerp between q0 and q1. | ||
| 547 | * | ||
| 548 | * @discussion This function may interpolate along either the longer or | ||
| 549 | * shorter path between q0 and q1; it is used as an implementation detail | ||
| 550 | * in `simd_slerp` and `simd_slerp_longest`; you should use those functions | ||
| 551 | * instead of calling this directly. */ | ||
| 552 | static SIMD_NOINLINE simd_quatf _simd_slerp_internal(simd_quatf q0, simd_quatf q1, float t) { | ||
| 553 | float s = 1 - t; | ||
| 554 | float a = _simd_angle(q0, q1); | ||
| 555 | float r = simd_recip(_simd_sinc(a)); | ||
| 556 | return simd_normalize(simd_quaternion(_simd_sinc(s*a)*r*s*q0.vector + _simd_sinc(t*a)*r*t*q1.vector)); | ||
| 557 | } | ||
| 558 | |||
| 559 | static SIMD_NOINLINE simd_quatf simd_slerp(simd_quatf q0, simd_quatf q1, float t) { | ||
| 560 | if (simd_dot(q0, q1) >= 0) | ||
| 561 | return _simd_slerp_internal(q0, q1, t); | ||
| 562 | return _simd_slerp_internal(q0, simd_negate(q1), t); | ||
| 563 | } | ||
| 564 | |||
| 565 | static SIMD_NOINLINE simd_quatf simd_slerp_longest(simd_quatf q0, simd_quatf q1, float t) { | ||
| 566 | if (simd_dot(q0, q1) >= 0) | ||
| 567 | return _simd_slerp_internal(q0, simd_negate(q1), t); | ||
| 568 | return _simd_slerp_internal(q0, q1, t); | ||
| 569 | } | ||
| 570 | |||
| 571 | /*! @discussion This function is an implementation detail and you should not | ||
| 572 | * call it directly. It may be removed or modified in future versions of the | ||
| 573 | * simd module. */ | ||
| 574 | static SIMD_NOINLINE simd_quatf _simd_intermediate(simd_quatf q0, simd_quatf q1, simd_quatf q2) { | ||
| 575 | simd_quatf p0 = __tg_log(simd_mul(q0, simd_inverse(q1))); | ||
| 576 | simd_quatf p2 = __tg_log(simd_mul(q2, simd_inverse(q1))); | ||
| 577 | return simd_normalize(simd_mul(q1, __tg_exp(simd_mul(-0.25, simd_add(p0,p2))))); | ||
| 578 | } | ||
| 579 | |||
| 580 | /*! @discussion This function is an implementation detail and you should not | ||
| 581 | * call it directly. It may be removed or modified in future versions of the | ||
| 582 | * simd module. */ | ||
| 583 | static SIMD_NOINLINE simd_quatf _simd_squad(simd_quatf q0, simd_quatf qa, simd_quatf qb, simd_quatf q1, float t) { | ||
| 584 | simd_quatf r0 = _simd_slerp_internal(q0, q1, t); | ||
| 585 | simd_quatf r1 = _simd_slerp_internal(qa, qb, t); | ||
| 586 | return _simd_slerp_internal(r0, r1, 2*t*(1 - t)); | ||
| 587 | } | ||
| 588 | |||
| 589 | static SIMD_NOINLINE simd_quatf simd_spline(simd_quatf q0, simd_quatf q1, simd_quatf q2, simd_quatf q3, float t) { | ||
| 590 | simd_quatf qa = _simd_intermediate(q0, q1, q2); | ||
| 591 | simd_quatf qb = _simd_intermediate(q1, q2, q3); | ||
| 592 | return _simd_squad(q1, qa, qb, q2, t); | ||
| 593 | } | ||
| 594 | |||
| 595 | static SIMD_NOINLINE simd_quatf simd_bezier(simd_quatf q0, simd_quatf q1, simd_quatf q2, simd_quatf q3, float t) { | ||
| 596 | simd_quatf q01 = _simd_slerp_internal(q0, q1, t); | ||
| 597 | simd_quatf q12 = _simd_slerp_internal(q1, q2, t); | ||
| 598 | simd_quatf q23 = _simd_slerp_internal(q2, q3, t); | ||
| 599 | simd_quatf q012 = _simd_slerp_internal(q01, q12, t); | ||
| 600 | simd_quatf q123 = _simd_slerp_internal(q12, q23, t); | ||
| 601 | return _simd_slerp_internal(q012, q123, t); | ||
| 602 | } | ||
| 603 | |||
| 604 | /* MARK: - C and Objective-C double interfaces */ | ||
| 605 | |||
| 606 | /*! @abstract Constructs a quaternion from four scalar values. | ||
| 607 | * | ||
| 608 | * @param ix The first component of the imaginary (vector) part. | ||
| 609 | * @param iy The second component of the imaginary (vector) part. | ||
| 610 | * @param iz The third component of the imaginary (vector) part. | ||
| 611 | * | ||
| 612 | * @param r The real (scalar) part. */ | ||
| 613 | static inline SIMD_CFUNC simd_quatd simd_quaternion(double ix, double iy, double iz, double r) { | ||
| 614 | return (simd_quatd){ { ix, iy, iz, r } }; | ||
| 615 | } | ||
| 616 | |||
| 617 | /*! @abstract Constructs a quaternion from an array of four scalars. | ||
| 618 | * | ||
| 619 | * @discussion Note that the imaginary part of the quaternion comes from | ||
| 620 | * array elements 0, 1, and 2, and the real part comes from element 3. */ | ||
| 621 | static inline SIMD_NONCONST simd_quatd simd_quaternion(const double xyzr[4]) { | ||
| 622 | return (simd_quatd){ *(const simd_packed_double4 *)xyzr }; | ||
| 623 | } | ||
| 624 | |||
| 625 | /*! @abstract Constructs a quaternion from a four-element vector. | ||
| 626 | * | ||
| 627 | * @discussion Note that the imaginary (vector) part of the quaternion comes | ||
| 628 | * from lanes 0, 1, and 2 of the vector, and the real (scalar) part comes from | ||
| 629 | * lane 3. */ | ||
| 630 | static inline SIMD_CFUNC simd_quatd simd_quaternion(simd_double4 xyzr) { | ||
| 631 | return (simd_quatd){ xyzr }; | ||
| 632 | } | ||
| 633 | |||
| 634 | /*! @abstract Constructs a quaternion that rotates by `angle` radians about | ||
| 635 | * `axis`. */ | ||
| 636 | static inline SIMD_CFUNC simd_quatd simd_quaternion(double angle, simd_double3 axis); | ||
| 637 | |||
| 638 | /*! @abstract Construct a quaternion that rotates from one vector to another. | ||
| 639 | * | ||
| 640 | * @param from A normalized three-element vector. | ||
| 641 | * @param to A normalized three-element vector. | ||
| 642 | * | ||
| 643 | * @discussion The rotation axis is `simd_cross(from, to)`. If `from` and | ||
| 644 | * `to` point in opposite directions (to within machine precision), an | ||
| 645 | * arbitrary rotation axis is chosen, and the angle is pi radians. */ | ||
| 646 | static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double3 from, simd_double3 to); | ||
| 647 | |||
| 648 | /*! @abstract Construct a quaternion from a 3x3 rotation `matrix`. | ||
| 649 | * | ||
| 650 | * @discussion If `matrix` is not orthogonal with determinant 1, the result | ||
| 651 | * is undefined. */ | ||
| 652 | static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double3x3 matrix); | ||
| 653 | |||
| 654 | /*! @abstract Construct a quaternion from a 4x4 rotation `matrix`. | ||
| 655 | * | ||
| 656 | * @discussion The last row and column of the matrix are ignored. This | ||
| 657 | * function is equivalent to calling simd_quaternion with the upper-left 3x3 | ||
| 658 | * submatrix . */ | ||
| 659 | static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double4x4 matrix); | ||
| 660 | |||
| 661 | /*! @abstract The real (scalar) part of the quaternion `q`. */ | ||
| 662 | static inline SIMD_CFUNC double simd_real(simd_quatd q) { | ||
| 663 | return q.vector.w; | ||
| 664 | } | ||
| 665 | |||
| 666 | /*! @abstract The imaginary (vector) part of the quaternion `q`. */ | ||
| 667 | static inline SIMD_CFUNC simd_double3 simd_imag(simd_quatd q) { | ||
| 668 | return q.vector.xyz; | ||
| 669 | } | ||
| 670 | |||
| 671 | /*! @abstract The angle (in radians) of rotation represented by `q`. */ | ||
| 672 | static inline SIMD_CFUNC double simd_angle(simd_quatd q); | ||
| 673 | |||
| 674 | /*! @abstract The normalized axis (a 3-element vector) around which the | ||
| 675 | * action of the quaternion `q` rotates. */ | ||
| 676 | static inline SIMD_CFUNC simd_double3 simd_axis(simd_quatd q); | ||
| 677 | |||
| 678 | /*! @abstract The sum of the quaternions `p` and `q`. */ | ||
| 679 | static inline SIMD_CFUNC simd_quatd simd_add(simd_quatd p, simd_quatd q); | ||
| 680 | |||
| 681 | /*! @abstract The difference of the quaternions `p` and `q`. */ | ||
| 682 | static inline SIMD_CFUNC simd_quatd simd_sub(simd_quatd p, simd_quatd q); | ||
| 683 | |||
| 684 | /*! @abstract The product of the quaternions `p` and `q`. */ | ||
| 685 | static inline SIMD_CFUNC simd_quatd simd_mul(simd_quatd p, simd_quatd q); | ||
| 686 | |||
| 687 | /*! @abstract The quaternion `q` scaled by the real value `a`. */ | ||
| 688 | static inline SIMD_CFUNC simd_quatd simd_mul(simd_quatd q, double a); | ||
| 689 | |||
| 690 | /*! @abstract The quaternion `q` scaled by the real value `a`. */ | ||
| 691 | static inline SIMD_CFUNC simd_quatd simd_mul(double a, simd_quatd q); | ||
| 692 | |||
| 693 | /*! @abstract The conjugate of the quaternion `q`. */ | ||
| 694 | static inline SIMD_CFUNC simd_quatd simd_conjugate(simd_quatd q); | ||
| 695 | |||
| 696 | /*! @abstract The (multiplicative) inverse of the quaternion `q`. */ | ||
| 697 | static inline SIMD_CFUNC simd_quatd simd_inverse(simd_quatd q); | ||
| 698 | |||
| 699 | /*! @abstract The negation (additive inverse) of the quaternion `q`. */ | ||
| 700 | static inline SIMD_CFUNC simd_quatd simd_negate(simd_quatd q); | ||
| 701 | |||
| 702 | /*! @abstract The dot product of the quaternions `p` and `q` interpreted as | ||
| 703 | * four-dimensional vectors. */ | ||
| 704 | static inline SIMD_CFUNC double simd_dot(simd_quatd p, simd_quatd q); | ||
| 705 | |||
| 706 | /*! @abstract The length of the quaternion `q`. */ | ||
| 707 | static inline SIMD_CFUNC double simd_length(simd_quatd q); | ||
| 708 | |||
| 709 | /*! @abstract The unit quaternion obtained by normalizing `q`. */ | ||
| 710 | static inline SIMD_CFUNC simd_quatd simd_normalize(simd_quatd q); | ||
| 711 | |||
| 712 | /*! @abstract Rotates the vector `v` by the quaternion `q`. */ | ||
| 713 | static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v); | ||
| 714 | |||
| 715 | /*! @abstract Logarithm of the quaternion `q`. | ||
| 716 | * @discussion Do not call this function directly; use `log(q)` instead. | ||
| 717 | * | ||
| 718 | * We can write a quaternion `q` in the form: `r(cos(t) + sin(t)v)` where | ||
| 719 | * `r` is the length of `q`, `t` is an angle, and `v` is a unit 3-vector. | ||
| 720 | * The logarithm of `q` is `log(r) + tv`, just like the logarithm of the | ||
| 721 | * complex number `r*(cos(t) + i sin(t))` is `log(r) + it`. | ||
| 722 | * | ||
| 723 | * Note that this function is not robust against poorly-scaled non-unit | ||
| 724 | * quaternions, because it is primarily used for spline interpolation of | ||
| 725 | * unit quaternions. If you need to compute a robust logarithm of general | ||
| 726 | * quaternions, you can use the following approach: | ||
| 727 | * | ||
| 728 | * scale = simd_reduce_max(simd_abs(q.vector)); | ||
| 729 | * logq = log(simd_recip(scale)*q); | ||
| 730 | * logq.real += log(scale); | ||
| 731 | * return logq; */ | ||
| 732 | static SIMD_NOINLINE simd_quatd __tg_log(simd_quatd q); | ||
| 733 | |||
| 734 | /*! @abstract Inverse of `log( )`; the exponential map on quaternions. | ||
| 735 | * @discussion Do not call this function directly; use `exp(q)` instead. */ | ||
| 736 | static SIMD_NOINLINE simd_quatd __tg_exp(simd_quatd q); | ||
| 737 | |||
| 738 | /*! @abstract Spherical linear interpolation along the shortest arc between | ||
| 739 | * quaternions `q0` and `q1`. */ | ||
| 740 | static SIMD_NOINLINE simd_quatd simd_slerp(simd_quatd q0, simd_quatd q1, double t); | ||
| 741 | |||
| 742 | /*! @abstract Spherical linear interpolation along the longest arc between | ||
| 743 | * quaternions `q0` and `q1`. */ | ||
| 744 | static SIMD_NOINLINE simd_quatd simd_slerp_longest(simd_quatd q0, simd_quatd q1, double t); | ||
| 745 | |||
| 746 | /*! @abstract Interpolate between quaternions along a spherical cubic spline. | ||
| 747 | * | ||
| 748 | * @discussion The function interpolates between q1 and q2. q0 is the left | ||
| 749 | * endpoint of the previous interval, and q3 is the right endpoint of the next | ||
| 750 | * interval. Use this function to smoothly interpolate between a sequence of | ||
| 751 | * rotations. */ | ||
| 752 | static SIMD_NOINLINE simd_quatd simd_spline(simd_quatd q0, simd_quatd q1, simd_quatd q2, simd_quatd q3, double t); | ||
| 753 | |||
| 754 | /*! @abstract Spherical cubic Bezier interpolation between quaternions. | ||
| 755 | * | ||
| 756 | * @discussion The function treats q0 ... q3 as control points and uses slerp | ||
| 757 | * in place of lerp in the De Castlejeau algorithm. The endpoints of | ||
| 758 | * interpolation are thus q0 and q3, and the curve will not generally pass | ||
| 759 | * through q1 or q2. Note that the convex hull property of "standard" Bezier | ||
| 760 | * curve does not hold on the sphere. */ | ||
| 761 | static SIMD_NOINLINE simd_quatd simd_bezier(simd_quatd q0, simd_quatd q1, simd_quatd q2, simd_quatd q3, double t); | ||
| 762 | |||
| 763 | #ifdef __cplusplus | ||
| 764 | } /* extern "C" */ | ||
| 765 | /* MARK: - C++ double interfaces */ | ||
| 766 | |||
| 767 | namespace simd { | ||
| 768 | struct quatd : ::simd_quatd { | ||
| 769 | /*! @abstract The identity quaternion. */ | ||
| 770 | quatd( ) : ::simd_quatd(::simd_quaternion((double4){0,0,0,1})) { } | ||
| 771 | |||
| 772 | /*! @abstract Constructs a C++ quaternion from a C quaternion. */ | ||
| 773 | quatd(::simd_quatd q) : ::simd_quatd(q) { } | ||
| 774 | |||
| 775 | /*! @abstract Constructs a quaternion from components. */ | ||
| 776 | quatd(double ix, double iy, double iz, double r) : ::simd_quatd(::simd_quaternion(ix, iy, iz, r)) { } | ||
| 777 | |||
| 778 | /*! @abstract Constructs a quaternion from an array of scalars. */ | ||
| 779 | quatd(const double xyzr[4]) : ::simd_quatd(::simd_quaternion(xyzr)) { } | ||
| 780 | |||
| 781 | /*! @abstract Constructs a quaternion from a vector. */ | ||
| 782 | quatd(double4 xyzr) : ::simd_quatd(::simd_quaternion(xyzr)) { } | ||
| 783 | |||
| 784 | /*! @abstract Quaternion representing rotation about `axis` by `angle` | ||
| 785 | * radians. */ | ||
| 786 | quatd(double angle, double3 axis) : ::simd_quatd(::simd_quaternion(angle, axis)) { } | ||
| 787 | |||
| 788 | /*! @abstract Quaternion that rotates `from` into `to`. */ | ||
| 789 | quatd(double3 from, double3 to) : ::simd_quatd(::simd_quaternion(from, to)) { } | ||
| 790 | |||
| 791 | /*! @abstract Constructs a quaternion from a rotation matrix. */ | ||
| 792 | quatd(::simd_double3x3 matrix) : ::simd_quatd(::simd_quaternion(matrix)) { } | ||
| 793 | |||
| 794 | /*! @abstract Constructs a quaternion from a rotation matrix. */ | ||
| 795 | quatd(::simd_double4x4 matrix) : ::simd_quatd(::simd_quaternion(matrix)) { } | ||
| 796 | |||
| 797 | /*! @abstract The real (scalar) part of the quaternion. */ | ||
| 798 | double real(void) const { return ::simd_real(*this); } | ||
| 799 | |||
| 800 | /*! @abstract The imaginary (vector) part of the quaternion. */ | ||
| 801 | double3 imag(void) const { return ::simd_imag(*this); } | ||
| 802 | |||
| 803 | /*! @abstract The angle the quaternion rotates by. */ | ||
| 804 | double angle(void) const { return ::simd_angle(*this); } | ||
| 805 | |||
| 806 | /*! @abstract The axis the quaternion rotates about. */ | ||
| 807 | double3 axis(void) const { return ::simd_axis(*this); } | ||
| 808 | |||
| 809 | /*! @abstract The length of the quaternion. */ | ||
| 810 | double length(void) const { return ::simd_length(*this); } | ||
| 811 | |||
| 812 | /*! @abstract Act on the vector `v` by rotation. */ | ||
| 813 | double3 operator()(const ::simd_double3 v) const { return ::simd_act(*this, v); } | ||
| 814 | }; | ||
| 815 | |||
| 816 | static SIMD_CPPFUNC quatd operator+(const ::simd_quatd p, const ::simd_quatd q) { return ::simd_add(p, q); } | ||
| 817 | static SIMD_CPPFUNC quatd operator-(const ::simd_quatd p, const ::simd_quatd q) { return ::simd_sub(p, q); } | ||
| 818 | static SIMD_CPPFUNC quatd operator-(const ::simd_quatd p) { return ::simd_negate(p); } | ||
| 819 | static SIMD_CPPFUNC quatd operator*(const double r, const ::simd_quatd p) { return ::simd_mul(r, p); } | ||
| 820 | static SIMD_CPPFUNC quatd operator*(const ::simd_quatd p, const double r) { return ::simd_mul(p, r); } | ||
| 821 | static SIMD_CPPFUNC quatd operator*(const ::simd_quatd p, const ::simd_quatd q) { return ::simd_mul(p, q); } | ||
| 822 | static SIMD_CPPFUNC quatd operator/(const ::simd_quatd p, const ::simd_quatd q) { return ::simd_mul(p, ::simd_inverse(q)); } | ||
| 823 | static SIMD_CPPFUNC quatd operator+=(quatd &p, const ::simd_quatd q) { return p = p+q; } | ||
| 824 | static SIMD_CPPFUNC quatd operator-=(quatd &p, const ::simd_quatd q) { return p = p-q; } | ||
| 825 | static SIMD_CPPFUNC quatd operator*=(quatd &p, const double r) { return p = p*r; } | ||
| 826 | static SIMD_CPPFUNC quatd operator*=(quatd &p, const ::simd_quatd q) { return p = p*q; } | ||
| 827 | static SIMD_CPPFUNC quatd operator/=(quatd &p, const ::simd_quatd q) { return p = p/q; } | ||
| 828 | |||
| 829 | /*! @abstract The conjugate of the quaternion `q`. */ | ||
| 830 | static SIMD_CPPFUNC quatd conjugate(const ::simd_quatd p) { return ::simd_conjugate(p); } | ||
| 831 | |||
| 832 | /*! @abstract The (multiplicative) inverse of the quaternion `q`. */ | ||
| 833 | static SIMD_CPPFUNC quatd inverse(const ::simd_quatd p) { return ::simd_inverse(p); } | ||
| 834 | |||
| 835 | /*! @abstract The dot product of the quaternions `p` and `q` interpreted as | ||
| 836 | * four-dimensional vectors. */ | ||
| 837 | static SIMD_CPPFUNC double dot(const ::simd_quatd p, const ::simd_quatd q) { return ::simd_dot(p, q); } | ||
| 838 | |||
| 839 | /*! @abstract The unit quaternion obtained by normalizing `q`. */ | ||
| 840 | static SIMD_CPPFUNC quatd normalize(const ::simd_quatd p) { return ::simd_normalize(p); } | ||
| 841 | |||
| 842 | /*! @abstract logarithm of the quaternion `q`. */ | ||
| 843 | static SIMD_CPPFUNC quatd log(const ::simd_quatd q) { return ::__tg_log(q); } | ||
| 844 | |||
| 845 | /*! @abstract exponential map of quaterion `q`. */ | ||
| 846 | static SIMD_CPPFUNC quatd exp(const ::simd_quatd q) { return ::__tg_exp(q); } | ||
| 847 | |||
| 848 | /*! @abstract Spherical linear interpolation along the shortest arc between | ||
| 849 | * quaternions `q0` and `q1`. */ | ||
| 850 | static SIMD_CPPFUNC quatd slerp(const ::simd_quatd p0, const ::simd_quatd p1, double t) { return ::simd_slerp(p0, p1, t); } | ||
| 851 | |||
| 852 | /*! @abstract Spherical linear interpolation along the longest arc between | ||
| 853 | * quaternions `q0` and `q1`. */ | ||
| 854 | static SIMD_CPPFUNC quatd slerp_longest(const ::simd_quatd p0, const ::simd_quatd p1, double t) { return ::simd_slerp_longest(p0, p1, t); } | ||
| 855 | |||
| 856 | /*! @abstract Interpolate between quaternions along a spherical cubic spline. | ||
| 857 | * | ||
| 858 | * @discussion The function interpolates between q1 and q2. q0 is the left | ||
| 859 | * endpoint of the previous interval, and q3 is the right endpoint of the next | ||
| 860 | * interval. Use this function to smoothly interpolate between a sequence of | ||
| 861 | * rotations. */ | ||
| 862 | static SIMD_CPPFUNC quatd spline(const ::simd_quatd p0, const ::simd_quatd p1, const ::simd_quatd p2, const ::simd_quatd p3, double t) { return ::simd_spline(p0, p1, p2, p3, t); } | ||
| 863 | |||
| 864 | /*! @abstract Spherical cubic Bezier interpolation between quaternions. | ||
| 865 | * | ||
| 866 | * @discussion The function treats q0 ... q3 as control points and uses slerp | ||
| 867 | * in place of lerp in the De Castlejeau algorithm. The endpoints of | ||
| 868 | * interpolation are thus q0 and q3, and the curve will not generally pass | ||
| 869 | * through q1 or q2. Note that the convex hull property of "standard" Bezier | ||
| 870 | * curve does not hold on the sphere. */ | ||
| 871 | static SIMD_CPPFUNC quatd bezier(const ::simd_quatd p0, const ::simd_quatd p1, const ::simd_quatd p2, const ::simd_quatd p3, double t) { return ::simd_bezier(p0, p1, p2, p3, t); } | ||
| 872 | } | ||
| 873 | |||
| 874 | extern "C" { | ||
| 875 | #endif /* __cplusplus */ | ||
| 876 | |||
| 877 | /* MARK: - double implementations */ | ||
| 878 | |||
| 879 | #include <simd/math.h> | ||
| 880 | #include <simd/geometry.h> | ||
| 881 | |||
| 882 | /* tg_promote is implementation gobbledygook that enables the compile-time | ||
| 883 | * dispatching in tgmath.h to work its magic. */ | ||
| 884 | static simd_quatd __attribute__((__overloadable__)) __tg_promote(simd_quatd); | ||
| 885 | |||
| 886 | /*! @abstract Constructs a quaternion from imaginary and real parts. | ||
| 887 | * @discussion This function is hidden behind an underscore to avoid confusion | ||
| 888 | * with the angle-axis constructor. */ | ||
| 889 | static inline SIMD_CFUNC simd_quatd _simd_quaternion(simd_double3 imag, double real) { | ||
| 890 | return simd_quaternion(simd_make_double4(imag, real)); | ||
| 891 | } | ||
| 892 | |||
| 893 | static inline SIMD_CFUNC simd_quatd simd_quaternion(double angle, simd_double3 axis) { | ||
| 894 | return _simd_quaternion(sin(angle/2) * axis, cos(angle/2)); | ||
| 895 | } | ||
| 896 | |||
| 897 | static inline SIMD_CFUNC double simd_angle(simd_quatd q) { | ||
| 898 | return 2*atan2(simd_length(q.vector.xyz), q.vector.w); | ||
| 899 | } | ||
| 900 | |||
| 901 | static inline SIMD_CFUNC simd_double3 simd_axis(simd_quatd q) { | ||
| 902 | return simd_normalize(q.vector.xyz); | ||
| 903 | } | ||
| 904 | |||
| 905 | static inline SIMD_CFUNC simd_quatd simd_add(simd_quatd p, simd_quatd q) { | ||
| 906 | return simd_quaternion(p.vector + q.vector); | ||
| 907 | } | ||
| 908 | |||
| 909 | static inline SIMD_CFUNC simd_quatd simd_sub(simd_quatd p, simd_quatd q) { | ||
| 910 | return simd_quaternion(p.vector - q.vector); | ||
| 911 | } | ||
| 912 | |||
| 913 | static inline SIMD_CFUNC simd_quatd simd_mul(simd_quatd p, simd_quatd q) { | ||
| 914 | #pragma STDC FP_CONTRACT ON | ||
| 915 | return simd_quaternion((p.vector.x * __builtin_shufflevector(q.vector, -q.vector, 3,6,1,4) + | ||
| 916 | p.vector.y * __builtin_shufflevector(q.vector, -q.vector, 2,3,4,5)) + | ||
| 917 | (p.vector.z * __builtin_shufflevector(q.vector, -q.vector, 5,0,3,6) + | ||
| 918 | p.vector.w * q.vector)); | ||
| 919 | } | ||
| 920 | |||
| 921 | static inline SIMD_CFUNC simd_quatd simd_mul(simd_quatd q, double a) { | ||
| 922 | return simd_quaternion(a * q.vector); | ||
| 923 | } | ||
| 924 | |||
| 925 | static inline SIMD_CFUNC simd_quatd simd_mul(double a, simd_quatd q) { | ||
| 926 | return simd_mul(q,a); | ||
| 927 | } | ||
| 928 | |||
| 929 | static inline SIMD_CFUNC simd_quatd simd_conjugate(simd_quatd q) { | ||
| 930 | return simd_quaternion(q.vector * (simd_double4){-1,-1,-1, 1}); | ||
| 931 | } | ||
| 932 | |||
| 933 | static inline SIMD_CFUNC simd_quatd simd_inverse(simd_quatd q) { | ||
| 934 | return simd_quaternion(simd_conjugate(q).vector * simd_recip(simd_length_squared(q.vector))); | ||
| 935 | } | ||
| 936 | |||
| 937 | static inline SIMD_CFUNC simd_quatd simd_negate(simd_quatd q) { | ||
| 938 | return simd_quaternion(-q.vector); | ||
| 939 | } | ||
| 940 | |||
| 941 | static inline SIMD_CFUNC double simd_dot(simd_quatd p, simd_quatd q) { | ||
| 942 | return simd_dot(p.vector, q.vector); | ||
| 943 | } | ||
| 944 | |||
| 945 | static inline SIMD_CFUNC double simd_length(simd_quatd q) { | ||
| 946 | return simd_length(q.vector); | ||
| 947 | } | ||
| 948 | |||
| 949 | static inline SIMD_CFUNC simd_quatd simd_normalize(simd_quatd q) { | ||
| 950 | double length_squared = simd_length_squared(q.vector); | ||
| 951 | if (length_squared == 0) { | ||
| 952 | return simd_quaternion((simd_double4){0,0,0,1}); | ||
| 953 | } | ||
| 954 | return simd_quaternion(q.vector * simd_rsqrt(length_squared)); | ||
| 955 | } | ||
| 956 | |||
| 957 | #if defined __arm__ || defined __arm64__ | ||
| 958 | /*! @abstract Multiplies the vector `v` by the quaternion `q`. | ||
| 959 | * | ||
| 960 | * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation | ||
| 961 | * by `q`. That operation is provided by `simd_act(q, v)`. This function is an | ||
| 962 | * implementation detail and you should not call it directly. It may be | ||
| 963 | * removed or modified in future versions of the simd module. */ | ||
| 964 | static inline SIMD_CFUNC simd_quatd _simd_mul_vq(simd_double3 v, simd_quatd q) { | ||
| 965 | #pragma STDC FP_CONTRACT ON | ||
| 966 | return simd_quaternion(v.x * __builtin_shufflevector(q.vector, -q.vector, 3,6,1,4) + | ||
| 967 | v.y * __builtin_shufflevector(q.vector, -q.vector, 2,3,4,5) + | ||
| 968 | v.z * __builtin_shufflevector(q.vector, -q.vector, 5,0,3,6)); | ||
| 969 | } | ||
| 970 | #endif | ||
| 971 | |||
| 972 | static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v) { | ||
| 973 | #if defined __arm__ || defined __arm64__ | ||
| 974 | return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz; | ||
| 975 | #else | ||
| 976 | #pragma STDC FP_CONTRACT ON | ||
| 977 | simd_double3 t = 2*simd_cross(simd_imag(q),v); | ||
| 978 | return v + simd_real(q)*t + simd_cross(simd_imag(q), t); | ||
| 979 | #endif | ||
| 980 | } | ||
| 981 | |||
| 982 | static SIMD_NOINLINE simd_quatd __tg_log(simd_quatd q) { | ||
| 983 | double real = __tg_log(simd_length_squared(q.vector))/2; | ||
| 984 | if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real); | ||
| 985 | simd_double3 imag = __tg_acos(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q)); | ||
| 986 | return _simd_quaternion(imag, real); | ||
| 987 | } | ||
| 988 | |||
| 989 | static SIMD_NOINLINE simd_quatd __tg_exp(simd_quatd q) { | ||
| 990 | // angle is actually *twice* the angle of the rotation corresponding to | ||
| 991 | // the resulting quaternion, which is why we don't simply use the (angle, | ||
| 992 | // axis) constructor to generate `unit`. | ||
| 993 | double angle = simd_length(simd_imag(q)); | ||
| 994 | if (angle == 0) return _simd_quaternion(0, exp(simd_real(q))); | ||
| 995 | simd_double3 axis = simd_normalize(simd_imag(q)); | ||
| 996 | simd_quatd unit = _simd_quaternion(sin(angle)*axis, cosf(angle)); | ||
| 997 | return simd_mul(exp(simd_real(q)), unit); | ||
| 998 | } | ||
| 999 | |||
| 1000 | /*! @abstract Implementation detail of the `simd_quaternion(from, to)` | ||
| 1001 | * initializer. | ||
| 1002 | * | ||
| 1003 | * @discussion Computes the quaternion rotation `from` to `to` if they are | ||
| 1004 | * separated by less than 90 degrees. Not numerically stable for larger | ||
| 1005 | * angles. This function is an implementation detail and you should not | ||
| 1006 | * call it directly. It may be removed or modified in future versions of the | ||
| 1007 | * simd module. */ | ||
| 1008 | static inline SIMD_CFUNC simd_quatd _simd_quaternion_reduced(simd_double3 from, simd_double3 to) { | ||
| 1009 | simd_double3 half = simd_normalize(from + to); | ||
| 1010 | return _simd_quaternion(simd_cross(from, half), simd_dot(from, half)); | ||
| 1011 | } | ||
| 1012 | |||
| 1013 | static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double3 from, simd_double3 to) { | ||
| 1014 | |||
| 1015 | // If the angle between from and to is not too big, we can compute the | ||
| 1016 | // rotation accurately using a simple implementation. | ||
| 1017 | if (simd_dot(from, to) >= 0) { | ||
| 1018 | return _simd_quaternion_reduced(from, to); | ||
| 1019 | } | ||
| 1020 | |||
| 1021 | // Because from and to are more than 90 degrees apart, we compute the | ||
| 1022 | // rotation in two stages (from -> half), (half -> to) to preserve numerical | ||
| 1023 | // accuracy. | ||
| 1024 | simd_double3 half = from + to; | ||
| 1025 | |||
| 1026 | if (simd_length_squared(half) == 0) { | ||
| 1027 | // half is nearly zero, so from and to point in nearly opposite directions | ||
| 1028 | // and the rotation is numerically underspecified. Pick an axis orthogonal | ||
| 1029 | // to the vectors, and use an angle of pi radians. | ||
| 1030 | simd_double3 abs_from = simd_abs(from); | ||
| 1031 | if (abs_from.x <= abs_from.y && abs_from.x <= abs_from.z) | ||
| 1032 | return _simd_quaternion(simd_normalize(simd_cross(from, (simd_double3){1,0,0})), 0.f); | ||
| 1033 | else if (abs_from.y <= abs_from.z) | ||
| 1034 | return _simd_quaternion(simd_normalize(simd_cross(from, (simd_double3){0,1,0})), 0.f); | ||
| 1035 | else | ||
| 1036 | return _simd_quaternion(simd_normalize(simd_cross(from, (simd_double3){0,0,1})), 0.f); | ||
| 1037 | } | ||
| 1038 | |||
| 1039 | // Compute the two-step rotation. */ | ||
| 1040 | half = simd_normalize(half); | ||
| 1041 | return simd_mul(_simd_quaternion_reduced(from, half), | ||
| 1042 | _simd_quaternion_reduced(half, to)); | ||
| 1043 | } | ||
| 1044 | |||
| 1045 | static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double3x3 matrix) { | ||
| 1046 | const simd_double3 *mat = matrix.columns; | ||
| 1047 | double trace = mat[0][0] + mat[1][1] + mat[2][2]; | ||
| 1048 | if (trace >= 0.0) { | ||
| 1049 | double r = 2*sqrt(1 + trace); | ||
| 1050 | double rinv = simd_recip(r); | ||
| 1051 | return simd_quaternion(rinv*(mat[1][2] - mat[2][1]), | ||
| 1052 | rinv*(mat[2][0] - mat[0][2]), | ||
| 1053 | rinv*(mat[0][1] - mat[1][0]), | ||
| 1054 | r/4); | ||
| 1055 | } else if (mat[0][0] >= mat[1][1] && mat[0][0] >= mat[2][2]) { | ||
| 1056 | double r = 2*sqrt(1 - mat[1][1] - mat[2][2] + mat[0][0]); | ||
| 1057 | double rinv = simd_recip(r); | ||
| 1058 | return simd_quaternion(r/4, | ||
| 1059 | rinv*(mat[0][1] + mat[1][0]), | ||
| 1060 | rinv*(mat[0][2] + mat[2][0]), | ||
| 1061 | rinv*(mat[1][2] - mat[2][1])); | ||
| 1062 | } else if (mat[1][1] >= mat[2][2]) { | ||
| 1063 | double r = 2*sqrt(1 - mat[0][0] - mat[2][2] + mat[1][1]); | ||
| 1064 | double rinv = simd_recip(r); | ||
| 1065 | return simd_quaternion(rinv*(mat[0][1] + mat[1][0]), | ||
| 1066 | r/4, | ||
| 1067 | rinv*(mat[1][2] + mat[2][1]), | ||
| 1068 | rinv*(mat[2][0] - mat[0][2])); | ||
| 1069 | } else { | ||
| 1070 | double r = 2*sqrt(1 - mat[0][0] - mat[1][1] + mat[2][2]); | ||
| 1071 | double rinv = simd_recip(r); | ||
| 1072 | return simd_quaternion(rinv*(mat[0][2] + mat[2][0]), | ||
| 1073 | rinv*(mat[1][2] + mat[2][1]), | ||
| 1074 | r/4, | ||
| 1075 | rinv*(mat[0][1] - mat[1][0])); | ||
| 1076 | } | ||
| 1077 | } | ||
| 1078 | |||
| 1079 | static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double4x4 matrix) { | ||
| 1080 | const simd_double4 *mat = matrix.columns; | ||
| 1081 | double trace = mat[0][0] + mat[1][1] + mat[2][2]; | ||
| 1082 | if (trace >= 0.0) { | ||
| 1083 | double r = 2*sqrt(1 + trace); | ||
| 1084 | double rinv = simd_recip(r); | ||
| 1085 | return simd_quaternion(rinv*(mat[1][2] - mat[2][1]), | ||
| 1086 | rinv*(mat[2][0] - mat[0][2]), | ||
| 1087 | rinv*(mat[0][1] - mat[1][0]), | ||
| 1088 | r/4); | ||
| 1089 | } else if (mat[0][0] >= mat[1][1] && mat[0][0] >= mat[2][2]) { | ||
| 1090 | double r = 2*sqrt(1 - mat[1][1] - mat[2][2] + mat[0][0]); | ||
| 1091 | double rinv = simd_recip(r); | ||
| 1092 | return simd_quaternion(r/4, | ||
| 1093 | rinv*(mat[0][1] + mat[1][0]), | ||
| 1094 | rinv*(mat[0][2] + mat[2][0]), | ||
| 1095 | rinv*(mat[1][2] - mat[2][1])); | ||
| 1096 | } else if (mat[1][1] >= mat[2][2]) { | ||
| 1097 | double r = 2*sqrt(1 - mat[0][0] - mat[2][2] + mat[1][1]); | ||
| 1098 | double rinv = simd_recip(r); | ||
| 1099 | return simd_quaternion(rinv*(mat[0][1] + mat[1][0]), | ||
| 1100 | r/4, | ||
| 1101 | rinv*(mat[1][2] + mat[2][1]), | ||
| 1102 | rinv*(mat[2][0] - mat[0][2])); | ||
| 1103 | } else { | ||
| 1104 | double r = 2*sqrt(1 - mat[0][0] - mat[1][1] + mat[2][2]); | ||
| 1105 | double rinv = simd_recip(r); | ||
| 1106 | return simd_quaternion(rinv*(mat[0][2] + mat[2][0]), | ||
| 1107 | rinv*(mat[1][2] + mat[2][1]), | ||
| 1108 | r/4, | ||
| 1109 | rinv*(mat[0][1] - mat[1][0])); | ||
| 1110 | } | ||
| 1111 | } | ||
| 1112 | |||
| 1113 | /*! @abstract The angle between p and q interpreted as 4-dimensional vectors. | ||
| 1114 | * | ||
| 1115 | * @discussion This function is an implementation detail and you should not | ||
| 1116 | * call it directly. It may be removed or modified in future versions of the | ||
| 1117 | * simd module. */ | ||
| 1118 | static SIMD_NOINLINE double _simd_angle(simd_quatd p, simd_quatd q) { | ||
| 1119 | return 2*atan2(simd_length(p.vector - q.vector), simd_length(p.vector + q.vector)); | ||
| 1120 | } | ||
| 1121 | |||
| 1122 | /*! @abstract sin(x)/x. | ||
| 1123 | * | ||
| 1124 | * @discussion This function is an implementation detail and you should not | ||
| 1125 | * call it directly. It may be removed or modified in future versions of the | ||
| 1126 | * simd module. */ | ||
| 1127 | static SIMD_CFUNC double _simd_sinc(double x) { | ||
| 1128 | if (x == 0) return 1; | ||
| 1129 | return sin(x)/x; | ||
| 1130 | } | ||
| 1131 | |||
| 1132 | /*! @abstract Spherical lerp between q0 and q1. | ||
| 1133 | * | ||
| 1134 | * @discussion This function may interpolate along either the longer or | ||
| 1135 | * shorter path between q0 and q1; it is used as an implementation detail | ||
| 1136 | * in `simd_slerp` and `simd_slerp_longest`; you should use those functions | ||
| 1137 | * instead of calling this directly. */ | ||
| 1138 | static SIMD_NOINLINE simd_quatd _simd_slerp_internal(simd_quatd q0, simd_quatd q1, double t) { | ||
| 1139 | double s = 1 - t; | ||
| 1140 | double a = _simd_angle(q0, q1); | ||
| 1141 | double r = simd_recip(_simd_sinc(a)); | ||
| 1142 | return simd_normalize(simd_quaternion(_simd_sinc(s*a)*r*s*q0.vector + _simd_sinc(t*a)*r*t*q1.vector)); | ||
| 1143 | } | ||
| 1144 | |||
| 1145 | static SIMD_NOINLINE simd_quatd simd_slerp(simd_quatd q0, simd_quatd q1, double t) { | ||
| 1146 | if (simd_dot(q0, q1) >= 0) | ||
| 1147 | return _simd_slerp_internal(q0, q1, t); | ||
| 1148 | return _simd_slerp_internal(q0, simd_negate(q1), t); | ||
| 1149 | } | ||
| 1150 | |||
| 1151 | static SIMD_NOINLINE simd_quatd simd_slerp_longest(simd_quatd q0, simd_quatd q1, double t) { | ||
| 1152 | if (simd_dot(q0, q1) >= 0) | ||
| 1153 | return _simd_slerp_internal(q0, simd_negate(q1), t); | ||
| 1154 | return _simd_slerp_internal(q0, q1, t); | ||
| 1155 | } | ||
| 1156 | |||
| 1157 | /*! @discussion This function is an implementation detail and you should not | ||
| 1158 | * call it directly. It may be removed or modified in future versions of the | ||
| 1159 | * simd module. */ | ||
| 1160 | static SIMD_NOINLINE simd_quatd _simd_intermediate(simd_quatd q0, simd_quatd q1, simd_quatd q2) { | ||
| 1161 | simd_quatd p0 = __tg_log(simd_mul(q0, simd_inverse(q1))); | ||
| 1162 | simd_quatd p2 = __tg_log(simd_mul(q2, simd_inverse(q1))); | ||
| 1163 | return simd_normalize(simd_mul(q1, __tg_exp(simd_mul(-0.25, simd_add(p0,p2))))); | ||
| 1164 | } | ||
| 1165 | |||
| 1166 | /*! @discussion This function is an implementation detail and you should not | ||
| 1167 | * call it directly. It may be removed or modified in future versions of the | ||
| 1168 | * simd module. */ | ||
| 1169 | static SIMD_NOINLINE simd_quatd _simd_squad(simd_quatd q0, simd_quatd qa, simd_quatd qb, simd_quatd q1, double t) { | ||
| 1170 | simd_quatd r0 = _simd_slerp_internal(q0, q1, t); | ||
| 1171 | simd_quatd r1 = _simd_slerp_internal(qa, qb, t); | ||
| 1172 | return _simd_slerp_internal(r0, r1, 2*t*(1 - t)); | ||
| 1173 | } | ||
| 1174 | |||
| 1175 | static SIMD_NOINLINE simd_quatd simd_spline(simd_quatd q0, simd_quatd q1, simd_quatd q2, simd_quatd q3, double t) { | ||
| 1176 | simd_quatd qa = _simd_intermediate(q0, q1, q2); | ||
| 1177 | simd_quatd qb = _simd_intermediate(q1, q2, q3); | ||
| 1178 | return _simd_squad(q1, qa, qb, q2, t); | ||
| 1179 | } | ||
| 1180 | |||
| 1181 | static SIMD_NOINLINE simd_quatd simd_bezier(simd_quatd q0, simd_quatd q1, simd_quatd q2, simd_quatd q3, double t) { | ||
| 1182 | simd_quatd q01 = _simd_slerp_internal(q0, q1, t); | ||
| 1183 | simd_quatd q12 = _simd_slerp_internal(q1, q2, t); | ||
| 1184 | simd_quatd q23 = _simd_slerp_internal(q2, q3, t); | ||
| 1185 | simd_quatd q012 = _simd_slerp_internal(q01, q12, t); | ||
| 1186 | simd_quatd q123 = _simd_slerp_internal(q12, q23, t); | ||
| 1187 | return _simd_slerp_internal(q012, q123, t); | ||
| 1188 | } | ||
| 1189 | |||
| 1190 | #ifdef __cplusplus | ||
| 1191 | } /* extern "C" */ | ||
| 1192 | #endif /* __cplusplus */ | ||
| 1193 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 1194 | #endif /* SIMD_QUATERNIONS */ | ||
lib/libc/include/x86_64-macos-gnu/simd/simd.h created+21| ... | @@ -0,0 +1,21 @@ | ||
| 1 | /* Copyright (c) 2014 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * This header provides small vector (simd) and matrix types, and basic | ||
| 4 | * arithmetic and mathematical functions for them. The vast majority of these | ||
| 5 | * operations are implemented as header inlines, as they can be performed | ||
| 6 | * using just a few instructions on most processors. | ||
| 7 | * | ||
| 8 | * These functions are broken into two groups; vector and matrix. This header | ||
| 9 | * includes all of them, but these may also be included separately. Consult | ||
| 10 | * these two headers for detailed documentation of what types and operations | ||
| 11 | * are available. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __SIMD_HEADER__ | ||
| 15 | #define __SIMD_HEADER__ | ||
| 16 | |||
| 17 | #include <simd/vector.h> | ||
| 18 | #include <simd/matrix.h> | ||
| 19 | #include <simd/quaternion.h> | ||
| 20 | |||
| 21 | #endif | ||
lib/libc/include/x86_64-macos-gnu/simd/types.h created+128| ... | @@ -0,0 +1,128 @@ | ||
| 1 | /*! @header | ||
| 2 | * @copyright 2015-2016 Apple, Inc. All rights reserved. | ||
| 3 | * @unsorted */ | ||
| 4 | |||
| 5 | #ifndef SIMD_TYPES | ||
| 6 | #define SIMD_TYPES | ||
| 7 | |||
| 8 | #include <simd/vector_types.h> | ||
| 9 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 10 | |||
| 11 | /*! @group Matrices | ||
| 12 | * @discussion | ||
| 13 | * This header defines nine matrix types for each of float and double, which | ||
| 14 | * are intended for use together with the vector types defined in | ||
| 15 | * <simd/vector_types.h>. | ||
| 16 | * | ||
| 17 | * For compatibility with common graphics libraries, these matrices are stored | ||
| 18 | * in column-major order, and implemented as arrays of column vectors. | ||
| 19 | * Column-major storage order may seem a little strange if you aren't used to | ||
| 20 | * it, but for most usage the memory layout of the matrices shouldn't matter | ||
| 21 | * at all; instead you should think of matrices as abstract mathematical | ||
| 22 | * objects that you use to perform arithmetic without worrying about the | ||
| 23 | * details of the underlying representation. | ||
| 24 | * | ||
| 25 | * WARNING: vectors of length three are internally represented as length four | ||
| 26 | * vectors with one element of padding (for alignment purposes). This means | ||
| 27 | * that when a floatNx3 or doubleNx3 is viewed as a vector, it appears to | ||
| 28 | * have 4*N elements instead of the expected 3*N (with one padding element | ||
| 29 | * at the end of each column). The matrix elements are laid out in memory | ||
| 30 | * as follows: | ||
| 31 | * | ||
| 32 | * { 0, 1, 2, x, 3, 4, 5, x, ... } | ||
| 33 | * | ||
| 34 | * (where the scalar indices used above indicate the conceptual column- | ||
| 35 | * major storage order). If you aren't monkeying around with the internal | ||
| 36 | * storage details of matrices, you don't need to worry about this at all. | ||
| 37 | * Consider this yet another good reason to avoid doing so. */ | ||
| 38 | |||
| 39 | /*! @abstract A matrix with 2 rows and 2 columns. */ | ||
| 40 | typedef struct { simd_float2 columns[2]; } simd_float2x2; | ||
| 41 | |||
| 42 | /*! @abstract A matrix with 2 rows and 3 columns. */ | ||
| 43 | typedef struct { simd_float2 columns[3]; } simd_float3x2; | ||
| 44 | |||
| 45 | /*! @abstract A matrix with 2 rows and 4 columns. */ | ||
| 46 | typedef struct { simd_float2 columns[4]; } simd_float4x2; | ||
| 47 | |||
| 48 | /*! @abstract A matrix with 3 rows and 2 columns. */ | ||
| 49 | typedef struct { simd_float3 columns[2]; } simd_float2x3; | ||
| 50 | |||
| 51 | /*! @abstract A matrix with 3 rows and 3 columns. */ | ||
| 52 | typedef struct { simd_float3 columns[3]; } simd_float3x3; | ||
| 53 | |||
| 54 | /*! @abstract A matrix with 3 rows and 4 columns. */ | ||
| 55 | typedef struct { simd_float3 columns[4]; } simd_float4x3; | ||
| 56 | |||
| 57 | /*! @abstract A matrix with 4 rows and 2 columns. */ | ||
| 58 | typedef struct { simd_float4 columns[2]; } simd_float2x4; | ||
| 59 | |||
| 60 | /*! @abstract A matrix with 4 rows and 3 columns. */ | ||
| 61 | typedef struct { simd_float4 columns[3]; } simd_float3x4; | ||
| 62 | |||
| 63 | /*! @abstract A matrix with 4 rows and 4 columns. */ | ||
| 64 | typedef struct { simd_float4 columns[4]; } simd_float4x4; | ||
| 65 | |||
| 66 | /*! @abstract A matrix with 2 rows and 2 columns. */ | ||
| 67 | typedef struct { simd_double2 columns[2]; } simd_double2x2; | ||
| 68 | |||
| 69 | /*! @abstract A matrix with 2 rows and 3 columns. */ | ||
| 70 | typedef struct { simd_double2 columns[3]; } simd_double3x2; | ||
| 71 | |||
| 72 | /*! @abstract A matrix with 2 rows and 4 columns. */ | ||
| 73 | typedef struct { simd_double2 columns[4]; } simd_double4x2; | ||
| 74 | |||
| 75 | /*! @abstract A matrix with 3 rows and 2 columns. */ | ||
| 76 | typedef struct { simd_double3 columns[2]; } simd_double2x3; | ||
| 77 | |||
| 78 | /*! @abstract A matrix with 3 rows and 3 columns. */ | ||
| 79 | typedef struct { simd_double3 columns[3]; } simd_double3x3; | ||
| 80 | |||
| 81 | /*! @abstract A matrix with 3 rows and 4 columns. */ | ||
| 82 | typedef struct { simd_double3 columns[4]; } simd_double4x3; | ||
| 83 | |||
| 84 | /*! @abstract A matrix with 4 rows and 2 columns. */ | ||
| 85 | typedef struct { simd_double4 columns[2]; } simd_double2x4; | ||
| 86 | |||
| 87 | /*! @abstract A matrix with 4 rows and 3 columns. */ | ||
| 88 | typedef struct { simd_double4 columns[3]; } simd_double3x4; | ||
| 89 | |||
| 90 | /*! @abstract A matrix with 4 rows and 4 columns. */ | ||
| 91 | typedef struct { simd_double4 columns[4]; } simd_double4x4; | ||
| 92 | |||
| 93 | |||
| 94 | /*! @group Quaternions | ||
| 95 | * @discussion Unlike vectors, quaternions are not raw clang extended-vector | ||
| 96 | * types, because if they were you'd be able to intermix them with vectors | ||
| 97 | * in arithmetic operations freely, but the arithmetic would not do what you | ||
| 98 | * want it to do (it would simply perform the arithmetic operation | ||
| 99 | * componentwise on the quaternion and vector). | ||
| 100 | * | ||
| 101 | * Quaternions aren't unions in C/Obj-C, because then the C++ types couldn't | ||
| 102 | * inherit from the C types, which would make intermixing rather painful (you | ||
| 103 | * can't inherit from a union). This means that we can't provide nice member | ||
| 104 | * access like .real and .imag; you need to use functions to access the pieces | ||
| 105 | * of a quaternion instead. | ||
| 106 | * | ||
| 107 | * This also means that you need to use functions instead of operators to do | ||
| 108 | * arithmetic with quaternions in C and Obj-C. In C++, we are able to provide | ||
| 109 | * operator overloads for arithmetic. | ||
| 110 | * | ||
| 111 | * Internally, a quaternion is represented as a vector of four elements. The | ||
| 112 | * first three elements are the "imaginary" (or "vector") part of the | ||
| 113 | * quaternion, and the last element is the "real" (or "scalar") part. As with | ||
| 114 | * everything simd, you will generally get better performance if you avoid | ||
| 115 | * using the internal storage details of the type, and instead treat these | ||
| 116 | * quaternions as abstract mathematical objects once they are created. | ||
| 117 | * | ||
| 118 | * While the C types are defined here, the operations on quaternions and the | ||
| 119 | * C++ quaternion types are defined in <simd/quaternion.h> */ | ||
| 120 | |||
| 121 | /*! @abstract A single-precision quaternion. */ | ||
| 122 | typedef struct { simd_float4 vector; } simd_quatf; | ||
| 123 | |||
| 124 | /*! @abstract A double-precision quaternion. */ | ||
| 125 | typedef struct { simd_double4 vector; } simd_quatd; | ||
| 126 | |||
| 127 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 128 | #endif /* SIMD_TYPES */ | ||
lib/libc/include/x86_64-macos-gnu/simd/vector.h created+52| ... | @@ -0,0 +1,52 @@ | ||
| 1 | /* Copyright (c) 2014 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * This header provides small vector (simd) types and basic arithmetic and | ||
| 4 | * math functions that operate on them. | ||
| 5 | * | ||
| 6 | * A wide assortment of vector types are provided in <simd/vector_types.h>, | ||
| 7 | * which is included by this header. The most important (as far as the rest | ||
| 8 | * of this library is concerned) are vector_floatN (where N is 2, 3, 4, 8, or | ||
| 9 | * 16), and vector_doubleN (where N is 2, 3, 4, or 8). | ||
| 10 | * | ||
| 11 | * All of the vector types are based on what clang call "OpenCL vectors", | ||
| 12 | * defined with the __ext_vector_type__ attribute. Many C operators "just | ||
| 13 | * work" with these types, so it is not necessary to make function calls | ||
| 14 | * to do basic arithmetic: | ||
| 15 | * | ||
| 16 | * simd_float4 x, y; | ||
| 17 | * x = x + y; // vector sum of x and y. | ||
| 18 | * | ||
| 19 | * scalar values are implicitly promoted to vectors (with a "splat"), so it | ||
| 20 | * is possible to easily write expressions involving scalars as well: | ||
| 21 | * | ||
| 22 | * simd_float4 x; | ||
| 23 | * x = 2*x; // scale x by 2. | ||
| 24 | * | ||
| 25 | * Besides the basic operations provided by the compiler, this header provides | ||
| 26 | * a set of mathematical and geometric primitives for use with these types. | ||
| 27 | * In C and Objective-C, these functions are prefixed with vector_; in C++, | ||
| 28 | * unprefixed names are available within the simd:: namespace. | ||
| 29 | * | ||
| 30 | * simd_float3 x, y; | ||
| 31 | * vector_max(x,y) // elementwise maximum of x and y | ||
| 32 | * fabs(x) // same as vector_abs(x) | ||
| 33 | * vector_clamp(x,0,1) // x clamped to the range [0,1]. This has no | ||
| 34 | * // standard-library analogue, so there is no | ||
| 35 | * // alternate name. | ||
| 36 | * | ||
| 37 | * Matrix and matrix-vector operations are also available in <simd/matrix.h>. | ||
| 38 | */ | ||
| 39 | |||
| 40 | #ifndef __SIMD_VECTOR_HEADER__ | ||
| 41 | #define __SIMD_VECTOR_HEADER__ | ||
| 42 | |||
| 43 | #include <simd/vector_types.h> | ||
| 44 | #include <simd/packed.h> | ||
| 45 | #include <simd/vector_make.h> | ||
| 46 | #include <simd/logic.h> | ||
| 47 | #include <simd/math.h> | ||
| 48 | #include <simd/common.h> | ||
| 49 | #include <simd/geometry.h> | ||
| 50 | #include <simd/conversion.h> | ||
| 51 | |||
| 52 | #endif | ||
lib/libc/include/x86_64-macos-gnu/simd/vector_make.h created+6768| ... | @@ -0,0 +1,6768 @@ | ||
| 1 | /*! @header | ||
| 2 | * This header defines functions for constructing, extending, and truncating | ||
| 3 | * simd vector types. | ||
| 4 | * | ||
| 5 | * For each vector type `simd_typeN` supported by <simd/simd.h>, the following | ||
| 6 | * constructors are provided: | ||
| 7 | * | ||
| 8 | * ~~~ | ||
| 9 | * simd_typeN simd_make_typeN(type other); | ||
| 10 | * simd_typeN simd_make_typeN(simd_typeM other); | ||
| 11 | * ~~~ | ||
| 12 | * For the scalar-input version, or if M < N, these functions zero-extend | ||
| 13 | * `other` to produce a wider vector. If M == N, `other` is passed through | ||
| 14 | * unmodified. If `M > N`, `other` is truncated to form the result. | ||
| 15 | * | ||
| 16 | * ~~~ | ||
| 17 | * simd_typeN simd_make_typeN_undef(type other); | ||
| 18 | * simd_typeN simd_make_typeN_undef(simd_typeM other); | ||
| 19 | * ~~~ | ||
| 20 | * These functions are only available for M < N and for scalar inputs. They | ||
| 21 | * extend `other` to produce a wider vector where the contents of the newly- | ||
| 22 | * formed lanes are undefined. | ||
| 23 | * | ||
| 24 | * In addition, if N is 2, 3, or 4, the following constructors are available: | ||
| 25 | * ~~~ | ||
| 26 | * simd_make_typeN(parts ...) | ||
| 27 | * ~~~ | ||
| 28 | * where parts is a list of scalars and smaller vectors such that the sum of | ||
| 29 | * the number of lanes in the arguments is equal to N. For example, a | ||
| 30 | * `simd_float3` can be constructed from three `floats`, or a `float` and a | ||
| 31 | * `simd_float2` in any order: | ||
| 32 | * ~~~ | ||
| 33 | * simd_float2 ab = { 1, 2 }; | ||
| 34 | * simd_float3 vector = simd_make_float3(ab, 3); | ||
| 35 | * ~~~ | ||
| 36 | * | ||
| 37 | * @copyright 2014-2016 Apple, Inc. All rights reserved. | ||
| 38 | * @unsorted */ | ||
| 39 | |||
| 40 | #ifndef SIMD_VECTOR_CONSTRUCTORS | ||
| 41 | #define SIMD_VECTOR_CONSTRUCTORS | ||
| 42 | |||
| 43 | #include <simd/vector_types.h> | ||
| 44 | #if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 45 | |||
| 46 | #ifdef __cplusplus | ||
| 47 | extern "C" { | ||
| 48 | #endif | ||
| 49 | |||
| 50 | /*! @abstract Concatenates `x` and `y` to form a vector of two 8-bit signed | ||
| 51 | * (twos-complement) integers. */ | ||
| 52 | static inline SIMD_CFUNC simd_char2 simd_make_char2(char x, char y) { | ||
| 53 | simd_char2 result; | ||
| 54 | result.x = x; | ||
| 55 | result.y = y; | ||
| 56 | return result; | ||
| 57 | } | ||
| 58 | |||
| 59 | /*! @abstract Zero-extends `other` to form a vector of two 8-bit signed | ||
| 60 | * (twos-complement) integers. */ | ||
| 61 | static inline SIMD_CFUNC simd_char2 simd_make_char2(char other) { | ||
| 62 | simd_char2 result = 0; | ||
| 63 | result.x = other; | ||
| 64 | return result; | ||
| 65 | } | ||
| 66 | |||
| 67 | /*! @abstract Extends `other` to form a vector of two 8-bit signed (twos- | ||
| 68 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 69 | * unspecified. */ | ||
| 70 | static inline SIMD_CFUNC simd_char2 simd_make_char2_undef(char other) { | ||
| 71 | simd_char2 result; | ||
| 72 | result.x = other; | ||
| 73 | return result; | ||
| 74 | } | ||
| 75 | |||
| 76 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 77 | * templated and autogenerated code. */ | ||
| 78 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char2 other) { | ||
| 79 | return other; | ||
| 80 | } | ||
| 81 | |||
| 82 | /*! @abstract Truncates `other` to form a vector of two 8-bit signed (twos- | ||
| 83 | * complement) integers. */ | ||
| 84 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char3 other) { | ||
| 85 | return other.xy; | ||
| 86 | } | ||
| 87 | |||
| 88 | /*! @abstract Truncates `other` to form a vector of two 8-bit signed (twos- | ||
| 89 | * complement) integers. */ | ||
| 90 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char4 other) { | ||
| 91 | return other.xy; | ||
| 92 | } | ||
| 93 | |||
| 94 | /*! @abstract Truncates `other` to form a vector of two 8-bit signed (twos- | ||
| 95 | * complement) integers. */ | ||
| 96 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char8 other) { | ||
| 97 | return other.xy; | ||
| 98 | } | ||
| 99 | |||
| 100 | /*! @abstract Truncates `other` to form a vector of two 8-bit signed (twos- | ||
| 101 | * complement) integers. */ | ||
| 102 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char16 other) { | ||
| 103 | return other.xy; | ||
| 104 | } | ||
| 105 | |||
| 106 | /*! @abstract Truncates `other` to form a vector of two 8-bit signed (twos- | ||
| 107 | * complement) integers. */ | ||
| 108 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char32 other) { | ||
| 109 | return other.xy; | ||
| 110 | } | ||
| 111 | |||
| 112 | /*! @abstract Truncates `other` to form a vector of two 8-bit signed (twos- | ||
| 113 | * complement) integers. */ | ||
| 114 | static inline SIMD_CFUNC simd_char2 simd_make_char2(simd_char64 other) { | ||
| 115 | return other.xy; | ||
| 116 | } | ||
| 117 | |||
| 118 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 8-bit | ||
| 119 | * signed (twos-complement) integers. */ | ||
| 120 | static inline SIMD_CFUNC simd_char3 simd_make_char3(char x, char y, char z) { | ||
| 121 | simd_char3 result; | ||
| 122 | result.x = x; | ||
| 123 | result.y = y; | ||
| 124 | result.z = z; | ||
| 125 | return result; | ||
| 126 | } | ||
| 127 | |||
| 128 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 8-bit | ||
| 129 | * signed (twos-complement) integers. */ | ||
| 130 | static inline SIMD_CFUNC simd_char3 simd_make_char3(char x, simd_char2 yz) { | ||
| 131 | simd_char3 result; | ||
| 132 | result.x = x; | ||
| 133 | result.yz = yz; | ||
| 134 | return result; | ||
| 135 | } | ||
| 136 | |||
| 137 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 8-bit | ||
| 138 | * signed (twos-complement) integers. */ | ||
| 139 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char2 xy, char z) { | ||
| 140 | simd_char3 result; | ||
| 141 | result.xy = xy; | ||
| 142 | result.z = z; | ||
| 143 | return result; | ||
| 144 | } | ||
| 145 | |||
| 146 | /*! @abstract Zero-extends `other` to form a vector of three 8-bit signed | ||
| 147 | * (twos-complement) integers. */ | ||
| 148 | static inline SIMD_CFUNC simd_char3 simd_make_char3(char other) { | ||
| 149 | simd_char3 result = 0; | ||
| 150 | result.x = other; | ||
| 151 | return result; | ||
| 152 | } | ||
| 153 | |||
| 154 | /*! @abstract Extends `other` to form a vector of three 8-bit signed (twos- | ||
| 155 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 156 | * unspecified. */ | ||
| 157 | static inline SIMD_CFUNC simd_char3 simd_make_char3_undef(char other) { | ||
| 158 | simd_char3 result; | ||
| 159 | result.x = other; | ||
| 160 | return result; | ||
| 161 | } | ||
| 162 | |||
| 163 | /*! @abstract Zero-extends `other` to form a vector of three 8-bit signed | ||
| 164 | * (twos-complement) integers. */ | ||
| 165 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char2 other) { | ||
| 166 | simd_char3 result = 0; | ||
| 167 | result.xy = other; | ||
| 168 | return result; | ||
| 169 | } | ||
| 170 | |||
| 171 | /*! @abstract Extends `other` to form a vector of three 8-bit signed (twos- | ||
| 172 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 173 | * unspecified. */ | ||
| 174 | static inline SIMD_CFUNC simd_char3 simd_make_char3_undef(simd_char2 other) { | ||
| 175 | simd_char3 result; | ||
| 176 | result.xy = other; | ||
| 177 | return result; | ||
| 178 | } | ||
| 179 | |||
| 180 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 181 | * templated and autogenerated code. */ | ||
| 182 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char3 other) { | ||
| 183 | return other; | ||
| 184 | } | ||
| 185 | |||
| 186 | /*! @abstract Truncates `other` to form a vector of three 8-bit signed | ||
| 187 | * (twos-complement) integers. */ | ||
| 188 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char4 other) { | ||
| 189 | return other.xyz; | ||
| 190 | } | ||
| 191 | |||
| 192 | /*! @abstract Truncates `other` to form a vector of three 8-bit signed | ||
| 193 | * (twos-complement) integers. */ | ||
| 194 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char8 other) { | ||
| 195 | return other.xyz; | ||
| 196 | } | ||
| 197 | |||
| 198 | /*! @abstract Truncates `other` to form a vector of three 8-bit signed | ||
| 199 | * (twos-complement) integers. */ | ||
| 200 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char16 other) { | ||
| 201 | return other.xyz; | ||
| 202 | } | ||
| 203 | |||
| 204 | /*! @abstract Truncates `other` to form a vector of three 8-bit signed | ||
| 205 | * (twos-complement) integers. */ | ||
| 206 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char32 other) { | ||
| 207 | return other.xyz; | ||
| 208 | } | ||
| 209 | |||
| 210 | /*! @abstract Truncates `other` to form a vector of three 8-bit signed | ||
| 211 | * (twos-complement) integers. */ | ||
| 212 | static inline SIMD_CFUNC simd_char3 simd_make_char3(simd_char64 other) { | ||
| 213 | return other.xyz; | ||
| 214 | } | ||
| 215 | |||
| 216 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 217 | * 8-bit signed (twos-complement) integers. */ | ||
| 218 | static inline SIMD_CFUNC simd_char4 simd_make_char4(char x, char y, char z, char w) { | ||
| 219 | simd_char4 result; | ||
| 220 | result.x = x; | ||
| 221 | result.y = y; | ||
| 222 | result.z = z; | ||
| 223 | result.w = w; | ||
| 224 | return result; | ||
| 225 | } | ||
| 226 | |||
| 227 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 8-bit | ||
| 228 | * signed (twos-complement) integers. */ | ||
| 229 | static inline SIMD_CFUNC simd_char4 simd_make_char4(char x, char y, simd_char2 zw) { | ||
| 230 | simd_char4 result; | ||
| 231 | result.x = x; | ||
| 232 | result.y = y; | ||
| 233 | result.zw = zw; | ||
| 234 | return result; | ||
| 235 | } | ||
| 236 | |||
| 237 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 8-bit | ||
| 238 | * signed (twos-complement) integers. */ | ||
| 239 | static inline SIMD_CFUNC simd_char4 simd_make_char4(char x, simd_char2 yz, char w) { | ||
| 240 | simd_char4 result; | ||
| 241 | result.x = x; | ||
| 242 | result.yz = yz; | ||
| 243 | result.w = w; | ||
| 244 | return result; | ||
| 245 | } | ||
| 246 | |||
| 247 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 8-bit | ||
| 248 | * signed (twos-complement) integers. */ | ||
| 249 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char2 xy, char z, char w) { | ||
| 250 | simd_char4 result; | ||
| 251 | result.xy = xy; | ||
| 252 | result.z = z; | ||
| 253 | result.w = w; | ||
| 254 | return result; | ||
| 255 | } | ||
| 256 | |||
| 257 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 8-bit | ||
| 258 | * signed (twos-complement) integers. */ | ||
| 259 | static inline SIMD_CFUNC simd_char4 simd_make_char4(char x, simd_char3 yzw) { | ||
| 260 | simd_char4 result; | ||
| 261 | result.x = x; | ||
| 262 | result.yzw = yzw; | ||
| 263 | return result; | ||
| 264 | } | ||
| 265 | |||
| 266 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 8-bit | ||
| 267 | * signed (twos-complement) integers. */ | ||
| 268 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char2 xy, simd_char2 zw) { | ||
| 269 | simd_char4 result; | ||
| 270 | result.xy = xy; | ||
| 271 | result.zw = zw; | ||
| 272 | return result; | ||
| 273 | } | ||
| 274 | |||
| 275 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 8-bit | ||
| 276 | * signed (twos-complement) integers. */ | ||
| 277 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char3 xyz, char w) { | ||
| 278 | simd_char4 result; | ||
| 279 | result.xyz = xyz; | ||
| 280 | result.w = w; | ||
| 281 | return result; | ||
| 282 | } | ||
| 283 | |||
| 284 | /*! @abstract Zero-extends `other` to form a vector of four 8-bit signed | ||
| 285 | * (twos-complement) integers. */ | ||
| 286 | static inline SIMD_CFUNC simd_char4 simd_make_char4(char other) { | ||
| 287 | simd_char4 result = 0; | ||
| 288 | result.x = other; | ||
| 289 | return result; | ||
| 290 | } | ||
| 291 | |||
| 292 | /*! @abstract Extends `other` to form a vector of four 8-bit signed (twos- | ||
| 293 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 294 | * unspecified. */ | ||
| 295 | static inline SIMD_CFUNC simd_char4 simd_make_char4_undef(char other) { | ||
| 296 | simd_char4 result; | ||
| 297 | result.x = other; | ||
| 298 | return result; | ||
| 299 | } | ||
| 300 | |||
| 301 | /*! @abstract Zero-extends `other` to form a vector of four 8-bit signed | ||
| 302 | * (twos-complement) integers. */ | ||
| 303 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char2 other) { | ||
| 304 | simd_char4 result = 0; | ||
| 305 | result.xy = other; | ||
| 306 | return result; | ||
| 307 | } | ||
| 308 | |||
| 309 | /*! @abstract Extends `other` to form a vector of four 8-bit signed (twos- | ||
| 310 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 311 | * unspecified. */ | ||
| 312 | static inline SIMD_CFUNC simd_char4 simd_make_char4_undef(simd_char2 other) { | ||
| 313 | simd_char4 result; | ||
| 314 | result.xy = other; | ||
| 315 | return result; | ||
| 316 | } | ||
| 317 | |||
| 318 | /*! @abstract Zero-extends `other` to form a vector of four 8-bit signed | ||
| 319 | * (twos-complement) integers. */ | ||
| 320 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char3 other) { | ||
| 321 | simd_char4 result = 0; | ||
| 322 | result.xyz = other; | ||
| 323 | return result; | ||
| 324 | } | ||
| 325 | |||
| 326 | /*! @abstract Extends `other` to form a vector of four 8-bit signed (twos- | ||
| 327 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 328 | * unspecified. */ | ||
| 329 | static inline SIMD_CFUNC simd_char4 simd_make_char4_undef(simd_char3 other) { | ||
| 330 | simd_char4 result; | ||
| 331 | result.xyz = other; | ||
| 332 | return result; | ||
| 333 | } | ||
| 334 | |||
| 335 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 336 | * templated and autogenerated code. */ | ||
| 337 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char4 other) { | ||
| 338 | return other; | ||
| 339 | } | ||
| 340 | |||
| 341 | /*! @abstract Truncates `other` to form a vector of four 8-bit signed (twos- | ||
| 342 | * complement) integers. */ | ||
| 343 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char8 other) { | ||
| 344 | return other.xyzw; | ||
| 345 | } | ||
| 346 | |||
| 347 | /*! @abstract Truncates `other` to form a vector of four 8-bit signed (twos- | ||
| 348 | * complement) integers. */ | ||
| 349 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char16 other) { | ||
| 350 | return other.xyzw; | ||
| 351 | } | ||
| 352 | |||
| 353 | /*! @abstract Truncates `other` to form a vector of four 8-bit signed (twos- | ||
| 354 | * complement) integers. */ | ||
| 355 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char32 other) { | ||
| 356 | return other.xyzw; | ||
| 357 | } | ||
| 358 | |||
| 359 | /*! @abstract Truncates `other` to form a vector of four 8-bit signed (twos- | ||
| 360 | * complement) integers. */ | ||
| 361 | static inline SIMD_CFUNC simd_char4 simd_make_char4(simd_char64 other) { | ||
| 362 | return other.xyzw; | ||
| 363 | } | ||
| 364 | |||
| 365 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 8-bit | ||
| 366 | * signed (twos-complement) integers. */ | ||
| 367 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char4 lo, simd_char4 hi) { | ||
| 368 | simd_char8 result; | ||
| 369 | result.lo = lo; | ||
| 370 | result.hi = hi; | ||
| 371 | return result; | ||
| 372 | } | ||
| 373 | |||
| 374 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit signed | ||
| 375 | * (twos-complement) integers. */ | ||
| 376 | static inline SIMD_CFUNC simd_char8 simd_make_char8(char other) { | ||
| 377 | simd_char8 result = 0; | ||
| 378 | result.x = other; | ||
| 379 | return result; | ||
| 380 | } | ||
| 381 | |||
| 382 | /*! @abstract Extends `other` to form a vector of eight 8-bit signed (twos- | ||
| 383 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 384 | * unspecified. */ | ||
| 385 | static inline SIMD_CFUNC simd_char8 simd_make_char8_undef(char other) { | ||
| 386 | simd_char8 result; | ||
| 387 | result.x = other; | ||
| 388 | return result; | ||
| 389 | } | ||
| 390 | |||
| 391 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit signed | ||
| 392 | * (twos-complement) integers. */ | ||
| 393 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char2 other) { | ||
| 394 | simd_char8 result = 0; | ||
| 395 | result.xy = other; | ||
| 396 | return result; | ||
| 397 | } | ||
| 398 | |||
| 399 | /*! @abstract Extends `other` to form a vector of eight 8-bit signed (twos- | ||
| 400 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 401 | * unspecified. */ | ||
| 402 | static inline SIMD_CFUNC simd_char8 simd_make_char8_undef(simd_char2 other) { | ||
| 403 | simd_char8 result; | ||
| 404 | result.xy = other; | ||
| 405 | return result; | ||
| 406 | } | ||
| 407 | |||
| 408 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit signed | ||
| 409 | * (twos-complement) integers. */ | ||
| 410 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char3 other) { | ||
| 411 | simd_char8 result = 0; | ||
| 412 | result.xyz = other; | ||
| 413 | return result; | ||
| 414 | } | ||
| 415 | |||
| 416 | /*! @abstract Extends `other` to form a vector of eight 8-bit signed (twos- | ||
| 417 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 418 | * unspecified. */ | ||
| 419 | static inline SIMD_CFUNC simd_char8 simd_make_char8_undef(simd_char3 other) { | ||
| 420 | simd_char8 result; | ||
| 421 | result.xyz = other; | ||
| 422 | return result; | ||
| 423 | } | ||
| 424 | |||
| 425 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit signed | ||
| 426 | * (twos-complement) integers. */ | ||
| 427 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char4 other) { | ||
| 428 | simd_char8 result = 0; | ||
| 429 | result.xyzw = other; | ||
| 430 | return result; | ||
| 431 | } | ||
| 432 | |||
| 433 | /*! @abstract Extends `other` to form a vector of eight 8-bit signed (twos- | ||
| 434 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 435 | * unspecified. */ | ||
| 436 | static inline SIMD_CFUNC simd_char8 simd_make_char8_undef(simd_char4 other) { | ||
| 437 | simd_char8 result; | ||
| 438 | result.xyzw = other; | ||
| 439 | return result; | ||
| 440 | } | ||
| 441 | |||
| 442 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 443 | * templated and autogenerated code. */ | ||
| 444 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char8 other) { | ||
| 445 | return other; | ||
| 446 | } | ||
| 447 | |||
| 448 | /*! @abstract Truncates `other` to form a vector of eight 8-bit signed | ||
| 449 | * (twos-complement) integers. */ | ||
| 450 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char16 other) { | ||
| 451 | return simd_make_char8(other.lo); | ||
| 452 | } | ||
| 453 | |||
| 454 | /*! @abstract Truncates `other` to form a vector of eight 8-bit signed | ||
| 455 | * (twos-complement) integers. */ | ||
| 456 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char32 other) { | ||
| 457 | return simd_make_char8(other.lo); | ||
| 458 | } | ||
| 459 | |||
| 460 | /*! @abstract Truncates `other` to form a vector of eight 8-bit signed | ||
| 461 | * (twos-complement) integers. */ | ||
| 462 | static inline SIMD_CFUNC simd_char8 simd_make_char8(simd_char64 other) { | ||
| 463 | return simd_make_char8(other.lo); | ||
| 464 | } | ||
| 465 | |||
| 466 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 8-bit | ||
| 467 | * signed (twos-complement) integers. */ | ||
| 468 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char8 lo, simd_char8 hi) { | ||
| 469 | simd_char16 result; | ||
| 470 | result.lo = lo; | ||
| 471 | result.hi = hi; | ||
| 472 | return result; | ||
| 473 | } | ||
| 474 | |||
| 475 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit signed | ||
| 476 | * (twos-complement) integers. */ | ||
| 477 | static inline SIMD_CFUNC simd_char16 simd_make_char16(char other) { | ||
| 478 | simd_char16 result = 0; | ||
| 479 | result.x = other; | ||
| 480 | return result; | ||
| 481 | } | ||
| 482 | |||
| 483 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit signed | ||
| 484 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 485 | * lanes are unspecified. */ | ||
| 486 | static inline SIMD_CFUNC simd_char16 simd_make_char16_undef(char other) { | ||
| 487 | simd_char16 result; | ||
| 488 | result.x = other; | ||
| 489 | return result; | ||
| 490 | } | ||
| 491 | |||
| 492 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit signed | ||
| 493 | * (twos-complement) integers. */ | ||
| 494 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char2 other) { | ||
| 495 | simd_char16 result = 0; | ||
| 496 | result.xy = other; | ||
| 497 | return result; | ||
| 498 | } | ||
| 499 | |||
| 500 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit signed | ||
| 501 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 502 | * lanes are unspecified. */ | ||
| 503 | static inline SIMD_CFUNC simd_char16 simd_make_char16_undef(simd_char2 other) { | ||
| 504 | simd_char16 result; | ||
| 505 | result.xy = other; | ||
| 506 | return result; | ||
| 507 | } | ||
| 508 | |||
| 509 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit signed | ||
| 510 | * (twos-complement) integers. */ | ||
| 511 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char3 other) { | ||
| 512 | simd_char16 result = 0; | ||
| 513 | result.xyz = other; | ||
| 514 | return result; | ||
| 515 | } | ||
| 516 | |||
| 517 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit signed | ||
| 518 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 519 | * lanes are unspecified. */ | ||
| 520 | static inline SIMD_CFUNC simd_char16 simd_make_char16_undef(simd_char3 other) { | ||
| 521 | simd_char16 result; | ||
| 522 | result.xyz = other; | ||
| 523 | return result; | ||
| 524 | } | ||
| 525 | |||
| 526 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit signed | ||
| 527 | * (twos-complement) integers. */ | ||
| 528 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char4 other) { | ||
| 529 | simd_char16 result = 0; | ||
| 530 | result.xyzw = other; | ||
| 531 | return result; | ||
| 532 | } | ||
| 533 | |||
| 534 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit signed | ||
| 535 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 536 | * lanes are unspecified. */ | ||
| 537 | static inline SIMD_CFUNC simd_char16 simd_make_char16_undef(simd_char4 other) { | ||
| 538 | simd_char16 result; | ||
| 539 | result.xyzw = other; | ||
| 540 | return result; | ||
| 541 | } | ||
| 542 | |||
| 543 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit signed | ||
| 544 | * (twos-complement) integers. */ | ||
| 545 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char8 other) { | ||
| 546 | simd_char16 result = 0; | ||
| 547 | result.lo = simd_make_char8(other); | ||
| 548 | return result; | ||
| 549 | } | ||
| 550 | |||
| 551 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit signed | ||
| 552 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 553 | * lanes are unspecified. */ | ||
| 554 | static inline SIMD_CFUNC simd_char16 simd_make_char16_undef(simd_char8 other) { | ||
| 555 | simd_char16 result; | ||
| 556 | result.lo = simd_make_char8(other); | ||
| 557 | return result; | ||
| 558 | } | ||
| 559 | |||
| 560 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 561 | * templated and autogenerated code. */ | ||
| 562 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char16 other) { | ||
| 563 | return other; | ||
| 564 | } | ||
| 565 | |||
| 566 | /*! @abstract Truncates `other` to form a vector of sixteen 8-bit signed | ||
| 567 | * (twos-complement) integers. */ | ||
| 568 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char32 other) { | ||
| 569 | return simd_make_char16(other.lo); | ||
| 570 | } | ||
| 571 | |||
| 572 | /*! @abstract Truncates `other` to form a vector of sixteen 8-bit signed | ||
| 573 | * (twos-complement) integers. */ | ||
| 574 | static inline SIMD_CFUNC simd_char16 simd_make_char16(simd_char64 other) { | ||
| 575 | return simd_make_char16(other.lo); | ||
| 576 | } | ||
| 577 | |||
| 578 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 579 | * 8-bit signed (twos-complement) integers. */ | ||
| 580 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char16 lo, simd_char16 hi) { | ||
| 581 | simd_char32 result; | ||
| 582 | result.lo = lo; | ||
| 583 | result.hi = hi; | ||
| 584 | return result; | ||
| 585 | } | ||
| 586 | |||
| 587 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 588 | * signed (twos-complement) integers. */ | ||
| 589 | static inline SIMD_CFUNC simd_char32 simd_make_char32(char other) { | ||
| 590 | simd_char32 result = 0; | ||
| 591 | result.x = other; | ||
| 592 | return result; | ||
| 593 | } | ||
| 594 | |||
| 595 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 596 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 597 | * lanes are unspecified. */ | ||
| 598 | static inline SIMD_CFUNC simd_char32 simd_make_char32_undef(char other) { | ||
| 599 | simd_char32 result; | ||
| 600 | result.x = other; | ||
| 601 | return result; | ||
| 602 | } | ||
| 603 | |||
| 604 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 605 | * signed (twos-complement) integers. */ | ||
| 606 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char2 other) { | ||
| 607 | simd_char32 result = 0; | ||
| 608 | result.xy = other; | ||
| 609 | return result; | ||
| 610 | } | ||
| 611 | |||
| 612 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 613 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 614 | * lanes are unspecified. */ | ||
| 615 | static inline SIMD_CFUNC simd_char32 simd_make_char32_undef(simd_char2 other) { | ||
| 616 | simd_char32 result; | ||
| 617 | result.xy = other; | ||
| 618 | return result; | ||
| 619 | } | ||
| 620 | |||
| 621 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 622 | * signed (twos-complement) integers. */ | ||
| 623 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char3 other) { | ||
| 624 | simd_char32 result = 0; | ||
| 625 | result.xyz = other; | ||
| 626 | return result; | ||
| 627 | } | ||
| 628 | |||
| 629 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 630 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 631 | * lanes are unspecified. */ | ||
| 632 | static inline SIMD_CFUNC simd_char32 simd_make_char32_undef(simd_char3 other) { | ||
| 633 | simd_char32 result; | ||
| 634 | result.xyz = other; | ||
| 635 | return result; | ||
| 636 | } | ||
| 637 | |||
| 638 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 639 | * signed (twos-complement) integers. */ | ||
| 640 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char4 other) { | ||
| 641 | simd_char32 result = 0; | ||
| 642 | result.xyzw = other; | ||
| 643 | return result; | ||
| 644 | } | ||
| 645 | |||
| 646 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 647 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 648 | * lanes are unspecified. */ | ||
| 649 | static inline SIMD_CFUNC simd_char32 simd_make_char32_undef(simd_char4 other) { | ||
| 650 | simd_char32 result; | ||
| 651 | result.xyzw = other; | ||
| 652 | return result; | ||
| 653 | } | ||
| 654 | |||
| 655 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 656 | * signed (twos-complement) integers. */ | ||
| 657 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char8 other) { | ||
| 658 | simd_char32 result = 0; | ||
| 659 | result.lo = simd_make_char16(other); | ||
| 660 | return result; | ||
| 661 | } | ||
| 662 | |||
| 663 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 664 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 665 | * lanes are unspecified. */ | ||
| 666 | static inline SIMD_CFUNC simd_char32 simd_make_char32_undef(simd_char8 other) { | ||
| 667 | simd_char32 result; | ||
| 668 | result.lo = simd_make_char16(other); | ||
| 669 | return result; | ||
| 670 | } | ||
| 671 | |||
| 672 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 673 | * signed (twos-complement) integers. */ | ||
| 674 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char16 other) { | ||
| 675 | simd_char32 result = 0; | ||
| 676 | result.lo = simd_make_char16(other); | ||
| 677 | return result; | ||
| 678 | } | ||
| 679 | |||
| 680 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 681 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 682 | * lanes are unspecified. */ | ||
| 683 | static inline SIMD_CFUNC simd_char32 simd_make_char32_undef(simd_char16 other) { | ||
| 684 | simd_char32 result; | ||
| 685 | result.lo = simd_make_char16(other); | ||
| 686 | return result; | ||
| 687 | } | ||
| 688 | |||
| 689 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 690 | * templated and autogenerated code. */ | ||
| 691 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char32 other) { | ||
| 692 | return other; | ||
| 693 | } | ||
| 694 | |||
| 695 | /*! @abstract Truncates `other` to form a vector of thirty-two 8-bit signed | ||
| 696 | * (twos-complement) integers. */ | ||
| 697 | static inline SIMD_CFUNC simd_char32 simd_make_char32(simd_char64 other) { | ||
| 698 | return simd_make_char32(other.lo); | ||
| 699 | } | ||
| 700 | |||
| 701 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixty-four | ||
| 702 | * 8-bit signed (twos-complement) integers. */ | ||
| 703 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char32 lo, simd_char32 hi) { | ||
| 704 | simd_char64 result; | ||
| 705 | result.lo = lo; | ||
| 706 | result.hi = hi; | ||
| 707 | return result; | ||
| 708 | } | ||
| 709 | |||
| 710 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 711 | * signed (twos-complement) integers. */ | ||
| 712 | static inline SIMD_CFUNC simd_char64 simd_make_char64(char other) { | ||
| 713 | simd_char64 result = 0; | ||
| 714 | result.x = other; | ||
| 715 | return result; | ||
| 716 | } | ||
| 717 | |||
| 718 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 719 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 720 | * lanes are unspecified. */ | ||
| 721 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(char other) { | ||
| 722 | simd_char64 result; | ||
| 723 | result.x = other; | ||
| 724 | return result; | ||
| 725 | } | ||
| 726 | |||
| 727 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 728 | * signed (twos-complement) integers. */ | ||
| 729 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char2 other) { | ||
| 730 | simd_char64 result = 0; | ||
| 731 | result.xy = other; | ||
| 732 | return result; | ||
| 733 | } | ||
| 734 | |||
| 735 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 736 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 737 | * lanes are unspecified. */ | ||
| 738 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(simd_char2 other) { | ||
| 739 | simd_char64 result; | ||
| 740 | result.xy = other; | ||
| 741 | return result; | ||
| 742 | } | ||
| 743 | |||
| 744 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 745 | * signed (twos-complement) integers. */ | ||
| 746 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char3 other) { | ||
| 747 | simd_char64 result = 0; | ||
| 748 | result.xyz = other; | ||
| 749 | return result; | ||
| 750 | } | ||
| 751 | |||
| 752 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 753 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 754 | * lanes are unspecified. */ | ||
| 755 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(simd_char3 other) { | ||
| 756 | simd_char64 result; | ||
| 757 | result.xyz = other; | ||
| 758 | return result; | ||
| 759 | } | ||
| 760 | |||
| 761 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 762 | * signed (twos-complement) integers. */ | ||
| 763 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char4 other) { | ||
| 764 | simd_char64 result = 0; | ||
| 765 | result.xyzw = other; | ||
| 766 | return result; | ||
| 767 | } | ||
| 768 | |||
| 769 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 770 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 771 | * lanes are unspecified. */ | ||
| 772 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(simd_char4 other) { | ||
| 773 | simd_char64 result; | ||
| 774 | result.xyzw = other; | ||
| 775 | return result; | ||
| 776 | } | ||
| 777 | |||
| 778 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 779 | * signed (twos-complement) integers. */ | ||
| 780 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char8 other) { | ||
| 781 | simd_char64 result = 0; | ||
| 782 | result.lo = simd_make_char32(other); | ||
| 783 | return result; | ||
| 784 | } | ||
| 785 | |||
| 786 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 787 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 788 | * lanes are unspecified. */ | ||
| 789 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(simd_char8 other) { | ||
| 790 | simd_char64 result; | ||
| 791 | result.lo = simd_make_char32(other); | ||
| 792 | return result; | ||
| 793 | } | ||
| 794 | |||
| 795 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 796 | * signed (twos-complement) integers. */ | ||
| 797 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char16 other) { | ||
| 798 | simd_char64 result = 0; | ||
| 799 | result.lo = simd_make_char32(other); | ||
| 800 | return result; | ||
| 801 | } | ||
| 802 | |||
| 803 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 804 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 805 | * lanes are unspecified. */ | ||
| 806 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(simd_char16 other) { | ||
| 807 | simd_char64 result; | ||
| 808 | result.lo = simd_make_char32(other); | ||
| 809 | return result; | ||
| 810 | } | ||
| 811 | |||
| 812 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 813 | * signed (twos-complement) integers. */ | ||
| 814 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char32 other) { | ||
| 815 | simd_char64 result = 0; | ||
| 816 | result.lo = simd_make_char32(other); | ||
| 817 | return result; | ||
| 818 | } | ||
| 819 | |||
| 820 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 821 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 822 | * lanes are unspecified. */ | ||
| 823 | static inline SIMD_CFUNC simd_char64 simd_make_char64_undef(simd_char32 other) { | ||
| 824 | simd_char64 result; | ||
| 825 | result.lo = simd_make_char32(other); | ||
| 826 | return result; | ||
| 827 | } | ||
| 828 | |||
| 829 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 830 | * templated and autogenerated code. */ | ||
| 831 | static inline SIMD_CFUNC simd_char64 simd_make_char64(simd_char64 other) { | ||
| 832 | return other; | ||
| 833 | } | ||
| 834 | |||
| 835 | /*! @abstract Concatenates `x` and `y` to form a vector of two 8-bit | ||
| 836 | * unsigned integers. */ | ||
| 837 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(unsigned char x, unsigned char y) { | ||
| 838 | simd_uchar2 result; | ||
| 839 | result.x = x; | ||
| 840 | result.y = y; | ||
| 841 | return result; | ||
| 842 | } | ||
| 843 | |||
| 844 | /*! @abstract Zero-extends `other` to form a vector of two 8-bit unsigned | ||
| 845 | * integers. */ | ||
| 846 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(unsigned char other) { | ||
| 847 | simd_uchar2 result = 0; | ||
| 848 | result.x = other; | ||
| 849 | return result; | ||
| 850 | } | ||
| 851 | |||
| 852 | /*! @abstract Extends `other` to form a vector of two 8-bit unsigned | ||
| 853 | * integers. The contents of the newly-created vector lanes are | ||
| 854 | * unspecified. */ | ||
| 855 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2_undef(unsigned char other) { | ||
| 856 | simd_uchar2 result; | ||
| 857 | result.x = other; | ||
| 858 | return result; | ||
| 859 | } | ||
| 860 | |||
| 861 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 862 | * templated and autogenerated code. */ | ||
| 863 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar2 other) { | ||
| 864 | return other; | ||
| 865 | } | ||
| 866 | |||
| 867 | /*! @abstract Truncates `other` to form a vector of two 8-bit unsigned | ||
| 868 | * integers. */ | ||
| 869 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar3 other) { | ||
| 870 | return other.xy; | ||
| 871 | } | ||
| 872 | |||
| 873 | /*! @abstract Truncates `other` to form a vector of two 8-bit unsigned | ||
| 874 | * integers. */ | ||
| 875 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar4 other) { | ||
| 876 | return other.xy; | ||
| 877 | } | ||
| 878 | |||
| 879 | /*! @abstract Truncates `other` to form a vector of two 8-bit unsigned | ||
| 880 | * integers. */ | ||
| 881 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar8 other) { | ||
| 882 | return other.xy; | ||
| 883 | } | ||
| 884 | |||
| 885 | /*! @abstract Truncates `other` to form a vector of two 8-bit unsigned | ||
| 886 | * integers. */ | ||
| 887 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar16 other) { | ||
| 888 | return other.xy; | ||
| 889 | } | ||
| 890 | |||
| 891 | /*! @abstract Truncates `other` to form a vector of two 8-bit unsigned | ||
| 892 | * integers. */ | ||
| 893 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar32 other) { | ||
| 894 | return other.xy; | ||
| 895 | } | ||
| 896 | |||
| 897 | /*! @abstract Truncates `other` to form a vector of two 8-bit unsigned | ||
| 898 | * integers. */ | ||
| 899 | static inline SIMD_CFUNC simd_uchar2 simd_make_uchar2(simd_uchar64 other) { | ||
| 900 | return other.xy; | ||
| 901 | } | ||
| 902 | |||
| 903 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 8-bit | ||
| 904 | * unsigned integers. */ | ||
| 905 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(unsigned char x, unsigned char y, unsigned char z) { | ||
| 906 | simd_uchar3 result; | ||
| 907 | result.x = x; | ||
| 908 | result.y = y; | ||
| 909 | result.z = z; | ||
| 910 | return result; | ||
| 911 | } | ||
| 912 | |||
| 913 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 8-bit | ||
| 914 | * unsigned integers. */ | ||
| 915 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(unsigned char x, simd_uchar2 yz) { | ||
| 916 | simd_uchar3 result; | ||
| 917 | result.x = x; | ||
| 918 | result.yz = yz; | ||
| 919 | return result; | ||
| 920 | } | ||
| 921 | |||
| 922 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 8-bit | ||
| 923 | * unsigned integers. */ | ||
| 924 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar2 xy, unsigned char z) { | ||
| 925 | simd_uchar3 result; | ||
| 926 | result.xy = xy; | ||
| 927 | result.z = z; | ||
| 928 | return result; | ||
| 929 | } | ||
| 930 | |||
| 931 | /*! @abstract Zero-extends `other` to form a vector of three 8-bit unsigned | ||
| 932 | * integers. */ | ||
| 933 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(unsigned char other) { | ||
| 934 | simd_uchar3 result = 0; | ||
| 935 | result.x = other; | ||
| 936 | return result; | ||
| 937 | } | ||
| 938 | |||
| 939 | /*! @abstract Extends `other` to form a vector of three 8-bit unsigned | ||
| 940 | * integers. The contents of the newly-created vector lanes are | ||
| 941 | * unspecified. */ | ||
| 942 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3_undef(unsigned char other) { | ||
| 943 | simd_uchar3 result; | ||
| 944 | result.x = other; | ||
| 945 | return result; | ||
| 946 | } | ||
| 947 | |||
| 948 | /*! @abstract Zero-extends `other` to form a vector of three 8-bit unsigned | ||
| 949 | * integers. */ | ||
| 950 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar2 other) { | ||
| 951 | simd_uchar3 result = 0; | ||
| 952 | result.xy = other; | ||
| 953 | return result; | ||
| 954 | } | ||
| 955 | |||
| 956 | /*! @abstract Extends `other` to form a vector of three 8-bit unsigned | ||
| 957 | * integers. The contents of the newly-created vector lanes are | ||
| 958 | * unspecified. */ | ||
| 959 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3_undef(simd_uchar2 other) { | ||
| 960 | simd_uchar3 result; | ||
| 961 | result.xy = other; | ||
| 962 | return result; | ||
| 963 | } | ||
| 964 | |||
| 965 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 966 | * templated and autogenerated code. */ | ||
| 967 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar3 other) { | ||
| 968 | return other; | ||
| 969 | } | ||
| 970 | |||
| 971 | /*! @abstract Truncates `other` to form a vector of three 8-bit unsigned | ||
| 972 | * integers. */ | ||
| 973 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar4 other) { | ||
| 974 | return other.xyz; | ||
| 975 | } | ||
| 976 | |||
| 977 | /*! @abstract Truncates `other` to form a vector of three 8-bit unsigned | ||
| 978 | * integers. */ | ||
| 979 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar8 other) { | ||
| 980 | return other.xyz; | ||
| 981 | } | ||
| 982 | |||
| 983 | /*! @abstract Truncates `other` to form a vector of three 8-bit unsigned | ||
| 984 | * integers. */ | ||
| 985 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar16 other) { | ||
| 986 | return other.xyz; | ||
| 987 | } | ||
| 988 | |||
| 989 | /*! @abstract Truncates `other` to form a vector of three 8-bit unsigned | ||
| 990 | * integers. */ | ||
| 991 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar32 other) { | ||
| 992 | return other.xyz; | ||
| 993 | } | ||
| 994 | |||
| 995 | /*! @abstract Truncates `other` to form a vector of three 8-bit unsigned | ||
| 996 | * integers. */ | ||
| 997 | static inline SIMD_CFUNC simd_uchar3 simd_make_uchar3(simd_uchar64 other) { | ||
| 998 | return other.xyz; | ||
| 999 | } | ||
| 1000 | |||
| 1001 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 1002 | * 8-bit unsigned integers. */ | ||
| 1003 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(unsigned char x, unsigned char y, unsigned char z, unsigned char w) { | ||
| 1004 | simd_uchar4 result; | ||
| 1005 | result.x = x; | ||
| 1006 | result.y = y; | ||
| 1007 | result.z = z; | ||
| 1008 | result.w = w; | ||
| 1009 | return result; | ||
| 1010 | } | ||
| 1011 | |||
| 1012 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 8-bit | ||
| 1013 | * unsigned integers. */ | ||
| 1014 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(unsigned char x, unsigned char y, simd_uchar2 zw) { | ||
| 1015 | simd_uchar4 result; | ||
| 1016 | result.x = x; | ||
| 1017 | result.y = y; | ||
| 1018 | result.zw = zw; | ||
| 1019 | return result; | ||
| 1020 | } | ||
| 1021 | |||
| 1022 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 8-bit | ||
| 1023 | * unsigned integers. */ | ||
| 1024 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(unsigned char x, simd_uchar2 yz, unsigned char w) { | ||
| 1025 | simd_uchar4 result; | ||
| 1026 | result.x = x; | ||
| 1027 | result.yz = yz; | ||
| 1028 | result.w = w; | ||
| 1029 | return result; | ||
| 1030 | } | ||
| 1031 | |||
| 1032 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 8-bit | ||
| 1033 | * unsigned integers. */ | ||
| 1034 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar2 xy, unsigned char z, unsigned char w) { | ||
| 1035 | simd_uchar4 result; | ||
| 1036 | result.xy = xy; | ||
| 1037 | result.z = z; | ||
| 1038 | result.w = w; | ||
| 1039 | return result; | ||
| 1040 | } | ||
| 1041 | |||
| 1042 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 8-bit | ||
| 1043 | * unsigned integers. */ | ||
| 1044 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(unsigned char x, simd_uchar3 yzw) { | ||
| 1045 | simd_uchar4 result; | ||
| 1046 | result.x = x; | ||
| 1047 | result.yzw = yzw; | ||
| 1048 | return result; | ||
| 1049 | } | ||
| 1050 | |||
| 1051 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 8-bit | ||
| 1052 | * unsigned integers. */ | ||
| 1053 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar2 xy, simd_uchar2 zw) { | ||
| 1054 | simd_uchar4 result; | ||
| 1055 | result.xy = xy; | ||
| 1056 | result.zw = zw; | ||
| 1057 | return result; | ||
| 1058 | } | ||
| 1059 | |||
| 1060 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 8-bit | ||
| 1061 | * unsigned integers. */ | ||
| 1062 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar3 xyz, unsigned char w) { | ||
| 1063 | simd_uchar4 result; | ||
| 1064 | result.xyz = xyz; | ||
| 1065 | result.w = w; | ||
| 1066 | return result; | ||
| 1067 | } | ||
| 1068 | |||
| 1069 | /*! @abstract Zero-extends `other` to form a vector of four 8-bit unsigned | ||
| 1070 | * integers. */ | ||
| 1071 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(unsigned char other) { | ||
| 1072 | simd_uchar4 result = 0; | ||
| 1073 | result.x = other; | ||
| 1074 | return result; | ||
| 1075 | } | ||
| 1076 | |||
| 1077 | /*! @abstract Extends `other` to form a vector of four 8-bit unsigned | ||
| 1078 | * integers. The contents of the newly-created vector lanes are | ||
| 1079 | * unspecified. */ | ||
| 1080 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4_undef(unsigned char other) { | ||
| 1081 | simd_uchar4 result; | ||
| 1082 | result.x = other; | ||
| 1083 | return result; | ||
| 1084 | } | ||
| 1085 | |||
| 1086 | /*! @abstract Zero-extends `other` to form a vector of four 8-bit unsigned | ||
| 1087 | * integers. */ | ||
| 1088 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar2 other) { | ||
| 1089 | simd_uchar4 result = 0; | ||
| 1090 | result.xy = other; | ||
| 1091 | return result; | ||
| 1092 | } | ||
| 1093 | |||
| 1094 | /*! @abstract Extends `other` to form a vector of four 8-bit unsigned | ||
| 1095 | * integers. The contents of the newly-created vector lanes are | ||
| 1096 | * unspecified. */ | ||
| 1097 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4_undef(simd_uchar2 other) { | ||
| 1098 | simd_uchar4 result; | ||
| 1099 | result.xy = other; | ||
| 1100 | return result; | ||
| 1101 | } | ||
| 1102 | |||
| 1103 | /*! @abstract Zero-extends `other` to form a vector of four 8-bit unsigned | ||
| 1104 | * integers. */ | ||
| 1105 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar3 other) { | ||
| 1106 | simd_uchar4 result = 0; | ||
| 1107 | result.xyz = other; | ||
| 1108 | return result; | ||
| 1109 | } | ||
| 1110 | |||
| 1111 | /*! @abstract Extends `other` to form a vector of four 8-bit unsigned | ||
| 1112 | * integers. The contents of the newly-created vector lanes are | ||
| 1113 | * unspecified. */ | ||
| 1114 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4_undef(simd_uchar3 other) { | ||
| 1115 | simd_uchar4 result; | ||
| 1116 | result.xyz = other; | ||
| 1117 | return result; | ||
| 1118 | } | ||
| 1119 | |||
| 1120 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1121 | * templated and autogenerated code. */ | ||
| 1122 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar4 other) { | ||
| 1123 | return other; | ||
| 1124 | } | ||
| 1125 | |||
| 1126 | /*! @abstract Truncates `other` to form a vector of four 8-bit unsigned | ||
| 1127 | * integers. */ | ||
| 1128 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar8 other) { | ||
| 1129 | return other.xyzw; | ||
| 1130 | } | ||
| 1131 | |||
| 1132 | /*! @abstract Truncates `other` to form a vector of four 8-bit unsigned | ||
| 1133 | * integers. */ | ||
| 1134 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar16 other) { | ||
| 1135 | return other.xyzw; | ||
| 1136 | } | ||
| 1137 | |||
| 1138 | /*! @abstract Truncates `other` to form a vector of four 8-bit unsigned | ||
| 1139 | * integers. */ | ||
| 1140 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar32 other) { | ||
| 1141 | return other.xyzw; | ||
| 1142 | } | ||
| 1143 | |||
| 1144 | /*! @abstract Truncates `other` to form a vector of four 8-bit unsigned | ||
| 1145 | * integers. */ | ||
| 1146 | static inline SIMD_CFUNC simd_uchar4 simd_make_uchar4(simd_uchar64 other) { | ||
| 1147 | return other.xyzw; | ||
| 1148 | } | ||
| 1149 | |||
| 1150 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 8-bit | ||
| 1151 | * unsigned integers. */ | ||
| 1152 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar4 lo, simd_uchar4 hi) { | ||
| 1153 | simd_uchar8 result; | ||
| 1154 | result.lo = lo; | ||
| 1155 | result.hi = hi; | ||
| 1156 | return result; | ||
| 1157 | } | ||
| 1158 | |||
| 1159 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit unsigned | ||
| 1160 | * integers. */ | ||
| 1161 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(unsigned char other) { | ||
| 1162 | simd_uchar8 result = 0; | ||
| 1163 | result.x = other; | ||
| 1164 | return result; | ||
| 1165 | } | ||
| 1166 | |||
| 1167 | /*! @abstract Extends `other` to form a vector of eight 8-bit unsigned | ||
| 1168 | * integers. The contents of the newly-created vector lanes are | ||
| 1169 | * unspecified. */ | ||
| 1170 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8_undef(unsigned char other) { | ||
| 1171 | simd_uchar8 result; | ||
| 1172 | result.x = other; | ||
| 1173 | return result; | ||
| 1174 | } | ||
| 1175 | |||
| 1176 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit unsigned | ||
| 1177 | * integers. */ | ||
| 1178 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar2 other) { | ||
| 1179 | simd_uchar8 result = 0; | ||
| 1180 | result.xy = other; | ||
| 1181 | return result; | ||
| 1182 | } | ||
| 1183 | |||
| 1184 | /*! @abstract Extends `other` to form a vector of eight 8-bit unsigned | ||
| 1185 | * integers. The contents of the newly-created vector lanes are | ||
| 1186 | * unspecified. */ | ||
| 1187 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8_undef(simd_uchar2 other) { | ||
| 1188 | simd_uchar8 result; | ||
| 1189 | result.xy = other; | ||
| 1190 | return result; | ||
| 1191 | } | ||
| 1192 | |||
| 1193 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit unsigned | ||
| 1194 | * integers. */ | ||
| 1195 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar3 other) { | ||
| 1196 | simd_uchar8 result = 0; | ||
| 1197 | result.xyz = other; | ||
| 1198 | return result; | ||
| 1199 | } | ||
| 1200 | |||
| 1201 | /*! @abstract Extends `other` to form a vector of eight 8-bit unsigned | ||
| 1202 | * integers. The contents of the newly-created vector lanes are | ||
| 1203 | * unspecified. */ | ||
| 1204 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8_undef(simd_uchar3 other) { | ||
| 1205 | simd_uchar8 result; | ||
| 1206 | result.xyz = other; | ||
| 1207 | return result; | ||
| 1208 | } | ||
| 1209 | |||
| 1210 | /*! @abstract Zero-extends `other` to form a vector of eight 8-bit unsigned | ||
| 1211 | * integers. */ | ||
| 1212 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar4 other) { | ||
| 1213 | simd_uchar8 result = 0; | ||
| 1214 | result.xyzw = other; | ||
| 1215 | return result; | ||
| 1216 | } | ||
| 1217 | |||
| 1218 | /*! @abstract Extends `other` to form a vector of eight 8-bit unsigned | ||
| 1219 | * integers. The contents of the newly-created vector lanes are | ||
| 1220 | * unspecified. */ | ||
| 1221 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8_undef(simd_uchar4 other) { | ||
| 1222 | simd_uchar8 result; | ||
| 1223 | result.xyzw = other; | ||
| 1224 | return result; | ||
| 1225 | } | ||
| 1226 | |||
| 1227 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1228 | * templated and autogenerated code. */ | ||
| 1229 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar8 other) { | ||
| 1230 | return other; | ||
| 1231 | } | ||
| 1232 | |||
| 1233 | /*! @abstract Truncates `other` to form a vector of eight 8-bit unsigned | ||
| 1234 | * integers. */ | ||
| 1235 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar16 other) { | ||
| 1236 | return simd_make_uchar8(other.lo); | ||
| 1237 | } | ||
| 1238 | |||
| 1239 | /*! @abstract Truncates `other` to form a vector of eight 8-bit unsigned | ||
| 1240 | * integers. */ | ||
| 1241 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar32 other) { | ||
| 1242 | return simd_make_uchar8(other.lo); | ||
| 1243 | } | ||
| 1244 | |||
| 1245 | /*! @abstract Truncates `other` to form a vector of eight 8-bit unsigned | ||
| 1246 | * integers. */ | ||
| 1247 | static inline SIMD_CFUNC simd_uchar8 simd_make_uchar8(simd_uchar64 other) { | ||
| 1248 | return simd_make_uchar8(other.lo); | ||
| 1249 | } | ||
| 1250 | |||
| 1251 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 8-bit | ||
| 1252 | * unsigned integers. */ | ||
| 1253 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar8 lo, simd_uchar8 hi) { | ||
| 1254 | simd_uchar16 result; | ||
| 1255 | result.lo = lo; | ||
| 1256 | result.hi = hi; | ||
| 1257 | return result; | ||
| 1258 | } | ||
| 1259 | |||
| 1260 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit | ||
| 1261 | * unsigned integers. */ | ||
| 1262 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(unsigned char other) { | ||
| 1263 | simd_uchar16 result = 0; | ||
| 1264 | result.x = other; | ||
| 1265 | return result; | ||
| 1266 | } | ||
| 1267 | |||
| 1268 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit unsigned | ||
| 1269 | * integers. The contents of the newly-created vector lanes are | ||
| 1270 | * unspecified. */ | ||
| 1271 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16_undef(unsigned char other) { | ||
| 1272 | simd_uchar16 result; | ||
| 1273 | result.x = other; | ||
| 1274 | return result; | ||
| 1275 | } | ||
| 1276 | |||
| 1277 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit | ||
| 1278 | * unsigned integers. */ | ||
| 1279 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar2 other) { | ||
| 1280 | simd_uchar16 result = 0; | ||
| 1281 | result.xy = other; | ||
| 1282 | return result; | ||
| 1283 | } | ||
| 1284 | |||
| 1285 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit unsigned | ||
| 1286 | * integers. The contents of the newly-created vector lanes are | ||
| 1287 | * unspecified. */ | ||
| 1288 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16_undef(simd_uchar2 other) { | ||
| 1289 | simd_uchar16 result; | ||
| 1290 | result.xy = other; | ||
| 1291 | return result; | ||
| 1292 | } | ||
| 1293 | |||
| 1294 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit | ||
| 1295 | * unsigned integers. */ | ||
| 1296 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar3 other) { | ||
| 1297 | simd_uchar16 result = 0; | ||
| 1298 | result.xyz = other; | ||
| 1299 | return result; | ||
| 1300 | } | ||
| 1301 | |||
| 1302 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit unsigned | ||
| 1303 | * integers. The contents of the newly-created vector lanes are | ||
| 1304 | * unspecified. */ | ||
| 1305 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16_undef(simd_uchar3 other) { | ||
| 1306 | simd_uchar16 result; | ||
| 1307 | result.xyz = other; | ||
| 1308 | return result; | ||
| 1309 | } | ||
| 1310 | |||
| 1311 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit | ||
| 1312 | * unsigned integers. */ | ||
| 1313 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar4 other) { | ||
| 1314 | simd_uchar16 result = 0; | ||
| 1315 | result.xyzw = other; | ||
| 1316 | return result; | ||
| 1317 | } | ||
| 1318 | |||
| 1319 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit unsigned | ||
| 1320 | * integers. The contents of the newly-created vector lanes are | ||
| 1321 | * unspecified. */ | ||
| 1322 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16_undef(simd_uchar4 other) { | ||
| 1323 | simd_uchar16 result; | ||
| 1324 | result.xyzw = other; | ||
| 1325 | return result; | ||
| 1326 | } | ||
| 1327 | |||
| 1328 | /*! @abstract Zero-extends `other` to form a vector of sixteen 8-bit | ||
| 1329 | * unsigned integers. */ | ||
| 1330 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar8 other) { | ||
| 1331 | simd_uchar16 result = 0; | ||
| 1332 | result.lo = simd_make_uchar8(other); | ||
| 1333 | return result; | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit unsigned | ||
| 1337 | * integers. The contents of the newly-created vector lanes are | ||
| 1338 | * unspecified. */ | ||
| 1339 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16_undef(simd_uchar8 other) { | ||
| 1340 | simd_uchar16 result; | ||
| 1341 | result.lo = simd_make_uchar8(other); | ||
| 1342 | return result; | ||
| 1343 | } | ||
| 1344 | |||
| 1345 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1346 | * templated and autogenerated code. */ | ||
| 1347 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar16 other) { | ||
| 1348 | return other; | ||
| 1349 | } | ||
| 1350 | |||
| 1351 | /*! @abstract Truncates `other` to form a vector of sixteen 8-bit unsigned | ||
| 1352 | * integers. */ | ||
| 1353 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar32 other) { | ||
| 1354 | return simd_make_uchar16(other.lo); | ||
| 1355 | } | ||
| 1356 | |||
| 1357 | /*! @abstract Truncates `other` to form a vector of sixteen 8-bit unsigned | ||
| 1358 | * integers. */ | ||
| 1359 | static inline SIMD_CFUNC simd_uchar16 simd_make_uchar16(simd_uchar64 other) { | ||
| 1360 | return simd_make_uchar16(other.lo); | ||
| 1361 | } | ||
| 1362 | |||
| 1363 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 1364 | * 8-bit unsigned integers. */ | ||
| 1365 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar16 lo, simd_uchar16 hi) { | ||
| 1366 | simd_uchar32 result; | ||
| 1367 | result.lo = lo; | ||
| 1368 | result.hi = hi; | ||
| 1369 | return result; | ||
| 1370 | } | ||
| 1371 | |||
| 1372 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 1373 | * unsigned integers. */ | ||
| 1374 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(unsigned char other) { | ||
| 1375 | simd_uchar32 result = 0; | ||
| 1376 | result.x = other; | ||
| 1377 | return result; | ||
| 1378 | } | ||
| 1379 | |||
| 1380 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 1381 | * integers. The contents of the newly-created vector lanes are | ||
| 1382 | * unspecified. */ | ||
| 1383 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32_undef(unsigned char other) { | ||
| 1384 | simd_uchar32 result; | ||
| 1385 | result.x = other; | ||
| 1386 | return result; | ||
| 1387 | } | ||
| 1388 | |||
| 1389 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 1390 | * unsigned integers. */ | ||
| 1391 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar2 other) { | ||
| 1392 | simd_uchar32 result = 0; | ||
| 1393 | result.xy = other; | ||
| 1394 | return result; | ||
| 1395 | } | ||
| 1396 | |||
| 1397 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 1398 | * integers. The contents of the newly-created vector lanes are | ||
| 1399 | * unspecified. */ | ||
| 1400 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32_undef(simd_uchar2 other) { | ||
| 1401 | simd_uchar32 result; | ||
| 1402 | result.xy = other; | ||
| 1403 | return result; | ||
| 1404 | } | ||
| 1405 | |||
| 1406 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 1407 | * unsigned integers. */ | ||
| 1408 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar3 other) { | ||
| 1409 | simd_uchar32 result = 0; | ||
| 1410 | result.xyz = other; | ||
| 1411 | return result; | ||
| 1412 | } | ||
| 1413 | |||
| 1414 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 1415 | * integers. The contents of the newly-created vector lanes are | ||
| 1416 | * unspecified. */ | ||
| 1417 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32_undef(simd_uchar3 other) { | ||
| 1418 | simd_uchar32 result; | ||
| 1419 | result.xyz = other; | ||
| 1420 | return result; | ||
| 1421 | } | ||
| 1422 | |||
| 1423 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 1424 | * unsigned integers. */ | ||
| 1425 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar4 other) { | ||
| 1426 | simd_uchar32 result = 0; | ||
| 1427 | result.xyzw = other; | ||
| 1428 | return result; | ||
| 1429 | } | ||
| 1430 | |||
| 1431 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 1432 | * integers. The contents of the newly-created vector lanes are | ||
| 1433 | * unspecified. */ | ||
| 1434 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32_undef(simd_uchar4 other) { | ||
| 1435 | simd_uchar32 result; | ||
| 1436 | result.xyzw = other; | ||
| 1437 | return result; | ||
| 1438 | } | ||
| 1439 | |||
| 1440 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 1441 | * unsigned integers. */ | ||
| 1442 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar8 other) { | ||
| 1443 | simd_uchar32 result = 0; | ||
| 1444 | result.lo = simd_make_uchar16(other); | ||
| 1445 | return result; | ||
| 1446 | } | ||
| 1447 | |||
| 1448 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 1449 | * integers. The contents of the newly-created vector lanes are | ||
| 1450 | * unspecified. */ | ||
| 1451 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32_undef(simd_uchar8 other) { | ||
| 1452 | simd_uchar32 result; | ||
| 1453 | result.lo = simd_make_uchar16(other); | ||
| 1454 | return result; | ||
| 1455 | } | ||
| 1456 | |||
| 1457 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 8-bit | ||
| 1458 | * unsigned integers. */ | ||
| 1459 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar16 other) { | ||
| 1460 | simd_uchar32 result = 0; | ||
| 1461 | result.lo = simd_make_uchar16(other); | ||
| 1462 | return result; | ||
| 1463 | } | ||
| 1464 | |||
| 1465 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 1466 | * integers. The contents of the newly-created vector lanes are | ||
| 1467 | * unspecified. */ | ||
| 1468 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32_undef(simd_uchar16 other) { | ||
| 1469 | simd_uchar32 result; | ||
| 1470 | result.lo = simd_make_uchar16(other); | ||
| 1471 | return result; | ||
| 1472 | } | ||
| 1473 | |||
| 1474 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1475 | * templated and autogenerated code. */ | ||
| 1476 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar32 other) { | ||
| 1477 | return other; | ||
| 1478 | } | ||
| 1479 | |||
| 1480 | /*! @abstract Truncates `other` to form a vector of thirty-two 8-bit | ||
| 1481 | * unsigned integers. */ | ||
| 1482 | static inline SIMD_CFUNC simd_uchar32 simd_make_uchar32(simd_uchar64 other) { | ||
| 1483 | return simd_make_uchar32(other.lo); | ||
| 1484 | } | ||
| 1485 | |||
| 1486 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixty-four | ||
| 1487 | * 8-bit unsigned integers. */ | ||
| 1488 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar32 lo, simd_uchar32 hi) { | ||
| 1489 | simd_uchar64 result; | ||
| 1490 | result.lo = lo; | ||
| 1491 | result.hi = hi; | ||
| 1492 | return result; | ||
| 1493 | } | ||
| 1494 | |||
| 1495 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1496 | * unsigned integers. */ | ||
| 1497 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(unsigned char other) { | ||
| 1498 | simd_uchar64 result = 0; | ||
| 1499 | result.x = other; | ||
| 1500 | return result; | ||
| 1501 | } | ||
| 1502 | |||
| 1503 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1504 | * integers. The contents of the newly-created vector lanes are | ||
| 1505 | * unspecified. */ | ||
| 1506 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(unsigned char other) { | ||
| 1507 | simd_uchar64 result; | ||
| 1508 | result.x = other; | ||
| 1509 | return result; | ||
| 1510 | } | ||
| 1511 | |||
| 1512 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1513 | * unsigned integers. */ | ||
| 1514 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar2 other) { | ||
| 1515 | simd_uchar64 result = 0; | ||
| 1516 | result.xy = other; | ||
| 1517 | return result; | ||
| 1518 | } | ||
| 1519 | |||
| 1520 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1521 | * integers. The contents of the newly-created vector lanes are | ||
| 1522 | * unspecified. */ | ||
| 1523 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(simd_uchar2 other) { | ||
| 1524 | simd_uchar64 result; | ||
| 1525 | result.xy = other; | ||
| 1526 | return result; | ||
| 1527 | } | ||
| 1528 | |||
| 1529 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1530 | * unsigned integers. */ | ||
| 1531 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar3 other) { | ||
| 1532 | simd_uchar64 result = 0; | ||
| 1533 | result.xyz = other; | ||
| 1534 | return result; | ||
| 1535 | } | ||
| 1536 | |||
| 1537 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1538 | * integers. The contents of the newly-created vector lanes are | ||
| 1539 | * unspecified. */ | ||
| 1540 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(simd_uchar3 other) { | ||
| 1541 | simd_uchar64 result; | ||
| 1542 | result.xyz = other; | ||
| 1543 | return result; | ||
| 1544 | } | ||
| 1545 | |||
| 1546 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1547 | * unsigned integers. */ | ||
| 1548 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar4 other) { | ||
| 1549 | simd_uchar64 result = 0; | ||
| 1550 | result.xyzw = other; | ||
| 1551 | return result; | ||
| 1552 | } | ||
| 1553 | |||
| 1554 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1555 | * integers. The contents of the newly-created vector lanes are | ||
| 1556 | * unspecified. */ | ||
| 1557 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(simd_uchar4 other) { | ||
| 1558 | simd_uchar64 result; | ||
| 1559 | result.xyzw = other; | ||
| 1560 | return result; | ||
| 1561 | } | ||
| 1562 | |||
| 1563 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1564 | * unsigned integers. */ | ||
| 1565 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar8 other) { | ||
| 1566 | simd_uchar64 result = 0; | ||
| 1567 | result.lo = simd_make_uchar32(other); | ||
| 1568 | return result; | ||
| 1569 | } | ||
| 1570 | |||
| 1571 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1572 | * integers. The contents of the newly-created vector lanes are | ||
| 1573 | * unspecified. */ | ||
| 1574 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(simd_uchar8 other) { | ||
| 1575 | simd_uchar64 result; | ||
| 1576 | result.lo = simd_make_uchar32(other); | ||
| 1577 | return result; | ||
| 1578 | } | ||
| 1579 | |||
| 1580 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1581 | * unsigned integers. */ | ||
| 1582 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar16 other) { | ||
| 1583 | simd_uchar64 result = 0; | ||
| 1584 | result.lo = simd_make_uchar32(other); | ||
| 1585 | return result; | ||
| 1586 | } | ||
| 1587 | |||
| 1588 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1589 | * integers. The contents of the newly-created vector lanes are | ||
| 1590 | * unspecified. */ | ||
| 1591 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(simd_uchar16 other) { | ||
| 1592 | simd_uchar64 result; | ||
| 1593 | result.lo = simd_make_uchar32(other); | ||
| 1594 | return result; | ||
| 1595 | } | ||
| 1596 | |||
| 1597 | /*! @abstract Zero-extends `other` to form a vector of sixty-four 8-bit | ||
| 1598 | * unsigned integers. */ | ||
| 1599 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar32 other) { | ||
| 1600 | simd_uchar64 result = 0; | ||
| 1601 | result.lo = simd_make_uchar32(other); | ||
| 1602 | return result; | ||
| 1603 | } | ||
| 1604 | |||
| 1605 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 1606 | * integers. The contents of the newly-created vector lanes are | ||
| 1607 | * unspecified. */ | ||
| 1608 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64_undef(simd_uchar32 other) { | ||
| 1609 | simd_uchar64 result; | ||
| 1610 | result.lo = simd_make_uchar32(other); | ||
| 1611 | return result; | ||
| 1612 | } | ||
| 1613 | |||
| 1614 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1615 | * templated and autogenerated code. */ | ||
| 1616 | static inline SIMD_CFUNC simd_uchar64 simd_make_uchar64(simd_uchar64 other) { | ||
| 1617 | return other; | ||
| 1618 | } | ||
| 1619 | |||
| 1620 | /*! @abstract Concatenates `x` and `y` to form a vector of two 16-bit signed | ||
| 1621 | * (twos-complement) integers. */ | ||
| 1622 | static inline SIMD_CFUNC simd_short2 simd_make_short2(short x, short y) { | ||
| 1623 | simd_short2 result; | ||
| 1624 | result.x = x; | ||
| 1625 | result.y = y; | ||
| 1626 | return result; | ||
| 1627 | } | ||
| 1628 | |||
| 1629 | /*! @abstract Zero-extends `other` to form a vector of two 16-bit signed | ||
| 1630 | * (twos-complement) integers. */ | ||
| 1631 | static inline SIMD_CFUNC simd_short2 simd_make_short2(short other) { | ||
| 1632 | simd_short2 result = 0; | ||
| 1633 | result.x = other; | ||
| 1634 | return result; | ||
| 1635 | } | ||
| 1636 | |||
| 1637 | /*! @abstract Extends `other` to form a vector of two 16-bit signed (twos- | ||
| 1638 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1639 | * unspecified. */ | ||
| 1640 | static inline SIMD_CFUNC simd_short2 simd_make_short2_undef(short other) { | ||
| 1641 | simd_short2 result; | ||
| 1642 | result.x = other; | ||
| 1643 | return result; | ||
| 1644 | } | ||
| 1645 | |||
| 1646 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1647 | * templated and autogenerated code. */ | ||
| 1648 | static inline SIMD_CFUNC simd_short2 simd_make_short2(simd_short2 other) { | ||
| 1649 | return other; | ||
| 1650 | } | ||
| 1651 | |||
| 1652 | /*! @abstract Truncates `other` to form a vector of two 16-bit signed (twos- | ||
| 1653 | * complement) integers. */ | ||
| 1654 | static inline SIMD_CFUNC simd_short2 simd_make_short2(simd_short3 other) { | ||
| 1655 | return other.xy; | ||
| 1656 | } | ||
| 1657 | |||
| 1658 | /*! @abstract Truncates `other` to form a vector of two 16-bit signed (twos- | ||
| 1659 | * complement) integers. */ | ||
| 1660 | static inline SIMD_CFUNC simd_short2 simd_make_short2(simd_short4 other) { | ||
| 1661 | return other.xy; | ||
| 1662 | } | ||
| 1663 | |||
| 1664 | /*! @abstract Truncates `other` to form a vector of two 16-bit signed (twos- | ||
| 1665 | * complement) integers. */ | ||
| 1666 | static inline SIMD_CFUNC simd_short2 simd_make_short2(simd_short8 other) { | ||
| 1667 | return other.xy; | ||
| 1668 | } | ||
| 1669 | |||
| 1670 | /*! @abstract Truncates `other` to form a vector of two 16-bit signed (twos- | ||
| 1671 | * complement) integers. */ | ||
| 1672 | static inline SIMD_CFUNC simd_short2 simd_make_short2(simd_short16 other) { | ||
| 1673 | return other.xy; | ||
| 1674 | } | ||
| 1675 | |||
| 1676 | /*! @abstract Truncates `other` to form a vector of two 16-bit signed (twos- | ||
| 1677 | * complement) integers. */ | ||
| 1678 | static inline SIMD_CFUNC simd_short2 simd_make_short2(simd_short32 other) { | ||
| 1679 | return other.xy; | ||
| 1680 | } | ||
| 1681 | |||
| 1682 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 16-bit | ||
| 1683 | * signed (twos-complement) integers. */ | ||
| 1684 | static inline SIMD_CFUNC simd_short3 simd_make_short3(short x, short y, short z) { | ||
| 1685 | simd_short3 result; | ||
| 1686 | result.x = x; | ||
| 1687 | result.y = y; | ||
| 1688 | result.z = z; | ||
| 1689 | return result; | ||
| 1690 | } | ||
| 1691 | |||
| 1692 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 16-bit | ||
| 1693 | * signed (twos-complement) integers. */ | ||
| 1694 | static inline SIMD_CFUNC simd_short3 simd_make_short3(short x, simd_short2 yz) { | ||
| 1695 | simd_short3 result; | ||
| 1696 | result.x = x; | ||
| 1697 | result.yz = yz; | ||
| 1698 | return result; | ||
| 1699 | } | ||
| 1700 | |||
| 1701 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 16-bit | ||
| 1702 | * signed (twos-complement) integers. */ | ||
| 1703 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short2 xy, short z) { | ||
| 1704 | simd_short3 result; | ||
| 1705 | result.xy = xy; | ||
| 1706 | result.z = z; | ||
| 1707 | return result; | ||
| 1708 | } | ||
| 1709 | |||
| 1710 | /*! @abstract Zero-extends `other` to form a vector of three 16-bit signed | ||
| 1711 | * (twos-complement) integers. */ | ||
| 1712 | static inline SIMD_CFUNC simd_short3 simd_make_short3(short other) { | ||
| 1713 | simd_short3 result = 0; | ||
| 1714 | result.x = other; | ||
| 1715 | return result; | ||
| 1716 | } | ||
| 1717 | |||
| 1718 | /*! @abstract Extends `other` to form a vector of three 16-bit signed (twos- | ||
| 1719 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1720 | * unspecified. */ | ||
| 1721 | static inline SIMD_CFUNC simd_short3 simd_make_short3_undef(short other) { | ||
| 1722 | simd_short3 result; | ||
| 1723 | result.x = other; | ||
| 1724 | return result; | ||
| 1725 | } | ||
| 1726 | |||
| 1727 | /*! @abstract Zero-extends `other` to form a vector of three 16-bit signed | ||
| 1728 | * (twos-complement) integers. */ | ||
| 1729 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short2 other) { | ||
| 1730 | simd_short3 result = 0; | ||
| 1731 | result.xy = other; | ||
| 1732 | return result; | ||
| 1733 | } | ||
| 1734 | |||
| 1735 | /*! @abstract Extends `other` to form a vector of three 16-bit signed (twos- | ||
| 1736 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1737 | * unspecified. */ | ||
| 1738 | static inline SIMD_CFUNC simd_short3 simd_make_short3_undef(simd_short2 other) { | ||
| 1739 | simd_short3 result; | ||
| 1740 | result.xy = other; | ||
| 1741 | return result; | ||
| 1742 | } | ||
| 1743 | |||
| 1744 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1745 | * templated and autogenerated code. */ | ||
| 1746 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short3 other) { | ||
| 1747 | return other; | ||
| 1748 | } | ||
| 1749 | |||
| 1750 | /*! @abstract Truncates `other` to form a vector of three 16-bit signed | ||
| 1751 | * (twos-complement) integers. */ | ||
| 1752 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short4 other) { | ||
| 1753 | return other.xyz; | ||
| 1754 | } | ||
| 1755 | |||
| 1756 | /*! @abstract Truncates `other` to form a vector of three 16-bit signed | ||
| 1757 | * (twos-complement) integers. */ | ||
| 1758 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short8 other) { | ||
| 1759 | return other.xyz; | ||
| 1760 | } | ||
| 1761 | |||
| 1762 | /*! @abstract Truncates `other` to form a vector of three 16-bit signed | ||
| 1763 | * (twos-complement) integers. */ | ||
| 1764 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short16 other) { | ||
| 1765 | return other.xyz; | ||
| 1766 | } | ||
| 1767 | |||
| 1768 | /*! @abstract Truncates `other` to form a vector of three 16-bit signed | ||
| 1769 | * (twos-complement) integers. */ | ||
| 1770 | static inline SIMD_CFUNC simd_short3 simd_make_short3(simd_short32 other) { | ||
| 1771 | return other.xyz; | ||
| 1772 | } | ||
| 1773 | |||
| 1774 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 1775 | * 16-bit signed (twos-complement) integers. */ | ||
| 1776 | static inline SIMD_CFUNC simd_short4 simd_make_short4(short x, short y, short z, short w) { | ||
| 1777 | simd_short4 result; | ||
| 1778 | result.x = x; | ||
| 1779 | result.y = y; | ||
| 1780 | result.z = z; | ||
| 1781 | result.w = w; | ||
| 1782 | return result; | ||
| 1783 | } | ||
| 1784 | |||
| 1785 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 16-bit | ||
| 1786 | * signed (twos-complement) integers. */ | ||
| 1787 | static inline SIMD_CFUNC simd_short4 simd_make_short4(short x, short y, simd_short2 zw) { | ||
| 1788 | simd_short4 result; | ||
| 1789 | result.x = x; | ||
| 1790 | result.y = y; | ||
| 1791 | result.zw = zw; | ||
| 1792 | return result; | ||
| 1793 | } | ||
| 1794 | |||
| 1795 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 16-bit | ||
| 1796 | * signed (twos-complement) integers. */ | ||
| 1797 | static inline SIMD_CFUNC simd_short4 simd_make_short4(short x, simd_short2 yz, short w) { | ||
| 1798 | simd_short4 result; | ||
| 1799 | result.x = x; | ||
| 1800 | result.yz = yz; | ||
| 1801 | result.w = w; | ||
| 1802 | return result; | ||
| 1803 | } | ||
| 1804 | |||
| 1805 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 16-bit | ||
| 1806 | * signed (twos-complement) integers. */ | ||
| 1807 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short2 xy, short z, short w) { | ||
| 1808 | simd_short4 result; | ||
| 1809 | result.xy = xy; | ||
| 1810 | result.z = z; | ||
| 1811 | result.w = w; | ||
| 1812 | return result; | ||
| 1813 | } | ||
| 1814 | |||
| 1815 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 16-bit | ||
| 1816 | * signed (twos-complement) integers. */ | ||
| 1817 | static inline SIMD_CFUNC simd_short4 simd_make_short4(short x, simd_short3 yzw) { | ||
| 1818 | simd_short4 result; | ||
| 1819 | result.x = x; | ||
| 1820 | result.yzw = yzw; | ||
| 1821 | return result; | ||
| 1822 | } | ||
| 1823 | |||
| 1824 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 16-bit | ||
| 1825 | * signed (twos-complement) integers. */ | ||
| 1826 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short2 xy, simd_short2 zw) { | ||
| 1827 | simd_short4 result; | ||
| 1828 | result.xy = xy; | ||
| 1829 | result.zw = zw; | ||
| 1830 | return result; | ||
| 1831 | } | ||
| 1832 | |||
| 1833 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 16-bit | ||
| 1834 | * signed (twos-complement) integers. */ | ||
| 1835 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short3 xyz, short w) { | ||
| 1836 | simd_short4 result; | ||
| 1837 | result.xyz = xyz; | ||
| 1838 | result.w = w; | ||
| 1839 | return result; | ||
| 1840 | } | ||
| 1841 | |||
| 1842 | /*! @abstract Zero-extends `other` to form a vector of four 16-bit signed | ||
| 1843 | * (twos-complement) integers. */ | ||
| 1844 | static inline SIMD_CFUNC simd_short4 simd_make_short4(short other) { | ||
| 1845 | simd_short4 result = 0; | ||
| 1846 | result.x = other; | ||
| 1847 | return result; | ||
| 1848 | } | ||
| 1849 | |||
| 1850 | /*! @abstract Extends `other` to form a vector of four 16-bit signed (twos- | ||
| 1851 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1852 | * unspecified. */ | ||
| 1853 | static inline SIMD_CFUNC simd_short4 simd_make_short4_undef(short other) { | ||
| 1854 | simd_short4 result; | ||
| 1855 | result.x = other; | ||
| 1856 | return result; | ||
| 1857 | } | ||
| 1858 | |||
| 1859 | /*! @abstract Zero-extends `other` to form a vector of four 16-bit signed | ||
| 1860 | * (twos-complement) integers. */ | ||
| 1861 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short2 other) { | ||
| 1862 | simd_short4 result = 0; | ||
| 1863 | result.xy = other; | ||
| 1864 | return result; | ||
| 1865 | } | ||
| 1866 | |||
| 1867 | /*! @abstract Extends `other` to form a vector of four 16-bit signed (twos- | ||
| 1868 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1869 | * unspecified. */ | ||
| 1870 | static inline SIMD_CFUNC simd_short4 simd_make_short4_undef(simd_short2 other) { | ||
| 1871 | simd_short4 result; | ||
| 1872 | result.xy = other; | ||
| 1873 | return result; | ||
| 1874 | } | ||
| 1875 | |||
| 1876 | /*! @abstract Zero-extends `other` to form a vector of four 16-bit signed | ||
| 1877 | * (twos-complement) integers. */ | ||
| 1878 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short3 other) { | ||
| 1879 | simd_short4 result = 0; | ||
| 1880 | result.xyz = other; | ||
| 1881 | return result; | ||
| 1882 | } | ||
| 1883 | |||
| 1884 | /*! @abstract Extends `other` to form a vector of four 16-bit signed (twos- | ||
| 1885 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1886 | * unspecified. */ | ||
| 1887 | static inline SIMD_CFUNC simd_short4 simd_make_short4_undef(simd_short3 other) { | ||
| 1888 | simd_short4 result; | ||
| 1889 | result.xyz = other; | ||
| 1890 | return result; | ||
| 1891 | } | ||
| 1892 | |||
| 1893 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1894 | * templated and autogenerated code. */ | ||
| 1895 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short4 other) { | ||
| 1896 | return other; | ||
| 1897 | } | ||
| 1898 | |||
| 1899 | /*! @abstract Truncates `other` to form a vector of four 16-bit signed | ||
| 1900 | * (twos-complement) integers. */ | ||
| 1901 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short8 other) { | ||
| 1902 | return other.xyzw; | ||
| 1903 | } | ||
| 1904 | |||
| 1905 | /*! @abstract Truncates `other` to form a vector of four 16-bit signed | ||
| 1906 | * (twos-complement) integers. */ | ||
| 1907 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short16 other) { | ||
| 1908 | return other.xyzw; | ||
| 1909 | } | ||
| 1910 | |||
| 1911 | /*! @abstract Truncates `other` to form a vector of four 16-bit signed | ||
| 1912 | * (twos-complement) integers. */ | ||
| 1913 | static inline SIMD_CFUNC simd_short4 simd_make_short4(simd_short32 other) { | ||
| 1914 | return other.xyzw; | ||
| 1915 | } | ||
| 1916 | |||
| 1917 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 16-bit | ||
| 1918 | * signed (twos-complement) integers. */ | ||
| 1919 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short4 lo, simd_short4 hi) { | ||
| 1920 | simd_short8 result; | ||
| 1921 | result.lo = lo; | ||
| 1922 | result.hi = hi; | ||
| 1923 | return result; | ||
| 1924 | } | ||
| 1925 | |||
| 1926 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit signed | ||
| 1927 | * (twos-complement) integers. */ | ||
| 1928 | static inline SIMD_CFUNC simd_short8 simd_make_short8(short other) { | ||
| 1929 | simd_short8 result = 0; | ||
| 1930 | result.x = other; | ||
| 1931 | return result; | ||
| 1932 | } | ||
| 1933 | |||
| 1934 | /*! @abstract Extends `other` to form a vector of eight 16-bit signed (twos- | ||
| 1935 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1936 | * unspecified. */ | ||
| 1937 | static inline SIMD_CFUNC simd_short8 simd_make_short8_undef(short other) { | ||
| 1938 | simd_short8 result; | ||
| 1939 | result.x = other; | ||
| 1940 | return result; | ||
| 1941 | } | ||
| 1942 | |||
| 1943 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit signed | ||
| 1944 | * (twos-complement) integers. */ | ||
| 1945 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short2 other) { | ||
| 1946 | simd_short8 result = 0; | ||
| 1947 | result.xy = other; | ||
| 1948 | return result; | ||
| 1949 | } | ||
| 1950 | |||
| 1951 | /*! @abstract Extends `other` to form a vector of eight 16-bit signed (twos- | ||
| 1952 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1953 | * unspecified. */ | ||
| 1954 | static inline SIMD_CFUNC simd_short8 simd_make_short8_undef(simd_short2 other) { | ||
| 1955 | simd_short8 result; | ||
| 1956 | result.xy = other; | ||
| 1957 | return result; | ||
| 1958 | } | ||
| 1959 | |||
| 1960 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit signed | ||
| 1961 | * (twos-complement) integers. */ | ||
| 1962 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short3 other) { | ||
| 1963 | simd_short8 result = 0; | ||
| 1964 | result.xyz = other; | ||
| 1965 | return result; | ||
| 1966 | } | ||
| 1967 | |||
| 1968 | /*! @abstract Extends `other` to form a vector of eight 16-bit signed (twos- | ||
| 1969 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1970 | * unspecified. */ | ||
| 1971 | static inline SIMD_CFUNC simd_short8 simd_make_short8_undef(simd_short3 other) { | ||
| 1972 | simd_short8 result; | ||
| 1973 | result.xyz = other; | ||
| 1974 | return result; | ||
| 1975 | } | ||
| 1976 | |||
| 1977 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit signed | ||
| 1978 | * (twos-complement) integers. */ | ||
| 1979 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short4 other) { | ||
| 1980 | simd_short8 result = 0; | ||
| 1981 | result.xyzw = other; | ||
| 1982 | return result; | ||
| 1983 | } | ||
| 1984 | |||
| 1985 | /*! @abstract Extends `other` to form a vector of eight 16-bit signed (twos- | ||
| 1986 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 1987 | * unspecified. */ | ||
| 1988 | static inline SIMD_CFUNC simd_short8 simd_make_short8_undef(simd_short4 other) { | ||
| 1989 | simd_short8 result; | ||
| 1990 | result.xyzw = other; | ||
| 1991 | return result; | ||
| 1992 | } | ||
| 1993 | |||
| 1994 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 1995 | * templated and autogenerated code. */ | ||
| 1996 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short8 other) { | ||
| 1997 | return other; | ||
| 1998 | } | ||
| 1999 | |||
| 2000 | /*! @abstract Truncates `other` to form a vector of eight 16-bit signed | ||
| 2001 | * (twos-complement) integers. */ | ||
| 2002 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short16 other) { | ||
| 2003 | return simd_make_short8(other.lo); | ||
| 2004 | } | ||
| 2005 | |||
| 2006 | /*! @abstract Truncates `other` to form a vector of eight 16-bit signed | ||
| 2007 | * (twos-complement) integers. */ | ||
| 2008 | static inline SIMD_CFUNC simd_short8 simd_make_short8(simd_short32 other) { | ||
| 2009 | return simd_make_short8(other.lo); | ||
| 2010 | } | ||
| 2011 | |||
| 2012 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 16-bit | ||
| 2013 | * signed (twos-complement) integers. */ | ||
| 2014 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short8 lo, simd_short8 hi) { | ||
| 2015 | simd_short16 result; | ||
| 2016 | result.lo = lo; | ||
| 2017 | result.hi = hi; | ||
| 2018 | return result; | ||
| 2019 | } | ||
| 2020 | |||
| 2021 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit signed | ||
| 2022 | * (twos-complement) integers. */ | ||
| 2023 | static inline SIMD_CFUNC simd_short16 simd_make_short16(short other) { | ||
| 2024 | simd_short16 result = 0; | ||
| 2025 | result.x = other; | ||
| 2026 | return result; | ||
| 2027 | } | ||
| 2028 | |||
| 2029 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit signed | ||
| 2030 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2031 | * lanes are unspecified. */ | ||
| 2032 | static inline SIMD_CFUNC simd_short16 simd_make_short16_undef(short other) { | ||
| 2033 | simd_short16 result; | ||
| 2034 | result.x = other; | ||
| 2035 | return result; | ||
| 2036 | } | ||
| 2037 | |||
| 2038 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit signed | ||
| 2039 | * (twos-complement) integers. */ | ||
| 2040 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short2 other) { | ||
| 2041 | simd_short16 result = 0; | ||
| 2042 | result.xy = other; | ||
| 2043 | return result; | ||
| 2044 | } | ||
| 2045 | |||
| 2046 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit signed | ||
| 2047 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2048 | * lanes are unspecified. */ | ||
| 2049 | static inline SIMD_CFUNC simd_short16 simd_make_short16_undef(simd_short2 other) { | ||
| 2050 | simd_short16 result; | ||
| 2051 | result.xy = other; | ||
| 2052 | return result; | ||
| 2053 | } | ||
| 2054 | |||
| 2055 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit signed | ||
| 2056 | * (twos-complement) integers. */ | ||
| 2057 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short3 other) { | ||
| 2058 | simd_short16 result = 0; | ||
| 2059 | result.xyz = other; | ||
| 2060 | return result; | ||
| 2061 | } | ||
| 2062 | |||
| 2063 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit signed | ||
| 2064 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2065 | * lanes are unspecified. */ | ||
| 2066 | static inline SIMD_CFUNC simd_short16 simd_make_short16_undef(simd_short3 other) { | ||
| 2067 | simd_short16 result; | ||
| 2068 | result.xyz = other; | ||
| 2069 | return result; | ||
| 2070 | } | ||
| 2071 | |||
| 2072 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit signed | ||
| 2073 | * (twos-complement) integers. */ | ||
| 2074 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short4 other) { | ||
| 2075 | simd_short16 result = 0; | ||
| 2076 | result.xyzw = other; | ||
| 2077 | return result; | ||
| 2078 | } | ||
| 2079 | |||
| 2080 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit signed | ||
| 2081 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2082 | * lanes are unspecified. */ | ||
| 2083 | static inline SIMD_CFUNC simd_short16 simd_make_short16_undef(simd_short4 other) { | ||
| 2084 | simd_short16 result; | ||
| 2085 | result.xyzw = other; | ||
| 2086 | return result; | ||
| 2087 | } | ||
| 2088 | |||
| 2089 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit signed | ||
| 2090 | * (twos-complement) integers. */ | ||
| 2091 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short8 other) { | ||
| 2092 | simd_short16 result = 0; | ||
| 2093 | result.lo = simd_make_short8(other); | ||
| 2094 | return result; | ||
| 2095 | } | ||
| 2096 | |||
| 2097 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit signed | ||
| 2098 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2099 | * lanes are unspecified. */ | ||
| 2100 | static inline SIMD_CFUNC simd_short16 simd_make_short16_undef(simd_short8 other) { | ||
| 2101 | simd_short16 result; | ||
| 2102 | result.lo = simd_make_short8(other); | ||
| 2103 | return result; | ||
| 2104 | } | ||
| 2105 | |||
| 2106 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2107 | * templated and autogenerated code. */ | ||
| 2108 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short16 other) { | ||
| 2109 | return other; | ||
| 2110 | } | ||
| 2111 | |||
| 2112 | /*! @abstract Truncates `other` to form a vector of sixteen 16-bit signed | ||
| 2113 | * (twos-complement) integers. */ | ||
| 2114 | static inline SIMD_CFUNC simd_short16 simd_make_short16(simd_short32 other) { | ||
| 2115 | return simd_make_short16(other.lo); | ||
| 2116 | } | ||
| 2117 | |||
| 2118 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 2119 | * 16-bit signed (twos-complement) integers. */ | ||
| 2120 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short16 lo, simd_short16 hi) { | ||
| 2121 | simd_short32 result; | ||
| 2122 | result.lo = lo; | ||
| 2123 | result.hi = hi; | ||
| 2124 | return result; | ||
| 2125 | } | ||
| 2126 | |||
| 2127 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2128 | * signed (twos-complement) integers. */ | ||
| 2129 | static inline SIMD_CFUNC simd_short32 simd_make_short32(short other) { | ||
| 2130 | simd_short32 result = 0; | ||
| 2131 | result.x = other; | ||
| 2132 | return result; | ||
| 2133 | } | ||
| 2134 | |||
| 2135 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 2136 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2137 | * lanes are unspecified. */ | ||
| 2138 | static inline SIMD_CFUNC simd_short32 simd_make_short32_undef(short other) { | ||
| 2139 | simd_short32 result; | ||
| 2140 | result.x = other; | ||
| 2141 | return result; | ||
| 2142 | } | ||
| 2143 | |||
| 2144 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2145 | * signed (twos-complement) integers. */ | ||
| 2146 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short2 other) { | ||
| 2147 | simd_short32 result = 0; | ||
| 2148 | result.xy = other; | ||
| 2149 | return result; | ||
| 2150 | } | ||
| 2151 | |||
| 2152 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 2153 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2154 | * lanes are unspecified. */ | ||
| 2155 | static inline SIMD_CFUNC simd_short32 simd_make_short32_undef(simd_short2 other) { | ||
| 2156 | simd_short32 result; | ||
| 2157 | result.xy = other; | ||
| 2158 | return result; | ||
| 2159 | } | ||
| 2160 | |||
| 2161 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2162 | * signed (twos-complement) integers. */ | ||
| 2163 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short3 other) { | ||
| 2164 | simd_short32 result = 0; | ||
| 2165 | result.xyz = other; | ||
| 2166 | return result; | ||
| 2167 | } | ||
| 2168 | |||
| 2169 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 2170 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2171 | * lanes are unspecified. */ | ||
| 2172 | static inline SIMD_CFUNC simd_short32 simd_make_short32_undef(simd_short3 other) { | ||
| 2173 | simd_short32 result; | ||
| 2174 | result.xyz = other; | ||
| 2175 | return result; | ||
| 2176 | } | ||
| 2177 | |||
| 2178 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2179 | * signed (twos-complement) integers. */ | ||
| 2180 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short4 other) { | ||
| 2181 | simd_short32 result = 0; | ||
| 2182 | result.xyzw = other; | ||
| 2183 | return result; | ||
| 2184 | } | ||
| 2185 | |||
| 2186 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 2187 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2188 | * lanes are unspecified. */ | ||
| 2189 | static inline SIMD_CFUNC simd_short32 simd_make_short32_undef(simd_short4 other) { | ||
| 2190 | simd_short32 result; | ||
| 2191 | result.xyzw = other; | ||
| 2192 | return result; | ||
| 2193 | } | ||
| 2194 | |||
| 2195 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2196 | * signed (twos-complement) integers. */ | ||
| 2197 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short8 other) { | ||
| 2198 | simd_short32 result = 0; | ||
| 2199 | result.lo = simd_make_short16(other); | ||
| 2200 | return result; | ||
| 2201 | } | ||
| 2202 | |||
| 2203 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 2204 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2205 | * lanes are unspecified. */ | ||
| 2206 | static inline SIMD_CFUNC simd_short32 simd_make_short32_undef(simd_short8 other) { | ||
| 2207 | simd_short32 result; | ||
| 2208 | result.lo = simd_make_short16(other); | ||
| 2209 | return result; | ||
| 2210 | } | ||
| 2211 | |||
| 2212 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2213 | * signed (twos-complement) integers. */ | ||
| 2214 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short16 other) { | ||
| 2215 | simd_short32 result = 0; | ||
| 2216 | result.lo = simd_make_short16(other); | ||
| 2217 | return result; | ||
| 2218 | } | ||
| 2219 | |||
| 2220 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 2221 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 2222 | * lanes are unspecified. */ | ||
| 2223 | static inline SIMD_CFUNC simd_short32 simd_make_short32_undef(simd_short16 other) { | ||
| 2224 | simd_short32 result; | ||
| 2225 | result.lo = simd_make_short16(other); | ||
| 2226 | return result; | ||
| 2227 | } | ||
| 2228 | |||
| 2229 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2230 | * templated and autogenerated code. */ | ||
| 2231 | static inline SIMD_CFUNC simd_short32 simd_make_short32(simd_short32 other) { | ||
| 2232 | return other; | ||
| 2233 | } | ||
| 2234 | |||
| 2235 | /*! @abstract Concatenates `x` and `y` to form a vector of two 16-bit | ||
| 2236 | * unsigned integers. */ | ||
| 2237 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(unsigned short x, unsigned short y) { | ||
| 2238 | simd_ushort2 result; | ||
| 2239 | result.x = x; | ||
| 2240 | result.y = y; | ||
| 2241 | return result; | ||
| 2242 | } | ||
| 2243 | |||
| 2244 | /*! @abstract Zero-extends `other` to form a vector of two 16-bit unsigned | ||
| 2245 | * integers. */ | ||
| 2246 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(unsigned short other) { | ||
| 2247 | simd_ushort2 result = 0; | ||
| 2248 | result.x = other; | ||
| 2249 | return result; | ||
| 2250 | } | ||
| 2251 | |||
| 2252 | /*! @abstract Extends `other` to form a vector of two 16-bit unsigned | ||
| 2253 | * integers. The contents of the newly-created vector lanes are | ||
| 2254 | * unspecified. */ | ||
| 2255 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2_undef(unsigned short other) { | ||
| 2256 | simd_ushort2 result; | ||
| 2257 | result.x = other; | ||
| 2258 | return result; | ||
| 2259 | } | ||
| 2260 | |||
| 2261 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2262 | * templated and autogenerated code. */ | ||
| 2263 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(simd_ushort2 other) { | ||
| 2264 | return other; | ||
| 2265 | } | ||
| 2266 | |||
| 2267 | /*! @abstract Truncates `other` to form a vector of two 16-bit unsigned | ||
| 2268 | * integers. */ | ||
| 2269 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(simd_ushort3 other) { | ||
| 2270 | return other.xy; | ||
| 2271 | } | ||
| 2272 | |||
| 2273 | /*! @abstract Truncates `other` to form a vector of two 16-bit unsigned | ||
| 2274 | * integers. */ | ||
| 2275 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(simd_ushort4 other) { | ||
| 2276 | return other.xy; | ||
| 2277 | } | ||
| 2278 | |||
| 2279 | /*! @abstract Truncates `other` to form a vector of two 16-bit unsigned | ||
| 2280 | * integers. */ | ||
| 2281 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(simd_ushort8 other) { | ||
| 2282 | return other.xy; | ||
| 2283 | } | ||
| 2284 | |||
| 2285 | /*! @abstract Truncates `other` to form a vector of two 16-bit unsigned | ||
| 2286 | * integers. */ | ||
| 2287 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(simd_ushort16 other) { | ||
| 2288 | return other.xy; | ||
| 2289 | } | ||
| 2290 | |||
| 2291 | /*! @abstract Truncates `other` to form a vector of two 16-bit unsigned | ||
| 2292 | * integers. */ | ||
| 2293 | static inline SIMD_CFUNC simd_ushort2 simd_make_ushort2(simd_ushort32 other) { | ||
| 2294 | return other.xy; | ||
| 2295 | } | ||
| 2296 | |||
| 2297 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 16-bit | ||
| 2298 | * unsigned integers. */ | ||
| 2299 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(unsigned short x, unsigned short y, unsigned short z) { | ||
| 2300 | simd_ushort3 result; | ||
| 2301 | result.x = x; | ||
| 2302 | result.y = y; | ||
| 2303 | result.z = z; | ||
| 2304 | return result; | ||
| 2305 | } | ||
| 2306 | |||
| 2307 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 16-bit | ||
| 2308 | * unsigned integers. */ | ||
| 2309 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(unsigned short x, simd_ushort2 yz) { | ||
| 2310 | simd_ushort3 result; | ||
| 2311 | result.x = x; | ||
| 2312 | result.yz = yz; | ||
| 2313 | return result; | ||
| 2314 | } | ||
| 2315 | |||
| 2316 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 16-bit | ||
| 2317 | * unsigned integers. */ | ||
| 2318 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort2 xy, unsigned short z) { | ||
| 2319 | simd_ushort3 result; | ||
| 2320 | result.xy = xy; | ||
| 2321 | result.z = z; | ||
| 2322 | return result; | ||
| 2323 | } | ||
| 2324 | |||
| 2325 | /*! @abstract Zero-extends `other` to form a vector of three 16-bit unsigned | ||
| 2326 | * integers. */ | ||
| 2327 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(unsigned short other) { | ||
| 2328 | simd_ushort3 result = 0; | ||
| 2329 | result.x = other; | ||
| 2330 | return result; | ||
| 2331 | } | ||
| 2332 | |||
| 2333 | /*! @abstract Extends `other` to form a vector of three 16-bit unsigned | ||
| 2334 | * integers. The contents of the newly-created vector lanes are | ||
| 2335 | * unspecified. */ | ||
| 2336 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3_undef(unsigned short other) { | ||
| 2337 | simd_ushort3 result; | ||
| 2338 | result.x = other; | ||
| 2339 | return result; | ||
| 2340 | } | ||
| 2341 | |||
| 2342 | /*! @abstract Zero-extends `other` to form a vector of three 16-bit unsigned | ||
| 2343 | * integers. */ | ||
| 2344 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort2 other) { | ||
| 2345 | simd_ushort3 result = 0; | ||
| 2346 | result.xy = other; | ||
| 2347 | return result; | ||
| 2348 | } | ||
| 2349 | |||
| 2350 | /*! @abstract Extends `other` to form a vector of three 16-bit unsigned | ||
| 2351 | * integers. The contents of the newly-created vector lanes are | ||
| 2352 | * unspecified. */ | ||
| 2353 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3_undef(simd_ushort2 other) { | ||
| 2354 | simd_ushort3 result; | ||
| 2355 | result.xy = other; | ||
| 2356 | return result; | ||
| 2357 | } | ||
| 2358 | |||
| 2359 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2360 | * templated and autogenerated code. */ | ||
| 2361 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort3 other) { | ||
| 2362 | return other; | ||
| 2363 | } | ||
| 2364 | |||
| 2365 | /*! @abstract Truncates `other` to form a vector of three 16-bit unsigned | ||
| 2366 | * integers. */ | ||
| 2367 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort4 other) { | ||
| 2368 | return other.xyz; | ||
| 2369 | } | ||
| 2370 | |||
| 2371 | /*! @abstract Truncates `other` to form a vector of three 16-bit unsigned | ||
| 2372 | * integers. */ | ||
| 2373 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort8 other) { | ||
| 2374 | return other.xyz; | ||
| 2375 | } | ||
| 2376 | |||
| 2377 | /*! @abstract Truncates `other` to form a vector of three 16-bit unsigned | ||
| 2378 | * integers. */ | ||
| 2379 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort16 other) { | ||
| 2380 | return other.xyz; | ||
| 2381 | } | ||
| 2382 | |||
| 2383 | /*! @abstract Truncates `other` to form a vector of three 16-bit unsigned | ||
| 2384 | * integers. */ | ||
| 2385 | static inline SIMD_CFUNC simd_ushort3 simd_make_ushort3(simd_ushort32 other) { | ||
| 2386 | return other.xyz; | ||
| 2387 | } | ||
| 2388 | |||
| 2389 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 2390 | * 16-bit unsigned integers. */ | ||
| 2391 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w) { | ||
| 2392 | simd_ushort4 result; | ||
| 2393 | result.x = x; | ||
| 2394 | result.y = y; | ||
| 2395 | result.z = z; | ||
| 2396 | result.w = w; | ||
| 2397 | return result; | ||
| 2398 | } | ||
| 2399 | |||
| 2400 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 16-bit | ||
| 2401 | * unsigned integers. */ | ||
| 2402 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(unsigned short x, unsigned short y, simd_ushort2 zw) { | ||
| 2403 | simd_ushort4 result; | ||
| 2404 | result.x = x; | ||
| 2405 | result.y = y; | ||
| 2406 | result.zw = zw; | ||
| 2407 | return result; | ||
| 2408 | } | ||
| 2409 | |||
| 2410 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 16-bit | ||
| 2411 | * unsigned integers. */ | ||
| 2412 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(unsigned short x, simd_ushort2 yz, unsigned short w) { | ||
| 2413 | simd_ushort4 result; | ||
| 2414 | result.x = x; | ||
| 2415 | result.yz = yz; | ||
| 2416 | result.w = w; | ||
| 2417 | return result; | ||
| 2418 | } | ||
| 2419 | |||
| 2420 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 16-bit | ||
| 2421 | * unsigned integers. */ | ||
| 2422 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort2 xy, unsigned short z, unsigned short w) { | ||
| 2423 | simd_ushort4 result; | ||
| 2424 | result.xy = xy; | ||
| 2425 | result.z = z; | ||
| 2426 | result.w = w; | ||
| 2427 | return result; | ||
| 2428 | } | ||
| 2429 | |||
| 2430 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 16-bit | ||
| 2431 | * unsigned integers. */ | ||
| 2432 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(unsigned short x, simd_ushort3 yzw) { | ||
| 2433 | simd_ushort4 result; | ||
| 2434 | result.x = x; | ||
| 2435 | result.yzw = yzw; | ||
| 2436 | return result; | ||
| 2437 | } | ||
| 2438 | |||
| 2439 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 16-bit | ||
| 2440 | * unsigned integers. */ | ||
| 2441 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort2 xy, simd_ushort2 zw) { | ||
| 2442 | simd_ushort4 result; | ||
| 2443 | result.xy = xy; | ||
| 2444 | result.zw = zw; | ||
| 2445 | return result; | ||
| 2446 | } | ||
| 2447 | |||
| 2448 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 16-bit | ||
| 2449 | * unsigned integers. */ | ||
| 2450 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort3 xyz, unsigned short w) { | ||
| 2451 | simd_ushort4 result; | ||
| 2452 | result.xyz = xyz; | ||
| 2453 | result.w = w; | ||
| 2454 | return result; | ||
| 2455 | } | ||
| 2456 | |||
| 2457 | /*! @abstract Zero-extends `other` to form a vector of four 16-bit unsigned | ||
| 2458 | * integers. */ | ||
| 2459 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(unsigned short other) { | ||
| 2460 | simd_ushort4 result = 0; | ||
| 2461 | result.x = other; | ||
| 2462 | return result; | ||
| 2463 | } | ||
| 2464 | |||
| 2465 | /*! @abstract Extends `other` to form a vector of four 16-bit unsigned | ||
| 2466 | * integers. The contents of the newly-created vector lanes are | ||
| 2467 | * unspecified. */ | ||
| 2468 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4_undef(unsigned short other) { | ||
| 2469 | simd_ushort4 result; | ||
| 2470 | result.x = other; | ||
| 2471 | return result; | ||
| 2472 | } | ||
| 2473 | |||
| 2474 | /*! @abstract Zero-extends `other` to form a vector of four 16-bit unsigned | ||
| 2475 | * integers. */ | ||
| 2476 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort2 other) { | ||
| 2477 | simd_ushort4 result = 0; | ||
| 2478 | result.xy = other; | ||
| 2479 | return result; | ||
| 2480 | } | ||
| 2481 | |||
| 2482 | /*! @abstract Extends `other` to form a vector of four 16-bit unsigned | ||
| 2483 | * integers. The contents of the newly-created vector lanes are | ||
| 2484 | * unspecified. */ | ||
| 2485 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4_undef(simd_ushort2 other) { | ||
| 2486 | simd_ushort4 result; | ||
| 2487 | result.xy = other; | ||
| 2488 | return result; | ||
| 2489 | } | ||
| 2490 | |||
| 2491 | /*! @abstract Zero-extends `other` to form a vector of four 16-bit unsigned | ||
| 2492 | * integers. */ | ||
| 2493 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort3 other) { | ||
| 2494 | simd_ushort4 result = 0; | ||
| 2495 | result.xyz = other; | ||
| 2496 | return result; | ||
| 2497 | } | ||
| 2498 | |||
| 2499 | /*! @abstract Extends `other` to form a vector of four 16-bit unsigned | ||
| 2500 | * integers. The contents of the newly-created vector lanes are | ||
| 2501 | * unspecified. */ | ||
| 2502 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4_undef(simd_ushort3 other) { | ||
| 2503 | simd_ushort4 result; | ||
| 2504 | result.xyz = other; | ||
| 2505 | return result; | ||
| 2506 | } | ||
| 2507 | |||
| 2508 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2509 | * templated and autogenerated code. */ | ||
| 2510 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort4 other) { | ||
| 2511 | return other; | ||
| 2512 | } | ||
| 2513 | |||
| 2514 | /*! @abstract Truncates `other` to form a vector of four 16-bit unsigned | ||
| 2515 | * integers. */ | ||
| 2516 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort8 other) { | ||
| 2517 | return other.xyzw; | ||
| 2518 | } | ||
| 2519 | |||
| 2520 | /*! @abstract Truncates `other` to form a vector of four 16-bit unsigned | ||
| 2521 | * integers. */ | ||
| 2522 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort16 other) { | ||
| 2523 | return other.xyzw; | ||
| 2524 | } | ||
| 2525 | |||
| 2526 | /*! @abstract Truncates `other` to form a vector of four 16-bit unsigned | ||
| 2527 | * integers. */ | ||
| 2528 | static inline SIMD_CFUNC simd_ushort4 simd_make_ushort4(simd_ushort32 other) { | ||
| 2529 | return other.xyzw; | ||
| 2530 | } | ||
| 2531 | |||
| 2532 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 16-bit | ||
| 2533 | * unsigned integers. */ | ||
| 2534 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort4 lo, simd_ushort4 hi) { | ||
| 2535 | simd_ushort8 result; | ||
| 2536 | result.lo = lo; | ||
| 2537 | result.hi = hi; | ||
| 2538 | return result; | ||
| 2539 | } | ||
| 2540 | |||
| 2541 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit unsigned | ||
| 2542 | * integers. */ | ||
| 2543 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(unsigned short other) { | ||
| 2544 | simd_ushort8 result = 0; | ||
| 2545 | result.x = other; | ||
| 2546 | return result; | ||
| 2547 | } | ||
| 2548 | |||
| 2549 | /*! @abstract Extends `other` to form a vector of eight 16-bit unsigned | ||
| 2550 | * integers. The contents of the newly-created vector lanes are | ||
| 2551 | * unspecified. */ | ||
| 2552 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8_undef(unsigned short other) { | ||
| 2553 | simd_ushort8 result; | ||
| 2554 | result.x = other; | ||
| 2555 | return result; | ||
| 2556 | } | ||
| 2557 | |||
| 2558 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit unsigned | ||
| 2559 | * integers. */ | ||
| 2560 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort2 other) { | ||
| 2561 | simd_ushort8 result = 0; | ||
| 2562 | result.xy = other; | ||
| 2563 | return result; | ||
| 2564 | } | ||
| 2565 | |||
| 2566 | /*! @abstract Extends `other` to form a vector of eight 16-bit unsigned | ||
| 2567 | * integers. The contents of the newly-created vector lanes are | ||
| 2568 | * unspecified. */ | ||
| 2569 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8_undef(simd_ushort2 other) { | ||
| 2570 | simd_ushort8 result; | ||
| 2571 | result.xy = other; | ||
| 2572 | return result; | ||
| 2573 | } | ||
| 2574 | |||
| 2575 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit unsigned | ||
| 2576 | * integers. */ | ||
| 2577 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort3 other) { | ||
| 2578 | simd_ushort8 result = 0; | ||
| 2579 | result.xyz = other; | ||
| 2580 | return result; | ||
| 2581 | } | ||
| 2582 | |||
| 2583 | /*! @abstract Extends `other` to form a vector of eight 16-bit unsigned | ||
| 2584 | * integers. The contents of the newly-created vector lanes are | ||
| 2585 | * unspecified. */ | ||
| 2586 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8_undef(simd_ushort3 other) { | ||
| 2587 | simd_ushort8 result; | ||
| 2588 | result.xyz = other; | ||
| 2589 | return result; | ||
| 2590 | } | ||
| 2591 | |||
| 2592 | /*! @abstract Zero-extends `other` to form a vector of eight 16-bit unsigned | ||
| 2593 | * integers. */ | ||
| 2594 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort4 other) { | ||
| 2595 | simd_ushort8 result = 0; | ||
| 2596 | result.xyzw = other; | ||
| 2597 | return result; | ||
| 2598 | } | ||
| 2599 | |||
| 2600 | /*! @abstract Extends `other` to form a vector of eight 16-bit unsigned | ||
| 2601 | * integers. The contents of the newly-created vector lanes are | ||
| 2602 | * unspecified. */ | ||
| 2603 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8_undef(simd_ushort4 other) { | ||
| 2604 | simd_ushort8 result; | ||
| 2605 | result.xyzw = other; | ||
| 2606 | return result; | ||
| 2607 | } | ||
| 2608 | |||
| 2609 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2610 | * templated and autogenerated code. */ | ||
| 2611 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort8 other) { | ||
| 2612 | return other; | ||
| 2613 | } | ||
| 2614 | |||
| 2615 | /*! @abstract Truncates `other` to form a vector of eight 16-bit unsigned | ||
| 2616 | * integers. */ | ||
| 2617 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort16 other) { | ||
| 2618 | return simd_make_ushort8(other.lo); | ||
| 2619 | } | ||
| 2620 | |||
| 2621 | /*! @abstract Truncates `other` to form a vector of eight 16-bit unsigned | ||
| 2622 | * integers. */ | ||
| 2623 | static inline SIMD_CFUNC simd_ushort8 simd_make_ushort8(simd_ushort32 other) { | ||
| 2624 | return simd_make_ushort8(other.lo); | ||
| 2625 | } | ||
| 2626 | |||
| 2627 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 16-bit | ||
| 2628 | * unsigned integers. */ | ||
| 2629 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort8 lo, simd_ushort8 hi) { | ||
| 2630 | simd_ushort16 result; | ||
| 2631 | result.lo = lo; | ||
| 2632 | result.hi = hi; | ||
| 2633 | return result; | ||
| 2634 | } | ||
| 2635 | |||
| 2636 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit | ||
| 2637 | * unsigned integers. */ | ||
| 2638 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(unsigned short other) { | ||
| 2639 | simd_ushort16 result = 0; | ||
| 2640 | result.x = other; | ||
| 2641 | return result; | ||
| 2642 | } | ||
| 2643 | |||
| 2644 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit unsigned | ||
| 2645 | * integers. The contents of the newly-created vector lanes are | ||
| 2646 | * unspecified. */ | ||
| 2647 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16_undef(unsigned short other) { | ||
| 2648 | simd_ushort16 result; | ||
| 2649 | result.x = other; | ||
| 2650 | return result; | ||
| 2651 | } | ||
| 2652 | |||
| 2653 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit | ||
| 2654 | * unsigned integers. */ | ||
| 2655 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort2 other) { | ||
| 2656 | simd_ushort16 result = 0; | ||
| 2657 | result.xy = other; | ||
| 2658 | return result; | ||
| 2659 | } | ||
| 2660 | |||
| 2661 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit unsigned | ||
| 2662 | * integers. The contents of the newly-created vector lanes are | ||
| 2663 | * unspecified. */ | ||
| 2664 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16_undef(simd_ushort2 other) { | ||
| 2665 | simd_ushort16 result; | ||
| 2666 | result.xy = other; | ||
| 2667 | return result; | ||
| 2668 | } | ||
| 2669 | |||
| 2670 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit | ||
| 2671 | * unsigned integers. */ | ||
| 2672 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort3 other) { | ||
| 2673 | simd_ushort16 result = 0; | ||
| 2674 | result.xyz = other; | ||
| 2675 | return result; | ||
| 2676 | } | ||
| 2677 | |||
| 2678 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit unsigned | ||
| 2679 | * integers. The contents of the newly-created vector lanes are | ||
| 2680 | * unspecified. */ | ||
| 2681 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16_undef(simd_ushort3 other) { | ||
| 2682 | simd_ushort16 result; | ||
| 2683 | result.xyz = other; | ||
| 2684 | return result; | ||
| 2685 | } | ||
| 2686 | |||
| 2687 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit | ||
| 2688 | * unsigned integers. */ | ||
| 2689 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort4 other) { | ||
| 2690 | simd_ushort16 result = 0; | ||
| 2691 | result.xyzw = other; | ||
| 2692 | return result; | ||
| 2693 | } | ||
| 2694 | |||
| 2695 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit unsigned | ||
| 2696 | * integers. The contents of the newly-created vector lanes are | ||
| 2697 | * unspecified. */ | ||
| 2698 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16_undef(simd_ushort4 other) { | ||
| 2699 | simd_ushort16 result; | ||
| 2700 | result.xyzw = other; | ||
| 2701 | return result; | ||
| 2702 | } | ||
| 2703 | |||
| 2704 | /*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit | ||
| 2705 | * unsigned integers. */ | ||
| 2706 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort8 other) { | ||
| 2707 | simd_ushort16 result = 0; | ||
| 2708 | result.lo = simd_make_ushort8(other); | ||
| 2709 | return result; | ||
| 2710 | } | ||
| 2711 | |||
| 2712 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit unsigned | ||
| 2713 | * integers. The contents of the newly-created vector lanes are | ||
| 2714 | * unspecified. */ | ||
| 2715 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16_undef(simd_ushort8 other) { | ||
| 2716 | simd_ushort16 result; | ||
| 2717 | result.lo = simd_make_ushort8(other); | ||
| 2718 | return result; | ||
| 2719 | } | ||
| 2720 | |||
| 2721 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2722 | * templated and autogenerated code. */ | ||
| 2723 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort16 other) { | ||
| 2724 | return other; | ||
| 2725 | } | ||
| 2726 | |||
| 2727 | /*! @abstract Truncates `other` to form a vector of sixteen 16-bit unsigned | ||
| 2728 | * integers. */ | ||
| 2729 | static inline SIMD_CFUNC simd_ushort16 simd_make_ushort16(simd_ushort32 other) { | ||
| 2730 | return simd_make_ushort16(other.lo); | ||
| 2731 | } | ||
| 2732 | |||
| 2733 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 2734 | * 16-bit unsigned integers. */ | ||
| 2735 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort16 lo, simd_ushort16 hi) { | ||
| 2736 | simd_ushort32 result; | ||
| 2737 | result.lo = lo; | ||
| 2738 | result.hi = hi; | ||
| 2739 | return result; | ||
| 2740 | } | ||
| 2741 | |||
| 2742 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2743 | * unsigned integers. */ | ||
| 2744 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(unsigned short other) { | ||
| 2745 | simd_ushort32 result = 0; | ||
| 2746 | result.x = other; | ||
| 2747 | return result; | ||
| 2748 | } | ||
| 2749 | |||
| 2750 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 2751 | * integers. The contents of the newly-created vector lanes are | ||
| 2752 | * unspecified. */ | ||
| 2753 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32_undef(unsigned short other) { | ||
| 2754 | simd_ushort32 result; | ||
| 2755 | result.x = other; | ||
| 2756 | return result; | ||
| 2757 | } | ||
| 2758 | |||
| 2759 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2760 | * unsigned integers. */ | ||
| 2761 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort2 other) { | ||
| 2762 | simd_ushort32 result = 0; | ||
| 2763 | result.xy = other; | ||
| 2764 | return result; | ||
| 2765 | } | ||
| 2766 | |||
| 2767 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 2768 | * integers. The contents of the newly-created vector lanes are | ||
| 2769 | * unspecified. */ | ||
| 2770 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32_undef(simd_ushort2 other) { | ||
| 2771 | simd_ushort32 result; | ||
| 2772 | result.xy = other; | ||
| 2773 | return result; | ||
| 2774 | } | ||
| 2775 | |||
| 2776 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2777 | * unsigned integers. */ | ||
| 2778 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort3 other) { | ||
| 2779 | simd_ushort32 result = 0; | ||
| 2780 | result.xyz = other; | ||
| 2781 | return result; | ||
| 2782 | } | ||
| 2783 | |||
| 2784 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 2785 | * integers. The contents of the newly-created vector lanes are | ||
| 2786 | * unspecified. */ | ||
| 2787 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32_undef(simd_ushort3 other) { | ||
| 2788 | simd_ushort32 result; | ||
| 2789 | result.xyz = other; | ||
| 2790 | return result; | ||
| 2791 | } | ||
| 2792 | |||
| 2793 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2794 | * unsigned integers. */ | ||
| 2795 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort4 other) { | ||
| 2796 | simd_ushort32 result = 0; | ||
| 2797 | result.xyzw = other; | ||
| 2798 | return result; | ||
| 2799 | } | ||
| 2800 | |||
| 2801 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 2802 | * integers. The contents of the newly-created vector lanes are | ||
| 2803 | * unspecified. */ | ||
| 2804 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32_undef(simd_ushort4 other) { | ||
| 2805 | simd_ushort32 result; | ||
| 2806 | result.xyzw = other; | ||
| 2807 | return result; | ||
| 2808 | } | ||
| 2809 | |||
| 2810 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2811 | * unsigned integers. */ | ||
| 2812 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort8 other) { | ||
| 2813 | simd_ushort32 result = 0; | ||
| 2814 | result.lo = simd_make_ushort16(other); | ||
| 2815 | return result; | ||
| 2816 | } | ||
| 2817 | |||
| 2818 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 2819 | * integers. The contents of the newly-created vector lanes are | ||
| 2820 | * unspecified. */ | ||
| 2821 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32_undef(simd_ushort8 other) { | ||
| 2822 | simd_ushort32 result; | ||
| 2823 | result.lo = simd_make_ushort16(other); | ||
| 2824 | return result; | ||
| 2825 | } | ||
| 2826 | |||
| 2827 | /*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit | ||
| 2828 | * unsigned integers. */ | ||
| 2829 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort16 other) { | ||
| 2830 | simd_ushort32 result = 0; | ||
| 2831 | result.lo = simd_make_ushort16(other); | ||
| 2832 | return result; | ||
| 2833 | } | ||
| 2834 | |||
| 2835 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 2836 | * integers. The contents of the newly-created vector lanes are | ||
| 2837 | * unspecified. */ | ||
| 2838 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32_undef(simd_ushort16 other) { | ||
| 2839 | simd_ushort32 result; | ||
| 2840 | result.lo = simd_make_ushort16(other); | ||
| 2841 | return result; | ||
| 2842 | } | ||
| 2843 | |||
| 2844 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2845 | * templated and autogenerated code. */ | ||
| 2846 | static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort32 other) { | ||
| 2847 | return other; | ||
| 2848 | } | ||
| 2849 | |||
| 2850 | /*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed | ||
| 2851 | * (twos-complement) integers. */ | ||
| 2852 | static inline SIMD_CFUNC simd_int2 simd_make_int2(int x, int y) { | ||
| 2853 | simd_int2 result; | ||
| 2854 | result.x = x; | ||
| 2855 | result.y = y; | ||
| 2856 | return result; | ||
| 2857 | } | ||
| 2858 | |||
| 2859 | /*! @abstract Zero-extends `other` to form a vector of two 32-bit signed | ||
| 2860 | * (twos-complement) integers. */ | ||
| 2861 | static inline SIMD_CFUNC simd_int2 simd_make_int2(int other) { | ||
| 2862 | simd_int2 result = 0; | ||
| 2863 | result.x = other; | ||
| 2864 | return result; | ||
| 2865 | } | ||
| 2866 | |||
| 2867 | /*! @abstract Extends `other` to form a vector of two 32-bit signed (twos- | ||
| 2868 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 2869 | * unspecified. */ | ||
| 2870 | static inline SIMD_CFUNC simd_int2 simd_make_int2_undef(int other) { | ||
| 2871 | simd_int2 result; | ||
| 2872 | result.x = other; | ||
| 2873 | return result; | ||
| 2874 | } | ||
| 2875 | |||
| 2876 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2877 | * templated and autogenerated code. */ | ||
| 2878 | static inline SIMD_CFUNC simd_int2 simd_make_int2(simd_int2 other) { | ||
| 2879 | return other; | ||
| 2880 | } | ||
| 2881 | |||
| 2882 | /*! @abstract Truncates `other` to form a vector of two 32-bit signed (twos- | ||
| 2883 | * complement) integers. */ | ||
| 2884 | static inline SIMD_CFUNC simd_int2 simd_make_int2(simd_int3 other) { | ||
| 2885 | return other.xy; | ||
| 2886 | } | ||
| 2887 | |||
| 2888 | /*! @abstract Truncates `other` to form a vector of two 32-bit signed (twos- | ||
| 2889 | * complement) integers. */ | ||
| 2890 | static inline SIMD_CFUNC simd_int2 simd_make_int2(simd_int4 other) { | ||
| 2891 | return other.xy; | ||
| 2892 | } | ||
| 2893 | |||
| 2894 | /*! @abstract Truncates `other` to form a vector of two 32-bit signed (twos- | ||
| 2895 | * complement) integers. */ | ||
| 2896 | static inline SIMD_CFUNC simd_int2 simd_make_int2(simd_int8 other) { | ||
| 2897 | return other.xy; | ||
| 2898 | } | ||
| 2899 | |||
| 2900 | /*! @abstract Truncates `other` to form a vector of two 32-bit signed (twos- | ||
| 2901 | * complement) integers. */ | ||
| 2902 | static inline SIMD_CFUNC simd_int2 simd_make_int2(simd_int16 other) { | ||
| 2903 | return other.xy; | ||
| 2904 | } | ||
| 2905 | |||
| 2906 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 32-bit | ||
| 2907 | * signed (twos-complement) integers. */ | ||
| 2908 | static inline SIMD_CFUNC simd_int3 simd_make_int3(int x, int y, int z) { | ||
| 2909 | simd_int3 result; | ||
| 2910 | result.x = x; | ||
| 2911 | result.y = y; | ||
| 2912 | result.z = z; | ||
| 2913 | return result; | ||
| 2914 | } | ||
| 2915 | |||
| 2916 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 32-bit | ||
| 2917 | * signed (twos-complement) integers. */ | ||
| 2918 | static inline SIMD_CFUNC simd_int3 simd_make_int3(int x, simd_int2 yz) { | ||
| 2919 | simd_int3 result; | ||
| 2920 | result.x = x; | ||
| 2921 | result.yz = yz; | ||
| 2922 | return result; | ||
| 2923 | } | ||
| 2924 | |||
| 2925 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 32-bit | ||
| 2926 | * signed (twos-complement) integers. */ | ||
| 2927 | static inline SIMD_CFUNC simd_int3 simd_make_int3(simd_int2 xy, int z) { | ||
| 2928 | simd_int3 result; | ||
| 2929 | result.xy = xy; | ||
| 2930 | result.z = z; | ||
| 2931 | return result; | ||
| 2932 | } | ||
| 2933 | |||
| 2934 | /*! @abstract Zero-extends `other` to form a vector of three 32-bit signed | ||
| 2935 | * (twos-complement) integers. */ | ||
| 2936 | static inline SIMD_CFUNC simd_int3 simd_make_int3(int other) { | ||
| 2937 | simd_int3 result = 0; | ||
| 2938 | result.x = other; | ||
| 2939 | return result; | ||
| 2940 | } | ||
| 2941 | |||
| 2942 | /*! @abstract Extends `other` to form a vector of three 32-bit signed (twos- | ||
| 2943 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 2944 | * unspecified. */ | ||
| 2945 | static inline SIMD_CFUNC simd_int3 simd_make_int3_undef(int other) { | ||
| 2946 | simd_int3 result; | ||
| 2947 | result.x = other; | ||
| 2948 | return result; | ||
| 2949 | } | ||
| 2950 | |||
| 2951 | /*! @abstract Zero-extends `other` to form a vector of three 32-bit signed | ||
| 2952 | * (twos-complement) integers. */ | ||
| 2953 | static inline SIMD_CFUNC simd_int3 simd_make_int3(simd_int2 other) { | ||
| 2954 | simd_int3 result = 0; | ||
| 2955 | result.xy = other; | ||
| 2956 | return result; | ||
| 2957 | } | ||
| 2958 | |||
| 2959 | /*! @abstract Extends `other` to form a vector of three 32-bit signed (twos- | ||
| 2960 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 2961 | * unspecified. */ | ||
| 2962 | static inline SIMD_CFUNC simd_int3 simd_make_int3_undef(simd_int2 other) { | ||
| 2963 | simd_int3 result; | ||
| 2964 | result.xy = other; | ||
| 2965 | return result; | ||
| 2966 | } | ||
| 2967 | |||
| 2968 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 2969 | * templated and autogenerated code. */ | ||
| 2970 | static inline SIMD_CFUNC simd_int3 simd_make_int3(simd_int3 other) { | ||
| 2971 | return other; | ||
| 2972 | } | ||
| 2973 | |||
| 2974 | /*! @abstract Truncates `other` to form a vector of three 32-bit signed | ||
| 2975 | * (twos-complement) integers. */ | ||
| 2976 | static inline SIMD_CFUNC simd_int3 simd_make_int3(simd_int4 other) { | ||
| 2977 | return other.xyz; | ||
| 2978 | } | ||
| 2979 | |||
| 2980 | /*! @abstract Truncates `other` to form a vector of three 32-bit signed | ||
| 2981 | * (twos-complement) integers. */ | ||
| 2982 | static inline SIMD_CFUNC simd_int3 simd_make_int3(simd_int8 other) { | ||
| 2983 | return other.xyz; | ||
| 2984 | } | ||
| 2985 | |||
| 2986 | /*! @abstract Truncates `other` to form a vector of three 32-bit signed | ||
| 2987 | * (twos-complement) integers. */ | ||
| 2988 | static inline SIMD_CFUNC simd_int3 simd_make_int3(simd_int16 other) { | ||
| 2989 | return other.xyz; | ||
| 2990 | } | ||
| 2991 | |||
| 2992 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 2993 | * 32-bit signed (twos-complement) integers. */ | ||
| 2994 | static inline SIMD_CFUNC simd_int4 simd_make_int4(int x, int y, int z, int w) { | ||
| 2995 | simd_int4 result; | ||
| 2996 | result.x = x; | ||
| 2997 | result.y = y; | ||
| 2998 | result.z = z; | ||
| 2999 | result.w = w; | ||
| 3000 | return result; | ||
| 3001 | } | ||
| 3002 | |||
| 3003 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 32-bit | ||
| 3004 | * signed (twos-complement) integers. */ | ||
| 3005 | static inline SIMD_CFUNC simd_int4 simd_make_int4(int x, int y, simd_int2 zw) { | ||
| 3006 | simd_int4 result; | ||
| 3007 | result.x = x; | ||
| 3008 | result.y = y; | ||
| 3009 | result.zw = zw; | ||
| 3010 | return result; | ||
| 3011 | } | ||
| 3012 | |||
| 3013 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 32-bit | ||
| 3014 | * signed (twos-complement) integers. */ | ||
| 3015 | static inline SIMD_CFUNC simd_int4 simd_make_int4(int x, simd_int2 yz, int w) { | ||
| 3016 | simd_int4 result; | ||
| 3017 | result.x = x; | ||
| 3018 | result.yz = yz; | ||
| 3019 | result.w = w; | ||
| 3020 | return result; | ||
| 3021 | } | ||
| 3022 | |||
| 3023 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 32-bit | ||
| 3024 | * signed (twos-complement) integers. */ | ||
| 3025 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int2 xy, int z, int w) { | ||
| 3026 | simd_int4 result; | ||
| 3027 | result.xy = xy; | ||
| 3028 | result.z = z; | ||
| 3029 | result.w = w; | ||
| 3030 | return result; | ||
| 3031 | } | ||
| 3032 | |||
| 3033 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 32-bit | ||
| 3034 | * signed (twos-complement) integers. */ | ||
| 3035 | static inline SIMD_CFUNC simd_int4 simd_make_int4(int x, simd_int3 yzw) { | ||
| 3036 | simd_int4 result; | ||
| 3037 | result.x = x; | ||
| 3038 | result.yzw = yzw; | ||
| 3039 | return result; | ||
| 3040 | } | ||
| 3041 | |||
| 3042 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 32-bit | ||
| 3043 | * signed (twos-complement) integers. */ | ||
| 3044 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int2 xy, simd_int2 zw) { | ||
| 3045 | simd_int4 result; | ||
| 3046 | result.xy = xy; | ||
| 3047 | result.zw = zw; | ||
| 3048 | return result; | ||
| 3049 | } | ||
| 3050 | |||
| 3051 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 32-bit | ||
| 3052 | * signed (twos-complement) integers. */ | ||
| 3053 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int3 xyz, int w) { | ||
| 3054 | simd_int4 result; | ||
| 3055 | result.xyz = xyz; | ||
| 3056 | result.w = w; | ||
| 3057 | return result; | ||
| 3058 | } | ||
| 3059 | |||
| 3060 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit signed | ||
| 3061 | * (twos-complement) integers. */ | ||
| 3062 | static inline SIMD_CFUNC simd_int4 simd_make_int4(int other) { | ||
| 3063 | simd_int4 result = 0; | ||
| 3064 | result.x = other; | ||
| 3065 | return result; | ||
| 3066 | } | ||
| 3067 | |||
| 3068 | /*! @abstract Extends `other` to form a vector of four 32-bit signed (twos- | ||
| 3069 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3070 | * unspecified. */ | ||
| 3071 | static inline SIMD_CFUNC simd_int4 simd_make_int4_undef(int other) { | ||
| 3072 | simd_int4 result; | ||
| 3073 | result.x = other; | ||
| 3074 | return result; | ||
| 3075 | } | ||
| 3076 | |||
| 3077 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit signed | ||
| 3078 | * (twos-complement) integers. */ | ||
| 3079 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int2 other) { | ||
| 3080 | simd_int4 result = 0; | ||
| 3081 | result.xy = other; | ||
| 3082 | return result; | ||
| 3083 | } | ||
| 3084 | |||
| 3085 | /*! @abstract Extends `other` to form a vector of four 32-bit signed (twos- | ||
| 3086 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3087 | * unspecified. */ | ||
| 3088 | static inline SIMD_CFUNC simd_int4 simd_make_int4_undef(simd_int2 other) { | ||
| 3089 | simd_int4 result; | ||
| 3090 | result.xy = other; | ||
| 3091 | return result; | ||
| 3092 | } | ||
| 3093 | |||
| 3094 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit signed | ||
| 3095 | * (twos-complement) integers. */ | ||
| 3096 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int3 other) { | ||
| 3097 | simd_int4 result = 0; | ||
| 3098 | result.xyz = other; | ||
| 3099 | return result; | ||
| 3100 | } | ||
| 3101 | |||
| 3102 | /*! @abstract Extends `other` to form a vector of four 32-bit signed (twos- | ||
| 3103 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3104 | * unspecified. */ | ||
| 3105 | static inline SIMD_CFUNC simd_int4 simd_make_int4_undef(simd_int3 other) { | ||
| 3106 | simd_int4 result; | ||
| 3107 | result.xyz = other; | ||
| 3108 | return result; | ||
| 3109 | } | ||
| 3110 | |||
| 3111 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3112 | * templated and autogenerated code. */ | ||
| 3113 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int4 other) { | ||
| 3114 | return other; | ||
| 3115 | } | ||
| 3116 | |||
| 3117 | /*! @abstract Truncates `other` to form a vector of four 32-bit signed | ||
| 3118 | * (twos-complement) integers. */ | ||
| 3119 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int8 other) { | ||
| 3120 | return other.xyzw; | ||
| 3121 | } | ||
| 3122 | |||
| 3123 | /*! @abstract Truncates `other` to form a vector of four 32-bit signed | ||
| 3124 | * (twos-complement) integers. */ | ||
| 3125 | static inline SIMD_CFUNC simd_int4 simd_make_int4(simd_int16 other) { | ||
| 3126 | return other.xyzw; | ||
| 3127 | } | ||
| 3128 | |||
| 3129 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 32-bit | ||
| 3130 | * signed (twos-complement) integers. */ | ||
| 3131 | static inline SIMD_CFUNC simd_int8 simd_make_int8(simd_int4 lo, simd_int4 hi) { | ||
| 3132 | simd_int8 result; | ||
| 3133 | result.lo = lo; | ||
| 3134 | result.hi = hi; | ||
| 3135 | return result; | ||
| 3136 | } | ||
| 3137 | |||
| 3138 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit signed | ||
| 3139 | * (twos-complement) integers. */ | ||
| 3140 | static inline SIMD_CFUNC simd_int8 simd_make_int8(int other) { | ||
| 3141 | simd_int8 result = 0; | ||
| 3142 | result.x = other; | ||
| 3143 | return result; | ||
| 3144 | } | ||
| 3145 | |||
| 3146 | /*! @abstract Extends `other` to form a vector of eight 32-bit signed (twos- | ||
| 3147 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3148 | * unspecified. */ | ||
| 3149 | static inline SIMD_CFUNC simd_int8 simd_make_int8_undef(int other) { | ||
| 3150 | simd_int8 result; | ||
| 3151 | result.x = other; | ||
| 3152 | return result; | ||
| 3153 | } | ||
| 3154 | |||
| 3155 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit signed | ||
| 3156 | * (twos-complement) integers. */ | ||
| 3157 | static inline SIMD_CFUNC simd_int8 simd_make_int8(simd_int2 other) { | ||
| 3158 | simd_int8 result = 0; | ||
| 3159 | result.xy = other; | ||
| 3160 | return result; | ||
| 3161 | } | ||
| 3162 | |||
| 3163 | /*! @abstract Extends `other` to form a vector of eight 32-bit signed (twos- | ||
| 3164 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3165 | * unspecified. */ | ||
| 3166 | static inline SIMD_CFUNC simd_int8 simd_make_int8_undef(simd_int2 other) { | ||
| 3167 | simd_int8 result; | ||
| 3168 | result.xy = other; | ||
| 3169 | return result; | ||
| 3170 | } | ||
| 3171 | |||
| 3172 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit signed | ||
| 3173 | * (twos-complement) integers. */ | ||
| 3174 | static inline SIMD_CFUNC simd_int8 simd_make_int8(simd_int3 other) { | ||
| 3175 | simd_int8 result = 0; | ||
| 3176 | result.xyz = other; | ||
| 3177 | return result; | ||
| 3178 | } | ||
| 3179 | |||
| 3180 | /*! @abstract Extends `other` to form a vector of eight 32-bit signed (twos- | ||
| 3181 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3182 | * unspecified. */ | ||
| 3183 | static inline SIMD_CFUNC simd_int8 simd_make_int8_undef(simd_int3 other) { | ||
| 3184 | simd_int8 result; | ||
| 3185 | result.xyz = other; | ||
| 3186 | return result; | ||
| 3187 | } | ||
| 3188 | |||
| 3189 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit signed | ||
| 3190 | * (twos-complement) integers. */ | ||
| 3191 | static inline SIMD_CFUNC simd_int8 simd_make_int8(simd_int4 other) { | ||
| 3192 | simd_int8 result = 0; | ||
| 3193 | result.xyzw = other; | ||
| 3194 | return result; | ||
| 3195 | } | ||
| 3196 | |||
| 3197 | /*! @abstract Extends `other` to form a vector of eight 32-bit signed (twos- | ||
| 3198 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 3199 | * unspecified. */ | ||
| 3200 | static inline SIMD_CFUNC simd_int8 simd_make_int8_undef(simd_int4 other) { | ||
| 3201 | simd_int8 result; | ||
| 3202 | result.xyzw = other; | ||
| 3203 | return result; | ||
| 3204 | } | ||
| 3205 | |||
| 3206 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3207 | * templated and autogenerated code. */ | ||
| 3208 | static inline SIMD_CFUNC simd_int8 simd_make_int8(simd_int8 other) { | ||
| 3209 | return other; | ||
| 3210 | } | ||
| 3211 | |||
| 3212 | /*! @abstract Truncates `other` to form a vector of eight 32-bit signed | ||
| 3213 | * (twos-complement) integers. */ | ||
| 3214 | static inline SIMD_CFUNC simd_int8 simd_make_int8(simd_int16 other) { | ||
| 3215 | return simd_make_int8(other.lo); | ||
| 3216 | } | ||
| 3217 | |||
| 3218 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 32-bit | ||
| 3219 | * signed (twos-complement) integers. */ | ||
| 3220 | static inline SIMD_CFUNC simd_int16 simd_make_int16(simd_int8 lo, simd_int8 hi) { | ||
| 3221 | simd_int16 result; | ||
| 3222 | result.lo = lo; | ||
| 3223 | result.hi = hi; | ||
| 3224 | return result; | ||
| 3225 | } | ||
| 3226 | |||
| 3227 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit signed | ||
| 3228 | * (twos-complement) integers. */ | ||
| 3229 | static inline SIMD_CFUNC simd_int16 simd_make_int16(int other) { | ||
| 3230 | simd_int16 result = 0; | ||
| 3231 | result.x = other; | ||
| 3232 | return result; | ||
| 3233 | } | ||
| 3234 | |||
| 3235 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit signed | ||
| 3236 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 3237 | * lanes are unspecified. */ | ||
| 3238 | static inline SIMD_CFUNC simd_int16 simd_make_int16_undef(int other) { | ||
| 3239 | simd_int16 result; | ||
| 3240 | result.x = other; | ||
| 3241 | return result; | ||
| 3242 | } | ||
| 3243 | |||
| 3244 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit signed | ||
| 3245 | * (twos-complement) integers. */ | ||
| 3246 | static inline SIMD_CFUNC simd_int16 simd_make_int16(simd_int2 other) { | ||
| 3247 | simd_int16 result = 0; | ||
| 3248 | result.xy = other; | ||
| 3249 | return result; | ||
| 3250 | } | ||
| 3251 | |||
| 3252 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit signed | ||
| 3253 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 3254 | * lanes are unspecified. */ | ||
| 3255 | static inline SIMD_CFUNC simd_int16 simd_make_int16_undef(simd_int2 other) { | ||
| 3256 | simd_int16 result; | ||
| 3257 | result.xy = other; | ||
| 3258 | return result; | ||
| 3259 | } | ||
| 3260 | |||
| 3261 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit signed | ||
| 3262 | * (twos-complement) integers. */ | ||
| 3263 | static inline SIMD_CFUNC simd_int16 simd_make_int16(simd_int3 other) { | ||
| 3264 | simd_int16 result = 0; | ||
| 3265 | result.xyz = other; | ||
| 3266 | return result; | ||
| 3267 | } | ||
| 3268 | |||
| 3269 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit signed | ||
| 3270 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 3271 | * lanes are unspecified. */ | ||
| 3272 | static inline SIMD_CFUNC simd_int16 simd_make_int16_undef(simd_int3 other) { | ||
| 3273 | simd_int16 result; | ||
| 3274 | result.xyz = other; | ||
| 3275 | return result; | ||
| 3276 | } | ||
| 3277 | |||
| 3278 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit signed | ||
| 3279 | * (twos-complement) integers. */ | ||
| 3280 | static inline SIMD_CFUNC simd_int16 simd_make_int16(simd_int4 other) { | ||
| 3281 | simd_int16 result = 0; | ||
| 3282 | result.xyzw = other; | ||
| 3283 | return result; | ||
| 3284 | } | ||
| 3285 | |||
| 3286 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit signed | ||
| 3287 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 3288 | * lanes are unspecified. */ | ||
| 3289 | static inline SIMD_CFUNC simd_int16 simd_make_int16_undef(simd_int4 other) { | ||
| 3290 | simd_int16 result; | ||
| 3291 | result.xyzw = other; | ||
| 3292 | return result; | ||
| 3293 | } | ||
| 3294 | |||
| 3295 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit signed | ||
| 3296 | * (twos-complement) integers. */ | ||
| 3297 | static inline SIMD_CFUNC simd_int16 simd_make_int16(simd_int8 other) { | ||
| 3298 | simd_int16 result = 0; | ||
| 3299 | result.lo = simd_make_int8(other); | ||
| 3300 | return result; | ||
| 3301 | } | ||
| 3302 | |||
| 3303 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit signed | ||
| 3304 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 3305 | * lanes are unspecified. */ | ||
| 3306 | static inline SIMD_CFUNC simd_int16 simd_make_int16_undef(simd_int8 other) { | ||
| 3307 | simd_int16 result; | ||
| 3308 | result.lo = simd_make_int8(other); | ||
| 3309 | return result; | ||
| 3310 | } | ||
| 3311 | |||
| 3312 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3313 | * templated and autogenerated code. */ | ||
| 3314 | static inline SIMD_CFUNC simd_int16 simd_make_int16(simd_int16 other) { | ||
| 3315 | return other; | ||
| 3316 | } | ||
| 3317 | |||
| 3318 | /*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit | ||
| 3319 | * unsigned integers. */ | ||
| 3320 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(unsigned int x, unsigned int y) { | ||
| 3321 | simd_uint2 result; | ||
| 3322 | result.x = x; | ||
| 3323 | result.y = y; | ||
| 3324 | return result; | ||
| 3325 | } | ||
| 3326 | |||
| 3327 | /*! @abstract Zero-extends `other` to form a vector of two 32-bit unsigned | ||
| 3328 | * integers. */ | ||
| 3329 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(unsigned int other) { | ||
| 3330 | simd_uint2 result = 0; | ||
| 3331 | result.x = other; | ||
| 3332 | return result; | ||
| 3333 | } | ||
| 3334 | |||
| 3335 | /*! @abstract Extends `other` to form a vector of two 32-bit unsigned | ||
| 3336 | * integers. The contents of the newly-created vector lanes are | ||
| 3337 | * unspecified. */ | ||
| 3338 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2_undef(unsigned int other) { | ||
| 3339 | simd_uint2 result; | ||
| 3340 | result.x = other; | ||
| 3341 | return result; | ||
| 3342 | } | ||
| 3343 | |||
| 3344 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3345 | * templated and autogenerated code. */ | ||
| 3346 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(simd_uint2 other) { | ||
| 3347 | return other; | ||
| 3348 | } | ||
| 3349 | |||
| 3350 | /*! @abstract Truncates `other` to form a vector of two 32-bit unsigned | ||
| 3351 | * integers. */ | ||
| 3352 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(simd_uint3 other) { | ||
| 3353 | return other.xy; | ||
| 3354 | } | ||
| 3355 | |||
| 3356 | /*! @abstract Truncates `other` to form a vector of two 32-bit unsigned | ||
| 3357 | * integers. */ | ||
| 3358 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(simd_uint4 other) { | ||
| 3359 | return other.xy; | ||
| 3360 | } | ||
| 3361 | |||
| 3362 | /*! @abstract Truncates `other` to form a vector of two 32-bit unsigned | ||
| 3363 | * integers. */ | ||
| 3364 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(simd_uint8 other) { | ||
| 3365 | return other.xy; | ||
| 3366 | } | ||
| 3367 | |||
| 3368 | /*! @abstract Truncates `other` to form a vector of two 32-bit unsigned | ||
| 3369 | * integers. */ | ||
| 3370 | static inline SIMD_CFUNC simd_uint2 simd_make_uint2(simd_uint16 other) { | ||
| 3371 | return other.xy; | ||
| 3372 | } | ||
| 3373 | |||
| 3374 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 32-bit | ||
| 3375 | * unsigned integers. */ | ||
| 3376 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(unsigned int x, unsigned int y, unsigned int z) { | ||
| 3377 | simd_uint3 result; | ||
| 3378 | result.x = x; | ||
| 3379 | result.y = y; | ||
| 3380 | result.z = z; | ||
| 3381 | return result; | ||
| 3382 | } | ||
| 3383 | |||
| 3384 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 32-bit | ||
| 3385 | * unsigned integers. */ | ||
| 3386 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(unsigned int x, simd_uint2 yz) { | ||
| 3387 | simd_uint3 result; | ||
| 3388 | result.x = x; | ||
| 3389 | result.yz = yz; | ||
| 3390 | return result; | ||
| 3391 | } | ||
| 3392 | |||
| 3393 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 32-bit | ||
| 3394 | * unsigned integers. */ | ||
| 3395 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(simd_uint2 xy, unsigned int z) { | ||
| 3396 | simd_uint3 result; | ||
| 3397 | result.xy = xy; | ||
| 3398 | result.z = z; | ||
| 3399 | return result; | ||
| 3400 | } | ||
| 3401 | |||
| 3402 | /*! @abstract Zero-extends `other` to form a vector of three 32-bit unsigned | ||
| 3403 | * integers. */ | ||
| 3404 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(unsigned int other) { | ||
| 3405 | simd_uint3 result = 0; | ||
| 3406 | result.x = other; | ||
| 3407 | return result; | ||
| 3408 | } | ||
| 3409 | |||
| 3410 | /*! @abstract Extends `other` to form a vector of three 32-bit unsigned | ||
| 3411 | * integers. The contents of the newly-created vector lanes are | ||
| 3412 | * unspecified. */ | ||
| 3413 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3_undef(unsigned int other) { | ||
| 3414 | simd_uint3 result; | ||
| 3415 | result.x = other; | ||
| 3416 | return result; | ||
| 3417 | } | ||
| 3418 | |||
| 3419 | /*! @abstract Zero-extends `other` to form a vector of three 32-bit unsigned | ||
| 3420 | * integers. */ | ||
| 3421 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(simd_uint2 other) { | ||
| 3422 | simd_uint3 result = 0; | ||
| 3423 | result.xy = other; | ||
| 3424 | return result; | ||
| 3425 | } | ||
| 3426 | |||
| 3427 | /*! @abstract Extends `other` to form a vector of three 32-bit unsigned | ||
| 3428 | * integers. The contents of the newly-created vector lanes are | ||
| 3429 | * unspecified. */ | ||
| 3430 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3_undef(simd_uint2 other) { | ||
| 3431 | simd_uint3 result; | ||
| 3432 | result.xy = other; | ||
| 3433 | return result; | ||
| 3434 | } | ||
| 3435 | |||
| 3436 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3437 | * templated and autogenerated code. */ | ||
| 3438 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(simd_uint3 other) { | ||
| 3439 | return other; | ||
| 3440 | } | ||
| 3441 | |||
| 3442 | /*! @abstract Truncates `other` to form a vector of three 32-bit unsigned | ||
| 3443 | * integers. */ | ||
| 3444 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(simd_uint4 other) { | ||
| 3445 | return other.xyz; | ||
| 3446 | } | ||
| 3447 | |||
| 3448 | /*! @abstract Truncates `other` to form a vector of three 32-bit unsigned | ||
| 3449 | * integers. */ | ||
| 3450 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(simd_uint8 other) { | ||
| 3451 | return other.xyz; | ||
| 3452 | } | ||
| 3453 | |||
| 3454 | /*! @abstract Truncates `other` to form a vector of three 32-bit unsigned | ||
| 3455 | * integers. */ | ||
| 3456 | static inline SIMD_CFUNC simd_uint3 simd_make_uint3(simd_uint16 other) { | ||
| 3457 | return other.xyz; | ||
| 3458 | } | ||
| 3459 | |||
| 3460 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 3461 | * 32-bit unsigned integers. */ | ||
| 3462 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(unsigned int x, unsigned int y, unsigned int z, unsigned int w) { | ||
| 3463 | simd_uint4 result; | ||
| 3464 | result.x = x; | ||
| 3465 | result.y = y; | ||
| 3466 | result.z = z; | ||
| 3467 | result.w = w; | ||
| 3468 | return result; | ||
| 3469 | } | ||
| 3470 | |||
| 3471 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 32-bit | ||
| 3472 | * unsigned integers. */ | ||
| 3473 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(unsigned int x, unsigned int y, simd_uint2 zw) { | ||
| 3474 | simd_uint4 result; | ||
| 3475 | result.x = x; | ||
| 3476 | result.y = y; | ||
| 3477 | result.zw = zw; | ||
| 3478 | return result; | ||
| 3479 | } | ||
| 3480 | |||
| 3481 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 32-bit | ||
| 3482 | * unsigned integers. */ | ||
| 3483 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(unsigned int x, simd_uint2 yz, unsigned int w) { | ||
| 3484 | simd_uint4 result; | ||
| 3485 | result.x = x; | ||
| 3486 | result.yz = yz; | ||
| 3487 | result.w = w; | ||
| 3488 | return result; | ||
| 3489 | } | ||
| 3490 | |||
| 3491 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 32-bit | ||
| 3492 | * unsigned integers. */ | ||
| 3493 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint2 xy, unsigned int z, unsigned int w) { | ||
| 3494 | simd_uint4 result; | ||
| 3495 | result.xy = xy; | ||
| 3496 | result.z = z; | ||
| 3497 | result.w = w; | ||
| 3498 | return result; | ||
| 3499 | } | ||
| 3500 | |||
| 3501 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 32-bit | ||
| 3502 | * unsigned integers. */ | ||
| 3503 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(unsigned int x, simd_uint3 yzw) { | ||
| 3504 | simd_uint4 result; | ||
| 3505 | result.x = x; | ||
| 3506 | result.yzw = yzw; | ||
| 3507 | return result; | ||
| 3508 | } | ||
| 3509 | |||
| 3510 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 32-bit | ||
| 3511 | * unsigned integers. */ | ||
| 3512 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint2 xy, simd_uint2 zw) { | ||
| 3513 | simd_uint4 result; | ||
| 3514 | result.xy = xy; | ||
| 3515 | result.zw = zw; | ||
| 3516 | return result; | ||
| 3517 | } | ||
| 3518 | |||
| 3519 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 32-bit | ||
| 3520 | * unsigned integers. */ | ||
| 3521 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint3 xyz, unsigned int w) { | ||
| 3522 | simd_uint4 result; | ||
| 3523 | result.xyz = xyz; | ||
| 3524 | result.w = w; | ||
| 3525 | return result; | ||
| 3526 | } | ||
| 3527 | |||
| 3528 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit unsigned | ||
| 3529 | * integers. */ | ||
| 3530 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(unsigned int other) { | ||
| 3531 | simd_uint4 result = 0; | ||
| 3532 | result.x = other; | ||
| 3533 | return result; | ||
| 3534 | } | ||
| 3535 | |||
| 3536 | /*! @abstract Extends `other` to form a vector of four 32-bit unsigned | ||
| 3537 | * integers. The contents of the newly-created vector lanes are | ||
| 3538 | * unspecified. */ | ||
| 3539 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4_undef(unsigned int other) { | ||
| 3540 | simd_uint4 result; | ||
| 3541 | result.x = other; | ||
| 3542 | return result; | ||
| 3543 | } | ||
| 3544 | |||
| 3545 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit unsigned | ||
| 3546 | * integers. */ | ||
| 3547 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint2 other) { | ||
| 3548 | simd_uint4 result = 0; | ||
| 3549 | result.xy = other; | ||
| 3550 | return result; | ||
| 3551 | } | ||
| 3552 | |||
| 3553 | /*! @abstract Extends `other` to form a vector of four 32-bit unsigned | ||
| 3554 | * integers. The contents of the newly-created vector lanes are | ||
| 3555 | * unspecified. */ | ||
| 3556 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4_undef(simd_uint2 other) { | ||
| 3557 | simd_uint4 result; | ||
| 3558 | result.xy = other; | ||
| 3559 | return result; | ||
| 3560 | } | ||
| 3561 | |||
| 3562 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit unsigned | ||
| 3563 | * integers. */ | ||
| 3564 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint3 other) { | ||
| 3565 | simd_uint4 result = 0; | ||
| 3566 | result.xyz = other; | ||
| 3567 | return result; | ||
| 3568 | } | ||
| 3569 | |||
| 3570 | /*! @abstract Extends `other` to form a vector of four 32-bit unsigned | ||
| 3571 | * integers. The contents of the newly-created vector lanes are | ||
| 3572 | * unspecified. */ | ||
| 3573 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4_undef(simd_uint3 other) { | ||
| 3574 | simd_uint4 result; | ||
| 3575 | result.xyz = other; | ||
| 3576 | return result; | ||
| 3577 | } | ||
| 3578 | |||
| 3579 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3580 | * templated and autogenerated code. */ | ||
| 3581 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint4 other) { | ||
| 3582 | return other; | ||
| 3583 | } | ||
| 3584 | |||
| 3585 | /*! @abstract Truncates `other` to form a vector of four 32-bit unsigned | ||
| 3586 | * integers. */ | ||
| 3587 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint8 other) { | ||
| 3588 | return other.xyzw; | ||
| 3589 | } | ||
| 3590 | |||
| 3591 | /*! @abstract Truncates `other` to form a vector of four 32-bit unsigned | ||
| 3592 | * integers. */ | ||
| 3593 | static inline SIMD_CFUNC simd_uint4 simd_make_uint4(simd_uint16 other) { | ||
| 3594 | return other.xyzw; | ||
| 3595 | } | ||
| 3596 | |||
| 3597 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 32-bit | ||
| 3598 | * unsigned integers. */ | ||
| 3599 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(simd_uint4 lo, simd_uint4 hi) { | ||
| 3600 | simd_uint8 result; | ||
| 3601 | result.lo = lo; | ||
| 3602 | result.hi = hi; | ||
| 3603 | return result; | ||
| 3604 | } | ||
| 3605 | |||
| 3606 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit unsigned | ||
| 3607 | * integers. */ | ||
| 3608 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(unsigned int other) { | ||
| 3609 | simd_uint8 result = 0; | ||
| 3610 | result.x = other; | ||
| 3611 | return result; | ||
| 3612 | } | ||
| 3613 | |||
| 3614 | /*! @abstract Extends `other` to form a vector of eight 32-bit unsigned | ||
| 3615 | * integers. The contents of the newly-created vector lanes are | ||
| 3616 | * unspecified. */ | ||
| 3617 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8_undef(unsigned int other) { | ||
| 3618 | simd_uint8 result; | ||
| 3619 | result.x = other; | ||
| 3620 | return result; | ||
| 3621 | } | ||
| 3622 | |||
| 3623 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit unsigned | ||
| 3624 | * integers. */ | ||
| 3625 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(simd_uint2 other) { | ||
| 3626 | simd_uint8 result = 0; | ||
| 3627 | result.xy = other; | ||
| 3628 | return result; | ||
| 3629 | } | ||
| 3630 | |||
| 3631 | /*! @abstract Extends `other` to form a vector of eight 32-bit unsigned | ||
| 3632 | * integers. The contents of the newly-created vector lanes are | ||
| 3633 | * unspecified. */ | ||
| 3634 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8_undef(simd_uint2 other) { | ||
| 3635 | simd_uint8 result; | ||
| 3636 | result.xy = other; | ||
| 3637 | return result; | ||
| 3638 | } | ||
| 3639 | |||
| 3640 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit unsigned | ||
| 3641 | * integers. */ | ||
| 3642 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(simd_uint3 other) { | ||
| 3643 | simd_uint8 result = 0; | ||
| 3644 | result.xyz = other; | ||
| 3645 | return result; | ||
| 3646 | } | ||
| 3647 | |||
| 3648 | /*! @abstract Extends `other` to form a vector of eight 32-bit unsigned | ||
| 3649 | * integers. The contents of the newly-created vector lanes are | ||
| 3650 | * unspecified. */ | ||
| 3651 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8_undef(simd_uint3 other) { | ||
| 3652 | simd_uint8 result; | ||
| 3653 | result.xyz = other; | ||
| 3654 | return result; | ||
| 3655 | } | ||
| 3656 | |||
| 3657 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit unsigned | ||
| 3658 | * integers. */ | ||
| 3659 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(simd_uint4 other) { | ||
| 3660 | simd_uint8 result = 0; | ||
| 3661 | result.xyzw = other; | ||
| 3662 | return result; | ||
| 3663 | } | ||
| 3664 | |||
| 3665 | /*! @abstract Extends `other` to form a vector of eight 32-bit unsigned | ||
| 3666 | * integers. The contents of the newly-created vector lanes are | ||
| 3667 | * unspecified. */ | ||
| 3668 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8_undef(simd_uint4 other) { | ||
| 3669 | simd_uint8 result; | ||
| 3670 | result.xyzw = other; | ||
| 3671 | return result; | ||
| 3672 | } | ||
| 3673 | |||
| 3674 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3675 | * templated and autogenerated code. */ | ||
| 3676 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(simd_uint8 other) { | ||
| 3677 | return other; | ||
| 3678 | } | ||
| 3679 | |||
| 3680 | /*! @abstract Truncates `other` to form a vector of eight 32-bit unsigned | ||
| 3681 | * integers. */ | ||
| 3682 | static inline SIMD_CFUNC simd_uint8 simd_make_uint8(simd_uint16 other) { | ||
| 3683 | return simd_make_uint8(other.lo); | ||
| 3684 | } | ||
| 3685 | |||
| 3686 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 32-bit | ||
| 3687 | * unsigned integers. */ | ||
| 3688 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(simd_uint8 lo, simd_uint8 hi) { | ||
| 3689 | simd_uint16 result; | ||
| 3690 | result.lo = lo; | ||
| 3691 | result.hi = hi; | ||
| 3692 | return result; | ||
| 3693 | } | ||
| 3694 | |||
| 3695 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 3696 | * unsigned integers. */ | ||
| 3697 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(unsigned int other) { | ||
| 3698 | simd_uint16 result = 0; | ||
| 3699 | result.x = other; | ||
| 3700 | return result; | ||
| 3701 | } | ||
| 3702 | |||
| 3703 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit unsigned | ||
| 3704 | * integers. The contents of the newly-created vector lanes are | ||
| 3705 | * unspecified. */ | ||
| 3706 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16_undef(unsigned int other) { | ||
| 3707 | simd_uint16 result; | ||
| 3708 | result.x = other; | ||
| 3709 | return result; | ||
| 3710 | } | ||
| 3711 | |||
| 3712 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 3713 | * unsigned integers. */ | ||
| 3714 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(simd_uint2 other) { | ||
| 3715 | simd_uint16 result = 0; | ||
| 3716 | result.xy = other; | ||
| 3717 | return result; | ||
| 3718 | } | ||
| 3719 | |||
| 3720 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit unsigned | ||
| 3721 | * integers. The contents of the newly-created vector lanes are | ||
| 3722 | * unspecified. */ | ||
| 3723 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16_undef(simd_uint2 other) { | ||
| 3724 | simd_uint16 result; | ||
| 3725 | result.xy = other; | ||
| 3726 | return result; | ||
| 3727 | } | ||
| 3728 | |||
| 3729 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 3730 | * unsigned integers. */ | ||
| 3731 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(simd_uint3 other) { | ||
| 3732 | simd_uint16 result = 0; | ||
| 3733 | result.xyz = other; | ||
| 3734 | return result; | ||
| 3735 | } | ||
| 3736 | |||
| 3737 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit unsigned | ||
| 3738 | * integers. The contents of the newly-created vector lanes are | ||
| 3739 | * unspecified. */ | ||
| 3740 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16_undef(simd_uint3 other) { | ||
| 3741 | simd_uint16 result; | ||
| 3742 | result.xyz = other; | ||
| 3743 | return result; | ||
| 3744 | } | ||
| 3745 | |||
| 3746 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 3747 | * unsigned integers. */ | ||
| 3748 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(simd_uint4 other) { | ||
| 3749 | simd_uint16 result = 0; | ||
| 3750 | result.xyzw = other; | ||
| 3751 | return result; | ||
| 3752 | } | ||
| 3753 | |||
| 3754 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit unsigned | ||
| 3755 | * integers. The contents of the newly-created vector lanes are | ||
| 3756 | * unspecified. */ | ||
| 3757 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16_undef(simd_uint4 other) { | ||
| 3758 | simd_uint16 result; | ||
| 3759 | result.xyzw = other; | ||
| 3760 | return result; | ||
| 3761 | } | ||
| 3762 | |||
| 3763 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 3764 | * unsigned integers. */ | ||
| 3765 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(simd_uint8 other) { | ||
| 3766 | simd_uint16 result = 0; | ||
| 3767 | result.lo = simd_make_uint8(other); | ||
| 3768 | return result; | ||
| 3769 | } | ||
| 3770 | |||
| 3771 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit unsigned | ||
| 3772 | * integers. The contents of the newly-created vector lanes are | ||
| 3773 | * unspecified. */ | ||
| 3774 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16_undef(simd_uint8 other) { | ||
| 3775 | simd_uint16 result; | ||
| 3776 | result.lo = simd_make_uint8(other); | ||
| 3777 | return result; | ||
| 3778 | } | ||
| 3779 | |||
| 3780 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3781 | * templated and autogenerated code. */ | ||
| 3782 | static inline SIMD_CFUNC simd_uint16 simd_make_uint16(simd_uint16 other) { | ||
| 3783 | return other; | ||
| 3784 | } | ||
| 3785 | |||
| 3786 | /*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit | ||
| 3787 | * floating-point numbers. */ | ||
| 3788 | static inline SIMD_CFUNC simd_float2 simd_make_float2(float x, float y) { | ||
| 3789 | simd_float2 result; | ||
| 3790 | result.x = x; | ||
| 3791 | result.y = y; | ||
| 3792 | return result; | ||
| 3793 | } | ||
| 3794 | |||
| 3795 | /*! @abstract Zero-extends `other` to form a vector of two 32-bit floating- | ||
| 3796 | * point numbers. */ | ||
| 3797 | static inline SIMD_CFUNC simd_float2 simd_make_float2(float other) { | ||
| 3798 | simd_float2 result = 0; | ||
| 3799 | result.x = other; | ||
| 3800 | return result; | ||
| 3801 | } | ||
| 3802 | |||
| 3803 | /*! @abstract Extends `other` to form a vector of two 32-bit floating-point | ||
| 3804 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 3805 | static inline SIMD_CFUNC simd_float2 simd_make_float2_undef(float other) { | ||
| 3806 | simd_float2 result; | ||
| 3807 | result.x = other; | ||
| 3808 | return result; | ||
| 3809 | } | ||
| 3810 | |||
| 3811 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3812 | * templated and autogenerated code. */ | ||
| 3813 | static inline SIMD_CFUNC simd_float2 simd_make_float2(simd_float2 other) { | ||
| 3814 | return other; | ||
| 3815 | } | ||
| 3816 | |||
| 3817 | /*! @abstract Truncates `other` to form a vector of two 32-bit floating- | ||
| 3818 | * point numbers. */ | ||
| 3819 | static inline SIMD_CFUNC simd_float2 simd_make_float2(simd_float3 other) { | ||
| 3820 | return other.xy; | ||
| 3821 | } | ||
| 3822 | |||
| 3823 | /*! @abstract Truncates `other` to form a vector of two 32-bit floating- | ||
| 3824 | * point numbers. */ | ||
| 3825 | static inline SIMD_CFUNC simd_float2 simd_make_float2(simd_float4 other) { | ||
| 3826 | return other.xy; | ||
| 3827 | } | ||
| 3828 | |||
| 3829 | /*! @abstract Truncates `other` to form a vector of two 32-bit floating- | ||
| 3830 | * point numbers. */ | ||
| 3831 | static inline SIMD_CFUNC simd_float2 simd_make_float2(simd_float8 other) { | ||
| 3832 | return other.xy; | ||
| 3833 | } | ||
| 3834 | |||
| 3835 | /*! @abstract Truncates `other` to form a vector of two 32-bit floating- | ||
| 3836 | * point numbers. */ | ||
| 3837 | static inline SIMD_CFUNC simd_float2 simd_make_float2(simd_float16 other) { | ||
| 3838 | return other.xy; | ||
| 3839 | } | ||
| 3840 | |||
| 3841 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 32-bit | ||
| 3842 | * floating-point numbers. */ | ||
| 3843 | static inline SIMD_CFUNC simd_float3 simd_make_float3(float x, float y, float z) { | ||
| 3844 | simd_float3 result; | ||
| 3845 | result.x = x; | ||
| 3846 | result.y = y; | ||
| 3847 | result.z = z; | ||
| 3848 | return result; | ||
| 3849 | } | ||
| 3850 | |||
| 3851 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 32-bit | ||
| 3852 | * floating-point numbers. */ | ||
| 3853 | static inline SIMD_CFUNC simd_float3 simd_make_float3(float x, simd_float2 yz) { | ||
| 3854 | simd_float3 result; | ||
| 3855 | result.x = x; | ||
| 3856 | result.yz = yz; | ||
| 3857 | return result; | ||
| 3858 | } | ||
| 3859 | |||
| 3860 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 32-bit | ||
| 3861 | * floating-point numbers. */ | ||
| 3862 | static inline SIMD_CFUNC simd_float3 simd_make_float3(simd_float2 xy, float z) { | ||
| 3863 | simd_float3 result; | ||
| 3864 | result.xy = xy; | ||
| 3865 | result.z = z; | ||
| 3866 | return result; | ||
| 3867 | } | ||
| 3868 | |||
| 3869 | /*! @abstract Zero-extends `other` to form a vector of three 32-bit | ||
| 3870 | * floating-point numbers. */ | ||
| 3871 | static inline SIMD_CFUNC simd_float3 simd_make_float3(float other) { | ||
| 3872 | simd_float3 result = 0; | ||
| 3873 | result.x = other; | ||
| 3874 | return result; | ||
| 3875 | } | ||
| 3876 | |||
| 3877 | /*! @abstract Extends `other` to form a vector of three 32-bit floating- | ||
| 3878 | * point numbers. The contents of the newly-created vector lanes are | ||
| 3879 | * unspecified. */ | ||
| 3880 | static inline SIMD_CFUNC simd_float3 simd_make_float3_undef(float other) { | ||
| 3881 | simd_float3 result; | ||
| 3882 | result.x = other; | ||
| 3883 | return result; | ||
| 3884 | } | ||
| 3885 | |||
| 3886 | /*! @abstract Zero-extends `other` to form a vector of three 32-bit | ||
| 3887 | * floating-point numbers. */ | ||
| 3888 | static inline SIMD_CFUNC simd_float3 simd_make_float3(simd_float2 other) { | ||
| 3889 | simd_float3 result = 0; | ||
| 3890 | result.xy = other; | ||
| 3891 | return result; | ||
| 3892 | } | ||
| 3893 | |||
| 3894 | /*! @abstract Extends `other` to form a vector of three 32-bit floating- | ||
| 3895 | * point numbers. The contents of the newly-created vector lanes are | ||
| 3896 | * unspecified. */ | ||
| 3897 | static inline SIMD_CFUNC simd_float3 simd_make_float3_undef(simd_float2 other) { | ||
| 3898 | simd_float3 result; | ||
| 3899 | result.xy = other; | ||
| 3900 | return result; | ||
| 3901 | } | ||
| 3902 | |||
| 3903 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 3904 | * templated and autogenerated code. */ | ||
| 3905 | static inline SIMD_CFUNC simd_float3 simd_make_float3(simd_float3 other) { | ||
| 3906 | return other; | ||
| 3907 | } | ||
| 3908 | |||
| 3909 | /*! @abstract Truncates `other` to form a vector of three 32-bit floating- | ||
| 3910 | * point numbers. */ | ||
| 3911 | static inline SIMD_CFUNC simd_float3 simd_make_float3(simd_float4 other) { | ||
| 3912 | return other.xyz; | ||
| 3913 | } | ||
| 3914 | |||
| 3915 | /*! @abstract Truncates `other` to form a vector of three 32-bit floating- | ||
| 3916 | * point numbers. */ | ||
| 3917 | static inline SIMD_CFUNC simd_float3 simd_make_float3(simd_float8 other) { | ||
| 3918 | return other.xyz; | ||
| 3919 | } | ||
| 3920 | |||
| 3921 | /*! @abstract Truncates `other` to form a vector of three 32-bit floating- | ||
| 3922 | * point numbers. */ | ||
| 3923 | static inline SIMD_CFUNC simd_float3 simd_make_float3(simd_float16 other) { | ||
| 3924 | return other.xyz; | ||
| 3925 | } | ||
| 3926 | |||
| 3927 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 3928 | * 32-bit floating-point numbers. */ | ||
| 3929 | static inline SIMD_CFUNC simd_float4 simd_make_float4(float x, float y, float z, float w) { | ||
| 3930 | simd_float4 result; | ||
| 3931 | result.x = x; | ||
| 3932 | result.y = y; | ||
| 3933 | result.z = z; | ||
| 3934 | result.w = w; | ||
| 3935 | return result; | ||
| 3936 | } | ||
| 3937 | |||
| 3938 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 32-bit | ||
| 3939 | * floating-point numbers. */ | ||
| 3940 | static inline SIMD_CFUNC simd_float4 simd_make_float4(float x, float y, simd_float2 zw) { | ||
| 3941 | simd_float4 result; | ||
| 3942 | result.x = x; | ||
| 3943 | result.y = y; | ||
| 3944 | result.zw = zw; | ||
| 3945 | return result; | ||
| 3946 | } | ||
| 3947 | |||
| 3948 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 32-bit | ||
| 3949 | * floating-point numbers. */ | ||
| 3950 | static inline SIMD_CFUNC simd_float4 simd_make_float4(float x, simd_float2 yz, float w) { | ||
| 3951 | simd_float4 result; | ||
| 3952 | result.x = x; | ||
| 3953 | result.yz = yz; | ||
| 3954 | result.w = w; | ||
| 3955 | return result; | ||
| 3956 | } | ||
| 3957 | |||
| 3958 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 32-bit | ||
| 3959 | * floating-point numbers. */ | ||
| 3960 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float2 xy, float z, float w) { | ||
| 3961 | simd_float4 result; | ||
| 3962 | result.xy = xy; | ||
| 3963 | result.z = z; | ||
| 3964 | result.w = w; | ||
| 3965 | return result; | ||
| 3966 | } | ||
| 3967 | |||
| 3968 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 32-bit | ||
| 3969 | * floating-point numbers. */ | ||
| 3970 | static inline SIMD_CFUNC simd_float4 simd_make_float4(float x, simd_float3 yzw) { | ||
| 3971 | simd_float4 result; | ||
| 3972 | result.x = x; | ||
| 3973 | result.yzw = yzw; | ||
| 3974 | return result; | ||
| 3975 | } | ||
| 3976 | |||
| 3977 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 32-bit | ||
| 3978 | * floating-point numbers. */ | ||
| 3979 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float2 xy, simd_float2 zw) { | ||
| 3980 | simd_float4 result; | ||
| 3981 | result.xy = xy; | ||
| 3982 | result.zw = zw; | ||
| 3983 | return result; | ||
| 3984 | } | ||
| 3985 | |||
| 3986 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 32-bit | ||
| 3987 | * floating-point numbers. */ | ||
| 3988 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float3 xyz, float w) { | ||
| 3989 | simd_float4 result; | ||
| 3990 | result.xyz = xyz; | ||
| 3991 | result.w = w; | ||
| 3992 | return result; | ||
| 3993 | } | ||
| 3994 | |||
| 3995 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit floating- | ||
| 3996 | * point numbers. */ | ||
| 3997 | static inline SIMD_CFUNC simd_float4 simd_make_float4(float other) { | ||
| 3998 | simd_float4 result = 0; | ||
| 3999 | result.x = other; | ||
| 4000 | return result; | ||
| 4001 | } | ||
| 4002 | |||
| 4003 | /*! @abstract Extends `other` to form a vector of four 32-bit floating-point | ||
| 4004 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 4005 | static inline SIMD_CFUNC simd_float4 simd_make_float4_undef(float other) { | ||
| 4006 | simd_float4 result; | ||
| 4007 | result.x = other; | ||
| 4008 | return result; | ||
| 4009 | } | ||
| 4010 | |||
| 4011 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit floating- | ||
| 4012 | * point numbers. */ | ||
| 4013 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float2 other) { | ||
| 4014 | simd_float4 result = 0; | ||
| 4015 | result.xy = other; | ||
| 4016 | return result; | ||
| 4017 | } | ||
| 4018 | |||
| 4019 | /*! @abstract Extends `other` to form a vector of four 32-bit floating-point | ||
| 4020 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 4021 | static inline SIMD_CFUNC simd_float4 simd_make_float4_undef(simd_float2 other) { | ||
| 4022 | simd_float4 result; | ||
| 4023 | result.xy = other; | ||
| 4024 | return result; | ||
| 4025 | } | ||
| 4026 | |||
| 4027 | /*! @abstract Zero-extends `other` to form a vector of four 32-bit floating- | ||
| 4028 | * point numbers. */ | ||
| 4029 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float3 other) { | ||
| 4030 | simd_float4 result = 0; | ||
| 4031 | result.xyz = other; | ||
| 4032 | return result; | ||
| 4033 | } | ||
| 4034 | |||
| 4035 | /*! @abstract Extends `other` to form a vector of four 32-bit floating-point | ||
| 4036 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 4037 | static inline SIMD_CFUNC simd_float4 simd_make_float4_undef(simd_float3 other) { | ||
| 4038 | simd_float4 result; | ||
| 4039 | result.xyz = other; | ||
| 4040 | return result; | ||
| 4041 | } | ||
| 4042 | |||
| 4043 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4044 | * templated and autogenerated code. */ | ||
| 4045 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float4 other) { | ||
| 4046 | return other; | ||
| 4047 | } | ||
| 4048 | |||
| 4049 | /*! @abstract Truncates `other` to form a vector of four 32-bit floating- | ||
| 4050 | * point numbers. */ | ||
| 4051 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float8 other) { | ||
| 4052 | return other.xyzw; | ||
| 4053 | } | ||
| 4054 | |||
| 4055 | /*! @abstract Truncates `other` to form a vector of four 32-bit floating- | ||
| 4056 | * point numbers. */ | ||
| 4057 | static inline SIMD_CFUNC simd_float4 simd_make_float4(simd_float16 other) { | ||
| 4058 | return other.xyzw; | ||
| 4059 | } | ||
| 4060 | |||
| 4061 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 32-bit | ||
| 4062 | * floating-point numbers. */ | ||
| 4063 | static inline SIMD_CFUNC simd_float8 simd_make_float8(simd_float4 lo, simd_float4 hi) { | ||
| 4064 | simd_float8 result; | ||
| 4065 | result.lo = lo; | ||
| 4066 | result.hi = hi; | ||
| 4067 | return result; | ||
| 4068 | } | ||
| 4069 | |||
| 4070 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit | ||
| 4071 | * floating-point numbers. */ | ||
| 4072 | static inline SIMD_CFUNC simd_float8 simd_make_float8(float other) { | ||
| 4073 | simd_float8 result = 0; | ||
| 4074 | result.x = other; | ||
| 4075 | return result; | ||
| 4076 | } | ||
| 4077 | |||
| 4078 | /*! @abstract Extends `other` to form a vector of eight 32-bit floating- | ||
| 4079 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4080 | * unspecified. */ | ||
| 4081 | static inline SIMD_CFUNC simd_float8 simd_make_float8_undef(float other) { | ||
| 4082 | simd_float8 result; | ||
| 4083 | result.x = other; | ||
| 4084 | return result; | ||
| 4085 | } | ||
| 4086 | |||
| 4087 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit | ||
| 4088 | * floating-point numbers. */ | ||
| 4089 | static inline SIMD_CFUNC simd_float8 simd_make_float8(simd_float2 other) { | ||
| 4090 | simd_float8 result = 0; | ||
| 4091 | result.xy = other; | ||
| 4092 | return result; | ||
| 4093 | } | ||
| 4094 | |||
| 4095 | /*! @abstract Extends `other` to form a vector of eight 32-bit floating- | ||
| 4096 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4097 | * unspecified. */ | ||
| 4098 | static inline SIMD_CFUNC simd_float8 simd_make_float8_undef(simd_float2 other) { | ||
| 4099 | simd_float8 result; | ||
| 4100 | result.xy = other; | ||
| 4101 | return result; | ||
| 4102 | } | ||
| 4103 | |||
| 4104 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit | ||
| 4105 | * floating-point numbers. */ | ||
| 4106 | static inline SIMD_CFUNC simd_float8 simd_make_float8(simd_float3 other) { | ||
| 4107 | simd_float8 result = 0; | ||
| 4108 | result.xyz = other; | ||
| 4109 | return result; | ||
| 4110 | } | ||
| 4111 | |||
| 4112 | /*! @abstract Extends `other` to form a vector of eight 32-bit floating- | ||
| 4113 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4114 | * unspecified. */ | ||
| 4115 | static inline SIMD_CFUNC simd_float8 simd_make_float8_undef(simd_float3 other) { | ||
| 4116 | simd_float8 result; | ||
| 4117 | result.xyz = other; | ||
| 4118 | return result; | ||
| 4119 | } | ||
| 4120 | |||
| 4121 | /*! @abstract Zero-extends `other` to form a vector of eight 32-bit | ||
| 4122 | * floating-point numbers. */ | ||
| 4123 | static inline SIMD_CFUNC simd_float8 simd_make_float8(simd_float4 other) { | ||
| 4124 | simd_float8 result = 0; | ||
| 4125 | result.xyzw = other; | ||
| 4126 | return result; | ||
| 4127 | } | ||
| 4128 | |||
| 4129 | /*! @abstract Extends `other` to form a vector of eight 32-bit floating- | ||
| 4130 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4131 | * unspecified. */ | ||
| 4132 | static inline SIMD_CFUNC simd_float8 simd_make_float8_undef(simd_float4 other) { | ||
| 4133 | simd_float8 result; | ||
| 4134 | result.xyzw = other; | ||
| 4135 | return result; | ||
| 4136 | } | ||
| 4137 | |||
| 4138 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4139 | * templated and autogenerated code. */ | ||
| 4140 | static inline SIMD_CFUNC simd_float8 simd_make_float8(simd_float8 other) { | ||
| 4141 | return other; | ||
| 4142 | } | ||
| 4143 | |||
| 4144 | /*! @abstract Truncates `other` to form a vector of eight 32-bit floating- | ||
| 4145 | * point numbers. */ | ||
| 4146 | static inline SIMD_CFUNC simd_float8 simd_make_float8(simd_float16 other) { | ||
| 4147 | return simd_make_float8(other.lo); | ||
| 4148 | } | ||
| 4149 | |||
| 4150 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 32-bit | ||
| 4151 | * floating-point numbers. */ | ||
| 4152 | static inline SIMD_CFUNC simd_float16 simd_make_float16(simd_float8 lo, simd_float8 hi) { | ||
| 4153 | simd_float16 result; | ||
| 4154 | result.lo = lo; | ||
| 4155 | result.hi = hi; | ||
| 4156 | return result; | ||
| 4157 | } | ||
| 4158 | |||
| 4159 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 4160 | * floating-point numbers. */ | ||
| 4161 | static inline SIMD_CFUNC simd_float16 simd_make_float16(float other) { | ||
| 4162 | simd_float16 result = 0; | ||
| 4163 | result.x = other; | ||
| 4164 | return result; | ||
| 4165 | } | ||
| 4166 | |||
| 4167 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit floating- | ||
| 4168 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4169 | * unspecified. */ | ||
| 4170 | static inline SIMD_CFUNC simd_float16 simd_make_float16_undef(float other) { | ||
| 4171 | simd_float16 result; | ||
| 4172 | result.x = other; | ||
| 4173 | return result; | ||
| 4174 | } | ||
| 4175 | |||
| 4176 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 4177 | * floating-point numbers. */ | ||
| 4178 | static inline SIMD_CFUNC simd_float16 simd_make_float16(simd_float2 other) { | ||
| 4179 | simd_float16 result = 0; | ||
| 4180 | result.xy = other; | ||
| 4181 | return result; | ||
| 4182 | } | ||
| 4183 | |||
| 4184 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit floating- | ||
| 4185 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4186 | * unspecified. */ | ||
| 4187 | static inline SIMD_CFUNC simd_float16 simd_make_float16_undef(simd_float2 other) { | ||
| 4188 | simd_float16 result; | ||
| 4189 | result.xy = other; | ||
| 4190 | return result; | ||
| 4191 | } | ||
| 4192 | |||
| 4193 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 4194 | * floating-point numbers. */ | ||
| 4195 | static inline SIMD_CFUNC simd_float16 simd_make_float16(simd_float3 other) { | ||
| 4196 | simd_float16 result = 0; | ||
| 4197 | result.xyz = other; | ||
| 4198 | return result; | ||
| 4199 | } | ||
| 4200 | |||
| 4201 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit floating- | ||
| 4202 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4203 | * unspecified. */ | ||
| 4204 | static inline SIMD_CFUNC simd_float16 simd_make_float16_undef(simd_float3 other) { | ||
| 4205 | simd_float16 result; | ||
| 4206 | result.xyz = other; | ||
| 4207 | return result; | ||
| 4208 | } | ||
| 4209 | |||
| 4210 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 4211 | * floating-point numbers. */ | ||
| 4212 | static inline SIMD_CFUNC simd_float16 simd_make_float16(simd_float4 other) { | ||
| 4213 | simd_float16 result = 0; | ||
| 4214 | result.xyzw = other; | ||
| 4215 | return result; | ||
| 4216 | } | ||
| 4217 | |||
| 4218 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit floating- | ||
| 4219 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4220 | * unspecified. */ | ||
| 4221 | static inline SIMD_CFUNC simd_float16 simd_make_float16_undef(simd_float4 other) { | ||
| 4222 | simd_float16 result; | ||
| 4223 | result.xyzw = other; | ||
| 4224 | return result; | ||
| 4225 | } | ||
| 4226 | |||
| 4227 | /*! @abstract Zero-extends `other` to form a vector of sixteen 32-bit | ||
| 4228 | * floating-point numbers. */ | ||
| 4229 | static inline SIMD_CFUNC simd_float16 simd_make_float16(simd_float8 other) { | ||
| 4230 | simd_float16 result = 0; | ||
| 4231 | result.lo = simd_make_float8(other); | ||
| 4232 | return result; | ||
| 4233 | } | ||
| 4234 | |||
| 4235 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit floating- | ||
| 4236 | * point numbers. The contents of the newly-created vector lanes are | ||
| 4237 | * unspecified. */ | ||
| 4238 | static inline SIMD_CFUNC simd_float16 simd_make_float16_undef(simd_float8 other) { | ||
| 4239 | simd_float16 result; | ||
| 4240 | result.lo = simd_make_float8(other); | ||
| 4241 | return result; | ||
| 4242 | } | ||
| 4243 | |||
| 4244 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4245 | * templated and autogenerated code. */ | ||
| 4246 | static inline SIMD_CFUNC simd_float16 simd_make_float16(simd_float16 other) { | ||
| 4247 | return other; | ||
| 4248 | } | ||
| 4249 | |||
| 4250 | /*! @abstract Concatenates `x` and `y` to form a vector of two 64-bit signed | ||
| 4251 | * (twos-complement) integers. */ | ||
| 4252 | static inline SIMD_CFUNC simd_long2 simd_make_long2(simd_long1 x, simd_long1 y) { | ||
| 4253 | simd_long2 result; | ||
| 4254 | result.x = x; | ||
| 4255 | result.y = y; | ||
| 4256 | return result; | ||
| 4257 | } | ||
| 4258 | |||
| 4259 | /*! @abstract Zero-extends `other` to form a vector of two 64-bit signed | ||
| 4260 | * (twos-complement) integers. */ | ||
| 4261 | static inline SIMD_CFUNC simd_long2 simd_make_long2(simd_long1 other) { | ||
| 4262 | simd_long2 result = 0; | ||
| 4263 | result.x = other; | ||
| 4264 | return result; | ||
| 4265 | } | ||
| 4266 | |||
| 4267 | /*! @abstract Extends `other` to form a vector of two 64-bit signed (twos- | ||
| 4268 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4269 | * unspecified. */ | ||
| 4270 | static inline SIMD_CFUNC simd_long2 simd_make_long2_undef(simd_long1 other) { | ||
| 4271 | simd_long2 result; | ||
| 4272 | result.x = other; | ||
| 4273 | return result; | ||
| 4274 | } | ||
| 4275 | |||
| 4276 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4277 | * templated and autogenerated code. */ | ||
| 4278 | static inline SIMD_CFUNC simd_long2 simd_make_long2(simd_long2 other) { | ||
| 4279 | return other; | ||
| 4280 | } | ||
| 4281 | |||
| 4282 | /*! @abstract Truncates `other` to form a vector of two 64-bit signed (twos- | ||
| 4283 | * complement) integers. */ | ||
| 4284 | static inline SIMD_CFUNC simd_long2 simd_make_long2(simd_long3 other) { | ||
| 4285 | return other.xy; | ||
| 4286 | } | ||
| 4287 | |||
| 4288 | /*! @abstract Truncates `other` to form a vector of two 64-bit signed (twos- | ||
| 4289 | * complement) integers. */ | ||
| 4290 | static inline SIMD_CFUNC simd_long2 simd_make_long2(simd_long4 other) { | ||
| 4291 | return other.xy; | ||
| 4292 | } | ||
| 4293 | |||
| 4294 | /*! @abstract Truncates `other` to form a vector of two 64-bit signed (twos- | ||
| 4295 | * complement) integers. */ | ||
| 4296 | static inline SIMD_CFUNC simd_long2 simd_make_long2(simd_long8 other) { | ||
| 4297 | return other.xy; | ||
| 4298 | } | ||
| 4299 | |||
| 4300 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 64-bit | ||
| 4301 | * signed (twos-complement) integers. */ | ||
| 4302 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long1 x, simd_long1 y, simd_long1 z) { | ||
| 4303 | simd_long3 result; | ||
| 4304 | result.x = x; | ||
| 4305 | result.y = y; | ||
| 4306 | result.z = z; | ||
| 4307 | return result; | ||
| 4308 | } | ||
| 4309 | |||
| 4310 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 64-bit | ||
| 4311 | * signed (twos-complement) integers. */ | ||
| 4312 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long1 x, simd_long2 yz) { | ||
| 4313 | simd_long3 result; | ||
| 4314 | result.x = x; | ||
| 4315 | result.yz = yz; | ||
| 4316 | return result; | ||
| 4317 | } | ||
| 4318 | |||
| 4319 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 64-bit | ||
| 4320 | * signed (twos-complement) integers. */ | ||
| 4321 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long2 xy, simd_long1 z) { | ||
| 4322 | simd_long3 result; | ||
| 4323 | result.xy = xy; | ||
| 4324 | result.z = z; | ||
| 4325 | return result; | ||
| 4326 | } | ||
| 4327 | |||
| 4328 | /*! @abstract Zero-extends `other` to form a vector of three 64-bit signed | ||
| 4329 | * (twos-complement) integers. */ | ||
| 4330 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long1 other) { | ||
| 4331 | simd_long3 result = 0; | ||
| 4332 | result.x = other; | ||
| 4333 | return result; | ||
| 4334 | } | ||
| 4335 | |||
| 4336 | /*! @abstract Extends `other` to form a vector of three 64-bit signed (twos- | ||
| 4337 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4338 | * unspecified. */ | ||
| 4339 | static inline SIMD_CFUNC simd_long3 simd_make_long3_undef(simd_long1 other) { | ||
| 4340 | simd_long3 result; | ||
| 4341 | result.x = other; | ||
| 4342 | return result; | ||
| 4343 | } | ||
| 4344 | |||
| 4345 | /*! @abstract Zero-extends `other` to form a vector of three 64-bit signed | ||
| 4346 | * (twos-complement) integers. */ | ||
| 4347 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long2 other) { | ||
| 4348 | simd_long3 result = 0; | ||
| 4349 | result.xy = other; | ||
| 4350 | return result; | ||
| 4351 | } | ||
| 4352 | |||
| 4353 | /*! @abstract Extends `other` to form a vector of three 64-bit signed (twos- | ||
| 4354 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4355 | * unspecified. */ | ||
| 4356 | static inline SIMD_CFUNC simd_long3 simd_make_long3_undef(simd_long2 other) { | ||
| 4357 | simd_long3 result; | ||
| 4358 | result.xy = other; | ||
| 4359 | return result; | ||
| 4360 | } | ||
| 4361 | |||
| 4362 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4363 | * templated and autogenerated code. */ | ||
| 4364 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long3 other) { | ||
| 4365 | return other; | ||
| 4366 | } | ||
| 4367 | |||
| 4368 | /*! @abstract Truncates `other` to form a vector of three 64-bit signed | ||
| 4369 | * (twos-complement) integers. */ | ||
| 4370 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long4 other) { | ||
| 4371 | return other.xyz; | ||
| 4372 | } | ||
| 4373 | |||
| 4374 | /*! @abstract Truncates `other` to form a vector of three 64-bit signed | ||
| 4375 | * (twos-complement) integers. */ | ||
| 4376 | static inline SIMD_CFUNC simd_long3 simd_make_long3(simd_long8 other) { | ||
| 4377 | return other.xyz; | ||
| 4378 | } | ||
| 4379 | |||
| 4380 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 4381 | * 64-bit signed (twos-complement) integers. */ | ||
| 4382 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long1 x, simd_long1 y, simd_long1 z, simd_long1 w) { | ||
| 4383 | simd_long4 result; | ||
| 4384 | result.x = x; | ||
| 4385 | result.y = y; | ||
| 4386 | result.z = z; | ||
| 4387 | result.w = w; | ||
| 4388 | return result; | ||
| 4389 | } | ||
| 4390 | |||
| 4391 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 64-bit | ||
| 4392 | * signed (twos-complement) integers. */ | ||
| 4393 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long1 x, simd_long1 y, simd_long2 zw) { | ||
| 4394 | simd_long4 result; | ||
| 4395 | result.x = x; | ||
| 4396 | result.y = y; | ||
| 4397 | result.zw = zw; | ||
| 4398 | return result; | ||
| 4399 | } | ||
| 4400 | |||
| 4401 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 64-bit | ||
| 4402 | * signed (twos-complement) integers. */ | ||
| 4403 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long1 x, simd_long2 yz, simd_long1 w) { | ||
| 4404 | simd_long4 result; | ||
| 4405 | result.x = x; | ||
| 4406 | result.yz = yz; | ||
| 4407 | result.w = w; | ||
| 4408 | return result; | ||
| 4409 | } | ||
| 4410 | |||
| 4411 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 64-bit | ||
| 4412 | * signed (twos-complement) integers. */ | ||
| 4413 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long2 xy, simd_long1 z, simd_long1 w) { | ||
| 4414 | simd_long4 result; | ||
| 4415 | result.xy = xy; | ||
| 4416 | result.z = z; | ||
| 4417 | result.w = w; | ||
| 4418 | return result; | ||
| 4419 | } | ||
| 4420 | |||
| 4421 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 64-bit | ||
| 4422 | * signed (twos-complement) integers. */ | ||
| 4423 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long1 x, simd_long3 yzw) { | ||
| 4424 | simd_long4 result; | ||
| 4425 | result.x = x; | ||
| 4426 | result.yzw = yzw; | ||
| 4427 | return result; | ||
| 4428 | } | ||
| 4429 | |||
| 4430 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 64-bit | ||
| 4431 | * signed (twos-complement) integers. */ | ||
| 4432 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long2 xy, simd_long2 zw) { | ||
| 4433 | simd_long4 result; | ||
| 4434 | result.xy = xy; | ||
| 4435 | result.zw = zw; | ||
| 4436 | return result; | ||
| 4437 | } | ||
| 4438 | |||
| 4439 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 64-bit | ||
| 4440 | * signed (twos-complement) integers. */ | ||
| 4441 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long3 xyz, simd_long1 w) { | ||
| 4442 | simd_long4 result; | ||
| 4443 | result.xyz = xyz; | ||
| 4444 | result.w = w; | ||
| 4445 | return result; | ||
| 4446 | } | ||
| 4447 | |||
| 4448 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit signed | ||
| 4449 | * (twos-complement) integers. */ | ||
| 4450 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long1 other) { | ||
| 4451 | simd_long4 result = 0; | ||
| 4452 | result.x = other; | ||
| 4453 | return result; | ||
| 4454 | } | ||
| 4455 | |||
| 4456 | /*! @abstract Extends `other` to form a vector of four 64-bit signed (twos- | ||
| 4457 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4458 | * unspecified. */ | ||
| 4459 | static inline SIMD_CFUNC simd_long4 simd_make_long4_undef(simd_long1 other) { | ||
| 4460 | simd_long4 result; | ||
| 4461 | result.x = other; | ||
| 4462 | return result; | ||
| 4463 | } | ||
| 4464 | |||
| 4465 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit signed | ||
| 4466 | * (twos-complement) integers. */ | ||
| 4467 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long2 other) { | ||
| 4468 | simd_long4 result = 0; | ||
| 4469 | result.xy = other; | ||
| 4470 | return result; | ||
| 4471 | } | ||
| 4472 | |||
| 4473 | /*! @abstract Extends `other` to form a vector of four 64-bit signed (twos- | ||
| 4474 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4475 | * unspecified. */ | ||
| 4476 | static inline SIMD_CFUNC simd_long4 simd_make_long4_undef(simd_long2 other) { | ||
| 4477 | simd_long4 result; | ||
| 4478 | result.xy = other; | ||
| 4479 | return result; | ||
| 4480 | } | ||
| 4481 | |||
| 4482 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit signed | ||
| 4483 | * (twos-complement) integers. */ | ||
| 4484 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long3 other) { | ||
| 4485 | simd_long4 result = 0; | ||
| 4486 | result.xyz = other; | ||
| 4487 | return result; | ||
| 4488 | } | ||
| 4489 | |||
| 4490 | /*! @abstract Extends `other` to form a vector of four 64-bit signed (twos- | ||
| 4491 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4492 | * unspecified. */ | ||
| 4493 | static inline SIMD_CFUNC simd_long4 simd_make_long4_undef(simd_long3 other) { | ||
| 4494 | simd_long4 result; | ||
| 4495 | result.xyz = other; | ||
| 4496 | return result; | ||
| 4497 | } | ||
| 4498 | |||
| 4499 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4500 | * templated and autogenerated code. */ | ||
| 4501 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long4 other) { | ||
| 4502 | return other; | ||
| 4503 | } | ||
| 4504 | |||
| 4505 | /*! @abstract Truncates `other` to form a vector of four 64-bit signed | ||
| 4506 | * (twos-complement) integers. */ | ||
| 4507 | static inline SIMD_CFUNC simd_long4 simd_make_long4(simd_long8 other) { | ||
| 4508 | return other.xyzw; | ||
| 4509 | } | ||
| 4510 | |||
| 4511 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 64-bit | ||
| 4512 | * signed (twos-complement) integers. */ | ||
| 4513 | static inline SIMD_CFUNC simd_long8 simd_make_long8(simd_long4 lo, simd_long4 hi) { | ||
| 4514 | simd_long8 result; | ||
| 4515 | result.lo = lo; | ||
| 4516 | result.hi = hi; | ||
| 4517 | return result; | ||
| 4518 | } | ||
| 4519 | |||
| 4520 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit signed | ||
| 4521 | * (twos-complement) integers. */ | ||
| 4522 | static inline SIMD_CFUNC simd_long8 simd_make_long8(simd_long1 other) { | ||
| 4523 | simd_long8 result = 0; | ||
| 4524 | result.x = other; | ||
| 4525 | return result; | ||
| 4526 | } | ||
| 4527 | |||
| 4528 | /*! @abstract Extends `other` to form a vector of eight 64-bit signed (twos- | ||
| 4529 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4530 | * unspecified. */ | ||
| 4531 | static inline SIMD_CFUNC simd_long8 simd_make_long8_undef(simd_long1 other) { | ||
| 4532 | simd_long8 result; | ||
| 4533 | result.x = other; | ||
| 4534 | return result; | ||
| 4535 | } | ||
| 4536 | |||
| 4537 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit signed | ||
| 4538 | * (twos-complement) integers. */ | ||
| 4539 | static inline SIMD_CFUNC simd_long8 simd_make_long8(simd_long2 other) { | ||
| 4540 | simd_long8 result = 0; | ||
| 4541 | result.xy = other; | ||
| 4542 | return result; | ||
| 4543 | } | ||
| 4544 | |||
| 4545 | /*! @abstract Extends `other` to form a vector of eight 64-bit signed (twos- | ||
| 4546 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4547 | * unspecified. */ | ||
| 4548 | static inline SIMD_CFUNC simd_long8 simd_make_long8_undef(simd_long2 other) { | ||
| 4549 | simd_long8 result; | ||
| 4550 | result.xy = other; | ||
| 4551 | return result; | ||
| 4552 | } | ||
| 4553 | |||
| 4554 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit signed | ||
| 4555 | * (twos-complement) integers. */ | ||
| 4556 | static inline SIMD_CFUNC simd_long8 simd_make_long8(simd_long3 other) { | ||
| 4557 | simd_long8 result = 0; | ||
| 4558 | result.xyz = other; | ||
| 4559 | return result; | ||
| 4560 | } | ||
| 4561 | |||
| 4562 | /*! @abstract Extends `other` to form a vector of eight 64-bit signed (twos- | ||
| 4563 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4564 | * unspecified. */ | ||
| 4565 | static inline SIMD_CFUNC simd_long8 simd_make_long8_undef(simd_long3 other) { | ||
| 4566 | simd_long8 result; | ||
| 4567 | result.xyz = other; | ||
| 4568 | return result; | ||
| 4569 | } | ||
| 4570 | |||
| 4571 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit signed | ||
| 4572 | * (twos-complement) integers. */ | ||
| 4573 | static inline SIMD_CFUNC simd_long8 simd_make_long8(simd_long4 other) { | ||
| 4574 | simd_long8 result = 0; | ||
| 4575 | result.xyzw = other; | ||
| 4576 | return result; | ||
| 4577 | } | ||
| 4578 | |||
| 4579 | /*! @abstract Extends `other` to form a vector of eight 64-bit signed (twos- | ||
| 4580 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 4581 | * unspecified. */ | ||
| 4582 | static inline SIMD_CFUNC simd_long8 simd_make_long8_undef(simd_long4 other) { | ||
| 4583 | simd_long8 result; | ||
| 4584 | result.xyzw = other; | ||
| 4585 | return result; | ||
| 4586 | } | ||
| 4587 | |||
| 4588 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4589 | * templated and autogenerated code. */ | ||
| 4590 | static inline SIMD_CFUNC simd_long8 simd_make_long8(simd_long8 other) { | ||
| 4591 | return other; | ||
| 4592 | } | ||
| 4593 | |||
| 4594 | /*! @abstract Concatenates `x` and `y` to form a vector of two 64-bit | ||
| 4595 | * unsigned integers. */ | ||
| 4596 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2(simd_ulong1 x, simd_ulong1 y) { | ||
| 4597 | simd_ulong2 result; | ||
| 4598 | result.x = x; | ||
| 4599 | result.y = y; | ||
| 4600 | return result; | ||
| 4601 | } | ||
| 4602 | |||
| 4603 | /*! @abstract Zero-extends `other` to form a vector of two 64-bit unsigned | ||
| 4604 | * integers. */ | ||
| 4605 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2(simd_ulong1 other) { | ||
| 4606 | simd_ulong2 result = 0; | ||
| 4607 | result.x = other; | ||
| 4608 | return result; | ||
| 4609 | } | ||
| 4610 | |||
| 4611 | /*! @abstract Extends `other` to form a vector of two 64-bit unsigned | ||
| 4612 | * integers. The contents of the newly-created vector lanes are | ||
| 4613 | * unspecified. */ | ||
| 4614 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2_undef(simd_ulong1 other) { | ||
| 4615 | simd_ulong2 result; | ||
| 4616 | result.x = other; | ||
| 4617 | return result; | ||
| 4618 | } | ||
| 4619 | |||
| 4620 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4621 | * templated and autogenerated code. */ | ||
| 4622 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2(simd_ulong2 other) { | ||
| 4623 | return other; | ||
| 4624 | } | ||
| 4625 | |||
| 4626 | /*! @abstract Truncates `other` to form a vector of two 64-bit unsigned | ||
| 4627 | * integers. */ | ||
| 4628 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2(simd_ulong3 other) { | ||
| 4629 | return other.xy; | ||
| 4630 | } | ||
| 4631 | |||
| 4632 | /*! @abstract Truncates `other` to form a vector of two 64-bit unsigned | ||
| 4633 | * integers. */ | ||
| 4634 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2(simd_ulong4 other) { | ||
| 4635 | return other.xy; | ||
| 4636 | } | ||
| 4637 | |||
| 4638 | /*! @abstract Truncates `other` to form a vector of two 64-bit unsigned | ||
| 4639 | * integers. */ | ||
| 4640 | static inline SIMD_CFUNC simd_ulong2 simd_make_ulong2(simd_ulong8 other) { | ||
| 4641 | return other.xy; | ||
| 4642 | } | ||
| 4643 | |||
| 4644 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 64-bit | ||
| 4645 | * unsigned integers. */ | ||
| 4646 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong1 x, simd_ulong1 y, simd_ulong1 z) { | ||
| 4647 | simd_ulong3 result; | ||
| 4648 | result.x = x; | ||
| 4649 | result.y = y; | ||
| 4650 | result.z = z; | ||
| 4651 | return result; | ||
| 4652 | } | ||
| 4653 | |||
| 4654 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 64-bit | ||
| 4655 | * unsigned integers. */ | ||
| 4656 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong1 x, simd_ulong2 yz) { | ||
| 4657 | simd_ulong3 result; | ||
| 4658 | result.x = x; | ||
| 4659 | result.yz = yz; | ||
| 4660 | return result; | ||
| 4661 | } | ||
| 4662 | |||
| 4663 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 64-bit | ||
| 4664 | * unsigned integers. */ | ||
| 4665 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong2 xy, simd_ulong1 z) { | ||
| 4666 | simd_ulong3 result; | ||
| 4667 | result.xy = xy; | ||
| 4668 | result.z = z; | ||
| 4669 | return result; | ||
| 4670 | } | ||
| 4671 | |||
| 4672 | /*! @abstract Zero-extends `other` to form a vector of three 64-bit unsigned | ||
| 4673 | * integers. */ | ||
| 4674 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong1 other) { | ||
| 4675 | simd_ulong3 result = 0; | ||
| 4676 | result.x = other; | ||
| 4677 | return result; | ||
| 4678 | } | ||
| 4679 | |||
| 4680 | /*! @abstract Extends `other` to form a vector of three 64-bit unsigned | ||
| 4681 | * integers. The contents of the newly-created vector lanes are | ||
| 4682 | * unspecified. */ | ||
| 4683 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3_undef(simd_ulong1 other) { | ||
| 4684 | simd_ulong3 result; | ||
| 4685 | result.x = other; | ||
| 4686 | return result; | ||
| 4687 | } | ||
| 4688 | |||
| 4689 | /*! @abstract Zero-extends `other` to form a vector of three 64-bit unsigned | ||
| 4690 | * integers. */ | ||
| 4691 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong2 other) { | ||
| 4692 | simd_ulong3 result = 0; | ||
| 4693 | result.xy = other; | ||
| 4694 | return result; | ||
| 4695 | } | ||
| 4696 | |||
| 4697 | /*! @abstract Extends `other` to form a vector of three 64-bit unsigned | ||
| 4698 | * integers. The contents of the newly-created vector lanes are | ||
| 4699 | * unspecified. */ | ||
| 4700 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3_undef(simd_ulong2 other) { | ||
| 4701 | simd_ulong3 result; | ||
| 4702 | result.xy = other; | ||
| 4703 | return result; | ||
| 4704 | } | ||
| 4705 | |||
| 4706 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4707 | * templated and autogenerated code. */ | ||
| 4708 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong3 other) { | ||
| 4709 | return other; | ||
| 4710 | } | ||
| 4711 | |||
| 4712 | /*! @abstract Truncates `other` to form a vector of three 64-bit unsigned | ||
| 4713 | * integers. */ | ||
| 4714 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong4 other) { | ||
| 4715 | return other.xyz; | ||
| 4716 | } | ||
| 4717 | |||
| 4718 | /*! @abstract Truncates `other` to form a vector of three 64-bit unsigned | ||
| 4719 | * integers. */ | ||
| 4720 | static inline SIMD_CFUNC simd_ulong3 simd_make_ulong3(simd_ulong8 other) { | ||
| 4721 | return other.xyz; | ||
| 4722 | } | ||
| 4723 | |||
| 4724 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 4725 | * 64-bit unsigned integers. */ | ||
| 4726 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong1 x, simd_ulong1 y, simd_ulong1 z, simd_ulong1 w) { | ||
| 4727 | simd_ulong4 result; | ||
| 4728 | result.x = x; | ||
| 4729 | result.y = y; | ||
| 4730 | result.z = z; | ||
| 4731 | result.w = w; | ||
| 4732 | return result; | ||
| 4733 | } | ||
| 4734 | |||
| 4735 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 64-bit | ||
| 4736 | * unsigned integers. */ | ||
| 4737 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong1 x, simd_ulong1 y, simd_ulong2 zw) { | ||
| 4738 | simd_ulong4 result; | ||
| 4739 | result.x = x; | ||
| 4740 | result.y = y; | ||
| 4741 | result.zw = zw; | ||
| 4742 | return result; | ||
| 4743 | } | ||
| 4744 | |||
| 4745 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 64-bit | ||
| 4746 | * unsigned integers. */ | ||
| 4747 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong1 x, simd_ulong2 yz, simd_ulong1 w) { | ||
| 4748 | simd_ulong4 result; | ||
| 4749 | result.x = x; | ||
| 4750 | result.yz = yz; | ||
| 4751 | result.w = w; | ||
| 4752 | return result; | ||
| 4753 | } | ||
| 4754 | |||
| 4755 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 64-bit | ||
| 4756 | * unsigned integers. */ | ||
| 4757 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong2 xy, simd_ulong1 z, simd_ulong1 w) { | ||
| 4758 | simd_ulong4 result; | ||
| 4759 | result.xy = xy; | ||
| 4760 | result.z = z; | ||
| 4761 | result.w = w; | ||
| 4762 | return result; | ||
| 4763 | } | ||
| 4764 | |||
| 4765 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 64-bit | ||
| 4766 | * unsigned integers. */ | ||
| 4767 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong1 x, simd_ulong3 yzw) { | ||
| 4768 | simd_ulong4 result; | ||
| 4769 | result.x = x; | ||
| 4770 | result.yzw = yzw; | ||
| 4771 | return result; | ||
| 4772 | } | ||
| 4773 | |||
| 4774 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 64-bit | ||
| 4775 | * unsigned integers. */ | ||
| 4776 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong2 xy, simd_ulong2 zw) { | ||
| 4777 | simd_ulong4 result; | ||
| 4778 | result.xy = xy; | ||
| 4779 | result.zw = zw; | ||
| 4780 | return result; | ||
| 4781 | } | ||
| 4782 | |||
| 4783 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 64-bit | ||
| 4784 | * unsigned integers. */ | ||
| 4785 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong3 xyz, simd_ulong1 w) { | ||
| 4786 | simd_ulong4 result; | ||
| 4787 | result.xyz = xyz; | ||
| 4788 | result.w = w; | ||
| 4789 | return result; | ||
| 4790 | } | ||
| 4791 | |||
| 4792 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit unsigned | ||
| 4793 | * integers. */ | ||
| 4794 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong1 other) { | ||
| 4795 | simd_ulong4 result = 0; | ||
| 4796 | result.x = other; | ||
| 4797 | return result; | ||
| 4798 | } | ||
| 4799 | |||
| 4800 | /*! @abstract Extends `other` to form a vector of four 64-bit unsigned | ||
| 4801 | * integers. The contents of the newly-created vector lanes are | ||
| 4802 | * unspecified. */ | ||
| 4803 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4_undef(simd_ulong1 other) { | ||
| 4804 | simd_ulong4 result; | ||
| 4805 | result.x = other; | ||
| 4806 | return result; | ||
| 4807 | } | ||
| 4808 | |||
| 4809 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit unsigned | ||
| 4810 | * integers. */ | ||
| 4811 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong2 other) { | ||
| 4812 | simd_ulong4 result = 0; | ||
| 4813 | result.xy = other; | ||
| 4814 | return result; | ||
| 4815 | } | ||
| 4816 | |||
| 4817 | /*! @abstract Extends `other` to form a vector of four 64-bit unsigned | ||
| 4818 | * integers. The contents of the newly-created vector lanes are | ||
| 4819 | * unspecified. */ | ||
| 4820 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4_undef(simd_ulong2 other) { | ||
| 4821 | simd_ulong4 result; | ||
| 4822 | result.xy = other; | ||
| 4823 | return result; | ||
| 4824 | } | ||
| 4825 | |||
| 4826 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit unsigned | ||
| 4827 | * integers. */ | ||
| 4828 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong3 other) { | ||
| 4829 | simd_ulong4 result = 0; | ||
| 4830 | result.xyz = other; | ||
| 4831 | return result; | ||
| 4832 | } | ||
| 4833 | |||
| 4834 | /*! @abstract Extends `other` to form a vector of four 64-bit unsigned | ||
| 4835 | * integers. The contents of the newly-created vector lanes are | ||
| 4836 | * unspecified. */ | ||
| 4837 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4_undef(simd_ulong3 other) { | ||
| 4838 | simd_ulong4 result; | ||
| 4839 | result.xyz = other; | ||
| 4840 | return result; | ||
| 4841 | } | ||
| 4842 | |||
| 4843 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4844 | * templated and autogenerated code. */ | ||
| 4845 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong4 other) { | ||
| 4846 | return other; | ||
| 4847 | } | ||
| 4848 | |||
| 4849 | /*! @abstract Truncates `other` to form a vector of four 64-bit unsigned | ||
| 4850 | * integers. */ | ||
| 4851 | static inline SIMD_CFUNC simd_ulong4 simd_make_ulong4(simd_ulong8 other) { | ||
| 4852 | return other.xyzw; | ||
| 4853 | } | ||
| 4854 | |||
| 4855 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 64-bit | ||
| 4856 | * unsigned integers. */ | ||
| 4857 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8(simd_ulong4 lo, simd_ulong4 hi) { | ||
| 4858 | simd_ulong8 result; | ||
| 4859 | result.lo = lo; | ||
| 4860 | result.hi = hi; | ||
| 4861 | return result; | ||
| 4862 | } | ||
| 4863 | |||
| 4864 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit unsigned | ||
| 4865 | * integers. */ | ||
| 4866 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8(simd_ulong1 other) { | ||
| 4867 | simd_ulong8 result = 0; | ||
| 4868 | result.x = other; | ||
| 4869 | return result; | ||
| 4870 | } | ||
| 4871 | |||
| 4872 | /*! @abstract Extends `other` to form a vector of eight 64-bit unsigned | ||
| 4873 | * integers. The contents of the newly-created vector lanes are | ||
| 4874 | * unspecified. */ | ||
| 4875 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8_undef(simd_ulong1 other) { | ||
| 4876 | simd_ulong8 result; | ||
| 4877 | result.x = other; | ||
| 4878 | return result; | ||
| 4879 | } | ||
| 4880 | |||
| 4881 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit unsigned | ||
| 4882 | * integers. */ | ||
| 4883 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8(simd_ulong2 other) { | ||
| 4884 | simd_ulong8 result = 0; | ||
| 4885 | result.xy = other; | ||
| 4886 | return result; | ||
| 4887 | } | ||
| 4888 | |||
| 4889 | /*! @abstract Extends `other` to form a vector of eight 64-bit unsigned | ||
| 4890 | * integers. The contents of the newly-created vector lanes are | ||
| 4891 | * unspecified. */ | ||
| 4892 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8_undef(simd_ulong2 other) { | ||
| 4893 | simd_ulong8 result; | ||
| 4894 | result.xy = other; | ||
| 4895 | return result; | ||
| 4896 | } | ||
| 4897 | |||
| 4898 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit unsigned | ||
| 4899 | * integers. */ | ||
| 4900 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8(simd_ulong3 other) { | ||
| 4901 | simd_ulong8 result = 0; | ||
| 4902 | result.xyz = other; | ||
| 4903 | return result; | ||
| 4904 | } | ||
| 4905 | |||
| 4906 | /*! @abstract Extends `other` to form a vector of eight 64-bit unsigned | ||
| 4907 | * integers. The contents of the newly-created vector lanes are | ||
| 4908 | * unspecified. */ | ||
| 4909 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8_undef(simd_ulong3 other) { | ||
| 4910 | simd_ulong8 result; | ||
| 4911 | result.xyz = other; | ||
| 4912 | return result; | ||
| 4913 | } | ||
| 4914 | |||
| 4915 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit unsigned | ||
| 4916 | * integers. */ | ||
| 4917 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8(simd_ulong4 other) { | ||
| 4918 | simd_ulong8 result = 0; | ||
| 4919 | result.xyzw = other; | ||
| 4920 | return result; | ||
| 4921 | } | ||
| 4922 | |||
| 4923 | /*! @abstract Extends `other` to form a vector of eight 64-bit unsigned | ||
| 4924 | * integers. The contents of the newly-created vector lanes are | ||
| 4925 | * unspecified. */ | ||
| 4926 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8_undef(simd_ulong4 other) { | ||
| 4927 | simd_ulong8 result; | ||
| 4928 | result.xyzw = other; | ||
| 4929 | return result; | ||
| 4930 | } | ||
| 4931 | |||
| 4932 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4933 | * templated and autogenerated code. */ | ||
| 4934 | static inline SIMD_CFUNC simd_ulong8 simd_make_ulong8(simd_ulong8 other) { | ||
| 4935 | return other; | ||
| 4936 | } | ||
| 4937 | |||
| 4938 | /*! @abstract Concatenates `x` and `y` to form a vector of two 64-bit | ||
| 4939 | * floating-point numbers. */ | ||
| 4940 | static inline SIMD_CFUNC simd_double2 simd_make_double2(double x, double y) { | ||
| 4941 | simd_double2 result; | ||
| 4942 | result.x = x; | ||
| 4943 | result.y = y; | ||
| 4944 | return result; | ||
| 4945 | } | ||
| 4946 | |||
| 4947 | /*! @abstract Zero-extends `other` to form a vector of two 64-bit floating- | ||
| 4948 | * point numbers. */ | ||
| 4949 | static inline SIMD_CFUNC simd_double2 simd_make_double2(double other) { | ||
| 4950 | simd_double2 result = 0; | ||
| 4951 | result.x = other; | ||
| 4952 | return result; | ||
| 4953 | } | ||
| 4954 | |||
| 4955 | /*! @abstract Extends `other` to form a vector of two 64-bit floating-point | ||
| 4956 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 4957 | static inline SIMD_CFUNC simd_double2 simd_make_double2_undef(double other) { | ||
| 4958 | simd_double2 result; | ||
| 4959 | result.x = other; | ||
| 4960 | return result; | ||
| 4961 | } | ||
| 4962 | |||
| 4963 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 4964 | * templated and autogenerated code. */ | ||
| 4965 | static inline SIMD_CFUNC simd_double2 simd_make_double2(simd_double2 other) { | ||
| 4966 | return other; | ||
| 4967 | } | ||
| 4968 | |||
| 4969 | /*! @abstract Truncates `other` to form a vector of two 64-bit floating- | ||
| 4970 | * point numbers. */ | ||
| 4971 | static inline SIMD_CFUNC simd_double2 simd_make_double2(simd_double3 other) { | ||
| 4972 | return other.xy; | ||
| 4973 | } | ||
| 4974 | |||
| 4975 | /*! @abstract Truncates `other` to form a vector of two 64-bit floating- | ||
| 4976 | * point numbers. */ | ||
| 4977 | static inline SIMD_CFUNC simd_double2 simd_make_double2(simd_double4 other) { | ||
| 4978 | return other.xy; | ||
| 4979 | } | ||
| 4980 | |||
| 4981 | /*! @abstract Truncates `other` to form a vector of two 64-bit floating- | ||
| 4982 | * point numbers. */ | ||
| 4983 | static inline SIMD_CFUNC simd_double2 simd_make_double2(simd_double8 other) { | ||
| 4984 | return other.xy; | ||
| 4985 | } | ||
| 4986 | |||
| 4987 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 64-bit | ||
| 4988 | * floating-point numbers. */ | ||
| 4989 | static inline SIMD_CFUNC simd_double3 simd_make_double3(double x, double y, double z) { | ||
| 4990 | simd_double3 result; | ||
| 4991 | result.x = x; | ||
| 4992 | result.y = y; | ||
| 4993 | result.z = z; | ||
| 4994 | return result; | ||
| 4995 | } | ||
| 4996 | |||
| 4997 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 64-bit | ||
| 4998 | * floating-point numbers. */ | ||
| 4999 | static inline SIMD_CFUNC simd_double3 simd_make_double3(double x, simd_double2 yz) { | ||
| 5000 | simd_double3 result; | ||
| 5001 | result.x = x; | ||
| 5002 | result.yz = yz; | ||
| 5003 | return result; | ||
| 5004 | } | ||
| 5005 | |||
| 5006 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 64-bit | ||
| 5007 | * floating-point numbers. */ | ||
| 5008 | static inline SIMD_CFUNC simd_double3 simd_make_double3(simd_double2 xy, double z) { | ||
| 5009 | simd_double3 result; | ||
| 5010 | result.xy = xy; | ||
| 5011 | result.z = z; | ||
| 5012 | return result; | ||
| 5013 | } | ||
| 5014 | |||
| 5015 | /*! @abstract Zero-extends `other` to form a vector of three 64-bit | ||
| 5016 | * floating-point numbers. */ | ||
| 5017 | static inline SIMD_CFUNC simd_double3 simd_make_double3(double other) { | ||
| 5018 | simd_double3 result = 0; | ||
| 5019 | result.x = other; | ||
| 5020 | return result; | ||
| 5021 | } | ||
| 5022 | |||
| 5023 | /*! @abstract Extends `other` to form a vector of three 64-bit floating- | ||
| 5024 | * point numbers. The contents of the newly-created vector lanes are | ||
| 5025 | * unspecified. */ | ||
| 5026 | static inline SIMD_CFUNC simd_double3 simd_make_double3_undef(double other) { | ||
| 5027 | simd_double3 result; | ||
| 5028 | result.x = other; | ||
| 5029 | return result; | ||
| 5030 | } | ||
| 5031 | |||
| 5032 | /*! @abstract Zero-extends `other` to form a vector of three 64-bit | ||
| 5033 | * floating-point numbers. */ | ||
| 5034 | static inline SIMD_CFUNC simd_double3 simd_make_double3(simd_double2 other) { | ||
| 5035 | simd_double3 result = 0; | ||
| 5036 | result.xy = other; | ||
| 5037 | return result; | ||
| 5038 | } | ||
| 5039 | |||
| 5040 | /*! @abstract Extends `other` to form a vector of three 64-bit floating- | ||
| 5041 | * point numbers. The contents of the newly-created vector lanes are | ||
| 5042 | * unspecified. */ | ||
| 5043 | static inline SIMD_CFUNC simd_double3 simd_make_double3_undef(simd_double2 other) { | ||
| 5044 | simd_double3 result; | ||
| 5045 | result.xy = other; | ||
| 5046 | return result; | ||
| 5047 | } | ||
| 5048 | |||
| 5049 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 5050 | * templated and autogenerated code. */ | ||
| 5051 | static inline SIMD_CFUNC simd_double3 simd_make_double3(simd_double3 other) { | ||
| 5052 | return other; | ||
| 5053 | } | ||
| 5054 | |||
| 5055 | /*! @abstract Truncates `other` to form a vector of three 64-bit floating- | ||
| 5056 | * point numbers. */ | ||
| 5057 | static inline SIMD_CFUNC simd_double3 simd_make_double3(simd_double4 other) { | ||
| 5058 | return other.xyz; | ||
| 5059 | } | ||
| 5060 | |||
| 5061 | /*! @abstract Truncates `other` to form a vector of three 64-bit floating- | ||
| 5062 | * point numbers. */ | ||
| 5063 | static inline SIMD_CFUNC simd_double3 simd_make_double3(simd_double8 other) { | ||
| 5064 | return other.xyz; | ||
| 5065 | } | ||
| 5066 | |||
| 5067 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 5068 | * 64-bit floating-point numbers. */ | ||
| 5069 | static inline SIMD_CFUNC simd_double4 simd_make_double4(double x, double y, double z, double w) { | ||
| 5070 | simd_double4 result; | ||
| 5071 | result.x = x; | ||
| 5072 | result.y = y; | ||
| 5073 | result.z = z; | ||
| 5074 | result.w = w; | ||
| 5075 | return result; | ||
| 5076 | } | ||
| 5077 | |||
| 5078 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 64-bit | ||
| 5079 | * floating-point numbers. */ | ||
| 5080 | static inline SIMD_CFUNC simd_double4 simd_make_double4(double x, double y, simd_double2 zw) { | ||
| 5081 | simd_double4 result; | ||
| 5082 | result.x = x; | ||
| 5083 | result.y = y; | ||
| 5084 | result.zw = zw; | ||
| 5085 | return result; | ||
| 5086 | } | ||
| 5087 | |||
| 5088 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 64-bit | ||
| 5089 | * floating-point numbers. */ | ||
| 5090 | static inline SIMD_CFUNC simd_double4 simd_make_double4(double x, simd_double2 yz, double w) { | ||
| 5091 | simd_double4 result; | ||
| 5092 | result.x = x; | ||
| 5093 | result.yz = yz; | ||
| 5094 | result.w = w; | ||
| 5095 | return result; | ||
| 5096 | } | ||
| 5097 | |||
| 5098 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 64-bit | ||
| 5099 | * floating-point numbers. */ | ||
| 5100 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double2 xy, double z, double w) { | ||
| 5101 | simd_double4 result; | ||
| 5102 | result.xy = xy; | ||
| 5103 | result.z = z; | ||
| 5104 | result.w = w; | ||
| 5105 | return result; | ||
| 5106 | } | ||
| 5107 | |||
| 5108 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 64-bit | ||
| 5109 | * floating-point numbers. */ | ||
| 5110 | static inline SIMD_CFUNC simd_double4 simd_make_double4(double x, simd_double3 yzw) { | ||
| 5111 | simd_double4 result; | ||
| 5112 | result.x = x; | ||
| 5113 | result.yzw = yzw; | ||
| 5114 | return result; | ||
| 5115 | } | ||
| 5116 | |||
| 5117 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 64-bit | ||
| 5118 | * floating-point numbers. */ | ||
| 5119 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double2 xy, simd_double2 zw) { | ||
| 5120 | simd_double4 result; | ||
| 5121 | result.xy = xy; | ||
| 5122 | result.zw = zw; | ||
| 5123 | return result; | ||
| 5124 | } | ||
| 5125 | |||
| 5126 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 64-bit | ||
| 5127 | * floating-point numbers. */ | ||
| 5128 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double3 xyz, double w) { | ||
| 5129 | simd_double4 result; | ||
| 5130 | result.xyz = xyz; | ||
| 5131 | result.w = w; | ||
| 5132 | return result; | ||
| 5133 | } | ||
| 5134 | |||
| 5135 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit floating- | ||
| 5136 | * point numbers. */ | ||
| 5137 | static inline SIMD_CFUNC simd_double4 simd_make_double4(double other) { | ||
| 5138 | simd_double4 result = 0; | ||
| 5139 | result.x = other; | ||
| 5140 | return result; | ||
| 5141 | } | ||
| 5142 | |||
| 5143 | /*! @abstract Extends `other` to form a vector of four 64-bit floating-point | ||
| 5144 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 5145 | static inline SIMD_CFUNC simd_double4 simd_make_double4_undef(double other) { | ||
| 5146 | simd_double4 result; | ||
| 5147 | result.x = other; | ||
| 5148 | return result; | ||
| 5149 | } | ||
| 5150 | |||
| 5151 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit floating- | ||
| 5152 | * point numbers. */ | ||
| 5153 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double2 other) { | ||
| 5154 | simd_double4 result = 0; | ||
| 5155 | result.xy = other; | ||
| 5156 | return result; | ||
| 5157 | } | ||
| 5158 | |||
| 5159 | /*! @abstract Extends `other` to form a vector of four 64-bit floating-point | ||
| 5160 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 5161 | static inline SIMD_CFUNC simd_double4 simd_make_double4_undef(simd_double2 other) { | ||
| 5162 | simd_double4 result; | ||
| 5163 | result.xy = other; | ||
| 5164 | return result; | ||
| 5165 | } | ||
| 5166 | |||
| 5167 | /*! @abstract Zero-extends `other` to form a vector of four 64-bit floating- | ||
| 5168 | * point numbers. */ | ||
| 5169 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double3 other) { | ||
| 5170 | simd_double4 result = 0; | ||
| 5171 | result.xyz = other; | ||
| 5172 | return result; | ||
| 5173 | } | ||
| 5174 | |||
| 5175 | /*! @abstract Extends `other` to form a vector of four 64-bit floating-point | ||
| 5176 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 5177 | static inline SIMD_CFUNC simd_double4 simd_make_double4_undef(simd_double3 other) { | ||
| 5178 | simd_double4 result; | ||
| 5179 | result.xyz = other; | ||
| 5180 | return result; | ||
| 5181 | } | ||
| 5182 | |||
| 5183 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 5184 | * templated and autogenerated code. */ | ||
| 5185 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double4 other) { | ||
| 5186 | return other; | ||
| 5187 | } | ||
| 5188 | |||
| 5189 | /*! @abstract Truncates `other` to form a vector of four 64-bit floating- | ||
| 5190 | * point numbers. */ | ||
| 5191 | static inline SIMD_CFUNC simd_double4 simd_make_double4(simd_double8 other) { | ||
| 5192 | return other.xyzw; | ||
| 5193 | } | ||
| 5194 | |||
| 5195 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 64-bit | ||
| 5196 | * floating-point numbers. */ | ||
| 5197 | static inline SIMD_CFUNC simd_double8 simd_make_double8(simd_double4 lo, simd_double4 hi) { | ||
| 5198 | simd_double8 result; | ||
| 5199 | result.lo = lo; | ||
| 5200 | result.hi = hi; | ||
| 5201 | return result; | ||
| 5202 | } | ||
| 5203 | |||
| 5204 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit | ||
| 5205 | * floating-point numbers. */ | ||
| 5206 | static inline SIMD_CFUNC simd_double8 simd_make_double8(double other) { | ||
| 5207 | simd_double8 result = 0; | ||
| 5208 | result.x = other; | ||
| 5209 | return result; | ||
| 5210 | } | ||
| 5211 | |||
| 5212 | /*! @abstract Extends `other` to form a vector of eight 64-bit floating- | ||
| 5213 | * point numbers. The contents of the newly-created vector lanes are | ||
| 5214 | * unspecified. */ | ||
| 5215 | static inline SIMD_CFUNC simd_double8 simd_make_double8_undef(double other) { | ||
| 5216 | simd_double8 result; | ||
| 5217 | result.x = other; | ||
| 5218 | return result; | ||
| 5219 | } | ||
| 5220 | |||
| 5221 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit | ||
| 5222 | * floating-point numbers. */ | ||
| 5223 | static inline SIMD_CFUNC simd_double8 simd_make_double8(simd_double2 other) { | ||
| 5224 | simd_double8 result = 0; | ||
| 5225 | result.xy = other; | ||
| 5226 | return result; | ||
| 5227 | } | ||
| 5228 | |||
| 5229 | /*! @abstract Extends `other` to form a vector of eight 64-bit floating- | ||
| 5230 | * point numbers. The contents of the newly-created vector lanes are | ||
| 5231 | * unspecified. */ | ||
| 5232 | static inline SIMD_CFUNC simd_double8 simd_make_double8_undef(simd_double2 other) { | ||
| 5233 | simd_double8 result; | ||
| 5234 | result.xy = other; | ||
| 5235 | return result; | ||
| 5236 | } | ||
| 5237 | |||
| 5238 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit | ||
| 5239 | * floating-point numbers. */ | ||
| 5240 | static inline SIMD_CFUNC simd_double8 simd_make_double8(simd_double3 other) { | ||
| 5241 | simd_double8 result = 0; | ||
| 5242 | result.xyz = other; | ||
| 5243 | return result; | ||
| 5244 | } | ||
| 5245 | |||
| 5246 | /*! @abstract Extends `other` to form a vector of eight 64-bit floating- | ||
| 5247 | * point numbers. The contents of the newly-created vector lanes are | ||
| 5248 | * unspecified. */ | ||
| 5249 | static inline SIMD_CFUNC simd_double8 simd_make_double8_undef(simd_double3 other) { | ||
| 5250 | simd_double8 result; | ||
| 5251 | result.xyz = other; | ||
| 5252 | return result; | ||
| 5253 | } | ||
| 5254 | |||
| 5255 | /*! @abstract Zero-extends `other` to form a vector of eight 64-bit | ||
| 5256 | * floating-point numbers. */ | ||
| 5257 | static inline SIMD_CFUNC simd_double8 simd_make_double8(simd_double4 other) { | ||
| 5258 | simd_double8 result = 0; | ||
| 5259 | result.xyzw = other; | ||
| 5260 | return result; | ||
| 5261 | } | ||
| 5262 | |||
| 5263 | /*! @abstract Extends `other` to form a vector of eight 64-bit floating- | ||
| 5264 | * point numbers. The contents of the newly-created vector lanes are | ||
| 5265 | * unspecified. */ | ||
| 5266 | static inline SIMD_CFUNC simd_double8 simd_make_double8_undef(simd_double4 other) { | ||
| 5267 | simd_double8 result; | ||
| 5268 | result.xyzw = other; | ||
| 5269 | return result; | ||
| 5270 | } | ||
| 5271 | |||
| 5272 | /*! @abstract Returns `other` unmodified. This function is a convenience for | ||
| 5273 | * templated and autogenerated code. */ | ||
| 5274 | static inline SIMD_CFUNC simd_double8 simd_make_double8(simd_double8 other) { | ||
| 5275 | return other; | ||
| 5276 | } | ||
| 5277 | |||
| 5278 | #ifdef __cplusplus | ||
| 5279 | } /* extern "C" */ | ||
| 5280 | |||
| 5281 | namespace simd { | ||
| 5282 | /*! @abstract Concatenates `x` and `y` to form a vector of two 8-bit signed | ||
| 5283 | * (twos-complement) integers. */ | ||
| 5284 | static inline SIMD_CPPFUNC char2 make_char2(char x, char y) { | ||
| 5285 | return ::simd_make_char2(x, y); | ||
| 5286 | } | ||
| 5287 | |||
| 5288 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 5289 | * 8-bit signed (twos-complement) integers. */ | ||
| 5290 | template <typename typeN> static SIMD_CPPFUNC char2 make_char2(typeN other) { | ||
| 5291 | return ::simd_make_char2(other); | ||
| 5292 | } | ||
| 5293 | |||
| 5294 | /*! @abstract Extends `other` to form a vector of two 8-bit signed (twos- | ||
| 5295 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5296 | * unspecified. */ | ||
| 5297 | template <typename typeN> static SIMD_CPPFUNC char2 make_char2_undef(typeN other) { | ||
| 5298 | return ::simd_make_char2_undef(other); | ||
| 5299 | } | ||
| 5300 | |||
| 5301 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 8-bit | ||
| 5302 | * signed (twos-complement) integers. */ | ||
| 5303 | static inline SIMD_CPPFUNC char3 make_char3(char x, char y, char z) { | ||
| 5304 | return ::simd_make_char3(x, y, z); | ||
| 5305 | } | ||
| 5306 | |||
| 5307 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 8-bit | ||
| 5308 | * signed (twos-complement) integers. */ | ||
| 5309 | static inline SIMD_CPPFUNC char3 make_char3(char x, char2 yz) { | ||
| 5310 | return ::simd_make_char3(x, yz); | ||
| 5311 | } | ||
| 5312 | |||
| 5313 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 8-bit | ||
| 5314 | * signed (twos-complement) integers. */ | ||
| 5315 | static inline SIMD_CPPFUNC char3 make_char3(char2 xy, char z) { | ||
| 5316 | return ::simd_make_char3(xy, z); | ||
| 5317 | } | ||
| 5318 | |||
| 5319 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 5320 | * 8-bit signed (twos-complement) integers. */ | ||
| 5321 | template <typename typeN> static SIMD_CPPFUNC char3 make_char3(typeN other) { | ||
| 5322 | return ::simd_make_char3(other); | ||
| 5323 | } | ||
| 5324 | |||
| 5325 | /*! @abstract Extends `other` to form a vector of three 8-bit signed (twos- | ||
| 5326 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5327 | * unspecified. */ | ||
| 5328 | template <typename typeN> static SIMD_CPPFUNC char3 make_char3_undef(typeN other) { | ||
| 5329 | return ::simd_make_char3_undef(other); | ||
| 5330 | } | ||
| 5331 | |||
| 5332 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 5333 | * 8-bit signed (twos-complement) integers. */ | ||
| 5334 | static inline SIMD_CPPFUNC char4 make_char4(char x, char y, char z, char w) { | ||
| 5335 | return ::simd_make_char4(x, y, z, w); | ||
| 5336 | } | ||
| 5337 | |||
| 5338 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 8-bit | ||
| 5339 | * signed (twos-complement) integers. */ | ||
| 5340 | static inline SIMD_CPPFUNC char4 make_char4(char x, char y, char2 zw) { | ||
| 5341 | return ::simd_make_char4(x, y, zw); | ||
| 5342 | } | ||
| 5343 | |||
| 5344 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 8-bit | ||
| 5345 | * signed (twos-complement) integers. */ | ||
| 5346 | static inline SIMD_CPPFUNC char4 make_char4(char x, char2 yz, char w) { | ||
| 5347 | return ::simd_make_char4(x, yz, w); | ||
| 5348 | } | ||
| 5349 | |||
| 5350 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 8-bit | ||
| 5351 | * signed (twos-complement) integers. */ | ||
| 5352 | static inline SIMD_CPPFUNC char4 make_char4(char2 xy, char z, char w) { | ||
| 5353 | return ::simd_make_char4(xy, z, w); | ||
| 5354 | } | ||
| 5355 | |||
| 5356 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 8-bit | ||
| 5357 | * signed (twos-complement) integers. */ | ||
| 5358 | static inline SIMD_CPPFUNC char4 make_char4(char x, char3 yzw) { | ||
| 5359 | return ::simd_make_char4(x, yzw); | ||
| 5360 | } | ||
| 5361 | |||
| 5362 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 8-bit | ||
| 5363 | * signed (twos-complement) integers. */ | ||
| 5364 | static inline SIMD_CPPFUNC char4 make_char4(char2 xy, char2 zw) { | ||
| 5365 | return ::simd_make_char4(xy, zw); | ||
| 5366 | } | ||
| 5367 | |||
| 5368 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 8-bit | ||
| 5369 | * signed (twos-complement) integers. */ | ||
| 5370 | static inline SIMD_CPPFUNC char4 make_char4(char3 xyz, char w) { | ||
| 5371 | return ::simd_make_char4(xyz, w); | ||
| 5372 | } | ||
| 5373 | |||
| 5374 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 5375 | * 8-bit signed (twos-complement) integers. */ | ||
| 5376 | template <typename typeN> static SIMD_CPPFUNC char4 make_char4(typeN other) { | ||
| 5377 | return ::simd_make_char4(other); | ||
| 5378 | } | ||
| 5379 | |||
| 5380 | /*! @abstract Extends `other` to form a vector of four 8-bit signed (twos- | ||
| 5381 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5382 | * unspecified. */ | ||
| 5383 | template <typename typeN> static SIMD_CPPFUNC char4 make_char4_undef(typeN other) { | ||
| 5384 | return ::simd_make_char4_undef(other); | ||
| 5385 | } | ||
| 5386 | |||
| 5387 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 8-bit | ||
| 5388 | * signed (twos-complement) integers. */ | ||
| 5389 | static inline SIMD_CPPFUNC char8 make_char8(char4 lo, char4 hi) { | ||
| 5390 | return ::simd_make_char8(lo, hi); | ||
| 5391 | } | ||
| 5392 | |||
| 5393 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 5394 | * 8-bit signed (twos-complement) integers. */ | ||
| 5395 | template <typename typeN> static SIMD_CPPFUNC char8 make_char8(typeN other) { | ||
| 5396 | return ::simd_make_char8(other); | ||
| 5397 | } | ||
| 5398 | |||
| 5399 | /*! @abstract Extends `other` to form a vector of eight 8-bit signed (twos- | ||
| 5400 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5401 | * unspecified. */ | ||
| 5402 | template <typename typeN> static SIMD_CPPFUNC char8 make_char8_undef(typeN other) { | ||
| 5403 | return ::simd_make_char8_undef(other); | ||
| 5404 | } | ||
| 5405 | |||
| 5406 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 8-bit | ||
| 5407 | * signed (twos-complement) integers. */ | ||
| 5408 | static inline SIMD_CPPFUNC char16 make_char16(char8 lo, char8 hi) { | ||
| 5409 | return ::simd_make_char16(lo, hi); | ||
| 5410 | } | ||
| 5411 | |||
| 5412 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 5413 | * 8-bit signed (twos-complement) integers. */ | ||
| 5414 | template <typename typeN> static SIMD_CPPFUNC char16 make_char16(typeN other) { | ||
| 5415 | return ::simd_make_char16(other); | ||
| 5416 | } | ||
| 5417 | |||
| 5418 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit signed | ||
| 5419 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 5420 | * lanes are unspecified. */ | ||
| 5421 | template <typename typeN> static SIMD_CPPFUNC char16 make_char16_undef(typeN other) { | ||
| 5422 | return ::simd_make_char16_undef(other); | ||
| 5423 | } | ||
| 5424 | |||
| 5425 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 5426 | * 8-bit signed (twos-complement) integers. */ | ||
| 5427 | static inline SIMD_CPPFUNC char32 make_char32(char16 lo, char16 hi) { | ||
| 5428 | return ::simd_make_char32(lo, hi); | ||
| 5429 | } | ||
| 5430 | |||
| 5431 | /*! @abstract Truncates or zero-extends `other` to form a vector of thirty- | ||
| 5432 | * two 8-bit signed (twos-complement) integers. */ | ||
| 5433 | template <typename typeN> static SIMD_CPPFUNC char32 make_char32(typeN other) { | ||
| 5434 | return ::simd_make_char32(other); | ||
| 5435 | } | ||
| 5436 | |||
| 5437 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit signed | ||
| 5438 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 5439 | * lanes are unspecified. */ | ||
| 5440 | template <typename typeN> static SIMD_CPPFUNC char32 make_char32_undef(typeN other) { | ||
| 5441 | return ::simd_make_char32_undef(other); | ||
| 5442 | } | ||
| 5443 | |||
| 5444 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixty-four | ||
| 5445 | * 8-bit signed (twos-complement) integers. */ | ||
| 5446 | static inline SIMD_CPPFUNC char64 make_char64(char32 lo, char32 hi) { | ||
| 5447 | return ::simd_make_char64(lo, hi); | ||
| 5448 | } | ||
| 5449 | |||
| 5450 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixty- | ||
| 5451 | * four 8-bit signed (twos-complement) integers. */ | ||
| 5452 | template <typename typeN> static SIMD_CPPFUNC char64 make_char64(typeN other) { | ||
| 5453 | return ::simd_make_char64(other); | ||
| 5454 | } | ||
| 5455 | |||
| 5456 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit signed | ||
| 5457 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 5458 | * lanes are unspecified. */ | ||
| 5459 | template <typename typeN> static SIMD_CPPFUNC char64 make_char64_undef(typeN other) { | ||
| 5460 | return ::simd_make_char64_undef(other); | ||
| 5461 | } | ||
| 5462 | |||
| 5463 | /*! @abstract Concatenates `x` and `y` to form a vector of two 8-bit | ||
| 5464 | * unsigned integers. */ | ||
| 5465 | static inline SIMD_CPPFUNC uchar2 make_uchar2(unsigned char x, unsigned char y) { | ||
| 5466 | return ::simd_make_uchar2(x, y); | ||
| 5467 | } | ||
| 5468 | |||
| 5469 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 5470 | * 8-bit unsigned integers. */ | ||
| 5471 | template <typename typeN> static SIMD_CPPFUNC uchar2 make_uchar2(typeN other) { | ||
| 5472 | return ::simd_make_uchar2(other); | ||
| 5473 | } | ||
| 5474 | |||
| 5475 | /*! @abstract Extends `other` to form a vector of two 8-bit unsigned | ||
| 5476 | * integers. The contents of the newly-created vector lanes are | ||
| 5477 | * unspecified. */ | ||
| 5478 | template <typename typeN> static SIMD_CPPFUNC uchar2 make_uchar2_undef(typeN other) { | ||
| 5479 | return ::simd_make_uchar2_undef(other); | ||
| 5480 | } | ||
| 5481 | |||
| 5482 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 8-bit | ||
| 5483 | * unsigned integers. */ | ||
| 5484 | static inline SIMD_CPPFUNC uchar3 make_uchar3(unsigned char x, unsigned char y, unsigned char z) { | ||
| 5485 | return ::simd_make_uchar3(x, y, z); | ||
| 5486 | } | ||
| 5487 | |||
| 5488 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 8-bit | ||
| 5489 | * unsigned integers. */ | ||
| 5490 | static inline SIMD_CPPFUNC uchar3 make_uchar3(unsigned char x, uchar2 yz) { | ||
| 5491 | return ::simd_make_uchar3(x, yz); | ||
| 5492 | } | ||
| 5493 | |||
| 5494 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 8-bit | ||
| 5495 | * unsigned integers. */ | ||
| 5496 | static inline SIMD_CPPFUNC uchar3 make_uchar3(uchar2 xy, unsigned char z) { | ||
| 5497 | return ::simd_make_uchar3(xy, z); | ||
| 5498 | } | ||
| 5499 | |||
| 5500 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 5501 | * 8-bit unsigned integers. */ | ||
| 5502 | template <typename typeN> static SIMD_CPPFUNC uchar3 make_uchar3(typeN other) { | ||
| 5503 | return ::simd_make_uchar3(other); | ||
| 5504 | } | ||
| 5505 | |||
| 5506 | /*! @abstract Extends `other` to form a vector of three 8-bit unsigned | ||
| 5507 | * integers. The contents of the newly-created vector lanes are | ||
| 5508 | * unspecified. */ | ||
| 5509 | template <typename typeN> static SIMD_CPPFUNC uchar3 make_uchar3_undef(typeN other) { | ||
| 5510 | return ::simd_make_uchar3_undef(other); | ||
| 5511 | } | ||
| 5512 | |||
| 5513 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 5514 | * 8-bit unsigned integers. */ | ||
| 5515 | static inline SIMD_CPPFUNC uchar4 make_uchar4(unsigned char x, unsigned char y, unsigned char z, unsigned char w) { | ||
| 5516 | return ::simd_make_uchar4(x, y, z, w); | ||
| 5517 | } | ||
| 5518 | |||
| 5519 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 8-bit | ||
| 5520 | * unsigned integers. */ | ||
| 5521 | static inline SIMD_CPPFUNC uchar4 make_uchar4(unsigned char x, unsigned char y, uchar2 zw) { | ||
| 5522 | return ::simd_make_uchar4(x, y, zw); | ||
| 5523 | } | ||
| 5524 | |||
| 5525 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 8-bit | ||
| 5526 | * unsigned integers. */ | ||
| 5527 | static inline SIMD_CPPFUNC uchar4 make_uchar4(unsigned char x, uchar2 yz, unsigned char w) { | ||
| 5528 | return ::simd_make_uchar4(x, yz, w); | ||
| 5529 | } | ||
| 5530 | |||
| 5531 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 8-bit | ||
| 5532 | * unsigned integers. */ | ||
| 5533 | static inline SIMD_CPPFUNC uchar4 make_uchar4(uchar2 xy, unsigned char z, unsigned char w) { | ||
| 5534 | return ::simd_make_uchar4(xy, z, w); | ||
| 5535 | } | ||
| 5536 | |||
| 5537 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 8-bit | ||
| 5538 | * unsigned integers. */ | ||
| 5539 | static inline SIMD_CPPFUNC uchar4 make_uchar4(unsigned char x, uchar3 yzw) { | ||
| 5540 | return ::simd_make_uchar4(x, yzw); | ||
| 5541 | } | ||
| 5542 | |||
| 5543 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 8-bit | ||
| 5544 | * unsigned integers. */ | ||
| 5545 | static inline SIMD_CPPFUNC uchar4 make_uchar4(uchar2 xy, uchar2 zw) { | ||
| 5546 | return ::simd_make_uchar4(xy, zw); | ||
| 5547 | } | ||
| 5548 | |||
| 5549 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 8-bit | ||
| 5550 | * unsigned integers. */ | ||
| 5551 | static inline SIMD_CPPFUNC uchar4 make_uchar4(uchar3 xyz, unsigned char w) { | ||
| 5552 | return ::simd_make_uchar4(xyz, w); | ||
| 5553 | } | ||
| 5554 | |||
| 5555 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 5556 | * 8-bit unsigned integers. */ | ||
| 5557 | template <typename typeN> static SIMD_CPPFUNC uchar4 make_uchar4(typeN other) { | ||
| 5558 | return ::simd_make_uchar4(other); | ||
| 5559 | } | ||
| 5560 | |||
| 5561 | /*! @abstract Extends `other` to form a vector of four 8-bit unsigned | ||
| 5562 | * integers. The contents of the newly-created vector lanes are | ||
| 5563 | * unspecified. */ | ||
| 5564 | template <typename typeN> static SIMD_CPPFUNC uchar4 make_uchar4_undef(typeN other) { | ||
| 5565 | return ::simd_make_uchar4_undef(other); | ||
| 5566 | } | ||
| 5567 | |||
| 5568 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 8-bit | ||
| 5569 | * unsigned integers. */ | ||
| 5570 | static inline SIMD_CPPFUNC uchar8 make_uchar8(uchar4 lo, uchar4 hi) { | ||
| 5571 | return ::simd_make_uchar8(lo, hi); | ||
| 5572 | } | ||
| 5573 | |||
| 5574 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 5575 | * 8-bit unsigned integers. */ | ||
| 5576 | template <typename typeN> static SIMD_CPPFUNC uchar8 make_uchar8(typeN other) { | ||
| 5577 | return ::simd_make_uchar8(other); | ||
| 5578 | } | ||
| 5579 | |||
| 5580 | /*! @abstract Extends `other` to form a vector of eight 8-bit unsigned | ||
| 5581 | * integers. The contents of the newly-created vector lanes are | ||
| 5582 | * unspecified. */ | ||
| 5583 | template <typename typeN> static SIMD_CPPFUNC uchar8 make_uchar8_undef(typeN other) { | ||
| 5584 | return ::simd_make_uchar8_undef(other); | ||
| 5585 | } | ||
| 5586 | |||
| 5587 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 8-bit | ||
| 5588 | * unsigned integers. */ | ||
| 5589 | static inline SIMD_CPPFUNC uchar16 make_uchar16(uchar8 lo, uchar8 hi) { | ||
| 5590 | return ::simd_make_uchar16(lo, hi); | ||
| 5591 | } | ||
| 5592 | |||
| 5593 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 5594 | * 8-bit unsigned integers. */ | ||
| 5595 | template <typename typeN> static SIMD_CPPFUNC uchar16 make_uchar16(typeN other) { | ||
| 5596 | return ::simd_make_uchar16(other); | ||
| 5597 | } | ||
| 5598 | |||
| 5599 | /*! @abstract Extends `other` to form a vector of sixteen 8-bit unsigned | ||
| 5600 | * integers. The contents of the newly-created vector lanes are | ||
| 5601 | * unspecified. */ | ||
| 5602 | template <typename typeN> static SIMD_CPPFUNC uchar16 make_uchar16_undef(typeN other) { | ||
| 5603 | return ::simd_make_uchar16_undef(other); | ||
| 5604 | } | ||
| 5605 | |||
| 5606 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 5607 | * 8-bit unsigned integers. */ | ||
| 5608 | static inline SIMD_CPPFUNC uchar32 make_uchar32(uchar16 lo, uchar16 hi) { | ||
| 5609 | return ::simd_make_uchar32(lo, hi); | ||
| 5610 | } | ||
| 5611 | |||
| 5612 | /*! @abstract Truncates or zero-extends `other` to form a vector of thirty- | ||
| 5613 | * two 8-bit unsigned integers. */ | ||
| 5614 | template <typename typeN> static SIMD_CPPFUNC uchar32 make_uchar32(typeN other) { | ||
| 5615 | return ::simd_make_uchar32(other); | ||
| 5616 | } | ||
| 5617 | |||
| 5618 | /*! @abstract Extends `other` to form a vector of thirty-two 8-bit unsigned | ||
| 5619 | * integers. The contents of the newly-created vector lanes are | ||
| 5620 | * unspecified. */ | ||
| 5621 | template <typename typeN> static SIMD_CPPFUNC uchar32 make_uchar32_undef(typeN other) { | ||
| 5622 | return ::simd_make_uchar32_undef(other); | ||
| 5623 | } | ||
| 5624 | |||
| 5625 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixty-four | ||
| 5626 | * 8-bit unsigned integers. */ | ||
| 5627 | static inline SIMD_CPPFUNC uchar64 make_uchar64(uchar32 lo, uchar32 hi) { | ||
| 5628 | return ::simd_make_uchar64(lo, hi); | ||
| 5629 | } | ||
| 5630 | |||
| 5631 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixty- | ||
| 5632 | * four 8-bit unsigned integers. */ | ||
| 5633 | template <typename typeN> static SIMD_CPPFUNC uchar64 make_uchar64(typeN other) { | ||
| 5634 | return ::simd_make_uchar64(other); | ||
| 5635 | } | ||
| 5636 | |||
| 5637 | /*! @abstract Extends `other` to form a vector of sixty-four 8-bit unsigned | ||
| 5638 | * integers. The contents of the newly-created vector lanes are | ||
| 5639 | * unspecified. */ | ||
| 5640 | template <typename typeN> static SIMD_CPPFUNC uchar64 make_uchar64_undef(typeN other) { | ||
| 5641 | return ::simd_make_uchar64_undef(other); | ||
| 5642 | } | ||
| 5643 | |||
| 5644 | /*! @abstract Concatenates `x` and `y` to form a vector of two 16-bit signed | ||
| 5645 | * (twos-complement) integers. */ | ||
| 5646 | static inline SIMD_CPPFUNC short2 make_short2(short x, short y) { | ||
| 5647 | return ::simd_make_short2(x, y); | ||
| 5648 | } | ||
| 5649 | |||
| 5650 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 5651 | * 16-bit signed (twos-complement) integers. */ | ||
| 5652 | template <typename typeN> static SIMD_CPPFUNC short2 make_short2(typeN other) { | ||
| 5653 | return ::simd_make_short2(other); | ||
| 5654 | } | ||
| 5655 | |||
| 5656 | /*! @abstract Extends `other` to form a vector of two 16-bit signed (twos- | ||
| 5657 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5658 | * unspecified. */ | ||
| 5659 | template <typename typeN> static SIMD_CPPFUNC short2 make_short2_undef(typeN other) { | ||
| 5660 | return ::simd_make_short2_undef(other); | ||
| 5661 | } | ||
| 5662 | |||
| 5663 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 16-bit | ||
| 5664 | * signed (twos-complement) integers. */ | ||
| 5665 | static inline SIMD_CPPFUNC short3 make_short3(short x, short y, short z) { | ||
| 5666 | return ::simd_make_short3(x, y, z); | ||
| 5667 | } | ||
| 5668 | |||
| 5669 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 16-bit | ||
| 5670 | * signed (twos-complement) integers. */ | ||
| 5671 | static inline SIMD_CPPFUNC short3 make_short3(short x, short2 yz) { | ||
| 5672 | return ::simd_make_short3(x, yz); | ||
| 5673 | } | ||
| 5674 | |||
| 5675 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 16-bit | ||
| 5676 | * signed (twos-complement) integers. */ | ||
| 5677 | static inline SIMD_CPPFUNC short3 make_short3(short2 xy, short z) { | ||
| 5678 | return ::simd_make_short3(xy, z); | ||
| 5679 | } | ||
| 5680 | |||
| 5681 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 5682 | * 16-bit signed (twos-complement) integers. */ | ||
| 5683 | template <typename typeN> static SIMD_CPPFUNC short3 make_short3(typeN other) { | ||
| 5684 | return ::simd_make_short3(other); | ||
| 5685 | } | ||
| 5686 | |||
| 5687 | /*! @abstract Extends `other` to form a vector of three 16-bit signed (twos- | ||
| 5688 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5689 | * unspecified. */ | ||
| 5690 | template <typename typeN> static SIMD_CPPFUNC short3 make_short3_undef(typeN other) { | ||
| 5691 | return ::simd_make_short3_undef(other); | ||
| 5692 | } | ||
| 5693 | |||
| 5694 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 5695 | * 16-bit signed (twos-complement) integers. */ | ||
| 5696 | static inline SIMD_CPPFUNC short4 make_short4(short x, short y, short z, short w) { | ||
| 5697 | return ::simd_make_short4(x, y, z, w); | ||
| 5698 | } | ||
| 5699 | |||
| 5700 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 16-bit | ||
| 5701 | * signed (twos-complement) integers. */ | ||
| 5702 | static inline SIMD_CPPFUNC short4 make_short4(short x, short y, short2 zw) { | ||
| 5703 | return ::simd_make_short4(x, y, zw); | ||
| 5704 | } | ||
| 5705 | |||
| 5706 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 16-bit | ||
| 5707 | * signed (twos-complement) integers. */ | ||
| 5708 | static inline SIMD_CPPFUNC short4 make_short4(short x, short2 yz, short w) { | ||
| 5709 | return ::simd_make_short4(x, yz, w); | ||
| 5710 | } | ||
| 5711 | |||
| 5712 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 16-bit | ||
| 5713 | * signed (twos-complement) integers. */ | ||
| 5714 | static inline SIMD_CPPFUNC short4 make_short4(short2 xy, short z, short w) { | ||
| 5715 | return ::simd_make_short4(xy, z, w); | ||
| 5716 | } | ||
| 5717 | |||
| 5718 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 16-bit | ||
| 5719 | * signed (twos-complement) integers. */ | ||
| 5720 | static inline SIMD_CPPFUNC short4 make_short4(short x, short3 yzw) { | ||
| 5721 | return ::simd_make_short4(x, yzw); | ||
| 5722 | } | ||
| 5723 | |||
| 5724 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 16-bit | ||
| 5725 | * signed (twos-complement) integers. */ | ||
| 5726 | static inline SIMD_CPPFUNC short4 make_short4(short2 xy, short2 zw) { | ||
| 5727 | return ::simd_make_short4(xy, zw); | ||
| 5728 | } | ||
| 5729 | |||
| 5730 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 16-bit | ||
| 5731 | * signed (twos-complement) integers. */ | ||
| 5732 | static inline SIMD_CPPFUNC short4 make_short4(short3 xyz, short w) { | ||
| 5733 | return ::simd_make_short4(xyz, w); | ||
| 5734 | } | ||
| 5735 | |||
| 5736 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 5737 | * 16-bit signed (twos-complement) integers. */ | ||
| 5738 | template <typename typeN> static SIMD_CPPFUNC short4 make_short4(typeN other) { | ||
| 5739 | return ::simd_make_short4(other); | ||
| 5740 | } | ||
| 5741 | |||
| 5742 | /*! @abstract Extends `other` to form a vector of four 16-bit signed (twos- | ||
| 5743 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5744 | * unspecified. */ | ||
| 5745 | template <typename typeN> static SIMD_CPPFUNC short4 make_short4_undef(typeN other) { | ||
| 5746 | return ::simd_make_short4_undef(other); | ||
| 5747 | } | ||
| 5748 | |||
| 5749 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 16-bit | ||
| 5750 | * signed (twos-complement) integers. */ | ||
| 5751 | static inline SIMD_CPPFUNC short8 make_short8(short4 lo, short4 hi) { | ||
| 5752 | return ::simd_make_short8(lo, hi); | ||
| 5753 | } | ||
| 5754 | |||
| 5755 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 5756 | * 16-bit signed (twos-complement) integers. */ | ||
| 5757 | template <typename typeN> static SIMD_CPPFUNC short8 make_short8(typeN other) { | ||
| 5758 | return ::simd_make_short8(other); | ||
| 5759 | } | ||
| 5760 | |||
| 5761 | /*! @abstract Extends `other` to form a vector of eight 16-bit signed (twos- | ||
| 5762 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5763 | * unspecified. */ | ||
| 5764 | template <typename typeN> static SIMD_CPPFUNC short8 make_short8_undef(typeN other) { | ||
| 5765 | return ::simd_make_short8_undef(other); | ||
| 5766 | } | ||
| 5767 | |||
| 5768 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 16-bit | ||
| 5769 | * signed (twos-complement) integers. */ | ||
| 5770 | static inline SIMD_CPPFUNC short16 make_short16(short8 lo, short8 hi) { | ||
| 5771 | return ::simd_make_short16(lo, hi); | ||
| 5772 | } | ||
| 5773 | |||
| 5774 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 5775 | * 16-bit signed (twos-complement) integers. */ | ||
| 5776 | template <typename typeN> static SIMD_CPPFUNC short16 make_short16(typeN other) { | ||
| 5777 | return ::simd_make_short16(other); | ||
| 5778 | } | ||
| 5779 | |||
| 5780 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit signed | ||
| 5781 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 5782 | * lanes are unspecified. */ | ||
| 5783 | template <typename typeN> static SIMD_CPPFUNC short16 make_short16_undef(typeN other) { | ||
| 5784 | return ::simd_make_short16_undef(other); | ||
| 5785 | } | ||
| 5786 | |||
| 5787 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 5788 | * 16-bit signed (twos-complement) integers. */ | ||
| 5789 | static inline SIMD_CPPFUNC short32 make_short32(short16 lo, short16 hi) { | ||
| 5790 | return ::simd_make_short32(lo, hi); | ||
| 5791 | } | ||
| 5792 | |||
| 5793 | /*! @abstract Truncates or zero-extends `other` to form a vector of thirty- | ||
| 5794 | * two 16-bit signed (twos-complement) integers. */ | ||
| 5795 | template <typename typeN> static SIMD_CPPFUNC short32 make_short32(typeN other) { | ||
| 5796 | return ::simd_make_short32(other); | ||
| 5797 | } | ||
| 5798 | |||
| 5799 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit signed | ||
| 5800 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 5801 | * lanes are unspecified. */ | ||
| 5802 | template <typename typeN> static SIMD_CPPFUNC short32 make_short32_undef(typeN other) { | ||
| 5803 | return ::simd_make_short32_undef(other); | ||
| 5804 | } | ||
| 5805 | |||
| 5806 | /*! @abstract Concatenates `x` and `y` to form a vector of two 16-bit | ||
| 5807 | * unsigned integers. */ | ||
| 5808 | static inline SIMD_CPPFUNC ushort2 make_ushort2(unsigned short x, unsigned short y) { | ||
| 5809 | return ::simd_make_ushort2(x, y); | ||
| 5810 | } | ||
| 5811 | |||
| 5812 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 5813 | * 16-bit unsigned integers. */ | ||
| 5814 | template <typename typeN> static SIMD_CPPFUNC ushort2 make_ushort2(typeN other) { | ||
| 5815 | return ::simd_make_ushort2(other); | ||
| 5816 | } | ||
| 5817 | |||
| 5818 | /*! @abstract Extends `other` to form a vector of two 16-bit unsigned | ||
| 5819 | * integers. The contents of the newly-created vector lanes are | ||
| 5820 | * unspecified. */ | ||
| 5821 | template <typename typeN> static SIMD_CPPFUNC ushort2 make_ushort2_undef(typeN other) { | ||
| 5822 | return ::simd_make_ushort2_undef(other); | ||
| 5823 | } | ||
| 5824 | |||
| 5825 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 16-bit | ||
| 5826 | * unsigned integers. */ | ||
| 5827 | static inline SIMD_CPPFUNC ushort3 make_ushort3(unsigned short x, unsigned short y, unsigned short z) { | ||
| 5828 | return ::simd_make_ushort3(x, y, z); | ||
| 5829 | } | ||
| 5830 | |||
| 5831 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 16-bit | ||
| 5832 | * unsigned integers. */ | ||
| 5833 | static inline SIMD_CPPFUNC ushort3 make_ushort3(unsigned short x, ushort2 yz) { | ||
| 5834 | return ::simd_make_ushort3(x, yz); | ||
| 5835 | } | ||
| 5836 | |||
| 5837 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 16-bit | ||
| 5838 | * unsigned integers. */ | ||
| 5839 | static inline SIMD_CPPFUNC ushort3 make_ushort3(ushort2 xy, unsigned short z) { | ||
| 5840 | return ::simd_make_ushort3(xy, z); | ||
| 5841 | } | ||
| 5842 | |||
| 5843 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 5844 | * 16-bit unsigned integers. */ | ||
| 5845 | template <typename typeN> static SIMD_CPPFUNC ushort3 make_ushort3(typeN other) { | ||
| 5846 | return ::simd_make_ushort3(other); | ||
| 5847 | } | ||
| 5848 | |||
| 5849 | /*! @abstract Extends `other` to form a vector of three 16-bit unsigned | ||
| 5850 | * integers. The contents of the newly-created vector lanes are | ||
| 5851 | * unspecified. */ | ||
| 5852 | template <typename typeN> static SIMD_CPPFUNC ushort3 make_ushort3_undef(typeN other) { | ||
| 5853 | return ::simd_make_ushort3_undef(other); | ||
| 5854 | } | ||
| 5855 | |||
| 5856 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 5857 | * 16-bit unsigned integers. */ | ||
| 5858 | static inline SIMD_CPPFUNC ushort4 make_ushort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w) { | ||
| 5859 | return ::simd_make_ushort4(x, y, z, w); | ||
| 5860 | } | ||
| 5861 | |||
| 5862 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 16-bit | ||
| 5863 | * unsigned integers. */ | ||
| 5864 | static inline SIMD_CPPFUNC ushort4 make_ushort4(unsigned short x, unsigned short y, ushort2 zw) { | ||
| 5865 | return ::simd_make_ushort4(x, y, zw); | ||
| 5866 | } | ||
| 5867 | |||
| 5868 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 16-bit | ||
| 5869 | * unsigned integers. */ | ||
| 5870 | static inline SIMD_CPPFUNC ushort4 make_ushort4(unsigned short x, ushort2 yz, unsigned short w) { | ||
| 5871 | return ::simd_make_ushort4(x, yz, w); | ||
| 5872 | } | ||
| 5873 | |||
| 5874 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 16-bit | ||
| 5875 | * unsigned integers. */ | ||
| 5876 | static inline SIMD_CPPFUNC ushort4 make_ushort4(ushort2 xy, unsigned short z, unsigned short w) { | ||
| 5877 | return ::simd_make_ushort4(xy, z, w); | ||
| 5878 | } | ||
| 5879 | |||
| 5880 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 16-bit | ||
| 5881 | * unsigned integers. */ | ||
| 5882 | static inline SIMD_CPPFUNC ushort4 make_ushort4(unsigned short x, ushort3 yzw) { | ||
| 5883 | return ::simd_make_ushort4(x, yzw); | ||
| 5884 | } | ||
| 5885 | |||
| 5886 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 16-bit | ||
| 5887 | * unsigned integers. */ | ||
| 5888 | static inline SIMD_CPPFUNC ushort4 make_ushort4(ushort2 xy, ushort2 zw) { | ||
| 5889 | return ::simd_make_ushort4(xy, zw); | ||
| 5890 | } | ||
| 5891 | |||
| 5892 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 16-bit | ||
| 5893 | * unsigned integers. */ | ||
| 5894 | static inline SIMD_CPPFUNC ushort4 make_ushort4(ushort3 xyz, unsigned short w) { | ||
| 5895 | return ::simd_make_ushort4(xyz, w); | ||
| 5896 | } | ||
| 5897 | |||
| 5898 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 5899 | * 16-bit unsigned integers. */ | ||
| 5900 | template <typename typeN> static SIMD_CPPFUNC ushort4 make_ushort4(typeN other) { | ||
| 5901 | return ::simd_make_ushort4(other); | ||
| 5902 | } | ||
| 5903 | |||
| 5904 | /*! @abstract Extends `other` to form a vector of four 16-bit unsigned | ||
| 5905 | * integers. The contents of the newly-created vector lanes are | ||
| 5906 | * unspecified. */ | ||
| 5907 | template <typename typeN> static SIMD_CPPFUNC ushort4 make_ushort4_undef(typeN other) { | ||
| 5908 | return ::simd_make_ushort4_undef(other); | ||
| 5909 | } | ||
| 5910 | |||
| 5911 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 16-bit | ||
| 5912 | * unsigned integers. */ | ||
| 5913 | static inline SIMD_CPPFUNC ushort8 make_ushort8(ushort4 lo, ushort4 hi) { | ||
| 5914 | return ::simd_make_ushort8(lo, hi); | ||
| 5915 | } | ||
| 5916 | |||
| 5917 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 5918 | * 16-bit unsigned integers. */ | ||
| 5919 | template <typename typeN> static SIMD_CPPFUNC ushort8 make_ushort8(typeN other) { | ||
| 5920 | return ::simd_make_ushort8(other); | ||
| 5921 | } | ||
| 5922 | |||
| 5923 | /*! @abstract Extends `other` to form a vector of eight 16-bit unsigned | ||
| 5924 | * integers. The contents of the newly-created vector lanes are | ||
| 5925 | * unspecified. */ | ||
| 5926 | template <typename typeN> static SIMD_CPPFUNC ushort8 make_ushort8_undef(typeN other) { | ||
| 5927 | return ::simd_make_ushort8_undef(other); | ||
| 5928 | } | ||
| 5929 | |||
| 5930 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 16-bit | ||
| 5931 | * unsigned integers. */ | ||
| 5932 | static inline SIMD_CPPFUNC ushort16 make_ushort16(ushort8 lo, ushort8 hi) { | ||
| 5933 | return ::simd_make_ushort16(lo, hi); | ||
| 5934 | } | ||
| 5935 | |||
| 5936 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 5937 | * 16-bit unsigned integers. */ | ||
| 5938 | template <typename typeN> static SIMD_CPPFUNC ushort16 make_ushort16(typeN other) { | ||
| 5939 | return ::simd_make_ushort16(other); | ||
| 5940 | } | ||
| 5941 | |||
| 5942 | /*! @abstract Extends `other` to form a vector of sixteen 16-bit unsigned | ||
| 5943 | * integers. The contents of the newly-created vector lanes are | ||
| 5944 | * unspecified. */ | ||
| 5945 | template <typename typeN> static SIMD_CPPFUNC ushort16 make_ushort16_undef(typeN other) { | ||
| 5946 | return ::simd_make_ushort16_undef(other); | ||
| 5947 | } | ||
| 5948 | |||
| 5949 | /*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two | ||
| 5950 | * 16-bit unsigned integers. */ | ||
| 5951 | static inline SIMD_CPPFUNC ushort32 make_ushort32(ushort16 lo, ushort16 hi) { | ||
| 5952 | return ::simd_make_ushort32(lo, hi); | ||
| 5953 | } | ||
| 5954 | |||
| 5955 | /*! @abstract Truncates or zero-extends `other` to form a vector of thirty- | ||
| 5956 | * two 16-bit unsigned integers. */ | ||
| 5957 | template <typename typeN> static SIMD_CPPFUNC ushort32 make_ushort32(typeN other) { | ||
| 5958 | return ::simd_make_ushort32(other); | ||
| 5959 | } | ||
| 5960 | |||
| 5961 | /*! @abstract Extends `other` to form a vector of thirty-two 16-bit unsigned | ||
| 5962 | * integers. The contents of the newly-created vector lanes are | ||
| 5963 | * unspecified. */ | ||
| 5964 | template <typename typeN> static SIMD_CPPFUNC ushort32 make_ushort32_undef(typeN other) { | ||
| 5965 | return ::simd_make_ushort32_undef(other); | ||
| 5966 | } | ||
| 5967 | |||
| 5968 | /*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed | ||
| 5969 | * (twos-complement) integers. */ | ||
| 5970 | static inline SIMD_CPPFUNC int2 make_int2(int x, int y) { | ||
| 5971 | return ::simd_make_int2(x, y); | ||
| 5972 | } | ||
| 5973 | |||
| 5974 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 5975 | * 32-bit signed (twos-complement) integers. */ | ||
| 5976 | template <typename typeN> static SIMD_CPPFUNC int2 make_int2(typeN other) { | ||
| 5977 | return ::simd_make_int2(other); | ||
| 5978 | } | ||
| 5979 | |||
| 5980 | /*! @abstract Extends `other` to form a vector of two 32-bit signed (twos- | ||
| 5981 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 5982 | * unspecified. */ | ||
| 5983 | template <typename typeN> static SIMD_CPPFUNC int2 make_int2_undef(typeN other) { | ||
| 5984 | return ::simd_make_int2_undef(other); | ||
| 5985 | } | ||
| 5986 | |||
| 5987 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 32-bit | ||
| 5988 | * signed (twos-complement) integers. */ | ||
| 5989 | static inline SIMD_CPPFUNC int3 make_int3(int x, int y, int z) { | ||
| 5990 | return ::simd_make_int3(x, y, z); | ||
| 5991 | } | ||
| 5992 | |||
| 5993 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 32-bit | ||
| 5994 | * signed (twos-complement) integers. */ | ||
| 5995 | static inline SIMD_CPPFUNC int3 make_int3(int x, int2 yz) { | ||
| 5996 | return ::simd_make_int3(x, yz); | ||
| 5997 | } | ||
| 5998 | |||
| 5999 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 32-bit | ||
| 6000 | * signed (twos-complement) integers. */ | ||
| 6001 | static inline SIMD_CPPFUNC int3 make_int3(int2 xy, int z) { | ||
| 6002 | return ::simd_make_int3(xy, z); | ||
| 6003 | } | ||
| 6004 | |||
| 6005 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 6006 | * 32-bit signed (twos-complement) integers. */ | ||
| 6007 | template <typename typeN> static SIMD_CPPFUNC int3 make_int3(typeN other) { | ||
| 6008 | return ::simd_make_int3(other); | ||
| 6009 | } | ||
| 6010 | |||
| 6011 | /*! @abstract Extends `other` to form a vector of three 32-bit signed (twos- | ||
| 6012 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6013 | * unspecified. */ | ||
| 6014 | template <typename typeN> static SIMD_CPPFUNC int3 make_int3_undef(typeN other) { | ||
| 6015 | return ::simd_make_int3_undef(other); | ||
| 6016 | } | ||
| 6017 | |||
| 6018 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 6019 | * 32-bit signed (twos-complement) integers. */ | ||
| 6020 | static inline SIMD_CPPFUNC int4 make_int4(int x, int y, int z, int w) { | ||
| 6021 | return ::simd_make_int4(x, y, z, w); | ||
| 6022 | } | ||
| 6023 | |||
| 6024 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 32-bit | ||
| 6025 | * signed (twos-complement) integers. */ | ||
| 6026 | static inline SIMD_CPPFUNC int4 make_int4(int x, int y, int2 zw) { | ||
| 6027 | return ::simd_make_int4(x, y, zw); | ||
| 6028 | } | ||
| 6029 | |||
| 6030 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 32-bit | ||
| 6031 | * signed (twos-complement) integers. */ | ||
| 6032 | static inline SIMD_CPPFUNC int4 make_int4(int x, int2 yz, int w) { | ||
| 6033 | return ::simd_make_int4(x, yz, w); | ||
| 6034 | } | ||
| 6035 | |||
| 6036 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 32-bit | ||
| 6037 | * signed (twos-complement) integers. */ | ||
| 6038 | static inline SIMD_CPPFUNC int4 make_int4(int2 xy, int z, int w) { | ||
| 6039 | return ::simd_make_int4(xy, z, w); | ||
| 6040 | } | ||
| 6041 | |||
| 6042 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 32-bit | ||
| 6043 | * signed (twos-complement) integers. */ | ||
| 6044 | static inline SIMD_CPPFUNC int4 make_int4(int x, int3 yzw) { | ||
| 6045 | return ::simd_make_int4(x, yzw); | ||
| 6046 | } | ||
| 6047 | |||
| 6048 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 32-bit | ||
| 6049 | * signed (twos-complement) integers. */ | ||
| 6050 | static inline SIMD_CPPFUNC int4 make_int4(int2 xy, int2 zw) { | ||
| 6051 | return ::simd_make_int4(xy, zw); | ||
| 6052 | } | ||
| 6053 | |||
| 6054 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 32-bit | ||
| 6055 | * signed (twos-complement) integers. */ | ||
| 6056 | static inline SIMD_CPPFUNC int4 make_int4(int3 xyz, int w) { | ||
| 6057 | return ::simd_make_int4(xyz, w); | ||
| 6058 | } | ||
| 6059 | |||
| 6060 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 6061 | * 32-bit signed (twos-complement) integers. */ | ||
| 6062 | template <typename typeN> static SIMD_CPPFUNC int4 make_int4(typeN other) { | ||
| 6063 | return ::simd_make_int4(other); | ||
| 6064 | } | ||
| 6065 | |||
| 6066 | /*! @abstract Extends `other` to form a vector of four 32-bit signed (twos- | ||
| 6067 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6068 | * unspecified. */ | ||
| 6069 | template <typename typeN> static SIMD_CPPFUNC int4 make_int4_undef(typeN other) { | ||
| 6070 | return ::simd_make_int4_undef(other); | ||
| 6071 | } | ||
| 6072 | |||
| 6073 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 32-bit | ||
| 6074 | * signed (twos-complement) integers. */ | ||
| 6075 | static inline SIMD_CPPFUNC int8 make_int8(int4 lo, int4 hi) { | ||
| 6076 | return ::simd_make_int8(lo, hi); | ||
| 6077 | } | ||
| 6078 | |||
| 6079 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 6080 | * 32-bit signed (twos-complement) integers. */ | ||
| 6081 | template <typename typeN> static SIMD_CPPFUNC int8 make_int8(typeN other) { | ||
| 6082 | return ::simd_make_int8(other); | ||
| 6083 | } | ||
| 6084 | |||
| 6085 | /*! @abstract Extends `other` to form a vector of eight 32-bit signed (twos- | ||
| 6086 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6087 | * unspecified. */ | ||
| 6088 | template <typename typeN> static SIMD_CPPFUNC int8 make_int8_undef(typeN other) { | ||
| 6089 | return ::simd_make_int8_undef(other); | ||
| 6090 | } | ||
| 6091 | |||
| 6092 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 32-bit | ||
| 6093 | * signed (twos-complement) integers. */ | ||
| 6094 | static inline SIMD_CPPFUNC int16 make_int16(int8 lo, int8 hi) { | ||
| 6095 | return ::simd_make_int16(lo, hi); | ||
| 6096 | } | ||
| 6097 | |||
| 6098 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 6099 | * 32-bit signed (twos-complement) integers. */ | ||
| 6100 | template <typename typeN> static SIMD_CPPFUNC int16 make_int16(typeN other) { | ||
| 6101 | return ::simd_make_int16(other); | ||
| 6102 | } | ||
| 6103 | |||
| 6104 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit signed | ||
| 6105 | * (twos-complement) integers. The contents of the newly-created vector | ||
| 6106 | * lanes are unspecified. */ | ||
| 6107 | template <typename typeN> static SIMD_CPPFUNC int16 make_int16_undef(typeN other) { | ||
| 6108 | return ::simd_make_int16_undef(other); | ||
| 6109 | } | ||
| 6110 | |||
| 6111 | /*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit | ||
| 6112 | * unsigned integers. */ | ||
| 6113 | static inline SIMD_CPPFUNC uint2 make_uint2(unsigned int x, unsigned int y) { | ||
| 6114 | return ::simd_make_uint2(x, y); | ||
| 6115 | } | ||
| 6116 | |||
| 6117 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 6118 | * 32-bit unsigned integers. */ | ||
| 6119 | template <typename typeN> static SIMD_CPPFUNC uint2 make_uint2(typeN other) { | ||
| 6120 | return ::simd_make_uint2(other); | ||
| 6121 | } | ||
| 6122 | |||
| 6123 | /*! @abstract Extends `other` to form a vector of two 32-bit unsigned | ||
| 6124 | * integers. The contents of the newly-created vector lanes are | ||
| 6125 | * unspecified. */ | ||
| 6126 | template <typename typeN> static SIMD_CPPFUNC uint2 make_uint2_undef(typeN other) { | ||
| 6127 | return ::simd_make_uint2_undef(other); | ||
| 6128 | } | ||
| 6129 | |||
| 6130 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 32-bit | ||
| 6131 | * unsigned integers. */ | ||
| 6132 | static inline SIMD_CPPFUNC uint3 make_uint3(unsigned int x, unsigned int y, unsigned int z) { | ||
| 6133 | return ::simd_make_uint3(x, y, z); | ||
| 6134 | } | ||
| 6135 | |||
| 6136 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 32-bit | ||
| 6137 | * unsigned integers. */ | ||
| 6138 | static inline SIMD_CPPFUNC uint3 make_uint3(unsigned int x, uint2 yz) { | ||
| 6139 | return ::simd_make_uint3(x, yz); | ||
| 6140 | } | ||
| 6141 | |||
| 6142 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 32-bit | ||
| 6143 | * unsigned integers. */ | ||
| 6144 | static inline SIMD_CPPFUNC uint3 make_uint3(uint2 xy, unsigned int z) { | ||
| 6145 | return ::simd_make_uint3(xy, z); | ||
| 6146 | } | ||
| 6147 | |||
| 6148 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 6149 | * 32-bit unsigned integers. */ | ||
| 6150 | template <typename typeN> static SIMD_CPPFUNC uint3 make_uint3(typeN other) { | ||
| 6151 | return ::simd_make_uint3(other); | ||
| 6152 | } | ||
| 6153 | |||
| 6154 | /*! @abstract Extends `other` to form a vector of three 32-bit unsigned | ||
| 6155 | * integers. The contents of the newly-created vector lanes are | ||
| 6156 | * unspecified. */ | ||
| 6157 | template <typename typeN> static SIMD_CPPFUNC uint3 make_uint3_undef(typeN other) { | ||
| 6158 | return ::simd_make_uint3_undef(other); | ||
| 6159 | } | ||
| 6160 | |||
| 6161 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 6162 | * 32-bit unsigned integers. */ | ||
| 6163 | static inline SIMD_CPPFUNC uint4 make_uint4(unsigned int x, unsigned int y, unsigned int z, unsigned int w) { | ||
| 6164 | return ::simd_make_uint4(x, y, z, w); | ||
| 6165 | } | ||
| 6166 | |||
| 6167 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 32-bit | ||
| 6168 | * unsigned integers. */ | ||
| 6169 | static inline SIMD_CPPFUNC uint4 make_uint4(unsigned int x, unsigned int y, uint2 zw) { | ||
| 6170 | return ::simd_make_uint4(x, y, zw); | ||
| 6171 | } | ||
| 6172 | |||
| 6173 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 32-bit | ||
| 6174 | * unsigned integers. */ | ||
| 6175 | static inline SIMD_CPPFUNC uint4 make_uint4(unsigned int x, uint2 yz, unsigned int w) { | ||
| 6176 | return ::simd_make_uint4(x, yz, w); | ||
| 6177 | } | ||
| 6178 | |||
| 6179 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 32-bit | ||
| 6180 | * unsigned integers. */ | ||
| 6181 | static inline SIMD_CPPFUNC uint4 make_uint4(uint2 xy, unsigned int z, unsigned int w) { | ||
| 6182 | return ::simd_make_uint4(xy, z, w); | ||
| 6183 | } | ||
| 6184 | |||
| 6185 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 32-bit | ||
| 6186 | * unsigned integers. */ | ||
| 6187 | static inline SIMD_CPPFUNC uint4 make_uint4(unsigned int x, uint3 yzw) { | ||
| 6188 | return ::simd_make_uint4(x, yzw); | ||
| 6189 | } | ||
| 6190 | |||
| 6191 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 32-bit | ||
| 6192 | * unsigned integers. */ | ||
| 6193 | static inline SIMD_CPPFUNC uint4 make_uint4(uint2 xy, uint2 zw) { | ||
| 6194 | return ::simd_make_uint4(xy, zw); | ||
| 6195 | } | ||
| 6196 | |||
| 6197 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 32-bit | ||
| 6198 | * unsigned integers. */ | ||
| 6199 | static inline SIMD_CPPFUNC uint4 make_uint4(uint3 xyz, unsigned int w) { | ||
| 6200 | return ::simd_make_uint4(xyz, w); | ||
| 6201 | } | ||
| 6202 | |||
| 6203 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 6204 | * 32-bit unsigned integers. */ | ||
| 6205 | template <typename typeN> static SIMD_CPPFUNC uint4 make_uint4(typeN other) { | ||
| 6206 | return ::simd_make_uint4(other); | ||
| 6207 | } | ||
| 6208 | |||
| 6209 | /*! @abstract Extends `other` to form a vector of four 32-bit unsigned | ||
| 6210 | * integers. The contents of the newly-created vector lanes are | ||
| 6211 | * unspecified. */ | ||
| 6212 | template <typename typeN> static SIMD_CPPFUNC uint4 make_uint4_undef(typeN other) { | ||
| 6213 | return ::simd_make_uint4_undef(other); | ||
| 6214 | } | ||
| 6215 | |||
| 6216 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 32-bit | ||
| 6217 | * unsigned integers. */ | ||
| 6218 | static inline SIMD_CPPFUNC uint8 make_uint8(uint4 lo, uint4 hi) { | ||
| 6219 | return ::simd_make_uint8(lo, hi); | ||
| 6220 | } | ||
| 6221 | |||
| 6222 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 6223 | * 32-bit unsigned integers. */ | ||
| 6224 | template <typename typeN> static SIMD_CPPFUNC uint8 make_uint8(typeN other) { | ||
| 6225 | return ::simd_make_uint8(other); | ||
| 6226 | } | ||
| 6227 | |||
| 6228 | /*! @abstract Extends `other` to form a vector of eight 32-bit unsigned | ||
| 6229 | * integers. The contents of the newly-created vector lanes are | ||
| 6230 | * unspecified. */ | ||
| 6231 | template <typename typeN> static SIMD_CPPFUNC uint8 make_uint8_undef(typeN other) { | ||
| 6232 | return ::simd_make_uint8_undef(other); | ||
| 6233 | } | ||
| 6234 | |||
| 6235 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 32-bit | ||
| 6236 | * unsigned integers. */ | ||
| 6237 | static inline SIMD_CPPFUNC uint16 make_uint16(uint8 lo, uint8 hi) { | ||
| 6238 | return ::simd_make_uint16(lo, hi); | ||
| 6239 | } | ||
| 6240 | |||
| 6241 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 6242 | * 32-bit unsigned integers. */ | ||
| 6243 | template <typename typeN> static SIMD_CPPFUNC uint16 make_uint16(typeN other) { | ||
| 6244 | return ::simd_make_uint16(other); | ||
| 6245 | } | ||
| 6246 | |||
| 6247 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit unsigned | ||
| 6248 | * integers. The contents of the newly-created vector lanes are | ||
| 6249 | * unspecified. */ | ||
| 6250 | template <typename typeN> static SIMD_CPPFUNC uint16 make_uint16_undef(typeN other) { | ||
| 6251 | return ::simd_make_uint16_undef(other); | ||
| 6252 | } | ||
| 6253 | |||
| 6254 | /*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit | ||
| 6255 | * floating-point numbers. */ | ||
| 6256 | static inline SIMD_CPPFUNC float2 make_float2(float x, float y) { | ||
| 6257 | return ::simd_make_float2(x, y); | ||
| 6258 | } | ||
| 6259 | |||
| 6260 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 6261 | * 32-bit floating-point numbers. */ | ||
| 6262 | template <typename typeN> static SIMD_CPPFUNC float2 make_float2(typeN other) { | ||
| 6263 | return ::simd_make_float2(other); | ||
| 6264 | } | ||
| 6265 | |||
| 6266 | /*! @abstract Extends `other` to form a vector of two 32-bit floating-point | ||
| 6267 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 6268 | template <typename typeN> static SIMD_CPPFUNC float2 make_float2_undef(typeN other) { | ||
| 6269 | return ::simd_make_float2_undef(other); | ||
| 6270 | } | ||
| 6271 | |||
| 6272 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 32-bit | ||
| 6273 | * floating-point numbers. */ | ||
| 6274 | static inline SIMD_CPPFUNC float3 make_float3(float x, float y, float z) { | ||
| 6275 | return ::simd_make_float3(x, y, z); | ||
| 6276 | } | ||
| 6277 | |||
| 6278 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 32-bit | ||
| 6279 | * floating-point numbers. */ | ||
| 6280 | static inline SIMD_CPPFUNC float3 make_float3(float x, float2 yz) { | ||
| 6281 | return ::simd_make_float3(x, yz); | ||
| 6282 | } | ||
| 6283 | |||
| 6284 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 32-bit | ||
| 6285 | * floating-point numbers. */ | ||
| 6286 | static inline SIMD_CPPFUNC float3 make_float3(float2 xy, float z) { | ||
| 6287 | return ::simd_make_float3(xy, z); | ||
| 6288 | } | ||
| 6289 | |||
| 6290 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 6291 | * 32-bit floating-point numbers. */ | ||
| 6292 | template <typename typeN> static SIMD_CPPFUNC float3 make_float3(typeN other) { | ||
| 6293 | return ::simd_make_float3(other); | ||
| 6294 | } | ||
| 6295 | |||
| 6296 | /*! @abstract Extends `other` to form a vector of three 32-bit floating- | ||
| 6297 | * point numbers. The contents of the newly-created vector lanes are | ||
| 6298 | * unspecified. */ | ||
| 6299 | template <typename typeN> static SIMD_CPPFUNC float3 make_float3_undef(typeN other) { | ||
| 6300 | return ::simd_make_float3_undef(other); | ||
| 6301 | } | ||
| 6302 | |||
| 6303 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 6304 | * 32-bit floating-point numbers. */ | ||
| 6305 | static inline SIMD_CPPFUNC float4 make_float4(float x, float y, float z, float w) { | ||
| 6306 | return ::simd_make_float4(x, y, z, w); | ||
| 6307 | } | ||
| 6308 | |||
| 6309 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 32-bit | ||
| 6310 | * floating-point numbers. */ | ||
| 6311 | static inline SIMD_CPPFUNC float4 make_float4(float x, float y, float2 zw) { | ||
| 6312 | return ::simd_make_float4(x, y, zw); | ||
| 6313 | } | ||
| 6314 | |||
| 6315 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 32-bit | ||
| 6316 | * floating-point numbers. */ | ||
| 6317 | static inline SIMD_CPPFUNC float4 make_float4(float x, float2 yz, float w) { | ||
| 6318 | return ::simd_make_float4(x, yz, w); | ||
| 6319 | } | ||
| 6320 | |||
| 6321 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 32-bit | ||
| 6322 | * floating-point numbers. */ | ||
| 6323 | static inline SIMD_CPPFUNC float4 make_float4(float2 xy, float z, float w) { | ||
| 6324 | return ::simd_make_float4(xy, z, w); | ||
| 6325 | } | ||
| 6326 | |||
| 6327 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 32-bit | ||
| 6328 | * floating-point numbers. */ | ||
| 6329 | static inline SIMD_CPPFUNC float4 make_float4(float x, float3 yzw) { | ||
| 6330 | return ::simd_make_float4(x, yzw); | ||
| 6331 | } | ||
| 6332 | |||
| 6333 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 32-bit | ||
| 6334 | * floating-point numbers. */ | ||
| 6335 | static inline SIMD_CPPFUNC float4 make_float4(float2 xy, float2 zw) { | ||
| 6336 | return ::simd_make_float4(xy, zw); | ||
| 6337 | } | ||
| 6338 | |||
| 6339 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 32-bit | ||
| 6340 | * floating-point numbers. */ | ||
| 6341 | static inline SIMD_CPPFUNC float4 make_float4(float3 xyz, float w) { | ||
| 6342 | return ::simd_make_float4(xyz, w); | ||
| 6343 | } | ||
| 6344 | |||
| 6345 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 6346 | * 32-bit floating-point numbers. */ | ||
| 6347 | template <typename typeN> static SIMD_CPPFUNC float4 make_float4(typeN other) { | ||
| 6348 | return ::simd_make_float4(other); | ||
| 6349 | } | ||
| 6350 | |||
| 6351 | /*! @abstract Extends `other` to form a vector of four 32-bit floating-point | ||
| 6352 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 6353 | template <typename typeN> static SIMD_CPPFUNC float4 make_float4_undef(typeN other) { | ||
| 6354 | return ::simd_make_float4_undef(other); | ||
| 6355 | } | ||
| 6356 | |||
| 6357 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 32-bit | ||
| 6358 | * floating-point numbers. */ | ||
| 6359 | static inline SIMD_CPPFUNC float8 make_float8(float4 lo, float4 hi) { | ||
| 6360 | return ::simd_make_float8(lo, hi); | ||
| 6361 | } | ||
| 6362 | |||
| 6363 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 6364 | * 32-bit floating-point numbers. */ | ||
| 6365 | template <typename typeN> static SIMD_CPPFUNC float8 make_float8(typeN other) { | ||
| 6366 | return ::simd_make_float8(other); | ||
| 6367 | } | ||
| 6368 | |||
| 6369 | /*! @abstract Extends `other` to form a vector of eight 32-bit floating- | ||
| 6370 | * point numbers. The contents of the newly-created vector lanes are | ||
| 6371 | * unspecified. */ | ||
| 6372 | template <typename typeN> static SIMD_CPPFUNC float8 make_float8_undef(typeN other) { | ||
| 6373 | return ::simd_make_float8_undef(other); | ||
| 6374 | } | ||
| 6375 | |||
| 6376 | /*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 32-bit | ||
| 6377 | * floating-point numbers. */ | ||
| 6378 | static inline SIMD_CPPFUNC float16 make_float16(float8 lo, float8 hi) { | ||
| 6379 | return ::simd_make_float16(lo, hi); | ||
| 6380 | } | ||
| 6381 | |||
| 6382 | /*! @abstract Truncates or zero-extends `other` to form a vector of sixteen | ||
| 6383 | * 32-bit floating-point numbers. */ | ||
| 6384 | template <typename typeN> static SIMD_CPPFUNC float16 make_float16(typeN other) { | ||
| 6385 | return ::simd_make_float16(other); | ||
| 6386 | } | ||
| 6387 | |||
| 6388 | /*! @abstract Extends `other` to form a vector of sixteen 32-bit floating- | ||
| 6389 | * point numbers. The contents of the newly-created vector lanes are | ||
| 6390 | * unspecified. */ | ||
| 6391 | template <typename typeN> static SIMD_CPPFUNC float16 make_float16_undef(typeN other) { | ||
| 6392 | return ::simd_make_float16_undef(other); | ||
| 6393 | } | ||
| 6394 | |||
| 6395 | /*! @abstract Concatenates `x` and `y` to form a vector of two 64-bit signed | ||
| 6396 | * (twos-complement) integers. */ | ||
| 6397 | static inline SIMD_CPPFUNC long2 make_long2(long1 x, long1 y) { | ||
| 6398 | return ::simd_make_long2(x, y); | ||
| 6399 | } | ||
| 6400 | |||
| 6401 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 6402 | * 64-bit signed (twos-complement) integers. */ | ||
| 6403 | template <typename typeN> static SIMD_CPPFUNC long2 make_long2(typeN other) { | ||
| 6404 | return ::simd_make_long2(other); | ||
| 6405 | } | ||
| 6406 | |||
| 6407 | /*! @abstract Extends `other` to form a vector of two 64-bit signed (twos- | ||
| 6408 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6409 | * unspecified. */ | ||
| 6410 | template <typename typeN> static SIMD_CPPFUNC long2 make_long2_undef(typeN other) { | ||
| 6411 | return ::simd_make_long2_undef(other); | ||
| 6412 | } | ||
| 6413 | |||
| 6414 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 64-bit | ||
| 6415 | * signed (twos-complement) integers. */ | ||
| 6416 | static inline SIMD_CPPFUNC long3 make_long3(long1 x, long1 y, long1 z) { | ||
| 6417 | return ::simd_make_long3(x, y, z); | ||
| 6418 | } | ||
| 6419 | |||
| 6420 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 64-bit | ||
| 6421 | * signed (twos-complement) integers. */ | ||
| 6422 | static inline SIMD_CPPFUNC long3 make_long3(long1 x, long2 yz) { | ||
| 6423 | return ::simd_make_long3(x, yz); | ||
| 6424 | } | ||
| 6425 | |||
| 6426 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 64-bit | ||
| 6427 | * signed (twos-complement) integers. */ | ||
| 6428 | static inline SIMD_CPPFUNC long3 make_long3(long2 xy, long1 z) { | ||
| 6429 | return ::simd_make_long3(xy, z); | ||
| 6430 | } | ||
| 6431 | |||
| 6432 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 6433 | * 64-bit signed (twos-complement) integers. */ | ||
| 6434 | template <typename typeN> static SIMD_CPPFUNC long3 make_long3(typeN other) { | ||
| 6435 | return ::simd_make_long3(other); | ||
| 6436 | } | ||
| 6437 | |||
| 6438 | /*! @abstract Extends `other` to form a vector of three 64-bit signed (twos- | ||
| 6439 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6440 | * unspecified. */ | ||
| 6441 | template <typename typeN> static SIMD_CPPFUNC long3 make_long3_undef(typeN other) { | ||
| 6442 | return ::simd_make_long3_undef(other); | ||
| 6443 | } | ||
| 6444 | |||
| 6445 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 6446 | * 64-bit signed (twos-complement) integers. */ | ||
| 6447 | static inline SIMD_CPPFUNC long4 make_long4(long1 x, long1 y, long1 z, long1 w) { | ||
| 6448 | return ::simd_make_long4(x, y, z, w); | ||
| 6449 | } | ||
| 6450 | |||
| 6451 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 64-bit | ||
| 6452 | * signed (twos-complement) integers. */ | ||
| 6453 | static inline SIMD_CPPFUNC long4 make_long4(long1 x, long1 y, long2 zw) { | ||
| 6454 | return ::simd_make_long4(x, y, zw); | ||
| 6455 | } | ||
| 6456 | |||
| 6457 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 64-bit | ||
| 6458 | * signed (twos-complement) integers. */ | ||
| 6459 | static inline SIMD_CPPFUNC long4 make_long4(long1 x, long2 yz, long1 w) { | ||
| 6460 | return ::simd_make_long4(x, yz, w); | ||
| 6461 | } | ||
| 6462 | |||
| 6463 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 64-bit | ||
| 6464 | * signed (twos-complement) integers. */ | ||
| 6465 | static inline SIMD_CPPFUNC long4 make_long4(long2 xy, long1 z, long1 w) { | ||
| 6466 | return ::simd_make_long4(xy, z, w); | ||
| 6467 | } | ||
| 6468 | |||
| 6469 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 64-bit | ||
| 6470 | * signed (twos-complement) integers. */ | ||
| 6471 | static inline SIMD_CPPFUNC long4 make_long4(long1 x, long3 yzw) { | ||
| 6472 | return ::simd_make_long4(x, yzw); | ||
| 6473 | } | ||
| 6474 | |||
| 6475 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 64-bit | ||
| 6476 | * signed (twos-complement) integers. */ | ||
| 6477 | static inline SIMD_CPPFUNC long4 make_long4(long2 xy, long2 zw) { | ||
| 6478 | return ::simd_make_long4(xy, zw); | ||
| 6479 | } | ||
| 6480 | |||
| 6481 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 64-bit | ||
| 6482 | * signed (twos-complement) integers. */ | ||
| 6483 | static inline SIMD_CPPFUNC long4 make_long4(long3 xyz, long1 w) { | ||
| 6484 | return ::simd_make_long4(xyz, w); | ||
| 6485 | } | ||
| 6486 | |||
| 6487 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 6488 | * 64-bit signed (twos-complement) integers. */ | ||
| 6489 | template <typename typeN> static SIMD_CPPFUNC long4 make_long4(typeN other) { | ||
| 6490 | return ::simd_make_long4(other); | ||
| 6491 | } | ||
| 6492 | |||
| 6493 | /*! @abstract Extends `other` to form a vector of four 64-bit signed (twos- | ||
| 6494 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6495 | * unspecified. */ | ||
| 6496 | template <typename typeN> static SIMD_CPPFUNC long4 make_long4_undef(typeN other) { | ||
| 6497 | return ::simd_make_long4_undef(other); | ||
| 6498 | } | ||
| 6499 | |||
| 6500 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 64-bit | ||
| 6501 | * signed (twos-complement) integers. */ | ||
| 6502 | static inline SIMD_CPPFUNC long8 make_long8(long4 lo, long4 hi) { | ||
| 6503 | return ::simd_make_long8(lo, hi); | ||
| 6504 | } | ||
| 6505 | |||
| 6506 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 6507 | * 64-bit signed (twos-complement) integers. */ | ||
| 6508 | template <typename typeN> static SIMD_CPPFUNC long8 make_long8(typeN other) { | ||
| 6509 | return ::simd_make_long8(other); | ||
| 6510 | } | ||
| 6511 | |||
| 6512 | /*! @abstract Extends `other` to form a vector of eight 64-bit signed (twos- | ||
| 6513 | * complement) integers. The contents of the newly-created vector lanes are | ||
| 6514 | * unspecified. */ | ||
| 6515 | template <typename typeN> static SIMD_CPPFUNC long8 make_long8_undef(typeN other) { | ||
| 6516 | return ::simd_make_long8_undef(other); | ||
| 6517 | } | ||
| 6518 | |||
| 6519 | /*! @abstract Concatenates `x` and `y` to form a vector of two 64-bit | ||
| 6520 | * unsigned integers. */ | ||
| 6521 | static inline SIMD_CPPFUNC ulong2 make_ulong2(ulong1 x, ulong1 y) { | ||
| 6522 | return ::simd_make_ulong2(x, y); | ||
| 6523 | } | ||
| 6524 | |||
| 6525 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 6526 | * 64-bit unsigned integers. */ | ||
| 6527 | template <typename typeN> static SIMD_CPPFUNC ulong2 make_ulong2(typeN other) { | ||
| 6528 | return ::simd_make_ulong2(other); | ||
| 6529 | } | ||
| 6530 | |||
| 6531 | /*! @abstract Extends `other` to form a vector of two 64-bit unsigned | ||
| 6532 | * integers. The contents of the newly-created vector lanes are | ||
| 6533 | * unspecified. */ | ||
| 6534 | template <typename typeN> static SIMD_CPPFUNC ulong2 make_ulong2_undef(typeN other) { | ||
| 6535 | return ::simd_make_ulong2_undef(other); | ||
| 6536 | } | ||
| 6537 | |||
| 6538 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 64-bit | ||
| 6539 | * unsigned integers. */ | ||
| 6540 | static inline SIMD_CPPFUNC ulong3 make_ulong3(ulong1 x, ulong1 y, ulong1 z) { | ||
| 6541 | return ::simd_make_ulong3(x, y, z); | ||
| 6542 | } | ||
| 6543 | |||
| 6544 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 64-bit | ||
| 6545 | * unsigned integers. */ | ||
| 6546 | static inline SIMD_CPPFUNC ulong3 make_ulong3(ulong1 x, ulong2 yz) { | ||
| 6547 | return ::simd_make_ulong3(x, yz); | ||
| 6548 | } | ||
| 6549 | |||
| 6550 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 64-bit | ||
| 6551 | * unsigned integers. */ | ||
| 6552 | static inline SIMD_CPPFUNC ulong3 make_ulong3(ulong2 xy, ulong1 z) { | ||
| 6553 | return ::simd_make_ulong3(xy, z); | ||
| 6554 | } | ||
| 6555 | |||
| 6556 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 6557 | * 64-bit unsigned integers. */ | ||
| 6558 | template <typename typeN> static SIMD_CPPFUNC ulong3 make_ulong3(typeN other) { | ||
| 6559 | return ::simd_make_ulong3(other); | ||
| 6560 | } | ||
| 6561 | |||
| 6562 | /*! @abstract Extends `other` to form a vector of three 64-bit unsigned | ||
| 6563 | * integers. The contents of the newly-created vector lanes are | ||
| 6564 | * unspecified. */ | ||
| 6565 | template <typename typeN> static SIMD_CPPFUNC ulong3 make_ulong3_undef(typeN other) { | ||
| 6566 | return ::simd_make_ulong3_undef(other); | ||
| 6567 | } | ||
| 6568 | |||
| 6569 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 6570 | * 64-bit unsigned integers. */ | ||
| 6571 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong1 x, ulong1 y, ulong1 z, ulong1 w) { | ||
| 6572 | return ::simd_make_ulong4(x, y, z, w); | ||
| 6573 | } | ||
| 6574 | |||
| 6575 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 64-bit | ||
| 6576 | * unsigned integers. */ | ||
| 6577 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong1 x, ulong1 y, ulong2 zw) { | ||
| 6578 | return ::simd_make_ulong4(x, y, zw); | ||
| 6579 | } | ||
| 6580 | |||
| 6581 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 64-bit | ||
| 6582 | * unsigned integers. */ | ||
| 6583 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong1 x, ulong2 yz, ulong1 w) { | ||
| 6584 | return ::simd_make_ulong4(x, yz, w); | ||
| 6585 | } | ||
| 6586 | |||
| 6587 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 64-bit | ||
| 6588 | * unsigned integers. */ | ||
| 6589 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong2 xy, ulong1 z, ulong1 w) { | ||
| 6590 | return ::simd_make_ulong4(xy, z, w); | ||
| 6591 | } | ||
| 6592 | |||
| 6593 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 64-bit | ||
| 6594 | * unsigned integers. */ | ||
| 6595 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong1 x, ulong3 yzw) { | ||
| 6596 | return ::simd_make_ulong4(x, yzw); | ||
| 6597 | } | ||
| 6598 | |||
| 6599 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 64-bit | ||
| 6600 | * unsigned integers. */ | ||
| 6601 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong2 xy, ulong2 zw) { | ||
| 6602 | return ::simd_make_ulong4(xy, zw); | ||
| 6603 | } | ||
| 6604 | |||
| 6605 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 64-bit | ||
| 6606 | * unsigned integers. */ | ||
| 6607 | static inline SIMD_CPPFUNC ulong4 make_ulong4(ulong3 xyz, ulong1 w) { | ||
| 6608 | return ::simd_make_ulong4(xyz, w); | ||
| 6609 | } | ||
| 6610 | |||
| 6611 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 6612 | * 64-bit unsigned integers. */ | ||
| 6613 | template <typename typeN> static SIMD_CPPFUNC ulong4 make_ulong4(typeN other) { | ||
| 6614 | return ::simd_make_ulong4(other); | ||
| 6615 | } | ||
| 6616 | |||
| 6617 | /*! @abstract Extends `other` to form a vector of four 64-bit unsigned | ||
| 6618 | * integers. The contents of the newly-created vector lanes are | ||
| 6619 | * unspecified. */ | ||
| 6620 | template <typename typeN> static SIMD_CPPFUNC ulong4 make_ulong4_undef(typeN other) { | ||
| 6621 | return ::simd_make_ulong4_undef(other); | ||
| 6622 | } | ||
| 6623 | |||
| 6624 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 64-bit | ||
| 6625 | * unsigned integers. */ | ||
| 6626 | static inline SIMD_CPPFUNC ulong8 make_ulong8(ulong4 lo, ulong4 hi) { | ||
| 6627 | return ::simd_make_ulong8(lo, hi); | ||
| 6628 | } | ||
| 6629 | |||
| 6630 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 6631 | * 64-bit unsigned integers. */ | ||
| 6632 | template <typename typeN> static SIMD_CPPFUNC ulong8 make_ulong8(typeN other) { | ||
| 6633 | return ::simd_make_ulong8(other); | ||
| 6634 | } | ||
| 6635 | |||
| 6636 | /*! @abstract Extends `other` to form a vector of eight 64-bit unsigned | ||
| 6637 | * integers. The contents of the newly-created vector lanes are | ||
| 6638 | * unspecified. */ | ||
| 6639 | template <typename typeN> static SIMD_CPPFUNC ulong8 make_ulong8_undef(typeN other) { | ||
| 6640 | return ::simd_make_ulong8_undef(other); | ||
| 6641 | } | ||
| 6642 | |||
| 6643 | /*! @abstract Concatenates `x` and `y` to form a vector of two 64-bit | ||
| 6644 | * floating-point numbers. */ | ||
| 6645 | static inline SIMD_CPPFUNC double2 make_double2(double x, double y) { | ||
| 6646 | return ::simd_make_double2(x, y); | ||
| 6647 | } | ||
| 6648 | |||
| 6649 | /*! @abstract Truncates or zero-extends `other` to form a vector of two | ||
| 6650 | * 64-bit floating-point numbers. */ | ||
| 6651 | template <typename typeN> static SIMD_CPPFUNC double2 make_double2(typeN other) { | ||
| 6652 | return ::simd_make_double2(other); | ||
| 6653 | } | ||
| 6654 | |||
| 6655 | /*! @abstract Extends `other` to form a vector of two 64-bit floating-point | ||
| 6656 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 6657 | template <typename typeN> static SIMD_CPPFUNC double2 make_double2_undef(typeN other) { | ||
| 6658 | return ::simd_make_double2_undef(other); | ||
| 6659 | } | ||
| 6660 | |||
| 6661 | /*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 64-bit | ||
| 6662 | * floating-point numbers. */ | ||
| 6663 | static inline SIMD_CPPFUNC double3 make_double3(double x, double y, double z) { | ||
| 6664 | return ::simd_make_double3(x, y, z); | ||
| 6665 | } | ||
| 6666 | |||
| 6667 | /*! @abstract Concatenates `x` and `yz` to form a vector of three 64-bit | ||
| 6668 | * floating-point numbers. */ | ||
| 6669 | static inline SIMD_CPPFUNC double3 make_double3(double x, double2 yz) { | ||
| 6670 | return ::simd_make_double3(x, yz); | ||
| 6671 | } | ||
| 6672 | |||
| 6673 | /*! @abstract Concatenates `xy` and `z` to form a vector of three 64-bit | ||
| 6674 | * floating-point numbers. */ | ||
| 6675 | static inline SIMD_CPPFUNC double3 make_double3(double2 xy, double z) { | ||
| 6676 | return ::simd_make_double3(xy, z); | ||
| 6677 | } | ||
| 6678 | |||
| 6679 | /*! @abstract Truncates or zero-extends `other` to form a vector of three | ||
| 6680 | * 64-bit floating-point numbers. */ | ||
| 6681 | template <typename typeN> static SIMD_CPPFUNC double3 make_double3(typeN other) { | ||
| 6682 | return ::simd_make_double3(other); | ||
| 6683 | } | ||
| 6684 | |||
| 6685 | /*! @abstract Extends `other` to form a vector of three 64-bit floating- | ||
| 6686 | * point numbers. The contents of the newly-created vector lanes are | ||
| 6687 | * unspecified. */ | ||
| 6688 | template <typename typeN> static SIMD_CPPFUNC double3 make_double3_undef(typeN other) { | ||
| 6689 | return ::simd_make_double3_undef(other); | ||
| 6690 | } | ||
| 6691 | |||
| 6692 | /*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four | ||
| 6693 | * 64-bit floating-point numbers. */ | ||
| 6694 | static inline SIMD_CPPFUNC double4 make_double4(double x, double y, double z, double w) { | ||
| 6695 | return ::simd_make_double4(x, y, z, w); | ||
| 6696 | } | ||
| 6697 | |||
| 6698 | /*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 64-bit | ||
| 6699 | * floating-point numbers. */ | ||
| 6700 | static inline SIMD_CPPFUNC double4 make_double4(double x, double y, double2 zw) { | ||
| 6701 | return ::simd_make_double4(x, y, zw); | ||
| 6702 | } | ||
| 6703 | |||
| 6704 | /*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 64-bit | ||
| 6705 | * floating-point numbers. */ | ||
| 6706 | static inline SIMD_CPPFUNC double4 make_double4(double x, double2 yz, double w) { | ||
| 6707 | return ::simd_make_double4(x, yz, w); | ||
| 6708 | } | ||
| 6709 | |||
| 6710 | /*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 64-bit | ||
| 6711 | * floating-point numbers. */ | ||
| 6712 | static inline SIMD_CPPFUNC double4 make_double4(double2 xy, double z, double w) { | ||
| 6713 | return ::simd_make_double4(xy, z, w); | ||
| 6714 | } | ||
| 6715 | |||
| 6716 | /*! @abstract Concatenates `x` and `yzw` to form a vector of four 64-bit | ||
| 6717 | * floating-point numbers. */ | ||
| 6718 | static inline SIMD_CPPFUNC double4 make_double4(double x, double3 yzw) { | ||
| 6719 | return ::simd_make_double4(x, yzw); | ||
| 6720 | } | ||
| 6721 | |||
| 6722 | /*! @abstract Concatenates `xy` and `zw` to form a vector of four 64-bit | ||
| 6723 | * floating-point numbers. */ | ||
| 6724 | static inline SIMD_CPPFUNC double4 make_double4(double2 xy, double2 zw) { | ||
| 6725 | return ::simd_make_double4(xy, zw); | ||
| 6726 | } | ||
| 6727 | |||
| 6728 | /*! @abstract Concatenates `xyz` and `w` to form a vector of four 64-bit | ||
| 6729 | * floating-point numbers. */ | ||
| 6730 | static inline SIMD_CPPFUNC double4 make_double4(double3 xyz, double w) { | ||
| 6731 | return ::simd_make_double4(xyz, w); | ||
| 6732 | } | ||
| 6733 | |||
| 6734 | /*! @abstract Truncates or zero-extends `other` to form a vector of four | ||
| 6735 | * 64-bit floating-point numbers. */ | ||
| 6736 | template <typename typeN> static SIMD_CPPFUNC double4 make_double4(typeN other) { | ||
| 6737 | return ::simd_make_double4(other); | ||
| 6738 | } | ||
| 6739 | |||
| 6740 | /*! @abstract Extends `other` to form a vector of four 64-bit floating-point | ||
| 6741 | * numbers. The contents of the newly-created vector lanes are unspecified. */ | ||
| 6742 | template <typename typeN> static SIMD_CPPFUNC double4 make_double4_undef(typeN other) { | ||
| 6743 | return ::simd_make_double4_undef(other); | ||
| 6744 | } | ||
| 6745 | |||
| 6746 | /*! @abstract Concatenates `lo` and `hi` to form a vector of eight 64-bit | ||
| 6747 | * floating-point numbers. */ | ||
| 6748 | static inline SIMD_CPPFUNC double8 make_double8(double4 lo, double4 hi) { | ||
| 6749 | return ::simd_make_double8(lo, hi); | ||
| 6750 | } | ||
| 6751 | |||
| 6752 | /*! @abstract Truncates or zero-extends `other` to form a vector of eight | ||
| 6753 | * 64-bit floating-point numbers. */ | ||
| 6754 | template <typename typeN> static SIMD_CPPFUNC double8 make_double8(typeN other) { | ||
| 6755 | return ::simd_make_double8(other); | ||
| 6756 | } | ||
| 6757 | |||
| 6758 | /*! @abstract Extends `other` to form a vector of eight 64-bit floating- | ||
| 6759 | * point numbers. The contents of the newly-created vector lanes are | ||
| 6760 | * unspecified. */ | ||
| 6761 | template <typename typeN> static SIMD_CPPFUNC double8 make_double8_undef(typeN other) { | ||
| 6762 | return ::simd_make_double8_undef(other); | ||
| 6763 | } | ||
| 6764 | |||
| 6765 | } /* namespace simd */ | ||
| 6766 | #endif /* __cplusplus */ | ||
| 6767 | #endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 6768 | #endif /* SIMD_VECTOR_CONSTRUCTORS */ | ||
lib/libc/include/x86_64-macos-gnu/simd/vector_types.h created+1281| ... | @@ -0,0 +1,1281 @@ | ||
| 1 | /*! @header | ||
| 2 | * This header defines fixed size vector types that are useful both for | ||
| 3 | * graphics and geometry, and for software vectorization without | ||
| 4 | * architecture-specific intrinsics. | ||
| 5 | * | ||
| 6 | * These types are based on a clang feature called "Extended vector types" | ||
| 7 | * or "OpenCL vector types" (despite the name, these types work just fine | ||
| 8 | * in C, Objective-C, and C++). There are a few tricks that make these | ||
| 9 | * types nicer to work with than traditional simd intrinsic types: | ||
| 10 | * | ||
| 11 | * - Basic arithmetic operators are overloaded to perform lanewise | ||
| 12 | * operations with these types, including both vector-vector and | ||
| 13 | * vector-scalar operations. | ||
| 14 | * | ||
| 15 | * - It is possible to access vector components both via array-style | ||
| 16 | * subscripting and by using the "." operator with component names | ||
| 17 | * "x", "y", "z", "w", and permutations thereof. | ||
| 18 | * | ||
| 19 | * - There are also some named subvectors: .lo and .hi are the first | ||
| 20 | * and second halves of a vector, and .even and .odd are the even- | ||
| 21 | * and odd-indexed elements of a vector. | ||
| 22 | * | ||
| 23 | * - Clang provides some useful builtins that operate on these vector | ||
| 24 | * types: __builtin_shufflevector and __builtin_convertvector. | ||
| 25 | * | ||
| 26 | * - The <simd/simd.h> headers define a large assortment of vector and | ||
| 27 | * matrix operations that work on these types. | ||
| 28 | * | ||
| 29 | * - You can also use the simd types with the architecture-specific | ||
| 30 | * intrinsics defined in <immintrin.h> and <arm_neon.h>. | ||
| 31 | * | ||
| 32 | * The following vector types are defined by this header: | ||
| 33 | * | ||
| 34 | * simd_charN where N is 1, 2, 3, 4, 8, 16, 32, or 64. | ||
| 35 | * simd_ucharN where N is 1, 2, 3, 4, 8, 16, 32, or 64. | ||
| 36 | * simd_shortN where N is 1, 2, 3, 4, 8, 16, or 32. | ||
| 37 | * simd_ushortN where N is 1, 2, 3, 4, 8, 16, or 32. | ||
| 38 | * simd_intN where N is 1, 2, 3, 4, 8, or 16. | ||
| 39 | * simd_uintN where N is 1, 2, 3, 4, 8, or 16. | ||
| 40 | * simd_floatN where N is 1, 2, 3, 4, 8, or 16. | ||
| 41 | * simd_longN where N is 1, 2, 3, 4, or 8. | ||
| 42 | * simd_ulongN where N is 1, 2, 3, 4, or 8. | ||
| 43 | * simd_doubleN where N is 1, 2, 3, 4, or 8. | ||
| 44 | * | ||
| 45 | * These types generally have greater alignment than the underlying scalar | ||
| 46 | * type; they are aligned to either the size of the vector[1] or 16 bytes, | ||
| 47 | * whichever is smaller. | ||
| 48 | * | ||
| 49 | * [1] Note that sizeof a three-element vector is the same as sizeof the | ||
| 50 | * corresponding four-element vector, because three-element vectors have | ||
| 51 | * a hidden lane of padding. | ||
| 52 | * | ||
| 53 | * In earlier versions of the simd library, the alignment of vectors could | ||
| 54 | * be larger than 16B, up to the "architectural vector size" of 16, 32, or | ||
| 55 | * 64B, depending on what options were passed on the command line when | ||
| 56 | * compiling. This super-alignment does not interact well with malloc, and | ||
| 57 | * makes it difficult for libraries to provide a stable API, while conferring | ||
| 58 | * relatively little performance benefit, so it has been relaxed. | ||
| 59 | * | ||
| 60 | * For each simd_typeN type where N is not 1 or 3, there is also a | ||
| 61 | * corresponding simd_packed_typeN type that requires only the alignment | ||
| 62 | * matching that of the underlying scalar type. Use this if you need to | ||
| 63 | * work with pointers-to or arrays-of scalar values: | ||
| 64 | * | ||
| 65 | * void myFunction(float *pointerToFourFloats) { | ||
| 66 | * // This is a bug, because `pointerToFourFloats` does not satisfy | ||
| 67 | * // the alignment requirements of the `simd_float4` type; attempting | ||
| 68 | * // to dereference (load from) `vecptr` is likely to crash at runtime. | ||
| 69 | * simd_float4 *vecptr = (simd_float4 *)pointerToFourFloats; | ||
| 70 | * | ||
| 71 | * // Instead, convert to `simd_packed_float4`: | ||
| 72 | * simd_packed_float4 *vecptr = (simd_packed_float4 *)pointerToFourFloats; | ||
| 73 | * // The `simd_packed_float4` type has the same alignment requirements | ||
| 74 | * // as `float`, so this conversion is safe, and lets us load a vector. | ||
| 75 | * // Note that `simd_packed_float4` can be assigned to `simd_float4` | ||
| 76 | * // without any conversion; they types only behave differently as | ||
| 77 | * // pointers or arrays. | ||
| 78 | * simd_float4 vector = vecptr[0]; | ||
| 79 | * } | ||
| 80 | * | ||
| 81 | * All of the simd_-prefixed types are also available in the C++ simd:: | ||
| 82 | * namespace; simd_char4 can be used as simd::char4, for example. These types | ||
| 83 | * largely match the Metal shader language vector types, except that there | ||
| 84 | * are no vector types larger than 4 elements in Metal. | ||
| 85 | * | ||
| 86 | * @copyright 2014-2017 Apple, Inc. All rights reserved. | ||
| 87 | * @unsorted */ | ||
| 88 | |||
| 89 | #ifndef SIMD_VECTOR_TYPES | ||
| 90 | #define SIMD_VECTOR_TYPES | ||
| 91 | |||
| 92 | # include <simd/base.h> | ||
| 93 | # if SIMD_COMPILER_HAS_REQUIRED_FEATURES | ||
| 94 | |||
| 95 | /* MARK: Basic vector types */ | ||
| 96 | |||
| 97 | /*! @group C and Objective-C vector types | ||
| 98 | * @discussion These are the basic types that underpin the simd library. */ | ||
| 99 | |||
| 100 | /*! @abstract A scalar 8-bit signed (twos-complement) integer. */ | ||
| 101 | typedef char simd_char1; | ||
| 102 | |||
| 103 | /*! @abstract A vector of two 8-bit signed (twos-complement) integers. | ||
| 104 | * @description In C++ and Metal, this type is also available as | ||
| 105 | * simd::char2. The alignment of this type is greater than the alignment of | ||
| 106 | * char; if you need to operate on data buffers that may not be suitably | ||
| 107 | * aligned, you should access them using simd_packed_char2 instead. */ | ||
| 108 | typedef __attribute__((__ext_vector_type__(2))) char simd_char2; | ||
| 109 | |||
| 110 | /*! @abstract A vector of three 8-bit signed (twos-complement) integers. | ||
| 111 | * @description In C++ and Metal, this type is also available as | ||
| 112 | * simd::char3. Note that vectors of this type are padded to have the same | ||
| 113 | * size and alignment as simd_char4. */ | ||
| 114 | typedef __attribute__((__ext_vector_type__(3))) char simd_char3; | ||
| 115 | |||
| 116 | /*! @abstract A vector of four 8-bit signed (twos-complement) integers. | ||
| 117 | * @description In C++ and Metal, this type is also available as | ||
| 118 | * simd::char4. The alignment of this type is greater than the alignment of | ||
| 119 | * char; if you need to operate on data buffers that may not be suitably | ||
| 120 | * aligned, you should access them using simd_packed_char4 instead. */ | ||
| 121 | typedef __attribute__((__ext_vector_type__(4))) char simd_char4; | ||
| 122 | |||
| 123 | /*! @abstract A vector of eight 8-bit signed (twos-complement) integers. | ||
| 124 | * @description In C++ this type is also available as simd::char8. This | ||
| 125 | * type is not available in Metal. The alignment of this type is greater | ||
| 126 | * than the alignment of char; if you need to operate on data buffers that | ||
| 127 | * may not be suitably aligned, you should access them using | ||
| 128 | * simd_packed_char8 instead. */ | ||
| 129 | typedef __attribute__((__ext_vector_type__(8))) char simd_char8; | ||
| 130 | |||
| 131 | /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers. | ||
| 132 | * @description In C++ this type is also available as simd::char16. This | ||
| 133 | * type is not available in Metal. The alignment of this type is greater | ||
| 134 | * than the alignment of char; if you need to operate on data buffers that | ||
| 135 | * may not be suitably aligned, you should access them using | ||
| 136 | * simd_packed_char16 instead. */ | ||
| 137 | typedef __attribute__((__ext_vector_type__(16))) char simd_char16; | ||
| 138 | |||
| 139 | /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) | ||
| 140 | * integers. | ||
| 141 | * @description In C++ this type is also available as simd::char32. This | ||
| 142 | * type is not available in Metal. The alignment of this type is greater | ||
| 143 | * than the alignment of char; if you need to operate on data buffers that | ||
| 144 | * may not be suitably aligned, you should access them using | ||
| 145 | * simd_packed_char32 instead. */ | ||
| 146 | typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) char simd_char32; | ||
| 147 | |||
| 148 | /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) | ||
| 149 | * integers. | ||
| 150 | * @description In C++ this type is also available as simd::char64. This | ||
| 151 | * type is not available in Metal. The alignment of this type is greater | ||
| 152 | * than the alignment of char; if you need to operate on data buffers that | ||
| 153 | * may not be suitably aligned, you should access them using | ||
| 154 | * simd_packed_char64 instead. */ | ||
| 155 | typedef __attribute__((__ext_vector_type__(64),__aligned__(16))) char simd_char64; | ||
| 156 | |||
| 157 | /*! @abstract A scalar 8-bit unsigned integer. */ | ||
| 158 | typedef unsigned char simd_uchar1; | ||
| 159 | |||
| 160 | /*! @abstract A vector of two 8-bit unsigned integers. | ||
| 161 | * @description In C++ and Metal, this type is also available as | ||
| 162 | * simd::uchar2. The alignment of this type is greater than the alignment | ||
| 163 | * of unsigned char; if you need to operate on data buffers that may not be | ||
| 164 | * suitably aligned, you should access them using simd_packed_uchar2 | ||
| 165 | * instead. */ | ||
| 166 | typedef __attribute__((__ext_vector_type__(2))) unsigned char simd_uchar2; | ||
| 167 | |||
| 168 | /*! @abstract A vector of three 8-bit unsigned integers. | ||
| 169 | * @description In C++ and Metal, this type is also available as | ||
| 170 | * simd::uchar3. Note that vectors of this type are padded to have the same | ||
| 171 | * size and alignment as simd_uchar4. */ | ||
| 172 | typedef __attribute__((__ext_vector_type__(3))) unsigned char simd_uchar3; | ||
| 173 | |||
| 174 | /*! @abstract A vector of four 8-bit unsigned integers. | ||
| 175 | * @description In C++ and Metal, this type is also available as | ||
| 176 | * simd::uchar4. The alignment of this type is greater than the alignment | ||
| 177 | * of unsigned char; if you need to operate on data buffers that may not be | ||
| 178 | * suitably aligned, you should access them using simd_packed_uchar4 | ||
| 179 | * instead. */ | ||
| 180 | typedef __attribute__((__ext_vector_type__(4))) unsigned char simd_uchar4; | ||
| 181 | |||
| 182 | /*! @abstract A vector of eight 8-bit unsigned integers. | ||
| 183 | * @description In C++ this type is also available as simd::uchar8. This | ||
| 184 | * type is not available in Metal. The alignment of this type is greater | ||
| 185 | * than the alignment of unsigned char; if you need to operate on data | ||
| 186 | * buffers that may not be suitably aligned, you should access them using | ||
| 187 | * simd_packed_uchar8 instead. */ | ||
| 188 | typedef __attribute__((__ext_vector_type__(8))) unsigned char simd_uchar8; | ||
| 189 | |||
| 190 | /*! @abstract A vector of sixteen 8-bit unsigned integers. | ||
| 191 | * @description In C++ this type is also available as simd::uchar16. This | ||
| 192 | * type is not available in Metal. The alignment of this type is greater | ||
| 193 | * than the alignment of unsigned char; if you need to operate on data | ||
| 194 | * buffers that may not be suitably aligned, you should access them using | ||
| 195 | * simd_packed_uchar16 instead. */ | ||
| 196 | typedef __attribute__((__ext_vector_type__(16))) unsigned char simd_uchar16; | ||
| 197 | |||
| 198 | /*! @abstract A vector of thirty-two 8-bit unsigned integers. | ||
| 199 | * @description In C++ this type is also available as simd::uchar32. This | ||
| 200 | * type is not available in Metal. The alignment of this type is greater | ||
| 201 | * than the alignment of unsigned char; if you need to operate on data | ||
| 202 | * buffers that may not be suitably aligned, you should access them using | ||
| 203 | * simd_packed_uchar32 instead. */ | ||
| 204 | typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned char simd_uchar32; | ||
| 205 | |||
| 206 | /*! @abstract A vector of sixty-four 8-bit unsigned integers. | ||
| 207 | * @description In C++ this type is also available as simd::uchar64. This | ||
| 208 | * type is not available in Metal. The alignment of this type is greater | ||
| 209 | * than the alignment of unsigned char; if you need to operate on data | ||
| 210 | * buffers that may not be suitably aligned, you should access them using | ||
| 211 | * simd_packed_uchar64 instead. */ | ||
| 212 | typedef __attribute__((__ext_vector_type__(64),__aligned__(16))) unsigned char simd_uchar64; | ||
| 213 | |||
| 214 | /*! @abstract A scalar 16-bit signed (twos-complement) integer. */ | ||
| 215 | typedef short simd_short1; | ||
| 216 | |||
| 217 | /*! @abstract A vector of two 16-bit signed (twos-complement) integers. | ||
| 218 | * @description In C++ and Metal, this type is also available as | ||
| 219 | * simd::short2. The alignment of this type is greater than the alignment | ||
| 220 | * of short; if you need to operate on data buffers that may not be | ||
| 221 | * suitably aligned, you should access them using simd_packed_short2 | ||
| 222 | * instead. */ | ||
| 223 | typedef __attribute__((__ext_vector_type__(2))) short simd_short2; | ||
| 224 | |||
| 225 | /*! @abstract A vector of three 16-bit signed (twos-complement) integers. | ||
| 226 | * @description In C++ and Metal, this type is also available as | ||
| 227 | * simd::short3. Note that vectors of this type are padded to have the same | ||
| 228 | * size and alignment as simd_short4. */ | ||
| 229 | typedef __attribute__((__ext_vector_type__(3))) short simd_short3; | ||
| 230 | |||
| 231 | /*! @abstract A vector of four 16-bit signed (twos-complement) integers. | ||
| 232 | * @description In C++ and Metal, this type is also available as | ||
| 233 | * simd::short4. The alignment of this type is greater than the alignment | ||
| 234 | * of short; if you need to operate on data buffers that may not be | ||
| 235 | * suitably aligned, you should access them using simd_packed_short4 | ||
| 236 | * instead. */ | ||
| 237 | typedef __attribute__((__ext_vector_type__(4))) short simd_short4; | ||
| 238 | |||
| 239 | /*! @abstract A vector of eight 16-bit signed (twos-complement) integers. | ||
| 240 | * @description In C++ this type is also available as simd::short8. This | ||
| 241 | * type is not available in Metal. The alignment of this type is greater | ||
| 242 | * than the alignment of short; if you need to operate on data buffers that | ||
| 243 | * may not be suitably aligned, you should access them using | ||
| 244 | * simd_packed_short8 instead. */ | ||
| 245 | typedef __attribute__((__ext_vector_type__(8))) short simd_short8; | ||
| 246 | |||
| 247 | /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers. | ||
| 248 | * @description In C++ this type is also available as simd::short16. This | ||
| 249 | * type is not available in Metal. The alignment of this type is greater | ||
| 250 | * than the alignment of short; if you need to operate on data buffers that | ||
| 251 | * may not be suitably aligned, you should access them using | ||
| 252 | * simd_packed_short16 instead. */ | ||
| 253 | typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) short simd_short16; | ||
| 254 | |||
| 255 | /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) | ||
| 256 | * integers. | ||
| 257 | * @description In C++ this type is also available as simd::short32. This | ||
| 258 | * type is not available in Metal. The alignment of this type is greater | ||
| 259 | * than the alignment of short; if you need to operate on data buffers that | ||
| 260 | * may not be suitably aligned, you should access them using | ||
| 261 | * simd_packed_short32 instead. */ | ||
| 262 | typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) short simd_short32; | ||
| 263 | |||
| 264 | /*! @abstract A scalar 16-bit unsigned integer. */ | ||
| 265 | typedef unsigned short simd_ushort1; | ||
| 266 | |||
| 267 | /*! @abstract A vector of two 16-bit unsigned integers. | ||
| 268 | * @description In C++ and Metal, this type is also available as | ||
| 269 | * simd::ushort2. The alignment of this type is greater than the alignment | ||
| 270 | * of unsigned short; if you need to operate on data buffers that may not | ||
| 271 | * be suitably aligned, you should access them using simd_packed_ushort2 | ||
| 272 | * instead. */ | ||
| 273 | typedef __attribute__((__ext_vector_type__(2))) unsigned short simd_ushort2; | ||
| 274 | |||
| 275 | /*! @abstract A vector of three 16-bit unsigned integers. | ||
| 276 | * @description In C++ and Metal, this type is also available as | ||
| 277 | * simd::ushort3. Note that vectors of this type are padded to have the | ||
| 278 | * same size and alignment as simd_ushort4. */ | ||
| 279 | typedef __attribute__((__ext_vector_type__(3))) unsigned short simd_ushort3; | ||
| 280 | |||
| 281 | /*! @abstract A vector of four 16-bit unsigned integers. | ||
| 282 | * @description In C++ and Metal, this type is also available as | ||
| 283 | * simd::ushort4. The alignment of this type is greater than the alignment | ||
| 284 | * of unsigned short; if you need to operate on data buffers that may not | ||
| 285 | * be suitably aligned, you should access them using simd_packed_ushort4 | ||
| 286 | * instead. */ | ||
| 287 | typedef __attribute__((__ext_vector_type__(4))) unsigned short simd_ushort4; | ||
| 288 | |||
| 289 | /*! @abstract A vector of eight 16-bit unsigned integers. | ||
| 290 | * @description In C++ this type is also available as simd::ushort8. This | ||
| 291 | * type is not available in Metal. The alignment of this type is greater | ||
| 292 | * than the alignment of unsigned short; if you need to operate on data | ||
| 293 | * buffers that may not be suitably aligned, you should access them using | ||
| 294 | * simd_packed_ushort8 instead. */ | ||
| 295 | typedef __attribute__((__ext_vector_type__(8))) unsigned short simd_ushort8; | ||
| 296 | |||
| 297 | /*! @abstract A vector of sixteen 16-bit unsigned integers. | ||
| 298 | * @description In C++ this type is also available as simd::ushort16. This | ||
| 299 | * type is not available in Metal. The alignment of this type is greater | ||
| 300 | * than the alignment of unsigned short; if you need to operate on data | ||
| 301 | * buffers that may not be suitably aligned, you should access them using | ||
| 302 | * simd_packed_ushort16 instead. */ | ||
| 303 | typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned short simd_ushort16; | ||
| 304 | |||
| 305 | /*! @abstract A vector of thirty-two 16-bit unsigned integers. | ||
| 306 | * @description In C++ this type is also available as simd::ushort32. This | ||
| 307 | * type is not available in Metal. The alignment of this type is greater | ||
| 308 | * than the alignment of unsigned short; if you need to operate on data | ||
| 309 | * buffers that may not be suitably aligned, you should access them using | ||
| 310 | * simd_packed_ushort32 instead. */ | ||
| 311 | typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned short simd_ushort32; | ||
| 312 | |||
| 313 | /*! @abstract A scalar 32-bit signed (twos-complement) integer. */ | ||
| 314 | typedef int simd_int1; | ||
| 315 | |||
| 316 | /*! @abstract A vector of two 32-bit signed (twos-complement) integers. | ||
| 317 | * @description In C++ and Metal, this type is also available as | ||
| 318 | * simd::int2. The alignment of this type is greater than the alignment of | ||
| 319 | * int; if you need to operate on data buffers that may not be suitably | ||
| 320 | * aligned, you should access them using simd_packed_int2 instead. */ | ||
| 321 | typedef __attribute__((__ext_vector_type__(2))) int simd_int2; | ||
| 322 | |||
| 323 | /*! @abstract A vector of three 32-bit signed (twos-complement) integers. | ||
| 324 | * @description In C++ and Metal, this type is also available as | ||
| 325 | * simd::int3. Note that vectors of this type are padded to have the same | ||
| 326 | * size and alignment as simd_int4. */ | ||
| 327 | typedef __attribute__((__ext_vector_type__(3))) int simd_int3; | ||
| 328 | |||
| 329 | /*! @abstract A vector of four 32-bit signed (twos-complement) integers. | ||
| 330 | * @description In C++ and Metal, this type is also available as | ||
| 331 | * simd::int4. The alignment of this type is greater than the alignment of | ||
| 332 | * int; if you need to operate on data buffers that may not be suitably | ||
| 333 | * aligned, you should access them using simd_packed_int4 instead. */ | ||
| 334 | typedef __attribute__((__ext_vector_type__(4))) int simd_int4; | ||
| 335 | |||
| 336 | /*! @abstract A vector of eight 32-bit signed (twos-complement) integers. | ||
| 337 | * @description In C++ this type is also available as simd::int8. This type | ||
| 338 | * is not available in Metal. The alignment of this type is greater than | ||
| 339 | * the alignment of int; if you need to operate on data buffers that may | ||
| 340 | * not be suitably aligned, you should access them using simd_packed_int8 | ||
| 341 | * instead. */ | ||
| 342 | typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) int simd_int8; | ||
| 343 | |||
| 344 | /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers. | ||
| 345 | * @description In C++ this type is also available as simd::int16. This | ||
| 346 | * type is not available in Metal. The alignment of this type is greater | ||
| 347 | * than the alignment of int; if you need to operate on data buffers that | ||
| 348 | * may not be suitably aligned, you should access them using | ||
| 349 | * simd_packed_int16 instead. */ | ||
| 350 | typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) int simd_int16; | ||
| 351 | |||
| 352 | /*! @abstract A scalar 32-bit unsigned integer. */ | ||
| 353 | typedef unsigned int simd_uint1; | ||
| 354 | |||
| 355 | /*! @abstract A vector of two 32-bit unsigned integers. | ||
| 356 | * @description In C++ and Metal, this type is also available as | ||
| 357 | * simd::uint2. The alignment of this type is greater than the alignment of | ||
| 358 | * unsigned int; if you need to operate on data buffers that may not be | ||
| 359 | * suitably aligned, you should access them using simd_packed_uint2 | ||
| 360 | * instead. */ | ||
| 361 | typedef __attribute__((__ext_vector_type__(2))) unsigned int simd_uint2; | ||
| 362 | |||
| 363 | /*! @abstract A vector of three 32-bit unsigned integers. | ||
| 364 | * @description In C++ and Metal, this type is also available as | ||
| 365 | * simd::uint3. Note that vectors of this type are padded to have the same | ||
| 366 | * size and alignment as simd_uint4. */ | ||
| 367 | typedef __attribute__((__ext_vector_type__(3))) unsigned int simd_uint3; | ||
| 368 | |||
| 369 | /*! @abstract A vector of four 32-bit unsigned integers. | ||
| 370 | * @description In C++ and Metal, this type is also available as | ||
| 371 | * simd::uint4. The alignment of this type is greater than the alignment of | ||
| 372 | * unsigned int; if you need to operate on data buffers that may not be | ||
| 373 | * suitably aligned, you should access them using simd_packed_uint4 | ||
| 374 | * instead. */ | ||
| 375 | typedef __attribute__((__ext_vector_type__(4))) unsigned int simd_uint4; | ||
| 376 | |||
| 377 | /*! @abstract A vector of eight 32-bit unsigned integers. | ||
| 378 | * @description In C++ this type is also available as simd::uint8. This | ||
| 379 | * type is not available in Metal. The alignment of this type is greater | ||
| 380 | * than the alignment of unsigned int; if you need to operate on data | ||
| 381 | * buffers that may not be suitably aligned, you should access them using | ||
| 382 | * simd_packed_uint8 instead. */ | ||
| 383 | typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) unsigned int simd_uint8; | ||
| 384 | |||
| 385 | /*! @abstract A vector of sixteen 32-bit unsigned integers. | ||
| 386 | * @description In C++ this type is also available as simd::uint16. This | ||
| 387 | * type is not available in Metal. The alignment of this type is greater | ||
| 388 | * than the alignment of unsigned int; if you need to operate on data | ||
| 389 | * buffers that may not be suitably aligned, you should access them using | ||
| 390 | * simd_packed_uint16 instead. */ | ||
| 391 | typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned int simd_uint16; | ||
| 392 | |||
| 393 | /*! @abstract A scalar 32-bit floating-point number. */ | ||
| 394 | typedef float simd_float1; | ||
| 395 | |||
| 396 | /*! @abstract A vector of two 32-bit floating-point numbers. | ||
| 397 | * @description In C++ and Metal, this type is also available as | ||
| 398 | * simd::float2. The alignment of this type is greater than the alignment | ||
| 399 | * of float; if you need to operate on data buffers that may not be | ||
| 400 | * suitably aligned, you should access them using simd_packed_float2 | ||
| 401 | * instead. */ | ||
| 402 | typedef __attribute__((__ext_vector_type__(2))) float simd_float2; | ||
| 403 | |||
| 404 | /*! @abstract A vector of three 32-bit floating-point numbers. | ||
| 405 | * @description In C++ and Metal, this type is also available as | ||
| 406 | * simd::float3. Note that vectors of this type are padded to have the same | ||
| 407 | * size and alignment as simd_float4. */ | ||
| 408 | typedef __attribute__((__ext_vector_type__(3))) float simd_float3; | ||
| 409 | |||
| 410 | /*! @abstract A vector of four 32-bit floating-point numbers. | ||
| 411 | * @description In C++ and Metal, this type is also available as | ||
| 412 | * simd::float4. The alignment of this type is greater than the alignment | ||
| 413 | * of float; if you need to operate on data buffers that may not be | ||
| 414 | * suitably aligned, you should access them using simd_packed_float4 | ||
| 415 | * instead. */ | ||
| 416 | typedef __attribute__((__ext_vector_type__(4))) float simd_float4; | ||
| 417 | |||
| 418 | /*! @abstract A vector of eight 32-bit floating-point numbers. | ||
| 419 | * @description In C++ this type is also available as simd::float8. This | ||
| 420 | * type is not available in Metal. The alignment of this type is greater | ||
| 421 | * than the alignment of float; if you need to operate on data buffers that | ||
| 422 | * may not be suitably aligned, you should access them using | ||
| 423 | * simd_packed_float8 instead. */ | ||
| 424 | typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) float simd_float8; | ||
| 425 | |||
| 426 | /*! @abstract A vector of sixteen 32-bit floating-point numbers. | ||
| 427 | * @description In C++ this type is also available as simd::float16. This | ||
| 428 | * type is not available in Metal. The alignment of this type is greater | ||
| 429 | * than the alignment of float; if you need to operate on data buffers that | ||
| 430 | * may not be suitably aligned, you should access them using | ||
| 431 | * simd_packed_float16 instead. */ | ||
| 432 | typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) float simd_float16; | ||
| 433 | |||
| 434 | /*! @abstract A scalar 64-bit signed (twos-complement) integer. */ | ||
| 435 | #if defined __LP64__ | ||
| 436 | typedef long simd_long1; | ||
| 437 | #else | ||
| 438 | typedef long long simd_long1; | ||
| 439 | #endif | ||
| 440 | |||
| 441 | /*! @abstract A vector of two 64-bit signed (twos-complement) integers. | ||
| 442 | * @description In C++ and Metal, this type is also available as | ||
| 443 | * simd::long2. The alignment of this type is greater than the alignment of | ||
| 444 | * simd_long1; if you need to operate on data buffers that may not be | ||
| 445 | * suitably aligned, you should access them using simd_packed_long2 | ||
| 446 | * instead. */ | ||
| 447 | typedef __attribute__((__ext_vector_type__(2))) simd_long1 simd_long2; | ||
| 448 | |||
| 449 | /*! @abstract A vector of three 64-bit signed (twos-complement) integers. | ||
| 450 | * @description In C++ and Metal, this type is also available as | ||
| 451 | * simd::long3. Note that vectors of this type are padded to have the same | ||
| 452 | * size and alignment as simd_long4. */ | ||
| 453 | typedef __attribute__((__ext_vector_type__(3),__aligned__(16))) simd_long1 simd_long3; | ||
| 454 | |||
| 455 | /*! @abstract A vector of four 64-bit signed (twos-complement) integers. | ||
| 456 | * @description In C++ and Metal, this type is also available as | ||
| 457 | * simd::long4. The alignment of this type is greater than the alignment of | ||
| 458 | * simd_long1; if you need to operate on data buffers that may not be | ||
| 459 | * suitably aligned, you should access them using simd_packed_long4 | ||
| 460 | * instead. */ | ||
| 461 | typedef __attribute__((__ext_vector_type__(4),__aligned__(16))) simd_long1 simd_long4; | ||
| 462 | |||
| 463 | /*! @abstract A vector of eight 64-bit signed (twos-complement) integers. | ||
| 464 | * @description In C++ this type is also available as simd::long8. This | ||
| 465 | * type is not available in Metal. The alignment of this type is greater | ||
| 466 | * than the alignment of simd_long1; if you need to operate on data buffers | ||
| 467 | * that may not be suitably aligned, you should access them using | ||
| 468 | * simd_packed_long8 instead. */ | ||
| 469 | typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) simd_long1 simd_long8; | ||
| 470 | |||
| 471 | /*! @abstract A scalar 64-bit unsigned integer. */ | ||
| 472 | #if defined __LP64__ | ||
| 473 | typedef unsigned long simd_ulong1; | ||
| 474 | #else | ||
| 475 | typedef unsigned long long simd_ulong1; | ||
| 476 | #endif | ||
| 477 | |||
| 478 | /*! @abstract A vector of two 64-bit unsigned integers. | ||
| 479 | * @description In C++ and Metal, this type is also available as | ||
| 480 | * simd::ulong2. The alignment of this type is greater than the alignment | ||
| 481 | * of simd_ulong1; if you need to operate on data buffers that may not be | ||
| 482 | * suitably aligned, you should access them using simd_packed_ulong2 | ||
| 483 | * instead. */ | ||
| 484 | typedef __attribute__((__ext_vector_type__(2))) simd_ulong1 simd_ulong2; | ||
| 485 | |||
| 486 | /*! @abstract A vector of three 64-bit unsigned integers. | ||
| 487 | * @description In C++ and Metal, this type is also available as | ||
| 488 | * simd::ulong3. Note that vectors of this type are padded to have the same | ||
| 489 | * size and alignment as simd_ulong4. */ | ||
| 490 | typedef __attribute__((__ext_vector_type__(3),__aligned__(16))) simd_ulong1 simd_ulong3; | ||
| 491 | |||
| 492 | /*! @abstract A vector of four 64-bit unsigned integers. | ||
| 493 | * @description In C++ and Metal, this type is also available as | ||
| 494 | * simd::ulong4. The alignment of this type is greater than the alignment | ||
| 495 | * of simd_ulong1; if you need to operate on data buffers that may not be | ||
| 496 | * suitably aligned, you should access them using simd_packed_ulong4 | ||
| 497 | * instead. */ | ||
| 498 | typedef __attribute__((__ext_vector_type__(4),__aligned__(16))) simd_ulong1 simd_ulong4; | ||
| 499 | |||
| 500 | /*! @abstract A vector of eight 64-bit unsigned integers. | ||
| 501 | * @description In C++ this type is also available as simd::ulong8. This | ||
| 502 | * type is not available in Metal. The alignment of this type is greater | ||
| 503 | * than the alignment of simd_ulong1; if you need to operate on data | ||
| 504 | * buffers that may not be suitably aligned, you should access them using | ||
| 505 | * simd_packed_ulong8 instead. */ | ||
| 506 | typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) simd_ulong1 simd_ulong8; | ||
| 507 | |||
| 508 | /*! @abstract A scalar 64-bit floating-point number. */ | ||
| 509 | typedef double simd_double1; | ||
| 510 | |||
| 511 | /*! @abstract A vector of two 64-bit floating-point numbers. | ||
| 512 | * @description In C++ and Metal, this type is also available as | ||
| 513 | * simd::double2. The alignment of this type is greater than the alignment | ||
| 514 | * of double; if you need to operate on data buffers that may not be | ||
| 515 | * suitably aligned, you should access them using simd_packed_double2 | ||
| 516 | * instead. */ | ||
| 517 | typedef __attribute__((__ext_vector_type__(2))) double simd_double2; | ||
| 518 | |||
| 519 | /*! @abstract A vector of three 64-bit floating-point numbers. | ||
| 520 | * @description In C++ and Metal, this type is also available as | ||
| 521 | * simd::double3. Note that vectors of this type are padded to have the | ||
| 522 | * same size and alignment as simd_double4. */ | ||
| 523 | typedef __attribute__((__ext_vector_type__(3),__aligned__(16))) double simd_double3; | ||
| 524 | |||
| 525 | /*! @abstract A vector of four 64-bit floating-point numbers. | ||
| 526 | * @description In C++ and Metal, this type is also available as | ||
| 527 | * simd::double4. The alignment of this type is greater than the alignment | ||
| 528 | * of double; if you need to operate on data buffers that may not be | ||
| 529 | * suitably aligned, you should access them using simd_packed_double4 | ||
| 530 | * instead. */ | ||
| 531 | typedef __attribute__((__ext_vector_type__(4),__aligned__(16))) double simd_double4; | ||
| 532 | |||
| 533 | /*! @abstract A vector of eight 64-bit floating-point numbers. | ||
| 534 | * @description In C++ this type is also available as simd::double8. This | ||
| 535 | * type is not available in Metal. The alignment of this type is greater | ||
| 536 | * than the alignment of double; if you need to operate on data buffers | ||
| 537 | * that may not be suitably aligned, you should access them using | ||
| 538 | * simd_packed_double8 instead. */ | ||
| 539 | typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) double simd_double8; | ||
| 540 | |||
| 541 | /* MARK: C++ vector types */ | ||
| 542 | #if defined __cplusplus | ||
| 543 | /*! @group C++ and Metal vector types | ||
| 544 | * @discussion Shorter type names available within the simd:: namespace. | ||
| 545 | * Each of these types is interchangable with the corresponding C type | ||
| 546 | * with the `simd_` prefix. */ | ||
| 547 | namespace simd { | ||
| 548 | /*! @abstract A scalar 8-bit signed (twos-complement) integer. | ||
| 549 | * @discussion In C and Objective-C, this type is available as | ||
| 550 | * simd_char1. */ | ||
| 551 | typedef ::simd_char1 char1; | ||
| 552 | |||
| 553 | /*! @abstract A vector of two 8-bit signed (twos-complement) integers. | ||
| 554 | * @description In C or Objective-C, this type is available as | ||
| 555 | * simd_char2. The alignment of this type is greater than the alignment | ||
| 556 | * of char; if you need to operate on data buffers that may not be | ||
| 557 | * suitably aligned, you should access them using simd::packed_char2 | ||
| 558 | * instead. */ | ||
| 559 | typedef ::simd_char2 char2; | ||
| 560 | |||
| 561 | /*! @abstract A vector of three 8-bit signed (twos-complement) integers. | ||
| 562 | * @description In C or Objective-C, this type is available as | ||
| 563 | * simd_char3. Vectors of this type are padded to have the same size and | ||
| 564 | * alignment as simd_char4. */ | ||
| 565 | typedef ::simd_char3 char3; | ||
| 566 | |||
| 567 | /*! @abstract A vector of four 8-bit signed (twos-complement) integers. | ||
| 568 | * @description In C or Objective-C, this type is available as | ||
| 569 | * simd_char4. The alignment of this type is greater than the alignment | ||
| 570 | * of char; if you need to operate on data buffers that may not be | ||
| 571 | * suitably aligned, you should access them using simd::packed_char4 | ||
| 572 | * instead. */ | ||
| 573 | typedef ::simd_char4 char4; | ||
| 574 | |||
| 575 | /*! @abstract A vector of eight 8-bit signed (twos-complement) integers. | ||
| 576 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 577 | * this type is available as simd_char8. The alignment of this type is | ||
| 578 | * greater than the alignment of char; if you need to operate on data | ||
| 579 | * buffers that may not be suitably aligned, you should access them using | ||
| 580 | * simd::packed_char8 instead. */ | ||
| 581 | typedef ::simd_char8 char8; | ||
| 582 | |||
| 583 | /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers. | ||
| 584 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 585 | * this type is available as simd_char16. The alignment of this type is | ||
| 586 | * greater than the alignment of char; if you need to operate on data | ||
| 587 | * buffers that may not be suitably aligned, you should access them using | ||
| 588 | * simd::packed_char16 instead. */ | ||
| 589 | typedef ::simd_char16 char16; | ||
| 590 | |||
| 591 | /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) | ||
| 592 | * integers. | ||
| 593 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 594 | * this type is available as simd_char32. The alignment of this type is | ||
| 595 | * greater than the alignment of char; if you need to operate on data | ||
| 596 | * buffers that may not be suitably aligned, you should access them using | ||
| 597 | * simd::packed_char32 instead. */ | ||
| 598 | typedef ::simd_char32 char32; | ||
| 599 | |||
| 600 | /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) | ||
| 601 | * integers. | ||
| 602 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 603 | * this type is available as simd_char64. The alignment of this type is | ||
| 604 | * greater than the alignment of char; if you need to operate on data | ||
| 605 | * buffers that may not be suitably aligned, you should access them using | ||
| 606 | * simd::packed_char64 instead. */ | ||
| 607 | typedef ::simd_char64 char64; | ||
| 608 | |||
| 609 | /*! @abstract A scalar 8-bit unsigned integer. | ||
| 610 | * @discussion In C and Objective-C, this type is available as | ||
| 611 | * simd_uchar1. */ | ||
| 612 | typedef ::simd_uchar1 uchar1; | ||
| 613 | |||
| 614 | /*! @abstract A vector of two 8-bit unsigned integers. | ||
| 615 | * @description In C or Objective-C, this type is available as | ||
| 616 | * simd_uchar2. The alignment of this type is greater than the alignment | ||
| 617 | * of unsigned char; if you need to operate on data buffers that may not | ||
| 618 | * be suitably aligned, you should access them using simd::packed_uchar2 | ||
| 619 | * instead. */ | ||
| 620 | typedef ::simd_uchar2 uchar2; | ||
| 621 | |||
| 622 | /*! @abstract A vector of three 8-bit unsigned integers. | ||
| 623 | * @description In C or Objective-C, this type is available as | ||
| 624 | * simd_uchar3. Vectors of this type are padded to have the same size and | ||
| 625 | * alignment as simd_uchar4. */ | ||
| 626 | typedef ::simd_uchar3 uchar3; | ||
| 627 | |||
| 628 | /*! @abstract A vector of four 8-bit unsigned integers. | ||
| 629 | * @description In C or Objective-C, this type is available as | ||
| 630 | * simd_uchar4. The alignment of this type is greater than the alignment | ||
| 631 | * of unsigned char; if you need to operate on data buffers that may not | ||
| 632 | * be suitably aligned, you should access them using simd::packed_uchar4 | ||
| 633 | * instead. */ | ||
| 634 | typedef ::simd_uchar4 uchar4; | ||
| 635 | |||
| 636 | /*! @abstract A vector of eight 8-bit unsigned integers. | ||
| 637 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 638 | * this type is available as simd_uchar8. The alignment of this type is | ||
| 639 | * greater than the alignment of unsigned char; if you need to operate on | ||
| 640 | * data buffers that may not be suitably aligned, you should access them | ||
| 641 | * using simd::packed_uchar8 instead. */ | ||
| 642 | typedef ::simd_uchar8 uchar8; | ||
| 643 | |||
| 644 | /*! @abstract A vector of sixteen 8-bit unsigned integers. | ||
| 645 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 646 | * this type is available as simd_uchar16. The alignment of this type is | ||
| 647 | * greater than the alignment of unsigned char; if you need to operate on | ||
| 648 | * data buffers that may not be suitably aligned, you should access them | ||
| 649 | * using simd::packed_uchar16 instead. */ | ||
| 650 | typedef ::simd_uchar16 uchar16; | ||
| 651 | |||
| 652 | /*! @abstract A vector of thirty-two 8-bit unsigned integers. | ||
| 653 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 654 | * this type is available as simd_uchar32. The alignment of this type is | ||
| 655 | * greater than the alignment of unsigned char; if you need to operate on | ||
| 656 | * data buffers that may not be suitably aligned, you should access them | ||
| 657 | * using simd::packed_uchar32 instead. */ | ||
| 658 | typedef ::simd_uchar32 uchar32; | ||
| 659 | |||
| 660 | /*! @abstract A vector of sixty-four 8-bit unsigned integers. | ||
| 661 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 662 | * this type is available as simd_uchar64. The alignment of this type is | ||
| 663 | * greater than the alignment of unsigned char; if you need to operate on | ||
| 664 | * data buffers that may not be suitably aligned, you should access them | ||
| 665 | * using simd::packed_uchar64 instead. */ | ||
| 666 | typedef ::simd_uchar64 uchar64; | ||
| 667 | |||
| 668 | /*! @abstract A scalar 16-bit signed (twos-complement) integer. | ||
| 669 | * @discussion In C and Objective-C, this type is available as | ||
| 670 | * simd_short1. */ | ||
| 671 | typedef ::simd_short1 short1; | ||
| 672 | |||
| 673 | /*! @abstract A vector of two 16-bit signed (twos-complement) integers. | ||
| 674 | * @description In C or Objective-C, this type is available as | ||
| 675 | * simd_short2. The alignment of this type is greater than the alignment | ||
| 676 | * of short; if you need to operate on data buffers that may not be | ||
| 677 | * suitably aligned, you should access them using simd::packed_short2 | ||
| 678 | * instead. */ | ||
| 679 | typedef ::simd_short2 short2; | ||
| 680 | |||
| 681 | /*! @abstract A vector of three 16-bit signed (twos-complement) integers. | ||
| 682 | * @description In C or Objective-C, this type is available as | ||
| 683 | * simd_short3. Vectors of this type are padded to have the same size and | ||
| 684 | * alignment as simd_short4. */ | ||
| 685 | typedef ::simd_short3 short3; | ||
| 686 | |||
| 687 | /*! @abstract A vector of four 16-bit signed (twos-complement) integers. | ||
| 688 | * @description In C or Objective-C, this type is available as | ||
| 689 | * simd_short4. The alignment of this type is greater than the alignment | ||
| 690 | * of short; if you need to operate on data buffers that may not be | ||
| 691 | * suitably aligned, you should access them using simd::packed_short4 | ||
| 692 | * instead. */ | ||
| 693 | typedef ::simd_short4 short4; | ||
| 694 | |||
| 695 | /*! @abstract A vector of eight 16-bit signed (twos-complement) integers. | ||
| 696 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 697 | * this type is available as simd_short8. The alignment of this type is | ||
| 698 | * greater than the alignment of short; if you need to operate on data | ||
| 699 | * buffers that may not be suitably aligned, you should access them using | ||
| 700 | * simd::packed_short8 instead. */ | ||
| 701 | typedef ::simd_short8 short8; | ||
| 702 | |||
| 703 | /*! @abstract A vector of sixteen 16-bit signed (twos-complement) | ||
| 704 | * integers. | ||
| 705 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 706 | * this type is available as simd_short16. The alignment of this type is | ||
| 707 | * greater than the alignment of short; if you need to operate on data | ||
| 708 | * buffers that may not be suitably aligned, you should access them using | ||
| 709 | * simd::packed_short16 instead. */ | ||
| 710 | typedef ::simd_short16 short16; | ||
| 711 | |||
| 712 | /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) | ||
| 713 | * integers. | ||
| 714 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 715 | * this type is available as simd_short32. The alignment of this type is | ||
| 716 | * greater than the alignment of short; if you need to operate on data | ||
| 717 | * buffers that may not be suitably aligned, you should access them using | ||
| 718 | * simd::packed_short32 instead. */ | ||
| 719 | typedef ::simd_short32 short32; | ||
| 720 | |||
| 721 | /*! @abstract A scalar 16-bit unsigned integer. | ||
| 722 | * @discussion In C and Objective-C, this type is available as | ||
| 723 | * simd_ushort1. */ | ||
| 724 | typedef ::simd_ushort1 ushort1; | ||
| 725 | |||
| 726 | /*! @abstract A vector of two 16-bit unsigned integers. | ||
| 727 | * @description In C or Objective-C, this type is available as | ||
| 728 | * simd_ushort2. The alignment of this type is greater than the alignment | ||
| 729 | * of unsigned short; if you need to operate on data buffers that may not | ||
| 730 | * be suitably aligned, you should access them using simd::packed_ushort2 | ||
| 731 | * instead. */ | ||
| 732 | typedef ::simd_ushort2 ushort2; | ||
| 733 | |||
| 734 | /*! @abstract A vector of three 16-bit unsigned integers. | ||
| 735 | * @description In C or Objective-C, this type is available as | ||
| 736 | * simd_ushort3. Vectors of this type are padded to have the same size | ||
| 737 | * and alignment as simd_ushort4. */ | ||
| 738 | typedef ::simd_ushort3 ushort3; | ||
| 739 | |||
| 740 | /*! @abstract A vector of four 16-bit unsigned integers. | ||
| 741 | * @description In C or Objective-C, this type is available as | ||
| 742 | * simd_ushort4. The alignment of this type is greater than the alignment | ||
| 743 | * of unsigned short; if you need to operate on data buffers that may not | ||
| 744 | * be suitably aligned, you should access them using simd::packed_ushort4 | ||
| 745 | * instead. */ | ||
| 746 | typedef ::simd_ushort4 ushort4; | ||
| 747 | |||
| 748 | /*! @abstract A vector of eight 16-bit unsigned integers. | ||
| 749 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 750 | * this type is available as simd_ushort8. The alignment of this type is | ||
| 751 | * greater than the alignment of unsigned short; if you need to operate | ||
| 752 | * on data buffers that may not be suitably aligned, you should access | ||
| 753 | * them using simd::packed_ushort8 instead. */ | ||
| 754 | typedef ::simd_ushort8 ushort8; | ||
| 755 | |||
| 756 | /*! @abstract A vector of sixteen 16-bit unsigned integers. | ||
| 757 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 758 | * this type is available as simd_ushort16. The alignment of this type is | ||
| 759 | * greater than the alignment of unsigned short; if you need to operate | ||
| 760 | * on data buffers that may not be suitably aligned, you should access | ||
| 761 | * them using simd::packed_ushort16 instead. */ | ||
| 762 | typedef ::simd_ushort16 ushort16; | ||
| 763 | |||
| 764 | /*! @abstract A vector of thirty-two 16-bit unsigned integers. | ||
| 765 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 766 | * this type is available as simd_ushort32. The alignment of this type is | ||
| 767 | * greater than the alignment of unsigned short; if you need to operate | ||
| 768 | * on data buffers that may not be suitably aligned, you should access | ||
| 769 | * them using simd::packed_ushort32 instead. */ | ||
| 770 | typedef ::simd_ushort32 ushort32; | ||
| 771 | |||
| 772 | /*! @abstract A scalar 32-bit signed (twos-complement) integer. | ||
| 773 | * @discussion In C and Objective-C, this type is available as simd_int1. */ | ||
| 774 | typedef ::simd_int1 int1; | ||
| 775 | |||
| 776 | /*! @abstract A vector of two 32-bit signed (twos-complement) integers. | ||
| 777 | * @description In C or Objective-C, this type is available as simd_int2. | ||
| 778 | * The alignment of this type is greater than the alignment of int; if | ||
| 779 | * you need to operate on data buffers that may not be suitably aligned, | ||
| 780 | * you should access them using simd::packed_int2 instead. */ | ||
| 781 | typedef ::simd_int2 int2; | ||
| 782 | |||
| 783 | /*! @abstract A vector of three 32-bit signed (twos-complement) integers. | ||
| 784 | * @description In C or Objective-C, this type is available as simd_int3. | ||
| 785 | * Vectors of this type are padded to have the same size and alignment as | ||
| 786 | * simd_int4. */ | ||
| 787 | typedef ::simd_int3 int3; | ||
| 788 | |||
| 789 | /*! @abstract A vector of four 32-bit signed (twos-complement) integers. | ||
| 790 | * @description In C or Objective-C, this type is available as simd_int4. | ||
| 791 | * The alignment of this type is greater than the alignment of int; if | ||
| 792 | * you need to operate on data buffers that may not be suitably aligned, | ||
| 793 | * you should access them using simd::packed_int4 instead. */ | ||
| 794 | typedef ::simd_int4 int4; | ||
| 795 | |||
| 796 | /*! @abstract A vector of eight 32-bit signed (twos-complement) integers. | ||
| 797 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 798 | * this type is available as simd_int8. The alignment of this type is | ||
| 799 | * greater than the alignment of int; if you need to operate on data | ||
| 800 | * buffers that may not be suitably aligned, you should access them using | ||
| 801 | * simd::packed_int8 instead. */ | ||
| 802 | typedef ::simd_int8 int8; | ||
| 803 | |||
| 804 | /*! @abstract A vector of sixteen 32-bit signed (twos-complement) | ||
| 805 | * integers. | ||
| 806 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 807 | * this type is available as simd_int16. The alignment of this type is | ||
| 808 | * greater than the alignment of int; if you need to operate on data | ||
| 809 | * buffers that may not be suitably aligned, you should access them using | ||
| 810 | * simd::packed_int16 instead. */ | ||
| 811 | typedef ::simd_int16 int16; | ||
| 812 | |||
| 813 | /*! @abstract A scalar 32-bit unsigned integer. | ||
| 814 | * @discussion In C and Objective-C, this type is available as | ||
| 815 | * simd_uint1. */ | ||
| 816 | typedef ::simd_uint1 uint1; | ||
| 817 | |||
| 818 | /*! @abstract A vector of two 32-bit unsigned integers. | ||
| 819 | * @description In C or Objective-C, this type is available as | ||
| 820 | * simd_uint2. The alignment of this type is greater than the alignment | ||
| 821 | * of unsigned int; if you need to operate on data buffers that may not | ||
| 822 | * be suitably aligned, you should access them using simd::packed_uint2 | ||
| 823 | * instead. */ | ||
| 824 | typedef ::simd_uint2 uint2; | ||
| 825 | |||
| 826 | /*! @abstract A vector of three 32-bit unsigned integers. | ||
| 827 | * @description In C or Objective-C, this type is available as | ||
| 828 | * simd_uint3. Vectors of this type are padded to have the same size and | ||
| 829 | * alignment as simd_uint4. */ | ||
| 830 | typedef ::simd_uint3 uint3; | ||
| 831 | |||
| 832 | /*! @abstract A vector of four 32-bit unsigned integers. | ||
| 833 | * @description In C or Objective-C, this type is available as | ||
| 834 | * simd_uint4. The alignment of this type is greater than the alignment | ||
| 835 | * of unsigned int; if you need to operate on data buffers that may not | ||
| 836 | * be suitably aligned, you should access them using simd::packed_uint4 | ||
| 837 | * instead. */ | ||
| 838 | typedef ::simd_uint4 uint4; | ||
| 839 | |||
| 840 | /*! @abstract A vector of eight 32-bit unsigned integers. | ||
| 841 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 842 | * this type is available as simd_uint8. The alignment of this type is | ||
| 843 | * greater than the alignment of unsigned int; if you need to operate on | ||
| 844 | * data buffers that may not be suitably aligned, you should access them | ||
| 845 | * using simd::packed_uint8 instead. */ | ||
| 846 | typedef ::simd_uint8 uint8; | ||
| 847 | |||
| 848 | /*! @abstract A vector of sixteen 32-bit unsigned integers. | ||
| 849 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 850 | * this type is available as simd_uint16. The alignment of this type is | ||
| 851 | * greater than the alignment of unsigned int; if you need to operate on | ||
| 852 | * data buffers that may not be suitably aligned, you should access them | ||
| 853 | * using simd::packed_uint16 instead. */ | ||
| 854 | typedef ::simd_uint16 uint16; | ||
| 855 | |||
| 856 | /*! @abstract A scalar 32-bit floating-point number. | ||
| 857 | * @discussion In C and Objective-C, this type is available as | ||
| 858 | * simd_float1. */ | ||
| 859 | typedef ::simd_float1 float1; | ||
| 860 | |||
| 861 | /*! @abstract A vector of two 32-bit floating-point numbers. | ||
| 862 | * @description In C or Objective-C, this type is available as | ||
| 863 | * simd_float2. The alignment of this type is greater than the alignment | ||
| 864 | * of float; if you need to operate on data buffers that may not be | ||
| 865 | * suitably aligned, you should access them using simd::packed_float2 | ||
| 866 | * instead. */ | ||
| 867 | typedef ::simd_float2 float2; | ||
| 868 | |||
| 869 | /*! @abstract A vector of three 32-bit floating-point numbers. | ||
| 870 | * @description In C or Objective-C, this type is available as | ||
| 871 | * simd_float3. Vectors of this type are padded to have the same size and | ||
| 872 | * alignment as simd_float4. */ | ||
| 873 | typedef ::simd_float3 float3; | ||
| 874 | |||
| 875 | /*! @abstract A vector of four 32-bit floating-point numbers. | ||
| 876 | * @description In C or Objective-C, this type is available as | ||
| 877 | * simd_float4. The alignment of this type is greater than the alignment | ||
| 878 | * of float; if you need to operate on data buffers that may not be | ||
| 879 | * suitably aligned, you should access them using simd::packed_float4 | ||
| 880 | * instead. */ | ||
| 881 | typedef ::simd_float4 float4; | ||
| 882 | |||
| 883 | /*! @abstract A vector of eight 32-bit floating-point numbers. | ||
| 884 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 885 | * this type is available as simd_float8. The alignment of this type is | ||
| 886 | * greater than the alignment of float; if you need to operate on data | ||
| 887 | * buffers that may not be suitably aligned, you should access them using | ||
| 888 | * simd::packed_float8 instead. */ | ||
| 889 | typedef ::simd_float8 float8; | ||
| 890 | |||
| 891 | /*! @abstract A vector of sixteen 32-bit floating-point numbers. | ||
| 892 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 893 | * this type is available as simd_float16. The alignment of this type is | ||
| 894 | * greater than the alignment of float; if you need to operate on data | ||
| 895 | * buffers that may not be suitably aligned, you should access them using | ||
| 896 | * simd::packed_float16 instead. */ | ||
| 897 | typedef ::simd_float16 float16; | ||
| 898 | |||
| 899 | /*! @abstract A scalar 64-bit signed (twos-complement) integer. | ||
| 900 | * @discussion In C and Objective-C, this type is available as | ||
| 901 | * simd_long1. */ | ||
| 902 | typedef ::simd_long1 long1; | ||
| 903 | |||
| 904 | /*! @abstract A vector of two 64-bit signed (twos-complement) integers. | ||
| 905 | * @description In C or Objective-C, this type is available as | ||
| 906 | * simd_long2. The alignment of this type is greater than the alignment | ||
| 907 | * of simd_long1; if you need to operate on data buffers that may not be | ||
| 908 | * suitably aligned, you should access them using simd::packed_long2 | ||
| 909 | * instead. */ | ||
| 910 | typedef ::simd_long2 long2; | ||
| 911 | |||
| 912 | /*! @abstract A vector of three 64-bit signed (twos-complement) integers. | ||
| 913 | * @description In C or Objective-C, this type is available as | ||
| 914 | * simd_long3. Vectors of this type are padded to have the same size and | ||
| 915 | * alignment as simd_long4. */ | ||
| 916 | typedef ::simd_long3 long3; | ||
| 917 | |||
| 918 | /*! @abstract A vector of four 64-bit signed (twos-complement) integers. | ||
| 919 | * @description In C or Objective-C, this type is available as | ||
| 920 | * simd_long4. The alignment of this type is greater than the alignment | ||
| 921 | * of simd_long1; if you need to operate on data buffers that may not be | ||
| 922 | * suitably aligned, you should access them using simd::packed_long4 | ||
| 923 | * instead. */ | ||
| 924 | typedef ::simd_long4 long4; | ||
| 925 | |||
| 926 | /*! @abstract A vector of eight 64-bit signed (twos-complement) integers. | ||
| 927 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 928 | * this type is available as simd_long8. The alignment of this type is | ||
| 929 | * greater than the alignment of simd_long1; if you need to operate on | ||
| 930 | * data buffers that may not be suitably aligned, you should access them | ||
| 931 | * using simd::packed_long8 instead. */ | ||
| 932 | typedef ::simd_long8 long8; | ||
| 933 | |||
| 934 | /*! @abstract A scalar 64-bit unsigned integer. | ||
| 935 | * @discussion In C and Objective-C, this type is available as | ||
| 936 | * simd_ulong1. */ | ||
| 937 | typedef ::simd_ulong1 ulong1; | ||
| 938 | |||
| 939 | /*! @abstract A vector of two 64-bit unsigned integers. | ||
| 940 | * @description In C or Objective-C, this type is available as | ||
| 941 | * simd_ulong2. The alignment of this type is greater than the alignment | ||
| 942 | * of simd_ulong1; if you need to operate on data buffers that may not be | ||
| 943 | * suitably aligned, you should access them using simd::packed_ulong2 | ||
| 944 | * instead. */ | ||
| 945 | typedef ::simd_ulong2 ulong2; | ||
| 946 | |||
| 947 | /*! @abstract A vector of three 64-bit unsigned integers. | ||
| 948 | * @description In C or Objective-C, this type is available as | ||
| 949 | * simd_ulong3. Vectors of this type are padded to have the same size and | ||
| 950 | * alignment as simd_ulong4. */ | ||
| 951 | typedef ::simd_ulong3 ulong3; | ||
| 952 | |||
| 953 | /*! @abstract A vector of four 64-bit unsigned integers. | ||
| 954 | * @description In C or Objective-C, this type is available as | ||
| 955 | * simd_ulong4. The alignment of this type is greater than the alignment | ||
| 956 | * of simd_ulong1; if you need to operate on data buffers that may not be | ||
| 957 | * suitably aligned, you should access them using simd::packed_ulong4 | ||
| 958 | * instead. */ | ||
| 959 | typedef ::simd_ulong4 ulong4; | ||
| 960 | |||
| 961 | /*! @abstract A vector of eight 64-bit unsigned integers. | ||
| 962 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 963 | * this type is available as simd_ulong8. The alignment of this type is | ||
| 964 | * greater than the alignment of simd_ulong1; if you need to operate on | ||
| 965 | * data buffers that may not be suitably aligned, you should access them | ||
| 966 | * using simd::packed_ulong8 instead. */ | ||
| 967 | typedef ::simd_ulong8 ulong8; | ||
| 968 | |||
| 969 | /*! @abstract A scalar 64-bit floating-point number. | ||
| 970 | * @discussion In C and Objective-C, this type is available as | ||
| 971 | * simd_double1. */ | ||
| 972 | typedef ::simd_double1 double1; | ||
| 973 | |||
| 974 | /*! @abstract A vector of two 64-bit floating-point numbers. | ||
| 975 | * @description In C or Objective-C, this type is available as | ||
| 976 | * simd_double2. The alignment of this type is greater than the alignment | ||
| 977 | * of double; if you need to operate on data buffers that may not be | ||
| 978 | * suitably aligned, you should access them using simd::packed_double2 | ||
| 979 | * instead. */ | ||
| 980 | typedef ::simd_double2 double2; | ||
| 981 | |||
| 982 | /*! @abstract A vector of three 64-bit floating-point numbers. | ||
| 983 | * @description In C or Objective-C, this type is available as | ||
| 984 | * simd_double3. Vectors of this type are padded to have the same size | ||
| 985 | * and alignment as simd_double4. */ | ||
| 986 | typedef ::simd_double3 double3; | ||
| 987 | |||
| 988 | /*! @abstract A vector of four 64-bit floating-point numbers. | ||
| 989 | * @description In C or Objective-C, this type is available as | ||
| 990 | * simd_double4. The alignment of this type is greater than the alignment | ||
| 991 | * of double; if you need to operate on data buffers that may not be | ||
| 992 | * suitably aligned, you should access them using simd::packed_double4 | ||
| 993 | * instead. */ | ||
| 994 | typedef ::simd_double4 double4; | ||
| 995 | |||
| 996 | /*! @abstract A vector of eight 64-bit floating-point numbers. | ||
| 997 | * @description This type is not available in Metal. In C or Objective-C, | ||
| 998 | * this type is available as simd_double8. The alignment of this type is | ||
| 999 | * greater than the alignment of double; if you need to operate on data | ||
| 1000 | * buffers that may not be suitably aligned, you should access them using | ||
| 1001 | * simd::packed_double8 instead. */ | ||
| 1002 | typedef ::simd_double8 double8; | ||
| 1003 | |||
| 1004 | } /* namespace simd:: */ | ||
| 1005 | #endif /* __cplusplus */ | ||
| 1006 | |||
| 1007 | /* MARK: Deprecated vector types */ | ||
| 1008 | /*! @group Deprecated vector types | ||
| 1009 | * @discussion These are the original types used by earlier versions of the | ||
| 1010 | * simd library; they are provided here for compatability with existing source | ||
| 1011 | * files. Use the new ("simd_"-prefixed) types for future development. */ | ||
| 1012 | |||
| 1013 | /*! @abstract A vector of two 8-bit signed (twos-complement) integers. | ||
| 1014 | * @description This type is deprecated; you should use simd_char2 or | ||
| 1015 | * simd::char2 instead. */ | ||
| 1016 | typedef simd_char2 vector_char2; | ||
| 1017 | |||
| 1018 | /*! @abstract A vector of three 8-bit signed (twos-complement) integers. | ||
| 1019 | * @description This type is deprecated; you should use simd_char3 or | ||
| 1020 | * simd::char3 instead. */ | ||
| 1021 | typedef simd_char3 vector_char3; | ||
| 1022 | |||
| 1023 | /*! @abstract A vector of four 8-bit signed (twos-complement) integers. | ||
| 1024 | * @description This type is deprecated; you should use simd_char4 or | ||
| 1025 | * simd::char4 instead. */ | ||
| 1026 | typedef simd_char4 vector_char4; | ||
| 1027 | |||
| 1028 | /*! @abstract A vector of eight 8-bit signed (twos-complement) integers. | ||
| 1029 | * @description This type is deprecated; you should use simd_char8 or | ||
| 1030 | * simd::char8 instead. */ | ||
| 1031 | typedef simd_char8 vector_char8; | ||
| 1032 | |||
| 1033 | /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers. | ||
| 1034 | * @description This type is deprecated; you should use simd_char16 or | ||
| 1035 | * simd::char16 instead. */ | ||
| 1036 | typedef simd_char16 vector_char16; | ||
| 1037 | |||
| 1038 | /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) | ||
| 1039 | * integers. | ||
| 1040 | * @description This type is deprecated; you should use simd_char32 or | ||
| 1041 | * simd::char32 instead. */ | ||
| 1042 | typedef simd_char32 vector_char32; | ||
| 1043 | |||
| 1044 | /*! @abstract A vector of two 8-bit unsigned integers. | ||
| 1045 | * @description This type is deprecated; you should use simd_uchar2 or | ||
| 1046 | * simd::uchar2 instead. */ | ||
| 1047 | typedef simd_uchar2 vector_uchar2; | ||
| 1048 | |||
| 1049 | /*! @abstract A vector of three 8-bit unsigned integers. | ||
| 1050 | * @description This type is deprecated; you should use simd_uchar3 or | ||
| 1051 | * simd::uchar3 instead. */ | ||
| 1052 | typedef simd_uchar3 vector_uchar3; | ||
| 1053 | |||
| 1054 | /*! @abstract A vector of four 8-bit unsigned integers. | ||
| 1055 | * @description This type is deprecated; you should use simd_uchar4 or | ||
| 1056 | * simd::uchar4 instead. */ | ||
| 1057 | typedef simd_uchar4 vector_uchar4; | ||
| 1058 | |||
| 1059 | /*! @abstract A vector of eight 8-bit unsigned integers. | ||
| 1060 | * @description This type is deprecated; you should use simd_uchar8 or | ||
| 1061 | * simd::uchar8 instead. */ | ||
| 1062 | typedef simd_uchar8 vector_uchar8; | ||
| 1063 | |||
| 1064 | /*! @abstract A vector of sixteen 8-bit unsigned integers. | ||
| 1065 | * @description This type is deprecated; you should use simd_uchar16 or | ||
| 1066 | * simd::uchar16 instead. */ | ||
| 1067 | typedef simd_uchar16 vector_uchar16; | ||
| 1068 | |||
| 1069 | /*! @abstract A vector of thirty-two 8-bit unsigned integers. | ||
| 1070 | * @description This type is deprecated; you should use simd_uchar32 or | ||
| 1071 | * simd::uchar32 instead. */ | ||
| 1072 | typedef simd_uchar32 vector_uchar32; | ||
| 1073 | |||
| 1074 | /*! @abstract A vector of two 16-bit signed (twos-complement) integers. | ||
| 1075 | * @description This type is deprecated; you should use simd_short2 or | ||
| 1076 | * simd::short2 instead. */ | ||
| 1077 | typedef simd_short2 vector_short2; | ||
| 1078 | |||
| 1079 | /*! @abstract A vector of three 16-bit signed (twos-complement) integers. | ||
| 1080 | * @description This type is deprecated; you should use simd_short3 or | ||
| 1081 | * simd::short3 instead. */ | ||
| 1082 | typedef simd_short3 vector_short3; | ||
| 1083 | |||
| 1084 | /*! @abstract A vector of four 16-bit signed (twos-complement) integers. | ||
| 1085 | * @description This type is deprecated; you should use simd_short4 or | ||
| 1086 | * simd::short4 instead. */ | ||
| 1087 | typedef simd_short4 vector_short4; | ||
| 1088 | |||
| 1089 | /*! @abstract A vector of eight 16-bit signed (twos-complement) integers. | ||
| 1090 | * @description This type is deprecated; you should use simd_short8 or | ||
| 1091 | * simd::short8 instead. */ | ||
| 1092 | typedef simd_short8 vector_short8; | ||
| 1093 | |||
| 1094 | /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers. | ||
| 1095 | * @description This type is deprecated; you should use simd_short16 or | ||
| 1096 | * simd::short16 instead. */ | ||
| 1097 | typedef simd_short16 vector_short16; | ||
| 1098 | |||
| 1099 | /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) | ||
| 1100 | * integers. | ||
| 1101 | * @description This type is deprecated; you should use simd_short32 or | ||
| 1102 | * simd::short32 instead. */ | ||
| 1103 | typedef simd_short32 vector_short32; | ||
| 1104 | |||
| 1105 | /*! @abstract A vector of two 16-bit unsigned integers. | ||
| 1106 | * @description This type is deprecated; you should use simd_ushort2 or | ||
| 1107 | * simd::ushort2 instead. */ | ||
| 1108 | typedef simd_ushort2 vector_ushort2; | ||
| 1109 | |||
| 1110 | /*! @abstract A vector of three 16-bit unsigned integers. | ||
| 1111 | * @description This type is deprecated; you should use simd_ushort3 or | ||
| 1112 | * simd::ushort3 instead. */ | ||
| 1113 | typedef simd_ushort3 vector_ushort3; | ||
| 1114 | |||
| 1115 | /*! @abstract A vector of four 16-bit unsigned integers. | ||
| 1116 | * @description This type is deprecated; you should use simd_ushort4 or | ||
| 1117 | * simd::ushort4 instead. */ | ||
| 1118 | typedef simd_ushort4 vector_ushort4; | ||
| 1119 | |||
| 1120 | /*! @abstract A vector of eight 16-bit unsigned integers. | ||
| 1121 | * @description This type is deprecated; you should use simd_ushort8 or | ||
| 1122 | * simd::ushort8 instead. */ | ||
| 1123 | typedef simd_ushort8 vector_ushort8; | ||
| 1124 | |||
| 1125 | /*! @abstract A vector of sixteen 16-bit unsigned integers. | ||
| 1126 | * @description This type is deprecated; you should use simd_ushort16 or | ||
| 1127 | * simd::ushort16 instead. */ | ||
| 1128 | typedef simd_ushort16 vector_ushort16; | ||
| 1129 | |||
| 1130 | /*! @abstract A vector of thirty-two 16-bit unsigned integers. | ||
| 1131 | * @description This type is deprecated; you should use simd_ushort32 or | ||
| 1132 | * simd::ushort32 instead. */ | ||
| 1133 | typedef simd_ushort32 vector_ushort32; | ||
| 1134 | |||
| 1135 | /*! @abstract A vector of two 32-bit signed (twos-complement) integers. | ||
| 1136 | * @description This type is deprecated; you should use simd_int2 or | ||
| 1137 | * simd::int2 instead. */ | ||
| 1138 | typedef simd_int2 vector_int2; | ||
| 1139 | |||
| 1140 | /*! @abstract A vector of three 32-bit signed (twos-complement) integers. | ||
| 1141 | * @description This type is deprecated; you should use simd_int3 or | ||
| 1142 | * simd::int3 instead. */ | ||
| 1143 | typedef simd_int3 vector_int3; | ||
| 1144 | |||
| 1145 | /*! @abstract A vector of four 32-bit signed (twos-complement) integers. | ||
| 1146 | * @description This type is deprecated; you should use simd_int4 or | ||
| 1147 | * simd::int4 instead. */ | ||
| 1148 | typedef simd_int4 vector_int4; | ||
| 1149 | |||
| 1150 | /*! @abstract A vector of eight 32-bit signed (twos-complement) integers. | ||
| 1151 | * @description This type is deprecated; you should use simd_int8 or | ||
| 1152 | * simd::int8 instead. */ | ||
| 1153 | typedef simd_int8 vector_int8; | ||
| 1154 | |||
| 1155 | /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers. | ||
| 1156 | * @description This type is deprecated; you should use simd_int16 or | ||
| 1157 | * simd::int16 instead. */ | ||
| 1158 | typedef simd_int16 vector_int16; | ||
| 1159 | |||
| 1160 | /*! @abstract A vector of two 32-bit unsigned integers. | ||
| 1161 | * @description This type is deprecated; you should use simd_uint2 or | ||
| 1162 | * simd::uint2 instead. */ | ||
| 1163 | typedef simd_uint2 vector_uint2; | ||
| 1164 | |||
| 1165 | /*! @abstract A vector of three 32-bit unsigned integers. | ||
| 1166 | * @description This type is deprecated; you should use simd_uint3 or | ||
| 1167 | * simd::uint3 instead. */ | ||
| 1168 | typedef simd_uint3 vector_uint3; | ||
| 1169 | |||
| 1170 | /*! @abstract A vector of four 32-bit unsigned integers. | ||
| 1171 | * @description This type is deprecated; you should use simd_uint4 or | ||
| 1172 | * simd::uint4 instead. */ | ||
| 1173 | typedef simd_uint4 vector_uint4; | ||
| 1174 | |||
| 1175 | /*! @abstract A vector of eight 32-bit unsigned integers. | ||
| 1176 | * @description This type is deprecated; you should use simd_uint8 or | ||
| 1177 | * simd::uint8 instead. */ | ||
| 1178 | typedef simd_uint8 vector_uint8; | ||
| 1179 | |||
| 1180 | /*! @abstract A vector of sixteen 32-bit unsigned integers. | ||
| 1181 | * @description This type is deprecated; you should use simd_uint16 or | ||
| 1182 | * simd::uint16 instead. */ | ||
| 1183 | typedef simd_uint16 vector_uint16; | ||
| 1184 | |||
| 1185 | /*! @abstract A vector of two 32-bit floating-point numbers. | ||
| 1186 | * @description This type is deprecated; you should use simd_float2 or | ||
| 1187 | * simd::float2 instead. */ | ||
| 1188 | typedef simd_float2 vector_float2; | ||
| 1189 | |||
| 1190 | /*! @abstract A vector of three 32-bit floating-point numbers. | ||
| 1191 | * @description This type is deprecated; you should use simd_float3 or | ||
| 1192 | * simd::float3 instead. */ | ||
| 1193 | typedef simd_float3 vector_float3; | ||
| 1194 | |||
| 1195 | /*! @abstract A vector of four 32-bit floating-point numbers. | ||
| 1196 | * @description This type is deprecated; you should use simd_float4 or | ||
| 1197 | * simd::float4 instead. */ | ||
| 1198 | typedef simd_float4 vector_float4; | ||
| 1199 | |||
| 1200 | /*! @abstract A vector of eight 32-bit floating-point numbers. | ||
| 1201 | * @description This type is deprecated; you should use simd_float8 or | ||
| 1202 | * simd::float8 instead. */ | ||
| 1203 | typedef simd_float8 vector_float8; | ||
| 1204 | |||
| 1205 | /*! @abstract A vector of sixteen 32-bit floating-point numbers. | ||
| 1206 | * @description This type is deprecated; you should use simd_float16 or | ||
| 1207 | * simd::float16 instead. */ | ||
| 1208 | typedef simd_float16 vector_float16; | ||
| 1209 | |||
| 1210 | /*! @abstract A scalar 64-bit signed (twos-complement) integer. | ||
| 1211 | * @description This type is deprecated; you should use simd_long1 or | ||
| 1212 | * simd::long1 instead. */ | ||
| 1213 | typedef simd_long1 vector_long1; | ||
| 1214 | |||
| 1215 | /*! @abstract A vector of two 64-bit signed (twos-complement) integers. | ||
| 1216 | * @description This type is deprecated; you should use simd_long2 or | ||
| 1217 | * simd::long2 instead. */ | ||
| 1218 | typedef simd_long2 vector_long2; | ||
| 1219 | |||
| 1220 | /*! @abstract A vector of three 64-bit signed (twos-complement) integers. | ||
| 1221 | * @description This type is deprecated; you should use simd_long3 or | ||
| 1222 | * simd::long3 instead. */ | ||
| 1223 | typedef simd_long3 vector_long3; | ||
| 1224 | |||
| 1225 | /*! @abstract A vector of four 64-bit signed (twos-complement) integers. | ||
| 1226 | * @description This type is deprecated; you should use simd_long4 or | ||
| 1227 | * simd::long4 instead. */ | ||
| 1228 | typedef simd_long4 vector_long4; | ||
| 1229 | |||
| 1230 | /*! @abstract A vector of eight 64-bit signed (twos-complement) integers. | ||
| 1231 | * @description This type is deprecated; you should use simd_long8 or | ||
| 1232 | * simd::long8 instead. */ | ||
| 1233 | typedef simd_long8 vector_long8; | ||
| 1234 | |||
| 1235 | /*! @abstract A scalar 64-bit unsigned integer. | ||
| 1236 | * @description This type is deprecated; you should use simd_ulong1 or | ||
| 1237 | * simd::ulong1 instead. */ | ||
| 1238 | typedef simd_ulong1 vector_ulong1; | ||
| 1239 | |||
| 1240 | /*! @abstract A vector of two 64-bit unsigned integers. | ||
| 1241 | * @description This type is deprecated; you should use simd_ulong2 or | ||
| 1242 | * simd::ulong2 instead. */ | ||
| 1243 | typedef simd_ulong2 vector_ulong2; | ||
| 1244 | |||
| 1245 | /*! @abstract A vector of three 64-bit unsigned integers. | ||
| 1246 | * @description This type is deprecated; you should use simd_ulong3 or | ||
| 1247 | * simd::ulong3 instead. */ | ||
| 1248 | typedef simd_ulong3 vector_ulong3; | ||
| 1249 | |||
| 1250 | /*! @abstract A vector of four 64-bit unsigned integers. | ||
| 1251 | * @description This type is deprecated; you should use simd_ulong4 or | ||
| 1252 | * simd::ulong4 instead. */ | ||
| 1253 | typedef simd_ulong4 vector_ulong4; | ||
| 1254 | |||
| 1255 | /*! @abstract A vector of eight 64-bit unsigned integers. | ||
| 1256 | * @description This type is deprecated; you should use simd_ulong8 or | ||
| 1257 | * simd::ulong8 instead. */ | ||
| 1258 | typedef simd_ulong8 vector_ulong8; | ||
| 1259 | |||
| 1260 | /*! @abstract A vector of two 64-bit floating-point numbers. | ||
| 1261 | * @description This type is deprecated; you should use simd_double2 or | ||
| 1262 | * simd::double2 instead. */ | ||
| 1263 | typedef simd_double2 vector_double2; | ||
| 1264 | |||
| 1265 | /*! @abstract A vector of three 64-bit floating-point numbers. | ||
| 1266 | * @description This type is deprecated; you should use simd_double3 or | ||
| 1267 | * simd::double3 instead. */ | ||
| 1268 | typedef simd_double3 vector_double3; | ||
| 1269 | |||
| 1270 | /*! @abstract A vector of four 64-bit floating-point numbers. | ||
| 1271 | * @description This type is deprecated; you should use simd_double4 or | ||
| 1272 | * simd::double4 instead. */ | ||
| 1273 | typedef simd_double4 vector_double4; | ||
| 1274 | |||
| 1275 | /*! @abstract A vector of eight 64-bit floating-point numbers. | ||
| 1276 | * @description This type is deprecated; you should use simd_double8 or | ||
| 1277 | * simd::double8 instead. */ | ||
| 1278 | typedef simd_double8 vector_double8; | ||
| 1279 | |||
| 1280 | # endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ | ||
| 1281 | #endif | ||
lib/libc/include/x86_64-macos-gnu/spawn.h created+187| ... | @@ -0,0 +1,187 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2006, 2010 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | |||
| 25 | #ifndef _SPAWN_H_ | ||
| 26 | #define _SPAWN_H_ | ||
| 27 | |||
| 28 | /* | ||
| 29 | * [SPN] Support for _POSIX_SPAWN | ||
| 30 | */ | ||
| 31 | |||
| 32 | #include <sys/cdefs.h> | ||
| 33 | #include <_types.h> | ||
| 34 | #include <sys/spawn.h> /* shared types */ | ||
| 35 | |||
| 36 | #include <Availability.h> | ||
| 37 | |||
| 38 | /* | ||
| 39 | * [SPN] Inclusion of the <spawn.h> header may make visible symbols defined | ||
| 40 | * in the <sched.h>, <signal.h>, and <sys/types.h> headers. | ||
| 41 | */ | ||
| 42 | #include <sys/_types/_pid_t.h> | ||
| 43 | #include <sys/_types/_sigset_t.h> | ||
| 44 | #include <sys/_types/_mode_t.h> | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Opaque types for use with posix_spawn() family functions. Internals are | ||
| 48 | * not defined, and should not be accessed directly. Types are defined as | ||
| 49 | * mandated by POSIX. | ||
| 50 | */ | ||
| 51 | typedef void *posix_spawnattr_t; | ||
| 52 | typedef void *posix_spawn_file_actions_t; | ||
| 53 | |||
| 54 | __BEGIN_DECLS | ||
| 55 | /* | ||
| 56 | * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround, | ||
| 57 | * a dummy argument name is added. | ||
| 58 | */ | ||
| 59 | |||
| 60 | int posix_spawn(pid_t * __restrict, const char * __restrict, | ||
| 61 | const posix_spawn_file_actions_t *, | ||
| 62 | const posix_spawnattr_t * __restrict, | ||
| 63 | char *const __argv[__restrict], | ||
| 64 | char *const __envp[__restrict]) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 65 | |||
| 66 | int posix_spawnp(pid_t * __restrict, const char * __restrict, | ||
| 67 | const posix_spawn_file_actions_t *, | ||
| 68 | const posix_spawnattr_t * __restrict, | ||
| 69 | char *const __argv[__restrict], | ||
| 70 | char *const __envp[__restrict]) __API_AVAILABLE(macos(10.5), ios(2.0)); | ||
| 71 | |||
| 72 | int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 73 | |||
| 74 | int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, | ||
| 75 | int) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 76 | |||
| 77 | int posix_spawn_file_actions_addopen( | ||
| 78 | 	posix_spawn_file_actions_t * __restrict, int, | ||
| 79 | 	const char * __restrict, int, mode_t) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 80 | |||
| 81 | int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 82 | |||
| 83 | int posix_spawn_file_actions_init(posix_spawn_file_actions_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 84 | |||
| 85 | int posix_spawnattr_destroy(posix_spawnattr_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 86 | |||
| 87 | int posix_spawnattr_getsigdefault(const posix_spawnattr_t * __restrict, | ||
| 88 | sigset_t * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 89 | |||
| 90 | int posix_spawnattr_getflags(const posix_spawnattr_t * __restrict, | ||
| 91 | short * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 92 | |||
| 93 | int posix_spawnattr_getpgroup(const posix_spawnattr_t * __restrict, | ||
| 94 | pid_t * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 95 | |||
| 96 | int posix_spawnattr_getsigmask(const posix_spawnattr_t * __restrict, | ||
| 97 | sigset_t * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 98 | |||
| 99 | int posix_spawnattr_init(posix_spawnattr_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 100 | |||
| 101 | int posix_spawnattr_setsigdefault(posix_spawnattr_t * __restrict, | ||
| 102 | const sigset_t * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 103 | |||
| 104 | int posix_spawnattr_setflags(posix_spawnattr_t *, short) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 105 | |||
| 106 | int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 107 | |||
| 108 | int posix_spawnattr_setsigmask(posix_spawnattr_t * __restrict, | ||
| 109 | const sigset_t * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 110 | |||
| 111 | #if 0 /* _POSIX_PRIORITY_SCHEDULING [PS] : not supported */ | ||
| 112 | int posix_spawnattr_setschedparam(posix_spawnattr_t * __restrict, | ||
| 113 | const struct sched_param * __restrict); | ||
| 114 | int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int); | ||
| 115 | int posix_spawnattr_getschedparam(const posix_spawnattr_t * __restrict, | ||
| 116 | struct sched_param * __restrict); | ||
| 117 | int posix_spawnattr_getschedpolicy(const posix_spawnattr_t * __restrict, | ||
| 118 | int * __restrict); | ||
| 119 | #endif /* 0 */ | ||
| 120 | |||
| 121 | __END_DECLS | ||
| 122 | |||
| 123 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 124 | /* | ||
| 125 | * Darwin-specific extensions below | ||
| 126 | */ | ||
| 127 | #include <mach/exception_types.h> | ||
| 128 | #include <mach/machine.h> | ||
| 129 | #include <mach/port.h> | ||
| 130 | |||
| 131 | #include <sys/_types/_size_t.h> | ||
| 132 | |||
| 133 | __BEGIN_DECLS | ||
| 134 | |||
| 135 | int posix_spawnattr_getbinpref_np(const posix_spawnattr_t * __restrict, | ||
| 136 | size_t, cpu_type_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 137 | |||
| 138 | int posix_spawnattr_getarchpref_np(const posix_spawnattr_t * __restrict, | ||
| 139 | size_t, cpu_type_t *__restrict, cpu_subtype_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(11.0), ios(14.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 140 | |||
| 141 | int posix_spawnattr_setauditsessionport_np(posix_spawnattr_t * __restrict, | ||
| 142 | mach_port_t) __API_AVAILABLE(macos(10.6), ios(3.2)); | ||
| 143 | |||
| 144 | int posix_spawnattr_setbinpref_np(posix_spawnattr_t * __restrict, | ||
| 145 | size_t, cpu_type_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 146 | |||
| 147 | int posix_spawnattr_setarchpref_np(posix_spawnattr_t * __restrict, | ||
| 148 | size_t, cpu_type_t *__restrict, cpu_subtype_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(11.0), ios(14.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 149 | |||
| 150 | int posix_spawnattr_setexceptionports_np(posix_spawnattr_t * __restrict, | ||
| 151 | exception_mask_t, mach_port_t, | ||
| 152 | exception_behavior_t, thread_state_flavor_t) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 153 | |||
| 154 | int posix_spawnattr_setspecialport_np(posix_spawnattr_t * __restrict, | ||
| 155 | mach_port_t, int) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); | ||
| 156 | |||
| 157 | int posix_spawnattr_setsuidcredport_np(posix_spawnattr_t * __restrict, mach_port_t) __API_UNAVAILABLE(ios, macos); | ||
| 158 | |||
| 159 | int posix_spawnattr_setnosmt_np(const posix_spawnattr_t * __restrict attr) __API_AVAILABLE(macos(11.0)); | ||
| 160 | |||
| 161 | /* | ||
| 162 | * Set CPU Security Mitigation on the spawned process | ||
| 163 | * This attribute affects all threads and is inherited on fork and exec | ||
| 164 | */ | ||
| 165 | int posix_spawnattr_set_csm_np(const posix_spawnattr_t * __restrict attr, uint32_t flags) __API_AVAILABLE(macos(11.0)); | ||
| 166 | /* | ||
| 167 | * flags for CPU Security Mitigation attribute | ||
| 168 | * POSIX_SPAWN_NP_CSM_ALL should be used in most cases, | ||
| 169 | * the individual flags are provided only for performance evaluation etc | ||
| 170 | */ | ||
| 171 | #define POSIX_SPAWN_NP_CSM_ALL 0x0001 | ||
| 172 | #define POSIX_SPAWN_NP_CSM_NOSMT 0x0002 | ||
| 173 | #define POSIX_SPAWN_NP_CSM_TECS 0x0004 | ||
| 174 | |||
| 175 | int posix_spawn_file_actions_addinherit_np(posix_spawn_file_actions_t *, | ||
| 176 | int) __API_AVAILABLE(macos(10.7), ios(4.3)) __API_UNAVAILABLE(watchos, tvos); | ||
| 177 | |||
| 178 | int posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *, | ||
| 179 | const char * __restrict) __API_AVAILABLE(macos(10.15)) __API_UNAVAILABLE(ios, tvos, watchos); | ||
| 180 | |||
| 181 | int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *, | ||
| 182 | int) __API_AVAILABLE(macos(10.15)) __API_UNAVAILABLE(ios, tvos, watchos); | ||
| 183 | |||
| 184 | __END_DECLS | ||
| 185 | |||
| 186 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 187 | #endif /* _SPAWN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/stdint.h-9| ... | @@ -3,15 +3,6 @@ | ... | @@ -3,15 +3,6 @@ |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | /* | ||
| 7 | * Note from the Zig project: | ||
| 8 | * | ||
| 9 | * Apple released their libc as a whole under the APSL 2.0 license [1], which | ||
| 10 | * includes this file. Therefore, this file is governed by the APSL 2.0 license. | ||
| 11 | * | ||
| 12 | * [1]: https://opensource.apple.com/source/Libc/Libc-1353.100.2/ | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _STDINT_H_ | 6 | #ifndef _STDINT_H_ |
| 16 | #define _STDINT_H_ | 7 | #define _STDINT_H_ |
| 17 | 8 |
lib/libc/include/x86_64-macos-gnu/stdio.h+1-1| ... | @@ -217,7 +217,7 @@ __END_DECLS | ... | @@ -217,7 +217,7 @@ __END_DECLS |
| 217 | /* Additional functionality provided by: | 217 | /* Additional functionality provided by: |
| 218 | * POSIX.2-1992 C Language Binding Option | 218 | * POSIX.2-1992 C Language Binding Option |
| 219 | */ | 219 | */ |
| 220 | #if TARGET_OS_EMBEDDED | 220 | #if TARGET_OS_IPHONE |
| 221 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) | 221 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) |
| 222 | #else | 222 | #else |
| 223 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) | 223 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) |
lib/libc/include/x86_64-macos-gnu/stdlib.h+4-1| ... | @@ -178,7 +178,7 @@ unsigned long long | ... | @@ -178,7 +178,7 @@ unsigned long long |
| 178 | 	 strtoull(const char *__str, char **__endptr, int __base); | 178 | 	 strtoull(const char *__str, char **__endptr, int __base); |
| 179 | #endif /* !__DARWIN_NO_LONG_LONG */ | 179 | #endif /* !__DARWIN_NO_LONG_LONG */ |
| 180 | 180 | ||
| 181 | #if TARGET_OS_EMBEDDED | 181 | #if TARGET_OS_IPHONE |
| 182 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) | 182 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) |
| 183 | #else | 183 | #else |
| 184 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) | 184 | #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) |
| ... | @@ -347,6 +347,9 @@ int	 sradixsort(const unsigned char **__base, int __nel, const unsigned char *__ | ... | @@ -347,6 +347,9 @@ int	 sradixsort(const unsigned char **__base, int __nel, const unsigned char *__ |
| 347 | void	 sranddev(void); | 347 | void	 sranddev(void); |
| 348 | void	 srandomdev(void); | 348 | void	 srandomdev(void); |
| 349 | void	*reallocf(void *__ptr, size_t __size) __alloc_size(2); | 349 | void	*reallocf(void *__ptr, size_t __size) __alloc_size(2); |
| 350 | long long | ||
| 351 | 	strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp) | ||
| 352 | 	__API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)); | ||
| 350 | #if !__DARWIN_NO_LONG_LONG | 353 | #if !__DARWIN_NO_LONG_LONG |
| 351 | long long | 354 | long long |
| 352 | 	 strtoq(const char *__str, char **__endptr, int __base); | 355 | 	 strtoq(const char *__str, char **__endptr, int __base); |
lib/libc/include/x86_64-macos-gnu/string.h+4| ... | @@ -170,6 +170,10 @@ void	 swab(const void * __restrict, void * __restrict, ssize_t); | ... | @@ -170,6 +170,10 @@ void	 swab(const void * __restrict, void * __restrict, ssize_t); |
| 170 | __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) | 170 | __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) |
| 171 | __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1) | 171 | __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1) |
| 172 | int	timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); | 172 | int	timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); |
| 173 | |||
| 174 | __OSX_AVAILABLE(11.0) __IOS_AVAILABLE(14.0) | ||
| 175 | __TVOS_AVAILABLE(14.0) __WATCHOS_AVAILABLE(7.0) | ||
| 176 | int 	 strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen); | ||
| 173 | __END_DECLS | 177 | __END_DECLS |
| 174 | 178 | ||
| 175 | /* Some functions historically defined in string.h were placed in strings.h | 179 | /* Some functions historically defined in string.h were placed in strings.h |
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_attr_t.h+6-6| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
| 5 | * | 5 | * |
| 6 | * This file contains Original Code and/or Modifications of Original Code | 6 | * This file contains Original Code and/or Modifications of Original Code |
| 7 | * as defined in and that are subject to the Apple Public Source License | 7 | * as defined in and that are subject to the Apple Public Source License |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | 8 | * Version 2.0 (the 'License'). You may not use this file except in |
| ... | @@ -11,10 +11,10 @@ | ... | @@ -11,10 +11,10 @@ |
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | 11 | * unlawful or unlicensed copies of an Apple operating system, or to |
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | 12 | * circumvent, violate, or enable the circumvention or violation of, any |
| 13 | * terms of an Apple operating system software license agreement. | 13 | * terms of an Apple operating system software license agreement. |
| 14 | * | 14 | * |
| 15 | * Please obtain a copy of the License at | 15 | * Please obtain a copy of the License at |
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. |
| 17 | * | 17 | * |
| 18 | * The Original Code and all software distributed under the License are | 18 | * The Original Code and all software distributed under the License are |
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
| ... | @@ -22,11 +22,11 @@ | ... | @@ -22,11 +22,11 @@ |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
| 23 | * Please see the License for the specific language governing rights and | 23 | * Please see the License for the specific language governing rights and |
| 24 | * limitations under the License. | 24 | * limitations under the License. |
| 25 | * | 25 | * |
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
| 27 | */ | 27 | */ |
| 28 | #ifndef _PTHREAD_ATTR_T | 28 | #ifndef _PTHREAD_ATTR_T |
| 29 | #define _PTHREAD_ATTR_T | 29 | #define _PTHREAD_ATTR_T |
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_attr_t */ | 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_attr_t */ |
| 31 | typedef __darwin_pthread_attr_t pthread_attr_t; | 31 | typedef __darwin_pthread_attr_t pthread_attr_t; |
| 32 | #endif /* _PTHREAD_ATTR_T */ | 32 | #endif /* _PTHREAD_ATTR_T */ |
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_cond_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_COND_T | ||
| 29 | #define _PTHREAD_COND_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_cond_t */ | ||
| 31 | typedef __darwin_pthread_cond_t pthread_cond_t; | ||
| 32 | #endif /* _PTHREAD_COND_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_condattr_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_CONDATTR_T | ||
| 29 | #define _PTHREAD_CONDATTR_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_condattr_t */ | ||
| 31 | typedef __darwin_pthread_condattr_t pthread_condattr_t; | ||
| 32 | #endif /* _PTHREAD_CONDATTR_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_key_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_KEY_T | ||
| 29 | #define _PTHREAD_KEY_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_key_t */ | ||
| 31 | typedef __darwin_pthread_key_t pthread_key_t; | ||
| 32 | #endif /* _PTHREAD_KEY_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_mutex_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_MUTEX_T | ||
| 29 | #define _PTHREAD_MUTEX_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_mutex_t */ | ||
| 31 | typedef __darwin_pthread_mutex_t pthread_mutex_t; | ||
| 32 | #endif /*_PTHREAD_MUTEX_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_mutexattr_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_MUTEXATTR_T | ||
| 29 | #define _PTHREAD_MUTEXATTR_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_mutexattr_t */ | ||
| 31 | typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t; | ||
| 32 | #endif /* _PTHREAD_MUTEXATTR_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_once_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_ONCE_T | ||
| 29 | #define _PTHREAD_ONCE_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_once_t */ | ||
| 31 | typedef __darwin_pthread_once_t pthread_once_t; | ||
| 32 | #endif /* _PTHREAD_ONCE_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_RWLOCK_T | ||
| 29 | #define _PTHREAD_RWLOCK_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_rwlock_t */ | ||
| 31 | typedef __darwin_pthread_rwlock_t pthread_rwlock_t; | ||
| 32 | #endif /* _PTHREAD_RWLOCK_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _PTHREAD_RWLOCKATTR_T | ||
| 29 | #define _PTHREAD_RWLOCKATTR_T | ||
| 30 | #include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_rwlockattr_t */ | ||
| 31 | typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t; | ||
| 32 | #endif /* _PTHREAD_RWLOCKATTR_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_t.h+4-4| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
| 5 | * | 5 | * |
| 6 | * This file contains Original Code and/or Modifications of Original Code | 6 | * This file contains Original Code and/or Modifications of Original Code |
| 7 | * as defined in and that are subject to the Apple Public Source License | 7 | * as defined in and that are subject to the Apple Public Source License |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | 8 | * Version 2.0 (the 'License'). You may not use this file except in |
| ... | @@ -11,10 +11,10 @@ | ... | @@ -11,10 +11,10 @@ |
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | 11 | * unlawful or unlicensed copies of an Apple operating system, or to |
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | 12 | * circumvent, violate, or enable the circumvention or violation of, any |
| 13 | * terms of an Apple operating system software license agreement. | 13 | * terms of an Apple operating system software license agreement. |
| 14 | * | 14 | * |
| 15 | * Please obtain a copy of the License at | 15 | * Please obtain a copy of the License at |
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. |
| 17 | * | 17 | * |
| 18 | * The Original Code and all software distributed under the License are | 18 | * The Original Code and all software distributed under the License are |
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
| ... | @@ -22,7 +22,7 @@ | ... | @@ -22,7 +22,7 @@ |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
| 23 | * Please see the License for the specific language governing rights and | 23 | * Please see the License for the specific language governing rights and |
| 24 | * limitations under the License. | 24 | * limitations under the License. |
| 25 | * | 25 | * |
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
| 27 | */ | 27 | */ |
| 28 | #ifndef _PTHREAD_T | 28 | #ifndef _PTHREAD_T |
lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_types.h+4-4| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * Copyright (c) 2003-2013 Apple Inc. All rights reserved. | 2 | * Copyright (c) 2003-2013 Apple Inc. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
| 5 | * | 5 | * |
| 6 | * This file contains Original Code and/or Modifications of Original Code | 6 | * This file contains Original Code and/or Modifications of Original Code |
| 7 | * as defined in and that are subject to the Apple Public Source License | 7 | * as defined in and that are subject to the Apple Public Source License |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | 8 | * Version 2.0 (the 'License'). You may not use this file except in |
| ... | @@ -11,10 +11,10 @@ | ... | @@ -11,10 +11,10 @@ |
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | 11 | * unlawful or unlicensed copies of an Apple operating system, or to |
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | 12 | * circumvent, violate, or enable the circumvention or violation of, any |
| 13 | * terms of an Apple operating system software license agreement. | 13 | * terms of an Apple operating system software license agreement. |
| 14 | * | 14 | * |
| 15 | * Please obtain a copy of the License at | 15 | * Please obtain a copy of the License at |
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. |
| 17 | * | 17 | * |
| 18 | * The Original Code and all software distributed under the License are | 18 | * The Original Code and all software distributed under the License are |
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
| ... | @@ -22,7 +22,7 @@ | ... | @@ -22,7 +22,7 @@ |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
| 23 | * Please see the License for the specific language governing rights and | 23 | * Please see the License for the specific language governing rights and |
| 24 | * limitations under the License. | 24 | * limitations under the License. |
| 25 | * | 25 | * |
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
| 27 | */ | 27 | */ |
| 28 | 28 |
lib/libc/include/x86_64-macos-gnu/sys/_select.h created+57| ... | @@ -0,0 +1,57 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, 2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * This is called from sys/select.h and sys/time.h for the common prototype | ||
| 31 | * of select(). Setting _DARWIN_C_SOURCE or _DARWIN_UNLIMITED_SELECT uses | ||
| 32 | * the version of select() that does not place a limit on the first argument | ||
| 33 | * (nfds). In the UNIX conformance case, values of nfds greater than | ||
| 34 | * FD_SETSIZE will return an error of EINVAL. | ||
| 35 | */ | ||
| 36 | #ifndef _SYS__SELECT_H_ | ||
| 37 | #define _SYS__SELECT_H_ | ||
| 38 | |||
| 39 | #include <sys/cdefs.h> /* __DARWIN_EXTSN_C, __DARWIN_1050, __DARWIN_ALIAS_C */ | ||
| 40 | #include <sys/_types/_fd_def.h> /* fd_set */ | ||
| 41 | #include <sys/_types/_timeval.h> /* struct timeval */ | ||
| 42 | |||
| 43 | int select(int, fd_set * __restrict, fd_set * __restrict, | ||
| 44 | fd_set * __restrict, struct timeval * __restrict) | ||
| 45 | |||
| 46 | #if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) | ||
| 47 | __DARWIN_EXTSN_C(select) | ||
| 48 | #else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ | ||
| 49 | # if defined(__LP64__) && !__DARWIN_NON_CANCELABLE | ||
| 50 | __DARWIN_1050(select) | ||
| 51 | # else /* !__LP64__ || __DARWIN_NON_CANCELABLE */ | ||
| 52 | __DARWIN_ALIAS_C(select) | ||
| 53 | # endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */ | ||
| 54 | #endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */ | ||
| 55 | ; | ||
| 56 | |||
| 57 | #endif /* !_SYS__SELECT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_symbol_aliasing.h+36| ... | @@ -305,6 +305,30 @@ | ... | @@ -305,6 +305,30 @@ |
| 305 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_6(x) | 305 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_6(x) |
| 306 | #endif | 306 | #endif |
| 307 | 307 | ||
| 308 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130700 | ||
| 309 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_7(x) x | ||
| 310 | #else | ||
| 311 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_7(x) | ||
| 312 | #endif | ||
| 313 | |||
| 314 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140000 | ||
| 315 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_0(x) x | ||
| 316 | #else | ||
| 317 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_0(x) | ||
| 318 | #endif | ||
| 319 | |||
| 320 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140100 | ||
| 321 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_1(x) x | ||
| 322 | #else | ||
| 323 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_1(x) | ||
| 324 | #endif | ||
| 325 | |||
| 326 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140200 | ||
| 327 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_2(x) x | ||
| 328 | #else | ||
| 329 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_2(x) | ||
| 330 | #endif | ||
| 331 | |||
| 308 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000 | 332 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000 |
| 309 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x | 333 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x |
| 310 | #else | 334 | #else |
| ... | @@ -497,3 +521,15 @@ | ... | @@ -497,3 +521,15 @@ |
| 497 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15_1(x) | 521 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15_1(x) |
| 498 | #endif | 522 | #endif |
| 499 | 523 | ||
| 524 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101600 | ||
| 525 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_16(x) x | ||
| 526 | #else | ||
| 527 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_16(x) | ||
| 528 | #endif | ||
| 529 | |||
| 530 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 110000 | ||
| 531 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_11_0(x) x | ||
| 532 | #else | ||
| 533 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_11_0(x) | ||
| 534 | #endif | ||
| 535 |
lib/libc/include/x86_64-macos-gnu/sys/_types/_blkcnt_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _BLKCNT_T | ||
| 29 | #define _BLKCNT_T | ||
| 30 | #include <sys/_types.h> /* __darwin_blkcnt_t */ | ||
| 31 | typedef __darwin_blkcnt_t blkcnt_t; | ||
| 32 | #endif /* _BLKCNT_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_blksize_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _BLKSIZE_T | ||
| 29 | #define _BLKSIZE_T | ||
| 30 | #include <sys/_types.h> /* __darwin_blksize_t */ | ||
| 31 | typedef __darwin_blksize_t blksize_t; | ||
| 32 | #endif /* _BLKSIZE_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_caddr_t.h created+31| ... | @@ -0,0 +1,31 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _CADDR_T | ||
| 29 | #define _CADDR_T | ||
| 30 | typedef char * caddr_t; | ||
| 31 | #endif /* _CADDR_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_clr.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef FD_CLR | ||
| 29 | #define FD_CLR(n, p) __DARWIN_FD_CLR(n, p) | ||
| 30 | #endif /* FD_CLR */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_copy.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef FD_COPY | ||
| 29 | #define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) | ||
| 30 | #endif /* FD_COPY */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_def.h created+121| ... | @@ -0,0 +1,121 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _FD_SET | ||
| 29 | #define _FD_SET | ||
| 30 | |||
| 31 | #include <machine/types.h> /* __int32_t and uintptr_t */ | ||
| 32 | #include <Availability.h> | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Select uses bit masks of file descriptors in longs. These macros | ||
| 36 | * manipulate such bit fields (the filesystem macros use chars). The | ||
| 37 | * extra protection here is to permit application redefinition above | ||
| 38 | * the default size. | ||
| 39 | */ | ||
| 40 | #ifdef FD_SETSIZE | ||
| 41 | #define __DARWIN_FD_SETSIZE FD_SETSIZE | ||
| 42 | #else /* !FD_SETSIZE */ | ||
| 43 | #define __DARWIN_FD_SETSIZE 1024 | ||
| 44 | #endif /* FD_SETSIZE */ | ||
| 45 | #define __DARWIN_NBBY 8 /* bits in a byte */ | ||
| 46 | #define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY) /* bits per mask */ | ||
| 47 | #define __DARWIN_howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) /* # y's == x bits? */ | ||
| 48 | |||
| 49 | __BEGIN_DECLS | ||
| 50 | typedef struct fd_set { | ||
| 51 | 	__int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)]; | ||
| 52 | } fd_set; | ||
| 53 | |||
| 54 | int __darwin_check_fd_set_overflow(int, const void *, int) __API_AVAILABLE(macosx(11.0), ios(14.0), tvos(14.0), watchos(7.0)); | ||
| 55 | __END_DECLS | ||
| 56 | |||
| 57 | __header_always_inline int | ||
| 58 | __darwin_check_fd_set(int _a, const void *_b) | ||
| 59 | { | ||
| 60 | #ifdef __clang__ | ||
| 61 | #pragma clang diagnostic push | ||
| 62 | #pragma clang diagnostic ignored "-Wunguarded-availability-new" | ||
| 63 | #endif | ||
| 64 | 	if ((uintptr_t)&__darwin_check_fd_set_overflow != (uintptr_t) 0) { | ||
| 65 | #if defined(_DARWIN_UNLIMITED_SELECT) || defined(_DARWIN_C_SOURCE) | ||
| 66 | 		return __darwin_check_fd_set_overflow(_a, _b, 1); | ||
| 67 | #else | ||
| 68 | 		return __darwin_check_fd_set_overflow(_a, _b, 0); | ||
| 69 | #endif | ||
| 70 | 	} else { | ||
| 71 | 		return 1; | ||
| 72 | 	} | ||
| 73 | #ifdef __clang__ | ||
| 74 | #pragma clang diagnostic pop | ||
| 75 | #endif | ||
| 76 | } | ||
| 77 | |||
| 78 | /* This inline avoids argument side-effect issues with FD_ISSET() */ | ||
| 79 | __header_always_inline int | ||
| 80 | __darwin_fd_isset(int _fd, const struct fd_set *_p) | ||
| 81 | { | ||
| 82 | 	if (__darwin_check_fd_set(_fd, (const void *) _p)) { | ||
| 83 | 		return _p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] & ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS))); | ||
| 84 | 	} | ||
| 85 | |||
| 86 | 	return 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | __header_always_inline void | ||
| 90 | __darwin_fd_set(int _fd, struct fd_set *const _p) | ||
| 91 | { | ||
| 92 | 	if (__darwin_check_fd_set(_fd, (const void *) _p)) { | ||
| 93 | 		(_p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] |= ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)))); | ||
| 94 | 	} | ||
| 95 | } | ||
| 96 | |||
| 97 | __header_always_inline void | ||
| 98 | __darwin_fd_clr(int _fd, struct fd_set *const _p) | ||
| 99 | { | ||
| 100 | 	if (__darwin_check_fd_set(_fd, (const void *) _p)) { | ||
| 101 | 		(_p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] &= ~((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)))); | ||
| 102 | 	} | ||
| 103 | } | ||
| 104 | |||
| 105 | |||
| 106 | #define __DARWIN_FD_SET(n, p) __darwin_fd_set((n), (p)) | ||
| 107 | #define __DARWIN_FD_CLR(n, p) __darwin_fd_clr((n), (p)) | ||
| 108 | #define __DARWIN_FD_ISSET(n, p) __darwin_fd_isset((n), (p)) | ||
| 109 | |||
| 110 | #if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3 | ||
| 111 | /* | ||
| 112 | * Use the built-in bzero function instead of the library version so that | ||
| 113 | * we do not pollute the namespace or introduce prototype warnings. | ||
| 114 | */ | ||
| 115 | #define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p))) | ||
| 116 | #else | ||
| 117 | #define __DARWIN_FD_ZERO(p) bzero(p, sizeof(*(p))) | ||
| 118 | #endif | ||
| 119 | |||
| 120 | #define __DARWIN_FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) | ||
| 121 | #endif /* _FD_SET */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_isset.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef FD_ISSET | ||
| 29 | #define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) | ||
| 30 | #endif /* FD_ISSET */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_set.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef FD_SET | ||
| 29 | #define FD_SET(n, p) __DARWIN_FD_SET(n, p) | ||
| 30 | #endif /* FD_SET */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_setsize.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef FD_SETSIZE | ||
| 29 | #define FD_SETSIZE __DARWIN_FD_SETSIZE | ||
| 30 | #endif /* FD_SETSIZE */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_zero.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef FD_ZERO | ||
| 29 | #define FD_ZERO(p) __DARWIN_FD_ZERO(p) | ||
| 30 | #endif /* FD_ZERO */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_filesec_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _FILESEC_T | ||
| 29 | #define _FILESEC_T | ||
| 30 | struct _filesec; | ||
| 31 | typedef struct _filesec *filesec_t; | ||
| 32 | #endif /* _FILESEC_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fsblkcnt_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _FSBLKCNT_T | ||
| 29 | #define _FSBLKCNT_T | ||
| 30 | #include <sys/_types.h> /* __darwin_fsblkcnt_t */ | ||
| 31 | typedef __darwin_fsblkcnt_t fsblkcnt_t; | ||
| 32 | #endif /* _FSBLKCNT_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fsfilcnt_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _FSFILCNT_T | ||
| 29 | #define _FSFILCNT_T | ||
| 30 | #include <sys/_types.h> /* __darwin_fsfilcnt_t */ | ||
| 31 | typedef __darwin_fsfilcnt_t fsfilcnt_t; | ||
| 32 | #endif /* _FSFILCNT_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fsid_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _FSID_T | ||
| 29 | #define _FSID_T | ||
| 30 | #include <sys/_types/_int32_t.h> /* int32_t */ | ||
| 31 | typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */ | ||
| 32 | #endif /* _FSID_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_fsobj_id_t.h created+38| ... | @@ -0,0 +1,38 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2016 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _FSOBJ_ID_T | ||
| 29 | #define _FSOBJ_ID_T | ||
| 30 | |||
| 31 | #include <sys/_types/_u_int32_t.h> /* u_int32_t */ | ||
| 32 | |||
| 33 | typedef struct fsobj_id { | ||
| 34 | 	u_int32_t fid_objno; | ||
| 35 | 	u_int32_t fid_generation; | ||
| 36 | } fsobj_id_t; | ||
| 37 | |||
| 38 | #endif /* _FSOBJ_ID_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_gid_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _GID_T | ||
| 29 | #define _GID_T | ||
| 30 | #include <sys/_types.h> /* __darwin_gid_t */ | ||
| 31 | typedef __darwin_gid_t gid_t; | ||
| 32 | #endif | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_guid_t.h created+37| ... | @@ -0,0 +1,37 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _KAUTH_GUID | ||
| 29 | #define _KAUTH_GUID | ||
| 30 | /* Apple-style globally unique identifier */ | ||
| 31 | typedef union { | ||
| 32 | #define KAUTH_GUID_SIZE 16 /* 128-bit identifier */ | ||
| 33 | 	unsigned char g_guid[KAUTH_GUID_SIZE]; | ||
| 34 | 	unsigned int g_guid_asint[KAUTH_GUID_SIZE / sizeof(unsigned int)]; | ||
| 35 | } guid_t; | ||
| 36 | #define _GUID_T | ||
| 37 | #endif /* _KAUTH_GUID */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_in_addr_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _IN_ADDR_T | ||
| 29 | #define _IN_ADDR_T | ||
| 30 | #include <machine/types.h> /* __uint32_t */ | ||
| 31 | typedef __uint32_t in_addr_t; /* base type for internet address */ | ||
| 32 | #endif /* _IN_ADDR_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_in_port_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _IN_PORT_T | ||
| 29 | #define _IN_PORT_T | ||
| 30 | #include <machine/types.h> /* __uint16_t */ | ||
| 31 | typedef __uint16_t in_port_t; | ||
| 32 | #endif /* _IN_PORT_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_ino64_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _INO64_T | ||
| 29 | #define _INO64_T | ||
| 30 | #include <sys/_types.h> /* __darwin_ino64_t */ | ||
| 31 | typedef __darwin_ino64_t ino64_t; /* 64bit inode number */ | ||
| 32 | #endif /* _INO64_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_ino_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _INO_T | ||
| 29 | #define _INO_T | ||
| 30 | #include <sys/_types.h> /* __darwin_ino_t */ | ||
| 31 | typedef __darwin_ino_t ino_t; /* inode number */ | ||
| 32 | #endif /* _INO_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_int8_t.h+1-1| ... | @@ -27,5 +27,5 @@ | ... | @@ -27,5 +27,5 @@ |
| 27 | */ | 27 | */ |
| 28 | #ifndef _INT8_T | 28 | #ifndef _INT8_T |
| 29 | #define _INT8_T | 29 | #define _INT8_T |
| 30 | typedef __signed char int8_t; | 30 | typedef signed char int8_t; |
| 31 | #endif /* _INT8_T */ | 31 | #endif /* _INT8_T */ |
lib/libc/include/x86_64-macos-gnu/sys/_types/_iovec_t.h created+35| ... | @@ -0,0 +1,35 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _STRUCT_IOVEC | ||
| 29 | #define _STRUCT_IOVEC | ||
| 30 | #include <sys/_types/_size_t.h> /* size_t */ | ||
| 31 | struct iovec { | ||
| 32 | 	void * iov_base; /* [XSI] Base address of I/O memory region */ | ||
| 33 | 	size_t iov_len; /* [XSI] Size of region iov_base points to */ | ||
| 34 | }; | ||
| 35 | #endif /* _STRUCT_IOVEC */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_key_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _KEY_T | ||
| 29 | #define _KEY_T | ||
| 30 | #include <machine/types.h> /* __int32_t */ | ||
| 31 | typedef __int32_t key_t; /* IPC key (for Sys V IPC) */ | ||
| 32 | #endif /* _KEY_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_mach_port_t.h created+51| ... | @@ -0,0 +1,51 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | *	mach_port_t - a named port right | ||
| 31 | * | ||
| 32 | *	In user-space, "rights" are represented by the name of the | ||
| 33 | *	right in the Mach port namespace. Even so, this type is | ||
| 34 | *	presented as a unique one to more clearly denote the presence | ||
| 35 | *	of a right coming along with the name. | ||
| 36 | * | ||
| 37 | *	Often, various rights for a port held in a single name space | ||
| 38 | *	will coalesce and are, therefore, be identified by a single name | ||
| 39 | *	[this is the case for send and receive rights]. But not | ||
| 40 | *	always [send-once rights currently get a unique name for | ||
| 41 | *	each right]. | ||
| 42 | * | ||
| 43 | *	This definition of mach_port_t is only for user-space. | ||
| 44 | * | ||
| 45 | */ | ||
| 46 | |||
| 47 | #ifndef _MACH_PORT_T | ||
| 48 | #define _MACH_PORT_T | ||
| 49 | #include <sys/_types.h> /* __darwin_mach_port_t */ | ||
| 50 | typedef __darwin_mach_port_t mach_port_t; | ||
| 51 | #endif /* _MACH_PORT_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_nlink_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _NLINK_T | ||
| 29 | #define _NLINK_T | ||
| 30 | #include <machine/types.h> /* __uint16_t */ | ||
| 31 | typedef __uint16_t nlink_t; /* link count */ | ||
| 32 | #endif /* _NLINK_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_o_dsync.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef O_DSYNC | ||
| 29 | #define O_DSYNC 0x400000 /* synch I/O data integrity */ | ||
| 30 | #endif /* O_DSYNC */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_o_sync.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef O_SYNC | ||
| 29 | #define O_SYNC 0x0080 /* synch I/O file integrity */ | ||
| 30 | #endif /* O_SYNC */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_os_inline.h created+34| ... | @@ -0,0 +1,34 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #if !defined(OS_INLINE) | ||
| 29 | # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | ||
| 30 | # define OS_INLINE static inline | ||
| 31 | # else | ||
| 32 | # define OS_INLINE static __inline__ | ||
| 33 | # endif | ||
| 34 | #endif /* OS_INLINE */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_posix_vdisable.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _POSIX_VDISABLE | ||
| 29 | #define _POSIX_VDISABLE ((unsigned char)'\377') | ||
| 30 | #endif /* POSIX_VDISABLE */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_s_ifmt.h created+74| ... | @@ -0,0 +1,74 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * [XSI] The symbolic names for file modes for use as values of mode_t | ||
| 31 | * shall be defined as described in <sys/stat.h> | ||
| 32 | */ | ||
| 33 | #ifndef S_IFMT | ||
| 34 | /* File type */ | ||
| 35 | #define S_IFMT 0170000 /* [XSI] type of file mask */ | ||
| 36 | #define S_IFIFO 0010000 /* [XSI] named pipe (fifo) */ | ||
| 37 | #define S_IFCHR 0020000 /* [XSI] character special */ | ||
| 38 | #define S_IFDIR 0040000 /* [XSI] directory */ | ||
| 39 | #define S_IFBLK 0060000 /* [XSI] block special */ | ||
| 40 | #define S_IFREG 0100000 /* [XSI] regular */ | ||
| 41 | #define S_IFLNK 0120000 /* [XSI] symbolic link */ | ||
| 42 | #define S_IFSOCK 0140000 /* [XSI] socket */ | ||
| 43 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 44 | #define S_IFWHT 0160000 /* OBSOLETE: whiteout */ | ||
| 45 | #endif | ||
| 46 | |||
| 47 | /* File mode */ | ||
| 48 | /* Read, write, execute/search by owner */ | ||
| 49 | #define S_IRWXU 0000700 /* [XSI] RWX mask for owner */ | ||
| 50 | #define S_IRUSR 0000400 /* [XSI] R for owner */ | ||
| 51 | #define S_IWUSR 0000200 /* [XSI] W for owner */ | ||
| 52 | #define S_IXUSR 0000100 /* [XSI] X for owner */ | ||
| 53 | /* Read, write, execute/search by group */ | ||
| 54 | #define S_IRWXG 0000070 /* [XSI] RWX mask for group */ | ||
| 55 | #define S_IRGRP 0000040 /* [XSI] R for group */ | ||
| 56 | #define S_IWGRP 0000020 /* [XSI] W for group */ | ||
| 57 | #define S_IXGRP 0000010 /* [XSI] X for group */ | ||
| 58 | /* Read, write, execute/search by others */ | ||
| 59 | #define S_IRWXO 0000007 /* [XSI] RWX mask for other */ | ||
| 60 | #define S_IROTH 0000004 /* [XSI] R for other */ | ||
| 61 | #define S_IWOTH 0000002 /* [XSI] W for other */ | ||
| 62 | #define S_IXOTH 0000001 /* [XSI] X for other */ | ||
| 63 | |||
| 64 | #define S_ISUID 0004000 /* [XSI] set user id on execution */ | ||
| 65 | #define S_ISGID 0002000 /* [XSI] set group id on execution */ | ||
| 66 | #define S_ISVTX 0001000 /* [XSI] directory restrcted delete */ | ||
| 67 | |||
| 68 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 69 | #define S_ISTXT S_ISVTX /* sticky bit: not supported */ | ||
| 70 | #define S_IREAD S_IRUSR /* backward compatability */ | ||
| 71 | #define S_IWRITE S_IWUSR /* backward compatability */ | ||
| 72 | #define S_IEXEC S_IXUSR /* backward compatability */ | ||
| 73 | #endif | ||
| 74 | #endif /* !S_IFMT */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_sa_family_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _SA_FAMILY_T | ||
| 29 | #define _SA_FAMILY_T | ||
| 30 | #include <machine/types.h> /* __uint8_t */ | ||
| 31 | typedef __uint8_t sa_family_t; | ||
| 32 | #endif /* _SA_FAMILY_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_seek_set.h created+46| ... | @@ -0,0 +1,46 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #include <sys/cdefs.h> | ||
| 30 | |||
| 31 | /* whence values for lseek(2) */ | ||
| 32 | #ifndef SEEK_SET | ||
| 33 | #define SEEK_SET 0 /* set file offset to offset */ | ||
| 34 | #define SEEK_CUR 1 /* set file offset to current plus offset */ | ||
| 35 | #define SEEK_END 2 /* set file offset to EOF plus offset */ | ||
| 36 | #endif /* !SEEK_SET */ | ||
| 37 | |||
| 38 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 39 | #ifndef SEEK_HOLE | ||
| 40 | #define SEEK_HOLE 3 /* set file offset to the start of the next hole greater than or equal to the supplied offset */ | ||
| 41 | #endif | ||
| 42 | |||
| 43 | #ifndef SEEK_DATA | ||
| 44 | #define SEEK_DATA 4 /* set file offset to the start of the next non-hole file region greater than or equal to the supplied offset */ | ||
| 45 | #endif | ||
| 46 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_socklen_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _SOCKLEN_T | ||
| 29 | #define _SOCKLEN_T | ||
| 30 | #include <machine/types.h> /* __darwin_socklen_t */ | ||
| 31 | typedef __darwin_socklen_t socklen_t; | ||
| 32 | #endif | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_suseconds_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _SUSECONDS_T | ||
| 29 | #define _SUSECONDS_T | ||
| 30 | #include <sys/_types.h> /* __darwin_suseconds_t */ | ||
| 31 | typedef __darwin_suseconds_t suseconds_t; | ||
| 32 | #endif /* _SUSECONDS_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_timeval32.h created+38| ... | @@ -0,0 +1,38 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _STRUCT_TIMEVAL32 | ||
| 29 | #define _STRUCT_TIMEVAL32 struct timeval32 | ||
| 30 | |||
| 31 | #include <machine/types.h> /* __int32_t */ | ||
| 32 | |||
| 33 | _STRUCT_TIMEVAL32 | ||
| 34 | { | ||
| 35 | 	__int32_t tv_sec; /* seconds */ | ||
| 36 | 	__int32_t tv_usec; /* and microseconds */ | ||
| 37 | }; | ||
| 38 | #endif /* _STRUCT_TIMEVAL32 */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_timeval64.h created+38| ... | @@ -0,0 +1,38 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2015 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _STRUCT_TIMEVAL64 | ||
| 30 | #define _STRUCT_TIMEVAL64 | ||
| 31 | |||
| 32 | #include <machine/types.h> /* __int64_t */ | ||
| 33 | |||
| 34 | struct timeval64 { | ||
| 35 | 	__int64_t tv_sec; /* seconds */ | ||
| 36 | 	__int64_t tv_usec; /* and microseconds */ | ||
| 37 | }; | ||
| 38 | #endif /* _STRUCT_TIMEVAL32 */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_u_char.h created+31| ... | @@ -0,0 +1,31 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _U_CHAR | ||
| 29 | #define _U_CHAR | ||
| 30 | typedef unsigned char u_char; | ||
| 31 | #endif /* _U_CHAR */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_u_int.h created+31| ... | @@ -0,0 +1,31 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _U_INT | ||
| 29 | #define _U_INT | ||
| 30 | typedef unsigned int u_int; | ||
| 31 | #endif /* _U_INT */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_u_short.h created+31| ... | @@ -0,0 +1,31 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _U_SHORT | ||
| 29 | #define _U_SHORT | ||
| 30 | typedef unsigned short u_short; | ||
| 31 | #endif /* _U_SHORT */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_ucontext.h+1| ... | @@ -38,6 +38,7 @@ | ... | @@ -38,6 +38,7 @@ |
| 38 | #include <machine/types.h> /* __darwin_size_t */ | 38 | #include <machine/types.h> /* __darwin_size_t */ |
| 39 | #include <machine/_mcontext.h> /* _STRUCT_MCONTEXT */ | 39 | #include <machine/_mcontext.h> /* _STRUCT_MCONTEXT */ |
| 40 | #include <sys/_types.h> /* __darwin_sigset_t */ | 40 | #include <sys/_types.h> /* __darwin_sigset_t */ |
| 41 | #include <sys/_types/_sigaltstack.h> /* _STRUCT_SIGALTSTACK */ | ||
| 41 | 42 | ||
| 42 | _STRUCT_UCONTEXT | 43 | _STRUCT_UCONTEXT |
| 43 | { | 44 | { |
lib/libc/include/x86_64-macos-gnu/sys/_types/_useconds_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _USECONDS_T | ||
| 29 | #define _USECONDS_T | ||
| 30 | #include <sys/_types.h> /* __darwin_useconds_t */ | ||
| 31 | typedef __darwin_useconds_t useconds_t; | ||
| 32 | #endif /* _USECONDS_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/_types/_uuid_t.h created+32| ... | @@ -0,0 +1,32 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | #ifndef _UUID_T | ||
| 29 | #define _UUID_T | ||
| 30 | #include <sys/_types.h> /* __darwin_uuid_t */ | ||
| 31 | typedef __darwin_uuid_t uuid_t; | ||
| 32 | #endif /* _UUID_T */ | ||
lib/libc/include/x86_64-macos-gnu/sys/acl.h created+212| ... | @@ -0,0 +1,212 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004, 2010 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * The contents of this file constitute Original Code as defined in and | ||
| 7 | * are subject to the Apple Public Source License Version 1.1 (the | ||
| 8 | * "License"). You may not use this file except in compliance with the | ||
| 9 | * License. Please obtain a copy of the License at | ||
| 10 | * http://www.apple.com/publicsource and read it before using this file. | ||
| 11 | * | ||
| 12 | * This Original Code and all software distributed under the License are | ||
| 13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the | ||
| 17 | * License for the specific language governing rights and limitations | ||
| 18 | * under the License. | ||
| 19 | * | ||
| 20 | * @APPLE_LICENSE_HEADER_END@ | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _SYS_ACL_H | ||
| 24 | #define _SYS_ACL_H | ||
| 25 | |||
| 26 | #include <Availability.h> | ||
| 27 | #include <sys/kauth.h> | ||
| 28 | #include <sys/_types/_ssize_t.h> | ||
| 29 | |||
| 30 | #define __DARWIN_ACL_READ_DATA			(1<<1) | ||
| 31 | #define __DARWIN_ACL_LIST_DIRECTORY		__DARWIN_ACL_READ_DATA | ||
| 32 | #define __DARWIN_ACL_WRITE_DATA			(1<<2) | ||
| 33 | #define __DARWIN_ACL_ADD_FILE			__DARWIN_ACL_WRITE_DATA | ||
| 34 | #define __DARWIN_ACL_EXECUTE			(1<<3) | ||
| 35 | #define __DARWIN_ACL_SEARCH			__DARWIN_ACL_EXECUTE | ||
| 36 | #define __DARWIN_ACL_DELETE			(1<<4) | ||
| 37 | #define __DARWIN_ACL_APPEND_DATA		(1<<5) | ||
| 38 | #define __DARWIN_ACL_ADD_SUBDIRECTORY		__DARWIN_ACL_APPEND_DATA | ||
| 39 | #define __DARWIN_ACL_DELETE_CHILD		(1<<6) | ||
| 40 | #define __DARWIN_ACL_READ_ATTRIBUTES		(1<<7) | ||
| 41 | #define __DARWIN_ACL_WRITE_ATTRIBUTES		(1<<8) | ||
| 42 | #define __DARWIN_ACL_READ_EXTATTRIBUTES		(1<<9) | ||
| 43 | #define __DARWIN_ACL_WRITE_EXTATTRIBUTES	(1<<10) | ||
| 44 | #define __DARWIN_ACL_READ_SECURITY		(1<<11) | ||
| 45 | #define __DARWIN_ACL_WRITE_SECURITY		(1<<12) | ||
| 46 | #define __DARWIN_ACL_CHANGE_OWNER		(1<<13) | ||
| 47 | #define __DARWIN_ACL_SYNCHRONIZE		(1<<20) | ||
| 48 | |||
| 49 | #define __DARWIN_ACL_EXTENDED_ALLOW		1 | ||
| 50 | #define __DARWIN_ACL_EXTENDED_DENY		2 | ||
| 51 | |||
| 52 | #define __DARWIN_ACL_ENTRY_INHERITED		(1<<4) | ||
| 53 | #define __DARWIN_ACL_ENTRY_FILE_INHERIT		(1<<5) | ||
| 54 | #define __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT	(1<<6) | ||
| 55 | #define __DARWIN_ACL_ENTRY_LIMIT_INHERIT	(1<<7) | ||
| 56 | #define __DARWIN_ACL_ENTRY_ONLY_INHERIT		(1<<8) | ||
| 57 | #define __DARWIN_ACL_FLAG_NO_INHERIT		(1<<17) | ||
| 58 | |||
| 59 | /* | ||
| 60 | * Implementation constants. | ||
| 61 | * | ||
| 62 | * The ACL_TYPE_EXTENDED binary format permits 169 entries plus | ||
| 63 | * the ACL header in a page. Give ourselves some room to grow; | ||
| 64 | * this limit is arbitrary. | ||
| 65 | */ | ||
| 66 | #define ACL_MAX_ENTRIES		128 | ||
| 67 | |||
| 68 | /* 23.2.2 Individual object access permissions - nonstandard */ | ||
| 69 | typedef enum { | ||
| 70 | 	ACL_READ_DATA		= __DARWIN_ACL_READ_DATA, | ||
| 71 | 	ACL_LIST_DIRECTORY	= __DARWIN_ACL_LIST_DIRECTORY, | ||
| 72 | 	ACL_WRITE_DATA		= __DARWIN_ACL_WRITE_DATA, | ||
| 73 | 	ACL_ADD_FILE		= __DARWIN_ACL_ADD_FILE, | ||
| 74 | 	ACL_EXECUTE		= __DARWIN_ACL_EXECUTE, | ||
| 75 | 	ACL_SEARCH		= __DARWIN_ACL_SEARCH, | ||
| 76 | 	ACL_DELETE		= __DARWIN_ACL_DELETE, | ||
| 77 | 	ACL_APPEND_DATA		= __DARWIN_ACL_APPEND_DATA, | ||
| 78 | 	ACL_ADD_SUBDIRECTORY	= __DARWIN_ACL_ADD_SUBDIRECTORY, | ||
| 79 | 	ACL_DELETE_CHILD	= __DARWIN_ACL_DELETE_CHILD, | ||
| 80 | 	ACL_READ_ATTRIBUTES	= __DARWIN_ACL_READ_ATTRIBUTES, | ||
| 81 | 	ACL_WRITE_ATTRIBUTES	= __DARWIN_ACL_WRITE_ATTRIBUTES, | ||
| 82 | 	ACL_READ_EXTATTRIBUTES	= __DARWIN_ACL_READ_EXTATTRIBUTES, | ||
| 83 | 	ACL_WRITE_EXTATTRIBUTES	= __DARWIN_ACL_WRITE_EXTATTRIBUTES, | ||
| 84 | 	ACL_READ_SECURITY	= __DARWIN_ACL_READ_SECURITY, | ||
| 85 | 	ACL_WRITE_SECURITY	= __DARWIN_ACL_WRITE_SECURITY, | ||
| 86 | 	ACL_CHANGE_OWNER	= __DARWIN_ACL_CHANGE_OWNER, | ||
| 87 | 	ACL_SYNCHRONIZE		= __DARWIN_ACL_SYNCHRONIZE, | ||
| 88 | } acl_perm_t; | ||
| 89 | |||
| 90 | /* 23.2.5 ACL entry tag type bits - nonstandard */ | ||
| 91 | typedef enum { | ||
| 92 | 	ACL_UNDEFINED_TAG	= 0, | ||
| 93 | 	ACL_EXTENDED_ALLOW	= __DARWIN_ACL_EXTENDED_ALLOW, | ||
| 94 | 	ACL_EXTENDED_DENY	= __DARWIN_ACL_EXTENDED_DENY | ||
| 95 | } acl_tag_t; | ||
| 96 | |||
| 97 | /* 23.2.6 Individual ACL types */ | ||
| 98 | typedef enum { | ||
| 99 | 	ACL_TYPE_EXTENDED	= 0x00000100, | ||
| 100 | /* Posix 1003.1e types - not supported */ | ||
| 101 | 	ACL_TYPE_ACCESS = 0x00000000, | ||
| 102 | 	ACL_TYPE_DEFAULT = 0x00000001, | ||
| 103 | /* The following types are defined on FreeBSD/Linux - not supported */ | ||
| 104 | 	ACL_TYPE_AFS = 0x00000002, | ||
| 105 | 	ACL_TYPE_CODA = 0x00000003, | ||
| 106 | 	ACL_TYPE_NTFS = 0x00000004, | ||
| 107 | 	ACL_TYPE_NWFS = 0x00000005 | ||
| 108 | } acl_type_t; | ||
| 109 | |||
| 110 | /* 23.2.7 ACL qualifier constants */ | ||
| 111 | |||
| 112 | #define ACL_UNDEFINED_ID	NULL	/* XXX ? */ | ||
| 113 | |||
| 114 | /* 23.2.8 ACL Entry Constants */ | ||
| 115 | typedef enum { | ||
| 116 | 	ACL_FIRST_ENTRY		= 0, | ||
| 117 | 	ACL_NEXT_ENTRY		= -1, | ||
| 118 | 	ACL_LAST_ENTRY		= -2 | ||
| 119 | } acl_entry_id_t; | ||
| 120 | |||
| 121 | /* nonstandard ACL / entry flags */ | ||
| 122 | typedef enum { | ||
| 123 | 	ACL_FLAG_DEFER_INHERIT		= (1 << 0),	/* tentative */ | ||
| 124 | 	ACL_FLAG_NO_INHERIT		= __DARWIN_ACL_FLAG_NO_INHERIT, | ||
| 125 | 	ACL_ENTRY_INHERITED		= __DARWIN_ACL_ENTRY_INHERITED, | ||
| 126 | 	ACL_ENTRY_FILE_INHERIT		= __DARWIN_ACL_ENTRY_FILE_INHERIT, | ||
| 127 | 	ACL_ENTRY_DIRECTORY_INHERIT	= __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT, | ||
| 128 | 	ACL_ENTRY_LIMIT_INHERIT		= __DARWIN_ACL_ENTRY_LIMIT_INHERIT, | ||
| 129 | 	ACL_ENTRY_ONLY_INHERIT		= __DARWIN_ACL_ENTRY_ONLY_INHERIT | ||
| 130 | } acl_flag_t; | ||
| 131 | |||
| 132 | /* "External" ACL types */ | ||
| 133 | |||
| 134 | struct _acl; | ||
| 135 | struct _acl_entry; | ||
| 136 | struct _acl_permset; | ||
| 137 | struct _acl_flagset; | ||
| 138 | |||
| 139 | typedef struct _acl		*acl_t; | ||
| 140 | typedef struct _acl_entry	*acl_entry_t; | ||
| 141 | typedef struct _acl_permset	*acl_permset_t; | ||
| 142 | typedef struct _acl_flagset	*acl_flagset_t; | ||
| 143 | |||
| 144 | typedef u_int64_t		acl_permset_mask_t; | ||
| 145 | |||
| 146 | __BEGIN_DECLS | ||
| 147 | /* 23.1.6.1 ACL Storage Management */ | ||
| 148 | extern acl_t	acl_dup(acl_t acl); | ||
| 149 | extern int	acl_free(void *obj_p); | ||
| 150 | extern acl_t	acl_init(int count); | ||
| 151 | |||
| 152 | /* 23.1.6.2 (1) ACL Entry manipulation */ | ||
| 153 | extern int	acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d); | ||
| 154 | extern int	acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p); | ||
| 155 | extern int	acl_create_entry_np(acl_t *acl_p, acl_entry_t *entry_p, int entry_index); | ||
| 156 | extern int	acl_delete_entry(acl_t acl, acl_entry_t entry_d); | ||
| 157 | extern int	acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p); | ||
| 158 | extern int	acl_valid(acl_t acl); | ||
| 159 | extern int	acl_valid_fd_np(int fd, acl_type_t type, acl_t acl); | ||
| 160 | extern int	acl_valid_file_np(const char *path, acl_type_t type, acl_t acl); | ||
| 161 | extern int	acl_valid_link_np(const char *path, acl_type_t type, acl_t acl); | ||
| 162 | |||
| 163 | /* 23.1.6.2 (2) Manipulate permissions within an ACL entry */ | ||
| 164 | extern int	acl_add_perm(acl_permset_t permset_d, acl_perm_t perm); | ||
| 165 | extern int	acl_calc_mask(acl_t *acl_p);	/* not supported */ | ||
| 166 | extern int	acl_clear_perms(acl_permset_t permset_d); | ||
| 167 | extern int	acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm); | ||
| 168 | extern int	acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm); | ||
| 169 | extern int 	acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p); | ||
| 170 | extern int	acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d); | ||
| 171 | |||
| 172 | /* nonstandard - manipulate permissions within an ACL entry using bitmasks */ | ||
| 173 | extern int	acl_maximal_permset_mask_np(acl_permset_mask_t * mask_p) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 174 | extern int	acl_get_permset_mask_np(acl_entry_t entry_d, acl_permset_mask_t * mask_p) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 175 | extern int	acl_set_permset_mask_np(acl_entry_t entry_d, acl_permset_mask_t mask) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 176 | |||
| 177 | /* nonstandard - manipulate flags on ACLs and entries */ | ||
| 178 | extern int	acl_add_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); | ||
| 179 | extern int	acl_clear_flags_np(acl_flagset_t flagset_d); | ||
| 180 | extern int	acl_delete_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); | ||
| 181 | extern int	acl_get_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); | ||
| 182 | extern int	acl_get_flagset_np(void *obj_p, acl_flagset_t *flagset_p); | ||
| 183 | extern int	acl_set_flagset_np(void *obj_p, acl_flagset_t flagset_d); | ||
| 184 | |||
| 185 | /* 23.1.6.2 (3) Manipulate ACL entry tag type and qualifier */ | ||
| 186 | extern void	*acl_get_qualifier(acl_entry_t entry_d); | ||
| 187 | extern int	acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p); | ||
| 188 | extern int	acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p); | ||
| 189 | extern int	acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type); | ||
| 190 | |||
| 191 | /* 23.1.6.3 ACL manipulation on an Object */ | ||
| 192 | extern int	acl_delete_def_file(const char *path_p); /* not supported */ | ||
| 193 | extern acl_t 	acl_get_fd(int fd); | ||
| 194 | extern acl_t	acl_get_fd_np(int fd, acl_type_t type); | ||
| 195 | extern acl_t	acl_get_file(const char *path_p, acl_type_t type); | ||
| 196 | extern acl_t	acl_get_link_np(const char *path_p, acl_type_t type); | ||
| 197 | extern int	acl_set_fd(int fd, acl_t acl); | ||
| 198 | extern int	acl_set_fd_np(int fd, acl_t acl, acl_type_t acl_type); | ||
| 199 | extern int	acl_set_file(const char *path_p, acl_type_t type, acl_t acl); | ||
| 200 | extern int	acl_set_link_np(const char *path_p, acl_type_t type, acl_t acl); | ||
| 201 | |||
| 202 | /* 23.1.6.4 ACL Format translation */ | ||
| 203 | extern ssize_t	acl_copy_ext(void *buf_p, acl_t acl, ssize_t size); | ||
| 204 | extern ssize_t	acl_copy_ext_native(void *buf_p, acl_t acl, ssize_t size); | ||
| 205 | extern acl_t	acl_copy_int(const void *buf_p); | ||
| 206 | extern acl_t	acl_copy_int_native(const void *buf_p); | ||
| 207 | extern acl_t	acl_from_text(const char *buf_p); | ||
| 208 | extern ssize_t	acl_size(acl_t acl); | ||
| 209 | extern char	*acl_to_text(acl_t acl, ssize_t *len_p); | ||
| 210 | __END_DECLS | ||
| 211 | |||
| 212 | #endif /* _SYS_ACL_H */ | ||
lib/libc/include/x86_64-macos-gnu/sys/aio.h created+248| ... | @@ -0,0 +1,248 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | *	File:	sys/aio.h | ||
| 30 | *	Author:	Umesh Vaishampayan [umeshv@apple.com] | ||
| 31 | *			05-Feb-2003	umeshv	Created. | ||
| 32 | * | ||
| 33 | *	Header file for POSIX Asynchronous IO APIs | ||
| 34 | * | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _SYS_AIO_H_ | ||
| 38 | #define _SYS_AIO_H_ | ||
| 39 | |||
| 40 | #include <sys/signal.h> | ||
| 41 | #include <sys/_types.h> | ||
| 42 | #include <sys/cdefs.h> | ||
| 43 | |||
| 44 | /* | ||
| 45 | * [XSI] Inclusion of the <aio.h> header may make visible symbols defined | ||
| 46 | * in the headers <fcntl.h>, <signal.h>, <sys/types.h>, and <time.h>. | ||
| 47 | * | ||
| 48 | * In our case, this is limited to struct timespec, off_t and ssize_t. | ||
| 49 | */ | ||
| 50 | #include <sys/_types/_timespec.h> | ||
| 51 | |||
| 52 | #include <sys/_types/_off_t.h> | ||
| 53 | #include <sys/_types/_ssize_t.h> | ||
| 54 | |||
| 55 | /* | ||
| 56 | * A aio_fsync() options that the calling thread is to continue execution | ||
| 57 | * while the lio_listio() operation is being performed, and no notification | ||
| 58 | * is given when the operation is complete | ||
| 59 | * | ||
| 60 | * [XSI] from <fcntl.h> | ||
| 61 | */ | ||
| 62 | #include <sys/_types/_o_sync.h> | ||
| 63 | #include <sys/_types/_o_dsync.h> | ||
| 64 | |||
| 65 | struct aiocb { | ||
| 66 | 	int aio_fildes; /* File descriptor */ | ||
| 67 | 	off_t aio_offset; /* File offset */ | ||
| 68 | 	volatile void *aio_buf; /* Location of buffer */ | ||
| 69 | 	size_t aio_nbytes; /* Length of transfer */ | ||
| 70 | 	int aio_reqprio; /* Request priority offset */ | ||
| 71 | 	struct sigevent aio_sigevent; /* Signal number and value */ | ||
| 72 | 	int aio_lio_opcode; /* Operation to be performed */ | ||
| 73 | }; | ||
| 74 | |||
| 75 | |||
| 76 | /* | ||
| 77 | * aio_cancel() return values | ||
| 78 | */ | ||
| 79 | |||
| 80 | /* | ||
| 81 | * none of the requested operations could be canceled since they are | ||
| 82 | * already complete. | ||
| 83 | */ | ||
| 84 | #define AIO_ALLDONE 0x1 | ||
| 85 | |||
| 86 | /* all requested operations have been canceled */ | ||
| 87 | #define AIO_CANCELED 0x2 | ||
| 88 | |||
| 89 | /* | ||
| 90 | * some of the requested operations could not be canceled since | ||
| 91 | * they are in progress | ||
| 92 | */ | ||
| 93 | #define AIO_NOTCANCELED 0x4 | ||
| 94 | |||
| 95 | |||
| 96 | /* | ||
| 97 | * lio_listio operation options | ||
| 98 | */ | ||
| 99 | |||
| 100 | #define LIO_NOP 0x0 /* option indicating that no transfer is requested */ | ||
| 101 | #define LIO_READ 0x1 /* option requesting a read */ | ||
| 102 | #define LIO_WRITE 0x2 /* option requesting a write */ | ||
| 103 | |||
| 104 | /* | ||
| 105 | * lio_listio() modes | ||
| 106 | */ | ||
| 107 | |||
| 108 | /* | ||
| 109 | * A lio_listio() synchronization operation indicating | ||
| 110 | * that the calling thread is to continue execution while | ||
| 111 | * the lio_listio() operation is being performed, and no | ||
| 112 | * notification is given when the operation is complete | ||
| 113 | */ | ||
| 114 | #define LIO_NOWAIT 0x1 | ||
| 115 | |||
| 116 | /* | ||
| 117 | * A lio_listio() synchronization operation indicating | ||
| 118 | * that the calling thread is to suspend until the | ||
| 119 | * lio_listio() operation is complete. | ||
| 120 | */ | ||
| 121 | #define LIO_WAIT 0x2 | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Maximum number of operations in single lio_listio call | ||
| 125 | */ | ||
| 126 | #define AIO_LISTIO_MAX 16 | ||
| 127 | |||
| 128 | |||
| 129 | /* | ||
| 130 | * Prototypes | ||
| 131 | */ | ||
| 132 | |||
| 133 | __BEGIN_DECLS | ||
| 134 | |||
| 135 | /* | ||
| 136 | * Attempt to cancel one or more asynchronous I/O requests currently outstanding | ||
| 137 | * against file descriptor fd. The aiocbp argument points to the asynchronous I/O | ||
| 138 | * control block for a particular request to be canceled. If aiocbp is NULL, then | ||
| 139 | * all outstanding cancelable asynchronous I/O requests against fd shall be canceled. | ||
| 140 | */ | ||
| 141 | int aio_cancel( int fd, | ||
| 142 | struct aiocb * aiocbp ); | ||
| 143 | |||
| 144 | /* | ||
| 145 | * Return the error status associated with the aiocb structure referenced by the | ||
| 146 | * aiocbp argument. The error status for an asynchronous I/O operation is the errno | ||
| 147 | * value that would be set by the corresponding read(), write(), or fsync() | ||
| 148 | * operation. If the operation has not yet completed, then the error status shall | ||
| 149 | * be equal to [EINPROGRESS]. | ||
| 150 | */ | ||
| 151 | int aio_error( const struct aiocb * aiocbp ); | ||
| 152 | |||
| 153 | /* | ||
| 154 | * Asynchronously force all I/O operations associated with the file indicated by | ||
| 155 | * the file descriptor aio_fildes member of the aiocb structure referenced by the | ||
| 156 | * aiocbp argument and queued at the time of the call to aio_fsync() to the | ||
| 157 | * synchronized I/O completion state. The function call shall return when the | ||
| 158 | * synchronization request has been initiated or queued. op O_SYNC is the only | ||
| 159 | * supported opertation at this time. | ||
| 160 | * The aiocbp argument refers to an asynchronous I/O control block. The aiocbp | ||
| 161 | * value may be used as an argument to aio_error() and aio_return() in order to | ||
| 162 | * determine the error status and return status, respectively, of the asynchronous | ||
| 163 | * operation while it is proceeding. When the request is queued, the error status | ||
| 164 | * for the operation is [EINPROGRESS]. When all data has been successfully | ||
| 165 | * transferred, the error status shall be reset to reflect the success or failure | ||
| 166 | * of the operation. | ||
| 167 | */ | ||
| 168 | int aio_fsync( int op, | ||
| 169 | struct aiocb * aiocbp ); | ||
| 170 | |||
| 171 | /* | ||
| 172 | * Read aiocbp->aio_nbytes from the file associated with aiocbp->aio_fildes into | ||
| 173 | * the buffer pointed to by aiocbp->aio_buf. The function call shall return when | ||
| 174 | * the read request has been initiated or queued. | ||
| 175 | * The aiocbp value may be used as an argument to aio_error() and aio_return() in | ||
| 176 | * order to determine the error status and return status, respectively, of the | ||
| 177 | * asynchronous operation while it is proceeding. If an error condition is | ||
| 178 | * encountered during queuing, the function call shall return without having | ||
| 179 | * initiated or queued the request. The requested operation takes place at the | ||
| 180 | * absolute position in the file as given by aio_offset, as if lseek() were called | ||
| 181 | * immediately prior to the operation with an offset equal to aio_offset and a | ||
| 182 | * whence equal to SEEK_SET. After a successful call to enqueue an asynchronous | ||
| 183 | * I/O operation, the value of the file offset for the file is unspecified. | ||
| 184 | */ | ||
| 185 | int aio_read( struct aiocb * aiocbp ); | ||
| 186 | |||
| 187 | /* | ||
| 188 | * Return the return status associated with the aiocb structure referenced by | ||
| 189 | * the aiocbp argument. The return status for an asynchronous I/O operation is | ||
| 190 | * the value that would be returned by the corresponding read(), write(), or | ||
| 191 | * fsync() function call. If the error status for the operation is equal to | ||
| 192 | * [EINPROGRESS], then the return status for the operation is undefined. The | ||
| 193 | * aio_return() function may be called exactly once to retrieve the return status | ||
| 194 | * of a given asynchronous operation; thereafter, if the same aiocb structure | ||
| 195 | * is used in a call to aio_return() or aio_error(), an error may be returned. | ||
| 196 | * When the aiocb structure referred to by aiocbp is used to submit another | ||
| 197 | * asynchronous operation, then aio_return() may be successfully used to | ||
| 198 | * retrieve the return status of that operation. | ||
| 199 | */ | ||
| 200 | ssize_t aio_return( struct aiocb * aiocbp ); | ||
| 201 | |||
| 202 | /* | ||
| 203 | * Suspend the calling thread until at least one of the asynchronous I/O | ||
| 204 | * operations referenced by the aiocblist argument has completed, until a signal | ||
| 205 | * interrupts the function, or, if timeout is not NULL, until the time | ||
| 206 | * interval specified by timeout has passed. If any of the aiocb structures | ||
| 207 | * in the aiocblist correspond to completed asynchronous I/O operations (that is, | ||
| 208 | * the error status for the operation is not equal to [EINPROGRESS]) at the | ||
| 209 | * time of the call, the function shall return without suspending the calling | ||
| 210 | * thread. The aiocblist argument is an array of pointers to asynchronous I/O | ||
| 211 | * control blocks. The nent argument indicates the number of elements in the | ||
| 212 | * array. Each aiocb structure pointed to has been used in initiating an | ||
| 213 | * asynchronous I/O request via aio_read(), aio_write(), or lio_listio(). This | ||
| 214 | * array may contain NULL pointers, which are ignored. | ||
| 215 | */ | ||
| 216 | int aio_suspend( const struct aiocb *const aiocblist[], | ||
| 217 | int nent, | ||
| 218 | const struct timespec * timeoutp ) __DARWIN_ALIAS_C(aio_suspend); | ||
| 219 | |||
| 220 | /* | ||
| 221 | * Write aiocbp->aio_nbytes to the file associated with aiocbp->aio_fildes from | ||
| 222 | * the buffer pointed to by aiocbp->aio_buf. The function shall return when the | ||
| 223 | * write request has been initiated or, at a minimum, queued. | ||
| 224 | * The aiocbp argument may be used as an argument to aio_error() and aio_return() | ||
| 225 | * in order to determine the error status and return status, respectively, of the | ||
| 226 | * asynchronous operation while it is proceeding. | ||
| 227 | */ | ||
| 228 | int aio_write( struct aiocb * aiocbp ); | ||
| 229 | |||
| 230 | /* | ||
| 231 | * Initiate a list of I/O requests with a single function call. The mode | ||
| 232 | * argument takes one of the values LIO_WAIT or LIO_NOWAIT and determines whether | ||
| 233 | * the function returns when the I/O operations have been completed, or as soon | ||
| 234 | * as the operations have been queued. If the mode argument is LIO_WAIT, the | ||
| 235 | * function shall wait until all I/O is complete and the sig argument shall be | ||
| 236 | * ignored. | ||
| 237 | * If the mode argument is LIO_NOWAIT, the function shall return immediately, and | ||
| 238 | * asynchronous notification shall occur, according to the sig argument, when all | ||
| 239 | * the I/O operations complete. If sig is NULL, then no asynchronous notification | ||
| 240 | * shall occur. | ||
| 241 | */ | ||
| 242 | int lio_listio( int mode, | ||
| 243 | struct aiocb *const aiocblist[], | ||
| 244 | int nent, | ||
| 245 | struct sigevent *sigp ); | ||
| 246 | __END_DECLS | ||
| 247 | |||
| 248 | #endif /* _SYS_AIO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/attr.h created+586| ... | @@ -0,0 +1,586 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * attr.h - attribute data structures and interfaces | ||
| 31 | * | ||
| 32 | * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _SYS_ATTR_H_ | ||
| 36 | #define _SYS_ATTR_H_ | ||
| 37 | |||
| 38 | #include <sys/appleapiopts.h> | ||
| 39 | |||
| 40 | #ifdef __APPLE_API_UNSTABLE | ||
| 41 | #include <sys/types.h> | ||
| 42 | #include <sys/ucred.h> | ||
| 43 | #include <sys/time.h> | ||
| 44 | #include <sys/cdefs.h> | ||
| 45 | |||
| 46 | #define FSOPT_NOFOLLOW 0x00000001 | ||
| 47 | #define FSOPT_NOINMEMUPDATE 0x00000002 | ||
| 48 | #define FSOPT_REPORT_FULLSIZE 0x00000004 | ||
| 49 | /* The following option only valid when requesting ATTR_CMN_RETURNED_ATTRS */ | ||
| 50 | #define FSOPT_PACK_INVAL_ATTRS 0x00000008 | ||
| 51 | |||
| 52 | |||
| 53 | #define FSOPT_ATTR_CMN_EXTENDED 0x00000020 | ||
| 54 | #define FSOPT_RETURN_REALDEV 0x00000200 | ||
| 55 | |||
| 56 | /* we currently aren't anywhere near this amount for a valid | ||
| 57 | * fssearchblock.sizeofsearchparams1 or fssearchblock.sizeofsearchparams2 | ||
| 58 | * but we put a sanity check in to avoid abuse of the value passed in from | ||
| 59 | * user land. | ||
| 60 | */ | ||
| 61 | #define SEARCHFS_MAX_SEARCHPARMS 4096 | ||
| 62 | |||
| 63 | typedef u_int32_t text_encoding_t; | ||
| 64 | |||
| 65 | typedef u_int32_t fsobj_type_t; | ||
| 66 | |||
| 67 | typedef u_int32_t fsobj_tag_t; | ||
| 68 | |||
| 69 | typedef u_int32_t fsfile_type_t; | ||
| 70 | |||
| 71 | typedef u_int32_t fsvolid_t; | ||
| 72 | |||
| 73 | #include <sys/_types/_fsobj_id_t.h> /* file object id type */ | ||
| 74 | |||
| 75 | typedef u_int32_t attrgroup_t; | ||
| 76 | |||
| 77 | struct attrlist { | ||
| 78 | 	u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */ | ||
| 79 | 	u_int16_t reserved; /* (to maintain 4-byte alignment) */ | ||
| 80 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 81 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 82 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 83 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 84 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 85 | }; | ||
| 86 | #define ATTR_BIT_MAP_COUNT 5 | ||
| 87 | |||
| 88 | typedef struct attribute_set { | ||
| 89 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 90 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 91 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 92 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 93 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 94 | } attribute_set_t; | ||
| 95 | |||
| 96 | typedef struct attrreference { | ||
| 97 | 	int32_t attr_dataoffset; | ||
| 98 | 	u_int32_t attr_length; | ||
| 99 | } attrreference_t; | ||
| 100 | |||
| 101 | /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */ | ||
| 102 | |||
| 103 | struct diskextent { | ||
| 104 | 	u_int32_t startblock; /* first block allocated */ | ||
| 105 | 	u_int32_t blockcount; /* number of blocks allocated */ | ||
| 106 | }; | ||
| 107 | |||
| 108 | typedef struct diskextent extentrecord[8]; | ||
| 109 | |||
| 110 | typedef u_int32_t vol_capabilities_set_t[4]; | ||
| 111 | |||
| 112 | #define VOL_CAPABILITIES_FORMAT 0 | ||
| 113 | #define VOL_CAPABILITIES_INTERFACES 1 | ||
| 114 | #define VOL_CAPABILITIES_RESERVED1 2 | ||
| 115 | #define VOL_CAPABILITIES_RESERVED2 3 | ||
| 116 | |||
| 117 | typedef struct vol_capabilities_attr { | ||
| 118 | 	vol_capabilities_set_t capabilities; | ||
| 119 | 	vol_capabilities_set_t valid; | ||
| 120 | } vol_capabilities_attr_t; | ||
| 121 | |||
| 122 | /* | ||
| 123 | * XXX this value needs to be raised - 3893388 | ||
| 124 | */ | ||
| 125 | #define ATTR_MAX_BUFFER 8192 | ||
| 126 | |||
| 127 | /* | ||
| 128 | * VOL_CAP_FMT_PERSISTENTOBJECTIDS: When set, the volume has object IDs | ||
| 129 | * that are persistent (retain their values even when the volume is | ||
| 130 | * unmounted and remounted), and a file or directory can be looked up | ||
| 131 | * by ID. Volumes that support VolFS and can support Carbon File ID | ||
| 132 | * references should set this bit. | ||
| 133 | * | ||
| 134 | * VOL_CAP_FMT_SYMBOLICLINKS: When set, the volume supports symbolic | ||
| 135 | * links. The symlink(), readlink(), and lstat() calls all use this | ||
| 136 | * symbolic link. | ||
| 137 | * | ||
| 138 | * VOL_CAP_FMT_HARDLINKS: When set, the volume supports hard links. | ||
| 139 | * The link() call creates hard links. | ||
| 140 | * | ||
| 141 | * VOL_CAP_FMT_JOURNAL: When set, the volume is capable of supporting | ||
| 142 | * a journal used to speed recovery in case of unplanned shutdown | ||
| 143 | * (such as a power outage or crash). This bit does not necessarily | ||
| 144 | * mean the volume is actively using a journal for recovery. | ||
| 145 | * | ||
| 146 | * VOL_CAP_FMT_JOURNAL_ACTIVE: When set, the volume is currently using | ||
| 147 | * a journal for use in speeding recovery after an unplanned shutdown. | ||
| 148 | * This bit can be set only if VOL_CAP_FMT_JOURNAL is also set. | ||
| 149 | * | ||
| 150 | * VOL_CAP_FMT_NO_ROOT_TIMES: When set, the volume format does not | ||
| 151 | * store reliable times for the root directory, so you should not | ||
| 152 | * depend on them to detect changes, etc. | ||
| 153 | * | ||
| 154 | * VOL_CAP_FMT_SPARSE_FILES: When set, the volume supports sparse files. | ||
| 155 | * That is, files which can have "holes" that have never been written | ||
| 156 | * to, and are not allocated on disk. Sparse files may have an | ||
| 157 | * allocated size that is less than the file's logical length. | ||
| 158 | * | ||
| 159 | * VOL_CAP_FMT_ZERO_RUNS: For security reasons, parts of a file (runs) | ||
| 160 | * that have never been written to must appear to contain zeroes. When | ||
| 161 | * this bit is set, the volume keeps track of allocated but unwritten | ||
| 162 | * runs of a file so that it can substitute zeroes without actually | ||
| 163 | * writing zeroes to the media. This provides performance similar to | ||
| 164 | * sparse files, but not the space savings. | ||
| 165 | * | ||
| 166 | * VOL_CAP_FMT_CASE_SENSITIVE: When set, file and directory names are | ||
| 167 | * case sensitive (upper and lower case are different). When clear, | ||
| 168 | * an upper case character is equivalent to a lower case character, | ||
| 169 | * and you can't have two names that differ solely in the case of | ||
| 170 | * the characters. | ||
| 171 | * | ||
| 172 | * VOL_CAP_FMT_CASE_PRESERVING: When set, file and directory names | ||
| 173 | * preserve the difference between upper and lower case. If clear, | ||
| 174 | * the volume may change the case of some characters (typically | ||
| 175 | * making them all upper or all lower case). A volume that sets | ||
| 176 | * VOL_CAP_FMT_CASE_SENSITIVE should also set VOL_CAP_FMT_CASE_PRESERVING. | ||
| 177 | * | ||
| 178 | * VOL_CAP_FMT_FAST_STATFS: This bit is used as a hint to upper layers | ||
| 179 | * (especially Carbon) that statfs() is fast enough that its results | ||
| 180 | * need not be cached by those upper layers. A volume that caches | ||
| 181 | * the statfs information in its in-memory structures should set this bit. | ||
| 182 | * A volume that must always read from disk or always perform a network | ||
| 183 | * transaction should not set this bit. | ||
| 184 | * | ||
| 185 | * VOL_CAP_FMT_2TB_FILESIZE: If this bit is set the volume format supports | ||
| 186 | * file sizes larger than 4GB, and potentially up to 2TB; it does not | ||
| 187 | * indicate whether the filesystem supports files larger than that. | ||
| 188 | * | ||
| 189 | * VOL_CAP_FMT_OPENDENYMODES: When set, the volume supports open deny | ||
| 190 | * modes (e.g. "open for read write, deny write"; effectively, mandatory | ||
| 191 | * file locking based on open modes). | ||
| 192 | * | ||
| 193 | * VOL_CAP_FMT_HIDDEN_FILES: When set, the volume supports the UF_HIDDEN | ||
| 194 | * file flag, and the UF_HIDDEN flag is mapped to that volume's native | ||
| 195 | * "hidden" or "invisible" bit (which may be the invisible bit from the | ||
| 196 | * Finder Info extended attribute). | ||
| 197 | * | ||
| 198 | * VOL_CAP_FMT_PATH_FROM_ID: When set, the volume supports the ability | ||
| 199 | * to derive a pathname to the root of the file system given only the | ||
| 200 | * id of an object. This also implies that object ids on this file | ||
| 201 | * system are persistent and not recycled. This is a very specialized | ||
| 202 | * capability and it is assumed that most file systems will not support | ||
| 203 | * it. Its use is for legacy non-posix APIs like ResolveFileIDRef. | ||
| 204 | * | ||
| 205 | * VOL_CAP_FMT_NO_VOLUME_SIZES: When set, the volume does not support | ||
| 206 | * returning values for total data blocks, available blocks, or free blocks | ||
| 207 | * (as in f_blocks, f_bavail, or f_bfree in "struct statfs"). Historically, | ||
| 208 | * those values were set to 0xFFFFFFFF for volumes that did not support them. | ||
| 209 | * | ||
| 210 | * VOL_CAP_FMT_DECMPFS_COMPRESSION: When set, the volume supports transparent | ||
| 211 | * decompression of compressed files using decmpfs. | ||
| 212 | * | ||
| 213 | * VOL_CAP_FMT_64BIT_OBJECT_IDS: When set, the volume uses object IDs that | ||
| 214 | * are 64-bit. This means that ATTR_CMN_FILEID and ATTR_CMN_PARENTID are the | ||
| 215 | * only legitimate attributes for obtaining object IDs from this volume and the | ||
| 216 | * 32-bit fid_objno fields of the fsobj_id_t returned by ATTR_CMN_OBJID, | ||
| 217 | * ATTR_CMN_OBJPERMID, and ATTR_CMN_PAROBJID are undefined. | ||
| 218 | * | ||
| 219 | * VOL_CAP_FMT_DIR_HARDLINKS: When set, the volume supports directory | ||
| 220 | * hard links. | ||
| 221 | * | ||
| 222 | * VOL_CAP_FMT_DOCUMENT_ID: When set, the volume supports document IDs | ||
| 223 | * (an ID which persists across object ID changes) for document revisions. | ||
| 224 | * | ||
| 225 | * VOL_CAP_FMT_WRITE_GENERATION_COUNT: When set, the volume supports write | ||
| 226 | * generation counts (a count of how many times an object has been modified) | ||
| 227 | * | ||
| 228 | * VOL_CAP_FMT_NO_IMMUTABLE_FILES: When set, the volume does not support | ||
| 229 | * setting the UF_IMMUTABLE flag. | ||
| 230 | * | ||
| 231 | * VOL_CAP_FMT_NO_PERMISSIONS: When set, the volume does not support setting | ||
| 232 | * permissions. | ||
| 233 | * | ||
| 234 | * VOL_CAP_FMT_SHARED_SPACE: When set, the volume supports sharing space with | ||
| 235 | * other filesystems i.e. multiple logical filesystems can exist in the same | ||
| 236 | * "partition". An implication of this is that the filesystem which sets | ||
| 237 | * this capability treats waitfor arguments to VFS_SYNC as bit flags. | ||
| 238 | * | ||
| 239 | * VOL_CAP_FMT_VOL_GROUPS: When set, this volume is part of a volume-group | ||
| 240 | * that implies multiple volumes must be mounted in order to boot and root the | ||
| 241 | * operating system. Typically, this means a read-only system volume and a | ||
| 242 | * writable data volume. | ||
| 243 | * | ||
| 244 | * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed. | ||
| 245 | * Any modifications to volume data or metadata will be detected and may | ||
| 246 | * render the volume unusable. | ||
| 247 | */ | ||
| 248 | #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001 | ||
| 249 | #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002 | ||
| 250 | #define VOL_CAP_FMT_HARDLINKS 0x00000004 | ||
| 251 | #define VOL_CAP_FMT_JOURNAL 0x00000008 | ||
| 252 | #define VOL_CAP_FMT_JOURNAL_ACTIVE 0x00000010 | ||
| 253 | #define VOL_CAP_FMT_NO_ROOT_TIMES 0x00000020 | ||
| 254 | #define VOL_CAP_FMT_SPARSE_FILES 0x00000040 | ||
| 255 | #define VOL_CAP_FMT_ZERO_RUNS 0x00000080 | ||
| 256 | #define VOL_CAP_FMT_CASE_SENSITIVE 0x00000100 | ||
| 257 | #define VOL_CAP_FMT_CASE_PRESERVING 0x00000200 | ||
| 258 | #define VOL_CAP_FMT_FAST_STATFS 0x00000400 | ||
| 259 | #define VOL_CAP_FMT_2TB_FILESIZE 0x00000800 | ||
| 260 | #define VOL_CAP_FMT_OPENDENYMODES 0x00001000 | ||
| 261 | #define VOL_CAP_FMT_HIDDEN_FILES 0x00002000 | ||
| 262 | #define VOL_CAP_FMT_PATH_FROM_ID 0x00004000 | ||
| 263 | #define VOL_CAP_FMT_NO_VOLUME_SIZES 0x00008000 | ||
| 264 | #define VOL_CAP_FMT_DECMPFS_COMPRESSION 0x00010000 | ||
| 265 | #define VOL_CAP_FMT_64BIT_OBJECT_IDS 0x00020000 | ||
| 266 | #define VOL_CAP_FMT_DIR_HARDLINKS 0x00040000 | ||
| 267 | #define VOL_CAP_FMT_DOCUMENT_ID 0x00080000 | ||
| 268 | #define VOL_CAP_FMT_WRITE_GENERATION_COUNT 0x00100000 | ||
| 269 | #define VOL_CAP_FMT_NO_IMMUTABLE_FILES 0x00200000 | ||
| 270 | #define VOL_CAP_FMT_NO_PERMISSIONS 0x00400000 | ||
| 271 | #define VOL_CAP_FMT_SHARED_SPACE 0x00800000 | ||
| 272 | #define VOL_CAP_FMT_VOL_GROUPS 0x01000000 | ||
| 273 | #define VOL_CAP_FMT_SEALED 0x02000000 | ||
| 274 | |||
| 275 | /* | ||
| 276 | * VOL_CAP_INT_SEARCHFS: When set, the volume implements the | ||
| 277 | * searchfs() system call (the vnop_searchfs vnode operation). | ||
| 278 | * | ||
| 279 | * VOL_CAP_INT_ATTRLIST: When set, the volume implements the | ||
| 280 | * getattrlist() and setattrlist() system calls (vnop_getattrlist | ||
| 281 | * and vnop_setattrlist vnode operations) for the volume, files, | ||
| 282 | * and directories. The volume may or may not implement the | ||
| 283 | * readdirattr() system call. XXX Is there any minimum set | ||
| 284 | * of attributes that should be supported? To determine the | ||
| 285 | * set of supported attributes, get the ATTR_VOL_ATTRIBUTES | ||
| 286 | * attribute of the volume. | ||
| 287 | * | ||
| 288 | * VOL_CAP_INT_NFSEXPORT: When set, the volume implements exporting | ||
| 289 | * of NFS volumes. | ||
| 290 | * | ||
| 291 | * VOL_CAP_INT_READDIRATTR: When set, the volume implements the | ||
| 292 | * readdirattr() system call (vnop_readdirattr vnode operation). | ||
| 293 | * | ||
| 294 | * VOL_CAP_INT_EXCHANGEDATA: When set, the volume implements the | ||
| 295 | * exchangedata() system call (VNOP_EXCHANGE vnode operation). | ||
| 296 | * | ||
| 297 | * VOL_CAP_INT_COPYFILE: When set, the volume implements the | ||
| 298 | * VOP_COPYFILE vnode operation. (XXX There should be a copyfile() | ||
| 299 | * system call in <unistd.h>.) | ||
| 300 | * | ||
| 301 | * VOL_CAP_INT_ALLOCATE: When set, the volume implements the | ||
| 302 | * VNOP_ALLOCATE vnode operation, which means it implements the | ||
| 303 | * F_PREALLOCATE selector of fcntl(2). | ||
| 304 | * | ||
| 305 | * VOL_CAP_INT_VOL_RENAME: When set, the volume implements the | ||
| 306 | * ATTR_VOL_NAME attribute for both getattrlist() and setattrlist(). | ||
| 307 | * The volume can be renamed by setting ATTR_VOL_NAME with setattrlist(). | ||
| 308 | * | ||
| 309 | * VOL_CAP_INT_ADVLOCK: When set, the volume implements POSIX style | ||
| 310 | * byte range locks via vnop_advlock (accessible from fcntl(2)). | ||
| 311 | * | ||
| 312 | * VOL_CAP_INT_FLOCK: When set, the volume implements whole-file flock(2) | ||
| 313 | * style locks via vnop_advlock. This includes the O_EXLOCK and O_SHLOCK | ||
| 314 | * flags of the open(2) call. | ||
| 315 | * | ||
| 316 | * VOL_CAP_INT_EXTENDED_SECURITY: When set, the volume implements | ||
| 317 | * extended security (ACLs). | ||
| 318 | * | ||
| 319 | * VOL_CAP_INT_USERACCESS: When set, the volume supports the | ||
| 320 | * ATTR_CMN_USERACCESS attribute (used to get the user's access | ||
| 321 | * mode to the file). | ||
| 322 | * | ||
| 323 | * VOL_CAP_INT_MANLOCK: When set, the volume supports AFP-style | ||
| 324 | * mandatory byte range locks via an ioctl(). | ||
| 325 | * | ||
| 326 | * VOL_CAP_INT_EXTENDED_ATTR: When set, the volume implements | ||
| 327 | * native extended attribues. | ||
| 328 | * | ||
| 329 | * VOL_CAP_INT_NAMEDSTREAMS: When set, the volume supports | ||
| 330 | * native named streams. | ||
| 331 | * | ||
| 332 | * VOL_CAP_INT_CLONE: When set, the volume supports clones. | ||
| 333 | * | ||
| 334 | * VOL_CAP_INT_SNAPSHOT: When set, the volume supports snapshots. | ||
| 335 | * | ||
| 336 | * VOL_CAP_INT_RENAME_SWAP: When set, the volume supports swapping | ||
| 337 | * file system objects. | ||
| 338 | * | ||
| 339 | * VOL_CAP_INT_RENAME_EXCL: When set, the volume supports an | ||
| 340 | * exclusive rename operation. | ||
| 341 | * | ||
| 342 | * VOL_CAP_INT_RENAME_OPENFAIL: When set, the volume may fail rename | ||
| 343 | * operations on files that are open. | ||
| 344 | */ | ||
| 345 | #define VOL_CAP_INT_SEARCHFS 0x00000001 | ||
| 346 | #define VOL_CAP_INT_ATTRLIST 0x00000002 | ||
| 347 | #define VOL_CAP_INT_NFSEXPORT 0x00000004 | ||
| 348 | #define VOL_CAP_INT_READDIRATTR 0x00000008 | ||
| 349 | #define VOL_CAP_INT_EXCHANGEDATA 0x00000010 | ||
| 350 | #define VOL_CAP_INT_COPYFILE 0x00000020 | ||
| 351 | #define VOL_CAP_INT_ALLOCATE 0x00000040 | ||
| 352 | #define VOL_CAP_INT_VOL_RENAME 0x00000080 | ||
| 353 | #define VOL_CAP_INT_ADVLOCK 0x00000100 | ||
| 354 | #define VOL_CAP_INT_FLOCK 0x00000200 | ||
| 355 | #define VOL_CAP_INT_EXTENDED_SECURITY 0x00000400 | ||
| 356 | #define VOL_CAP_INT_USERACCESS 0x00000800 | ||
| 357 | #define VOL_CAP_INT_MANLOCK 0x00001000 | ||
| 358 | #define VOL_CAP_INT_NAMEDSTREAMS 0x00002000 | ||
| 359 | #define VOL_CAP_INT_EXTENDED_ATTR 0x00004000 | ||
| 360 | #define VOL_CAP_INT_CLONE 0x00010000 | ||
| 361 | #define VOL_CAP_INT_SNAPSHOT 0x00020000 | ||
| 362 | #define VOL_CAP_INT_RENAME_SWAP 0x00040000 | ||
| 363 | #define VOL_CAP_INT_RENAME_EXCL 0x00080000 | ||
| 364 | #define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000 | ||
| 365 | |||
| 366 | typedef struct vol_attributes_attr { | ||
| 367 | 	attribute_set_t validattr; | ||
| 368 | 	attribute_set_t nativeattr; | ||
| 369 | } vol_attributes_attr_t; | ||
| 370 | |||
| 371 | #define ATTR_CMN_NAME 0x00000001 | ||
| 372 | #define ATTR_CMN_DEVID 0x00000002 | ||
| 373 | #define ATTR_CMN_FSID 0x00000004 | ||
| 374 | #define ATTR_CMN_OBJTYPE 0x00000008 | ||
| 375 | #define ATTR_CMN_OBJTAG 0x00000010 | ||
| 376 | #define ATTR_CMN_OBJID 0x00000020 | ||
| 377 | #define ATTR_CMN_OBJPERMANENTID 0x00000040 | ||
| 378 | #define ATTR_CMN_PAROBJID 0x00000080 | ||
| 379 | #define ATTR_CMN_SCRIPT 0x00000100 | ||
| 380 | #define ATTR_CMN_CRTIME 0x00000200 | ||
| 381 | #define ATTR_CMN_MODTIME 0x00000400 | ||
| 382 | #define ATTR_CMN_CHGTIME 0x00000800 | ||
| 383 | #define ATTR_CMN_ACCTIME 0x00001000 | ||
| 384 | #define ATTR_CMN_BKUPTIME 0x00002000 | ||
| 385 | #define ATTR_CMN_FNDRINFO 0x00004000 | ||
| 386 | #define ATTR_CMN_OWNERID 0x00008000 | ||
| 387 | #define ATTR_CMN_GRPID 0x00010000 | ||
| 388 | #define ATTR_CMN_ACCESSMASK 0x00020000 | ||
| 389 | #define ATTR_CMN_FLAGS 0x00040000 | ||
| 390 | |||
| 391 | /* The following were defined as:				*/ | ||
| 392 | /* #define ATTR_CMN_NAMEDATTRCOUNT		0x00080000	*/ | ||
| 393 | /* #define ATTR_CMN_NAMEDATTRLIST		0x00100000	*/ | ||
| 394 | /* These bits have been salvaged for use as:			*/ | ||
| 395 | /*	#define ATTR_CMN_GEN_COUNT		0x00080000	*/ | ||
| 396 | /*	#define ATTR_CMN_DOCUMENT_ID		0x00100000	*/ | ||
| 397 | /* They can only be used with the FSOPT_ATTR_CMN_EXTENDED	*/ | ||
| 398 | /* option flag. */ | ||
| 399 | |||
| 400 | #define ATTR_CMN_GEN_COUNT 0x00080000 | ||
| 401 | #define ATTR_CMN_DOCUMENT_ID 0x00100000 | ||
| 402 | |||
| 403 | #define ATTR_CMN_USERACCESS 0x00200000 | ||
| 404 | #define ATTR_CMN_EXTENDED_SECURITY 0x00400000 | ||
| 405 | #define ATTR_CMN_UUID 0x00800000 | ||
| 406 | #define ATTR_CMN_GRPUUID 0x01000000 | ||
| 407 | #define ATTR_CMN_FILEID 0x02000000 | ||
| 408 | #define ATTR_CMN_PARENTID 0x04000000 | ||
| 409 | #define ATTR_CMN_FULLPATH 0x08000000 | ||
| 410 | #define ATTR_CMN_ADDEDTIME 0x10000000 | ||
| 411 | #define ATTR_CMN_ERROR 0x20000000 | ||
| 412 | #define ATTR_CMN_DATA_PROTECT_FLAGS 0x40000000 | ||
| 413 | |||
| 414 | /* | ||
| 415 | * ATTR_CMN_RETURNED_ATTRS is only valid with getattrlist(2) and | ||
| 416 | * getattrlistbulk(2). It is always the first attribute in the return buffer. | ||
| 417 | */ | ||
| 418 | #define ATTR_CMN_RETURNED_ATTRS 0x80000000 | ||
| 419 | |||
| 420 | #define ATTR_CMN_VALIDMASK 0xFFFFFFFF | ||
| 421 | /* | ||
| 422 | * The settable ATTR_CMN_* attributes include the following: | ||
| 423 | * ATTR_CMN_SCRIPT | ||
| 424 | * ATTR_CMN_CRTIME | ||
| 425 | * ATTR_CMN_MODTIME | ||
| 426 | * ATTR_CMN_CHGTIME | ||
| 427 | * | ||
| 428 | * ATTR_CMN_ACCTIME | ||
| 429 | * ATTR_CMN_BKUPTIME | ||
| 430 | * ATTR_CMN_FNDRINFO | ||
| 431 | * ATTR_CMN_OWNERID | ||
| 432 | * | ||
| 433 | * ATTR_CMN_GRPID | ||
| 434 | * ATTR_CMN_ACCESSMASK | ||
| 435 | * ATTR_CMN_FLAGS | ||
| 436 | * | ||
| 437 | * ATTR_CMN_EXTENDED_SECURITY | ||
| 438 | * ATTR_CMN_UUID | ||
| 439 | * | ||
| 440 | * ATTR_CMN_GRPUUID | ||
| 441 | * | ||
| 442 | * ATTR_CMN_DATA_PROTECT_FLAGS | ||
| 443 | */ | ||
| 444 | #define ATTR_CMN_SETMASK 0x51C7FF00 | ||
| 445 | #define ATTR_CMN_VOLSETMASK 0x00006700 | ||
| 446 | |||
| 447 | #define ATTR_VOL_FSTYPE 0x00000001 | ||
| 448 | #define ATTR_VOL_SIGNATURE 0x00000002 | ||
| 449 | #define ATTR_VOL_SIZE 0x00000004 | ||
| 450 | #define ATTR_VOL_SPACEFREE 0x00000008 | ||
| 451 | #define ATTR_VOL_SPACEAVAIL 0x00000010 | ||
| 452 | #define ATTR_VOL_MINALLOCATION 0x00000020 | ||
| 453 | #define ATTR_VOL_ALLOCATIONCLUMP 0x00000040 | ||
| 454 | #define ATTR_VOL_IOBLOCKSIZE 0x00000080 | ||
| 455 | #define ATTR_VOL_OBJCOUNT 0x00000100 | ||
| 456 | #define ATTR_VOL_FILECOUNT 0x00000200 | ||
| 457 | #define ATTR_VOL_DIRCOUNT 0x00000400 | ||
| 458 | #define ATTR_VOL_MAXOBJCOUNT 0x00000800 | ||
| 459 | #define ATTR_VOL_MOUNTPOINT 0x00001000 | ||
| 460 | #define ATTR_VOL_NAME 0x00002000 | ||
| 461 | #define ATTR_VOL_MOUNTFLAGS 0x00004000 | ||
| 462 | #define ATTR_VOL_MOUNTEDDEVICE 0x00008000 | ||
| 463 | #define ATTR_VOL_ENCODINGSUSED 0x00010000 | ||
| 464 | #define ATTR_VOL_CAPABILITIES 0x00020000 | ||
| 465 | #define ATTR_VOL_UUID 0x00040000 | ||
| 466 | #define ATTR_VOL_QUOTA_SIZE 0x10000000 | ||
| 467 | #define ATTR_VOL_RESERVED_SIZE 0x20000000 | ||
| 468 | #define ATTR_VOL_ATTRIBUTES 0x40000000 | ||
| 469 | #define ATTR_VOL_INFO 0x80000000 | ||
| 470 | |||
| 471 | #define ATTR_VOL_VALIDMASK 0xF007FFFF | ||
| 472 | |||
| 473 | /* | ||
| 474 | * The list of settable ATTR_VOL_* attributes include the following: | ||
| 475 | * ATTR_VOL_NAME | ||
| 476 | * ATTR_VOL_INFO | ||
| 477 | */ | ||
| 478 | #define ATTR_VOL_SETMASK 0x80002000 | ||
| 479 | |||
| 480 | |||
| 481 | /* File/directory attributes: */ | ||
| 482 | #define ATTR_DIR_LINKCOUNT 0x00000001 | ||
| 483 | #define ATTR_DIR_ENTRYCOUNT 0x00000002 | ||
| 484 | #define ATTR_DIR_MOUNTSTATUS 0x00000004 | ||
| 485 | #define ATTR_DIR_ALLOCSIZE 0x00000008 | ||
| 486 | #define ATTR_DIR_IOBLOCKSIZE 0x00000010 | ||
| 487 | #define ATTR_DIR_DATALENGTH 0x00000020 | ||
| 488 | |||
| 489 | /* ATTR_DIR_MOUNTSTATUS Flags: */ | ||
| 490 | #define DIR_MNTSTATUS_MNTPOINT 0x00000001 | ||
| 491 | #define DIR_MNTSTATUS_TRIGGER 0x00000002 | ||
| 492 | |||
| 493 | #define ATTR_DIR_VALIDMASK 0x0000003f | ||
| 494 | #define ATTR_DIR_SETMASK 0x00000000 | ||
| 495 | |||
| 496 | #define ATTR_FILE_LINKCOUNT 0x00000001 | ||
| 497 | #define ATTR_FILE_TOTALSIZE 0x00000002 | ||
| 498 | #define ATTR_FILE_ALLOCSIZE 0x00000004 | ||
| 499 | #define ATTR_FILE_IOBLOCKSIZE 0x00000008 | ||
| 500 | #define ATTR_FILE_DEVTYPE 0x00000020 | ||
| 501 | #define ATTR_FILE_FORKCOUNT 0x00000080 | ||
| 502 | #define ATTR_FILE_FORKLIST 0x00000100 | ||
| 503 | #define ATTR_FILE_DATALENGTH 0x00000200 | ||
| 504 | #define ATTR_FILE_DATAALLOCSIZE 0x00000400 | ||
| 505 | #define ATTR_FILE_RSRCLENGTH 0x00001000 | ||
| 506 | #define ATTR_FILE_RSRCALLOCSIZE 0x00002000 | ||
| 507 | |||
| 508 | #define ATTR_FILE_VALIDMASK 0x000037FF | ||
| 509 | /* | ||
| 510 | * Settable ATTR_FILE_* attributes include: | ||
| 511 | * ATTR_FILE_DEVTYPE | ||
| 512 | */ | ||
| 513 | #define ATTR_FILE_SETMASK 0x00000020 | ||
| 514 | |||
| 515 | /* CMNEXT attributes extend the common attributes, but in the forkattr field */ | ||
| 516 | #define ATTR_CMNEXT_RELPATH 0x00000004 | ||
| 517 | #define ATTR_CMNEXT_PRIVATESIZE 0x00000008 | ||
| 518 | #define ATTR_CMNEXT_LINKID 0x00000010 | ||
| 519 | #define ATTR_CMNEXT_NOFIRMLINKPATH 0x00000020 | ||
| 520 | #define ATTR_CMNEXT_REALDEVID 0x00000040 | ||
| 521 | #define ATTR_CMNEXT_REALFSID 0x00000080 | ||
| 522 | #define ATTR_CMNEXT_CLONEID 0x00000100 | ||
| 523 | #define ATTR_CMNEXT_EXT_FLAGS 0x00000200 | ||
| 524 | #define ATTR_CMNEXT_RECURSIVE_GENCOUNT 0x00000400 | ||
| 525 | |||
| 526 | #define ATTR_CMNEXT_VALIDMASK 0x000007fc | ||
| 527 | #define ATTR_CMNEXT_SETMASK 0x00000000 | ||
| 528 | |||
| 529 | /* Deprecated fork attributes */ | ||
| 530 | #define ATTR_FORK_TOTALSIZE 0x00000001 | ||
| 531 | #define ATTR_FORK_ALLOCSIZE 0x00000002 | ||
| 532 | #define ATTR_FORK_RESERVED 0xffffffff | ||
| 533 | |||
| 534 | #define ATTR_FORK_VALIDMASK 0x00000003 | ||
| 535 | #define ATTR_FORK_SETMASK 0x00000000 | ||
| 536 | |||
| 537 | /* Obsolete, implemented, not supported */ | ||
| 538 | #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000 | ||
| 539 | #define ATTR_CMN_NAMEDATTRLIST 0x00100000 | ||
| 540 | #define ATTR_FILE_CLUMPSIZE 0x00000010 /* obsolete */ | ||
| 541 | #define ATTR_FILE_FILETYPE 0x00000040 /* always zero */ | ||
| 542 | #define ATTR_FILE_DATAEXTENTS 0x00000800 /* obsolete, HFS-specific */ | ||
| 543 | #define ATTR_FILE_RSRCEXTENTS 0x00004000 /* obsolete, HFS-specific */ | ||
| 544 | |||
| 545 | /* Required attributes for getattrlistbulk(2) */ | ||
| 546 | #define ATTR_BULK_REQUIRED (ATTR_CMN_NAME | ATTR_CMN_RETURNED_ATTRS) | ||
| 547 | |||
| 548 | /* | ||
| 549 | * Searchfs | ||
| 550 | */ | ||
| 551 | #define SRCHFS_START 0x00000001 | ||
| 552 | #define SRCHFS_MATCHPARTIALNAMES 0x00000002 | ||
| 553 | #define SRCHFS_MATCHDIRS 0x00000004 | ||
| 554 | #define SRCHFS_MATCHFILES 0x00000008 | ||
| 555 | #define SRCHFS_SKIPLINKS 0x00000010 | ||
| 556 | #define SRCHFS_SKIPINVISIBLE 0x00000020 | ||
| 557 | #define SRCHFS_SKIPPACKAGES 0x00000040 | ||
| 558 | #define SRCHFS_SKIPINAPPROPRIATE 0x00000080 | ||
| 559 | |||
| 560 | #define SRCHFS_NEGATEPARAMS 0x80000000 | ||
| 561 | #define SRCHFS_VALIDOPTIONSMASK 0x800000FF | ||
| 562 | |||
| 563 | struct fssearchblock { | ||
| 564 | 	struct attrlist *returnattrs; | ||
| 565 | 	void *returnbuffer; | ||
| 566 | 	size_t returnbuffersize; | ||
| 567 | 	u_long maxmatches; | ||
| 568 | 	struct timeval timelimit; | ||
| 569 | 	void *searchparams1; | ||
| 570 | 	size_t sizeofsearchparams1; | ||
| 571 | 	void *searchparams2; | ||
| 572 | 	size_t sizeofsearchparams2; | ||
| 573 | 	struct attrlist searchattrs; | ||
| 574 | }; | ||
| 575 | |||
| 576 | |||
| 577 | struct searchstate { | ||
| 578 | 	uint32_t ss_union_flags; // for SRCHFS_START | ||
| 579 | 	uint32_t ss_union_layer; // 0 = top | ||
| 580 | 	u_char ss_fsstate[548]; // fs private | ||
| 581 | } __attribute__((packed)); | ||
| 582 | |||
| 583 | #define FST_EOF (-1) /* end-of-file offset */ | ||
| 584 | |||
| 585 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 586 | #endif /* !_SYS_ATTR_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/cdefs.h+32-11| ... | @@ -174,6 +174,15 @@ | ... | @@ -174,6 +174,15 @@ |
| 174 | #define __cold | 174 | #define __cold |
| 175 | #endif | 175 | #endif |
| 176 | 176 | ||
| 177 | /* __exported denotes symbols that should be exported even when symbols | ||
| 178 | * are hidden by default. | ||
| 179 | * __exported_push/_exported_pop are pragmas used to delimit a range of | ||
| 180 | * symbols that should be exported even when symbols are hidden by default. | ||
| 181 | */ | ||
| 182 | #define __exported __attribute__((__visibility__("default"))) | ||
| 183 | #define __exported_push _Pragma("GCC visibility push(default)") | ||
| 184 | #define __exported_pop _Pragma("GCC visibility pop") | ||
| 185 | |||
| 177 | /* __deprecated causes the compiler to produce a warning when encountering | 186 | /* __deprecated causes the compiler to produce a warning when encountering |
| 178 | * code using the deprecated functionality. | 187 | * code using the deprecated functionality. |
| 179 | * __deprecated_msg() does the same, and compilers that support it will print | 188 | * __deprecated_msg() does the same, and compilers that support it will print |
| ... | @@ -202,9 +211,17 @@ | ... | @@ -202,9 +211,17 @@ |
| 202 | #define __kpi_deprecated(_msg) | 211 | #define __kpi_deprecated(_msg) |
| 203 | 212 | ||
| 204 | /* __unavailable causes the compiler to error out when encountering | 213 | /* __unavailable causes the compiler to error out when encountering |
| 205 | * code using the tagged function of variable. | 214 | * code using the tagged function |
| 206 | */ | 215 | */ |
| 207 | #define __unavailable __attribute__((__unavailable__)) | 216 | #if __has_attribute(unavailable) |
| 217 | #define __unavailable __attribute__((__unavailable__)) | ||
| 218 | #else | ||
| 219 | #define __unavailable | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #define __kpi_unavailable | ||
| 223 | |||
| 224 | #define __kpi_deprecated_arm64_macos_unavailable | ||
| 208 | 225 | ||
| 209 | /* Delete pseudo-keywords wherever they are not available or needed. */ | 226 | /* Delete pseudo-keywords wherever they are not available or needed. */ |
| 210 | #ifndef __dead | 227 | #ifndef __dead |
| ... | @@ -471,9 +488,19 @@ | ... | @@ -471,9 +488,19 @@ |
| 471 | 488 | ||
| 472 | /* These settings are particular to each product. */ | 489 | /* These settings are particular to each product. */ |
| 473 | /* Platform: MacOSX */ | 490 | /* Platform: MacOSX */ |
| 491 | #if defined(__i386__) | ||
| 474 | #define __DARWIN_ONLY_64_BIT_INO_T 0 | 492 | #define __DARWIN_ONLY_64_BIT_INO_T 0 |
| 475 | /* #undef __DARWIN_ONLY_UNIX_CONFORMANCE (automatically set for 64-bit) */ | 493 | #define __DARWIN_ONLY_UNIX_CONFORMANCE 0 |
| 476 | #define __DARWIN_ONLY_VERS_1050 0 | 494 | #define __DARWIN_ONLY_VERS_1050 0 |
| 495 | #elif defined(__x86_64__) | ||
| 496 | #define __DARWIN_ONLY_64_BIT_INO_T 0 | ||
| 497 | #define __DARWIN_ONLY_UNIX_CONFORMANCE 1 | ||
| 498 | #define __DARWIN_ONLY_VERS_1050 0 | ||
| 499 | #else | ||
| 500 | #define __DARWIN_ONLY_64_BIT_INO_T 1 | ||
| 501 | #define __DARWIN_ONLY_UNIX_CONFORMANCE 1 | ||
| 502 | #define __DARWIN_ONLY_VERS_1050 1 | ||
| 503 | #endif | ||
| 477 | 504 | ||
| 478 | /* | 505 | /* |
| 479 | * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow | 506 | * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow |
| ... | @@ -493,14 +520,6 @@ | ... | @@ -493,14 +520,6 @@ |
| 493 | * pre-10.5, and it is the default compilation environment, revert the | 520 | * pre-10.5, and it is the default compilation environment, revert the |
| 494 | * compilation environment to pre-__DARWIN_UNIX03. | 521 | * compilation environment to pre-__DARWIN_UNIX03. |
| 495 | */ | 522 | */ |
| 496 | #if !defined(__DARWIN_ONLY_UNIX_CONFORMANCE) | ||
| 497 | # if defined(__LP64__) | ||
| 498 | # define __DARWIN_ONLY_UNIX_CONFORMANCE 1 | ||
| 499 | # else /* !__LP64__ */ | ||
| 500 | # define __DARWIN_ONLY_UNIX_CONFORMANCE 0 | ||
| 501 | # endif /* __LP64__ */ | ||
| 502 | #endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ | ||
| 503 | |||
| 504 | #if !defined(__DARWIN_UNIX03) | 523 | #if !defined(__DARWIN_UNIX03) |
| 505 | # if __DARWIN_ONLY_UNIX_CONFORMANCE | 524 | # if __DARWIN_ONLY_UNIX_CONFORMANCE |
| 506 | # if defined(_NONSTD_SOURCE) | 525 | # if defined(_NONSTD_SOURCE) |
| ... | @@ -803,6 +822,8 @@ | ... | @@ -803,6 +822,8 @@ |
| 803 | */ | 822 | */ |
| 804 | #if !defined(__sys_cdefs_arch_unknown__) && defined(__i386__) | 823 | #if !defined(__sys_cdefs_arch_unknown__) && defined(__i386__) |
| 805 | #elif !defined(__sys_cdefs_arch_unknown__) && defined(__x86_64__) | 824 | #elif !defined(__sys_cdefs_arch_unknown__) && defined(__x86_64__) |
| 825 | #elif !defined(__sys_cdefs_arch_unknown__) && defined(__arm__) | ||
| 826 | #elif !defined(__sys_cdefs_arch_unknown__) && defined(__arm64__) | ||
| 806 | #else | 827 | #else |
| 807 | #error Unsupported architecture | 828 | #error Unsupported architecture |
| 808 | #endif | 829 | #endif |
lib/libc/include/x86_64-macos-gnu/sys/dirent.h created+141| ... | @@ -0,0 +1,141 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1989, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)dirent.h	8.3 (Berkeley) 8/10/94 | ||
| 62 | */ | ||
| 63 | |||
| 64 | /* | ||
| 65 | * The dirent structure defines the format of directory entries. | ||
| 66 | * | ||
| 67 | * A directory entry has a struct dirent at the front of it, containing its | ||
| 68 | * inode number, the length of the entry, and the length of the name | ||
| 69 | * contained in the entry. These are followed by the name padded to a 4 | ||
| 70 | * byte boundary with null bytes. All names are guaranteed null terminated. | ||
| 71 | * The maximum length of a name in a directory is MAXNAMLEN when 32-bit | ||
| 72 | * ino_t is in effect; (MAXPATHLEN - 1) when 64-bit ino_t is in effect. | ||
| 73 | */ | ||
| 74 | |||
| 75 | #ifndef _SYS_DIRENT_H | ||
| 76 | #define _SYS_DIRENT_H | ||
| 77 | |||
| 78 | #include <sys/_types.h> | ||
| 79 | #include <sys/cdefs.h> | ||
| 80 | |||
| 81 | #include <sys/_types/_ino_t.h> | ||
| 82 | |||
| 83 | |||
| 84 | #define __DARWIN_MAXNAMLEN 255 | ||
| 85 | |||
| 86 | #pragma pack(4) | ||
| 87 | |||
| 88 | #if !__DARWIN_64_BIT_INO_T | ||
| 89 | struct dirent { | ||
| 90 | 	ino_t d_ino; /* file number of entry */ | ||
| 91 | 	__uint16_t d_reclen; /* length of this record */ | ||
| 92 | 	__uint8_t d_type; /* file type, see below */ | ||
| 93 | 	__uint8_t d_namlen; /* length of string in d_name */ | ||
| 94 | 	char d_name[__DARWIN_MAXNAMLEN + 1]; /* name must be no longer than this */ | ||
| 95 | }; | ||
| 96 | #endif /* !__DARWIN_64_BIT_INO_T */ | ||
| 97 | |||
| 98 | #pragma pack() | ||
| 99 | |||
| 100 | #define __DARWIN_MAXPATHLEN 1024 | ||
| 101 | |||
| 102 | #define __DARWIN_STRUCT_DIRENTRY { \ | ||
| 103 | 	__uint64_t d_ino; /* file number of entry */ \ | ||
| 104 | 	__uint64_t d_seekoff; /* seek offset (optional, used by servers) */ \ | ||
| 105 | 	__uint16_t d_reclen; /* length of this record */ \ | ||
| 106 | 	__uint16_t d_namlen; /* length of string in d_name */ \ | ||
| 107 | 	__uint8_t d_type; /* file type, see below */ \ | ||
| 108 | 	char d_name[__DARWIN_MAXPATHLEN]; /* entry name (up to MAXPATHLEN bytes) */ \ | ||
| 109 | } | ||
| 110 | |||
| 111 | #if __DARWIN_64_BIT_INO_T | ||
| 112 | struct dirent __DARWIN_STRUCT_DIRENTRY; | ||
| 113 | #endif /* __DARWIN_64_BIT_INO_T */ | ||
| 114 | |||
| 115 | |||
| 116 | |||
| 117 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 118 | #define d_fileno d_ino /* backward compatibility */ | ||
| 119 | #define MAXNAMLEN __DARWIN_MAXNAMLEN | ||
| 120 | /* | ||
| 121 | * File types | ||
| 122 | */ | ||
| 123 | #define DT_UNKNOWN 0 | ||
| 124 | #define DT_FIFO 1 | ||
| 125 | #define DT_CHR 2 | ||
| 126 | #define DT_DIR 4 | ||
| 127 | #define DT_BLK 6 | ||
| 128 | #define DT_REG 8 | ||
| 129 | #define DT_LNK 10 | ||
| 130 | #define DT_SOCK 12 | ||
| 131 | #define DT_WHT 14 | ||
| 132 | |||
| 133 | /* | ||
| 134 | * Convert between stat structure types and directory types. | ||
| 135 | */ | ||
| 136 | #define IFTODT(mode) (((mode) & 0170000) >> 12) | ||
| 137 | #define DTTOIF(dirtype) ((dirtype) << 12) | ||
| 138 | #endif | ||
| 139 | |||
| 140 | |||
| 141 | #endif /* _SYS_DIRENT_H */ | ||
lib/libc/include/x86_64-macos-gnu/sys/event.h created+396| ... | @@ -0,0 +1,396 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2003-2019 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*- | ||
| 29 | * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> | ||
| 30 | * All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * | ||
| 41 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 51 | * SUCH DAMAGE. | ||
| 52 | * | ||
| 53 | *	$FreeBSD: src/sys/sys/event.h,v 1.5.2.5 2001/12/14 19:21:22 jlemon Exp $ | ||
| 54 | */ | ||
| 55 | |||
| 56 | #ifndef _SYS_EVENT_H_ | ||
| 57 | #define _SYS_EVENT_H_ | ||
| 58 | |||
| 59 | #include <machine/types.h> | ||
| 60 | #include <sys/cdefs.h> | ||
| 61 | #include <stdint.h> | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Filter types | ||
| 65 | */ | ||
| 66 | #define EVFILT_READ (-1) | ||
| 67 | #define EVFILT_WRITE (-2) | ||
| 68 | #define EVFILT_AIO (-3) /* attached to aio requests */ | ||
| 69 | #define EVFILT_VNODE (-4) /* attached to vnodes */ | ||
| 70 | #define EVFILT_PROC (-5) /* attached to struct proc */ | ||
| 71 | #define EVFILT_SIGNAL (-6) /* attached to struct proc */ | ||
| 72 | #define EVFILT_TIMER (-7) /* timers */ | ||
| 73 | #define EVFILT_MACHPORT (-8) /* Mach portsets */ | ||
| 74 | #define EVFILT_FS (-9) /* Filesystem events */ | ||
| 75 | #define EVFILT_USER (-10) /* User events */ | ||
| 76 | #define EVFILT_VM (-12) /* Virtual memory events */ | ||
| 77 | #define EVFILT_EXCEPT (-15) /* Exception events */ | ||
| 78 | |||
| 79 | #define EVFILT_SYSCOUNT 17 | ||
| 80 | #define EVFILT_THREADMARKER EVFILT_SYSCOUNT /* Internal use only */ | ||
| 81 | |||
| 82 | #pragma pack(4) | ||
| 83 | |||
| 84 | struct kevent { | ||
| 85 | 	uintptr_t ident; /* identifier for this event */ | ||
| 86 | 	int16_t filter; /* filter for event */ | ||
| 87 | 	uint16_t flags; /* general flags */ | ||
| 88 | 	uint32_t fflags; /* filter-specific flags */ | ||
| 89 | 	intptr_t data; /* filter-specific data */ | ||
| 90 | 	void *udata; /* opaque user data identifier */ | ||
| 91 | }; | ||
| 92 | |||
| 93 | |||
| 94 | #pragma pack() | ||
| 95 | |||
| 96 | struct kevent64_s { | ||
| 97 | 	uint64_t ident; /* identifier for this event */ | ||
| 98 | 	int16_t filter; /* filter for event */ | ||
| 99 | 	uint16_t flags; /* general flags */ | ||
| 100 | 	uint32_t fflags; /* filter-specific flags */ | ||
| 101 | 	int64_t data; /* filter-specific data */ | ||
| 102 | 	uint64_t udata; /* opaque user data identifier */ | ||
| 103 | 	uint64_t ext[2]; /* filter-specific extensions */ | ||
| 104 | }; | ||
| 105 | |||
| 106 | |||
| 107 | #define EV_SET(kevp, a, b, c, d, e, f) do { \ | ||
| 108 | 	struct kevent *__kevp__ = (kevp); \ | ||
| 109 | 	__kevp__->ident = (a); \ | ||
| 110 | 	__kevp__->filter = (b); \ | ||
| 111 | 	__kevp__->flags = (c); \ | ||
| 112 | 	__kevp__->fflags = (d); \ | ||
| 113 | 	__kevp__->data = (e); \ | ||
| 114 | 	__kevp__->udata = (f); \ | ||
| 115 | } while(0) | ||
| 116 | |||
| 117 | #define EV_SET64(kevp, a, b, c, d, e, f, g, h) do { \ | ||
| 118 | 	struct kevent64_s *__kevp__ = (kevp); \ | ||
| 119 | 	__kevp__->ident = (a); \ | ||
| 120 | 	__kevp__->filter = (b); \ | ||
| 121 | 	__kevp__->flags = (c); \ | ||
| 122 | 	__kevp__->fflags = (d); \ | ||
| 123 | 	__kevp__->data = (e); \ | ||
| 124 | 	__kevp__->udata = (f); \ | ||
| 125 | 	__kevp__->ext[0] = (g); \ | ||
| 126 | 	__kevp__->ext[1] = (h); \ | ||
| 127 | } while(0) | ||
| 128 | |||
| 129 | |||
| 130 | /* kevent system call flags */ | ||
| 131 | #define KEVENT_FLAG_NONE 0x000000 /* no flag value */ | ||
| 132 | #define KEVENT_FLAG_IMMEDIATE 0x000001 /* immediate timeout */ | ||
| 133 | #define KEVENT_FLAG_ERROR_EVENTS 0x000002 /* output events only include change errors */ | ||
| 134 | |||
| 135 | |||
| 136 | /* actions */ | ||
| 137 | #define EV_ADD 0x0001 /* add event to kq (implies enable) */ | ||
| 138 | #define EV_DELETE 0x0002 /* delete event from kq */ | ||
| 139 | #define EV_ENABLE 0x0004 /* enable event */ | ||
| 140 | #define EV_DISABLE 0x0008 /* disable event (not reported) */ | ||
| 141 | |||
| 142 | /* flags */ | ||
| 143 | #define EV_ONESHOT 0x0010 /* only report one occurrence */ | ||
| 144 | #define EV_CLEAR 0x0020 /* clear event state after reporting */ | ||
| 145 | #define EV_RECEIPT 0x0040 /* force immediate event output */ | ||
| 146 | /* ... with or without EV_ERROR */ | ||
| 147 | /* ... use KEVENT_FLAG_ERROR_EVENTS */ | ||
| 148 | /* on syscalls supporting flags */ | ||
| 149 | |||
| 150 | #define EV_DISPATCH 0x0080 /* disable event after reporting */ | ||
| 151 | #define EV_UDATA_SPECIFIC 0x0100 /* unique kevent per udata value */ | ||
| 152 | |||
| 153 | #define EV_DISPATCH2 (EV_DISPATCH | EV_UDATA_SPECIFIC) | ||
| 154 | /* ... in combination with EV_DELETE */ | ||
| 155 | /* will defer delete until udata-specific */ | ||
| 156 | /* event enabled. EINPROGRESS will be */ | ||
| 157 | /* returned to indicate the deferral */ | ||
| 158 | |||
| 159 | #define EV_VANISHED 0x0200 /* report that source has vanished */ | ||
| 160 | /* ... only valid with EV_DISPATCH2 */ | ||
| 161 | |||
| 162 | #define EV_SYSFLAGS 0xF000 /* reserved by system */ | ||
| 163 | #define EV_FLAG0 0x1000 /* filter-specific flag */ | ||
| 164 | #define EV_FLAG1 0x2000 /* filter-specific flag */ | ||
| 165 | |||
| 166 | /* returned values */ | ||
| 167 | #define EV_EOF 0x8000 /* EOF detected */ | ||
| 168 | #define EV_ERROR 0x4000 /* error, data contains errno */ | ||
| 169 | |||
| 170 | /* | ||
| 171 | * Filter specific flags for EVFILT_READ | ||
| 172 | * | ||
| 173 | * The default behavior for EVFILT_READ is to make the "read" determination | ||
| 174 | * relative to the current file descriptor read pointer. | ||
| 175 | * | ||
| 176 | * The EV_POLL flag indicates the determination should be made via poll(2) | ||
| 177 | * semantics. These semantics dictate always returning true for regular files, | ||
| 178 | * regardless of the amount of unread data in the file. | ||
| 179 | * | ||
| 180 | * On input, EV_OOBAND specifies that filter should actively return in the | ||
| 181 | * presence of OOB on the descriptor. It implies that filter will return | ||
| 182 | * if there is OOB data available to read OR when any other condition | ||
| 183 | * for the read are met (for example number of bytes regular data becomes >= | ||
| 184 | * low-watermark). | ||
| 185 | * If EV_OOBAND is not set on input, it implies that the filter should not actively | ||
| 186 | * return for out of band data on the descriptor. The filter will then only return | ||
| 187 | * when some other condition for read is met (ex: when number of regular data bytes | ||
| 188 | * >=low-watermark OR when socket can't receive more data (SS_CANTRCVMORE)). | ||
| 189 | * | ||
| 190 | * On output, EV_OOBAND indicates the presence of OOB data on the descriptor. | ||
| 191 | * If it was not specified as an input parameter, then the data count is the | ||
| 192 | * number of bytes before the current OOB marker, else data count is the number | ||
| 193 | * of bytes beyond OOB marker. | ||
| 194 | */ | ||
| 195 | #define EV_POLL EV_FLAG0 | ||
| 196 | #define EV_OOBAND EV_FLAG1 | ||
| 197 | |||
| 198 | /* | ||
| 199 | * data/hint fflags for EVFILT_USER, shared with userspace | ||
| 200 | */ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * On input, NOTE_TRIGGER causes the event to be triggered for output. | ||
| 204 | */ | ||
| 205 | #define NOTE_TRIGGER 0x01000000 | ||
| 206 | |||
| 207 | /* | ||
| 208 | * On input, the top two bits of fflags specifies how the lower twenty four | ||
| 209 | * bits should be applied to the stored value of fflags. | ||
| 210 | * | ||
| 211 | * On output, the top two bits will always be set to NOTE_FFNOP and the | ||
| 212 | * remaining twenty four bits will contain the stored fflags value. | ||
| 213 | */ | ||
| 214 | #define NOTE_FFNOP 0x00000000 /* ignore input fflags */ | ||
| 215 | #define NOTE_FFAND 0x40000000 /* and fflags */ | ||
| 216 | #define NOTE_FFOR 0x80000000 /* or fflags */ | ||
| 217 | #define NOTE_FFCOPY 0xc0000000 /* copy fflags */ | ||
| 218 | #define NOTE_FFCTRLMASK 0xc0000000 /* mask for operations */ | ||
| 219 | #define NOTE_FFLAGSMASK 0x00ffffff | ||
| 220 | |||
| 221 | |||
| 222 | /* | ||
| 223 | * data/hint fflags for EVFILT_{READ|WRITE}, shared with userspace | ||
| 224 | * | ||
| 225 | * The default behavior for EVFILT_READ is to make the determination | ||
| 226 | * realtive to the current file descriptor read pointer. | ||
| 227 | */ | ||
| 228 | #define NOTE_LOWAT 0x00000001 /* low water mark */ | ||
| 229 | |||
| 230 | /* data/hint flags for EVFILT_EXCEPT, shared with userspace */ | ||
| 231 | #define NOTE_OOB 0x00000002 /* OOB data */ | ||
| 232 | |||
| 233 | /* | ||
| 234 | * data/hint fflags for EVFILT_VNODE, shared with userspace | ||
| 235 | */ | ||
| 236 | #define NOTE_DELETE 0x00000001 /* vnode was removed */ | ||
| 237 | #define NOTE_WRITE 0x00000002 /* data contents changed */ | ||
| 238 | #define NOTE_EXTEND 0x00000004 /* size increased */ | ||
| 239 | #define NOTE_ATTRIB 0x00000008 /* attributes changed */ | ||
| 240 | #define NOTE_LINK 0x00000010 /* link count changed */ | ||
| 241 | #define NOTE_RENAME 0x00000020 /* vnode was renamed */ | ||
| 242 | #define NOTE_REVOKE 0x00000040 /* vnode access was revoked */ | ||
| 243 | #define NOTE_NONE 0x00000080 /* No specific vnode event: to test for EVFILT_READ activation*/ | ||
| 244 | #define NOTE_FUNLOCK 0x00000100 /* vnode was unlocked by flock(2) */ | ||
| 245 | |||
| 246 | /* | ||
| 247 | * data/hint fflags for EVFILT_PROC, shared with userspace | ||
| 248 | * | ||
| 249 | * Please note that EVFILT_PROC and EVFILT_SIGNAL share the same knote list | ||
| 250 | * that hangs off the proc structure. They also both play games with the hint | ||
| 251 | * passed to KNOTE(). If NOTE_SIGNAL is passed as a hint, then the lower bits | ||
| 252 | * of the hint contain the signal. IF NOTE_FORK is passed, then the lower bits | ||
| 253 | * contain the PID of the child (but the pid does not get passed through in | ||
| 254 | * the actual kevent). | ||
| 255 | */ | ||
| 256 | enum { | ||
| 257 | 	eNoteReapDeprecated __deprecated_enum_msg("This kqueue(2) EVFILT_PROC flag is deprecated") = 0x10000000 | ||
| 258 | }; | ||
| 259 | |||
| 260 | #define NOTE_EXIT 0x80000000 /* process exited */ | ||
| 261 | #define NOTE_FORK 0x40000000 /* process forked */ | ||
| 262 | #define NOTE_EXEC 0x20000000 /* process exec'd */ | ||
| 263 | #define NOTE_REAP ((unsigned int)eNoteReapDeprecated /* 0x10000000 */ ) /* process reaped */ | ||
| 264 | #define NOTE_SIGNAL 0x08000000 /* shared with EVFILT_SIGNAL */ | ||
| 265 | #define NOTE_EXITSTATUS 0x04000000 /* exit status to be returned, valid for child process or when allowed to signal target pid */ | ||
| 266 | #define NOTE_EXIT_DETAIL 0x02000000 /* provide details on reasons for exit */ | ||
| 267 | |||
| 268 | #define NOTE_PDATAMASK 0x000fffff /* mask for signal & exit status */ | ||
| 269 | #define NOTE_PCTRLMASK (~NOTE_PDATAMASK) | ||
| 270 | |||
| 271 | /* | ||
| 272 | * If NOTE_EXITSTATUS is present, provide additional info about exiting process. | ||
| 273 | */ | ||
| 274 | enum { | ||
| 275 | 	eNoteExitReparentedDeprecated __deprecated_enum_msg("This kqueue(2) EVFILT_PROC flag is no longer sent") = 0x00080000 | ||
| 276 | }; | ||
| 277 | #define NOTE_EXIT_REPARENTED ((unsigned int)eNoteExitReparentedDeprecated) /* exited while reparented */ | ||
| 278 | |||
| 279 | /* | ||
| 280 | * If NOTE_EXIT_DETAIL is present, these bits indicate specific reasons for exiting. | ||
| 281 | */ | ||
| 282 | #define NOTE_EXIT_DETAIL_MASK 0x00070000 | ||
| 283 | #define NOTE_EXIT_DECRYPTFAIL 0x00010000 | ||
| 284 | #define NOTE_EXIT_MEMORY 0x00020000 | ||
| 285 | #define NOTE_EXIT_CSERROR 0x00040000 | ||
| 286 | |||
| 287 | |||
| 288 | /* | ||
| 289 | * data/hint fflags for EVFILT_VM, shared with userspace. | ||
| 290 | */ | ||
| 291 | #define NOTE_VM_PRESSURE 0x80000000 /* will react on memory pressure */ | ||
| 292 | #define NOTE_VM_PRESSURE_TERMINATE 0x40000000 /* will quit on memory pressure, possibly after cleaning up dirty state */ | ||
| 293 | #define NOTE_VM_PRESSURE_SUDDEN_TERMINATE 0x20000000 /* will quit immediately on memory pressure */ | ||
| 294 | #define NOTE_VM_ERROR 0x10000000 /* there was an error */ | ||
| 295 | |||
| 296 | |||
| 297 | /* | ||
| 298 | * data/hint fflags for EVFILT_TIMER, shared with userspace. | ||
| 299 | * The default is a (repeating) interval timer with the data | ||
| 300 | * specifying the timeout interval in milliseconds. | ||
| 301 | * | ||
| 302 | * All timeouts are implicitly EV_CLEAR events. | ||
| 303 | */ | ||
| 304 | #define NOTE_SECONDS 0x00000001 /* data is seconds */ | ||
| 305 | #define NOTE_USECONDS 0x00000002 /* data is microseconds */ | ||
| 306 | #define NOTE_NSECONDS 0x00000004 /* data is nanoseconds */ | ||
| 307 | #define NOTE_ABSOLUTE 0x00000008 /* absolute timeout */ | ||
| 308 | /* ... implicit EV_ONESHOT, timeout uses the gettimeofday epoch */ | ||
| 309 | #define NOTE_LEEWAY 0x00000010 /* ext[1] holds leeway for power aware timers */ | ||
| 310 | #define NOTE_CRITICAL 0x00000020 /* system does minimal timer coalescing */ | ||
| 311 | #define NOTE_BACKGROUND 0x00000040 /* system does maximum timer coalescing */ | ||
| 312 | #define NOTE_MACH_CONTINUOUS_TIME 0x00000080 | ||
| 313 | /* | ||
| 314 | * NOTE_MACH_CONTINUOUS_TIME: | ||
| 315 | * with NOTE_ABSOLUTE: causes the timer to continue to tick across sleep, | ||
| 316 | * still uses gettimeofday epoch | ||
| 317 | * with NOTE_MACHTIME and NOTE_ABSOLUTE: uses mach continuous time epoch | ||
| 318 | * without NOTE_ABSOLUTE (interval timer mode): continues to tick across sleep | ||
| 319 | */ | ||
| 320 | #define NOTE_MACHTIME 0x00000100 /* data is mach absolute time units */ | ||
| 321 | /* timeout uses the mach absolute time epoch */ | ||
| 322 | |||
| 323 | |||
| 324 | /* | ||
| 325 | * data/hint fflags for EVFILT_MACHPORT, shared with userspace. | ||
| 326 | * | ||
| 327 | * Only portsets are supported at this time. | ||
| 328 | * | ||
| 329 | * The fflags field can optionally contain the MACH_RCV_MSG, MACH_RCV_LARGE, | ||
| 330 | * and related trailer receive options as defined in <mach/message.h>. | ||
| 331 | * The presence of these flags directs the kevent64() call to attempt to receive | ||
| 332 | * the message during kevent delivery, rather than just indicate that a message exists. | ||
| 333 | * On setup, The ext[0] field contains the receive buffer pointer and ext[1] contains | ||
| 334 | * the receive buffer length. Upon event delivery, the actual received message size | ||
| 335 | * is returned in ext[1]. As with mach_msg(), the buffer must be large enough to | ||
| 336 | * receive the message and the requested (or default) message trailers. In addition, | ||
| 337 | * the fflags field contains the return code normally returned by mach_msg(). | ||
| 338 | * | ||
| 339 | * If MACH_RCV_MSG is specified, and the ext[1] field specifies a zero length, the | ||
| 340 | * system call argument specifying an ouput area (kevent_qos) will be consulted. If | ||
| 341 | * the system call specified an output data area, the user-space address | ||
| 342 | * of the received message is carved from that provided output data area (if enough | ||
| 343 | * space remains there). The address and length of each received message is | ||
| 344 | * returned in the ext[0] and ext[1] fields (respectively) of the corresponding kevent. | ||
| 345 | * | ||
| 346 | * IF_MACH_RCV_VOUCHER_CONTENT is specified, the contents of the message voucher is | ||
| 347 | * extracted (as specified in the xflags field) and stored in ext[2] up to ext[3] | ||
| 348 | * length. If the input length is zero, and the system call provided a data area, | ||
| 349 | * the space for the voucher content is carved from the provided space and its | ||
| 350 | * address and length is returned in ext[2] and ext[3] respectively. | ||
| 351 | * | ||
| 352 | * If no message receipt options were provided in the fflags field on setup, no | ||
| 353 | * message is received by this call. Instead, on output, the data field simply | ||
| 354 | * contains the name of the actual port detected with a message waiting. | ||
| 355 | */ | ||
| 356 | |||
| 357 | /* | ||
| 358 | * DEPRECATED!!!!!!!!! | ||
| 359 | * NOTE_TRACK, NOTE_TRACKERR, and NOTE_CHILD are no longer supported as of 10.5 | ||
| 360 | */ | ||
| 361 | /* additional flags for EVFILT_PROC */ | ||
| 362 | #define NOTE_TRACK 0x00000001 /* follow across forks */ | ||
| 363 | #define NOTE_TRACKERR 0x00000002 /* could not track child */ | ||
| 364 | #define NOTE_CHILD 0x00000004 /* am a child process */ | ||
| 365 | |||
| 366 | |||
| 367 | |||
| 368 | /* Temporay solution for BootX to use inode.h till kqueue moves to vfs layer */ | ||
| 369 | #include <sys/queue.h> | ||
| 370 | struct knote; | ||
| 371 | SLIST_HEAD(klist, knote); | ||
| 372 | |||
| 373 | |||
| 374 | #include <sys/types.h> | ||
| 375 | |||
| 376 | struct timespec; | ||
| 377 | |||
| 378 | __BEGIN_DECLS | ||
| 379 | int kqueue(void); | ||
| 380 | int kevent(int kq, | ||
| 381 | const struct kevent *changelist, int nchanges, | ||
| 382 | struct kevent *eventlist, int nevents, | ||
| 383 | const struct timespec *timeout); | ||
| 384 | int kevent64(int kq, | ||
| 385 | const struct kevent64_s *changelist, int nchanges, | ||
| 386 | struct kevent64_s *eventlist, int nevents, | ||
| 387 | unsigned int flags, | ||
| 388 | const struct timespec *timeout); | ||
| 389 | |||
| 390 | |||
| 391 | __END_DECLS | ||
| 392 | |||
| 393 | |||
| 394 | |||
| 395 | |||
| 396 | #endif /* !_SYS_EVENT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/fcntl.h created+581| ... | @@ -0,0 +1,581 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1983, 1990, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | *	This product includes software developed by the University of | ||
| 49 | *	California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)fcntl.h	8.3 (Berkeley) 1/21/94 | ||
| 67 | */ | ||
| 68 | |||
| 69 | |||
| 70 | #ifndef _SYS_FCNTL_H_ | ||
| 71 | #define _SYS_FCNTL_H_ | ||
| 72 | |||
| 73 | /* | ||
| 74 | * This file includes the definitions for open and fcntl | ||
| 75 | * described by POSIX for <fcntl.h>; it also includes | ||
| 76 | * related kernel definitions. | ||
| 77 | */ | ||
| 78 | #include <sys/_types.h> | ||
| 79 | #include <sys/cdefs.h> | ||
| 80 | #include <Availability.h> | ||
| 81 | |||
| 82 | /* We should not be exporting size_t here. Temporary for gcc bootstrapping. */ | ||
| 83 | #include <sys/_types/_size_t.h> | ||
| 84 | #include <sys/_types/_mode_t.h> | ||
| 85 | #include <sys/_types/_off_t.h> | ||
| 86 | #include <sys/_types/_pid_t.h> | ||
| 87 | |||
| 88 | /* | ||
| 89 | * File status flags: these are used by open(2), fcntl(2). | ||
| 90 | * They are also used (indirectly) in the kernel file structure f_flags, | ||
| 91 | * which is a superset of the open/fcntl flags. Open flags and f_flags | ||
| 92 | * are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags). | ||
| 93 | * Open/fcntl flags begin with O_; kernel-internal flags begin with F. | ||
| 94 | */ | ||
| 95 | /* open-only flags */ | ||
| 96 | #define O_RDONLY 0x0000 /* open for reading only */ | ||
| 97 | #define O_WRONLY 0x0001 /* open for writing only */ | ||
| 98 | #define O_RDWR 0x0002 /* open for reading and writing */ | ||
| 99 | #define O_ACCMODE 0x0003 /* mask for above modes */ | ||
| 100 | |||
| 101 | /* | ||
| 102 | * Kernel encoding of open mode; separate read and write bits that are | ||
| 103 | * independently testable: 1 greater than the above. | ||
| 104 | * | ||
| 105 | * XXX | ||
| 106 | * FREAD and FWRITE are excluded from the #ifdef KERNEL so that TIOCFLUSH, | ||
| 107 | * which was documented to use FREAD/FWRITE, continues to work. | ||
| 108 | */ | ||
| 109 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 110 | #define FREAD 0x00000001 | ||
| 111 | #define FWRITE 0x00000002 | ||
| 112 | #endif | ||
| 113 | #define O_NONBLOCK 0x00000004 /* no delay */ | ||
| 114 | #define O_APPEND 0x00000008 /* set append mode */ | ||
| 115 | |||
| 116 | #include <sys/_types/_o_sync.h> | ||
| 117 | |||
| 118 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 119 | #define O_SHLOCK 0x00000010 /* open with shared file lock */ | ||
| 120 | #define O_EXLOCK 0x00000020 /* open with exclusive file lock */ | ||
| 121 | #define O_ASYNC 0x00000040 /* signal pgrp when data ready */ | ||
| 122 | #define O_FSYNC O_SYNC /* source compatibility: do not use */ | ||
| 123 | #define O_NOFOLLOW 0x00000100 /* don't follow symlinks */ | ||
| 124 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 125 | #define O_CREAT 0x00000200 /* create if nonexistant */ | ||
| 126 | #define O_TRUNC 0x00000400 /* truncate to zero length */ | ||
| 127 | #define O_EXCL 0x00000800 /* error if already exists */ | ||
| 128 | |||
| 129 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 130 | #define O_EVTONLY 0x00008000 /* descriptor requested for event notifications only */ | ||
| 131 | #endif | ||
| 132 | |||
| 133 | |||
| 134 | #define O_NOCTTY 0x00020000 /* don't assign controlling terminal */ | ||
| 135 | |||
| 136 | |||
| 137 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 138 | #define O_DIRECTORY 0x00100000 | ||
| 139 | #define O_SYMLINK 0x00200000 /* allow open of a symlink */ | ||
| 140 | #endif | ||
| 141 | |||
| 142 | // O_DSYNC 0x00400000 /* synch I/O data integrity */ | ||
| 143 | #include <sys/_types/_o_dsync.h> | ||
| 144 | |||
| 145 | |||
| 146 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 147 | #define O_CLOEXEC 0x01000000 /* implicitly set FD_CLOEXEC */ | ||
| 148 | #endif | ||
| 149 | |||
| 150 | |||
| 151 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 152 | #define O_NOFOLLOW_ANY 0x20000000 /* no symlinks allowed in path */ | ||
| 153 | #endif | ||
| 154 | |||
| 155 | |||
| 156 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 157 | /* | ||
| 158 | * Descriptor value for the current working directory | ||
| 159 | */ | ||
| 160 | #define AT_FDCWD -2 | ||
| 161 | |||
| 162 | /* | ||
| 163 | * Flags for the at functions | ||
| 164 | */ | ||
| 165 | #define AT_EACCESS 0x0010 /* Use effective ids in access check */ | ||
| 166 | #define AT_SYMLINK_NOFOLLOW 0x0020 /* Act on the symlink itself not the target */ | ||
| 167 | #define AT_SYMLINK_FOLLOW 0x0040 /* Act on target of symlink */ | ||
| 168 | #define AT_REMOVEDIR 0x0080 /* Path refers to directory */ | ||
| 169 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 170 | #define AT_REALDEV 0x0200 /* Return real device inodes resides on for fstatat(2) */ | ||
| 171 | #define AT_FDONLY 0x0400 /* Use only the fd and Ignore the path for fstatat(2) */ | ||
| 172 | #endif | ||
| 173 | #endif | ||
| 174 | |||
| 175 | /* Data Protection Flags */ | ||
| 176 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 177 | #define O_DP_GETRAWENCRYPTED 0x0001 | ||
| 178 | #define O_DP_GETRAWUNENCRYPTED 0x0002 | ||
| 179 | #endif | ||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | /* | ||
| 184 | * The O_* flags used to have only F* names, which were used in the kernel | ||
| 185 | * and by fcntl. We retain the F* names for the kernel f_flags field | ||
| 186 | * and for backward compatibility for fcntl. | ||
| 187 | */ | ||
| 188 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 189 | #define FAPPEND O_APPEND /* kernel/compat */ | ||
| 190 | #define FASYNC O_ASYNC /* kernel/compat */ | ||
| 191 | #define FFSYNC O_FSYNC /* kernel */ | ||
| 192 | #define FFDSYNC O_DSYNC /* kernel */ | ||
| 193 | #define FNONBLOCK O_NONBLOCK /* kernel */ | ||
| 194 | #define FNDELAY O_NONBLOCK /* compat */ | ||
| 195 | #define O_NDELAY O_NONBLOCK /* compat */ | ||
| 196 | #endif | ||
| 197 | |||
| 198 | /* | ||
| 199 | * Flags used for copyfile(2) | ||
| 200 | */ | ||
| 201 | |||
| 202 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 203 | #define CPF_OVERWRITE 0x0001 | ||
| 204 | #define CPF_IGNORE_MODE 0x0002 | ||
| 205 | #define CPF_MASK (CPF_OVERWRITE|CPF_IGNORE_MODE) | ||
| 206 | #endif | ||
| 207 | |||
| 208 | /* | ||
| 209 | * Constants used for fcntl(2) | ||
| 210 | */ | ||
| 211 | |||
| 212 | /* command values */ | ||
| 213 | #define F_DUPFD 0 /* duplicate file descriptor */ | ||
| 214 | #define F_GETFD 1 /* get file descriptor flags */ | ||
| 215 | #define F_SETFD 2 /* set file descriptor flags */ | ||
| 216 | #define F_GETFL 3 /* get file status flags */ | ||
| 217 | #define F_SETFL 4 /* set file status flags */ | ||
| 218 | #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ | ||
| 219 | #define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ | ||
| 220 | #define F_GETLK 7 /* get record locking information */ | ||
| 221 | #define F_SETLK 8 /* set record locking information */ | ||
| 222 | #define F_SETLKW 9 /* F_SETLK; wait if blocked */ | ||
| 223 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 224 | #define F_SETLKWTIMEOUT 10 /* F_SETLK; wait if blocked, return on timeout */ | ||
| 225 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 226 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 227 | #define F_FLUSH_DATA 40 | ||
| 228 | #define F_CHKCLEAN 41 /* Used for regression test */ | ||
| 229 | #define F_PREALLOCATE 42 /* Preallocate storage */ | ||
| 230 | #define F_SETSIZE 43 /* Truncate a file. Equivalent to calling truncate(2) */ | ||
| 231 | #define F_RDADVISE 44 /* Issue an advisory read async with no copy to user */ | ||
| 232 | #define F_RDAHEAD 45 /* turn read ahead off/on for this fd */ | ||
| 233 | /* | ||
| 234 | * 46,47 used to be F_READBOOTSTRAP and F_WRITEBOOTSTRAP | ||
| 235 | */ | ||
| 236 | #define F_NOCACHE 48 /* turn data caching off/on for this fd */ | ||
| 237 | #define F_LOG2PHYS 49 /* file offset to device offset */ | ||
| 238 | #define F_GETPATH 50 /* return the full path of the fd */ | ||
| 239 | #define F_FULLFSYNC 51 /* fsync + ask the drive to flush to the media */ | ||
| 240 | #define F_PATHPKG_CHECK 52 /* find which component (if any) is a package */ | ||
| 241 | #define F_FREEZE_FS 53 /* "freeze" all fs operations */ | ||
| 242 | #define F_THAW_FS 54 /* "thaw" all fs operations */ | ||
| 243 | #define F_GLOBAL_NOCACHE 55 /* turn data caching off/on (globally) for this file */ | ||
| 244 | |||
| 245 | |||
| 246 | #define F_ADDSIGS 59 /* add detached signatures */ | ||
| 247 | |||
| 248 | |||
| 249 | #define F_ADDFILESIGS 61 /* add signature from same file (used by dyld for shared libs) */ | ||
| 250 | |||
| 251 | #define F_NODIRECT 62 /* used in conjunction with F_NOCACHE to indicate that DIRECT, synchonous writes */ | ||
| 252 | /* should not be used (i.e. its ok to temporaily create cached pages) */ | ||
| 253 | |||
| 254 | #define F_GETPROTECTIONCLASS 63 /* Get the protection class of a file from the EA, returns int */ | ||
| 255 | #define F_SETPROTECTIONCLASS 64 /* Set the protection class of a file for the EA, requires int */ | ||
| 256 | |||
| 257 | #define F_LOG2PHYS_EXT 65 /* file offset to device offset, extended */ | ||
| 258 | |||
| 259 | #define F_GETLKPID 66 /* get record locking information, per-process */ | ||
| 260 | |||
| 261 | /* See F_DUPFD_CLOEXEC below for 67 */ | ||
| 262 | |||
| 263 | |||
| 264 | #define F_SETBACKINGSTORE 70 /* Mark the file as being the backing store for another filesystem */ | ||
| 265 | #define F_GETPATH_MTMINFO 71 /* return the full path of the FD, but error in specific mtmd circumstances */ | ||
| 266 | |||
| 267 | #define F_GETCODEDIR 72 /* Returns the code directory, with associated hashes, to the caller */ | ||
| 268 | |||
| 269 | #define F_SETNOSIGPIPE 73 /* No SIGPIPE generated on EPIPE */ | ||
| 270 | #define F_GETNOSIGPIPE 74 /* Status of SIGPIPE for this fd */ | ||
| 271 | |||
| 272 | #define F_TRANSCODEKEY 75 /* For some cases, we need to rewrap the key for AKS/MKB */ | ||
| 273 | |||
| 274 | #define F_SINGLE_WRITER 76 /* file being written to a by single writer... if throttling enabled, writes */ | ||
| 275 | /* may be broken into smaller chunks with throttling in between */ | ||
| 276 | |||
| 277 | #define F_GETPROTECTIONLEVEL 77 /* Get the protection version number for this filesystem */ | ||
| 278 | |||
| 279 | #define F_FINDSIGS 78 /* Add detached code signatures (used by dyld for shared libs) */ | ||
| 280 | |||
| 281 | |||
| 282 | #define F_ADDFILESIGS_FOR_DYLD_SIM 83 /* Add signature from same file, only if it is signed by Apple (used by dyld for simulator) */ | ||
| 283 | |||
| 284 | |||
| 285 | #define F_BARRIERFSYNC 85 /* fsync + issue barrier to drive */ | ||
| 286 | |||
| 287 | |||
| 288 | #define F_ADDFILESIGS_RETURN 97 /* Add signature from same file, return end offset in structure on success */ | ||
| 289 | #define F_CHECK_LV 98 /* Check if Library Validation allows this Mach-O file to be mapped into the calling process */ | ||
| 290 | |||
| 291 | #define F_PUNCHHOLE 99 /* Deallocate a range of the file */ | ||
| 292 | |||
| 293 | #define F_TRIM_ACTIVE_FILE 100 /* Trim an active file */ | ||
| 294 | |||
| 295 | #define F_SPECULATIVE_READ 101 /* Synchronous advisory read fcntl for regular and compressed file */ | ||
| 296 | |||
| 297 | #define F_GETPATH_NOFIRMLINK 102 /* return the full path without firmlinks of the fd */ | ||
| 298 | |||
| 299 | #define F_ADDFILESIGS_INFO 103 /* Add signature from same file, return information */ | ||
| 300 | #define F_ADDFILESUPPL 104 /* Add supplemental signature from same file with fd reference to original */ | ||
| 301 | #define F_GETSIGSINFO 105 /* Look up code signature information attached to a file or slice */ | ||
| 302 | |||
| 303 | // FS-specific fcntl()'s numbers begin at 0x00010000 and go up | ||
| 304 | #define FCNTL_FS_SPECIFIC_BASE 0x00010000 | ||
| 305 | |||
| 306 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 307 | |||
| 308 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 309 | #define F_DUPFD_CLOEXEC 67 /* mark the dup with FD_CLOEXEC */ | ||
| 310 | #endif | ||
| 311 | |||
| 312 | /* file descriptor flags (F_GETFD, F_SETFD) */ | ||
| 313 | #define FD_CLOEXEC 1 /* close-on-exec flag */ | ||
| 314 | |||
| 315 | /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */ | ||
| 316 | #define F_RDLCK 1 /* shared or read lock */ | ||
| 317 | #define F_UNLCK 2 /* unlock */ | ||
| 318 | #define F_WRLCK 3 /* exclusive or write lock */ | ||
| 319 | |||
| 320 | |||
| 321 | /* | ||
| 322 | * [XSI] The values used for l_whence shall be defined as described | ||
| 323 | * in <unistd.h> | ||
| 324 | */ | ||
| 325 | #include <sys/_types/_seek_set.h> | ||
| 326 | |||
| 327 | /* | ||
| 328 | * [XSI] The symbolic names for file modes for use as values of mode_t | ||
| 329 | * shall be defined as described in <sys/stat.h> | ||
| 330 | */ | ||
| 331 | #include <sys/_types/_s_ifmt.h> | ||
| 332 | |||
| 333 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 334 | /* allocate flags (F_PREALLOCATE) */ | ||
| 335 | |||
| 336 | #define F_ALLOCATECONTIG 0x00000002 /* allocate contigious space */ | ||
| 337 | #define F_ALLOCATEALL 0x00000004 /* allocate all requested space or no space at all */ | ||
| 338 | |||
| 339 | /* Position Modes (fst_posmode) for F_PREALLOCATE */ | ||
| 340 | |||
| 341 | #define F_PEOFPOSMODE 3 /* Make it past all of the SEEK pos modes so that */ | ||
| 342 | /* we can keep them in sync should we desire */ | ||
| 343 | #define F_VOLPOSMODE 4 /* specify volume starting postion */ | ||
| 344 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 345 | |||
| 346 | /* | ||
| 347 | * Advisory file segment locking data type - | ||
| 348 | * information passed to system by user | ||
| 349 | */ | ||
| 350 | struct flock { | ||
| 351 | 	off_t l_start; /* starting offset */ | ||
| 352 | 	off_t l_len; /* len = 0 means until end of file */ | ||
| 353 | 	pid_t l_pid; /* lock owner */ | ||
| 354 | 	short l_type; /* lock type: read/write, etc. */ | ||
| 355 | 	short l_whence; /* type of l_start */ | ||
| 356 | }; | ||
| 357 | |||
| 358 | #include <sys/_types/_timespec.h> | ||
| 359 | |||
| 360 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 361 | /* | ||
| 362 | * Advisory file segment locking with time out - | ||
| 363 | * Information passed to system by user for F_SETLKWTIMEOUT | ||
| 364 | */ | ||
| 365 | struct flocktimeout { | ||
| 366 | 	struct flock fl; /* flock passed for file locking */ | ||
| 367 | 	struct timespec timeout; /* timespec struct for timeout */ | ||
| 368 | }; | ||
| 369 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 370 | |||
| 371 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 372 | /* | ||
| 373 | * advisory file read data type - | ||
| 374 | * information passed by user to system | ||
| 375 | */ | ||
| 376 | |||
| 377 | |||
| 378 | struct radvisory { | ||
| 379 | 	off_t ra_offset; | ||
| 380 | 	int ra_count; | ||
| 381 | }; | ||
| 382 | |||
| 383 | |||
| 384 | /* | ||
| 385 | * detached code signatures data type - | ||
| 386 | * information passed by user to system used by F_ADDSIGS and F_ADDFILESIGS. | ||
| 387 | * F_ADDFILESIGS is a shortcut for files that contain their own signature and | ||
| 388 | * doesn't require mapping of the file in order to load the signature. | ||
| 389 | */ | ||
| 390 | #define USER_FSIGNATURES_CDHASH_LEN 20 | ||
| 391 | typedef struct fsignatures { | ||
| 392 | 	off_t fs_file_start; | ||
| 393 | 	void *fs_blob_start; | ||
| 394 | 	size_t fs_blob_size; | ||
| 395 | |||
| 396 | 	/* The following fields are only applicable to F_ADDFILESIGS_INFO (64bit only). */ | ||
| 397 | 	/* Prior to F_ADDFILESIGS_INFO, this struct ended after fs_blob_size. */ | ||
| 398 | 	size_t fs_fsignatures_size;// input: size of this struct (for compatibility) | ||
| 399 | 	char fs_cdhash[USER_FSIGNATURES_CDHASH_LEN]; // output: cdhash | ||
| 400 | 	int fs_hash_type;// output: hash algorithm type for cdhash | ||
| 401 | } fsignatures_t; | ||
| 402 | |||
| 403 | typedef struct fsupplement { | ||
| 404 | 	off_t fs_file_start; /* offset of Mach-O image in FAT file */ | ||
| 405 | 	off_t fs_blob_start; /* offset of signature in Mach-O image */ | ||
| 406 | 	size_t fs_blob_size; /* signature blob size */ | ||
| 407 | 	int fs_orig_fd; /* address of original image */ | ||
| 408 | } fsupplement_t; | ||
| 409 | |||
| 410 | |||
| 411 | |||
| 412 | /* | ||
| 413 | * DYLD needs to check if the object is allowed to be combined | ||
| 414 | * into the main binary. This is done between the code signature | ||
| 415 | * is loaded and dyld is doing all the work to process the LOAD commands. | ||
| 416 | * | ||
| 417 | * While this could be done in F_ADDFILESIGS.* family the hook into | ||
| 418 | * the MAC module doesn't say no when LV isn't enabled and then that | ||
| 419 | * is cached on the vnode, and the MAC module never gets change once | ||
| 420 | * a process that library validation enabled. | ||
| 421 | */ | ||
| 422 | typedef struct fchecklv { | ||
| 423 | 	off_t lv_file_start; | ||
| 424 | 	size_t lv_error_message_size; | ||
| 425 | 	void *lv_error_message; | ||
| 426 | } fchecklv_t; | ||
| 427 | |||
| 428 | |||
| 429 | /* At this time F_GETSIGSINFO can only indicate platformness. | ||
| 430 | * As additional requestable information is defined, new keys will be added and the | ||
| 431 | * fgetsigsinfo_t structure will be lengthened to add space for the additional information | ||
| 432 | */ | ||
| 433 | #define GETSIGSINFO_PLATFORM_BINARY 1 | ||
| 434 | |||
| 435 | /* fgetsigsinfo_t used by F_GETSIGSINFO command */ | ||
| 436 | typedef struct fgetsigsinfo { | ||
| 437 | 	off_t fg_file_start; /* IN: Offset in the file to look for a signature, -1 for any signature */ | ||
| 438 | 	int fg_info_request; /* IN: Key indicating the info requested */ | ||
| 439 | 	int fg_sig_is_platform; /* OUT: 1 if the signature is a plat form binary, 0 if not */ | ||
| 440 | } fgetsigsinfo_t; | ||
| 441 | |||
| 442 | |||
| 443 | /* lock operations for flock(2) */ | ||
| 444 | #define LOCK_SH 0x01 /* shared file lock */ | ||
| 445 | #define LOCK_EX 0x02 /* exclusive file lock */ | ||
| 446 | #define LOCK_NB 0x04 /* don't block when locking */ | ||
| 447 | #define LOCK_UN 0x08 /* unlock file */ | ||
| 448 | |||
| 449 | /* fstore_t type used by F_PREALLOCATE command */ | ||
| 450 | |||
| 451 | typedef struct fstore { | ||
| 452 | 	unsigned int fst_flags; /* IN: flags word */ | ||
| 453 | 	int fst_posmode; /* IN: indicates use of offset field */ | ||
| 454 | 	off_t fst_offset; /* IN: start of the region */ | ||
| 455 | 	off_t fst_length; /* IN: size of the region */ | ||
| 456 | 	off_t fst_bytesalloc; /* OUT: number of bytes allocated */ | ||
| 457 | } fstore_t; | ||
| 458 | |||
| 459 | /* fpunchhole_t used by F_PUNCHHOLE */ | ||
| 460 | typedef struct fpunchhole { | ||
| 461 | 	unsigned int fp_flags; /* unused */ | ||
| 462 | 	unsigned int reserved; /* (to maintain 8-byte alignment) */ | ||
| 463 | 	off_t fp_offset; /* IN: start of the region */ | ||
| 464 | 	off_t fp_length; /* IN: size of the region */ | ||
| 465 | } fpunchhole_t; | ||
| 466 | |||
| 467 | /* factive_file_trim_t used by F_TRIM_ACTIVE_FILE */ | ||
| 468 | typedef struct ftrimactivefile { | ||
| 469 | 	off_t fta_offset; /* IN: start of the region */ | ||
| 470 | 	off_t fta_length; /* IN: size of the region */ | ||
| 471 | } ftrimactivefile_t; | ||
| 472 | |||
| 473 | /* fspecread_t used by F_SPECULATIVE_READ */ | ||
| 474 | typedef struct fspecread { | ||
| 475 | 	unsigned int fsr_flags; /* IN: flags word */ | ||
| 476 | 	unsigned int reserved; /* to maintain 8-byte alignment */ | ||
| 477 | 	off_t fsr_offset; /* IN: start of the region */ | ||
| 478 | 	off_t fsr_length; /* IN: size of the region */ | ||
| 479 | } fspecread_t; | ||
| 480 | |||
| 481 | /* fbootstraptransfer_t used by F_READBOOTSTRAP and F_WRITEBOOTSTRAP commands */ | ||
| 482 | |||
| 483 | typedef struct fbootstraptransfer { | ||
| 484 | 	off_t fbt_offset; /* IN: offset to start read/write */ | ||
| 485 | 	size_t fbt_length; /* IN: number of bytes to transfer */ | ||
| 486 | 	void *fbt_buffer; /* IN: buffer to be read/written */ | ||
| 487 | } fbootstraptransfer_t; | ||
| 488 | |||
| 489 | |||
| 490 | /* | ||
| 491 | * For F_LOG2PHYS this information is passed back to user | ||
| 492 | * Currently only devoffset is returned - that is the VOP_BMAP | ||
| 493 | * result - the disk device address corresponding to the | ||
| 494 | * current file offset (likely set with an lseek). | ||
| 495 | * | ||
| 496 | * The flags could hold an indication of whether the # of | ||
| 497 | * contiguous bytes reflects the true extent length on disk, | ||
| 498 | * or is an advisory value that indicates there is at least that | ||
| 499 | * many bytes contiguous. For some filesystems it might be too | ||
| 500 | * inefficient to provide anything beyond the advisory value. | ||
| 501 | * Flags and contiguous bytes return values are not yet implemented. | ||
| 502 | * For them the fcntl will nedd to switch from using BMAP to CMAP | ||
| 503 | * and a per filesystem type flag will be needed to interpret the | ||
| 504 | * contiguous bytes count result from CMAP. | ||
| 505 | * | ||
| 506 | * F_LOG2PHYS_EXT is a variant of F_LOG2PHYS that uses a passed in | ||
| 507 | * file offset and length instead of the current file offset. | ||
| 508 | * F_LOG2PHYS_EXT operates on the same structure as F_LOG2PHYS, but | ||
| 509 | * treats it as an in/out. | ||
| 510 | */ | ||
| 511 | #pragma pack(4) | ||
| 512 | |||
| 513 | struct log2phys { | ||
| 514 | 	unsigned int l2p_flags; /* unused so far */ | ||
| 515 | 	off_t l2p_contigbytes; /* F_LOG2PHYS: unused so far */ | ||
| 516 | 	 /* F_LOG2PHYS_EXT: IN: number of bytes to be queried */ | ||
| 517 | 	 /* OUT: number of contiguous bytes at this position */ | ||
| 518 | 	off_t l2p_devoffset; /* F_LOG2PHYS: OUT: bytes into device */ | ||
| 519 | 	 /* F_LOG2PHYS_EXT: IN: bytes into file */ | ||
| 520 | 	 /* OUT: bytes into device */ | ||
| 521 | }; | ||
| 522 | |||
| 523 | #pragma pack() | ||
| 524 | |||
| 525 | #define O_POPUP 0x80000000 /* force window to popup on open */ | ||
| 526 | #define O_ALERT 0x20000000 /* small, clean popup window */ | ||
| 527 | |||
| 528 | |||
| 529 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 530 | |||
| 531 | |||
| 532 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 533 | |||
| 534 | #include <sys/_types/_filesec_t.h> | ||
| 535 | |||
| 536 | typedef enum { | ||
| 537 | 	FILESEC_OWNER = 1, | ||
| 538 | 	FILESEC_GROUP = 2, | ||
| 539 | 	FILESEC_UUID = 3, | ||
| 540 | 	FILESEC_MODE = 4, | ||
| 541 | 	FILESEC_ACL = 5, | ||
| 542 | 	FILESEC_GRPUUID = 6, | ||
| 543 | |||
| 544 | /* XXX these are private to the implementation */ | ||
| 545 | 	FILESEC_ACL_RAW = 100, | ||
| 546 | 	FILESEC_ACL_ALLOCSIZE = 101 | ||
| 547 | } filesec_property_t; | ||
| 548 | |||
| 549 | /* XXX backwards compatibility */ | ||
| 550 | #define FILESEC_GUID FILESEC_UUID | ||
| 551 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 552 | |||
| 553 | __BEGIN_DECLS | ||
| 554 | int open(const char *, int, ...) __DARWIN_ALIAS_C(open); | ||
| 555 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 556 | int openat(int, const char *, int, ...) __DARWIN_NOCANCEL(openat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 557 | #endif | ||
| 558 | int creat(const char *, mode_t) __DARWIN_ALIAS_C(creat); | ||
| 559 | int fcntl(int, int, ...) __DARWIN_ALIAS_C(fcntl); | ||
| 560 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 561 | |||
| 562 | int openx_np(const char *, int, filesec_t); | ||
| 563 | /* | ||
| 564 | * data-protected non-portable open(2) : | ||
| 565 | * int open_dprotected_np(user_addr_t path, int flags, int class, int dpflags, int mode) | ||
| 566 | */ | ||
| 567 | int open_dprotected_np( const char *, int, int, int, ...); | ||
| 568 | int flock(int, int); | ||
| 569 | filesec_t filesec_init(void); | ||
| 570 | filesec_t filesec_dup(filesec_t); | ||
| 571 | void filesec_free(filesec_t); | ||
| 572 | int filesec_get_property(filesec_t, filesec_property_t, void *); | ||
| 573 | int filesec_query_property(filesec_t, filesec_property_t, int *); | ||
| 574 | int filesec_set_property(filesec_t, filesec_property_t, const void *); | ||
| 575 | int filesec_unset_property(filesec_t, filesec_property_t) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | ||
| 576 | #define _FILESEC_UNSET_PROPERTY ((void *)0) | ||
| 577 | #define _FILESEC_REMOVE_ACL ((void *)1) | ||
| 578 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 579 | __END_DECLS | ||
| 580 | |||
| 581 | #endif /* !_SYS_FCNTL_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/ioccom.h created+99| ... | @@ -0,0 +1,99 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1990, 1993, 1994 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)ioccom.h	8.2 (Berkeley) 3/28/94 | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _SYS_IOCCOM_H_ | ||
| 65 | #define _SYS_IOCCOM_H_ | ||
| 66 | |||
| 67 | #include <sys/_types.h> | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Ioctl's have the command encoded in the lower word, and the size of | ||
| 71 | * any in or out parameters in the upper word. The high 3 bits of the | ||
| 72 | * upper word are used to encode the in/out status of the parameter. | ||
| 73 | */ | ||
| 74 | #define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ | ||
| 75 | #define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) | ||
| 76 | #define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16)) | ||
| 77 | #define IOCGROUP(x) (((x) >> 8) & 0xff) | ||
| 78 | |||
| 79 | #define IOCPARM_MAX (IOCPARM_MASK + 1) /* max size of ioctl args */ | ||
| 80 | /* no parameters */ | ||
| 81 | #define IOC_VOID (__uint32_t)0x20000000 | ||
| 82 | /* copy parameters out */ | ||
| 83 | #define IOC_OUT (__uint32_t)0x40000000 | ||
| 84 | /* copy parameters in */ | ||
| 85 | #define IOC_IN (__uint32_t)0x80000000 | ||
| 86 | /* copy parameters in and out */ | ||
| 87 | #define IOC_INOUT (IOC_IN|IOC_OUT) | ||
| 88 | /* mask for IN/OUT/VOID */ | ||
| 89 | #define IOC_DIRMASK (__uint32_t)0xe0000000 | ||
| 90 | |||
| 91 | #define _IOC(inout, group, num, len) \ | ||
| 92 | 	(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) | ||
| 93 | #define _IO(g, n) _IOC(IOC_VOID,	(g), (n), 0) | ||
| 94 | #define _IOR(g, n, t) _IOC(IOC_OUT,	(g), (n), sizeof(t)) | ||
| 95 | #define _IOW(g, n, t) _IOC(IOC_IN,	(g), (n), sizeof(t)) | ||
| 96 | /* this should be _IORW, but stdio got there first */ | ||
| 97 | #define _IOWR(g, n, t) _IOC(IOC_INOUT,	(g), (n), sizeof(t)) | ||
| 98 | |||
| 99 | #endif /* !_SYS_IOCCOM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/ipc.h created+176| ... | @@ -0,0 +1,176 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1988 University of Utah. | ||
| 30 | * Copyright (c) 1990, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * This code is derived from software contributed to Berkeley by | ||
| 39 | * the Systems Programming Group of the University of Utah Computer | ||
| 40 | * Science Department. | ||
| 41 | * | ||
| 42 | * Redistribution and use in source and binary forms, with or without | ||
| 43 | * modification, are permitted provided that the following conditions | ||
| 44 | * are met: | ||
| 45 | * 1. Redistributions of source code must retain the above copyright | ||
| 46 | * notice, this list of conditions and the following disclaimer. | ||
| 47 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 48 | * notice, this list of conditions and the following disclaimer in the | ||
| 49 | * documentation and/or other materials provided with the distribution. | ||
| 50 | * 3. All advertising materials mentioning features or use of this software | ||
| 51 | * must display the following acknowledgement: | ||
| 52 | *	This product includes software developed by the University of | ||
| 53 | *	California, Berkeley and its contributors. | ||
| 54 | * 4. Neither the name of the University nor the names of its contributors | ||
| 55 | * may be used to endorse or promote products derived from this software | ||
| 56 | * without specific prior written permission. | ||
| 57 | * | ||
| 58 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 59 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 60 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 61 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 62 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 63 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 64 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 65 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 66 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 67 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 68 | * SUCH DAMAGE. | ||
| 69 | * | ||
| 70 | *	@(#)ipc.h	8.4 (Berkeley) 2/19/95 | ||
| 71 | */ | ||
| 72 | |||
| 73 | /* | ||
| 74 | * SVID compatible ipc.h file | ||
| 75 | */ | ||
| 76 | #ifndef _SYS_IPC_H_ | ||
| 77 | #define _SYS_IPC_H_ | ||
| 78 | |||
| 79 | #include <sys/appleapiopts.h> | ||
| 80 | #include <sys/cdefs.h> | ||
| 81 | |||
| 82 | #include <sys/_types.h> | ||
| 83 | |||
| 84 | /* | ||
| 85 | * [XSI] The uid_t, gid_t, mode_t, and key_t types SHALL be defined as | ||
| 86 | * described in <sys/types.h>. | ||
| 87 | */ | ||
| 88 | #include <sys/_types/_uid_t.h> | ||
| 89 | #include <sys/_types/_gid_t.h> | ||
| 90 | #include <sys/_types/_mode_t.h> | ||
| 91 | #include <sys/_types/_key_t.h> | ||
| 92 | |||
| 93 | |||
| 94 | #pragma pack(4) | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Technically, we should force all code references to the new structure | ||
| 98 | * definition, not in just the standards conformance case, and leave the | ||
| 99 | * legacy interface there for binary compatibility only. Currently, we | ||
| 100 | * are only forcing this for programs requesting standards conformance. | ||
| 101 | */ | ||
| 102 | #if __DARWIN_UNIX03 || defined(KERNEL) | ||
| 103 | /* | ||
| 104 | * [XSI] Information used in determining permission to perform an IPC | ||
| 105 | * operation | ||
| 106 | */ | ||
| 107 | struct ipc_perm { | ||
| 108 | 	uid_t uid; /* [XSI] Owner's user ID */ | ||
| 109 | 	gid_t gid; /* [XSI] Owner's group ID */ | ||
| 110 | 	uid_t cuid; /* [XSI] Creator's user ID */ | ||
| 111 | 	gid_t cgid; /* [XSI] Creator's group ID */ | ||
| 112 | 	mode_t mode; /* [XSI] Read/write permission */ | ||
| 113 | 	unsigned short _seq; /* Reserved for internal use */ | ||
| 114 | 	key_t _key; /* Reserved for internal use */ | ||
| 115 | }; | ||
| 116 | #define __ipc_perm_new ipc_perm | ||
| 117 | #else /* !__DARWIN_UNIX03 */ | ||
| 118 | #define ipc_perm __ipc_perm_old | ||
| 119 | #endif /* !__DARWIN_UNIX03 */ | ||
| 120 | |||
| 121 | #if !__DARWIN_UNIX03 | ||
| 122 | /* | ||
| 123 | * Legacy structure; this structure is maintained for binary backward | ||
| 124 | * compatability with previous versions of the interface. New code | ||
| 125 | * should not use this interface, since ID values may be truncated. | ||
| 126 | */ | ||
| 127 | struct __ipc_perm_old { | ||
| 128 | 	__uint16_t cuid; /* Creator's user ID */ | ||
| 129 | 	__uint16_t cgid; /* Creator's group ID */ | ||
| 130 | 	__uint16_t uid; /* Owner's user ID */ | ||
| 131 | 	__uint16_t gid; /* Owner's group ID */ | ||
| 132 | 	mode_t mode; /* Read/Write permission */ | ||
| 133 | 	__uint16_t seq; /* Reserved for internal use */ | ||
| 134 | 	key_t key; /* Reserved for internal use */ | ||
| 135 | }; | ||
| 136 | #endif /* !__DARWIN_UNIX03 */ | ||
| 137 | |||
| 138 | #pragma pack() | ||
| 139 | |||
| 140 | /* | ||
| 141 | * [XSI] Definitions shall be provided for the following constants: | ||
| 142 | */ | ||
| 143 | |||
| 144 | /* Mode bits */ | ||
| 145 | #define IPC_CREAT 001000 /* Create entry if key does not exist */ | ||
| 146 | #define IPC_EXCL 002000 /* Fail if key exists */ | ||
| 147 | #define IPC_NOWAIT 004000 /* Error if request must wait */ | ||
| 148 | |||
| 149 | /* Keys */ | ||
| 150 | #define IPC_PRIVATE ((key_t)0) /* Private key */ | ||
| 151 | |||
| 152 | /* Control commands */ | ||
| 153 | #define IPC_RMID 0 /* Remove identifier */ | ||
| 154 | #define IPC_SET 1 /* Set options */ | ||
| 155 | #define IPC_STAT 2 /* Get options */ | ||
| 156 | |||
| 157 | |||
| 158 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 159 | |||
| 160 | /* common mode bits */ | ||
| 161 | #define IPC_R 000400 /* Read permission */ | ||
| 162 | #define IPC_W 000200 /* Write/alter permission */ | ||
| 163 | #define IPC_M 010000 /* Modify control info permission */ | ||
| 164 | |||
| 165 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 166 | |||
| 167 | |||
| 168 | |||
| 169 | |||
| 170 | __BEGIN_DECLS | ||
| 171 | /* [XSI] */ | ||
| 172 | key_t ftok(const char *, int); | ||
| 173 | __END_DECLS | ||
| 174 | |||
| 175 | |||
| 176 | #endif /* !_SYS_IPC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/kauth.h created+410| ... | @@ -0,0 +1,410 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2010 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 30 | * support for mandatory and extensible security protections. This notice | ||
| 31 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 32 | * Version 2.0. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _SYS_KAUTH_H | ||
| 36 | #define _SYS_KAUTH_H | ||
| 37 | |||
| 38 | #include <sys/appleapiopts.h> | ||
| 39 | #include <sys/cdefs.h> | ||
| 40 | #include <mach/boolean.h> | ||
| 41 | #include <machine/types.h> /* u_int8_t, etc. */ | ||
| 42 | #include <sys/_types.h> /* __offsetof() */ | ||
| 43 | #include <sys/_types/_uid_t.h> /* uid_t */ | ||
| 44 | #include <sys/_types/_gid_t.h> /* gid_t */ | ||
| 45 | #include <sys/syslimits.h> /* NGROUPS_MAX */ | ||
| 46 | |||
| 47 | #ifdef __APPLE_API_EVOLVING | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Identities. | ||
| 51 | */ | ||
| 52 | |||
| 53 | #define KAUTH_UID_NONE (~(uid_t)0 - 100) /* not a valid UID */ | ||
| 54 | #define KAUTH_GID_NONE (~(gid_t)0 - 100) /* not a valid GID */ | ||
| 55 | |||
| 56 | #include <sys/_types/_guid_t.h> | ||
| 57 | |||
| 58 | /* NT Security Identifier, structure as defined by Microsoft */ | ||
| 59 | #pragma pack(1) /* push packing of 1 byte */ | ||
| 60 | typedef struct { | ||
| 61 | 	u_int8_t sid_kind; | ||
| 62 | 	u_int8_t sid_authcount; | ||
| 63 | 	u_int8_t sid_authority[6]; | ||
| 64 | #define KAUTH_NTSID_MAX_AUTHORITIES 16 | ||
| 65 | 	u_int32_t sid_authorities[KAUTH_NTSID_MAX_AUTHORITIES]; | ||
| 66 | } ntsid_t; | ||
| 67 | #pragma pack() /* pop packing to previous packing level */ | ||
| 68 | #define _NTSID_T | ||
| 69 | |||
| 70 | /* valid byte count inside a SID structure */ | ||
| 71 | #define KAUTH_NTSID_HDRSIZE (8) | ||
| 72 | #define KAUTH_NTSID_SIZE(_s) (KAUTH_NTSID_HDRSIZE + ((_s)->sid_authcount * sizeof(u_int32_t))) | ||
| 73 | |||
| 74 | /* | ||
| 75 | * External lookup message payload; this structure is shared between the | ||
| 76 | * kernel group membership resolver, and the user space group membership | ||
| 77 | * resolver daemon, and is use to communicate resolution requests from the | ||
| 78 | * kernel to user space, and the result of that request from user space to | ||
| 79 | * the kernel. | ||
| 80 | */ | ||
| 81 | struct kauth_identity_extlookup { | ||
| 82 | 	u_int32_t el_seqno; /* request sequence number */ | ||
| 83 | 	u_int32_t el_result; /* lookup result */ | ||
| 84 | #define KAUTH_EXTLOOKUP_SUCCESS 0 /* results here are good */ | ||
| 85 | #define KAUTH_EXTLOOKUP_BADRQ 1 /* request badly formatted */ | ||
| 86 | #define KAUTH_EXTLOOKUP_FAILURE 2 /* transient failure during lookup */ | ||
| 87 | #define KAUTH_EXTLOOKUP_FATAL 3 /* permanent failure during lookup */ | ||
| 88 | #define KAUTH_EXTLOOKUP_INPROG 100 /* request in progress */ | ||
| 89 | 	u_int32_t el_flags; | ||
| 90 | #define KAUTH_EXTLOOKUP_VALID_UID (1<<0) | ||
| 91 | #define KAUTH_EXTLOOKUP_VALID_UGUID (1<<1) | ||
| 92 | #define KAUTH_EXTLOOKUP_VALID_USID (1<<2) | ||
| 93 | #define KAUTH_EXTLOOKUP_VALID_GID (1<<3) | ||
| 94 | #define KAUTH_EXTLOOKUP_VALID_GGUID (1<<4) | ||
| 95 | #define KAUTH_EXTLOOKUP_VALID_GSID (1<<5) | ||
| 96 | #define KAUTH_EXTLOOKUP_WANT_UID (1<<6) | ||
| 97 | #define KAUTH_EXTLOOKUP_WANT_UGUID (1<<7) | ||
| 98 | #define KAUTH_EXTLOOKUP_WANT_USID (1<<8) | ||
| 99 | #define KAUTH_EXTLOOKUP_WANT_GID (1<<9) | ||
| 100 | #define KAUTH_EXTLOOKUP_WANT_GGUID (1<<10) | ||
| 101 | #define KAUTH_EXTLOOKUP_WANT_GSID (1<<11) | ||
| 102 | #define KAUTH_EXTLOOKUP_WANT_MEMBERSHIP (1<<12) | ||
| 103 | #define KAUTH_EXTLOOKUP_VALID_MEMBERSHIP (1<<13) | ||
| 104 | #define KAUTH_EXTLOOKUP_ISMEMBER (1<<14) | ||
| 105 | #define KAUTH_EXTLOOKUP_VALID_PWNAM (1<<15) | ||
| 106 | #define KAUTH_EXTLOOKUP_WANT_PWNAM (1<<16) | ||
| 107 | #define KAUTH_EXTLOOKUP_VALID_GRNAM (1<<17) | ||
| 108 | #define KAUTH_EXTLOOKUP_WANT_GRNAM (1<<18) | ||
| 109 | #define KAUTH_EXTLOOKUP_VALID_SUPGRPS (1<<19) | ||
| 110 | #define KAUTH_EXTLOOKUP_WANT_SUPGRPS (1<<20) | ||
| 111 | |||
| 112 | 	__darwin_pid_t el_info_pid; /* request on behalf of PID */ | ||
| 113 | 	u_int64_t el_extend; /* extension field */ | ||
| 114 | 	u_int32_t el_info_reserved_1; /* reserved (APPLE) */ | ||
| 115 | |||
| 116 | 	uid_t el_uid; /* user ID */ | ||
| 117 | 	guid_t el_uguid; /* user GUID */ | ||
| 118 | 	u_int32_t el_uguid_valid; /* TTL on translation result (seconds) */ | ||
| 119 | 	ntsid_t el_usid; /* user NT SID */ | ||
| 120 | 	u_int32_t el_usid_valid; /* TTL on translation result (seconds) */ | ||
| 121 | 	gid_t el_gid; /* group ID */ | ||
| 122 | 	guid_t el_gguid; /* group GUID */ | ||
| 123 | 	u_int32_t el_gguid_valid; /* TTL on translation result (seconds) */ | ||
| 124 | 	ntsid_t el_gsid; /* group SID */ | ||
| 125 | 	u_int32_t el_gsid_valid; /* TTL on translation result (seconds) */ | ||
| 126 | 	u_int32_t el_member_valid; /* TTL on group lookup result */ | ||
| 127 | 	u_int32_t el_sup_grp_cnt; /* count of supplemental groups up to NGROUPS */ | ||
| 128 | 	gid_t el_sup_groups[NGROUPS_MAX]; /* supplemental group list */ | ||
| 129 | }; | ||
| 130 | |||
| 131 | struct kauth_cache_sizes { | ||
| 132 | 	u_int32_t kcs_group_size; | ||
| 133 | 	u_int32_t kcs_id_size; | ||
| 134 | }; | ||
| 135 | |||
| 136 | #define KAUTH_EXTLOOKUP_REGISTER (0) | ||
| 137 | #define KAUTH_EXTLOOKUP_RESULT (1<<0) | ||
| 138 | #define KAUTH_EXTLOOKUP_WORKER (1<<1) | ||
| 139 | #define KAUTH_EXTLOOKUP_DEREGISTER (1<<2) | ||
| 140 | #define KAUTH_GET_CACHE_SIZES (1<<3) | ||
| 141 | #define KAUTH_SET_CACHE_SIZES (1<<4) | ||
| 142 | #define KAUTH_CLEAR_CACHES (1<<5) | ||
| 143 | |||
| 144 | #define IDENTITYSVC_ENTITLEMENT "com.apple.private.identitysvc" | ||
| 145 | |||
| 146 | |||
| 147 | |||
| 148 | /* | ||
| 149 | * Generic Access Control Lists. | ||
| 150 | */ | ||
| 151 | #if defined(KERNEL) || defined (_SYS_ACL_H) | ||
| 152 | |||
| 153 | typedef u_int32_t kauth_ace_rights_t; | ||
| 154 | |||
| 155 | /* Access Control List Entry (ACE) */ | ||
| 156 | struct kauth_ace { | ||
| 157 | 	guid_t ace_applicable; | ||
| 158 | 	u_int32_t ace_flags; | ||
| 159 | #define KAUTH_ACE_KINDMASK 0xf | ||
| 160 | #define KAUTH_ACE_PERMIT 1 | ||
| 161 | #define KAUTH_ACE_DENY 2 | ||
| 162 | #define KAUTH_ACE_AUDIT 3 /* not implemented */ | ||
| 163 | #define KAUTH_ACE_ALARM 4 /* not implemented */ | ||
| 164 | #define KAUTH_ACE_INHERITED (1<<4) | ||
| 165 | #define KAUTH_ACE_FILE_INHERIT (1<<5) | ||
| 166 | #define KAUTH_ACE_DIRECTORY_INHERIT (1<<6) | ||
| 167 | #define KAUTH_ACE_LIMIT_INHERIT (1<<7) | ||
| 168 | #define KAUTH_ACE_ONLY_INHERIT (1<<8) | ||
| 169 | #define KAUTH_ACE_SUCCESS (1<<9) /* not implemented (AUDIT/ALARM) */ | ||
| 170 | #define KAUTH_ACE_FAILURE (1<<10) /* not implemented (AUDIT/ALARM) */ | ||
| 171 | /* All flag bits controlling ACE inheritance */ | ||
| 172 | #define KAUTH_ACE_INHERIT_CONTROL_FLAGS \ | ||
| 173 | 	 (KAUTH_ACE_FILE_INHERIT | \ | ||
| 174 | 	 KAUTH_ACE_DIRECTORY_INHERIT | \ | ||
| 175 | 	 KAUTH_ACE_LIMIT_INHERIT | \ | ||
| 176 | 	 KAUTH_ACE_ONLY_INHERIT) | ||
| 177 | 	kauth_ace_rights_t ace_rights; /* scope specific */ | ||
| 178 | 	/* These rights are never tested, but may be present in an ACL */ | ||
| 179 | #define KAUTH_ACE_GENERIC_ALL (1<<21) | ||
| 180 | #define KAUTH_ACE_GENERIC_EXECUTE (1<<22) | ||
| 181 | #define KAUTH_ACE_GENERIC_WRITE (1<<23) | ||
| 182 | #define KAUTH_ACE_GENERIC_READ (1<<24) | ||
| 183 | }; | ||
| 184 | |||
| 185 | #ifndef _KAUTH_ACE | ||
| 186 | #define _KAUTH_ACE | ||
| 187 | typedef struct kauth_ace *kauth_ace_t; | ||
| 188 | #endif | ||
| 189 | |||
| 190 | |||
| 191 | /* Access Control List */ | ||
| 192 | struct kauth_acl { | ||
| 193 | 	u_int32_t acl_entrycount; | ||
| 194 | 	u_int32_t acl_flags; | ||
| 195 | |||
| 196 | 	struct kauth_ace acl_ace[1]; | ||
| 197 | }; | ||
| 198 | |||
| 199 | /* | ||
| 200 | * XXX this value needs to be raised - 3893388 | ||
| 201 | */ | ||
| 202 | #define KAUTH_ACL_MAX_ENTRIES 128 | ||
| 203 | |||
| 204 | /* | ||
| 205 | * The low 16 bits of the flags field are reserved for filesystem | ||
| 206 | * internal use and must be preserved by all APIs. This includes | ||
| 207 | * round-tripping flags through user-space interfaces. | ||
| 208 | */ | ||
| 209 | #define KAUTH_ACL_FLAGS_PRIVATE (0xffff) | ||
| 210 | |||
| 211 | /* | ||
| 212 | * The high 16 bits of the flags are used to store attributes and | ||
| 213 | * to request specific handling of the ACL. | ||
| 214 | */ | ||
| 215 | |||
| 216 | /* inheritance will be deferred until the first rename operation */ | ||
| 217 | #define KAUTH_ACL_DEFER_INHERIT (1<<16) | ||
| 218 | /* this ACL must not be overwritten as part of an inheritance operation */ | ||
| 219 | #define KAUTH_ACL_NO_INHERIT (1<<17) | ||
| 220 | |||
| 221 | /* acl_entrycount that tells us the ACL is not valid */ | ||
| 222 | #define KAUTH_FILESEC_NOACL ((u_int32_t)(-1)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * If the acl_entrycount field is KAUTH_FILESEC_NOACL, then the size is the | ||
| 226 | * same as a kauth_acl structure; the intent is to put an actual entrycount of | ||
| 227 | * KAUTH_FILESEC_NOACL on disk to distinguish a kauth_filesec_t with an empty | ||
| 228 | * entry (Windows treats this as "deny all") from one that merely indicates a | ||
| 229 | * file group and/or owner guid values. | ||
| 230 | */ | ||
| 231 | #define KAUTH_ACL_SIZE(c) (__offsetof(struct kauth_acl, acl_ace) + ((u_int32_t)(c) != KAUTH_FILESEC_NOACL ? ((c) * sizeof(struct kauth_ace)) : 0)) | ||
| 232 | #define KAUTH_ACL_COPYSIZE(p) KAUTH_ACL_SIZE((p)->acl_entrycount) | ||
| 233 | |||
| 234 | |||
| 235 | #ifndef _KAUTH_ACL | ||
| 236 | #define _KAUTH_ACL | ||
| 237 | typedef struct kauth_acl *kauth_acl_t; | ||
| 238 | #endif | ||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | /* | ||
| 243 | * Extended File Security. | ||
| 244 | */ | ||
| 245 | |||
| 246 | /* File Security information */ | ||
| 247 | struct kauth_filesec { | ||
| 248 | 	u_int32_t fsec_magic; | ||
| 249 | #define KAUTH_FILESEC_MAGIC 0x012cc16d | ||
| 250 | 	guid_t fsec_owner; | ||
| 251 | 	guid_t fsec_group; | ||
| 252 | |||
| 253 | 	struct kauth_acl fsec_acl; | ||
| 254 | }; | ||
| 255 | |||
| 256 | /* backwards compatibility */ | ||
| 257 | #define fsec_entrycount fsec_acl.acl_entrycount | ||
| 258 | #define fsec_flags fsec_acl.acl_flags | ||
| 259 | #define fsec_ace fsec_acl.acl_ace | ||
| 260 | #define KAUTH_FILESEC_FLAGS_PRIVATE KAUTH_ACL_FLAGS_PRIVATE | ||
| 261 | #define KAUTH_FILESEC_DEFER_INHERIT KAUTH_ACL_DEFER_INHERIT | ||
| 262 | #define KAUTH_FILESEC_NO_INHERIT KAUTH_ACL_NO_INHERIT | ||
| 263 | #define KAUTH_FILESEC_NONE ((kauth_filesec_t)0) | ||
| 264 | #define KAUTH_FILESEC_WANTED ((kauth_filesec_t)1) | ||
| 265 | |||
| 266 | #ifndef _KAUTH_FILESEC | ||
| 267 | #define _KAUTH_FILESEC | ||
| 268 | typedef struct kauth_filesec *kauth_filesec_t; | ||
| 269 | #endif | ||
| 270 | |||
| 271 | #define KAUTH_FILESEC_SIZE(c) (__offsetof(struct kauth_filesec, fsec_acl) + __offsetof(struct kauth_acl, acl_ace) + (c) * sizeof(struct kauth_ace)) | ||
| 272 | #define KAUTH_FILESEC_COPYSIZE(p) KAUTH_FILESEC_SIZE(((p)->fsec_entrycount == KAUTH_FILESEC_NOACL) ? 0 : (p)->fsec_entrycount) | ||
| 273 | #define KAUTH_FILESEC_COUNT(s) (((s) - KAUTH_FILESEC_SIZE(0)) / sizeof(struct kauth_ace)) | ||
| 274 | #define KAUTH_FILESEC_VALID(s) ((s) >= KAUTH_FILESEC_SIZE(0) && (((s) - KAUTH_FILESEC_SIZE(0)) % sizeof(struct kauth_ace)) == 0) | ||
| 275 | |||
| 276 | #define KAUTH_FILESEC_XATTR "com.apple.system.Security" | ||
| 277 | |||
| 278 | /* Allowable first arguments to kauth_filesec_acl_setendian() */ | ||
| 279 | #define KAUTH_ENDIAN_HOST 0x00000001 /* set host endianness */ | ||
| 280 | #define KAUTH_ENDIAN_DISK 0x00000002 /* set disk endianness */ | ||
| 281 | |||
| 282 | #endif /* KERNEL || <sys/acl.h> */ | ||
| 283 | |||
| 284 | |||
| 285 | |||
| 286 | /* Actions, also rights bits in an ACE */ | ||
| 287 | |||
| 288 | #if defined(KERNEL) || defined (_SYS_ACL_H) | ||
| 289 | #define KAUTH_VNODE_READ_DATA (1U<<1) | ||
| 290 | #define KAUTH_VNODE_LIST_DIRECTORY KAUTH_VNODE_READ_DATA | ||
| 291 | #define KAUTH_VNODE_WRITE_DATA (1U<<2) | ||
| 292 | #define KAUTH_VNODE_ADD_FILE KAUTH_VNODE_WRITE_DATA | ||
| 293 | #define KAUTH_VNODE_EXECUTE (1U<<3) | ||
| 294 | #define KAUTH_VNODE_SEARCH KAUTH_VNODE_EXECUTE | ||
| 295 | #define KAUTH_VNODE_DELETE (1U<<4) | ||
| 296 | #define KAUTH_VNODE_APPEND_DATA (1U<<5) | ||
| 297 | #define KAUTH_VNODE_ADD_SUBDIRECTORY KAUTH_VNODE_APPEND_DATA | ||
| 298 | #define KAUTH_VNODE_DELETE_CHILD (1U<<6) | ||
| 299 | #define KAUTH_VNODE_READ_ATTRIBUTES (1U<<7) | ||
| 300 | #define KAUTH_VNODE_WRITE_ATTRIBUTES (1U<<8) | ||
| 301 | #define KAUTH_VNODE_READ_EXTATTRIBUTES (1U<<9) | ||
| 302 | #define KAUTH_VNODE_WRITE_EXTATTRIBUTES (1U<<10) | ||
| 303 | #define KAUTH_VNODE_READ_SECURITY (1U<<11) | ||
| 304 | #define KAUTH_VNODE_WRITE_SECURITY (1U<<12) | ||
| 305 | #define KAUTH_VNODE_TAKE_OWNERSHIP (1U<<13) | ||
| 306 | |||
| 307 | /* backwards compatibility only */ | ||
| 308 | #define KAUTH_VNODE_CHANGE_OWNER KAUTH_VNODE_TAKE_OWNERSHIP | ||
| 309 | |||
| 310 | /* For Windows interoperability only */ | ||
| 311 | #define KAUTH_VNODE_SYNCHRONIZE (1U<<20) | ||
| 312 | |||
| 313 | /* (1<<21) - (1<<24) are reserved for generic rights bits */ | ||
| 314 | |||
| 315 | /* Actions not expressed as rights bits */ | ||
| 316 | /* | ||
| 317 | * Authorizes the vnode as the target of a hard link. | ||
| 318 | */ | ||
| 319 | #define KAUTH_VNODE_LINKTARGET (1U<<25) | ||
| 320 | |||
| 321 | /* | ||
| 322 | * Indicates that other steps have been taken to authorise the action, | ||
| 323 | * but authorisation should be denied for immutable objects. | ||
| 324 | */ | ||
| 325 | #define KAUTH_VNODE_CHECKIMMUTABLE (1U<<26) | ||
| 326 | |||
| 327 | /* Action modifiers */ | ||
| 328 | /* | ||
| 329 | * The KAUTH_VNODE_ACCESS bit is passed to the callback if the authorisation | ||
| 330 | * request in progress is advisory, rather than authoritative. Listeners | ||
| 331 | * performing consequential work (i.e. not strictly checking authorisation) | ||
| 332 | * may test this flag to avoid performing unnecessary work. | ||
| 333 | * | ||
| 334 | * This bit will never be present in an ACE. | ||
| 335 | */ | ||
| 336 | #define KAUTH_VNODE_ACCESS (1U<<31) | ||
| 337 | |||
| 338 | /* | ||
| 339 | * The KAUTH_VNODE_NOIMMUTABLE bit is passed to the callback along with the | ||
| 340 | * KAUTH_VNODE_WRITE_SECURITY bit (and no others) to indicate that the | ||
| 341 | * caller wishes to change one or more of the immutable flags, and the | ||
| 342 | * state of these flags should not be considered when authorizing the request. | ||
| 343 | * The system immutable flags are only ignored when the system securelevel | ||
| 344 | * is low enough to allow their removal. | ||
| 345 | */ | ||
| 346 | #define KAUTH_VNODE_NOIMMUTABLE (1U<<30) | ||
| 347 | |||
| 348 | |||
| 349 | /* | ||
| 350 | * fake right that is composed by the following... | ||
| 351 | * vnode must have search for owner, group and world allowed | ||
| 352 | * plus there must be no deny modes present for SEARCH... this fake | ||
| 353 | * right is used by the fast lookup path to avoid checking | ||
| 354 | * for an exact match on the last credential to lookup | ||
| 355 | * the component being acted on | ||
| 356 | */ | ||
| 357 | #define KAUTH_VNODE_SEARCHBYANYONE (1U<<29) | ||
| 358 | |||
| 359 | |||
| 360 | /* | ||
| 361 | * when passed as an 'action' to "vnode_uncache_authorized_actions" | ||
| 362 | * it indicates that all of the cached authorizations for that | ||
| 363 | * vnode should be invalidated | ||
| 364 | */ | ||
| 365 | #define KAUTH_INVALIDATE_CACHED_RIGHTS ((kauth_action_t)~0) | ||
| 366 | |||
| 367 | |||
| 368 | |||
| 369 | /* The expansions of the GENERIC bits at evaluation time */ | ||
| 370 | #define KAUTH_VNODE_GENERIC_READ_BITS (KAUTH_VNODE_READ_DATA | \ | ||
| 371 | 	 KAUTH_VNODE_READ_ATTRIBUTES | \ | ||
| 372 | 	 KAUTH_VNODE_READ_EXTATTRIBUTES | \ | ||
| 373 | 	 KAUTH_VNODE_READ_SECURITY) | ||
| 374 | |||
| 375 | #define KAUTH_VNODE_GENERIC_WRITE_BITS (KAUTH_VNODE_WRITE_DATA | \ | ||
| 376 | 	 KAUTH_VNODE_APPEND_DATA | \ | ||
| 377 | 	 KAUTH_VNODE_DELETE | \ | ||
| 378 | 	 KAUTH_VNODE_DELETE_CHILD | \ | ||
| 379 | 	 KAUTH_VNODE_WRITE_ATTRIBUTES | \ | ||
| 380 | 	 KAUTH_VNODE_WRITE_EXTATTRIBUTES | \ | ||
| 381 | 	 KAUTH_VNODE_WRITE_SECURITY) | ||
| 382 | |||
| 383 | #define KAUTH_VNODE_GENERIC_EXECUTE_BITS (KAUTH_VNODE_EXECUTE) | ||
| 384 | |||
| 385 | #define KAUTH_VNODE_GENERIC_ALL_BITS (KAUTH_VNODE_GENERIC_READ_BITS | \ | ||
| 386 | 	 KAUTH_VNODE_GENERIC_WRITE_BITS | \ | ||
| 387 | 	 KAUTH_VNODE_GENERIC_EXECUTE_BITS) | ||
| 388 | |||
| 389 | /* | ||
| 390 | * Some sets of bits, defined here for convenience. | ||
| 391 | */ | ||
| 392 | #define KAUTH_VNODE_WRITE_RIGHTS (KAUTH_VNODE_ADD_FILE | \ | ||
| 393 | 	 KAUTH_VNODE_ADD_SUBDIRECTORY | \ | ||
| 394 | 	 KAUTH_VNODE_DELETE_CHILD | \ | ||
| 395 | 	 KAUTH_VNODE_WRITE_DATA | \ | ||
| 396 | 	 KAUTH_VNODE_APPEND_DATA | \ | ||
| 397 | 	 KAUTH_VNODE_DELETE | \ | ||
| 398 | 	 KAUTH_VNODE_WRITE_ATTRIBUTES | \ | ||
| 399 | 	 KAUTH_VNODE_WRITE_EXTATTRIBUTES | \ | ||
| 400 | 	 KAUTH_VNODE_WRITE_SECURITY | \ | ||
| 401 | 	 KAUTH_VNODE_TAKE_OWNERSHIP | \ | ||
| 402 | 	 KAUTH_VNODE_LINKTARGET | \ | ||
| 403 | 	 KAUTH_VNODE_CHECKIMMUTABLE) | ||
| 404 | |||
| 405 | |||
| 406 | #endif /* KERNEL || <sys/acl.h> */ | ||
| 407 | |||
| 408 | |||
| 409 | #endif /* __APPLE_API_EVOLVING */ | ||
| 410 | #endif /* _SYS_KAUTH_H */ | ||
lib/libc/include/x86_64-macos-gnu/sys/lock.h created+76| ... | @@ -0,0 +1,76 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1995 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * This code contains ideas from software contributed to Berkeley by | ||
| 34 | * Avadis Tevanian, Jr., Michael Wayne Young, and the Mach Operating | ||
| 35 | * System project at Carnegie-Mellon University. | ||
| 36 | * | ||
| 37 | * Redistribution and use in source and binary forms, with or without | ||
| 38 | * modification, are permitted provided that the following conditions | ||
| 39 | * are met: | ||
| 40 | * 1. Redistributions of source code must retain the above copyright | ||
| 41 | * notice, this list of conditions and the following disclaimer. | ||
| 42 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 43 | * notice, this list of conditions and the following disclaimer in the | ||
| 44 | * documentation and/or other materials provided with the distribution. | ||
| 45 | * 3. All advertising materials mentioning features or use of this software | ||
| 46 | * must display the following acknowledgement: | ||
| 47 | *	This product includes software developed by the University of | ||
| 48 | *	California, Berkeley and its contributors. | ||
| 49 | * 4. Neither the name of the University nor the names of its contributors | ||
| 50 | * may be used to endorse or promote products derived from this software | ||
| 51 | * without specific prior written permission. | ||
| 52 | * | ||
| 53 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 54 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 55 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 56 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 63 | * SUCH DAMAGE. | ||
| 64 | * | ||
| 65 | *	@(#)lock.h	8.12 (Berkeley) 5/19/95 | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _SYS_LOCK_H_ | ||
| 69 | #define _SYS_LOCK_H_ | ||
| 70 | |||
| 71 | #include <sys/appleapiopts.h> | ||
| 72 | #include <sys/types.h> | ||
| 73 | #include <sys/cdefs.h> | ||
| 74 | |||
| 75 | |||
| 76 | #endif /* _SYS_LOCK_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/mman.h created+263| ... | @@ -0,0 +1,263 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)mman.h	8.1 (Berkeley) 6/2/93 | ||
| 62 | */ | ||
| 63 | |||
| 64 | /* | ||
| 65 | * Currently unsupported: | ||
| 66 | * | ||
| 67 | * [TYM]	POSIX_TYPED_MEM_ALLOCATE | ||
| 68 | * [TYM]	POSIX_TYPED_MEM_ALLOCATE_CONTIG | ||
| 69 | * [TYM]	POSIX_TYPED_MEM_MAP_ALLOCATABLE | ||
| 70 | * [TYM]	struct posix_typed_mem_info | ||
| 71 | * [TYM]	posix_mem_offset() | ||
| 72 | * [TYM]	posix_typed_mem_get_info() | ||
| 73 | * [TYM]	posix_typed_mem_open() | ||
| 74 | */ | ||
| 75 | |||
| 76 | #ifndef _SYS_MMAN_H_ | ||
| 77 | #define _SYS_MMAN_H_ | ||
| 78 | |||
| 79 | #include <sys/appleapiopts.h> | ||
| 80 | #include <sys/cdefs.h> | ||
| 81 | |||
| 82 | #include <sys/_types.h> | ||
| 83 | |||
| 84 | /* | ||
| 85 | * [various] The mode_t, off_t, and size_t types shall be defined as | ||
| 86 | * described in <sys/types.h> | ||
| 87 | */ | ||
| 88 | #include <sys/_types/_mode_t.h> | ||
| 89 | #include <sys/_types/_off_t.h> | ||
| 90 | #include <sys/_types/_size_t.h> | ||
| 91 | |||
| 92 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 93 | #include <Availability.h> | ||
| 94 | #endif /* __DARWIN_C_LEVEL */ | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Protections are chosen from these bits, or-ed together | ||
| 98 | */ | ||
| 99 | #define PROT_NONE 0x00 /* [MC2] no permissions */ | ||
| 100 | #define PROT_READ 0x01 /* [MC2] pages can be read */ | ||
| 101 | #define PROT_WRITE 0x02 /* [MC2] pages can be written */ | ||
| 102 | #define PROT_EXEC 0x04 /* [MC2] pages can be executed */ | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Flags contain sharing type and options. | ||
| 106 | * Sharing types; choose one. | ||
| 107 | */ | ||
| 108 | #define MAP_SHARED 0x0001 /* [MF|SHM] share changes */ | ||
| 109 | #define MAP_PRIVATE 0x0002 /* [MF|SHM] changes are private */ | ||
| 110 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 111 | #define MAP_COPY MAP_PRIVATE /* Obsolete */ | ||
| 112 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 113 | |||
| 114 | /* | ||
| 115 | * Other flags | ||
| 116 | */ | ||
| 117 | #define MAP_FIXED 0x0010 /* [MF|SHM] interpret addr exactly */ | ||
| 118 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 119 | #define MAP_RENAME 0x0020 /* Sun: rename private pages to file */ | ||
| 120 | #define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */ | ||
| 121 | #define MAP_RESERVED0080 0x0080 /* previously unimplemented MAP_INHERIT */ | ||
| 122 | #define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */ | ||
| 123 | #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ | ||
| 124 | #define MAP_NOCACHE 0x0400 /* don't cache pages for this mapping */ | ||
| 125 | #define MAP_JIT 0x0800 /* Allocate a region that will be used for JIT purposes */ | ||
| 126 | |||
| 127 | /* | ||
| 128 | * Mapping type | ||
| 129 | */ | ||
| 130 | #define MAP_FILE 0x0000 /* map from file (default) */ | ||
| 131 | #define MAP_ANON 0x1000 /* allocated from memory, swap space */ | ||
| 132 | #define MAP_ANONYMOUS MAP_ANON | ||
| 133 | |||
| 134 | /* | ||
| 135 | * The MAP_RESILIENT_* flags can be used when the caller wants to map some | ||
| 136 | * possibly unreliable memory and be able to access it safely, possibly | ||
| 137 | * getting the wrong contents rather than raising any exception. | ||
| 138 | * For safety reasons, such mappings have to be read-only (PROT_READ access | ||
| 139 | * only). | ||
| 140 | * | ||
| 141 | * MAP_RESILIENT_CODESIGN: | ||
| 142 | * accessing this mapping will not generate code-signing violations, | ||
| 143 | *	even if the contents are tainted. | ||
| 144 | * MAP_RESILIENT_MEDIA: | ||
| 145 | *	accessing this mapping will not generate an exception if the contents | ||
| 146 | *	are not available (unreachable removable or remote media, access beyond | ||
| 147 | *	end-of-file, ...). Missing contents will be replaced with zeroes. | ||
| 148 | */ | ||
| 149 | #define MAP_RESILIENT_CODESIGN 0x2000 /* no code-signing failures */ | ||
| 150 | #define MAP_RESILIENT_MEDIA 0x4000 /* no backing-store failures */ | ||
| 151 | |||
| 152 | #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 | ||
| 153 | #define MAP_32BIT 0x8000 /* Return virtual addresses <4G only */ | ||
| 154 | #endif /* defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 */ | ||
| 155 | |||
| 156 | |||
| 157 | /* | ||
| 158 | * Flags used to support translated processes. | ||
| 159 | */ | ||
| 160 | #define MAP_TRANSLATED_ALLOW_EXECUTE 0x20000 /* allow execute in translated processes */ | ||
| 161 | |||
| 162 | #define MAP_UNIX03 0x40000 /* UNIX03 compliance */ | ||
| 163 | |||
| 164 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 165 | |||
| 166 | /* | ||
| 167 | * Process memory locking | ||
| 168 | */ | ||
| 169 | #define MCL_CURRENT 0x0001 /* [ML] Lock only current memory */ | ||
| 170 | #define MCL_FUTURE 0x0002 /* [ML] Lock all future memory as well */ | ||
| 171 | |||
| 172 | /* | ||
| 173 | * Error return from mmap() | ||
| 174 | */ | ||
| 175 | #define MAP_FAILED ((void *)-1) /* [MF|SHM] mmap failed */ | ||
| 176 | |||
| 177 | /* | ||
| 178 | * msync() flags | ||
| 179 | */ | ||
| 180 | #define MS_ASYNC 0x0001 /* [MF|SIO] return immediately */ | ||
| 181 | #define MS_INVALIDATE 0x0002 /* [MF|SIO] invalidate all cached data */ | ||
| 182 | #define MS_SYNC 0x0010 /* [MF|SIO] msync synchronously */ | ||
| 183 | |||
| 184 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 185 | #define MS_KILLPAGES 0x0004 /* invalidate pages, leave mapped */ | ||
| 186 | #define MS_DEACTIVATE 0x0008 /* deactivate pages, leave mapped */ | ||
| 187 | |||
| 188 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 189 | |||
| 190 | |||
| 191 | /* | ||
| 192 | * Advice to madvise | ||
| 193 | */ | ||
| 194 | #define POSIX_MADV_NORMAL 0 /* [MC1] no further special treatment */ | ||
| 195 | #define POSIX_MADV_RANDOM 1 /* [MC1] expect random page refs */ | ||
| 196 | #define POSIX_MADV_SEQUENTIAL 2 /* [MC1] expect sequential page refs */ | ||
| 197 | #define POSIX_MADV_WILLNEED 3 /* [MC1] will need these pages */ | ||
| 198 | #define POSIX_MADV_DONTNEED 4 /* [MC1] dont need these pages */ | ||
| 199 | |||
| 200 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 201 | #define MADV_NORMAL POSIX_MADV_NORMAL | ||
| 202 | #define MADV_RANDOM POSIX_MADV_RANDOM | ||
| 203 | #define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL | ||
| 204 | #define MADV_WILLNEED POSIX_MADV_WILLNEED | ||
| 205 | #define MADV_DONTNEED POSIX_MADV_DONTNEED | ||
| 206 | #define MADV_FREE 5 /* pages unneeded, discard contents */ | ||
| 207 | #define MADV_ZERO_WIRED_PAGES 6 /* zero the wired pages that have not been unwired before the entry is deleted */ | ||
| 208 | #define MADV_FREE_REUSABLE 7 /* pages can be reused (by anyone) */ | ||
| 209 | #define MADV_FREE_REUSE 8 /* caller wants to reuse those pages */ | ||
| 210 | #define MADV_CAN_REUSE 9 | ||
| 211 | #define MADV_PAGEOUT 10 /* page out now (internal only) */ | ||
| 212 | |||
| 213 | /* | ||
| 214 | * Return bits from mincore | ||
| 215 | */ | ||
| 216 | #define MINCORE_INCORE 0x1 /* Page is incore */ | ||
| 217 | #define MINCORE_REFERENCED 0x2 /* Page has been referenced by us */ | ||
| 218 | #define MINCORE_MODIFIED 0x4 /* Page has been modified by us */ | ||
| 219 | #define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */ | ||
| 220 | #define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */ | ||
| 221 | #define MINCORE_PAGED_OUT 0x20 /* Page has been paged out */ | ||
| 222 | #define MINCORE_COPIED 0x40 /* Page has been copied */ | ||
| 223 | #define MINCORE_ANONYMOUS 0x80 /* Page belongs to an anonymous object */ | ||
| 224 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 225 | |||
| 226 | |||
| 227 | |||
| 228 | |||
| 229 | __BEGIN_DECLS | ||
| 230 | /* [ML] */ | ||
| 231 | int mlockall(int); | ||
| 232 | int munlockall(void); | ||
| 233 | /* [MR] */ | ||
| 234 | int mlock(const void *, size_t); | ||
| 235 | #ifndef _MMAP | ||
| 236 | #define _MMAP | ||
| 237 | /* [MC3]*/ | ||
| 238 | void * mmap(void *, size_t, int, int, int, off_t) __DARWIN_ALIAS(mmap); | ||
| 239 | #endif | ||
| 240 | /* [MPR] */ | ||
| 241 | int mprotect(void *, size_t, int) __DARWIN_ALIAS(mprotect); | ||
| 242 | /* [MF|SIO] */ | ||
| 243 | int msync(void *, size_t, int) __DARWIN_ALIAS_C(msync); | ||
| 244 | /* [MR] */ | ||
| 245 | int munlock(const void *, size_t); | ||
| 246 | /* [MC3]*/ | ||
| 247 | int munmap(void *, size_t) __DARWIN_ALIAS(munmap); | ||
| 248 | /* [SHM] */ | ||
| 249 | int shm_open(const char *, int, ...); | ||
| 250 | int shm_unlink(const char *); | ||
| 251 | /* [ADV] */ | ||
| 252 | int posix_madvise(void *, size_t, int); | ||
| 253 | |||
| 254 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 255 | int madvise(void *, size_t, int); | ||
| 256 | int mincore(const void *, size_t, char *); | ||
| 257 | int minherit(void *, size_t, int); | ||
| 258 | #endif | ||
| 259 | |||
| 260 | |||
| 261 | __END_DECLS | ||
| 262 | |||
| 263 | #endif /* !_SYS_MMAN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/mount.h created+434| ... | @@ -0,0 +1,434 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1989, 1991, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)mount.h	8.21 (Berkeley) 5/20/95 | ||
| 62 | */ | ||
| 63 | /* | ||
| 64 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 65 | * support for mandatory and extensible security protections. This notice | ||
| 66 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 67 | * Version 2.0. | ||
| 68 | */ | ||
| 69 | |||
| 70 | |||
| 71 | #ifndef _SYS_MOUNT_H_ | ||
| 72 | #define _SYS_MOUNT_H_ | ||
| 73 | |||
| 74 | #include <sys/appleapiopts.h> | ||
| 75 | #include <sys/cdefs.h> | ||
| 76 | #include <sys/attr.h> /* needed for vol_capabilities_attr_t */ | ||
| 77 | #include <os/base.h> | ||
| 78 | |||
| 79 | #include <stdint.h> | ||
| 80 | #include <sys/ucred.h> | ||
| 81 | #include <sys/queue.h> /* XXX needed for user builds */ | ||
| 82 | #include <Availability.h> | ||
| 83 | |||
| 84 | #include <sys/_types/_fsid_t.h> /* file system id type */ | ||
| 85 | |||
| 86 | /* | ||
| 87 | * file system statistics | ||
| 88 | */ | ||
| 89 | |||
| 90 | #define MFSNAMELEN 15 /* length of fs type name, not inc. null */ | ||
| 91 | #define MFSTYPENAMELEN 16 /* length of fs type name including null */ | ||
| 92 | |||
| 93 | #if __DARWIN_64_BIT_INO_T | ||
| 94 | #define MNAMELEN MAXPATHLEN /* length of buffer for returned name */ | ||
| 95 | #else /* ! __DARWIN_64_BIT_INO_T */ | ||
| 96 | #define MNAMELEN 90 /* length of buffer for returned name */ | ||
| 97 | #endif /* __DARWIN_64_BIT_INO_T */ | ||
| 98 | |||
| 99 | #define MNT_EXT_ROOT_DATA_VOL 0x00000001 /* Data volume of root volume group */ | ||
| 100 | |||
| 101 | #define __DARWIN_STRUCT_STATFS64 { \ | ||
| 102 | 	uint32_t	f_bsize; /* fundamental file system block size */ \ | ||
| 103 | 	int32_t		f_iosize; /* optimal transfer block size */ \ | ||
| 104 | 	uint64_t	f_blocks; /* total data blocks in file system */ \ | ||
| 105 | 	uint64_t	f_bfree; /* free blocks in fs */ \ | ||
| 106 | 	uint64_t	f_bavail; /* free blocks avail to non-superuser */ \ | ||
| 107 | 	uint64_t	f_files; /* total file nodes in file system */ \ | ||
| 108 | 	uint64_t	f_ffree; /* free file nodes in fs */ \ | ||
| 109 | 	fsid_t		f_fsid; /* file system id */ \ | ||
| 110 | 	uid_t		f_owner; /* user that mounted the filesystem */ \ | ||
| 111 | 	uint32_t	f_type; /* type of filesystem */ \ | ||
| 112 | 	uint32_t	f_flags; /* copy of mount exported flags */ \ | ||
| 113 | 	uint32_t	f_fssubtype; /* fs sub-type (flavor) */ \ | ||
| 114 | 	char		f_fstypename[MFSTYPENAMELEN]; /* fs type name */ \ | ||
| 115 | 	char		f_mntonname[MAXPATHLEN]; /* directory on which mounted */ \ | ||
| 116 | 	char		f_mntfromname[MAXPATHLEN]; /* mounted filesystem */ \ | ||
| 117 | 	uint32_t f_flags_ext; /* extended flags */ \ | ||
| 118 | 	uint32_t	f_reserved[7]; /* For future use */ \ | ||
| 119 | } | ||
| 120 | |||
| 121 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 122 | |||
| 123 | struct statfs64 __DARWIN_STRUCT_STATFS64; | ||
| 124 | |||
| 125 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 126 | |||
| 127 | #if __DARWIN_64_BIT_INO_T | ||
| 128 | |||
| 129 | struct statfs __DARWIN_STRUCT_STATFS64; | ||
| 130 | |||
| 131 | #else /* !__DARWIN_64_BIT_INO_T */ | ||
| 132 | |||
| 133 | /* | ||
| 134 | * LP64 - WARNING - must be kept in sync with struct user_statfs in mount_internal.h. | ||
| 135 | */ | ||
| 136 | struct statfs { | ||
| 137 | 	short f_otype; /* TEMPORARY SHADOW COPY OF f_type */ | ||
| 138 | 	short f_oflags; /* TEMPORARY SHADOW COPY OF f_flags */ | ||
| 139 | 	long f_bsize; /* fundamental file system block size */ | ||
| 140 | 	long f_iosize; /* optimal transfer block size */ | ||
| 141 | 	long f_blocks; /* total data blocks in file system */ | ||
| 142 | 	long f_bfree; /* free blocks in fs */ | ||
| 143 | 	long f_bavail; /* free blocks avail to non-superuser */ | ||
| 144 | 	long f_files; /* total file nodes in file system */ | ||
| 145 | 	long f_ffree; /* free file nodes in fs */ | ||
| 146 | 	fsid_t f_fsid; /* file system id */ | ||
| 147 | 	uid_t f_owner; /* user that mounted the filesystem */ | ||
| 148 | 	short f_reserved1; /* spare for later */ | ||
| 149 | 	short f_type; /* type of filesystem */ | ||
| 150 | 	long f_flags; /* copy of mount exported flags */ | ||
| 151 | 	long f_reserved2[2]; /* reserved for future use */ | ||
| 152 | 	char f_fstypename[MFSNAMELEN]; /* fs type name */ | ||
| 153 | 	char f_mntonname[MNAMELEN]; /* directory on which mounted */ | ||
| 154 | 	char f_mntfromname[MNAMELEN];/* mounted filesystem */ | ||
| 155 | 	char f_reserved3; /* For alignment */ | ||
| 156 | 	long f_reserved4[4]; /* For future use */ | ||
| 157 | }; | ||
| 158 | |||
| 159 | #endif /* __DARWIN_64_BIT_INO_T */ | ||
| 160 | |||
| 161 | #pragma pack(4) | ||
| 162 | |||
| 163 | struct vfsstatfs { | ||
| 164 | 	uint32_t f_bsize; /* fundamental file system block size */ | ||
| 165 | 	size_t f_iosize; /* optimal transfer block size */ | ||
| 166 | 	uint64_t f_blocks; /* total data blocks in file system */ | ||
| 167 | 	uint64_t f_bfree; /* free blocks in fs */ | ||
| 168 | 	uint64_t f_bavail; /* free blocks avail to non-superuser */ | ||
| 169 | 	uint64_t f_bused; /* free blocks avail to non-superuser */ | ||
| 170 | 	uint64_t f_files; /* total file nodes in file system */ | ||
| 171 | 	uint64_t f_ffree; /* free file nodes in fs */ | ||
| 172 | 	fsid_t f_fsid; /* file system id */ | ||
| 173 | 	uid_t f_owner; /* user that mounted the filesystem */ | ||
| 174 | 	uint64_t f_flags; /* copy of mount exported flags */ | ||
| 175 | 	char f_fstypename[MFSTYPENAMELEN];/* fs type name inclus */ | ||
| 176 | 	char f_mntonname[MAXPATHLEN];/* directory on which mounted */ | ||
| 177 | 	char f_mntfromname[MAXPATHLEN];/* mounted filesystem */ | ||
| 178 | 	uint32_t f_fssubtype; /* fs sub-type (flavor) */ | ||
| 179 | 	void *f_reserved[2]; /* For future use == 0 */ | ||
| 180 | }; | ||
| 181 | |||
| 182 | #pragma pack() | ||
| 183 | |||
| 184 | |||
| 185 | /* | ||
| 186 | * User specifiable flags. | ||
| 187 | * | ||
| 188 | * Unmount uses MNT_FORCE flag. | ||
| 189 | */ | ||
| 190 | #define MNT_RDONLY 0x00000001 /* read only filesystem */ | ||
| 191 | #define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */ | ||
| 192 | #define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */ | ||
| 193 | #define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ | ||
| 194 | #define MNT_NODEV 0x00000010 /* don't interpret special files */ | ||
| 195 | #define MNT_UNION 0x00000020 /* union with underlying filesystem */ | ||
| 196 | #define MNT_ASYNC 0x00000040 /* file system written asynchronously */ | ||
| 197 | #define MNT_CPROTECT 0x00000080 /* file system supports content protection */ | ||
| 198 | |||
| 199 | /* | ||
| 200 | * NFS export related mount flags. | ||
| 201 | */ | ||
| 202 | #define MNT_EXPORTED 0x00000100 /* file system is exported */ | ||
| 203 | |||
| 204 | /* | ||
| 205 | * Denotes storage which can be removed from the system by the user. | ||
| 206 | */ | ||
| 207 | |||
| 208 | #define MNT_REMOVABLE 0x00000200 | ||
| 209 | |||
| 210 | /* | ||
| 211 | * MAC labeled / "quarantined" flag | ||
| 212 | */ | ||
| 213 | #define MNT_QUARANTINE 0x00000400 /* file system is quarantined */ | ||
| 214 | |||
| 215 | /* | ||
| 216 | * Flags set by internal operations. | ||
| 217 | */ | ||
| 218 | #define MNT_LOCAL 0x00001000 /* filesystem is stored locally */ | ||
| 219 | #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */ | ||
| 220 | #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */ | ||
| 221 | #define MNT_DOVOLFS 0x00008000 /* FS supports volfs (deprecated flag in Mac OS X 10.5) */ | ||
| 222 | |||
| 223 | |||
| 224 | #define MNT_DONTBROWSE 0x00100000 /* file system is not appropriate path to user data */ | ||
| 225 | #define MNT_IGNORE_OWNERSHIP 0x00200000 /* VFS will ignore ownership information on filesystem objects */ | ||
| 226 | #define MNT_AUTOMOUNTED 0x00400000 /* filesystem was mounted by automounter */ | ||
| 227 | #define MNT_JOURNALED 0x00800000 /* filesystem is journaled */ | ||
| 228 | #define MNT_NOUSERXATTR 0x01000000 /* Don't allow user extended attributes */ | ||
| 229 | #define MNT_DEFWRITE 0x02000000 /* filesystem should defer writes */ | ||
| 230 | #define MNT_MULTILABEL 0x04000000 /* MAC support for individual labels */ | ||
| 231 | #define MNT_NOATIME 0x10000000 /* disable update of file access time */ | ||
| 232 | #define MNT_SNAPSHOT 0x40000000 /* The mount is a snapshot */ | ||
| 233 | #define MNT_STRICTATIME 0x80000000 /* enable strict update of file access time */ | ||
| 234 | |||
| 235 | /* backwards compatibility only */ | ||
| 236 | #define MNT_UNKNOWNPERMISSIONS MNT_IGNORE_OWNERSHIP | ||
| 237 | |||
| 238 | |||
| 239 | /* | ||
| 240 | * XXX I think that this could now become (~(MNT_CMDFLAGS)) | ||
| 241 | * but the 'mount' program may need changing to handle this. | ||
| 242 | */ | ||
| 243 | #define MNT_VISFLAGMASK (MNT_RDONLY	| MNT_SYNCHRONOUS | MNT_NOEXEC	| \ | ||
| 244 | 	 MNT_NOSUID	| MNT_NODEV	| MNT_UNION	| \ | ||
| 245 | 	 MNT_ASYNC	| MNT_EXPORTED	| MNT_QUARANTINE | \ | ||
| 246 | 	 MNT_LOCAL	| MNT_QUOTA | MNT_REMOVABLE | \ | ||
| 247 | 	 MNT_ROOTFS	| MNT_DOVOLFS	| MNT_DONTBROWSE | \ | ||
| 248 | 	 MNT_IGNORE_OWNERSHIP | MNT_AUTOMOUNTED | MNT_JOURNALED | \ | ||
| 249 | 	 MNT_NOUSERXATTR | MNT_DEFWRITE	| MNT_MULTILABEL | \ | ||
| 250 | 	 MNT_NOATIME | MNT_STRICTATIME | MNT_SNAPSHOT | MNT_CPROTECT) | ||
| 251 | /* | ||
| 252 | * External filesystem command modifier flags. | ||
| 253 | * Unmount can use the MNT_FORCE flag. | ||
| 254 | * XXX These are not STATES and really should be somewhere else. | ||
| 255 | * External filesystem control flags. | ||
| 256 | */ | ||
| 257 | #define MNT_UPDATE 0x00010000 /* not a real mount, just an update */ | ||
| 258 | #define MNT_NOBLOCK 0x00020000 /* don't block unmount if not responding */ | ||
| 259 | #define MNT_RELOAD 0x00040000 /* reload filesystem data */ | ||
| 260 | #define MNT_FORCE 0x00080000 /* force unmount or readonly change */ | ||
| 261 | #define MNT_CMDFLAGS (MNT_UPDATE|MNT_NOBLOCK|MNT_RELOAD|MNT_FORCE) | ||
| 262 | |||
| 263 | |||
| 264 | |||
| 265 | /* | ||
| 266 | * Sysctl CTL_VFS definitions. | ||
| 267 | * | ||
| 268 | * Second level identifier specifies which filesystem. Second level | ||
| 269 | * identifier VFS_GENERIC returns information about all filesystems. | ||
| 270 | */ | ||
| 271 | #define VFS_GENERIC 0 /* generic filesystem information */ | ||
| 272 | #define VFS_NUMMNTOPS 1 /* int: total num of vfs mount/unmount operations */ | ||
| 273 | /* | ||
| 274 | * Third level identifiers for VFS_GENERIC are given below; third | ||
| 275 | * level identifiers for specific filesystems are given in their | ||
| 276 | * mount specific header files. | ||
| 277 | */ | ||
| 278 | #define VFS_MAXTYPENUM 1 /* int: highest defined filesystem type */ | ||
| 279 | #define VFS_CONF 2 /* struct: vfsconf for filesystem given | ||
| 280 | 	 * as next argument */ | ||
| 281 | |||
| 282 | /* | ||
| 283 | * Flags for various system call interfaces. | ||
| 284 | * | ||
| 285 | * waitfor flags to vfs_sync() and getfsstat() | ||
| 286 | */ | ||
| 287 | #define MNT_WAIT 1 /* synchronized I/O file integrity completion */ | ||
| 288 | #define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */ | ||
| 289 | #define MNT_DWAIT 4 /* synchronized I/O data integrity completion */ | ||
| 290 | |||
| 291 | |||
| 292 | #if !defined(KERNEL) && !defined(_KERN_SYS_KERNELTYPES_H_) /* also defined in kernel_types.h */ | ||
| 293 | struct mount; | ||
| 294 | typedef struct mount * mount_t; | ||
| 295 | struct vnode; | ||
| 296 | typedef struct vnode * vnode_t; | ||
| 297 | #endif | ||
| 298 | |||
| 299 | /* Reserved fields preserve binary compatibility */ | ||
| 300 | struct vfsconf { | ||
| 301 | 	uint32_t vfc_reserved1; /* opaque */ | ||
| 302 | 	char vfc_name[MFSNAMELEN]; /* filesystem type name */ | ||
| 303 | 	int vfc_typenum; /* historic filesystem type number */ | ||
| 304 | 	int vfc_refcount; /* number mounted of this type */ | ||
| 305 | 	int vfc_flags; /* permanent flags */ | ||
| 306 | 	uint32_t vfc_reserved2; /* opaque */ | ||
| 307 | 	uint32_t vfc_reserved3; /* opaque */ | ||
| 308 | }; | ||
| 309 | |||
| 310 | struct vfsidctl { | ||
| 311 | 	int vc_vers; /* should be VFSIDCTL_VERS1 (below) */ | ||
| 312 | 	fsid_t vc_fsid; /* fsid to operate on. */ | ||
| 313 | 	void *vc_ptr; /* pointer to data structure. */ | ||
| 314 | 	size_t vc_len; /* sizeof said structure. */ | ||
| 315 | 	u_int32_t vc_spare[12]; /* spare (must be zero). */ | ||
| 316 | }; | ||
| 317 | |||
| 318 | |||
| 319 | /* vfsidctl API version. */ | ||
| 320 | #define VFS_CTL_VERS1 0x01 | ||
| 321 | |||
| 322 | |||
| 323 | /* | ||
| 324 | * New style VFS sysctls, do not reuse/conflict with the namespace for | ||
| 325 | * private sysctls. | ||
| 326 | */ | ||
| 327 | #define VFS_CTL_OSTATFS 0x00010001 /* old legacy statfs */ | ||
| 328 | #define VFS_CTL_UMOUNT 0x00010002 /* unmount */ | ||
| 329 | #define VFS_CTL_QUERY 0x00010003 /* anything wrong? (vfsquery) */ | ||
| 330 | #define VFS_CTL_NEWADDR 0x00010004 /* reconnect to new address */ | ||
| 331 | #define VFS_CTL_TIMEO 0x00010005 /* set timeout for vfs notification */ | ||
| 332 | #define VFS_CTL_NOLOCKS 0x00010006 /* disable file locking */ | ||
| 333 | #define VFS_CTL_SADDR 0x00010007 /* get server address */ | ||
| 334 | #define VFS_CTL_DISC 0x00010008 /* server disconnected */ | ||
| 335 | #define VFS_CTL_SERVERINFO 0x00010009 /* information about fs server */ | ||
| 336 | #define VFS_CTL_NSTATUS 0x0001000A /* netfs mount status */ | ||
| 337 | #define VFS_CTL_STATFS64 0x0001000B /* statfs64 */ | ||
| 338 | |||
| 339 | /* | ||
| 340 | * Automatically select the correct VFS_CTL_*STATFS* flavor based | ||
| 341 | * on what "struct statfs" layout the client will use. | ||
| 342 | */ | ||
| 343 | #if __DARWIN_64_BIT_INO_T | ||
| 344 | #define VFS_CTL_STATFS VFS_CTL_STATFS64 | ||
| 345 | #else | ||
| 346 | #define VFS_CTL_STATFS VFS_CTL_OSTATFS | ||
| 347 | #endif | ||
| 348 | |||
| 349 | struct vfsquery { | ||
| 350 | 	u_int32_t vq_flags; | ||
| 351 | 	u_int32_t vq_spare[31]; | ||
| 352 | }; | ||
| 353 | |||
| 354 | struct vfs_server { | ||
| 355 | 	int32_t vs_minutes; /* minutes until server goes down. */ | ||
| 356 | 	u_int8_t vs_server_name[MAXHOSTNAMELEN * 3]; /* UTF8 server name to display (null terminated) */ | ||
| 357 | }; | ||
| 358 | |||
| 359 | /* | ||
| 360 | * NetFS mount status - returned by VFS_CTL_NSTATUS | ||
| 361 | */ | ||
| 362 | struct netfs_status { | ||
| 363 | 	u_int32_t ns_status; // Current status of mount (vfsquery flags) | ||
| 364 | 	char ns_mountopts[512]; // Significant mount options | ||
| 365 | 	uint32_t ns_waittime; // Time waiting for reply (sec) | ||
| 366 | 	uint32_t ns_threadcount; // Number of threads blocked on network calls | ||
| 367 | 	uint64_t ns_threadids[0]; // Thread IDs of those blocked threads | ||
| 368 | }; | ||
| 369 | |||
| 370 | /* vfsquery flags */ | ||
| 371 | #define VQ_NOTRESP 0x0001 /* server down */ | ||
| 372 | #define VQ_NEEDAUTH 0x0002 /* server bad auth */ | ||
| 373 | #define VQ_LOWDISK 0x0004 /* we're low on space */ | ||
| 374 | #define VQ_MOUNT 0x0008 /* new filesystem arrived */ | ||
| 375 | #define VQ_UNMOUNT 0x0010 /* filesystem has left */ | ||
| 376 | #define VQ_DEAD 0x0020 /* filesystem is dead, needs force unmount */ | ||
| 377 | #define VQ_ASSIST 0x0040 /* filesystem needs assistance from external program */ | ||
| 378 | #define VQ_NOTRESPLOCK 0x0080 /* server lockd down */ | ||
| 379 | #define VQ_UPDATE 0x0100 /* filesystem information has changed */ | ||
| 380 | #define VQ_VERYLOWDISK 0x0200 /* file system has *very* little disk space left */ | ||
| 381 | #define VQ_SYNCEVENT 0x0400 /* a sync just happened (not set by kernel starting Mac OS X 10.9) */ | ||
| 382 | #define VQ_SERVEREVENT 0x0800 /* server issued notification/warning */ | ||
| 383 | #define VQ_QUOTA 0x1000 /* a user quota has been hit */ | ||
| 384 | #define VQ_NEARLOWDISK 0x2000 /* Above lowdisk and below desired disk space */ | ||
| 385 | #define VQ_DESIRED_DISK 0x4000 /* the desired disk space */ | ||
| 386 | #define VQ_FREE_SPACE_CHANGE 0x8000 /* free disk space has significantly changed */ | ||
| 387 | #define VQ_FLAG10000 0x10000 /* placeholder */ | ||
| 388 | |||
| 389 | |||
| 390 | |||
| 391 | |||
| 392 | /* | ||
| 393 | * Generic file handle | ||
| 394 | */ | ||
| 395 | #define NFS_MAX_FH_SIZE NFSV4_MAX_FH_SIZE | ||
| 396 | #define NFSV4_MAX_FH_SIZE 128 | ||
| 397 | #define NFSV3_MAX_FH_SIZE 64 | ||
| 398 | #define NFSV2_MAX_FH_SIZE 32 | ||
| 399 | struct fhandle { | ||
| 400 | 	unsigned int fh_len; /* length of file handle */ | ||
| 401 | 	unsigned char fh_data[NFS_MAX_FH_SIZE]; /* file handle value */ | ||
| 402 | }; | ||
| 403 | typedef struct fhandle fhandle_t; | ||
| 404 | |||
| 405 | |||
| 406 | __BEGIN_DECLS | ||
| 407 | int fhopen(const struct fhandle *, int); | ||
| 408 | int fstatfs(int, struct statfs *) __DARWIN_INODE64(fstatfs); | ||
| 409 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 410 | int fstatfs64(int, struct statfs64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 411 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 412 | int getfh(const char *, fhandle_t *); | ||
| 413 | int getfsstat(struct statfs *, int, int) __DARWIN_INODE64(getfsstat); | ||
| 414 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 415 | int getfsstat64(struct statfs64 *, int, int) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 416 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 417 | int getmntinfo(struct statfs **, int) __DARWIN_INODE64(getmntinfo); | ||
| 418 | int getmntinfo_r_np(struct statfs **, int) __DARWIN_INODE64(getmntinfo_r_np) | ||
| 419 | __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 420 | __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 421 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 422 | int getmntinfo64(struct statfs64 **, int) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 423 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 424 | int mount(const char *, const char *, int, void *); | ||
| 425 | int fmount(const char *, int, int, void *) __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 426 | int statfs(const char *, struct statfs *) __DARWIN_INODE64(statfs); | ||
| 427 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 428 | int statfs64(const char *, struct statfs64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 429 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 430 | int unmount(const char *, int); | ||
| 431 | int getvfsbyname(const char *, struct vfsconf *); | ||
| 432 | __END_DECLS | ||
| 433 | |||
| 434 | #endif /* !_SYS_MOUNT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/msg.h created+225| ... | @@ -0,0 +1,225 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*	$NetBSD: msg.h,v 1.4 1994/06/29 06:44:43 cgd Exp $	*/ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * SVID compatible msg.h file | ||
| 32 | * | ||
| 33 | * Author: Daniel Boulet | ||
| 34 | * | ||
| 35 | * Copyright 1993 Daniel Boulet and RTMX Inc. | ||
| 36 | * | ||
| 37 | * This system call was implemented by Daniel Boulet under contract from RTMX. | ||
| 38 | * | ||
| 39 | * Redistribution and use in source forms, with and without modification, | ||
| 40 | * are permitted provided that this entire comment appears intact. | ||
| 41 | * | ||
| 42 | * Redistribution in binary form may occur without any restrictions. | ||
| 43 | * Obviously, it would be nice if you gave credit where credit is due | ||
| 44 | * but requiring it would be too onerous. | ||
| 45 | * | ||
| 46 | * This software is provided ``AS IS'' without any warranties of any kind. | ||
| 47 | */ | ||
| 48 | /* | ||
| 49 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 50 | * support for mandatory and extensible security protections. This notice | ||
| 51 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 52 | * Version 2.0. | ||
| 53 | */ | ||
| 54 | |||
| 55 | #ifndef _SYS_MSG_H_ | ||
| 56 | #define _SYS_MSG_H_ | ||
| 57 | |||
| 58 | #include <sys/appleapiopts.h> | ||
| 59 | |||
| 60 | #include <sys/_types.h> | ||
| 61 | #include <sys/cdefs.h> | ||
| 62 | |||
| 63 | /* | ||
| 64 | * [XSI] All of the symbols from <sys/ipc.h> SHALL be defined when this | ||
| 65 | * header is included | ||
| 66 | */ | ||
| 67 | #include <sys/ipc.h> | ||
| 68 | |||
| 69 | |||
| 70 | /* | ||
| 71 | * [XSI] The pid_t, time_t, key_t, size_t, and ssize_t types shall be | ||
| 72 | * defined as described in <sys/types.h>. | ||
| 73 | * | ||
| 74 | * NOTE:	The definition of the key_t type is implicit from the | ||
| 75 | *		inclusion of <sys/ipc.h> | ||
| 76 | */ | ||
| 77 | #include <sys/_types/_pid_t.h> | ||
| 78 | #include <sys/_types/_time_t.h> | ||
| 79 | #include <sys/_types/_size_t.h> | ||
| 80 | #include <sys/_types/_ssize_t.h> | ||
| 81 | |||
| 82 | /* [XSI] Used for the number of messages in the message queue */ | ||
| 83 | typedef unsigned long msgqnum_t; | ||
| 84 | |||
| 85 | /* [XSI] Used for the number of bytes allowed in a message queue */ | ||
| 86 | typedef unsigned long msglen_t; | ||
| 87 | |||
| 88 | /* | ||
| 89 | * Possible values for the fifth parameter to msgrcv(), in addition to the | ||
| 90 | * IPC_NOWAIT flag, which is permitted. | ||
| 91 | */ | ||
| 92 | #define MSG_NOERROR 010000 /* [XSI] No error if big message */ | ||
| 93 | |||
| 94 | |||
| 95 | /* | ||
| 96 | * Technically, we should force all code references to the new structure | ||
| 97 | * definition, not in just the standards conformance case, and leave the | ||
| 98 | * legacy interface there for binary compatibility only. Currently, we | ||
| 99 | * are only forcing this for programs requesting standards conformance. | ||
| 100 | */ | ||
| 101 | #if __DARWIN_UNIX03 || defined(KERNEL) | ||
| 102 | #pragma pack(4) | ||
| 103 | /* | ||
| 104 | * Structure used internally. | ||
| 105 | * | ||
| 106 | * Structure whose address is passed as the third parameter to msgctl() | ||
| 107 | * when the second parameter is IPC_SET or IPC_STAT. In the case of the | ||
| 108 | * IPC_SET command, only the msg_perm.{uid|gid|perm} and msg_qbytes are | ||
| 109 | * honored. In the case of IPC_STAT, only the fields indicated as [XSI] | ||
| 110 | * mandated fields are guaranteed to meaningful: DO NOT depend on the | ||
| 111 | * contents of the other fields. | ||
| 112 | * | ||
| 113 | * NOTES:	Reserved fields are not preserved across IPC_SET/IPC_STAT. | ||
| 114 | */ | ||
| 115 | #if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE)) | ||
| 116 | struct msqid_ds | ||
| 117 | #else | ||
| 118 | #define msqid_ds __msqid_ds_new | ||
| 119 | struct __msqid_ds_new | ||
| 120 | #endif | ||
| 121 | { | ||
| 122 | 	struct __ipc_perm_new msg_perm; /* [XSI] msg queue permissions */ | ||
| 123 | 	__int32_t msg_first; /* RESERVED: kernel use only */ | ||
| 124 | 	__int32_t msg_last; /* RESERVED: kernel use only */ | ||
| 125 | 	msglen_t msg_cbytes; /* # of bytes on the queue */ | ||
| 126 | 	msgqnum_t msg_qnum; /* [XSI] number of msgs on the queue */ | ||
| 127 | 	msglen_t msg_qbytes; /* [XSI] max bytes on the queue */ | ||
| 128 | 	pid_t msg_lspid; /* [XSI] pid of last msgsnd() */ | ||
| 129 | 	pid_t msg_lrpid; /* [XSI] pid of last msgrcv() */ | ||
| 130 | 	time_t msg_stime; /* [XSI] time of last msgsnd() */ | ||
| 131 | 	__int32_t msg_pad1; /* RESERVED: DO NOT USE */ | ||
| 132 | 	time_t msg_rtime; /* [XSI] time of last msgrcv() */ | ||
| 133 | 	__int32_t msg_pad2; /* RESERVED: DO NOT USE */ | ||
| 134 | 	time_t msg_ctime; /* [XSI] time of last msgctl() */ | ||
| 135 | 	__int32_t msg_pad3; /* RESERVED: DO NOT USE */ | ||
| 136 | 	__int32_t msg_pad4[4]; /* RESERVED: DO NOT USE */ | ||
| 137 | }; | ||
| 138 | #pragma pack() | ||
| 139 | #else /* !__DARWIN_UNIX03 */ | ||
| 140 | #define msqid_ds __msqid_ds_old | ||
| 141 | #endif /* !__DARWIN_UNIX03 */ | ||
| 142 | |||
| 143 | #if !__DARWIN_UNIX03 | ||
| 144 | struct __msqid_ds_old { | ||
| 145 | 	struct __ipc_perm_old msg_perm; /* [XSI] msg queue permissions */ | ||
| 146 | 	__int32_t msg_first; /* RESERVED: kernel use only */ | ||
| 147 | 	__int32_t msg_last; /* RESERVED: kernel use only */ | ||
| 148 | 	msglen_t msg_cbytes; /* # of bytes on the queue */ | ||
| 149 | 	msgqnum_t msg_qnum; /* [XSI] number of msgs on the queue */ | ||
| 150 | 	msglen_t msg_qbytes; /* [XSI] max bytes on the queue */ | ||
| 151 | 	pid_t msg_lspid; /* [XSI] pid of last msgsnd() */ | ||
| 152 | 	pid_t msg_lrpid; /* [XSI] pid of last msgrcv() */ | ||
| 153 | 	time_t msg_stime; /* [XSI] time of last msgsnd() */ | ||
| 154 | 	__int32_t msg_pad1; /* RESERVED: DO NOT USE */ | ||
| 155 | 	time_t msg_rtime; /* [XSI] time of last msgrcv() */ | ||
| 156 | 	__int32_t msg_pad2; /* RESERVED: DO NOT USE */ | ||
| 157 | 	time_t msg_ctime; /* [XSI] time of last msgctl() */ | ||
| 158 | 	__int32_t msg_pad3; /* RESERVED: DO NOT USE */ | ||
| 159 | 	__int32_t msg_pad4[4]; /* RESERVED: DO NOT USE */ | ||
| 160 | }; | ||
| 161 | #endif /* !__DARWIN_UNIX03 */ | ||
| 162 | |||
| 163 | |||
| 164 | |||
| 165 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 166 | #ifdef __APPLE_API_UNSTABLE | ||
| 167 | /* XXX kernel only; protect with macro later */ | ||
| 168 | |||
| 169 | struct msg { | ||
| 170 | 	struct msg *msg_next; /* next msg in the chain */ | ||
| 171 | 	long msg_type; /* type of this message */ | ||
| 172 | 	 /* >0 -> type of this message */ | ||
| 173 | 	 /* 0 -> free header */ | ||
| 174 | 	unsigned short msg_ts; /* size of this message */ | ||
| 175 | 	short msg_spot; /* location of msg start in buffer */ | ||
| 176 | 	struct label *label; /* MAC label */ | ||
| 177 | }; | ||
| 178 | |||
| 179 | /* | ||
| 180 | * Example structure describing a message whose address is to be passed as | ||
| 181 | * the second argument to the functions msgrcv() and msgsnd(). The only | ||
| 182 | * actual hard requirement is that the first field be of type long, and | ||
| 183 | * contain the message type. The user is encouraged to define their own | ||
| 184 | * application specific structure; this definition is included solely for | ||
| 185 | * backward compatability with existing source code. | ||
| 186 | */ | ||
| 187 | struct mymsg { | ||
| 188 | 	long mtype; /* message type (+ve integer) */ | ||
| 189 | 	char mtext[1]; /* message body */ | ||
| 190 | }; | ||
| 191 | |||
| 192 | /* | ||
| 193 | * Based on the configuration parameters described in an SVR2 (yes, two) | ||
| 194 | * config(1m) man page. | ||
| 195 | * | ||
| 196 | * Each message is broken up and stored in segments that are msgssz bytes | ||
| 197 | * long. For efficiency reasons, this should be a power of two. Also, | ||
| 198 | * it doesn't make sense if it is less than 8 or greater than about 256. | ||
| 199 | * Consequently, msginit in kern/sysv_msg.c checks that msgssz is a power of | ||
| 200 | * two between 8 and 1024 inclusive (and panic's if it isn't). | ||
| 201 | */ | ||
| 202 | struct msginfo { | ||
| 203 | 	int msgmax, /* max chars in a message */ | ||
| 204 | 	 msgmni, /* max message queue identifiers */ | ||
| 205 | 	 msgmnb, /* max chars in a queue */ | ||
| 206 | 	 msgtql, /* max messages in system */ | ||
| 207 | 	 msgssz, /* size of a message segment (see notes above) */ | ||
| 208 | 	 msgseg; /* number of message segments */ | ||
| 209 | }; | ||
| 210 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 211 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 212 | |||
| 213 | |||
| 214 | __BEGIN_DECLS | ||
| 215 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 216 | int msgsys(int, ...); | ||
| 217 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 218 | int msgctl(int, int, struct msqid_ds *) __DARWIN_ALIAS(msgctl); | ||
| 219 | int msgget(key_t, int); | ||
| 220 | ssize_t msgrcv(int, void *, size_t, long, int) __DARWIN_ALIAS_C(msgrcv); | ||
| 221 | int msgsnd(int, const void *, size_t, int) __DARWIN_ALIAS_C(msgsnd); | ||
| 222 | __END_DECLS | ||
| 223 | |||
| 224 | |||
| 225 | #endif /* !_SYS_MSG_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/param.h created+235| ... | @@ -0,0 +1,235 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1989, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | *	This product includes software developed by the University of | ||
| 49 | *	California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)param.h	8.3 (Berkeley) 4/4/95 | ||
| 67 | */ | ||
| 68 | |||
| 69 | #ifndef _SYS_PARAM_H_ | ||
| 70 | #define _SYS_PARAM_H_ | ||
| 71 | |||
| 72 | #define BSD 199506 /* System version (year & month). */ | ||
| 73 | #define BSD4_3 1 | ||
| 74 | #define BSD4_4 1 | ||
| 75 | |||
| 76 | #define NeXTBSD 1995064 /* NeXTBSD version (year, month, release) */ | ||
| 77 | #define NeXTBSD4_0 0 /* NeXTBSD 4.0 */ | ||
| 78 | |||
| 79 | #include <sys/_types.h> | ||
| 80 | #include <sys/_types/_null.h> | ||
| 81 | |||
| 82 | #ifndef LOCORE | ||
| 83 | #include <sys/types.h> | ||
| 84 | #endif | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Machine-independent constants (some used in following include files). | ||
| 88 | * Redefined constants are from POSIX 1003.1 limits file. | ||
| 89 | * | ||
| 90 | * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>) | ||
| 91 | * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>) | ||
| 92 | */ | ||
| 93 | #include <sys/syslimits.h> | ||
| 94 | |||
| 95 | #define MAXCOMLEN 16 /* max command name remembered */ | ||
| 96 | #define MAXINTERP 64 /* max interpreter file name length */ | ||
| 97 | #define MAXLOGNAME 255 /* max login name length */ | ||
| 98 | #define MAXUPRC CHILD_MAX /* max simultaneous processes */ | ||
| 99 | #define NCARGS ARG_MAX /* max bytes for an exec function */ | ||
| 100 | #define NGROUPS NGROUPS_MAX /* max number groups */ | ||
| 101 | #define NOFILE 256 /* default max open files per process */ | ||
| 102 | #define NOGROUP 65535 /* marker for empty group set member */ | ||
| 103 | #define MAXHOSTNAMELEN 256 /* max hostname size */ | ||
| 104 | #define MAXDOMNAMELEN 256 /* maximum domain name length */ | ||
| 105 | |||
| 106 | /* Machine type dependent parameters. */ | ||
| 107 | #include <machine/param.h> | ||
| 108 | |||
| 109 | /* More types and definitions used throughout the kernel. */ | ||
| 110 | #include <limits.h> | ||
| 111 | |||
| 112 | /* Signals. */ | ||
| 113 | #include <sys/signal.h> | ||
| 114 | |||
| 115 | /* | ||
| 116 | * Priorities. Note that with 32 run queues, differences less than 4 are | ||
| 117 | * insignificant. | ||
| 118 | */ | ||
| 119 | #define PSWP 0 | ||
| 120 | #define PVM 4 | ||
| 121 | #define PINOD 8 | ||
| 122 | #define PRIBIO 16 | ||
| 123 | #define PVFS 20 | ||
| 124 | #define PZERO 22 /* No longer magic, shouldn't be here. XXX */ | ||
| 125 | #define PSOCK 24 | ||
| 126 | #define PWAIT 32 | ||
| 127 | #define PLOCK 36 | ||
| 128 | #define PPAUSE 40 | ||
| 129 | #define PUSER 50 | ||
| 130 | #define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */ | ||
| 131 | |||
| 132 | #define PRIMASK 0x0ff | ||
| 133 | #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ | ||
| 134 | #define PTTYBLOCK 0x200 /* for tty SIGTTOU and SIGTTIN blocking */ | ||
| 135 | #define PDROP 0x400 /* OR'd with pri to stop re-aquistion of mutex upon wakeup */ | ||
| 136 | #define PSPIN 0x800 /* OR'd with pri to require mutex in spin mode upon wakeup */ | ||
| 137 | |||
| 138 | #define NBPW sizeof(int) /* number of bytes per word (integer) */ | ||
| 139 | |||
| 140 | #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ | ||
| 141 | #define NODEV (dev_t)(-1) /* non-existent device */ | ||
| 142 | |||
| 143 | /* | ||
| 144 | * Clustering of hardware pages on machines with ridiculously small | ||
| 145 | * page sizes is done here. The paging subsystem deals with units of | ||
| 146 | * CLSIZE pte's describing NBPG (from machine/param.h) pages each. | ||
| 147 | */ | ||
| 148 | #define CLBYTES (CLSIZE*NBPG) | ||
| 149 | #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ | ||
| 150 | #define claligned(x) ((((int)(x))&CLOFSET)==0) | ||
| 151 | #define CLOFF CLOFSET | ||
| 152 | #define CLSHIFT (PGSHIFT+CLSIZELOG2) | ||
| 153 | |||
| 154 | #if CLSIZE == 1 | ||
| 155 | #define clbase(i) (i) | ||
| 156 | #define clrnd(i) (i) | ||
| 157 | #else | ||
| 158 | /* Give the base virtual address (first of CLSIZE). */ | ||
| 159 | #define clbase(i) ((i) &~ (CLSIZE-1)) | ||
| 160 | /* Round a number of clicks up to a whole cluster. */ | ||
| 161 | #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) | ||
| 162 | #endif | ||
| 163 | |||
| 164 | #define CBLOCK 64 /* Clist block size, must be a power of 2. */ | ||
| 165 | #define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ | ||
| 166 | /* Data chars/clist. */ | ||
| 167 | #define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) | ||
| 168 | #define CROUND (CBLOCK - 1) /* Clist rounding. */ | ||
| 169 | |||
| 170 | /* | ||
| 171 | * File system parameters and macros. | ||
| 172 | * | ||
| 173 | * The file system is made out of blocks of at most MAXPHYS units, with | ||
| 174 | * smaller units (fragments) only in the last direct block. MAXBSIZE | ||
| 175 | * primarily determines the size of buffers in the buffer pool. It may be | ||
| 176 | * made larger than MAXPHYS without any effect on existing file systems; | ||
| 177 | * however making it smaller may make some file systems unmountable. | ||
| 178 | * We set this to track the value of MAX_UPL_TRANSFER_BYTES from | ||
| 179 | * osfmk/mach/memory_object_types.h to bound it at the maximum UPL size. | ||
| 180 | */ | ||
| 181 | #define MAXBSIZE (256 * 4096) | ||
| 182 | #define MAXPHYSIO MAXPHYS | ||
| 183 | #define MAXFRAG 8 | ||
| 184 | |||
| 185 | #define MAXPHYSIO_WIRED (16 * 1024 * 1024) | ||
| 186 | |||
| 187 | /* | ||
| 188 | * MAXPATHLEN defines the longest permissable path length after expanding | ||
| 189 | * symbolic links. It is used to allocate a temporary buffer from the buffer | ||
| 190 | * pool in which to do the name expansion, hence should be a power of two, | ||
| 191 | * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the | ||
| 192 | * maximum number of symbolic links that may be expanded in a path name. | ||
| 193 | * It should be set high enough to allow all legitimate uses, but halt | ||
| 194 | * infinite loops reasonably quickly. | ||
| 195 | */ | ||
| 196 | #define MAXPATHLEN PATH_MAX | ||
| 197 | #define MAXSYMLINKS 32 | ||
| 198 | |||
| 199 | /* Bit map related macros. */ | ||
| 200 | #define setbit(a, i) (((unsigned char *)(a))[(i)/NBBY] |= 1u<<((i)%NBBY)) | ||
| 201 | #define clrbit(a, i) (((unsigned char *)(a))[(i)/NBBY] &= ~(1u<<((i)%NBBY))) | ||
| 202 | #define isset(a, i) (((unsigned char *)(a))[(i)/NBBY] & (1u<<((i)%NBBY))) | ||
| 203 | #define isclr(a, i) ((((unsigned char *)(a))[(i)/NBBY] & (1u<<((i)%NBBY))) == 0) | ||
| 204 | |||
| 205 | /* Macros for counting and rounding. */ | ||
| 206 | #ifndef howmany | ||
| 207 | #define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) | ||
| 208 | #endif | ||
| 209 | #define roundup(x, y) ((((x) % (y)) == 0) ? \ | ||
| 210 | 	 (x) : ((x) + ((y) - ((x) % (y))))) | ||
| 211 | #define powerof2(x) ((((x)-1)&(x))==0) | ||
| 212 | |||
| 213 | /* Macros for min/max. */ | ||
| 214 | #ifndef MIN | ||
| 215 | #define MIN(a, b) (((a)<(b))?(a):(b)) | ||
| 216 | #endif /* MIN */ | ||
| 217 | #ifndef MAX | ||
| 218 | #define MAX(a, b) (((a)>(b))?(a):(b)) | ||
| 219 | #endif /* MAX */ | ||
| 220 | |||
| 221 | /* | ||
| 222 | * Scale factor for scaled integers used to count %cpu time and load avgs. | ||
| 223 | * | ||
| 224 | * The number of CPU `tick's that map to a unique `%age' can be expressed | ||
| 225 | * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that | ||
| 226 | * can be calculated (assuming 32 bits) can be closely approximated using | ||
| 227 | * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). | ||
| 228 | * | ||
| 229 | * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', | ||
| 230 | * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. | ||
| 231 | */ | ||
| 232 | #define FSHIFT 11 /* bits to right of fixed binary point */ | ||
| 233 | #define FSCALE (1<<FSHIFT) | ||
| 234 | |||
| 235 | #endif /* _SYS_PARAM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/poll.h created+118| ... | @@ -0,0 +1,118 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*- | ||
| 29 | * Copyright (c) 1997 Peter Wemm <peter@freebsd.org> | ||
| 30 | * All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. The name of the author may not be used to endorse or promote products | ||
| 41 | * derived from this software without specific prior written permission. | ||
| 42 | * | ||
| 43 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 44 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 45 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 46 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 47 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 48 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 49 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 50 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 51 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 52 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 53 | * SUCH DAMAGE. | ||
| 54 | * | ||
| 55 | */ | ||
| 56 | |||
| 57 | #ifndef _SYS_POLL_H_ | ||
| 58 | #define _SYS_POLL_H_ | ||
| 59 | |||
| 60 | /* | ||
| 61 | * This file is intended to be compatible with the traditional poll.h. | ||
| 62 | */ | ||
| 63 | |||
| 64 | /* | ||
| 65 | * Requestable events. If poll(2) finds any of these set, they are | ||
| 66 | * copied to revents on return. | ||
| 67 | */ | ||
| 68 | #define POLLIN 0x0001 /* any readable data available */ | ||
| 69 | #define POLLPRI 0x0002 /* OOB/Urgent readable data */ | ||
| 70 | #define POLLOUT 0x0004 /* file descriptor is writeable */ | ||
| 71 | #define POLLRDNORM 0x0040 /* non-OOB/URG data available */ | ||
| 72 | #define POLLWRNORM POLLOUT /* no write type differentiation */ | ||
| 73 | #define POLLRDBAND 0x0080 /* OOB/Urgent readable data */ | ||
| 74 | #define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */ | ||
| 75 | |||
| 76 | /* | ||
| 77 | * FreeBSD extensions: polling on a regular file might return one | ||
| 78 | * of these events (currently only supported on local filesystems). | ||
| 79 | */ | ||
| 80 | #define POLLEXTEND 0x0200 /* file may have been extended */ | ||
| 81 | #define POLLATTRIB 0x0400 /* file attributes may have changed */ | ||
| 82 | #define POLLNLINK 0x0800 /* (un)link/rename may have happened */ | ||
| 83 | #define POLLWRITE 0x1000 /* file's contents may have changed */ | ||
| 84 | |||
| 85 | /* | ||
| 86 | * These events are set if they occur regardless of whether they were | ||
| 87 | * requested. | ||
| 88 | */ | ||
| 89 | #define POLLERR 0x0008 /* some poll error occurred */ | ||
| 90 | #define POLLHUP 0x0010 /* file descriptor was "hung up" */ | ||
| 91 | #define POLLNVAL 0x0020 /* requested events "invalid" */ | ||
| 92 | |||
| 93 | #define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\ | ||
| 94 | 	 POLLWRBAND|POLLERR|POLLHUP|POLLNVAL) | ||
| 95 | |||
| 96 | struct pollfd { | ||
| 97 | 	int fd; | ||
| 98 | 	short events; | ||
| 99 | 	short revents; | ||
| 100 | }; | ||
| 101 | |||
| 102 | typedef unsigned int nfds_t; | ||
| 103 | |||
| 104 | |||
| 105 | #include <sys/cdefs.h> | ||
| 106 | |||
| 107 | __BEGIN_DECLS | ||
| 108 | |||
| 109 | /* | ||
| 110 | * This is defined here (instead of <poll.h>) because this is where | ||
| 111 | * traditional SVR4 code will look to find it. | ||
| 112 | */ | ||
| 113 | extern int poll(struct pollfd *, nfds_t, int) __DARWIN_ALIAS_C(poll); | ||
| 114 | |||
| 115 | __END_DECLS | ||
| 116 | |||
| 117 | |||
| 118 | #endif /* !_SYS_POLL_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/proc.h created+224| ... | @@ -0,0 +1,224 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1986, 1989, 1991, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | *	This product includes software developed by the University of | ||
| 49 | *	California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)proc.h	8.15 (Berkeley) 5/19/95 | ||
| 67 | */ | ||
| 68 | |||
| 69 | #ifndef _SYS_PROC_H_ | ||
| 70 | #define _SYS_PROC_H_ | ||
| 71 | |||
| 72 | #include <sys/appleapiopts.h> | ||
| 73 | #include <sys/cdefs.h> | ||
| 74 | #include <sys/select.h> /* For struct selinfo. */ | ||
| 75 | #include <sys/queue.h> | ||
| 76 | #include <sys/lock.h> | ||
| 77 | #include <sys/param.h> | ||
| 78 | #include <sys/event.h> | ||
| 79 | #include <sys/time.h> | ||
| 80 | #include <mach/boolean.h> | ||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | struct session; | ||
| 85 | struct pgrp; | ||
| 86 | struct proc; | ||
| 87 | struct proc_ident; | ||
| 88 | |||
| 89 | /* Exported fields for kern sysctls */ | ||
| 90 | struct extern_proc { | ||
| 91 | 	union { | ||
| 92 | 		struct { | ||
| 93 | 			struct proc *__p_forw; /* Doubly-linked run/sleep queue. */ | ||
| 94 | 			struct proc *__p_back; | ||
| 95 | 		} p_st1; | ||
| 96 | 		struct timeval __p_starttime; /* process start time */ | ||
| 97 | 	} p_un; | ||
| 98 | #define p_forw p_un.p_st1.__p_forw | ||
| 99 | #define p_back p_un.p_st1.__p_back | ||
| 100 | #define p_starttime p_un.__p_starttime | ||
| 101 | 	struct vmspace *p_vmspace; /* Address space. */ | ||
| 102 | 	struct sigacts *p_sigacts; /* Signal actions, state (PROC ONLY). */ | ||
| 103 | 	int p_flag; /* P_* flags. */ | ||
| 104 | 	char p_stat; /* S* process status. */ | ||
| 105 | 	pid_t p_pid; /* Process identifier. */ | ||
| 106 | 	pid_t p_oppid; /* Save parent pid during ptrace. XXX */ | ||
| 107 | 	int p_dupfd; /* Sideways return value from fdopen. XXX */ | ||
| 108 | 	/* Mach related */ | ||
| 109 | 	caddr_t user_stack; /* where user stack was allocated */ | ||
| 110 | 	void *exit_thread; /* XXX Which thread is exiting? */ | ||
| 111 | 	int p_debugger; /* allow to debug */ | ||
| 112 | 	boolean_t sigwait; /* indication to suspend */ | ||
| 113 | 	/* scheduling */ | ||
| 114 | 	u_int p_estcpu; /* Time averaged value of p_cpticks. */ | ||
| 115 | 	int p_cpticks; /* Ticks of cpu time. */ | ||
| 116 | 	fixpt_t p_pctcpu; /* %cpu for this process during p_swtime */ | ||
| 117 | 	void *p_wchan; /* Sleep address. */ | ||
| 118 | 	char *p_wmesg; /* Reason for sleep. */ | ||
| 119 | 	u_int p_swtime; /* Time swapped in or out. */ | ||
| 120 | 	u_int p_slptime; /* Time since last blocked. */ | ||
| 121 | 	struct itimerval p_realtimer; /* Alarm timer. */ | ||
| 122 | 	struct timeval p_rtime; /* Real time. */ | ||
| 123 | 	u_quad_t p_uticks; /* Statclock hits in user mode. */ | ||
| 124 | 	u_quad_t p_sticks; /* Statclock hits in system mode. */ | ||
| 125 | 	u_quad_t p_iticks; /* Statclock hits processing intr. */ | ||
| 126 | 	int p_traceflag; /* Kernel trace points. */ | ||
| 127 | 	struct vnode *p_tracep; /* Trace to vnode. */ | ||
| 128 | 	int p_siglist; /* DEPRECATED. */ | ||
| 129 | 	struct vnode *p_textvp; /* Vnode of executable. */ | ||
| 130 | 	int p_holdcnt; /* If non-zero, don't swap. */ | ||
| 131 | 	sigset_t p_sigmask; /* DEPRECATED. */ | ||
| 132 | 	sigset_t p_sigignore; /* Signals being ignored. */ | ||
| 133 | 	sigset_t p_sigcatch; /* Signals being caught by user. */ | ||
| 134 | 	u_char p_priority; /* Process priority. */ | ||
| 135 | 	u_char p_usrpri; /* User-priority based on p_cpu and p_nice. */ | ||
| 136 | 	char p_nice; /* Process "nice" value. */ | ||
| 137 | 	char p_comm[MAXCOMLEN + 1]; | ||
| 138 | 	struct pgrp *p_pgrp; /* Pointer to process group. */ | ||
| 139 | 	struct user *p_addr; /* Kernel virtual addr of u-area (PROC ONLY). */ | ||
| 140 | 	u_short p_xstat; /* Exit status for wait; also stop signal. */ | ||
| 141 | 	u_short p_acflag; /* Accounting flags. */ | ||
| 142 | 	struct rusage *p_ru; /* Exit information. XXX */ | ||
| 143 | }; | ||
| 144 | |||
| 145 | |||
| 146 | /* Status values. */ | ||
| 147 | #define SIDL 1 /* Process being created by fork. */ | ||
| 148 | #define SRUN 2 /* Currently runnable. */ | ||
| 149 | #define SSLEEP 3 /* Sleeping on an address. */ | ||
| 150 | #define SSTOP 4 /* Process debugging or suspension. */ | ||
| 151 | #define SZOMB 5 /* Awaiting collection by parent. */ | ||
| 152 | |||
| 153 | /* These flags are kept in extern_proc.p_flag. */ | ||
| 154 | #define P_ADVLOCK 0x00000001 /* Process may hold POSIX adv. lock */ | ||
| 155 | #define P_CONTROLT 0x00000002 /* Has a controlling terminal */ | ||
| 156 | #define P_LP64 0x00000004 /* Process is LP64 */ | ||
| 157 | #define P_NOCLDSTOP 0x00000008 /* No SIGCHLD when children stop */ | ||
| 158 | |||
| 159 | #define P_PPWAIT 0x00000010 /* Parent waiting for chld exec/exit */ | ||
| 160 | #define P_PROFIL 0x00000020 /* Has started profiling */ | ||
| 161 | #define P_SELECT 0x00000040 /* Selecting; wakeup/waiting danger */ | ||
| 162 | #define P_CONTINUED 0x00000080 /* Process was stopped and continued */ | ||
| 163 | |||
| 164 | #define P_SUGID 0x00000100 /* Has set privileges since last exec */ | ||
| 165 | #define P_SYSTEM 0x00000200 /* Sys proc: no sigs, stats or swap */ | ||
| 166 | #define P_TIMEOUT 0x00000400 /* Timing out during sleep */ | ||
| 167 | #define P_TRACED 0x00000800 /* Debugged process being traced */ | ||
| 168 | |||
| 169 | #define P_DISABLE_ASLR 0x00001000 /* Disable address space layout randomization */ | ||
| 170 | #define P_WEXIT 0x00002000 /* Working on exiting */ | ||
| 171 | #define P_EXEC 0x00004000 /* Process called exec. */ | ||
| 172 | |||
| 173 | /* Should be moved to machine-dependent areas. */ | ||
| 174 | #define P_OWEUPC 0x00008000 /* Owe process an addupc() call at next ast. */ | ||
| 175 | |||
| 176 | #define P_AFFINITY 0x00010000 /* xxx */ | ||
| 177 | #define P_TRANSLATED 0x00020000 /* xxx */ | ||
| 178 | #define P_CLASSIC P_TRANSLATED /* xxx */ | ||
| 179 | |||
| 180 | #define P_DELAYIDLESLEEP 0x00040000 /* Process is marked to delay idle sleep on disk IO */ | ||
| 181 | #define P_CHECKOPENEVT 0x00080000 /* check if a vnode has the OPENEVT flag set on open */ | ||
| 182 | |||
| 183 | #define P_DEPENDENCY_CAPABLE 0x00100000 /* process is ok to call vfs_markdependency() */ | ||
| 184 | #define P_REBOOT 0x00200000 /* Process called reboot() */ | ||
| 185 | #define P_RESV6 0x00400000 /* used to be P_TBE */ | ||
| 186 | #define P_RESV7 0x00800000 /* (P_SIGEXC)signal exceptions */ | ||
| 187 | |||
| 188 | #define P_THCWD 0x01000000 /* process has thread cwd */ | ||
| 189 | #define P_RESV9 0x02000000 /* (P_VFORK)process has vfork children */ | ||
| 190 | #define P_ADOPTPERSONA 0x04000000 /* process adopted a persona (used to be P_NOATTACH) */ | ||
| 191 | #define P_RESV11 0x08000000 /* (P_INVFORK) proc in vfork */ | ||
| 192 | |||
| 193 | #define P_NOSHLIB 0x10000000 /* no shared libs are in use for proc */ | ||
| 194 | /* flag set on exec */ | ||
| 195 | #define P_FORCEQUOTA 0x20000000 /* Force quota for root */ | ||
| 196 | #define P_NOCLDWAIT 0x40000000 /* No zombies when chil procs exit */ | ||
| 197 | #define P_NOREMOTEHANG 0x80000000 /* Don't hang on remote FS ops */ | ||
| 198 | |||
| 199 | #define P_INMEM 0 /* Obsolete: retained for compilation */ | ||
| 200 | #define P_NOSWAP 0 /* Obsolete: retained for compilation */ | ||
| 201 | #define P_PHYSIO 0 /* Obsolete: retained for compilation */ | ||
| 202 | #define P_FSTRACE 0 /* Obsolete: retained for compilation */ | ||
| 203 | #define P_SSTEP 0 /* Obsolete: retained for compilation */ | ||
| 204 | |||
| 205 | #define P_DIRTY_TRACK 0x00000001 /* track dirty state */ | ||
| 206 | #define P_DIRTY_ALLOW_IDLE_EXIT 0x00000002 /* process can be idle-exited when clean */ | ||
| 207 | #define P_DIRTY_DEFER 0x00000004 /* defer initial opt-in to idle-exit */ | ||
| 208 | #define P_DIRTY 0x00000008 /* process is dirty */ | ||
| 209 | #define P_DIRTY_SHUTDOWN 0x00000010 /* process is dirty during shutdown */ | ||
| 210 | #define P_DIRTY_TERMINATED 0x00000020 /* process has been marked for termination */ | ||
| 211 | #define P_DIRTY_BUSY 0x00000040 /* serialization flag */ | ||
| 212 | #define P_DIRTY_MARKED 0x00000080 /* marked dirty previously */ | ||
| 213 | #define P_DIRTY_AGING_IN_PROGRESS 0x00000100 /* aging in one of the 'aging bands' */ | ||
| 214 | #define P_DIRTY_LAUNCH_IN_PROGRESS 0x00000200 /* launch is in progress */ | ||
| 215 | #define P_DIRTY_DEFER_ALWAYS 0x00000400 /* defer going to idle-exit after every dirty->clean transition. | ||
| 216 | 	 * For legacy jetsam policy only. This is the default with the other policies.*/ | ||
| 217 | |||
| 218 | #define P_DIRTY_IS_DIRTY (P_DIRTY | P_DIRTY_SHUTDOWN) | ||
| 219 | #define P_DIRTY_IDLE_EXIT_ENABLED (P_DIRTY_TRACK|P_DIRTY_ALLOW_IDLE_EXIT) | ||
| 220 | |||
| 221 | |||
| 222 | |||
| 223 | |||
| 224 | #endif /* !_SYS_PROC_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/qos.h created+200| ... | @@ -0,0 +1,200 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2013-2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _SYS_QOS_H | ||
| 25 | #define _SYS_QOS_H | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <Availability.h> | ||
| 29 | |||
| 30 | /*! | ||
| 31 | * @typedef qos_class_t | ||
| 32 | * | ||
| 33 | * @abstract | ||
| 34 | * An abstract thread quality of service (QOS) classification. | ||
| 35 | * | ||
| 36 | * @discussion | ||
| 37 | * Thread quality of service (QOS) classes are ordered abstract representations | ||
| 38 | * of the nature of work that is expected to be performed by a pthread, dispatch | ||
| 39 | * queue, or NSOperation. Each class specifies a maximum thread scheduling | ||
| 40 | * priority for that band (which may be used in combination with a relative | ||
| 41 | * priority offset within the band), as well as quality of service | ||
| 42 | * characteristics for timer latency, CPU throughput, I/O throughput, network | ||
| 43 | * socket traffic management behavior and more. | ||
| 44 | * | ||
| 45 | * A best effort is made to allocate available system resources to every QOS | ||
| 46 | * class. Quality of service degredation only occurs during system resource | ||
| 47 | * contention, proportionally to the QOS class. That said, QOS classes | ||
| 48 | * representing user-initiated work attempt to achieve peak throughput while | ||
| 49 | * QOS classes for other work attempt to achieve peak energy and thermal | ||
| 50 | * efficiency, even in the absence of contention. Finally, the use of QOS | ||
| 51 | * classes does not allow threads to supersede any limits that may be applied | ||
| 52 | * to the overall process. | ||
| 53 | */ | ||
| 54 | |||
| 55 | /*! | ||
| 56 | * @constant QOS_CLASS_USER_INTERACTIVE | ||
| 57 | * @abstract A QOS class which indicates work performed by this thread | ||
| 58 | * is interactive with the user. | ||
| 59 | * @discussion Such work is requested to run at high priority relative to other | ||
| 60 | * work on the system. Specifying this QOS class is a request to run with | ||
| 61 | * nearly all available system CPU and I/O bandwidth even under contention. | ||
| 62 | * This is not an energy-efficient QOS class to use for large tasks. The use of | ||
| 63 | * this QOS class should be limited to critical interaction with the user such | ||
| 64 | * as handling events on the main event loop, view drawing, animation, etc. | ||
| 65 | * | ||
| 66 | * @constant QOS_CLASS_USER_INITIATED | ||
| 67 | * @abstract A QOS class which indicates work performed by this thread | ||
| 68 | * was initiated by the user and that the user is likely waiting for the | ||
| 69 | * results. | ||
| 70 | * @discussion Such work is requested to run at a priority below critical user- | ||
| 71 | * interactive work, but relatively higher than other work on the system. This | ||
| 72 | * is not an energy-efficient QOS class to use for large tasks. Its use | ||
| 73 | * should be limited to operations of short enough duration that the user is | ||
| 74 | * unlikely to switch tasks while waiting for the results. Typical | ||
| 75 | * user-initiated work will have progress indicated by the display of | ||
| 76 | * placeholder content or modal user interface. | ||
| 77 | * | ||
| 78 | * @constant QOS_CLASS_DEFAULT | ||
| 79 | * @abstract A default QOS class used by the system in cases where more specific | ||
| 80 | * QOS class information is not available. | ||
| 81 | * @discussion Such work is requested to run at a priority below critical user- | ||
| 82 | * interactive and user-initiated work, but relatively higher than utility and | ||
| 83 | * background tasks. Threads created by pthread_create() without an attribute | ||
| 84 | * specifying a QOS class will default to QOS_CLASS_DEFAULT. This QOS class | ||
| 85 | * value is not intended to be used as a work classification, it should only be | ||
| 86 | * set when propagating or restoring QOS class values provided by the system. | ||
| 87 | * | ||
| 88 | * @constant QOS_CLASS_UTILITY | ||
| 89 | * @abstract A QOS class which indicates work performed by this thread | ||
| 90 | * may or may not be initiated by the user and that the user is unlikely to be | ||
| 91 | * immediately waiting for the results. | ||
| 92 | * @discussion Such work is requested to run at a priority below critical user- | ||
| 93 | * interactive and user-initiated work, but relatively higher than low-level | ||
| 94 | * system maintenance tasks. The use of this QOS class indicates the work | ||
| 95 | * should be run in an energy and thermally-efficient manner. The progress of | ||
| 96 | * utility work may or may not be indicated to the user, but the effect of such | ||
| 97 | * work is user-visible. | ||
| 98 | * | ||
| 99 | * @constant QOS_CLASS_BACKGROUND | ||
| 100 | * @abstract A QOS class which indicates work performed by this thread was not | ||
| 101 | * initiated by the user and that the user may be unaware of the results. | ||
| 102 | * @discussion Such work is requested to run at a priority below other work. | ||
| 103 | * The use of this QOS class indicates the work should be run in the most energy | ||
| 104 | * and thermally-efficient manner. | ||
| 105 | * | ||
| 106 | * @constant QOS_CLASS_UNSPECIFIED | ||
| 107 | * @abstract A QOS class value which indicates the absence or removal of QOS | ||
| 108 | * class information. | ||
| 109 | * @discussion As an API return value, may indicate that threads or pthread | ||
| 110 | * attributes were configured with legacy API incompatible or in conflict with | ||
| 111 | * the QOS class system. | ||
| 112 | */ | ||
| 113 | |||
| 114 | #define __QOS_ENUM(name, type, ...) enum { __VA_ARGS__ }; typedef type name##_t | ||
| 115 | #define __QOS_CLASS_AVAILABLE(...) | ||
| 116 | |||
| 117 | #if defined(__cplusplus) || defined(__OBJC__) || __LP64__ | ||
| 118 | #if defined(__has_feature) && defined(__has_extension) | ||
| 119 | #if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) | ||
| 120 | #undef __QOS_ENUM | ||
| 121 | #define __QOS_ENUM(name, type, ...) typedef enum : type { __VA_ARGS__ } name##_t | ||
| 122 | #endif | ||
| 123 | #endif | ||
| 124 | #if __has_feature(enumerator_attributes) | ||
| 125 | #undef __QOS_CLASS_AVAILABLE | ||
| 126 | #define __QOS_CLASS_AVAILABLE __API_AVAILABLE | ||
| 127 | #endif | ||
| 128 | #endif | ||
| 129 | |||
| 130 | __QOS_ENUM(qos_class, unsigned int, | ||
| 131 | 	QOS_CLASS_USER_INTERACTIVE | ||
| 132 | 			__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x21, | ||
| 133 | 	QOS_CLASS_USER_INITIATED | ||
| 134 | 			__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x19, | ||
| 135 | 	QOS_CLASS_DEFAULT | ||
| 136 | 			__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x15, | ||
| 137 | 	QOS_CLASS_UTILITY | ||
| 138 | 			__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x11, | ||
| 139 | 	QOS_CLASS_BACKGROUND | ||
| 140 | 			__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x09, | ||
| 141 | 	QOS_CLASS_UNSPECIFIED | ||
| 142 | 			__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x00, | ||
| 143 | ); | ||
| 144 | |||
| 145 | #undef __QOS_ENUM | ||
| 146 | |||
| 147 | /*! | ||
| 148 | * @constant QOS_MIN_RELATIVE_PRIORITY | ||
| 149 | * @abstract The minimum relative priority that may be specified within a | ||
| 150 | * QOS class. These priorities are relative only within a given QOS class | ||
| 151 | * and meaningful only for the current process. | ||
| 152 | */ | ||
| 153 | #define QOS_MIN_RELATIVE_PRIORITY (-15) | ||
| 154 | |||
| 155 | /* Userspace (only) definitions */ | ||
| 156 | |||
| 157 | #ifndef KERNEL | ||
| 158 | |||
| 159 | __BEGIN_DECLS | ||
| 160 | |||
| 161 | /*! | ||
| 162 | * @function qos_class_self | ||
| 163 | * | ||
| 164 | * @abstract | ||
| 165 | * Returns the requested QOS class of the current thread. | ||
| 166 | * | ||
| 167 | * @return | ||
| 168 | * One of the QOS class values in qos_class_t. | ||
| 169 | */ | ||
| 170 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 171 | qos_class_t | ||
| 172 | qos_class_self(void); | ||
| 173 | |||
| 174 | /*! | ||
| 175 | * @function qos_class_main | ||
| 176 | * | ||
| 177 | * @abstract | ||
| 178 | * Returns the initial requested QOS class of the main thread. | ||
| 179 | * | ||
| 180 | * @discussion | ||
| 181 | * The QOS class that the main thread of a process is created with depends on | ||
| 182 | * the type of process (e.g. application or daemon) and on how it has been | ||
| 183 | * launched. | ||
| 184 | * | ||
| 185 | * This function returns that initial requested QOS class value chosen by the | ||
| 186 | * system to enable propagation of that classification to matching work not | ||
| 187 | * executing on the main thread. | ||
| 188 | * | ||
| 189 | * @return | ||
| 190 | * One of the QOS class values in qos_class_t. | ||
| 191 | */ | ||
| 192 | __API_AVAILABLE(macos(10.10), ios(8.0)) | ||
| 193 | qos_class_t | ||
| 194 | qos_class_main(void); | ||
| 195 | |||
| 196 | __END_DECLS | ||
| 197 | |||
| 198 | #endif // KERNEL | ||
| 199 | |||
| 200 | #endif // _SYS_QOS_H | ||
lib/libc/include/x86_64-macos-gnu/sys/queue.h created+909| ... | @@ -0,0 +1,909 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*- | ||
| 29 | * Copyright (c) 1991, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 4. Neither the name of the University nor the names of its contributors | ||
| 41 | * may be used to endorse or promote products derived from this software | ||
| 42 | * without specific prior written permission. | ||
| 43 | * | ||
| 44 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 45 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 46 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 47 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 48 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 49 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 50 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 51 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 52 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 53 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 54 | * SUCH DAMAGE. | ||
| 55 | * | ||
| 56 | *	@(#)queue.h	8.5 (Berkeley) 8/20/94 | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _SYS_QUEUE_H_ | ||
| 60 | #define _SYS_QUEUE_H_ | ||
| 61 | |||
| 62 | #ifndef __improbable | ||
| 63 | #define __improbable(x) (x) /* noop in userspace */ | ||
| 64 | #endif /* __improbable */ | ||
| 65 | |||
| 66 | /* | ||
| 67 | * This file defines five types of data structures: singly-linked lists, | ||
| 68 | * singly-linked tail queues, lists, tail queues, and circular queues. | ||
| 69 | * | ||
| 70 | * A singly-linked list is headed by a single forward pointer. The elements | ||
| 71 | * are singly linked for minimum space and pointer manipulation overhead at | ||
| 72 | * the expense of O(n) removal for arbitrary elements. New elements can be | ||
| 73 | * added to the list after an existing element or at the head of the list. | ||
| 74 | * Elements being removed from the head of the list should use the explicit | ||
| 75 | * macro for this purpose for optimum efficiency. A singly-linked list may | ||
| 76 | * only be traversed in the forward direction. Singly-linked lists are ideal | ||
| 77 | * for applications with large datasets and few or no removals or for | ||
| 78 | * implementing a LIFO queue. | ||
| 79 | * | ||
| 80 | * A singly-linked tail queue is headed by a pair of pointers, one to the | ||
| 81 | * head of the list and the other to the tail of the list. The elements are | ||
| 82 | * singly linked for minimum space and pointer manipulation overhead at the | ||
| 83 | * expense of O(n) removal for arbitrary elements. New elements can be added | ||
| 84 | * to the list after an existing element, at the head of the list, or at the | ||
| 85 | * end of the list. Elements being removed from the head of the tail queue | ||
| 86 | * should use the explicit macro for this purpose for optimum efficiency. | ||
| 87 | * A singly-linked tail queue may only be traversed in the forward direction. | ||
| 88 | * Singly-linked tail queues are ideal for applications with large datasets | ||
| 89 | * and few or no removals or for implementing a FIFO queue. | ||
| 90 | * | ||
| 91 | * A list is headed by a single forward pointer (or an array of forward | ||
| 92 | * pointers for a hash table header). The elements are doubly linked | ||
| 93 | * so that an arbitrary element can be removed without a need to | ||
| 94 | * traverse the list. New elements can be added to the list before | ||
| 95 | * or after an existing element or at the head of the list. A list | ||
| 96 | * may only be traversed in the forward direction. | ||
| 97 | * | ||
| 98 | * A tail queue is headed by a pair of pointers, one to the head of the | ||
| 99 | * list and the other to the tail of the list. The elements are doubly | ||
| 100 | * linked so that an arbitrary element can be removed without a need to | ||
| 101 | * traverse the list. New elements can be added to the list before or | ||
| 102 | * after an existing element, at the head of the list, or at the end of | ||
| 103 | * the list. A tail queue may be traversed in either direction. | ||
| 104 | * | ||
| 105 | * A circle queue is headed by a pair of pointers, one to the head of the | ||
| 106 | * list and the other to the tail of the list. The elements are doubly | ||
| 107 | * linked so that an arbitrary element can be removed without a need to | ||
| 108 | * traverse the list. New elements can be added to the list before or after | ||
| 109 | * an existing element, at the head of the list, or at the end of the list. | ||
| 110 | * A circle queue may be traversed in either direction, but has a more | ||
| 111 | * complex end of list detection. | ||
| 112 | * Note that circle queues are deprecated, because, as the removal log | ||
| 113 | * in FreeBSD states, "CIRCLEQs are a disgrace to everything Knuth taught | ||
| 114 | * us in Volume 1 Chapter 2. [...] Use TAILQ instead, it provides the same | ||
| 115 | * functionality." Code using them will continue to compile, but they | ||
| 116 | * are no longer documented on the man page. | ||
| 117 | * | ||
| 118 | * For details on the use of these macros, see the queue(3) manual page. | ||
| 119 | * | ||
| 120 | * | ||
| 121 | *				SLIST	LIST	STAILQ	TAILQ	CIRCLEQ | ||
| 122 | * _HEAD			+	+	+	+	+ | ||
| 123 | * _HEAD_INITIALIZER		+	+	+	+	- | ||
| 124 | * _ENTRY			+	+	+	+	+ | ||
| 125 | * _INIT			+	+	+	+	+ | ||
| 126 | * _EMPTY			+	+	+	+	+ | ||
| 127 | * _FIRST			+	+	+	+	+ | ||
| 128 | * _NEXT			+	+	+	+	+ | ||
| 129 | * _PREV			-	-	-	+	+ | ||
| 130 | * _LAST			-	-	+	+	+ | ||
| 131 | * _FOREACH			+	+	+	+	+ | ||
| 132 | * _FOREACH_SAFE		+	+	+	+	- | ||
| 133 | * _FOREACH_REVERSE		-	-	-	+	- | ||
| 134 | * _FOREACH_REVERSE_SAFE	-	-	-	+	- | ||
| 135 | * _INSERT_HEAD			+	+	+	+	+ | ||
| 136 | * _INSERT_BEFORE		-	+	-	+	+ | ||
| 137 | * _INSERT_AFTER		+	+	+	+	+ | ||
| 138 | * _INSERT_TAIL			-	-	+	+	+ | ||
| 139 | * _CONCAT			-	-	+	+	- | ||
| 140 | * _REMOVE_AFTER		+	-	+	-	- | ||
| 141 | * _REMOVE_HEAD			+	-	+	-	- | ||
| 142 | * _REMOVE_HEAD_UNTIL		-	-	+	-	- | ||
| 143 | * _REMOVE			+	+	+	+	+ | ||
| 144 | * _SWAP			-	+	+	+	- | ||
| 145 | * | ||
| 146 | */ | ||
| 147 | #ifdef QUEUE_MACRO_DEBUG | ||
| 148 | /* Store the last 2 places the queue element or head was altered */ | ||
| 149 | struct qm_trace { | ||
| 150 | 	char * lastfile; | ||
| 151 | 	int lastline; | ||
| 152 | 	char * prevfile; | ||
| 153 | 	int prevline; | ||
| 154 | }; | ||
| 155 | |||
| 156 | #define TRACEBUF struct qm_trace trace; | ||
| 157 | #define TRASHIT(x) do {(x) = (void *)-1;} while (0) | ||
| 158 | |||
| 159 | #define QMD_TRACE_HEAD(head) do { \ | ||
| 160 | 	(head)->trace.prevline = (head)->trace.lastline; \ | ||
| 161 | 	(head)->trace.prevfile = (head)->trace.lastfile; \ | ||
| 162 | 	(head)->trace.lastline = __LINE__; \ | ||
| 163 | 	(head)->trace.lastfile = __FILE__; \ | ||
| 164 | } while (0) | ||
| 165 | |||
| 166 | #define QMD_TRACE_ELEM(elem) do { \ | ||
| 167 | 	(elem)->trace.prevline = (elem)->trace.lastline; \ | ||
| 168 | 	(elem)->trace.prevfile = (elem)->trace.lastfile; \ | ||
| 169 | 	(elem)->trace.lastline = __LINE__; \ | ||
| 170 | 	(elem)->trace.lastfile = __FILE__; \ | ||
| 171 | } while (0) | ||
| 172 | |||
| 173 | #else | ||
| 174 | #define QMD_TRACE_ELEM(elem) | ||
| 175 | #define QMD_TRACE_HEAD(head) | ||
| 176 | #define TRACEBUF | ||
| 177 | #define TRASHIT(x) | ||
| 178 | #endif /* QUEUE_MACRO_DEBUG */ | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Horrible macros to enable use of code that was meant to be C-specific | ||
| 182 | * (and which push struct onto type) in C++; without these, C++ code | ||
| 183 | * that uses these macros in the context of a class will blow up | ||
| 184 | * due to "struct" being preprended to "type" by the macros, causing | ||
| 185 | * inconsistent use of tags. | ||
| 186 | * | ||
| 187 | * This approach is necessary because these are macros; we have to use | ||
| 188 | * these on a per-macro basis (because the queues are implemented as | ||
| 189 | * macros, disabling this warning in the scope of the header file is | ||
| 190 | * insufficient), whuch means we can't use #pragma, and have to use | ||
| 191 | * _Pragma. We only need to use these for the queue macros that | ||
| 192 | * prepend "struct" to "type" and will cause C++ to blow up. | ||
| 193 | */ | ||
| 194 | #if defined(__clang__) && defined(__cplusplus) | ||
| 195 | #define __MISMATCH_TAGS_PUSH \ | ||
| 196 | 	_Pragma("clang diagnostic push") \ | ||
| 197 | 	_Pragma("clang diagnostic ignored \"-Wmismatched-tags\"") | ||
| 198 | #define __MISMATCH_TAGS_POP \ | ||
| 199 | 	_Pragma("clang diagnostic pop") | ||
| 200 | #else | ||
| 201 | #define __MISMATCH_TAGS_PUSH | ||
| 202 | #define __MISMATCH_TAGS_POP | ||
| 203 | #endif | ||
| 204 | |||
| 205 | /*! | ||
| 206 | * Ensures that these macros can safely be used in structs when compiling with | ||
| 207 | * clang. The macros do not allow for nullability attributes to be specified due | ||
| 208 | * to how they are expanded. For example: | ||
| 209 | * | ||
| 210 | * SLIST_HEAD(, foo _Nullable) bar; | ||
| 211 | * | ||
| 212 | * expands to | ||
| 213 | * | ||
| 214 | * struct { | ||
| 215 | * struct foo _Nullable *slh_first; | ||
| 216 | * } | ||
| 217 | * | ||
| 218 | * which is not valid because the nullability specifier has to apply to the | ||
| 219 | * pointer. So just ignore nullability completeness in all the places where this | ||
| 220 | * is an issue. | ||
| 221 | */ | ||
| 222 | #if defined(__clang__) | ||
| 223 | #define __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 224 | 	_Pragma("clang diagnostic push") \ | ||
| 225 | 	_Pragma("clang diagnostic ignored \"-Wnullability-completeness\"") | ||
| 226 | #define __NULLABILITY_COMPLETENESS_POP \ | ||
| 227 | 	_Pragma("clang diagnostic pop") | ||
| 228 | #else | ||
| 229 | #define __NULLABILITY_COMPLETENESS_PUSH | ||
| 230 | #define __NULLABILITY_COMPLETENESS_POP | ||
| 231 | #endif | ||
| 232 | |||
| 233 | /* | ||
| 234 | * Singly-linked List declarations. | ||
| 235 | */ | ||
| 236 | #define SLIST_HEAD(name, type) \ | ||
| 237 | __MISMATCH_TAGS_PUSH \ | ||
| 238 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 239 | struct name { \ | ||
| 240 | 	struct type *slh_first; /* first element */ \ | ||
| 241 | } \ | ||
| 242 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 243 | __MISMATCH_TAGS_POP | ||
| 244 | |||
| 245 | #define SLIST_HEAD_INITIALIZER(head) \ | ||
| 246 | 	{ NULL } | ||
| 247 | |||
| 248 | #define SLIST_ENTRY(type) \ | ||
| 249 | __MISMATCH_TAGS_PUSH \ | ||
| 250 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 251 | struct { \ | ||
| 252 | 	struct type *sle_next; /* next element */ \ | ||
| 253 | } \ | ||
| 254 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 255 | __MISMATCH_TAGS_POP | ||
| 256 | |||
| 257 | /* | ||
| 258 | * Singly-linked List functions. | ||
| 259 | */ | ||
| 260 | #define SLIST_EMPTY(head) ((head)->slh_first == NULL) | ||
| 261 | |||
| 262 | #define SLIST_FIRST(head) ((head)->slh_first) | ||
| 263 | |||
| 264 | #define SLIST_FOREACH(var, head, field) \ | ||
| 265 | 	for ((var) = SLIST_FIRST((head)); \ | ||
| 266 | 	 (var); \ | ||
| 267 | 	 (var) = SLIST_NEXT((var), field)) | ||
| 268 | |||
| 269 | #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ | ||
| 270 | 	for ((var) = SLIST_FIRST((head)); \ | ||
| 271 | 	 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ | ||
| 272 | 	 (var) = (tvar)) | ||
| 273 | |||
| 274 | #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ | ||
| 275 | 	for ((varp) = &SLIST_FIRST((head)); \ | ||
| 276 | 	 ((var) = *(varp)) != NULL; \ | ||
| 277 | 	 (varp) = &SLIST_NEXT((var), field)) | ||
| 278 | |||
| 279 | #define SLIST_INIT(head) do { \ | ||
| 280 | 	SLIST_FIRST((head)) = NULL; \ | ||
| 281 | } while (0) | ||
| 282 | |||
| 283 | #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ | ||
| 284 | 	SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ | ||
| 285 | 	SLIST_NEXT((slistelm), field) = (elm); \ | ||
| 286 | } while (0) | ||
| 287 | |||
| 288 | #define SLIST_INSERT_HEAD(head, elm, field) do { \ | ||
| 289 | 	SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ | ||
| 290 | 	SLIST_FIRST((head)) = (elm); \ | ||
| 291 | } while (0) | ||
| 292 | |||
| 293 | #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) | ||
| 294 | |||
| 295 | #define SLIST_REMOVE(head, elm, type, field) \ | ||
| 296 | __MISMATCH_TAGS_PUSH \ | ||
| 297 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 298 | do { \ | ||
| 299 | 	if (SLIST_FIRST((head)) == (elm)) { \ | ||
| 300 | 	 SLIST_REMOVE_HEAD((head), field); \ | ||
| 301 | 	} \ | ||
| 302 | 	else { \ | ||
| 303 | 	 struct type *curelm = SLIST_FIRST((head)); \ | ||
| 304 | 	 while (SLIST_NEXT(curelm, field) != (elm)) \ | ||
| 305 | 	 curelm = SLIST_NEXT(curelm, field); \ | ||
| 306 | 	 SLIST_REMOVE_AFTER(curelm, field); \ | ||
| 307 | 	} \ | ||
| 308 | 	TRASHIT((elm)->field.sle_next); \ | ||
| 309 | } while (0) \ | ||
| 310 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 311 | __MISMATCH_TAGS_POP | ||
| 312 | |||
| 313 | #define SLIST_REMOVE_AFTER(elm, field) do { \ | ||
| 314 | 	SLIST_NEXT(elm, field) = \ | ||
| 315 | 	 SLIST_NEXT(SLIST_NEXT(elm, field), field); \ | ||
| 316 | } while (0) | ||
| 317 | |||
| 318 | #define SLIST_REMOVE_HEAD(head, field) do { \ | ||
| 319 | 	SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ | ||
| 320 | } while (0) | ||
| 321 | |||
| 322 | /* | ||
| 323 | * Singly-linked Tail queue declarations. | ||
| 324 | */ | ||
| 325 | #define STAILQ_HEAD(name, type) \ | ||
| 326 | __MISMATCH_TAGS_PUSH \ | ||
| 327 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 328 | struct name { \ | ||
| 329 | 	struct type *stqh_first;/* first element */ \ | ||
| 330 | 	struct type **stqh_last;/* addr of last next element */ \ | ||
| 331 | } \ | ||
| 332 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 333 | __MISMATCH_TAGS_POP | ||
| 334 | |||
| 335 | #define STAILQ_HEAD_INITIALIZER(head) \ | ||
| 336 | 	{ NULL, &(head).stqh_first } | ||
| 337 | |||
| 338 | #define STAILQ_ENTRY(type) \ | ||
| 339 | __MISMATCH_TAGS_PUSH \ | ||
| 340 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 341 | struct { \ | ||
| 342 | 	struct type *stqe_next; /* next element */ \ | ||
| 343 | } \ | ||
| 344 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 345 | __MISMATCH_TAGS_POP | ||
| 346 | |||
| 347 | /* | ||
| 348 | * Singly-linked Tail queue functions. | ||
| 349 | */ | ||
| 350 | #define STAILQ_CONCAT(head1, head2) do { \ | ||
| 351 | 	if (!STAILQ_EMPTY((head2))) { \ | ||
| 352 | 	 *(head1)->stqh_last = (head2)->stqh_first; \ | ||
| 353 | 	 (head1)->stqh_last = (head2)->stqh_last; \ | ||
| 354 | 	 STAILQ_INIT((head2)); \ | ||
| 355 | 	} \ | ||
| 356 | } while (0) | ||
| 357 | |||
| 358 | #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) | ||
| 359 | |||
| 360 | #define STAILQ_FIRST(head) ((head)->stqh_first) | ||
| 361 | |||
| 362 | #define STAILQ_FOREACH(var, head, field) \ | ||
| 363 | 	for((var) = STAILQ_FIRST((head)); \ | ||
| 364 | 	 (var); \ | ||
| 365 | 	 (var) = STAILQ_NEXT((var), field)) | ||
| 366 | |||
| 367 | |||
| 368 | #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ | ||
| 369 | 	for ((var) = STAILQ_FIRST((head)); \ | ||
| 370 | 	 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ | ||
| 371 | 	 (var) = (tvar)) | ||
| 372 | |||
| 373 | #define STAILQ_INIT(head) do { \ | ||
| 374 | 	STAILQ_FIRST((head)) = NULL; \ | ||
| 375 | 	(head)->stqh_last = &STAILQ_FIRST((head)); \ | ||
| 376 | } while (0) | ||
| 377 | |||
| 378 | #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ | ||
| 379 | 	if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ | ||
| 380 | 	 (head)->stqh_last = &STAILQ_NEXT((elm), field); \ | ||
| 381 | 	STAILQ_NEXT((tqelm), field) = (elm); \ | ||
| 382 | } while (0) | ||
| 383 | |||
| 384 | #define STAILQ_INSERT_HEAD(head, elm, field) do { \ | ||
| 385 | 	if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ | ||
| 386 | 	 (head)->stqh_last = &STAILQ_NEXT((elm), field); \ | ||
| 387 | 	STAILQ_FIRST((head)) = (elm); \ | ||
| 388 | } while (0) | ||
| 389 | |||
| 390 | #define STAILQ_INSERT_TAIL(head, elm, field) do { \ | ||
| 391 | 	STAILQ_NEXT((elm), field) = NULL; \ | ||
| 392 | 	*(head)->stqh_last = (elm); \ | ||
| 393 | 	(head)->stqh_last = &STAILQ_NEXT((elm), field); \ | ||
| 394 | } while (0) | ||
| 395 | |||
| 396 | #define STAILQ_LAST(head, type, field) \ | ||
| 397 | __MISMATCH_TAGS_PUSH \ | ||
| 398 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 399 | 	(STAILQ_EMPTY((head)) ? \ | ||
| 400 | 	 NULL : \ | ||
| 401 | 	 ((struct type *)(void *) \ | ||
| 402 | 	 ((char *)((head)->stqh_last) - __offsetof(struct type, field))))\ | ||
| 403 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 404 | __MISMATCH_TAGS_POP | ||
| 405 | |||
| 406 | #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) | ||
| 407 | |||
| 408 | #define STAILQ_REMOVE(head, elm, type, field) \ | ||
| 409 | __MISMATCH_TAGS_PUSH \ | ||
| 410 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 411 | do { \ | ||
| 412 | 	if (STAILQ_FIRST((head)) == (elm)) { \ | ||
| 413 | 	 STAILQ_REMOVE_HEAD((head), field); \ | ||
| 414 | 	} \ | ||
| 415 | 	else { \ | ||
| 416 | 	 struct type *curelm = STAILQ_FIRST((head)); \ | ||
| 417 | 	 while (STAILQ_NEXT(curelm, field) != (elm)) \ | ||
| 418 | 	 curelm = STAILQ_NEXT(curelm, field); \ | ||
| 419 | 	 STAILQ_REMOVE_AFTER(head, curelm, field); \ | ||
| 420 | 	} \ | ||
| 421 | 	TRASHIT((elm)->field.stqe_next); \ | ||
| 422 | } while (0) \ | ||
| 423 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 424 | __MISMATCH_TAGS_POP | ||
| 425 | |||
| 426 | #define STAILQ_REMOVE_HEAD(head, field) do { \ | ||
| 427 | 	if ((STAILQ_FIRST((head)) = \ | ||
| 428 | 	 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ | ||
| 429 | 	 (head)->stqh_last = &STAILQ_FIRST((head)); \ | ||
| 430 | } while (0) | ||
| 431 | |||
| 432 | #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ | ||
| 433 | if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ | ||
| 434 | 	 (head)->stqh_last = &STAILQ_FIRST((head)); \ | ||
| 435 | } while (0) | ||
| 436 | |||
| 437 | #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ | ||
| 438 | 	if ((STAILQ_NEXT(elm, field) = \ | ||
| 439 | 	 STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ | ||
| 440 | 	 (head)->stqh_last = &STAILQ_NEXT((elm), field); \ | ||
| 441 | } while (0) | ||
| 442 | |||
| 443 | #define STAILQ_SWAP(head1, head2, type) \ | ||
| 444 | __MISMATCH_TAGS_PUSH \ | ||
| 445 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 446 | do { \ | ||
| 447 | 	struct type *swap_first = STAILQ_FIRST(head1); \ | ||
| 448 | 	struct type **swap_last = (head1)->stqh_last; \ | ||
| 449 | 	STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ | ||
| 450 | 	(head1)->stqh_last = (head2)->stqh_last; \ | ||
| 451 | 	STAILQ_FIRST(head2) = swap_first; \ | ||
| 452 | 	(head2)->stqh_last = swap_last; \ | ||
| 453 | 	if (STAILQ_EMPTY(head1)) \ | ||
| 454 | 	 (head1)->stqh_last = &STAILQ_FIRST(head1); \ | ||
| 455 | 	if (STAILQ_EMPTY(head2)) \ | ||
| 456 | 	 (head2)->stqh_last = &STAILQ_FIRST(head2); \ | ||
| 457 | } while (0) \ | ||
| 458 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 459 | __MISMATCH_TAGS_POP | ||
| 460 | |||
| 461 | |||
| 462 | /* | ||
| 463 | * List declarations. | ||
| 464 | */ | ||
| 465 | #define LIST_HEAD(name, type) \ | ||
| 466 | __MISMATCH_TAGS_PUSH \ | ||
| 467 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 468 | struct name { \ | ||
| 469 | 	struct type *lh_first; /* first element */ \ | ||
| 470 | } \ | ||
| 471 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 472 | __MISMATCH_TAGS_POP | ||
| 473 | |||
| 474 | #define LIST_HEAD_INITIALIZER(head) \ | ||
| 475 | 	{ NULL } | ||
| 476 | |||
| 477 | #define LIST_ENTRY(type) \ | ||
| 478 | __MISMATCH_TAGS_PUSH \ | ||
| 479 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 480 | struct { \ | ||
| 481 | 	struct type *le_next; /* next element */ \ | ||
| 482 | 	struct type **le_prev; /* address of previous next element */ \ | ||
| 483 | } \ | ||
| 484 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 485 | __MISMATCH_TAGS_POP | ||
| 486 | |||
| 487 | /* | ||
| 488 | * List functions. | ||
| 489 | */ | ||
| 490 | |||
| 491 | #define LIST_CHECK_HEAD(head, field) | ||
| 492 | #define LIST_CHECK_NEXT(elm, field) | ||
| 493 | #define LIST_CHECK_PREV(elm, field) | ||
| 494 | |||
| 495 | #define LIST_EMPTY(head) ((head)->lh_first == NULL) | ||
| 496 | |||
| 497 | #define LIST_FIRST(head) ((head)->lh_first) | ||
| 498 | |||
| 499 | #define LIST_FOREACH(var, head, field) \ | ||
| 500 | 	for ((var) = LIST_FIRST((head)); \ | ||
| 501 | 	 (var); \ | ||
| 502 | 	 (var) = LIST_NEXT((var), field)) | ||
| 503 | |||
| 504 | #define LIST_FOREACH_SAFE(var, head, field, tvar) \ | ||
| 505 | 	for ((var) = LIST_FIRST((head)); \ | ||
| 506 | 	 (var) && ((tvar) = LIST_NEXT((var), field), 1); \ | ||
| 507 | 	 (var) = (tvar)) | ||
| 508 | |||
| 509 | #define LIST_INIT(head) do { \ | ||
| 510 | 	LIST_FIRST((head)) = NULL; \ | ||
| 511 | } while (0) | ||
| 512 | |||
| 513 | #define LIST_INSERT_AFTER(listelm, elm, field) do { \ | ||
| 514 | 	LIST_CHECK_NEXT(listelm, field); \ | ||
| 515 | 	if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ | ||
| 516 | 	 LIST_NEXT((listelm), field)->field.le_prev = \ | ||
| 517 | 	 &LIST_NEXT((elm), field); \ | ||
| 518 | 	LIST_NEXT((listelm), field) = (elm); \ | ||
| 519 | 	(elm)->field.le_prev = &LIST_NEXT((listelm), field); \ | ||
| 520 | } while (0) | ||
| 521 | |||
| 522 | #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ | ||
| 523 | 	LIST_CHECK_PREV(listelm, field); \ | ||
| 524 | 	(elm)->field.le_prev = (listelm)->field.le_prev; \ | ||
| 525 | 	LIST_NEXT((elm), field) = (listelm); \ | ||
| 526 | 	*(listelm)->field.le_prev = (elm); \ | ||
| 527 | 	(listelm)->field.le_prev = &LIST_NEXT((elm), field); \ | ||
| 528 | } while (0) | ||
| 529 | |||
| 530 | #define LIST_INSERT_HEAD(head, elm, field) do { \ | ||
| 531 | 	LIST_CHECK_HEAD((head), field); \ | ||
| 532 | 	if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ | ||
| 533 | 	 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ | ||
| 534 | 	LIST_FIRST((head)) = (elm); \ | ||
| 535 | 	(elm)->field.le_prev = &LIST_FIRST((head)); \ | ||
| 536 | } while (0) | ||
| 537 | |||
| 538 | #define LIST_NEXT(elm, field) ((elm)->field.le_next) | ||
| 539 | |||
| 540 | #define LIST_REMOVE(elm, field) do { \ | ||
| 541 | 	LIST_CHECK_NEXT(elm, field); \ | ||
| 542 | 	LIST_CHECK_PREV(elm, field); \ | ||
| 543 | 	if (LIST_NEXT((elm), field) != NULL) \ | ||
| 544 | 	 LIST_NEXT((elm), field)->field.le_prev = \ | ||
| 545 | 	 (elm)->field.le_prev; \ | ||
| 546 | 	*(elm)->field.le_prev = LIST_NEXT((elm), field); \ | ||
| 547 | 	TRASHIT((elm)->field.le_next); \ | ||
| 548 | 	TRASHIT((elm)->field.le_prev); \ | ||
| 549 | } while (0) | ||
| 550 | |||
| 551 | #define LIST_SWAP(head1, head2, type, field) \ | ||
| 552 | __MISMATCH_TAGS_PUSH \ | ||
| 553 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 554 | do { \ | ||
| 555 | 	struct type *swap_tmp = LIST_FIRST((head1)); \ | ||
| 556 | 	LIST_FIRST((head1)) = LIST_FIRST((head2)); \ | ||
| 557 | 	LIST_FIRST((head2)) = swap_tmp; \ | ||
| 558 | 	if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ | ||
| 559 | 	 swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ | ||
| 560 | 	if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ | ||
| 561 | 	 swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ | ||
| 562 | } while (0) \ | ||
| 563 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 564 | __MISMATCH_TAGS_POP | ||
| 565 | |||
| 566 | /* | ||
| 567 | * Tail queue declarations. | ||
| 568 | */ | ||
| 569 | #define TAILQ_HEAD(name, type) \ | ||
| 570 | __MISMATCH_TAGS_PUSH \ | ||
| 571 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 572 | struct name { \ | ||
| 573 | 	struct type *tqh_first; /* first element */ \ | ||
| 574 | 	struct type **tqh_last; /* addr of last next element */ \ | ||
| 575 | 	TRACEBUF \ | ||
| 576 | } \ | ||
| 577 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 578 | __MISMATCH_TAGS_POP | ||
| 579 | |||
| 580 | #define TAILQ_HEAD_INITIALIZER(head) \ | ||
| 581 | 	{ NULL, &(head).tqh_first } | ||
| 582 | |||
| 583 | #define TAILQ_ENTRY(type) \ | ||
| 584 | __MISMATCH_TAGS_PUSH \ | ||
| 585 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 586 | struct { \ | ||
| 587 | 	struct type *tqe_next; /* next element */ \ | ||
| 588 | 	struct type **tqe_prev; /* address of previous next element */ \ | ||
| 589 | 	TRACEBUF \ | ||
| 590 | } \ | ||
| 591 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 592 | __MISMATCH_TAGS_POP | ||
| 593 | |||
| 594 | /* | ||
| 595 | * Tail queue functions. | ||
| 596 | */ | ||
| 597 | #define TAILQ_CHECK_HEAD(head, field) | ||
| 598 | #define TAILQ_CHECK_NEXT(elm, field) | ||
| 599 | #define TAILQ_CHECK_PREV(elm, field) | ||
| 600 | |||
| 601 | #define TAILQ_CONCAT(head1, head2, field) do { \ | ||
| 602 | 	if (!TAILQ_EMPTY(head2)) { \ | ||
| 603 | 	 *(head1)->tqh_last = (head2)->tqh_first; \ | ||
| 604 | 	 (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ | ||
| 605 | 	 (head1)->tqh_last = (head2)->tqh_last; \ | ||
| 606 | 	 TAILQ_INIT((head2)); \ | ||
| 607 | 	 QMD_TRACE_HEAD(head1); \ | ||
| 608 | 	 QMD_TRACE_HEAD(head2); \ | ||
| 609 | 	} \ | ||
| 610 | } while (0) | ||
| 611 | |||
| 612 | #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) | ||
| 613 | |||
| 614 | #define TAILQ_FIRST(head) ((head)->tqh_first) | ||
| 615 | |||
| 616 | #define TAILQ_FOREACH(var, head, field) \ | ||
| 617 | 	for ((var) = TAILQ_FIRST((head)); \ | ||
| 618 | 	 (var); \ | ||
| 619 | 	 (var) = TAILQ_NEXT((var), field)) | ||
| 620 | |||
| 621 | #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ | ||
| 622 | 	for ((var) = TAILQ_FIRST((head)); \ | ||
| 623 | 	 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ | ||
| 624 | 	 (var) = (tvar)) | ||
| 625 | |||
| 626 | #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ | ||
| 627 | 	for ((var) = TAILQ_LAST((head), headname); \ | ||
| 628 | 	 (var); \ | ||
| 629 | 	 (var) = TAILQ_PREV((var), headname, field)) | ||
| 630 | |||
| 631 | #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ | ||
| 632 | 	for ((var) = TAILQ_LAST((head), headname); \ | ||
| 633 | 	 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ | ||
| 634 | 	 (var) = (tvar)) | ||
| 635 | |||
| 636 | |||
| 637 | #define TAILQ_INIT(head) do { \ | ||
| 638 | 	TAILQ_FIRST((head)) = NULL; \ | ||
| 639 | 	(head)->tqh_last = &TAILQ_FIRST((head)); \ | ||
| 640 | 	QMD_TRACE_HEAD(head); \ | ||
| 641 | } while (0) | ||
| 642 | |||
| 643 | |||
| 644 | #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ | ||
| 645 | 	TAILQ_CHECK_NEXT(listelm, field); \ | ||
| 646 | 	if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ | ||
| 647 | 	 TAILQ_NEXT((elm), field)->field.tqe_prev = \ | ||
| 648 | 	 &TAILQ_NEXT((elm), field); \ | ||
| 649 | 	else { \ | ||
| 650 | 	 (head)->tqh_last = &TAILQ_NEXT((elm), field); \ | ||
| 651 | 	 QMD_TRACE_HEAD(head); \ | ||
| 652 | 	} \ | ||
| 653 | 	TAILQ_NEXT((listelm), field) = (elm); \ | ||
| 654 | 	(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ | ||
| 655 | 	QMD_TRACE_ELEM(&(elm)->field); \ | ||
| 656 | 	QMD_TRACE_ELEM(&listelm->field); \ | ||
| 657 | } while (0) | ||
| 658 | |||
| 659 | #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ | ||
| 660 | 	TAILQ_CHECK_PREV(listelm, field); \ | ||
| 661 | 	(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ | ||
| 662 | 	TAILQ_NEXT((elm), field) = (listelm); \ | ||
| 663 | 	*(listelm)->field.tqe_prev = (elm); \ | ||
| 664 | 	(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ | ||
| 665 | 	QMD_TRACE_ELEM(&(elm)->field); \ | ||
| 666 | 	QMD_TRACE_ELEM(&listelm->field); \ | ||
| 667 | } while (0) | ||
| 668 | |||
| 669 | #define TAILQ_INSERT_HEAD(head, elm, field) do { \ | ||
| 670 | 	TAILQ_CHECK_HEAD(head, field); \ | ||
| 671 | 	if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ | ||
| 672 | 	 TAILQ_FIRST((head))->field.tqe_prev = \ | ||
| 673 | 	 &TAILQ_NEXT((elm), field); \ | ||
| 674 | 	else \ | ||
| 675 | 	 (head)->tqh_last = &TAILQ_NEXT((elm), field); \ | ||
| 676 | 	TAILQ_FIRST((head)) = (elm); \ | ||
| 677 | 	(elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ | ||
| 678 | 	QMD_TRACE_HEAD(head); \ | ||
| 679 | 	QMD_TRACE_ELEM(&(elm)->field); \ | ||
| 680 | } while (0) | ||
| 681 | |||
| 682 | #define TAILQ_INSERT_TAIL(head, elm, field) do { \ | ||
| 683 | 	TAILQ_NEXT((elm), field) = NULL; \ | ||
| 684 | 	(elm)->field.tqe_prev = (head)->tqh_last; \ | ||
| 685 | 	*(head)->tqh_last = (elm); \ | ||
| 686 | 	(head)->tqh_last = &TAILQ_NEXT((elm), field); \ | ||
| 687 | 	QMD_TRACE_HEAD(head); \ | ||
| 688 | 	QMD_TRACE_ELEM(&(elm)->field); \ | ||
| 689 | } while (0) | ||
| 690 | |||
| 691 | #define TAILQ_LAST(head, headname) \ | ||
| 692 | __MISMATCH_TAGS_PUSH \ | ||
| 693 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 694 | 	(*(((struct headname *)((head)->tqh_last))->tqh_last)) \ | ||
| 695 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 696 | __MISMATCH_TAGS_POP | ||
| 697 | |||
| 698 | #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) | ||
| 699 | |||
| 700 | #define TAILQ_PREV(elm, headname, field) \ | ||
| 701 | __MISMATCH_TAGS_PUSH \ | ||
| 702 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 703 | 	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) \ | ||
| 704 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 705 | __MISMATCH_TAGS_POP | ||
| 706 | |||
| 707 | #define TAILQ_REMOVE(head, elm, field) do { \ | ||
| 708 | 	TAILQ_CHECK_NEXT(elm, field); \ | ||
| 709 | 	TAILQ_CHECK_PREV(elm, field); \ | ||
| 710 | 	if ((TAILQ_NEXT((elm), field)) != NULL) \ | ||
| 711 | 	 TAILQ_NEXT((elm), field)->field.tqe_prev = \ | ||
| 712 | 	 (elm)->field.tqe_prev; \ | ||
| 713 | 	else { \ | ||
| 714 | 	 (head)->tqh_last = (elm)->field.tqe_prev; \ | ||
| 715 | 	 QMD_TRACE_HEAD(head); \ | ||
| 716 | 	} \ | ||
| 717 | 	*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ | ||
| 718 | 	TRASHIT((elm)->field.tqe_next); \ | ||
| 719 | 	TRASHIT((elm)->field.tqe_prev); \ | ||
| 720 | 	QMD_TRACE_ELEM(&(elm)->field); \ | ||
| 721 | } while (0) | ||
| 722 | |||
| 723 | /* | ||
| 724 | * Why did they switch to spaces for this one macro? | ||
| 725 | */ | ||
| 726 | #define TAILQ_SWAP(head1, head2, type, field) \ | ||
| 727 | __MISMATCH_TAGS_PUSH \ | ||
| 728 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 729 | do { \ | ||
| 730 | 	struct type *swap_first = (head1)->tqh_first; \ | ||
| 731 | 	struct type **swap_last = (head1)->tqh_last; \ | ||
| 732 | 	(head1)->tqh_first = (head2)->tqh_first; \ | ||
| 733 | 	(head1)->tqh_last = (head2)->tqh_last; \ | ||
| 734 | 	(head2)->tqh_first = swap_first; \ | ||
| 735 | 	(head2)->tqh_last = swap_last; \ | ||
| 736 | 	if ((swap_first = (head1)->tqh_first) != NULL) \ | ||
| 737 | 	 swap_first->field.tqe_prev = &(head1)->tqh_first; \ | ||
| 738 | 	else \ | ||
| 739 | 	 (head1)->tqh_last = &(head1)->tqh_first; \ | ||
| 740 | 	if ((swap_first = (head2)->tqh_first) != NULL) \ | ||
| 741 | 	 swap_first->field.tqe_prev = &(head2)->tqh_first; \ | ||
| 742 | 	else \ | ||
| 743 | 	 (head2)->tqh_last = &(head2)->tqh_first; \ | ||
| 744 | } while (0) \ | ||
| 745 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 746 | __MISMATCH_TAGS_POP | ||
| 747 | |||
| 748 | /* | ||
| 749 | * Circular queue definitions. | ||
| 750 | */ | ||
| 751 | #define CIRCLEQ_HEAD(name, type) \ | ||
| 752 | __MISMATCH_TAGS_PUSH \ | ||
| 753 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 754 | struct name { \ | ||
| 755 | 	struct type *cqh_first; /* first element */ \ | ||
| 756 | 	struct type *cqh_last; /* last element */ \ | ||
| 757 | } \ | ||
| 758 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 759 | __MISMATCH_TAGS_POP | ||
| 760 | |||
| 761 | #define CIRCLEQ_ENTRY(type) \ | ||
| 762 | __MISMATCH_TAGS_PUSH \ | ||
| 763 | __NULLABILITY_COMPLETENESS_PUSH \ | ||
| 764 | struct { \ | ||
| 765 | 	struct type *cqe_next; /* next element */ \ | ||
| 766 | 	struct type *cqe_prev; /* previous element */ \ | ||
| 767 | } \ | ||
| 768 | __NULLABILITY_COMPLETENESS_POP \ | ||
| 769 | __MISMATCH_TAGS_POP | ||
| 770 | |||
| 771 | /* | ||
| 772 | * Circular queue functions. | ||
| 773 | */ | ||
| 774 | #define CIRCLEQ_CHECK_HEAD(head, field) | ||
| 775 | #define CIRCLEQ_CHECK_NEXT(head, elm, field) | ||
| 776 | #define CIRCLEQ_CHECK_PREV(head, elm, field) | ||
| 777 | |||
| 778 | #define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) | ||
| 779 | |||
| 780 | #define CIRCLEQ_FIRST(head) ((head)->cqh_first) | ||
| 781 | |||
| 782 | #define CIRCLEQ_FOREACH(var, head, field) \ | ||
| 783 | 	for((var) = (head)->cqh_first; \ | ||
| 784 | 	 (var) != (void *)(head); \ | ||
| 785 | 	 (var) = (var)->field.cqe_next) | ||
| 786 | |||
| 787 | #define CIRCLEQ_INIT(head) do { \ | ||
| 788 | 	(head)->cqh_first = (void *)(head); \ | ||
| 789 | 	(head)->cqh_last = (void *)(head); \ | ||
| 790 | } while (0) | ||
| 791 | |||
| 792 | #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ | ||
| 793 | 	CIRCLEQ_CHECK_NEXT(head, listelm, field); \ | ||
| 794 | 	(elm)->field.cqe_next = (listelm)->field.cqe_next; \ | ||
| 795 | 	(elm)->field.cqe_prev = (listelm); \ | ||
| 796 | 	if ((listelm)->field.cqe_next == (void *)(head)) \ | ||
| 797 | 	 (head)->cqh_last = (elm); \ | ||
| 798 | 	else \ | ||
| 799 | 	 (listelm)->field.cqe_next->field.cqe_prev = (elm); \ | ||
| 800 | 	(listelm)->field.cqe_next = (elm); \ | ||
| 801 | } while (0) | ||
| 802 | |||
| 803 | #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ | ||
| 804 | 	CIRCLEQ_CHECK_PREV(head, listelm, field); \ | ||
| 805 | 	(elm)->field.cqe_next = (listelm); \ | ||
| 806 | 	(elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ | ||
| 807 | 	if ((listelm)->field.cqe_prev == (void *)(head)) \ | ||
| 808 | 	 (head)->cqh_first = (elm); \ | ||
| 809 | 	else \ | ||
| 810 | 	 (listelm)->field.cqe_prev->field.cqe_next = (elm); \ | ||
| 811 | 	(listelm)->field.cqe_prev = (elm); \ | ||
| 812 | } while (0) | ||
| 813 | |||
| 814 | #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ | ||
| 815 | 	CIRCLEQ_CHECK_HEAD(head, field); \ | ||
| 816 | 	(elm)->field.cqe_next = (head)->cqh_first; \ | ||
| 817 | 	(elm)->field.cqe_prev = (void *)(head); \ | ||
| 818 | 	if ((head)->cqh_last == (void *)(head)) \ | ||
| 819 | 	 (head)->cqh_last = (elm); \ | ||
| 820 | 	else \ | ||
| 821 | 	 (head)->cqh_first->field.cqe_prev = (elm); \ | ||
| 822 | 	(head)->cqh_first = (elm); \ | ||
| 823 | } while (0) | ||
| 824 | |||
| 825 | #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ | ||
| 826 | 	(elm)->field.cqe_next = (void *)(head); \ | ||
| 827 | 	(elm)->field.cqe_prev = (head)->cqh_last; \ | ||
| 828 | 	if ((head)->cqh_first == (void *)(head)) \ | ||
| 829 | 	 (head)->cqh_first = (elm); \ | ||
| 830 | 	else \ | ||
| 831 | 	 (head)->cqh_last->field.cqe_next = (elm); \ | ||
| 832 | 	(head)->cqh_last = (elm); \ | ||
| 833 | } while (0) | ||
| 834 | |||
| 835 | #define CIRCLEQ_LAST(head) ((head)->cqh_last) | ||
| 836 | |||
| 837 | #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) | ||
| 838 | |||
| 839 | #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) | ||
| 840 | |||
| 841 | #define CIRCLEQ_REMOVE(head, elm, field) do { \ | ||
| 842 | 	CIRCLEQ_CHECK_NEXT(head, elm, field); \ | ||
| 843 | 	CIRCLEQ_CHECK_PREV(head, elm, field); \ | ||
| 844 | 	if ((elm)->field.cqe_next == (void *)(head)) \ | ||
| 845 | 	 (head)->cqh_last = (elm)->field.cqe_prev; \ | ||
| 846 | 	else \ | ||
| 847 | 	 (elm)->field.cqe_next->field.cqe_prev = \ | ||
| 848 | 	 (elm)->field.cqe_prev; \ | ||
| 849 | 	if ((elm)->field.cqe_prev == (void *)(head)) \ | ||
| 850 | 	 (head)->cqh_first = (elm)->field.cqe_next; \ | ||
| 851 | 	else \ | ||
| 852 | 	 (elm)->field.cqe_prev->field.cqe_next = \ | ||
| 853 | 	 (elm)->field.cqe_next; \ | ||
| 854 | } while (0) | ||
| 855 | |||
| 856 | #ifdef _KERNEL | ||
| 857 | |||
| 858 | #if NOTFB31 | ||
| 859 | |||
| 860 | /* | ||
| 861 | * XXX insque() and remque() are an old way of handling certain queues. | ||
| 862 | * They bogusly assumes that all queue heads look alike. | ||
| 863 | */ | ||
| 864 | |||
| 865 | struct quehead { | ||
| 866 | 	struct quehead *qh_link; | ||
| 867 | 	struct quehead *qh_rlink; | ||
| 868 | }; | ||
| 869 | |||
| 870 | #ifdef __GNUC__ | ||
| 871 | #define chkquenext(a) | ||
| 872 | #define chkqueprev(a) | ||
| 873 | |||
| 874 | static __inline void | ||
| 875 | insque(void *a, void *b) | ||
| 876 | { | ||
| 877 | 	struct quehead *element = (struct quehead *)a, | ||
| 878 | 	 *head = (struct quehead *)b; | ||
| 879 | 	chkquenext(head); | ||
| 880 | |||
| 881 | 	element->qh_link = head->qh_link; | ||
| 882 | 	element->qh_rlink = head; | ||
| 883 | 	head->qh_link = element; | ||
| 884 | 	element->qh_link->qh_rlink = element; | ||
| 885 | } | ||
| 886 | |||
| 887 | static __inline void | ||
| 888 | remque(void *a) | ||
| 889 | { | ||
| 890 | 	struct quehead *element = (struct quehead *)a; | ||
| 891 | 	chkquenext(element); | ||
| 892 | 	chkqueprev(element); | ||
| 893 | |||
| 894 | 	element->qh_link->qh_rlink = element->qh_rlink; | ||
| 895 | 	element->qh_rlink->qh_link = element->qh_link; | ||
| 896 | 	element->qh_rlink = 0; | ||
| 897 | } | ||
| 898 | |||
| 899 | #else /* !__GNUC__ */ | ||
| 900 | |||
| 901 | void insque(void *a, void *b); | ||
| 902 | void remque(void *a); | ||
| 903 | |||
| 904 | #endif /* __GNUC__ */ | ||
| 905 | |||
| 906 | #endif /* NOTFB31 */ | ||
| 907 | #endif /* _KERNEL */ | ||
| 908 | |||
| 909 | #endif /* !_SYS_QUEUE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/resource.h+56-2| ... | @@ -188,7 +188,13 @@ struct rusage { | ... | @@ -188,7 +188,13 @@ struct rusage { |
| 188 | #define RUSAGE_INFO_V2 2 | 188 | #define RUSAGE_INFO_V2 2 |
| 189 | #define RUSAGE_INFO_V3 3 | 189 | #define RUSAGE_INFO_V3 3 |
| 190 | #define RUSAGE_INFO_V4 4 | 190 | #define RUSAGE_INFO_V4 4 |
| 191 | #define RUSAGE_INFO_CURRENT RUSAGE_INFO_V4 | 191 | #define RUSAGE_INFO_V5 5 |
| 192 | #define RUSAGE_INFO_CURRENT RUSAGE_INFO_V5 | ||
| 193 | |||
| 194 | /* | ||
| 195 | * Flags for RUSAGE_INFO_V5 | ||
| 196 | */ | ||
| 197 | #define RU_PROC_RUNS_RESLIDE 0x00000001 /* proc has reslid shared cache */ | ||
| 192 | 198 | ||
| 193 | typedef void *rusage_info_t; | 199 | typedef void *rusage_info_t; |
| 194 | 200 | ||
| ... | @@ -318,7 +324,47 @@ struct rusage_info_v4 { | ... | @@ -318,7 +324,47 @@ struct rusage_info_v4 { |
| 318 | 	uint64_t ri_runnable_time; | 324 | 	uint64_t ri_runnable_time; |
| 319 | }; | 325 | }; |
| 320 | 326 | ||
| 321 | typedef struct rusage_info_v4 rusage_info_current; | 327 | struct rusage_info_v5 { |
| 328 | 	uint8_t ri_uuid[16]; | ||
| 329 | 	uint64_t ri_user_time; | ||
| 330 | 	uint64_t ri_system_time; | ||
| 331 | 	uint64_t ri_pkg_idle_wkups; | ||
| 332 | 	uint64_t ri_interrupt_wkups; | ||
| 333 | 	uint64_t ri_pageins; | ||
| 334 | 	uint64_t ri_wired_size; | ||
| 335 | 	uint64_t ri_resident_size; | ||
| 336 | 	uint64_t ri_phys_footprint; | ||
| 337 | 	uint64_t ri_proc_start_abstime; | ||
| 338 | 	uint64_t ri_proc_exit_abstime; | ||
| 339 | 	uint64_t ri_child_user_time; | ||
| 340 | 	uint64_t ri_child_system_time; | ||
| 341 | 	uint64_t ri_child_pkg_idle_wkups; | ||
| 342 | 	uint64_t ri_child_interrupt_wkups; | ||
| 343 | 	uint64_t ri_child_pageins; | ||
| 344 | 	uint64_t ri_child_elapsed_abstime; | ||
| 345 | 	uint64_t ri_diskio_bytesread; | ||
| 346 | 	uint64_t ri_diskio_byteswritten; | ||
| 347 | 	uint64_t ri_cpu_time_qos_default; | ||
| 348 | 	uint64_t ri_cpu_time_qos_maintenance; | ||
| 349 | 	uint64_t ri_cpu_time_qos_background; | ||
| 350 | 	uint64_t ri_cpu_time_qos_utility; | ||
| 351 | 	uint64_t ri_cpu_time_qos_legacy; | ||
| 352 | 	uint64_t ri_cpu_time_qos_user_initiated; | ||
| 353 | 	uint64_t ri_cpu_time_qos_user_interactive; | ||
| 354 | 	uint64_t ri_billed_system_time; | ||
| 355 | 	uint64_t ri_serviced_system_time; | ||
| 356 | 	uint64_t ri_logical_writes; | ||
| 357 | 	uint64_t ri_lifetime_max_phys_footprint; | ||
| 358 | 	uint64_t ri_instructions; | ||
| 359 | 	uint64_t ri_cycles; | ||
| 360 | 	uint64_t ri_billed_energy; | ||
| 361 | 	uint64_t ri_serviced_energy; | ||
| 362 | 	uint64_t ri_interval_max_phys_footprint; | ||
| 363 | 	uint64_t ri_runnable_time; | ||
| 364 | 	uint64_t ri_flags; | ||
| 365 | }; | ||
| 366 | |||
| 367 | typedef struct rusage_info_v5 rusage_info_current; | ||
| 322 | 368 | ||
| 323 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | 369 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ |
| 324 | 370 | ||
| ... | @@ -409,6 +455,8 @@ struct proc_rlimit_control_wakeupmon { | ... | @@ -409,6 +455,8 @@ struct proc_rlimit_control_wakeupmon { |
| 409 | #define IOPOL_TYPE_VFS_ATIME_UPDATES 2 | 455 | #define IOPOL_TYPE_VFS_ATIME_UPDATES 2 |
| 410 | #define IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES 3 | 456 | #define IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES 3 |
| 411 | #define IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME 4 | 457 | #define IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME 4 |
| 458 | #define IOPOL_TYPE_VFS_TRIGGER_RESOLVE 5 | ||
| 459 | #define IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION 6 | ||
| 412 | 460 | ||
| 413 | /* scope */ | 461 | /* scope */ |
| 414 | #define IOPOL_SCOPE_PROCESS 0 | 462 | #define IOPOL_SCOPE_PROCESS 0 |
| ... | @@ -438,6 +486,12 @@ struct proc_rlimit_control_wakeupmon { | ... | @@ -438,6 +486,12 @@ struct proc_rlimit_control_wakeupmon { |
| 438 | #define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0 | 486 | #define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0 |
| 439 | #define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1 | 487 | #define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1 |
| 440 | 488 | ||
| 489 | #define IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT 0 | ||
| 490 | #define IOPOL_VFS_TRIGGER_RESOLVE_OFF 1 | ||
| 491 | |||
| 492 | #define IOPOL_VFS_CONTENT_PROTECTION_DEFAULT 0 | ||
| 493 | #define IOPOL_VFS_CONTENT_PROTECTION_IGNORE 1 | ||
| 494 | |||
| 441 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | 495 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ |
| 442 | 496 | ||
| 443 | 497 |
lib/libc/include/x86_64-macos-gnu/sys/select.h created+134| ... | @@ -0,0 +1,134 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1992, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | *	This product includes software developed by the University of | ||
| 43 | *	California, Berkeley and its contributors. | ||
| 44 | * 4. Neither the name of the University nor the names of its contributors | ||
| 45 | * may be used to endorse or promote products derived from this software | ||
| 46 | * without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 58 | * SUCH DAMAGE. | ||
| 59 | * | ||
| 60 | *	@(#)select.h	8.2 (Berkeley) 1/4/94 | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _SYS_SELECT_H_ | ||
| 64 | #define _SYS_SELECT_H_ | ||
| 65 | |||
| 66 | #include <sys/appleapiopts.h> | ||
| 67 | #include <sys/cdefs.h> | ||
| 68 | #include <sys/_types.h> | ||
| 69 | |||
| 70 | /* | ||
| 71 | * [XSI] The <sys/select.h> header shall define the fd_set type as a structure. | ||
| 72 | * The timespec structure shall be defined as described in <time.h> | ||
| 73 | * The <sys/select.h> header shall define the timeval structure. | ||
| 74 | */ | ||
| 75 | #include <sys/_types/_fd_def.h> | ||
| 76 | #include <sys/_types/_timespec.h> | ||
| 77 | #include <sys/_types/_timeval.h> | ||
| 78 | |||
| 79 | /* | ||
| 80 | * The time_t and suseconds_t types shall be defined as described in | ||
| 81 | * <sys/types.h> | ||
| 82 | * The sigset_t type shall be defined as described in <signal.h> | ||
| 83 | */ | ||
| 84 | #include <sys/_types/_time_t.h> | ||
| 85 | #include <sys/_types/_suseconds_t.h> | ||
| 86 | #include <sys/_types/_sigset_t.h> | ||
| 87 | |||
| 88 | /* | ||
| 89 | * [XSI] FD_CLR, FD_ISSET, FD_SET, FD_ZERO may be declared as a function, or | ||
| 90 | *	 defined as a macro, or both | ||
| 91 | * [XSI] FD_SETSIZE shall be defined as a macro | ||
| 92 | */ | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Select uses bit masks of file descriptors in longs. These macros | ||
| 96 | * manipulate such bit fields (the filesystem macros use chars). The | ||
| 97 | * extra protection here is to permit application redefinition above | ||
| 98 | * the default size. | ||
| 99 | */ | ||
| 100 | #include <sys/_types/_fd_setsize.h> | ||
| 101 | #include <sys/_types/_fd_set.h> | ||
| 102 | #include <sys/_types/_fd_clr.h> | ||
| 103 | #include <sys/_types/_fd_isset.h> | ||
| 104 | #include <sys/_types/_fd_zero.h> | ||
| 105 | |||
| 106 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 107 | #include <sys/_types/_fd_copy.h> | ||
| 108 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 109 | |||
| 110 | |||
| 111 | __BEGIN_DECLS | ||
| 112 | |||
| 113 | #ifndef __MWERKS__ | ||
| 114 | int pselect(int, fd_set * __restrict, fd_set * __restrict, | ||
| 115 | fd_set * __restrict, const struct timespec * __restrict, | ||
| 116 | const sigset_t * __restrict) | ||
| 117 | #if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) | ||
| 118 | __DARWIN_EXTSN_C(pselect) | ||
| 119 | #else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ | ||
| 120 | # if defined(__LP64__) && !__DARWIN_NON_CANCELABLE | ||
| 121 | __DARWIN_1050(pselect) | ||
| 122 | # else /* !__LP64__ || __DARWIN_NON_CANCELABLE */ | ||
| 123 | __DARWIN_ALIAS_C(pselect) | ||
| 124 | # endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */ | ||
| 125 | #endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */ | ||
| 126 | ; | ||
| 127 | #endif /* __MWERKS__ */ | ||
| 128 | |||
| 129 | #include <sys/_select.h> /* select() prototype */ | ||
| 130 | |||
| 131 | __END_DECLS | ||
| 132 | |||
| 133 | |||
| 134 | #endif /* !_SYS_SELECT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/sem.h created+206| ... | @@ -0,0 +1,206 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2007 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*	$NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $	*/ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * SVID compatible sem.h file | ||
| 32 | * | ||
| 33 | * Author: Daniel Boulet | ||
| 34 | * John Bellardo modified the implementation for Darwin. 12/2000 | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _SYS_SEM_H_ | ||
| 38 | #define _SYS_SEM_H_ | ||
| 39 | |||
| 40 | |||
| 41 | #include <sys/cdefs.h> | ||
| 42 | #include <sys/_types.h> | ||
| 43 | #include <machine/types.h> /* __int32_t */ | ||
| 44 | |||
| 45 | /* | ||
| 46 | * [XSI]	All of the symbols from <sys/ipc.h> SHALL be defined | ||
| 47 | *		when this header is included | ||
| 48 | */ | ||
| 49 | #include <sys/ipc.h> | ||
| 50 | |||
| 51 | |||
| 52 | /* | ||
| 53 | * [XSI] The pid_t, time_t, key_t, and size_t types shall be defined as | ||
| 54 | * described in <sys/types.h>. | ||
| 55 | * | ||
| 56 | * NOTE:	The definition of the key_t type is implicit from the | ||
| 57 | *		inclusion of <sys/ipc.h> | ||
| 58 | */ | ||
| 59 | #include <sys/_types/_pid_t.h> | ||
| 60 | #include <sys/_types/_time_t.h> | ||
| 61 | #include <sys/_types/_size_t.h> | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Technically, we should force all code references to the new structure | ||
| 65 | * definition, not in just the standards conformance case, and leave the | ||
| 66 | * legacy interface there for binary compatibility only. Currently, we | ||
| 67 | * are only forcing this for programs requesting standards conformance. | ||
| 68 | */ | ||
| 69 | #if __DARWIN_UNIX03 || defined(KERNEL) | ||
| 70 | #pragma pack(4) | ||
| 71 | /* | ||
| 72 | * Structure used internally. | ||
| 73 | * | ||
| 74 | * This structure is exposed because standards dictate that it is used as | ||
| 75 | * the semun union member 'buf' as the fourth argment to semctl() when the | ||
| 76 | * third argument is IPC_STAT or IPC_SET. | ||
| 77 | * | ||
| 78 | * Note: only the fields sem_perm, sem_nsems, sem_otime, and sem_ctime | ||
| 79 | * are meaningful in user space. | ||
| 80 | */ | ||
| 81 | #if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE)) | ||
| 82 | struct semid_ds | ||
| 83 | #else | ||
| 84 | #define semid_ds __semid_ds_new | ||
| 85 | struct __semid_ds_new | ||
| 86 | #endif | ||
| 87 | { | ||
| 88 | 	struct __ipc_perm_new sem_perm; /* [XSI] operation permission struct */ | ||
| 89 | 	__int32_t sem_base; /* 32 bit base ptr for semaphore set */ | ||
| 90 | 	unsigned short sem_nsems; /* [XSI] number of sems in set */ | ||
| 91 | 	time_t sem_otime; /* [XSI] last operation time */ | ||
| 92 | 	__int32_t sem_pad1; /* RESERVED: DO NOT USE! */ | ||
| 93 | 	time_t sem_ctime; /* [XSI] last change time */ | ||
| 94 | 	 /* Times measured in secs since */ | ||
| 95 | 	 /* 00:00:00 GMT, Jan. 1, 1970 */ | ||
| 96 | 	__int32_t sem_pad2; /* RESERVED: DO NOT USE! */ | ||
| 97 | 	__int32_t sem_pad3[4]; /* RESERVED: DO NOT USE! */ | ||
| 98 | }; | ||
| 99 | #pragma pack() | ||
| 100 | #else /* !__DARWIN_UNIX03 */ | ||
| 101 | #define semid_ds __semid_ds_old | ||
| 102 | #endif /* __DARWIN_UNIX03 */ | ||
| 103 | |||
| 104 | #if !__DARWIN_UNIX03 | ||
| 105 | struct __semid_ds_old { | ||
| 106 | 	struct __ipc_perm_old sem_perm; /* [XSI] operation permission struct */ | ||
| 107 | 	__int32_t sem_base; /* 32 bit base ptr for semaphore set */ | ||
| 108 | 	unsigned short sem_nsems; /* [XSI] number of sems in set */ | ||
| 109 | 	time_t sem_otime; /* [XSI] last operation time */ | ||
| 110 | 	__int32_t sem_pad1; /* RESERVED: DO NOT USE! */ | ||
| 111 | 	time_t sem_ctime; /* [XSI] last change time */ | ||
| 112 | 	 /* Times measured in secs since */ | ||
| 113 | 	 /* 00:00:00 GMT, Jan. 1, 1970 */ | ||
| 114 | 	__int32_t sem_pad2; /* RESERVED: DO NOT USE! */ | ||
| 115 | 	__int32_t sem_pad3[4]; /* RESERVED: DO NOT USE! */ | ||
| 116 | }; | ||
| 117 | #endif /* !__DARWIN_UNIX03 */ | ||
| 118 | |||
| 119 | /* | ||
| 120 | * Possible values for the third argument to semctl() | ||
| 121 | */ | ||
| 122 | #define GETNCNT 3 /* [XSI] Return the value of semncnt {READ} */ | ||
| 123 | #define GETPID 4 /* [XSI] Return the value of sempid {READ} */ | ||
| 124 | #define GETVAL 5 /* [XSI] Return the value of semval {READ} */ | ||
| 125 | #define GETALL 6 /* [XSI] Return semvals into arg.array {READ} */ | ||
| 126 | #define GETZCNT 7 /* [XSI] Return the value of semzcnt {READ} */ | ||
| 127 | #define SETVAL 8 /* [XSI] Set the value of semval to arg.val {ALTER} */ | ||
| 128 | #define SETALL 9 /* [XSI] Set semvals from arg.array {ALTER} */ | ||
| 129 | |||
| 130 | |||
| 131 | /* A semaphore; this is an anonymous structure, not for external use */ | ||
| 132 | struct sem { | ||
| 133 | 	unsigned short semval; /* semaphore value */ | ||
| 134 | 	pid_t sempid; /* pid of last operation */ | ||
| 135 | 	unsigned short semncnt; /* # awaiting semval > cval */ | ||
| 136 | 	unsigned short semzcnt; /* # awaiting semval == 0 */ | ||
| 137 | }; | ||
| 138 | |||
| 139 | |||
| 140 | /* | ||
| 141 | * Structure of array element for second argument to semop() | ||
| 142 | */ | ||
| 143 | struct sembuf { | ||
| 144 | 	unsigned short sem_num; /* [XSI] semaphore # */ | ||
| 145 | 	short sem_op; /* [XSI] semaphore operation */ | ||
| 146 | 	short sem_flg; /* [XSI] operation flags */ | ||
| 147 | }; | ||
| 148 | |||
| 149 | /* | ||
| 150 | * Possible flag values for sem_flg | ||
| 151 | */ | ||
| 152 | #define SEM_UNDO 010000 /* [XSI] Set up adjust on exit entry */ | ||
| 153 | |||
| 154 | |||
| 155 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 156 | |||
| 157 | /* | ||
| 158 | * Union used as the fourth argment to semctl() in all cases. Specific | ||
| 159 | * member values are used for different values of the third parameter: | ||
| 160 | * | ||
| 161 | * Command					Member | ||
| 162 | * -------------------------------------------	------ | ||
| 163 | * GETALL, SETALL				array | ||
| 164 | * SETVAL					val | ||
| 165 | * IPC_STAT, IPC_SET				buf | ||
| 166 | * | ||
| 167 | * The union definition is intended to be defined by the user application | ||
| 168 | * in conforming applications; it is provided here for two reasons: | ||
| 169 | * | ||
| 170 | * 1)	Historical source compatability for non-conforming applications | ||
| 171 | *	expecting this header to declare the union type on their behalf | ||
| 172 | * | ||
| 173 | * 2)	Documentation; specifically, 64 bit applications that do not pass | ||
| 174 | *	this structure for 'val', or, alternately, a 64 bit type, will | ||
| 175 | *	not function correctly | ||
| 176 | */ | ||
| 177 | union semun { | ||
| 178 | 	int val; /* value for SETVAL */ | ||
| 179 | 	struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ | ||
| 180 | 	unsigned short *array; /* array for GETALL & SETALL */ | ||
| 181 | }; | ||
| 182 | typedef union semun semun_t; | ||
| 183 | |||
| 184 | |||
| 185 | /* | ||
| 186 | * Permissions | ||
| 187 | */ | ||
| 188 | #define SEM_A 0200 /* alter permission */ | ||
| 189 | #define SEM_R 0400 /* read permission */ | ||
| 190 | |||
| 191 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | |||
| 196 | __BEGIN_DECLS | ||
| 197 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 198 | int semsys(int, ...); | ||
| 199 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 200 | int semctl(int, int, int, ...) __DARWIN_ALIAS(semctl); | ||
| 201 | int semget(key_t, int, int); | ||
| 202 | int semop(int, struct sembuf *, size_t); | ||
| 203 | __END_DECLS | ||
| 204 | |||
| 205 | |||
| 206 | #endif /* !_SEM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/semaphore.h created+64| ... | @@ -0,0 +1,64 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*	@(#)semaphore.h	1.0	2/29/00		*/ | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | /* | ||
| 33 | * semaphore.h - POSIX semaphores | ||
| 34 | * | ||
| 35 | * HISTORY | ||
| 36 | * 29-Feb-00	A.Ramesh at Apple | ||
| 37 | *	Created for Mac OS X | ||
| 38 | */ | ||
| 39 | |||
| 40 | #ifndef _SYS_SEMAPHORE_H_ | ||
| 41 | #define _SYS_SEMAPHORE_H_ | ||
| 42 | |||
| 43 | typedef int sem_t; | ||
| 44 | |||
| 45 | /* this should go in limits.h> */ | ||
| 46 | #define SEM_VALUE_MAX 32767 | ||
| 47 | #define SEM_FAILED ((sem_t *)-1) | ||
| 48 | |||
| 49 | #include <sys/cdefs.h> | ||
| 50 | |||
| 51 | __BEGIN_DECLS | ||
| 52 | int sem_close(sem_t *); | ||
| 53 | int sem_destroy(sem_t *) __deprecated; | ||
| 54 | int sem_getvalue(sem_t * __restrict, int * __restrict) __deprecated; | ||
| 55 | int sem_init(sem_t *, int, unsigned int) __deprecated; | ||
| 56 | sem_t * sem_open(const char *, int, ...); | ||
| 57 | int sem_post(sem_t *); | ||
| 58 | int sem_trywait(sem_t *); | ||
| 59 | int sem_unlink(const char *); | ||
| 60 | int sem_wait(sem_t *) __DARWIN_ALIAS_C(sem_wait); | ||
| 61 | __END_DECLS | ||
| 62 | |||
| 63 | |||
| 64 | #endif /* _SYS_SEMAPHORE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/shm.h created+190| ... | @@ -0,0 +1,190 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /*	$NetBSD: shm.h,v 1.15 1994/06/29 06:45:17 cgd Exp $	*/ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Copyright (c) 1994 Adam Glass | ||
| 32 | * All rights reserved. | ||
| 33 | * | ||
| 34 | * Redistribution and use in source and binary forms, with or without | ||
| 35 | * modification, are permitted provided that the following conditions | ||
| 36 | * are met: | ||
| 37 | * 1. Redistributions of source code must retain the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer. | ||
| 39 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 40 | * notice, this list of conditions and the following disclaimer in the | ||
| 41 | * documentation and/or other materials provided with the distribution. | ||
| 42 | * 3. All advertising materials mentioning features or use of this software | ||
| 43 | * must display the following acknowledgement: | ||
| 44 | * This product includes software developed by Adam Glass. | ||
| 45 | * 4. The name of the author may not be used to endorse or promote products | ||
| 46 | * derived from this software without specific prior written permission | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
| 49 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
| 50 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
| 51 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| 52 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 53 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 54 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 55 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 56 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
| 57 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 58 | */ | ||
| 59 | |||
| 60 | /* | ||
| 61 | * As defined+described in "X/Open System Interfaces and Headers" | ||
| 62 | * Issue 4, p. XXX | ||
| 63 | */ | ||
| 64 | |||
| 65 | #ifndef _SYS_SHM_H_ | ||
| 66 | #define _SYS_SHM_H_ | ||
| 67 | |||
| 68 | #include <sys/cdefs.h> | ||
| 69 | #include <sys/_types.h> | ||
| 70 | |||
| 71 | /* | ||
| 72 | * [XSI]	All of the symbols from <sys/ipc.h> SHALL be defined | ||
| 73 | *		when this header is included | ||
| 74 | */ | ||
| 75 | #include <sys/ipc.h> | ||
| 76 | |||
| 77 | /* | ||
| 78 | * [XSI] The pid_t, time_t, key_t, and size_t types shall be defined as | ||
| 79 | * described in <sys/types.h>. | ||
| 80 | * | ||
| 81 | * NOTE:	The definition of the key_t type is implicit from the | ||
| 82 | *		inclusion of <sys/ipc.h> | ||
| 83 | */ | ||
| 84 | #include <sys/_types/_pid_t.h> | ||
| 85 | #include <sys/_types/_time_t.h> | ||
| 86 | #include <sys/_types/_size_t.h> | ||
| 87 | |||
| 88 | /* | ||
| 89 | * [XSI] The unsigned integer type used for the number of current attaches | ||
| 90 | * that MUST be able to store values at least as large as a type unsigned | ||
| 91 | * short. | ||
| 92 | */ | ||
| 93 | typedef unsigned short shmatt_t; | ||
| 94 | |||
| 95 | |||
| 96 | /* | ||
| 97 | * Possible flag values which may be OR'ed into the third argument to | ||
| 98 | * shmat() | ||
| 99 | */ | ||
| 100 | #define SHM_RDONLY 010000 /* [XSI] Attach read-only (else read-write) */ | ||
| 101 | #define SHM_RND 020000 /* [XSI] Round attach address to SHMLBA */ | ||
| 102 | |||
| 103 | /* | ||
| 104 | * This value is symbolic, and generally not expected to be sed by user | ||
| 105 | * programs directly, although such ise is permitted by the standard. Its | ||
| 106 | * value in our implementation is equal to the number of bytes per page. | ||
| 107 | * | ||
| 108 | * NOTE:	We DO NOT obtain this value from the appropriate system | ||
| 109 | *		headers at this time, to avoid the resulting namespace | ||
| 110 | *		pollution, which is why we discourages its use. | ||
| 111 | */ | ||
| 112 | #if __arm64__ | ||
| 113 | #define SHMLBA (16*1024) /* [XSI] Segment low boundary address multiple*/ | ||
| 114 | #else /* __arm64__ */ | ||
| 115 | #define SHMLBA 4096 /* [XSI] Segment low boundary address multiple*/ | ||
| 116 | #endif /* __arm64__ */ | ||
| 117 | |||
| 118 | /* "official" access mode definitions; somewhat braindead since you have | ||
| 119 | * to specify (SHM_* >> 3) for group and (SHM_* >> 6) for world permissions */ | ||
| 120 | #define SHM_R (IPC_R) | ||
| 121 | #define SHM_W (IPC_W) | ||
| 122 | |||
| 123 | #pragma pack(4) | ||
| 124 | |||
| 125 | /* | ||
| 126 | * Technically, we should force all code references to the new structure | ||
| 127 | * definition, not in just the standards conformance case, and leave the | ||
| 128 | * legacy interface there for binary compatibility only. Currently, we | ||
| 129 | * are only forcing this for programs requesting standards conformance. | ||
| 130 | */ | ||
| 131 | #if __DARWIN_UNIX03 || defined(KERNEL) | ||
| 132 | /* | ||
| 133 | * Structure used internally. | ||
| 134 | * | ||
| 135 | * This structure is exposed because standards dictate that it is used as | ||
| 136 | * the third argment to shmctl(). | ||
| 137 | * | ||
| 138 | * NOTE:	The field shm_internal is not meaningful in user space, | ||
| 139 | *		and must not be used there. | ||
| 140 | */ | ||
| 141 | #if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE)) | ||
| 142 | struct shmid_ds | ||
| 143 | #else | ||
| 144 | #define shmid_ds __shmid_ds_new | ||
| 145 | struct __shmid_ds_new | ||
| 146 | #endif | ||
| 147 | { | ||
| 148 | 	struct __ipc_perm_new shm_perm; /* [XSI] Operation permission value */ | ||
| 149 | 	size_t shm_segsz; /* [XSI] Size of segment in bytes */ | ||
| 150 | 	pid_t shm_lpid; /* [XSI] PID of last shared memory op */ | ||
| 151 | 	pid_t shm_cpid; /* [XSI] PID of creator */ | ||
| 152 | 	shmatt_t shm_nattch; /* [XSI] Number of current attaches */ | ||
| 153 | 	time_t shm_atime; /* [XSI] Time of last shmat() */ | ||
| 154 | 	time_t shm_dtime; /* [XSI] Time of last shmdt() */ | ||
| 155 | 	time_t shm_ctime; /* [XSI] Time of last shmctl() change */ | ||
| 156 | 	void *shm_internal; /* reserved for kernel use */ | ||
| 157 | }; | ||
| 158 | #else /* !__DARWIN_UNIX03 */ | ||
| 159 | #define shmid_ds __shmid_ds_old | ||
| 160 | #endif /* !__DARWIN_UNIX03 */ | ||
| 161 | |||
| 162 | #if !__DARWIN_UNIX03 | ||
| 163 | struct __shmid_ds_old { | ||
| 164 | 	struct __ipc_perm_old shm_perm; /* [XSI] Operation permission value */ | ||
| 165 | 	size_t shm_segsz; /* [XSI] Size of segment in bytes */ | ||
| 166 | 	pid_t shm_lpid; /* [XSI] PID of last shared memory op */ | ||
| 167 | 	pid_t shm_cpid; /* [XSI] PID of creator */ | ||
| 168 | 	shmatt_t shm_nattch; /* [XSI] Number of current attaches */ | ||
| 169 | 	time_t shm_atime; /* [XSI] Time of last shmat() */ | ||
| 170 | 	time_t shm_dtime; /* [XSI] Time of last shmdt() */ | ||
| 171 | 	time_t shm_ctime; /* [XSI] Time of last shmctl() change */ | ||
| 172 | 	void *shm_internal; /* reserved for kernel use */ | ||
| 173 | }; | ||
| 174 | #endif /* !__DARWIN_UNIX03 */ | ||
| 175 | |||
| 176 | #pragma pack() | ||
| 177 | |||
| 178 | |||
| 179 | __BEGIN_DECLS | ||
| 180 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 181 | int shmsys(int, ...); | ||
| 182 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 183 | void *shmat(int, const void *, int); | ||
| 184 | int shmctl(int, int, struct shmid_ds *) __DARWIN_ALIAS(shmctl); | ||
| 185 | int shmdt(const void *); | ||
| 186 | int shmget(key_t, size_t, int); | ||
| 187 | __END_DECLS | ||
| 188 | |||
| 189 | |||
| 190 | #endif /* !_SYS_SHM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/socket.h created+741| ... | @@ -0,0 +1,741 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2019 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1998, 1999 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 30 | /* | ||
| 31 | * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 | ||
| 32 | *	The Regents of the University of California. All rights reserved. | ||
| 33 | * | ||
| 34 | * Redistribution and use in source and binary forms, with or without | ||
| 35 | * modification, are permitted provided that the following conditions | ||
| 36 | * are met: | ||
| 37 | * 1. Redistributions of source code must retain the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer. | ||
| 39 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 40 | * notice, this list of conditions and the following disclaimer in the | ||
| 41 | * documentation and/or other materials provided with the distribution. | ||
| 42 | * 3. All advertising materials mentioning features or use of this software | ||
| 43 | * must display the following acknowledgement: | ||
| 44 | *	This product includes software developed by the University of | ||
| 45 | *	California, Berkeley and its contributors. | ||
| 46 | * 4. Neither the name of the University nor the names of its contributors | ||
| 47 | * may be used to endorse or promote products derived from this software | ||
| 48 | * without specific prior written permission. | ||
| 49 | * | ||
| 50 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 51 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 53 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 54 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 55 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 56 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 57 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 58 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 59 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 60 | * SUCH DAMAGE. | ||
| 61 | * | ||
| 62 | *	@(#)socket.h	8.4 (Berkeley) 2/21/94 | ||
| 63 | * $FreeBSD: src/sys/sys/socket.h,v 1.39.2.7 2001/07/03 11:02:01 ume Exp $ | ||
| 64 | */ | ||
| 65 | /* | ||
| 66 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 67 | * support for mandatory and extensible security protections. This notice | ||
| 68 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 69 | * Version 2.0. | ||
| 70 | */ | ||
| 71 | |||
| 72 | #ifndef _SYS_SOCKET_H_ | ||
| 73 | #define _SYS_SOCKET_H_ | ||
| 74 | |||
| 75 | #include <sys/types.h> | ||
| 76 | #include <sys/cdefs.h> | ||
| 77 | #include <machine/_param.h> | ||
| 78 | #include <net/net_kev.h> | ||
| 79 | |||
| 80 | |||
| 81 | #include <Availability.h> | ||
| 82 | |||
| 83 | /* | ||
| 84 | * Definitions related to sockets: types, address families, options. | ||
| 85 | */ | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Data types. | ||
| 89 | */ | ||
| 90 | |||
| 91 | #include <sys/_types/_gid_t.h> | ||
| 92 | #include <sys/_types/_off_t.h> | ||
| 93 | #include <sys/_types/_pid_t.h> | ||
| 94 | #include <sys/_types/_sa_family_t.h> | ||
| 95 | #include <sys/_types/_socklen_t.h> | ||
| 96 | |||
| 97 | /* XXX Not explicitly defined by POSIX, but function return types are */ | ||
| 98 | #include <sys/_types/_size_t.h> | ||
| 99 | |||
| 100 | /* XXX Not explicitly defined by POSIX, but function return types are */ | ||
| 101 | #include <sys/_types/_ssize_t.h> | ||
| 102 | |||
| 103 | /* | ||
| 104 | * [XSI] The iovec structure shall be defined as described in <sys/uio.h>. | ||
| 105 | */ | ||
| 106 | #include <sys/_types/_iovec_t.h> | ||
| 107 | |||
| 108 | /* | ||
| 109 | * Types | ||
| 110 | */ | ||
| 111 | #define SOCK_STREAM 1 /* stream socket */ | ||
| 112 | #define SOCK_DGRAM 2 /* datagram socket */ | ||
| 113 | #define SOCK_RAW 3 /* raw-protocol interface */ | ||
| 114 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 115 | #define SOCK_RDM 4 /* reliably-delivered message */ | ||
| 116 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 117 | #define SOCK_SEQPACKET 5 /* sequenced packet stream */ | ||
| 118 | |||
| 119 | /* | ||
| 120 | * Option flags per-socket. | ||
| 121 | */ | ||
| 122 | #define SO_DEBUG 0x0001 /* turn on debugging info recording */ | ||
| 123 | #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ | ||
| 124 | #define SO_REUSEADDR 0x0004 /* allow local address reuse */ | ||
| 125 | #define SO_KEEPALIVE 0x0008 /* keep connections alive */ | ||
| 126 | #define SO_DONTROUTE 0x0010 /* just use interface addresses */ | ||
| 127 | #define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ | ||
| 128 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 129 | #define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ | ||
| 130 | #define SO_LINGER 0x0080 /* linger on close if data present (in ticks) */ | ||
| 131 | #else | ||
| 132 | #define SO_LINGER 0x1080 /* linger on close if data present (in seconds) */ | ||
| 133 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 134 | #define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ | ||
| 135 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 136 | #define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ | ||
| 137 | #define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ | ||
| 138 | #define SO_TIMESTAMP_MONOTONIC 0x0800 /* Monotonically increasing timestamp on rcvd dgram */ | ||
| 139 | #ifndef __APPLE__ | ||
| 140 | #define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ | ||
| 141 | #else | ||
| 142 | #define SO_DONTTRUNC 0x2000 /* APPLE: Retain unread data */ | ||
| 143 | /* (ATOMIC proto) */ | ||
| 144 | #define SO_WANTMORE 0x4000 /* APPLE: Give hint when more data ready */ | ||
| 145 | #define SO_WANTOOBFLAG 0x8000 /* APPLE: Want OOB in MSG_FLAG on receive */ | ||
| 146 | |||
| 147 | |||
| 148 | #endif /* (!__APPLE__) */ | ||
| 149 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Additional options, not kept in so_options. | ||
| 153 | */ | ||
| 154 | #define SO_SNDBUF 0x1001 /* send buffer size */ | ||
| 155 | #define SO_RCVBUF 0x1002 /* receive buffer size */ | ||
| 156 | #define SO_SNDLOWAT 0x1003 /* send low-water mark */ | ||
| 157 | #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ | ||
| 158 | #define SO_SNDTIMEO 0x1005 /* send timeout */ | ||
| 159 | #define SO_RCVTIMEO 0x1006 /* receive timeout */ | ||
| 160 | #define SO_ERROR 0x1007 /* get error status and clear */ | ||
| 161 | #define SO_TYPE 0x1008 /* get socket type */ | ||
| 162 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 163 | #define SO_LABEL 0x1010 /* deprecated */ | ||
| 164 | #define SO_PEERLABEL 0x1011 /* deprecated */ | ||
| 165 | #ifdef __APPLE__ | ||
| 166 | #define SO_NREAD 0x1020 /* APPLE: get 1st-packet byte count */ | ||
| 167 | #define SO_NKE 0x1021 /* APPLE: Install socket-level NKE */ | ||
| 168 | #define SO_NOSIGPIPE 0x1022 /* APPLE: No SIGPIPE on EPIPE */ | ||
| 169 | #define SO_NOADDRERR 0x1023 /* APPLE: Returns EADDRNOTAVAIL when src is not available anymore */ | ||
| 170 | #define SO_NWRITE 0x1024 /* APPLE: Get number of bytes currently in send socket buffer */ | ||
| 171 | #define SO_REUSESHAREUID 0x1025 /* APPLE: Allow reuse of port/socket by different userids */ | ||
| 172 | #ifdef __APPLE_API_PRIVATE | ||
| 173 | #define SO_NOTIFYCONFLICT 0x1026 /* APPLE: send notification if there is a bind on a port which is already in use */ | ||
| 174 | #define SO_UPCALLCLOSEWAIT 0x1027 /* APPLE: block on close until an upcall returns */ | ||
| 175 | #endif | ||
| 176 | #define SO_LINGER_SEC 0x1080 /* linger on close if data present (in seconds) */ | ||
| 177 | #define SO_RANDOMPORT 0x1082 /* APPLE: request local port randomization */ | ||
| 178 | #define SO_NP_EXTENSIONS 0x1083 /* To turn off some POSIX behavior */ | ||
| 179 | #endif | ||
| 180 | |||
| 181 | #define SO_NUMRCVPKT 0x1112 /* number of datagrams in receive socket buffer */ | ||
| 182 | #define SO_NET_SERVICE_TYPE 0x1116 /* Network service type */ | ||
| 183 | |||
| 184 | |||
| 185 | #define SO_NETSVC_MARKING_LEVEL 0x1119 /* Get QoS marking in effect for socket */ | ||
| 186 | |||
| 187 | /* | ||
| 188 | * Network Service Type for option SO_NET_SERVICE_TYPE | ||
| 189 | * | ||
| 190 | * The vast majority of sockets should use Best Effort that is the default | ||
| 191 | * Network Service Type. Other Network Service Types have to be used only if | ||
| 192 | * the traffic actually matches the description of the Network Service Type. | ||
| 193 | * | ||
| 194 | * Network Service Types do not represent priorities but rather describe | ||
| 195 | * different categories of delay, jitter and loss parameters. | ||
| 196 | * Those parameters may influence protocols from layer 4 protocols like TCP | ||
| 197 | * to layer 2 protocols like Wi-Fi. The Network Service Type can determine | ||
| 198 | * how the traffic is queued and scheduled by the host networking stack and | ||
| 199 | * by other entities on the network like switches and routers. For example | ||
| 200 | * for Wi-Fi, the Network Service Type can select the marking of the | ||
| 201 | * layer 2 packet with the appropriate WMM Access Category. | ||
| 202 | * | ||
| 203 | * There is no point in attempting to game the system and use | ||
| 204 | * a Network Service Type that does not correspond to the actual | ||
| 205 | * traffic characteristic but one that seems to have a higher precedence. | ||
| 206 | * The reason is that for service classes that have lower tolerance | ||
| 207 | * for delay and jitter, the queues size is lower than for service | ||
| 208 | * classes that are more tolerant to delay and jitter. | ||
| 209 | * | ||
| 210 | * For example using a voice service type for bulk data transfer will lead | ||
| 211 | * to disastrous results as soon as congestion happens because the voice | ||
| 212 | * queue overflows and packets get dropped. This is not only bad for the bulk | ||
| 213 | * data transfer but it is also bad for VoIP apps that legitimately are using | ||
| 214 | * the voice service type. | ||
| 215 | * | ||
| 216 | * The characteristics of the Network Service Types are based on the service | ||
| 217 | * classes defined in RFC 4594 "Configuration Guidelines for DiffServ Service | ||
| 218 | * Classes" | ||
| 219 | * | ||
| 220 | * When system detects the outgoing interface belongs to a DiffServ domain | ||
| 221 | * that follows the recommendation of the IETF draft "Guidelines for DiffServ to | ||
| 222 | * IEEE 802.11 Mapping", the packet will marked at layer 3 with a DSCP value | ||
| 223 | * that corresponds to Network Service Type. | ||
| 224 | * | ||
| 225 | * NET_SERVICE_TYPE_BE | ||
| 226 | *	"Best Effort", unclassified/standard. This is the default service | ||
| 227 | *	class and cover the majority of the traffic. | ||
| 228 | * | ||
| 229 | * NET_SERVICE_TYPE_BK | ||
| 230 | *	"Background", high delay tolerant, loss tolerant. elastic flow, | ||
| 231 | *	variable size & long-lived. E.g: non-interactive network bulk transfer | ||
| 232 | *	like synching or backup. | ||
| 233 | * | ||
| 234 | * NET_SERVICE_TYPE_RD | ||
| 235 | *	"Responsive Data", a notch higher than "Best Effort", medium delay | ||
| 236 | *	tolerant, elastic & inelastic flow, bursty, long-lived. E.g. email, | ||
| 237 | *	instant messaging, for which there is a sense of interactivity and | ||
| 238 | *	urgency (user waiting for output). | ||
| 239 | * | ||
| 240 | * NET_SERVICE_TYPE_OAM | ||
| 241 | *	"Operations, Administration, and Management", medium delay tolerant, | ||
| 242 | *	low-medium loss tolerant, elastic & inelastic flows, variable size. | ||
| 243 | *	E.g. VPN tunnels. | ||
| 244 | * | ||
| 245 | * NET_SERVICE_TYPE_AV | ||
| 246 | *	"Multimedia Audio/Video Streaming", medium delay tolerant, low-medium | ||
| 247 | *	loss tolerant, elastic flow, constant packet interval, variable rate | ||
| 248 | *	and size. E.g. video and audio playback with buffering. | ||
| 249 | * | ||
| 250 | * NET_SERVICE_TYPE_RV | ||
| 251 | *	"Responsive Multimedia Audio/Video", low delay tolerant, low-medium | ||
| 252 | *	loss tolerant, elastic flow, variable packet interval, rate and size. | ||
| 253 | *	E.g. screen sharing. | ||
| 254 | * | ||
| 255 | * NET_SERVICE_TYPE_VI | ||
| 256 | *	"Interactive Video", low delay tolerant, low-medium loss tolerant, | ||
| 257 | *	elastic flow, constant packet interval, variable rate & size. E.g. | ||
| 258 | *	video telephony. | ||
| 259 | * | ||
| 260 | * NET_SERVICE_TYPE_SIG | ||
| 261 | *	"Signaling", low delay tolerant, low loss tolerant, inelastic flow, | ||
| 262 | *	jitter tolerant, rate is bursty but short, variable size. E.g. SIP. | ||
| 263 | * | ||
| 264 | * NET_SERVICE_TYPE_VO | ||
| 265 | *	"Interactive Voice", very low delay tolerant, very low loss tolerant, | ||
| 266 | *	inelastic flow, constant packet rate, somewhat fixed size. | ||
| 267 | *	E.g. VoIP. | ||
| 268 | */ | ||
| 269 | |||
| 270 | #define NET_SERVICE_TYPE_BE 0 /* Best effort */ | ||
| 271 | #define NET_SERVICE_TYPE_BK 1 /* Background system initiated */ | ||
| 272 | #define NET_SERVICE_TYPE_SIG 2 /* Signaling */ | ||
| 273 | #define NET_SERVICE_TYPE_VI 3 /* Interactive Video */ | ||
| 274 | #define NET_SERVICE_TYPE_VO 4 /* Interactive Voice */ | ||
| 275 | #define NET_SERVICE_TYPE_RV 5 /* Responsive Multimedia Audio/Video */ | ||
| 276 | #define NET_SERVICE_TYPE_AV 6 /* Multimedia Audio/Video Streaming */ | ||
| 277 | #define NET_SERVICE_TYPE_OAM 7 /* Operations, Administration, and Management */ | ||
| 278 | #define NET_SERVICE_TYPE_RD 8 /* Responsive Data */ | ||
| 279 | |||
| 280 | |||
| 281 | /* These are supported values for SO_NETSVC_MARKING_LEVEL */ | ||
| 282 | #define NETSVC_MRKNG_UNKNOWN 0 /* The outgoing network interface is not known */ | ||
| 283 | #define NETSVC_MRKNG_LVL_L2 1 /* Default marking at layer 2 (for example Wi-Fi WMM) */ | ||
| 284 | #define NETSVC_MRKNG_LVL_L3L2_ALL 2 /* Layer 3 DSCP marking and layer 2 marking for all Network Service Types */ | ||
| 285 | #define NETSVC_MRKNG_LVL_L3L2_BK 3 /* The system policy limits layer 3 DSCP marking and layer 2 marking | ||
| 286 | 	 * to background Network Service Types */ | ||
| 287 | |||
| 288 | |||
| 289 | typedef __uint32_t sae_associd_t; | ||
| 290 | #define SAE_ASSOCID_ANY 0 | ||
| 291 | #define SAE_ASSOCID_ALL ((sae_associd_t)(-1ULL)) | ||
| 292 | |||
| 293 | typedef __uint32_t sae_connid_t; | ||
| 294 | #define SAE_CONNID_ANY 0 | ||
| 295 | #define SAE_CONNID_ALL ((sae_connid_t)(-1ULL)) | ||
| 296 | |||
| 297 | /* connectx() flag parameters */ | ||
| 298 | #define CONNECT_RESUME_ON_READ_WRITE 0x1 /* resume connect() on read/write */ | ||
| 299 | #define CONNECT_DATA_IDEMPOTENT 0x2 /* data is idempotent */ | ||
| 300 | #define CONNECT_DATA_AUTHENTICATED 0x4 /* data includes security that replaces the TFO-cookie */ | ||
| 301 | |||
| 302 | /* sockaddr endpoints */ | ||
| 303 | typedef struct sa_endpoints { | ||
| 304 | 	unsigned int sae_srcif; /* optional source interface */ | ||
| 305 | 	const struct sockaddr *sae_srcaddr; /* optional source address */ | ||
| 306 | 	socklen_t sae_srcaddrlen; /* size of source address */ | ||
| 307 | 	const struct sockaddr *sae_dstaddr; /* destination address */ | ||
| 308 | 	socklen_t sae_dstaddrlen; /* size of destination address */ | ||
| 309 | } sa_endpoints_t; | ||
| 310 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 311 | |||
| 312 | /* | ||
| 313 | * Structure used for manipulating linger option. | ||
| 314 | */ | ||
| 315 | struct linger { | ||
| 316 | 	int l_onoff; /* option on/off */ | ||
| 317 | 	int l_linger; /* linger time */ | ||
| 318 | }; | ||
| 319 | |||
| 320 | #ifndef __APPLE__ | ||
| 321 | struct accept_filter_arg { | ||
| 322 | 	char af_name[16]; | ||
| 323 | 	char af_arg[256 - 16]; | ||
| 324 | }; | ||
| 325 | #endif | ||
| 326 | |||
| 327 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 328 | #ifdef __APPLE__ | ||
| 329 | |||
| 330 | /* | ||
| 331 | * Structure to control non-portable Sockets extension to POSIX | ||
| 332 | */ | ||
| 333 | struct so_np_extensions { | ||
| 334 | 	u_int32_t npx_flags; | ||
| 335 | 	u_int32_t npx_mask; | ||
| 336 | }; | ||
| 337 | |||
| 338 | #define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */ | ||
| 339 | |||
| 340 | |||
| 341 | |||
| 342 | #endif | ||
| 343 | #endif | ||
| 344 | |||
| 345 | /* | ||
| 346 | * Level number for (get/set)sockopt() to apply to socket itself. | ||
| 347 | */ | ||
| 348 | #define SOL_SOCKET 0xffff /* options for socket level */ | ||
| 349 | |||
| 350 | |||
| 351 | /* | ||
| 352 | * Address families. | ||
| 353 | */ | ||
| 354 | #define AF_UNSPEC 0 /* unspecified */ | ||
| 355 | #define AF_UNIX 1 /* local to host (pipes) */ | ||
| 356 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 357 | #define AF_LOCAL AF_UNIX /* backward compatibility */ | ||
| 358 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 359 | #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ | ||
| 360 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 361 | #define AF_IMPLINK 3 /* arpanet imp addresses */ | ||
| 362 | #define AF_PUP 4 /* pup protocols: e.g. BSP */ | ||
| 363 | #define AF_CHAOS 5 /* mit CHAOS protocols */ | ||
| 364 | #define AF_NS 6 /* XEROX NS protocols */ | ||
| 365 | #define AF_ISO 7 /* ISO protocols */ | ||
| 366 | #define AF_OSI AF_ISO | ||
| 367 | #define AF_ECMA 8 /* European computer manufacturers */ | ||
| 368 | #define AF_DATAKIT 9 /* datakit protocols */ | ||
| 369 | #define AF_CCITT 10 /* CCITT protocols, X.25 etc */ | ||
| 370 | #define AF_SNA 11 /* IBM SNA */ | ||
| 371 | #define AF_DECnet 12 /* DECnet */ | ||
| 372 | #define AF_DLI 13 /* DEC Direct data link interface */ | ||
| 373 | #define AF_LAT 14 /* LAT */ | ||
| 374 | #define AF_HYLINK 15 /* NSC Hyperchannel */ | ||
| 375 | #define AF_APPLETALK 16 /* Apple Talk */ | ||
| 376 | #define AF_ROUTE 17 /* Internal Routing Protocol */ | ||
| 377 | #define AF_LINK 18 /* Link layer interface */ | ||
| 378 | #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ | ||
| 379 | #define AF_COIP 20 /* connection-oriented IP, aka ST II */ | ||
| 380 | #define AF_CNT 21 /* Computer Network Technology */ | ||
| 381 | #define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ | ||
| 382 | #define AF_IPX 23 /* Novell Internet Protocol */ | ||
| 383 | #define AF_SIP 24 /* Simple Internet Protocol */ | ||
| 384 | #define pseudo_AF_PIP 25 /* Help Identify PIP packets */ | ||
| 385 | #define AF_NDRV 27 /* Network Driver 'raw' access */ | ||
| 386 | #define AF_ISDN 28 /* Integrated Services Digital Network */ | ||
| 387 | #define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ | ||
| 388 | #define pseudo_AF_KEY 29 /* Internal key-management function */ | ||
| 389 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 390 | #define AF_INET6 30 /* IPv6 */ | ||
| 391 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 392 | #define AF_NATM 31 /* native ATM access */ | ||
| 393 | #define AF_SYSTEM 32 /* Kernel event messages */ | ||
| 394 | #define AF_NETBIOS 33 /* NetBIOS */ | ||
| 395 | #define AF_PPP 34 /* PPP communication protocol */ | ||
| 396 | #define pseudo_AF_HDRCMPLT 35 /* Used by BPF to not rewrite headers | ||
| 397 | 	 * in interface output routine */ | ||
| 398 | #define AF_RESERVED_36 36 /* Reserved for internal usage */ | ||
| 399 | #define AF_IEEE80211 37 /* IEEE 802.11 protocol */ | ||
| 400 | #define AF_UTUN 38 | ||
| 401 | #define AF_VSOCK 40 /* VM Sockets */ | ||
| 402 | #define AF_MAX 41 | ||
| 403 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 404 | |||
| 405 | /* | ||
| 406 | * [XSI] Structure used by kernel to store most addresses. | ||
| 407 | */ | ||
| 408 | struct sockaddr { | ||
| 409 | 	__uint8_t sa_len; /* total length */ | ||
| 410 | 	sa_family_t sa_family; /* [XSI] address family */ | ||
| 411 | 	char sa_data[14]; /* [XSI] addr value (actually larger) */ | ||
| 412 | }; | ||
| 413 | |||
| 414 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 415 | #define SOCK_MAXADDRLEN 255 /* longest possible addresses */ | ||
| 416 | |||
| 417 | /* | ||
| 418 | * Structure used by kernel to pass protocol | ||
| 419 | * information in raw sockets. | ||
| 420 | */ | ||
| 421 | struct sockproto { | ||
| 422 | 	__uint16_t sp_family; /* address family */ | ||
| 423 | 	__uint16_t sp_protocol; /* protocol */ | ||
| 424 | }; | ||
| 425 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 426 | |||
| 427 | /* | ||
| 428 | * RFC 2553: protocol-independent placeholder for socket addresses | ||
| 429 | */ | ||
| 430 | #define _SS_MAXSIZE 128 | ||
| 431 | #define _SS_ALIGNSIZE (sizeof(__int64_t)) | ||
| 432 | #define _SS_PAD1SIZE \ | ||
| 433 | 	 (_SS_ALIGNSIZE - sizeof(__uint8_t) - sizeof(sa_family_t)) | ||
| 434 | #define _SS_PAD2SIZE \ | ||
| 435 | 	 (_SS_MAXSIZE - sizeof(__uint8_t) - sizeof(sa_family_t) - \ | ||
| 436 | 	 _SS_PAD1SIZE - _SS_ALIGNSIZE) | ||
| 437 | |||
| 438 | /* | ||
| 439 | * [XSI] sockaddr_storage | ||
| 440 | */ | ||
| 441 | struct sockaddr_storage { | ||
| 442 | 	__uint8_t ss_len; /* address length */ | ||
| 443 | 	sa_family_t ss_family; /* [XSI] address family */ | ||
| 444 | 	char __ss_pad1[_SS_PAD1SIZE]; | ||
| 445 | 	__int64_t __ss_align; /* force structure storage alignment */ | ||
| 446 | 	char __ss_pad2[_SS_PAD2SIZE]; | ||
| 447 | }; | ||
| 448 | |||
| 449 | /* | ||
| 450 | * Protocol families, same as address families for now. | ||
| 451 | */ | ||
| 452 | #define PF_UNSPEC AF_UNSPEC | ||
| 453 | #define PF_LOCAL AF_LOCAL | ||
| 454 | #define PF_UNIX PF_LOCAL /* backward compatibility */ | ||
| 455 | #define PF_INET AF_INET | ||
| 456 | #define PF_IMPLINK AF_IMPLINK | ||
| 457 | #define PF_PUP AF_PUP | ||
| 458 | #define PF_CHAOS AF_CHAOS | ||
| 459 | #define PF_NS AF_NS | ||
| 460 | #define PF_ISO AF_ISO | ||
| 461 | #define PF_OSI AF_ISO | ||
| 462 | #define PF_ECMA AF_ECMA | ||
| 463 | #define PF_DATAKIT AF_DATAKIT | ||
| 464 | #define PF_CCITT AF_CCITT | ||
| 465 | #define PF_SNA AF_SNA | ||
| 466 | #define PF_DECnet AF_DECnet | ||
| 467 | #define PF_DLI AF_DLI | ||
| 468 | #define PF_LAT AF_LAT | ||
| 469 | #define PF_HYLINK AF_HYLINK | ||
| 470 | #define PF_APPLETALK AF_APPLETALK | ||
| 471 | #define PF_ROUTE AF_ROUTE | ||
| 472 | #define PF_LINK AF_LINK | ||
| 473 | #define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ | ||
| 474 | #define PF_COIP AF_COIP | ||
| 475 | #define PF_CNT AF_CNT | ||
| 476 | #define PF_SIP AF_SIP | ||
| 477 | #define PF_IPX AF_IPX /* same format as AF_NS */ | ||
| 478 | #define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ | ||
| 479 | #define PF_PIP pseudo_AF_PIP | ||
| 480 | #define PF_NDRV AF_NDRV | ||
| 481 | #define PF_ISDN AF_ISDN | ||
| 482 | #define PF_KEY pseudo_AF_KEY | ||
| 483 | #define PF_INET6 AF_INET6 | ||
| 484 | #define PF_NATM AF_NATM | ||
| 485 | #define PF_SYSTEM AF_SYSTEM | ||
| 486 | #define PF_NETBIOS AF_NETBIOS | ||
| 487 | #define PF_PPP AF_PPP | ||
| 488 | #define PF_RESERVED_36 AF_RESERVED_36 | ||
| 489 | #define PF_UTUN AF_UTUN | ||
| 490 | #define PF_VSOCK AF_VSOCK | ||
| 491 | #define PF_MAX AF_MAX | ||
| 492 | |||
| 493 | /* | ||
| 494 | * These do not have socket-layer support: | ||
| 495 | */ | ||
| 496 | #define PF_VLAN ((uint32_t)0x766c616e) /* 'vlan' */ | ||
| 497 | #define PF_BOND ((uint32_t)0x626f6e64) /* 'bond' */ | ||
| 498 | |||
| 499 | /* | ||
| 500 | * Definitions for network related sysctl, CTL_NET. | ||
| 501 | * | ||
| 502 | * Second level is protocol family. | ||
| 503 | * Third level is protocol number. | ||
| 504 | * | ||
| 505 | * Further levels are defined by the individual families below. | ||
| 506 | */ | ||
| 507 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 508 | #define NET_MAXID AF_MAX | ||
| 509 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 510 | |||
| 511 | |||
| 512 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 513 | /* | ||
| 514 | * PF_ROUTE - Routing table | ||
| 515 | * | ||
| 516 | * Three additional levels are defined: | ||
| 517 | *	Fourth: address family, 0 is wildcard | ||
| 518 | *	Fifth: type of info, defined below | ||
| 519 | *	Sixth: flag(s) to mask with for NET_RT_FLAGS | ||
| 520 | */ | ||
| 521 | #define NET_RT_DUMP 1 /* dump; may limit to a.f. */ | ||
| 522 | #define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ | ||
| 523 | #define NET_RT_IFLIST 3 /* survey interface list */ | ||
| 524 | #define NET_RT_STAT 4 /* routing statistics */ | ||
| 525 | #define NET_RT_TRASH 5 /* routes not in table but not freed */ | ||
| 526 | #define NET_RT_IFLIST2 6 /* interface list with addresses */ | ||
| 527 | #define NET_RT_DUMP2 7 /* dump; may limit to a.f. */ | ||
| 528 | /* | ||
| 529 | * Allows read access non-local host's MAC address | ||
| 530 | * if the process has neighbor cache entitlement. | ||
| 531 | */ | ||
| 532 | #define NET_RT_FLAGS_PRIV 10 | ||
| 533 | #define NET_RT_MAXID 11 | ||
| 534 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 535 | |||
| 536 | |||
| 537 | |||
| 538 | |||
| 539 | /* | ||
| 540 | * Maximum queue length specifiable by listen. | ||
| 541 | */ | ||
| 542 | #define SOMAXCONN 128 | ||
| 543 | |||
| 544 | /* | ||
| 545 | * [XSI] Message header for recvmsg and sendmsg calls. | ||
| 546 | * Used value-result for recvmsg, value only for sendmsg. | ||
| 547 | */ | ||
| 548 | struct msghdr { | ||
| 549 | 	void *msg_name; /* [XSI] optional address */ | ||
| 550 | 	socklen_t msg_namelen; /* [XSI] size of address */ | ||
| 551 | 	struct iovec *msg_iov; /* [XSI] scatter/gather array */ | ||
| 552 | 	int msg_iovlen; /* [XSI] # elements in msg_iov */ | ||
| 553 | 	void *msg_control; /* [XSI] ancillary data, see below */ | ||
| 554 | 	socklen_t msg_controllen; /* [XSI] ancillary data buffer len */ | ||
| 555 | 	int msg_flags; /* [XSI] flags on received message */ | ||
| 556 | }; | ||
| 557 | |||
| 558 | |||
| 559 | |||
| 560 | #define MSG_OOB 0x1 /* process out-of-band data */ | ||
| 561 | #define MSG_PEEK 0x2 /* peek at incoming message */ | ||
| 562 | #define MSG_DONTROUTE 0x4 /* send without using routing tables */ | ||
| 563 | #define MSG_EOR 0x8 /* data completes record */ | ||
| 564 | #define MSG_TRUNC 0x10 /* data discarded before delivery */ | ||
| 565 | #define MSG_CTRUNC 0x20 /* control data lost before delivery */ | ||
| 566 | #define MSG_WAITALL 0x40 /* wait for full request or error */ | ||
| 567 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 568 | #define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ | ||
| 569 | #define MSG_EOF 0x100 /* data completes connection */ | ||
| 570 | #ifdef __APPLE__ | ||
| 571 | #ifdef __APPLE_API_OBSOLETE | ||
| 572 | #define MSG_WAITSTREAM 0x200 /* wait up to full request.. may return partial */ | ||
| 573 | #endif | ||
| 574 | #define MSG_FLUSH 0x400 /* Start of 'hold' seq; dump so_temp, deprecated */ | ||
| 575 | #define MSG_HOLD 0x800 /* Hold frag in so_temp, deprecated */ | ||
| 576 | #define MSG_SEND 0x1000 /* Send the packet in so_temp, deprecated */ | ||
| 577 | #define MSG_HAVEMORE 0x2000 /* Data ready to be read */ | ||
| 578 | #define MSG_RCVMORE 0x4000 /* Data remains in current pkt */ | ||
| 579 | #endif | ||
| 580 | #define MSG_NEEDSA 0x10000 /* Fail receive if socket address cannot be allocated */ | ||
| 581 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 582 | |||
| 583 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 584 | #define MSG_NOSIGNAL 0x80000 /* do not generate SIGPIPE on EOF */ | ||
| 585 | #endif /* __DARWIN_C_LEVEL */ | ||
| 586 | |||
| 587 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 588 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 589 | |||
| 590 | /* | ||
| 591 | * Header for ancillary data objects in msg_control buffer. | ||
| 592 | * Used for additional information with/about a datagram | ||
| 593 | * not expressible by flags. The format is a sequence | ||
| 594 | * of message elements headed by cmsghdr structures. | ||
| 595 | */ | ||
| 596 | struct cmsghdr { | ||
| 597 | 	socklen_t cmsg_len; /* [XSI] data byte count, including hdr */ | ||
| 598 | 	int cmsg_level; /* [XSI] originating protocol */ | ||
| 599 | 	int cmsg_type; /* [XSI] protocol-specific type */ | ||
| 600 | /* followed by	unsigned char cmsg_data[]; */ | ||
| 601 | }; | ||
| 602 | |||
| 603 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 604 | #ifndef __APPLE__ | ||
| 605 | /* | ||
| 606 | * While we may have more groups than this, the cmsgcred struct must | ||
| 607 | * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow | ||
| 608 | * this. | ||
| 609 | */ | ||
| 610 | #define CMGROUP_MAX 16 | ||
| 611 | |||
| 612 | /* | ||
| 613 | * Credentials structure, used to verify the identity of a peer | ||
| 614 | * process that has sent us a message. This is allocated by the | ||
| 615 | * peer process but filled in by the kernel. This prevents the | ||
| 616 | * peer from lying about its identity. (Note that cmcred_groups[0] | ||
| 617 | * is the effective GID.) | ||
| 618 | */ | ||
| 619 | struct cmsgcred { | ||
| 620 | 	pid_t cmcred_pid; /* PID of sending process */ | ||
| 621 | 	uid_t cmcred_uid; /* real UID of sending process */ | ||
| 622 | 	uid_t cmcred_euid; /* effective UID of sending process */ | ||
| 623 | 	gid_t cmcred_gid; /* real GID of sending process */ | ||
| 624 | 	short cmcred_ngroups; /* number or groups */ | ||
| 625 | 	gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ | ||
| 626 | }; | ||
| 627 | #endif | ||
| 628 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 629 | |||
| 630 | /* given pointer to struct cmsghdr, return pointer to data */ | ||
| 631 | #define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ | ||
| 632 | 	__DARWIN_ALIGN32(sizeof(struct cmsghdr))) | ||
| 633 | |||
| 634 | /* | ||
| 635 | * RFC 2292 requires to check msg_controllen, in case that the kernel returns | ||
| 636 | * an empty list for some reasons. | ||
| 637 | */ | ||
| 638 | #define CMSG_FIRSTHDR(mhdr) \ | ||
| 639 | 	((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ | ||
| 640 | 	 (struct cmsghdr *)(mhdr)->msg_control : \ | ||
| 641 | 	 (struct cmsghdr *)0L) | ||
| 642 | |||
| 643 | |||
| 644 | /* | ||
| 645 | * Given pointer to struct cmsghdr, return pointer to next cmsghdr | ||
| 646 | * RFC 2292 says that CMSG_NXTHDR(mhdr, NULL) is equivalent to CMSG_FIRSTHDR(mhdr) | ||
| 647 | */ | ||
| 648 | #define CMSG_NXTHDR(mhdr, cmsg) \ | ||
| 649 | 	((char *)(cmsg) == (char *)0L ? CMSG_FIRSTHDR(mhdr) : \ | ||
| 650 | 	 ((((unsigned char *)(cmsg) + \ | ||
| 651 | 	 __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len) + \ | ||
| 652 | 	 __DARWIN_ALIGN32(sizeof(struct cmsghdr))) > \ | ||
| 653 | 	 ((unsigned char *)(mhdr)->msg_control + \ | ||
| 654 | 	 (mhdr)->msg_controllen)) ? \ | ||
| 655 | 	 (struct cmsghdr *)0L /* NULL */ : \ | ||
| 656 | 	 (struct cmsghdr *)(void *)((unsigned char *)(cmsg) + \ | ||
| 657 | 	 __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len)))) | ||
| 658 | |||
| 659 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 660 | /* RFC 2292 additions */ | ||
| 661 | #define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l)) | ||
| 662 | #define CMSG_LEN(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l)) | ||
| 663 | |||
| 664 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 665 | |||
| 666 | /* "Socket"-level control message types: */ | ||
| 667 | #define SCM_RIGHTS 0x01 /* access rights (array of int) */ | ||
| 668 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 669 | #define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ | ||
| 670 | #define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ | ||
| 671 | #define SCM_TIMESTAMP_MONOTONIC 0x04 /* timestamp (uint64_t) */ | ||
| 672 | |||
| 673 | |||
| 674 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 675 | |||
| 676 | /* | ||
| 677 | * howto arguments for shutdown(2), specified by Posix.1g. | ||
| 678 | */ | ||
| 679 | #define SHUT_RD 0 /* shut down the reading side */ | ||
| 680 | #define SHUT_WR 1 /* shut down the writing side */ | ||
| 681 | #define SHUT_RDWR 2 /* shut down both sides */ | ||
| 682 | |||
| 683 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 684 | /* | ||
| 685 | * sendfile(2) header/trailer struct | ||
| 686 | */ | ||
| 687 | struct sf_hdtr { | ||
| 688 | 	struct iovec *headers; /* pointer to an array of header struct iovec's */ | ||
| 689 | 	int hdr_cnt; /* number of header iovec's */ | ||
| 690 | 	struct iovec *trailers; /* pointer to an array of trailer struct iovec's */ | ||
| 691 | 	int trl_cnt; /* number of trailer iovec's */ | ||
| 692 | }; | ||
| 693 | |||
| 694 | |||
| 695 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 696 | |||
| 697 | |||
| 698 | __BEGIN_DECLS | ||
| 699 | |||
| 700 | int accept(int, struct sockaddr * __restrict, socklen_t * __restrict) | ||
| 701 | __DARWIN_ALIAS_C(accept); | ||
| 702 | int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind); | ||
| 703 | int connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(connect); | ||
| 704 | int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict) | ||
| 705 | __DARWIN_ALIAS(getpeername); | ||
| 706 | int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict) | ||
| 707 | __DARWIN_ALIAS(getsockname); | ||
| 708 | int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); | ||
| 709 | int listen(int, int) __DARWIN_ALIAS(listen); | ||
| 710 | ssize_t recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv); | ||
| 711 | ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, | ||
| 712 | socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom); | ||
| 713 | ssize_t recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg); | ||
| 714 | ssize_t send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send); | ||
| 715 | ssize_t sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg); | ||
| 716 | ssize_t sendto(int, const void *, size_t, | ||
| 717 | int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto); | ||
| 718 | int setsockopt(int, int, int, const void *, socklen_t); | ||
| 719 | int shutdown(int, int); | ||
| 720 | int sockatmark(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 721 | int socket(int, int, int); | ||
| 722 | int socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair); | ||
| 723 | |||
| 724 | #if !defined(_POSIX_C_SOURCE) | ||
| 725 | int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int); | ||
| 726 | #endif /* !_POSIX_C_SOURCE */ | ||
| 727 | |||
| 728 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 729 | void pfctlinput(int, struct sockaddr *); | ||
| 730 | |||
| 731 | __API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0)) | ||
| 732 | int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned int, | ||
| 733 | const struct iovec *, unsigned int, size_t *, sae_connid_t *); | ||
| 734 | |||
| 735 | __API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0)) | ||
| 736 | int disconnectx(int, sae_associd_t, sae_connid_t); | ||
| 737 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 738 | __END_DECLS | ||
| 739 | |||
| 740 | |||
| 741 | #endif /* !_SYS_SOCKET_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/spawn.h created+79| ... | @@ -0,0 +1,79 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2006-2020 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * [SPN] Support for _POSIX_SPAWN | ||
| 31 | * | ||
| 32 | * This header contains information that is shared between the user space | ||
| 33 | * and kernel versions of the posix_spawn() code. Shared elements are all | ||
| 34 | * manifest constants, at the current time. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _SYS_SPAWN_H_ | ||
| 38 | #define _SYS_SPAWN_H_ | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Possible bit values which may be OR'ed together and provided as the second | ||
| 42 | * parameter to posix_spawnattr_setflags() or implicit returned in the value of | ||
| 43 | * the second parameter to posix_spawnattr_getflags(). | ||
| 44 | */ | ||
| 45 | #define POSIX_SPAWN_RESETIDS 0x0001 /* [SPN] R[UG]ID not E[UG]ID */ | ||
| 46 | #define POSIX_SPAWN_SETPGROUP 0x0002 /* [SPN] set non-parent PGID */ | ||
| 47 | #define POSIX_SPAWN_SETSIGDEF 0x0004 /* [SPN] reset sigset default */ | ||
| 48 | #define POSIX_SPAWN_SETSIGMASK 0x0008 /* [SPN] set signal mask */ | ||
| 49 | |||
| 50 | #if 0 /* _POSIX_PRIORITY_SCHEDULING [PS] : not supported */ | ||
| 51 | #define POSIX_SPAWN_SETSCHEDPARAM 0x0010 | ||
| 52 | #define POSIX_SPAWN_SETSCHEDULER 0x0020 | ||
| 53 | #endif /* 0 */ | ||
| 54 | |||
| 55 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 56 | /* | ||
| 57 | * Darwin-specific flags | ||
| 58 | */ | ||
| 59 | #define POSIX_SPAWN_SETEXEC 0x0040 | ||
| 60 | #define POSIX_SPAWN_START_SUSPENDED 0x0080 | ||
| 61 | #define POSIX_SPAWN_SETSID 0x0400 | ||
| 62 | #define POSIX_SPAWN_CLOEXEC_DEFAULT 0x4000 | ||
| 63 | |||
| 64 | #define _POSIX_SPAWN_RESLIDE 0x0800 | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Possible values to be set for the process control actions on resource starvation. | ||
| 68 | * POSIX_SPAWN_PCONTROL_THROTTLE indicates that the process is to be throttled on starvation. | ||
| 69 | * POSIX_SPAWN_PCONTROL_SUSPEND indicates that the process is to be suspended on starvation. | ||
| 70 | * POSIX_SPAWN_PCONTROL_KILL indicates that the process is to be terminated on starvation. | ||
| 71 | */ | ||
| 72 | #define POSIX_SPAWN_PCONTROL_NONE 0x0000 | ||
| 73 | #define POSIX_SPAWN_PCONTROL_THROTTLE 0x0001 | ||
| 74 | #define POSIX_SPAWN_PCONTROL_SUSPEND 0x0002 | ||
| 75 | #define POSIX_SPAWN_PCONTROL_KILL 0x0003 | ||
| 76 | |||
| 77 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 78 | |||
| 79 | #endif /* _SYS_SPAWN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/stat.h created+432| ... | @@ -0,0 +1,432 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2014 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1989, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | *	This product includes software developed by the University of | ||
| 49 | *	California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)stat.h	8.9 (Berkeley) 8/17/94 | ||
| 67 | */ | ||
| 68 | |||
| 69 | |||
| 70 | #ifndef _SYS_STAT_H_ | ||
| 71 | #define _SYS_STAT_H_ | ||
| 72 | |||
| 73 | #include <sys/_types.h> | ||
| 74 | #include <sys/cdefs.h> | ||
| 75 | #include <Availability.h> | ||
| 76 | |||
| 77 | /* [XSI] The timespec structure may be defined as described in <time.h> */ | ||
| 78 | #include <sys/_types/_timespec.h> | ||
| 79 | |||
| 80 | /* | ||
| 81 | * [XSI] The blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, uid_t, | ||
| 82 | * gid_t, off_t, and time_t types shall be defined as described in | ||
| 83 | * <sys/types.h>. | ||
| 84 | */ | ||
| 85 | #include <sys/_types/_blkcnt_t.h> | ||
| 86 | #include <sys/_types/_blksize_t.h> | ||
| 87 | #include <sys/_types/_dev_t.h> /* device number */ | ||
| 88 | #include <sys/_types/_ino_t.h> | ||
| 89 | |||
| 90 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 91 | #include <sys/_types/_ino64_t.h> | ||
| 92 | #endif /* !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) */ | ||
| 93 | |||
| 94 | #include <sys/_types/_mode_t.h> | ||
| 95 | #include <sys/_types/_nlink_t.h> | ||
| 96 | #include <sys/_types/_uid_t.h> | ||
| 97 | #include <sys/_types/_gid_t.h> | ||
| 98 | #include <sys/_types/_off_t.h> | ||
| 99 | #include <sys/_types/_time_t.h> | ||
| 100 | |||
| 101 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 102 | /* | ||
| 103 | * XXX So deprecated, it would make your head spin | ||
| 104 | * | ||
| 105 | * The old stat structure. In fact, this is not used by the kernel at all, | ||
| 106 | * and should not be used by user space, and should be removed from this | ||
| 107 | * header file entirely (along with the unused cvtstat() prototype in | ||
| 108 | * vnode_internal.h). | ||
| 109 | */ | ||
| 110 | struct ostat { | ||
| 111 | 	__uint16_t st_dev; /* inode's device */ | ||
| 112 | 	ino_t st_ino; /* inode's number */ | ||
| 113 | 	mode_t st_mode; /* inode protection mode */ | ||
| 114 | 	nlink_t st_nlink; /* number of hard links */ | ||
| 115 | 	__uint16_t st_uid; /* user ID of the file's owner */ | ||
| 116 | 	__uint16_t st_gid; /* group ID of the file's group */ | ||
| 117 | 	__uint16_t st_rdev; /* device type */ | ||
| 118 | 	__int32_t st_size; /* file size, in bytes */ | ||
| 119 | 	struct timespec st_atimespec; /* time of last access */ | ||
| 120 | 	struct timespec st_mtimespec; /* time of last data modification */ | ||
| 121 | 	struct timespec st_ctimespec; /* time of last file status change */ | ||
| 122 | 	__int32_t st_blksize; /* optimal blocksize for I/O */ | ||
| 123 | 	__int32_t st_blocks; /* blocks allocated for file */ | ||
| 124 | 	__uint32_t st_flags; /* user defined flags for file */ | ||
| 125 | 	__uint32_t st_gen; /* file generation number */ | ||
| 126 | }; | ||
| 127 | |||
| 128 | #define __DARWIN_STRUCT_STAT64_TIMES \ | ||
| 129 | 	struct timespec st_atimespec; /* time of last access */ \ | ||
| 130 | 	struct timespec st_mtimespec; /* time of last data modification */ \ | ||
| 131 | 	struct timespec st_ctimespec; /* time of last status change */ \ | ||
| 132 | 	struct timespec st_birthtimespec; /* time of file creation(birth) */ | ||
| 133 | |||
| 134 | #else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 135 | |||
| 136 | #define __DARWIN_STRUCT_STAT64_TIMES \ | ||
| 137 | 	time_t		st_atime; /* [XSI] Time of last access */ \ | ||
| 138 | 	long		st_atimensec; /* nsec of last access */ \ | ||
| 139 | 	time_t		st_mtime; /* [XSI] Last data modification time */ \ | ||
| 140 | 	long		st_mtimensec; /* last data modification nsec */ \ | ||
| 141 | 	time_t		st_ctime; /* [XSI] Time of last status change */ \ | ||
| 142 | 	long		st_ctimensec; /* nsec of last status change */ \ | ||
| 143 | 	time_t		st_birthtime; /* File creation time(birth) */ \ | ||
| 144 | 	long		st_birthtimensec; /* nsec of File creation time */ | ||
| 145 | |||
| 146 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 147 | |||
| 148 | /* | ||
| 149 | * This structure is used as the second parameter to the fstat64(), | ||
| 150 | * lstat64(), and stat64() functions, and for struct stat when | ||
| 151 | * __DARWIN_64_BIT_INO_T is set. __DARWIN_STRUCT_STAT64 is defined | ||
| 152 | * above, depending on whether we use struct timespec or the direct | ||
| 153 | * components. | ||
| 154 | * | ||
| 155 | * This is simillar to stat except for 64bit inode number | ||
| 156 | * number instead of 32bit ino_t and the addition of create(birth) time. | ||
| 157 | */ | ||
| 158 | #define __DARWIN_STRUCT_STAT64 { \ | ||
| 159 | 	dev_t		st_dev; /* [XSI] ID of device containing file */ \ | ||
| 160 | 	mode_t		st_mode; /* [XSI] Mode of file (see below) */ \ | ||
| 161 | 	nlink_t		st_nlink; /* [XSI] Number of hard links */ \ | ||
| 162 | 	__darwin_ino64_t st_ino; /* [XSI] File serial number */ \ | ||
| 163 | 	uid_t		st_uid; /* [XSI] User ID of the file */ \ | ||
| 164 | 	gid_t		st_gid; /* [XSI] Group ID of the file */ \ | ||
| 165 | 	dev_t		st_rdev; /* [XSI] Device ID */ \ | ||
| 166 | 	__DARWIN_STRUCT_STAT64_TIMES \ | ||
| 167 | 	off_t		st_size; /* [XSI] file size, in bytes */ \ | ||
| 168 | 	blkcnt_t	st_blocks; /* [XSI] blocks allocated for file */ \ | ||
| 169 | 	blksize_t	st_blksize; /* [XSI] optimal blocksize for I/O */ \ | ||
| 170 | 	__uint32_t	st_flags; /* user defined flags for file */ \ | ||
| 171 | 	__uint32_t	st_gen; /* file generation number */ \ | ||
| 172 | 	__int32_t	st_lspare; /* RESERVED: DO NOT USE! */ \ | ||
| 173 | 	__int64_t	st_qspare[2]; /* RESERVED: DO NOT USE! */ \ | ||
| 174 | } | ||
| 175 | |||
| 176 | /* | ||
| 177 | * [XSI] This structure is used as the second parameter to the fstat(), | ||
| 178 | * lstat(), and stat() functions. | ||
| 179 | */ | ||
| 180 | #if __DARWIN_64_BIT_INO_T | ||
| 181 | |||
| 182 | struct stat __DARWIN_STRUCT_STAT64; | ||
| 183 | |||
| 184 | #else /* !__DARWIN_64_BIT_INO_T */ | ||
| 185 | |||
| 186 | struct stat { | ||
| 187 | 	dev_t st_dev; /* [XSI] ID of device containing file */ | ||
| 188 | 	ino_t st_ino; /* [XSI] File serial number */ | ||
| 189 | 	mode_t st_mode; /* [XSI] Mode of file (see below) */ | ||
| 190 | 	nlink_t st_nlink; /* [XSI] Number of hard links */ | ||
| 191 | 	uid_t st_uid; /* [XSI] User ID of the file */ | ||
| 192 | 	gid_t st_gid; /* [XSI] Group ID of the file */ | ||
| 193 | 	dev_t st_rdev; /* [XSI] Device ID */ | ||
| 194 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 195 | 	struct timespec st_atimespec; /* time of last access */ | ||
| 196 | 	struct timespec st_mtimespec; /* time of last data modification */ | ||
| 197 | 	struct timespec st_ctimespec; /* time of last status change */ | ||
| 198 | #else | ||
| 199 | 	time_t st_atime; /* [XSI] Time of last access */ | ||
| 200 | 	long st_atimensec; /* nsec of last access */ | ||
| 201 | 	time_t st_mtime; /* [XSI] Last data modification time */ | ||
| 202 | 	long st_mtimensec; /* last data modification nsec */ | ||
| 203 | 	time_t st_ctime; /* [XSI] Time of last status change */ | ||
| 204 | 	long st_ctimensec; /* nsec of last status change */ | ||
| 205 | #endif | ||
| 206 | 	off_t st_size; /* [XSI] file size, in bytes */ | ||
| 207 | 	blkcnt_t st_blocks; /* [XSI] blocks allocated for file */ | ||
| 208 | 	blksize_t st_blksize; /* [XSI] optimal blocksize for I/O */ | ||
| 209 | 	__uint32_t st_flags; /* user defined flags for file */ | ||
| 210 | 	__uint32_t st_gen; /* file generation number */ | ||
| 211 | 	__int32_t st_lspare; /* RESERVED: DO NOT USE! */ | ||
| 212 | 	__int64_t st_qspare[2]; /* RESERVED: DO NOT USE! */ | ||
| 213 | }; | ||
| 214 | |||
| 215 | #endif /* __DARWIN_64_BIT_INO_T */ | ||
| 216 | |||
| 217 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 218 | |||
| 219 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 220 | |||
| 221 | struct stat64 __DARWIN_STRUCT_STAT64; | ||
| 222 | |||
| 223 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 224 | |||
| 225 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 226 | |||
| 227 | |||
| 228 | |||
| 229 | |||
| 230 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 231 | #define st_atime st_atimespec.tv_sec | ||
| 232 | #define st_mtime st_mtimespec.tv_sec | ||
| 233 | #define st_ctime st_ctimespec.tv_sec | ||
| 234 | #define st_birthtime st_birthtimespec.tv_sec | ||
| 235 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 236 | |||
| 237 | /* | ||
| 238 | * [XSI] The following are symbolic names for the values of type mode_t. They | ||
| 239 | * are bitmap values. | ||
| 240 | */ | ||
| 241 | #include <sys/_types/_s_ifmt.h> | ||
| 242 | |||
| 243 | /* | ||
| 244 | * [XSI] The following macros shall be provided to test whether a file is | ||
| 245 | * of the specified type. The value m supplied to the macros is the value | ||
| 246 | * of st_mode from a stat structure. The macro shall evaluate to a non-zero | ||
| 247 | * value if the test is true; 0 if the test is false. | ||
| 248 | */ | ||
| 249 | #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* block special */ | ||
| 250 | #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* char special */ | ||
| 251 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* directory */ | ||
| 252 | #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo or socket */ | ||
| 253 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* regular file */ | ||
| 254 | #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* symbolic link */ | ||
| 255 | #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) /* socket */ | ||
| 256 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 257 | #define S_ISWHT(m) (((m) & S_IFMT) == S_IFWHT) /* OBSOLETE: whiteout */ | ||
| 258 | #endif | ||
| 259 | |||
| 260 | /* | ||
| 261 | * [XSI] The implementation may implement message queues, semaphores, or | ||
| 262 | * shared memory objects as distinct file types. The following macros | ||
| 263 | * shall be provided to test whether a file is of the specified type. | ||
| 264 | * The value of the buf argument supplied to the macros is a pointer to | ||
| 265 | * a stat structure. The macro shall evaluate to a non-zero value if | ||
| 266 | * the specified object is implemented as a distinct file type and the | ||
| 267 | * specified file type is contained in the stat structure referenced by | ||
| 268 | * buf. Otherwise, the macro shall evaluate to zero. | ||
| 269 | * | ||
| 270 | * NOTE:	The current implementation does not do this, although | ||
| 271 | *		this may change in future revisions, and co currently only | ||
| 272 | *		provides these macros to ensure source compatability with | ||
| 273 | *		implementations which do. | ||
| 274 | */ | ||
| 275 | #define S_TYPEISMQ(buf) (0) /* Test for a message queue */ | ||
| 276 | #define S_TYPEISSEM(buf) (0) /* Test for a semaphore */ | ||
| 277 | #define S_TYPEISSHM(buf) (0) /* Test for a shared memory object */ | ||
| 278 | |||
| 279 | /* | ||
| 280 | * [TYM] The implementation may implement typed memory objects as distinct | ||
| 281 | * file types, and the following macro shall test whether a file is of the | ||
| 282 | * specified type. The value of the buf argument supplied to the macros is | ||
| 283 | * a pointer to a stat structure. The macro shall evaluate to a non-zero | ||
| 284 | * value if the specified object is implemented as a distinct file type and | ||
| 285 | * the specified file type is contained in the stat structure referenced by | ||
| 286 | * buf. Otherwise, the macro shall evaluate to zero. | ||
| 287 | * | ||
| 288 | * NOTE:	The current implementation does not do this, although | ||
| 289 | *		this may change in future revisions, and co currently only | ||
| 290 | *		provides this macro to ensure source compatability with | ||
| 291 | *		implementations which do. | ||
| 292 | */ | ||
| 293 | #define S_TYPEISTMO(buf) (0) /* Test for a typed memory object */ | ||
| 294 | |||
| 295 | |||
| 296 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 297 | #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ | ||
| 298 | /* 7777 */ | ||
| 299 | #define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) | ||
| 300 | /* 0666 */ | ||
| 301 | #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) | ||
| 302 | |||
| 303 | #define S_BLKSIZE 512 /* block size used in the stat struct */ | ||
| 304 | |||
| 305 | /* | ||
| 306 | * Definitions of flags stored in file flags word. | ||
| 307 | * | ||
| 308 | * Super-user and owner changeable flags. | ||
| 309 | */ | ||
| 310 | #define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */ | ||
| 311 | #define UF_NODUMP 0x00000001 /* do not dump file */ | ||
| 312 | #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ | ||
| 313 | #define UF_APPEND 0x00000004 /* writes to file may only append */ | ||
| 314 | #define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ | ||
| 315 | /* | ||
| 316 | * The following bit is reserved for FreeBSD. It is not implemented | ||
| 317 | * in Mac OS X. | ||
| 318 | */ | ||
| 319 | /* #define UF_NOUNLINK	0x00000010 */	/* file may not be removed or renamed */ | ||
| 320 | #define UF_COMPRESSED 0x00000020 /* file is compressed (some file-systems) */ | ||
| 321 | |||
| 322 | /* UF_TRACKED is used for dealing with document IDs. We no longer issue | ||
| 323 | * notifications for deletes or renames for files which have UF_TRACKED set. */ | ||
| 324 | #define UF_TRACKED 0x00000040 | ||
| 325 | |||
| 326 | #define UF_DATAVAULT 0x00000080 /* entitlement required for reading */ | ||
| 327 | /* and writing */ | ||
| 328 | |||
| 329 | /* Bits 0x0100 through 0x4000 are currently undefined. */ | ||
| 330 | #define UF_HIDDEN 0x00008000 /* hint that this item should not be */ | ||
| 331 | /* displayed in a GUI */ | ||
| 332 | /* | ||
| 333 | * Super-user changeable flags. | ||
| 334 | */ | ||
| 335 | #define SF_SUPPORTED 0x009f0000 /* mask of superuser supported flags */ | ||
| 336 | #define SF_SETTABLE 0x3fff0000 /* mask of superuser changeable flags */ | ||
| 337 | #define SF_SYNTHETIC 0xc0000000 /* mask of system read-only synthetic flags */ | ||
| 338 | #define SF_ARCHIVED 0x00010000 /* file is archived */ | ||
| 339 | #define SF_IMMUTABLE 0x00020000 /* file may not be changed */ | ||
| 340 | #define SF_APPEND 0x00040000 /* writes to file may only append */ | ||
| 341 | #define SF_RESTRICTED 0x00080000 /* entitlement required for writing */ | ||
| 342 | #define SF_NOUNLINK 0x00100000 /* Item may not be removed, renamed or mounted on */ | ||
| 343 | |||
| 344 | /* | ||
| 345 | * The following two bits are reserved for FreeBSD. They are not | ||
| 346 | * implemented in Mac OS X. | ||
| 347 | */ | ||
| 348 | /* #define SF_SNAPSHOT	0x00200000 */	/* snapshot inode */ | ||
| 349 | /* NOTE: There is no SF_HIDDEN bit. */ | ||
| 350 | |||
| 351 | #define SF_FIRMLINK 0x00800000 /* file is a firmlink */ | ||
| 352 | |||
| 353 | /* | ||
| 354 | * Synthetic flags. | ||
| 355 | * | ||
| 356 | * These are read-only. We keep them out of SF_SUPPORTED so that | ||
| 357 | * attempts to set them will fail. | ||
| 358 | */ | ||
| 359 | #define SF_DATALESS 0x40000000 /* file is dataless object */ | ||
| 360 | |||
| 361 | |||
| 362 | #endif | ||
| 363 | |||
| 364 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 365 | /* | ||
| 366 | * Extended flags ("EF") returned by ATTR_CMNEXT_EXT_FLAGS from getattrlist/getattrlistbulk | ||
| 367 | */ | ||
| 368 | #define EF_MAY_SHARE_BLOCKS 0x00000001 /* file may share blocks with another file */ | ||
| 369 | #define EF_NO_XATTRS 0x00000002 /* file has no xattrs at all */ | ||
| 370 | #define EF_IS_SYNC_ROOT 0x00000004 /* file is a sync root for iCloud */ | ||
| 371 | #define EF_IS_PURGEABLE 0x00000008 /* file is purgeable */ | ||
| 372 | #define EF_IS_SPARSE 0x00000010 /* file has at least one sparse region */ | ||
| 373 | #define EF_IS_SYNTHETIC 0x00000020 /* a synthetic directory/symlink */ | ||
| 374 | #endif | ||
| 375 | |||
| 376 | |||
| 377 | |||
| 378 | __BEGIN_DECLS | ||
| 379 | /* [XSI] */ | ||
| 380 | int chmod(const char *, mode_t) __DARWIN_ALIAS(chmod); | ||
| 381 | int fchmod(int, mode_t) __DARWIN_ALIAS(fchmod); | ||
| 382 | int fstat(int, struct stat *) __DARWIN_INODE64(fstat); | ||
| 383 | int lstat(const char *, struct stat *) __DARWIN_INODE64(lstat); | ||
| 384 | int mkdir(const char *, mode_t); | ||
| 385 | int mkfifo(const char *, mode_t); | ||
| 386 | int stat(const char *, struct stat *) __DARWIN_INODE64(stat); | ||
| 387 | int mknod(const char *, mode_t, dev_t); | ||
| 388 | mode_t umask(mode_t); | ||
| 389 | |||
| 390 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 391 | int fchmodat(int, const char *, mode_t, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 392 | int fstatat(int, const char *, struct stat *, int) __DARWIN_INODE64(fstatat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 393 | int mkdirat(int, const char *, mode_t) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 394 | |||
| 395 | #define UTIME_NOW -1 | ||
| 396 | #define UTIME_OMIT -2 | ||
| 397 | |||
| 398 | int futimens(int __fd, const struct timespec __times[2]) __API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)); | ||
| 399 | int utimensat(int __fd, const char *__path, const struct timespec __times[2], | ||
| 400 | int __flag) __API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)); | ||
| 401 | #endif | ||
| 402 | |||
| 403 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 404 | |||
| 405 | #include <sys/_types/_filesec_t.h> | ||
| 406 | |||
| 407 | int chflags(const char *, __uint32_t); | ||
| 408 | int chmodx_np(const char *, filesec_t); | ||
| 409 | int fchflags(int, __uint32_t); | ||
| 410 | int fchmodx_np(int, filesec_t); | ||
| 411 | int fstatx_np(int, struct stat *, filesec_t) __DARWIN_INODE64(fstatx_np); | ||
| 412 | int lchflags(const char *, __uint32_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 413 | int lchmod(const char *, mode_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 414 | int lstatx_np(const char *, struct stat *, filesec_t) __DARWIN_INODE64(lstatx_np); | ||
| 415 | int mkdirx_np(const char *, filesec_t); | ||
| 416 | int mkfifox_np(const char *, filesec_t); | ||
| 417 | int statx_np(const char *, struct stat *, filesec_t) __DARWIN_INODE64(statx_np); | ||
| 418 | int umaskx_np(filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 419 | |||
| 420 | #if !__DARWIN_ONLY_64_BIT_INO_T | ||
| 421 | /* The following deprecated routines are simillar to stat and friends except provide struct stat64 instead of struct stat */ | ||
| 422 | int fstatx64_np(int, struct stat64 *, filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 423 | int lstatx64_np(const char *, struct stat64 *, filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 424 | int statx64_np(const char *, struct stat64 *, filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 425 | int fstat64(int, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 426 | int lstat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 427 | int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA); | ||
| 428 | #endif /* !__DARWIN_ONLY_64_BIT_INO_T */ | ||
| 429 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 430 | |||
| 431 | __END_DECLS | ||
| 432 | #endif /* !_SYS_STAT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/statvfs.h created+60| ... | @@ -0,0 +1,60 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | * sys/statvfs.h | ||
| 26 | */ | ||
| 27 | #ifndef _SYS_STATVFS_H_ | ||
| 28 | #define	_SYS_STATVFS_H_ | ||
| 29 | |||
| 30 | #include <sys/_types.h> | ||
| 31 | #include <sys/cdefs.h> | ||
| 32 | |||
| 33 | #include <sys/_types/_fsblkcnt_t.h> | ||
| 34 | #include <sys/_types/_fsfilcnt_t.h> | ||
| 35 | |||
| 36 | /* Following structure is used as a statvfs/fstatvfs function parameter */ | ||
| 37 | struct statvfs { | ||
| 38 | 	unsigned long	f_bsize;	/* File system block size */ | ||
| 39 | 	unsigned long	f_frsize;	/* Fundamental file system block size */ | ||
| 40 | 	fsblkcnt_t	f_blocks;	/* Blocks on FS in units of f_frsize */ | ||
| 41 | 	fsblkcnt_t	f_bfree;	/* Free blocks */ | ||
| 42 | 	fsblkcnt_t	f_bavail;	/* Blocks available to non-root */ | ||
| 43 | 	fsfilcnt_t	f_files;	/* Total inodes */ | ||
| 44 | 	fsfilcnt_t	f_ffree;	/* Free inodes */ | ||
| 45 | 	fsfilcnt_t	f_favail;	/* Free inodes for non-root */ | ||
| 46 | 	unsigned long	f_fsid;		/* Filesystem ID */ | ||
| 47 | 	unsigned long	f_flag;		/* Bit mask of values */ | ||
| 48 | 	unsigned long	f_namemax;	/* Max file name length */ | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* Defined bits for f_flag field value */ | ||
| 52 | #define	ST_RDONLY	0x00000001	/* Read-only file system */ | ||
| 53 | #define	ST_NOSUID	0x00000002	/* Does not honor setuid/setgid */ | ||
| 54 | |||
| 55 | __BEGIN_DECLS | ||
| 56 | int fstatvfs(int, struct statvfs *); | ||
| 57 | int statvfs(const char * __restrict, struct statvfs * __restrict); | ||
| 58 | __END_DECLS | ||
| 59 | |||
| 60 | #endif	/* _SYS_STATVFS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/sysctl.h created+779| ... | @@ -0,0 +1,779 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2019 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1989, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * This code is derived from software contributed to Berkeley by | ||
| 34 | * Mike Karels at Berkeley Software Design, Inc. | ||
| 35 | * | ||
| 36 | * Redistribution and use in source and binary forms, with or without | ||
| 37 | * modification, are permitted provided that the following conditions | ||
| 38 | * are met: | ||
| 39 | * 1. Redistributions of source code must retain the above copyright | ||
| 40 | * notice, this list of conditions and the following disclaimer. | ||
| 41 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer in the | ||
| 43 | * documentation and/or other materials provided with the distribution. | ||
| 44 | * 3. All advertising materials mentioning features or use of this software | ||
| 45 | * must display the following acknowledgement: | ||
| 46 | *	This product includes software developed by the University of | ||
| 47 | *	California, Berkeley and its contributors. | ||
| 48 | * 4. Neither the name of the University nor the names of its contributors | ||
| 49 | * may be used to endorse or promote products derived from this software | ||
| 50 | * without specific prior written permission. | ||
| 51 | * | ||
| 52 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 53 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 55 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 58 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 60 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 61 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 62 | * SUCH DAMAGE. | ||
| 63 | * | ||
| 64 | *	@(#)sysctl.h	8.1 (Berkeley) 6/2/93 | ||
| 65 | */ | ||
| 66 | /* | ||
| 67 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 68 | * support for mandatory and extensible security protections. This notice | ||
| 69 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 70 | * Version 2.0. | ||
| 71 | */ | ||
| 72 | |||
| 73 | #ifndef _SYS_SYSCTL_H_ | ||
| 74 | #define _SYS_SYSCTL_H_ | ||
| 75 | |||
| 76 | /* | ||
| 77 | * These are for the eproc structure defined below. | ||
| 78 | */ | ||
| 79 | #include <sys/cdefs.h> | ||
| 80 | |||
| 81 | #include <sys/appleapiopts.h> | ||
| 82 | #include <sys/time.h> | ||
| 83 | #include <sys/ucred.h> | ||
| 84 | #include <sys/proc.h> | ||
| 85 | #include <sys/vm.h> | ||
| 86 | |||
| 87 | |||
| 88 | /* | ||
| 89 | * Definitions for sysctl call. The sysctl call uses a hierarchical name | ||
| 90 | * for objects that can be examined or modified. The name is expressed as | ||
| 91 | * a sequence of integers. Like a file path name, the meaning of each | ||
| 92 | * component depends on its place in the hierarchy. The top-level and kern | ||
| 93 | * identifiers are defined here, and other identifiers are defined in the | ||
| 94 | * respective subsystem header files. | ||
| 95 | */ | ||
| 96 | |||
| 97 | #define CTL_MAXNAME 12 /* largest number of components supported */ | ||
| 98 | |||
| 99 | /* | ||
| 100 | * Each subsystem defined by sysctl defines a list of variables | ||
| 101 | * for that subsystem. Each name is either a node with further | ||
| 102 | * levels defined below it, or it is a leaf of some particular | ||
| 103 | * type given below. Each sysctl level defines a set of name/type | ||
| 104 | * pairs to be used by sysctl(1) in manipulating the subsystem. | ||
| 105 | * | ||
| 106 | * When declaring new sysctl names, use the CTLFLAG_LOCKED flag in the | ||
| 107 | * type to indicate that all necessary locking will be handled | ||
| 108 | * within the sysctl. | ||
| 109 | * | ||
| 110 | * Any sysctl defined without CTLFLAG_LOCKED is considered legacy | ||
| 111 | * and will be protected by a global mutex. | ||
| 112 | * | ||
| 113 | * Note:	This is not optimal, so it is best to handle locking | ||
| 114 | *		yourself, if you are able to do so. A simple design | ||
| 115 | *		pattern for use to avoid in a single function known | ||
| 116 | *		to potentially be in the paging path ot doing a DMA | ||
| 117 | *		to physical memory in a user space process is: | ||
| 118 | * | ||
| 119 | *			lock | ||
| 120 | *			perform operation vs. local buffer | ||
| 121 | *			unlock | ||
| 122 | *			SYSCTL_OUT(rey, local buffer, length) | ||
| 123 | * | ||
| 124 | *		...this assumes you are not using a deep call graph | ||
| 125 | *		or are unable to pass a local buffer address as a | ||
| 126 | *		parameter into your deep call graph. | ||
| 127 | * | ||
| 128 | *		Note that very large user buffers can fail the wire | ||
| 129 | *		if to do so would require more physical pages than | ||
| 130 | *		are available (the caller will get an ENOMEM error, | ||
| 131 | *		see sysctl_mem_hold() for details). | ||
| 132 | */ | ||
| 133 | struct ctlname { | ||
| 134 | 	char *ctl_name; /* subsystem name */ | ||
| 135 | 	int ctl_type; /* type of name */ | ||
| 136 | }; | ||
| 137 | |||
| 138 | #define CTLTYPE 0xf /* Mask for the type */ | ||
| 139 | #define CTLTYPE_NODE 1 /* name is a node */ | ||
| 140 | #define CTLTYPE_INT 2 /* name describes an integer */ | ||
| 141 | #define CTLTYPE_STRING 3 /* name describes a string */ | ||
| 142 | #define CTLTYPE_QUAD 4 /* name describes a 64-bit number */ | ||
| 143 | #define CTLTYPE_OPAQUE 5 /* name describes a structure */ | ||
| 144 | #define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */ | ||
| 145 | |||
| 146 | #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ | ||
| 147 | #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ | ||
| 148 | #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) | ||
| 149 | #define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */ | ||
| 150 | #define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ | ||
| 151 | #define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ | ||
| 152 | #define CTLFLAG_MASKED 0x04000000 /* deprecated variable, do not display */ | ||
| 153 | #define CTLFLAG_NOAUTO 0x02000000 /* do not auto-register */ | ||
| 154 | #define CTLFLAG_KERN 0x01000000 /* valid inside the kernel */ | ||
| 155 | #define CTLFLAG_LOCKED 0x00800000 /* node will handle locking itself */ | ||
| 156 | #define CTLFLAG_OID2 0x00400000 /* struct sysctl_oid has version info */ | ||
| 157 | |||
| 158 | /* | ||
| 159 | * USE THIS instead of a hardwired number from the categories below | ||
| 160 | * to get dynamically assigned sysctl entries using the linker-set | ||
| 161 | * technology. This is the way nearly all new sysctl variables should | ||
| 162 | * be implemented. | ||
| 163 | * | ||
| 164 | * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, ""); | ||
| 165 | * | ||
| 166 | * Note that linker set technology will automatically register all nodes | ||
| 167 | * declared like this on kernel initialization, UNLESS they are defined | ||
| 168 | * in I/O-Kit. In this case, you have to call sysctl_register_oid() | ||
| 169 | * manually - just like in a KEXT. | ||
| 170 | */ | ||
| 171 | #define OID_AUTO (-1) | ||
| 172 | #define OID_AUTO_START 100 /* conventional */ | ||
| 173 | |||
| 174 | |||
| 175 | #define SYSCTL_DEF_ENABLED | ||
| 176 | |||
| 177 | #ifdef SYSCTL_DEF_ENABLED | ||
| 178 | /* | ||
| 179 | * Top-level identifiers | ||
| 180 | */ | ||
| 181 | #define CTL_UNSPEC 0 /* unused */ | ||
| 182 | #define CTL_KERN 1 /* "high kernel": proc, limits */ | ||
| 183 | #define CTL_VM 2 /* virtual memory */ | ||
| 184 | #define CTL_VFS 3 /* file system, mount type is next */ | ||
| 185 | #define CTL_NET 4 /* network, see socket.h */ | ||
| 186 | #define CTL_DEBUG 5 /* debugging parameters */ | ||
| 187 | #define CTL_HW 6 /* generic cpu/io */ | ||
| 188 | #define CTL_MACHDEP 7 /* machine dependent */ | ||
| 189 | #define CTL_USER 8 /* user-level */ | ||
| 190 | #define CTL_MAXID 9 /* number of valid top-level ids */ | ||
| 191 | |||
| 192 | #define CTL_NAMES { \ | ||
| 193 | 	{ 0, 0 }, \ | ||
| 194 | 	{ "kern", CTLTYPE_NODE }, \ | ||
| 195 | 	{ "vm", CTLTYPE_NODE }, \ | ||
| 196 | 	{ "vfs", CTLTYPE_NODE }, \ | ||
| 197 | 	{ "net", CTLTYPE_NODE }, \ | ||
| 198 | 	{ "debug", CTLTYPE_NODE }, \ | ||
| 199 | 	{ "hw", CTLTYPE_NODE }, \ | ||
| 200 | 	{ "machdep", CTLTYPE_NODE }, \ | ||
| 201 | 	{ "user", CTLTYPE_NODE }, \ | ||
| 202 | } | ||
| 203 | |||
| 204 | /* | ||
| 205 | * CTL_KERN identifiers | ||
| 206 | */ | ||
| 207 | #define KERN_OSTYPE 1 /* string: system version */ | ||
| 208 | #define KERN_OSRELEASE 2 /* string: system release */ | ||
| 209 | #define KERN_OSREV 3 /* int: system revision */ | ||
| 210 | #define KERN_VERSION 4 /* string: compile time info */ | ||
| 211 | #define KERN_MAXVNODES 5 /* int: max vnodes */ | ||
| 212 | #define KERN_MAXPROC 6 /* int: max processes */ | ||
| 213 | #define KERN_MAXFILES 7 /* int: max open files */ | ||
| 214 | #define KERN_ARGMAX 8 /* int: max arguments to exec */ | ||
| 215 | #define KERN_SECURELVL 9 /* int: system security level */ | ||
| 216 | #define KERN_HOSTNAME 10 /* string: hostname */ | ||
| 217 | #define KERN_HOSTID 11 /* int: host identifier */ | ||
| 218 | #define KERN_CLOCKRATE 12 /* struct: struct clockrate */ | ||
| 219 | #define KERN_VNODE 13 /* struct: vnode structures */ | ||
| 220 | #define KERN_PROC 14 /* struct: process entries */ | ||
| 221 | #define KERN_FILE 15 /* struct: file entries */ | ||
| 222 | #define KERN_PROF 16 /* node: kernel profiling info */ | ||
| 223 | #define KERN_POSIX1 17 /* int: POSIX.1 version */ | ||
| 224 | #define KERN_NGROUPS 18 /* int: # of supplemental group ids */ | ||
| 225 | #define KERN_JOB_CONTROL 19 /* int: is job control available */ | ||
| 226 | #define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */ | ||
| 227 | #define KERN_BOOTTIME 21 /* struct: time kernel was booted */ | ||
| 228 | #define KERN_NISDOMAINNAME 22 /* string: YP domain name */ | ||
| 229 | #define KERN_DOMAINNAME KERN_NISDOMAINNAME | ||
| 230 | #define KERN_MAXPARTITIONS 23 /* int: number of partitions/disk */ | ||
| 231 | #define KERN_KDEBUG 24 /* int: kernel trace points */ | ||
| 232 | #define KERN_UPDATEINTERVAL 25 /* int: update process sleep time */ | ||
| 233 | #define KERN_OSRELDATE 26 /* int: OS release date */ | ||
| 234 | #define KERN_NTP_PLL 27 /* node: NTP PLL control */ | ||
| 235 | #define KERN_BOOTFILE 28 /* string: name of booted kernel */ | ||
| 236 | #define KERN_MAXFILESPERPROC 29 /* int: max open files per proc */ | ||
| 237 | #define KERN_MAXPROCPERUID 30 /* int: max processes per uid */ | ||
| 238 | #define KERN_DUMPDEV 31 /* dev_t: device to dump on */ | ||
| 239 | #define KERN_IPC 32 /* node: anything related to IPC */ | ||
| 240 | #define KERN_DUMMY 33 /* unused */ | ||
| 241 | #define KERN_PS_STRINGS 34 /* int: address of PS_STRINGS */ | ||
| 242 | #define KERN_USRSTACK32 35 /* int: address of USRSTACK */ | ||
| 243 | #define KERN_LOGSIGEXIT 36 /* int: do we log sigexit procs? */ | ||
| 244 | #define KERN_SYMFILE 37 /* string: kernel symbol filename */ | ||
| 245 | #define KERN_PROCARGS 38 | ||
| 246 | /* 39 was KERN_PCSAMPLES... now obsolete */ | ||
| 247 | #define KERN_NETBOOT 40 /* int: are we netbooted? 1=yes,0=no */ | ||
| 248 | /* 41 was KERN_PANICINFO : panic UI information (deprecated) */ | ||
| 249 | #define KERN_SYSV 42 /* node: System V IPC information */ | ||
| 250 | #define KERN_AFFINITY 43 /* xxx */ | ||
| 251 | #define KERN_TRANSLATE 44 /* xxx */ | ||
| 252 | #define KERN_CLASSIC KERN_TRANSLATE /* XXX backwards compat */ | ||
| 253 | #define KERN_EXEC 45 /* xxx */ | ||
| 254 | #define KERN_CLASSICHANDLER KERN_EXEC /* XXX backwards compatibility */ | ||
| 255 | #define KERN_AIOMAX 46 /* int: max aio requests */ | ||
| 256 | #define KERN_AIOPROCMAX 47 /* int: max aio requests per process */ | ||
| 257 | #define KERN_AIOTHREADS 48 /* int: max aio worker threads */ | ||
| 258 | #ifdef __APPLE_API_UNSTABLE | ||
| 259 | #define KERN_PROCARGS2 49 | ||
| 260 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 261 | #define KERN_COREFILE 50 /* string: corefile format string */ | ||
| 262 | #define KERN_COREDUMP 51 /* int: whether to coredump at all */ | ||
| 263 | #define KERN_SUGID_COREDUMP 52 /* int: whether to dump SUGID cores */ | ||
| 264 | #define KERN_PROCDELAYTERM 53 /* int: set/reset current proc for delayed termination during shutdown */ | ||
| 265 | #define KERN_SHREG_PRIVATIZABLE 54 /* int: can shared regions be privatized ? */ | ||
| 266 | /* 55 was KERN_PROC_LOW_PRI_IO... now deprecated */ | ||
| 267 | #define KERN_LOW_PRI_WINDOW 56 /* int: set/reset throttle window - milliseconds */ | ||
| 268 | #define KERN_LOW_PRI_DELAY 57 /* int: set/reset throttle delay - milliseconds */ | ||
| 269 | #define KERN_POSIX 58 /* node: posix tunables */ | ||
| 270 | #define KERN_USRSTACK64 59 /* LP64 user stack query */ | ||
| 271 | #define KERN_NX_PROTECTION 60 /* int: whether no-execute protection is enabled */ | ||
| 272 | #define KERN_TFP 61 /* Task for pid settings */ | ||
| 273 | #define KERN_PROCNAME 62 /* setup process program name(2*MAXCOMLEN) */ | ||
| 274 | #define KERN_THALTSTACK 63 /* for compat with older x86 and does nothing */ | ||
| 275 | #define KERN_SPECULATIVE_READS 64 /* int: whether speculative reads are disabled */ | ||
| 276 | #define KERN_OSVERSION 65 /* for build number i.e. 9A127 */ | ||
| 277 | #define KERN_SAFEBOOT 66 /* are we booted safe? */ | ||
| 278 | /*	67 was KERN_LCTX (login context) */ | ||
| 279 | #define KERN_RAGEVNODE 68 | ||
| 280 | #define KERN_TTY 69 /* node: tty settings */ | ||
| 281 | #define KERN_CHECKOPENEVT 70 /* spi: check the VOPENEVT flag on vnodes at open time */ | ||
| 282 | #define KERN_THREADNAME 71 /* set/get thread name */ | ||
| 283 | #define KERN_MAXID 72 /* number of valid kern ids */ | ||
| 284 | /* | ||
| 285 | * Don't add any more sysctls like this. Instead, use the SYSCTL_*() macros | ||
| 286 | * and OID_AUTO. This will have the added benefit of not having to recompile | ||
| 287 | * sysctl(8) to pick up your changes. | ||
| 288 | */ | ||
| 289 | |||
| 290 | |||
| 291 | #if defined(__LP64__) | ||
| 292 | #define KERN_USRSTACK KERN_USRSTACK64 | ||
| 293 | #else | ||
| 294 | #define KERN_USRSTACK KERN_USRSTACK32 | ||
| 295 | #endif | ||
| 296 | |||
| 297 | |||
| 298 | /* KERN_RAGEVNODE types */ | ||
| 299 | #define KERN_RAGE_PROC 1 | ||
| 300 | #define KERN_RAGE_THREAD 2 | ||
| 301 | #define KERN_UNRAGE_PROC 3 | ||
| 302 | #define KERN_UNRAGE_THREAD 4 | ||
| 303 | |||
| 304 | /* KERN_OPENEVT types */ | ||
| 305 | #define KERN_OPENEVT_PROC 1 | ||
| 306 | #define KERN_UNOPENEVT_PROC 2 | ||
| 307 | |||
| 308 | /* KERN_TFP types */ | ||
| 309 | #define KERN_TFP_POLICY 1 | ||
| 310 | |||
| 311 | /* KERN_TFP_POLICY values . All policies allow task port for self */ | ||
| 312 | #define KERN_TFP_POLICY_DENY 0 /* Deny Mode: None allowed except privileged */ | ||
| 313 | #define KERN_TFP_POLICY_DEFAULT 2 /* Default Mode: related ones allowed and upcall authentication */ | ||
| 314 | |||
| 315 | /* KERN_KDEBUG types */ | ||
| 316 | #define KERN_KDEFLAGS 1 | ||
| 317 | #define KERN_KDDFLAGS 2 | ||
| 318 | #define KERN_KDENABLE 3 | ||
| 319 | #define KERN_KDSETBUF 4 | ||
| 320 | #define KERN_KDGETBUF 5 | ||
| 321 | #define KERN_KDSETUP 6 | ||
| 322 | #define KERN_KDREMOVE 7 | ||
| 323 | #define KERN_KDSETREG 8 | ||
| 324 | #define KERN_KDGETREG 9 | ||
| 325 | #define KERN_KDREADTR 10 | ||
| 326 | #define KERN_KDPIDTR 11 | ||
| 327 | #define KERN_KDTHRMAP 12 | ||
| 328 | /* Don't use 13 as it is overloaded with KERN_VNODE */ | ||
| 329 | #define KERN_KDPIDEX 14 | ||
| 330 | #define KERN_KDSETRTCDEC 15 /* obsolete */ | ||
| 331 | #define KERN_KDGETENTROPY 16 /* obsolete */ | ||
| 332 | #define KERN_KDWRITETR 17 | ||
| 333 | #define KERN_KDWRITEMAP 18 | ||
| 334 | #define KERN_KDTEST 19 | ||
| 335 | /* 20 unused */ | ||
| 336 | #define KERN_KDREADCURTHRMAP 21 | ||
| 337 | #define KERN_KDSET_TYPEFILTER 22 | ||
| 338 | #define KERN_KDBUFWAIT 23 | ||
| 339 | #define KERN_KDCPUMAP 24 | ||
| 340 | /* 25 - 26 unused */ | ||
| 341 | #define KERN_KDWRITEMAP_V3 27 | ||
| 342 | #define KERN_KDWRITETR_V3 28 | ||
| 343 | |||
| 344 | #define CTL_KERN_NAMES { \ | ||
| 345 | 	{ 0, 0 }, \ | ||
| 346 | 	{ "ostype", CTLTYPE_STRING }, \ | ||
| 347 | 	{ "osrelease", CTLTYPE_STRING }, \ | ||
| 348 | 	{ "osrevision", CTLTYPE_INT }, \ | ||
| 349 | 	{ "version", CTLTYPE_STRING }, \ | ||
| 350 | 	{ "maxvnodes", CTLTYPE_INT }, \ | ||
| 351 | 	{ "maxproc", CTLTYPE_INT }, \ | ||
| 352 | 	{ "maxfiles", CTLTYPE_INT }, \ | ||
| 353 | 	{ "argmax", CTLTYPE_INT }, \ | ||
| 354 | 	{ "securelevel", CTLTYPE_INT }, \ | ||
| 355 | 	{ "hostname", CTLTYPE_STRING }, \ | ||
| 356 | 	{ "hostid", CTLTYPE_INT }, \ | ||
| 357 | 	{ "clockrate", CTLTYPE_STRUCT }, \ | ||
| 358 | 	{ "vnode", CTLTYPE_STRUCT }, \ | ||
| 359 | 	{ "proc", CTLTYPE_STRUCT }, \ | ||
| 360 | 	{ "file", CTLTYPE_STRUCT }, \ | ||
| 361 | 	{ "profiling", CTLTYPE_NODE }, \ | ||
| 362 | 	{ "posix1version", CTLTYPE_INT }, \ | ||
| 363 | 	{ "ngroups", CTLTYPE_INT }, \ | ||
| 364 | 	{ "job_control", CTLTYPE_INT }, \ | ||
| 365 | 	{ "saved_ids", CTLTYPE_INT }, \ | ||
| 366 | 	{ "boottime", CTLTYPE_STRUCT }, \ | ||
| 367 | 	{ "nisdomainname", CTLTYPE_STRING }, \ | ||
| 368 | 	{ "maxpartitions", CTLTYPE_INT }, \ | ||
| 369 | 	{ "kdebug", CTLTYPE_INT }, \ | ||
| 370 | 	{ "update", CTLTYPE_INT }, \ | ||
| 371 | 	{ "osreldate", CTLTYPE_INT }, \ | ||
| 372 | 	{ "ntp_pll", CTLTYPE_NODE }, \ | ||
| 373 | 	{ "bootfile", CTLTYPE_STRING }, \ | ||
| 374 | 	{ "maxfilesperproc", CTLTYPE_INT }, \ | ||
| 375 | 	{ "maxprocperuid", CTLTYPE_INT }, \ | ||
| 376 | 	{ "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \ | ||
| 377 | 	{ "ipc", CTLTYPE_NODE }, \ | ||
| 378 | 	{ "dummy", CTLTYPE_INT }, \ | ||
| 379 | 	{ "dummy", CTLTYPE_INT }, \ | ||
| 380 | 	{ "usrstack", CTLTYPE_INT }, \ | ||
| 381 | 	{ "logsigexit", CTLTYPE_INT }, \ | ||
| 382 | 	{ "symfile",CTLTYPE_STRING },\ | ||
| 383 | 	{ "procargs",CTLTYPE_STRUCT },\ | ||
| 384 | 	{ "dummy", CTLTYPE_INT }, /* deprecated pcsamples */ \ | ||
| 385 | 	{ "netboot", CTLTYPE_INT }, \ | ||
| 386 | 	{ "dummy", CTLTYPE_INT }, /* deprecated: panicinfo */ \ | ||
| 387 | 	{ "sysv", CTLTYPE_NODE }, \ | ||
| 388 | 	{ "dummy", CTLTYPE_INT }, \ | ||
| 389 | 	{ "dummy", CTLTYPE_INT }, \ | ||
| 390 | 	{ "exec", CTLTYPE_NODE }, \ | ||
| 391 | 	{ "aiomax", CTLTYPE_INT }, \ | ||
| 392 | 	{ "aioprocmax", CTLTYPE_INT }, \ | ||
| 393 | 	{ "aiothreads", CTLTYPE_INT }, \ | ||
| 394 | 	{ "procargs2",CTLTYPE_STRUCT }, \ | ||
| 395 | 	{ "corefile",CTLTYPE_STRING }, \ | ||
| 396 | 	{ "coredump", CTLTYPE_INT }, \ | ||
| 397 | 	{ "sugid_coredump", CTLTYPE_INT }, \ | ||
| 398 | 	{ "delayterm", CTLTYPE_INT }, \ | ||
| 399 | 	{ "shreg_private", CTLTYPE_INT }, \ | ||
| 400 | 	{ "proc_low_pri_io", CTLTYPE_INT }, \ | ||
| 401 | 	{ "low_pri_window", CTLTYPE_INT }, \ | ||
| 402 | 	{ "low_pri_delay", CTLTYPE_INT }, \ | ||
| 403 | 	{ "posix", CTLTYPE_NODE }, \ | ||
| 404 | 	{ "usrstack64", CTLTYPE_QUAD }, \ | ||
| 405 | 	{ "nx", CTLTYPE_INT }, \ | ||
| 406 | 	{ "tfp", CTLTYPE_NODE }, \ | ||
| 407 | 	{ "procname", CTLTYPE_STRING }, \ | ||
| 408 | 	{ "threadsigaltstack", CTLTYPE_INT }, \ | ||
| 409 | 	{ "speculative_reads_disabled", CTLTYPE_INT }, \ | ||
| 410 | 	{ "osversion", CTLTYPE_STRING }, \ | ||
| 411 | 	{ "safeboot", CTLTYPE_INT }, \ | ||
| 412 | 	{ "dummy", CTLTYPE_INT }, /* deprecated: lctx */ \ | ||
| 413 | 	{ "rage_vnode", CTLTYPE_INT }, \ | ||
| 414 | 	{ "tty", CTLTYPE_NODE }, \ | ||
| 415 | 	{ "check_openevt", CTLTYPE_INT }, \ | ||
| 416 | 	{ "thread_name", CTLTYPE_STRING } \ | ||
| 417 | } | ||
| 418 | |||
| 419 | /* | ||
| 420 | * CTL_VFS identifiers | ||
| 421 | */ | ||
| 422 | #define CTL_VFS_NAMES { \ | ||
| 423 | 	{ "vfsconf", CTLTYPE_STRUCT } \ | ||
| 424 | } | ||
| 425 | |||
| 426 | /* | ||
| 427 | * KERN_PROC subtypes | ||
| 428 | */ | ||
| 429 | #define KERN_PROC_ALL 0 /* everything */ | ||
| 430 | #define KERN_PROC_PID 1 /* by process id */ | ||
| 431 | #define KERN_PROC_PGRP 2 /* by process group id */ | ||
| 432 | #define KERN_PROC_SESSION 3 /* by session of pid */ | ||
| 433 | #define KERN_PROC_TTY 4 /* by controlling tty */ | ||
| 434 | #define KERN_PROC_UID 5 /* by effective uid */ | ||
| 435 | #define KERN_PROC_RUID 6 /* by real uid */ | ||
| 436 | #define KERN_PROC_LCID 7 /* by login context id */ | ||
| 437 | |||
| 438 | /* | ||
| 439 | * KERN_VFSNSPACE subtypes | ||
| 440 | */ | ||
| 441 | #define KERN_VFSNSPACE_HANDLE_PROC 1 | ||
| 442 | #define KERN_VFSNSPACE_UNHANDLE_PROC 2 | ||
| 443 | |||
| 444 | /* | ||
| 445 | * KERN_PROC subtype ops return arrays of augmented proc structures: | ||
| 446 | */ | ||
| 447 | |||
| 448 | struct _pcred { | ||
| 449 | 	char pc_lock[72]; /* opaque content */ | ||
| 450 | 	struct ucred *pc_ucred; /* Current credentials. */ | ||
| 451 | 	uid_t p_ruid; /* Real user id. */ | ||
| 452 | 	uid_t p_svuid; /* Saved effective user id. */ | ||
| 453 | 	gid_t p_rgid; /* Real group id. */ | ||
| 454 | 	gid_t p_svgid; /* Saved effective group id. */ | ||
| 455 | 	int p_refcnt; /* Number of references. */ | ||
| 456 | }; | ||
| 457 | |||
| 458 | struct _ucred { | ||
| 459 | 	int32_t cr_ref; /* reference count */ | ||
| 460 | 	uid_t cr_uid; /* effective user id */ | ||
| 461 | 	short cr_ngroups; /* number of groups */ | ||
| 462 | 	gid_t cr_groups[NGROUPS]; /* groups */ | ||
| 463 | }; | ||
| 464 | |||
| 465 | struct kinfo_proc { | ||
| 466 | 	struct extern_proc kp_proc; /* proc structure */ | ||
| 467 | 	struct eproc { | ||
| 468 | 		struct proc *e_paddr; /* address of proc */ | ||
| 469 | 		struct session *e_sess; /* session pointer */ | ||
| 470 | 		struct _pcred e_pcred; /* process credentials */ | ||
| 471 | 		struct _ucred e_ucred; /* current credentials */ | ||
| 472 | 		struct vmspace e_vm; /* address space */ | ||
| 473 | 		pid_t e_ppid; /* parent process id */ | ||
| 474 | 		pid_t e_pgid; /* process group id */ | ||
| 475 | 		short e_jobc; /* job control counter */ | ||
| 476 | 		dev_t e_tdev; /* controlling tty dev */ | ||
| 477 | 		pid_t e_tpgid; /* tty process group id */ | ||
| 478 | 		struct session *e_tsess; /* tty session pointer */ | ||
| 479 | #define WMESGLEN 7 | ||
| 480 | 		char e_wmesg[WMESGLEN + 1]; /* wchan message */ | ||
| 481 | 		segsz_t e_xsize; /* text size */ | ||
| 482 | 		short e_xrssize; /* text rss */ | ||
| 483 | 		short e_xccount; /* text references */ | ||
| 484 | 		short e_xswrss; | ||
| 485 | 		int32_t e_flag; | ||
| 486 | #define EPROC_CTTY 0x01 /* controlling tty vnode active */ | ||
| 487 | #define EPROC_SLEADER 0x02 /* session leader */ | ||
| 488 | #define COMAPT_MAXLOGNAME 12 | ||
| 489 | 		char e_login[COMAPT_MAXLOGNAME]; /* short setlogin() name */ | ||
| 490 | 		int32_t e_spare[4]; | ||
| 491 | 	} kp_eproc; | ||
| 492 | }; | ||
| 493 | |||
| 494 | |||
| 495 | |||
| 496 | /* | ||
| 497 | * KERN_IPC identifiers | ||
| 498 | */ | ||
| 499 | #define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */ | ||
| 500 | #define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */ | ||
| 501 | #define KIPC_SOMAXCONN 3 /* int: max length of connection q */ | ||
| 502 | #define KIPC_MAX_LINKHDR 4 /* int: max length of link header */ | ||
| 503 | #define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */ | ||
| 504 | #define KIPC_MAX_HDR 6 /* int: max total length of headers */ | ||
| 505 | #define KIPC_MAX_DATALEN 7 /* int: max length of data? */ | ||
| 506 | #define KIPC_MBSTAT 8 /* struct: mbuf usage statistics */ | ||
| 507 | #define KIPC_NMBCLUSTERS 9 /* int: maximum mbuf clusters */ | ||
| 508 | #define KIPC_SOQLIMITCOMPAT 10 /* int: socket queue limit */ | ||
| 509 | |||
| 510 | /* | ||
| 511 | * CTL_VM identifiers | ||
| 512 | */ | ||
| 513 | #define VM_METER 1 /* struct vmmeter */ | ||
| 514 | #define VM_LOADAVG 2 /* struct loadavg */ | ||
| 515 | /* | ||
| 516 | * Note: "3" was skipped sometime ago and should probably remain unused | ||
| 517 | * to avoid any new entry from being accepted by older kernels... | ||
| 518 | */ | ||
| 519 | #define VM_MACHFACTOR 4 /* struct loadavg with mach factor*/ | ||
| 520 | #define VM_SWAPUSAGE 5 /* total swap usage */ | ||
| 521 | #define VM_MAXID 6 /* number of valid vm ids */ | ||
| 522 | |||
| 523 | #define CTL_VM_NAMES { \ | ||
| 524 | 	{ 0, 0 }, \ | ||
| 525 | 	{ "vmmeter", CTLTYPE_STRUCT }, \ | ||
| 526 | 	{ "loadavg", CTLTYPE_STRUCT }, \ | ||
| 527 | 	{ 0, 0 }, /* placeholder for "3" (see comment above) */ \ | ||
| 528 | 	{ "dummy", CTLTYPE_INT }, \ | ||
| 529 | 	{ "swapusage", CTLTYPE_STRUCT } \ | ||
| 530 | } | ||
| 531 | |||
| 532 | struct xsw_usage { | ||
| 533 | 	u_int64_t xsu_total; | ||
| 534 | 	u_int64_t xsu_avail; | ||
| 535 | 	u_int64_t xsu_used; | ||
| 536 | 	u_int32_t xsu_pagesize; | ||
| 537 | 	boolean_t xsu_encrypted; | ||
| 538 | }; | ||
| 539 | |||
| 540 | #ifdef __APPLE_API_PRIVATE | ||
| 541 | /* Load average structure. Use of fixpt_t assume <sys/types.h> in scope. */ | ||
| 542 | /* XXX perhaps we should protect fixpt_t, and define it here (or discard it) */ | ||
| 543 | struct loadavg { | ||
| 544 | 	fixpt_t ldavg[3]; | ||
| 545 | 	long fscale; | ||
| 546 | }; | ||
| 547 | extern struct loadavg averunnable; | ||
| 548 | #define LSCALE 1000 /* scaling for "fixed point" arithmetic */ | ||
| 549 | |||
| 550 | #endif /* __APPLE_API_PRIVATE */ | ||
| 551 | |||
| 552 | |||
| 553 | /* | ||
| 554 | * CTL_HW identifiers | ||
| 555 | */ | ||
| 556 | #define HW_MACHINE 1 /* string: machine class (deprecated: use HW_PRODUCT) */ | ||
| 557 | #define HW_MODEL 2 /* string: specific machine model (deprecated: use HW_TARGET) */ | ||
| 558 | #define HW_NCPU 3 /* int: number of cpus */ | ||
| 559 | #define HW_BYTEORDER 4 /* int: machine byte order */ | ||
| 560 | #define HW_PHYSMEM 5 /* int: total memory */ | ||
| 561 | #define HW_USERMEM 6 /* int: non-kernel memory */ | ||
| 562 | #define HW_PAGESIZE 7 /* int: software page size */ | ||
| 563 | #define HW_DISKNAMES 8 /* strings: disk drive names */ | ||
| 564 | #define HW_DISKSTATS 9 /* struct: diskstats[] */ | ||
| 565 | #define HW_EPOCH 10 /* int: 0 for Legacy, else NewWorld */ | ||
| 566 | #define HW_FLOATINGPT 11 /* int: has HW floating point? */ | ||
| 567 | #define HW_MACHINE_ARCH 12 /* string: machine architecture */ | ||
| 568 | #define HW_VECTORUNIT 13 /* int: has HW vector unit? */ | ||
| 569 | #define HW_BUS_FREQ 14 /* int: Bus Frequency */ | ||
| 570 | #define HW_CPU_FREQ 15 /* int: CPU Frequency */ | ||
| 571 | #define HW_CACHELINE 16 /* int: Cache Line Size in Bytes */ | ||
| 572 | #define HW_L1ICACHESIZE 17 /* int: L1 I Cache Size in Bytes */ | ||
| 573 | #define HW_L1DCACHESIZE 18 /* int: L1 D Cache Size in Bytes */ | ||
| 574 | #define HW_L2SETTINGS 19 /* int: L2 Cache Settings */ | ||
| 575 | #define HW_L2CACHESIZE 20 /* int: L2 Cache Size in Bytes */ | ||
| 576 | #define HW_L3SETTINGS 21 /* int: L3 Cache Settings */ | ||
| 577 | #define HW_L3CACHESIZE 22 /* int: L3 Cache Size in Bytes */ | ||
| 578 | #define HW_TB_FREQ 23 /* int: Bus Frequency */ | ||
| 579 | #define HW_MEMSIZE 24 /* uint64_t: physical ram size */ | ||
| 580 | #define HW_AVAILCPU 25 /* int: number of available CPUs */ | ||
| 581 | #define HW_TARGET 26 /* string: model identifier */ | ||
| 582 | #define HW_PRODUCT 27 /* string: product identifier */ | ||
| 583 | #define HW_MAXID 28 /* number of valid hw ids */ | ||
| 584 | |||
| 585 | #define CTL_HW_NAMES { \ | ||
| 586 | 	{ 0, 0 }, \ | ||
| 587 | 	{ "machine", CTLTYPE_STRING }, /* Deprecated: use hw.product */ \ | ||
| 588 | 	{ "model", CTLTYPE_STRING }, /* Deprecated: use hw.target */ \ | ||
| 589 | 	{ "ncpu", CTLTYPE_INT }, \ | ||
| 590 | 	{ "byteorder", CTLTYPE_INT }, \ | ||
| 591 | 	{ "physmem", CTLTYPE_INT }, \ | ||
| 592 | 	{ "usermem", CTLTYPE_INT }, \ | ||
| 593 | 	{ "pagesize", CTLTYPE_INT }, \ | ||
| 594 | 	{ "disknames", CTLTYPE_STRUCT }, \ | ||
| 595 | 	{ "diskstats", CTLTYPE_STRUCT }, \ | ||
| 596 | 	{ "epoch", CTLTYPE_INT }, \ | ||
| 597 | 	{ "floatingpoint", CTLTYPE_INT }, \ | ||
| 598 | 	{ "machinearch", CTLTYPE_STRING }, \ | ||
| 599 | 	{ "vectorunit", CTLTYPE_INT }, \ | ||
| 600 | 	{ "busfrequency", CTLTYPE_INT }, \ | ||
| 601 | 	{ "cpufrequency", CTLTYPE_INT }, \ | ||
| 602 | 	{ "cachelinesize", CTLTYPE_INT }, \ | ||
| 603 | 	{ "l1icachesize", CTLTYPE_INT }, \ | ||
| 604 | 	{ "l1dcachesize", CTLTYPE_INT }, \ | ||
| 605 | 	{ "l2settings", CTLTYPE_INT }, \ | ||
| 606 | 	{ "l2cachesize", CTLTYPE_INT }, \ | ||
| 607 | 	{ "l3settings", CTLTYPE_INT }, \ | ||
| 608 | 	{ "l3cachesize", CTLTYPE_INT }, \ | ||
| 609 | 	{ "tbfrequency", CTLTYPE_INT }, \ | ||
| 610 | 	{ "memsize", CTLTYPE_QUAD }, \ | ||
| 611 | 	{ "availcpu", CTLTYPE_INT }, \ | ||
| 612 | 	{ "target", CTLTYPE_STRING }, \ | ||
| 613 | 	{ "product", CTLTYPE_STRING }, \ | ||
| 614 | } | ||
| 615 | |||
| 616 | /* | ||
| 617 | * XXX This information should be moved to the man page. | ||
| 618 | * | ||
| 619 | * These are the support HW selectors for sysctlbyname. Parameters that are byte counts or frequencies are 64 bit numbers. | ||
| 620 | * All other parameters are 32 bit numbers. | ||
| 621 | * | ||
| 622 | * hw.memsize - The number of bytes of physical memory in the system. | ||
| 623 | * | ||
| 624 | * hw.ncpu - The maximum number of processors that could be available this boot. | ||
| 625 | * Use this value for sizing of static per processor arrays; i.e. processor load statistics. | ||
| 626 | * | ||
| 627 | * hw.activecpu - The number of processors currently available for executing threads. | ||
| 628 | * Use this number to determine the number threads to create in SMP aware applications. | ||
| 629 | * This number can change when power management modes are changed. | ||
| 630 | * | ||
| 631 | * hw.physicalcpu - The number of physical processors available in the current power management mode. | ||
| 632 | * hw.physicalcpu_max - The maximum number of physical processors that could be available this boot | ||
| 633 | * | ||
| 634 | * hw.logicalcpu - The number of logical processors available in the current power management mode. | ||
| 635 | * hw.logicalcpu_max - The maximum number of logical processors that could be available this boot | ||
| 636 | * | ||
| 637 | * hw.tbfrequency - This gives the time base frequency used by the OS and is the basis of all timing services. | ||
| 638 | * In general is is better to use mach's or higher level timing services, but this value | ||
| 639 | * is needed to convert the PPC Time Base registers to real time. | ||
| 640 | * | ||
| 641 | * hw.cpufrequency - These values provide the current, min and max cpu frequency. The min and max are for | ||
| 642 | * hw.cpufrequency_max - all power management modes. The current frequency is the max frequency in the current mode. | ||
| 643 | * hw.cpufrequency_min - All frequencies are in Hz. | ||
| 644 | * | ||
| 645 | * hw.busfrequency - These values provide the current, min and max bus frequency. The min and max are for | ||
| 646 | * hw.busfrequency_max - all power management modes. The current frequency is the max frequency in the current mode. | ||
| 647 | * hw.busfrequency_min - All frequencies are in Hz. | ||
| 648 | * | ||
| 649 | * hw.cputype - These values provide the mach-o cpu type and subtype. A complete list is in <mach/machine.h> | ||
| 650 | * hw.cpusubtype - These values should be used to determine what processor family the running cpu is from so that | ||
| 651 | * the best binary can be chosen, or the best dynamic code generated. They should not be used | ||
| 652 | * to determine if a given processor feature is available. | ||
| 653 | * hw.cputhreadtype - This value will be present if the processor supports threads. Like hw.cpusubtype this selector | ||
| 654 | * should not be used to infer features, and only used to name the processors thread architecture. | ||
| 655 | * The values are defined in <mach/machine.h> | ||
| 656 | * | ||
| 657 | * hw.byteorder - Gives the byte order of the processor. 4321 for big endian, 1234 for little. | ||
| 658 | * | ||
| 659 | * hw.pagesize - Gives the size in bytes of the pages used by the processor and VM system. | ||
| 660 | * | ||
| 661 | * hw.cachelinesize - Gives the size in bytes of the processor's cache lines. | ||
| 662 | * This value should be use to control the strides of loops that use cache control instructions | ||
| 663 | * like dcbz, dcbt or dcbst. | ||
| 664 | * | ||
| 665 | * hw.l1dcachesize - These values provide the size in bytes of the L1, L2 and L3 caches. If a cache is not present | ||
| 666 | * hw.l1icachesize - then the selector will return and error. | ||
| 667 | * hw.l2cachesize - | ||
| 668 | * hw.l3cachesize - | ||
| 669 | * | ||
| 670 | * hw.packages - Gives the number of processor packages. | ||
| 671 | * | ||
| 672 | * These are the selectors for optional processor features for specific processors. Selectors that return errors are not support | ||
| 673 | * on the system. Supported features will return 1 if they are recommended or 0 if they are supported but are not expected to help . | ||
| 674 | * performance. Future versions of these selectors may return larger values as necessary so it is best to test for non zero. | ||
| 675 | * | ||
| 676 | * For PowerPC: | ||
| 677 | * | ||
| 678 | * hw.optional.floatingpoint - Floating Point Instructions | ||
| 679 | * hw.optional.altivec - AltiVec Instructions | ||
| 680 | * hw.optional.graphicsops - Graphics Operations | ||
| 681 | * hw.optional.64bitops - 64-bit Instructions | ||
| 682 | * hw.optional.fsqrt - HW Floating Point Square Root Instruction | ||
| 683 | * hw.optional.stfiwx - Store Floating Point as Integer Word Indexed Instructions | ||
| 684 | * hw.optional.dcba - Data Cache Block Allocate Instruction | ||
| 685 | * hw.optional.datastreams - Data Streams Instructions | ||
| 686 | * hw.optional.dcbtstreams - Data Cache Block Touch Steams Instruction Form | ||
| 687 | * | ||
| 688 | * For x86 Architecture: | ||
| 689 | * | ||
| 690 | * hw.optional.floatingpoint - Floating Point Instructions | ||
| 691 | * hw.optional.mmx - Original MMX vector instructions | ||
| 692 | * hw.optional.sse - Streaming SIMD Extensions | ||
| 693 | * hw.optional.sse2 - Streaming SIMD Extensions 2 | ||
| 694 | * hw.optional.sse3 - Streaming SIMD Extensions 3 | ||
| 695 | * hw.optional.supplementalsse3 - Supplemental Streaming SIMD Extensions 3 | ||
| 696 | * hw.optional.x86_64 - 64-bit support | ||
| 697 | */ | ||
| 698 | |||
| 699 | |||
| 700 | /* | ||
| 701 | * CTL_USER definitions | ||
| 702 | */ | ||
| 703 | #define USER_CS_PATH 1 /* string: _CS_PATH */ | ||
| 704 | #define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */ | ||
| 705 | #define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */ | ||
| 706 | #define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */ | ||
| 707 | #define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */ | ||
| 708 | #define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */ | ||
| 709 | #define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */ | ||
| 710 | #define USER_LINE_MAX 8 /* int: LINE_MAX */ | ||
| 711 | #define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */ | ||
| 712 | #define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */ | ||
| 713 | #define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */ | ||
| 714 | #define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */ | ||
| 715 | #define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */ | ||
| 716 | #define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */ | ||
| 717 | #define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */ | ||
| 718 | #define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */ | ||
| 719 | #define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */ | ||
| 720 | #define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */ | ||
| 721 | #define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */ | ||
| 722 | #define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */ | ||
| 723 | #define USER_MAXID 21 /* number of valid user ids */ | ||
| 724 | |||
| 725 | #define CTL_USER_NAMES { \ | ||
| 726 | 	{ 0, 0 }, \ | ||
| 727 | 	{ "cs_path", CTLTYPE_STRING }, \ | ||
| 728 | 	{ "bc_base_max", CTLTYPE_INT }, \ | ||
| 729 | 	{ "bc_dim_max", CTLTYPE_INT }, \ | ||
| 730 | 	{ "bc_scale_max", CTLTYPE_INT }, \ | ||
| 731 | 	{ "bc_string_max", CTLTYPE_INT }, \ | ||
| 732 | 	{ "coll_weights_max", CTLTYPE_INT }, \ | ||
| 733 | 	{ "expr_nest_max", CTLTYPE_INT }, \ | ||
| 734 | 	{ "line_max", CTLTYPE_INT }, \ | ||
| 735 | 	{ "re_dup_max", CTLTYPE_INT }, \ | ||
| 736 | 	{ "posix2_version", CTLTYPE_INT }, \ | ||
| 737 | 	{ "posix2_c_bind", CTLTYPE_INT }, \ | ||
| 738 | 	{ "posix2_c_dev", CTLTYPE_INT }, \ | ||
| 739 | 	{ "posix2_char_term", CTLTYPE_INT }, \ | ||
| 740 | 	{ "posix2_fort_dev", CTLTYPE_INT }, \ | ||
| 741 | 	{ "posix2_fort_run", CTLTYPE_INT }, \ | ||
| 742 | 	{ "posix2_localedef", CTLTYPE_INT }, \ | ||
| 743 | 	{ "posix2_sw_dev", CTLTYPE_INT }, \ | ||
| 744 | 	{ "posix2_upe", CTLTYPE_INT }, \ | ||
| 745 | 	{ "stream_max", CTLTYPE_INT }, \ | ||
| 746 | 	{ "tzname_max", CTLTYPE_INT } \ | ||
| 747 | } | ||
| 748 | |||
| 749 | |||
| 750 | |||
| 751 | /* | ||
| 752 | * CTL_DEBUG definitions | ||
| 753 | * | ||
| 754 | * Second level identifier specifies which debug variable. | ||
| 755 | * Third level identifier specifies which stucture component. | ||
| 756 | */ | ||
| 757 | #define CTL_DEBUG_NAME 0 /* string: variable name */ | ||
| 758 | #define CTL_DEBUG_VALUE 1 /* int: variable value */ | ||
| 759 | #define CTL_DEBUG_MAXID 20 | ||
| 760 | |||
| 761 | |||
| 762 | #if (CTL_MAXID != 9) || (KERN_MAXID != 72) || (VM_MAXID != 6) || (HW_MAXID != 28) || (USER_MAXID != 21) || (CTL_DEBUG_MAXID != 20) | ||
| 763 | #error Use the SYSCTL_*() macros and OID_AUTO instead! | ||
| 764 | #endif | ||
| 765 | |||
| 766 | |||
| 767 | |||
| 768 | __BEGIN_DECLS | ||
| 769 | int sysctl(int *, u_int, void *, size_t *, void *, size_t); | ||
| 770 | int sysctlbyname(const char *, void *, size_t *, void *, size_t); | ||
| 771 | int sysctlnametomib(const char *, int *, size_t *); | ||
| 772 | __END_DECLS | ||
| 773 | |||
| 774 | |||
| 775 | |||
| 776 | #endif /* SYSCTL_DEF_ENABLED */ | ||
| 777 | |||
| 778 | |||
| 779 | #endif /* !_SYS_SYSCTL_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/syslimits.h+9-1| ... | @@ -68,11 +68,19 @@ | ... | @@ -68,11 +68,19 @@ |
| 68 | #include <sys/cdefs.h> | 68 | #include <sys/cdefs.h> |
| 69 | 69 | ||
| 70 | #if !defined(_ANSI_SOURCE) | 70 | #if !defined(_ANSI_SOURCE) |
| 71 | |||
| 72 | /* max bytes for an exec function */ | ||
| 73 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) | ||
| 74 | #define ARG_MAX (1024 * 1024) | ||
| 75 | #else | ||
| 76 | #define ARG_MAX (256 * 1024) | ||
| 77 | #endif | ||
| 78 | |||
| 71 | /* | 79 | /* |
| 72 | * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at | 80 | * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at |
| 73 | * compile time; you *cannot* set it higher than the hard limit!! | 81 | * compile time; you *cannot* set it higher than the hard limit!! |
| 74 | */ | 82 | */ |
| 75 | #define ARG_MAX (256 * 1024) /* max bytes for an exec function */ | 83 | |
| 76 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | 84 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) |
| 77 | #define CHILD_MAX 266 /* max simultaneous processes */ | 85 | #define CHILD_MAX 266 /* max simultaneous processes */ |
| 78 | #define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */ | 86 | #define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */ |
lib/libc/include/x86_64-macos-gnu/sys/syslog.h created+236| ... | @@ -0,0 +1,236 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1988, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 4. Neither the name of the University nor the names of its contributors | ||
| 42 | * may be used to endorse or promote products derived from this software | ||
| 43 | * without specific prior written permission. | ||
| 44 | * | ||
| 45 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 46 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 55 | * SUCH DAMAGE. | ||
| 56 | * | ||
| 57 | *	@(#)syslog.h	8.1 (Berkeley) 6/2/93 | ||
| 58 | * $FreeBSD: src/sys/sys/syslog.h,v 1.27.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $ | ||
| 59 | */ | ||
| 60 | |||
| 61 | #ifndef _SYS_SYSLOG_H_ | ||
| 62 | #define _SYS_SYSLOG_H_ | ||
| 63 | |||
| 64 | #include <sys/appleapiopts.h> | ||
| 65 | #include <sys/cdefs.h> | ||
| 66 | |||
| 67 | #define _PATH_LOG "/var/run/syslog" | ||
| 68 | |||
| 69 | /* | ||
| 70 | * priorities/facilities are encoded into a single 32-bit quantity, where the | ||
| 71 | * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility | ||
| 72 | * (0-big number). Both the priorities and the facilities map roughly | ||
| 73 | * one-to-one to strings in the syslogd(8) source code. This mapping is | ||
| 74 | * included in this file. | ||
| 75 | * | ||
| 76 | * priorities (these are ordered) | ||
| 77 | */ | ||
| 78 | #define LOG_EMERG 0 /* system is unusable */ | ||
| 79 | #define LOG_ALERT 1 /* action must be taken immediately */ | ||
| 80 | #define LOG_CRIT 2 /* critical conditions */ | ||
| 81 | #define LOG_ERR 3 /* error conditions */ | ||
| 82 | #define LOG_WARNING 4 /* warning conditions */ | ||
| 83 | #define LOG_NOTICE 5 /* normal but significant condition */ | ||
| 84 | #define LOG_INFO 6 /* informational */ | ||
| 85 | #define LOG_DEBUG 7 /* debug-level messages */ | ||
| 86 | |||
| 87 | #define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ | ||
| 88 | /* extract priority */ | ||
| 89 | #define LOG_PRI(p) ((p) & LOG_PRIMASK) | ||
| 90 | #define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) | ||
| 91 | |||
| 92 | #ifdef SYSLOG_NAMES | ||
| 93 | #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ | ||
| 94 | /* mark "facility" */ | ||
| 95 | #define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0) | ||
| 96 | typedef struct _code { | ||
| 97 | 	const char *c_name; | ||
| 98 | 	int c_val; | ||
| 99 | } CODE; | ||
| 100 | |||
| 101 | CODE prioritynames[] = { | ||
| 102 | 	{ "alert", LOG_ALERT, }, | ||
| 103 | 	{ "crit", LOG_CRIT, }, | ||
| 104 | 	{ "debug", LOG_DEBUG, }, | ||
| 105 | 	{ "emerg", LOG_EMERG, }, | ||
| 106 | 	{ "err", LOG_ERR, }, | ||
| 107 | 	{ "error", LOG_ERR, }, /* DEPRECATED */ | ||
| 108 | 	{ "info", LOG_INFO, }, | ||
| 109 | 	{ "none", INTERNAL_NOPRI, }, /* INTERNAL */ | ||
| 110 | 	{ "notice", LOG_NOTICE, }, | ||
| 111 | 	{ "panic", LOG_EMERG, }, /* DEPRECATED */ | ||
| 112 | 	{ "warn", LOG_WARNING, }, /* DEPRECATED */ | ||
| 113 | 	{ "warning", LOG_WARNING, }, | ||
| 114 | 	{ NULL, -1, } | ||
| 115 | }; | ||
| 116 | #endif | ||
| 117 | |||
| 118 | /* facility codes */ | ||
| 119 | #define LOG_KERN (0<<3) /* kernel messages */ | ||
| 120 | #define LOG_USER (1<<3) /* random user-level messages */ | ||
| 121 | #define LOG_MAIL (2<<3) /* mail system */ | ||
| 122 | #define LOG_DAEMON (3<<3) /* system daemons */ | ||
| 123 | #define LOG_AUTH (4<<3) /* authorization messages */ | ||
| 124 | #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ | ||
| 125 | #define LOG_LPR (6<<3) /* line printer subsystem */ | ||
| 126 | #define LOG_NEWS (7<<3) /* network news subsystem */ | ||
| 127 | #define LOG_UUCP (8<<3) /* UUCP subsystem */ | ||
| 128 | #define LOG_CRON (9<<3) /* clock daemon */ | ||
| 129 | #define LOG_AUTHPRIV (10<<3) /* authorization messages (private) */ | ||
| 130 | /* Facility #10 clashes in DEC UNIX, where */ | ||
| 131 | /* it's defined as LOG_MEGASAFE for AdvFS */ | ||
| 132 | /* event logging. */ | ||
| 133 | #define LOG_FTP (11<<3) /* ftp daemon */ | ||
| 134 | //#define	LOG_NTP		(12<<3)	/* NTP subsystem */ | ||
| 135 | //#define	LOG_SECURITY	(13<<3) /* security subsystems (firewalling, etc.) */ | ||
| 136 | //#define	LOG_CONSOLE	(14<<3) /* /dev/console output */ | ||
| 137 | #define LOG_NETINFO (12<<3) /* NetInfo */ | ||
| 138 | #define LOG_REMOTEAUTH (13<<3) /* remote authentication/authorization */ | ||
| 139 | #define LOG_INSTALL (14<<3) /* installer subsystem */ | ||
| 140 | #define LOG_RAS (15<<3) /* Remote Access Service (VPN / PPP) */ | ||
| 141 | |||
| 142 | /* other codes through 15 reserved for system use */ | ||
| 143 | #define LOG_LOCAL0 (16<<3) /* reserved for local use */ | ||
| 144 | #define LOG_LOCAL1 (17<<3) /* reserved for local use */ | ||
| 145 | #define LOG_LOCAL2 (18<<3) /* reserved for local use */ | ||
| 146 | #define LOG_LOCAL3 (19<<3) /* reserved for local use */ | ||
| 147 | #define LOG_LOCAL4 (20<<3) /* reserved for local use */ | ||
| 148 | #define LOG_LOCAL5 (21<<3) /* reserved for local use */ | ||
| 149 | #define LOG_LOCAL6 (22<<3) /* reserved for local use */ | ||
| 150 | #define LOG_LOCAL7 (23<<3) /* reserved for local use */ | ||
| 151 | |||
| 152 | #define LOG_LAUNCHD (24<<3) /* launchd - general bootstrap daemon */ | ||
| 153 | |||
| 154 | #define LOG_NFACILITIES 25 /* current number of facilities */ | ||
| 155 | #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ | ||
| 156 | /* facility of pri */ | ||
| 157 | #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) | ||
| 158 | |||
| 159 | #ifdef SYSLOG_NAMES | ||
| 160 | CODE facilitynames[] = { | ||
| 161 | 	{ "auth", LOG_AUTH, }, | ||
| 162 | 	{ "authpriv", LOG_AUTHPRIV, }, | ||
| 163 | 	{ "cron", LOG_CRON, }, | ||
| 164 | 	{ "daemon", LOG_DAEMON, }, | ||
| 165 | 	{ "ftp", LOG_FTP, }, | ||
| 166 | 	{ "install", LOG_INSTALL }, | ||
| 167 | 	{ "kern", LOG_KERN, }, | ||
| 168 | 	{ "lpr", LOG_LPR, }, | ||
| 169 | 	{ "mail", LOG_MAIL, }, | ||
| 170 | 	{ "mark", INTERNAL_MARK, }, /* INTERNAL */ | ||
| 171 | 	{ "netinfo", LOG_NETINFO, }, | ||
| 172 | 	{ "ras", LOG_RAS }, | ||
| 173 | 	{ "remoteauth", LOG_REMOTEAUTH }, | ||
| 174 | 	{ "news", LOG_NEWS, }, | ||
| 175 | 	{ "security", LOG_AUTH }, /* DEPRECATED */ | ||
| 176 | 	{ "syslog", LOG_SYSLOG, }, | ||
| 177 | 	{ "user", LOG_USER, }, | ||
| 178 | 	{ "uucp", LOG_UUCP, }, | ||
| 179 | 	{ "local0", LOG_LOCAL0, }, | ||
| 180 | 	{ "local1", LOG_LOCAL1, }, | ||
| 181 | 	{ "local2", LOG_LOCAL2, }, | ||
| 182 | 	{ "local3", LOG_LOCAL3, }, | ||
| 183 | 	{ "local4", LOG_LOCAL4, }, | ||
| 184 | 	{ "local5", LOG_LOCAL5, }, | ||
| 185 | 	{ "local6", LOG_LOCAL6, }, | ||
| 186 | 	{ "local7", LOG_LOCAL7, }, | ||
| 187 | 	{ "launchd", LOG_LAUNCHD }, | ||
| 188 | 	{ NULL, -1, } | ||
| 189 | }; | ||
| 190 | #endif | ||
| 191 | |||
| 192 | |||
| 193 | /* | ||
| 194 | * arguments to setlogmask. | ||
| 195 | */ | ||
| 196 | #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ | ||
| 197 | #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Option flags for openlog. | ||
| 201 | * | ||
| 202 | * LOG_ODELAY no longer does anything. | ||
| 203 | * LOG_NDELAY is the inverse of what it used to be. | ||
| 204 | */ | ||
| 205 | #define LOG_PID 0x01 /* log the pid with each message */ | ||
| 206 | #define LOG_CONS 0x02 /* log on the console if errors in sending */ | ||
| 207 | #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ | ||
| 208 | #define LOG_NDELAY 0x08 /* don't delay open */ | ||
| 209 | #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ | ||
| 210 | #define LOG_PERROR 0x20 /* log to stderr as well */ | ||
| 211 | |||
| 212 | |||
| 213 | /* | ||
| 214 | * Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two | ||
| 215 | * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one | ||
| 216 | * of them here we may collide with the utility's includes. It's unreasonable | ||
| 217 | * for utilities to have to include one of them to include syslog.h, so we get | ||
| 218 | * __va_list from <sys/_types.h> and use it. | ||
| 219 | */ | ||
| 220 | #include <sys/_types.h> | ||
| 221 | |||
| 222 | __BEGIN_DECLS | ||
| 223 | void closelog(void); | ||
| 224 | void openlog(const char *, int, int); | ||
| 225 | int setlogmask(int); | ||
| 226 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 227 | void syslog(int, const char *, ...) __DARWIN_ALIAS_STARTING(__MAC_10_13, __IPHONE_NA, __DARWIN_EXTSN(syslog)) __printflike(2, 3) __not_tail_called; | ||
| 228 | #else | ||
| 229 | void syslog(int, const char *, ...) __printflike(2, 3) __not_tail_called; | ||
| 230 | #endif | ||
| 231 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 232 | void vsyslog(int, const char *, __darwin_va_list) __printflike(2, 0) __not_tail_called; | ||
| 233 | #endif | ||
| 234 | __END_DECLS | ||
| 235 | |||
| 236 | #endif /* !_SYS_SYSLOG_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/termios.h created+366| ... | @@ -0,0 +1,366 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1988, 1989, 1993, 1994 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | * This product includes software developed by the University of | ||
| 44 | * California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)termios.h	8.3 (Berkeley) 3/28/94 | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _SYS_TERMIOS_H_ | ||
| 65 | #define _SYS_TERMIOS_H_ | ||
| 66 | |||
| 67 | #include <sys/cdefs.h> | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Special Control Characters | ||
| 71 | * | ||
| 72 | * Index into c_cc[] character array. | ||
| 73 | * | ||
| 74 | *	Name	 Subscript	Enabled by | ||
| 75 | */ | ||
| 76 | #define VEOF 0 /* ICANON */ | ||
| 77 | #define VEOL 1 /* ICANON */ | ||
| 78 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 79 | #define VEOL2 2 /* ICANON together with IEXTEN */ | ||
| 80 | #endif | ||
| 81 | #define VERASE 3 /* ICANON */ | ||
| 82 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 83 | #define VWERASE 4 /* ICANON together with IEXTEN */ | ||
| 84 | #endif | ||
| 85 | #define VKILL 5 /* ICANON */ | ||
| 86 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 87 | #define VREPRINT 6 /* ICANON together with IEXTEN */ | ||
| 88 | #endif | ||
| 89 | /*			7	 spare 1 */ | ||
| 90 | #define VINTR 8 /* ISIG */ | ||
| 91 | #define VQUIT 9 /* ISIG */ | ||
| 92 | #define VSUSP 10 /* ISIG */ | ||
| 93 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 94 | #define VDSUSP 11 /* ISIG together with IEXTEN */ | ||
| 95 | #endif | ||
| 96 | #define VSTART 12 /* IXON, IXOFF */ | ||
| 97 | #define VSTOP 13 /* IXON, IXOFF */ | ||
| 98 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 99 | #define VLNEXT 14 /* IEXTEN */ | ||
| 100 | #define VDISCARD 15 /* IEXTEN */ | ||
| 101 | #endif | ||
| 102 | #define VMIN 16 /* !ICANON */ | ||
| 103 | #define VTIME 17 /* !ICANON */ | ||
| 104 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 105 | #define VSTATUS 18 /* ICANON together with IEXTEN */ | ||
| 106 | /*			19	 spare 2 */ | ||
| 107 | #endif | ||
| 108 | #define NCCS 20 | ||
| 109 | |||
| 110 | #include <sys/_types/_posix_vdisable.h> | ||
| 111 | |||
| 112 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 113 | #define CCEQ(val, c) ((c) == (val) ? (val) != _POSIX_VDISABLE : 0) | ||
| 114 | #endif | ||
| 115 | |||
| 116 | /* | ||
| 117 | * Input flags - software input processing | ||
| 118 | */ | ||
| 119 | #define IGNBRK 0x00000001 /* ignore BREAK condition */ | ||
| 120 | #define BRKINT 0x00000002 /* map BREAK to SIGINTR */ | ||
| 121 | #define IGNPAR 0x00000004 /* ignore (discard) parity errors */ | ||
| 122 | #define PARMRK 0x00000008 /* mark parity and framing errors */ | ||
| 123 | #define INPCK 0x00000010 /* enable checking of parity errors */ | ||
| 124 | #define ISTRIP 0x00000020 /* strip 8th bit off chars */ | ||
| 125 | #define INLCR 0x00000040 /* map NL into CR */ | ||
| 126 | #define IGNCR 0x00000080 /* ignore CR */ | ||
| 127 | #define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */ | ||
| 128 | #define IXON 0x00000200 /* enable output flow control */ | ||
| 129 | #define IXOFF 0x00000400 /* enable input flow control */ | ||
| 130 | #define IXANY 0x00000800 /* any char will restart after stop */ | ||
| 131 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 132 | #define IMAXBEL 0x00002000 /* ring bell on input queue full */ | ||
| 133 | #define IUTF8 0x00004000 /* maintain state for UTF-8 VERASE */ | ||
| 134 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 135 | |||
| 136 | /* | ||
| 137 | * Output flags - software output processing | ||
| 138 | */ | ||
| 139 | #define OPOST 0x00000001 /* enable following output processing */ | ||
| 140 | #define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ | ||
| 141 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 142 | #define OXTABS 0x00000004 /* expand tabs to spaces */ | ||
| 143 | #define ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ | ||
| 144 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 145 | /* | ||
| 146 | * The following block of features is unimplemented. Use of these flags in | ||
| 147 | * programs will currently result in unexpected behaviour. | ||
| 148 | * | ||
| 149 | * - Begin unimplemented features | ||
| 150 | */ | ||
| 151 | #define OCRNL 0x00000010 /* map CR to NL on output */ | ||
| 152 | #define ONOCR 0x00000020 /* no CR output at column 0 */ | ||
| 153 | #define ONLRET 0x00000040 /* NL performs CR function */ | ||
| 154 | #define OFILL 0x00000080 /* use fill characters for delay */ | ||
| 155 | #define NLDLY 0x00000300 /* \n delay */ | ||
| 156 | #define TABDLY 0x00000c04 /* horizontal tab delay */ | ||
| 157 | #define CRDLY 0x00003000 /* \r delay */ | ||
| 158 | #define FFDLY 0x00004000 /* form feed delay */ | ||
| 159 | #define BSDLY 0x00008000 /* \b delay */ | ||
| 160 | #define VTDLY 0x00010000 /* vertical tab delay */ | ||
| 161 | #define OFDEL 0x00020000 /* fill is DEL, else NUL */ | ||
| 162 | #if !defined(_SYS_IOCTL_COMPAT_H_) || __DARWIN_UNIX03 | ||
| 163 | /* | ||
| 164 | * These manifest constants have the same names as those in the header | ||
| 165 | * <sys/ioctl_compat.h>, so you are not permitted to have both definitions | ||
| 166 | * in scope simultaneously in the same compilation unit. Nevertheless, | ||
| 167 | * they are required to be in scope when _POSIX_C_SOURCE is requested; | ||
| 168 | * this means that including the <sys/ioctl_compat.h> header before this | ||
| 169 | * one when _POSIX_C_SOURCE is in scope will result in redefintions. We | ||
| 170 | * attempt to maintain these as the same values so as to avoid this being | ||
| 171 | * an outright error in most compilers. | ||
| 172 | */ | ||
| 173 | #define NL0 0x00000000 | ||
| 174 | #define NL1 0x00000100 | ||
| 175 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 176 | #define NL2 0x00000200 | ||
| 177 | #define NL3 0x00000300 | ||
| 178 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 179 | #define TAB0 0x00000000 | ||
| 180 | #define TAB1 0x00000400 | ||
| 181 | #define TAB2 0x00000800 | ||
| 182 | /* not in sys/ioctl_compat.h, use OXTABS value */ | ||
| 183 | #define TAB3 0x00000004 | ||
| 184 | #define CR0 0x00000000 | ||
| 185 | #define CR1 0x00001000 | ||
| 186 | #define CR2 0x00002000 | ||
| 187 | #define CR3 0x00003000 | ||
| 188 | #define FF0 0x00000000 | ||
| 189 | #define FF1 0x00004000 | ||
| 190 | #define BS0 0x00000000 | ||
| 191 | #define BS1 0x00008000 | ||
| 192 | #define VT0 0x00000000 | ||
| 193 | #define VT1 0x00010000 | ||
| 194 | #endif /* !_SYS_IOCTL_COMPAT_H_ */ | ||
| 195 | /* | ||
| 196 | * + End unimplemented features | ||
| 197 | */ | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Control flags - hardware control of terminal | ||
| 201 | */ | ||
| 202 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 203 | #define CIGNORE 0x00000001 /* ignore control flags */ | ||
| 204 | #endif | ||
| 205 | #define CSIZE 0x00000300 /* character size mask */ | ||
| 206 | #define CS5 0x00000000 /* 5 bits (pseudo) */ | ||
| 207 | #define CS6 0x00000100 /* 6 bits */ | ||
| 208 | #define CS7 0x00000200 /* 7 bits */ | ||
| 209 | #define CS8 0x00000300 /* 8 bits */ | ||
| 210 | #define CSTOPB 0x00000400 /* send 2 stop bits */ | ||
| 211 | #define CREAD 0x00000800 /* enable receiver */ | ||
| 212 | #define PARENB 0x00001000 /* parity enable */ | ||
| 213 | #define PARODD 0x00002000 /* odd parity, else even */ | ||
| 214 | #define HUPCL 0x00004000 /* hang up on last close */ | ||
| 215 | #define CLOCAL 0x00008000 /* ignore modem status lines */ | ||
| 216 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 217 | #define CCTS_OFLOW 0x00010000 /* CTS flow control of output */ | ||
| 218 | #define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) | ||
| 219 | #define CRTS_IFLOW 0x00020000 /* RTS flow control of input */ | ||
| 220 | #define CDTR_IFLOW 0x00040000 /* DTR flow control of input */ | ||
| 221 | #define CDSR_OFLOW 0x00080000 /* DSR flow control of output */ | ||
| 222 | #define CCAR_OFLOW 0x00100000 /* DCD flow control of output */ | ||
| 223 | #define MDMBUF 0x00100000 /* old name for CCAR_OFLOW */ | ||
| 224 | #endif | ||
| 225 | |||
| 226 | |||
| 227 | /* | ||
| 228 | * "Local" flags - dumping ground for other state | ||
| 229 | * | ||
| 230 | * Warning: some flags in this structure begin with | ||
| 231 | * the letter "I" and look like they belong in the | ||
| 232 | * input flag. | ||
| 233 | */ | ||
| 234 | |||
| 235 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 236 | #define ECHOKE 0x00000001 /* visual erase for line kill */ | ||
| 237 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 238 | #define ECHOE 0x00000002 /* visually erase chars */ | ||
| 239 | #define ECHOK 0x00000004 /* echo NL after line kill */ | ||
| 240 | #define ECHO 0x00000008 /* enable echoing */ | ||
| 241 | #define ECHONL 0x00000010 /* echo NL even if ECHO is off */ | ||
| 242 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 243 | #define ECHOPRT 0x00000020 /* visual erase mode for hardcopy */ | ||
| 244 | #define ECHOCTL 0x00000040 /* echo control chars as ^(Char) */ | ||
| 245 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 246 | #define ISIG 0x00000080 /* enable signals INTR, QUIT, [D]SUSP */ | ||
| 247 | #define ICANON 0x00000100 /* canonicalize input lines */ | ||
| 248 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 249 | #define ALTWERASE 0x00000200 /* use alternate WERASE algorithm */ | ||
| 250 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 251 | #define IEXTEN 0x00000400 /* enable DISCARD and LNEXT */ | ||
| 252 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 253 | #define EXTPROC 0x00000800 /* external processing */ | ||
| 254 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 255 | #define TOSTOP 0x00400000 /* stop background jobs from output */ | ||
| 256 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 257 | #define FLUSHO 0x00800000 /* output being flushed (state) */ | ||
| 258 | #define NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */ | ||
| 259 | #define PENDIN 0x20000000 /* XXX retype pending input (state) */ | ||
| 260 | #endif /*(_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ | ||
| 261 | #define NOFLSH 0x80000000 /* don't flush after interrupt */ | ||
| 262 | |||
| 263 | typedef unsigned long tcflag_t; | ||
| 264 | typedef unsigned char cc_t; | ||
| 265 | typedef unsigned long speed_t; | ||
| 266 | |||
| 267 | struct termios { | ||
| 268 | 	tcflag_t c_iflag; /* input flags */ | ||
| 269 | 	tcflag_t c_oflag; /* output flags */ | ||
| 270 | 	tcflag_t c_cflag; /* control flags */ | ||
| 271 | 	tcflag_t c_lflag; /* local flags */ | ||
| 272 | 	cc_t c_cc[NCCS]; /* control chars */ | ||
| 273 | 	speed_t c_ispeed; /* input speed */ | ||
| 274 | 	speed_t c_ospeed; /* output speed */ | ||
| 275 | }; | ||
| 276 | |||
| 277 | |||
| 278 | /* | ||
| 279 | * Commands passed to tcsetattr() for setting the termios structure. | ||
| 280 | */ | ||
| 281 | #define TCSANOW 0 /* make change immediate */ | ||
| 282 | #define TCSADRAIN 1 /* drain output, then change */ | ||
| 283 | #define TCSAFLUSH 2 /* drain output, flush input */ | ||
| 284 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 285 | #define TCSASOFT 0x10 /* flag - don't alter h.w. state */ | ||
| 286 | #endif | ||
| 287 | |||
| 288 | /* | ||
| 289 | * Standard speeds | ||
| 290 | */ | ||
| 291 | #define B0 0 | ||
| 292 | #define B50 50 | ||
| 293 | #define B75 75 | ||
| 294 | #define B110 110 | ||
| 295 | #define B134 134 | ||
| 296 | #define B150 150 | ||
| 297 | #define B200 200 | ||
| 298 | #define B300 300 | ||
| 299 | #define B600 600 | ||
| 300 | #define B1200 1200 | ||
| 301 | #define B1800 1800 | ||
| 302 | #define B2400 2400 | ||
| 303 | #define B4800 4800 | ||
| 304 | #define B9600 9600 | ||
| 305 | #define B19200 19200 | ||
| 306 | #define B38400 38400 | ||
| 307 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 308 | #define B7200 7200 | ||
| 309 | #define B14400 14400 | ||
| 310 | #define B28800 28800 | ||
| 311 | #define B57600 57600 | ||
| 312 | #define B76800 76800 | ||
| 313 | #define B115200 115200 | ||
| 314 | #define B230400 230400 | ||
| 315 | #define EXTA 19200 | ||
| 316 | #define EXTB 38400 | ||
| 317 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 318 | |||
| 319 | |||
| 320 | #define TCIFLUSH 1 | ||
| 321 | #define TCOFLUSH 2 | ||
| 322 | #define TCIOFLUSH 3 | ||
| 323 | #define TCOOFF 1 | ||
| 324 | #define TCOON 2 | ||
| 325 | #define TCIOFF 3 | ||
| 326 | #define TCION 4 | ||
| 327 | |||
| 328 | #include <sys/cdefs.h> | ||
| 329 | |||
| 330 | __BEGIN_DECLS | ||
| 331 | speed_t cfgetispeed(const struct termios *); | ||
| 332 | speed_t cfgetospeed(const struct termios *); | ||
| 333 | int cfsetispeed(struct termios *, speed_t); | ||
| 334 | int cfsetospeed(struct termios *, speed_t); | ||
| 335 | int tcgetattr(int, struct termios *); | ||
| 336 | int tcsetattr(int, int, const struct termios *); | ||
| 337 | int tcdrain(int) __DARWIN_ALIAS_C(tcdrain); | ||
| 338 | int tcflow(int, int); | ||
| 339 | int tcflush(int, int); | ||
| 340 | int tcsendbreak(int, int); | ||
| 341 | |||
| 342 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 343 | void cfmakeraw(struct termios *); | ||
| 344 | int cfsetspeed(struct termios *, speed_t); | ||
| 345 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 346 | __END_DECLS | ||
| 347 | |||
| 348 | |||
| 349 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 350 | |||
| 351 | /* | ||
| 352 | * Include tty ioctl's that aren't just for backwards compatibility | ||
| 353 | * with the old tty driver. These ioctl definitions were previously | ||
| 354 | * in <sys/ioctl.h>. | ||
| 355 | */ | ||
| 356 | #include <sys/ttycom.h> | ||
| 357 | #endif | ||
| 358 | |||
| 359 | /* | ||
| 360 | * END OF PROTECTED INCLUDE. | ||
| 361 | */ | ||
| 362 | #endif /* !_SYS_TERMIOS_H_ */ | ||
| 363 | |||
| 364 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 365 | #include <sys/ttydefaults.h> | ||
| 366 | #endif | ||
lib/libc/include/x86_64-macos-gnu/sys/time.h created+208| ... | @@ -0,0 +1,208 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1982, 1986, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)time.h	8.2 (Berkeley) 7/10/94 | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _SYS_TIME_H_ | ||
| 65 | #define _SYS_TIME_H_ | ||
| 66 | |||
| 67 | #include <sys/cdefs.h> | ||
| 68 | #include <sys/_types.h> | ||
| 69 | #include <Availability.h> | ||
| 70 | |||
| 71 | /* | ||
| 72 | * [XSI] The fd_set type shall be defined as described in <sys/select.h>. | ||
| 73 | * The timespec structure shall be defined as described in <time.h> | ||
| 74 | */ | ||
| 75 | #include <sys/_types/_fd_def.h> | ||
| 76 | #include <sys/_types/_timespec.h> | ||
| 77 | #include <sys/_types/_timeval.h> | ||
| 78 | |||
| 79 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 80 | #include <sys/_types/_timeval64.h> | ||
| 81 | #endif /* !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) */ | ||
| 82 | |||
| 83 | |||
| 84 | #include <sys/_types/_time_t.h> | ||
| 85 | #include <sys/_types/_suseconds_t.h> | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Structure used as a parameter by getitimer(2) and setitimer(2) system | ||
| 89 | * calls. | ||
| 90 | */ | ||
| 91 | struct itimerval { | ||
| 92 | 	struct timeval it_interval; /* timer interval */ | ||
| 93 | 	struct timeval it_value; /* current value */ | ||
| 94 | }; | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Names of the interval timers, and structure | ||
| 98 | * defining a timer setting. | ||
| 99 | */ | ||
| 100 | #define ITIMER_REAL 0 | ||
| 101 | #define ITIMER_VIRTUAL 1 | ||
| 102 | #define ITIMER_PROF 2 | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Select uses bit masks of file descriptors in longs. These macros | ||
| 106 | * manipulate such bit fields (the filesystem macros use chars). The | ||
| 107 | * extra protection here is to permit application redefinition above | ||
| 108 | * the default size. | ||
| 109 | */ | ||
| 110 | #include <sys/_types/_fd_setsize.h> | ||
| 111 | #include <sys/_types/_fd_set.h> | ||
| 112 | #include <sys/_types/_fd_clr.h> | ||
| 113 | #include <sys/_types/_fd_isset.h> | ||
| 114 | #include <sys/_types/_fd_zero.h> | ||
| 115 | |||
| 116 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 117 | |||
| 118 | #include <sys/_types/_fd_copy.h> | ||
| 119 | |||
| 120 | #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ | ||
| 121 | 	(ts)->tv_sec = (tv)->tv_sec; \ | ||
| 122 | 	(ts)->tv_nsec = (tv)->tv_usec * 1000; \ | ||
| 123 | } | ||
| 124 | #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ | ||
| 125 | 	(tv)->tv_sec = (ts)->tv_sec; \ | ||
| 126 | 	(tv)->tv_usec = (ts)->tv_nsec / 1000; \ | ||
| 127 | } | ||
| 128 | |||
| 129 | struct timezone { | ||
| 130 | 	int tz_minuteswest; /* minutes west of Greenwich */ | ||
| 131 | 	int tz_dsttime; /* type of dst correction */ | ||
| 132 | }; | ||
| 133 | #define DST_NONE 0 /* not on dst */ | ||
| 134 | #define DST_USA 1 /* USA style dst */ | ||
| 135 | #define DST_AUST 2 /* Australian style dst */ | ||
| 136 | #define DST_WET 3 /* Western European dst */ | ||
| 137 | #define DST_MET 4 /* Middle European dst */ | ||
| 138 | #define DST_EET 5 /* Eastern European dst */ | ||
| 139 | #define DST_CAN 6 /* Canada */ | ||
| 140 | |||
| 141 | /* Operations on timevals. */ | ||
| 142 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 | ||
| 143 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) | ||
| 144 | #define timercmp(tvp, uvp, cmp) \ | ||
| 145 | 	(((tvp)->tv_sec == (uvp)->tv_sec) ? \ | ||
| 146 | 	 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ | ||
| 147 | 	 ((tvp)->tv_sec cmp (uvp)->tv_sec)) | ||
| 148 | #define timeradd(tvp, uvp, vvp) \ | ||
| 149 | 	do { \ | ||
| 150 | 	 (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ | ||
| 151 | 	 (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ | ||
| 152 | 	 if ((vvp)->tv_usec >= 1000000) { \ | ||
| 153 | 	 (vvp)->tv_sec++; \ | ||
| 154 | 	 (vvp)->tv_usec -= 1000000; \ | ||
| 155 | 	 } \ | ||
| 156 | 	} while (0) | ||
| 157 | #define timersub(tvp, uvp, vvp) \ | ||
| 158 | 	do { \ | ||
| 159 | 	 (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ | ||
| 160 | 	 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ | ||
| 161 | 	 if ((vvp)->tv_usec < 0) { \ | ||
| 162 | 	 (vvp)->tv_sec--; \ | ||
| 163 | 	 (vvp)->tv_usec += 1000000; \ | ||
| 164 | 	 } \ | ||
| 165 | 	} while (0) | ||
| 166 | |||
| 167 | #define timevalcmp(l, r, cmp) timercmp(l, r, cmp) /* freebsd */ | ||
| 168 | |||
| 169 | /* | ||
| 170 | * Getkerninfo clock information structure | ||
| 171 | */ | ||
| 172 | struct clockinfo { | ||
| 173 | 	int hz; /* clock frequency */ | ||
| 174 | 	int tick; /* micro-seconds per hz tick */ | ||
| 175 | 	int tickadj; /* clock skew rate for adjtime() */ | ||
| 176 | 	int stathz; /* statistics clock frequency */ | ||
| 177 | 	int profhz; /* profiling clock frequency */ | ||
| 178 | }; | ||
| 179 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 184 | #include <time.h> | ||
| 185 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 186 | |||
| 187 | __BEGIN_DECLS | ||
| 188 | |||
| 189 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 190 | int adjtime(const struct timeval *, struct timeval *); | ||
| 191 | int futimes(int, const struct timeval *); | ||
| 192 | int lutimes(const char *, const struct timeval *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 193 | int settimeofday(const struct timeval *, const struct timezone *); | ||
| 194 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 195 | |||
| 196 | int getitimer(int, struct itimerval *); | ||
| 197 | int gettimeofday(struct timeval * __restrict, void * __restrict); | ||
| 198 | |||
| 199 | #include <sys/_select.h> /* select() prototype */ | ||
| 200 | |||
| 201 | int setitimer(int, const struct itimerval * __restrict, | ||
| 202 | struct itimerval * __restrict); | ||
| 203 | int utimes(const char *, const struct timeval *); | ||
| 204 | |||
| 205 | __END_DECLS | ||
| 206 | |||
| 207 | |||
| 208 | #endif /* !_SYS_TIME_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/times.h created+92| ... | @@ -0,0 +1,92 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1990, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | *	This product includes software developed by the University of | ||
| 49 | *	California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)times.h	8.4 (Berkeley) 1/21/94 | ||
| 67 | */ | ||
| 68 | |||
| 69 | #ifndef _SYS_TIMES_H_ | ||
| 70 | #define _SYS_TIMES_H_ | ||
| 71 | |||
| 72 | #include <sys/appleapiopts.h> | ||
| 73 | #include <sys/cdefs.h> | ||
| 74 | #include <sys/_types.h> | ||
| 75 | |||
| 76 | /* [XSI] The clock_t type shall be defined as described in <sys/types.h> */ | ||
| 77 | #include <sys/_types/_clock_t.h> | ||
| 78 | |||
| 79 | /* | ||
| 80 | * [XSI] Structure whose address is passed as the first parameter to times() | ||
| 81 | */ | ||
| 82 | struct tms { | ||
| 83 | 	clock_t tms_utime; /* [XSI] User CPU time */ | ||
| 84 | 	clock_t tms_stime; /* [XSI] System CPU time */ | ||
| 85 | 	clock_t tms_cutime; /* [XSI] Terminated children user CPU time */ | ||
| 86 | 	clock_t tms_cstime; /* [XSI] Terminated children System CPU time */ | ||
| 87 | }; | ||
| 88 | |||
| 89 | __BEGIN_DECLS | ||
| 90 | clock_t times(struct tms *); | ||
| 91 | __END_DECLS | ||
| 92 | #endif /* !_SYS_TIMES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/ttycom.h created+173| ... | @@ -0,0 +1,173 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1990, 1993, 1994 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | * This product includes software developed by the University of | ||
| 49 | * California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)ttycom.h	8.1 (Berkeley) 3/28/94 | ||
| 67 | */ | ||
| 68 | |||
| 69 | #ifndef _SYS_TTYCOM_H_ | ||
| 70 | #define _SYS_TTYCOM_H_ | ||
| 71 | |||
| 72 | #include <sys/ioccom.h> | ||
| 73 | /* | ||
| 74 | * Tty ioctl's except for those supported only for backwards compatibility | ||
| 75 | * with the old tty driver. | ||
| 76 | */ | ||
| 77 | |||
| 78 | /* | ||
| 79 | * Window/terminal size structure. This information is stored by the kernel | ||
| 80 | * in order to provide a consistent interface, but is not used by the kernel. | ||
| 81 | */ | ||
| 82 | struct winsize { | ||
| 83 | 	unsigned short ws_row; /* rows, in characters */ | ||
| 84 | 	unsigned short ws_col; /* columns, in characters */ | ||
| 85 | 	unsigned short ws_xpixel; /* horizontal size, pixels */ | ||
| 86 | 	unsigned short ws_ypixel; /* vertical size, pixels */ | ||
| 87 | }; | ||
| 88 | |||
| 89 | #define TIOCMODG _IOR('t', 3, int) /* get modem control state */ | ||
| 90 | #define TIOCMODS _IOW('t', 4, int) /* set modem control state */ | ||
| 91 | #define TIOCM_LE 0001 /* line enable */ | ||
| 92 | #define TIOCM_DTR 0002 /* data terminal ready */ | ||
| 93 | #define TIOCM_RTS 0004 /* request to send */ | ||
| 94 | #define TIOCM_ST 0010 /* secondary transmit */ | ||
| 95 | #define TIOCM_SR 0020 /* secondary receive */ | ||
| 96 | #define TIOCM_CTS 0040 /* clear to send */ | ||
| 97 | #define TIOCM_CAR 0100 /* carrier detect */ | ||
| 98 | #define TIOCM_CD TIOCM_CAR | ||
| 99 | #define TIOCM_RNG 0200 /* ring */ | ||
| 100 | #define TIOCM_RI TIOCM_RNG | ||
| 101 | #define TIOCM_DSR 0400 /* data set ready */ | ||
| 102 | /* 8-10 compat */ | ||
| 103 | #define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */ | ||
| 104 | #define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */ | ||
| 105 | /* 15 unused */ | ||
| 106 | #define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */ | ||
| 107 | /* 17-18 compat */ | ||
| 108 | #define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */ | ||
| 109 | #define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */ | ||
| 110 | #define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */ | ||
| 111 | #define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */ | ||
| 112 | #define TIOCGETD _IOR('t', 26, int) /* get line discipline */ | ||
| 113 | #define TIOCSETD _IOW('t', 27, int) /* set line discipline */ | ||
| 114 | #define TIOCIXON _IO('t', 129) /* internal input VSTART */ | ||
| 115 | #define TIOCIXOFF _IO('t', 128) /* internal input VSTOP */ | ||
| 116 | /* 127-124 compat */ | ||
| 117 | #define TIOCSBRK _IO('t', 123) /* set break bit */ | ||
| 118 | #define TIOCCBRK _IO('t', 122) /* clear break bit */ | ||
| 119 | #define TIOCSDTR _IO('t', 121) /* set data terminal ready */ | ||
| 120 | #define TIOCCDTR _IO('t', 120) /* clear data terminal ready */ | ||
| 121 | #define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ | ||
| 122 | #define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ | ||
| 123 | /* 117-116 compat */ | ||
| 124 | #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ | ||
| 125 | #define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ | ||
| 126 | #define TIOCNOTTY _IO('t', 113) /* void tty association */ | ||
| 127 | #define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ | ||
| 128 | #define TIOCPKT_DATA 0x00 /* data packet */ | ||
| 129 | #define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ | ||
| 130 | #define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ | ||
| 131 | #define TIOCPKT_STOP 0x04 /* stop output */ | ||
| 132 | #define TIOCPKT_START 0x08 /* start output */ | ||
| 133 | #define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ | ||
| 134 | #define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ | ||
| 135 | #define TIOCPKT_IOCTL 0x40 /* state change of pty driver */ | ||
| 136 | #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ | ||
| 137 | #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ | ||
| 138 | #define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ | ||
| 139 | #define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ | ||
| 140 | #define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ | ||
| 141 | #define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ | ||
| 142 | #define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */ | ||
| 143 | #define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ | ||
| 144 | #define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ | ||
| 145 | #define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ | ||
| 146 | #define TIOCSTAT _IO('t', 101) /* simulate ^T status message */ | ||
| 147 | #define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */ | ||
| 148 | #define TIOCSCONS _IO('t', 99) /* 4.2 compatibility */ | ||
| 149 | #define TIOCCONS _IOW('t', 98, int) /* become virtual console */ | ||
| 150 | #define TIOCSCTTY _IO('t', 97) /* become controlling tty */ | ||
| 151 | #define TIOCEXT _IOW('t', 96, int) /* pty: external processing */ | ||
| 152 | #define TIOCSIG _IO('t', 95) /* pty: generate signal */ | ||
| 153 | #define TIOCDRAIN _IO('t', 94) /* wait till output drained */ | ||
| 154 | #define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */ | ||
| 155 | #define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */ | ||
| 156 | #define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp | ||
| 157 | 	 * of last input event */ | ||
| 158 | #define TIOCDCDTIMESTAMP _IOR('t', 88, struct timeval) /* enable/get timestamp | ||
| 159 | 	 * of last DCd rise */ | ||
| 160 | #define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */ | ||
| 161 | #define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */ | ||
| 162 | #define TIOCDSIMICROCODE _IO('t', 85) /* download microcode to | ||
| 163 | 	 * DSI Softmodem */ | ||
| 164 | #define TIOCPTYGRANT _IO('t', 84) /* grantpt(3) */ | ||
| 165 | #define TIOCPTYGNAME _IOC(IOC_OUT, 't', 83, 128) /* ptsname(3) */ | ||
| 166 | #define TIOCPTYUNLK _IO('t', 82) /* unlockpt(3) */ | ||
| 167 | |||
| 168 | #define TTYDISC 0 /* termios tty line discipline */ | ||
| 169 | #define TABLDISC 3 /* tablet discipline */ | ||
| 170 | #define SLIPDISC 4 /* serial IP discipline */ | ||
| 171 | #define PPPDISC 5 /* PPP discipline */ | ||
| 172 | |||
| 173 | #endif /* !_SYS_TTYCOM_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/ttydefaults.h created+124| ... | @@ -0,0 +1,124 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | * This product includes software developed by the University of | ||
| 49 | * California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)ttydefaults.h	8.4 (Berkeley) 1/21/94 | ||
| 67 | */ | ||
| 68 | |||
| 69 | /* | ||
| 70 | * System wide defaults for terminal state. | ||
| 71 | */ | ||
| 72 | #ifndef _SYS_TTYDEFAULTS_H_ | ||
| 73 | #define _SYS_TTYDEFAULTS_H_ | ||
| 74 | |||
| 75 | /* | ||
| 76 | * Defaults on "first" open. | ||
| 77 | */ | ||
| 78 | #define TTYDEF_IFLAG (BRKINT	| ICRNL	| IMAXBEL | IXON | IXANY) | ||
| 79 | #define TTYDEF_OFLAG (OPOST | ONLCR) | ||
| 80 | #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) | ||
| 81 | #define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) | ||
| 82 | #define TTYDEF_SPEED (B9600) | ||
| 83 | |||
| 84 | /* | ||
| 85 | * Control Character Defaults | ||
| 86 | */ | ||
| 87 | #define CTRL(x) (x&037) | ||
| 88 | #define CEOF CTRL('d') | ||
| 89 | #define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */ | ||
| 90 | #define CERASE 0177 | ||
| 91 | #define CINTR CTRL('c') | ||
| 92 | #define CSTATUS CTRL('t') | ||
| 93 | #define CKILL CTRL('u') | ||
| 94 | #define CMIN 1 | ||
| 95 | #define CQUIT 034 /* FS, ^\ */ | ||
| 96 | #define CSUSP CTRL('z') | ||
| 97 | #define CTIME 0 | ||
| 98 | #define CDSUSP CTRL('y') | ||
| 99 | #define CSTART CTRL('q') | ||
| 100 | #define CSTOP CTRL('s') | ||
| 101 | #define CLNEXT CTRL('v') | ||
| 102 | #define CDISCARD CTRL('o') | ||
| 103 | #define CWERASE CTRL('w') | ||
| 104 | #define CREPRINT CTRL('r') | ||
| 105 | #define CEOT CEOF | ||
| 106 | /* compat */ | ||
| 107 | #define CBRK CEOL | ||
| 108 | #define CRPRNT CREPRINT | ||
| 109 | #define CFLUSH CDISCARD | ||
| 110 | |||
| 111 | /* PROTECTED INCLUSION ENDS HERE */ | ||
| 112 | #endif /* !_SYS_TTYDEFAULTS_H_ */ | ||
| 113 | |||
| 114 | /* | ||
| 115 | * #define TTYDEFCHARS to include an array of default control characters. | ||
| 116 | */ | ||
| 117 | #ifdef TTYDEFCHARS | ||
| 118 | static cc_t ttydefchars[NCCS] = { | ||
| 119 | 	CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, | ||
| 120 | 	_POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, | ||
| 121 | 	CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE | ||
| 122 | }; | ||
| 123 | #undef TTYDEFCHARS | ||
| 124 | #endif | ||
lib/libc/include/x86_64-macos-gnu/sys/types.h created+235| ... | @@ -0,0 +1,235 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1982, 1986, 1991, 1993, 1994 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * (c) UNIX System Laboratories, Inc. | ||
| 33 | * All or some portions of this file are derived from material licensed | ||
| 34 | * to the University of California by American Telephone and Telegraph | ||
| 35 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | ||
| 36 | * the permission of UNIX System Laboratories, Inc. | ||
| 37 | * | ||
| 38 | * Redistribution and use in source and binary forms, with or without | ||
| 39 | * modification, are permitted provided that the following conditions | ||
| 40 | * are met: | ||
| 41 | * 1. Redistributions of source code must retain the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer. | ||
| 43 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 44 | * notice, this list of conditions and the following disclaimer in the | ||
| 45 | * documentation and/or other materials provided with the distribution. | ||
| 46 | * 3. All advertising materials mentioning features or use of this software | ||
| 47 | * must display the following acknowledgement: | ||
| 48 | *	This product includes software developed by the University of | ||
| 49 | *	California, Berkeley and its contributors. | ||
| 50 | * 4. Neither the name of the University nor the names of its contributors | ||
| 51 | * may be used to endorse or promote products derived from this software | ||
| 52 | * without specific prior written permission. | ||
| 53 | * | ||
| 54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 64 | * SUCH DAMAGE. | ||
| 65 | * | ||
| 66 | *	@(#)types.h	8.4 (Berkeley) 1/21/94 | ||
| 67 | */ | ||
| 68 | |||
| 69 | #ifndef _SYS_TYPES_H_ | ||
| 70 | #define _SYS_TYPES_H_ | ||
| 71 | |||
| 72 | #include <sys/appleapiopts.h> | ||
| 73 | |||
| 74 | #ifndef __ASSEMBLER__ | ||
| 75 | #include <sys/cdefs.h> | ||
| 76 | |||
| 77 | /* Machine type dependent parameters. */ | ||
| 78 | #include <machine/types.h> | ||
| 79 | #include <sys/_types.h> | ||
| 80 | |||
| 81 | #include <machine/endian.h> | ||
| 82 | |||
| 83 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 84 | #include <sys/_types/_u_char.h> | ||
| 85 | #include <sys/_types/_u_short.h> | ||
| 86 | #include <sys/_types/_u_int.h> | ||
| 87 | #ifndef _U_LONG | ||
| 88 | typedef unsigned long u_long; | ||
| 89 | #define _U_LONG | ||
| 90 | #endif | ||
| 91 | typedef unsigned short ushort; /* Sys V compatibility */ | ||
| 92 | typedef unsigned int uint; /* Sys V compatibility */ | ||
| 93 | #endif | ||
| 94 | |||
| 95 | typedef u_int64_t u_quad_t; /* quads */ | ||
| 96 | typedef int64_t quad_t; | ||
| 97 | typedef quad_t * qaddr_t; | ||
| 98 | |||
| 99 | #include <sys/_types/_caddr_t.h> /* core address */ | ||
| 100 | |||
| 101 | typedef int32_t daddr_t; /* disk address */ | ||
| 102 | |||
| 103 | #include <sys/_types/_dev_t.h> /* device number */ | ||
| 104 | |||
| 105 | typedef u_int32_t fixpt_t; /* fixed point number */ | ||
| 106 | |||
| 107 | #include <sys/_types/_blkcnt_t.h> | ||
| 108 | #include <sys/_types/_blksize_t.h> | ||
| 109 | #include <sys/_types/_gid_t.h> | ||
| 110 | #include <sys/_types/_in_addr_t.h> | ||
| 111 | #include <sys/_types/_in_port_t.h> | ||
| 112 | #include <sys/_types/_ino_t.h> | ||
| 113 | |||
| 114 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 115 | #include <sys/_types/_ino64_t.h> /* 64bit inode number */ | ||
| 116 | #endif /* !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) */ | ||
| 117 | |||
| 118 | #include <sys/_types/_key_t.h> | ||
| 119 | #include <sys/_types/_mode_t.h> | ||
| 120 | #include <sys/_types/_nlink_t.h> | ||
| 121 | #include <sys/_types/_id_t.h> | ||
| 122 | #include <sys/_types/_pid_t.h> | ||
| 123 | #include <sys/_types/_off_t.h> | ||
| 124 | |||
| 125 | typedef int32_t segsz_t; /* segment size */ | ||
| 126 | typedef int32_t swblk_t; /* swap offset */ | ||
| 127 | |||
| 128 | #include <sys/_types/_uid_t.h> | ||
| 129 | |||
| 130 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 131 | /* Major, minor numbers, dev_t's. */ | ||
| 132 | #if defined(__cplusplus) | ||
| 133 | /* | ||
| 134 | * These lowercase macros tend to match member functions in some C++ code, | ||
| 135 | * so for C++, we must use inline functions instead. | ||
| 136 | */ | ||
| 137 | |||
| 138 | static inline __int32_t | ||
| 139 | major(__uint32_t _x) | ||
| 140 | { | ||
| 141 | 	return (__int32_t)(((__uint32_t)_x >> 24) & 0xff); | ||
| 142 | } | ||
| 143 | |||
| 144 | static inline __int32_t | ||
| 145 | minor(__uint32_t _x) | ||
| 146 | { | ||
| 147 | 	return (__int32_t)((_x) & 0xffffff); | ||
| 148 | } | ||
| 149 | |||
| 150 | static inline dev_t | ||
| 151 | makedev(__uint32_t _major, __uint32_t _minor) | ||
| 152 | { | ||
| 153 | 	return (dev_t)(((_major) << 24) | (_minor)); | ||
| 154 | } | ||
| 155 | |||
| 156 | #else /* !__cplusplus */ | ||
| 157 | |||
| 158 | #define major(x) ((int32_t)(((u_int32_t)(x) >> 24) & 0xff)) | ||
| 159 | #define minor(x) ((int32_t)((x) & 0xffffff)) | ||
| 160 | #define makedev(x, y) ((dev_t)(((x) << 24) | (y))) | ||
| 161 | |||
| 162 | #endif /* !__cplusplus */ | ||
| 163 | #endif /* !_POSIX_C_SOURCE */ | ||
| 164 | |||
| 165 | #include <sys/_types/_clock_t.h> | ||
| 166 | #include <sys/_types/_size_t.h> | ||
| 167 | #include <sys/_types/_ssize_t.h> | ||
| 168 | #include <sys/_types/_time_t.h> | ||
| 169 | |||
| 170 | #include <sys/_types/_useconds_t.h> | ||
| 171 | #include <sys/_types/_suseconds_t.h> | ||
| 172 | |||
| 173 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 174 | #include <sys/_types/_rsize_t.h> | ||
| 175 | #include <sys/_types/_errno_t.h> | ||
| 176 | #endif | ||
| 177 | |||
| 178 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 179 | /* | ||
| 180 | * This code is present here in order to maintain historical backward | ||
| 181 | * compatability, and is intended to be removed at some point in the | ||
| 182 | * future; please include <sys/select.h> instead. | ||
| 183 | */ | ||
| 184 | #include <sys/_types/_fd_def.h> | ||
| 185 | |||
| 186 | #define NBBY __DARWIN_NBBY /* bits in a byte */ | ||
| 187 | #define NFDBITS __DARWIN_NFDBITS /* bits per mask */ | ||
| 188 | #define howmany(x, y) __DARWIN_howmany(x, y) /* # y's == x bits? */ | ||
| 189 | typedef __int32_t fd_mask; | ||
| 190 | |||
| 191 | /* | ||
| 192 | * Select uses bit masks of file descriptors in longs. These macros | ||
| 193 | * manipulate such bit fields (the filesystem macros use chars). The | ||
| 194 | * extra protection here is to permit application redefinition above | ||
| 195 | * the default size. | ||
| 196 | */ | ||
| 197 | #include <sys/_types/_fd_setsize.h> | ||
| 198 | #include <sys/_types/_fd_set.h> | ||
| 199 | #include <sys/_types/_fd_clr.h> | ||
| 200 | #include <sys/_types/_fd_zero.h> | ||
| 201 | #include <sys/_types/_fd_isset.h> | ||
| 202 | |||
| 203 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 204 | #include <sys/_types/_fd_copy.h> | ||
| 205 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 206 | |||
| 207 | |||
| 208 | |||
| 209 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 210 | #endif /* __ASSEMBLER__ */ | ||
| 211 | |||
| 212 | |||
| 213 | #ifndef __POSIX_LIB__ | ||
| 214 | |||
| 215 | #include <sys/_pthread/_pthread_attr_t.h> | ||
| 216 | #include <sys/_pthread/_pthread_cond_t.h> | ||
| 217 | #include <sys/_pthread/_pthread_condattr_t.h> | ||
| 218 | #include <sys/_pthread/_pthread_mutex_t.h> | ||
| 219 | #include <sys/_pthread/_pthread_mutexattr_t.h> | ||
| 220 | #include <sys/_pthread/_pthread_once_t.h> | ||
| 221 | #include <sys/_pthread/_pthread_rwlock_t.h> | ||
| 222 | #include <sys/_pthread/_pthread_rwlockattr_t.h> | ||
| 223 | #include <sys/_pthread/_pthread_t.h> | ||
| 224 | |||
| 225 | #endif /* __POSIX_LIB__ */ | ||
| 226 | |||
| 227 | #include <sys/_pthread/_pthread_key_t.h> | ||
| 228 | |||
| 229 | |||
| 230 | /* statvfs and fstatvfs */ | ||
| 231 | |||
| 232 | #include <sys/_types/_fsblkcnt_t.h> | ||
| 233 | #include <sys/_types/_fsfilcnt_t.h> | ||
| 234 | |||
| 235 | #endif /* !_SYS_TYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/ucred.h created+116| ... | @@ -0,0 +1,116 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1989, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)ucred.h	8.4 (Berkeley) 1/9/95 | ||
| 62 | */ | ||
| 63 | /* | ||
| 64 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | ||
| 65 | * support for mandatory and extensible security protections. This notice | ||
| 66 | * is included in support of clause 2.2 (b) of the Apple Public License, | ||
| 67 | * Version 2.0. | ||
| 68 | */ | ||
| 69 | |||
| 70 | #ifndef _SYS_UCRED_H_ | ||
| 71 | #define _SYS_UCRED_H_ | ||
| 72 | |||
| 73 | #include <sys/appleapiopts.h> | ||
| 74 | #include <sys/cdefs.h> | ||
| 75 | #include <sys/param.h> | ||
| 76 | #include <bsm/audit.h> | ||
| 77 | |||
| 78 | struct label; | ||
| 79 | |||
| 80 | #ifdef __APPLE_API_UNSTABLE | ||
| 81 | struct ucred; | ||
| 82 | struct posix_cred; | ||
| 83 | |||
| 84 | #ifndef _KAUTH_CRED_T | ||
| 85 | #define _KAUTH_CRED_T | ||
| 86 | typedef struct ucred *kauth_cred_t; | ||
| 87 | typedef struct posix_cred *posix_cred_t; | ||
| 88 | #endif /* !_KAUTH_CRED_T */ | ||
| 89 | |||
| 90 | /* | ||
| 91 | * Credential flags that can be set on a credential | ||
| 92 | */ | ||
| 93 | #define CRF_NOMEMBERD 0x00000001 /* memberd opt out by setgroups() */ | ||
| 94 | #define CRF_MAC_ENFORCE 0x00000002 /* force entry through MAC Framework */ | ||
| 95 | /* also forces credential cache miss */ | ||
| 96 | |||
| 97 | /* | ||
| 98 | * This is the external representation of struct ucred. | ||
| 99 | */ | ||
| 100 | struct xucred { | ||
| 101 | 	u_int cr_version; /* structure layout version */ | ||
| 102 | 	uid_t cr_uid; /* effective user id */ | ||
| 103 | 	short cr_ngroups; /* number of advisory groups */ | ||
| 104 | 	gid_t cr_groups[NGROUPS]; /* advisory group list */ | ||
| 105 | }; | ||
| 106 | #define XUCRED_VERSION 0 | ||
| 107 | |||
| 108 | #define cr_gid cr_groups[0] | ||
| 109 | #define NOCRED ((kauth_cred_t )0) /* no credential available */ | ||
| 110 | #define FSCRED ((kauth_cred_t )-1) /* filesystem credential */ | ||
| 111 | |||
| 112 | #define IS_VALID_CRED(_cr) ((_cr) != NOCRED && (_cr) != FSCRED) | ||
| 113 | |||
| 114 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 115 | |||
| 116 | #endif /* !_SYS_UCRED_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/uio.h created+111| ... | @@ -0,0 +1,111 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2019 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1982, 1986, 1993, 1994 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)uio.h	8.5 (Berkeley) 2/22/94 | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _SYS_UIO_H_ | ||
| 65 | #define _SYS_UIO_H_ | ||
| 66 | |||
| 67 | #include <Availability.h> | ||
| 68 | #include <sys/cdefs.h> | ||
| 69 | #include <sys/_types.h> | ||
| 70 | #include <sys/_types/_off_t.h> | ||
| 71 | |||
| 72 | /* | ||
| 73 | * [XSI] The ssize_t and size_t types shall be defined as described | ||
| 74 | * in <sys/types.h>. | ||
| 75 | */ | ||
| 76 | #include <sys/_types/_size_t.h> | ||
| 77 | #include <sys/_types/_ssize_t.h> | ||
| 78 | |||
| 79 | /* | ||
| 80 | * [XSI] Structure whose address is passed as the second parameter to the | ||
| 81 | * readv(), preadv(), writev() and pwritev() functions. | ||
| 82 | */ | ||
| 83 | #include <sys/_types/_iovec_t.h> | ||
| 84 | |||
| 85 | |||
| 86 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 87 | /* | ||
| 88 | * IO direction for uio_t. | ||
| 89 | *	UIO_READ - data moves into iovec(s) associated with uio_t | ||
| 90 | *	UIO_WRITE - data moves out of iovec(s) associated with uio_t | ||
| 91 | */ | ||
| 92 | enum uio_rw { UIO_READ, UIO_WRITE }; | ||
| 93 | #endif | ||
| 94 | |||
| 95 | |||
| 96 | |||
| 97 | __BEGIN_DECLS | ||
| 98 | ssize_t readv(int, const struct iovec *, int) __DARWIN_ALIAS_C(readv); | ||
| 99 | ssize_t writev(int, const struct iovec *, int) __DARWIN_ALIAS_C(writev); | ||
| 100 | |||
| 101 | #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) | ||
| 102 | |||
| 103 | ssize_t preadv(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(preadv) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)); | ||
| 104 | ssize_t pwritev(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(pwritev) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)); | ||
| 105 | |||
| 106 | #endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */ | ||
| 107 | |||
| 108 | __END_DECLS | ||
| 109 | |||
| 110 | |||
| 111 | #endif /* !_SYS_UIO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/un.h created+106| ... | @@ -0,0 +1,106 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* | ||
| 29 | * Copyright (c) 1982, 1986, 1993 | ||
| 30 | *	The Regents of the University of California. All rights reserved. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | *	This product includes software developed by the University of | ||
| 43 | *	California, Berkeley and its contributors. | ||
| 44 | * 4. Neither the name of the University nor the names of its contributors | ||
| 45 | * may be used to endorse or promote products derived from this software | ||
| 46 | * without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 58 | * SUCH DAMAGE. | ||
| 59 | * | ||
| 60 | *	@(#)un.h	8.3 (Berkeley) 2/19/95 | ||
| 61 | */ | ||
| 62 | |||
| 63 | #ifndef _SYS_UN_H_ | ||
| 64 | #define _SYS_UN_H_ | ||
| 65 | |||
| 66 | #include <sys/appleapiopts.h> | ||
| 67 | #include <sys/cdefs.h> | ||
| 68 | #include <sys/_types.h> | ||
| 69 | |||
| 70 | /* [XSI] The sa_family_t type shall be defined as described in <sys/socket.h> */ | ||
| 71 | #include <sys/_types/_sa_family_t.h> | ||
| 72 | |||
| 73 | /* | ||
| 74 | * [XSI] Definitions for UNIX IPC domain. | ||
| 75 | */ | ||
| 76 | struct sockaddr_un { | ||
| 77 | 	unsigned char sun_len; /* sockaddr len including null */ | ||
| 78 | 	sa_family_t sun_family; /* [XSI] AF_UNIX */ | ||
| 79 | 	char sun_path[104]; /* [XSI] path name (gag) */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 83 | |||
| 84 | /* Level number of get/setsockopt for local domain sockets */ | ||
| 85 | #define SOL_LOCAL 0 | ||
| 86 | |||
| 87 | /* Socket options. */ | ||
| 88 | #define LOCAL_PEERCRED 0x001 /* retrieve peer credentials */ | ||
| 89 | #define LOCAL_PEERPID 0x002 /* retrieve peer pid */ | ||
| 90 | #define LOCAL_PEEREPID 0x003 /* retrieve eff. peer pid */ | ||
| 91 | #define LOCAL_PEERUUID 0x004 /* retrieve peer UUID */ | ||
| 92 | #define LOCAL_PEEREUUID 0x005 /* retrieve eff. peer UUID */ | ||
| 93 | #define LOCAL_PEERTOKEN 0x006 /* retrieve peer audit token */ | ||
| 94 | |||
| 95 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 100 | /* actual length of an initialized sockaddr_un */ | ||
| 101 | #define SUN_LEN(su) \ | ||
| 102 | 	(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) | ||
| 103 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 104 | |||
| 105 | |||
| 106 | #endif /* !_SYS_UN_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/unistd.h created+218| ... | @@ -0,0 +1,218 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2013 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1989, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)unistd.h	8.2 (Berkeley) 1/7/94 | ||
| 62 | */ | ||
| 63 | |||
| 64 | #ifndef _SYS_UNISTD_H_ | ||
| 65 | #define _SYS_UNISTD_H_ | ||
| 66 | |||
| 67 | #include <sys/cdefs.h> | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Although we have saved user/group IDs, we do not use them in setuid | ||
| 71 | * as described in POSIX 1003.1, because the feature does not work for | ||
| 72 | * root. We use the saved IDs in seteuid/setegid, which are not currently | ||
| 73 | * part of the POSIX 1003.1 specification. | ||
| 74 | */ | ||
| 75 | #ifdef _NOT_AVAILABLE | ||
| 76 | #define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */ | ||
| 77 | #endif | ||
| 78 | |||
| 79 | #define _POSIX_VERSION 200112L | ||
| 80 | #define _POSIX2_VERSION 200112L | ||
| 81 | |||
| 82 | /* execution-time symbolic constants */ | ||
| 83 | /* may disable terminal special characters */ | ||
| 84 | #include <sys/_types/_posix_vdisable.h> | ||
| 85 | |||
| 86 | #define _POSIX_THREAD_KEYS_MAX 128 | ||
| 87 | |||
| 88 | /* access function */ | ||
| 89 | #define F_OK 0 /* test for existence of file */ | ||
| 90 | #define X_OK (1<<0) /* test for execute or search permission */ | ||
| 91 | #define W_OK (1<<1) /* test for write permission */ | ||
| 92 | #define R_OK (1<<2) /* test for read permission */ | ||
| 93 | |||
| 94 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 95 | /* | ||
| 96 | * Extended access functions. | ||
| 97 | * Note that we depend on these matching the definitions in sys/kauth.h, | ||
| 98 | * but with the bits shifted left by 8. | ||
| 99 | */ | ||
| 100 | #define _READ_OK (1<<9) /* read file data / read directory */ | ||
| 101 | #define _WRITE_OK (1<<10) /* write file data / add file to directory */ | ||
| 102 | #define _EXECUTE_OK (1<<11) /* execute file / search in directory*/ | ||
| 103 | #define _DELETE_OK (1<<12) /* delete file / delete directory */ | ||
| 104 | #define _APPEND_OK (1<<13) /* append to file / add subdirectory to directory */ | ||
| 105 | #define _RMFILE_OK (1<<14) /* - / remove file from directory */ | ||
| 106 | #define _RATTR_OK (1<<15) /* read basic attributes */ | ||
| 107 | #define _WATTR_OK (1<<16) /* write basic attributes */ | ||
| 108 | #define _REXT_OK (1<<17) /* read extended attributes */ | ||
| 109 | #define _WEXT_OK (1<<18) /* write extended attributes */ | ||
| 110 | #define _RPERM_OK (1<<19) /* read permissions */ | ||
| 111 | #define _WPERM_OK (1<<20) /* write permissions */ | ||
| 112 | #define _CHOWN_OK (1<<21) /* change ownership */ | ||
| 113 | |||
| 114 | #define _ACCESS_EXTENDED_MASK (_READ_OK | _WRITE_OK | _EXECUTE_OK | \ | ||
| 115 | 	 _DELETE_OK | _APPEND_OK | \ | ||
| 116 | 	 _RMFILE_OK | _REXT_OK | \ | ||
| 117 | 	 _WEXT_OK | _RATTR_OK | _WATTR_OK | _RPERM_OK | \ | ||
| 118 | 	 _WPERM_OK | _CHOWN_OK) | ||
| 119 | #endif | ||
| 120 | |||
| 121 | /* whence values for lseek(2) */ | ||
| 122 | #include <sys/_types/_seek_set.h> | ||
| 123 | |||
| 124 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 125 | /* whence values for lseek(2); renamed by POSIX 1003.1 */ | ||
| 126 | #define L_SET SEEK_SET | ||
| 127 | #define L_INCR SEEK_CUR | ||
| 128 | #define L_XTND SEEK_END | ||
| 129 | #endif | ||
| 130 | |||
| 131 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 132 | struct accessx_descriptor { | ||
| 133 | 	unsigned int ad_name_offset; | ||
| 134 | 	int ad_flags; | ||
| 135 | 	int ad_pad[2]; | ||
| 136 | }; | ||
| 137 | #define ACCESSX_MAX_DESCRIPTORS 100 | ||
| 138 | #define ACCESSX_MAX_TABLESIZE (16 * 1024) | ||
| 139 | #endif | ||
| 140 | |||
| 141 | /* configurable pathname variables */ | ||
| 142 | #define _PC_LINK_MAX 1 | ||
| 143 | #define _PC_MAX_CANON 2 | ||
| 144 | #define _PC_MAX_INPUT 3 | ||
| 145 | #define _PC_NAME_MAX 4 | ||
| 146 | #define _PC_PATH_MAX 5 | ||
| 147 | #define _PC_PIPE_BUF 6 | ||
| 148 | #define _PC_CHOWN_RESTRICTED 7 | ||
| 149 | #define _PC_NO_TRUNC 8 | ||
| 150 | #define _PC_VDISABLE 9 | ||
| 151 | |||
| 152 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 153 | #define _PC_NAME_CHARS_MAX 10 | ||
| 154 | #define _PC_CASE_SENSITIVE 11 | ||
| 155 | #define _PC_CASE_PRESERVING 12 | ||
| 156 | #define _PC_EXTENDED_SECURITY_NP 13 | ||
| 157 | #define _PC_AUTH_OPAQUE_NP 14 | ||
| 158 | #endif | ||
| 159 | |||
| 160 | #define _PC_2_SYMLINKS 15 /* Symlink supported in directory */ | ||
| 161 | #define _PC_ALLOC_SIZE_MIN 16 /* Minimum storage actually allocated */ | ||
| 162 | #define _PC_ASYNC_IO 17 /* Async I/O [AIO] supported? */ | ||
| 163 | #define _PC_FILESIZEBITS 18 /* # of bits to represent file size */ | ||
| 164 | #define _PC_PRIO_IO 19 /* Priority I/O [PIO] supported? */ | ||
| 165 | #define _PC_REC_INCR_XFER_SIZE 20 /* Recommended increment for next two */ | ||
| 166 | #define _PC_REC_MAX_XFER_SIZE 21 /* Recommended max file transfer size */ | ||
| 167 | #define _PC_REC_MIN_XFER_SIZE 22 /* Recommended min file transfer size */ | ||
| 168 | #define _PC_REC_XFER_ALIGN 23 /* Recommended buffer alignment */ | ||
| 169 | #define _PC_SYMLINK_MAX 24 /* Max # of bytes in symlink name */ | ||
| 170 | #define _PC_SYNC_IO 25 /* Sync I/O [SIO] supported? */ | ||
| 171 | #define _PC_XATTR_SIZE_BITS 26 /* # of bits to represent maximum xattr size */ | ||
| 172 | #define _PC_MIN_HOLE_SIZE 27 /* Recommended minimum hole size for sparse files */ | ||
| 173 | |||
| 174 | /* configurable system strings */ | ||
| 175 | #define _CS_PATH 1 | ||
| 176 | |||
| 177 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 178 | |||
| 179 | #include <machine/_types.h> | ||
| 180 | #include <sys/_types/_size_t.h> | ||
| 181 | #include <_types/_uint64_t.h> | ||
| 182 | #include <_types/_uint32_t.h> | ||
| 183 | #include <Availability.h> | ||
| 184 | |||
| 185 | __BEGIN_DECLS | ||
| 186 | |||
| 187 | int getattrlistbulk(int, void *, void *, size_t, uint64_t) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 188 | int getattrlistat(int, const char *, void *, void *, size_t, unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 189 | int setattrlistat(int, const char *, void *, void *, size_t, uint32_t) __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 190 | |||
| 191 | __END_DECLS | ||
| 192 | |||
| 193 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 194 | |||
| 195 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 196 | |||
| 197 | #include <machine/_types.h> | ||
| 198 | #include <sys/_types/_size_t.h> | ||
| 199 | #include <sys/_types/_ssize_t.h> | ||
| 200 | #include <sys/_types.h> | ||
| 201 | #include <sys/_types/_uid_t.h> | ||
| 202 | #include <sys/_types/_gid_t.h> | ||
| 203 | #include <Availability.h> | ||
| 204 | |||
| 205 | __BEGIN_DECLS | ||
| 206 | |||
| 207 | int faccessat(int, const char *, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 208 | int fchownat(int, const char *, uid_t, gid_t, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 209 | int linkat(int, const char *, int, const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 210 | ssize_t readlinkat(int, const char *, char *, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 211 | int symlinkat(const char *, int, const char *) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 212 | int unlinkat(int, const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); | ||
| 213 | |||
| 214 | __END_DECLS | ||
| 215 | |||
| 216 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 217 | |||
| 218 | #endif /* !_SYS_UNISTD_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/sys/utsname.h created+86| ... | @@ -0,0 +1,86 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright 1993,1995 NeXT Computer Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1994 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * This code is derived from software contributed to Berkeley by | ||
| 34 | * Chuck Karish of Mindcraft, Inc. | ||
| 35 | * | ||
| 36 | * Redistribution and use in source and binary forms, with or without | ||
| 37 | * modification, are permitted provided that the following conditions | ||
| 38 | * are met: | ||
| 39 | * 1. Redistributions of source code must retain the above copyright | ||
| 40 | * notice, this list of conditions and the following disclaimer. | ||
| 41 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 42 | * notice, this list of conditions and the following disclaimer in the | ||
| 43 | * documentation and/or other materials provided with the distribution. | ||
| 44 | * 3. All advertising materials mentioning features or use of this software | ||
| 45 | * must display the following acknowledgement: | ||
| 46 | *	This product includes software developed by the University of | ||
| 47 | *	California, Berkeley and its contributors. | ||
| 48 | * 4. Neither the name of the University nor the names of its contributors | ||
| 49 | * may be used to endorse or promote products derived from this software | ||
| 50 | * without specific prior written permission. | ||
| 51 | * | ||
| 52 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 53 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 55 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 58 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 60 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 61 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 62 | * SUCH DAMAGE. | ||
| 63 | * | ||
| 64 | *	@(#)utsname.h	8.1 (Berkeley) 1/4/94 | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _SYS_UTSNAME_H | ||
| 68 | #define _SYS_UTSNAME_H | ||
| 69 | |||
| 70 | #include <sys/cdefs.h> | ||
| 71 | |||
| 72 | #define _SYS_NAMELEN 256 | ||
| 73 | |||
| 74 | struct utsname { | ||
| 75 | 	char sysname[_SYS_NAMELEN]; /* [XSI] Name of OS */ | ||
| 76 | 	char nodename[_SYS_NAMELEN]; /* [XSI] Name of this network node */ | ||
| 77 | 	char release[_SYS_NAMELEN]; /* [XSI] Release level */ | ||
| 78 | 	char version[_SYS_NAMELEN]; /* [XSI] Version level */ | ||
| 79 | 	char machine[_SYS_NAMELEN]; /* [XSI] Hardware type */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | __BEGIN_DECLS | ||
| 83 | int uname(struct utsname *); | ||
| 84 | __END_DECLS | ||
| 85 | |||
| 86 | #endif /* !_SYS_UTSNAME_H */ | ||
lib/libc/include/x86_64-macos-gnu/sys/vm.h created+89| ... | @@ -0,0 +1,89 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /* | ||
| 30 | * Copyright (c) 1991, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)vm.h	8.5 (Berkeley) 5/11/95 | ||
| 62 | */ | ||
| 63 | /* HISTORY | ||
| 64 | * 05-Jun-95 Mac Gillon (mgillon) at NeXT | ||
| 65 | * 4.4 code uses this file to import MACH API | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _SYS_VM_H | ||
| 69 | #define _SYS_VM_H | ||
| 70 | |||
| 71 | #include <sys/appleapiopts.h> | ||
| 72 | #include <sys/cdefs.h> | ||
| 73 | |||
| 74 | |||
| 75 | #include <sys/_types/_caddr_t.h> /* caddr_t */ | ||
| 76 | #include <sys/_types/_int32_t.h> /* int32_t */ | ||
| 77 | |||
| 78 | /* just to keep kinfo_proc happy */ | ||
| 79 | /* NOTE: Pointer fields are size variant for LP64 */ | ||
| 80 | struct vmspace { | ||
| 81 | 	int32_t dummy; | ||
| 82 | 	caddr_t dummy2; | ||
| 83 | 	int32_t dummy3[5]; | ||
| 84 | 	caddr_t dummy4[3]; | ||
| 85 | }; | ||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | #endif /* _SYS_VM_H */ | ||
lib/libc/include/x86_64-macos-gnu/sysexits.h created+118| ... | @@ -0,0 +1,118 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 1987, 1993 | ||
| 3 | *	The Regents of the University of California. All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer in the | ||
| 12 | * documentation and/or other materials provided with the distribution. | ||
| 13 | * 3. All advertising materials mentioning features or use of this software | ||
| 14 | * must display the following acknowledgement: | ||
| 15 | *	This product includes software developed by the University of | ||
| 16 | *	California, Berkeley and its contributors. | ||
| 17 | * 4. Neither the name of the University nor the names of its contributors | ||
| 18 | * may be used to endorse or promote products derived from this software | ||
| 19 | * without specific prior written permission. | ||
| 20 | * | ||
| 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 31 | * SUCH DAMAGE. | ||
| 32 | * | ||
| 33 | *	@(#)sysexits.h	8.1 (Berkeley) 6/2/93 | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef	_SYSEXITS_H_ | ||
| 37 | #define	_SYSEXITS_H_ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * SYSEXITS.H -- Exit status codes for system programs. | ||
| 41 | * | ||
| 42 | *	This include file attempts to categorize possible error | ||
| 43 | *	exit statuses for system programs, notably delivermail | ||
| 44 | *	and the Berkeley network. | ||
| 45 | * | ||
| 46 | *	Error numbers begin at EX__BASE to reduce the possibility of | ||
| 47 | *	clashing with other exit statuses that random programs may | ||
| 48 | *	already return. The meaning of the codes is approximately | ||
| 49 | *	as follows: | ||
| 50 | * | ||
| 51 | *	EX_USAGE -- The command was used incorrectly, e.g., with | ||
| 52 | *		the wrong number of arguments, a bad flag, a bad | ||
| 53 | *		syntax in a parameter, or whatever. | ||
| 54 | *	EX_DATAERR -- The input data was incorrect in some way. | ||
| 55 | *		This should only be used for user's data & not | ||
| 56 | *		system files. | ||
| 57 | *	EX_NOINPUT -- An input file (not a system file) did not | ||
| 58 | *		exist or was not readable. This could also include | ||
| 59 | *		errors like "No message" to a mailer (if it cared | ||
| 60 | *		to catch it). | ||
| 61 | *	EX_NOUSER -- The user specified did not exist. This might | ||
| 62 | *		be used for mail addresses or remote logins. | ||
| 63 | *	EX_NOHOST -- The host specified did not exist. This is used | ||
| 64 | *		in mail addresses or network requests. | ||
| 65 | *	EX_UNAVAILABLE -- A service is unavailable. This can occur | ||
| 66 | *		if a support program or file does not exist. This | ||
| 67 | *		can also be used as a catchall message when something | ||
| 68 | *		you wanted to do doesn't work, but you don't know | ||
| 69 | *		why. | ||
| 70 | *	EX_SOFTWARE -- An internal software error has been detected. | ||
| 71 | *		This should be limited to non-operating system related | ||
| 72 | *		errors as possible. | ||
| 73 | *	EX_OSERR -- An operating system error has been detected. | ||
| 74 | *		This is intended to be used for such things as "cannot | ||
| 75 | *		fork", "cannot create pipe", or the like. It includes | ||
| 76 | *		things like getuid returning a user that does not | ||
| 77 | *		exist in the passwd file. | ||
| 78 | *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp, | ||
| 79 | *		etc.) does not exist, cannot be opened, or has some | ||
| 80 | *		sort of error (e.g., syntax error). | ||
| 81 | *	EX_CANTCREAT -- A (user specified) output file cannot be | ||
| 82 | *		created. | ||
| 83 | *	EX_IOERR -- An error occurred while doing I/O on some file. | ||
| 84 | *	EX_TEMPFAIL -- temporary failure, indicating something that | ||
| 85 | *		is not really an error. In sendmail, this means | ||
| 86 | *		that a mailer (e.g.) could not create a connection, | ||
| 87 | *		and the request should be reattempted later. | ||
| 88 | *	EX_PROTOCOL -- the remote system returned something that | ||
| 89 | *		was "not possible" during a protocol exchange. | ||
| 90 | *	EX_NOPERM -- You did not have sufficient permission to | ||
| 91 | *		perform the operation. This is not intended for | ||
| 92 | *		file system problems, which should use NOINPUT or | ||
| 93 | *		CANTCREAT, but rather for higher level permissions. | ||
| 94 | */ | ||
| 95 | |||
| 96 | #define EX_OK		0	/* successful termination */ | ||
| 97 | |||
| 98 | #define EX__BASE	64	/* base value for error messages */ | ||
| 99 | |||
| 100 | #define EX_USAGE	64	/* command line usage error */ | ||
| 101 | #define EX_DATAERR	65	/* data format error */ | ||
| 102 | #define EX_NOINPUT	66	/* cannot open input */ | ||
| 103 | #define EX_NOUSER	67	/* addressee unknown */ | ||
| 104 | #define EX_NOHOST	68	/* host name unknown */ | ||
| 105 | #define EX_UNAVAILABLE	69	/* service unavailable */ | ||
| 106 | #define EX_SOFTWARE	70	/* internal software error */ | ||
| 107 | #define EX_OSERR	71	/* system error (e.g., can't fork) */ | ||
| 108 | #define EX_OSFILE	72	/* critical OS file missing */ | ||
| 109 | #define EX_CANTCREAT	73	/* can't create (user) output file */ | ||
| 110 | #define EX_IOERR	74	/* input/output error */ | ||
| 111 | #define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */ | ||
| 112 | #define EX_PROTOCOL	76	/* remote error in protocol */ | ||
| 113 | #define EX_NOPERM	77	/* permission denied */ | ||
| 114 | #define EX_CONFIG	78	/* configuration error */ | ||
| 115 | |||
| 116 | #define EX__MAX	78	/* maximum listed value */ | ||
| 117 | |||
| 118 | #endif /* !_SYSEXITS_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/syslog.h created+24| ... | @@ -0,0 +1,24 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #include <sys/syslog.h> | ||
| 24 | |||
lib/libc/include/x86_64-macos-gnu/tar.h created+73| ... | @@ -0,0 +1,73 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 1994 | ||
| 3 | *	The Regents of the University of California. All rights reserved. | ||
| 4 | * | ||
| 5 | * This code is derived from software contributed to Berkeley by | ||
| 6 | * Chuck Karish of Mindcraft, Inc. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. All advertising materials mentioning features or use of this software | ||
| 17 | * must display the following acknowledgement: | ||
| 18 | *	This product includes software developed by the University of | ||
| 19 | *	California, Berkeley and its contributors. | ||
| 20 | * 4. Neither the name of the University nor the names of its contributors | ||
| 21 | * may be used to endorse or promote products derived from this software | ||
| 22 | * without specific prior written permission. | ||
| 23 | * | ||
| 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 34 | * SUCH DAMAGE. | ||
| 35 | * | ||
| 36 | *	@(#)tar.h	8.2 (Berkeley) 1/4/94 | ||
| 37 | */ | ||
| 38 | |||
| 39 | #ifndef _TAR_H | ||
| 40 | #define _TAR_H | ||
| 41 | |||
| 42 | #define	TMAGIC		"ustar"	/* ustar and a null */ | ||
| 43 | #define	TMAGLEN		6 | ||
| 44 | #define	TVERSION	"00"	/* 00 and no null */ | ||
| 45 | #define	TVERSLEN	2 | ||
| 46 | |||
| 47 | /* Values used in typeflag field */ | ||
| 48 | #define	REGTYPE		'0'	/* Regular file */ | ||
| 49 | #define	AREGTYPE	'\0'	/* Regular file */ | ||
| 50 | #define	LNKTYPE		'1'	/* Link */ | ||
| 51 | #define	SYMTYPE		'2'	/* Reserved */ | ||
| 52 | #define	CHRTYPE		'3'	/* Character special */ | ||
| 53 | #define	BLKTYPE		'4'	/* Block special */ | ||
| 54 | #define	DIRTYPE		'5'	/* Directory */ | ||
| 55 | #define	FIFOTYPE	'6'	/* FIFO special */ | ||
| 56 | #define	CONTTYPE	'7'	/* Reserved */ | ||
| 57 | |||
| 58 | /* Bits used in the mode field - values in octal */ | ||
| 59 | #define	TSUID		04000	/* Set UID on execution */ | ||
| 60 | #define	TSGID		02000	/* Set GID on execution */ | ||
| 61 | #define	TSVTX		01000	/* Reserved */ | ||
| 62 | 				/* File permissions */ | ||
| 63 | #define	TUREAD		00400	/* Read by owner */ | ||
| 64 | #define	TUWRITE		00200	/* Write by owner */ | ||
| 65 | #define	TUEXEC		00100	/* Execute/Search by owner */ | ||
| 66 | #define	TGREAD		00040	/* Read by group */ | ||
| 67 | #define	TGWRITE		00020	/* Write by group */ | ||
| 68 | #define	TGEXEC		00010	/* Execute/Search by group */ | ||
| 69 | #define	TOREAD		00004	/* Read by other */ | ||
| 70 | #define	TOWRITE		00002	/* Write by other */ | ||
| 71 | #define	TOEXEC		00001	/* Execute/Search by other */ | ||
| 72 | |||
| 73 | #endif | ||
lib/libc/include/x86_64-macos-gnu/termios.h created+35| ... | @@ -0,0 +1,35 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | #ifndef __TERMIOS_H__ | ||
| 24 | #define __TERMIOS_H__ | ||
| 25 | |||
| 26 | #include <sys/cdefs.h> | ||
| 27 | #include <sys/termios.h> | ||
| 28 | #include <_types.h> | ||
| 29 | #include <sys/_types/_pid_t.h> | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | pid_t	tcgetsid(int); | ||
| 33 | __END_DECLS | ||
| 34 | |||
| 35 | #endif /* __TERMIOS_H__ */ | ||
lib/libc/include/x86_64-macos-gnu/ulimit.h created+41| ... | @@ -0,0 +1,41 @@ | ||
| 1 | /*- | ||
| 2 | * Copyright (c) 2002 Kyle Martin <mkm@ieee.org> | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer in the | ||
| 12 | * documentation and/or other materials provided with the distribution. | ||
| 13 | * | ||
| 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
| 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 24 | * SUCH DAMAGE. | ||
| 25 | * | ||
| 26 | * $FreeBSD: src/include/ulimit.h,v 1.4 2003/01/08 01:18:13 tjr Exp $ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _ULIMIT_H_ | ||
| 30 | #define	_ULIMIT_H_ | ||
| 31 | |||
| 32 | #include <sys/cdefs.h> | ||
| 33 | |||
| 34 | #define	UL_GETFSIZE	1 | ||
| 35 | #define	UL_SETFSIZE	2 | ||
| 36 | |||
| 37 | __BEGIN_DECLS | ||
| 38 | long	ulimit(int, ...); | ||
| 39 | __END_DECLS | ||
| 40 | |||
| 41 | #endif /* !_ULIMIT_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/unistd.h created+787| ... | @@ -0,0 +1,787 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved | ||
| 25 | * Copyright (c) 1991, 1993, 1994 | ||
| 26 | *	The Regents of the University of California. All rights reserved. | ||
| 27 | * | ||
| 28 | * Redistribution and use in source and binary forms, with or without | ||
| 29 | * modification, are permitted provided that the following conditions | ||
| 30 | * are met: | ||
| 31 | * 1. Redistributions of source code must retain the above copyright | ||
| 32 | * notice, this list of conditions and the following disclaimer. | ||
| 33 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 34 | * notice, this list of conditions and the following disclaimer in the | ||
| 35 | * documentation and/or other materials provided with the distribution. | ||
| 36 | * 3. All advertising materials mentioning features or use of this software | ||
| 37 | * must display the following acknowledgement: | ||
| 38 | *	This product includes software developed by the University of | ||
| 39 | *	California, Berkeley and its contributors. | ||
| 40 | * 4. Neither the name of the University nor the names of its contributors | ||
| 41 | * may be used to endorse or promote products derived from this software | ||
| 42 | * without specific prior written permission. | ||
| 43 | * | ||
| 44 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 45 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 46 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 47 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 48 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 49 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 50 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 51 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 52 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 53 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 54 | * SUCH DAMAGE. | ||
| 55 | * | ||
| 56 | *	@(#)unistd.h	8.12 (Berkeley) 4/27/95 | ||
| 57 | * | ||
| 58 | * Copyright (c) 1998 Apple Compter, Inc. | ||
| 59 | * All Rights Reserved | ||
| 60 | */ | ||
| 61 | |||
| 62 | /* History: | ||
| 63 | 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr | ||
| 64 | 3/26/98 CHW at Apple added real interface to searchfs call | ||
| 65 | 	3/5/98 CHW at Apple added hfs semantic system calls headers | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _UNISTD_H_ | ||
| 69 | #define	_UNISTD_H_ | ||
| 70 | |||
| 71 | #include <_types.h> | ||
| 72 | #include <sys/unistd.h> | ||
| 73 | #include <Availability.h> | ||
| 74 | #include <sys/_types/_gid_t.h> | ||
| 75 | #include <sys/_types/_intptr_t.h> | ||
| 76 | #include <sys/_types/_off_t.h> | ||
| 77 | #include <sys/_types/_pid_t.h> | ||
| 78 | /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: | ||
| 79 | * _GCC_SIZE_T */ | ||
| 80 | #include <sys/_types/_size_t.h> | ||
| 81 | #include <sys/_types/_ssize_t.h> | ||
| 82 | #include <sys/_types/_uid_t.h> | ||
| 83 | #include <sys/_types/_useconds_t.h> | ||
| 84 | #include <sys/_types/_null.h> | ||
| 85 | |||
| 86 | #define	 STDIN_FILENO	0	/* standard input file descriptor */ | ||
| 87 | #define	STDOUT_FILENO	1	/* standard output file descriptor */ | ||
| 88 | #define	STDERR_FILENO	2	/* standard error file descriptor */ | ||
| 89 | |||
| 90 | |||
| 91 | /* Version test macros */ | ||
| 92 | /* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ | ||
| 93 | #define	_XOPEN_VERSION			600		/* [XSI] */ | ||
| 94 | #define	_XOPEN_XCU_VERSION		4		/* Older standard */ | ||
| 95 | |||
| 96 | |||
| 97 | /* Please keep this list in the same order as the applicable standard */ | ||
| 98 | #define	_POSIX_ADVISORY_INFO		(-1)		/* [ADV] */ | ||
| 99 | #define	_POSIX_ASYNCHRONOUS_IO		(-1)		/* [AIO] */ | ||
| 100 | #define	_POSIX_BARRIERS			(-1)		/* [BAR] */ | ||
| 101 | #define	_POSIX_CHOWN_RESTRICTED		200112L | ||
| 102 | #define	_POSIX_CLOCK_SELECTION		(-1)		/* [CS] */ | ||
| 103 | #define	_POSIX_CPUTIME			(-1)		/* [CPT] */ | ||
| 104 | #define	_POSIX_FSYNC			200112L		/* [FSC] */ | ||
| 105 | #define	_POSIX_IPV6			200112L | ||
| 106 | #define	_POSIX_JOB_CONTROL		200112L | ||
| 107 | #define	_POSIX_MAPPED_FILES		200112L		/* [MF] */ | ||
| 108 | #define	_POSIX_MEMLOCK			(-1)		/* [ML] */ | ||
| 109 | #define	_POSIX_MEMLOCK_RANGE		(-1)		/* [MR] */ | ||
| 110 | #define	_POSIX_MEMORY_PROTECTION	200112L		/* [MPR] */ | ||
| 111 | #define	_POSIX_MESSAGE_PASSING		(-1)		/* [MSG] */ | ||
| 112 | #define	_POSIX_MONOTONIC_CLOCK		(-1)		/* [MON] */ | ||
| 113 | #define	_POSIX_NO_TRUNC			200112L | ||
| 114 | #define	_POSIX_PRIORITIZED_IO		(-1)		/* [PIO] */ | ||
| 115 | #define	_POSIX_PRIORITY_SCHEDULING	(-1)		/* [PS] */ | ||
| 116 | #define	_POSIX_RAW_SOCKETS		(-1)		/* [RS] */ | ||
| 117 | #define	_POSIX_READER_WRITER_LOCKS	200112L		/* [THR] */ | ||
| 118 | #define	_POSIX_REALTIME_SIGNALS		(-1)		/* [RTS] */ | ||
| 119 | #define	_POSIX_REGEXP			200112L | ||
| 120 | #define	_POSIX_SAVED_IDS		200112L		/* XXX required */ | ||
| 121 | #define	_POSIX_SEMAPHORES		(-1)		/* [SEM] */ | ||
| 122 | #define	_POSIX_SHARED_MEMORY_OBJECTS	(-1)		/* [SHM] */ | ||
| 123 | #define	_POSIX_SHELL			200112L | ||
| 124 | #define	_POSIX_SPAWN			(-1)		/* [SPN] */ | ||
| 125 | #define	_POSIX_SPIN_LOCKS		(-1)		/* [SPI] */ | ||
| 126 | #define	_POSIX_SPORADIC_SERVER		(-1)		/* [SS] */ | ||
| 127 | #define	_POSIX_SYNCHRONIZED_IO		(-1)		/* [SIO] */ | ||
| 128 | #define	_POSIX_THREAD_ATTR_STACKADDR	200112L		/* [TSA] */ | ||
| 129 | #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L		/* [TSS] */ | ||
| 130 | #define	_POSIX_THREAD_CPUTIME		(-1)		/* [TCT] */ | ||
| 131 | #define	_POSIX_THREAD_PRIO_INHERIT	(-1)		/* [TPI] */ | ||
| 132 | #define	_POSIX_THREAD_PRIO_PROTECT	(-1)		/* [TPP] */ | ||
| 133 | #define	_POSIX_THREAD_PRIORITY_SCHEDULING	(-1)	/* [TPS] */ | ||
| 134 | #define	_POSIX_THREAD_PROCESS_SHARED	200112L		/* [TSH] */ | ||
| 135 | #define	_POSIX_THREAD_SAFE_FUNCTIONS	200112L		/* [TSF] */ | ||
| 136 | #define	_POSIX_THREAD_SPORADIC_SERVER	(-1)		/* [TSP] */ | ||
| 137 | #define	_POSIX_THREADS			200112L		/* [THR] */ | ||
| 138 | #define	_POSIX_TIMEOUTS			(-1)		/* [TMO] */ | ||
| 139 | #define	_POSIX_TIMERS			(-1)		/* [TMR] */ | ||
| 140 | #define	_POSIX_TRACE			(-1)		/* [TRC] */ | ||
| 141 | #define	_POSIX_TRACE_EVENT_FILTER	(-1)		/* [TEF] */ | ||
| 142 | #define	_POSIX_TRACE_INHERIT		(-1)		/* [TRI] */ | ||
| 143 | #define	_POSIX_TRACE_LOG		(-1)		/* [TRL] */ | ||
| 144 | #define	_POSIX_TYPED_MEMORY_OBJECTS	(-1)		/* [TYM] */ | ||
| 145 | #ifndef _POSIX_VDISABLE | ||
| 146 | #define	_POSIX_VDISABLE			0xff		/* same as sys/termios.h */ | ||
| 147 | #endif /* _POSIX_VDISABLE */ | ||
| 148 | |||
| 149 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 150 | #define	_POSIX2_C_BIND			200112L | ||
| 151 | #define	_POSIX2_C_DEV			200112L		/* c99 command */ | ||
| 152 | #define	_POSIX2_CHAR_TERM		200112L | ||
| 153 | #define	_POSIX2_FORT_DEV		(-1)		/* fort77 command */ | ||
| 154 | #define	_POSIX2_FORT_RUN		200112L | ||
| 155 | #define	_POSIX2_LOCALEDEF		200112L		/* localedef command */ | ||
| 156 | #define	_POSIX2_PBS			(-1) | ||
| 157 | #define	_POSIX2_PBS_ACCOUNTING		(-1) | ||
| 158 | #define	_POSIX2_PBS_CHECKPOINT		(-1) | ||
| 159 | #define	_POSIX2_PBS_LOCATE		(-1) | ||
| 160 | #define	_POSIX2_PBS_MESSAGE		(-1) | ||
| 161 | #define	_POSIX2_PBS_TRACK		(-1) | ||
| 162 | #define	_POSIX2_SW_DEV			200112L | ||
| 163 | #define	_POSIX2_UPE			200112L	/* XXXX no fc, newgrp, tabs */ | ||
| 164 | #endif /* __DARWIN_C_LEVEL */ | ||
| 165 | |||
| 166 | #define	__ILP32_OFF32 (-1) | ||
| 167 | #define	__ILP32_OFFBIG (-1) | ||
| 168 | |||
| 169 | #define	__LP64_OFF64 (1) | ||
| 170 | #define	__LPBIG_OFFBIG (1) | ||
| 171 | |||
| 172 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 173 | #define	_POSIX_V6_ILP32_OFF32		__ILP32_OFF32 | ||
| 174 | #define	_POSIX_V6_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 175 | #define	_POSIX_V6_LP64_OFF64		__LP64_OFF64 | ||
| 176 | #define	_POSIX_V6_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 177 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 178 | |||
| 179 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 180 | #define	_POSIX_V7_ILP32_OFF32		__ILP32_OFF32 | ||
| 181 | #define	_POSIX_V7_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 182 | #define	_POSIX_V7_LP64_OFF64		__LP64_OFF64 | ||
| 183 | #define	_POSIX_V7_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 184 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 185 | |||
| 186 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 187 | #define	_V6_ILP32_OFF32 __ILP32_OFF32 | ||
| 188 | #define	_V6_ILP32_OFFBIG __ILP32_OFFBIG | ||
| 189 | #define	_V6_LP64_OFF64 __LP64_OFF64 | ||
| 190 | #define	_V6_LPBIG_OFFBIG __LPBIG_OFFBIG | ||
| 191 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 192 | |||
| 193 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 194 | /* Removed in Issue 7 */ | ||
| 195 | #define	_XBS5_ILP32_OFF32		 __ILP32_OFF32 | ||
| 196 | #define	_XBS5_ILP32_OFFBIG		 __ILP32_OFFBIG | ||
| 197 | #define	_XBS5_LP64_OFF64		 __LP64_OFF64 | ||
| 198 | #define	_XBS5_LPBIG_OFFBIG		 __LPBIG_OFFBIG | ||
| 199 | #endif /* __DARWIN_C_LEVEL < 200809L */ | ||
| 200 | |||
| 201 | #if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ | ||
| 202 | #define	_XOPEN_CRYPT			(1) | ||
| 203 | #define	_XOPEN_ENH_I18N			(1)		/* XXX required */ | ||
| 204 | #define	_XOPEN_LEGACY			(-1)	/* no ftime gcvt, wcswcs */ | ||
| 205 | #define	_XOPEN_REALTIME			(-1)	/* no q'ed signals, mq_* */ | ||
| 206 | #define	_XOPEN_REALTIME_THREADS		(-1)	/* no posix_spawn, et. al. */ | ||
| 207 | #define	_XOPEN_SHM			(1) | ||
| 208 | #define	_XOPEN_STREAMS			(-1) /* Issue 6 */ | ||
| 209 | #define	_XOPEN_UNIX			(1) | ||
| 210 | #endif /* XSI */ | ||
| 211 | |||
| 212 | /* configurable system variables */ | ||
| 213 | #define	_SC_ARG_MAX			 1 | ||
| 214 | #define	_SC_CHILD_MAX			 2 | ||
| 215 | #define	_SC_CLK_TCK			 3 | ||
| 216 | #define	_SC_NGROUPS_MAX			 4 | ||
| 217 | #define	_SC_OPEN_MAX			 5 | ||
| 218 | #define	_SC_JOB_CONTROL			 6 | ||
| 219 | #define	_SC_SAVED_IDS			 7 | ||
| 220 | #define	_SC_VERSION			 8 | ||
| 221 | #define	_SC_BC_BASE_MAX			 9 | ||
| 222 | #define	_SC_BC_DIM_MAX			10 | ||
| 223 | #define	_SC_BC_SCALE_MAX		11 | ||
| 224 | #define	_SC_BC_STRING_MAX		12 | ||
| 225 | #define	_SC_COLL_WEIGHTS_MAX		13 | ||
| 226 | #define	_SC_EXPR_NEST_MAX		14 | ||
| 227 | #define	_SC_LINE_MAX			15 | ||
| 228 | #define	_SC_RE_DUP_MAX			16 | ||
| 229 | #define	_SC_2_VERSION			17 | ||
| 230 | #define	_SC_2_C_BIND			18 | ||
| 231 | #define	_SC_2_C_DEV			19 | ||
| 232 | #define	_SC_2_CHAR_TERM			20 | ||
| 233 | #define	_SC_2_FORT_DEV			21 | ||
| 234 | #define	_SC_2_FORT_RUN			22 | ||
| 235 | #define	_SC_2_LOCALEDEF			23 | ||
| 236 | #define	_SC_2_SW_DEV			24 | ||
| 237 | #define	_SC_2_UPE			25 | ||
| 238 | #define	_SC_STREAM_MAX			26 | ||
| 239 | #define	_SC_TZNAME_MAX			27 | ||
| 240 | |||
| 241 | #if __DARWIN_C_LEVEL >= 199309L | ||
| 242 | #define	_SC_ASYNCHRONOUS_IO		28 | ||
| 243 | #define	_SC_PAGESIZE			29 | ||
| 244 | #define	_SC_MEMLOCK			30 | ||
| 245 | #define	_SC_MEMLOCK_RANGE		31 | ||
| 246 | #define	_SC_MEMORY_PROTECTION		32 | ||
| 247 | #define	_SC_MESSAGE_PASSING		33 | ||
| 248 | #define	_SC_PRIORITIZED_IO		34 | ||
| 249 | #define	_SC_PRIORITY_SCHEDULING		35 | ||
| 250 | #define	_SC_REALTIME_SIGNALS		36 | ||
| 251 | #define	_SC_SEMAPHORES			37 | ||
| 252 | #define	_SC_FSYNC			38 | ||
| 253 | #define	_SC_SHARED_MEMORY_OBJECTS 	39 | ||
| 254 | #define	_SC_SYNCHRONIZED_IO		40 | ||
| 255 | #define	_SC_TIMERS			41 | ||
| 256 | #define	_SC_AIO_LISTIO_MAX		42 | ||
| 257 | #define	_SC_AIO_MAX			43 | ||
| 258 | #define	_SC_AIO_PRIO_DELTA_MAX		44 | ||
| 259 | #define	_SC_DELAYTIMER_MAX		45 | ||
| 260 | #define	_SC_MQ_OPEN_MAX			46 | ||
| 261 | #define	_SC_MAPPED_FILES		47	/* swap _SC_PAGESIZE vs. BSD */ | ||
| 262 | #define	_SC_RTSIG_MAX			48 | ||
| 263 | #define	_SC_SEM_NSEMS_MAX		49 | ||
| 264 | #define	_SC_SEM_VALUE_MAX		50 | ||
| 265 | #define	_SC_SIGQUEUE_MAX		51 | ||
| 266 | #define	_SC_TIMER_MAX			52 | ||
| 267 | #endif /* __DARWIN_C_LEVEL >= 199309L */ | ||
| 268 | |||
| 269 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 270 | #define	_SC_NPROCESSORS_CONF		57 | ||
| 271 | #define	_SC_NPROCESSORS_ONLN		58 | ||
| 272 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 273 | |||
| 274 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 275 | #define	_SC_2_PBS			59 | ||
| 276 | #define	_SC_2_PBS_ACCOUNTING		60 | ||
| 277 | #define	_SC_2_PBS_CHECKPOINT		61 | ||
| 278 | #define	_SC_2_PBS_LOCATE		62 | ||
| 279 | #define	_SC_2_PBS_MESSAGE		63 | ||
| 280 | #define	_SC_2_PBS_TRACK			64 | ||
| 281 | #define	_SC_ADVISORY_INFO		65 | ||
| 282 | #define	_SC_BARRIERS			66 | ||
| 283 | #define	_SC_CLOCK_SELECTION		67 | ||
| 284 | #define	_SC_CPUTIME			68 | ||
| 285 | #define	_SC_FILE_LOCKING		69 | ||
| 286 | #define	_SC_GETGR_R_SIZE_MAX		70 | ||
| 287 | #define	_SC_GETPW_R_SIZE_MAX		71 | ||
| 288 | #define	_SC_HOST_NAME_MAX		72 | ||
| 289 | #define	_SC_LOGIN_NAME_MAX		73 | ||
| 290 | #define	_SC_MONOTONIC_CLOCK		74 | ||
| 291 | #define	_SC_MQ_PRIO_MAX			75 | ||
| 292 | #define	_SC_READER_WRITER_LOCKS		76 | ||
| 293 | #define	_SC_REGEXP			77 | ||
| 294 | #define	_SC_SHELL			78 | ||
| 295 | #define	_SC_SPAWN			79 | ||
| 296 | #define	_SC_SPIN_LOCKS			80 | ||
| 297 | #define	_SC_SPORADIC_SERVER		81 | ||
| 298 | #define	_SC_THREAD_ATTR_STACKADDR	82 | ||
| 299 | #define	_SC_THREAD_ATTR_STACKSIZE	83 | ||
| 300 | #define	_SC_THREAD_CPUTIME		84 | ||
| 301 | #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 85 | ||
| 302 | #define	_SC_THREAD_KEYS_MAX		86 | ||
| 303 | #define	_SC_THREAD_PRIO_INHERIT		87 | ||
| 304 | #define	_SC_THREAD_PRIO_PROTECT		88 | ||
| 305 | #define	_SC_THREAD_PRIORITY_SCHEDULING	89 | ||
| 306 | #define	_SC_THREAD_PROCESS_SHARED	90 | ||
| 307 | #define	_SC_THREAD_SAFE_FUNCTIONS	91 | ||
| 308 | #define	_SC_THREAD_SPORADIC_SERVER	92 | ||
| 309 | #define	_SC_THREAD_STACK_MIN		93 | ||
| 310 | #define	_SC_THREAD_THREADS_MAX		94 | ||
| 311 | #define	_SC_TIMEOUTS			95 | ||
| 312 | #define	_SC_THREADS			96 | ||
| 313 | #define	_SC_TRACE			97 | ||
| 314 | #define	_SC_TRACE_EVENT_FILTER		98 | ||
| 315 | #define	_SC_TRACE_INHERIT		99 | ||
| 316 | #define	_SC_TRACE_LOG			100 | ||
| 317 | #define	_SC_TTY_NAME_MAX		101 | ||
| 318 | #define	_SC_TYPED_MEMORY_OBJECTS	102 | ||
| 319 | #define	_SC_V6_ILP32_OFF32		103 | ||
| 320 | #define	_SC_V6_ILP32_OFFBIG		104 | ||
| 321 | #define	_SC_V6_LP64_OFF64		105 | ||
| 322 | #define	_SC_V6_LPBIG_OFFBIG		106 | ||
| 323 | #define	_SC_IPV6			118 | ||
| 324 | #define	_SC_RAW_SOCKETS			119 | ||
| 325 | #define	_SC_SYMLOOP_MAX			120 | ||
| 326 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 327 | |||
| 328 | #if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ | ||
| 329 | #define	_SC_ATEXIT_MAX			107 | ||
| 330 | #define	_SC_IOV_MAX			56 | ||
| 331 | #define	_SC_PAGE_SIZE			_SC_PAGESIZE | ||
| 332 | #define	_SC_XOPEN_CRYPT			108 | ||
| 333 | #define	_SC_XOPEN_ENH_I18N		109 | ||
| 334 | #define	_SC_XOPEN_LEGACY		110 /* Issue 6 */ | ||
| 335 | #define	_SC_XOPEN_REALTIME		111 /* Issue 6 */ | ||
| 336 | #define	_SC_XOPEN_REALTIME_THREADS	112 /* Issue 6 */ | ||
| 337 | #define	_SC_XOPEN_SHM			113 | ||
| 338 | #define	_SC_XOPEN_STREAMS		114 /* Issue 6 */ | ||
| 339 | #define	_SC_XOPEN_UNIX			115 | ||
| 340 | #define	_SC_XOPEN_VERSION		116 | ||
| 341 | #define	_SC_XOPEN_XCU_VERSION		121 | ||
| 342 | #endif /* XSI */ | ||
| 343 | |||
| 344 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 345 | /* Removed in Issue 7 */ | ||
| 346 | #define	_SC_XBS5_ILP32_OFF32		122 | ||
| 347 | #define	_SC_XBS5_ILP32_OFFBIG		123 | ||
| 348 | #define	_SC_XBS5_LP64_OFF64		124 | ||
| 349 | #define	_SC_XBS5_LPBIG_OFFBIG		125 | ||
| 350 | #endif /* __DARWIN_C_LEVEL <= 200809L */ | ||
| 351 | |||
| 352 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 353 | #define	_SC_SS_REPL_MAX			126 | ||
| 354 | #define	_SC_TRACE_EVENT_NAME_MAX	127 | ||
| 355 | #define	_SC_TRACE_NAME_MAX		128 | ||
| 356 | #define	_SC_TRACE_SYS_MAX		129 | ||
| 357 | #define	_SC_TRACE_USER_EVENT_MAX	130 | ||
| 358 | #endif | ||
| 359 | |||
| 360 | #if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 361 | /* Removed in Issue 6 */ | ||
| 362 | #define	_SC_PASS_MAX			131 | ||
| 363 | #endif | ||
| 364 | |||
| 365 | /* 132-199 available for future use */ | ||
| 366 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 367 | #define	_SC_PHYS_PAGES			200 | ||
| 368 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 369 | |||
| 370 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 371 | #ifndef _CS_PATH /* Defined in <sys/unistd.h> */ | ||
| 372 | #define	_CS_PATH				1 | ||
| 373 | #endif | ||
| 374 | #endif | ||
| 375 | |||
| 376 | #if __DARWIN_C_LEVEL >= 200112 | ||
| 377 | #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		2 | ||
| 378 | #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	3 | ||
| 379 | #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		4 | ||
| 380 | #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	5 | ||
| 381 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	6 | ||
| 382 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		7 | ||
| 383 | #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		8 | ||
| 384 | #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		9 | ||
| 385 | #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10 | ||
| 386 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11 | ||
| 387 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12 | ||
| 388 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13 | ||
| 389 | #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14 | ||
| 390 | #endif | ||
| 391 | |||
| 392 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 393 | /* Removed in Issue 7 */ | ||
| 394 | #define	_CS_XBS5_ILP32_OFF32_CFLAGS		20 | ||
| 395 | #define	_CS_XBS5_ILP32_OFF32_LDFLAGS		21 | ||
| 396 | #define	_CS_XBS5_ILP32_OFF32_LIBS		22 | ||
| 397 | #define	_CS_XBS5_ILP32_OFF32_LINTFLAGS		23 | ||
| 398 | #define	_CS_XBS5_ILP32_OFFBIG_CFLAGS		24 | ||
| 399 | #define	_CS_XBS5_ILP32_OFFBIG_LDFLAGS		25 | ||
| 400 | #define	_CS_XBS5_ILP32_OFFBIG_LIBS		26 | ||
| 401 | #define	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS		27 | ||
| 402 | #define	_CS_XBS5_LP64_OFF64_CFLAGS		28 | ||
| 403 | #define	_CS_XBS5_LP64_OFF64_LDFLAGS		29 | ||
| 404 | #define	_CS_XBS5_LP64_OFF64_LIBS		30 | ||
| 405 | #define	_CS_XBS5_LP64_OFF64_LINTFLAGS		31 | ||
| 406 | #define	_CS_XBS5_LPBIG_OFFBIG_CFLAGS		32 | ||
| 407 | #define	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS		33 | ||
| 408 | #define	_CS_XBS5_LPBIG_OFFBIG_LIBS		34 | ||
| 409 | #define	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS		35 | ||
| 410 | #endif | ||
| 411 | |||
| 412 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 413 | #define	_CS_DARWIN_USER_DIR			65536 | ||
| 414 | #define	_CS_DARWIN_USER_TEMP_DIR		65537 | ||
| 415 | #define	_CS_DARWIN_USER_CACHE_DIR		65538 | ||
| 416 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 417 | |||
| 418 | |||
| 419 | #ifdef _DARWIN_UNLIMITED_GETGROUPS | ||
| 420 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 | ||
| 421 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it." | ||
| 422 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 | ||
| 423 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it." | ||
| 424 | #endif | ||
| 425 | #endif | ||
| 426 | |||
| 427 | /* POSIX.1-1990 */ | ||
| 428 | |||
| 429 | __BEGIN_DECLS | ||
| 430 | void	 _exit(int) __dead2; | ||
| 431 | int	 access(const char *, int); | ||
| 432 | unsigned int | ||
| 433 | 	 alarm(unsigned int); | ||
| 434 | int	 chdir(const char *); | ||
| 435 | int	 chown(const char *, uid_t, gid_t); | ||
| 436 | |||
| 437 | int	 close(int) __DARWIN_ALIAS_C(close); | ||
| 438 | |||
| 439 | int	 dup(int); | ||
| 440 | int	 dup2(int, int); | ||
| 441 | int	 execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 442 | int	 execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 443 | int	 execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 444 | int	 execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 445 | int	 execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 446 | int	 execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 447 | pid_t	 fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 448 | long	 fpathconf(int, int); | ||
| 449 | char	*getcwd(char *, size_t); | ||
| 450 | gid_t	 getegid(void); | ||
| 451 | uid_t	 geteuid(void); | ||
| 452 | gid_t	 getgid(void); | ||
| 453 | #if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) | ||
| 454 | int	 getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); | ||
| 455 | #else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ | ||
| 456 | int	 getgroups(int, gid_t []); | ||
| 457 | #endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ | ||
| 458 | char	*getlogin(void); | ||
| 459 | pid_t	 getpgrp(void); | ||
| 460 | pid_t	 getpid(void); | ||
| 461 | pid_t	 getppid(void); | ||
| 462 | uid_t	 getuid(void); | ||
| 463 | int	 isatty(int); | ||
| 464 | int	 link(const char *, const char *); | ||
| 465 | off_t	 lseek(int, off_t, int); | ||
| 466 | long	 pathconf(const char *, int); | ||
| 467 | |||
| 468 | int	 pause(void) __DARWIN_ALIAS_C(pause); | ||
| 469 | |||
| 470 | int	 pipe(int [2]); | ||
| 471 | |||
| 472 | ssize_t	 read(int, void *, size_t) __DARWIN_ALIAS_C(read); | ||
| 473 | |||
| 474 | int	 rmdir(const char *); | ||
| 475 | int	 setgid(gid_t); | ||
| 476 | int	 setpgid(pid_t, pid_t); | ||
| 477 | pid_t	 setsid(void); | ||
| 478 | int	 setuid(uid_t); | ||
| 479 | |||
| 480 | unsigned int | ||
| 481 | 	 sleep(unsigned int) __DARWIN_ALIAS_C(sleep); | ||
| 482 | |||
| 483 | long	 sysconf(int); | ||
| 484 | pid_t	 tcgetpgrp(int); | ||
| 485 | int	 tcsetpgrp(int, pid_t); | ||
| 486 | char	*ttyname(int); | ||
| 487 | |||
| 488 | #if __DARWIN_UNIX03 | ||
| 489 | int	 ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); | ||
| 490 | #else /* !__DARWIN_UNIX03 */ | ||
| 491 | char	*ttyname_r(int, char *, size_t); | ||
| 492 | #endif /* __DARWIN_UNIX03 */ | ||
| 493 | |||
| 494 | int	 unlink(const char *); | ||
| 495 | |||
| 496 | ssize_t	 write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write); | ||
| 497 | __END_DECLS | ||
| 498 | |||
| 499 | |||
| 500 | |||
| 501 | /* Additional functionality provided by: | ||
| 502 | * POSIX.2-1992 C Language Binding Option | ||
| 503 | */ | ||
| 504 | |||
| 505 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 506 | __BEGIN_DECLS | ||
| 507 | size_t	 confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); | ||
| 508 | |||
| 509 | int	 getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); | ||
| 510 | |||
| 511 | extern char *optarg;			/* getopt(3) external variables */ | ||
| 512 | extern int optind, opterr, optopt; | ||
| 513 | __END_DECLS | ||
| 514 | #endif /* __DARWIN_C_LEVEL >= 199209L */ | ||
| 515 | |||
| 516 | |||
| 517 | |||
| 518 | /* Additional functionality provided by: | ||
| 519 | * POSIX.1c-1995, | ||
| 520 | * POSIX.1i-1995, | ||
| 521 | * and the omnibus ISO/IEC 9945-1: 1996 | ||
| 522 | */ | ||
| 523 | |||
| 524 | #if __DARWIN_C_LEVEL >= 199506L | ||
| 525 | #include <_ctermid.h> | ||
| 526 | /* These F_* are really XSI or Issue 6 */ | ||
| 527 | #define F_ULOCK 0 /* unlock locked section */ | ||
| 528 | #define	F_LOCK 1 /* lock a section for exclusive use */ | ||
| 529 | #define	F_TLOCK 2 /* test and lock a section for exclusive use */ | ||
| 530 | #define	F_TEST 3 /* test a section for locks by other procs */ | ||
| 531 | |||
| 532 | __BEGIN_DECLS | ||
| 533 | |||
| 534 | /* Begin XSI */ | ||
| 535 | /* Removed in Issue 6 */ | ||
| 536 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 537 | #if !defined(_POSIX_C_SOURCE) | ||
| 538 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 539 | #endif | ||
| 540 | void	*brk(const void *); | ||
| 541 | int	 chroot(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 542 | #endif | ||
| 543 | |||
| 544 | char	*crypt(const char *, const char *); | ||
| 545 | #if __DARWIN_UNIX03 | ||
| 546 | void	 encrypt(char *, int) __DARWIN_ALIAS(encrypt); | ||
| 547 | #else /* !__DARWIN_UNIX03 */ | ||
| 548 | int	 encrypt(char *, int); | ||
| 549 | #endif /* __DARWIN_UNIX03 */ | ||
| 550 | int	 fchdir(int); | ||
| 551 | long	 gethostid(void); | ||
| 552 | pid_t	 getpgid(pid_t); | ||
| 553 | pid_t	 getsid(pid_t); | ||
| 554 | |||
| 555 | /* Removed in Issue 6 */ | ||
| 556 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 557 | int	 getdtablesize(void) __POSIX_C_DEPRECATED(199506L); | ||
| 558 | int	 getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); | ||
| 559 | char	*getpass(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 560 | #endif | ||
| 561 | |||
| 562 | /* Removed in Issue 7 */ | ||
| 563 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L | ||
| 564 | char	*getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ | ||
| 565 | #endif | ||
| 566 | |||
| 567 | int	 lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); | ||
| 568 | |||
| 569 | int	 lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); | ||
| 570 | |||
| 571 | int	 nice(int) __DARWIN_ALIAS(nice); | ||
| 572 | |||
| 573 | ssize_t	 pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); | ||
| 574 | |||
| 575 | ssize_t	 pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite); | ||
| 576 | |||
| 577 | /* Removed in Issue 6 */ | ||
| 578 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 579 | /* Note that Issue 5 changed the argument as intprt_t, | ||
| 580 | * but we keep it as int for binary compatability. */ | ||
| 581 | #if !defined(_POSIX_C_SOURCE) | ||
| 582 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 583 | #endif | ||
| 584 | void	*sbrk(int); | ||
| 585 | #endif | ||
| 586 | |||
| 587 | #if __DARWIN_UNIX03 | ||
| 588 | pid_t	 setpgrp(void) __DARWIN_ALIAS(setpgrp); | ||
| 589 | #else /* !__DARWIN_UNIX03 */ | ||
| 590 | int	 setpgrp(pid_t pid, pid_t pgrp);	/* obsoleted by setpgid() */ | ||
| 591 | #endif /* __DARWIN_UNIX03 */ | ||
| 592 | |||
| 593 | int	 setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); | ||
| 594 | |||
| 595 | int	 setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); | ||
| 596 | |||
| 597 | void swab(const void * __restrict, void * __restrict, ssize_t); | ||
| 598 | void	 sync(void); | ||
| 599 | int	 truncate(const char *, off_t); | ||
| 600 | useconds_t	 ualarm(useconds_t, useconds_t); | ||
| 601 | int	 usleep(useconds_t) __DARWIN_ALIAS_C(usleep); | ||
| 602 | pid_t	 vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 603 | /* End XSI */ | ||
| 604 | |||
| 605 | int	 fsync(int) __DARWIN_ALIAS_C(fsync); | ||
| 606 | |||
| 607 | int	 ftruncate(int, off_t); | ||
| 608 | int	 getlogin_r(char *, size_t); | ||
| 609 | __END_DECLS | ||
| 610 | #endif /* __DARWIN_C_LEVEL >= 199506L */ | ||
| 611 | |||
| 612 | |||
| 613 | |||
| 614 | /* Additional functionality provided by: | ||
| 615 | * POSIX.1-2001 | ||
| 616 | * ISO C99 | ||
| 617 | */ | ||
| 618 | |||
| 619 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 620 | __BEGIN_DECLS | ||
| 621 | int	 fchown(int, uid_t, gid_t); | ||
| 622 | int	 gethostname(char *, size_t); | ||
| 623 | ssize_t readlink(const char * __restrict, char * __restrict, size_t); | ||
| 624 | int	 setegid(gid_t); | ||
| 625 | int	 seteuid(uid_t); | ||
| 626 | int	 symlink(const char *, const char *); | ||
| 627 | __END_DECLS | ||
| 628 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 629 | |||
| 630 | |||
| 631 | |||
| 632 | /* Darwin extensions */ | ||
| 633 | |||
| 634 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 635 | #include <sys/select.h> | ||
| 636 | |||
| 637 | #include <sys/_types/_dev_t.h> | ||
| 638 | #include <sys/_types/_mode_t.h> | ||
| 639 | #include <sys/_types/_uuid_t.h> | ||
| 640 | |||
| 641 | __BEGIN_DECLS | ||
| 642 | void	 _Exit(int) __dead2; | ||
| 643 | int	 accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); | ||
| 644 | int	 acct(const char *); | ||
| 645 | int	 add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 646 | void	 endusershell(void); | ||
| 647 | int	 execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 648 | char	*fflagstostr(unsigned long); | ||
| 649 | int	 getdomainname(char *, int); | ||
| 650 | int	 getgrouplist(const char *, int, int *, int *); | ||
| 651 | #if defined(__has_include) | ||
| 652 | #if __has_include(<gethostuuid_private.h>) | ||
| 653 | #include <gethostuuid_private.h> | ||
| 654 | #else | ||
| 655 | #include <gethostuuid.h> | ||
| 656 | #endif | ||
| 657 | #else | ||
| 658 | #include <gethostuuid.h> | ||
| 659 | #endif | ||
| 660 | mode_t	 getmode(const void *, mode_t); | ||
| 661 | int	 getpeereid(int, uid_t *, gid_t *); | ||
| 662 | int	 getsgroups_np(int *, uuid_t); | ||
| 663 | char	*getusershell(void); | ||
| 664 | int	 getwgroups_np(int *, uuid_t); | ||
| 665 | int	 initgroups(const char *, int); | ||
| 666 | int	 issetugid(void); | ||
| 667 | char	*mkdtemp(char *); | ||
| 668 | int	 mknod(const char *, mode_t, dev_t); | ||
| 669 | int	 mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */ | ||
| 670 | int	 mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */ | ||
| 671 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 672 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 673 | int	 mkstemp(char *); | ||
| 674 | int	 mkstemps(char *, int); | ||
| 675 | char	*mktemp(char *); | ||
| 676 | int	 mkostemp(char *path, int oflags) | ||
| 677 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 678 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 679 | int	 mkostemps(char *path, int slen, int oflags) | ||
| 680 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 681 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 682 | /* Non-portable mkstemp that uses open_dprotected_np */ | ||
| 683 | int	 mkstemp_dprotected_np(char *path, int dpclass, int dpflags) | ||
| 684 | 		__OSX_UNAVAILABLE __IOS_AVAILABLE(10.0) | ||
| 685 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 686 | char *mkdtempat_np(int dfd, char *path) | ||
| 687 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 688 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 689 | int mkstempsat_np(int dfd, char *path, int slen) | ||
| 690 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 691 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 692 | int mkostempsat_np(int dfd, char *path, int slen, int oflags) | ||
| 693 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 694 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 695 | int	 nfssvc(int, void *); | ||
| 696 | int	 profil(char *, size_t, unsigned long, unsigned int); | ||
| 697 | |||
| 698 | __deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.") | ||
| 699 | int	 pthread_setugid_np(uid_t, gid_t); | ||
| 700 | int	 pthread_getugid_np( uid_t *, gid_t *); | ||
| 701 | |||
| 702 | int	 reboot(int); | ||
| 703 | int	 revoke(const char *); | ||
| 704 | |||
| 705 | __deprecated int	 rcmd(char **, int, const char *, const char *, const char *, int *); | ||
| 706 | __deprecated int	 rcmd_af(char **, int, const char *, const char *, const char *, int *, | ||
| 707 | 		int); | ||
| 708 | __deprecated int	 rresvport(int *); | ||
| 709 | __deprecated int	 rresvport_af(int *, int); | ||
| 710 | __deprecated int	 iruserok(unsigned long, int, const char *, const char *); | ||
| 711 | __deprecated int	 iruserok_sa(const void *, int, int, const char *, const char *); | ||
| 712 | __deprecated int	 ruserok(const char *, int, const char *, const char *); | ||
| 713 | |||
| 714 | int	 setdomainname(const char *, int); | ||
| 715 | int	 setgroups(int, const gid_t *); | ||
| 716 | void	 sethostid(long); | ||
| 717 | int	 sethostname(const char *, int); | ||
| 718 | #if __DARWIN_UNIX03 | ||
| 719 | void	 setkey(const char *) __DARWIN_ALIAS(setkey); | ||
| 720 | #else /* !__DARWIN_UNIX03 */ | ||
| 721 | int	 setkey(const char *); | ||
| 722 | #endif /* __DARWIN_UNIX03 */ | ||
| 723 | int	 setlogin(const char *); | ||
| 724 | void	*setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); | ||
| 725 | int	 setrgid(gid_t); | ||
| 726 | int	 setruid(uid_t); | ||
| 727 | int	 setsgroups_np(int, const uuid_t); | ||
| 728 | void	 setusershell(void); | ||
| 729 | int	 setwgroups_np(int, const uuid_t); | ||
| 730 | int	 strtofflags(char **, unsigned long *, unsigned long *); | ||
| 731 | int	 swapon(const char *); | ||
| 732 | int	 ttyslot(void); | ||
| 733 | int	 undelete(const char *); | ||
| 734 | int	 unwhiteout(const char *); | ||
| 735 | void	*valloc(size_t);			 | ||
| 736 | |||
| 737 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 738 | __OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; " | ||
| 739 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 740 | __OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; " | ||
| 741 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 742 | int	 syscall(int, ...); | ||
| 743 | |||
| 744 | extern char *suboptarg;			/* getsubopt(3) external variable */ | ||
| 745 | int	 getsubopt(char **, char * const *, char **); | ||
| 746 | |||
| 747 | /* HFS & HFS Plus semantics system calls go here */ | ||
| 748 | #ifdef __LP64__ | ||
| 749 | int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 750 | int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 751 | int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); | ||
| 752 | int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); | ||
| 753 | int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 754 | int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 755 | |||
| 756 | #else /* __LP64__ */ | ||
| 757 | int	fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 758 | int	fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 759 | int	getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); | ||
| 760 | int	setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); | ||
| 761 | int exchangedata(const char*,const char*,unsigned long) | ||
| 762 | 		__OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag") | ||
| 763 | 		__IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag") | ||
| 764 | 		__WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 765 | int	getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 766 | |||
| 767 | #endif /* __LP64__ */ | ||
| 768 | |||
| 769 | struct fssearchblock; | ||
| 770 | struct searchstate; | ||
| 771 | |||
| 772 | int	 searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 773 | int	 fsctl(const char *,unsigned long,void*,unsigned int); | ||
| 774 | int	 ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 775 | |||
| 776 | #define	SYNC_VOLUME_FULLSYNC	0x01	/* Flush data and metadata to platter, not just to disk cache */ | ||
| 777 | #define SYNC_VOLUME_WAIT	0x02	/* Wait for sync to complete */ | ||
| 778 | |||
| 779 | int	fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 780 | int	sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 781 | |||
| 782 | extern int optreset; | ||
| 783 | |||
| 784 | __END_DECLS | ||
| 785 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 786 | |||
| 787 | #endif /* _UNISTD_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/utime.h created+75| ... | @@ -0,0 +1,75 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1990, 1993 | ||
| 25 | *	The Regents of the University of California. All rights reserved. | ||
| 26 | * | ||
| 27 | * Redistribution and use in source and binary forms, with or without | ||
| 28 | * modification, are permitted provided that the following conditions | ||
| 29 | * are met: | ||
| 30 | * 1. Redistributions of source code must retain the above copyright | ||
| 31 | * notice, this list of conditions and the following disclaimer. | ||
| 32 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 33 | * notice, this list of conditions and the following disclaimer in the | ||
| 34 | * documentation and/or other materials provided with the distribution. | ||
| 35 | * 3. All advertising materials mentioning features or use of this software | ||
| 36 | * must display the following acknowledgement: | ||
| 37 | *	This product includes software developed by the University of | ||
| 38 | *	California, Berkeley and its contributors. | ||
| 39 | * 4. Neither the name of the University nor the names of its contributors | ||
| 40 | * may be used to endorse or promote products derived from this software | ||
| 41 | * without specific prior written permission. | ||
| 42 | * | ||
| 43 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 44 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 45 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 46 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 47 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 48 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 49 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 50 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 51 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 52 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 53 | * SUCH DAMAGE. | ||
| 54 | * | ||
| 55 | *	@(#)utime.h	8.1 (Berkeley) 6/2/93 | ||
| 56 | */ | ||
| 57 | |||
| 58 | #ifndef	_UTIME_H_ | ||
| 59 | #define	_UTIME_H_ | ||
| 60 | |||
| 61 | #include <_types.h> | ||
| 62 | #include <sys/_types/_time_t.h> | ||
| 63 | |||
| 64 | struct utimbuf { | ||
| 65 | 	time_t actime;		/* Access time */ | ||
| 66 | 	time_t modtime;		/* Modification time */ | ||
| 67 | }; | ||
| 68 | |||
| 69 | #include <sys/cdefs.h> | ||
| 70 | |||
| 71 | __BEGIN_DECLS | ||
| 72 | int utime(const char *, const struct utimbuf *); | ||
| 73 | __END_DECLS | ||
| 74 | |||
| 75 | #endif /* !_UTIME_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/utmpx.h created+176| ... | @@ -0,0 +1,176 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*	$NetBSD: utmpx.h,v 1.11 2003/08/26 16:48:32 wiz Exp $	 */ | ||
| 24 | |||
| 25 | /*- | ||
| 26 | * Copyright (c) 2002 The NetBSD Foundation, Inc. | ||
| 27 | * All rights reserved. | ||
| 28 | * | ||
| 29 | * This code is derived from software contributed to The NetBSD Foundation | ||
| 30 | * by Christos Zoulas. | ||
| 31 | * | ||
| 32 | * Redistribution and use in source and binary forms, with or without | ||
| 33 | * modification, are permitted provided that the following conditions | ||
| 34 | * are met: | ||
| 35 | * 1. Redistributions of source code must retain the above copyright | ||
| 36 | * notice, this list of conditions and the following disclaimer. | ||
| 37 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 38 | * notice, this list of conditions and the following disclaimer in the | ||
| 39 | * documentation and/or other materials provided with the distribution. | ||
| 40 | * 3. All advertising materials mentioning features or use of this software | ||
| 41 | * must display the following acknowledgement: | ||
| 42 | * This product includes software developed by the NetBSD | ||
| 43 | * Foundation, Inc. and its contributors. | ||
| 44 | * 4. Neither the name of The NetBSD Foundation nor the names of its | ||
| 45 | * contributors may be used to endorse or promote products derived | ||
| 46 | * from this software without specific prior written permission. | ||
| 47 | * | ||
| 48 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | ||
| 49 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| 50 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 51 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | ||
| 52 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 53 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 54 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 55 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 56 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 57 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 58 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 59 | */ | ||
| 60 | #ifndef	_UTMPX_H_ | ||
| 61 | #define	_UTMPX_H_ | ||
| 62 | |||
| 63 | #include <_types.h> | ||
| 64 | #include <sys/time.h> | ||
| 65 | #include <sys/cdefs.h> | ||
| 66 | #include <Availability.h> | ||
| 67 | #include <sys/_types/_pid_t.h> | ||
| 68 | |||
| 69 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 70 | #include <sys/_types/_uid_t.h> | ||
| 71 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 72 | |||
| 73 | #define	_PATH_UTMPX		"/var/run/utmpx" | ||
| 74 | |||
| 75 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 76 | #define	UTMPX_FILE	_PATH_UTMPX | ||
| 77 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 78 | |||
| 79 | #define _UTX_USERSIZE	256	/* matches MAXLOGNAME */ | ||
| 80 | #define _UTX_LINESIZE	32 | ||
| 81 | #define	_UTX_IDSIZE	4 | ||
| 82 | #define _UTX_HOSTSIZE	256 | ||
| 83 | |||
| 84 | #define EMPTY		0 | ||
| 85 | #define RUN_LVL		1 | ||
| 86 | #define BOOT_TIME	2 | ||
| 87 | #define OLD_TIME	3 | ||
| 88 | #define NEW_TIME	4 | ||
| 89 | #define INIT_PROCESS	5 | ||
| 90 | #define LOGIN_PROCESS	6 | ||
| 91 | #define USER_PROCESS	7 | ||
| 92 | #define DEAD_PROCESS	8 | ||
| 93 | |||
| 94 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 95 | #define ACCOUNTING	9 | ||
| 96 | #define SIGNATURE	10 | ||
| 97 | #define SHUTDOWN_TIME	11 | ||
| 98 | |||
| 99 | #define UTMPX_AUTOFILL_MASK			0x8000 | ||
| 100 | #define UTMPX_DEAD_IF_CORRESPONDING_MASK	0x4000 | ||
| 101 | |||
| 102 | /* notify(3) change notification name */ | ||
| 103 | #define UTMPX_CHANGE_NOTIFICATION		"com.apple.system.utmpx" | ||
| 104 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 105 | |||
| 106 | /* | ||
| 107 | * The following structure describes the fields of the utmpx entries | ||
| 108 | * stored in _PATH_UTMPX. This is not the format the | ||
| 109 | * entries are stored in the files, and application should only access | ||
| 110 | * entries using routines described in getutxent(3). | ||
| 111 | */ | ||
| 112 | |||
| 113 | #ifdef _UTMPX_COMPAT | ||
| 114 | #define ut_user ut_name | ||
| 115 | #define ut_xtime ut_tv.tv_sec | ||
| 116 | #endif /* _UTMPX_COMPAT */ | ||
| 117 | |||
| 118 | struct utmpx { | ||
| 119 | 	char ut_user[_UTX_USERSIZE];	/* login name */ | ||
| 120 | 	char ut_id[_UTX_IDSIZE];	/* id */ | ||
| 121 | 	char ut_line[_UTX_LINESIZE];	/* tty name */ | ||
| 122 | 	pid_t ut_pid;			/* process id creating the entry */ | ||
| 123 | 	short ut_type;			/* type of this entry */ | ||
| 124 | 	struct timeval ut_tv;		/* time entry was created */ | ||
| 125 | 	char ut_host[_UTX_HOSTSIZE];	/* host name */ | ||
| 126 | 	__uint32_t ut_pad[16];		/* reserved for future use */ | ||
| 127 | }; | ||
| 128 | |||
| 129 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 130 | struct lastlogx { | ||
| 131 | 	struct timeval ll_tv;		/* time entry was created */ | ||
| 132 | 	char ll_line[_UTX_LINESIZE];	/* tty name */ | ||
| 133 | 	char ll_host[_UTX_HOSTSIZE];	/* host name */ | ||
| 134 | }; | ||
| 135 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 136 | |||
| 137 | __BEGIN_DECLS | ||
| 138 | |||
| 139 | void	endutxent(void); | ||
| 140 | |||
| 141 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 142 | void	endutxent_wtmp(void) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 143 | struct lastlogx * | ||
| 144 | 	getlastlogx(uid_t, struct lastlogx *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 145 | struct lastlogx * | ||
| 146 | 	getlastlogxbyname(const char*, struct lastlogx *)__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 147 | struct utmp;	/* forward reference */ | ||
| 148 | void	getutmp(const struct utmpx *, struct utmp *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_9, __IPHONE_2_0, __IPHONE_7_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 149 | void	getutmpx(const struct utmp *, struct utmpx *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_9, __IPHONE_2_0, __IPHONE_7_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 150 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 151 | |||
| 152 | struct utmpx * | ||
| 153 | 	getutxent(void); | ||
| 154 | |||
| 155 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 156 | struct utmpx * | ||
| 157 | 	getutxent_wtmp(void) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 158 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 159 | |||
| 160 | struct utmpx * | ||
| 161 | 	getutxid(const struct utmpx *); | ||
| 162 | struct utmpx * | ||
| 163 | 	getutxline(const struct utmpx *); | ||
| 164 | struct utmpx * | ||
| 165 | 	pututxline(const struct utmpx *); | ||
| 166 | void	setutxent(void); | ||
| 167 | |||
| 168 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 169 | void	setutxent_wtmp(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 170 | int	utmpxname(const char *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 171 | int	wtmpxname(const char *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ||
| 172 | #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ | ||
| 173 | |||
| 174 | __END_DECLS | ||
| 175 | |||
| 176 | #endif /* !_UTMPX_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/uuid/uuid.h created+79| ... | @@ -0,0 +1,79 @@ | ||
| 1 | /* | ||
| 2 | * Public include file for the UUID library | ||
| 3 | * | ||
| 4 | * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. | ||
| 5 | * | ||
| 6 | * %Begin-Header% | ||
| 7 | * Redistribution and use in source and binary forms, with or without | ||
| 8 | * modification, are permitted provided that the following conditions | ||
| 9 | * are met: | ||
| 10 | * 1. Redistributions of source code must retain the above copyright | ||
| 11 | * notice, and the entire permission notice in its entirety, | ||
| 12 | * including the disclaimer of warranties. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. The name of the author may not be used to endorse or promote | ||
| 17 | * products derived from this software without specific prior | ||
| 18 | * written permission. | ||
| 19 | * | ||
| 20 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
| 21 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
| 22 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF | ||
| 23 | * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE | ||
| 24 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT | ||
| 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
| 27 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
| 30 | * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH | ||
| 31 | * DAMAGE. | ||
| 32 | * %End-Header% | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _UUID_UUID_H | ||
| 36 | #define _UUID_UUID_H | ||
| 37 | |||
| 38 | #include <sys/_types.h> | ||
| 39 | #include <sys/_types/_uuid_t.h> | ||
| 40 | |||
| 41 | #ifndef _UUID_STRING_T | ||
| 42 | #define _UUID_STRING_T | ||
| 43 | typedef __darwin_uuid_string_t uuid_string_t; | ||
| 44 | #endif /* _UUID_STRING_T */ | ||
| 45 | |||
| 46 | #define UUID_DEFINE(name, u0, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15) \ | ||
| 47 | 	static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} | ||
| 48 | |||
| 49 | UUID_DEFINE(UUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | ||
| 50 | |||
| 51 | #ifdef __cplusplus | ||
| 52 | extern "C" { | ||
| 53 | #endif | ||
| 54 | |||
| 55 | void uuid_clear(uuid_t uu); | ||
| 56 | |||
| 57 | int uuid_compare(const uuid_t uu1, const uuid_t uu2); | ||
| 58 | |||
| 59 | void uuid_copy(uuid_t dst, const uuid_t src); | ||
| 60 | |||
| 61 | void uuid_generate(uuid_t out); | ||
| 62 | void uuid_generate_random(uuid_t out); | ||
| 63 | void uuid_generate_time(uuid_t out); | ||
| 64 | |||
| 65 | void uuid_generate_early_random(uuid_t out); | ||
| 66 | |||
| 67 | int uuid_is_null(const uuid_t uu); | ||
| 68 | |||
| 69 | int uuid_parse(const uuid_string_t in, uuid_t uu); | ||
| 70 | |||
| 71 | void uuid_unparse(const uuid_t uu, uuid_string_t out); | ||
| 72 | void uuid_unparse_lower(const uuid_t uu, uuid_string_t out); | ||
| 73 | void uuid_unparse_upper(const uuid_t uu, uuid_string_t out); | ||
| 74 | |||
| 75 | #ifdef __cplusplus | ||
| 76 | } | ||
| 77 | #endif | ||
| 78 | |||
| 79 | #endif /* _UUID_UUID_H */ | ||
lib/libc/include/x86_64-macos-gnu/wordexp.h created+85| ... | @@ -0,0 +1,85 @@ | ||
| 1 | /* | ||
| 2 | * Copyright 1994, University Corporation for Atmospheric Research | ||
| 3 | * See ../COPYRIGHT file for copying and redistribution conditions. | ||
| 4 | */ | ||
| 5 | /* | ||
| 6 | * Reproduction of ../COPYRIGHT file: | ||
| 7 | * | ||
| 8 | ********************************************************************* | ||
| 9 | |||
| 10 | Copyright 1995-2002 University Corporation for Atmospheric Research/Unidata | ||
| 11 | |||
| 12 | Portions of this software were developed by the Unidata Program at the | ||
| 13 | University Corporation for Atmospheric Research. | ||
| 14 | |||
| 15 | Access and use of this software shall impose the following obligations | ||
| 16 | and understandings on the user. The user is granted the right, without | ||
| 17 | any fee or cost, to use, copy, modify, alter, enhance and distribute | ||
| 18 | this software, and any derivative works thereof, and its supporting | ||
| 19 | documentation for any purpose whatsoever, provided that this entire | ||
| 20 | notice appears in all copies of the software, derivative works and | ||
| 21 | supporting documentation. Further, UCAR requests that the user credit | ||
| 22 | UCAR/Unidata in any publications that result from the use of this | ||
| 23 | software or in any product that includes this software. The names UCAR | ||
| 24 | and/or Unidata, however, may not be used in any advertising or publicity | ||
| 25 | to endorse or promote any products or commercial entity unless specific | ||
| 26 | written permission is obtained from UCAR/Unidata. The user also | ||
| 27 | understands that UCAR/Unidata is not obligated to provide the user with | ||
| 28 | any support, consulting, training or assistance of any kind with regard | ||
| 29 | to the use, operation and performance of this software nor to provide | ||
| 30 | the user with any updates, revisions, new versions or "bug fixes." | ||
| 31 | |||
| 32 | THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR | ||
| 33 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 34 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 35 | DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, | ||
| 36 | INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING | ||
| 37 | FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
| 38 | NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
| 39 | WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 40 | |||
| 41 | ********************************************************************* | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | |||
| 45 | /* $Id: wordexp.h,v 1.5 1994/05/12 20:46:40 davis Exp $ */ | ||
| 46 | #ifndef _WORDEXP_H | ||
| 47 | #define _WORDEXP_H | ||
| 48 | |||
| 49 | #include <sys/cdefs.h> | ||
| 50 | #include <_types.h> | ||
| 51 | #include <sys/_types/_size_t.h> | ||
| 52 | #include <Availability.h> | ||
| 53 | |||
| 54 | typedef struct { | ||
| 55 | 	size_t we_wordc; | ||
| 56 | 	char **we_wordv; | ||
| 57 | 	size_t we_offs; | ||
| 58 | } wordexp_t; | ||
| 59 | |||
| 60 | /* wordexp() flags Argument */ | ||
| 61 | #define WRDE_APPEND	0x01 | ||
| 62 | #define WRDE_DOOFFS	0x02 | ||
| 63 | #define WRDE_NOCMD	0x04 | ||
| 64 | #define WRDE_REUSE	0x08 | ||
| 65 | #define WRDE_SHOWERR	0x10 | ||
| 66 | #define WRDE_UNDEF	0x20 | ||
| 67 | |||
| 68 | /* | ||
| 69 | * wordexp() Return Values | ||
| 70 | */ | ||
| 71 | /* required */ | ||
| 72 | #define WRDE_BADCHAR	1 | ||
| 73 | #define WRDE_BADVAL	2 | ||
| 74 | #define WRDE_CMDSUB	3 | ||
| 75 | #define WRDE_NOSPACE	4 | ||
| 76 | #define WRDE_NOSYS	5 | ||
| 77 | #define WRDE_SYNTAX	6 | ||
| 78 | |||
| 79 | |||
| 80 | __BEGIN_DECLS | ||
| 81 | int wordexp(const char * __restrict, wordexp_t * __restrict, int) __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA); | ||
| 82 | void wordfree(wordexp_t *) __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA); | ||
| 83 | __END_DECLS | ||
| 84 | |||
| 85 | #endif /* _WORDEXP_H */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale.h created+111| ... | @@ -0,0 +1,111 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE_H_ | ||
| 25 | #define _XLOCALE_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | |||
| 29 | #ifndef _USE_EXTENDED_LOCALES_ | ||
| 30 | #define _USE_EXTENDED_LOCALES_ | ||
| 31 | #endif /* _USE_EXTENDED_LOCALES_ */ | ||
| 32 | |||
| 33 | #include <_locale.h> | ||
| 34 | #include <_xlocale.h> | ||
| 35 | |||
| 36 | #define LC_ALL_MASK			( LC_COLLATE_MASK \ | ||
| 37 | 					 | LC_CTYPE_MASK \ | ||
| 38 | 					 | LC_MESSAGES_MASK \ | ||
| 39 | 					 | LC_MONETARY_MASK \ | ||
| 40 | 					 | LC_NUMERIC_MASK \ | ||
| 41 | 					 | LC_TIME_MASK ) | ||
| 42 | #define LC_COLLATE_MASK			(1 << 0) | ||
| 43 | #define LC_CTYPE_MASK			(1 << 1) | ||
| 44 | #define LC_MESSAGES_MASK		(1 << 2) | ||
| 45 | #define LC_MONETARY_MASK		(1 << 3) | ||
| 46 | #define LC_NUMERIC_MASK			(1 << 4) | ||
| 47 | #define LC_TIME_MASK			(1 << 5) | ||
| 48 | |||
| 49 | #define _LC_NUM_MASK			6 | ||
| 50 | #define _LC_LAST_MASK			(1 << (_LC_NUM_MASK - 1)) | ||
| 51 | |||
| 52 | #define LC_GLOBAL_LOCALE		((locale_t)-1) | ||
| 53 | #define LC_C_LOCALE				((locale_t)NULL) | ||
| 54 | |||
| 55 | #ifdef MB_CUR_MAX | ||
| 56 | #undef MB_CUR_MAX | ||
| 57 | #define MB_CUR_MAX			(___mb_cur_max()) | ||
| 58 | #ifndef MB_CUR_MAX_L | ||
| 59 | #define MB_CUR_MAX_L(x)			(___mb_cur_max_l(x)) | ||
| 60 | #endif /* !MB_CUR_MAX_L */ | ||
| 61 | #endif /* MB_CUR_MAX */ | ||
| 62 | |||
| 63 | __BEGIN_DECLS | ||
| 64 | extern const locale_t _c_locale; | ||
| 65 | |||
| 66 | locale_t	duplocale(locale_t); | ||
| 67 | int		freelocale(locale_t); | ||
| 68 | struct lconv *	localeconv_l(locale_t); | ||
| 69 | locale_t	newlocale(int, __const char *, locale_t); | ||
| 70 | __const char *	querylocale(int, locale_t); | ||
| 71 | locale_t	uselocale(locale_t); | ||
| 72 | __END_DECLS | ||
| 73 | |||
| 74 | #ifdef _CTYPE_H_ | ||
| 75 | #include <xlocale/_ctype.h> | ||
| 76 | #endif /* _CTYPE_H_ */ | ||
| 77 | #ifdef __WCTYPE_H_ | ||
| 78 | #include <xlocale/__wctype.h> | ||
| 79 | #endif /* __WCTYPE_H_ */ | ||
| 80 | #ifdef _INTTYPES_H_ | ||
| 81 | #include <xlocale/_inttypes.h> | ||
| 82 | #endif /* _INTTYPES_H_ */ | ||
| 83 | #ifdef _LANGINFO_H_ | ||
| 84 | #include <xlocale/_langinfo.h> | ||
| 85 | #endif /* _LANGINFO_H_ */ | ||
| 86 | #ifdef _MONETARY_H_ | ||
| 87 | #include <xlocale/_monetary.h> | ||
| 88 | #endif /* _MONETARY_H_ */ | ||
| 89 | #ifdef _REGEX_H_ | ||
| 90 | #include <xlocale/_regex.h> | ||
| 91 | #endif /* _REGEX_H_ */ | ||
| 92 | #ifdef _STDIO_H_ | ||
| 93 | #include <xlocale/_stdio.h> | ||
| 94 | #endif /* _STDIO_H_ */ | ||
| 95 | #ifdef _STDLIB_H_ | ||
| 96 | #include <xlocale/_stdlib.h> | ||
| 97 | #endif /* _STDLIB_H_ */ | ||
| 98 | #ifdef _STRING_H_ | ||
| 99 | #include <xlocale/_string.h> | ||
| 100 | #endif /*STRING_CTYPE_H_ */ | ||
| 101 | #ifdef _TIME_H_ | ||
| 102 | #include <xlocale/_time.h> | ||
| 103 | #endif /* _TIME_H_ */ | ||
| 104 | #ifdef _WCHAR_H_ | ||
| 105 | #include <xlocale/_wchar.h> | ||
| 106 | #endif /*WCHAR_CTYPE_H_ */ | ||
| 107 | #ifdef _WCTYPE_H_ | ||
| 108 | #include <xlocale/_wctype.h> | ||
| 109 | #endif /* _WCTYPE_H_ */ | ||
| 110 | |||
| 111 | #endif /* _XLOCALE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/__wctype.h created+143| ... | @@ -0,0 +1,143 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE___WCTYPE_H_ | ||
| 25 | #define _XLOCALE___WCTYPE_H_ | ||
| 26 | |||
| 27 | #include <__wctype.h> | ||
| 28 | #include <xlocale/_ctype.h> | ||
| 29 | |||
| 30 | #if !defined(_DONT_USE_CTYPE_INLINE_) && \ | ||
| 31 | (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) | ||
| 32 | |||
| 33 | __DARWIN_WCTYPE_TOP_inline int | ||
| 34 | iswalnum_l(wint_t _wc, locale_t _l) | ||
| 35 | { | ||
| 36 | 	return (__istype_l(_wc, _CTYPE_A|_CTYPE_D, _l)); | ||
| 37 | } | ||
| 38 | |||
| 39 | __DARWIN_WCTYPE_TOP_inline int | ||
| 40 | iswalpha_l(wint_t _wc, locale_t _l) | ||
| 41 | { | ||
| 42 | 	return (__istype_l(_wc, _CTYPE_A, _l)); | ||
| 43 | } | ||
| 44 | |||
| 45 | __DARWIN_WCTYPE_TOP_inline int | ||
| 46 | iswcntrl_l(wint_t _wc, locale_t _l) | ||
| 47 | { | ||
| 48 | 	return (__istype_l(_wc, _CTYPE_C, _l)); | ||
| 49 | } | ||
| 50 | |||
| 51 | __DARWIN_WCTYPE_TOP_inline int | ||
| 52 | iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l) | ||
| 53 | { | ||
| 54 | 	return (__istype_l(_wc, _charclass, _l)); | ||
| 55 | } | ||
| 56 | |||
| 57 | __DARWIN_WCTYPE_TOP_inline int | ||
| 58 | iswdigit_l(wint_t _wc, locale_t _l) | ||
| 59 | { | ||
| 60 | 	return (__istype_l(_wc, _CTYPE_D, _l)); | ||
| 61 | } | ||
| 62 | |||
| 63 | __DARWIN_WCTYPE_TOP_inline int | ||
| 64 | iswgraph_l(wint_t _wc, locale_t _l) | ||
| 65 | { | ||
| 66 | 	return (__istype_l(_wc, _CTYPE_G, _l)); | ||
| 67 | } | ||
| 68 | |||
| 69 | __DARWIN_WCTYPE_TOP_inline int | ||
| 70 | iswlower_l(wint_t _wc, locale_t _l) | ||
| 71 | { | ||
| 72 | 	return (__istype_l(_wc, _CTYPE_L, _l)); | ||
| 73 | } | ||
| 74 | |||
| 75 | __DARWIN_WCTYPE_TOP_inline int | ||
| 76 | iswprint_l(wint_t _wc, locale_t _l) | ||
| 77 | { | ||
| 78 | 	return (__istype_l(_wc, _CTYPE_R, _l)); | ||
| 79 | } | ||
| 80 | |||
| 81 | __DARWIN_WCTYPE_TOP_inline int | ||
| 82 | iswpunct_l(wint_t _wc, locale_t _l) | ||
| 83 | { | ||
| 84 | 	return (__istype_l(_wc, _CTYPE_P, _l)); | ||
| 85 | } | ||
| 86 | |||
| 87 | __DARWIN_WCTYPE_TOP_inline int | ||
| 88 | iswspace_l(wint_t _wc, locale_t _l) | ||
| 89 | { | ||
| 90 | 	return (__istype_l(_wc, _CTYPE_S, _l)); | ||
| 91 | } | ||
| 92 | |||
| 93 | __DARWIN_WCTYPE_TOP_inline int | ||
| 94 | iswupper_l(wint_t _wc, locale_t _l) | ||
| 95 | { | ||
| 96 | 	return (__istype_l(_wc, _CTYPE_U, _l)); | ||
| 97 | } | ||
| 98 | |||
| 99 | __DARWIN_WCTYPE_TOP_inline int | ||
| 100 | iswxdigit_l(wint_t _wc, locale_t _l) | ||
| 101 | { | ||
| 102 | 	return (__istype_l(_wc, _CTYPE_X, _l)); | ||
| 103 | } | ||
| 104 | |||
| 105 | __DARWIN_WCTYPE_TOP_inline wint_t | ||
| 106 | towlower_l(wint_t _wc, locale_t _l) | ||
| 107 | { | ||
| 108 | return (__tolower_l(_wc, _l)); | ||
| 109 | } | ||
| 110 | |||
| 111 | __DARWIN_WCTYPE_TOP_inline wint_t | ||
| 112 | towupper_l(wint_t _wc, locale_t _l) | ||
| 113 | { | ||
| 114 | return (__toupper_l(_wc, _l)); | ||
| 115 | } | ||
| 116 | |||
| 117 | #else /* not using inlines */ | ||
| 118 | |||
| 119 | __BEGIN_DECLS | ||
| 120 | int	iswalnum_l(wint_t, locale_t); | ||
| 121 | int	iswalpha_l(wint_t, locale_t); | ||
| 122 | int	iswcntrl_l(wint_t, locale_t); | ||
| 123 | int	iswctype_l(wint_t, wctype_t, locale_t); | ||
| 124 | int	iswdigit_l(wint_t, locale_t); | ||
| 125 | int	iswgraph_l(wint_t, locale_t); | ||
| 126 | int	iswlower_l(wint_t, locale_t); | ||
| 127 | int	iswprint_l(wint_t, locale_t); | ||
| 128 | int	iswpunct_l(wint_t, locale_t); | ||
| 129 | int	iswspace_l(wint_t, locale_t); | ||
| 130 | int	iswupper_l(wint_t, locale_t); | ||
| 131 | int	iswxdigit_l(wint_t, locale_t); | ||
| 132 | wint_t	towlower_l(wint_t, locale_t); | ||
| 133 | wint_t	towupper_l(wint_t, locale_t); | ||
| 134 | __END_DECLS | ||
| 135 | |||
| 136 | #endif /* using inlines */ | ||
| 137 | |||
| 138 | __BEGIN_DECLS | ||
| 139 | wctype_t | ||
| 140 | 	wctype_l(const char *, locale_t); | ||
| 141 | __END_DECLS | ||
| 142 | |||
| 143 | #endif /* _XLOCALE___WCTYPE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_ctype.h created+237| ... | @@ -0,0 +1,237 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__CTYPE_H_ | ||
| 25 | #define _XLOCALE__CTYPE_H_ | ||
| 26 | |||
| 27 | #include <_ctype.h> | ||
| 28 | #include <_xlocale.h> | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Use inline functions if we are allowed to and the compiler supports them. | ||
| 32 | */ | ||
| 33 | #if !defined(_DONT_USE_CTYPE_INLINE_) && \ | ||
| 34 | (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) | ||
| 35 | |||
| 36 | /* See comments in <machine/_type.h> about __darwin_ct_rune_t. */ | ||
| 37 | __BEGIN_DECLS | ||
| 38 | unsigned long		___runetype_l(__darwin_ct_rune_t, locale_t); | ||
| 39 | __darwin_ct_rune_t	___tolower_l(__darwin_ct_rune_t, locale_t); | ||
| 40 | __darwin_ct_rune_t	___toupper_l(__darwin_ct_rune_t, locale_t); | ||
| 41 | __END_DECLS | ||
| 42 | |||
| 43 | __BEGIN_DECLS | ||
| 44 | int 	__maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t); | ||
| 45 | __END_DECLS | ||
| 46 | |||
| 47 | __DARWIN_CTYPE_inline int | ||
| 48 | __istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l) | ||
| 49 | { | ||
| 50 | 	return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f) | ||
| 51 | 		: __maskrune_l(_c, _f, _l)); | ||
| 52 | } | ||
| 53 | |||
| 54 | __DARWIN_CTYPE_inline __darwin_ct_rune_t | ||
| 55 | __toupper_l(__darwin_ct_rune_t _c, locale_t _l) | ||
| 56 | { | ||
| 57 | 	return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c] | ||
| 58 | 		: ___toupper_l(_c, _l); | ||
| 59 | } | ||
| 60 | |||
| 61 | __DARWIN_CTYPE_inline __darwin_ct_rune_t | ||
| 62 | __tolower_l(__darwin_ct_rune_t _c, locale_t _l) | ||
| 63 | { | ||
| 64 | 	return isascii(_c) ? _DefaultRuneLocale.__maplower[_c] | ||
| 65 | 		: ___tolower_l(_c, _l); | ||
| 66 | } | ||
| 67 | |||
| 68 | __DARWIN_CTYPE_inline int | ||
| 69 | __wcwidth_l(__darwin_ct_rune_t _c, locale_t _l) | ||
| 70 | { | ||
| 71 | 	unsigned int _x; | ||
| 72 | |||
| 73 | 	if (_c == 0) | ||
| 74 | 		return (0); | ||
| 75 | 	_x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, _l); | ||
| 76 | 	if ((_x & _CTYPE_SWM) != 0) | ||
| 77 | 		return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); | ||
| 78 | 	return ((_x & _CTYPE_R) != 0 ? 1 : -1); | ||
| 79 | } | ||
| 80 | |||
| 81 | #ifndef _EXTERNALIZE_CTYPE_INLINES_ | ||
| 82 | |||
| 83 | __DARWIN_CTYPE_TOP_inline int | ||
| 84 | digittoint_l(int c, locale_t l) | ||
| 85 | { | ||
| 86 | 	return (__maskrune_l(c, 0x0F, l)); | ||
| 87 | } | ||
| 88 | |||
| 89 | __DARWIN_CTYPE_TOP_inline int | ||
| 90 | isalnum_l(int c, locale_t l) | ||
| 91 | { | ||
| 92 | 	return (__istype_l(c, _CTYPE_A|_CTYPE_D, l)); | ||
| 93 | } | ||
| 94 | |||
| 95 | __DARWIN_CTYPE_TOP_inline int | ||
| 96 | isalpha_l(int c, locale_t l) | ||
| 97 | { | ||
| 98 | 	return (__istype_l(c, _CTYPE_A, l)); | ||
| 99 | } | ||
| 100 | |||
| 101 | __DARWIN_CTYPE_TOP_inline int | ||
| 102 | isblank_l(int c, locale_t l) | ||
| 103 | { | ||
| 104 | 	return (__istype_l(c, _CTYPE_B, l)); | ||
| 105 | } | ||
| 106 | |||
| 107 | __DARWIN_CTYPE_TOP_inline int | ||
| 108 | iscntrl_l(int c, locale_t l) | ||
| 109 | { | ||
| 110 | 	return (__istype_l(c, _CTYPE_C, l)); | ||
| 111 | } | ||
| 112 | |||
| 113 | __DARWIN_CTYPE_TOP_inline int | ||
| 114 | isdigit_l(int c, locale_t l) | ||
| 115 | { | ||
| 116 | 	return (__istype_l(c, _CTYPE_D, l)); | ||
| 117 | } | ||
| 118 | |||
| 119 | __DARWIN_CTYPE_TOP_inline int | ||
| 120 | isgraph_l(int c, locale_t l) | ||
| 121 | { | ||
| 122 | 	return (__istype_l(c, _CTYPE_G, l)); | ||
| 123 | } | ||
| 124 | |||
| 125 | __DARWIN_CTYPE_TOP_inline int | ||
| 126 | ishexnumber_l(int c, locale_t l) | ||
| 127 | { | ||
| 128 | 	return (__istype_l(c, _CTYPE_X, l)); | ||
| 129 | } | ||
| 130 | |||
| 131 | __DARWIN_CTYPE_TOP_inline int | ||
| 132 | isideogram_l(int c, locale_t l) | ||
| 133 | { | ||
| 134 | 	return (__istype_l(c, _CTYPE_I, l)); | ||
| 135 | } | ||
| 136 | |||
| 137 | __DARWIN_CTYPE_TOP_inline int | ||
| 138 | islower_l(int c, locale_t l) | ||
| 139 | { | ||
| 140 | 	return (__istype_l(c, _CTYPE_L, l)); | ||
| 141 | } | ||
| 142 | |||
| 143 | __DARWIN_CTYPE_TOP_inline int | ||
| 144 | isnumber_l(int c, locale_t l) | ||
| 145 | { | ||
| 146 | 	return (__istype_l(c, _CTYPE_D, l)); | ||
| 147 | } | ||
| 148 | |||
| 149 | __DARWIN_CTYPE_TOP_inline int | ||
| 150 | isphonogram_l(int c, locale_t l) | ||
| 151 | { | ||
| 152 | 	return (__istype_l(c, _CTYPE_Q, l)); | ||
| 153 | } | ||
| 154 | |||
| 155 | __DARWIN_CTYPE_TOP_inline int | ||
| 156 | isprint_l(int c, locale_t l) | ||
| 157 | { | ||
| 158 | 	return (__istype_l(c, _CTYPE_R, l)); | ||
| 159 | } | ||
| 160 | |||
| 161 | __DARWIN_CTYPE_TOP_inline int | ||
| 162 | ispunct_l(int c, locale_t l) | ||
| 163 | { | ||
| 164 | 	return (__istype_l(c, _CTYPE_P, l)); | ||
| 165 | } | ||
| 166 | |||
| 167 | __DARWIN_CTYPE_TOP_inline int | ||
| 168 | isrune_l(int c, locale_t l) | ||
| 169 | { | ||
| 170 | 	return (__istype_l(c, 0xFFFFFFF0L, l)); | ||
| 171 | } | ||
| 172 | |||
| 173 | __DARWIN_CTYPE_TOP_inline int | ||
| 174 | isspace_l(int c, locale_t l) | ||
| 175 | { | ||
| 176 | 	return (__istype_l(c, _CTYPE_S, l)); | ||
| 177 | } | ||
| 178 | |||
| 179 | __DARWIN_CTYPE_TOP_inline int | ||
| 180 | isspecial_l(int c, locale_t l) | ||
| 181 | { | ||
| 182 | 	return (__istype_l(c, _CTYPE_T, l)); | ||
| 183 | } | ||
| 184 | |||
| 185 | __DARWIN_CTYPE_TOP_inline int | ||
| 186 | isupper_l(int c, locale_t l) | ||
| 187 | { | ||
| 188 | 	return (__istype_l(c, _CTYPE_U, l)); | ||
| 189 | } | ||
| 190 | |||
| 191 | __DARWIN_CTYPE_TOP_inline int | ||
| 192 | isxdigit_l(int c, locale_t l) | ||
| 193 | { | ||
| 194 | 	return (__istype_l(c, _CTYPE_X, l)); | ||
| 195 | } | ||
| 196 | |||
| 197 | __DARWIN_CTYPE_TOP_inline int | ||
| 198 | tolower_l(int c, locale_t l) | ||
| 199 | { | ||
| 200 | return (__tolower_l(c, l)); | ||
| 201 | } | ||
| 202 | |||
| 203 | __DARWIN_CTYPE_TOP_inline int | ||
| 204 | toupper_l(int c, locale_t l) | ||
| 205 | { | ||
| 206 | return (__toupper_l(c, l)); | ||
| 207 | } | ||
| 208 | #endif /* _EXTERNALIZE_CTYPE_INLINES_ */ | ||
| 209 | |||
| 210 | #else /* not using inlines */ | ||
| 211 | |||
| 212 | __BEGIN_DECLS | ||
| 213 | int digittoint_l(int, locale_t); | ||
| 214 | int isalnum_l(int, locale_t); | ||
| 215 | int isalpha_l(int, locale_t); | ||
| 216 | int isblank_l(int, locale_t); | ||
| 217 | int iscntrl_l(int, locale_t); | ||
| 218 | int isdigit_l(int, locale_t); | ||
| 219 | int isgraph_l(int, locale_t); | ||
| 220 | int ishexnumber_l(int, locale_t); | ||
| 221 | int isideogram_l(int, locale_t); | ||
| 222 | int islower_l(int, locale_t); | ||
| 223 | int isnumber_l(int, locale_t); | ||
| 224 | int isphonogram_l(int, locale_t); | ||
| 225 | int isprint_l(int, locale_t); | ||
| 226 | int ispunct_l(int, locale_t); | ||
| 227 | int isrune_l(int, locale_t); | ||
| 228 | int isspace_l(int, locale_t); | ||
| 229 | int isspecial_l(int, locale_t); | ||
| 230 | int isupper_l(int, locale_t); | ||
| 231 | int isxdigit_l(int, locale_t); | ||
| 232 | int tolower_l(int, locale_t); | ||
| 233 | int toupper_l(int, locale_t); | ||
| 234 | __END_DECLS | ||
| 235 | #endif /* using inlines */ | ||
| 236 | |||
| 237 | #endif /* _XLOCALE__CTYPE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_inttypes.h created+48| ... | @@ -0,0 +1,48 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__INTTYPES_H_ | ||
| 25 | #define _XLOCALE__INTTYPES_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <stdint.h> | ||
| 29 | #include <stddef.h> /* wchar_t */ | ||
| 30 | #include <_xlocale.h> | ||
| 31 | |||
| 32 | __BEGIN_DECLS | ||
| 33 | intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr, | ||
| 34 | 		int base, locale_t); | ||
| 35 | uintmax_t strtoumax_l(const char * __restrict nptr, char ** __restrict endptr, | ||
| 36 | 		int base, locale_t); | ||
| 37 | intmax_t wcstoimax_l(const wchar_t * __restrict nptr, | ||
| 38 | 		wchar_t ** __restrict endptr, int base, locale_t); | ||
| 39 | uintmax_t wcstoumax_l(const wchar_t * __restrict nptr, | ||
| 40 | 		wchar_t ** __restrict endptr, int base, locale_t); | ||
| 41 | |||
| 42 | /* Poison the following routines if -fshort-wchar is set */ | ||
| 43 | #if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU | ||
| 44 | #pragma GCC poison wcstoimax_l wcstoumax_l | ||
| 45 | #endif | ||
| 46 | __END_DECLS | ||
| 47 | |||
| 48 | #endif /* _XLOCALE__INTTYPES_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_langinfo.h created+35| ... | @@ -0,0 +1,35 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__LANGINFO_H_ | ||
| 25 | #define _XLOCALE__LANGINFO_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <_types/_nl_item.h> | ||
| 29 | #include <_xlocale.h> | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | char	*nl_langinfo_l(nl_item, locale_t); | ||
| 33 | __END_DECLS | ||
| 34 | |||
| 35 | #endif /* _XLOCALE__LANGINFO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_monetary.h created+38| ... | @@ -0,0 +1,38 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, 2009 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__MONETARY_H_ | ||
| 25 | #define _XLOCALE__MONETARY_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <_types.h> | ||
| 29 | #include <sys/_types/_size_t.h> | ||
| 30 | #include <sys/_types/_ssize_t.h> | ||
| 31 | #include <_xlocale.h> | ||
| 32 | |||
| 33 | __BEGIN_DECLS | ||
| 34 | ssize_t	strfmon_l(char *, size_t, locale_t, const char *, ...) | ||
| 35 | 		__strfmonlike(4, 5); | ||
| 36 | __END_DECLS | ||
| 37 | |||
| 38 | #endif /* _XLOCALE__MONETARY_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_regex.h created+55| ... | @@ -0,0 +1,55 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2011 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__REGEX_H_ | ||
| 25 | #define _XLOCALE__REGEX_H_ | ||
| 26 | |||
| 27 | #ifndef _REGEX_H_ | ||
| 28 | #include <_regex.h> | ||
| 29 | #endif // _REGEX_H_ | ||
| 30 | #include <_xlocale.h> | ||
| 31 | |||
| 32 | __BEGIN_DECLS | ||
| 33 | |||
| 34 | int	regcomp_l(regex_t * __restrict, const char * __restrict, int, | ||
| 35 | 	 locale_t __restrict) | ||
| 36 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); | ||
| 37 | |||
| 38 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 39 | |||
| 40 | int	regncomp_l(regex_t * __restrict, const char * __restrict, size_t, | ||
| 41 | 	 int, locale_t __restrict) | ||
| 42 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); | ||
| 43 | int	regwcomp_l(regex_t * __restrict, const wchar_t * __restrict, | ||
| 44 | 	 int, locale_t __restrict) | ||
| 45 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); | ||
| 46 | int	regwnexec_l(const regex_t * __restrict, const wchar_t * __restrict, | ||
| 47 | 	 size_t, size_t, regmatch_t __pmatch[ __restrict], int, | ||
| 48 | 	 locale_t __restrict) | ||
| 49 | 	 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); | ||
| 50 | |||
| 51 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 52 | |||
| 53 | __END_DECLS | ||
| 54 | |||
| 55 | #endif /* _XLOCALE__REGEX_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_stdio.h created+82| ... | @@ -0,0 +1,82 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, 2009, 2010 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__STDIO_H_ | ||
| 25 | #define _XLOCALE__STDIO_H_ | ||
| 26 | |||
| 27 | #include <_stdio.h> | ||
| 28 | #include <_xlocale.h> | ||
| 29 | |||
| 30 | __BEGIN_DECLS | ||
| 31 | |||
| 32 | int	 fprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...) | ||
| 33 | __printflike(3, 4); | ||
| 34 | int	 fscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...) | ||
| 35 | __scanflike(3, 4); | ||
| 36 | int	 printf_l(locale_t __restrict, const char * __restrict, ...) | ||
| 37 | __printflike(2, 3); | ||
| 38 | int	 scanf_l(locale_t __restrict, const char * __restrict, ...) | ||
| 39 | __scanflike(2, 3); | ||
| 40 | int	 sprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, ...) | ||
| 41 | __printflike(3, 4) __swift_unavailable("Use snprintf_l instead."); | ||
| 42 | int	 sscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, ...) | ||
| 43 | __scanflike(3, 4); | ||
| 44 | int	 vfprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list) | ||
| 45 | __printflike(3, 0); | ||
| 46 | int	 vprintf_l(locale_t __restrict, const char * __restrict, va_list) | ||
| 47 | __printflike(2, 0); | ||
| 48 | int	 vsprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, va_list) | ||
| 49 | __printflike(3, 0) __swift_unavailable("Use vsnprintf_l instead."); | ||
| 50 | |||
| 51 | #if __DARWIN_C_LEVEL >= 200112L || defined(__cplusplus) | ||
| 52 | int	 snprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, ...) | ||
| 53 | __printflike(4, 5); | ||
| 54 | int	 vfscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list) | ||
| 55 | __scanflike(3, 0); | ||
| 56 | int	 vscanf_l(locale_t __restrict, const char * __restrict, va_list) | ||
| 57 | __scanflike(2, 0); | ||
| 58 | int	 vsnprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, va_list) | ||
| 59 | __printflike(4, 0); | ||
| 60 | int	 vsscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, va_list) | ||
| 61 | __scanflike(3, 0); | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #if __DARWIN_C_LEVEL >= 200809L || defined(__cplusplus) | ||
| 65 | int	 dprintf_l(int, locale_t __restrict, const char * __restrict, ...) | ||
| 66 | __printflike(3, 4) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 67 | int	 vdprintf_l(int, locale_t __restrict, const char * __restrict, va_list) | ||
| 68 | __printflike(3, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 69 | #endif | ||
| 70 | |||
| 71 | |||
| 72 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL || defined(__cplusplus) | ||
| 73 | int	 asprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, ...) | ||
| 74 | __printflike(3, 4); | ||
| 75 | int	 vasprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, va_list) | ||
| 76 | __printflike(3, 0); | ||
| 77 | #endif | ||
| 78 | |||
| 79 | __END_DECLS | ||
| 80 | |||
| 81 | |||
| 82 | #endif /* _XLOCALE__STDIO_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_stdlib.h created+74| ... | @@ -0,0 +1,74 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__STDLIB_H_ | ||
| 25 | #define _XLOCALE__STDLIB_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <sys/_types/_size_t.h> | ||
| 29 | #include <sys/_types/_wchar_t.h> | ||
| 30 | #include <_xlocale.h> | ||
| 31 | |||
| 32 | __BEGIN_DECLS | ||
| 33 | double	 atof_l(const char *, locale_t); | ||
| 34 | int	 atoi_l(const char *, locale_t); | ||
| 35 | long	 atol_l(const char *, locale_t); | ||
| 36 | #if !__DARWIN_NO_LONG_LONG | ||
| 37 | long long | ||
| 38 | 	 atoll_l(const char *, locale_t); | ||
| 39 | #endif /* !__DARWIN_NO_LONG_LONG */ | ||
| 40 | int	 mblen_l(const char *, size_t, locale_t); | ||
| 41 | size_t	 mbstowcs_l(wchar_t * __restrict , const char * __restrict, size_t, | ||
| 42 | 	 locale_t); | ||
| 43 | int	 mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t, | ||
| 44 | 	 locale_t); | ||
| 45 | double	 strtod_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtod_l); | ||
| 46 | float	 strtof_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtof_l); | ||
| 47 | long	 strtol_l(const char *, char **, int, locale_t); | ||
| 48 | long double | ||
| 49 | 	 strtold_l(const char *, char **, locale_t); | ||
| 50 | long long | ||
| 51 | 	 strtoll_l(const char *, char **, int, locale_t); | ||
| 52 | #if !__DARWIN_NO_LONG_LONG | ||
| 53 | long long | ||
| 54 | 	 strtoq_l(const char *, char **, int, locale_t); | ||
| 55 | #endif /* !__DARWIN_NO_LONG_LONG */ | ||
| 56 | unsigned long | ||
| 57 | 	 strtoul_l(const char *, char **, int, locale_t); | ||
| 58 | unsigned long long | ||
| 59 | 	 strtoull_l(const char *, char **, int, locale_t); | ||
| 60 | #if !__DARWIN_NO_LONG_LONG | ||
| 61 | unsigned long long | ||
| 62 | 	 strtouq_l(const char *, char **, int, locale_t); | ||
| 63 | #endif /* !__DARWIN_NO_LONG_LONG */ | ||
| 64 | size_t	 wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t, | ||
| 65 | 	 locale_t); | ||
| 66 | int	 wctomb_l(char *, wchar_t, locale_t); | ||
| 67 | |||
| 68 | /* Poison the following routines if -fshort-wchar is set */ | ||
| 69 | #if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU | ||
| 70 | #pragma GCC poison mbstowcs_l mbtowc_l wcstombs_l wctomb_l | ||
| 71 | #endif | ||
| 72 | __END_DECLS | ||
| 73 | |||
| 74 | #endif /* _XLOCALE__STDLIB_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_string.h created+39| ... | @@ -0,0 +1,39 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__STRING_H_ | ||
| 25 | #define _XLOCALE__STRING_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <sys/_types/_size_t.h> | ||
| 29 | #include <_xlocale.h> | ||
| 30 | |||
| 31 | __BEGIN_DECLS | ||
| 32 | int	 strcoll_l(const char *, const char *, locale_t); | ||
| 33 | size_t	 strxfrm_l(char *, const char *, size_t, locale_t); | ||
| 34 | int	 strcasecmp_l(const char *, const char *, locale_t); | ||
| 35 | char *strcasestr_l(const char *, const char *, locale_t); | ||
| 36 | int	 strncasecmp_l(const char *, const char *, size_t, locale_t); | ||
| 37 | __END_DECLS | ||
| 38 | |||
| 39 | #endif /* _XLOCALE__STRING_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_time.h created+41| ... | @@ -0,0 +1,41 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, 2009 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__TIME_H_ | ||
| 25 | #define _XLOCALE__TIME_H_ | ||
| 26 | |||
| 27 | #include <sys/cdefs.h> | ||
| 28 | #include <sys/_types/_size_t.h> | ||
| 29 | #include <_types.h> | ||
| 30 | #include <_xlocale.h> | ||
| 31 | |||
| 32 | __BEGIN_DECLS | ||
| 33 | size_t	 strftime_l(char * __restrict, size_t, const char * __restrict, | ||
| 34 | 		const struct tm * __restrict, locale_t) | ||
| 35 | 		__DARWIN_ALIAS(strftime_l) __strftimelike(3); | ||
| 36 | char	*strptime_l(const char * __restrict, const char * __restrict, | ||
| 37 | 		struct tm * __restrict, locale_t) | ||
| 38 | 		__DARWIN_ALIAS(strptime_l) __strftimelike(2); | ||
| 39 | __END_DECLS | ||
| 40 | |||
| 41 | #endif /* _XLOCALE__TIME_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_wchar.h created+147| ... | @@ -0,0 +1,147 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__WCHAR_H_ | ||
| 25 | #define _XLOCALE__WCHAR_H_ | ||
| 26 | |||
| 27 | #include <_stdio.h> | ||
| 28 | #include <_xlocale.h> | ||
| 29 | #include <sys/_types/_mbstate_t.h> | ||
| 30 | #include <sys/_types/_wint_t.h> | ||
| 31 | #include <stddef.h> /* wchar_t */ | ||
| 32 | |||
| 33 | /* Initially added in Issue 4 */ | ||
| 34 | __BEGIN_DECLS | ||
| 35 | wint_t	btowc_l(int, locale_t); | ||
| 36 | wint_t	fgetwc_l(FILE *, locale_t); | ||
| 37 | wchar_t	*fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); | ||
| 38 | wint_t	fputwc_l(wchar_t, FILE *, locale_t); | ||
| 39 | int	fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); | ||
| 40 | int	fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); | ||
| 41 | int	fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); | ||
| 42 | wint_t	getwc_l(FILE *, locale_t); | ||
| 43 | wint_t	getwchar_l(locale_t); | ||
| 44 | size_t	mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, | ||
| 45 | 	 locale_t); | ||
| 46 | size_t	mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, | ||
| 47 | 	 mbstate_t * __restrict, locale_t); | ||
| 48 | int	mbsinit_l(const mbstate_t *, locale_t); | ||
| 49 | size_t	mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, | ||
| 50 | 	 mbstate_t * __restrict, locale_t); | ||
| 51 | wint_t	putwc_l(wchar_t, FILE *, locale_t); | ||
| 52 | wint_t	putwchar_l(wchar_t, locale_t); | ||
| 53 | int	swprintf_l(wchar_t * __restrict, size_t n, locale_t, | ||
| 54 | 		const wchar_t * __restrict, ...); | ||
| 55 | int	swscanf_l(const wchar_t * __restrict, locale_t, | ||
| 56 | 		const wchar_t * __restrict, ...); | ||
| 57 | wint_t	ungetwc_l(wint_t, FILE *, locale_t); | ||
| 58 | int	vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, | ||
| 59 | 		__darwin_va_list); | ||
| 60 | int	vswprintf_l(wchar_t * __restrict, size_t n, locale_t, | ||
| 61 | 		const wchar_t * __restrict, __darwin_va_list); | ||
| 62 | int	vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list); | ||
| 63 | size_t	wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, | ||
| 64 | 	 locale_t); | ||
| 65 | int	wcscoll_l(const wchar_t *, const wchar_t *, locale_t); | ||
| 66 | size_t	wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, | ||
| 67 | 		const struct tm * __restrict, locale_t) | ||
| 68 | 		__DARWIN_ALIAS(wcsftime_l); | ||
| 69 | size_t	wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, | ||
| 70 | 	 mbstate_t * __restrict, locale_t); | ||
| 71 | double	wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); | ||
| 72 | long	wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, | ||
| 73 | 	 locale_t); | ||
| 74 | unsigned long | ||
| 75 | 	wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, | ||
| 76 | 	 locale_t); | ||
| 77 | int	wcswidth_l(const wchar_t *, size_t, locale_t); | ||
| 78 | size_t	wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, | ||
| 79 | 	 locale_t); | ||
| 80 | int	wctob_l(wint_t, locale_t); | ||
| 81 | int	wcwidth_l(wchar_t, locale_t); | ||
| 82 | int	wprintf_l(locale_t, const wchar_t * __restrict, ...); | ||
| 83 | int	wscanf_l(locale_t, const wchar_t * __restrict, ...); | ||
| 84 | __END_DECLS | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | /* Additional functionality provided by: | ||
| 89 | * POSIX.1-2001 | ||
| 90 | */ | ||
| 91 | |||
| 92 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 93 | __BEGIN_DECLS | ||
| 94 | int	vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, | ||
| 95 | 		__darwin_va_list); | ||
| 96 | int	vswscanf_l(const wchar_t * __restrict, locale_t, | ||
| 97 | 		const wchar_t * __restrict, __darwin_va_list); | ||
| 98 | int	vwscanf_l(locale_t, const wchar_t * __restrict, __darwin_va_list); | ||
| 99 | float	wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); | ||
| 100 | long double | ||
| 101 | 	wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); | ||
| 102 | #if !__DARWIN_NO_LONG_LONG | ||
| 103 | long long | ||
| 104 | 	wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, | ||
| 105 | 	 locale_t); | ||
| 106 | unsigned long long | ||
| 107 | 	wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, | ||
| 108 | 	 locale_t); | ||
| 109 | #endif /* !__DARWIN_NO_LONG_LONG */ | ||
| 110 | __END_DECLS | ||
| 111 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 112 | |||
| 113 | |||
| 114 | |||
| 115 | /* Additional functionality provided by: | ||
| 116 | * POSIX.1-2008 | ||
| 117 | */ | ||
| 118 | |||
| 119 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 120 | __BEGIN_DECLS | ||
| 121 | size_t	mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, | ||
| 122 | 	 size_t, mbstate_t * __restrict, locale_t); | ||
| 123 | int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 124 | int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 125 | size_t	wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, | ||
| 126 | 	 size_t, mbstate_t * __restrict, locale_t); | ||
| 127 | __END_DECLS | ||
| 128 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 129 | |||
| 130 | |||
| 131 | |||
| 132 | /* Darwin extensions */ | ||
| 133 | |||
| 134 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 135 | __BEGIN_DECLS | ||
| 136 | wchar_t	*fgetwln_l(FILE * __restrict, size_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | ||
| 137 | __END_DECLS | ||
| 138 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 139 | |||
| 140 | |||
| 141 | |||
| 142 | /* Poison the following routines if -fshort-wchar is set */ | ||
| 143 | #if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU | ||
| 144 | #pragma GCC poison fgetwln_l fgetws_l fputwc_l fputws_l fwprintf_l fwscanf_l mbrtowc_l mbsnrtowcs_l mbsrtowcs_l putwc_l putwchar_l swprintf_l swscanf_l vfwprintf_l vfwscanf_l vswprintf_l vswscanf_l vwprintf_l vwscanf_l wcrtomb_l wcscoll_l wcsftime_l wcsftime_l wcsnrtombs_l wcsrtombs_l wcstod_l wcstof_l wcstol_l wcstold_l wcstoll_l wcstoul_l wcstoull_l wcswidth_l wcsxfrm_l wcwidth_l wprintf_l wscanf_l | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #endif /* _XLOCALE__WCHAR_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xlocale/_wctype.h created+97| ... | @@ -0,0 +1,97 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _XLOCALE__WCTYPE_H_ | ||
| 25 | #define _XLOCALE__WCTYPE_H_ | ||
| 26 | |||
| 27 | #include <__wctype.h> | ||
| 28 | #include <_types/_wctrans_t.h> | ||
| 29 | #include <xlocale/_ctype.h> | ||
| 30 | |||
| 31 | #if !defined(_DONT_USE_CTYPE_INLINE_) && \ | ||
| 32 | (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) | ||
| 33 | |||
| 34 | __DARWIN_WCTYPE_TOP_inline int | ||
| 35 | iswblank_l(wint_t _wc, locale_t _l) | ||
| 36 | { | ||
| 37 | 	return (__istype_l(_wc, _CTYPE_B, _l)); | ||
| 38 | } | ||
| 39 | |||
| 40 | __DARWIN_WCTYPE_TOP_inline int | ||
| 41 | iswhexnumber_l(wint_t _wc, locale_t _l) | ||
| 42 | { | ||
| 43 | 	return (__istype_l(_wc, _CTYPE_X, _l)); | ||
| 44 | } | ||
| 45 | |||
| 46 | __DARWIN_WCTYPE_TOP_inline int | ||
| 47 | iswideogram_l(wint_t _wc, locale_t _l) | ||
| 48 | { | ||
| 49 | 	return (__istype_l(_wc, _CTYPE_I, _l)); | ||
| 50 | } | ||
| 51 | |||
| 52 | __DARWIN_WCTYPE_TOP_inline int | ||
| 53 | iswnumber_l(wint_t _wc, locale_t _l) | ||
| 54 | { | ||
| 55 | 	return (__istype_l(_wc, _CTYPE_D, _l)); | ||
| 56 | } | ||
| 57 | |||
| 58 | __DARWIN_WCTYPE_TOP_inline int | ||
| 59 | iswphonogram_l(wint_t _wc, locale_t _l) | ||
| 60 | { | ||
| 61 | 	return (__istype_l(_wc, _CTYPE_Q, _l)); | ||
| 62 | } | ||
| 63 | |||
| 64 | __DARWIN_WCTYPE_TOP_inline int | ||
| 65 | iswrune_l(wint_t _wc, locale_t _l) | ||
| 66 | { | ||
| 67 | 	return (__istype_l(_wc, 0xFFFFFFF0L, _l)); | ||
| 68 | } | ||
| 69 | |||
| 70 | __DARWIN_WCTYPE_TOP_inline int | ||
| 71 | iswspecial_l(wint_t _wc, locale_t _l) | ||
| 72 | { | ||
| 73 | 	return (__istype_l(_wc, _CTYPE_T, _l)); | ||
| 74 | } | ||
| 75 | |||
| 76 | #else /* not using inlines */ | ||
| 77 | |||
| 78 | __BEGIN_DECLS | ||
| 79 | int	iswblank_l(wint_t, locale_t); | ||
| 80 | wint_t	iswhexnumber_l(wint_t, locale_t); | ||
| 81 | wint_t	iswideogram_l(wint_t, locale_t); | ||
| 82 | wint_t	iswnumber_l(wint_t, locale_t); | ||
| 83 | wint_t	iswphonogram_l(wint_t, locale_t); | ||
| 84 | wint_t	iswrune_l(wint_t, locale_t); | ||
| 85 | wint_t	iswspecial_l(wint_t, locale_t); | ||
| 86 | __END_DECLS | ||
| 87 | |||
| 88 | #endif /* using inlines */ | ||
| 89 | |||
| 90 | __BEGIN_DECLS | ||
| 91 | wint_t	nextwctype_l(wint_t, wctype_t, locale_t); | ||
| 92 | wint_t	towctrans_l(wint_t, wctrans_t, locale_t); | ||
| 93 | wctrans_t | ||
| 94 | 	wctrans_l(const char *, locale_t); | ||
| 95 | __END_DECLS | ||
| 96 | |||
| 97 | #endif /* _XLOCALE__WCTYPE_H_ */ | ||
lib/libc/include/x86_64-macos-gnu/xpc/activity.h created+447| ... | @@ -0,0 +1,447 @@ | ||
| 1 | #ifndef __XPC_ACTIVITY_H__ | ||
| 2 | #define __XPC_ACTIVITY_H__ | ||
| 3 | |||
| 4 | #ifndef __XPC_INDIRECT__ | ||
| 5 | #error "Please #include <xpc/xpc.h> instead of this file directly." | ||
| 6 | // For HeaderDoc. | ||
| 7 | #include <xpc/base.h> | ||
| 8 | #endif // __XPC_INDIRECT__ | ||
| 9 | |||
| 10 | #ifdef __BLOCKS__ | ||
| 11 | |||
| 12 | XPC_ASSUME_NONNULL_BEGIN | ||
| 13 | __BEGIN_DECLS | ||
| 14 | |||
| 15 | /* | ||
| 16 | * The following are a collection of keys and values used to set an activity's | ||
| 17 | * execution criteria. | ||
| 18 | */ | ||
| 19 | |||
| 20 | /*! | ||
| 21 | * @constant XPC_ACTIVITY_INTERVAL | ||
| 22 | * An integer property indicating the desired time interval (in seconds) of the | ||
| 23 | * activity. The activity will not be run more than once per time interval. | ||
| 24 | * Due to the nature of XPC Activity finding an opportune time to run | ||
| 25 | * the activity, any two occurrences may be more or less than 'interval' | ||
| 26 | * seconds apart, but on average will be 'interval' seconds apart. | ||
| 27 | * The presence of this key implies the following, unless overridden: | ||
| 28 | * - XPC_ACTIVITY_REPEATING with a value of true | ||
| 29 | * - XPC_ACTIVITY_DELAY with a value of half the 'interval' | ||
| 30 | * The delay enforces a minimum distance between any two occurrences. | ||
| 31 | * - XPC_ACTIVITY_GRACE_PERIOD with a value of half the 'interval'. | ||
| 32 | * The grace period is the amount of time allowed to pass after the end of | ||
| 33 | * the interval before more aggressive scheduling occurs. The grace period | ||
| 34 | * does not increase the size of the interval. | ||
| 35 | */ | ||
| 36 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 37 | XPC_EXPORT | ||
| 38 | const char * const XPC_ACTIVITY_INTERVAL; | ||
| 39 | |||
| 40 | /*! | ||
| 41 | * @constant XPC_ACTIVITY_REPEATING | ||
| 42 | * A boolean property indicating whether this is a repeating activity. | ||
| 43 | */ | ||
| 44 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 45 | XPC_EXPORT | ||
| 46 | const char * const XPC_ACTIVITY_REPEATING; | ||
| 47 | |||
| 48 | /*! | ||
| 49 | * @constant XPC_ACTIVITY_DELAY | ||
| 50 | * An integer property indicating the number of seconds to delay before | ||
| 51 | * beginning the activity. | ||
| 52 | */ | ||
| 53 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 54 | XPC_EXPORT | ||
| 55 | const char * const XPC_ACTIVITY_DELAY; | ||
| 56 | |||
| 57 | /*! | ||
| 58 | * @constant XPC_ACTIVITY_GRACE_PERIOD | ||
| 59 | * An integer property indicating the number of seconds to allow as a grace | ||
| 60 | * period before the scheduling of the activity becomes more aggressive. | ||
| 61 | */ | ||
| 62 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 63 | XPC_EXPORT | ||
| 64 | const char * const XPC_ACTIVITY_GRACE_PERIOD; | ||
| 65 | |||
| 66 | |||
| 67 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 68 | XPC_EXPORT | ||
| 69 | const int64_t XPC_ACTIVITY_INTERVAL_1_MIN; | ||
| 70 | |||
| 71 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 72 | XPC_EXPORT | ||
| 73 | const int64_t XPC_ACTIVITY_INTERVAL_5_MIN; | ||
| 74 | |||
| 75 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 76 | XPC_EXPORT | ||
| 77 | const int64_t XPC_ACTIVITY_INTERVAL_15_MIN; | ||
| 78 | |||
| 79 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 80 | XPC_EXPORT | ||
| 81 | const int64_t XPC_ACTIVITY_INTERVAL_30_MIN; | ||
| 82 | |||
| 83 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 84 | XPC_EXPORT | ||
| 85 | const int64_t XPC_ACTIVITY_INTERVAL_1_HOUR; | ||
| 86 | |||
| 87 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 88 | XPC_EXPORT | ||
| 89 | const int64_t XPC_ACTIVITY_INTERVAL_4_HOURS; | ||
| 90 | |||
| 91 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 92 | XPC_EXPORT | ||
| 93 | const int64_t XPC_ACTIVITY_INTERVAL_8_HOURS; | ||
| 94 | |||
| 95 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 96 | XPC_EXPORT | ||
| 97 | const int64_t XPC_ACTIVITY_INTERVAL_1_DAY; | ||
| 98 | |||
| 99 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 100 | XPC_EXPORT | ||
| 101 | const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS; | ||
| 102 | |||
| 103 | /*! | ||
| 104 | * @constant XPC_ACTIVITY_PRIORITY | ||
| 105 | * A string property indicating the priority of the activity. | ||
| 106 | */ | ||
| 107 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 108 | XPC_EXPORT | ||
| 109 | const char * const XPC_ACTIVITY_PRIORITY; | ||
| 110 | |||
| 111 | /*! | ||
| 112 | * @constant XPC_ACTIVITY_PRIORITY_MAINTENANCE | ||
| 113 | * A string indicating activity is maintenance priority. | ||
| 114 | * | ||
| 115 | * Maintenance priority is intended for user-invisible maintenance tasks | ||
| 116 | * such as garbage collection or optimization. | ||
| 117 | * | ||
| 118 | * Maintenance activities are not permitted to run if the device thermal | ||
| 119 | * condition exceeds a nominal level or if the battery level is lower than 20%. | ||
| 120 | * In Low Power Mode (on supported devices), maintenance activities are not | ||
| 121 | * permitted to run while the device is on battery, or plugged in and the | ||
| 122 | * battery level is lower than 30%. | ||
| 123 | */ | ||
| 124 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 125 | XPC_EXPORT | ||
| 126 | const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE; | ||
| 127 | |||
| 128 | /*! | ||
| 129 | * @constant XPC_ACTIVITY_PRIORITY_UTILITY | ||
| 130 | * A string indicating activity is utility priority. | ||
| 131 | * | ||
| 132 | * Utility priority is intended for user-visible tasks such as fetching data | ||
| 133 | * from the network, copying files, or importing data. | ||
| 134 | * | ||
| 135 | * Utility activities are not permitted to run if the device thermal condition | ||
| 136 | * exceeds a moderate level or if the battery level is less than 10%. In Low | ||
| 137 | * Power Mode (on supported devices) when on battery power, utility activities | ||
| 138 | * are only permitted when they are close to their deadline (90% of their time | ||
| 139 | * window has elapsed). | ||
| 140 | */ | ||
| 141 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 142 | XPC_EXPORT | ||
| 143 | const char * const XPC_ACTIVITY_PRIORITY_UTILITY; | ||
| 144 | |||
| 145 | /*! | ||
| 146 | * @constant XPC_ACTIVITY_ALLOW_BATTERY | ||
| 147 | * A Boolean value indicating whether the activity should be allowed to run | ||
| 148 | * while the computer is on battery power. The default value is false for | ||
| 149 | * maintenance priority activity and true for utility priority activity. | ||
| 150 | */ | ||
| 151 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 152 | XPC_EXPORT | ||
| 153 | const char * const XPC_ACTIVITY_ALLOW_BATTERY; | ||
| 154 | |||
| 155 | /*! | ||
| 156 | * @constant XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP | ||
| 157 | * A Boolean value indicating whether the activity should only be performed | ||
| 158 | * while device appears to be asleep. Note that the definition of screen sleep | ||
| 159 | * may vary by platform and may include states where the device is known to be | ||
| 160 | * idle despite the fact that the display itself is still powered. Defaults to | ||
| 161 | * false. | ||
| 162 | */ | ||
| 163 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 164 | XPC_EXPORT | ||
| 165 | const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool | ||
| 166 | |||
| 167 | /*! | ||
| 168 | * @constant XPC_ACTIVITY_REQUIRE_BATTERY_LEVEL | ||
| 169 | * An integer percentage of minimum battery charge required to allow the | ||
| 170 | * activity to run. A default minimum battery level is determined by the | ||
| 171 | * system. | ||
| 172 | */ | ||
| 173 | __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_9, __MAC_10_9, __IPHONE_7_0, __IPHONE_7_0, | ||
| 174 | 	"REQUIRE_BATTERY_LEVEL is not implemented") | ||
| 175 | XPC_EXPORT | ||
| 176 | const char * const XPC_ACTIVITY_REQUIRE_BATTERY_LEVEL; // int (%) | ||
| 177 | |||
| 178 | /*! | ||
| 179 | * @constant XPC_ACTIVITY_REQUIRE_HDD_SPINNING | ||
| 180 | * A Boolean value indicating whether the activity should only be performed | ||
| 181 | * while the hard disk drive (HDD) is spinning. Computers with flash storage | ||
| 182 | * are considered to be equivalent to HDD spinning. Defaults to false. | ||
| 183 | */ | ||
| 184 | __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_9, __MAC_10_9, __IPHONE_7_0, __IPHONE_7_0, | ||
| 185 | 	"REQUIRE_HDD_SPINNING is not implemented") | ||
| 186 | XPC_EXPORT | ||
| 187 | const char * const XPC_ACTIVITY_REQUIRE_HDD_SPINNING; // bool | ||
| 188 | |||
| 189 | /*! | ||
| 190 | * @define XPC_TYPE_ACTIVITY | ||
| 191 | * A type representing the XPC activity object. | ||
| 192 | */ | ||
| 193 | #define XPC_TYPE_ACTIVITY (&_xpc_type_activity) | ||
| 194 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 195 | XPC_EXPORT | ||
| 196 | XPC_TYPE(_xpc_type_activity); | ||
| 197 | |||
| 198 | /*! | ||
| 199 | * @typedef xpc_activity_t | ||
| 200 | * | ||
| 201 | * @abstract | ||
| 202 | * An XPC activity object. | ||
| 203 | * | ||
| 204 | * @discussion | ||
| 205 | * This object represents a set of execution criteria and a current execution | ||
| 206 | * state for background activity on the system. Once an activity is registered, | ||
| 207 | * the system will evaluate its criteria to determine whether the activity is | ||
| 208 | * eligible to run under current system conditions. When an activity becomes | ||
| 209 | * eligible to run, its execution state will be updated and an invocation of | ||
| 210 | * its handler block will be made. | ||
| 211 | */ | ||
| 212 | XPC_DECL(xpc_activity); | ||
| 213 | |||
| 214 | /*! | ||
| 215 | * @typedef xpc_activity_handler_t | ||
| 216 | * | ||
| 217 | * @abstract | ||
| 218 | * A block that is called when an XPC activity becomes eligible to run. | ||
| 219 | */ | ||
| 220 | XPC_NONNULL1 | ||
| 221 | typedef void (^xpc_activity_handler_t)(xpc_activity_t activity); | ||
| 222 | |||
| 223 | /*! | ||
| 224 | * @constant XPC_ACTIVITY_CHECK_IN | ||
| 225 | * This constant may be passed to xpc_activity_register() as the criteria | ||
| 226 | * dictionary in order to check in with the system for previously registered | ||
| 227 | * activity using the same identifier (for example, an activity taken from a | ||
| 228 | * launchd property list). | ||
| 229 | */ | ||
| 230 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 231 | XPC_EXPORT | ||
| 232 | const xpc_object_t XPC_ACTIVITY_CHECK_IN; | ||
| 233 | |||
| 234 | /*! | ||
| 235 | * @function xpc_activity_register | ||
| 236 | * | ||
| 237 | * @abstract | ||
| 238 | * Registers an activity with the system. | ||
| 239 | * | ||
| 240 | * @discussion | ||
| 241 | * Registers a new activity with the system. The criteria of the activity are | ||
| 242 | * described by the dictionary passed to this function. If an activity with the | ||
| 243 | * same identifier already exists, the criteria provided override the existing | ||
| 244 | * criteria unless the special dictionary XPC_ACTIVITY_CHECK_IN is used. The | ||
| 245 | * XPC_ACTIVITY_CHECK_IN dictionary instructs the system to first look up an | ||
| 246 | * existing activity without modifying its criteria. Once the existing activity | ||
| 247 | * is found (or a new one is created with an empty set of criteria) the handler | ||
| 248 | * will be called with an activity object in the XPC_ACTIVITY_STATE_CHECK_IN | ||
| 249 | * state. | ||
| 250 | * | ||
| 251 | * @param identifier | ||
| 252 | * A unique identifier for the activity. Each application has its own namespace. | ||
| 253 | * The identifier should remain constant across registrations, relaunches of | ||
| 254 | * the application, and reboots. It should identify the kind of work being done, | ||
| 255 | * not a particular invocation of the work. | ||
| 256 | * | ||
| 257 | * @param criteria | ||
| 258 | * A dictionary of criteria for the activity. | ||
| 259 | * | ||
| 260 | * @param handler | ||
| 261 | * The handler block to be called when the activity changes state to one of the | ||
| 262 | * following states: | ||
| 263 | * - XPC_ACTIVITY_STATE_CHECK_IN (optional) | ||
| 264 | * - XPC_ACTIVITY_STATE_RUN | ||
| 265 | * | ||
| 266 | * The handler block is never invoked reentrantly. It will be invoked on a | ||
| 267 | * dispatch queue with an appropriate priority to perform the activity. | ||
| 268 | */ | ||
| 269 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 270 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3 | ||
| 271 | void | ||
| 272 | xpc_activity_register(const char *identifier, xpc_object_t criteria, | ||
| 273 | 	xpc_activity_handler_t handler); | ||
| 274 | |||
| 275 | /*! | ||
| 276 | * @function xpc_activity_copy_criteria | ||
| 277 | * | ||
| 278 | * @abstract | ||
| 279 | * Returns an XPC dictionary describing the execution criteria of an activity. | ||
| 280 | * This will return NULL in cases where the activity has already completed, e.g. | ||
| 281 | * when checking in to an event that finished and was not rescheduled. | ||
| 282 | */ | ||
| 283 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 284 | XPC_EXPORT XPC_WARN_RESULT XPC_RETURNS_RETAINED XPC_NONNULL1 | ||
| 285 | xpc_object_t _Nullable | ||
| 286 | xpc_activity_copy_criteria(xpc_activity_t activity); | ||
| 287 | |||
| 288 | /*! | ||
| 289 | * @function xpc_activity_set_criteria | ||
| 290 | * | ||
| 291 | * @abstract | ||
| 292 | * Modifies the execution criteria of an activity. | ||
| 293 | */ | ||
| 294 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 295 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 296 | void | ||
| 297 | xpc_activity_set_criteria(xpc_activity_t activity, xpc_object_t criteria); | ||
| 298 | |||
| 299 | /*! | ||
| 300 | * @enum xpc_activity_state_t | ||
| 301 | * An activity is defined to be in one of the following states. Applications | ||
| 302 | * may check the current state of the activity using xpc_activity_get_state() | ||
| 303 | * in the handler block provided to xpc_activity_register(). | ||
| 304 | * | ||
| 305 | * The application can modify the state of the activity by calling | ||
| 306 | * xpc_activity_set_state() with one of the following: | ||
| 307 | * - XPC_ACTIVITY_STATE_DEFER | ||
| 308 | * - XPC_ACTIVITY_STATE_CONTINUE | ||
| 309 | * - XPC_ACTIVITY_STATE_DONE | ||
| 310 | * | ||
| 311 | * @constant XPC_ACTIVITY_STATE_CHECK_IN | ||
| 312 | * An activity in this state has just completed a checkin with the system after | ||
| 313 | * XPC_ACTIVITY_CHECK_IN was provided as the criteria dictionary to | ||
| 314 | * xpc_activity_register. The state gives the application an opportunity to | ||
| 315 | * inspect and modify the activity's criteria. | ||
| 316 | * | ||
| 317 | * @constant XPC_ACTIVITY_STATE_WAIT | ||
| 318 | * An activity in this state is waiting for an opportunity to run. This value | ||
| 319 | * is never returned within the activity's handler block, as the block is | ||
| 320 | * invoked in response to XPC_ACTIVITY_STATE_CHECK_IN or XPC_ACTIVITY_STATE_RUN. | ||
| 321 | * | ||
| 322 | * Note: | ||
| 323 | * A launchd job may idle exit while an activity is in the wait state and be | ||
| 324 | * relaunched in response to the activity becoming runnable. The launchd job | ||
| 325 | * simply needs to re-register for the activity on its next launch by passing | ||
| 326 | * XPC_ACTIVITY_STATE_CHECK_IN to xpc_activity_register(). | ||
| 327 | * | ||
| 328 | * @constant XPC_ACTIVITY_STATE_RUN | ||
| 329 | * An activity in this state is eligible to run based on its criteria. | ||
| 330 | * | ||
| 331 | * @constant XPC_ACTIVITY_STATE_DEFER | ||
| 332 | * An application may pass this value to xpc_activity_set_state() to indicate | ||
| 333 | * that the activity should be deferred (placed back into the WAIT state) until | ||
| 334 | * a time when its criteria are met again. Deferring an activity does not reset | ||
| 335 | * any of its time-based criteria (in other words, it will remain past due). | ||
| 336 | * | ||
| 337 | * IMPORTANT: | ||
| 338 | * This should be done in response to observing xpc_activity_should_defer(). | ||
| 339 | * It should not be done unilaterally. If you determine that conditions are bad | ||
| 340 | * to do your activity's work for reasons you can't express in a criteria | ||
| 341 | * dictionary, you should set the activity's state to XPC_ACTIVITY_STATE_DONE. | ||
| 342 | * | ||
| 343 | * | ||
| 344 | * @constant XPC_ACTIVITY_STATE_CONTINUE | ||
| 345 | * An application may pass this value to xpc_activity_set_state() to indicate | ||
| 346 | * that the activity will continue its operation beyond the return of its | ||
| 347 | * handler block. This can be used to extend an activity to include asynchronous | ||
| 348 | * operations. The activity's handler block will not be invoked again until the | ||
| 349 | * state has been updated to either XPC_ACTIVITY_STATE_DEFER or, in the case | ||
| 350 | * of repeating activity, XPC_ACTIVITY_STATE_DONE. | ||
| 351 | * | ||
| 352 | * @constant XPC_ACTIVITY_STATE_DONE | ||
| 353 | * An application may pass this value to xpc_activity_set_state() to indicate | ||
| 354 | * that the activity has completed. For non-repeating activity, the resources | ||
| 355 | * associated with the activity will be automatically released upon return from | ||
| 356 | * the handler block. For repeating activity, timers present in the activity's | ||
| 357 | * criteria will be reset. | ||
| 358 | */ | ||
| 359 | enum { | ||
| 360 | 	XPC_ACTIVITY_STATE_CHECK_IN, | ||
| 361 | 	XPC_ACTIVITY_STATE_WAIT, | ||
| 362 | 	XPC_ACTIVITY_STATE_RUN, | ||
| 363 | 	XPC_ACTIVITY_STATE_DEFER, | ||
| 364 | 	XPC_ACTIVITY_STATE_CONTINUE, | ||
| 365 | 	XPC_ACTIVITY_STATE_DONE, | ||
| 366 | }; | ||
| 367 | typedef long xpc_activity_state_t; | ||
| 368 | |||
| 369 | /*! | ||
| 370 | * @function xpc_activity_get_state | ||
| 371 | * | ||
| 372 | * @abstract | ||
| 373 | * Returns the current state of an activity. | ||
| 374 | */ | ||
| 375 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 376 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 377 | xpc_activity_state_t | ||
| 378 | xpc_activity_get_state(xpc_activity_t activity); | ||
| 379 | |||
| 380 | /*! | ||
| 381 | * @function xpc_activity_set_state | ||
| 382 | * | ||
| 383 | * @abstract | ||
| 384 | * Updates the current state of an activity. | ||
| 385 | * | ||
| 386 | * @return | ||
| 387 | * Returns true if the state was successfully updated; otherwise, returns | ||
| 388 | * false if the requested state transition is not valid. | ||
| 389 | */ | ||
| 390 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 391 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 392 | bool | ||
| 393 | xpc_activity_set_state(xpc_activity_t activity, xpc_activity_state_t state); | ||
| 394 | |||
| 395 | /*! | ||
| 396 | * @function xpc_activity_should_defer | ||
| 397 | * | ||
| 398 | * @abstract | ||
| 399 | * Test whether an activity should be deferred. | ||
| 400 | * | ||
| 401 | * @discussion | ||
| 402 | * This function may be used to test whether the criteria of a long-running | ||
| 403 | * activity are still satisfied. If not, the system indicates that the | ||
| 404 | * application should defer the activity. The application may acknowledge the | ||
| 405 | * deferral by calling xpc_activity_set_state() with XPC_ACTIVITY_STATE_DEFER. | ||
| 406 | * Once deferred, the system will place the activity back into the WAIT state | ||
| 407 | * and re-invoke the handler block at the earliest opportunity when the criteria | ||
| 408 | * are once again satisfied. | ||
| 409 | * | ||
| 410 | * @return | ||
| 411 | * Returns true if the activity should be deferred. | ||
| 412 | */ | ||
| 413 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 414 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 415 | bool | ||
| 416 | xpc_activity_should_defer(xpc_activity_t activity); | ||
| 417 | |||
| 418 | /*! | ||
| 419 | * @function xpc_activity_unregister | ||
| 420 | * | ||
| 421 | * @abstract | ||
| 422 | * Unregisters an activity found by its identifier. | ||
| 423 | * | ||
| 424 | * @discussion | ||
| 425 | * A dynamically registered activity will be deleted in response to this call. | ||
| 426 | * Statically registered activity (from a launchd property list) will be | ||
| 427 | * deleted until the job is next loaded (e.g. at next boot). | ||
| 428 | * | ||
| 429 | * Unregistering an activity has no effect on any outstanding xpc_activity_t | ||
| 430 | * objects or any currently executing xpc_activity_handler_t blocks; however, | ||
| 431 | * no new handler block invocations will be made after it is unregistered. | ||
| 432 | * | ||
| 433 | * @param identifier | ||
| 434 | * The identifier of the activity to unregister. | ||
| 435 | */ | ||
| 436 | __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) | ||
| 437 | XPC_EXPORT XPC_NONNULL1 | ||
| 438 | void | ||
| 439 | xpc_activity_unregister(const char *identifier); | ||
| 440 | |||
| 441 | __END_DECLS | ||
| 442 | XPC_ASSUME_NONNULL_END | ||
| 443 | |||
| 444 | #endif // __BLOCKS__ | ||
| 445 | |||
| 446 | #endif // __XPC_ACTIVITY_H__ | ||
| 447 | |||
lib/libc/include/x86_64-macos-gnu/xpc/availability.h created+124| ... | @@ -0,0 +1,124 @@ | ||
| 1 | #ifndef __XPC_AVAILABILITY_H__ | ||
| 2 | #define __XPC_AVAILABILITY_H__ | ||
| 3 | |||
| 4 | #include <Availability.h> | ||
| 5 | |||
| 6 | // Certain parts of the project use all the project's headers but have to build | ||
| 7 | // against newer OSX SDKs than ebuild uses -- liblaunch_host being the example. | ||
| 8 | // So we need to define these. | ||
| 9 | #ifndef __MAC_10_16 | ||
| 10 | #define __MAC_10_16 101600 | ||
| 11 | #endif // __MAC_10_16 | ||
| 12 | |||
| 13 | #ifndef __MAC_10_15 | ||
| 14 | #define __MAC_10_15 101500 | ||
| 15 | #define __AVAILABILITY_INTERNAL__MAC_10_15 \ | ||
| 16 | __attribute__((availability(macosx, introduced=10.15))) | ||
| 17 | #endif // __MAC_10_15 | ||
| 18 | |||
| 19 | #ifndef __MAC_10_14 | ||
| 20 | #define __MAC_10_14 101400 | ||
| 21 | #define __AVAILABILITY_INTERNAL__MAC_10_14 \ | ||
| 22 | __attribute__((availability(macosx, introduced=10.14))) | ||
| 23 | #endif // __MAC_10_14 | ||
| 24 | |||
| 25 | #ifndef __MAC_10_13 | ||
| 26 | #define __MAC_10_13 101300 | ||
| 27 | #define __AVAILABILITY_INTERNAL__MAC_10_13 \ | ||
| 28 | 	__attribute__((availability(macosx, introduced=10.13))) | ||
| 29 | #endif // __MAC_10_13 | ||
| 30 | |||
| 31 | #ifndef __MAC_10_12 | ||
| 32 | #define __MAC_10_12 101200 | ||
| 33 | #define __AVAILABILITY_INTERNAL__MAC_10_12 \ | ||
| 34 | 	__attribute__((availability(macosx, introduced=10.12))) | ||
| 35 | #endif // __MAC_10_12 | ||
| 36 | |||
| 37 | #ifndef __MAC_10_11 | ||
| 38 | #define __MAC_10_11 101100 | ||
| 39 | #define __AVAILABILITY_INTERNAL__MAC_10_11 \ | ||
| 40 | 	__attribute__((availability(macosx, introduced=10.11))) | ||
| 41 | #endif // __MAC_10_11 | ||
| 42 | |||
| 43 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 44 | #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 45 | #endif // __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 46 | |||
| 47 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 48 | #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 49 | #endif // __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 50 | |||
| 51 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 52 | #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 53 | #endif // __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 54 | |||
| 55 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 56 | #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 57 | #endif // __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 58 | |||
| 59 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 60 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 61 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 62 | |||
| 63 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 64 | #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 65 | #endif // __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 66 | |||
| 67 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 68 | #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 69 | #endif // __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 70 | |||
| 71 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 72 | #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 73 | #endif // __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 74 | |||
| 75 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 76 | #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 77 | #endif // __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 78 | |||
| 79 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 80 | #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 81 | #endif // __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 82 | |||
| 83 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 84 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 85 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 86 | |||
| 87 | #if __has_include(<simulator_host.h>) | ||
| 88 | #include <simulator_host.h> | ||
| 89 | #else // __has_include(<simulator_host.h>) | ||
| 90 | #ifndef IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 91 | #define IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED 999999 | ||
| 92 | #endif // IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 93 | #endif // __has_include(<simulator_host.h>) | ||
| 94 | |||
| 95 | #ifndef __WATCHOS_UNAVAILABLE | ||
| 96 | #define __WATCHOS_UNAVAILABLE | ||
| 97 | #endif | ||
| 98 | |||
| 99 | #ifndef __TVOS_UNAVAILABLE | ||
| 100 | #define __TVOS_UNAVAILABLE | ||
| 101 | #endif | ||
| 102 | |||
| 103 | // simulator host-side bits build against SDKs not having __*_AVAILABLE() yet | ||
| 104 | #ifndef __OSX_AVAILABLE | ||
| 105 | #define __OSX_AVAILABLE(...) | ||
| 106 | #endif | ||
| 107 | |||
| 108 | #ifndef __IOS_AVAILABLE | ||
| 109 | #define __IOS_AVAILABLE(...) | ||
| 110 | #endif | ||
| 111 | |||
| 112 | #ifndef __TVOS_AVAILABLE | ||
| 113 | #define __TVOS_AVAILABLE(...) | ||
| 114 | #endif | ||
| 115 | |||
| 116 | #ifndef __WATCHOS_AVAILABLE | ||
| 117 | #define __WATCHOS_AVAILABLE(...) | ||
| 118 | #endif | ||
| 119 | |||
| 120 | #ifndef __API_AVAILABLE | ||
| 121 | #define __API_AVAILABLE(...) | ||
| 122 | #endif | ||
| 123 | |||
| 124 | #endif // __XPC_AVAILABILITY_H__ | ||
lib/libc/include/x86_64-macos-gnu/xpc/base.h created+213| ... | @@ -0,0 +1,213 @@ | ||
| 1 | // Copyright (c) 2009-2011 Apple Inc. All rights reserved. | ||
| 2 | |||
| 3 | #ifndef __XPC_BASE_H__ | ||
| 4 | #define __XPC_BASE_H__ | ||
| 5 | |||
| 6 | #include <sys/cdefs.h> | ||
| 7 | |||
| 8 | __BEGIN_DECLS | ||
| 9 | |||
| 10 | #if !defined(__has_include) | ||
| 11 | #define __has_include(x) 0 | ||
| 12 | #endif // !defined(__has_include) | ||
| 13 | |||
| 14 | #if !defined(__has_attribute) | ||
| 15 | #define __has_attribute(x) 0 | ||
| 16 | #endif // !defined(__has_attribute) | ||
| 17 | |||
| 18 | #if !defined(__has_feature) | ||
| 19 | #define __has_feature(x) 0 | ||
| 20 | #endif // !defined(__has_feature) | ||
| 21 | |||
| 22 | #if !defined(__has_extension) | ||
| 23 | #define __has_extension(x) 0 | ||
| 24 | #endif // !defined(__has_extension) | ||
| 25 | |||
| 26 | #if __has_include(<xpc/availability.h>) | ||
| 27 | #include <xpc/availability.h> | ||
| 28 | #else // __has_include(<xpc/availability.h>) | ||
| 29 | #include <Availability.h> | ||
| 30 | #endif // __has_include(<xpc/availability.h>) | ||
| 31 | |||
| 32 | #include <os/availability.h> | ||
| 33 | |||
| 34 | #ifndef __XPC_INDIRECT__ | ||
| 35 | #error "Please #include <xpc/xpc.h> instead of this file directly." | ||
| 36 | #endif // __XPC_INDIRECT__ | ||
| 37 | |||
| 38 | #pragma mark Attribute Shims | ||
| 39 | #ifdef __GNUC__ | ||
| 40 | #define XPC_CONSTRUCTOR __attribute__((constructor)) | ||
| 41 | #define XPC_NORETURN __attribute__((__noreturn__)) | ||
| 42 | #define XPC_NOTHROW __attribute__((__nothrow__)) | ||
| 43 | #define XPC_NONNULL1 __attribute__((__nonnull__(1))) | ||
| 44 | #define XPC_NONNULL2 __attribute__((__nonnull__(2))) | ||
| 45 | #define XPC_NONNULL3 __attribute__((__nonnull__(3))) | ||
| 46 | #define XPC_NONNULL4 __attribute__((__nonnull__(4))) | ||
| 47 | #define XPC_NONNULL5 __attribute__((__nonnull__(5))) | ||
| 48 | #define XPC_NONNULL6 __attribute__((__nonnull__(6))) | ||
| 49 | #define XPC_NONNULL7 __attribute__((__nonnull__(7))) | ||
| 50 | #define XPC_NONNULL8 __attribute__((__nonnull__(8))) | ||
| 51 | #define XPC_NONNULL9 __attribute__((__nonnull__(9))) | ||
| 52 | #define XPC_NONNULL10 __attribute__((__nonnull__(10))) | ||
| 53 | #define XPC_NONNULL11 __attribute__((__nonnull__(11))) | ||
| 54 | #define XPC_NONNULL_ALL __attribute__((__nonnull__)) | ||
| 55 | #define XPC_SENTINEL __attribute__((__sentinel__)) | ||
| 56 | #define XPC_PURE __attribute__((__pure__)) | ||
| 57 | #define XPC_WARN_RESULT __attribute__((__warn_unused_result__)) | ||
| 58 | #define XPC_MALLOC __attribute__((__malloc__)) | ||
| 59 | #define XPC_UNUSED __attribute__((__unused__)) | ||
| 60 | #define XPC_USED __attribute__((__used__)) | ||
| 61 | #define XPC_PACKED __attribute__((__packed__)) | ||
| 62 | #define XPC_PRINTF(m, n) __attribute__((format(printf, m, n))) | ||
| 63 | #define XPC_INLINE static __inline__ __attribute__((__always_inline__)) | ||
| 64 | #define XPC_NOINLINE __attribute__((noinline)) | ||
| 65 | #define XPC_NOIMPL __attribute__((unavailable)) | ||
| 66 | |||
| 67 | #if __has_attribute(noescape) | ||
| 68 | #define XPC_NOESCAPE __attribute__((__noescape__)) | ||
| 69 | #else | ||
| 70 | #define XPC_NOESCAPE | ||
| 71 | #endif | ||
| 72 | |||
| 73 | #if __has_extension(attribute_unavailable_with_message) | ||
| 74 | #define XPC_UNAVAILABLE(m) __attribute__((unavailable(m))) | ||
| 75 | #else // __has_extension(attribute_unavailable_with_message) | ||
| 76 | #define XPC_UNAVAILABLE(m) XPC_NOIMPL | ||
| 77 | #endif // __has_extension(attribute_unavailable_with_message) | ||
| 78 | |||
| 79 | #define XPC_EXPORT extern __attribute__((visibility("default"))) | ||
| 80 | #define XPC_NOEXPORT __attribute__((visibility("hidden"))) | ||
| 81 | #define XPC_WEAKIMPORT extern __attribute__((weak_import)) | ||
| 82 | #define XPC_DEBUGGER_EXCL XPC_NOEXPORT XPC_USED | ||
| 83 | #define XPC_TRANSPARENT_UNION __attribute__((transparent_union)) | ||
| 84 | #if __clang__ | ||
| 85 | #define XPC_DEPRECATED(m) __attribute__((deprecated(m))) | ||
| 86 | #else // __clang__ | ||
| 87 | #define XPC_DEPRECATED(m) __attribute__((deprecated)) | ||
| 88 | #endif // __clang | ||
| 89 | |||
| 90 | #if defined(__XPC_TEST__) && __XPC_TEST__ | ||
| 91 | #define XPC_TESTSTATIC | ||
| 92 | #define XPC_TESTEXTERN extern | ||
| 93 | #else // defined(__XPC_TEST__) && __XPC_TEST__ | ||
| 94 | #define XPC_TESTSTATIC static | ||
| 95 | #endif // defined(__XPC_TEST__) && __XPC_TEST__ | ||
| 96 | |||
| 97 | #if __has_feature(objc_arc) | ||
| 98 | #define XPC_GIVES_REFERENCE __strong | ||
| 99 | #define XPC_UNRETAINED __unsafe_unretained | ||
| 100 | #define XPC_BRIDGE(xo) ((__bridge void *)(xo)) | ||
| 101 | #define XPC_BRIDGEREF_BEGIN(xo) ((__bridge_retained void *)(xo)) | ||
| 102 | #define XPC_BRIDGEREF_BEGIN_WITH_REF(xo) ((__bridge void *)(xo)) | ||
| 103 | #define XPC_BRIDGEREF_MIDDLE(xo) ((__bridge id)(xo)) | ||
| 104 | #define XPC_BRIDGEREF_END(xo) ((__bridge_transfer id)(xo)) | ||
| 105 | #else // __has_feature(objc_arc) | ||
| 106 | #define XPC_GIVES_REFERENCE | ||
| 107 | #define XPC_UNRETAINED | ||
| 108 | #define XPC_BRIDGE(xo) (xo) | ||
| 109 | #define XPC_BRIDGEREF_BEGIN(xo) (xo) | ||
| 110 | #define XPC_BRIDGEREF_BEGIN_WITH_REF(xo) (xo) | ||
| 111 | #define XPC_BRIDGEREF_MIDDLE(xo) (xo) | ||
| 112 | #define XPC_BRIDGEREF_END(xo) (xo) | ||
| 113 | #endif // __has_feature(objc_arc) | ||
| 114 | |||
| 115 | #define _xpc_unreachable() __builtin_unreachable() | ||
| 116 | #else // __GNUC__ | ||
| 117 | /*! @parseOnly */ | ||
| 118 | #define XPC_CONSTRUCTOR | ||
| 119 | /*! @parseOnly */ | ||
| 120 | #define XPC_NORETURN | ||
| 121 | /*! @parseOnly */ | ||
| 122 | #define XPC_NOTHROW | ||
| 123 | /*! @parseOnly */ | ||
| 124 | #define XPC_NONNULL1 | ||
| 125 | /*! @parseOnly */ | ||
| 126 | #define XPC_NONNULL2 | ||
| 127 | /*! @parseOnly */ | ||
| 128 | #define XPC_NONNULL3 | ||
| 129 | /*! @parseOnly */ | ||
| 130 | #define XPC_NONNULL4 | ||
| 131 | /*! @parseOnly */ | ||
| 132 | #define XPC_NONNULL5 | ||
| 133 | /*! @parseOnly */ | ||
| 134 | #define XPC_NONNULL6 | ||
| 135 | /*! @parseOnly */ | ||
| 136 | #define XPC_NONNULL7 | ||
| 137 | /*! @parseOnly */ | ||
| 138 | #define XPC_NONNULL8 | ||
| 139 | /*! @parseOnly */ | ||
| 140 | #define XPC_NONNULL9 | ||
| 141 | /*! @parseOnly */ | ||
| 142 | #define XPC_NONNULL10 | ||
| 143 | /*! @parseOnly */ | ||
| 144 | #define XPC_NONNULL11 | ||
| 145 | /*! @parseOnly */ | ||
| 146 | #define XPC_NONNULL(n) | ||
| 147 | /*! @parseOnly */ | ||
| 148 | #define XPC_NONNULL_ALL | ||
| 149 | /*! @parseOnly */ | ||
| 150 | #define XPC_SENTINEL | ||
| 151 | /*! @parseOnly */ | ||
| 152 | #define XPC_PURE | ||
| 153 | /*! @parseOnly */ | ||
| 154 | #define XPC_WARN_RESULT | ||
| 155 | /*! @parseOnly */ | ||
| 156 | #define XPC_MALLOC | ||
| 157 | /*! @parseOnly */ | ||
| 158 | #define XPC_UNUSED | ||
| 159 | /*! @parseOnly */ | ||
| 160 | #define XPC_PACKED | ||
| 161 | /*! @parseOnly */ | ||
| 162 | #define XPC_PRINTF(m, n) | ||
| 163 | /*! @parseOnly */ | ||
| 164 | #define XPC_INLINE static inline | ||
| 165 | /*! @parseOnly */ | ||
| 166 | #define XPC_NOINLINE | ||
| 167 | /*! @parseOnly */ | ||
| 168 | #define XPC_NOIMPL | ||
| 169 | /*! @parseOnly */ | ||
| 170 | #define XPC_EXPORT extern | ||
| 171 | /*! @parseOnly */ | ||
| 172 | #define XPC_WEAKIMPORT | ||
| 173 | /*! @parseOnly */ | ||
| 174 | #define XPC_DEPRECATED | ||
| 175 | /*! @parseOnly */ | ||
| 176 | #define XPC_UNAVAILABLE(m) | ||
| 177 | /*! @parseOnly */ | ||
| 178 | #define XPC_NOESCAPE | ||
| 179 | #endif // __GNUC__ | ||
| 180 | |||
| 181 | #if __has_feature(assume_nonnull) | ||
| 182 | #define XPC_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") | ||
| 183 | #define XPC_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") | ||
| 184 | #else | ||
| 185 | #define XPC_ASSUME_NONNULL_BEGIN | ||
| 186 | #define XPC_ASSUME_NONNULL_END | ||
| 187 | #endif | ||
| 188 | |||
| 189 | #if __has_feature(nullability_on_arrays) | ||
| 190 | #define XPC_NONNULL_ARRAY _Nonnull | ||
| 191 | #else | ||
| 192 | #define XPC_NONNULL_ARRAY | ||
| 193 | #endif | ||
| 194 | |||
| 195 | #ifdef OS_CLOSED_OPTIONS | ||
| 196 | #define XPC_FLAGS_ENUM(_name, _type, ...) \ | ||
| 197 | 		OS_CLOSED_OPTIONS(_name, _type, __VA_ARGS__) | ||
| 198 | #else // OS_CLOSED_ENUM | ||
| 199 | #define XPC_FLAGS_ENUM(_name, _type, ...) \ | ||
| 200 | 		OS_ENUM(_name, _type, __VA_ARGS__) | ||
| 201 | #endif // OS_CLOSED_ENUM | ||
| 202 | |||
| 203 | #ifdef OS_CLOSED_ENUM | ||
| 204 | #define XPC_ENUM(_name, _type, ...) \ | ||
| 205 | 		OS_CLOSED_ENUM(_name, _type, __VA_ARGS__) | ||
| 206 | #else // OS_CLOSED_ENUM | ||
| 207 | #define XPC_ENUM(_name, _type, ...) \ | ||
| 208 | 		OS_ENUM(_name, _type, __VA_ARGS__) | ||
| 209 | #endif // OS_CLOSED_ENUM | ||
| 210 | |||
| 211 | __END_DECLS | ||
| 212 | |||
| 213 | #endif // __XPC_BASE_H__ | ||
lib/libc/include/x86_64-macos-gnu/xpc/connection.h created+748| ... | @@ -0,0 +1,748 @@ | ||
| 1 | #ifndef __XPC_CONNECTION_H__ | ||
| 2 | #define __XPC_CONNECTION_H__ | ||
| 3 | |||
| 4 | #ifndef __XPC_INDIRECT__ | ||
| 5 | #error "Please #include <xpc/xpc.h> instead of this file directly." | ||
| 6 | // For HeaderDoc. | ||
| 7 | #include <xpc/base.h> | ||
| 8 | #endif // __XPC_INDIRECT__ | ||
| 9 | |||
| 10 | #ifndef __BLOCKS__ | ||
| 11 | #error "XPC connections require Blocks support." | ||
| 12 | #endif // __BLOCKS__ | ||
| 13 | |||
| 14 | XPC_ASSUME_NONNULL_BEGIN | ||
| 15 | __BEGIN_DECLS | ||
| 16 | |||
| 17 | /*! | ||
| 18 | * @constant XPC_ERROR_CONNECTION_INTERRUPTED | ||
| 19 | * Will be delivered to the connection's event handler if the remote service | ||
| 20 | * exited. The connection is still live even in this case, and resending a | ||
| 21 | * message will cause the service to be launched on-demand. This error serves | ||
| 22 | * as a client's indication that it should resynchronize any state that it had | ||
| 23 | * given the service. | ||
| 24 | * | ||
| 25 | * Any messages in the queue to be sent will be unwound and canceled when this | ||
| 26 | * error occurs. In the case where a message waiting to be sent has a reply | ||
| 27 | * handler, that handler will be invoked with this error. In the context of the | ||
| 28 | * reply handler, this error indicates that a reply to the message will never | ||
| 29 | * arrive. | ||
| 30 | * | ||
| 31 | * Messages that do not have reply handlers associated with them will be | ||
| 32 | * silently disposed of. This error will only be given to peer connections. | ||
| 33 | */ | ||
| 34 | #define XPC_ERROR_CONNECTION_INTERRUPTED \ | ||
| 35 | 	XPC_GLOBAL_OBJECT(_xpc_error_connection_interrupted) | ||
| 36 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 37 | XPC_EXPORT | ||
| 38 | const struct _xpc_dictionary_s _xpc_error_connection_interrupted; | ||
| 39 | |||
| 40 | /*! | ||
| 41 | * @constant XPC_ERROR_CONNECTION_INVALID | ||
| 42 | * Will be delivered to the connection's event handler if the named service | ||
| 43 | * provided to xpc_connection_create() could not be found in the XPC service | ||
| 44 | * namespace. The connection is useless and should be disposed of. | ||
| 45 | * | ||
| 46 | * Any messages in the queue to be sent will be unwound and canceled when this | ||
| 47 | * error occurs, similarly to the behavior when XPC_ERROR_CONNECTION_INTERRUPTED | ||
| 48 | * occurs. The only difference is that the XPC_ERROR_CONNECTION_INVALID will be | ||
| 49 | * given to outstanding reply handlers and the connection's event handler. | ||
| 50 | * | ||
| 51 | * This error may be given to any type of connection. | ||
| 52 | */ | ||
| 53 | #define XPC_ERROR_CONNECTION_INVALID \ | ||
| 54 | 	XPC_GLOBAL_OBJECT(_xpc_error_connection_invalid) | ||
| 55 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 56 | XPC_EXPORT | ||
| 57 | const struct _xpc_dictionary_s _xpc_error_connection_invalid; | ||
| 58 | |||
| 59 | /*! | ||
| 60 | * @constant XPC_ERROR_TERMINATION_IMMINENT | ||
| 61 | * On macOS, this error will be delivered to a peer connection's event handler | ||
| 62 | * when the XPC runtime has determined that the program should exit and that | ||
| 63 | * all outstanding transactions must be wound down, and no new transactions can | ||
| 64 | * be opened. | ||
| 65 | * | ||
| 66 | * After this error has been delivered to the event handler, no more messages | ||
| 67 | * will be received by the connection. The runtime will still attempt to deliver | ||
| 68 | * outgoing messages, but this error should be treated as an indication that | ||
| 69 | * the program will exit very soon, and any outstanding business over the | ||
| 70 | * connection should be wrapped up as quickly as possible and the connection | ||
| 71 | * canceled shortly thereafter. | ||
| 72 | * | ||
| 73 | * This error will only be delivered to peer connections received through a | ||
| 74 | * listener or the xpc_main() event handler. | ||
| 75 | */ | ||
| 76 | #define XPC_ERROR_TERMINATION_IMMINENT \ | ||
| 77 | 	XPC_GLOBAL_OBJECT(_xpc_error_termination_imminent) | ||
| 78 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 79 | XPC_EXPORT | ||
| 80 | const struct _xpc_dictionary_s _xpc_error_termination_imminent; | ||
| 81 | |||
| 82 | /*! | ||
| 83 | * @constant XPC_CONNECTION_MACH_SERVICE_LISTENER | ||
| 84 | * Passed to xpc_connection_create_mach_service(). This flag indicates that the | ||
| 85 | * caller is the listener for the named service. This flag may only be passed | ||
| 86 | * for services which are advertised in the process' launchd.plist(5). You may | ||
| 87 | * not use this flag to dynamically add services to the Mach bootstrap | ||
| 88 | * namespace. | ||
| 89 | */ | ||
| 90 | #define XPC_CONNECTION_MACH_SERVICE_LISTENER (1 << 0) | ||
| 91 | |||
| 92 | /*! | ||
| 93 | * @constant XPC_CONNECTION_MACH_SERVICE_PRIVILEGED | ||
| 94 | * Passed to xpc_connection_create_mach_service(). This flag indicates that the | ||
| 95 | * job advertising the service name in its launchd.plist(5) should be in the | ||
| 96 | * privileged Mach bootstrap. This is typically accomplished by placing your | ||
| 97 | * launchd.plist(5) in /Library/LaunchDaemons. If specified alongside the | ||
| 98 | * XPC_CONNECTION_MACH_SERVICE_LISTENER flag, this flag is a no-op. | ||
| 99 | */ | ||
| 100 | #define XPC_CONNECTION_MACH_SERVICE_PRIVILEGED (1 << 1) | ||
| 101 | |||
| 102 | /*! | ||
| 103 | * @typedef xpc_finalizer_f | ||
| 104 | * A function that is invoked when a connection is being torn down and its | ||
| 105 | * context needs to be freed. The sole argument is the value that was given to | ||
| 106 | * {@link xpc_connection_set_context} or NULL if no context has been set. It is | ||
| 107 | * not safe to reference the connection from within this function. | ||
| 108 | * | ||
| 109 | * @param value | ||
| 110 | * The context object that is to be disposed of. | ||
| 111 | */ | ||
| 112 | typedef void (*xpc_finalizer_t)(void * _Nullable value); | ||
| 113 | |||
| 114 | /*! | ||
| 115 | * @function xpc_connection_create | ||
| 116 | * Creates a new connection object. | ||
| 117 | * | ||
| 118 | * @param name | ||
| 119 | * If non-NULL, the name of the service with which to connect. The returned | ||
| 120 | * connection will be a peer. | ||
| 121 | * | ||
| 122 | * If NULL, an anonymous listener connection will be created. You can embed the | ||
| 123 | * ability to create new peer connections in an endpoint, which can be inserted | ||
| 124 | * into a message and sent to another process . | ||
| 125 | * | ||
| 126 | * @param targetq | ||
| 127 | * The GCD queue to which the event handler block will be submitted. This | ||
| 128 | * parameter may be NULL, in which case the connection's target queue will be | ||
| 129 | * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT. | ||
| 130 | * The target queue may be changed later with a call to | ||
| 131 | * xpc_connection_set_target_queue(). | ||
| 132 | * | ||
| 133 | * @result | ||
| 134 | * A new connection object. The caller is responsible for disposing of the | ||
| 135 | * returned object with {@link xpc_release} when it is no longer needed. | ||
| 136 | * | ||
| 137 | * @discussion | ||
| 138 | * This method will succeed even if the named service does not exist. This is | ||
| 139 | * because the XPC namespace is not queried for the service name until the | ||
| 140 | * connection has been activated. See {@link xpc_connection_activate()}. | ||
| 141 | * | ||
| 142 | * XPC connections, like dispatch sources, are returned in an inactive state, so | ||
| 143 | * you must call {@link xpc_connection_activate()} in order to begin receiving | ||
| 144 | * events from the connection. Also like dispatch sources, connections must be | ||
| 145 | * activated and not suspended in order to be safely released. It is | ||
| 146 | * a programming error to release an inactive or suspended connection. | ||
| 147 | */ | ||
| 148 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 149 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 150 | xpc_connection_t | ||
| 151 | xpc_connection_create(const char * _Nullable name, | ||
| 152 | 	dispatch_queue_t _Nullable targetq); | ||
| 153 | |||
| 154 | /*! | ||
| 155 | * @function xpc_connection_create_mach_service | ||
| 156 | * Creates a new connection object representing a Mach service. | ||
| 157 | * | ||
| 158 | * @param name | ||
| 159 | * The name of the remote service with which to connect. The service name must | ||
| 160 | * exist in a Mach bootstrap that is accessible to the process and be advertised | ||
| 161 | * in a launchd.plist. | ||
| 162 | * | ||
| 163 | * @param targetq | ||
| 164 | * The GCD queue to which the event handler block will be submitted. This | ||
| 165 | * parameter may be NULL, in which case the connection's target queue will be | ||
| 166 | * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT. | ||
| 167 | * The target queue may be changed later with a call to | ||
| 168 | * xpc_connection_set_target_queue(). | ||
| 169 | * | ||
| 170 | * @param flags | ||
| 171 | * Additional attributes with which to create the connection. | ||
| 172 | * | ||
| 173 | * @result | ||
| 174 | * A new connection object. | ||
| 175 | * | ||
| 176 | * @discussion | ||
| 177 | * If the XPC_CONNECTION_MACH_SERVICE_LISTENER flag is given to this method, | ||
| 178 | * then the connection returned will be a listener connection. Otherwise, a peer | ||
| 179 | * connection will be returned. See the documentation for | ||
| 180 | * {@link xpc_connection_set_event_handler()} for the semantics of listener | ||
| 181 | * connections versus peer connections. | ||
| 182 | * | ||
| 183 | * This method will succeed even if the named service does not exist. This is | ||
| 184 | * because the Mach namespace is not queried for the service name until the | ||
| 185 | * connection has been activated. See {@link xpc_connection_activate()}. | ||
| 186 | */ | ||
| 187 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 188 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 189 | xpc_connection_t | ||
| 190 | xpc_connection_create_mach_service(const char *name, | ||
| 191 | 	dispatch_queue_t _Nullable targetq, uint64_t flags); | ||
| 192 | |||
| 193 | /*! | ||
| 194 | * @function xpc_connection_create_from_endpoint | ||
| 195 | * Creates a new connection from the given endpoint. | ||
| 196 | * | ||
| 197 | * @param endpoint | ||
| 198 | * The endpoint from which to create the new connection. | ||
| 199 | * | ||
| 200 | * @result | ||
| 201 | * A new peer connection to the listener represented by the given endpoint. | ||
| 202 | * | ||
| 203 | * The same responsibilities of setting an event handler and activating the | ||
| 204 | * connection after calling xpc_connection_create() apply to the connection | ||
| 205 | * returned by this API. Since the connection yielded by this API is not | ||
| 206 | * associated with a name (and therefore is not rediscoverable), this connection | ||
| 207 | * will receive XPC_ERROR_CONNECTION_INVALID if the listening side crashes, | ||
| 208 | * exits or cancels the listener connection. | ||
| 209 | */ | ||
| 210 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 211 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 212 | xpc_connection_t | ||
| 213 | xpc_connection_create_from_endpoint(xpc_endpoint_t endpoint); | ||
| 214 | |||
| 215 | /*! | ||
| 216 | * @function xpc_connection_set_target_queue | ||
| 217 | * Sets the target queue of the given connection. | ||
| 218 | * | ||
| 219 | * @param connection | ||
| 220 | * The connection object which is to be manipulated. | ||
| 221 | * | ||
| 222 | * @param targetq | ||
| 223 | * The GCD queue to which the event handler block will be submitted. This | ||
| 224 | * parameter may be NULL, in which case the connection's target queue will be | ||
| 225 | * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT. | ||
| 226 | * | ||
| 227 | * @discussion | ||
| 228 | * Setting the target queue is asynchronous and non-preemptive and therefore | ||
| 229 | * this method will not interrupt the execution of an already-running event | ||
| 230 | * handler block. Setting the target queue may be likened to issuing a barrier | ||
| 231 | * to the connection which does the actual work of changing the target queue. | ||
| 232 | * | ||
| 233 | * The XPC runtime guarantees this non-preemptiveness even for concurrent target | ||
| 234 | * queues. If the target queue is a concurrent queue, then XPC still guarantees | ||
| 235 | * that there will never be more than one invocation of the connection's event | ||
| 236 | * handler block executing concurrently. If you wish to process events | ||
| 237 | * concurrently, you can dispatch_async(3) to a concurrent queue from within | ||
| 238 | * the event handler. | ||
| 239 | * | ||
| 240 | * IMPORTANT: When called from within the event handler block, | ||
| 241 | * dispatch_get_current_queue(3) is NOT guaranteed to return a pointer to the | ||
| 242 | * queue set with this method. | ||
| 243 | * | ||
| 244 | * Despite this seeming inconsistency, the XPC runtime guarantees that, when the | ||
| 245 | * target queue is a serial queue, the event handler block will execute | ||
| 246 | * synchonously with respect to other blocks submitted to that same queue. When | ||
| 247 | * the target queue is a concurrent queue, the event handler block may run | ||
| 248 | * concurrently with other blocks submitted to that queue, but it will never run | ||
| 249 | * concurrently with other invocations of itself for the same connection, as | ||
| 250 | * discussed previously. | ||
| 251 | */ | ||
| 252 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 253 | XPC_EXPORT XPC_NONNULL1 | ||
| 254 | void | ||
| 255 | xpc_connection_set_target_queue(xpc_connection_t connection, | ||
| 256 | 	dispatch_queue_t _Nullable targetq); | ||
| 257 | |||
| 258 | /*! | ||
| 259 | * @function xpc_connection_set_event_handler | ||
| 260 | * Sets the event handler block for the connection. | ||
| 261 | * | ||
| 262 | * @param connection | ||
| 263 | * The connection object which is to be manipulated. | ||
| 264 | * | ||
| 265 | * @param handler | ||
| 266 | * The event handler block. | ||
| 267 | * | ||
| 268 | * @discussion | ||
| 269 | * Setting the event handler is asynchronous and non-preemptive, and therefore | ||
| 270 | * this method will not interrupt the execution of an already-running event | ||
| 271 | * handler block. If the event handler is executing at the time of this call, it | ||
| 272 | * will finish, and then the connection's event handler will be changed before | ||
| 273 | * the next invocation of the event handler. The XPC runtime guarantees this | ||
| 274 | * non-preemptiveness even for concurrent target queues. | ||
| 275 | * | ||
| 276 | * Connection event handlers are non-reentrant, so it is safe to call | ||
| 277 | * xpc_connection_set_event_handler() from within the event handler block. | ||
| 278 | * | ||
| 279 | * The event handler's execution should be treated as a barrier to all | ||
| 280 | * connection activity. When it is executing, the connection will not attempt to | ||
| 281 | * send or receive messages, including reply messages. Thus, it is not safe to | ||
| 282 | * call xpc_connection_send_message_with_reply_sync() on the connection from | ||
| 283 | * within the event handler. | ||
| 284 | * | ||
| 285 | * You do not hold a reference on the object received as the event handler's | ||
| 286 | * only argument. Regardless of the type of object received, it is safe to call | ||
| 287 | * xpc_retain() on the object to obtain a reference to it. | ||
| 288 | * | ||
| 289 | * A connection may receive different events depending upon whether it is a | ||
| 290 | * listener or not. Any connection may receive an error in its event handler. | ||
| 291 | * But while normal connections may receive messages in addition to errors, | ||
| 292 | * listener connections will receive connections and and not messages. | ||
| 293 | * | ||
| 294 | * Connections received by listeners are equivalent to those returned by | ||
| 295 | * xpc_connection_create() with a non-NULL name argument and a NULL targetq | ||
| 296 | * argument with the exception that you do not hold a reference on them. | ||
| 297 | * You must set an event handler and activate the connection. If you do not wish | ||
| 298 | * to accept the connection, you may simply call xpc_connection_cancel() on it | ||
| 299 | * and return. The runtime will dispose of it for you. | ||
| 300 | * | ||
| 301 | * If there is an error in the connection, this handler will be invoked with the | ||
| 302 | * error dictionary as its argument. This dictionary will be one of the well- | ||
| 303 | * known XPC_ERROR_* dictionaries. | ||
| 304 | * | ||
| 305 | * Regardless of the type of event, ownership of the event object is NOT | ||
| 306 | * implicitly transferred. Thus, the object will be released and deallocated at | ||
| 307 | * some point in the future after the event handler returns. If you wish the | ||
| 308 | * event's lifetime to persist, you must retain it with xpc_retain(). | ||
| 309 | * | ||
| 310 | * Connections received through the event handler will be released and | ||
| 311 | * deallocated after the connection has gone invalid and delivered that event to | ||
| 312 | * its event handler. | ||
| 313 | */ | ||
| 314 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 315 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 316 | void | ||
| 317 | xpc_connection_set_event_handler(xpc_connection_t connection, | ||
| 318 | 	xpc_handler_t handler); | ||
| 319 | |||
| 320 | /*! | ||
| 321 | * @function xpc_connection_activate | ||
| 322 | * Activates the connection. Connections start in an inactive state, so you must | ||
| 323 | * call xpc_connection_activate() on a connection before it will send or receive | ||
| 324 | * any messages. | ||
| 325 | * | ||
| 326 | * @param connection | ||
| 327 | * The connection object which is to be manipulated. | ||
| 328 | * | ||
| 329 | * @discussion | ||
| 330 | * Calling xpc_connection_activate() on an active connection has no effect. | ||
| 331 | * Releasing the last reference on an inactive connection that was created with | ||
| 332 | * an xpc_connection_create*() call is undefined. | ||
| 333 | * | ||
| 334 | * For backward compatibility reasons, xpc_connection_resume() on an inactive | ||
| 335 | * and not otherwise suspended xpc connection has the same effect as calling | ||
| 336 | * xpc_connection_activate(). For new code, using xpc_connection_activate() | ||
| 337 | * is preferred. | ||
| 338 | */ | ||
| 339 | __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 340 | __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) | ||
| 341 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 342 | void | ||
| 343 | xpc_connection_activate(xpc_connection_t connection); | ||
| 344 | |||
| 345 | /*! | ||
| 346 | * @function xpc_connection_suspend | ||
| 347 | * Suspends the connection so that the event handler block will not fire and | ||
| 348 | * that the connection will not attempt to send any messages it has in its | ||
| 349 | * queue. All calls to xpc_connection_suspend() must be balanced with calls to | ||
| 350 | * xpc_connection_resume() before releasing the last reference to the | ||
| 351 | * connection. | ||
| 352 | * | ||
| 353 | * @param connection | ||
| 354 | * The connection object which is to be manipulated. | ||
| 355 | * | ||
| 356 | * @discussion | ||
| 357 | * Suspension is asynchronous and non-preemptive, and therefore this method will | ||
| 358 | * not interrupt the execution of an already-running event handler block. If | ||
| 359 | * the event handler is executing at the time of this call, it will finish, and | ||
| 360 | * then the connection will be suspended before the next scheduled invocation | ||
| 361 | * of the event handler. The XPC runtime guarantees this non-preemptiveness even | ||
| 362 | * for concurrent target queues. | ||
| 363 | * | ||
| 364 | * Connection event handlers are non-reentrant, so it is safe to call | ||
| 365 | * xpc_connection_suspend() from within the event handler block. | ||
| 366 | */ | ||
| 367 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 368 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 369 | void | ||
| 370 | xpc_connection_suspend(xpc_connection_t connection); | ||
| 371 | |||
| 372 | /*! | ||
| 373 | * @function xpc_connection_resume | ||
| 374 | * Resumes the connection. | ||
| 375 | * | ||
| 376 | * @param connection | ||
| 377 | * The connection object which is to be manipulated. | ||
| 378 | * | ||
| 379 | * @discussion | ||
| 380 | * In order for a connection to become live, every call to | ||
| 381 | * xpc_connection_suspend() must be balanced with a call to | ||
| 382 | * xpc_connection_resume(). | ||
| 383 | * | ||
| 384 | * For backward compatibility reasons, xpc_connection_resume() on an inactive | ||
| 385 | * and not otherwise suspended xpc connection has the same effect as calling | ||
| 386 | * xpc_connection_activate(). For new code, using xpc_connection_activate() | ||
| 387 | * is preferred. | ||
| 388 | * | ||
| 389 | * Calling xpc_connection_resume() more times than xpc_connection_suspend() | ||
| 390 | * has been called is otherwise considered an error. | ||
| 391 | */ | ||
| 392 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 393 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 394 | void | ||
| 395 | xpc_connection_resume(xpc_connection_t connection); | ||
| 396 | |||
| 397 | /*! | ||
| 398 | * @function xpc_connection_send_message | ||
| 399 | * Sends a message over the connection to the destination service. | ||
| 400 | * | ||
| 401 | * @param connection | ||
| 402 | * The connection over which the message shall be sent. | ||
| 403 | * | ||
| 404 | * @param message | ||
| 405 | * The message to send. This must be a dictionary object. This dictionary is | ||
| 406 | * logically copied by the connection, so it is safe to modify the dictionary | ||
| 407 | * after this call. | ||
| 408 | * | ||
| 409 | * @discussion | ||
| 410 | * Messages are delivered in FIFO order. This API is safe to call from multiple | ||
| 411 | * GCD queues. There is no indication that a message was delivered successfully. | ||
| 412 | * This is because even once the message has been successfully enqueued on the | ||
| 413 | * remote end, there are no guarantees about when the runtime will dequeue the | ||
| 414 | * message and invoke the other connection's event handler block. | ||
| 415 | * | ||
| 416 | * If this API is used to send a message that is in reply to another message, | ||
| 417 | * there is no guarantee of ordering between the invocations of the connection's | ||
| 418 | * event handler and the reply handler for that message, even if they are | ||
| 419 | * targeted to the same queue. | ||
| 420 | * | ||
| 421 | * After extensive study, we have found that clients who are interested in | ||
| 422 | * the state of the message on the server end are typically holding open | ||
| 423 | * transactions related to that message. And the only reliable way to track the | ||
| 424 | * lifetime of that transaction is at the protocol layer. So the server should | ||
| 425 | * send a reply message, which upon receiving, will cause the client to close | ||
| 426 | * its transaction. | ||
| 427 | */ | ||
| 428 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 429 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 430 | void | ||
| 431 | xpc_connection_send_message(xpc_connection_t connection, xpc_object_t message); | ||
| 432 | |||
| 433 | /*! | ||
| 434 | * @function xpc_connection_send_barrier | ||
| 435 | * Issues a barrier against the connection's message-send activity. | ||
| 436 | * | ||
| 437 | * @param connection | ||
| 438 | * The connection against which the barrier is to be issued. | ||
| 439 | * | ||
| 440 | * @param barrier | ||
| 441 | * The barrier block to issue. This barrier prevents concurrent message-send | ||
| 442 | * activity on the connection. No messages will be sent while the barrier block | ||
| 443 | * is executing. | ||
| 444 | * | ||
| 445 | * @discussion | ||
| 446 | * XPC guarantees that, even if the connection's target queue is a concurrent | ||
| 447 | * queue, there are no other messages being sent concurrently while the barrier | ||
| 448 | * block is executing. XPC does not guarantee that the receipt of messages | ||
| 449 | * (either through the connection's event handler or through reply handlers) | ||
| 450 | * will be suspended while the barrier is executing. | ||
| 451 | * | ||
| 452 | * A barrier is issued relative to the message-send queue. Thus, if you call | ||
| 453 | * xpc_connection_send_message() five times and then call | ||
| 454 | * xpc_connection_send_barrier(), the barrier will be invoked after the fifth | ||
| 455 | * message has been sent and its memory disposed of. You may safely cancel a | ||
| 456 | * connection from within a barrier block. | ||
| 457 | * | ||
| 458 | * If a barrier is issued after sending a message which expects a reply, the | ||
| 459 | * behavior is the same as described above. The receipt of a reply message will | ||
| 460 | * not influence when the barrier runs. | ||
| 461 | * | ||
| 462 | * A barrier block can be useful for throttling resource consumption on the | ||
| 463 | * connected side of a connection. For example, if your connection sends many | ||
| 464 | * large messages, you can use a barrier to limit the number of messages that | ||
| 465 | * are inflight at any given time. This can be particularly useful for messages | ||
| 466 | * that contain kernel resources (like file descriptors) which have a system- | ||
| 467 | * wide limit. | ||
| 468 | * | ||
| 469 | * If a barrier is issued on a canceled connection, it will be invoked | ||
| 470 | * immediately. If a connection has been canceled and still has outstanding | ||
| 471 | * barriers, those barriers will be invoked as part of the connection's | ||
| 472 | * unwinding process. | ||
| 473 | * | ||
| 474 | * It is important to note that a barrier block's execution order is not | ||
| 475 | * guaranteed with respect to other blocks that have been scheduled on the | ||
| 476 | * target queue of the connection. Or said differently, | ||
| 477 | * xpc_connection_send_barrier(3) is not equivalent to dispatch_async(3). | ||
| 478 | */ | ||
| 479 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 480 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 481 | void | ||
| 482 | xpc_connection_send_barrier(xpc_connection_t connection, | ||
| 483 | 	dispatch_block_t barrier); | ||
| 484 | |||
| 485 | /*! | ||
| 486 | * @function xpc_connection_send_message_with_reply | ||
| 487 | * Sends a message over the connection to the destination service and associates | ||
| 488 | * a handler to be invoked when the remote service sends a reply message. | ||
| 489 | * | ||
| 490 | * @param connection | ||
| 491 | * The connection over which the message shall be sent. | ||
| 492 | * | ||
| 493 | * @param message | ||
| 494 | * The message to send. This must be a dictionary object. | ||
| 495 | * | ||
| 496 | * @param replyq | ||
| 497 | * The GCD queue to which the reply handler will be submitted. This may be a | ||
| 498 | * concurrent queue. | ||
| 499 | * | ||
| 500 | * @param handler | ||
| 501 | * The handler block to invoke when a reply to the message is received from | ||
| 502 | * the connection. If the remote service exits prematurely before the reply was | ||
| 503 | * received, the XPC_ERROR_CONNECTION_INTERRUPTED error will be returned. | ||
| 504 | * If the connection went invalid before the message could be sent, the | ||
| 505 | * XPC_ERROR_CONNECTION_INVALID error will be returned. | ||
| 506 | * | ||
| 507 | * @discussion | ||
| 508 | * If the given GCD queue is a concurrent queue, XPC cannot guarantee that there | ||
| 509 | * will not be multiple reply handlers being invoked concurrently. XPC does not | ||
| 510 | * guarantee any ordering for the invocation of reply handers. So if multiple | ||
| 511 | * messages are waiting for replies and the connection goes invalid, there is no | ||
| 512 | * guarantee that the reply handlers will be invoked in FIFO order. Similarly, | ||
| 513 | * XPC does not guarantee that reply handlers will not run concurrently with | ||
| 514 | * the connection's event handler in the case that the reply queue and the | ||
| 515 | * connection's target queue are the same concurrent queue. | ||
| 516 | */ | ||
| 517 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 518 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL4 | ||
| 519 | void | ||
| 520 | xpc_connection_send_message_with_reply(xpc_connection_t connection, | ||
| 521 | 	xpc_object_t message, dispatch_queue_t _Nullable replyq, | ||
| 522 | 	xpc_handler_t handler); | ||
| 523 | |||
| 524 | /*! | ||
| 525 | * @function xpc_connection_send_message_with_reply_sync | ||
| 526 | * Sends a message over the connection and blocks the caller until a reply is | ||
| 527 | * received. | ||
| 528 | * | ||
| 529 | * @param connection | ||
| 530 | * The connection over which the message shall be sent. | ||
| 531 | * | ||
| 532 | * @param message | ||
| 533 | * The message to send. This must be a dictionary object. | ||
| 534 | * | ||
| 535 | * @result | ||
| 536 | * The message that the remote service sent in reply to the original message. | ||
| 537 | * If the remote service exits prematurely before the reply was received, the | ||
| 538 | * XPC_ERROR_CONNECTION_INTERRUPTED error will be returned. If the connection | ||
| 539 | * went invalid before the message could be sent, the | ||
| 540 | * XPC_ERROR_CONNECTION_INVALID error will be returned. | ||
| 541 | * | ||
| 542 | * You are responsible for releasing the returned object. | ||
| 543 | * | ||
| 544 | * @discussion | ||
| 545 | * This API supports priority inversion avoidance, and should be used instead of | ||
| 546 | * combining xpc_connection_send_message_with_reply() with a semaphore. | ||
| 547 | * | ||
| 548 | * Invoking this API from a queue that is a part of the target queue hierarchy | ||
| 549 | * results in deadlocks under certain conditions. | ||
| 550 | * | ||
| 551 | * Be judicious about your use of this API. It can block indefinitely, so if you | ||
| 552 | * are using it to implement an API that can be called from the main thread, you | ||
| 553 | * may wish to consider allowing the API to take a queue and callback block so | ||
| 554 | * that results may be delivered asynchronously if possible. | ||
| 555 | */ | ||
| 556 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 557 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT XPC_RETURNS_RETAINED | ||
| 558 | xpc_object_t | ||
| 559 | xpc_connection_send_message_with_reply_sync(xpc_connection_t connection, | ||
| 560 | 	xpc_object_t message); | ||
| 561 | |||
| 562 | /*! | ||
| 563 | * @function xpc_connection_cancel | ||
| 564 | * Cancels the connection and ensures that its event handler will not fire | ||
| 565 | * again. After this call, any messages that have not yet been sent will be | ||
| 566 | * discarded, and the connection will be unwound. If there are messages that are | ||
| 567 | * awaiting replies, they will have their reply handlers invoked with the | ||
| 568 | * XPC_ERROR_CONNECTION_INVALID error. | ||
| 569 | * | ||
| 570 | * @param connection | ||
| 571 | * The connection object which is to be manipulated. | ||
| 572 | * | ||
| 573 | * @discussion | ||
| 574 | * Cancellation is asynchronous and non-preemptive and therefore this method | ||
| 575 | * will not interrupt the execution of an already-running event handler block. | ||
| 576 | * If the event handler is executing at the time of this call, it will finish, | ||
| 577 | * and then the connection will be canceled, causing a final invocation of the | ||
| 578 | * event handler to be scheduled with the XPC_ERROR_CONNECTION_INVALID error. | ||
| 579 | * After that invocation, there will be no further invocations of the event | ||
| 580 | * handler. | ||
| 581 | * | ||
| 582 | * The XPC runtime guarantees this non-preemptiveness even for concurrent target | ||
| 583 | * queues. | ||
| 584 | */ | ||
| 585 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 586 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 587 | void | ||
| 588 | xpc_connection_cancel(xpc_connection_t connection); | ||
| 589 | |||
| 590 | /*! | ||
| 591 | * @function xpc_connection_get_name | ||
| 592 | * Returns the name of the service with which the connections was created. | ||
| 593 | * | ||
| 594 | * @param connection | ||
| 595 | * The connection object which is to be examined. | ||
| 596 | * | ||
| 597 | * @result | ||
| 598 | * The name of the remote service. If you obtained the connection through an | ||
| 599 | * invocation of another connection's event handler, NULL is returned. | ||
| 600 | */ | ||
| 601 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 602 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 603 | const char * _Nullable | ||
| 604 | xpc_connection_get_name(xpc_connection_t connection); | ||
| 605 | |||
| 606 | /*! | ||
| 607 | * @function xpc_connection_get_euid | ||
| 608 | * Returns the EUID of the remote peer. | ||
| 609 | * | ||
| 610 | * @param connection | ||
| 611 | * The connection object which is to be examined. | ||
| 612 | * | ||
| 613 | * @result | ||
| 614 | * The EUID of the remote peer at the time the connection was made. | ||
| 615 | */ | ||
| 616 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 617 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 618 | uid_t | ||
| 619 | xpc_connection_get_euid(xpc_connection_t connection); | ||
| 620 | |||
| 621 | /*! | ||
| 622 | * @function xpc_connection_get_egid | ||
| 623 | * Returns the EGID of the remote peer. | ||
| 624 | * | ||
| 625 | * @param connection | ||
| 626 | * The connection object which is to be examined. | ||
| 627 | * | ||
| 628 | * @result | ||
| 629 | * The EGID of the remote peer at the time the connection was made. | ||
| 630 | */ | ||
| 631 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 632 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 633 | gid_t | ||
| 634 | xpc_connection_get_egid(xpc_connection_t connection); | ||
| 635 | |||
| 636 | /*! | ||
| 637 | * @function xpc_connection_get_pid | ||
| 638 | * Returns the PID of the remote peer. | ||
| 639 | * | ||
| 640 | * @param connection | ||
| 641 | * The connection object which is to be examined. | ||
| 642 | * | ||
| 643 | * @result | ||
| 644 | * The PID of the remote peer. | ||
| 645 | * | ||
| 646 | * @discussion | ||
| 647 | * A given PID is not guaranteed to be unique across an entire boot cycle. | ||
| 648 | * Great care should be taken when dealing with this information, as it can go | ||
| 649 | * stale after the connection is established. OS X recycles PIDs, and therefore | ||
| 650 | * another process could spawn and claim the PID before a message is actually | ||
| 651 | * received from the connection. | ||
| 652 | * | ||
| 653 | * XPC will deliver an error to your event handler if the remote process goes | ||
| 654 | * away, but there are no guarantees as to the timing of this notification's | ||
| 655 | * delivery either at the kernel layer or at the XPC layer. | ||
| 656 | */ | ||
| 657 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 658 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 659 | pid_t | ||
| 660 | xpc_connection_get_pid(xpc_connection_t connection); | ||
| 661 | |||
| 662 | /*! | ||
| 663 | * @function xpc_connection_get_asid | ||
| 664 | * Returns the audit session identifier of the remote peer. | ||
| 665 | * | ||
| 666 | * @param connection | ||
| 667 | * The connection object which is to be examined. | ||
| 668 | * | ||
| 669 | * @result | ||
| 670 | * The audit session ID of the remote peer at the time the connection was made. | ||
| 671 | */ | ||
| 672 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 673 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 674 | au_asid_t | ||
| 675 | xpc_connection_get_asid(xpc_connection_t connection); | ||
| 676 | |||
| 677 | /*! | ||
| 678 | * @function xpc_connection_set_context | ||
| 679 | * Sets context on an connection. | ||
| 680 | * | ||
| 681 | * @param connection | ||
| 682 | * The connection which is to be manipulated. | ||
| 683 | * | ||
| 684 | * @param context | ||
| 685 | * The context to associate with the connection. | ||
| 686 | * | ||
| 687 | * @discussion | ||
| 688 | * If you must manage the memory of the context object, you must set a finalizer | ||
| 689 | * to dispose of it. If this method is called on a connection which already has | ||
| 690 | * context associated with it, the finalizer will NOT be invoked. The finalizer | ||
| 691 | * is only invoked when the connection is being deallocated. | ||
| 692 | * | ||
| 693 | * It is recommended that, instead of changing the actual context pointer | ||
| 694 | * associated with the object, you instead change the state of the context | ||
| 695 | * object itself. | ||
| 696 | */ | ||
| 697 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 698 | XPC_EXPORT XPC_NONNULL1 | ||
| 699 | void | ||
| 700 | xpc_connection_set_context(xpc_connection_t connection, | ||
| 701 | 	void * _Nullable context); | ||
| 702 | |||
| 703 | /*! | ||
| 704 | * @function xpc_connection_get_context | ||
| 705 | * Returns the context associated with the connection. | ||
| 706 | * | ||
| 707 | * @param connection | ||
| 708 | * The connection which is to be examined. | ||
| 709 | * | ||
| 710 | * @result | ||
| 711 | * The context associated with the connection. NULL if there has been no context | ||
| 712 | * associated with the object. | ||
| 713 | */ | ||
| 714 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 715 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 716 | void * _Nullable | ||
| 717 | xpc_connection_get_context(xpc_connection_t connection); | ||
| 718 | |||
| 719 | /*! | ||
| 720 | * @function xpc_connection_set_finalizer_f | ||
| 721 | * Sets the finalizer for the given connection. | ||
| 722 | * | ||
| 723 | * @param connection | ||
| 724 | * The connection on which to set the finalizer. | ||
| 725 | * | ||
| 726 | * @param finalizer | ||
| 727 | * The function that will be invoked when the connection's retain count has | ||
| 728 | * dropped to zero and is being torn down. | ||
| 729 | * | ||
| 730 | * @discussion | ||
| 731 | * This method disposes of the context value associated with a connection, as | ||
| 732 | * set by {@link xpc_connection_set_context}. | ||
| 733 | * | ||
| 734 | * For many uses of context objects, this API allows for a convenient shorthand | ||
| 735 | * for freeing them. For example, for a context object allocated with malloc(3): | ||
| 736 | * | ||
| 737 | * xpc_connection_set_finalizer_f(object, free); | ||
| 738 | */ | ||
| 739 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 740 | XPC_EXPORT XPC_NONNULL1 | ||
| 741 | void | ||
| 742 | xpc_connection_set_finalizer_f(xpc_connection_t connection, | ||
| 743 | 	xpc_finalizer_t _Nullable finalizer); | ||
| 744 | |||
| 745 | __END_DECLS | ||
| 746 | XPC_ASSUME_NONNULL_END | ||
| 747 | |||
| 748 | #endif // __XPC_CONNECTION_H__ | ||
lib/libc/include/x86_64-macos-gnu/xpc/debug.h created+23| ... | @@ -0,0 +1,23 @@ | ||
| 1 | #ifndef __XPC_DEBUG_H__ | ||
| 2 | #define __XPC_DEBUG_H__ | ||
| 3 | |||
| 4 | /*! | ||
| 5 | * @function xpc_debugger_api_misuse_info | ||
| 6 | * Returns a pointer to a string describing the reason XPC aborted the calling | ||
| 7 | * process. On OS X, this will be the same string present in the "Application | ||
| 8 | * Specific Information" section of the crash report. | ||
| 9 | * | ||
| 10 | * @result | ||
| 11 | * A pointer to the human-readable string describing the reason the caller was | ||
| 12 | * aborted. If XPC was not responsible for the program's termination, NULL will | ||
| 13 | * be returned. | ||
| 14 | * | ||
| 15 | * @discussion | ||
| 16 | * This function is only callable from within a debugger. It is not meant to be | ||
| 17 | * called by the program directly. | ||
| 18 | */ | ||
| 19 | XPC_DEBUGGER_EXCL | ||
| 20 | const char * | ||
| 21 | xpc_debugger_api_misuse_info(void); | ||
| 22 | |||
| 23 | #endif // __XPC_DEBUG_H__ | ||
lib/libc/include/x86_64-macos-gnu/xpc/endpoint.h created+22| ... | @@ -0,0 +1,22 @@ | ||
| 1 | #ifndef __XPC_ENDPOINT_H__ | ||
| 2 | #define __XPC_ENDPOINT_H__ | ||
| 3 | |||
| 4 | /*! | ||
| 5 | * @function xpc_endpoint_create | ||
| 6 | * Creates a new endpoint from a connection that is suitable for embedding into | ||
| 7 | * messages. | ||
| 8 | * | ||
| 9 | * @param connection | ||
| 10 | * Only connections obtained through calls to xpc_connection_create*() may be | ||
| 11 | * given to this API. Passing any other type of connection is not supported and | ||
| 12 | * will result in undefined behavior. | ||
| 13 | * | ||
| 14 | * @result | ||
| 15 | * A new endpoint object. | ||
| 16 | */ | ||
| 17 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 18 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 19 | xpc_endpoint_t _Nonnull | ||
| 20 | xpc_endpoint_create(xpc_connection_t _Nonnull connection); | ||
| 21 | |||
| 22 | #endif // __XPC_ENDPOINT_H__ | ||
lib/libc/include/x86_64-macos-gnu/xpc/xpc.h created+2701| ... | @@ -0,0 +1,2701 @@ | ||
| 1 | // Copyright (c) 2009-2020 Apple Inc. All rights reserved. | ||
| 2 | |||
| 3 | #ifndef __XPC_H__ | ||
| 4 | #define __XPC_H__ | ||
| 5 | |||
| 6 | #include <os/object.h> | ||
| 7 | #include <dispatch/dispatch.h> | ||
| 8 | |||
| 9 | #include <sys/mman.h> | ||
| 10 | #include <uuid/uuid.h> | ||
| 11 | #include <bsm/audit.h> | ||
| 12 | #include <stdarg.h> | ||
| 13 | #include <stdbool.h> | ||
| 14 | #include <stdint.h> | ||
| 15 | #include <stdlib.h> | ||
| 16 | #include <stdio.h> | ||
| 17 | #include <string.h> | ||
| 18 | #include <unistd.h> | ||
| 19 | #include <fcntl.h> | ||
| 20 | |||
| 21 | #ifndef __XPC_INDIRECT__ | ||
| 22 | #define __XPC_INDIRECT__ | ||
| 23 | #endif // __XPC_INDIRECT__ | ||
| 24 | |||
| 25 | #include <xpc/base.h> | ||
| 26 | |||
| 27 | #if __has_include(<xpc/xpc_transaction_deprecate.h>) | ||
| 28 | #include <xpc/xpc_transaction_deprecate.h> | ||
| 29 | #else // __has_include(<xpc/transaction_deprecate.h>) | ||
| 30 | #define XPC_TRANSACTION_DEPRECATED | ||
| 31 | #endif // __has_include(<xpc/transaction_deprecate.h>) | ||
| 32 | |||
| 33 | XPC_ASSUME_NONNULL_BEGIN | ||
| 34 | __BEGIN_DECLS | ||
| 35 | |||
| 36 | #ifndef __OSX_AVAILABLE_STARTING | ||
| 37 | #define __OSX_AVAILABLE_STARTING(x, y) | ||
| 38 | #endif // __OSX_AVAILABLE_STARTING | ||
| 39 | |||
| 40 | #define XPC_API_VERSION 20200610 | ||
| 41 | |||
| 42 | /*! | ||
| 43 | * @typedef xpc_type_t | ||
| 44 | * A type that describes XPC object types. | ||
| 45 | */ | ||
| 46 | typedef const struct _xpc_type_s * xpc_type_t; | ||
| 47 | #ifndef XPC_TYPE | ||
| 48 | #define XPC_TYPE(type) const struct _xpc_type_s type | ||
| 49 | #endif // XPC_TYPE | ||
| 50 | |||
| 51 | /*! | ||
| 52 | * @typedef xpc_object_t | ||
| 53 | * A type that can describe all XPC objects. Dictionaries, arrays, strings, etc. | ||
| 54 | * are all described by this type. | ||
| 55 | * | ||
| 56 | * XPC objects are created with a retain count of 1, and therefore it is the | ||
| 57 | * caller's responsibility to call xpc_release() on them when they are no longer | ||
| 58 | * needed. | ||
| 59 | */ | ||
| 60 | |||
| 61 | #if OS_OBJECT_USE_OBJC | ||
| 62 | /* By default, XPC objects are declared as Objective-C types when building with | ||
| 63 | * an Objective-C compiler. This allows them to participate in ARC, in RR | ||
| 64 | * management by the Blocks runtime and in leaks checking by the static | ||
| 65 | * analyzer, and enables them to be added to Cocoa collections. | ||
| 66 | * | ||
| 67 | * See <os/object.h> for details. | ||
| 68 | */ | ||
| 69 | OS_OBJECT_DECL(xpc_object); | ||
| 70 | #ifndef XPC_DECL | ||
| 71 | #define XPC_DECL(name) typedef xpc_object_t name##_t | ||
| 72 | #endif // XPC_DECL | ||
| 73 | |||
| 74 | #define XPC_GLOBAL_OBJECT(object) ((OS_OBJECT_BRIDGE xpc_object_t)&(object)) | ||
| 75 | #define XPC_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED | ||
| 76 | XPC_INLINE XPC_NONNULL_ALL | ||
| 77 | void | ||
| 78 | _xpc_object_validate(xpc_object_t object) { | ||
| 79 | 	(void)*(unsigned long volatile *)(OS_OBJECT_BRIDGE void *)object; | ||
| 80 | } | ||
| 81 | #else // OS_OBJECT_USE_OBJC | ||
| 82 | typedef void * xpc_object_t; | ||
| 83 | #define XPC_DECL(name) typedef struct _##name##_s * name##_t | ||
| 84 | #define XPC_GLOBAL_OBJECT(object) (&(object)) | ||
| 85 | #define XPC_RETURNS_RETAINED | ||
| 86 | #endif // OS_OBJECT_USE_OBJC | ||
| 87 | |||
| 88 | /*! | ||
| 89 | * @typedef xpc_handler_t | ||
| 90 | * The type of block that is accepted by the XPC connection APIs. | ||
| 91 | * | ||
| 92 | * @param object | ||
| 93 | * An XPC object that is to be handled. If there was an error, this object will | ||
| 94 | * be equal to one of the well-known XPC_ERROR_* dictionaries and can be | ||
| 95 | * compared with the equality operator. | ||
| 96 | * | ||
| 97 | * @discussion | ||
| 98 | * You are not responsible for releasing the event object. | ||
| 99 | */ | ||
| 100 | #if __BLOCKS__ | ||
| 101 | typedef void (^xpc_handler_t)(xpc_object_t object); | ||
| 102 | #endif // __BLOCKS__ | ||
| 103 | |||
| 104 | /*! | ||
| 105 | * @define XPC_TYPE_CONNECTION | ||
| 106 | * A type representing a connection to a named service. This connection is | ||
| 107 | * bidirectional and can be used to both send and receive messages. A | ||
| 108 | * connection carries the credentials of the remote service provider. | ||
| 109 | */ | ||
| 110 | #define XPC_TYPE_CONNECTION (&_xpc_type_connection) | ||
| 111 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 112 | XPC_EXPORT | ||
| 113 | XPC_TYPE(_xpc_type_connection); | ||
| 114 | XPC_DECL(xpc_connection); | ||
| 115 | |||
| 116 | /*! | ||
| 117 | * @typedef xpc_connection_handler_t | ||
| 118 | * The type of the function that will be invoked for a bundled XPC service when | ||
| 119 | * there is a new connection on the service. | ||
| 120 | * | ||
| 121 | * @param connection | ||
| 122 | * A new connection that is equivalent to one received by a listener connection. | ||
| 123 | * See the documentation for {@link xpc_connection_set_event_handler} for the | ||
| 124 | * semantics associated with the received connection. | ||
| 125 | */ | ||
| 126 | typedef void (*xpc_connection_handler_t)(xpc_connection_t connection); | ||
| 127 | |||
| 128 | /*! | ||
| 129 | * @define XPC_TYPE_ENDPOINT | ||
| 130 | * A type representing a connection in serialized form. Unlike a connection, an | ||
| 131 | * endpoint is an inert object that does not have any runtime activity | ||
| 132 | * associated with it. Thus, it is safe to pass an endpoint in a message. Upon | ||
| 133 | * receiving an endpoint, the recipient can use | ||
| 134 | * xpc_connection_create_from_endpoint() to create as many distinct connections | ||
| 135 | * as desired. | ||
| 136 | */ | ||
| 137 | #define XPC_TYPE_ENDPOINT (&_xpc_type_endpoint) | ||
| 138 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 139 | XPC_EXPORT | ||
| 140 | XPC_TYPE(_xpc_type_endpoint); | ||
| 141 | XPC_DECL(xpc_endpoint); | ||
| 142 | |||
| 143 | /*! | ||
| 144 | * @define XPC_TYPE_NULL | ||
| 145 | * A type representing a null object. This type is useful for disambiguating | ||
| 146 | * an unset key in a dictionary and one which has been reserved but set empty. | ||
| 147 | * Also, this type is a way to represent a "null" value in dictionaries, which | ||
| 148 | * do not accept NULL. | ||
| 149 | */ | ||
| 150 | #define XPC_TYPE_NULL (&_xpc_type_null) | ||
| 151 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 152 | XPC_EXPORT | ||
| 153 | XPC_TYPE(_xpc_type_null); | ||
| 154 | |||
| 155 | /*! | ||
| 156 | * @define XPC_TYPE_BOOL | ||
| 157 | * A type representing a Boolean value. | ||
| 158 | */ | ||
| 159 | #define XPC_TYPE_BOOL (&_xpc_type_bool) | ||
| 160 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 161 | XPC_EXPORT | ||
| 162 | XPC_TYPE(_xpc_type_bool); | ||
| 163 | |||
| 164 | /*! | ||
| 165 | * @define XPC_BOOL_TRUE | ||
| 166 | * A constant representing a Boolean value of true. You may compare a Boolean | ||
| 167 | * object against this constant to determine its value. | ||
| 168 | */ | ||
| 169 | #define XPC_BOOL_TRUE XPC_GLOBAL_OBJECT(_xpc_bool_true) | ||
| 170 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 171 | XPC_EXPORT | ||
| 172 | const struct _xpc_bool_s _xpc_bool_true; | ||
| 173 | |||
| 174 | /*! | ||
| 175 | * @define XPC_BOOL_FALSE | ||
| 176 | * A constant representing a Boolean value of false. You may compare a Boolean | ||
| 177 | * object against this constant to determine its value. | ||
| 178 | */ | ||
| 179 | #define XPC_BOOL_FALSE XPC_GLOBAL_OBJECT(_xpc_bool_false) | ||
| 180 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 181 | XPC_EXPORT | ||
| 182 | const struct _xpc_bool_s _xpc_bool_false; | ||
| 183 | |||
| 184 | /*! | ||
| 185 | * @define XPC_TYPE_INT64 | ||
| 186 | * A type representing a signed, 64-bit integer value. | ||
| 187 | */ | ||
| 188 | #define XPC_TYPE_INT64 (&_xpc_type_int64) | ||
| 189 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 190 | XPC_EXPORT | ||
| 191 | XPC_TYPE(_xpc_type_int64); | ||
| 192 | |||
| 193 | /*! | ||
| 194 | * @define XPC_TYPE_UINT64 | ||
| 195 | * A type representing an unsigned, 64-bit integer value. | ||
| 196 | */ | ||
| 197 | #define XPC_TYPE_UINT64 (&_xpc_type_uint64) | ||
| 198 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 199 | XPC_EXPORT | ||
| 200 | XPC_TYPE(_xpc_type_uint64); | ||
| 201 | |||
| 202 | /*! | ||
| 203 | * @define XPC_TYPE_DOUBLE | ||
| 204 | * A type representing an IEEE-compliant, double-precision floating point value. | ||
| 205 | */ | ||
| 206 | #define XPC_TYPE_DOUBLE (&_xpc_type_double) | ||
| 207 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 208 | XPC_EXPORT | ||
| 209 | XPC_TYPE(_xpc_type_double); | ||
| 210 | |||
| 211 | /*! | ||
| 212 | * @define XPC_TYPE_DATE | ||
| 213 | * A type representing a date interval. The interval is with respect to the | ||
| 214 | * Unix epoch. XPC dates are in Unix time and are thus unaware of local time | ||
| 215 | * or leap seconds. | ||
| 216 | */ | ||
| 217 | #define XPC_TYPE_DATE (&_xpc_type_date) | ||
| 218 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 219 | XPC_EXPORT | ||
| 220 | XPC_TYPE(_xpc_type_date); | ||
| 221 | |||
| 222 | /*! | ||
| 223 | * @define XPC_TYPE_DATA | ||
| 224 | * A type representing a an arbitrary buffer of bytes. | ||
| 225 | */ | ||
| 226 | #define XPC_TYPE_DATA (&_xpc_type_data) | ||
| 227 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 228 | XPC_EXPORT | ||
| 229 | XPC_TYPE(_xpc_type_data); | ||
| 230 | |||
| 231 | /*! | ||
| 232 | * @define XPC_TYPE_STRING | ||
| 233 | * A type representing a NUL-terminated C-string. | ||
| 234 | */ | ||
| 235 | #define XPC_TYPE_STRING (&_xpc_type_string) | ||
| 236 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 237 | XPC_EXPORT | ||
| 238 | XPC_TYPE(_xpc_type_string); | ||
| 239 | |||
| 240 | /*! | ||
| 241 | * @define XPC_TYPE_UUID | ||
| 242 | * A type representing a Universally Unique Identifier as defined by uuid(3). | ||
| 243 | */ | ||
| 244 | #define XPC_TYPE_UUID (&_xpc_type_uuid) | ||
| 245 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 246 | XPC_EXPORT | ||
| 247 | XPC_TYPE(_xpc_type_uuid); | ||
| 248 | |||
| 249 | /*! | ||
| 250 | * @define XPC_TYPE_FD | ||
| 251 | * A type representing a POSIX file descriptor. | ||
| 252 | */ | ||
| 253 | #define XPC_TYPE_FD (&_xpc_type_fd) | ||
| 254 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 255 | XPC_EXPORT | ||
| 256 | XPC_TYPE(_xpc_type_fd); | ||
| 257 | |||
| 258 | /*! | ||
| 259 | * @define XPC_TYPE_SHMEM | ||
| 260 | * A type representing a region of shared memory. | ||
| 261 | */ | ||
| 262 | #define XPC_TYPE_SHMEM (&_xpc_type_shmem) | ||
| 263 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 264 | XPC_EXPORT | ||
| 265 | XPC_TYPE(_xpc_type_shmem); | ||
| 266 | |||
| 267 | /*! | ||
| 268 | * @define XPC_TYPE_ARRAY | ||
| 269 | * A type representing an array of XPC objects. This array must be contiguous, | ||
| 270 | * i.e. it cannot contain NULL values. If you wish to indicate that a slot | ||
| 271 | * is empty, you can insert a null object. The array will grow as needed to | ||
| 272 | * accommodate more objects. | ||
| 273 | */ | ||
| 274 | #define XPC_TYPE_ARRAY (&_xpc_type_array) | ||
| 275 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 276 | XPC_EXPORT | ||
| 277 | XPC_TYPE(_xpc_type_array); | ||
| 278 | |||
| 279 | /*! | ||
| 280 | * @define XPC_TYPE_DICTIONARY | ||
| 281 | * A type representing a dictionary of XPC objects, keyed off of C-strings. | ||
| 282 | * You may insert NULL values into this collection. The dictionary will grow | ||
| 283 | * as needed to accommodate more key/value pairs. | ||
| 284 | */ | ||
| 285 | #define XPC_TYPE_DICTIONARY (&_xpc_type_dictionary) | ||
| 286 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 287 | XPC_EXPORT | ||
| 288 | XPC_TYPE(_xpc_type_dictionary); | ||
| 289 | |||
| 290 | /*! | ||
| 291 | * @define XPC_TYPE_ERROR | ||
| 292 | * A type representing an error object. Errors in XPC are dictionaries, but | ||
| 293 | * xpc_get_type() will return this type when given an error object. You | ||
| 294 | * cannot create an error object directly; XPC will only give them to handlers. | ||
| 295 | * These error objects have pointer values that are constant across the lifetime | ||
| 296 | * of your process and can be safely compared. | ||
| 297 | * | ||
| 298 | * These constants are enumerated in the header for the connection object. Error | ||
| 299 | * dictionaries may reserve keys so that they can be queried to obtain more | ||
| 300 | * detailed information about the error. Currently, the only reserved key is | ||
| 301 | * XPC_ERROR_KEY_DESCRIPTION. | ||
| 302 | */ | ||
| 303 | #define XPC_TYPE_ERROR (&_xpc_type_error) | ||
| 304 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 305 | XPC_EXPORT | ||
| 306 | XPC_TYPE(_xpc_type_error); | ||
| 307 | |||
| 308 | /*! | ||
| 309 | * @define XPC_ERROR_KEY_DESCRIPTION | ||
| 310 | * In an error dictionary, querying for this key will return a string object | ||
| 311 | * that describes the error in a human-readable way. | ||
| 312 | */ | ||
| 313 | #define XPC_ERROR_KEY_DESCRIPTION _xpc_error_key_description | ||
| 314 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 315 | XPC_EXPORT | ||
| 316 | const char * const _xpc_error_key_description; | ||
| 317 | |||
| 318 | /*! | ||
| 319 | * @define XPC_EVENT_KEY_NAME | ||
| 320 | * In an event dictionary, this querying for this key will return a string | ||
| 321 | * object that describes the event. | ||
| 322 | */ | ||
| 323 | #define XPC_EVENT_KEY_NAME _xpc_event_key_name | ||
| 324 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 325 | XPC_EXPORT | ||
| 326 | const char * const _xpc_event_key_name; | ||
| 327 | |||
| 328 | XPC_ASSUME_NONNULL_END | ||
| 329 | #if !defined(__XPC_BUILDING_XPC__) || !__XPC_BUILDING_XPC__ | ||
| 330 | #include <xpc/endpoint.h> | ||
| 331 | #include <xpc/debug.h> | ||
| 332 | #if __BLOCKS__ | ||
| 333 | #include <xpc/connection.h> | ||
| 334 | #include <xpc/activity.h> | ||
| 335 | #endif // __BLOCKS__ | ||
| 336 | #undef __XPC_INDIRECT__ | ||
| 337 | #include <launch.h> | ||
| 338 | #endif // !defined(__XPC_BUILDING_XPC__) || !__XPC_BUILDING_XPC__ | ||
| 339 | XPC_ASSUME_NONNULL_BEGIN | ||
| 340 | |||
| 341 | #pragma mark XPC Object Protocol | ||
| 342 | /*! | ||
| 343 | * @function xpc_retain | ||
| 344 | * | ||
| 345 | * @abstract | ||
| 346 | * Increments the reference count of an object. | ||
| 347 | * | ||
| 348 | * @param object | ||
| 349 | * The object which is to be manipulated. | ||
| 350 | * | ||
| 351 | * @result | ||
| 352 | * The object which was given. | ||
| 353 | * | ||
| 354 | * @discussion | ||
| 355 | * Calls to xpc_retain() must be balanced with calls to xpc_release() | ||
| 356 | * to avoid leaking memory. | ||
| 357 | */ | ||
| 358 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 359 | XPC_EXPORT XPC_NONNULL1 | ||
| 360 | xpc_object_t | ||
| 361 | xpc_retain(xpc_object_t object); | ||
| 362 | #if OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 363 | #undef xpc_retain | ||
| 364 | #define xpc_retain(object) ({ xpc_object_t _o = (object); \ | ||
| 365 | 		_xpc_object_validate(_o); [_o retain]; }) | ||
| 366 | #endif // OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 367 | |||
| 368 | /*! | ||
| 369 | * @function xpc_release | ||
| 370 | * | ||
| 371 | * @abstract | ||
| 372 | * Decrements the reference count of an object. | ||
| 373 | * | ||
| 374 | * @param object | ||
| 375 | * The object which is to be manipulated. | ||
| 376 | * | ||
| 377 | * @discussion | ||
| 378 | * The caller must take care to balance retains and releases. When creating or | ||
| 379 | * retaining XPC objects, the creator obtains a reference on the object. Thus, | ||
| 380 | * it is the caller's responsibility to call xpc_release() on those objects when | ||
| 381 | * they are no longer needed. | ||
| 382 | */ | ||
| 383 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 384 | XPC_EXPORT XPC_NONNULL1 | ||
| 385 | void | ||
| 386 | xpc_release(xpc_object_t object); | ||
| 387 | #if OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 388 | #undef xpc_release | ||
| 389 | #define xpc_release(object) ({ xpc_object_t _o = (object); \ | ||
| 390 | 		_xpc_object_validate(_o); [_o release]; }) | ||
| 391 | #endif // OS_OBJECT_USE_OBJC_RETAIN_RELEASE | ||
| 392 | |||
| 393 | /*! | ||
| 394 | * @function xpc_get_type | ||
| 395 | * | ||
| 396 | * @abstract | ||
| 397 | * Returns the type of an object. | ||
| 398 | * | ||
| 399 | * @param object | ||
| 400 | * The object to examine. | ||
| 401 | * | ||
| 402 | * @result | ||
| 403 | * An opaque pointer describing the type of the object. This pointer is suitable | ||
| 404 | * direct comparison to exported type constants with the equality operator. | ||
| 405 | */ | ||
| 406 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 407 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT | ||
| 408 | xpc_type_t | ||
| 409 | xpc_get_type(xpc_object_t object); | ||
| 410 | |||
| 411 | /*! | ||
| 412 | * @function xpc_type_get_name | ||
| 413 | * | ||
| 414 | * @abstract | ||
| 415 | * Returns a string describing an XPC object type. | ||
| 416 | * | ||
| 417 | * @param type | ||
| 418 | * The type to describe. | ||
| 419 | * | ||
| 420 | * @result | ||
| 421 | * A string describing the type of an object, like "string" or "int64". | ||
| 422 | * This string should not be freed or modified. | ||
| 423 | */ | ||
| 424 | __OSX_AVAILABLE_STARTING(__MAC_10_15, __IPHONE_13_0) | ||
| 425 | XPC_EXPORT XPC_NONNULL1 | ||
| 426 | const char * | ||
| 427 | xpc_type_get_name(xpc_type_t type); | ||
| 428 | |||
| 429 | /*! | ||
| 430 | * @function xpc_copy | ||
| 431 | * | ||
| 432 | * @abstract | ||
| 433 | * Creates a copy of the object. | ||
| 434 | * | ||
| 435 | * @param object | ||
| 436 | * The object to copy. | ||
| 437 | * | ||
| 438 | * @result | ||
| 439 | * The new object. NULL if the object type does not support copying or if | ||
| 440 | * sufficient memory for the copy could not be allocated. Service objects do | ||
| 441 | * not support copying. | ||
| 442 | * | ||
| 443 | * @discussion | ||
| 444 | * When called on an array or dictionary, xpc_copy() will perform a deep copy. | ||
| 445 | * | ||
| 446 | * The object returned is not necessarily guaranteed to be a new object, and | ||
| 447 | * whether it is will depend on the implementation of the object being copied. | ||
| 448 | */ | ||
| 449 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 450 | XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT XPC_RETURNS_RETAINED | ||
| 451 | xpc_object_t _Nullable | ||
| 452 | xpc_copy(xpc_object_t object); | ||
| 453 | |||
| 454 | /*! | ||
| 455 | * @function xpc_equal | ||
| 456 | * | ||
| 457 | * @abstract | ||
| 458 | * Compares two objects for equality. | ||
| 459 | * | ||
| 460 | * @param object1 | ||
| 461 | * The first object to compare. | ||
| 462 | * | ||
| 463 | * @param object2 | ||
| 464 | * The second object to compare. | ||
| 465 | * | ||
| 466 | * @result | ||
| 467 | * Returns true if the objects are equal, otherwise false. Two objects must be | ||
| 468 | * of the same type in order to be equal. | ||
| 469 | * | ||
| 470 | * For two arrays to be equal, they must contain the same values at the | ||
| 471 | * same indexes. For two dictionaries to be equal, they must contain the same | ||
| 472 | * values for the same keys. | ||
| 473 | * | ||
| 474 | * Two objects being equal implies that their hashes (as returned by xpc_hash()) | ||
| 475 | * are also equal. | ||
| 476 | */ | ||
| 477 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 478 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_WARN_RESULT | ||
| 479 | bool | ||
| 480 | xpc_equal(xpc_object_t object1, xpc_object_t object2); | ||
| 481 | |||
| 482 | /*! | ||
| 483 | * @function xpc_hash | ||
| 484 | * | ||
| 485 | * @abstract | ||
| 486 | * Calculates a hash value for the given object. | ||
| 487 | * | ||
| 488 | * @param object | ||
| 489 | * The object for which to calculate a hash value. This value may be modded | ||
| 490 | * with a table size for insertion into a dictionary-like data structure. | ||
| 491 | * | ||
| 492 | * @result | ||
| 493 | * The calculated hash value. | ||
| 494 | * | ||
| 495 | * @discussion | ||
| 496 | * Note that the computed hash values for any particular type and value of an | ||
| 497 | * object can change from across releases and platforms and should not be | ||
| 498 | * assumed to be constant across all time and space or stored persistently. | ||
| 499 | */ | ||
| 500 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 501 | XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT | ||
| 502 | size_t | ||
| 503 | xpc_hash(xpc_object_t object); | ||
| 504 | |||
| 505 | /*! | ||
| 506 | * @function xpc_copy_description | ||
| 507 | * | ||
| 508 | * @abstract | ||
| 509 | * Copies a debug string describing the object. | ||
| 510 | * | ||
| 511 | * @param object | ||
| 512 | * The object which is to be examined. | ||
| 513 | * | ||
| 514 | * @result | ||
| 515 | * A string describing object which contains information useful for debugging. | ||
| 516 | * This string should be disposed of with free(3) when done. | ||
| 517 | */ | ||
| 518 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 519 | XPC_EXPORT XPC_MALLOC XPC_WARN_RESULT XPC_NONNULL1 | ||
| 520 | char * | ||
| 521 | xpc_copy_description(xpc_object_t object); | ||
| 522 | |||
| 523 | #pragma mark XPC Object Types | ||
| 524 | #pragma mark Null | ||
| 525 | /*! | ||
| 526 | * @function xpc_null_create | ||
| 527 | * | ||
| 528 | * @abstract | ||
| 529 | * Creates an XPC object representing the null object. | ||
| 530 | * | ||
| 531 | * @result | ||
| 532 | * A new null object. | ||
| 533 | */ | ||
| 534 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 535 | XPC_EXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 536 | xpc_object_t | ||
| 537 | xpc_null_create(void); | ||
| 538 | |||
| 539 | #pragma mark Boolean | ||
| 540 | /*! | ||
| 541 | * @function xpc_bool_create | ||
| 542 | * | ||
| 543 | * @abstract | ||
| 544 | * Creates an XPC Boolean object. | ||
| 545 | * | ||
| 546 | * @param value | ||
| 547 | * The Boolean primitive value which is to be boxed. | ||
| 548 | * | ||
| 549 | * @result | ||
| 550 | * A new Boolean object. | ||
| 551 | */ | ||
| 552 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 553 | XPC_EXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 554 | xpc_object_t | ||
| 555 | xpc_bool_create(bool value); | ||
| 556 | |||
| 557 | /*! | ||
| 558 | * @function xpc_bool_get_value | ||
| 559 | * | ||
| 560 | * @abstract | ||
| 561 | * Returns the underlying Boolean value from the object. | ||
| 562 | * | ||
| 563 | * @param xbool | ||
| 564 | * The Boolean object which is to be examined. | ||
| 565 | * | ||
| 566 | * @result | ||
| 567 | * The underlying Boolean value or false if the given object was not an XPC | ||
| 568 | * Boolean object. | ||
| 569 | */ | ||
| 570 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 571 | XPC_EXPORT | ||
| 572 | bool | ||
| 573 | xpc_bool_get_value(xpc_object_t xbool); | ||
| 574 | |||
| 575 | #pragma mark Signed Integer | ||
| 576 | /*! | ||
| 577 | * @function xpc_int64_create | ||
| 578 | * | ||
| 579 | * @abstract | ||
| 580 | * Creates an XPC signed integer object. | ||
| 581 | * | ||
| 582 | * @param value | ||
| 583 | * The signed integer value which is to be boxed. | ||
| 584 | * | ||
| 585 | * @result | ||
| 586 | * A new signed integer object. | ||
| 587 | */ | ||
| 588 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 589 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 590 | xpc_object_t | ||
| 591 | xpc_int64_create(int64_t value); | ||
| 592 | |||
| 593 | /*! | ||
| 594 | * @function xpc_int64_get_value | ||
| 595 | * | ||
| 596 | * @abstract | ||
| 597 | * Returns the underlying signed 64-bit integer value from an object. | ||
| 598 | * | ||
| 599 | * @param xint | ||
| 600 | * The signed integer object which is to be examined. | ||
| 601 | * | ||
| 602 | * @result | ||
| 603 | * The underlying signed 64-bit value or 0 if the given object was not an XPC | ||
| 604 | * integer object. | ||
| 605 | */ | ||
| 606 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 607 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 608 | int64_t | ||
| 609 | xpc_int64_get_value(xpc_object_t xint); | ||
| 610 | |||
| 611 | #pragma mark Unsigned Integer | ||
| 612 | /*! | ||
| 613 | * @function xpc_uint64_create | ||
| 614 | * | ||
| 615 | * @abstract | ||
| 616 | * Creates an XPC unsigned integer object. | ||
| 617 | * | ||
| 618 | * @param value | ||
| 619 | * The unsigned integer value which is to be boxed. | ||
| 620 | * | ||
| 621 | * @result | ||
| 622 | * A new unsigned integer object. | ||
| 623 | */ | ||
| 624 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 625 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 626 | xpc_object_t | ||
| 627 | xpc_uint64_create(uint64_t value); | ||
| 628 | |||
| 629 | /*! | ||
| 630 | * @function xpc_uint64_get_value | ||
| 631 | * | ||
| 632 | * @abstract | ||
| 633 | * Returns the underlying unsigned 64-bit integer value from an object. | ||
| 634 | * | ||
| 635 | * @param xuint | ||
| 636 | * The unsigned integer object which is to be examined. | ||
| 637 | * | ||
| 638 | * @result | ||
| 639 | * The underlying unsigned integer value or 0 if the given object was not an XPC | ||
| 640 | * unsigned integer object. | ||
| 641 | */ | ||
| 642 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 643 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 644 | uint64_t | ||
| 645 | xpc_uint64_get_value(xpc_object_t xuint); | ||
| 646 | |||
| 647 | #pragma mark Double | ||
| 648 | /*! | ||
| 649 | * @function xpc_double_create | ||
| 650 | * | ||
| 651 | * @abstract | ||
| 652 | * Creates an XPC double object. | ||
| 653 | * | ||
| 654 | * @param value | ||
| 655 | * The floating point quantity which is to be boxed. | ||
| 656 | * | ||
| 657 | * @result | ||
| 658 | * A new floating point object. | ||
| 659 | */ | ||
| 660 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 661 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 662 | xpc_object_t | ||
| 663 | xpc_double_create(double value); | ||
| 664 | |||
| 665 | /*! | ||
| 666 | * @function xpc_double_get_value | ||
| 667 | * | ||
| 668 | * @abstract | ||
| 669 | * Returns the underlying double-precision floating point value from an object. | ||
| 670 | * | ||
| 671 | * @param xdouble | ||
| 672 | * The floating point object which is to be examined. | ||
| 673 | * | ||
| 674 | * @result | ||
| 675 | * The underlying floating point value or NAN if the given object was not an XPC | ||
| 676 | * floating point object. | ||
| 677 | */ | ||
| 678 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 679 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 680 | double | ||
| 681 | xpc_double_get_value(xpc_object_t xdouble); | ||
| 682 | |||
| 683 | #pragma mark Date | ||
| 684 | /*! | ||
| 685 | * @function xpc_date_create | ||
| 686 | * | ||
| 687 | * @abstract | ||
| 688 | * Creates an XPC date object. | ||
| 689 | * | ||
| 690 | * @param interval | ||
| 691 | * The date interval which is to be boxed. Negative values indicate the number | ||
| 692 | * of nanoseconds before the epoch. Positive values indicate the number of | ||
| 693 | * nanoseconds after the epoch. | ||
| 694 | * | ||
| 695 | * @result | ||
| 696 | * A new date object. | ||
| 697 | */ | ||
| 698 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 699 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 700 | xpc_object_t | ||
| 701 | xpc_date_create(int64_t interval); | ||
| 702 | |||
| 703 | /*! | ||
| 704 | * @function xpc_date_create_from_current | ||
| 705 | * | ||
| 706 | * @abstract | ||
| 707 | * Creates an XPC date object representing the current date. | ||
| 708 | * | ||
| 709 | * @result | ||
| 710 | * A new date object representing the current date. | ||
| 711 | */ | ||
| 712 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 713 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 714 | xpc_object_t | ||
| 715 | xpc_date_create_from_current(void); | ||
| 716 | |||
| 717 | /*! | ||
| 718 | * @function xpc_date_get_value | ||
| 719 | * | ||
| 720 | * @abstract | ||
| 721 | * Returns the underlying date interval from an object. | ||
| 722 | * | ||
| 723 | * @param xdate | ||
| 724 | * The date object which is to be examined. | ||
| 725 | * | ||
| 726 | * @result | ||
| 727 | * The underlying date interval or 0 if the given object was not an XPC date | ||
| 728 | * object. | ||
| 729 | */ | ||
| 730 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 731 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 732 | int64_t | ||
| 733 | xpc_date_get_value(xpc_object_t xdate); | ||
| 734 | |||
| 735 | #pragma mark Data | ||
| 736 | /*! | ||
| 737 | * @function xpc_data_create | ||
| 738 | * | ||
| 739 | * @abstract | ||
| 740 | * Creates an XPC object representing buffer of bytes. | ||
| 741 | * | ||
| 742 | * @param bytes | ||
| 743 | * The buffer of bytes which is to be boxed. You may create an empty data object | ||
| 744 | * by passing NULL for this parameter and 0 for the length. Passing NULL with | ||
| 745 | * any other length will result in undefined behavior. | ||
| 746 | * | ||
| 747 | * @param length | ||
| 748 | * The number of bytes which are to be boxed. | ||
| 749 | * | ||
| 750 | * @result | ||
| 751 | * A new data object. | ||
| 752 | * | ||
| 753 | * @discussion | ||
| 754 | * This method will copy the buffer given into internal storage. After calling | ||
| 755 | * this method, it is safe to dispose of the given buffer. | ||
| 756 | */ | ||
| 757 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 758 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 759 | xpc_object_t | ||
| 760 | xpc_data_create(const void * _Nullable bytes, size_t length); | ||
| 761 | |||
| 762 | /*! | ||
| 763 | * @function xpc_data_create_with_dispatch_data | ||
| 764 | * | ||
| 765 | * @abstract | ||
| 766 | * Creates an XPC object representing buffer of bytes described by the given GCD | ||
| 767 | * data object. | ||
| 768 | * | ||
| 769 | * @param ddata | ||
| 770 | * The GCD data object containing the bytes which are to be boxed. This object | ||
| 771 | * is retained by the data object. | ||
| 772 | * | ||
| 773 | * @result | ||
| 774 | * A new data object. | ||
| 775 | * | ||
| 776 | * @discussion | ||
| 777 | * The object returned by this method will refer to the buffer returned by | ||
| 778 | * dispatch_data_create_map(). The point where XPC will make the call to | ||
| 779 | * dispatch_data_create_map() is undefined. | ||
| 780 | */ | ||
| 781 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 782 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 783 | xpc_object_t | ||
| 784 | xpc_data_create_with_dispatch_data(dispatch_data_t ddata); | ||
| 785 | |||
| 786 | /*! | ||
| 787 | * @function xpc_data_get_length | ||
| 788 | * | ||
| 789 | * @abstract | ||
| 790 | * Returns the length of the data encapsulated by an XPC data object. | ||
| 791 | * | ||
| 792 | * @param xdata | ||
| 793 | * The data object which is to be examined. | ||
| 794 | * | ||
| 795 | * @result | ||
| 796 | * The length of the underlying boxed data or 0 if the given object was not an | ||
| 797 | * XPC data object. | ||
| 798 | */ | ||
| 799 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 800 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 801 | size_t | ||
| 802 | xpc_data_get_length(xpc_object_t xdata); | ||
| 803 | |||
| 804 | /*! | ||
| 805 | * @function xpc_data_get_bytes_ptr | ||
| 806 | * | ||
| 807 | * @abstract | ||
| 808 | * Returns a pointer to the internal storage of a data object. | ||
| 809 | * | ||
| 810 | * @param xdata | ||
| 811 | * The data object which is to be examined. | ||
| 812 | * | ||
| 813 | * @result | ||
| 814 | * A pointer to the underlying boxed data or NULL if the given object was not an | ||
| 815 | * XPC data object. | ||
| 816 | */ | ||
| 817 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 818 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 819 | const void * _Nullable | ||
| 820 | xpc_data_get_bytes_ptr(xpc_object_t xdata); | ||
| 821 | |||
| 822 | /*! | ||
| 823 | * @function xpc_data_get_bytes | ||
| 824 | * | ||
| 825 | * @abstract | ||
| 826 | * Copies the bytes stored in an data objects into the specified buffer. | ||
| 827 | * | ||
| 828 | * @param xdata | ||
| 829 | * The data object which is to be examined. | ||
| 830 | * | ||
| 831 | * @param buffer | ||
| 832 | * The buffer in which to copy the data object's bytes. | ||
| 833 | * | ||
| 834 | * @param off | ||
| 835 | * The offset at which to begin the copy. If this offset is greater than the | ||
| 836 | * length of the data element, nothing is copied. Pass 0 to start the copy | ||
| 837 | * at the beginning of the buffer. | ||
| 838 | * | ||
| 839 | * @param length | ||
| 840 | * The length of the destination buffer. | ||
| 841 | * | ||
| 842 | * @result | ||
| 843 | * The number of bytes that were copied into the buffer or 0 if the given object | ||
| 844 | * was not an XPC data object. | ||
| 845 | */ | ||
| 846 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 847 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2 | ||
| 848 | size_t | ||
| 849 | xpc_data_get_bytes(xpc_object_t xdata, | ||
| 850 | 	void *buffer, size_t off, size_t length); | ||
| 851 | |||
| 852 | #pragma mark String | ||
| 853 | /*! | ||
| 854 | * @function xpc_string_create | ||
| 855 | * | ||
| 856 | * @abstract | ||
| 857 | * Creates an XPC object representing a NUL-terminated C-string. | ||
| 858 | * | ||
| 859 | * @param string | ||
| 860 | * The C-string which is to be boxed. | ||
| 861 | * | ||
| 862 | * @result | ||
| 863 | * A new string object. | ||
| 864 | */ | ||
| 865 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 866 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 867 | xpc_object_t | ||
| 868 | xpc_string_create(const char *string); | ||
| 869 | |||
| 870 | /*! | ||
| 871 | * @function xpc_string_create_with_format | ||
| 872 | * | ||
| 873 | * @abstract | ||
| 874 | * Creates an XPC object representing a C-string that is generated from the | ||
| 875 | * given format string and arguments. | ||
| 876 | * | ||
| 877 | * @param fmt | ||
| 878 | * The printf(3)-style format string from which to construct the final C-string | ||
| 879 | * to be boxed. | ||
| 880 | * | ||
| 881 | * @param ... | ||
| 882 | * The arguments which correspond to those specified in the format string. | ||
| 883 | * | ||
| 884 | * @result | ||
| 885 | * A new string object. | ||
| 886 | */ | ||
| 887 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 888 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 889 | XPC_PRINTF(1, 2) | ||
| 890 | xpc_object_t | ||
| 891 | xpc_string_create_with_format(const char *fmt, ...); | ||
| 892 | |||
| 893 | /*! | ||
| 894 | * @function xpc_string_create_with_format_and_arguments | ||
| 895 | * | ||
| 896 | * @abstract | ||
| 897 | * Creates an XPC object representing a C-string that is generated from the | ||
| 898 | * given format string and argument list pointer. | ||
| 899 | * | ||
| 900 | * @param fmt | ||
| 901 | * The printf(3)-style format string from which to construct the final C-string | ||
| 902 | * to be boxed. | ||
| 903 | * | ||
| 904 | * @param ap | ||
| 905 | * A pointer to the arguments which correspond to those specified in the format | ||
| 906 | * string. | ||
| 907 | * | ||
| 908 | * @result | ||
| 909 | * A new string object. | ||
| 910 | */ | ||
| 911 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 912 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 913 | XPC_PRINTF(1, 0) | ||
| 914 | xpc_object_t | ||
| 915 | xpc_string_create_with_format_and_arguments(const char *fmt, va_list ap); | ||
| 916 | |||
| 917 | /*! | ||
| 918 | * @function xpc_string_get_length | ||
| 919 | * | ||
| 920 | * @abstract | ||
| 921 | * Returns the length of the underlying string. | ||
| 922 | * | ||
| 923 | * @param xstring | ||
| 924 | * The string object which is to be examined. | ||
| 925 | * | ||
| 926 | * @result | ||
| 927 | * The length of the underlying string, not including the NUL-terminator, or 0 | ||
| 928 | * if the given object was not an XPC string object. | ||
| 929 | */ | ||
| 930 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 931 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 932 | size_t | ||
| 933 | xpc_string_get_length(xpc_object_t xstring); | ||
| 934 | |||
| 935 | /*! | ||
| 936 | * @function xpc_string_get_string_ptr | ||
| 937 | * | ||
| 938 | * @abstract | ||
| 939 | * Returns a pointer to the internal storage of a string object. | ||
| 940 | * | ||
| 941 | * @param xstring | ||
| 942 | * The string object which is to be examined. | ||
| 943 | * | ||
| 944 | * @result | ||
| 945 | * A pointer to the string object's internal storage or NULL if the given object | ||
| 946 | * was not an XPC string object. | ||
| 947 | */ | ||
| 948 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 949 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 950 | const char * _Nullable | ||
| 951 | xpc_string_get_string_ptr(xpc_object_t xstring); | ||
| 952 | |||
| 953 | #pragma mark UUID | ||
| 954 | /*! | ||
| 955 | * @function xpc_uuid_create | ||
| 956 | * | ||
| 957 | * @abstract | ||
| 958 | * Creates an XPC object representing a universally-unique identifier (UUID) as | ||
| 959 | * described by uuid(3). | ||
| 960 | * | ||
| 961 | * @param uuid | ||
| 962 | * The UUID which is to be boxed. | ||
| 963 | * | ||
| 964 | * @result | ||
| 965 | * A new UUID object. | ||
| 966 | */ | ||
| 967 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 968 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 969 | xpc_object_t | ||
| 970 | xpc_uuid_create(const uuid_t XPC_NONNULL_ARRAY uuid); | ||
| 971 | |||
| 972 | /*! | ||
| 973 | * @function xpc_uuid_get_bytes | ||
| 974 | * | ||
| 975 | * @abstract | ||
| 976 | * Returns a pointer to the the boxed UUID bytes in an XPC UUID object. | ||
| 977 | * | ||
| 978 | * @param xuuid | ||
| 979 | * The UUID object which is to be examined. | ||
| 980 | * | ||
| 981 | * @result | ||
| 982 | * The underlying <code>uuid_t</code> bytes or NULL if the given object was not | ||
| 983 | * an XPC UUID object. The returned pointer may be safely passed to the uuid(3) | ||
| 984 | * APIs. | ||
| 985 | */ | ||
| 986 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 987 | XPC_EXPORT XPC_NONNULL1 | ||
| 988 | const uint8_t * _Nullable | ||
| 989 | xpc_uuid_get_bytes(xpc_object_t xuuid); | ||
| 990 | |||
| 991 | #pragma mark File Descriptors | ||
| 992 | /*! | ||
| 993 | * @function xpc_fd_create | ||
| 994 | * | ||
| 995 | * @abstract | ||
| 996 | * Creates an XPC object representing a POSIX file descriptor. | ||
| 997 | * | ||
| 998 | * @param fd | ||
| 999 | * The file descriptor which is to be boxed. | ||
| 1000 | * | ||
| 1001 | * @result | ||
| 1002 | * A new file descriptor object. NULL if sufficient memory could not be | ||
| 1003 | * allocated or if the given file descriptor was not valid. | ||
| 1004 | * | ||
| 1005 | * @discussion | ||
| 1006 | * This method performs the equivalent of a dup(2) on the descriptor, and thus | ||
| 1007 | * it is safe to call close(2) on the descriptor after boxing it with a file | ||
| 1008 | * descriptor object. | ||
| 1009 | * | ||
| 1010 | * IMPORTANT: Pointer equality is the ONLY valid test for equality between two | ||
| 1011 | * file descriptor objects. There is no reliable way to determine whether two | ||
| 1012 | * file descriptors refer to the same inode with the same capabilities, so two | ||
| 1013 | * file descriptor objects created from the same underlying file descriptor | ||
| 1014 | * number will not compare equally with xpc_equal(). This is also true of a | ||
| 1015 | * file descriptor object created using xpc_copy() and the original. | ||
| 1016 | * | ||
| 1017 | * This also implies that two collections containing file descriptor objects | ||
| 1018 | * cannot be equal unless the exact same object was inserted into both. | ||
| 1019 | */ | ||
| 1020 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1021 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 1022 | xpc_object_t _Nullable | ||
| 1023 | xpc_fd_create(int fd); | ||
| 1024 | |||
| 1025 | /*! | ||
| 1026 | * @function xpc_fd_dup | ||
| 1027 | * | ||
| 1028 | * @abstract | ||
| 1029 | * Returns a file descriptor that is equivalent to the one boxed by the file | ||
| 1030 | * file descriptor object. | ||
| 1031 | * | ||
| 1032 | * @param xfd | ||
| 1033 | * The file descriptor object which is to be examined. | ||
| 1034 | * | ||
| 1035 | * @result | ||
| 1036 | * A file descriptor that is equivalent to the one originally given to | ||
| 1037 | * xpc_fd_create(). If the descriptor could not be created or if the given | ||
| 1038 | * object was not an XPC file descriptor, -1 is returned. | ||
| 1039 | * | ||
| 1040 | * @discussion | ||
| 1041 | * Multiple invocations of xpc_fd_dup() will not return the same file descriptor | ||
| 1042 | * number, but they will return descriptors that are equivalent, as though they | ||
| 1043 | * had been created by dup(2). | ||
| 1044 | * | ||
| 1045 | * The caller is responsible for calling close(2) on the returned descriptor. | ||
| 1046 | */ | ||
| 1047 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1048 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1049 | int | ||
| 1050 | xpc_fd_dup(xpc_object_t xfd); | ||
| 1051 | |||
| 1052 | #pragma mark Shared Memory | ||
| 1053 | /*! | ||
| 1054 | * @function xpc_shmem_create | ||
| 1055 | * | ||
| 1056 | * @abstract | ||
| 1057 | * Creates an XPC object representing the given shared memory region. | ||
| 1058 | * | ||
| 1059 | * @param region | ||
| 1060 | * A pointer to a region of shared memory, created through a call to mmap(2) | ||
| 1061 | * with the MAP_SHARED flag, which is to be boxed. | ||
| 1062 | * | ||
| 1063 | * @param length | ||
| 1064 | * The length of the region. | ||
| 1065 | * | ||
| 1066 | * @result | ||
| 1067 | * A new shared memory object. | ||
| 1068 | * | ||
| 1069 | * @discussion | ||
| 1070 | * Only memory regions whose exact characteristics are known to the caller | ||
| 1071 | * should be boxed using this API. Memory returned from malloc(3) may not be | ||
| 1072 | * safely shared on either OS X or iOS because the underlying virtual memory | ||
| 1073 | * objects for malloc(3)ed allocations are owned by the malloc(3) subsystem and | ||
| 1074 | * not the caller of malloc(3). | ||
| 1075 | * | ||
| 1076 | * If you wish to share a memory region that you receive from another subsystem, | ||
| 1077 | * part of the interface contract with that other subsystem must include how to | ||
| 1078 | * create the region of memory, or sharing it may be unsafe. | ||
| 1079 | * | ||
| 1080 | * Certain operations may internally fragment a region of memory in a way that | ||
| 1081 | * would truncate the range detected by the shared memory object. vm_copy(), for | ||
| 1082 | * example, may split the region into multiple parts to avoid copying certain | ||
| 1083 | * page ranges. For this reason, it is recommended that you delay all VM | ||
| 1084 | * operations until the shared memory object has been created so that the VM | ||
| 1085 | * system knows that the entire range is intended for sharing. | ||
| 1086 | */ | ||
| 1087 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1088 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1089 | xpc_object_t | ||
| 1090 | xpc_shmem_create(void *region, size_t length); | ||
| 1091 | |||
| 1092 | /*! | ||
| 1093 | * @function xpc_shmem_map | ||
| 1094 | * | ||
| 1095 | * @abstract | ||
| 1096 | * Maps the region boxed by the XPC shared memory object into the caller's | ||
| 1097 | * address space. | ||
| 1098 | * | ||
| 1099 | * @param xshmem | ||
| 1100 | * The shared memory object to be examined. | ||
| 1101 | * | ||
| 1102 | * @param region | ||
| 1103 | * On return, this will point to the region at which the shared memory was | ||
| 1104 | * mapped. | ||
| 1105 | * | ||
| 1106 | * @result | ||
| 1107 | * The length of the region that was mapped. If the mapping failed or if the | ||
| 1108 | * given object was not an XPC shared memory object, 0 is returned. The length | ||
| 1109 | * of the mapped region will always be an integral page size, even if the | ||
| 1110 | * creator of the region specified a non-integral page size. | ||
| 1111 | * | ||
| 1112 | * @discussion | ||
| 1113 | * The resulting region must be disposed of with munmap(2). | ||
| 1114 | * | ||
| 1115 | * It is the responsibility of the caller to manage protections on the new | ||
| 1116 | * region accordingly. | ||
| 1117 | */ | ||
| 1118 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1119 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 1120 | size_t | ||
| 1121 | xpc_shmem_map(xpc_object_t xshmem, void * _Nullable * _Nonnull region); | ||
| 1122 | |||
| 1123 | #pragma mark Array | ||
| 1124 | /*! | ||
| 1125 | * @typedef xpc_array_applier_t | ||
| 1126 | * A block to be invoked for every value in the array. | ||
| 1127 | * | ||
| 1128 | * @param index | ||
| 1129 | * The current index in the iteration. | ||
| 1130 | * | ||
| 1131 | * @param value | ||
| 1132 | * The current value in the iteration. | ||
| 1133 | * | ||
| 1134 | * @result | ||
| 1135 | * A Boolean indicating whether iteration should continue. | ||
| 1136 | */ | ||
| 1137 | #ifdef __BLOCKS__ | ||
| 1138 | typedef bool (^xpc_array_applier_t)(size_t index, xpc_object_t _Nonnull value); | ||
| 1139 | #endif // __BLOCKS__ | ||
| 1140 | |||
| 1141 | /*! | ||
| 1142 | * @function xpc_array_create | ||
| 1143 | * | ||
| 1144 | * @abstract | ||
| 1145 | * Creates an XPC object representing an array of XPC objects. | ||
| 1146 | * | ||
| 1147 | * @discussion | ||
| 1148 | * This array must be contiguous and cannot contain any NULL values. If you | ||
| 1149 | * wish to insert the equivalent of a NULL value, you may use the result of | ||
| 1150 | * {@link xpc_null_create}. | ||
| 1151 | * | ||
| 1152 | * @param objects | ||
| 1153 | * An array of XPC objects which is to be boxed. The order of this array is | ||
| 1154 | * preserved in the object. If this array contains a NULL value, the behavior | ||
| 1155 | * is undefined. This parameter may be NULL only if the count is 0. | ||
| 1156 | * | ||
| 1157 | * @param count | ||
| 1158 | * The number of objects in the given array. If the number passed is less than | ||
| 1159 | * the actual number of values in the array, only the specified number of items | ||
| 1160 | * are inserted into the resulting array. If the number passed is more than | ||
| 1161 | * the the actual number of values, the behavior is undefined. | ||
| 1162 | * | ||
| 1163 | * @result | ||
| 1164 | * A new array object. | ||
| 1165 | */ | ||
| 1166 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1167 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 1168 | xpc_object_t | ||
| 1169 | xpc_array_create(const xpc_object_t _Nonnull * _Nullable objects, size_t count); | ||
| 1170 | |||
| 1171 | /*! | ||
| 1172 | * @function xpc_array_create_empty | ||
| 1173 | * | ||
| 1174 | * @abstract | ||
| 1175 | * Creates an XPC object representing an array of XPC objects. | ||
| 1176 | * | ||
| 1177 | * @result | ||
| 1178 | * A new array object. | ||
| 1179 | * | ||
| 1180 | * @see | ||
| 1181 | * xpc_array_create | ||
| 1182 | */ | ||
| 1183 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 1184 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 1185 | xpc_object_t | ||
| 1186 | xpc_array_create_empty(void); | ||
| 1187 | |||
| 1188 | /*! | ||
| 1189 | * @function xpc_array_set_value | ||
| 1190 | * | ||
| 1191 | * @abstract | ||
| 1192 | * Inserts the specified object into the array at the specified index. | ||
| 1193 | * | ||
| 1194 | * @param xarray | ||
| 1195 | * The array object which is to be manipulated. | ||
| 1196 | * | ||
| 1197 | * @param index | ||
| 1198 | * The index at which to insert the value. This value must lie within the index | ||
| 1199 | * space of the array (0 to N-1 inclusive, where N is the count of the array). | ||
| 1200 | * If the index is outside that range, the behavior is undefined. | ||
| 1201 | * | ||
| 1202 | * @param value | ||
| 1203 | * The object to insert. This value is retained by the array and cannot be | ||
| 1204 | * NULL. If there is already a value at the specified index, it is released, | ||
| 1205 | * and the new value is inserted in its place. | ||
| 1206 | */ | ||
| 1207 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1208 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3 | ||
| 1209 | void | ||
| 1210 | xpc_array_set_value(xpc_object_t xarray, size_t index, xpc_object_t value); | ||
| 1211 | |||
| 1212 | /*! | ||
| 1213 | * @function xpc_array_append_value | ||
| 1214 | * | ||
| 1215 | * @abstract | ||
| 1216 | * Appends an object to an XPC array. | ||
| 1217 | * | ||
| 1218 | * @param xarray | ||
| 1219 | * The array object which is to be manipulated. | ||
| 1220 | * | ||
| 1221 | * @param value | ||
| 1222 | * The object to append. This object is retained by the array. | ||
| 1223 | */ | ||
| 1224 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1225 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 1226 | void | ||
| 1227 | xpc_array_append_value(xpc_object_t xarray, xpc_object_t value); | ||
| 1228 | |||
| 1229 | /*! | ||
| 1230 | * @function xpc_array_get_count | ||
| 1231 | * | ||
| 1232 | * @abstract | ||
| 1233 | * Returns the count of values currently in the array. | ||
| 1234 | * | ||
| 1235 | * @param xarray | ||
| 1236 | * The array object which is to be examined. | ||
| 1237 | * | ||
| 1238 | * @result | ||
| 1239 | * The count of values in the array or 0 if the given object was not an XPC | ||
| 1240 | * array. | ||
| 1241 | */ | ||
| 1242 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1243 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1244 | size_t | ||
| 1245 | xpc_array_get_count(xpc_object_t xarray); | ||
| 1246 | |||
| 1247 | /*! | ||
| 1248 | * @function xpc_array_get_value | ||
| 1249 | * | ||
| 1250 | * @abstract | ||
| 1251 | * Returns the value at the specified index in the array. | ||
| 1252 | * | ||
| 1253 | * @param xarray | ||
| 1254 | * The array object which is to be examined. | ||
| 1255 | * | ||
| 1256 | * @param index | ||
| 1257 | * The index of the value to obtain. This value must lie within the range of | ||
| 1258 | * indexes as specified in xpc_array_set_value(). | ||
| 1259 | * | ||
| 1260 | * @result | ||
| 1261 | * The object at the specified index within the array or NULL if the given | ||
| 1262 | * object was not an XPC array. | ||
| 1263 | * | ||
| 1264 | * @discussion | ||
| 1265 | * This method does not grant the caller a reference to the underlying object, | ||
| 1266 | * and thus the caller is not responsible for releasing the object. | ||
| 1267 | */ | ||
| 1268 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1269 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 1270 | xpc_object_t | ||
| 1271 | xpc_array_get_value(xpc_object_t xarray, size_t index); | ||
| 1272 | |||
| 1273 | /*! | ||
| 1274 | * @function xpc_array_apply | ||
| 1275 | * | ||
| 1276 | * @abstract | ||
| 1277 | * Invokes the given block for every value in the array. | ||
| 1278 | * | ||
| 1279 | * @param xarray | ||
| 1280 | * The array object which is to be examined. | ||
| 1281 | * | ||
| 1282 | * @param applier | ||
| 1283 | * The block which this function applies to every element in the array. | ||
| 1284 | * | ||
| 1285 | * @result | ||
| 1286 | * A Boolean indicating whether iteration of the array completed successfully. | ||
| 1287 | * Iteration will only fail if the applier block returns false. | ||
| 1288 | * | ||
| 1289 | * @discussion | ||
| 1290 | * You should not modify an array's contents during iteration. The array indexes | ||
| 1291 | * are iterated in order. | ||
| 1292 | */ | ||
| 1293 | #ifdef __BLOCKS__ | ||
| 1294 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1295 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 1296 | bool | ||
| 1297 | xpc_array_apply(xpc_object_t xarray, XPC_NOESCAPE xpc_array_applier_t applier); | ||
| 1298 | #endif // __BLOCKS__ | ||
| 1299 | |||
| 1300 | #pragma mark Array Primitive Setters | ||
| 1301 | /*! | ||
| 1302 | * @define XPC_ARRAY_APPEND | ||
| 1303 | * A constant that may be passed as the destination index to the class of | ||
| 1304 | * primitive XPC array setters indicating that the given primitive should be | ||
| 1305 | * appended to the array. | ||
| 1306 | */ | ||
| 1307 | #define XPC_ARRAY_APPEND ((size_t)(-1)) | ||
| 1308 | |||
| 1309 | /*! | ||
| 1310 | * @function xpc_array_set_bool | ||
| 1311 | * | ||
| 1312 | * @abstract | ||
| 1313 | * Inserts a <code>bool</code> (primitive) value into an array. | ||
| 1314 | * | ||
| 1315 | * @param xarray | ||
| 1316 | * The array object which is to be manipulated. | ||
| 1317 | * | ||
| 1318 | * @param index | ||
| 1319 | * The index at which to insert the value. This value must lie within the index | ||
| 1320 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1321 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1322 | * undefined. | ||
| 1323 | * | ||
| 1324 | * @param value | ||
| 1325 | * The <code>bool</code> value to insert. After calling this method, the XPC | ||
| 1326 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 1327 | * with {@link xpc_array_get_value()}. | ||
| 1328 | */ | ||
| 1329 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1330 | XPC_EXPORT XPC_NONNULL1 | ||
| 1331 | void | ||
| 1332 | xpc_array_set_bool(xpc_object_t xarray, size_t index, bool value); | ||
| 1333 | |||
| 1334 | /*! | ||
| 1335 | * @function xpc_array_set_int64 | ||
| 1336 | * | ||
| 1337 | * @abstract | ||
| 1338 | * Inserts an <code>int64_t</code> (primitive) value into an array. | ||
| 1339 | * | ||
| 1340 | * @param xarray | ||
| 1341 | * The array object which is to be manipulated. | ||
| 1342 | * | ||
| 1343 | * @param index | ||
| 1344 | * The index at which to insert the value. This value must lie within the index | ||
| 1345 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1346 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1347 | * undefined. | ||
| 1348 | * | ||
| 1349 | * @param value | ||
| 1350 | * The <code>int64_t</code> value to insert. After calling this method, the XPC | ||
| 1351 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 1352 | * with {@link xpc_array_get_value()}. | ||
| 1353 | */ | ||
| 1354 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1355 | XPC_EXPORT XPC_NONNULL1 | ||
| 1356 | void | ||
| 1357 | xpc_array_set_int64(xpc_object_t xarray, size_t index, int64_t value); | ||
| 1358 | |||
| 1359 | /*! | ||
| 1360 | * @function xpc_array_set_uint64 | ||
| 1361 | * | ||
| 1362 | * @abstract | ||
| 1363 | * Inserts a <code>uint64_t</code> (primitive) value into an array. | ||
| 1364 | * | ||
| 1365 | * @param xarray | ||
| 1366 | * The array object which is to be manipulated. | ||
| 1367 | * | ||
| 1368 | * @param index | ||
| 1369 | * The index at which to insert the value. This value must lie within the index | ||
| 1370 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1371 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1372 | * undefined. | ||
| 1373 | * | ||
| 1374 | * @param value | ||
| 1375 | * The <code>uint64_t</code> value to insert. After calling this method, the XPC | ||
| 1376 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 1377 | * with {@link xpc_array_get_value()}. | ||
| 1378 | */ | ||
| 1379 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1380 | XPC_EXPORT XPC_NONNULL1 | ||
| 1381 | void | ||
| 1382 | xpc_array_set_uint64(xpc_object_t xarray, size_t index, uint64_t value); | ||
| 1383 | |||
| 1384 | /*! | ||
| 1385 | * @function xpc_array_set_double | ||
| 1386 | * | ||
| 1387 | * @abstract | ||
| 1388 | * Inserts a <code>double</code> (primitive) value into an array. | ||
| 1389 | * | ||
| 1390 | * @param xarray | ||
| 1391 | * The array object which is to be manipulated. | ||
| 1392 | * | ||
| 1393 | * @param index | ||
| 1394 | * The index at which to insert the value. This value must lie within the index | ||
| 1395 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1396 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1397 | * undefined. | ||
| 1398 | * | ||
| 1399 | * @param value | ||
| 1400 | * The <code>double</code> value to insert. After calling this method, the XPC | ||
| 1401 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 1402 | * with {@link xpc_array_get_value()}. | ||
| 1403 | */ | ||
| 1404 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1405 | XPC_EXPORT XPC_NONNULL1 | ||
| 1406 | void | ||
| 1407 | xpc_array_set_double(xpc_object_t xarray, size_t index, double value); | ||
| 1408 | |||
| 1409 | /*! | ||
| 1410 | * @function xpc_array_set_date | ||
| 1411 | * | ||
| 1412 | * @abstract | ||
| 1413 | * Inserts a date value into an array. | ||
| 1414 | * | ||
| 1415 | * @param xarray | ||
| 1416 | * The array object which is to be manipulated. | ||
| 1417 | * | ||
| 1418 | * @param index | ||
| 1419 | * The index at which to insert the value. This value must lie within the index | ||
| 1420 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1421 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1422 | * undefined. | ||
| 1423 | * | ||
| 1424 | * @param value | ||
| 1425 | * The date value to insert, represented as an <code>int64_t</code>. After | ||
| 1426 | * calling this method, the XPC object corresponding to the primitive value | ||
| 1427 | * inserted may be safely retrieved with {@link xpc_array_get_value()}. | ||
| 1428 | */ | ||
| 1429 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1430 | XPC_EXPORT XPC_NONNULL1 | ||
| 1431 | void | ||
| 1432 | xpc_array_set_date(xpc_object_t xarray, size_t index, int64_t value); | ||
| 1433 | |||
| 1434 | /*! | ||
| 1435 | * @function xpc_array_set_data | ||
| 1436 | * | ||
| 1437 | * @abstract | ||
| 1438 | * Inserts a raw data value into an array. | ||
| 1439 | * | ||
| 1440 | * @param xarray | ||
| 1441 | * The array object which is to be manipulated. | ||
| 1442 | * | ||
| 1443 | * @param index | ||
| 1444 | * The index at which to insert the value. This value must lie within the index | ||
| 1445 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1446 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1447 | * undefined. | ||
| 1448 | * | ||
| 1449 | * @param bytes | ||
| 1450 | * The raw data to insert. After calling this method, the XPC object | ||
| 1451 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 1452 | * {@link xpc_array_get_value()}. | ||
| 1453 | * | ||
| 1454 | * @param length | ||
| 1455 | * The length of the data. | ||
| 1456 | */ | ||
| 1457 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1458 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3 | ||
| 1459 | void | ||
| 1460 | xpc_array_set_data(xpc_object_t xarray, size_t index, const void *bytes, | ||
| 1461 | 	size_t length); | ||
| 1462 | |||
| 1463 | /*! | ||
| 1464 | * @function xpc_array_set_string | ||
| 1465 | * | ||
| 1466 | * @abstract | ||
| 1467 | * Inserts a C string into an array. | ||
| 1468 | * | ||
| 1469 | * @param xarray | ||
| 1470 | * The array object which is to be manipulated. | ||
| 1471 | * | ||
| 1472 | * @param index | ||
| 1473 | * The index at which to insert the value. This value must lie within the index | ||
| 1474 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1475 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1476 | * undefined. | ||
| 1477 | * | ||
| 1478 | * @param string | ||
| 1479 | * The C string to insert. After calling this method, the XPC object | ||
| 1480 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 1481 | * {@link xpc_array_get_value()}. | ||
| 1482 | */ | ||
| 1483 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1484 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3 | ||
| 1485 | void | ||
| 1486 | xpc_array_set_string(xpc_object_t xarray, size_t index, const char *string); | ||
| 1487 | |||
| 1488 | /*! | ||
| 1489 | * @function xpc_array_set_uuid | ||
| 1490 | * | ||
| 1491 | * @abstract | ||
| 1492 | * Inserts a <code>uuid_t</code> (primitive) value into an array. | ||
| 1493 | * | ||
| 1494 | * @param xarray | ||
| 1495 | * The array object which is to be manipulated. | ||
| 1496 | * | ||
| 1497 | * @param index | ||
| 1498 | * The index at which to insert the value. This value must lie within the index | ||
| 1499 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1500 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1501 | * undefined. | ||
| 1502 | * | ||
| 1503 | * @param uuid | ||
| 1504 | * The UUID primitive to insert. After calling this method, the XPC object | ||
| 1505 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 1506 | * {@link xpc_array_get_value()}. | ||
| 1507 | */ | ||
| 1508 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1509 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3 | ||
| 1510 | void | ||
| 1511 | xpc_array_set_uuid(xpc_object_t xarray, size_t index, | ||
| 1512 | 	const uuid_t XPC_NONNULL_ARRAY uuid); | ||
| 1513 | |||
| 1514 | /*! | ||
| 1515 | * @function xpc_array_set_fd | ||
| 1516 | * | ||
| 1517 | * @abstract | ||
| 1518 | * Inserts a file descriptor into an array. | ||
| 1519 | * | ||
| 1520 | * @param xarray | ||
| 1521 | * The array object which is to be manipulated. | ||
| 1522 | * | ||
| 1523 | * @param index | ||
| 1524 | * The index at which to insert the value. This value must lie within the index | ||
| 1525 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1526 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1527 | * undefined. | ||
| 1528 | * | ||
| 1529 | * @param fd | ||
| 1530 | * The file descriptor to insert. After calling this method, the XPC object | ||
| 1531 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 1532 | * {@link xpc_array_get_value()}. | ||
| 1533 | */ | ||
| 1534 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1535 | XPC_EXPORT XPC_NONNULL1 | ||
| 1536 | void | ||
| 1537 | xpc_array_set_fd(xpc_object_t xarray, size_t index, int fd); | ||
| 1538 | |||
| 1539 | /*! | ||
| 1540 | * @function xpc_array_set_connection | ||
| 1541 | * | ||
| 1542 | * @abstract | ||
| 1543 | * Inserts a connection into an array. | ||
| 1544 | * | ||
| 1545 | * @param xarray | ||
| 1546 | * The array object which is to be manipulated. | ||
| 1547 | * | ||
| 1548 | * @param index | ||
| 1549 | * The index at which to insert the value. This value must lie within the index | ||
| 1550 | * space of the array (0 to N-1 inclusive, where N is the count of the array) or | ||
| 1551 | * be XPC_ARRAY_APPEND. If the index is outside that range, the behavior is | ||
| 1552 | * undefined. | ||
| 1553 | * | ||
| 1554 | * @param connection | ||
| 1555 | * The connection to insert. After calling this method, the XPC object | ||
| 1556 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 1557 | * {@link xpc_array_get_value()}. The connection is NOT retained by the array. | ||
| 1558 | */ | ||
| 1559 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1560 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3 | ||
| 1561 | void | ||
| 1562 | xpc_array_set_connection(xpc_object_t xarray, size_t index, | ||
| 1563 | 	xpc_connection_t connection); | ||
| 1564 | |||
| 1565 | #pragma mark Array Primitive Getters | ||
| 1566 | /*! | ||
| 1567 | * @function xpc_array_get_bool | ||
| 1568 | * | ||
| 1569 | * @abstract | ||
| 1570 | * Gets a <code>bool</code> primitive value from an array directly. | ||
| 1571 | * | ||
| 1572 | * @param xarray | ||
| 1573 | * The array which is to be examined. | ||
| 1574 | * | ||
| 1575 | * @param index | ||
| 1576 | * The index of the value to obtain. This value must lie within the index space | ||
| 1577 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1578 | * index is outside that range, the behavior is undefined. | ||
| 1579 | * | ||
| 1580 | * @result | ||
| 1581 | * The underlying <code>bool</code> value at the specified index. false if the | ||
| 1582 | * value at the specified index is not a Boolean value. | ||
| 1583 | */ | ||
| 1584 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1585 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1586 | bool | ||
| 1587 | xpc_array_get_bool(xpc_object_t xarray, size_t index); | ||
| 1588 | |||
| 1589 | /*! | ||
| 1590 | * @function xpc_array_get_int64 | ||
| 1591 | * | ||
| 1592 | * @abstract | ||
| 1593 | * Gets an <code>int64_t</code> primitive value from an array directly. | ||
| 1594 | * | ||
| 1595 | * @param xarray | ||
| 1596 | * The array which is to be examined. | ||
| 1597 | * | ||
| 1598 | * @param index | ||
| 1599 | * The index of the value to obtain. This value must lie within the index space | ||
| 1600 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1601 | * index is outside that range, the behavior is undefined. | ||
| 1602 | * | ||
| 1603 | * @result | ||
| 1604 | * The underlying <code>int64_t</code> value at the specified index. 0 if the | ||
| 1605 | * value at the specified index is not a signed integer value. | ||
| 1606 | */ | ||
| 1607 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1608 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1609 | int64_t | ||
| 1610 | xpc_array_get_int64(xpc_object_t xarray, size_t index); | ||
| 1611 | |||
| 1612 | /*! | ||
| 1613 | * @function xpc_array_get_uint64 | ||
| 1614 | * | ||
| 1615 | * @abstract | ||
| 1616 | * Gets a <code>uint64_t</code> primitive value from an array directly. | ||
| 1617 | * | ||
| 1618 | * @param xarray | ||
| 1619 | * The array which is to be examined. | ||
| 1620 | * | ||
| 1621 | * @param index | ||
| 1622 | * The index of the value to obtain. This value must lie within the index space | ||
| 1623 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1624 | * index is outside that range, the behavior is undefined. | ||
| 1625 | * | ||
| 1626 | * @result | ||
| 1627 | * The underlying <code>uint64_t</code> value at the specified index. 0 if the | ||
| 1628 | * value at the specified index is not an unsigned integer value. | ||
| 1629 | */ | ||
| 1630 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1631 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1632 | uint64_t | ||
| 1633 | xpc_array_get_uint64(xpc_object_t xarray, size_t index); | ||
| 1634 | |||
| 1635 | /*! | ||
| 1636 | * @function xpc_array_get_double | ||
| 1637 | * | ||
| 1638 | * @abstract | ||
| 1639 | * Gets a <code>double</code> primitive value from an array directly. | ||
| 1640 | * | ||
| 1641 | * @param xarray | ||
| 1642 | * The array which is to be examined. | ||
| 1643 | * | ||
| 1644 | * @param index | ||
| 1645 | * The index of the value to obtain. This value must lie within the index space | ||
| 1646 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1647 | * index is outside that range, the behavior is undefined. | ||
| 1648 | * | ||
| 1649 | * @result | ||
| 1650 | * The underlying <code>double</code> value at the specified index. NAN if the | ||
| 1651 | * value at the specified index is not a floating point value. | ||
| 1652 | */ | ||
| 1653 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1654 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1655 | double | ||
| 1656 | xpc_array_get_double(xpc_object_t xarray, size_t index); | ||
| 1657 | |||
| 1658 | /*! | ||
| 1659 | * @function xpc_array_get_date | ||
| 1660 | * | ||
| 1661 | * @abstract | ||
| 1662 | * Gets a date interval from an array directly. | ||
| 1663 | * | ||
| 1664 | * @param xarray | ||
| 1665 | * The array which is to be examined. | ||
| 1666 | * | ||
| 1667 | * @param index | ||
| 1668 | * The index of the value to obtain. This value must lie within the index space | ||
| 1669 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1670 | * index is outside that range, the behavior is undefined. | ||
| 1671 | * | ||
| 1672 | * @result | ||
| 1673 | * The underlying date interval at the specified index. 0 if the value at the | ||
| 1674 | * specified index is not a date value. | ||
| 1675 | */ | ||
| 1676 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1677 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1678 | int64_t | ||
| 1679 | xpc_array_get_date(xpc_object_t xarray, size_t index); | ||
| 1680 | |||
| 1681 | /*! | ||
| 1682 | * @function xpc_array_get_data | ||
| 1683 | * | ||
| 1684 | * @abstract | ||
| 1685 | * Gets a pointer to the raw bytes of a data object from an array directly. | ||
| 1686 | * | ||
| 1687 | * @param xarray | ||
| 1688 | * The array which is to be examined. | ||
| 1689 | * | ||
| 1690 | * @param index | ||
| 1691 | * The index of the value to obtain. This value must lie within the index space | ||
| 1692 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1693 | * index is outside that range, the behavior is undefined. | ||
| 1694 | * | ||
| 1695 | * @param length | ||
| 1696 | * Upon return output, will contain the length of the data corresponding to the | ||
| 1697 | * specified key. | ||
| 1698 | * | ||
| 1699 | * @result | ||
| 1700 | * The underlying bytes at the specified index. NULL if the value at the | ||
| 1701 | * specified index is not a data value. | ||
| 1702 | */ | ||
| 1703 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1704 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1705 | const void * _Nullable | ||
| 1706 | xpc_array_get_data(xpc_object_t xarray, size_t index, | ||
| 1707 | 	size_t * _Nullable length); | ||
| 1708 | |||
| 1709 | /*! | ||
| 1710 | * @function xpc_array_get_string | ||
| 1711 | * | ||
| 1712 | * @abstract | ||
| 1713 | * Gets a C string value from an array directly. | ||
| 1714 | * | ||
| 1715 | * @param xarray | ||
| 1716 | * The array which is to be examined. | ||
| 1717 | * | ||
| 1718 | * @param index | ||
| 1719 | * The index of the value to obtain. This value must lie within the index space | ||
| 1720 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1721 | * index is outside that range, the behavior is undefined. | ||
| 1722 | * | ||
| 1723 | * @result | ||
| 1724 | * The underlying C string at the specified index. NULL if the value at the | ||
| 1725 | * specified index is not a C string value. | ||
| 1726 | */ | ||
| 1727 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1728 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1729 | const char * _Nullable | ||
| 1730 | xpc_array_get_string(xpc_object_t xarray, size_t index); | ||
| 1731 | |||
| 1732 | /*! | ||
| 1733 | * @function xpc_array_get_uuid | ||
| 1734 | * | ||
| 1735 | * @abstract | ||
| 1736 | * Gets a <code>uuid_t</code> value from an array directly. | ||
| 1737 | * | ||
| 1738 | * @param xarray | ||
| 1739 | * The array which is to be examined. | ||
| 1740 | * | ||
| 1741 | * @param index | ||
| 1742 | * The index of the value to obtain. This value must lie within the index space | ||
| 1743 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1744 | * index is outside that range, the behavior is undefined. | ||
| 1745 | * | ||
| 1746 | * @result | ||
| 1747 | * The underlying <code>uuid_t</code> value at the specified index. The null | ||
| 1748 | * UUID if the value at the specified index is not a UUID value. The returned | ||
| 1749 | * pointer may be safely passed to the uuid(3) APIs. | ||
| 1750 | */ | ||
| 1751 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1752 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1753 | const uint8_t * _Nullable | ||
| 1754 | xpc_array_get_uuid(xpc_object_t xarray, size_t index); | ||
| 1755 | |||
| 1756 | /*! | ||
| 1757 | * @function xpc_array_dup_fd | ||
| 1758 | * | ||
| 1759 | * @abstract | ||
| 1760 | * Gets a file descriptor from an array directly. | ||
| 1761 | * | ||
| 1762 | * @param xarray | ||
| 1763 | * The array which is to be examined. | ||
| 1764 | * | ||
| 1765 | * @param index | ||
| 1766 | * The index of the value to obtain. This value must lie within the index space | ||
| 1767 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1768 | * index is outside that range, the behavior is undefined. | ||
| 1769 | * | ||
| 1770 | * @result | ||
| 1771 | * A new file descriptor created from the value at the specified index. You are | ||
| 1772 | * responsible for close(2)ing this descriptor. -1 if the value at the specified | ||
| 1773 | * index is not a file descriptor value. | ||
| 1774 | */ | ||
| 1775 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1776 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1777 | int | ||
| 1778 | xpc_array_dup_fd(xpc_object_t xarray, size_t index); | ||
| 1779 | |||
| 1780 | /*! | ||
| 1781 | * @function xpc_array_create_connection | ||
| 1782 | * | ||
| 1783 | * @abstract | ||
| 1784 | * Creates a connection object from an array directly. | ||
| 1785 | * | ||
| 1786 | * @param xarray | ||
| 1787 | * The array which is to be examined. | ||
| 1788 | * | ||
| 1789 | * @param index | ||
| 1790 | * The index of the value to obtain. This value must lie within the index space | ||
| 1791 | * of the array (0 to N-1 inclusive, where N is the count of the array). If the | ||
| 1792 | * index is outside that range, the behavior is undefined. | ||
| 1793 | * | ||
| 1794 | * @result | ||
| 1795 | * A new connection created from the value at the specified index. You are | ||
| 1796 | * responsible for calling xpc_release() on the returned connection. NULL if the | ||
| 1797 | * value at the specified index is not an endpoint containing a connection. Each | ||
| 1798 | * call to this method for the same index in the same array will yield a | ||
| 1799 | * different connection. See {@link xpc_connection_create_from_endpoint()} for | ||
| 1800 | * discussion as to the responsibilities when dealing with the returned | ||
| 1801 | * connection. | ||
| 1802 | */ | ||
| 1803 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1804 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 | ||
| 1805 | xpc_connection_t _Nullable | ||
| 1806 | xpc_array_create_connection(xpc_object_t xarray, size_t index); | ||
| 1807 | |||
| 1808 | /*! | ||
| 1809 | * @function xpc_array_get_dictionary | ||
| 1810 | * | ||
| 1811 | * @abstract | ||
| 1812 | * Returns the dictionary at the specified index in the array. | ||
| 1813 | * | ||
| 1814 | * @param xarray | ||
| 1815 | * The array object which is to be examined. | ||
| 1816 | * | ||
| 1817 | * @param index | ||
| 1818 | * The index of the value to obtain. This value must lie within the range of | ||
| 1819 | * indexes as specified in xpc_array_set_value(). | ||
| 1820 | * | ||
| 1821 | * @result | ||
| 1822 | * The object at the specified index within the array or NULL if the given | ||
| 1823 | * object was not an XPC array or if the the value at the specified index was | ||
| 1824 | * not a dictionary. | ||
| 1825 | * | ||
| 1826 | * @discussion | ||
| 1827 | * This method does not grant the caller a reference to the underlying object, | ||
| 1828 | * and thus the caller is not responsible for releasing the object. | ||
| 1829 | */ | ||
| 1830 | __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) | ||
| 1831 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 1832 | xpc_object_t _Nullable | ||
| 1833 | xpc_array_get_dictionary(xpc_object_t xarray, size_t index); | ||
| 1834 | |||
| 1835 | /*! | ||
| 1836 | * @function xpc_array_get_array | ||
| 1837 | * | ||
| 1838 | * @abstract | ||
| 1839 | * Returns the array at the specified index in the array. | ||
| 1840 | * | ||
| 1841 | * @param xarray | ||
| 1842 | * The array object which is to be examined. | ||
| 1843 | * | ||
| 1844 | * @param index | ||
| 1845 | * The index of the value to obtain. This value must lie within the range of | ||
| 1846 | * indexes as specified in xpc_array_set_value(). | ||
| 1847 | * | ||
| 1848 | * @result | ||
| 1849 | * The object at the specified index within the array or NULL if the given | ||
| 1850 | * object was not an XPC array or if the the value at the specified index was | ||
| 1851 | * not an array. | ||
| 1852 | * | ||
| 1853 | * @discussion | ||
| 1854 | * This method does not grant the caller a reference to the underlying object, | ||
| 1855 | * and thus the caller is not responsible for releasing the object. | ||
| 1856 | */ | ||
| 1857 | __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) | ||
| 1858 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 1859 | xpc_object_t _Nullable | ||
| 1860 | xpc_array_get_array(xpc_object_t xarray, size_t index); | ||
| 1861 | |||
| 1862 | #pragma mark Dictionary | ||
| 1863 | /*! | ||
| 1864 | * @typedef xpc_dictionary_applier_t | ||
| 1865 | * A block to be invoked for every key/value pair in the dictionary. | ||
| 1866 | * | ||
| 1867 | * @param key | ||
| 1868 | * The current key in the iteration. | ||
| 1869 | * | ||
| 1870 | * @param value | ||
| 1871 | * The current value in the iteration. | ||
| 1872 | * | ||
| 1873 | * @result | ||
| 1874 | * A Boolean indicating whether iteration should continue. | ||
| 1875 | */ | ||
| 1876 | #ifdef __BLOCKS__ | ||
| 1877 | typedef bool (^xpc_dictionary_applier_t)(const char * _Nonnull key, | ||
| 1878 | 		xpc_object_t _Nonnull value); | ||
| 1879 | #endif // __BLOCKS__ | ||
| 1880 | |||
| 1881 | /*! | ||
| 1882 | * @function xpc_dictionary_create | ||
| 1883 | * | ||
| 1884 | * @abstract | ||
| 1885 | * Creates an XPC object representing a dictionary of XPC objects keyed to | ||
| 1886 | * C-strings. | ||
| 1887 | * | ||
| 1888 | * @param keys | ||
| 1889 | * An array of C-strings that are to be the keys for the values to be inserted. | ||
| 1890 | * Each element of this array is copied into the dictionary's internal storage. | ||
| 1891 | * Elements of this array may NOT be NULL. | ||
| 1892 | * | ||
| 1893 | * @param values | ||
| 1894 | * A C-array that is parallel to the array of keys, consisting of objects that | ||
| 1895 | * are to be inserted. Each element in this array is retained. Elements in this | ||
| 1896 | * array may be NULL. | ||
| 1897 | * | ||
| 1898 | * @param count | ||
| 1899 | * The number of key/value pairs in the given arrays. If the count is less than | ||
| 1900 | * the actual count of values, only that many key/value pairs will be inserted | ||
| 1901 | * into the dictionary. | ||
| 1902 | * | ||
| 1903 | * If the count is more than the the actual count of key/value pairs, the | ||
| 1904 | * behavior is undefined. If one array is NULL and the other is not, the | ||
| 1905 | * behavior is undefined. If both arrays are NULL and the count is non-0, the | ||
| 1906 | * behavior is undefined. | ||
| 1907 | * | ||
| 1908 | * @result | ||
| 1909 | * The new dictionary object. | ||
| 1910 | */ | ||
| 1911 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1912 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 1913 | xpc_object_t | ||
| 1914 | xpc_dictionary_create(const char * _Nonnull const * _Nullable keys, | ||
| 1915 | 	const xpc_object_t _Nullable * _Nullable values, size_t count); | ||
| 1916 | |||
| 1917 | /*! | ||
| 1918 | * @function xpc_dictionary_create_empty | ||
| 1919 | * | ||
| 1920 | * @abstract | ||
| 1921 | * Creates an XPC object representing a dictionary of XPC objects keyed to | ||
| 1922 | * C-strings. | ||
| 1923 | * | ||
| 1924 | * @result | ||
| 1925 | * The new dictionary object. | ||
| 1926 | * | ||
| 1927 | * @see | ||
| 1928 | * xpc_dictionary_create | ||
| 1929 | */ | ||
| 1930 | API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) | ||
| 1931 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT | ||
| 1932 | xpc_object_t | ||
| 1933 | xpc_dictionary_create_empty(void); | ||
| 1934 | |||
| 1935 | /*! | ||
| 1936 | * @function xpc_dictionary_create_reply | ||
| 1937 | * | ||
| 1938 | * @abstract | ||
| 1939 | * Creates a dictionary that is in reply to the given dictionary. | ||
| 1940 | * | ||
| 1941 | * @param original | ||
| 1942 | * The original dictionary that is to be replied to. | ||
| 1943 | * | ||
| 1944 | * @result | ||
| 1945 | * The new dictionary object. NULL if the object was not a dictionary with a | ||
| 1946 | * reply context. | ||
| 1947 | * | ||
| 1948 | * @discussion | ||
| 1949 | * After completing successfully on a dictionary, this method may not be called | ||
| 1950 | * again on that same dictionary. Attempts to do so will return NULL. | ||
| 1951 | * | ||
| 1952 | * When this dictionary is sent across the reply connection, the remote end's | ||
| 1953 | * reply handler is invoked. | ||
| 1954 | */ | ||
| 1955 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1956 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 1957 | xpc_object_t _Nullable | ||
| 1958 | xpc_dictionary_create_reply(xpc_object_t original); | ||
| 1959 | |||
| 1960 | /*! | ||
| 1961 | * @function xpc_dictionary_set_value | ||
| 1962 | * | ||
| 1963 | * @abstract | ||
| 1964 | * Sets the value for the specified key to the specified object. | ||
| 1965 | * | ||
| 1966 | * @param xdict | ||
| 1967 | * The dictionary object which is to be manipulated. | ||
| 1968 | * | ||
| 1969 | * @param key | ||
| 1970 | * The key for which the value shall be set. | ||
| 1971 | * | ||
| 1972 | * @param value | ||
| 1973 | * The object to insert. The object is retained by the dictionary. If there | ||
| 1974 | * already exists a value for the specified key, the old value is released | ||
| 1975 | * and overwritten by the new value. This parameter may be NULL, in which case | ||
| 1976 | * the value corresponding to the specified key is deleted if present. | ||
| 1977 | */ | ||
| 1978 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 1979 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 1980 | void | ||
| 1981 | xpc_dictionary_set_value(xpc_object_t xdict, const char *key, | ||
| 1982 | 	xpc_object_t _Nullable value); | ||
| 1983 | |||
| 1984 | /*! | ||
| 1985 | * @function xpc_dictionary_get_value | ||
| 1986 | * | ||
| 1987 | * @abstract | ||
| 1988 | * Returns the value for the specified key. | ||
| 1989 | * | ||
| 1990 | * @param xdict | ||
| 1991 | * The dictionary object which is to be examined. | ||
| 1992 | * | ||
| 1993 | * @param key | ||
| 1994 | * The key whose value is to be obtained. | ||
| 1995 | * | ||
| 1996 | * @result | ||
| 1997 | * The object for the specified key within the dictionary. NULL if there is no | ||
| 1998 | * value associated with the specified key or if the given object was not an | ||
| 1999 | * XPC dictionary. | ||
| 2000 | * | ||
| 2001 | * @discussion | ||
| 2002 | * This method does not grant the caller a reference to the underlying object, | ||
| 2003 | * and thus the caller is not responsible for releasing the object. | ||
| 2004 | */ | ||
| 2005 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2006 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2007 | xpc_object_t _Nullable | ||
| 2008 | xpc_dictionary_get_value(xpc_object_t xdict, const char *key); | ||
| 2009 | |||
| 2010 | /*! | ||
| 2011 | * @function xpc_dictionary_get_count | ||
| 2012 | * | ||
| 2013 | * @abstract | ||
| 2014 | * Returns the number of values stored in the dictionary. | ||
| 2015 | * | ||
| 2016 | * @param xdict | ||
| 2017 | * The dictionary object which is to be examined. | ||
| 2018 | * | ||
| 2019 | * @result | ||
| 2020 | * The number of values stored in the dictionary or 0 if the given object was | ||
| 2021 | * not an XPC dictionary. Calling xpc_dictionary_set_value() with a non-NULL | ||
| 2022 | * value will increment the count. Calling xpc_dictionary_set_value() with a | ||
| 2023 | * NULL value will decrement the count. | ||
| 2024 | */ | ||
| 2025 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2026 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 2027 | size_t | ||
| 2028 | xpc_dictionary_get_count(xpc_object_t xdict); | ||
| 2029 | |||
| 2030 | /*! | ||
| 2031 | * @function xpc_dictionary_apply | ||
| 2032 | * | ||
| 2033 | * @abstract | ||
| 2034 | * Invokes the given block for every key/value pair in the dictionary. | ||
| 2035 | * | ||
| 2036 | * @param xdict | ||
| 2037 | * The dictionary object which is to be examined. | ||
| 2038 | * | ||
| 2039 | * @param applier | ||
| 2040 | * The block which this function applies to every key/value pair in the | ||
| 2041 | * dictionary. | ||
| 2042 | * | ||
| 2043 | * @result | ||
| 2044 | * A Boolean indicating whether iteration of the dictionary completed | ||
| 2045 | * successfully. Iteration will only fail if the applier block returns false. | ||
| 2046 | * | ||
| 2047 | * @discussion | ||
| 2048 | * You should not modify a dictionary's contents during iteration. There is no | ||
| 2049 | * guaranteed order of iteration over dictionaries. | ||
| 2050 | */ | ||
| 2051 | #ifdef __BLOCKS__ | ||
| 2052 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2053 | XPC_EXPORT XPC_NONNULL_ALL | ||
| 2054 | bool | ||
| 2055 | xpc_dictionary_apply(xpc_object_t xdict, | ||
| 2056 | 		XPC_NOESCAPE xpc_dictionary_applier_t applier); | ||
| 2057 | #endif // __BLOCKS__ | ||
| 2058 | |||
| 2059 | /*! | ||
| 2060 | * @function xpc_dictionary_get_remote_connection | ||
| 2061 | * | ||
| 2062 | * @abstract | ||
| 2063 | * Returns the connection from which the dictionary was received. | ||
| 2064 | * | ||
| 2065 | * @param xdict | ||
| 2066 | * The dictionary object which is to be examined. | ||
| 2067 | * | ||
| 2068 | * @result | ||
| 2069 | * If the dictionary was received by a connection event handler or a dictionary | ||
| 2070 | * created through xpc_dictionary_create_reply(), a connection object over which | ||
| 2071 | * a reply message can be sent is returned. For any other dictionary, NULL is | ||
| 2072 | * returned. | ||
| 2073 | */ | ||
| 2074 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2075 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2076 | xpc_connection_t _Nullable | ||
| 2077 | xpc_dictionary_get_remote_connection(xpc_object_t xdict); | ||
| 2078 | |||
| 2079 | #pragma mark Dictionary Primitive Setters | ||
| 2080 | /*! | ||
| 2081 | * @function xpc_dictionary_set_bool | ||
| 2082 | * | ||
| 2083 | * @abstract | ||
| 2084 | * Inserts a <code>bool</code> (primitive) value into a dictionary. | ||
| 2085 | * | ||
| 2086 | * @param xdict | ||
| 2087 | * The dictionary which is to be manipulated. | ||
| 2088 | * | ||
| 2089 | * @param key | ||
| 2090 | * The key for which the primitive value shall be set. | ||
| 2091 | * | ||
| 2092 | * @param value | ||
| 2093 | * The <code>bool</code> value to insert. After calling this method, the XPC | ||
| 2094 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 2095 | * with {@link xpc_dictionary_get_value()}. | ||
| 2096 | */ | ||
| 2097 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2098 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2099 | void | ||
| 2100 | xpc_dictionary_set_bool(xpc_object_t xdict, const char *key, bool value); | ||
| 2101 | |||
| 2102 | /*! | ||
| 2103 | * @function xpc_dictionary_set_int64 | ||
| 2104 | * | ||
| 2105 | * @abstract | ||
| 2106 | * Inserts an <code>int64_t</code> (primitive) value into a dictionary. | ||
| 2107 | * | ||
| 2108 | * @param xdict | ||
| 2109 | * The dictionary which is to be manipulated. | ||
| 2110 | * | ||
| 2111 | * @param key | ||
| 2112 | * The key for which the primitive value shall be set. | ||
| 2113 | * | ||
| 2114 | * @param value | ||
| 2115 | * The <code>int64_t</code> value to insert. After calling this method, the XPC | ||
| 2116 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 2117 | * with {@link xpc_dictionary_get_value()}. | ||
| 2118 | */ | ||
| 2119 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2120 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2121 | void | ||
| 2122 | xpc_dictionary_set_int64(xpc_object_t xdict, const char *key, int64_t value); | ||
| 2123 | |||
| 2124 | /*! | ||
| 2125 | * @function xpc_dictionary_set_uint64 | ||
| 2126 | * | ||
| 2127 | * @abstract | ||
| 2128 | * Inserts a <code>uint64_t</code> (primitive) value into a dictionary. | ||
| 2129 | * | ||
| 2130 | * @param xdict | ||
| 2131 | * The dictionary which is to be manipulated. | ||
| 2132 | * | ||
| 2133 | * @param key | ||
| 2134 | * The key for which the primitive value shall be set. | ||
| 2135 | * | ||
| 2136 | * @param value | ||
| 2137 | * The <code>uint64_t</code> value to insert. After calling this method, the XPC | ||
| 2138 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 2139 | * with {@link xpc_dictionary_get_value()}. | ||
| 2140 | */ | ||
| 2141 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2142 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2143 | void | ||
| 2144 | xpc_dictionary_set_uint64(xpc_object_t xdict, const char *key, uint64_t value); | ||
| 2145 | |||
| 2146 | /*! | ||
| 2147 | * @function xpc_dictionary_set_double | ||
| 2148 | * | ||
| 2149 | * @abstract | ||
| 2150 | * Inserts a <code>double</code> (primitive) value into a dictionary. | ||
| 2151 | * | ||
| 2152 | * @param xdict | ||
| 2153 | * The dictionary which is to be manipulated. | ||
| 2154 | * | ||
| 2155 | * @param key | ||
| 2156 | * The key for which the primitive value shall be set. | ||
| 2157 | * | ||
| 2158 | * @param value | ||
| 2159 | * The <code>double</code> value to insert. After calling this method, the XPC | ||
| 2160 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 2161 | * with {@link xpc_dictionary_get_value()}. | ||
| 2162 | */ | ||
| 2163 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2164 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2165 | void | ||
| 2166 | xpc_dictionary_set_double(xpc_object_t xdict, const char *key, double value); | ||
| 2167 | |||
| 2168 | /*! | ||
| 2169 | * @function xpc_dictionary_set_date | ||
| 2170 | * | ||
| 2171 | * @abstract | ||
| 2172 | * Inserts a date (primitive) value into a dictionary. | ||
| 2173 | * | ||
| 2174 | * @param xdict | ||
| 2175 | * The dictionary which is to be manipulated. | ||
| 2176 | * | ||
| 2177 | * @param key | ||
| 2178 | * The key for which the primitive value shall be set. | ||
| 2179 | * | ||
| 2180 | * @param value | ||
| 2181 | * The date value to insert. After calling this method, the XPC object | ||
| 2182 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 2183 | * {@link xpc_dictionary_get_value()}. | ||
| 2184 | */ | ||
| 2185 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2186 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2187 | void | ||
| 2188 | xpc_dictionary_set_date(xpc_object_t xdict, const char *key, int64_t value); | ||
| 2189 | |||
| 2190 | /*! | ||
| 2191 | * @function xpc_dictionary_set_data | ||
| 2192 | * | ||
| 2193 | * @abstract | ||
| 2194 | * Inserts a raw data value into a dictionary. | ||
| 2195 | * | ||
| 2196 | * @param xdict | ||
| 2197 | * The dictionary which is to be manipulated. | ||
| 2198 | * | ||
| 2199 | * @param key | ||
| 2200 | * The key for which the primitive value shall be set. | ||
| 2201 | * | ||
| 2202 | * @param bytes | ||
| 2203 | * The bytes to insert. After calling this method, the XPC object corresponding | ||
| 2204 | * to the primitive value inserted may be safely retrieved with | ||
| 2205 | * {@link xpc_dictionary_get_value()}. | ||
| 2206 | * | ||
| 2207 | * @param length | ||
| 2208 | * The length of the data. | ||
| 2209 | */ | ||
| 2210 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2211 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3 | ||
| 2212 | void | ||
| 2213 | xpc_dictionary_set_data(xpc_object_t xdict, const char *key, const void *bytes, | ||
| 2214 | 	size_t length); | ||
| 2215 | |||
| 2216 | /*! | ||
| 2217 | * @function xpc_dictionary_set_string | ||
| 2218 | * | ||
| 2219 | * @abstract | ||
| 2220 | * Inserts a C string value into a dictionary. | ||
| 2221 | * | ||
| 2222 | * @param xdict | ||
| 2223 | * The dictionary which is to be manipulated. | ||
| 2224 | * | ||
| 2225 | * @param key | ||
| 2226 | * The key for which the primitive value shall be set. | ||
| 2227 | * | ||
| 2228 | * @param string | ||
| 2229 | * The C string to insert. After calling this method, the XPC object | ||
| 2230 | * corresponding to the primitive value inserted may be safely retrieved with | ||
| 2231 | * {@link xpc_dictionary_get_value()}. | ||
| 2232 | */ | ||
| 2233 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2234 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3 | ||
| 2235 | void | ||
| 2236 | xpc_dictionary_set_string(xpc_object_t xdict, const char *key, | ||
| 2237 | 	const char *string); | ||
| 2238 | |||
| 2239 | /*! | ||
| 2240 | * @function xpc_dictionary_set_uuid | ||
| 2241 | * | ||
| 2242 | * @abstract | ||
| 2243 | * Inserts a uuid (primitive) value into an array. | ||
| 2244 | * | ||
| 2245 | * @param xdict | ||
| 2246 | * The dictionary which is to be manipulated. | ||
| 2247 | * | ||
| 2248 | * @param key | ||
| 2249 | * The key for which the primitive value shall be set. | ||
| 2250 | * | ||
| 2251 | * @param uuid | ||
| 2252 | * The <code>uuid_t</code> value to insert. After calling this method, the XPC | ||
| 2253 | * object corresponding to the primitive value inserted may be safely retrieved | ||
| 2254 | * with {@link xpc_dictionary_get_value()}. | ||
| 2255 | */ | ||
| 2256 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2257 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3 | ||
| 2258 | void | ||
| 2259 | xpc_dictionary_set_uuid(xpc_object_t xdict, const char *key, | ||
| 2260 | 	const uuid_t XPC_NONNULL_ARRAY uuid); | ||
| 2261 | |||
| 2262 | /*! | ||
| 2263 | * @function xpc_dictionary_set_fd | ||
| 2264 | * | ||
| 2265 | * @abstract | ||
| 2266 | * Inserts a file descriptor into a dictionary. | ||
| 2267 | * | ||
| 2268 | * @param xdict | ||
| 2269 | * The dictionary which is to be manipulated. | ||
| 2270 | * | ||
| 2271 | * @param key | ||
| 2272 | * The key for which the primitive value shall be set. | ||
| 2273 | * | ||
| 2274 | * @param fd | ||
| 2275 | * The file descriptor to insert. After calling this method, the XPC object | ||
| 2276 | * corresponding to the primitive value inserted may be safely retrieved | ||
| 2277 | * with {@link xpc_dictionary_get_value()}. | ||
| 2278 | */ | ||
| 2279 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2280 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2281 | void | ||
| 2282 | xpc_dictionary_set_fd(xpc_object_t xdict, const char *key, int fd); | ||
| 2283 | |||
| 2284 | /*! | ||
| 2285 | * @function xpc_dictionary_set_connection | ||
| 2286 | * | ||
| 2287 | * @abstract | ||
| 2288 | * Inserts a connection into a dictionary. | ||
| 2289 | * | ||
| 2290 | * @param xdict | ||
| 2291 | * The dictionary which is to be manipulated. | ||
| 2292 | * | ||
| 2293 | * @param key | ||
| 2294 | * The key for which the primitive value shall be set. | ||
| 2295 | * | ||
| 2296 | * @param connection | ||
| 2297 | * The connection to insert. After calling this method, the XPC object | ||
| 2298 | * corresponding to the primitive value inserted may be safely retrieved | ||
| 2299 | * with {@link xpc_dictionary_get_value()}. The connection is NOT retained by | ||
| 2300 | * the dictionary. | ||
| 2301 | */ | ||
| 2302 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2303 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3 | ||
| 2304 | void | ||
| 2305 | xpc_dictionary_set_connection(xpc_object_t xdict, const char *key, | ||
| 2306 | 	xpc_connection_t connection); | ||
| 2307 | |||
| 2308 | #pragma mark Dictionary Primitive Getters | ||
| 2309 | /*! | ||
| 2310 | * @function xpc_dictionary_get_bool | ||
| 2311 | * | ||
| 2312 | * @abstract | ||
| 2313 | * Gets a <code>bool</code> primitive value from a dictionary directly. | ||
| 2314 | * | ||
| 2315 | * @param xdict | ||
| 2316 | * The dictionary object which is to be examined. | ||
| 2317 | * | ||
| 2318 | * @param key | ||
| 2319 | * The key whose value is to be obtained. | ||
| 2320 | * | ||
| 2321 | * @result | ||
| 2322 | * The underlying <code>bool</code> value for the specified key. false if the | ||
| 2323 | * the value for the specified key is not a Boolean value or if there is no | ||
| 2324 | * value for the specified key. | ||
| 2325 | */ | ||
| 2326 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2327 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2328 | bool | ||
| 2329 | xpc_dictionary_get_bool(xpc_object_t xdict, const char *key); | ||
| 2330 | |||
| 2331 | /*! | ||
| 2332 | * @function xpc_dictionary_get_int64 | ||
| 2333 | * | ||
| 2334 | * @abstract | ||
| 2335 | * Gets an <code>int64</code> primitive value from a dictionary directly. | ||
| 2336 | * | ||
| 2337 | * @param xdict | ||
| 2338 | * The dictionary object which is to be examined. | ||
| 2339 | * | ||
| 2340 | * @param key | ||
| 2341 | * The key whose value is to be obtained. | ||
| 2342 | * | ||
| 2343 | * @result | ||
| 2344 | * The underlying <code>int64_t</code> value for the specified key. 0 if the | ||
| 2345 | * value for the specified key is not a signed integer value or if there is no | ||
| 2346 | * value for the specified key. | ||
| 2347 | */ | ||
| 2348 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2349 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2350 | int64_t | ||
| 2351 | xpc_dictionary_get_int64(xpc_object_t xdict, const char *key); | ||
| 2352 | |||
| 2353 | /*! | ||
| 2354 | * @function xpc_dictionary_get_uint64 | ||
| 2355 | * | ||
| 2356 | * @abstract | ||
| 2357 | * Gets a <code>uint64</code> primitive value from a dictionary directly. | ||
| 2358 | * | ||
| 2359 | * @param xdict | ||
| 2360 | * The dictionary object which is to be examined. | ||
| 2361 | * | ||
| 2362 | * @param key | ||
| 2363 | * The key whose value is to be obtained. | ||
| 2364 | * | ||
| 2365 | * @result | ||
| 2366 | * The underlying <code>uint64_t</code> value for the specified key. 0 if the | ||
| 2367 | * value for the specified key is not an unsigned integer value or if there is | ||
| 2368 | * no value for the specified key. | ||
| 2369 | */ | ||
| 2370 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2371 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2372 | uint64_t | ||
| 2373 | xpc_dictionary_get_uint64(xpc_object_t xdict, const char *key); | ||
| 2374 | |||
| 2375 | /*! | ||
| 2376 | * @function xpc_dictionary_get_double | ||
| 2377 | * | ||
| 2378 | * @abstract | ||
| 2379 | * Gets a <code>double</code> primitive value from a dictionary directly. | ||
| 2380 | * | ||
| 2381 | * @param xdict | ||
| 2382 | * The dictionary object which is to be examined. | ||
| 2383 | * | ||
| 2384 | * @param key | ||
| 2385 | * The key whose value is to be obtained. | ||
| 2386 | * | ||
| 2387 | * @result | ||
| 2388 | * The underlying <code>double</code> value for the specified key. NAN if the | ||
| 2389 | * value for the specified key is not a floating point value or if there is no | ||
| 2390 | * value for the specified key. | ||
| 2391 | */ | ||
| 2392 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2393 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2394 | double | ||
| 2395 | xpc_dictionary_get_double(xpc_object_t xdict, const char *key); | ||
| 2396 | |||
| 2397 | /*! | ||
| 2398 | * @function xpc_dictionary_get_date | ||
| 2399 | * | ||
| 2400 | * @abstract | ||
| 2401 | * Gets a date value from a dictionary directly. | ||
| 2402 | * | ||
| 2403 | * @param xdict | ||
| 2404 | * The dictionary object which is to be examined. | ||
| 2405 | * | ||
| 2406 | * @param key | ||
| 2407 | * The key whose value is to be obtained. | ||
| 2408 | * | ||
| 2409 | * @result | ||
| 2410 | * The underlying date interval for the specified key. 0 if the value for the | ||
| 2411 | * specified key is not a date value or if there is no value for the specified | ||
| 2412 | * key. | ||
| 2413 | */ | ||
| 2414 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2415 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2416 | int64_t | ||
| 2417 | xpc_dictionary_get_date(xpc_object_t xdict, const char *key); | ||
| 2418 | |||
| 2419 | /*! | ||
| 2420 | * @function xpc_dictionary_get_data | ||
| 2421 | * | ||
| 2422 | * @abstract | ||
| 2423 | * Gets a raw data value from a dictionary directly. | ||
| 2424 | * | ||
| 2425 | * @param xdict | ||
| 2426 | * The dictionary object which is to be examined. | ||
| 2427 | * | ||
| 2428 | * @param key | ||
| 2429 | * The key whose value is to be obtained. | ||
| 2430 | * | ||
| 2431 | * @param length | ||
| 2432 | * For the data type, the third parameter, upon output, will contain the length | ||
| 2433 | * of the data corresponding to the specified key. May be NULL. | ||
| 2434 | * | ||
| 2435 | * @result | ||
| 2436 | * The underlying raw data for the specified key. NULL if the value for the | ||
| 2437 | * specified key is not a data value or if there is no value for the specified | ||
| 2438 | * key. | ||
| 2439 | */ | ||
| 2440 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2441 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 | ||
| 2442 | const void * _Nullable | ||
| 2443 | xpc_dictionary_get_data(xpc_object_t xdict, const char *key, | ||
| 2444 | 	size_t * _Nullable length); | ||
| 2445 | |||
| 2446 | /*! | ||
| 2447 | * @function xpc_dictionary_get_string | ||
| 2448 | * | ||
| 2449 | * @abstract | ||
| 2450 | * Gets a C string value from a dictionary directly. | ||
| 2451 | * | ||
| 2452 | * @param xdict | ||
| 2453 | * The dictionary object which is to be examined. | ||
| 2454 | * | ||
| 2455 | * @param key | ||
| 2456 | * The key whose value is to be obtained. | ||
| 2457 | * | ||
| 2458 | * @result | ||
| 2459 | * The underlying C string for the specified key. NULL if the value for the | ||
| 2460 | * specified key is not a C string value or if there is no value for the | ||
| 2461 | * specified key. | ||
| 2462 | */ | ||
| 2463 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2464 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2465 | const char * _Nullable | ||
| 2466 | xpc_dictionary_get_string(xpc_object_t xdict, const char *key); | ||
| 2467 | |||
| 2468 | /*! | ||
| 2469 | * @function xpc_dictionary_get_uuid | ||
| 2470 | * | ||
| 2471 | * @abstract | ||
| 2472 | * Gets a uuid value from a dictionary directly. | ||
| 2473 | * | ||
| 2474 | * @param xdict | ||
| 2475 | * The dictionary object which is to be examined. | ||
| 2476 | * | ||
| 2477 | * @param key | ||
| 2478 | * The key whose value is to be obtained. | ||
| 2479 | * | ||
| 2480 | * @result | ||
| 2481 | * The underlying <code>uuid_t</code> value for the specified key. NULL is the | ||
| 2482 | * value at the specified index is not a UUID value. The returned pointer may be | ||
| 2483 | * safely passed to the uuid(3) APIs. | ||
| 2484 | */ | ||
| 2485 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2486 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2 | ||
| 2487 | const uint8_t * _Nullable | ||
| 2488 | xpc_dictionary_get_uuid(xpc_object_t xdict, const char *key); | ||
| 2489 | |||
| 2490 | /*! | ||
| 2491 | * @function xpc_dictionary_dup_fd | ||
| 2492 | * | ||
| 2493 | * @abstract | ||
| 2494 | * Creates a file descriptor from a dictionary directly. | ||
| 2495 | * | ||
| 2496 | * @param xdict | ||
| 2497 | * The dictionary object which is to be examined. | ||
| 2498 | * | ||
| 2499 | * @param key | ||
| 2500 | * The key whose value is to be obtained. | ||
| 2501 | * | ||
| 2502 | * @result | ||
| 2503 | * A new file descriptor created from the value for the specified key. You are | ||
| 2504 | * responsible for close(2)ing this descriptor. -1 if the value for the | ||
| 2505 | * specified key is not a file descriptor value or if there is no value for the | ||
| 2506 | * specified key. | ||
| 2507 | */ | ||
| 2508 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2509 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2510 | int | ||
| 2511 | xpc_dictionary_dup_fd(xpc_object_t xdict, const char *key); | ||
| 2512 | |||
| 2513 | /*! | ||
| 2514 | * @function xpc_dictionary_create_connection | ||
| 2515 | * | ||
| 2516 | * @abstract | ||
| 2517 | * Creates a connection from a dictionary directly. | ||
| 2518 | * | ||
| 2519 | * @param xdict | ||
| 2520 | * The dictionary object which is to be examined. | ||
| 2521 | * | ||
| 2522 | * @param key | ||
| 2523 | * The key whose value is to be obtained. | ||
| 2524 | * | ||
| 2525 | * @result | ||
| 2526 | * A new connection created from the value for the specified key. You are | ||
| 2527 | * responsible for calling xpc_release() on the returned connection. NULL if the | ||
| 2528 | * value for the specified key is not an endpoint containing a connection or if | ||
| 2529 | * there is no value for the specified key. Each call to this method for the | ||
| 2530 | * same key in the same dictionary will yield a different connection. See | ||
| 2531 | * {@link xpc_connection_create_from_endpoint()} for discussion as to the | ||
| 2532 | * responsibilities when dealing with the returned connection. | ||
| 2533 | */ | ||
| 2534 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2535 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2536 | xpc_connection_t _Nullable | ||
| 2537 | xpc_dictionary_create_connection(xpc_object_t xdict, const char *key); | ||
| 2538 | |||
| 2539 | /*! | ||
| 2540 | * @function xpc_dictionary_get_dictionary | ||
| 2541 | * | ||
| 2542 | * @abstract | ||
| 2543 | * Returns the dictionary value for the specified key. | ||
| 2544 | * | ||
| 2545 | * @param xdict | ||
| 2546 | * The dictionary object which is to be examined. | ||
| 2547 | * | ||
| 2548 | * @param key | ||
| 2549 | * The key whose value is to be obtained. | ||
| 2550 | * | ||
| 2551 | * @result | ||
| 2552 | * The object for the specified key within the dictionary. NULL if there is no | ||
| 2553 | * value associated with the specified key, if the given object was not an | ||
| 2554 | * XPC dictionary, or if the object for the specified key is not a dictionary. | ||
| 2555 | * | ||
| 2556 | * @discussion | ||
| 2557 | * This method does not grant the caller a reference to the underlying object, | ||
| 2558 | * and thus the caller is not responsible for releasing the object. | ||
| 2559 | */ | ||
| 2560 | __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) | ||
| 2561 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2562 | xpc_object_t _Nullable | ||
| 2563 | xpc_dictionary_get_dictionary(xpc_object_t xdict, const char *key); | ||
| 2564 | |||
| 2565 | /*! | ||
| 2566 | * @function xpc_dictionary_get_array | ||
| 2567 | * | ||
| 2568 | * @abstract | ||
| 2569 | * Returns the array value for the specified key. | ||
| 2570 | * | ||
| 2571 | * @param xdict | ||
| 2572 | * The dictionary object which is to be examined. | ||
| 2573 | * | ||
| 2574 | * @param key | ||
| 2575 | * The key whose value is to be obtained. | ||
| 2576 | * | ||
| 2577 | * @result | ||
| 2578 | * The object for the specified key within the dictionary. NULL if there is no | ||
| 2579 | * value associated with the specified key, if the given object was not an | ||
| 2580 | * XPC dictionary, or if the object for the specified key is not an array. | ||
| 2581 | * | ||
| 2582 | * @discussion | ||
| 2583 | * This method does not grant the caller a reference to the underlying object, | ||
| 2584 | * and thus the caller is not responsible for releasing the object. | ||
| 2585 | */ | ||
| 2586 | __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) | ||
| 2587 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL | ||
| 2588 | xpc_object_t _Nullable | ||
| 2589 | xpc_dictionary_get_array(xpc_object_t xdict, const char *key); | ||
| 2590 | |||
| 2591 | #pragma mark Runtime | ||
| 2592 | /*! | ||
| 2593 | * @function xpc_main | ||
| 2594 | * The springboard into the XPCService runtime. This function will set up your | ||
| 2595 | * service bundle's listener connection and manage it automatically. After this | ||
| 2596 | * initial setup, this function will, by default, call dispatch_main(). You may | ||
| 2597 | * override this behavior by setting the RunLoopType key in your XPC service | ||
| 2598 | * bundle's Info.plist under the XPCService dictionary. | ||
| 2599 | * | ||
| 2600 | * @param handler | ||
| 2601 | * The handler with which to accept new connections. | ||
| 2602 | */ | ||
| 2603 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2604 | XPC_EXPORT XPC_NORETURN XPC_NONNULL1 | ||
| 2605 | void | ||
| 2606 | xpc_main(xpc_connection_handler_t handler); | ||
| 2607 | |||
| 2608 | #pragma mark Transactions | ||
| 2609 | /*! | ||
| 2610 | * @function xpc_transaction_begin | ||
| 2611 | * Informs the XPC runtime that a transaction has begun and that the service | ||
| 2612 | * should not exit due to inactivity. | ||
| 2613 | * | ||
| 2614 | * @discussion | ||
| 2615 | * A service with no outstanding transactions may automatically exit due to | ||
| 2616 | * inactivity as determined by the system. | ||
| 2617 | * | ||
| 2618 | * This function may be used to manually manage transactions in cases where | ||
| 2619 | * their automatic management (as described below) does not meet the needs of an | ||
| 2620 | * XPC service. This function also updates the transaction count used for sudden | ||
| 2621 | * termination, i.e. vproc_transaction_begin(), and these two interfaces may be | ||
| 2622 | * used in combination. | ||
| 2623 | * | ||
| 2624 | * The XPC runtime will automatically begin a transaction on behalf of a service | ||
| 2625 | * when a new message is received. If no reply message is expected, the | ||
| 2626 | * transaction is automatically ended when the connection event handler returns. | ||
| 2627 | * If a reply message is created, the transaction will end when the reply | ||
| 2628 | * message is sent or released. An XPC service may use xpc_transaction_begin() | ||
| 2629 | * and xpc_transaction_end() to inform the XPC runtime about activity that | ||
| 2630 | * occurs outside of this common pattern. | ||
| 2631 | * | ||
| 2632 | * On macOS, when the XPC runtime has determined that the service should exit, | ||
| 2633 | * the event handlers for all active peer connections will receive | ||
| 2634 | * {@link XPC_ERROR_TERMINATION_IMMINENT} as an indication that they should | ||
| 2635 | * unwind their existing transactions. After this error is delivered to a | ||
| 2636 | * connection's event handler, no more messages will be delivered to the | ||
| 2637 | * connection. | ||
| 2638 | */ | ||
| 2639 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2640 | XPC_TRANSACTION_DEPRECATED | ||
| 2641 | XPC_EXPORT | ||
| 2642 | void | ||
| 2643 | xpc_transaction_begin(void); | ||
| 2644 | |||
| 2645 | /*! | ||
| 2646 | * @function xpc_transaction_end | ||
| 2647 | * Informs the XPC runtime that a transaction has ended. | ||
| 2648 | * | ||
| 2649 | * @discussion | ||
| 2650 | * As described in {@link xpc_transaction_begin()}, this API may be used | ||
| 2651 | * interchangeably with vproc_transaction_end(). | ||
| 2652 | * | ||
| 2653 | * See the discussion for {@link xpc_transaction_begin()} for details regarding | ||
| 2654 | * the XPC runtime's idle-exit policy. | ||
| 2655 | */ | ||
| 2656 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2657 | XPC_TRANSACTION_DEPRECATED | ||
| 2658 | XPC_EXPORT | ||
| 2659 | void | ||
| 2660 | xpc_transaction_end(void); | ||
| 2661 | |||
| 2662 | #pragma mark XPC Event Stream | ||
| 2663 | /*! | ||
| 2664 | * @function xpc_set_event_stream_handler | ||
| 2665 | * Sets the event handler to invoke when streamed events are received. | ||
| 2666 | * | ||
| 2667 | * @param stream | ||
| 2668 | * The name of the event stream for which this handler will be invoked. | ||
| 2669 | * | ||
| 2670 | * @param targetq | ||
| 2671 | * The GCD queue to which the event handler block will be submitted. This | ||
| 2672 | * parameter may be NULL, in which case the connection's target queue will be | ||
| 2673 | * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT. | ||
| 2674 | * | ||
| 2675 | * @param handler | ||
| 2676 | * The event handler block. The event which this block receives as its first | ||
| 2677 | * parameter will always be a dictionary which contains the XPC_EVENT_KEY_NAME | ||
| 2678 | * key. The value for this key will be a string whose value is the name assigned | ||
| 2679 | * to the XPC event specified in the launchd.plist. Future keys may be added to | ||
| 2680 | * this dictionary. | ||
| 2681 | * | ||
| 2682 | * @discussion | ||
| 2683 | * Multiple calls to this function for the same event stream will result in | ||
| 2684 | * undefined behavior. | ||
| 2685 | * | ||
| 2686 | * There is no API to pause delivery of XPC events. If a process that | ||
| 2687 | * has set an XPC event handler exits, events may be dropped due to races | ||
| 2688 | * between the event handler running and the process exiting. | ||
| 2689 | */ | ||
| 2690 | #if __BLOCKS__ | ||
| 2691 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) | ||
| 2692 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3 | ||
| 2693 | void | ||
| 2694 | xpc_set_event_stream_handler(const char *stream, | ||
| 2695 | 	dispatch_queue_t _Nullable targetq, xpc_handler_t handler); | ||
| 2696 | #endif // __BLOCKS__ | ||
| 2697 | |||
| 2698 | __END_DECLS | ||
| 2699 | XPC_ASSUME_NONNULL_END | ||
| 2700 | |||
| 2701 | #endif // __XPC_H__ | ||
src/Compilation.zig+1-3| ... | @@ -2147,9 +2147,7 @@ fn detectLibCIncludeDirs( | ... | @@ -2147,9 +2147,7 @@ fn detectLibCIncludeDirs( |
| 2147 | return detectLibCFromLibCInstallation(arena, target, lci); | 2147 | return detectLibCFromLibCInstallation(arena, target, lci); |
| 2148 | } | 2148 | } |
| 2149 | 2149 | ||
| 2150 | if (target_util.canBuildLibC(target)) outer: { | 2150 | if (target_util.canBuildLibC(target)) { |
| 2151 | if (is_native_os and target.isDarwin()) break :outer; // If we're on Darwin, we want to use native since we only have headers. | ||
| 2152 | |||
| 2153 | const generic_name = target_util.libCGenericName(target); | 2151 | const generic_name = target_util.libCGenericName(target); |
| 2154 | // Some architectures are handled by the same set of headers. | 2152 | // Some architectures are handled by the same set of headers. |
| 2155 | const arch_name = if (target.abi.isMusl()) target_util.archMuslName(target.cpu.arch) else @tagName(target.cpu.arch); | 2153 | const arch_name = if (target.abi.isMusl()) target_util.archMuslName(target.cpu.arch) else @tagName(target.cpu.arch); |
src/link/MachO.zig+1-1| ... | @@ -548,7 +548,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { | ... | @@ -548,7 +548,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 548 | 548 | ||
| 549 | try argv.append("-demangle"); | 549 | try argv.append("-demangle"); |
| 550 | 550 | ||
| 551 | if (self.base.options.rdynamic) { | 551 | if (self.base.options.rdynamic and !self.base.options.system_linker_hack) { |
| 552 | try argv.append("--export-dynamic"); | 552 | try argv.append("--export-dynamic"); |
| 553 | } | 553 | } |
| 554 | 554 |
src/target.zig+5-2| ... | @@ -58,8 +58,11 @@ pub const available_libcs = [_]ArchOsAbi{ | ... | @@ -58,8 +58,11 @@ pub const available_libcs = [_]ArchOsAbi{ |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | pub fn libCGenericName(target: std.Target) [:0]const u8 { | 60 | pub fn libCGenericName(target: std.Target) [:0]const u8 { |
| 61 | if (target.os.tag == .windows) | 61 | switch (target.os.tag) { |
| 62 | return "mingw"; | 62 | .windows => return "mingw", |
| 63 | .macos, .ios, .tvos, .watchos => return "darwin", | ||
| 64 | else => {}, | ||
| 65 | } | ||
| 63 | switch (target.abi) { | 66 | switch (target.abi) { |
| 64 | .gnu, | 67 | .gnu, |
| 65 | .gnuabin32, | 68 | .gnuabin32, |