authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-05 13:25:53+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-17 10:04:53+01:00
log3971522fee1303b897c51c2be01604840adcc452
tree9c6da841956e0ed8981055f7a0de11a6874f7791
parent2e7883c59726a0832c3af6581fd96bf69a0fa3a6

macos: add unfiltered aarch64 libc headers


443 files changed, 120672 insertions(+), 0 deletions(-)

lib/libc/include/aarch64-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/aarch64-macos-gnu/Availability.h created+483
......@@ -0,0 +1,483 @@
1/*
2 * Copyright (c) 2007-2016 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__
25#define __AVAILABILITY__
26 /*
27 These macros are for use in OS header files. They enable function prototypes
28 and Objective-C methods to be tagged with the OS version in which they
29 were first available; and, if applicable, the OS version in which they
30 became deprecated.
31
32 The desktop Mac OS X and iOS each have different version numbers.
33 The __OSX_AVAILABLE_STARTING() macro allows you to specify both the desktop
34 and iOS version numbers. For instance:
35 __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0)
36 means the function/method was first available on Mac OS X 10.2 on the desktop
37 and first available in iOS 2.0 on the iPhone.
38
39 If a function is available on one platform, but not the other a _NA (not
40 applicable) parameter is used. For instance:
41 __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA)
42 means that the function/method was first available on Mac OS X 10.3, and it
43 currently not implemented on the iPhone.
44
45 At some point, a function/method may be deprecated. That means Apple
46 recommends applications stop using the function, either because there is a
47 better replacement or the functionality is being phased out. Deprecated
48 functions/methods can be tagged with a __OSX_AVAILABLE_BUT_DEPRECATED()
49 macro which specifies the OS version where the function became available
50 as well as the OS version in which it became deprecated. For instance:
51 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA)
52 means that the function/method was introduced in Mac OS X 10.0, then
53 became deprecated beginning in Mac OS X 10.5. On iOS the function
54 has never been available.
55
56 For these macros to function properly, a program must specify the OS version range
57 it is targeting. The min OS version is specified as an option to the compiler:
58 -mmacosx-version-min=10.x when building for Mac OS X, and -miphoneos-version-min=y.z
59 when building for the iPhone. The upper bound for the OS version is rarely needed,
60 but it can be set on the command line via: -D__MAC_OS_X_VERSION_MAX_ALLOWED=10x0 for
61 Mac OS X and __IPHONE_OS_VERSION_MAX_ALLOWED = y0z00 for iOS.
62
63 Examples:
64
65 A function available in Mac OS X 10.5 and later, but not on the phone:
66
67 extern void mymacfunc() __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
68
69
70 An Objective-C method in Mac OS X 10.5 and later, but not on the phone:
71
72 @interface MyClass : NSObject
73 -(void) mymacmethod __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
74 @end
75
76
77 An enum available on the phone, but not available on Mac OS X:
78
79 #if __IPHONE_OS_VERSION_MIN_REQUIRED
80 enum { myEnum = 1 };
81 #endif
82 Note: this works when targeting the Mac OS X platform because
83 __IPHONE_OS_VERSION_MIN_REQUIRED is undefined which evaluates to zero.
84
85
86 An enum with values added in different iPhoneOS versions:
87
88 enum {
89 myX = 1, // Usable on iPhoneOS 2.1 and later
90 myY = 2, // Usable on iPhoneOS 3.0 and later
91 myZ = 3, // Usable on iPhoneOS 3.0 and later
92 ...
93 Note: you do not want to use #if with enumeration values
94 when a client needs to see all values at compile time
95 and use runtime logic to only use the viable values.
96
97
98 It is also possible to use the *_VERSION_MIN_REQUIRED in source code to make one
99 source base that can be compiled to target a range of OS versions. It is best
100 to not use the _MAC_* and __IPHONE_* macros for comparisons, but rather their values.
101 That is because you might get compiled on an old OS that does not define a later
102 OS version macro, and in the C preprocessor undefined values evaluate to zero
103 in expresssions, which could cause the #if expression to evaluate in an unexpected
104 way.
105
106 #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
107 // code only compiled when targeting Mac OS X and not iPhone
108 // note use of 1050 instead of __MAC_10_5
109 #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050
110 // code in here might run on pre-Leopard OS
111 #else
112 // code here can assume Leopard or later
113 #endif
114 #endif
115
116
117*/
118
119/*
120 * __API_TO_BE_DEPRECATED is used as a version number in API that will be deprecated
121 * in an upcoming release. This soft deprecation is an intermediate step before formal
122 * deprecation to notify developers about the API before compiler warnings are generated.
123 * You can find all places in your code that use soft deprecated API by redefining the
124 * value of this macro to your current minimum deployment target, for example:
125 * (macOS)
126 * clang -D__API_TO_BE_DEPRECATED=10.12 <other compiler flags>
127 * (iOS)
128 * clang -D__API_TO_BE_DEPRECATED=11.0 <other compiler flags>
129 */
130
131#ifndef __API_TO_BE_DEPRECATED
132#define __API_TO_BE_DEPRECATED 100000
133#endif
134
135#include <AvailabilityVersions.h>
136#include <AvailabilityInternal.h>
137
138#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
139 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
140 #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
141 __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep
142 #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
143 __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep##_MSG(_msg)
144
145#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
146
147 #if defined(__has_builtin)
148 #if __has_builtin(__is_target_arch)
149 #if __has_builtin(__is_target_vendor)
150 #if __has_builtin(__is_target_os)
151 #if __has_builtin(__is_target_environment)
152 #if __has_builtin(__is_target_variant_os)
153 #if __has_builtin(__is_target_variant_environment)
154 #if (__is_target_arch(x86_64) && __is_target_vendor(apple) && ((__is_target_os(ios) && __is_target_environment(macabi)) || (__is_target_variant_os(ios) && __is_target_variant_environment(macabi))))
155 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx __AVAILABILITY_INTERNAL##_ios
156 #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
157 __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep
158 #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
159 __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg) __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep##_MSG(_msg)
160 #endif /* # if __is_target_arch... */
161 #endif /* #if __has_builtin(__is_target_variant_environment) */
162 #endif /* #if __has_builtin(__is_target_variant_os) */
163 #endif /* #if __has_builtin(__is_target_environment) */
164 #endif /* #if __has_builtin(__is_target_os) */
165 #endif /* #if __has_builtin(__is_target_vendor) */
166 #endif /* #if __has_builtin(__is_target_arch) */
167 #endif /* #if defined(__has_builtin) */
168
169 #ifndef __OSX_AVAILABLE_STARTING
170 #if defined(__has_attribute) && defined(__has_feature)
171 #if __has_attribute(availability)
172 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
173 #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
174 __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep
175 #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
176 __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
177 #else
178 #define __OSX_AVAILABLE_STARTING(_osx, _ios)
179 #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
180 #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
181 #endif
182 #else
183 #define __OSX_AVAILABLE_STARTING(_osx, _ios)
184 #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
185 #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
186 #endif
187#endif /* __OSX_AVAILABLE_STARTING */
188
189#else
190 #define __OSX_AVAILABLE_STARTING(_osx, _ios)
191 #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
192 #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
193#endif
194
195
196#if defined(__has_feature)
197 #if __has_feature(attribute_availability_with_message)
198 #define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
199 #define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability,message=_msg)))
200 #elif __has_feature(attribute_availability)
201 #define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
202 #define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability)))
203 #else
204 #define __OS_AVAILABILITY(_target, _availability)
205 #define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
206 #endif
207#else
208 #define __OS_AVAILABILITY(_target, _availability)
209 #define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
210#endif
211
212
213/* for use to document app extension usage */
214#if defined(__has_feature)
215 #if __has_feature(attribute_availability_app_extension)
216 #define __OSX_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(macosx_app_extension,unavailable,_msg)
217 #define __IOS_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(ios_app_extension,unavailable,_msg)
218 #else
219 #define __OSX_EXTENSION_UNAVAILABLE(_msg)
220 #define __IOS_EXTENSION_UNAVAILABLE(_msg)
221 #endif
222#else
223 #define __OSX_EXTENSION_UNAVAILABLE(_msg)
224 #define __IOS_EXTENSION_UNAVAILABLE(_msg)
225#endif
226
227#define __OS_EXTENSION_UNAVAILABLE(_msg) __OSX_EXTENSION_UNAVAILABLE(_msg) __IOS_EXTENSION_UNAVAILABLE(_msg)
228
229
230
231/* for use marking APIs available info for Mac OSX */
232#if defined(__has_attribute)
233 #if __has_attribute(availability)
234 #define __OSX_UNAVAILABLE __OS_AVAILABILITY(macosx,unavailable)
235 #define __OSX_AVAILABLE(_vers) __OS_AVAILABILITY(macosx,introduced=_vers)
236 #define __OSX_DEPRECATED(_start, _dep, _msg) __OSX_AVAILABLE(_start) __OS_AVAILABILITY_MSG(macosx,deprecated=_dep,_msg)
237 #endif
238#endif
239
240#ifndef __OSX_UNAVAILABLE
241 #define __OSX_UNAVAILABLE
242#endif
243
244#ifndef __OSX_AVAILABLE
245 #define __OSX_AVAILABLE(_vers)
246#endif
247
248#ifndef __OSX_DEPRECATED
249 #define __OSX_DEPRECATED(_start, _dep, _msg)
250#endif
251
252
253/* for use marking APIs available info for iOS */
254#if defined(__has_attribute)
255 #if __has_attribute(availability)
256 #define __IOS_UNAVAILABLE __OS_AVAILABILITY(ios,unavailable)
257 #define __IOS_PROHIBITED __OS_AVAILABILITY(ios,unavailable)
258 #define __IOS_AVAILABLE(_vers) __OS_AVAILABILITY(ios,introduced=_vers)
259 #define __IOS_DEPRECATED(_start, _dep, _msg) __IOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(ios,deprecated=_dep,_msg)
260 #endif
261#endif
262
263#ifndef __IOS_UNAVAILABLE
264 #define __IOS_UNAVAILABLE
265#endif
266
267#ifndef __IOS_PROHIBITED
268 #define __IOS_PROHIBITED
269#endif
270
271#ifndef __IOS_AVAILABLE
272 #define __IOS_AVAILABLE(_vers)
273#endif
274
275#ifndef __IOS_DEPRECATED
276 #define __IOS_DEPRECATED(_start, _dep, _msg)
277#endif
278
279
280/* for use marking APIs available info for tvOS */
281#if defined(__has_feature)
282 #if __has_feature(attribute_availability_tvos)
283 #define __TVOS_UNAVAILABLE __OS_AVAILABILITY(tvos,unavailable)
284 #define __TVOS_PROHIBITED __OS_AVAILABILITY(tvos,unavailable)
285 #define __TVOS_AVAILABLE(_vers) __OS_AVAILABILITY(tvos,introduced=_vers)
286 #define __TVOS_DEPRECATED(_start, _dep, _msg) __TVOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(tvos,deprecated=_dep,_msg)
287 #endif
288#endif
289
290#ifndef __TVOS_UNAVAILABLE
291 #define __TVOS_UNAVAILABLE
292#endif
293
294#ifndef __TVOS_PROHIBITED
295 #define __TVOS_PROHIBITED
296#endif
297
298#ifndef __TVOS_AVAILABLE
299 #define __TVOS_AVAILABLE(_vers)
300#endif
301
302#ifndef __TVOS_DEPRECATED
303 #define __TVOS_DEPRECATED(_start, _dep, _msg)
304#endif
305
306
307/* for use marking APIs available info for Watch OS */
308#if defined(__has_feature)
309 #if __has_feature(attribute_availability_watchos)
310 #define __WATCHOS_UNAVAILABLE __OS_AVAILABILITY(watchos,unavailable)
311 #define __WATCHOS_PROHIBITED __OS_AVAILABILITY(watchos,unavailable)
312 #define __WATCHOS_AVAILABLE(_vers) __OS_AVAILABILITY(watchos,introduced=_vers)
313 #define __WATCHOS_DEPRECATED(_start, _dep, _msg) __WATCHOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(watchos,deprecated=_dep,_msg)
314 #endif
315#endif
316
317#ifndef __WATCHOS_UNAVAILABLE
318 #define __WATCHOS_UNAVAILABLE
319#endif
320
321#ifndef __WATCHOS_PROHIBITED
322 #define __WATCHOS_PROHIBITED
323#endif
324
325#ifndef __WATCHOS_AVAILABLE
326 #define __WATCHOS_AVAILABLE(_vers)
327#endif
328
329#ifndef __WATCHOS_DEPRECATED
330 #define __WATCHOS_DEPRECATED(_start, _dep, _msg)
331#endif
332
333
334/* for use marking APIs unavailable for swift */
335#if defined(__has_feature)
336 #if __has_feature(attribute_availability_swift)
337 #define __SWIFT_UNAVAILABLE __OS_AVAILABILITY(swift,unavailable)
338 #define __SWIFT_UNAVAILABLE_MSG(_msg) __OS_AVAILABILITY_MSG(swift,unavailable,_msg)
339 #endif
340#endif
341
342#ifndef __SWIFT_UNAVAILABLE
343 #define __SWIFT_UNAVAILABLE
344#endif
345
346#ifndef __SWIFT_UNAVAILABLE_MSG
347 #define __SWIFT_UNAVAILABLE_MSG(_msg)
348#endif
349
350/*
351 Macros for defining which versions/platform a given symbol can be used.
352
353 @see http://clang.llvm.org/docs/AttributeReference.html#availability
354
355 * Note that these macros are only compatible with clang compilers that
356 * support the following target selection options:
357 *
358 * -mmacosx-version-min
359 * -miphoneos-version-min
360 * -mwatchos-version-min
361 * -mtvos-version-min
362 */
363
364#if defined(__has_feature) && defined(__has_attribute)
365 #if __has_attribute(availability)
366
367 /*
368 * API Introductions
369 *
370 * Use to specify the release that a particular API became available.
371 *
372 * Platform names:
373 * macos, ios, tvos, watchos
374 *
375 * Examples:
376 * __API_AVAILABLE(macos(10.10))
377 * __API_AVAILABLE(macos(10.9), ios(10.0))
378 * __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
379 * __API_AVAILABLE(driverkit(19.0))
380 */
381 #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__)
382
383 #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__)
384 #define __API_AVAILABLE_END _Pragma("clang attribute pop")
385
386 /*
387 * API Deprecations
388 *
389 * Use to specify the release that a particular API became unavailable.
390 *
391 * Platform names:
392 * macos, ios, tvos, watchos
393 *
394 * Examples:
395 *
396 * __API_DEPRECATED("No longer supported", macos(10.4, 10.8))
397 * __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))
398 *
399 * __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
400 * __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
401 */
402 #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__)
403 #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__)
404
405 #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__)
406 #define __API_DEPRECATED_END _Pragma("clang attribute pop")
407
408 #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__)
409 #define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
410
411 /*
412 * API Unavailability
413 * Use to specify that an API is unavailable for a particular platform.
414 *
415 * Example:
416 * __API_UNAVAILABLE(macos)
417 * __API_UNAVAILABLE(watchos, tvos)
418 */
419 #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__)
420
421 #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__)
422 #define __API_UNAVAILABLE_END _Pragma("clang attribute pop")
423 #else
424
425 /*
426 * Evaluate to nothing for compilers that don't support availability.
427 */
428
429 #define __API_AVAILABLE(...)
430 #define __API_AVAILABLE_BEGIN(...)
431 #define __API_AVAILABLE_END
432 #define __API_DEPRECATED(...)
433 #define __API_DEPRECATED_WITH_REPLACEMENT(...)
434 #define __API_DEPRECATED_BEGIN(...)
435 #define __API_DEPRECATED_END
436 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
437 #define __API_DEPRECATED_WITH_REPLACEMENT_END
438 #define __API_UNAVAILABLE(...)
439 #define __API_UNAVAILABLE_BEGIN(...)
440 #define __API_UNAVAILABLE_END
441 #endif /* __has_attribute(availability) */
442#else
443
444 /*
445 * Evaluate to nothing for compilers that don't support clang language extensions.
446 */
447
448 #define __API_AVAILABLE(...)
449 #define __API_AVAILABLE_BEGIN(...)
450 #define __API_AVAILABLE_END
451 #define __API_DEPRECATED(...)
452 #define __API_DEPRECATED_WITH_REPLACEMENT(...)
453 #define __API_DEPRECATED_BEGIN(...)
454 #define __API_DEPRECATED_END
455 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
456 #define __API_DEPRECATED_WITH_REPLACEMENT_END
457 #define __API_UNAVAILABLE(...)
458 #define __API_UNAVAILABLE_BEGIN(...)
459 #define __API_UNAVAILABLE_END
460#endif /* #if defined(__has_feature) && defined(__has_attribute) */
461
462#if __has_include(<AvailabilityProhibitedInternal.h>)
463 #include <AvailabilityProhibitedInternal.h>
464#endif
465
466/*
467 * If SPI decorations have not been defined elsewhere, disable them.
468 */
469
470#ifndef __SPI_AVAILABLE
471 #define __SPI_AVAILABLE(...)
472#endif
473
474#ifndef __SPI_DEPRECATED
475 #define __SPI_DEPRECATED(...)
476#endif
477
478#ifndef __SPI_DEPRECATED_WITH_REPLACEMENT
479 #define __SPI_DEPRECATED_WITH_REPLACEMENT(...)
480#endif
481
482#endif /* __AVAILABILITY__ */
483
lib/libc/include/aarch64-macos-gnu/AvailabilityInternal.h created+4675
......@@ -0,0 +1,4675 @@
1/*
2 * Copyright (c) 2007-2016 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: AvailabilityInternal.h
26
27 Contains: implementation details of __OSX_AVAILABLE_* macros from <Availability.h>
28
29*/
30#ifndef __AVAILABILITY_INTERNAL__
31#define __AVAILABILITY_INTERNAL__
32
33#if __has_include(<AvailabilityInternalPrivate.h>)
34 #include <AvailabilityInternalPrivate.h>
35#endif
36
37#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
38 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
39 /* compiler for Mac OS X sets __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ */
40 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
41 #endif
42#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED*/
43
44#ifndef __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 */
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
51 #endif
52#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
53
54#ifndef __TV_OS_VERSION_MIN_REQUIRED
55 #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
56 /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */
57 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
58 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_14_2
59 /* for compatibility with existing code. New code should use platform specific checks */
60 #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
61 #endif
62#endif
63
64#ifndef __WATCH_OS_VERSION_MIN_REQUIRED
65 #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
66 /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */
67 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
68 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_7_1
69 /* for compatibility with existing code. New code should use platform specific checks */
70 #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
71 #endif
72#endif
73
74#ifndef __BRIDGE_OS_VERSION_MIN_REQUIRED
75 #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__
76
77 #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__
78 #define __BRIDGE_OS_VERSION_MAX_ALLOWED 50000
79 /* for compatibility with existing code. New code should use platform specific checks */
80 #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000
81 #endif
82#endif
83
84#ifndef __DRIVERKIT_VERSION_MIN_REQUIRED
85 #ifdef __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__
86 #define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__
87 #endif
88#endif
89
90#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
91 /* make sure a default max version is set */
92 #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED
93 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_11_0
94 #endif
95#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
96
97#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
98 /* make sure a default max version is set */
99 #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
100 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_14_2
101 #endif
102 /* make sure a valid min is set */
103 #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
104 #undef __IPHONE_OS_VERSION_MIN_REQUIRED
105 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_2_0
106 #endif
107#endif
108
109#define __AVAILABILITY_INTERNAL_DEPRECATED __attribute__((deprecated))
110#ifdef __has_feature
111 #if __has_feature(attribute_deprecated_with_message)
112 #define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
113 #else
114 #define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated))
115 #endif
116#elif defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))
117 #define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
118#else
119 #define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated))
120#endif
121#define __AVAILABILITY_INTERNAL_UNAVAILABLE __attribute__((unavailable))
122#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
123#define __AVAILABILITY_INTERNAL_REGULAR
124
125#if defined(__has_builtin)
126 #if __has_builtin(__is_target_arch)
127 #if __has_builtin(__is_target_vendor)
128 #if __has_builtin(__is_target_os)
129 #if __has_builtin(__is_target_environment)
130 #if __has_builtin(__is_target_variant_os)
131 #if __has_builtin(__is_target_variant_environment)
132 #if (__is_target_arch(x86_64) && __is_target_vendor(apple) && ((__is_target_os(ios) && __is_target_environment(macabi)) || (__is_target_variant_os(ios) && __is_target_variant_environment(macabi))))
133 #define __ENABLE_LEGACY_IPHONE_AVAILABILITY 1
134 #define __ENABLE_LEGACY_MAC_AVAILABILITY 1
135 #endif /* # if __is_target_arch... */
136 #endif /* #if __has_builtin(__is_target_variant_environment) */
137 #endif /* #if __has_builtin(__is_target_variant_os) */
138 #endif /* #if __has_builtin(__is_target_environment) */
139 #endif /* #if __has_builtin(__is_target_os) */
140 #endif /* #if __has_builtin(__is_target_vendor) */
141 #endif /* #if __has_builtin(__is_target_arch) */
142#endif /* #if defined(__has_builtin) */
143
144#ifndef __ENABLE_LEGACY_IPHONE_AVAILABILITY
145 #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
146 #define __ENABLE_LEGACY_IPHONE_AVAILABILITY 1
147 #elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
148 #define __ENABLE_LEGACY_MAC_AVAILABILITY 1
149 #endif
150#endif /* __ENABLE_LEGACY_IPHONE_AVAILABILITY */
151
152#ifdef __ENABLE_LEGACY_IPHONE_AVAILABILITY
153 #if defined(__has_attribute) && defined(__has_feature)
154 #if __has_attribute(availability)
155 /* use better attributes if possible */
156 #define __AVAILABILITY_INTERNAL__IPHONE_2_0 __attribute__((availability(ios,introduced=2.0)))
157 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=2.0,deprecated=10.0)))
158 #if __has_feature(attribute_availability_with_message)
159 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.0,message=_msg)))
160 #else
161 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.0)))
162 #endif
163 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=2.0,deprecated=10.1)))
164 #if __has_feature(attribute_availability_with_message)
165 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.1,message=_msg)))
166 #else
167 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.1)))
168 #endif
169 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=2.0,deprecated=10.2)))
170 #if __has_feature(attribute_availability_with_message)
171 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.2,message=_msg)))
172 #else
173 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.2)))
174 #endif
175 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=2.0,deprecated=10.3)))
176 #if __has_feature(attribute_availability_with_message)
177 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.3,message=_msg)))
178 #else
179 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=10.3)))
180 #endif
181 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_11_0 __attribute__((availability(ios,introduced=2.0,deprecated=11.0)))
182 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_0 __attribute__((availability(ios,introduced=2.0,deprecated=2.0)))
183 #if __has_feature(attribute_availability_with_message)
184 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=2.0,message=_msg)))
185 #else
186 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=2.0)))
187 #endif
188 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1 __attribute__((availability(ios,introduced=2.0,deprecated=2.1)))
189 #if __has_feature(attribute_availability_with_message)
190 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=2.1,message=_msg)))
191 #else
192 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=2.1)))
193 #endif
194 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 __attribute__((availability(ios,introduced=2.0,deprecated=2.2)))
195 #if __has_feature(attribute_availability_with_message)
196 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=2.2,message=_msg)))
197 #else
198 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=2.2)))
199 #endif
200 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 __attribute__((availability(ios,introduced=2.0,deprecated=3.0)))
201 #if __has_feature(attribute_availability_with_message)
202 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=3.0,message=_msg)))
203 #else
204 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=3.0)))
205 #endif
206 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 __attribute__((availability(ios,introduced=2.0,deprecated=3.1)))
207 #if __has_feature(attribute_availability_with_message)
208 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=3.1,message=_msg)))
209 #else
210 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=3.1)))
211 #endif
212 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 __attribute__((availability(ios,introduced=2.0,deprecated=3.2)))
213 #if __has_feature(attribute_availability_with_message)
214 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=3.2,message=_msg)))
215 #else
216 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=3.2)))
217 #endif
218 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=2.0,deprecated=4.0)))
219 #if __has_feature(attribute_availability_with_message)
220 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.0,message=_msg)))
221 #else
222 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.0)))
223 #endif
224 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=2.0,deprecated=4.1)))
225 #if __has_feature(attribute_availability_with_message)
226 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.1,message=_msg)))
227 #else
228 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.1)))
229 #endif
230 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=2.0,deprecated=4.2)))
231 #if __has_feature(attribute_availability_with_message)
232 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.2,message=_msg)))
233 #else
234 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.2)))
235 #endif
236 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=2.0,deprecated=4.3)))
237 #if __has_feature(attribute_availability_with_message)
238 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.3,message=_msg)))
239 #else
240 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=4.3)))
241 #endif
242 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=2.0,deprecated=5.0)))
243 #if __has_feature(attribute_availability_with_message)
244 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=5.0,message=_msg)))
245 #else
246 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=5.0)))
247 #endif
248 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=2.0,deprecated=5.1)))
249 #if __has_feature(attribute_availability_with_message)
250 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=5.1,message=_msg)))
251 #else
252 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=5.1)))
253 #endif
254 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=2.0,deprecated=6.0)))
255 #if __has_feature(attribute_availability_with_message)
256 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=6.0,message=_msg)))
257 #else
258 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=6.0)))
259 #endif
260 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=2.0,deprecated=6.1)))
261 #if __has_feature(attribute_availability_with_message)
262 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=6.1,message=_msg)))
263 #else
264 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=6.1)))
265 #endif
266 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=2.0,deprecated=7.0)))
267 #if __has_feature(attribute_availability_with_message)
268 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=7.0,message=_msg)))
269 #else
270 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=7.0)))
271 #endif
272 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=2.0,deprecated=7.1)))
273 #if __has_feature(attribute_availability_with_message)
274 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=7.1,message=_msg)))
275 #else
276 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=7.1)))
277 #endif
278 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=2.0,deprecated=8.0)))
279 #if __has_feature(attribute_availability_with_message)
280 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.0,message=_msg)))
281 #else
282 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.0)))
283 #endif
284 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=2.0,deprecated=8.1)))
285 #if __has_feature(attribute_availability_with_message)
286 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.1,message=_msg)))
287 #else
288 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.1)))
289 #endif
290 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=2.0,deprecated=8.2)))
291 #if __has_feature(attribute_availability_with_message)
292 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.2,message=_msg)))
293 #else
294 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.2)))
295 #endif
296 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=2.0,deprecated=8.3)))
297 #if __has_feature(attribute_availability_with_message)
298 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.3,message=_msg)))
299 #else
300 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.3)))
301 #endif
302 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=2.0,deprecated=8.4)))
303 #if __has_feature(attribute_availability_with_message)
304 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.4,message=_msg)))
305 #else
306 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=8.4)))
307 #endif
308 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=2.0,deprecated=9.0)))
309 #if __has_feature(attribute_availability_with_message)
310 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.0,message=_msg)))
311 #else
312 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.0)))
313 #endif
314 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=2.0,deprecated=9.1)))
315 #if __has_feature(attribute_availability_with_message)
316 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.1,message=_msg)))
317 #else
318 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.1)))
319 #endif
320 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=2.0,deprecated=9.2)))
321 #if __has_feature(attribute_availability_with_message)
322 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.2,message=_msg)))
323 #else
324 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.2)))
325 #endif
326 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=2.0,deprecated=9.3)))
327 #if __has_feature(attribute_availability_with_message)
328 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.3,message=_msg)))
329 #else
330 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=2.0,deprecated=9.3)))
331 #endif
332 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=2.0)))
333 #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=2.0)))
334 #define __AVAILABILITY_INTERNAL__IPHONE_2_1 __attribute__((availability(ios,introduced=2.1)))
335 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=2.1,deprecated=10.0)))
336 #if __has_feature(attribute_availability_with_message)
337 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.0,message=_msg)))
338 #else
339 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.0)))
340 #endif
341 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=2.1,deprecated=10.1)))
342 #if __has_feature(attribute_availability_with_message)
343 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.1,message=_msg)))
344 #else
345 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.1)))
346 #endif
347 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=2.1,deprecated=10.2)))
348 #if __has_feature(attribute_availability_with_message)
349 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.2,message=_msg)))
350 #else
351 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.2)))
352 #endif
353 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=2.1,deprecated=10.3)))
354 #if __has_feature(attribute_availability_with_message)
355 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.3,message=_msg)))
356 #else
357 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=10.3)))
358 #endif
359 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1 __attribute__((availability(ios,introduced=2.1,deprecated=2.1)))
360 #if __has_feature(attribute_availability_with_message)
361 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=2.1,message=_msg)))
362 #else
363 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=2.1)))
364 #endif
365 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 __attribute__((availability(ios,introduced=2.1,deprecated=2.2)))
366 #if __has_feature(attribute_availability_with_message)
367 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=2.2,message=_msg)))
368 #else
369 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=2.2)))
370 #endif
371 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 __attribute__((availability(ios,introduced=2.1,deprecated=3.0)))
372 #if __has_feature(attribute_availability_with_message)
373 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=3.0,message=_msg)))
374 #else
375 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=3.0)))
376 #endif
377 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 __attribute__((availability(ios,introduced=2.1,deprecated=3.1)))
378 #if __has_feature(attribute_availability_with_message)
379 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=3.1,message=_msg)))
380 #else
381 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=3.1)))
382 #endif
383 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 __attribute__((availability(ios,introduced=2.1,deprecated=3.2)))
384 #if __has_feature(attribute_availability_with_message)
385 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=3.2,message=_msg)))
386 #else
387 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=3.2)))
388 #endif
389 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=2.1,deprecated=4.0)))
390 #if __has_feature(attribute_availability_with_message)
391 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.0,message=_msg)))
392 #else
393 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.0)))
394 #endif
395 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=2.1,deprecated=4.1)))
396 #if __has_feature(attribute_availability_with_message)
397 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.1,message=_msg)))
398 #else
399 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.1)))
400 #endif
401 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=2.1,deprecated=4.2)))
402 #if __has_feature(attribute_availability_with_message)
403 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.2,message=_msg)))
404 #else
405 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.2)))
406 #endif
407 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=2.1,deprecated=4.3)))
408 #if __has_feature(attribute_availability_with_message)
409 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.3,message=_msg)))
410 #else
411 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=4.3)))
412 #endif
413 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=2.1,deprecated=5.0)))
414 #if __has_feature(attribute_availability_with_message)
415 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=5.0,message=_msg)))
416 #else
417 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=5.0)))
418 #endif
419 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=2.1,deprecated=5.1)))
420 #if __has_feature(attribute_availability_with_message)
421 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=5.1,message=_msg)))
422 #else
423 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=5.1)))
424 #endif
425 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=2.1,deprecated=6.0)))
426 #if __has_feature(attribute_availability_with_message)
427 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=6.0,message=_msg)))
428 #else
429 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=6.0)))
430 #endif
431 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=2.1,deprecated=6.1)))
432 #if __has_feature(attribute_availability_with_message)
433 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=6.1,message=_msg)))
434 #else
435 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=6.1)))
436 #endif
437 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=2.1,deprecated=7.0)))
438 #if __has_feature(attribute_availability_with_message)
439 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=7.0,message=_msg)))
440 #else
441 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=7.0)))
442 #endif
443 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=2.1,deprecated=7.1)))
444 #if __has_feature(attribute_availability_with_message)
445 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=7.1,message=_msg)))
446 #else
447 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=7.1)))
448 #endif
449 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=2.1,deprecated=8.0)))
450 #if __has_feature(attribute_availability_with_message)
451 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.0,message=_msg)))
452 #else
453 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.0)))
454 #endif
455 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=2.1,deprecated=8.1)))
456 #if __has_feature(attribute_availability_with_message)
457 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.1,message=_msg)))
458 #else
459 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.1)))
460 #endif
461 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=2.1,deprecated=8.2)))
462 #if __has_feature(attribute_availability_with_message)
463 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.2,message=_msg)))
464 #else
465 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.2)))
466 #endif
467 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=2.1,deprecated=8.3)))
468 #if __has_feature(attribute_availability_with_message)
469 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.3,message=_msg)))
470 #else
471 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.3)))
472 #endif
473 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=2.1,deprecated=8.4)))
474 #if __has_feature(attribute_availability_with_message)
475 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.4,message=_msg)))
476 #else
477 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=8.4)))
478 #endif
479 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=2.1,deprecated=9.0)))
480 #if __has_feature(attribute_availability_with_message)
481 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.0,message=_msg)))
482 #else
483 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.0)))
484 #endif
485 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=2.1,deprecated=9.1)))
486 #if __has_feature(attribute_availability_with_message)
487 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.1,message=_msg)))
488 #else
489 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.1)))
490 #endif
491 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=2.1,deprecated=9.2)))
492 #if __has_feature(attribute_availability_with_message)
493 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.2,message=_msg)))
494 #else
495 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.2)))
496 #endif
497 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=2.1,deprecated=9.3)))
498 #if __has_feature(attribute_availability_with_message)
499 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.3,message=_msg)))
500 #else
501 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=2.1,deprecated=9.3)))
502 #endif
503 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=2.1)))
504 #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=2.1)))
505 #define __AVAILABILITY_INTERNAL__IPHONE_2_2 __attribute__((availability(ios,introduced=2.2)))
506 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=2.2,deprecated=10.0)))
507 #if __has_feature(attribute_availability_with_message)
508 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.0,message=_msg)))
509 #else
510 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.0)))
511 #endif
512 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=2.2,deprecated=10.1)))
513 #if __has_feature(attribute_availability_with_message)
514 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.1,message=_msg)))
515 #else
516 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.1)))
517 #endif
518 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=2.2,deprecated=10.2)))
519 #if __has_feature(attribute_availability_with_message)
520 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.2,message=_msg)))
521 #else
522 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.2)))
523 #endif
524 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=2.2,deprecated=10.3)))
525 #if __has_feature(attribute_availability_with_message)
526 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.3,message=_msg)))
527 #else
528 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=10.3)))
529 #endif
530 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __attribute__((availability(ios,introduced=2.2,deprecated=2.2)))
531 #if __has_feature(attribute_availability_with_message)
532 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=2.2,message=_msg)))
533 #else
534 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=2.2)))
535 #endif
536 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __attribute__((availability(ios,introduced=2.2,deprecated=3.0)))
537 #if __has_feature(attribute_availability_with_message)
538 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=3.0,message=_msg)))
539 #else
540 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=3.0)))
541 #endif
542 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __attribute__((availability(ios,introduced=2.2,deprecated=3.1)))
543 #if __has_feature(attribute_availability_with_message)
544 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=3.1,message=_msg)))
545 #else
546 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=3.1)))
547 #endif
548 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __attribute__((availability(ios,introduced=2.2,deprecated=3.2)))
549 #if __has_feature(attribute_availability_with_message)
550 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=3.2,message=_msg)))
551 #else
552 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=3.2)))
553 #endif
554 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=2.2,deprecated=4.0)))
555 #if __has_feature(attribute_availability_with_message)
556 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.0,message=_msg)))
557 #else
558 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.0)))
559 #endif
560 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=2.2,deprecated=4.1)))
561 #if __has_feature(attribute_availability_with_message)
562 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.1,message=_msg)))
563 #else
564 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.1)))
565 #endif
566 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=2.2,deprecated=4.2)))
567 #if __has_feature(attribute_availability_with_message)
568 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.2,message=_msg)))
569 #else
570 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.2)))
571 #endif
572 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=2.2,deprecated=4.3)))
573 #if __has_feature(attribute_availability_with_message)
574 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.3,message=_msg)))
575 #else
576 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=4.3)))
577 #endif
578 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=2.2,deprecated=5.0)))
579 #if __has_feature(attribute_availability_with_message)
580 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=5.0,message=_msg)))
581 #else
582 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=5.0)))
583 #endif
584 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=2.2,deprecated=5.1)))
585 #if __has_feature(attribute_availability_with_message)
586 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=5.1,message=_msg)))
587 #else
588 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=5.1)))
589 #endif
590 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=2.2,deprecated=6.0)))
591 #if __has_feature(attribute_availability_with_message)
592 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=6.0,message=_msg)))
593 #else
594 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=6.0)))
595 #endif
596 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=2.2,deprecated=6.1)))
597 #if __has_feature(attribute_availability_with_message)
598 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=6.1,message=_msg)))
599 #else
600 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=6.1)))
601 #endif
602 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=2.2,deprecated=7.0)))
603 #if __has_feature(attribute_availability_with_message)
604 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=7.0,message=_msg)))
605 #else
606 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=7.0)))
607 #endif
608 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=2.2,deprecated=7.1)))
609 #if __has_feature(attribute_availability_with_message)
610 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=7.1,message=_msg)))
611 #else
612 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=7.1)))
613 #endif
614 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=2.2,deprecated=8.0)))
615 #if __has_feature(attribute_availability_with_message)
616 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.0,message=_msg)))
617 #else
618 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.0)))
619 #endif
620 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=2.2,deprecated=8.1)))
621 #if __has_feature(attribute_availability_with_message)
622 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.1,message=_msg)))
623 #else
624 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.1)))
625 #endif
626 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=2.2,deprecated=8.2)))
627 #if __has_feature(attribute_availability_with_message)
628 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.2,message=_msg)))
629 #else
630 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.2)))
631 #endif
632 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=2.2,deprecated=8.3)))
633 #if __has_feature(attribute_availability_with_message)
634 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.3,message=_msg)))
635 #else
636 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.3)))
637 #endif
638 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=2.2,deprecated=8.4)))
639 #if __has_feature(attribute_availability_with_message)
640 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.4,message=_msg)))
641 #else
642 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=8.4)))
643 #endif
644 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=2.2,deprecated=9.0)))
645 #if __has_feature(attribute_availability_with_message)
646 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.0,message=_msg)))
647 #else
648 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.0)))
649 #endif
650 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=2.2,deprecated=9.1)))
651 #if __has_feature(attribute_availability_with_message)
652 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.1,message=_msg)))
653 #else
654 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.1)))
655 #endif
656 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=2.2,deprecated=9.2)))
657 #if __has_feature(attribute_availability_with_message)
658 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.2,message=_msg)))
659 #else
660 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.2)))
661 #endif
662 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=2.2,deprecated=9.3)))
663 #if __has_feature(attribute_availability_with_message)
664 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.3,message=_msg)))
665 #else
666 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=2.2,deprecated=9.3)))
667 #endif
668 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_NA __attribute__((availability(ios,introduced=2.2)))
669 #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=2.2)))
670 #define __AVAILABILITY_INTERNAL__IPHONE_3_0 __attribute__((availability(ios,introduced=3.0)))
671 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=3.0,deprecated=10.0)))
672 #if __has_feature(attribute_availability_with_message)
673 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.0,message=_msg)))
674 #else
675 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.0)))
676 #endif
677 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=3.0,deprecated=10.1)))
678 #if __has_feature(attribute_availability_with_message)
679 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.1,message=_msg)))
680 #else
681 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.1)))
682 #endif
683 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=3.0,deprecated=10.2)))
684 #if __has_feature(attribute_availability_with_message)
685 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.2,message=_msg)))
686 #else
687 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.2)))
688 #endif
689 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=3.0,deprecated=10.3)))
690 #if __has_feature(attribute_availability_with_message)
691 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.3,message=_msg)))
692 #else
693 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=10.3)))
694 #endif
695 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __attribute__((availability(ios,introduced=3.0,deprecated=3.0)))
696 #if __has_feature(attribute_availability_with_message)
697 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=3.0,message=_msg)))
698 #else
699 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=3.0)))
700 #endif
701 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __attribute__((availability(ios,introduced=3.0,deprecated=3.1)))
702 #if __has_feature(attribute_availability_with_message)
703 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=3.1,message=_msg)))
704 #else
705 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=3.1)))
706 #endif
707 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __attribute__((availability(ios,introduced=3.0,deprecated=3.2)))
708 #if __has_feature(attribute_availability_with_message)
709 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=3.2,message=_msg)))
710 #else
711 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=3.2)))
712 #endif
713 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=3.0,deprecated=4.0)))
714 #if __has_feature(attribute_availability_with_message)
715 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.0,message=_msg)))
716 #else
717 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.0)))
718 #endif
719 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=3.0,deprecated=4.1)))
720 #if __has_feature(attribute_availability_with_message)
721 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.1,message=_msg)))
722 #else
723 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.1)))
724 #endif
725 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=3.0,deprecated=4.2)))
726 #if __has_feature(attribute_availability_with_message)
727 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.2,message=_msg)))
728 #else
729 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.2)))
730 #endif
731 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=3.0,deprecated=4.3)))
732 #if __has_feature(attribute_availability_with_message)
733 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.3,message=_msg)))
734 #else
735 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=4.3)))
736 #endif
737 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=3.0,deprecated=5.0)))
738 #if __has_feature(attribute_availability_with_message)
739 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=5.0,message=_msg)))
740 #else
741 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=5.0)))
742 #endif
743 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=3.0,deprecated=5.1)))
744 #if __has_feature(attribute_availability_with_message)
745 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=5.1,message=_msg)))
746 #else
747 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=5.1)))
748 #endif
749 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=3.0,deprecated=6.0)))
750 #if __has_feature(attribute_availability_with_message)
751 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=6.0,message=_msg)))
752 #else
753 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=6.0)))
754 #endif
755 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=3.0,deprecated=6.1)))
756 #if __has_feature(attribute_availability_with_message)
757 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=6.1,message=_msg)))
758 #else
759 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=6.1)))
760 #endif
761 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=3.0,deprecated=7.0)))
762 #if __has_feature(attribute_availability_with_message)
763 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=7.0,message=_msg)))
764 #else
765 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=7.0)))
766 #endif
767 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=3.0,deprecated=7.1)))
768 #if __has_feature(attribute_availability_with_message)
769 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=7.1,message=_msg)))
770 #else
771 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=7.1)))
772 #endif
773 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=3.0,deprecated=8.0)))
774 #if __has_feature(attribute_availability_with_message)
775 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.0,message=_msg)))
776 #else
777 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.0)))
778 #endif
779 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=3.0,deprecated=8.1)))
780 #if __has_feature(attribute_availability_with_message)
781 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.1,message=_msg)))
782 #else
783 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.1)))
784 #endif
785 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=3.0,deprecated=8.2)))
786 #if __has_feature(attribute_availability_with_message)
787 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.2,message=_msg)))
788 #else
789 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.2)))
790 #endif
791 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=3.0,deprecated=8.3)))
792 #if __has_feature(attribute_availability_with_message)
793 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.3,message=_msg)))
794 #else
795 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.3)))
796 #endif
797 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=3.0,deprecated=8.4)))
798 #if __has_feature(attribute_availability_with_message)
799 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.4,message=_msg)))
800 #else
801 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=8.4)))
802 #endif
803 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=3.0,deprecated=9.0)))
804 #if __has_feature(attribute_availability_with_message)
805 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.0,message=_msg)))
806 #else
807 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.0)))
808 #endif
809 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=3.0,deprecated=9.1)))
810 #if __has_feature(attribute_availability_with_message)
811 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.1,message=_msg)))
812 #else
813 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.1)))
814 #endif
815 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=3.0,deprecated=9.2)))
816 #if __has_feature(attribute_availability_with_message)
817 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.2,message=_msg)))
818 #else
819 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.2)))
820 #endif
821 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=3.0,deprecated=9.3)))
822 #if __has_feature(attribute_availability_with_message)
823 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.3,message=_msg)))
824 #else
825 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=3.0,deprecated=9.3)))
826 #endif
827 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=3.0)))
828 #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=3.0)))
829 #define __AVAILABILITY_INTERNAL__IPHONE_3_1 __attribute__((availability(ios,introduced=3.1)))
830 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=3.1,deprecated=10.0)))
831 #if __has_feature(attribute_availability_with_message)
832 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.0,message=_msg)))
833 #else
834 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.0)))
835 #endif
836 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=3.1,deprecated=10.1)))
837 #if __has_feature(attribute_availability_with_message)
838 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.1,message=_msg)))
839 #else
840 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.1)))
841 #endif
842 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=3.1,deprecated=10.2)))
843 #if __has_feature(attribute_availability_with_message)
844 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.2,message=_msg)))
845 #else
846 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.2)))
847 #endif
848 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=3.1,deprecated=10.3)))
849 #if __has_feature(attribute_availability_with_message)
850 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.3,message=_msg)))
851 #else
852 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=10.3)))
853 #endif
854 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __attribute__((availability(ios,introduced=3.1,deprecated=3.1)))
855 #if __has_feature(attribute_availability_with_message)
856 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=3.1,message=_msg)))
857 #else
858 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=3.1)))
859 #endif
860 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __attribute__((availability(ios,introduced=3.1,deprecated=3.2)))
861 #if __has_feature(attribute_availability_with_message)
862 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=3.2,message=_msg)))
863 #else
864 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=3.2)))
865 #endif
866 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=3.1,deprecated=4.0)))
867 #if __has_feature(attribute_availability_with_message)
868 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.0,message=_msg)))
869 #else
870 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.0)))
871 #endif
872 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=3.1,deprecated=4.1)))
873 #if __has_feature(attribute_availability_with_message)
874 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.1,message=_msg)))
875 #else
876 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.1)))
877 #endif
878 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=3.1,deprecated=4.2)))
879 #if __has_feature(attribute_availability_with_message)
880 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.2,message=_msg)))
881 #else
882 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.2)))
883 #endif
884 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=3.1,deprecated=4.3)))
885 #if __has_feature(attribute_availability_with_message)
886 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.3,message=_msg)))
887 #else
888 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=4.3)))
889 #endif
890 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=3.1,deprecated=5.0)))
891 #if __has_feature(attribute_availability_with_message)
892 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=5.0,message=_msg)))
893 #else
894 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=5.0)))
895 #endif
896 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=3.1,deprecated=5.1)))
897 #if __has_feature(attribute_availability_with_message)
898 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=5.1,message=_msg)))
899 #else
900 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=5.1)))
901 #endif
902 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=3.1,deprecated=6.0)))
903 #if __has_feature(attribute_availability_with_message)
904 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=6.0,message=_msg)))
905 #else
906 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=6.0)))
907 #endif
908 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=3.1,deprecated=6.1)))
909 #if __has_feature(attribute_availability_with_message)
910 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=6.1,message=_msg)))
911 #else
912 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=6.1)))
913 #endif
914 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=3.1,deprecated=7.0)))
915 #if __has_feature(attribute_availability_with_message)
916 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=7.0,message=_msg)))
917 #else
918 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=7.0)))
919 #endif
920 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=3.1,deprecated=7.1)))
921 #if __has_feature(attribute_availability_with_message)
922 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=7.1,message=_msg)))
923 #else
924 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=7.1)))
925 #endif
926 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=3.1,deprecated=8.0)))
927 #if __has_feature(attribute_availability_with_message)
928 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.0,message=_msg)))
929 #else
930 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.0)))
931 #endif
932 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=3.1,deprecated=8.1)))
933 #if __has_feature(attribute_availability_with_message)
934 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.1,message=_msg)))
935 #else
936 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.1)))
937 #endif
938 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=3.1,deprecated=8.2)))
939 #if __has_feature(attribute_availability_with_message)
940 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.2,message=_msg)))
941 #else
942 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.2)))
943 #endif
944 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=3.1,deprecated=8.3)))
945 #if __has_feature(attribute_availability_with_message)
946 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.3,message=_msg)))
947 #else
948 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.3)))
949 #endif
950 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=3.1,deprecated=8.4)))
951 #if __has_feature(attribute_availability_with_message)
952 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.4,message=_msg)))
953 #else
954 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=8.4)))
955 #endif
956 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=3.1,deprecated=9.0)))
957 #if __has_feature(attribute_availability_with_message)
958 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.0,message=_msg)))
959 #else
960 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.0)))
961 #endif
962 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=3.1,deprecated=9.1)))
963 #if __has_feature(attribute_availability_with_message)
964 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.1,message=_msg)))
965 #else
966 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.1)))
967 #endif
968 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=3.1,deprecated=9.2)))
969 #if __has_feature(attribute_availability_with_message)
970 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.2,message=_msg)))
971 #else
972 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.2)))
973 #endif
974 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=3.1,deprecated=9.3)))
975 #if __has_feature(attribute_availability_with_message)
976 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.3,message=_msg)))
977 #else
978 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=3.1,deprecated=9.3)))
979 #endif
980 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=3.1)))
981 #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=3.1)))
982 #define __AVAILABILITY_INTERNAL__IPHONE_3_2 __attribute__((availability(ios,introduced=3.2)))
983 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=3.2,deprecated=10.0)))
984 #if __has_feature(attribute_availability_with_message)
985 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.0,message=_msg)))
986 #else
987 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.0)))
988 #endif
989 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=3.2,deprecated=10.1)))
990 #if __has_feature(attribute_availability_with_message)
991 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.1,message=_msg)))
992 #else
993 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.1)))
994 #endif
995 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=3.2,deprecated=10.2)))
996 #if __has_feature(attribute_availability_with_message)
997 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.2,message=_msg)))
998 #else
999 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.2)))
1000 #endif
1001 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=3.2,deprecated=10.3)))
1002 #if __has_feature(attribute_availability_with_message)
1003 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.3,message=_msg)))
1004 #else
1005 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=10.3)))
1006 #endif
1007 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __attribute__((availability(ios,introduced=3.2,deprecated=3.2)))
1008 #if __has_feature(attribute_availability_with_message)
1009 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=3.2,message=_msg)))
1010 #else
1011 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=3.2)))
1012 #endif
1013 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=3.2,deprecated=4.0)))
1014 #if __has_feature(attribute_availability_with_message)
1015 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.0,message=_msg)))
1016 #else
1017 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.0)))
1018 #endif
1019 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=3.2,deprecated=4.1)))
1020 #if __has_feature(attribute_availability_with_message)
1021 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.1,message=_msg)))
1022 #else
1023 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.1)))
1024 #endif
1025 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=3.2,deprecated=4.2)))
1026 #if __has_feature(attribute_availability_with_message)
1027 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.2,message=_msg)))
1028 #else
1029 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.2)))
1030 #endif
1031 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=3.2,deprecated=4.3)))
1032 #if __has_feature(attribute_availability_with_message)
1033 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.3,message=_msg)))
1034 #else
1035 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=4.3)))
1036 #endif
1037 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=3.2,deprecated=5.0)))
1038 #if __has_feature(attribute_availability_with_message)
1039 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=5.0,message=_msg)))
1040 #else
1041 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=5.0)))
1042 #endif
1043 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=3.2,deprecated=5.1)))
1044 #if __has_feature(attribute_availability_with_message)
1045 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=5.1,message=_msg)))
1046 #else
1047 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=5.1)))
1048 #endif
1049 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=3.2,deprecated=6.0)))
1050 #if __has_feature(attribute_availability_with_message)
1051 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=6.0,message=_msg)))
1052 #else
1053 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=6.0)))
1054 #endif
1055 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=3.2,deprecated=6.1)))
1056 #if __has_feature(attribute_availability_with_message)
1057 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=6.1,message=_msg)))
1058 #else
1059 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=6.1)))
1060 #endif
1061 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=3.2,deprecated=7.0)))
1062 #if __has_feature(attribute_availability_with_message)
1063 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=7.0,message=_msg)))
1064 #else
1065 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=7.0)))
1066 #endif
1067 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=3.2,deprecated=7.1)))
1068 #if __has_feature(attribute_availability_with_message)
1069 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=7.1,message=_msg)))
1070 #else
1071 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=7.1)))
1072 #endif
1073 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=3.2,deprecated=8.0)))
1074 #if __has_feature(attribute_availability_with_message)
1075 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.0,message=_msg)))
1076 #else
1077 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.0)))
1078 #endif
1079 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=3.2,deprecated=8.1)))
1080 #if __has_feature(attribute_availability_with_message)
1081 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.1,message=_msg)))
1082 #else
1083 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.1)))
1084 #endif
1085 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=3.2,deprecated=8.2)))
1086 #if __has_feature(attribute_availability_with_message)
1087 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.2,message=_msg)))
1088 #else
1089 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.2)))
1090 #endif
1091 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=3.2,deprecated=8.3)))
1092 #if __has_feature(attribute_availability_with_message)
1093 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.3,message=_msg)))
1094 #else
1095 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.3)))
1096 #endif
1097 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=3.2,deprecated=8.4)))
1098 #if __has_feature(attribute_availability_with_message)
1099 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.4,message=_msg)))
1100 #else
1101 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=8.4)))
1102 #endif
1103 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=3.2,deprecated=9.0)))
1104 #if __has_feature(attribute_availability_with_message)
1105 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.0,message=_msg)))
1106 #else
1107 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.0)))
1108 #endif
1109 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=3.2,deprecated=9.1)))
1110 #if __has_feature(attribute_availability_with_message)
1111 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.1,message=_msg)))
1112 #else
1113 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.1)))
1114 #endif
1115 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=3.2,deprecated=9.2)))
1116 #if __has_feature(attribute_availability_with_message)
1117 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.2,message=_msg)))
1118 #else
1119 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.2)))
1120 #endif
1121 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=3.2,deprecated=9.3)))
1122 #if __has_feature(attribute_availability_with_message)
1123 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.3,message=_msg)))
1124 #else
1125 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=3.2,deprecated=9.3)))
1126 #endif
1127 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA __attribute__((availability(ios,introduced=3.2)))
1128 #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=3.2)))
1129 #define __AVAILABILITY_INTERNAL__IPHONE_4_0 __attribute__((availability(ios,introduced=4.0)))
1130 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=4.0,deprecated=10.0)))
1131 #if __has_feature(attribute_availability_with_message)
1132 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.0,message=_msg)))
1133 #else
1134 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.0)))
1135 #endif
1136 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=4.0,deprecated=10.1)))
1137 #if __has_feature(attribute_availability_with_message)
1138 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.1,message=_msg)))
1139 #else
1140 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.1)))
1141 #endif
1142 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=4.0,deprecated=10.2)))
1143 #if __has_feature(attribute_availability_with_message)
1144 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.2,message=_msg)))
1145 #else
1146 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.2)))
1147 #endif
1148 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=4.0,deprecated=10.3)))
1149 #if __has_feature(attribute_availability_with_message)
1150 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.3,message=_msg)))
1151 #else
1152 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=10.3)))
1153 #endif
1154 #if __has_feature(attribute_availability_with_message)
1155 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_12_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=12.0,message=_msg)))
1156 #else
1157 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_12_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=12.0)))
1158 #endif
1159 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __attribute__((availability(ios,introduced=4.0,deprecated=4.0)))
1160 #if __has_feature(attribute_availability_with_message)
1161 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.0,message=_msg)))
1162 #else
1163 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.0)))
1164 #endif
1165 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=4.0,deprecated=4.1)))
1166 #if __has_feature(attribute_availability_with_message)
1167 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.1,message=_msg)))
1168 #else
1169 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.1)))
1170 #endif
1171 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=4.0,deprecated=4.2)))
1172 #if __has_feature(attribute_availability_with_message)
1173 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.2,message=_msg)))
1174 #else
1175 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.2)))
1176 #endif
1177 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=4.0,deprecated=4.3)))
1178 #if __has_feature(attribute_availability_with_message)
1179 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.3,message=_msg)))
1180 #else
1181 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.3)))
1182 #endif
1183 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=4.0,deprecated=5.0)))
1184 #if __has_feature(attribute_availability_with_message)
1185 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=5.0,message=_msg)))
1186 #else
1187 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=5.0)))
1188 #endif
1189 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=4.0,deprecated=5.1)))
1190 #if __has_feature(attribute_availability_with_message)
1191 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=5.1,message=_msg)))
1192 #else
1193 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=5.1)))
1194 #endif
1195 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=4.0,deprecated=6.0)))
1196 #if __has_feature(attribute_availability_with_message)
1197 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=6.0,message=_msg)))
1198 #else
1199 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=6.0)))
1200 #endif
1201 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=4.0,deprecated=6.1)))
1202 #if __has_feature(attribute_availability_with_message)
1203 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=6.1,message=_msg)))
1204 #else
1205 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=6.1)))
1206 #endif
1207 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=4.0,deprecated=7.0)))
1208 #if __has_feature(attribute_availability_with_message)
1209 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=7.0,message=_msg)))
1210 #else
1211 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=7.0)))
1212 #endif
1213 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=4.0,deprecated=7.1)))
1214 #if __has_feature(attribute_availability_with_message)
1215 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=7.1,message=_msg)))
1216 #else
1217 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=7.1)))
1218 #endif
1219 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=4.0,deprecated=8.0)))
1220 #if __has_feature(attribute_availability_with_message)
1221 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.0,message=_msg)))
1222 #else
1223 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.0)))
1224 #endif
1225 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=4.0,deprecated=8.1)))
1226 #if __has_feature(attribute_availability_with_message)
1227 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.1,message=_msg)))
1228 #else
1229 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.1)))
1230 #endif
1231 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=4.0,deprecated=8.2)))
1232 #if __has_feature(attribute_availability_with_message)
1233 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.2,message=_msg)))
1234 #else
1235 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.2)))
1236 #endif
1237 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=4.0,deprecated=8.3)))
1238 #if __has_feature(attribute_availability_with_message)
1239 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.3,message=_msg)))
1240 #else
1241 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.3)))
1242 #endif
1243 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=4.0,deprecated=8.4)))
1244 #if __has_feature(attribute_availability_with_message)
1245 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.4,message=_msg)))
1246 #else
1247 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=8.4)))
1248 #endif
1249 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=4.0,deprecated=9.0)))
1250 #if __has_feature(attribute_availability_with_message)
1251 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.0,message=_msg)))
1252 #else
1253 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.0)))
1254 #endif
1255 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=4.0,deprecated=9.1)))
1256 #if __has_feature(attribute_availability_with_message)
1257 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.1,message=_msg)))
1258 #else
1259 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.1)))
1260 #endif
1261 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=4.0,deprecated=9.2)))
1262 #if __has_feature(attribute_availability_with_message)
1263 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.2,message=_msg)))
1264 #else
1265 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.2)))
1266 #endif
1267 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=4.0,deprecated=9.3)))
1268 #if __has_feature(attribute_availability_with_message)
1269 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.3,message=_msg)))
1270 #else
1271 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=9.3)))
1272 #endif
1273 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=4.0)))
1274 #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=4.0)))
1275 #define __AVAILABILITY_INTERNAL__IPHONE_4_1 __attribute__((availability(ios,introduced=4.1)))
1276 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=4.1,deprecated=10.0)))
1277 #if __has_feature(attribute_availability_with_message)
1278 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.0,message=_msg)))
1279 #else
1280 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.0)))
1281 #endif
1282 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=4.1,deprecated=10.1)))
1283 #if __has_feature(attribute_availability_with_message)
1284 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.1,message=_msg)))
1285 #else
1286 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.1)))
1287 #endif
1288 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=4.1,deprecated=10.2)))
1289 #if __has_feature(attribute_availability_with_message)
1290 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.2,message=_msg)))
1291 #else
1292 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.2)))
1293 #endif
1294 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=4.1,deprecated=10.3)))
1295 #if __has_feature(attribute_availability_with_message)
1296 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.3,message=_msg)))
1297 #else
1298 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=10.3)))
1299 #endif
1300 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_1 __attribute__((availability(ios,introduced=4.1,deprecated=4.1)))
1301 #if __has_feature(attribute_availability_with_message)
1302 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=4.1,message=_msg)))
1303 #else
1304 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=4.1)))
1305 #endif
1306 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=4.1,deprecated=4.2)))
1307 #if __has_feature(attribute_availability_with_message)
1308 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=4.2,message=_msg)))
1309 #else
1310 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=4.2)))
1311 #endif
1312 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=4.1,deprecated=4.3)))
1313 #if __has_feature(attribute_availability_with_message)
1314 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=4.3,message=_msg)))
1315 #else
1316 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=4.3)))
1317 #endif
1318 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=4.1,deprecated=5.0)))
1319 #if __has_feature(attribute_availability_with_message)
1320 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=5.0,message=_msg)))
1321 #else
1322 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=5.0)))
1323 #endif
1324 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=4.1,deprecated=5.1)))
1325 #if __has_feature(attribute_availability_with_message)
1326 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=5.1,message=_msg)))
1327 #else
1328 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=5.1)))
1329 #endif
1330 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=4.1,deprecated=6.0)))
1331 #if __has_feature(attribute_availability_with_message)
1332 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=6.0,message=_msg)))
1333 #else
1334 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=6.0)))
1335 #endif
1336 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=4.1,deprecated=6.1)))
1337 #if __has_feature(attribute_availability_with_message)
1338 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=6.1,message=_msg)))
1339 #else
1340 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=6.1)))
1341 #endif
1342 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=4.1,deprecated=7.0)))
1343 #if __has_feature(attribute_availability_with_message)
1344 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=7.0,message=_msg)))
1345 #else
1346 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=7.0)))
1347 #endif
1348 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=4.1,deprecated=7.1)))
1349 #if __has_feature(attribute_availability_with_message)
1350 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=7.1,message=_msg)))
1351 #else
1352 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=7.1)))
1353 #endif
1354 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=4.1,deprecated=8.0)))
1355 #if __has_feature(attribute_availability_with_message)
1356 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.0,message=_msg)))
1357 #else
1358 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.0)))
1359 #endif
1360 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=4.1,deprecated=8.1)))
1361 #if __has_feature(attribute_availability_with_message)
1362 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.1,message=_msg)))
1363 #else
1364 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.1)))
1365 #endif
1366 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=4.1,deprecated=8.2)))
1367 #if __has_feature(attribute_availability_with_message)
1368 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.2,message=_msg)))
1369 #else
1370 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.2)))
1371 #endif
1372 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=4.1,deprecated=8.3)))
1373 #if __has_feature(attribute_availability_with_message)
1374 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.3,message=_msg)))
1375 #else
1376 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.3)))
1377 #endif
1378 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=4.1,deprecated=8.4)))
1379 #if __has_feature(attribute_availability_with_message)
1380 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.4,message=_msg)))
1381 #else
1382 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=8.4)))
1383 #endif
1384 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=4.1,deprecated=9.0)))
1385 #if __has_feature(attribute_availability_with_message)
1386 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.0,message=_msg)))
1387 #else
1388 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.0)))
1389 #endif
1390 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=4.1,deprecated=9.1)))
1391 #if __has_feature(attribute_availability_with_message)
1392 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.1,message=_msg)))
1393 #else
1394 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.1)))
1395 #endif
1396 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=4.1,deprecated=9.2)))
1397 #if __has_feature(attribute_availability_with_message)
1398 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.2,message=_msg)))
1399 #else
1400 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.2)))
1401 #endif
1402 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=4.1,deprecated=9.3)))
1403 #if __has_feature(attribute_availability_with_message)
1404 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.3,message=_msg)))
1405 #else
1406 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.1,deprecated=9.3)))
1407 #endif
1408 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=4.1)))
1409 #define __AVAILABILITY_INTERNAL__IPHONE_4_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=4.1)))
1410 #define __AVAILABILITY_INTERNAL__IPHONE_4_2 __attribute__((availability(ios,introduced=4.2)))
1411 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=4.2,deprecated=10.0)))
1412 #if __has_feature(attribute_availability_with_message)
1413 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.0,message=_msg)))
1414 #else
1415 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.0)))
1416 #endif
1417 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=4.2,deprecated=10.1)))
1418 #if __has_feature(attribute_availability_with_message)
1419 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.1,message=_msg)))
1420 #else
1421 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.1)))
1422 #endif
1423 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=4.2,deprecated=10.2)))
1424 #if __has_feature(attribute_availability_with_message)
1425 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.2,message=_msg)))
1426 #else
1427 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.2)))
1428 #endif
1429 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=4.2,deprecated=10.3)))
1430 #if __has_feature(attribute_availability_with_message)
1431 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.3,message=_msg)))
1432 #else
1433 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=10.3)))
1434 #endif
1435 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_4_2 __attribute__((availability(ios,introduced=4.2,deprecated=4.2)))
1436 #if __has_feature(attribute_availability_with_message)
1437 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=4.2,message=_msg)))
1438 #else
1439 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_4_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=4.2)))
1440 #endif
1441 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=4.2,deprecated=4.3)))
1442 #if __has_feature(attribute_availability_with_message)
1443 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=4.3,message=_msg)))
1444 #else
1445 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=4.3)))
1446 #endif
1447 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=4.2,deprecated=5.0)))
1448 #if __has_feature(attribute_availability_with_message)
1449 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=5.0,message=_msg)))
1450 #else
1451 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=5.0)))
1452 #endif
1453 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=4.2,deprecated=5.1)))
1454 #if __has_feature(attribute_availability_with_message)
1455 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=5.1,message=_msg)))
1456 #else
1457 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=5.1)))
1458 #endif
1459 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=4.2,deprecated=6.0)))
1460 #if __has_feature(attribute_availability_with_message)
1461 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=6.0,message=_msg)))
1462 #else
1463 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=6.0)))
1464 #endif
1465 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=4.2,deprecated=6.1)))
1466 #if __has_feature(attribute_availability_with_message)
1467 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=6.1,message=_msg)))
1468 #else
1469 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=6.1)))
1470 #endif
1471 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=4.2,deprecated=7.0)))
1472 #if __has_feature(attribute_availability_with_message)
1473 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=7.0,message=_msg)))
1474 #else
1475 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=7.0)))
1476 #endif
1477 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=4.2,deprecated=7.1)))
1478 #if __has_feature(attribute_availability_with_message)
1479 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=7.1,message=_msg)))
1480 #else
1481 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=7.1)))
1482 #endif
1483 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=4.2,deprecated=8.0)))
1484 #if __has_feature(attribute_availability_with_message)
1485 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.0,message=_msg)))
1486 #else
1487 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.0)))
1488 #endif
1489 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=4.2,deprecated=8.1)))
1490 #if __has_feature(attribute_availability_with_message)
1491 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.1,message=_msg)))
1492 #else
1493 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.1)))
1494 #endif
1495 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=4.2,deprecated=8.2)))
1496 #if __has_feature(attribute_availability_with_message)
1497 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.2,message=_msg)))
1498 #else
1499 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.2)))
1500 #endif
1501 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=4.2,deprecated=8.3)))
1502 #if __has_feature(attribute_availability_with_message)
1503 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.3,message=_msg)))
1504 #else
1505 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.3)))
1506 #endif
1507 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=4.2,deprecated=8.4)))
1508 #if __has_feature(attribute_availability_with_message)
1509 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.4,message=_msg)))
1510 #else
1511 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=8.4)))
1512 #endif
1513 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=4.2,deprecated=9.0)))
1514 #if __has_feature(attribute_availability_with_message)
1515 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.0,message=_msg)))
1516 #else
1517 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.0)))
1518 #endif
1519 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=4.2,deprecated=9.1)))
1520 #if __has_feature(attribute_availability_with_message)
1521 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.1,message=_msg)))
1522 #else
1523 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.1)))
1524 #endif
1525 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=4.2,deprecated=9.2)))
1526 #if __has_feature(attribute_availability_with_message)
1527 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.2,message=_msg)))
1528 #else
1529 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.2)))
1530 #endif
1531 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=4.2,deprecated=9.3)))
1532 #if __has_feature(attribute_availability_with_message)
1533 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.3,message=_msg)))
1534 #else
1535 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.2,deprecated=9.3)))
1536 #endif
1537 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_NA __attribute__((availability(ios,introduced=4.2)))
1538 #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=4.2)))
1539 #define __AVAILABILITY_INTERNAL__IPHONE_4_3 __attribute__((availability(ios,introduced=4.3)))
1540 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=4.3,deprecated=10.0)))
1541 #if __has_feature(attribute_availability_with_message)
1542 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.0,message=_msg)))
1543 #else
1544 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.0)))
1545 #endif
1546 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=4.3,deprecated=10.1)))
1547 #if __has_feature(attribute_availability_with_message)
1548 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.1,message=_msg)))
1549 #else
1550 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.1)))
1551 #endif
1552 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=4.3,deprecated=10.2)))
1553 #if __has_feature(attribute_availability_with_message)
1554 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.2,message=_msg)))
1555 #else
1556 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.2)))
1557 #endif
1558 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=4.3,deprecated=10.3)))
1559 #if __has_feature(attribute_availability_with_message)
1560 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.3,message=_msg)))
1561 #else
1562 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=10.3)))
1563 #endif
1564 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_4_3 __attribute__((availability(ios,introduced=4.3,deprecated=4.3)))
1565 #if __has_feature(attribute_availability_with_message)
1566 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=4.3,message=_msg)))
1567 #else
1568 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_4_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=4.3)))
1569 #endif
1570 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=4.3,deprecated=5.0)))
1571 #if __has_feature(attribute_availability_with_message)
1572 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=5.0,message=_msg)))
1573 #else
1574 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=5.0)))
1575 #endif
1576 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=4.3,deprecated=5.1)))
1577 #if __has_feature(attribute_availability_with_message)
1578 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=5.1,message=_msg)))
1579 #else
1580 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=5.1)))
1581 #endif
1582 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=4.3,deprecated=6.0)))
1583 #if __has_feature(attribute_availability_with_message)
1584 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=6.0,message=_msg)))
1585 #else
1586 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=6.0)))
1587 #endif
1588 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=4.3,deprecated=6.1)))
1589 #if __has_feature(attribute_availability_with_message)
1590 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=6.1,message=_msg)))
1591 #else
1592 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=6.1)))
1593 #endif
1594 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=4.3,deprecated=7.0)))
1595 #if __has_feature(attribute_availability_with_message)
1596 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=7.0,message=_msg)))
1597 #else
1598 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=7.0)))
1599 #endif
1600 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=4.3,deprecated=7.1)))
1601 #if __has_feature(attribute_availability_with_message)
1602 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=7.1,message=_msg)))
1603 #else
1604 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=7.1)))
1605 #endif
1606 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=4.3,deprecated=8.0)))
1607 #if __has_feature(attribute_availability_with_message)
1608 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.0,message=_msg)))
1609 #else
1610 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.0)))
1611 #endif
1612 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=4.3,deprecated=8.1)))
1613 #if __has_feature(attribute_availability_with_message)
1614 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.1,message=_msg)))
1615 #else
1616 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.1)))
1617 #endif
1618 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=4.3,deprecated=8.2)))
1619 #if __has_feature(attribute_availability_with_message)
1620 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.2,message=_msg)))
1621 #else
1622 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.2)))
1623 #endif
1624 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=4.3,deprecated=8.3)))
1625 #if __has_feature(attribute_availability_with_message)
1626 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.3,message=_msg)))
1627 #else
1628 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.3)))
1629 #endif
1630 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=4.3,deprecated=8.4)))
1631 #if __has_feature(attribute_availability_with_message)
1632 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.4,message=_msg)))
1633 #else
1634 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=8.4)))
1635 #endif
1636 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=4.3,deprecated=9.0)))
1637 #if __has_feature(attribute_availability_with_message)
1638 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.0,message=_msg)))
1639 #else
1640 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.0)))
1641 #endif
1642 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=4.3,deprecated=9.1)))
1643 #if __has_feature(attribute_availability_with_message)
1644 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.1,message=_msg)))
1645 #else
1646 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.1)))
1647 #endif
1648 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=4.3,deprecated=9.2)))
1649 #if __has_feature(attribute_availability_with_message)
1650 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.2,message=_msg)))
1651 #else
1652 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.2)))
1653 #endif
1654 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=4.3,deprecated=9.3)))
1655 #if __has_feature(attribute_availability_with_message)
1656 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.3,message=_msg)))
1657 #else
1658 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=4.3,deprecated=9.3)))
1659 #endif
1660 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_NA __attribute__((availability(ios,introduced=4.3)))
1661 #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=4.3)))
1662 #define __AVAILABILITY_INTERNAL__IPHONE_5_0 __attribute__((availability(ios,introduced=5.0)))
1663 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=5.0,deprecated=10.0)))
1664 #if __has_feature(attribute_availability_with_message)
1665 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.0,message=_msg)))
1666 #else
1667 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.0)))
1668 #endif
1669 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=5.0,deprecated=10.1)))
1670 #if __has_feature(attribute_availability_with_message)
1671 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.1,message=_msg)))
1672 #else
1673 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.1)))
1674 #endif
1675 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=5.0,deprecated=10.2)))
1676 #if __has_feature(attribute_availability_with_message)
1677 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.2,message=_msg)))
1678 #else
1679 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.2)))
1680 #endif
1681 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=5.0,deprecated=10.3)))
1682 #if __has_feature(attribute_availability_with_message)
1683 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.3,message=_msg)))
1684 #else
1685 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=10.3)))
1686 #endif
1687 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_11_0 __attribute__((availability(ios,introduced=5.0,deprecated=11.0)))
1688 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_5_0 __attribute__((availability(ios,introduced=5.0,deprecated=5.0)))
1689 #if __has_feature(attribute_availability_with_message)
1690 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=5.0,message=_msg)))
1691 #else
1692 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_5_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=5.0)))
1693 #endif
1694 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=5.0,deprecated=5.1)))
1695 #if __has_feature(attribute_availability_with_message)
1696 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=5.1,message=_msg)))
1697 #else
1698 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=5.1)))
1699 #endif
1700 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=5.0,deprecated=6.0)))
1701 #if __has_feature(attribute_availability_with_message)
1702 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=6.0,message=_msg)))
1703 #else
1704 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=6.0)))
1705 #endif
1706 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=5.0,deprecated=6.1)))
1707 #if __has_feature(attribute_availability_with_message)
1708 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=6.1,message=_msg)))
1709 #else
1710 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=6.1)))
1711 #endif
1712 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=5.0,deprecated=7.0)))
1713 #if __has_feature(attribute_availability_with_message)
1714 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=7.0,message=_msg)))
1715 #else
1716 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=7.0)))
1717 #endif
1718 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=5.0,deprecated=7.1)))
1719 #if __has_feature(attribute_availability_with_message)
1720 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=7.1,message=_msg)))
1721 #else
1722 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=7.1)))
1723 #endif
1724 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=5.0,deprecated=8.0)))
1725 #if __has_feature(attribute_availability_with_message)
1726 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.0,message=_msg)))
1727 #else
1728 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.0)))
1729 #endif
1730 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=5.0,deprecated=8.1)))
1731 #if __has_feature(attribute_availability_with_message)
1732 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.1,message=_msg)))
1733 #else
1734 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.1)))
1735 #endif
1736 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=5.0,deprecated=8.2)))
1737 #if __has_feature(attribute_availability_with_message)
1738 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.2,message=_msg)))
1739 #else
1740 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.2)))
1741 #endif
1742 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=5.0,deprecated=8.3)))
1743 #if __has_feature(attribute_availability_with_message)
1744 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.3,message=_msg)))
1745 #else
1746 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.3)))
1747 #endif
1748 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=5.0,deprecated=8.4)))
1749 #if __has_feature(attribute_availability_with_message)
1750 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.4,message=_msg)))
1751 #else
1752 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=8.4)))
1753 #endif
1754 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=5.0,deprecated=9.0)))
1755 #if __has_feature(attribute_availability_with_message)
1756 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.0,message=_msg)))
1757 #else
1758 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.0)))
1759 #endif
1760 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=5.0,deprecated=9.1)))
1761 #if __has_feature(attribute_availability_with_message)
1762 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.1,message=_msg)))
1763 #else
1764 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.1)))
1765 #endif
1766 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=5.0,deprecated=9.2)))
1767 #if __has_feature(attribute_availability_with_message)
1768 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.2,message=_msg)))
1769 #else
1770 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.2)))
1771 #endif
1772 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=5.0,deprecated=9.3)))
1773 #if __has_feature(attribute_availability_with_message)
1774 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.3,message=_msg)))
1775 #else
1776 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=5.0,deprecated=9.3)))
1777 #endif
1778 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=5.0)))
1779 #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=5.0)))
1780 #define __AVAILABILITY_INTERNAL__IPHONE_5_1 __attribute__((availability(ios,introduced=5.1)))
1781 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=5.1,deprecated=10.0)))
1782 #if __has_feature(attribute_availability_with_message)
1783 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.0,message=_msg)))
1784 #else
1785 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.0)))
1786 #endif
1787 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=5.1,deprecated=10.1)))
1788 #if __has_feature(attribute_availability_with_message)
1789 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.1,message=_msg)))
1790 #else
1791 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.1)))
1792 #endif
1793 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=5.1,deprecated=10.2)))
1794 #if __has_feature(attribute_availability_with_message)
1795 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.2,message=_msg)))
1796 #else
1797 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.2)))
1798 #endif
1799 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=5.1,deprecated=10.3)))
1800 #if __has_feature(attribute_availability_with_message)
1801 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.3,message=_msg)))
1802 #else
1803 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=10.3)))
1804 #endif
1805 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_5_1 __attribute__((availability(ios,introduced=5.1,deprecated=5.1)))
1806 #if __has_feature(attribute_availability_with_message)
1807 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=5.1,message=_msg)))
1808 #else
1809 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_5_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=5.1)))
1810 #endif
1811 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=5.1,deprecated=6.0)))
1812 #if __has_feature(attribute_availability_with_message)
1813 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=6.0,message=_msg)))
1814 #else
1815 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=6.0)))
1816 #endif
1817 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=5.1,deprecated=6.1)))
1818 #if __has_feature(attribute_availability_with_message)
1819 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=6.1,message=_msg)))
1820 #else
1821 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=6.1)))
1822 #endif
1823 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=5.1,deprecated=7.0)))
1824 #if __has_feature(attribute_availability_with_message)
1825 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=7.0,message=_msg)))
1826 #else
1827 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=7.0)))
1828 #endif
1829 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=5.1,deprecated=7.1)))
1830 #if __has_feature(attribute_availability_with_message)
1831 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=7.1,message=_msg)))
1832 #else
1833 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=7.1)))
1834 #endif
1835 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=5.1,deprecated=8.0)))
1836 #if __has_feature(attribute_availability_with_message)
1837 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.0,message=_msg)))
1838 #else
1839 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.0)))
1840 #endif
1841 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=5.1,deprecated=8.1)))
1842 #if __has_feature(attribute_availability_with_message)
1843 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.1,message=_msg)))
1844 #else
1845 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.1)))
1846 #endif
1847 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=5.1,deprecated=8.2)))
1848 #if __has_feature(attribute_availability_with_message)
1849 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.2,message=_msg)))
1850 #else
1851 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.2)))
1852 #endif
1853 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=5.1,deprecated=8.3)))
1854 #if __has_feature(attribute_availability_with_message)
1855 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.3,message=_msg)))
1856 #else
1857 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.3)))
1858 #endif
1859 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=5.1,deprecated=8.4)))
1860 #if __has_feature(attribute_availability_with_message)
1861 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.4,message=_msg)))
1862 #else
1863 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=8.4)))
1864 #endif
1865 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=5.1,deprecated=9.0)))
1866 #if __has_feature(attribute_availability_with_message)
1867 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.0,message=_msg)))
1868 #else
1869 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.0)))
1870 #endif
1871 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=5.1,deprecated=9.1)))
1872 #if __has_feature(attribute_availability_with_message)
1873 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.1,message=_msg)))
1874 #else
1875 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.1)))
1876 #endif
1877 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=5.1,deprecated=9.2)))
1878 #if __has_feature(attribute_availability_with_message)
1879 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.2,message=_msg)))
1880 #else
1881 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.2)))
1882 #endif
1883 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=5.1,deprecated=9.3)))
1884 #if __has_feature(attribute_availability_with_message)
1885 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.3,message=_msg)))
1886 #else
1887 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=5.1,deprecated=9.3)))
1888 #endif
1889 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=5.1)))
1890 #define __AVAILABILITY_INTERNAL__IPHONE_5_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=5.1)))
1891 #define __AVAILABILITY_INTERNAL__IPHONE_6_0 __attribute__((availability(ios,introduced=6.0)))
1892 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=6.0,deprecated=10.0)))
1893 #if __has_feature(attribute_availability_with_message)
1894 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.0,message=_msg)))
1895 #else
1896 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.0)))
1897 #endif
1898 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=6.0,deprecated=10.1)))
1899 #if __has_feature(attribute_availability_with_message)
1900 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.1,message=_msg)))
1901 #else
1902 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.1)))
1903 #endif
1904 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=6.0,deprecated=10.2)))
1905 #if __has_feature(attribute_availability_with_message)
1906 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.2,message=_msg)))
1907 #else
1908 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.2)))
1909 #endif
1910 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=6.0,deprecated=10.3)))
1911 #if __has_feature(attribute_availability_with_message)
1912 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.3,message=_msg)))
1913 #else
1914 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=10.3)))
1915 #endif
1916 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_6_0 __attribute__((availability(ios,introduced=6.0,deprecated=6.0)))
1917 #if __has_feature(attribute_availability_with_message)
1918 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=6.0,message=_msg)))
1919 #else
1920 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_6_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=6.0)))
1921 #endif
1922 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=6.0,deprecated=6.1)))
1923 #if __has_feature(attribute_availability_with_message)
1924 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=6.1,message=_msg)))
1925 #else
1926 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=6.1)))
1927 #endif
1928 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=6.0,deprecated=7.0)))
1929 #if __has_feature(attribute_availability_with_message)
1930 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=7.0,message=_msg)))
1931 #else
1932 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=7.0)))
1933 #endif
1934 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=6.0,deprecated=7.1)))
1935 #if __has_feature(attribute_availability_with_message)
1936 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=7.1,message=_msg)))
1937 #else
1938 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=7.1)))
1939 #endif
1940 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=6.0,deprecated=8.0)))
1941 #if __has_feature(attribute_availability_with_message)
1942 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.0,message=_msg)))
1943 #else
1944 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.0)))
1945 #endif
1946 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=6.0,deprecated=8.1)))
1947 #if __has_feature(attribute_availability_with_message)
1948 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.1,message=_msg)))
1949 #else
1950 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.1)))
1951 #endif
1952 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=6.0,deprecated=8.2)))
1953 #if __has_feature(attribute_availability_with_message)
1954 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.2,message=_msg)))
1955 #else
1956 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.2)))
1957 #endif
1958 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=6.0,deprecated=8.3)))
1959 #if __has_feature(attribute_availability_with_message)
1960 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.3,message=_msg)))
1961 #else
1962 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.3)))
1963 #endif
1964 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=6.0,deprecated=8.4)))
1965 #if __has_feature(attribute_availability_with_message)
1966 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.4,message=_msg)))
1967 #else
1968 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=8.4)))
1969 #endif
1970 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=6.0,deprecated=9.0)))
1971 #if __has_feature(attribute_availability_with_message)
1972 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.0,message=_msg)))
1973 #else
1974 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.0)))
1975 #endif
1976 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=6.0,deprecated=9.1)))
1977 #if __has_feature(attribute_availability_with_message)
1978 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.1,message=_msg)))
1979 #else
1980 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.1)))
1981 #endif
1982 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=6.0,deprecated=9.2)))
1983 #if __has_feature(attribute_availability_with_message)
1984 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.2,message=_msg)))
1985 #else
1986 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.2)))
1987 #endif
1988 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=6.0,deprecated=9.3)))
1989 #if __has_feature(attribute_availability_with_message)
1990 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.3,message=_msg)))
1991 #else
1992 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=6.0,deprecated=9.3)))
1993 #endif
1994 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=6.0)))
1995 #define __AVAILABILITY_INTERNAL__IPHONE_6_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=6.0)))
1996 #define __AVAILABILITY_INTERNAL__IPHONE_6_1 __attribute__((availability(ios,introduced=6.1)))
1997 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=6.1,deprecated=10.0)))
1998 #if __has_feature(attribute_availability_with_message)
1999 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.0,message=_msg)))
2000 #else
2001 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.0)))
2002 #endif
2003 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=6.1,deprecated=10.1)))
2004 #if __has_feature(attribute_availability_with_message)
2005 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.1,message=_msg)))
2006 #else
2007 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.1)))
2008 #endif
2009 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=6.1,deprecated=10.2)))
2010 #if __has_feature(attribute_availability_with_message)
2011 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.2,message=_msg)))
2012 #else
2013 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.2)))
2014 #endif
2015 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=6.1,deprecated=10.3)))
2016 #if __has_feature(attribute_availability_with_message)
2017 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.3,message=_msg)))
2018 #else
2019 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=10.3)))
2020 #endif
2021 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_6_1 __attribute__((availability(ios,introduced=6.1,deprecated=6.1)))
2022 #if __has_feature(attribute_availability_with_message)
2023 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=6.1,message=_msg)))
2024 #else
2025 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_6_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=6.1)))
2026 #endif
2027 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=6.1,deprecated=7.0)))
2028 #if __has_feature(attribute_availability_with_message)
2029 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=7.0,message=_msg)))
2030 #else
2031 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=7.0)))
2032 #endif
2033 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=6.1,deprecated=7.1)))
2034 #if __has_feature(attribute_availability_with_message)
2035 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=7.1,message=_msg)))
2036 #else
2037 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=7.1)))
2038 #endif
2039 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=6.1,deprecated=8.0)))
2040 #if __has_feature(attribute_availability_with_message)
2041 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.0,message=_msg)))
2042 #else
2043 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.0)))
2044 #endif
2045 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=6.1,deprecated=8.1)))
2046 #if __has_feature(attribute_availability_with_message)
2047 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.1,message=_msg)))
2048 #else
2049 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.1)))
2050 #endif
2051 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=6.1,deprecated=8.2)))
2052 #if __has_feature(attribute_availability_with_message)
2053 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.2,message=_msg)))
2054 #else
2055 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.2)))
2056 #endif
2057 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=6.1,deprecated=8.3)))
2058 #if __has_feature(attribute_availability_with_message)
2059 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.3,message=_msg)))
2060 #else
2061 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.3)))
2062 #endif
2063 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=6.1,deprecated=8.4)))
2064 #if __has_feature(attribute_availability_with_message)
2065 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.4,message=_msg)))
2066 #else
2067 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=8.4)))
2068 #endif
2069 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=6.1,deprecated=9.0)))
2070 #if __has_feature(attribute_availability_with_message)
2071 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.0,message=_msg)))
2072 #else
2073 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.0)))
2074 #endif
2075 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=6.1,deprecated=9.1)))
2076 #if __has_feature(attribute_availability_with_message)
2077 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.1,message=_msg)))
2078 #else
2079 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.1)))
2080 #endif
2081 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=6.1,deprecated=9.2)))
2082 #if __has_feature(attribute_availability_with_message)
2083 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.2,message=_msg)))
2084 #else
2085 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.2)))
2086 #endif
2087 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=6.1,deprecated=9.3)))
2088 #if __has_feature(attribute_availability_with_message)
2089 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.3,message=_msg)))
2090 #else
2091 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=6.1,deprecated=9.3)))
2092 #endif
2093 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=6.1)))
2094 #define __AVAILABILITY_INTERNAL__IPHONE_6_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=6.1)))
2095 #define __AVAILABILITY_INTERNAL__IPHONE_7_0 __attribute__((availability(ios,introduced=7.0)))
2096 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=7.0,deprecated=10.0)))
2097 #if __has_feature(attribute_availability_with_message)
2098 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.0,message=_msg)))
2099 #else
2100 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.0)))
2101 #endif
2102 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=7.0,deprecated=10.1)))
2103 #if __has_feature(attribute_availability_with_message)
2104 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.1,message=_msg)))
2105 #else
2106 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.1)))
2107 #endif
2108 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=7.0,deprecated=10.2)))
2109 #if __has_feature(attribute_availability_with_message)
2110 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.2,message=_msg)))
2111 #else
2112 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.2)))
2113 #endif
2114 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=7.0,deprecated=10.3)))
2115 #if __has_feature(attribute_availability_with_message)
2116 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.3,message=_msg)))
2117 #else
2118 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=10.3)))
2119 #endif
2120 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_11_0 __attribute__((availability(ios,introduced=7.0,deprecated=11.0)))
2121 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_11_3 __attribute__((availability(ios,introduced=7.0,deprecated=11.3)))
2122 #if __has_feature(attribute_availability_with_message)
2123 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_12_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=12.0,message=_msg)))
2124 #else
2125 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_12_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=12.0)))
2126 #endif
2127 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_7_0 __attribute__((availability(ios,introduced=7.0,deprecated=7.0)))
2128 #if __has_feature(attribute_availability_with_message)
2129 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=7.0,message=_msg)))
2130 #else
2131 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_7_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=7.0)))
2132 #endif
2133 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=7.0,deprecated=7.1)))
2134 #if __has_feature(attribute_availability_with_message)
2135 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=7.1,message=_msg)))
2136 #else
2137 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=7.1)))
2138 #endif
2139 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=7.0,deprecated=8.0)))
2140 #if __has_feature(attribute_availability_with_message)
2141 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.0,message=_msg)))
2142 #else
2143 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.0)))
2144 #endif
2145 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=7.0,deprecated=8.1)))
2146 #if __has_feature(attribute_availability_with_message)
2147 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.1,message=_msg)))
2148 #else
2149 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.1)))
2150 #endif
2151 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=7.0,deprecated=8.2)))
2152 #if __has_feature(attribute_availability_with_message)
2153 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.2,message=_msg)))
2154 #else
2155 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.2)))
2156 #endif
2157 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=7.0,deprecated=8.3)))
2158 #if __has_feature(attribute_availability_with_message)
2159 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.3,message=_msg)))
2160 #else
2161 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.3)))
2162 #endif
2163 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=7.0,deprecated=8.4)))
2164 #if __has_feature(attribute_availability_with_message)
2165 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.4,message=_msg)))
2166 #else
2167 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=8.4)))
2168 #endif
2169 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=7.0,deprecated=9.0)))
2170 #if __has_feature(attribute_availability_with_message)
2171 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.0,message=_msg)))
2172 #else
2173 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.0)))
2174 #endif
2175 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=7.0,deprecated=9.1)))
2176 #if __has_feature(attribute_availability_with_message)
2177 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.1,message=_msg)))
2178 #else
2179 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.1)))
2180 #endif
2181 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=7.0,deprecated=9.2)))
2182 #if __has_feature(attribute_availability_with_message)
2183 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.2,message=_msg)))
2184 #else
2185 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.2)))
2186 #endif
2187 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=7.0,deprecated=9.3)))
2188 #if __has_feature(attribute_availability_with_message)
2189 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.3,message=_msg)))
2190 #else
2191 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=7.0,deprecated=9.3)))
2192 #endif
2193 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=7.0)))
2194 #define __AVAILABILITY_INTERNAL__IPHONE_7_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=7.0)))
2195 #define __AVAILABILITY_INTERNAL__IPHONE_7_1 __attribute__((availability(ios,introduced=7.1)))
2196 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=7.1,deprecated=10.0)))
2197 #if __has_feature(attribute_availability_with_message)
2198 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.0,message=_msg)))
2199 #else
2200 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.0)))
2201 #endif
2202 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=7.1,deprecated=10.1)))
2203 #if __has_feature(attribute_availability_with_message)
2204 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.1,message=_msg)))
2205 #else
2206 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.1)))
2207 #endif
2208 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=7.1,deprecated=10.2)))
2209 #if __has_feature(attribute_availability_with_message)
2210 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.2,message=_msg)))
2211 #else
2212 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.2)))
2213 #endif
2214 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=7.1,deprecated=10.3)))
2215 #if __has_feature(attribute_availability_with_message)
2216 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.3,message=_msg)))
2217 #else
2218 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=10.3)))
2219 #endif
2220 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_7_1 __attribute__((availability(ios,introduced=7.1,deprecated=7.1)))
2221 #if __has_feature(attribute_availability_with_message)
2222 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=7.1,message=_msg)))
2223 #else
2224 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_7_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=7.1)))
2225 #endif
2226 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=7.1,deprecated=8.0)))
2227 #if __has_feature(attribute_availability_with_message)
2228 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.0,message=_msg)))
2229 #else
2230 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.0)))
2231 #endif
2232 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=7.1,deprecated=8.1)))
2233 #if __has_feature(attribute_availability_with_message)
2234 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.1,message=_msg)))
2235 #else
2236 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.1)))
2237 #endif
2238 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=7.1,deprecated=8.2)))
2239 #if __has_feature(attribute_availability_with_message)
2240 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.2,message=_msg)))
2241 #else
2242 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.2)))
2243 #endif
2244 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=7.1,deprecated=8.3)))
2245 #if __has_feature(attribute_availability_with_message)
2246 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.3,message=_msg)))
2247 #else
2248 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.3)))
2249 #endif
2250 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=7.1,deprecated=8.4)))
2251 #if __has_feature(attribute_availability_with_message)
2252 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.4,message=_msg)))
2253 #else
2254 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=8.4)))
2255 #endif
2256 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=7.1,deprecated=9.0)))
2257 #if __has_feature(attribute_availability_with_message)
2258 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.0,message=_msg)))
2259 #else
2260 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.0)))
2261 #endif
2262 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=7.1,deprecated=9.1)))
2263 #if __has_feature(attribute_availability_with_message)
2264 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.1,message=_msg)))
2265 #else
2266 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.1)))
2267 #endif
2268 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=7.1,deprecated=9.2)))
2269 #if __has_feature(attribute_availability_with_message)
2270 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.2,message=_msg)))
2271 #else
2272 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.2)))
2273 #endif
2274 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=7.1,deprecated=9.3)))
2275 #if __has_feature(attribute_availability_with_message)
2276 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.3,message=_msg)))
2277 #else
2278 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=7.1,deprecated=9.3)))
2279 #endif
2280 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=7.1)))
2281 #define __AVAILABILITY_INTERNAL__IPHONE_7_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=7.1)))
2282 #define __AVAILABILITY_INTERNAL__IPHONE_8_0 __attribute__((availability(ios,introduced=8.0)))
2283 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=8.0,deprecated=10.0)))
2284 #if __has_feature(attribute_availability_with_message)
2285 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.0,message=_msg)))
2286 #else
2287 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.0)))
2288 #endif
2289 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=8.0,deprecated=10.1)))
2290 #if __has_feature(attribute_availability_with_message)
2291 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.1,message=_msg)))
2292 #else
2293 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.1)))
2294 #endif
2295 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=8.0,deprecated=10.2)))
2296 #if __has_feature(attribute_availability_with_message)
2297 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.2,message=_msg)))
2298 #else
2299 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.2)))
2300 #endif
2301 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=8.0,deprecated=10.3)))
2302 #if __has_feature(attribute_availability_with_message)
2303 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.3,message=_msg)))
2304 #else
2305 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=10.3)))
2306 #endif
2307 #if __has_feature(attribute_availability_with_message)
2308 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_11_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=11,message=_msg)))
2309 #else
2310 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_11_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=11)))
2311 #endif
2312 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_11_3 __attribute__((availability(ios,introduced=8.0,deprecated=11.3)))
2313 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_12_0 __attribute__((availability(ios,introduced=8.0,deprecated=12.0)))
2314 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_0 __attribute__((availability(ios,introduced=8.0,deprecated=8.0)))
2315 #if __has_feature(attribute_availability_with_message)
2316 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.0,message=_msg)))
2317 #else
2318 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.0)))
2319 #endif
2320 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=8.0,deprecated=8.1)))
2321 #if __has_feature(attribute_availability_with_message)
2322 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.1,message=_msg)))
2323 #else
2324 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.1)))
2325 #endif
2326 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=8.0,deprecated=8.2)))
2327 #if __has_feature(attribute_availability_with_message)
2328 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.2,message=_msg)))
2329 #else
2330 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.2)))
2331 #endif
2332 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=8.0,deprecated=8.3)))
2333 #if __has_feature(attribute_availability_with_message)
2334 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.3,message=_msg)))
2335 #else
2336 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.3)))
2337 #endif
2338 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=8.0,deprecated=8.4)))
2339 #if __has_feature(attribute_availability_with_message)
2340 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.4,message=_msg)))
2341 #else
2342 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=8.4)))
2343 #endif
2344 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=8.0,deprecated=9.0)))
2345 #if __has_feature(attribute_availability_with_message)
2346 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.0,message=_msg)))
2347 #else
2348 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.0)))
2349 #endif
2350 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=8.0,deprecated=9.1)))
2351 #if __has_feature(attribute_availability_with_message)
2352 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.1,message=_msg)))
2353 #else
2354 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.1)))
2355 #endif
2356 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=8.0,deprecated=9.2)))
2357 #if __has_feature(attribute_availability_with_message)
2358 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.2,message=_msg)))
2359 #else
2360 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.2)))
2361 #endif
2362 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=8.0,deprecated=9.3)))
2363 #if __has_feature(attribute_availability_with_message)
2364 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.3,message=_msg)))
2365 #else
2366 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.0,deprecated=9.3)))
2367 #endif
2368 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=8.0)))
2369 #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=8.0)))
2370 #define __AVAILABILITY_INTERNAL__IPHONE_8_1 __attribute__((availability(ios,introduced=8.1)))
2371 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=8.1,deprecated=10.0)))
2372 #if __has_feature(attribute_availability_with_message)
2373 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.0,message=_msg)))
2374 #else
2375 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.0)))
2376 #endif
2377 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=8.1,deprecated=10.1)))
2378 #if __has_feature(attribute_availability_with_message)
2379 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.1,message=_msg)))
2380 #else
2381 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.1)))
2382 #endif
2383 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=8.1,deprecated=10.2)))
2384 #if __has_feature(attribute_availability_with_message)
2385 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.2,message=_msg)))
2386 #else
2387 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.2)))
2388 #endif
2389 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=8.1,deprecated=10.3)))
2390 #if __has_feature(attribute_availability_with_message)
2391 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.3,message=_msg)))
2392 #else
2393 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=10.3)))
2394 #endif
2395 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_1 __attribute__((availability(ios,introduced=8.1,deprecated=8.1)))
2396 #if __has_feature(attribute_availability_with_message)
2397 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.1,message=_msg)))
2398 #else
2399 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_1_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.1)))
2400 #endif
2401 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=8.1,deprecated=8.2)))
2402 #if __has_feature(attribute_availability_with_message)
2403 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.2,message=_msg)))
2404 #else
2405 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.2)))
2406 #endif
2407 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=8.1,deprecated=8.3)))
2408 #if __has_feature(attribute_availability_with_message)
2409 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.3,message=_msg)))
2410 #else
2411 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.3)))
2412 #endif
2413 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=8.1,deprecated=8.4)))
2414 #if __has_feature(attribute_availability_with_message)
2415 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.4,message=_msg)))
2416 #else
2417 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=8.4)))
2418 #endif
2419 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=8.1,deprecated=9.0)))
2420 #if __has_feature(attribute_availability_with_message)
2421 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.0,message=_msg)))
2422 #else
2423 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.0)))
2424 #endif
2425 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=8.1,deprecated=9.1)))
2426 #if __has_feature(attribute_availability_with_message)
2427 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.1,message=_msg)))
2428 #else
2429 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.1)))
2430 #endif
2431 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=8.1,deprecated=9.2)))
2432 #if __has_feature(attribute_availability_with_message)
2433 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.2,message=_msg)))
2434 #else
2435 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.2)))
2436 #endif
2437 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=8.1,deprecated=9.3)))
2438 #if __has_feature(attribute_availability_with_message)
2439 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.3,message=_msg)))
2440 #else
2441 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.1,deprecated=9.3)))
2442 #endif
2443 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=8.1)))
2444 #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=8.1)))
2445 #define __AVAILABILITY_INTERNAL__IPHONE_8_2 __attribute__((availability(ios,introduced=8.2)))
2446 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=8.2,deprecated=10.0)))
2447 #if __has_feature(attribute_availability_with_message)
2448 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.0,message=_msg)))
2449 #else
2450 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.0)))
2451 #endif
2452 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=8.2,deprecated=10.1)))
2453 #if __has_feature(attribute_availability_with_message)
2454 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.1,message=_msg)))
2455 #else
2456 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.1)))
2457 #endif
2458 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=8.2,deprecated=10.2)))
2459 #if __has_feature(attribute_availability_with_message)
2460 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.2,message=_msg)))
2461 #else
2462 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.2)))
2463 #endif
2464 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=8.2,deprecated=10.3)))
2465 #if __has_feature(attribute_availability_with_message)
2466 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.3,message=_msg)))
2467 #else
2468 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=10.3)))
2469 #endif
2470 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_2 __attribute__((availability(ios,introduced=8.2,deprecated=8.2)))
2471 #if __has_feature(attribute_availability_with_message)
2472 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=8.2,message=_msg)))
2473 #else
2474 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_2_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=8.2)))
2475 #endif
2476 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=8.2,deprecated=8.3)))
2477 #if __has_feature(attribute_availability_with_message)
2478 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=8.3,message=_msg)))
2479 #else
2480 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=8.3)))
2481 #endif
2482 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=8.2,deprecated=8.4)))
2483 #if __has_feature(attribute_availability_with_message)
2484 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=8.4,message=_msg)))
2485 #else
2486 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=8.4)))
2487 #endif
2488 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=8.2,deprecated=9.0)))
2489 #if __has_feature(attribute_availability_with_message)
2490 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.0,message=_msg)))
2491 #else
2492 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.0)))
2493 #endif
2494 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=8.2,deprecated=9.1)))
2495 #if __has_feature(attribute_availability_with_message)
2496 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.1,message=_msg)))
2497 #else
2498 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.1)))
2499 #endif
2500 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=8.2,deprecated=9.2)))
2501 #if __has_feature(attribute_availability_with_message)
2502 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.2,message=_msg)))
2503 #else
2504 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.2)))
2505 #endif
2506 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=8.2,deprecated=9.3)))
2507 #if __has_feature(attribute_availability_with_message)
2508 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.3,message=_msg)))
2509 #else
2510 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.2,deprecated=9.3)))
2511 #endif
2512 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_NA __attribute__((availability(ios,introduced=8.2)))
2513 #define __AVAILABILITY_INTERNAL__IPHONE_8_2_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=8.2)))
2514 #define __AVAILABILITY_INTERNAL__IPHONE_8_3 __attribute__((availability(ios,introduced=8.3)))
2515 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=8.3,deprecated=10.0)))
2516 #if __has_feature(attribute_availability_with_message)
2517 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.0,message=_msg)))
2518 #else
2519 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.0)))
2520 #endif
2521 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=8.3,deprecated=10.1)))
2522 #if __has_feature(attribute_availability_with_message)
2523 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.1,message=_msg)))
2524 #else
2525 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.1)))
2526 #endif
2527 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=8.3,deprecated=10.2)))
2528 #if __has_feature(attribute_availability_with_message)
2529 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.2,message=_msg)))
2530 #else
2531 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.2)))
2532 #endif
2533 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=8.3,deprecated=10.3)))
2534 #if __has_feature(attribute_availability_with_message)
2535 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.3,message=_msg)))
2536 #else
2537 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=10.3)))
2538 #endif
2539 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_8_3 __attribute__((availability(ios,introduced=8.3,deprecated=8.3)))
2540 #if __has_feature(attribute_availability_with_message)
2541 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=8.3,message=_msg)))
2542 #else
2543 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_8_3_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=8.3)))
2544 #endif
2545 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=8.3,deprecated=8.4)))
2546 #if __has_feature(attribute_availability_with_message)
2547 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=8.4,message=_msg)))
2548 #else
2549 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=8.4)))
2550 #endif
2551 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=8.3,deprecated=9.0)))
2552 #if __has_feature(attribute_availability_with_message)
2553 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.0,message=_msg)))
2554 #else
2555 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.0)))
2556 #endif
2557 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=8.3,deprecated=9.1)))
2558 #if __has_feature(attribute_availability_with_message)
2559 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.1,message=_msg)))
2560 #else
2561 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.1)))
2562 #endif
2563 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=8.3,deprecated=9.2)))
2564 #if __has_feature(attribute_availability_with_message)
2565 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.2,message=_msg)))
2566 #else
2567 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.2)))
2568 #endif
2569 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=8.3,deprecated=9.3)))
2570 #if __has_feature(attribute_availability_with_message)
2571 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.3,message=_msg)))
2572 #else
2573 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.3,deprecated=9.3)))
2574 #endif
2575 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_NA __attribute__((availability(ios,introduced=8.3)))
2576 #define __AVAILABILITY_INTERNAL__IPHONE_8_3_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=8.3)))
2577 #define __AVAILABILITY_INTERNAL__IPHONE_8_4 __attribute__((availability(ios,introduced=8.4)))
2578 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=8.4,deprecated=10.0)))
2579 #if __has_feature(attribute_availability_with_message)
2580 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.0,message=_msg)))
2581 #else
2582 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.0)))
2583 #endif
2584 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=8.4,deprecated=10.1)))
2585 #if __has_feature(attribute_availability_with_message)
2586 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.1,message=_msg)))
2587 #else
2588 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.1)))
2589 #endif
2590 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=8.4,deprecated=10.2)))
2591 #if __has_feature(attribute_availability_with_message)
2592 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.2,message=_msg)))
2593 #else
2594 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.2)))
2595 #endif
2596 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=8.4,deprecated=10.3)))
2597 #if __has_feature(attribute_availability_with_message)
2598 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.3,message=_msg)))
2599 #else
2600 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=10.3)))
2601 #endif
2602 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_8_4 __attribute__((availability(ios,introduced=8.4,deprecated=8.4)))
2603 #if __has_feature(attribute_availability_with_message)
2604 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=8.4,message=_msg)))
2605 #else
2606 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_8_4_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=8.4)))
2607 #endif
2608 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=8.4,deprecated=9.0)))
2609 #if __has_feature(attribute_availability_with_message)
2610 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.0,message=_msg)))
2611 #else
2612 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.0)))
2613 #endif
2614 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=8.4,deprecated=9.1)))
2615 #if __has_feature(attribute_availability_with_message)
2616 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.1,message=_msg)))
2617 #else
2618 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.1)))
2619 #endif
2620 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=8.4,deprecated=9.2)))
2621 #if __has_feature(attribute_availability_with_message)
2622 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.2,message=_msg)))
2623 #else
2624 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.2)))
2625 #endif
2626 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=8.4,deprecated=9.3)))
2627 #if __has_feature(attribute_availability_with_message)
2628 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.3,message=_msg)))
2629 #else
2630 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=8.4,deprecated=9.3)))
2631 #endif
2632 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_NA __attribute__((availability(ios,introduced=8.4)))
2633 #define __AVAILABILITY_INTERNAL__IPHONE_8_4_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=8.4)))
2634 #define __AVAILABILITY_INTERNAL__IPHONE_9_0 __attribute__((availability(ios,introduced=9.0)))
2635 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=9.0,deprecated=10.0)))
2636 #if __has_feature(attribute_availability_with_message)
2637 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.0,message=_msg)))
2638 #else
2639 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.0)))
2640 #endif
2641 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=9.0,deprecated=10.1)))
2642 #if __has_feature(attribute_availability_with_message)
2643 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.1,message=_msg)))
2644 #else
2645 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.1)))
2646 #endif
2647 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=9.0,deprecated=10.2)))
2648 #if __has_feature(attribute_availability_with_message)
2649 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.2,message=_msg)))
2650 #else
2651 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.2)))
2652 #endif
2653 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=9.0,deprecated=10.3)))
2654 #if __has_feature(attribute_availability_with_message)
2655 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.3,message=_msg)))
2656 #else
2657 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=10.3)))
2658 #endif
2659 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_0 __attribute__((availability(ios,introduced=9.0,deprecated=9.0)))
2660 #if __has_feature(attribute_availability_with_message)
2661 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.0,message=_msg)))
2662 #else
2663 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_0_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.0)))
2664 #endif
2665 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=9.0,deprecated=9.1)))
2666 #if __has_feature(attribute_availability_with_message)
2667 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.1,message=_msg)))
2668 #else
2669 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.1)))
2670 #endif
2671 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=9.0,deprecated=9.2)))
2672 #if __has_feature(attribute_availability_with_message)
2673 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.2,message=_msg)))
2674 #else
2675 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.2)))
2676 #endif
2677 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=9.0,deprecated=9.3)))
2678 #if __has_feature(attribute_availability_with_message)
2679 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.3,message=_msg)))
2680 #else
2681 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.0,deprecated=9.3)))
2682 #endif
2683 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=9.0)))
2684 #define __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=9.0)))
2685 #define __AVAILABILITY_INTERNAL__IPHONE_9_1 __attribute__((availability(ios,introduced=9.1)))
2686 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=9.1,deprecated=10.0)))
2687 #if __has_feature(attribute_availability_with_message)
2688 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.0,message=_msg)))
2689 #else
2690 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.0)))
2691 #endif
2692 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=9.1,deprecated=10.1)))
2693 #if __has_feature(attribute_availability_with_message)
2694 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.1,message=_msg)))
2695 #else
2696 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.1)))
2697 #endif
2698 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=9.1,deprecated=10.2)))
2699 #if __has_feature(attribute_availability_with_message)
2700 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.2,message=_msg)))
2701 #else
2702 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.2)))
2703 #endif
2704 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=9.1,deprecated=10.3)))
2705 #if __has_feature(attribute_availability_with_message)
2706 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.3,message=_msg)))
2707 #else
2708 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=10.3)))
2709 #endif
2710 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_1 __attribute__((availability(ios,introduced=9.1,deprecated=9.1)))
2711 #if __has_feature(attribute_availability_with_message)
2712 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=9.1,message=_msg)))
2713 #else
2714 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_1_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=9.1)))
2715 #endif
2716 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=9.1,deprecated=9.2)))
2717 #if __has_feature(attribute_availability_with_message)
2718 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=9.2,message=_msg)))
2719 #else
2720 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=9.2)))
2721 #endif
2722 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=9.1,deprecated=9.3)))
2723 #if __has_feature(attribute_availability_with_message)
2724 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=9.3,message=_msg)))
2725 #else
2726 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.1,deprecated=9.3)))
2727 #endif
2728 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=9.1)))
2729 #define __AVAILABILITY_INTERNAL__IPHONE_9_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=9.1)))
2730 #define __AVAILABILITY_INTERNAL__IPHONE_9_2 __attribute__((availability(ios,introduced=9.2)))
2731 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=9.2,deprecated=10.0)))
2732 #if __has_feature(attribute_availability_with_message)
2733 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.0,message=_msg)))
2734 #else
2735 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.0)))
2736 #endif
2737 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=9.2,deprecated=10.1)))
2738 #if __has_feature(attribute_availability_with_message)
2739 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.1,message=_msg)))
2740 #else
2741 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.1)))
2742 #endif
2743 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=9.2,deprecated=10.2)))
2744 #if __has_feature(attribute_availability_with_message)
2745 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.2,message=_msg)))
2746 #else
2747 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.2)))
2748 #endif
2749 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=9.2,deprecated=10.3)))
2750 #if __has_feature(attribute_availability_with_message)
2751 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.3,message=_msg)))
2752 #else
2753 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=10.3)))
2754 #endif
2755 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_9_2 __attribute__((availability(ios,introduced=9.2,deprecated=9.2)))
2756 #if __has_feature(attribute_availability_with_message)
2757 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=9.2,message=_msg)))
2758 #else
2759 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_9_2_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=9.2)))
2760 #endif
2761 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=9.2,deprecated=9.3)))
2762 #if __has_feature(attribute_availability_with_message)
2763 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=9.3,message=_msg)))
2764 #else
2765 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.2,deprecated=9.3)))
2766 #endif
2767 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_NA __attribute__((availability(ios,introduced=9.2)))
2768 #define __AVAILABILITY_INTERNAL__IPHONE_9_2_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=9.2)))
2769 #define __AVAILABILITY_INTERNAL__IPHONE_9_3 __attribute__((availability(ios,introduced=9.3)))
2770 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=9.3,deprecated=10.0)))
2771 #if __has_feature(attribute_availability_with_message)
2772 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.0,message=_msg)))
2773 #else
2774 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.0)))
2775 #endif
2776 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=9.3,deprecated=10.1)))
2777 #if __has_feature(attribute_availability_with_message)
2778 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.1,message=_msg)))
2779 #else
2780 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.1)))
2781 #endif
2782 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=9.3,deprecated=10.2)))
2783 #if __has_feature(attribute_availability_with_message)
2784 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.2,message=_msg)))
2785 #else
2786 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.2)))
2787 #endif
2788 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=9.3,deprecated=10.3)))
2789 #if __has_feature(attribute_availability_with_message)
2790 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.3,message=_msg)))
2791 #else
2792 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=10.3)))
2793 #endif
2794 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_9_3 __attribute__((availability(ios,introduced=9.3,deprecated=9.3)))
2795 #if __has_feature(attribute_availability_with_message)
2796 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=9.3,message=_msg)))
2797 #else
2798 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_9_3_MSG(_msg) __attribute__((availability(ios,introduced=9.3,deprecated=9.3)))
2799 #endif
2800 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_NA __attribute__((availability(ios,introduced=9.3)))
2801 #define __AVAILABILITY_INTERNAL__IPHONE_9_3_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=9.3)))
2802 #define __AVAILABILITY_INTERNAL__IPHONE_10_0 __attribute__((availability(ios,introduced=10.0)))
2803 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_0 __attribute__((availability(ios,introduced=10.0,deprecated=10.0)))
2804 #if __has_feature(attribute_availability_with_message)
2805 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.0,message=_msg)))
2806 #else
2807 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_0_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.0)))
2808 #endif
2809 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=10.0,deprecated=10.1)))
2810 #if __has_feature(attribute_availability_with_message)
2811 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.1,message=_msg)))
2812 #else
2813 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.1)))
2814 #endif
2815 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=10.0,deprecated=10.2)))
2816 #if __has_feature(attribute_availability_with_message)
2817 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.2,message=_msg)))
2818 #else
2819 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.2)))
2820 #endif
2821 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=10.0,deprecated=10.3)))
2822 #if __has_feature(attribute_availability_with_message)
2823 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.3,message=_msg)))
2824 #else
2825 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.0,deprecated=10.3)))
2826 #endif
2827 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_11_0 __attribute__((availability(ios,introduced=10.0,deprecated=11.0)))
2828 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_12_0 __attribute__((availability(ios,introduced=10.0,deprecated=12.0)))
2829 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_NA __attribute__((availability(ios,introduced=10.0)))
2830 #define __AVAILABILITY_INTERNAL__IPHONE_10_0_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=10.0)))
2831 #define __AVAILABILITY_INTERNAL__IPHONE_10_1 __attribute__((availability(ios,introduced=10.1)))
2832 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_1 __attribute__((availability(ios,introduced=10.1,deprecated=10.1)))
2833 #if __has_feature(attribute_availability_with_message)
2834 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=10.1,deprecated=10.1,message=_msg)))
2835 #else
2836 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_1_MSG(_msg) __attribute__((availability(ios,introduced=10.1,deprecated=10.1)))
2837 #endif
2838 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=10.1,deprecated=10.2)))
2839 #if __has_feature(attribute_availability_with_message)
2840 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=10.1,deprecated=10.2,message=_msg)))
2841 #else
2842 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=10.1,deprecated=10.2)))
2843 #endif
2844 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=10.1,deprecated=10.3)))
2845 #if __has_feature(attribute_availability_with_message)
2846 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.1,deprecated=10.3,message=_msg)))
2847 #else
2848 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.1,deprecated=10.3)))
2849 #endif
2850 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_NA __attribute__((availability(ios,introduced=10.1)))
2851 #define __AVAILABILITY_INTERNAL__IPHONE_10_1_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=10.1)))
2852 #define __AVAILABILITY_INTERNAL__IPHONE_10_2 __attribute__((availability(ios,introduced=10.2)))
2853 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_10_2 __attribute__((availability(ios,introduced=10.2,deprecated=10.2)))
2854 #if __has_feature(attribute_availability_with_message)
2855 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=10.2,deprecated=10.2,message=_msg)))
2856 #else
2857 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_10_2_MSG(_msg) __attribute__((availability(ios,introduced=10.2,deprecated=10.2)))
2858 #endif
2859 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=10.2,deprecated=10.3)))
2860 #if __has_feature(attribute_availability_with_message)
2861 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.2,deprecated=10.3,message=_msg)))
2862 #else
2863 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.2,deprecated=10.3)))
2864 #endif
2865 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_NA __attribute__((availability(ios,introduced=10.2)))
2866 #define __AVAILABILITY_INTERNAL__IPHONE_10_2_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=10.2)))
2867 #define __AVAILABILITY_INTERNAL__IPHONE_10_3 __attribute__((availability(ios,introduced=10.3)))
2868 #define __AVAILABILITY_INTERNAL__IPHONE_10_3_DEP__IPHONE_10_3 __attribute__((availability(ios,introduced=10.3,deprecated=10.3)))
2869 #if __has_feature(attribute_availability_with_message)
2870 #define __AVAILABILITY_INTERNAL__IPHONE_10_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.3,deprecated=10.3,message=_msg)))
2871 #else
2872 #define __AVAILABILITY_INTERNAL__IPHONE_10_3_DEP__IPHONE_10_3_MSG(_msg) __attribute__((availability(ios,introduced=10.3,deprecated=10.3)))
2873 #endif
2874 #define __AVAILABILITY_INTERNAL__IPHONE_10_3_DEP__IPHONE_NA __attribute__((availability(ios,introduced=10.3)))
2875 #define __AVAILABILITY_INTERNAL__IPHONE_10_3_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,introduced=10.3)))
2876 #define __AVAILABILITY_INTERNAL__IPHONE_11 __attribute__((availability(ios,introduced=11)))
2877 #define __AVAILABILITY_INTERNAL__IPHONE_11_0 __attribute__((availability(ios,introduced=11.0)))
2878 #define __AVAILABILITY_INTERNAL__IPHONE_11_3 __attribute__((availability(ios,introduced=11.3)))
2879 #define __AVAILABILITY_INTERNAL__IPHONE_12_0 __attribute__((availability(ios,introduced=12.0)))
2880 #define __AVAILABILITY_INTERNAL__IPHONE_13_0 __attribute__((availability(ios,introduced=13.0)))
2881
2882 #define __AVAILABILITY_INTERNAL__IPHONE_NA __attribute__((availability(ios,unavailable)))
2883 #define __AVAILABILITY_INTERNAL__IPHONE_NA__IPHONE_NA __attribute__((availability(ios,unavailable)))
2884 #define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA __attribute__((availability(ios,unavailable)))
2885 #define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,unavailable)))
2886
2887 #if __has_builtin(__is_target_arch)
2888 #if __has_builtin(__is_target_vendor)
2889 #if __has_builtin(__is_target_os)
2890 #if __has_builtin(__is_target_environment)
2891 #if __has_builtin(__is_target_variant_os)
2892 #if __has_builtin(__is_target_variant_environment)
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))
2894 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0)))
2895 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable)))
2896 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,unavailable)))
2897 #endif
2898 #endif /* #if __has_builtin(__is_target_variant_environment) */
2899 #endif /* #if __has_builtin(__is_target_variant_os) */
2900 #endif /* #if __has_builtin(__is_target_environment) */
2901 #endif /* #if __has_builtin(__is_target_os) */
2902 #endif /* #if __has_builtin(__is_target_vendor) */
2903 #endif /* #if __has_builtin(__is_target_arch) */
2904
2905 #ifndef __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION
2906 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0)))
2907 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0,deprecated=4.0)))
2908 #if __has_feature(attribute_availability_with_message)
2909 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.0,message=_msg)))
2910 #else
2911 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,introduced=4.0,deprecated=4.0)))
2912 #endif
2913 #endif /* __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION */
2914 #endif
2915 #endif
2916#endif
2917
2918#if __ENABLE_LEGACY_MAC_AVAILABILITY
2919 #if defined(__has_attribute) && defined(__has_feature)
2920 #if __has_attribute(availability)
2921 /* use better attributes if possible */
2922 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.1,deprecated=10.1)))
2923 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.1,deprecated=10.10)))
2924 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.1,deprecated=10.10.2)))
2925 #if __has_feature(attribute_availability_with_message)
2926 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10.2,message=_msg)))
2927 #else
2928 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10.2)))
2929 #endif
2930 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.1,deprecated=10.10.3)))
2931 #if __has_feature(attribute_availability_with_message)
2932 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10.3,message=_msg)))
2933 #else
2934 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10.3)))
2935 #endif
2936 #if __has_feature(attribute_availability_with_message)
2937 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10,message=_msg)))
2938 #else
2939 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10)))
2940 #endif
2941 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.1,deprecated=10.11)))
2942 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.2)))
2943 #if __has_feature(attribute_availability_with_message)
2944 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.2,message=_msg)))
2945 #else
2946 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.2)))
2947 #endif
2948 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.3)))
2949 #if __has_feature(attribute_availability_with_message)
2950 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.3,message=_msg)))
2951 #else
2952 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.3)))
2953 #endif
2954 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.4)))
2955 #if __has_feature(attribute_availability_with_message)
2956 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.4,message=_msg)))
2957 #else
2958 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11.4)))
2959 #endif
2960 #if __has_feature(attribute_availability_with_message)
2961 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11,message=_msg)))
2962 #else
2963 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11)))
2964 #endif
2965 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.1,deprecated=10.12)))
2966 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.1)))
2967 #if __has_feature(attribute_availability_with_message)
2968 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.1,message=_msg)))
2969 #else
2970 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.1)))
2971 #endif
2972 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.2)))
2973 #if __has_feature(attribute_availability_with_message)
2974 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.2,message=_msg)))
2975 #else
2976 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.2)))
2977 #endif
2978 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.4)))
2979 #if __has_feature(attribute_availability_with_message)
2980 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.4,message=_msg)))
2981 #else
2982 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12.4)))
2983 #endif
2984 #if __has_feature(attribute_availability_with_message)
2985 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12,message=_msg)))
2986 #else
2987 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.12)))
2988 #endif
2989 #if __has_feature(attribute_availability_with_message)
2990 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.1,message=_msg)))
2991 #else
2992 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.1)))
2993 #endif
2994 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_2 __attribute__((availability(macosx,introduced=10.1,deprecated=10.2)))
2995 #if __has_feature(attribute_availability_with_message)
2996 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.2,message=_msg)))
2997 #else
2998 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.2)))
2999 #endif
3000 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_3 __attribute__((availability(macosx,introduced=10.1,deprecated=10.3)))
3001 #if __has_feature(attribute_availability_with_message)
3002 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,message=_msg)))
3003 #else
3004 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3)))
3005 #endif
3006 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_4 __attribute__((availability(macosx,introduced=10.1,deprecated=10.4)))
3007 #if __has_feature(attribute_availability_with_message)
3008 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.4,message=_msg)))
3009 #else
3010 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.4)))
3011 #endif
3012 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_5 __attribute__((availability(macosx,introduced=10.1,deprecated=10.5)))
3013 #if __has_feature(attribute_availability_with_message)
3014 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.5,message=_msg)))
3015 #else
3016 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.5)))
3017 #endif
3018 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.1,deprecated=10.6)))
3019 #if __has_feature(attribute_availability_with_message)
3020 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.6,message=_msg)))
3021 #else
3022 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.6)))
3023 #endif
3024 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.1,deprecated=10.7)))
3025 #if __has_feature(attribute_availability_with_message)
3026 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.7,message=_msg)))
3027 #else
3028 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.7)))
3029 #endif
3030 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.1,deprecated=10.8)))
3031 #if __has_feature(attribute_availability_with_message)
3032 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8,message=_msg)))
3033 #else
3034 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8)))
3035 #endif
3036 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.1,deprecated=10.9)))
3037 #if __has_feature(attribute_availability_with_message)
3038 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.9,message=_msg)))
3039 #else
3040 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.1,deprecated=10.9)))
3041 #endif
3042 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.1)))
3043 #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.1)))
3044 #define __AVAILABILITY_INTERNAL__MAC_10_2 __attribute__((availability(macosx,introduced=10.2)))
3045 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.2,deprecated=10.1)))
3046 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.2,deprecated=10.10)))
3047 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.2,deprecated=10.10.2)))
3048 #if __has_feature(attribute_availability_with_message)
3049 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10.2,message=_msg)))
3050 #else
3051 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10.2)))
3052 #endif
3053 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.2,deprecated=10.10.3)))
3054 #if __has_feature(attribute_availability_with_message)
3055 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10.3,message=_msg)))
3056 #else
3057 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10.3)))
3058 #endif
3059 #if __has_feature(attribute_availability_with_message)
3060 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10,message=_msg)))
3061 #else
3062 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10)))
3063 #endif
3064 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.2,deprecated=10.11)))
3065 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.2)))
3066 #if __has_feature(attribute_availability_with_message)
3067 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.2,message=_msg)))
3068 #else
3069 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.2)))
3070 #endif
3071 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.3)))
3072 #if __has_feature(attribute_availability_with_message)
3073 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.3,message=_msg)))
3074 #else
3075 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.3)))
3076 #endif
3077 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.4)))
3078 #if __has_feature(attribute_availability_with_message)
3079 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.4,message=_msg)))
3080 #else
3081 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11.4)))
3082 #endif
3083 #if __has_feature(attribute_availability_with_message)
3084 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11,message=_msg)))
3085 #else
3086 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.11)))
3087 #endif
3088 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.2,deprecated=10.12)))
3089 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.1)))
3090 #if __has_feature(attribute_availability_with_message)
3091 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.1,message=_msg)))
3092 #else
3093 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.1)))
3094 #endif
3095 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.2)))
3096 #if __has_feature(attribute_availability_with_message)
3097 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.2,message=_msg)))
3098 #else
3099 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.2)))
3100 #endif
3101 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.4)))
3102 #if __has_feature(attribute_availability_with_message)
3103 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.4,message=_msg)))
3104 #else
3105 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12.4)))
3106 #endif
3107 #if __has_feature(attribute_availability_with_message)
3108 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12,message=_msg)))
3109 #else
3110 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.12)))
3111 #endif
3112 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.2,deprecated=10.13)))
3113 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_2 __attribute__((availability(macosx,introduced=10.2,deprecated=10.2)))
3114 #if __has_feature(attribute_availability_with_message)
3115 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.2,message=_msg)))
3116 #else
3117 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.2)))
3118 #endif
3119 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_3 __attribute__((availability(macosx,introduced=10.2,deprecated=10.3)))
3120 #if __has_feature(attribute_availability_with_message)
3121 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.3,message=_msg)))
3122 #else
3123 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.3)))
3124 #endif
3125 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_4 __attribute__((availability(macosx,introduced=10.2,deprecated=10.4)))
3126 #if __has_feature(attribute_availability_with_message)
3127 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,message=_msg)))
3128 #else
3129 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.4)))
3130 #endif
3131 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_5 __attribute__((availability(macosx,introduced=10.2,deprecated=10.5)))
3132 #if __has_feature(attribute_availability_with_message)
3133 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.5,message=_msg)))
3134 #else
3135 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.5)))
3136 #endif
3137 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.2,deprecated=10.6)))
3138 #if __has_feature(attribute_availability_with_message)
3139 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.6,message=_msg)))
3140 #else
3141 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.6)))
3142 #endif
3143 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.2,deprecated=10.7)))
3144 #if __has_feature(attribute_availability_with_message)
3145 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.7,message=_msg)))
3146 #else
3147 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.7)))
3148 #endif
3149 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.2,deprecated=10.8)))
3150 #if __has_feature(attribute_availability_with_message)
3151 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8,message=_msg)))
3152 #else
3153 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8)))
3154 #endif
3155 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.2,deprecated=10.9)))
3156 #if __has_feature(attribute_availability_with_message)
3157 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.9,message=_msg)))
3158 #else
3159 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.2,deprecated=10.9)))
3160 #endif
3161 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.2)))
3162 #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.2)))
3163 #define __AVAILABILITY_INTERNAL__MAC_10_3 __attribute__((availability(macosx,introduced=10.3)))
3164 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.3,deprecated=10.1)))
3165 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.3,deprecated=10.10)))
3166 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.3,deprecated=10.10.2)))
3167 #if __has_feature(attribute_availability_with_message)
3168 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10.2,message=_msg)))
3169 #else
3170 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10.2)))
3171 #endif
3172 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.3,deprecated=10.10.3)))
3173 #if __has_feature(attribute_availability_with_message)
3174 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10.3,message=_msg)))
3175 #else
3176 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10.3)))
3177 #endif
3178 #if __has_feature(attribute_availability_with_message)
3179 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10,message=_msg)))
3180 #else
3181 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10)))
3182 #endif
3183 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.3,deprecated=10.11)))
3184 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.2)))
3185 #if __has_feature(attribute_availability_with_message)
3186 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.2,message=_msg)))
3187 #else
3188 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.2)))
3189 #endif
3190 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.3)))
3191 #if __has_feature(attribute_availability_with_message)
3192 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.3,message=_msg)))
3193 #else
3194 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.3)))
3195 #endif
3196 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.4)))
3197 #if __has_feature(attribute_availability_with_message)
3198 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.4,message=_msg)))
3199 #else
3200 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11.4)))
3201 #endif
3202 #if __has_feature(attribute_availability_with_message)
3203 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11,message=_msg)))
3204 #else
3205 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.11)))
3206 #endif
3207 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.3,deprecated=10.12)))
3208 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.1)))
3209 #if __has_feature(attribute_availability_with_message)
3210 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.1,message=_msg)))
3211 #else
3212 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.1)))
3213 #endif
3214 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.2)))
3215 #if __has_feature(attribute_availability_with_message)
3216 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.2,message=_msg)))
3217 #else
3218 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.2)))
3219 #endif
3220 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.4)))
3221 #if __has_feature(attribute_availability_with_message)
3222 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.4,message=_msg)))
3223 #else
3224 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12.4)))
3225 #endif
3226 #if __has_feature(attribute_availability_with_message)
3227 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12,message=_msg)))
3228 #else
3229 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.12)))
3230 #endif
3231 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.3,deprecated=10.13)))
3232 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_3 __attribute__((availability(macosx,introduced=10.3,deprecated=10.3)))
3233 #if __has_feature(attribute_availability_with_message)
3234 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.3,message=_msg)))
3235 #else
3236 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.3)))
3237 #endif
3238 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_4 __attribute__((availability(macosx,introduced=10.3,deprecated=10.4)))
3239 #if __has_feature(attribute_availability_with_message)
3240 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4,message=_msg)))
3241 #else
3242 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4)))
3243 #endif
3244 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_5 __attribute__((availability(macosx,introduced=10.3,deprecated=10.5)))
3245 #if __has_feature(attribute_availability_with_message)
3246 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.5,message=_msg)))
3247 #else
3248 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.5)))
3249 #endif
3250 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.3,deprecated=10.6)))
3251 #if __has_feature(attribute_availability_with_message)
3252 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.6,message=_msg)))
3253 #else
3254 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.6)))
3255 #endif
3256 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.3,deprecated=10.7)))
3257 #if __has_feature(attribute_availability_with_message)
3258 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.7,message=_msg)))
3259 #else
3260 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.7)))
3261 #endif
3262 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.3,deprecated=10.8)))
3263 #if __has_feature(attribute_availability_with_message)
3264 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8,message=_msg)))
3265 #else
3266 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8)))
3267 #endif
3268 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.3,deprecated=10.9)))
3269 #if __has_feature(attribute_availability_with_message)
3270 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.9,message=_msg)))
3271 #else
3272 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.3,deprecated=10.9)))
3273 #endif
3274 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.3)))
3275 #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.3)))
3276 #define __AVAILABILITY_INTERNAL__MAC_10_4 __attribute__((availability(macosx,introduced=10.4)))
3277 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.4,deprecated=10.1)))
3278 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.4,deprecated=10.10)))
3279 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.4,deprecated=10.10.2)))
3280 #if __has_feature(attribute_availability_with_message)
3281 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10.2,message=_msg)))
3282 #else
3283 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10.2)))
3284 #endif
3285 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.4,deprecated=10.10.3)))
3286 #if __has_feature(attribute_availability_with_message)
3287 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10.3,message=_msg)))
3288 #else
3289 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10.3)))
3290 #endif
3291 #if __has_feature(attribute_availability_with_message)
3292 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message=_msg)))
3293 #else
3294 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10)))
3295 #endif
3296 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.4,deprecated=10.11)))
3297 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.2)))
3298 #if __has_feature(attribute_availability_with_message)
3299 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.2,message=_msg)))
3300 #else
3301 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.2)))
3302 #endif
3303 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.3)))
3304 #if __has_feature(attribute_availability_with_message)
3305 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.3,message=_msg)))
3306 #else
3307 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.3)))
3308 #endif
3309 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.4)))
3310 #if __has_feature(attribute_availability_with_message)
3311 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.4,message=_msg)))
3312 #else
3313 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11.4)))
3314 #endif
3315 #if __has_feature(attribute_availability_with_message)
3316 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11,message=_msg)))
3317 #else
3318 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11)))
3319 #endif
3320 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.4,deprecated=10.12)))
3321 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.1)))
3322 #if __has_feature(attribute_availability_with_message)
3323 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.1,message=_msg)))
3324 #else
3325 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.1)))
3326 #endif
3327 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.2)))
3328 #if __has_feature(attribute_availability_with_message)
3329 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.2,message=_msg)))
3330 #else
3331 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.2)))
3332 #endif
3333 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.4)))
3334 #if __has_feature(attribute_availability_with_message)
3335 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.4,message=_msg)))
3336 #else
3337 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12.4)))
3338 #endif
3339 #if __has_feature(attribute_availability_with_message)
3340 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12,message=_msg)))
3341 #else
3342 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.12)))
3343 #endif
3344 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.4,deprecated=10.13)))
3345 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_4 __attribute__((availability(macosx,introduced=10.4,deprecated=10.4)))
3346 #if __has_feature(attribute_availability_with_message)
3347 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.4,message=_msg)))
3348 #else
3349 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.4)))
3350 #endif
3351 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_5 __attribute__((availability(macosx,introduced=10.4,deprecated=10.5)))
3352 #if __has_feature(attribute_availability_with_message)
3353 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,message=_msg)))
3354 #else
3355 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5)))
3356 #endif
3357 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.4,deprecated=10.6)))
3358 #if __has_feature(attribute_availability_with_message)
3359 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,message=_msg)))
3360 #else
3361 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6)))
3362 #endif
3363 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.4,deprecated=10.7)))
3364 #if __has_feature(attribute_availability_with_message)
3365 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.7,message=_msg)))
3366 #else
3367 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.7)))
3368 #endif
3369 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.4,deprecated=10.8)))
3370 #if __has_feature(attribute_availability_with_message)
3371 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8,message=_msg)))
3372 #else
3373 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8)))
3374 #endif
3375 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.4,deprecated=10.9)))
3376 #if __has_feature(attribute_availability_with_message)
3377 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.9,message=_msg)))
3378 #else
3379 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.4,deprecated=10.9)))
3380 #endif
3381 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.4)))
3382 #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.4)))
3383 #define __AVAILABILITY_INTERNAL__MAC_10_5 __attribute__((availability(macosx,introduced=10.5)))
3384 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEPRECATED__MAC_10_7 __attribute__((availability(macosx,introduced=10.5.DEPRECATED..MAC.10.7)))
3385 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.5,deprecated=10.1)))
3386 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.5,deprecated=10.10)))
3387 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.5,deprecated=10.10.2)))
3388 #if __has_feature(attribute_availability_with_message)
3389 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10.2,message=_msg)))
3390 #else
3391 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10.2)))
3392 #endif
3393 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.5,deprecated=10.10.3)))
3394 #if __has_feature(attribute_availability_with_message)
3395 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10.3,message=_msg)))
3396 #else
3397 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10.3)))
3398 #endif
3399 #if __has_feature(attribute_availability_with_message)
3400 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10,message=_msg)))
3401 #else
3402 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10)))
3403 #endif
3404 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.5,deprecated=10.11)))
3405 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.2)))
3406 #if __has_feature(attribute_availability_with_message)
3407 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.2,message=_msg)))
3408 #else
3409 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.2)))
3410 #endif
3411 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.3)))
3412 #if __has_feature(attribute_availability_with_message)
3413 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.3,message=_msg)))
3414 #else
3415 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.3)))
3416 #endif
3417 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.4)))
3418 #if __has_feature(attribute_availability_with_message)
3419 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.4,message=_msg)))
3420 #else
3421 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11.4)))
3422 #endif
3423 #if __has_feature(attribute_availability_with_message)
3424 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message=_msg)))
3425 #else
3426 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11)))
3427 #endif
3428 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.5,deprecated=10.12)))
3429 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.1)))
3430 #if __has_feature(attribute_availability_with_message)
3431 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.1,message=_msg)))
3432 #else
3433 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.1)))
3434 #endif
3435 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.2)))
3436 #if __has_feature(attribute_availability_with_message)
3437 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.2,message=_msg)))
3438 #else
3439 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.2)))
3440 #endif
3441 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.4)))
3442 #if __has_feature(attribute_availability_with_message)
3443 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.4,message=_msg)))
3444 #else
3445 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12.4)))
3446 #endif
3447 #if __has_feature(attribute_availability_with_message)
3448 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12,message=_msg)))
3449 #else
3450 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.12)))
3451 #endif
3452 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_5 __attribute__((availability(macosx,introduced=10.5,deprecated=10.5)))
3453 #if __has_feature(attribute_availability_with_message)
3454 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.5,message=_msg)))
3455 #else
3456 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.5)))
3457 #endif
3458 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.5,deprecated=10.6)))
3459 #if __has_feature(attribute_availability_with_message)
3460 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.6,message=_msg)))
3461 #else
3462 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.6)))
3463 #endif
3464 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.5,deprecated=10.7)))
3465 #if __has_feature(attribute_availability_with_message)
3466 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.7,message=_msg)))
3467 #else
3468 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.7)))
3469 #endif
3470 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.5,deprecated=10.8)))
3471 #if __has_feature(attribute_availability_with_message)
3472 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message=_msg)))
3473 #else
3474 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8)))
3475 #endif
3476 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.5,deprecated=10.9)))
3477 #if __has_feature(attribute_availability_with_message)
3478 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.9,message=_msg)))
3479 #else
3480 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.5,deprecated=10.9)))
3481 #endif
3482 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.5)))
3483 #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.5)))
3484 #define __AVAILABILITY_INTERNAL__MAC_10_6 __attribute__((availability(macosx,introduced=10.6)))
3485 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.6,deprecated=10.1)))
3486 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.6,deprecated=10.10)))
3487 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.6,deprecated=10.10.2)))
3488 #if __has_feature(attribute_availability_with_message)
3489 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.10.2,message=_msg)))
3490 #else
3491 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.10.2)))
3492 #endif
3493 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.6,deprecated=10.10.3)))
3494 #if __has_feature(attribute_availability_with_message)
3495 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.10.3,message=_msg)))
3496 #else
3497 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.10.3)))
3498 #endif
3499 #if __has_feature(attribute_availability_with_message)
3500 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.10,message=_msg)))
3501 #else
3502 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.10)))
3503 #endif
3504 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.6,deprecated=10.11)))
3505 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.2)))
3506 #if __has_feature(attribute_availability_with_message)
3507 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.2,message=_msg)))
3508 #else
3509 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.2)))
3510 #endif
3511 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.3)))
3512 #if __has_feature(attribute_availability_with_message)
3513 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.3,message=_msg)))
3514 #else
3515 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.3)))
3516 #endif
3517 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.4)))
3518 #if __has_feature(attribute_availability_with_message)
3519 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.4,message=_msg)))
3520 #else
3521 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11.4)))
3522 #endif
3523 #if __has_feature(attribute_availability_with_message)
3524 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11,message=_msg)))
3525 #else
3526 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.11)))
3527 #endif
3528 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.6,deprecated=10.12)))
3529 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.1)))
3530 #if __has_feature(attribute_availability_with_message)
3531 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.1,message=_msg)))
3532 #else
3533 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.1)))
3534 #endif
3535 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.2)))
3536 #if __has_feature(attribute_availability_with_message)
3537 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.2,message=_msg)))
3538 #else
3539 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.2)))
3540 #endif
3541 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.4)))
3542 #if __has_feature(attribute_availability_with_message)
3543 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.4,message=_msg)))
3544 #else
3545 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12.4)))
3546 #endif
3547 #if __has_feature(attribute_availability_with_message)
3548 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12,message=_msg)))
3549 #else
3550 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.12)))
3551 #endif
3552 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.6,deprecated=10.13)))
3553 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.6,deprecated=10.6)))
3554 #if __has_feature(attribute_availability_with_message)
3555 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.6,message=_msg)))
3556 #else
3557 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.6)))
3558 #endif
3559 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.6,deprecated=10.7)))
3560 #if __has_feature(attribute_availability_with_message)
3561 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.7,message=_msg)))
3562 #else
3563 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.7)))
3564 #endif
3565 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.6,deprecated=10.8)))
3566 #if __has_feature(attribute_availability_with_message)
3567 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.8,message=_msg)))
3568 #else
3569 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.8)))
3570 #endif
3571 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.6,deprecated=10.9)))
3572 #if __has_feature(attribute_availability_with_message)
3573 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.9,message=_msg)))
3574 #else
3575 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.6,deprecated=10.9)))
3576 #endif
3577 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.6)))
3578 #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.6)))
3579 #define __AVAILABILITY_INTERNAL__MAC_10_7 __attribute__((availability(macosx,introduced=10.7)))
3580 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.7,deprecated=10.1)))
3581 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.7,deprecated=10.10)))
3582 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.7,deprecated=10.10.2)))
3583 #if __has_feature(attribute_availability_with_message)
3584 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.10.2,message=_msg)))
3585 #else
3586 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.10.2)))
3587 #endif
3588 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.7,deprecated=10.10.3)))
3589 #if __has_feature(attribute_availability_with_message)
3590 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.10.3,message=_msg)))
3591 #else
3592 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.10.3)))
3593 #endif
3594 #if __has_feature(attribute_availability_with_message)
3595 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.10,message=_msg)))
3596 #else
3597 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.10)))
3598 #endif
3599 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.7,deprecated=10.11)))
3600 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.2)))
3601 #if __has_feature(attribute_availability_with_message)
3602 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.2,message=_msg)))
3603 #else
3604 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.2)))
3605 #endif
3606 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.3)))
3607 #if __has_feature(attribute_availability_with_message)
3608 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.3,message=_msg)))
3609 #else
3610 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.3)))
3611 #endif
3612 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.4)))
3613 #if __has_feature(attribute_availability_with_message)
3614 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.4,message=_msg)))
3615 #else
3616 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11.4)))
3617 #endif
3618 #if __has_feature(attribute_availability_with_message)
3619 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11,message=_msg)))
3620 #else
3621 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.11)))
3622 #endif
3623 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.7,deprecated=10.12)))
3624 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.1)))
3625 #if __has_feature(attribute_availability_with_message)
3626 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.1,message=_msg)))
3627 #else
3628 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.1)))
3629 #endif
3630 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.2)))
3631 #if __has_feature(attribute_availability_with_message)
3632 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.2,message=_msg)))
3633 #else
3634 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.2)))
3635 #endif
3636 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.4)))
3637 #if __has_feature(attribute_availability_with_message)
3638 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.4,message=_msg)))
3639 #else
3640 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12.4)))
3641 #endif
3642 #if __has_feature(attribute_availability_with_message)
3643 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12,message=_msg)))
3644 #else
3645 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.12)))
3646 #endif
3647 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_13_2 __attribute__((availability(macosx,introduced=10.7,deprecated=10.13.2)))
3648 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.7,deprecated=10.7)))
3649 #if __has_feature(attribute_availability_with_message)
3650 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.7,message=_msg)))
3651 #else
3652 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.7)))
3653 #endif
3654 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.7,deprecated=10.8)))
3655 #if __has_feature(attribute_availability_with_message)
3656 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.8,message=_msg)))
3657 #else
3658 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.8)))
3659 #endif
3660 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.7,deprecated=10.9)))
3661 #if __has_feature(attribute_availability_with_message)
3662 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.9,message=_msg)))
3663 #else
3664 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.7,deprecated=10.9)))
3665 #endif
3666 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.7)))
3667 #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.7)))
3668 #define __AVAILABILITY_INTERNAL__MAC_10_8 __attribute__((availability(macosx,introduced=10.8)))
3669 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.8,deprecated=10.1)))
3670 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.8,deprecated=10.10)))
3671 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.8,deprecated=10.10.2)))
3672 #if __has_feature(attribute_availability_with_message)
3673 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.10.2,message=_msg)))
3674 #else
3675 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.10.2)))
3676 #endif
3677 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.8,deprecated=10.10.3)))
3678 #if __has_feature(attribute_availability_with_message)
3679 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.10.3,message=_msg)))
3680 #else
3681 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.10.3)))
3682 #endif
3683 #if __has_feature(attribute_availability_with_message)
3684 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.10,message=_msg)))
3685 #else
3686 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.10)))
3687 #endif
3688 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.8,deprecated=10.11)))
3689 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.2)))
3690 #if __has_feature(attribute_availability_with_message)
3691 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.2,message=_msg)))
3692 #else
3693 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.2)))
3694 #endif
3695 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.3)))
3696 #if __has_feature(attribute_availability_with_message)
3697 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.3,message=_msg)))
3698 #else
3699 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.3)))
3700 #endif
3701 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.4)))
3702 #if __has_feature(attribute_availability_with_message)
3703 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.4,message=_msg)))
3704 #else
3705 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11.4)))
3706 #endif
3707 #if __has_feature(attribute_availability_with_message)
3708 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11,message=_msg)))
3709 #else
3710 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.11)))
3711 #endif
3712 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.8,deprecated=10.12)))
3713 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.1)))
3714 #if __has_feature(attribute_availability_with_message)
3715 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.1,message=_msg)))
3716 #else
3717 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.1)))
3718 #endif
3719 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.2)))
3720 #if __has_feature(attribute_availability_with_message)
3721 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.2,message=_msg)))
3722 #else
3723 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.2)))
3724 #endif
3725 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.4)))
3726 #if __has_feature(attribute_availability_with_message)
3727 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.4,message=_msg)))
3728 #else
3729 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12.4)))
3730 #endif
3731 #if __has_feature(attribute_availability_with_message)
3732 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12,message=_msg)))
3733 #else
3734 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.12)))
3735 #endif
3736 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.8,deprecated=10.13)))
3737 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.8,deprecated=10.8)))
3738 #if __has_feature(attribute_availability_with_message)
3739 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.8,message=_msg)))
3740 #else
3741 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.8)))
3742 #endif
3743 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.8,deprecated=10.9)))
3744 #if __has_feature(attribute_availability_with_message)
3745 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.9,message=_msg)))
3746 #else
3747 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.8,deprecated=10.9)))
3748 #endif
3749 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.8)))
3750 #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.8)))
3751 #define __AVAILABILITY_INTERNAL__MAC_10_9 __attribute__((availability(macosx,introduced=10.9)))
3752 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.9,deprecated=10.1)))
3753 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.9,deprecated=10.10)))
3754 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.9,deprecated=10.10.2)))
3755 #if __has_feature(attribute_availability_with_message)
3756 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.10.2,message=_msg)))
3757 #else
3758 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.10.2)))
3759 #endif
3760 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.9,deprecated=10.10.3)))
3761 #if __has_feature(attribute_availability_with_message)
3762 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.10.3,message=_msg)))
3763 #else
3764 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.10.3)))
3765 #endif
3766 #if __has_feature(attribute_availability_with_message)
3767 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.10,message=_msg)))
3768 #else
3769 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.10)))
3770 #endif
3771 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.9,deprecated=10.11)))
3772 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.2)))
3773 #if __has_feature(attribute_availability_with_message)
3774 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.2,message=_msg)))
3775 #else
3776 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.2)))
3777 #endif
3778 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.3)))
3779 #if __has_feature(attribute_availability_with_message)
3780 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.3,message=_msg)))
3781 #else
3782 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.3)))
3783 #endif
3784 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.4)))
3785 #if __has_feature(attribute_availability_with_message)
3786 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.4,message=_msg)))
3787 #else
3788 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11.4)))
3789 #endif
3790 #if __has_feature(attribute_availability_with_message)
3791 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11,message=_msg)))
3792 #else
3793 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.11)))
3794 #endif
3795 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.9,deprecated=10.12)))
3796 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.1)))
3797 #if __has_feature(attribute_availability_with_message)
3798 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.1,message=_msg)))
3799 #else
3800 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.1)))
3801 #endif
3802 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.2)))
3803 #if __has_feature(attribute_availability_with_message)
3804 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.2,message=_msg)))
3805 #else
3806 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.2)))
3807 #endif
3808 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.4)))
3809 #if __has_feature(attribute_availability_with_message)
3810 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.4,message=_msg)))
3811 #else
3812 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12.4)))
3813 #endif
3814 #if __has_feature(attribute_availability_with_message)
3815 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12,message=_msg)))
3816 #else
3817 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.12)))
3818 #endif
3819 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.9,deprecated=10.13)))
3820 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_14 __attribute__((availability(macosx,introduced=10.9,deprecated=10.14)))
3821 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.9,deprecated=10.9)))
3822 #if __has_feature(attribute_availability_with_message)
3823 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.9,message=_msg)))
3824 #else
3825 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.9,deprecated=10.9)))
3826 #endif
3827 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.9)))
3828 #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.9)))
3829 #define __AVAILABILITY_INTERNAL__MAC_10_0 __attribute__((availability(macosx,introduced=10.0)))
3830 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0 __attribute__((availability(macosx,introduced=10.0,deprecated=10.0)))
3831 #if __has_feature(attribute_availability_with_message)
3832 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.0,message=_msg)))
3833 #else
3834 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.0)))
3835 #endif
3836 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.1)))
3837 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.0,deprecated=10.10)))
3838 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.2)))
3839 #if __has_feature(attribute_availability_with_message)
3840 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.2,message=_msg)))
3841 #else
3842 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.2)))
3843 #endif
3844 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.3)))
3845 #if __has_feature(attribute_availability_with_message)
3846 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.3,message=_msg)))
3847 #else
3848 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.3)))
3849 #endif
3850 #if __has_feature(attribute_availability_with_message)
3851 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message=_msg)))
3852 #else
3853 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10)))
3854 #endif
3855 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.0,deprecated=10.11)))
3856 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.2)))
3857 #if __has_feature(attribute_availability_with_message)
3858 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.2,message=_msg)))
3859 #else
3860 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.2)))
3861 #endif
3862 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.3)))
3863 #if __has_feature(attribute_availability_with_message)
3864 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.3,message=_msg)))
3865 #else
3866 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.3)))
3867 #endif
3868 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.4)))
3869 #if __has_feature(attribute_availability_with_message)
3870 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.4,message=_msg)))
3871 #else
3872 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11.4)))
3873 #endif
3874 #if __has_feature(attribute_availability_with_message)
3875 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11,message=_msg)))
3876 #else
3877 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11)))
3878 #endif
3879 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.0,deprecated=10.12)))
3880 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.1)))
3881 #if __has_feature(attribute_availability_with_message)
3882 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.1,message=_msg)))
3883 #else
3884 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.1)))
3885 #endif
3886 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.2)))
3887 #if __has_feature(attribute_availability_with_message)
3888 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.2,message=_msg)))
3889 #else
3890 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.2)))
3891 #endif
3892 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.4)))
3893 #if __has_feature(attribute_availability_with_message)
3894 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.4,message=_msg)))
3895 #else
3896 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12.4)))
3897 #endif
3898 #if __has_feature(attribute_availability_with_message)
3899 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12,message=_msg)))
3900 #else
3901 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.12)))
3902 #endif
3903 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.0,deprecated=10.13)))
3904 #if __has_feature(attribute_availability_with_message)
3905 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.1,message=_msg)))
3906 #else
3907 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.1)))
3908 #endif
3909 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.2)))
3910 #if __has_feature(attribute_availability_with_message)
3911 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.2,message=_msg)))
3912 #else
3913 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.2)))
3914 #endif
3915 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_3 __attribute__((availability(macosx,introduced=10.0,deprecated=10.3)))
3916 #if __has_feature(attribute_availability_with_message)
3917 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.3,message=_msg)))
3918 #else
3919 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.3)))
3920 #endif
3921 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_4 __attribute__((availability(macosx,introduced=10.0,deprecated=10.4)))
3922 #if __has_feature(attribute_availability_with_message)
3923 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4,message=_msg)))
3924 #else
3925 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4)))
3926 #endif
3927 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_5 __attribute__((availability(macosx,introduced=10.0,deprecated=10.5)))
3928 #if __has_feature(attribute_availability_with_message)
3929 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5,message=_msg)))
3930 #else
3931 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_5_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5)))
3932 #endif
3933 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_6 __attribute__((availability(macosx,introduced=10.0,deprecated=10.6)))
3934 #if __has_feature(attribute_availability_with_message)
3935 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6,message=_msg)))
3936 #else
3937 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_6_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6)))
3938 #endif
3939 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_7 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7)))
3940 #if __has_feature(attribute_availability_with_message)
3941 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7,message=_msg)))
3942 #else
3943 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_7_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7)))
3944 #endif
3945 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8 __attribute__((availability(macosx,introduced=10.0,deprecated=10.8)))
3946 #if __has_feature(attribute_availability_with_message)
3947 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message=_msg)))
3948 #else
3949 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8)))
3950 #endif
3951 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_9 __attribute__((availability(macosx,introduced=10.0,deprecated=10.9)))
3952 #if __has_feature(attribute_availability_with_message)
3953 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9,message=_msg)))
3954 #else
3955 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_9_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9)))
3956 #endif
3957 #if __has_feature(attribute_availability_with_message)
3958 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_13_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.13,message=_msg)))
3959 #else
3960 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_13_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.13)))
3961 #endif
3962 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.0)))
3963 #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.0)))
3964 #define __AVAILABILITY_INTERNAL__MAC_10_1 __attribute__((availability(macosx,introduced=10.1)))
3965 #define __AVAILABILITY_INTERNAL__MAC_10_10 __attribute__((availability(macosx,introduced=10.10)))
3966 #define __AVAILABILITY_INTERNAL__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.10.2)))
3967 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.10.2)))
3968 #if __has_feature(attribute_availability_with_message)
3969 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.10.2,message=_msg)))
3970 #else
3971 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.10.2)))
3972 #endif
3973 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.10.3)))
3974 #if __has_feature(attribute_availability_with_message)
3975 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.10.3,message=_msg)))
3976 #else
3977 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.10.3)))
3978 #endif
3979 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11)))
3980 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.2)))
3981 #if __has_feature(attribute_availability_with_message)
3982 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.2,message=_msg)))
3983 #else
3984 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.2)))
3985 #endif
3986 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.3)))
3987 #if __has_feature(attribute_availability_with_message)
3988 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.3,message=_msg)))
3989 #else
3990 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.3)))
3991 #endif
3992 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.4)))
3993 #if __has_feature(attribute_availability_with_message)
3994 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.4,message=_msg)))
3995 #else
3996 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11.4)))
3997 #endif
3998 #if __has_feature(attribute_availability_with_message)
3999 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11,message=_msg)))
4000 #else
4001 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.11)))
4002 #endif
4003 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12)))
4004 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.1)))
4005 #if __has_feature(attribute_availability_with_message)
4006 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.1,message=_msg)))
4007 #else
4008 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.1)))
4009 #endif
4010 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.2)))
4011 #if __has_feature(attribute_availability_with_message)
4012 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.2,message=_msg)))
4013 #else
4014 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.2)))
4015 #endif
4016 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.4)))
4017 #if __has_feature(attribute_availability_with_message)
4018 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.4,message=_msg)))
4019 #else
4020 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12.4)))
4021 #endif
4022 #if __has_feature(attribute_availability_with_message)
4023 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12,message=_msg)))
4024 #else
4025 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2,deprecated=10.12)))
4026 #endif
4027 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.10.2)))
4028 #define __AVAILABILITY_INTERNAL__MAC_10_10_2_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.2)))
4029 #define __AVAILABILITY_INTERNAL__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.10.3)))
4030 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.10.3)))
4031 #if __has_feature(attribute_availability_with_message)
4032 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.10.3,message=_msg)))
4033 #else
4034 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.10.3)))
4035 #endif
4036 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11)))
4037 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.2)))
4038 #if __has_feature(attribute_availability_with_message)
4039 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.2,message=_msg)))
4040 #else
4041 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.2)))
4042 #endif
4043 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.3)))
4044 #if __has_feature(attribute_availability_with_message)
4045 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.3,message=_msg)))
4046 #else
4047 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.3)))
4048 #endif
4049 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.4)))
4050 #if __has_feature(attribute_availability_with_message)
4051 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.4,message=_msg)))
4052 #else
4053 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11.4)))
4054 #endif
4055 #if __has_feature(attribute_availability_with_message)
4056 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11,message=_msg)))
4057 #else
4058 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.11)))
4059 #endif
4060 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12)))
4061 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.1)))
4062 #if __has_feature(attribute_availability_with_message)
4063 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.1,message=_msg)))
4064 #else
4065 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.1)))
4066 #endif
4067 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.2)))
4068 #if __has_feature(attribute_availability_with_message)
4069 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.2,message=_msg)))
4070 #else
4071 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.2)))
4072 #endif
4073 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.4)))
4074 #if __has_feature(attribute_availability_with_message)
4075 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.4,message=_msg)))
4076 #else
4077 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12.4)))
4078 #endif
4079 #if __has_feature(attribute_availability_with_message)
4080 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12,message=_msg)))
4081 #else
4082 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3,deprecated=10.12)))
4083 #endif
4084 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.10.3)))
4085 #define __AVAILABILITY_INTERNAL__MAC_10_10_3_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.10.3)))
4086 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.10,deprecated=10.1)))
4087 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.10,deprecated=10.10)))
4088 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.10,deprecated=10.10.2)))
4089 #if __has_feature(attribute_availability_with_message)
4090 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.10.2,message=_msg)))
4091 #else
4092 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.10.2)))
4093 #endif
4094 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_3 __attribute__((availability(macosx,introduced=10.10,deprecated=10.10.3)))
4095 #if __has_feature(attribute_availability_with_message)
4096 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.10.3,message=_msg)))
4097 #else
4098 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.10.3)))
4099 #endif
4100 #if __has_feature(attribute_availability_with_message)
4101 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.10,message=_msg)))
4102 #else
4103 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.10)))
4104 #endif
4105 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.10,deprecated=10.11)))
4106 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.2)))
4107 #if __has_feature(attribute_availability_with_message)
4108 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.2,message=_msg)))
4109 #else
4110 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.2)))
4111 #endif
4112 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.3)))
4113 #if __has_feature(attribute_availability_with_message)
4114 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.3,message=_msg)))
4115 #else
4116 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.3)))
4117 #endif
4118 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.4)))
4119 #if __has_feature(attribute_availability_with_message)
4120 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.4,message=_msg)))
4121 #else
4122 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11.4)))
4123 #endif
4124 #if __has_feature(attribute_availability_with_message)
4125 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11,message=_msg)))
4126 #else
4127 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11)))
4128 #endif
4129 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.10,deprecated=10.12)))
4130 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.1)))
4131 #if __has_feature(attribute_availability_with_message)
4132 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.1,message=_msg)))
4133 #else
4134 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.1)))
4135 #endif
4136 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.2)))
4137 #if __has_feature(attribute_availability_with_message)
4138 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.2,message=_msg)))
4139 #else
4140 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.2)))
4141 #endif
4142 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.4)))
4143 #if __has_feature(attribute_availability_with_message)
4144 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.4,message=_msg)))
4145 #else
4146 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12.4)))
4147 #endif
4148 #if __has_feature(attribute_availability_with_message)
4149 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12,message=_msg)))
4150 #else
4151 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.12)))
4152 #endif
4153 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.10,deprecated=10.13)))
4154 #if __has_feature(attribute_availability_with_message)
4155 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_13_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.13,message=_msg)))
4156 #else
4157 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_13_MSG(_msg) __attribute__((availability(macosx,introduced=10.10,deprecated=10.13)))
4158 #endif
4159 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_13_4 __attribute__((availability(macosx,introduced=10.10,deprecated=10.13.4)))
4160 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.10)))
4161 #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.10)))
4162 #define __AVAILABILITY_INTERNAL__MAC_10_11 __attribute__((availability(macosx,introduced=10.11)))
4163 #define __AVAILABILITY_INTERNAL__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.11.2)))
4164 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.2)))
4165 #if __has_feature(attribute_availability_with_message)
4166 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.2,message=_msg)))
4167 #else
4168 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.2)))
4169 #endif
4170 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.3)))
4171 #if __has_feature(attribute_availability_with_message)
4172 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.3,message=_msg)))
4173 #else
4174 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.3)))
4175 #endif
4176 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.4)))
4177 #if __has_feature(attribute_availability_with_message)
4178 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.4,message=_msg)))
4179 #else
4180 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.11.4)))
4181 #endif
4182 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12)))
4183 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.1)))
4184 #if __has_feature(attribute_availability_with_message)
4185 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.1,message=_msg)))
4186 #else
4187 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.1)))
4188 #endif
4189 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.2)))
4190 #if __has_feature(attribute_availability_with_message)
4191 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.2,message=_msg)))
4192 #else
4193 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.2)))
4194 #endif
4195 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.4)))
4196 #if __has_feature(attribute_availability_with_message)
4197 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.4,message=_msg)))
4198 #else
4199 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12.4)))
4200 #endif
4201 #if __has_feature(attribute_availability_with_message)
4202 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12,message=_msg)))
4203 #else
4204 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2,deprecated=10.12)))
4205 #endif
4206 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.11.2)))
4207 #define __AVAILABILITY_INTERNAL__MAC_10_11_2_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.2)))
4208 #define __AVAILABILITY_INTERNAL__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.11.3)))
4209 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.11.3)))
4210 #if __has_feature(attribute_availability_with_message)
4211 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.11.3,message=_msg)))
4212 #else
4213 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.11.3)))
4214 #endif
4215 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.11.4)))
4216 #if __has_feature(attribute_availability_with_message)
4217 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.11.4,message=_msg)))
4218 #else
4219 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.11.4)))
4220 #endif
4221 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12)))
4222 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.1)))
4223 #if __has_feature(attribute_availability_with_message)
4224 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.1,message=_msg)))
4225 #else
4226 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.1)))
4227 #endif
4228 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.2)))
4229 #if __has_feature(attribute_availability_with_message)
4230 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.2,message=_msg)))
4231 #else
4232 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.2)))
4233 #endif
4234 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.4)))
4235 #if __has_feature(attribute_availability_with_message)
4236 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.4,message=_msg)))
4237 #else
4238 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12.4)))
4239 #endif
4240 #if __has_feature(attribute_availability_with_message)
4241 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12,message=_msg)))
4242 #else
4243 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3,deprecated=10.12)))
4244 #endif
4245 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.11.3)))
4246 #define __AVAILABILITY_INTERNAL__MAC_10_11_3_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.3)))
4247 #define __AVAILABILITY_INTERNAL__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.11.4)))
4248 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.11.4)))
4249 #if __has_feature(attribute_availability_with_message)
4250 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.11.4,message=_msg)))
4251 #else
4252 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.11.4)))
4253 #endif
4254 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12)))
4255 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.1)))
4256 #if __has_feature(attribute_availability_with_message)
4257 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.1,message=_msg)))
4258 #else
4259 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.1)))
4260 #endif
4261 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.2)))
4262 #if __has_feature(attribute_availability_with_message)
4263 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.2,message=_msg)))
4264 #else
4265 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.2)))
4266 #endif
4267 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.4)))
4268 #if __has_feature(attribute_availability_with_message)
4269 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.4,message=_msg)))
4270 #else
4271 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12.4)))
4272 #endif
4273 #if __has_feature(attribute_availability_with_message)
4274 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12,message=_msg)))
4275 #else
4276 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4,deprecated=10.12)))
4277 #endif
4278 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.11.4)))
4279 #define __AVAILABILITY_INTERNAL__MAC_10_11_4_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.11.4)))
4280 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.11,deprecated=10.1)))
4281 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 __attribute__((availability(macosx,introduced=10.11,deprecated=10.11)))
4282 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_2 __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.2)))
4283 #if __has_feature(attribute_availability_with_message)
4284 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.2,message=_msg)))
4285 #else
4286 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.2)))
4287 #endif
4288 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_3 __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.3)))
4289 #if __has_feature(attribute_availability_with_message)
4290 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.3,message=_msg)))
4291 #else
4292 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_3_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.3)))
4293 #endif
4294 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_4 __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.4)))
4295 #if __has_feature(attribute_availability_with_message)
4296 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.4,message=_msg)))
4297 #else
4298 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11.4)))
4299 #endif
4300 #if __has_feature(attribute_availability_with_message)
4301 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11,message=_msg)))
4302 #else
4303 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.11)))
4304 #endif
4305 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.11,deprecated=10.12)))
4306 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.1)))
4307 #if __has_feature(attribute_availability_with_message)
4308 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.1,message=_msg)))
4309 #else
4310 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.1)))
4311 #endif
4312 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.2)))
4313 #if __has_feature(attribute_availability_with_message)
4314 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.2,message=_msg)))
4315 #else
4316 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.2)))
4317 #endif
4318 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.4)))
4319 #if __has_feature(attribute_availability_with_message)
4320 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.4,message=_msg)))
4321 #else
4322 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12.4)))
4323 #endif
4324 #if __has_feature(attribute_availability_with_message)
4325 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12,message=_msg)))
4326 #else
4327 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.11,deprecated=10.12)))
4328 #endif
4329 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.11)))
4330 #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.11)))
4331 #define __AVAILABILITY_INTERNAL__MAC_10_12 __attribute__((availability(macosx,introduced=10.12)))
4332 #define __AVAILABILITY_INTERNAL__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.12.1)))
4333 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.1)))
4334 #if __has_feature(attribute_availability_with_message)
4335 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.1,message=_msg)))
4336 #else
4337 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.1)))
4338 #endif
4339 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.2)))
4340 #if __has_feature(attribute_availability_with_message)
4341 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.2,message=_msg)))
4342 #else
4343 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.2)))
4344 #endif
4345 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.4)))
4346 #if __has_feature(attribute_availability_with_message)
4347 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.4,message=_msg)))
4348 #else
4349 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1,deprecated=10.12.4)))
4350 #endif
4351 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.12.1)))
4352 #define __AVAILABILITY_INTERNAL__MAC_10_12_1_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.1)))
4353 #define __AVAILABILITY_INTERNAL__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.12.2)))
4354 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.12.2,deprecated=10.12.2)))
4355 #if __has_feature(attribute_availability_with_message)
4356 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.2,deprecated=10.12.2,message=_msg)))
4357 #else
4358 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.2,deprecated=10.12.2)))
4359 #endif
4360 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.12.2,deprecated=10.12.4)))
4361 #if __has_feature(attribute_availability_with_message)
4362 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.2,deprecated=10.12.4,message=_msg)))
4363 #else
4364 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.2,deprecated=10.12.4)))
4365 #endif
4366 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.12.2)))
4367 #define __AVAILABILITY_INTERNAL__MAC_10_12_2_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.2)))
4368 #define __AVAILABILITY_INTERNAL__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.12.4)))
4369 #define __AVAILABILITY_INTERNAL__MAC_10_12_4_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.12.4,deprecated=10.12.4)))
4370 #if __has_feature(attribute_availability_with_message)
4371 #define __AVAILABILITY_INTERNAL__MAC_10_12_4_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.4,deprecated=10.12.4,message=_msg)))
4372 #else
4373 #define __AVAILABILITY_INTERNAL__MAC_10_12_4_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.4,deprecated=10.12.4)))
4374 #endif
4375 #define __AVAILABILITY_INTERNAL__MAC_10_12_4_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.12.4)))
4376 #define __AVAILABILITY_INTERNAL__MAC_10_12_4_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.12.4)))
4377 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12 __attribute__((availability(macosx,introduced=10.12,deprecated=10.12)))
4378 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_1 __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.1)))
4379 #if __has_feature(attribute_availability_with_message)
4380 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.1,message=_msg)))
4381 #else
4382 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_1_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.1)))
4383 #endif
4384 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_2 __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.2)))
4385 #if __has_feature(attribute_availability_with_message)
4386 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.2,message=_msg)))
4387 #else
4388 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_2_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.2)))
4389 #endif
4390 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_4 __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.4)))
4391 #if __has_feature(attribute_availability_with_message)
4392 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.4,message=_msg)))
4393 #else
4394 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_4_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12.4)))
4395 #endif
4396 #if __has_feature(attribute_availability_with_message)
4397 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12,message=_msg)))
4398 #else
4399 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_12_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.12)))
4400 #endif
4401 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_13 __attribute__((availability(macosx,introduced=10.12,deprecated=10.13)))
4402 #if __has_feature(attribute_availability_with_message)
4403 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_13_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.13,message=_msg)))
4404 #else
4405 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_13_MSG(_msg) __attribute__((availability(macosx,introduced=10.12,deprecated=10.13)))
4406 #endif
4407 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_13_4 __attribute__((availability(macosx,introduced=10.12,deprecated=10.13.4)))
4408 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_10_14 __attribute__((availability(macosx,introduced=10.12,deprecated=10.14)))
4409 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_NA __attribute__((availability(macosx,introduced=10.12)))
4410 #define __AVAILABILITY_INTERNAL__MAC_10_12_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,introduced=10.12)))
4411 #define __AVAILABILITY_INTERNAL__MAC_10_13 __attribute__((availability(macosx,introduced=10.13)))
4412 #define __AVAILABILITY_INTERNAL__MAC_10_13_4 __attribute__((availability(macosx,introduced=10.13.4)))
4413 #define __AVAILABILITY_INTERNAL__MAC_10_14 __attribute__((availability(macosx,introduced=10.14)))
4414 #define __AVAILABILITY_INTERNAL__MAC_10_14_DEP__MAC_10_14 __attribute__((availability(macosx,introduced=10.14,deprecated=10.14)))
4415 #define __AVAILABILITY_INTERNAL__MAC_10_15 __attribute__((availability(macosx,introduced=10.15)))
4416
4417 #define __AVAILABILITY_INTERNAL__MAC_NA __attribute__((availability(macosx,unavailable)))
4418 #define __AVAILABILITY_INTERNAL__MAC_NA_DEP__MAC_NA __attribute__((availability(macosx,unavailable)))
4419 #define __AVAILABILITY_INTERNAL__MAC_NA_DEP__MAC_NA_MSG(_msg) __attribute__((availability(macosx,unavailable)))
4420
4421 #define __AVAILABILITY_INTERNAL__IPHONE_NA __attribute__((availability(ios,unavailable)))
4422 #define __AVAILABILITY_INTERNAL__IPHONE_NA__IPHONE_NA __attribute__((availability(ios,unavailable)))
4423 #define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA __attribute__((availability(ios,unavailable)))
4424 #define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,unavailable)))
4425
4426 #ifndef __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION
4427 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable)))
4428 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable)))
4429 #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,unavailable)))
4430 #endif /* __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION */
4431 #endif
4432 #endif
4433#endif /* __ENABLE_LEGACY_MAC_AVAILABILITY */
4434
4435/*
4436 Macros for defining which versions/platform a given symbol can be used.
4437
4438 @see http://clang.llvm.org/docs/AttributeReference.html#availability
4439 */
4440
4441#if defined(__has_feature) && defined(__has_attribute)
4442 #if __has_attribute(availability)
4443
4444
4445 #define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
4446 #define __API_AVAILABLE_PLATFORM_macosx(x) macosx,introduced=x
4447 #define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x
4448 #define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x
4449 #define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x
4450
4451 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
4452 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
4453 #ifndef __API_AVAILABLE_PLATFORM_uikitformac
4454 #define __API_AVAILABLE_PLATFORM_uikitformac(x) uikitformac,introduced=x
4455 #endif
4456 #define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x
4457
4458 #if defined(__has_attribute)
4459 #if __has_attribute(availability)
4460 #define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x)))
4461 #else
4462 #define __API_A(x)
4463 #endif
4464 #else
4465 #define __API_A(x)
4466 #endif
4467
4468 #define __API_AVAILABLE1(x) __API_A(x)
4469 #define __API_AVAILABLE2(x,y) __API_A(x) __API_A(y)
4470 #define __API_AVAILABLE3(x,y,z) __API_A(x) __API_A(y) __API_A(z)
4471 #define __API_AVAILABLE4(x,y,z,t) __API_A(x) __API_A(y) __API_A(z) __API_A(t)
4472 #define __API_AVAILABLE5(x,y,z,t,b) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b)
4473 #define __API_AVAILABLE6(x,y,z,t,b,m) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m)
4474 #define __API_AVAILABLE7(x,y,z,t,b,m,d) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m) __API_A(d)
4475 #define __API_AVAILABLE_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
4476
4477 #define __API_APPLY_TO any(record, enum, enum_constant, function, objc_method, objc_category, objc_protocol, objc_interface, objc_property, type_alias, variable, field)
4478 #define __API_RANGE_STRINGIFY(x) __API_RANGE_STRINGIFY2(x)
4479 #define __API_RANGE_STRINGIFY2(x) #x
4480
4481 #define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
4482
4483 #define __API_AVAILABLE_BEGIN1(a) __API_A_BEGIN(a)
4484 #define __API_AVAILABLE_BEGIN2(a,b) __API_A_BEGIN(a) __API_A_BEGIN(b)
4485 #define __API_AVAILABLE_BEGIN3(a,b,c) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c)
4486 #define __API_AVAILABLE_BEGIN4(a,b,c,d) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d)
4487 #define __API_AVAILABLE_BEGIN5(a,b,c,d,e) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d) __API_A_BEGIN(e)
4488 #define __API_AVAILABLE_BEGIN6(a,b,c,d,e,f) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d) __API_A_BEGIN(e) __API_A_BEGIN(f)
4489 #define __API_AVAILABLE_BEGIN7(a,b,c,d,e,f,g) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d) __API_A_BEGIN(e) __API_A_BEGIN(f) __API_A_BEGIN(g)
4490 #define __API_AVAILABLE_BEGIN_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
4491
4492
4493 #define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y
4494 #define __API_DEPRECATED_PLATFORM_macosx(x,y) macosx,introduced=x,deprecated=y
4495 #define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y
4496 #define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y
4497 #define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y
4498
4499 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
4500 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
4501 #ifndef __API_DEPRECATED_PLATFORM_uikitformac
4502 #define __API_DEPRECATED_PLATFORM_uikitformac(x) uikitformac,introduced=x,deprecated=y
4503 #endif
4504 #define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y
4505
4506 #if defined(__has_attribute)
4507 #if __has_attribute(availability)
4508 #define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg)))
4509 #else
4510 #define __API_D(msg,x)
4511 #endif
4512 #else
4513 #define __API_D(msg,x)
4514 #endif
4515
4516 #define __API_DEPRECATED_MSG2(msg,x) __API_D(msg,x)
4517 #define __API_DEPRECATED_MSG3(msg,x,y) __API_D(msg,x) __API_D(msg,y)
4518 #define __API_DEPRECATED_MSG4(msg,x,y,z) __API_DEPRECATED_MSG3(msg,x,y) __API_D(msg,z)
4519 #define __API_DEPRECATED_MSG5(msg,x,y,z,t) __API_DEPRECATED_MSG4(msg,x,y,z) __API_D(msg,t)
4520 #define __API_DEPRECATED_MSG6(msg,x,y,z,t,b) __API_DEPRECATED_MSG5(msg,x,y,z,t) __API_D(msg,b)
4521 #define __API_DEPRECATED_MSG7(msg,x,y,z,t,b,m) __API_DEPRECATED_MSG6(msg,x,y,z,t,b) __API_D(msg,m)
4522 #define __API_DEPRECATED_MSG8(msg,x,y,z,t,b,m,d) __API_DEPRECATED_MSG7(msg,x,y,z,t,b,m) __API_D(msg,d)
4523 #define __API_DEPRECATED_MSG_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
4524
4525 #define __API_D_BEGIN(msg, x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))), apply_to = __API_APPLY_TO)))
4526
4527 #define __API_DEPRECATED_BEGIN_MSG2(msg,a) __API_D_BEGIN(msg,a)
4528 #define __API_DEPRECATED_BEGIN_MSG3(msg,a,b) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b)
4529 #define __API_DEPRECATED_BEGIN_MSG4(msg,a,b,c) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c)
4530 #define __API_DEPRECATED_BEGIN_MSG5(msg,a,b,c,d) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d)
4531 #define __API_DEPRECATED_BEGIN_MSG6(msg,a,b,c,d,e) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d) __API_D_BEGIN(msg,e)
4532 #define __API_DEPRECATED_BEGIN_MSG7(msg,a,b,c,d,e,f) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d) __API_D_BEGIN(msg,e) __API_D_BEGIN(msg,f)
4533 #define __API_DEPRECATED_BEGIN_MSG8(msg,a,b,c,d,e,f,g) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d) __API_D_BEGIN(msg,e) __API_D_BEGIN(msg,f) __API_D_BEGIN(msg,g)
4534 #define __API_DEPRECATED_BEGIN_MSG_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
4535
4536 #if __has_feature(attribute_availability_with_replacement)
4537 #define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))
4538 #else
4539 #define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x)))
4540 #endif
4541
4542 #define __API_DEPRECATED_REP2(rep,x) __API_R(rep,x)
4543 #define __API_DEPRECATED_REP3(rep,x,y) __API_R(rep,x) __API_R(rep,y)
4544 #define __API_DEPRECATED_REP4(rep,x,y,z) __API_DEPRECATED_REP3(rep,x,y) __API_R(rep,z)
4545 #define __API_DEPRECATED_REP5(rep,x,y,z,t) __API_DEPRECATED_REP4(rep,x,y,z) __API_R(rep,t)
4546 #define __API_DEPRECATED_REP6(rep,x,y,z,t,b) __API_DEPRECATED_REP5(rep,x,y,z,t) __API_R(rep,b)
4547 #define __API_DEPRECATED_REP7(rep,x,y,z,t,b,m) __API_DEPRECATED_REP6(rep,x,y,z,t,b) __API_R(rep,m)
4548 #define __API_DEPRECATED_REP8(rep,x,y,z,t,b,m,d) __API_DEPRECATED_REP7(rep,x,y,z,t,b,m) __API_R(rep,d)
4549 #define __API_DEPRECATED_REP_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
4550
4551 #if __has_feature(attribute_availability_with_replacement)
4552 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep))), apply_to = __API_APPLY_TO)))
4553 #else
4554 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
4555 #endif
4556
4557 #define __API_DEPRECATED_BEGIN_REP2(rep,a) __API_R_BEGIN(rep,a)
4558 #define __API_DEPRECATED_BEGIN_REP3(rep,a,b) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b)
4559 #define __API_DEPRECATED_BEGIN_REP4(rep,a,b,c) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c)
4560 #define __API_DEPRECATED_BEGIN_REP5(rep,a,b,c,d) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d)
4561 #define __API_DEPRECATED_BEGIN_REP6(rep,a,b,c,d,e) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d) __API_R_BEGIN(rep,e)
4562 #define __API_DEPRECATED_BEGIN_REP7(rep,a,b,c,d,e,f) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d) __API_R_BEGIN(rep,e) __API_R_BEGIN(rep,f)
4563 #define __API_DEPRECATED_BEGIN_REP8(rep,a,b,c,d,e,f,g) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d) __API_R_BEGIN(rep,e) __API_R_BEGIN(rep,f) __API_R_BEGIN(rep,g)
4564 #define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
4565
4566 /*
4567 * API Unavailability
4568 * Use to specify that an API is unavailable for a particular platform.
4569 *
4570 * Example:
4571 * __API_UNAVAILABLE(macos)
4572 * __API_UNAVAILABLE(watchos, tvos)
4573 */
4574 #define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
4575 #define __API_UNAVAILABLE_PLATFORM_macosx macosx,unavailable
4576 #define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
4577 #define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
4578 #define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
4579
4580 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
4581 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
4582 #ifndef __API_UNAVAILABLE_PLATFORM_uikitformac
4583 #define __API_UNAVAILABLE_PLATFORM_uikitformac(x) uikitformac,unavailable
4584 #endif
4585 #define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
4586
4587 #if defined(__has_attribute)
4588 #if __has_attribute(availability)
4589 #define __API_U(x) __attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x)))
4590 #else
4591 #define __API_U(x)
4592 #endif
4593 #else
4594 #define __API_U(x)
4595 #endif
4596
4597 #define __API_UNAVAILABLE1(x) __API_U(x)
4598 #define __API_UNAVAILABLE2(x,y) __API_U(x) __API_U(y)
4599 #define __API_UNAVAILABLE3(x,y,z) __API_UNAVAILABLE2(x,y) __API_U(z)
4600 #define __API_UNAVAILABLE4(x,y,z,t) __API_UNAVAILABLE3(x,y,z) __API_U(t)
4601 #define __API_UNAVAILABLE5(x,y,z,t,b) __API_UNAVAILABLE4(x,y,z,t) __API_U(b)
4602 #define __API_UNAVAILABLE6(x,y,z,t,b,m) __API_UNAVAILABLE5(x,y,z,t,b) __API_U(m)
4603 #define __API_UNAVAILABLE7(x,y,z,t,b,m,d) __API_UNAVAILABLE6(x,y,z,t,b,m) __API_U(d)
4604 #define __API_UNAVAILABLE_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
4605
4606 #define __API_U_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
4607
4608 #define __API_UNAVAILABLE_BEGIN1(a) __API_U_BEGIN(a)
4609 #define __API_UNAVAILABLE_BEGIN2(a,b) __API_U_BEGIN(a) __API_U_BEGIN(b)
4610 #define __API_UNAVAILABLE_BEGIN3(a,b,c) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c)
4611 #define __API_UNAVAILABLE_BEGIN4(a,b,c,d) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d)
4612 #define __API_UNAVAILABLE_BEGIN5(a,b,c,d,e) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d) __API_U_BEGIN(e)
4613 #define __API_UNAVAILABLE_BEGIN6(a,b,c,d,e,f) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d) __API_U_BEGIN(e) __API_U_BEGIN(f)
4614 #define __API_UNAVAILABLE_BEGIN7(a,b,c,d,e,f) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d) __API_U_BEGIN(e) __API_U_BEGIN(f) __API_U_BEGIN(g)
4615 #define __API_UNAVAILABLE_BEGIN_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
4616 #else
4617
4618 /*
4619 * Evaluate to nothing for compilers that don't support availability.
4620 */
4621
4622 #define __API_AVAILABLE_GET_MACRO(...)
4623 #define __API_AVAILABLE_BEGIN_GET_MACRO(...)
4624 #define __API_DEPRECATED_MSG_GET_MACRO(...)
4625 #define __API_DEPRECATED_REP_GET_MACRO(...)
4626 #define __API_DEPRECATED_BEGIN_MSG_GET_MACRO(...)
4627 #define __API_DEPRECATED_BEGIN_REP_GET_MACRO
4628 #define __API_UNAVAILABLE_GET_MACRO(...)
4629 #define __API_UNAVAILABLE_BEGIN_GET_MACRO(...)
4630 #endif /* __has_attribute(availability) */
4631#else
4632
4633 /*
4634 * Evaluate to nothing for compilers that don't support clang language extensions.
4635 */
4636
4637 #define __API_AVAILABLE_GET_MACRO(...)
4638 #define __API_AVAILABLE_BEGIN_GET_MACRO(...)
4639 #define __API_DEPRECATED_MSG_GET_MACRO(...)
4640 #define __API_DEPRECATED_REP_GET_MACRO(...)
4641 #define __API_DEPRECATED_BEGIN_MSG_GET_MACRO(...)
4642 #define __API_DEPRECATED_BEGIN_REP_GET_MACRO
4643 #define __API_UNAVAILABLE_GET_MACRO(...)
4644 #define __API_UNAVAILABLE_BEGIN_GET_MACRO(...)
4645#endif /* #if defined(__has_feature) && defined(__has_attribute) */
4646
4647/*
4648 * Swift compiler version
4649 * Allows for project-agnostic “epochs” for frameworks imported into Swift via the Clang importer, like #if _compiler_version for Swift
4650 * Example:
4651 *
4652 * #if __swift_compiler_version_at_least(800, 2, 20)
4653 * - (nonnull NSString *)description;
4654 * #else
4655 * - (NSString *)description;
4656 * #endif
4657 */
4658
4659#ifdef __SWIFT_COMPILER_VERSION
4660 #define __swift_compiler_version_at_least_impl(X, Y, Z, a, b, ...) \
4661 __SWIFT_COMPILER_VERSION >= ((X * UINT64_C(1000) * 1000 * 1000) + (Z * 1000 * 1000) + (a * 1000) + b)
4662 #define __swift_compiler_version_at_least(...) __swift_compiler_version_at_least_impl(__VA_ARGS__, 0, 0, 0, 0)
4663#else
4664 #define __swift_compiler_version_at_least(...) 1
4665#endif
4666
4667/*
4668 * If __SPI_AVAILABLE has not been defined elsewhere, disable it.
4669 */
4670
4671#ifndef __SPI_AVAILABLE
4672 #define __SPI_AVAILABLE(...)
4673#endif
4674
4675#endif /* __AVAILABILITY_INTERNAL__ */
lib/libc/include/aarch64-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/aarch64-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/aarch64-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
25extern "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.
31BLOCK_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
35BLOCK_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.
40BLOCK_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.
44BLOCK_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.
48BLOCK_EXPORT void * _NSConcreteGlobalBlock[32]
49 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
50BLOCK_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/aarch64-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/aarch64-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
55extern "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*********************************************************************************/
115typedef unsigned char UInt8;
116typedef signed char SInt8;
117typedef unsigned short UInt16;
118typedef signed short SInt16;
119
120#if __LP64__
121typedef unsigned int UInt32;
122typedef signed int SInt32;
123#else
124typedef unsigned long UInt32;
125typedef signed long SInt32;
126#endif
127
128/* avoid redeclaration if libkern/OSTypes.h */
129#ifndef _OS_OSTYPES_H
130#if TARGET_RT_BIG_ENDIAN
131struct wide {
132 SInt32 hi;
133 UInt32 lo;
134};
135typedef struct wide wide;
136struct UnsignedWide {
137 UInt32 hi;
138 UInt32 lo;
139};
140typedef struct UnsignedWide UnsignedWide;
141#else
142struct wide {
143 UInt32 lo;
144 SInt32 hi;
145};
146typedef struct wide wide;
147struct UnsignedWide {
148 UInt32 lo;
149 UInt32 hi;
150};
151typedef 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
179typedef wide SInt64;
180typedef 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*********************************************************************************/
193typedef SInt32 Fixed;
194typedef Fixed * FixedPtr;
195typedef SInt32 Fract;
196typedef Fract * FractPtr;
197typedef UInt32 UnsignedFixed;
198typedef UnsignedFixed * UnsignedFixedPtr;
199typedef short ShortFixed;
200typedef 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*********************************************************************************/
220typedef float Float32;
221typedef double Float64;
222struct Float80 {
223 SInt16 exp;
224 UInt16 man[4];
225};
226typedef struct Float80 Float80;
227
228struct Float96 {
229 SInt16 exp[2]; /* the second 16-bits are undefined */
230 UInt16 man[4];
231};
232typedef struct Float96 Float96;
233struct Float32Point {
234 Float32 x;
235 Float32 y;
236};
237typedef 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*********************************************************************************/
248typedef char * Ptr;
249typedef Ptr * Handle;
250typedef 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*********************************************************************************/
278typedef SInt16 OSErr;
279typedef SInt32 OSStatus;
280typedef void * LogicalAddress;
281typedef const void * ConstLogicalAddress;
282typedef void * PhysicalAddress;
283typedef UInt8 * BytePtr;
284typedef unsigned long ByteCount;
285typedef unsigned long ByteOffset;
286typedef SInt32 Duration;
287typedef UnsignedWide AbsoluteTime;
288typedef UInt32 OptionBits;
289typedef unsigned long ItemCount;
290typedef UInt32 PBVersion;
291typedef SInt16 ScriptCode;
292typedef SInt16 LangCode;
293typedef SInt16 RegionCode;
294typedef UInt32 FourCharCode;
295typedef FourCharCode OSType;
296typedef FourCharCode ResType;
297typedef OSType * OSTypePtr;
298typedef 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*********************************************************************************/
309typedef 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*********************************************************************************/
322typedef CALLBACK_API_C( long , ProcPtr )(void);
323typedef CALLBACK_API( void , Register68kProcPtr )(void);
324#if TARGET_RT_MAC_CFM
325/* The RoutineDescriptor structure is defined in MixedMode.h */
326typedef struct RoutineDescriptor *UniversalProcPtr;
327#else
328typedef ProcPtr UniversalProcPtr;
329#endif /* TARGET_RT_MAC_CFM */
330
331typedef ProcPtr * ProcHandle;
332typedef 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*********************************************************************************/
347typedef void * PRefCon;
348#if __LP64__
349typedef void * URefCon;
350typedef void * SRefCon;
351#else
352typedef UInt32 URefCon;
353typedef 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*********************************************************************************/
382enum {
383 noErr = 0
384};
385
386enum {
387 kNilOptions = 0
388};
389
390#define kInvalidID 0
391enum {
392 kVariableLengthArray
393#ifdef __has_extension
394 #if __has_extension(enumerator_attributes)
395 __attribute__((deprecated))
396 #endif
397#endif
398 = 1
399};
400
401enum {
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*********************************************************************************/
457typedef UInt32 UnicodeScalarValue;
458typedef UInt32 UTF32Char;
459typedef UInt16 UniChar;
460typedef UInt16 UTF16Char;
461typedef UInt8 UTF8Char;
462typedef UniChar * UniCharPtr;
463typedef unsigned long UniCharCount;
464typedef UniCharCount * UniCharCountPtr;
465typedef unsigned char Str255[256];
466typedef unsigned char Str63[64];
467typedef unsigned char Str32[33];
468typedef unsigned char Str31[32];
469typedef unsigned char Str27[28];
470typedef 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*/
479typedef 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*/
489typedef Str63 StrFileName;
490typedef unsigned char * StringPtr;
491typedef StringPtr * StringHandle;
492typedef const unsigned char * ConstStringPtr;
493typedef const unsigned char * ConstStr255Param;
494typedef const unsigned char * ConstStr63Param;
495typedef const unsigned char * ConstStr32Param;
496typedef const unsigned char * ConstStr31Param;
497typedef const unsigned char * ConstStr27Param;
498typedef const unsigned char * ConstStr15Param;
499typedef ConstStr63Param ConstStrFileNameParam;
500#ifdef __cplusplus
501inline 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 */
516struct ProcessSerialNumber {
517 UInt32 highLongOfPSN;
518 UInt32 lowLongOfPSN;
519};
520typedef struct ProcessSerialNumber ProcessSerialNumber;
521typedef 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*********************************************************************************/
538struct Point {
539 short v;
540 short h;
541};
542typedef struct Point Point;
543typedef Point * PointPtr;
544struct Rect {
545 short top;
546 short left;
547 short bottom;
548 short right;
549};
550typedef struct Rect Rect;
551typedef Rect * RectPtr;
552struct FixedPoint {
553 Fixed x;
554 Fixed y;
555};
556typedef struct FixedPoint FixedPoint;
557struct FixedRect {
558 Fixed left;
559 Fixed top;
560 Fixed right;
561 Fixed bottom;
562};
563typedef struct FixedRect FixedRect;
564
565typedef short CharParameter;
566enum {
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
577typedef unsigned char Style;
578typedef short StyleParameter;
579typedef 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*********************************************************************************/
594typedef SInt32 TimeValue;
595typedef SInt32 TimeScale;
596typedef wide CompTimeValue;
597typedef SInt64 TimeValue64;
598typedef struct TimeBaseRecord* TimeBase;
599struct TimeRecord {
600 CompTimeValue value; /* units (duration or absolute) */
601 TimeScale scale; /* units per second */
602 TimeBase base; /* refernce to the time base */
603};
604typedef 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
637struct 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};
644typedef struct NumVersion NumVersion;
645#else
646struct 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};
653typedef struct NumVersion NumVersion;
654#endif /* TARGET_RT_BIG_ENDIAN */
655
656enum {
657 /* Version Release Stage Codes */
658 developStage = 0x20,
659 alphaStage = 0x40,
660 betaStage = 0x60,
661 finalStage = 0x80
662};
663
664union NumVersionVariant {
665 /* NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value */
666 NumVersion parts;
667 UInt32 whole;
668};
669typedef union NumVersionVariant NumVersionVariant;
670typedef NumVersionVariant * NumVersionVariantPtr;
671typedef NumVersionVariantPtr * NumVersionVariantHandle;
672struct 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};
679typedef struct VersRec VersRec;
680typedef VersRec * VersRecPtr;
681typedef VersRecPtr * VersRecHndl;
682/*********************************************************************************
683
684 Old names for types
685
686*********************************************************************************/
687typedef UInt8 Byte;
688typedef SInt8 SignedByte;
689typedef wide * WidePtr;
690typedef UnsignedWide * UnsignedWidePtr;
691typedef Float80 extended80;
692typedef Float96 extended96;
693typedef 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 */
707extern void
708Debugger(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 */
719extern void
720DebugStr(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 */
766extern void
767SysBreak(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 */
778extern void
779SysBreakStr(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 */
790extern void
791SysBreakFunc(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/aarch64-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/aarch64-macos-gnu/__wctype.h created+74
......@@ -0,0 +1,74 @@
1/*
2 * Copyright (c) 2017 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)1999 Citrus Project,
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 * 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 *
36 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
37 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 *
48 */
49
50/*
51 * Common header for _wctype.h and xlocale/__wctype.h
52 */
53
54#ifndef ___WCTYPE_H_
55#define ___WCTYPE_H_
56
57#include <sys/cdefs.h>
58#include <_types.h>
59
60#include <sys/_types/_wint_t.h>
61#include <sys/_types/_wint_t.h>
62#include <_types/_wctype_t.h>
63
64#ifndef WEOF
65#define WEOF __DARWIN_WEOF
66#endif
67
68#ifndef __DARWIN_WCTYPE_TOP_inline
69#define __DARWIN_WCTYPE_TOP_inline __header_inline
70#endif
71
72#include <ctype.h>
73
74#endif /* ___WCTYPE_H_ */
lib/libc/include/aarch64-macos-gnu/_ctermid.h created+35
......@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2000, 2002-2006, 2008-2010, 2012, 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 _CTERMID_H_
25#define _CTERMID_H_
26
27#include <sys/cdefs.h>
28
29__BEGIN_DECLS
30
31char *ctermid(char *);
32
33__END_DECLS
34
35#endif
lib/libc/include/aarch64-macos-gnu/_ctype.h created+387
......@@ -0,0 +1,387 @@
1/*
2 * Copyright (c) 2000, 2005, 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 * (c) UNIX System Laboratories, Inc.
27 * All or some portions of this file are derived from material licensed
28 * to the University of California by American Telephone and Telegraph
29 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30 * the permission of UNIX System Laboratories, Inc.
31 *
32 * This code is derived from software contributed to Berkeley by
33 * Paul Borman at Krystal Technologies.
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 * 1. Redistributions of source code must retain the above copyright
39 * notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright
41 * notice, this list of conditions and the following disclaimer in the
42 * documentation and/or other materials provided with the distribution.
43 * 3. All advertising materials mentioning features or use of this software
44 * must display the following acknowledgement:
45 * This product includes software developed by the University of
46 * California, Berkeley and its contributors.
47 * 4. Neither the name of the University nor the names of its contributors
48 * may be used to endorse or promote products derived from this software
49 * without specific prior written permission.
50 *
51 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
52 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
55 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
57 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 * SUCH DAMAGE.
62 *
63 * @(#)ctype.h 8.4 (Berkeley) 1/21/94
64 */
65
66#ifndef __CTYPE_H_
67#define __CTYPE_H_
68
69#include <sys/cdefs.h>
70#include <runetype.h>
71
72#define _CTYPE_A 0x00000100L /* Alpha */
73#define _CTYPE_C 0x00000200L /* Control */
74#define _CTYPE_D 0x00000400L /* Digit */
75#define _CTYPE_G 0x00000800L /* Graph */
76#define _CTYPE_L 0x00001000L /* Lower */
77#define _CTYPE_P 0x00002000L /* Punct */
78#define _CTYPE_S 0x00004000L /* Space */
79#define _CTYPE_U 0x00008000L /* Upper */
80#define _CTYPE_X 0x00010000L /* X digit */
81#define _CTYPE_B 0x00020000L /* Blank */
82#define _CTYPE_R 0x00040000L /* Print */
83#define _CTYPE_I 0x00080000L /* Ideogram */
84#define _CTYPE_T 0x00100000L /* Special */
85#define _CTYPE_Q 0x00200000L /* Phonogram */
86#define _CTYPE_SW0 0x20000000L /* 0 width character */
87#define _CTYPE_SW1 0x40000000L /* 1 width character */
88#define _CTYPE_SW2 0x80000000L /* 2 width character */
89#define _CTYPE_SW3 0xc0000000L /* 3 width character */
90#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */
91#define _CTYPE_SWS 30 /* Bits to shift to get width */
92
93#ifdef _NONSTD_SOURCE
94/*
95 * Backward compatibility
96 */
97#define _A _CTYPE_A /* Alpha */
98#define _C _CTYPE_C /* Control */
99#define _D _CTYPE_D /* Digit */
100#define _G _CTYPE_G /* Graph */
101#define _L _CTYPE_L /* Lower */
102#define _P _CTYPE_P /* Punct */
103#define _S _CTYPE_S /* Space */
104#define _U _CTYPE_U /* Upper */
105#define _X _CTYPE_X /* X digit */
106#define _B _CTYPE_B /* Blank */
107#define _R _CTYPE_R /* Print */
108#define _I _CTYPE_I /* Ideogram */
109#define _T _CTYPE_T /* Special */
110#define _Q _CTYPE_Q /* Phonogram */
111#define _SW0 _CTYPE_SW0 /* 0 width character */
112#define _SW1 _CTYPE_SW1 /* 1 width character */
113#define _SW2 _CTYPE_SW2 /* 2 width character */
114#define _SW3 _CTYPE_SW3 /* 3 width character */
115#endif /* _NONSTD_SOURCE */
116
117#define __DARWIN_CTYPE_inline __header_inline
118
119#define __DARWIN_CTYPE_TOP_inline __header_inline
120
121/*
122 * Use inline functions if we are allowed to and the compiler supports them.
123 */
124#if !defined(_DONT_USE_CTYPE_INLINE_) && \
125 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
126
127/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
128__BEGIN_DECLS
129unsigned long ___runetype(__darwin_ct_rune_t);
130__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t);
131__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t);
132__END_DECLS
133
134__DARWIN_CTYPE_TOP_inline int
135isascii(int _c)
136{
137 return ((_c & ~0x7F) == 0);
138}
139
140#ifdef USE_ASCII
141__DARWIN_CTYPE_inline int
142__maskrune(__darwin_ct_rune_t _c, unsigned long _f)
143{
144 return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f;
145}
146#else /* !USE_ASCII */
147__BEGIN_DECLS
148int __maskrune(__darwin_ct_rune_t, unsigned long);
149__END_DECLS
150#endif /* USE_ASCII */
151
152__DARWIN_CTYPE_inline int
153__istype(__darwin_ct_rune_t _c, unsigned long _f)
154{
155#ifdef USE_ASCII
156 return !!(__maskrune(_c, _f));
157#else /* USE_ASCII */
158 return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f)
159 : !!__maskrune(_c, _f));
160#endif /* USE_ASCII */
161}
162
163__DARWIN_CTYPE_inline __darwin_ct_rune_t
164__isctype(__darwin_ct_rune_t _c, unsigned long _f)
165{
166#ifdef USE_ASCII
167 return !!(__maskrune(_c, _f));
168#else /* USE_ASCII */
169 return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
170 !!(_DefaultRuneLocale.__runetype[_c] & _f);
171#endif /* USE_ASCII */
172}
173
174#ifdef USE_ASCII
175__DARWIN_CTYPE_inline __darwin_ct_rune_t
176__toupper(__darwin_ct_rune_t _c)
177{
178 return _DefaultRuneLocale.__mapupper[_c & 0xff];
179}
180
181__DARWIN_CTYPE_inline __darwin_ct_rune_t
182__tolower(__darwin_ct_rune_t _c)
183{
184 return _DefaultRuneLocale.__maplower[_c & 0xff];
185}
186#else /* !USE_ASCII */
187__BEGIN_DECLS
188__darwin_ct_rune_t __toupper(__darwin_ct_rune_t);
189__darwin_ct_rune_t __tolower(__darwin_ct_rune_t);
190__END_DECLS
191#endif /* USE_ASCII */
192
193__DARWIN_CTYPE_inline int
194__wcwidth(__darwin_ct_rune_t _c)
195{
196 unsigned int _x;
197
198 if (_c == 0)
199 return (0);
200 _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R);
201 if ((_x & _CTYPE_SWM) != 0)
202 return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
203 return ((_x & _CTYPE_R) != 0 ? 1 : -1);
204}
205
206#ifndef _EXTERNALIZE_CTYPE_INLINES_
207
208#define _tolower(c) __tolower(c)
209#define _toupper(c) __toupper(c)
210
211__DARWIN_CTYPE_TOP_inline int
212isalnum(int _c)
213{
214 return (__istype(_c, _CTYPE_A|_CTYPE_D));
215}
216
217__DARWIN_CTYPE_TOP_inline int
218isalpha(int _c)
219{
220 return (__istype(_c, _CTYPE_A));
221}
222
223__DARWIN_CTYPE_TOP_inline int
224isblank(int _c)
225{
226 return (__istype(_c, _CTYPE_B));
227}
228
229__DARWIN_CTYPE_TOP_inline int
230iscntrl(int _c)
231{
232 return (__istype(_c, _CTYPE_C));
233}
234
235/* ANSI -- locale independent */
236__DARWIN_CTYPE_TOP_inline int
237isdigit(int _c)
238{
239 return (__isctype(_c, _CTYPE_D));
240}
241
242__DARWIN_CTYPE_TOP_inline int
243isgraph(int _c)
244{
245 return (__istype(_c, _CTYPE_G));
246}
247
248__DARWIN_CTYPE_TOP_inline int
249islower(int _c)
250{
251 return (__istype(_c, _CTYPE_L));
252}
253
254__DARWIN_CTYPE_TOP_inline int
255isprint(int _c)
256{
257 return (__istype(_c, _CTYPE_R));
258}
259
260__DARWIN_CTYPE_TOP_inline int
261ispunct(int _c)
262{
263 return (__istype(_c, _CTYPE_P));
264}
265
266__DARWIN_CTYPE_TOP_inline int
267isspace(int _c)
268{
269 return (__istype(_c, _CTYPE_S));
270}
271
272__DARWIN_CTYPE_TOP_inline int
273isupper(int _c)
274{
275 return (__istype(_c, _CTYPE_U));
276}
277
278/* ANSI -- locale independent */
279__DARWIN_CTYPE_TOP_inline int
280isxdigit(int _c)
281{
282 return (__isctype(_c, _CTYPE_X));
283}
284
285__DARWIN_CTYPE_TOP_inline int
286toascii(int _c)
287{
288 return (_c & 0x7F);
289}
290
291__DARWIN_CTYPE_TOP_inline int
292tolower(int _c)
293{
294 return (__tolower(_c));
295}
296
297__DARWIN_CTYPE_TOP_inline int
298toupper(int _c)
299{
300 return (__toupper(_c));
301}
302
303#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
304__DARWIN_CTYPE_TOP_inline int
305digittoint(int _c)
306{
307 return (__maskrune(_c, 0x0F));
308}
309
310__DARWIN_CTYPE_TOP_inline int
311ishexnumber(int _c)
312{
313 return (__istype(_c, _CTYPE_X));
314}
315
316__DARWIN_CTYPE_TOP_inline int
317isideogram(int _c)
318{
319 return (__istype(_c, _CTYPE_I));
320}
321
322__DARWIN_CTYPE_TOP_inline int
323isnumber(int _c)
324{
325 return (__istype(_c, _CTYPE_D));
326}
327
328__DARWIN_CTYPE_TOP_inline int
329isphonogram(int _c)
330{
331 return (__istype(_c, _CTYPE_Q));
332}
333
334__DARWIN_CTYPE_TOP_inline int
335isrune(int _c)
336{
337 return (__istype(_c, 0xFFFFFFF0L));
338}
339
340__DARWIN_CTYPE_TOP_inline int
341isspecial(int _c)
342{
343 return (__istype(_c, _CTYPE_T));
344}
345#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
346#endif /* _EXTERNALIZE_CTYPE_INLINES_ */
347
348#else /* not using inlines */
349
350__BEGIN_DECLS
351int isalnum(int);
352int isalpha(int);
353int isblank(int);
354int iscntrl(int);
355int isdigit(int);
356int isgraph(int);
357int islower(int);
358int isprint(int);
359int ispunct(int);
360int isspace(int);
361int isupper(int);
362int isxdigit(int);
363int tolower(int);
364int toupper(int);
365int isascii(int);
366int toascii(int);
367
368#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
369int _tolower(int);
370int _toupper(int);
371int digittoint(int);
372int ishexnumber(int);
373int isideogram(int);
374int isnumber(int);
375int isphonogram(int);
376int isrune(int);
377int isspecial(int);
378#endif
379__END_DECLS
380
381#endif /* using inlines */
382
383#ifdef _USE_EXTENDED_LOCALES_
384#include <xlocale/_ctype.h>
385#endif /* _USE_EXTENDED_LOCALES_ */
386
387#endif /* !_CTYPE_H_ */
lib/libc/include/aarch64-macos-gnu/_locale.h created+76
......@@ -0,0 +1,76 @@
1/*
2 * Copyright (c) 1991, 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 * @(#)locale.h 8.1 (Berkeley) 6/2/93
34 * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $
35 */
36
37#ifndef __LOCALE_H_
38#define __LOCALE_H_
39
40#include <sys/cdefs.h>
41#include <_types.h>
42
43struct lconv {
44 char *decimal_point;
45 char *thousands_sep;
46 char *grouping;
47 char *int_curr_symbol;
48 char *currency_symbol;
49 char *mon_decimal_point;
50 char *mon_thousands_sep;
51 char *mon_grouping;
52 char *positive_sign;
53 char *negative_sign;
54 char int_frac_digits;
55 char frac_digits;
56 char p_cs_precedes;
57 char p_sep_by_space;
58 char n_cs_precedes;
59 char n_sep_by_space;
60 char p_sign_posn;
61 char n_sign_posn;
62 char int_p_cs_precedes;
63 char int_n_cs_precedes;
64 char int_p_sep_by_space;
65 char int_n_sep_by_space;
66 char int_p_sign_posn;
67 char int_n_sign_posn;
68};
69
70#include <sys/_types/_null.h>
71
72__BEGIN_DECLS
73struct lconv *localeconv(void);
74__END_DECLS
75
76#endif /* __LOCALE_H_ */
lib/libc/include/aarch64-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
107typedef __darwin_off_t regoff_t;
108
109typedef 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
116typedef 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/aarch64-macos-gnu/_stdio.h created+159
......@@ -0,0 +1,159 @@
1/*
2 * Copyright (c) 2000, 2005, 2007, 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 * 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 * Chris Torek.
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 * @(#)stdio.h 8.5 (Berkeley) 4/29/95
59 */
60
61/*
62 * Common header for stdio.h and xlocale/_stdio.h
63 */
64
65#ifndef __STDIO_H_
66#define __STDIO_H_
67
68#include <sys/cdefs.h>
69#include <Availability.h>
70
71#include <_types.h>
72
73/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
74 * __gnuc_va_list and include <stdarg.h> */
75#include <sys/_types/_va_list.h>
76#include <sys/_types/_size_t.h>
77#include <sys/_types/_null.h>
78
79#include <sys/stdio.h>
80
81typedef __darwin_off_t fpos_t;
82
83#define _FSTDIO /* Define for new stdio with functions. */
84
85/*
86 * NB: to fit things in six character monocase externals, the stdio
87 * code uses the prefix `__s' for stdio objects, typically followed
88 * by a three-character attempt at a mnemonic.
89 */
90
91/* stdio buffers */
92struct __sbuf {
93 unsigned char *_base;
94 int _size;
95};
96
97/* hold a buncha junk that would grow the ABI */
98struct __sFILEX;
99
100/*
101 * stdio state variables.
102 *
103 * The following always hold:
104 *
105 * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
106 * _lbfsize is -_bf._size, else _lbfsize is 0
107 * if _flags&__SRD, _w is 0
108 * if _flags&__SWR, _r is 0
109 *
110 * This ensures that the getc and putc macros (or inline functions) never
111 * try to write or read from a file that is in `read' or `write' mode.
112 * (Moreover, they can, and do, automatically switch from read mode to
113 * write mode, and back, on "r+" and "w+" files.)
114 *
115 * _lbfsize is used only to make the inline line-buffered output stream
116 * code as compact as possible.
117 *
118 * _ub, _up, and _ur are used when ungetc() pushes back more characters
119 * than fit in the current _bf, or when ungetc() pushes back a character
120 * that does not match the previous one in _bf. When this happens,
121 * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
122 * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
123 *
124 * NB: see WARNING above before changing the layout of this structure!
125 */
126typedef struct __sFILE {
127 unsigned char *_p; /* current position in (some) buffer */
128 int _r; /* read space left for getc() */
129 int _w; /* write space left for putc() */
130 short _flags; /* flags, below; this FILE is free if 0 */
131 short _file; /* fileno, if Unix descriptor, else -1 */
132 struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
133 int _lbfsize; /* 0 or -_bf._size, for inline putc */
134
135 /* operations */
136 void *_cookie; /* cookie passed to io functions */
137 int (* _Nullable _close)(void *);
138 int (* _Nullable _read) (void *, char *, int);
139 fpos_t (* _Nullable _seek) (void *, fpos_t, int);
140 int (* _Nullable _write)(void *, const char *, int);
141
142 /* separate buffer for long sequences of ungetc() */
143 struct __sbuf _ub; /* ungetc buffer */
144 struct __sFILEX *_extra; /* additions to FILE to not break ABI */
145 int _ur; /* saved _r when _r is counting ungetc data */
146
147 /* tricks to meet minimum requirements even when malloc() fails */
148 unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
149 unsigned char _nbuf[1]; /* guarantee a getc() buffer */
150
151 /* separate buffer for fgetln() when line crosses buffer boundary */
152 struct __sbuf _lb; /* buffer for fgetln() */
153
154 /* Unix stdio files get aligned to block boundaries on fseek() */
155 int _blksize; /* stat.st_blksize (may be != _bf._size) */
156 fpos_t _offset; /* current lseek offset (see WARNING) */
157} FILE;
158
159#endif /* __STDIO_H_ */
lib/libc/include/aarch64-macos-gnu/_types.h created+69
......@@ -0,0 +1,69 @@
1/*
2 * Copyright (c) 2004, 2008, 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 __TYPES_H_
25#define __TYPES_H_
26
27#include <sys/_types.h>
28#include <machine/_types.h> /* __uint32_t */
29
30#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
31#define __strfmonlike(fmtarg, firstvararg) \
32 __attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
33#define __strftimelike(fmtarg) \
34 __attribute__((__format__ (__strftime__, fmtarg, 0)))
35#else
36#define __strfmonlike(fmtarg, firstvararg)
37#define __strftimelike(fmtarg)
38#endif
39
40typedef int __darwin_nl_item;
41typedef int __darwin_wctrans_t;
42#ifdef __LP64__
43typedef __uint32_t __darwin_wctype_t;
44#else /* !__LP64__ */
45typedef unsigned long __darwin_wctype_t;
46#endif /* __LP64__ */
47
48#ifdef __WCHAR_MAX__
49#define __DARWIN_WCHAR_MAX __WCHAR_MAX__
50#else /* ! __WCHAR_MAX__ */
51#define __DARWIN_WCHAR_MAX 0x7fffffff
52#endif /* __WCHAR_MAX__ */
53
54#if __DARWIN_WCHAR_MAX > 0xffffU
55#define __DARWIN_WCHAR_MIN (-0x7fffffff - 1)
56#else
57#define __DARWIN_WCHAR_MIN 0
58#endif
59#define __DARWIN_WEOF ((__darwin_wint_t)-1)
60
61#ifndef _FORTIFY_SOURCE
62# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050)
63# define _FORTIFY_SOURCE 0
64# else
65# define _FORTIFY_SOURCE 2 /* on by default */
66# endif
67#endif
68
69#endif /* __TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/_types/_intmax_t.h created+40
......@@ -0,0 +1,40 @@
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 _INTMAX_T
30#define _INTMAX_T
31#ifdef __INTMAX_TYPE__
32typedef __INTMAX_TYPE__ intmax_t;
33#else
34#ifdef __LP64__
35typedef long int intmax_t;
36#else
37typedef long long int intmax_t;
38#endif /* __LP64__ */
39#endif /* __INTMAX_TYPE__ */
40#endif /* _INTMAX_T */
lib/libc/include/aarch64-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>
32typedef __darwin_nl_item nl_item;
33#endif /* _NL_ITEM */
\ No newline at end of file
lib/libc/include/aarch64-macos-gnu/_types/_uint16_t.h created+32
......@@ -0,0 +1,32 @@
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 _UINT16_T
30#define _UINT16_T
31typedef unsigned short uint16_t;
32#endif /* _UINT16_T */
lib/libc/include/aarch64-macos-gnu/_types/_uint32_t.h created+32
......@@ -0,0 +1,32 @@
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 _UINT32_T
30#define _UINT32_T
31typedef unsigned int uint32_t;
32#endif /* _UINT32_T */
lib/libc/include/aarch64-macos-gnu/_types/_uint64_t.h created+32
......@@ -0,0 +1,32 @@
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 _UINT64_T
30#define _UINT64_T
31typedef unsigned long long uint64_t;
32#endif /* _UINT64_T */
lib/libc/include/aarch64-macos-gnu/_types/_uint8_t.h created+32
......@@ -0,0 +1,32 @@
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 _UINT8_T
30#define _UINT8_T
31typedef unsigned char uint8_t;
32#endif /* _UINT8_T */
lib/libc/include/aarch64-macos-gnu/_types/_uintmax_t.h created+40
......@@ -0,0 +1,40 @@
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 _UINTMAX_T
30#define _UINTMAX_T
31#ifdef __UINTMAX_TYPE__
32typedef __UINTMAX_TYPE__ uintmax_t;
33#else
34#ifdef __LP64__
35typedef long unsigned int uintmax_t;
36#else
37typedef long long unsigned int uintmax_t;
38#endif /* __LP64__ */
39#endif /* __UINTMAX_TYPE__ */
40#endif /* _UINTMAX_T */
lib/libc/include/aarch64-macos-gnu/_types/_wctrans_t.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 _WCTRANS_T
30#define _WCTRANS_T
31#include <_types.h>
32typedef __darwin_wctrans_t wctrans_t;
33#endif /* _WCTRANS_T */
\ No newline at end of file
lib/libc/include/aarch64-macos-gnu/_types/_wctype_t.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 _WCTYPE_T
30#define _WCTYPE_T
31#include <_types.h>
32typedef __darwin_wctype_t wctype_t;
33#endif /* _WCTYPE_T */
\ No newline at end of file
lib/libc/include/aarch64-macos-gnu/_wctype.h created+164
......@@ -0,0 +1,164 @@
1/*-
2 * Copyright (c)1999 Citrus Project,
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 */
27
28/*
29 * Common header for wctype.h and wchar.h
30 *
31 * Contains everything required by wctype.h except:
32 *
33 * #include <_types/_wctrans_t.h>
34 * int iswblank(wint_t);
35 * wint_t towctrans(wint_t, wctrans_t);
36 * wctrans_t wctrans(const char *);
37 */
38
39#ifndef __WCTYPE_H_
40#define __WCTYPE_H_
41
42#include <__wctype.h>
43
44/*
45 * Use inline functions if we are allowed to and the compiler supports them.
46 */
47#if !defined(_DONT_USE_CTYPE_INLINE_) && \
48 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
49
50__DARWIN_WCTYPE_TOP_inline int
51iswalnum(wint_t _wc)
52{
53 return (__istype(_wc, _CTYPE_A|_CTYPE_D));
54}
55
56__DARWIN_WCTYPE_TOP_inline int
57iswalpha(wint_t _wc)
58{
59 return (__istype(_wc, _CTYPE_A));
60}
61
62__DARWIN_WCTYPE_TOP_inline int
63iswcntrl(wint_t _wc)
64{
65 return (__istype(_wc, _CTYPE_C));
66}
67
68__DARWIN_WCTYPE_TOP_inline int
69iswctype(wint_t _wc, wctype_t _charclass)
70{
71 return (__istype(_wc, _charclass));
72}
73
74__DARWIN_WCTYPE_TOP_inline int
75iswdigit(wint_t _wc)
76{
77 return (__isctype(_wc, _CTYPE_D));
78}
79
80__DARWIN_WCTYPE_TOP_inline int
81iswgraph(wint_t _wc)
82{
83 return (__istype(_wc, _CTYPE_G));
84}
85
86__DARWIN_WCTYPE_TOP_inline int
87iswlower(wint_t _wc)
88{
89 return (__istype(_wc, _CTYPE_L));
90}
91
92__DARWIN_WCTYPE_TOP_inline int
93iswprint(wint_t _wc)
94{
95 return (__istype(_wc, _CTYPE_R));
96}
97
98__DARWIN_WCTYPE_TOP_inline int
99iswpunct(wint_t _wc)
100{
101 return (__istype(_wc, _CTYPE_P));
102}
103
104__DARWIN_WCTYPE_TOP_inline int
105iswspace(wint_t _wc)
106{
107 return (__istype(_wc, _CTYPE_S));
108}
109
110__DARWIN_WCTYPE_TOP_inline int
111iswupper(wint_t _wc)
112{
113 return (__istype(_wc, _CTYPE_U));
114}
115
116__DARWIN_WCTYPE_TOP_inline int
117iswxdigit(wint_t _wc)
118{
119 return (__isctype(_wc, _CTYPE_X));
120}
121
122__DARWIN_WCTYPE_TOP_inline wint_t
123towlower(wint_t _wc)
124{
125 return (__tolower(_wc));
126}
127
128__DARWIN_WCTYPE_TOP_inline wint_t
129towupper(wint_t _wc)
130{
131 return (__toupper(_wc));
132}
133
134#else /* not using inlines */
135
136__BEGIN_DECLS
137int iswalnum(wint_t);
138int iswalpha(wint_t);
139int iswcntrl(wint_t);
140int iswctype(wint_t, wctype_t);
141int iswdigit(wint_t);
142int iswgraph(wint_t);
143int iswlower(wint_t);
144int iswprint(wint_t);
145int iswpunct(wint_t);
146int iswspace(wint_t);
147int iswupper(wint_t);
148int iswxdigit(wint_t);
149wint_t towlower(wint_t);
150wint_t towupper(wint_t);
151__END_DECLS
152
153#endif /* using inlines */
154
155__BEGIN_DECLS
156wctype_t
157 wctype(const char *);
158__END_DECLS
159
160#ifdef _USE_EXTENDED_LOCALES_
161#include <xlocale/__wctype.h>
162#endif /* _USE_EXTENDED_LOCALES_ */
163
164#endif /* __WCTYPE_H_ */
lib/libc/include/aarch64-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
29struct _xlocale; /* forward reference */
30typedef struct _xlocale * locale_t;
31
32__BEGIN_DECLS
33int ___mb_cur_max(void);
34int ___mb_cur_max_l(locale_t);
35__END_DECLS
36
37#endif /* __XLOCALE_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/alloca.h created+43
......@@ -0,0 +1,43 @@
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#ifndef _ALLOCA_H_
25#define _ALLOCA_H_
26
27#include <sys/cdefs.h>
28#include <_types.h>
29#include <sys/_types/_size_t.h>
30
31__BEGIN_DECLS
32void *alloca(size_t); /* built-in for gcc */
33__END_DECLS
34
35#if defined(__GNUC__) && __GNUC__ >= 3
36/* built-in for gcc 3 */
37#undef alloca
38#undef __alloca
39#define alloca(size) __alloca(size)
40#define __alloca(size) __builtin_alloca(size)
41#endif
42
43#endif /* _ALLOCA_H_ */
lib/libc/include/aarch64-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
40typedef unsigned long NXSwappedFloat;
41typedef unsigned long long NXSwappedDouble;
42
43static __inline__ __attribute__((deprecated))
44unsigned short
45NXSwapShort(
46 unsigned short inv
47)
48{
49 return (unsigned short)OSSwapInt16((uint16_t)inv);
50}
51
52static __inline__ __attribute__((deprecated))
53unsigned int
54NXSwapInt(
55 unsigned int inv
56)
57{
58 return (unsigned int)OSSwapInt32((uint32_t)inv);
59}
60
61static __inline__ __attribute__((deprecated))
62unsigned long
63NXSwapLong(
64 unsigned long inv
65)
66{
67 return (unsigned long)OSSwapInt32((uint32_t)inv);
68}
69
70static __inline__ __attribute__((deprecated))
71unsigned long long
72NXSwapLongLong(
73 unsigned long long inv
74)
75{
76 return (unsigned long long)OSSwapInt64((uint64_t)inv);
77}
78
79static __inline__ __attribute__((deprecated))
80NXSwappedFloat
81NXConvertHostFloatToSwapped(float x)
82{
83 union fconv {
84 float number;
85 NXSwappedFloat sf;
86 } u;
87 u.number = x;
88 return u.sf;
89}
90
91static __inline__ __attribute__((deprecated))
92float
93NXConvertSwappedFloatToHost(NXSwappedFloat x)
94{
95 union fconv {
96 float number;
97 NXSwappedFloat sf;
98 } u;
99 u.sf = x;
100 return u.number;
101}
102
103static __inline__ __attribute__((deprecated))
104NXSwappedDouble
105NXConvertHostDoubleToSwapped(double x)
106{
107 union dconv {
108 double number;
109 NXSwappedDouble sd;
110 } u;
111 u.number = x;
112 return u.sd;
113}
114
115static __inline__ __attribute__((deprecated))
116double
117NXConvertSwappedDoubleToHost(NXSwappedDouble x)
118{
119 union dconv {
120 double number;
121 NXSwappedDouble sd;
122 } u;
123 u.sd = x;
124 return u.number;
125}
126
127static __inline__ __attribute__((deprecated))
128NXSwappedFloat
129NXSwapFloat(NXSwappedFloat x)
130{
131 return (NXSwappedFloat)OSSwapInt32((uint32_t)x);
132}
133
134static __inline__ __attribute__((deprecated))
135NXSwappedDouble
136NXSwapDouble(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
146enum NXByteOrder {
147 NX_UnknownByteOrder,
148 NX_LittleEndian,
149 NX_BigEndian
150};
151
152static __inline__
153enum NXByteOrder
154NXHostByteOrder(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
165static __inline__ __attribute__((deprecated))
166unsigned short
167NXSwapBigShortToHost(
168 unsigned short x
169)
170{
171 return (unsigned short)OSSwapBigToHostInt16((uint16_t)x);
172}
173
174static __inline__ __attribute__((deprecated))
175unsigned int
176NXSwapBigIntToHost(
177 unsigned int x
178)
179{
180 return (unsigned int)OSSwapBigToHostInt32((uint32_t)x);
181}
182
183static __inline__ __attribute__((deprecated))
184unsigned long
185NXSwapBigLongToHost(
186 unsigned long x
187)
188{
189 return (unsigned long)OSSwapBigToHostInt32((uint32_t)x);
190}
191
192static __inline__ __attribute__((deprecated))
193unsigned long long
194NXSwapBigLongLongToHost(
195 unsigned long long x
196)
197{
198 return (unsigned long long)OSSwapBigToHostInt64((uint64_t)x);
199}
200
201static __inline__ __attribute__((deprecated))
202double
203NXSwapBigDoubleToHost(
204 NXSwappedDouble x
205)
206{
207 return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapBigToHostInt64((uint64_t)x));
208}
209
210static __inline__ __attribute__((deprecated))
211float
212NXSwapBigFloatToHost(
213 NXSwappedFloat x
214)
215{
216 return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapBigToHostInt32((uint32_t)x));
217}
218
219static __inline__ __attribute__((deprecated))
220unsigned short
221NXSwapHostShortToBig(
222 unsigned short x
223)
224{
225 return (unsigned short)OSSwapHostToBigInt16((uint16_t)x);
226}
227
228static __inline__ __attribute__((deprecated))
229unsigned int
230NXSwapHostIntToBig(
231 unsigned int x
232)
233{
234 return (unsigned int)OSSwapHostToBigInt32((uint32_t)x);
235}
236
237static __inline__ __attribute__((deprecated))
238unsigned long
239NXSwapHostLongToBig(
240 unsigned long x
241)
242{
243 return (unsigned long)OSSwapHostToBigInt32((uint32_t)x);
244}
245
246static __inline__ __attribute__((deprecated))
247unsigned long long
248NXSwapHostLongLongToBig(
249 unsigned long long x
250)
251{
252 return (unsigned long long)OSSwapHostToBigInt64((uint64_t)x);
253}
254
255static __inline__ __attribute__((deprecated))
256NXSwappedDouble
257NXSwapHostDoubleToBig(
258 double x
259)
260{
261 return (NXSwappedDouble)OSSwapHostToBigInt64((uint64_t)NXConvertHostDoubleToSwapped(x));
262}
263
264static __inline__ __attribute__((deprecated))
265NXSwappedFloat
266NXSwapHostFloatToBig(
267 float x
268)
269{
270 return (NXSwappedFloat)OSSwapHostToBigInt32((uint32_t)NXConvertHostFloatToSwapped(x));
271}
272
273static __inline__ __attribute__((deprecated))
274unsigned short
275NXSwapLittleShortToHost(
276 unsigned short x
277)
278{
279 return (unsigned short)OSSwapLittleToHostInt16((uint16_t)x);
280}
281
282static __inline__ __attribute__((deprecated))
283unsigned int
284NXSwapLittleIntToHost(
285 unsigned int x
286)
287{
288 return (unsigned int)OSSwapLittleToHostInt32((uint32_t)x);
289}
290
291static __inline__ __attribute__((deprecated))
292unsigned long
293NXSwapLittleLongToHost(
294 unsigned long x
295)
296{
297 return (unsigned long)OSSwapLittleToHostInt32((uint32_t)x);
298}
299
300static __inline__ __attribute__((deprecated))
301unsigned long long
302NXSwapLittleLongLongToHost(
303 unsigned long long x
304)
305{
306 return (unsigned long long)OSSwapLittleToHostInt64((uint64_t)x);
307}
308
309static __inline__ __attribute__((deprecated))
310double
311NXSwapLittleDoubleToHost(
312 NXSwappedDouble x
313)
314{
315 return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapLittleToHostInt64((uint64_t)x));
316}
317
318static __inline__ __attribute__((deprecated))
319float
320NXSwapLittleFloatToHost(
321 NXSwappedFloat x
322)
323{
324 return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapLittleToHostInt32((uint32_t)x));
325}
326
327static __inline__ __attribute__((deprecated))
328unsigned short
329NXSwapHostShortToLittle(
330 unsigned short x
331)
332{
333 return (unsigned short)OSSwapHostToLittleInt16((uint16_t)x);
334}
335
336static __inline__ __attribute__((deprecated))
337unsigned int
338NXSwapHostIntToLittle(
339 unsigned int x
340)
341{
342 return (unsigned int)OSSwapHostToLittleInt32((uint32_t)x);
343}
344
345static __inline__ __attribute__((deprecated))
346unsigned long
347NXSwapHostLongToLittle(
348 unsigned long x
349)
350{
351 return (unsigned long)OSSwapHostToLittleInt32((uint32_t)x);
352}
353
354static __inline__ __attribute__((deprecated))
355unsigned long long
356NXSwapHostLongLongToLittle(
357 unsigned long long x
358)
359{
360 return (unsigned long long)OSSwapHostToLittleInt64((uint64_t)x);
361}
362
363static __inline__ __attribute__((deprecated))
364NXSwappedDouble
365NXSwapHostDoubleToLittle(
366 double x
367)
368{
369 return (NXSwappedDouble)OSSwapHostToLittleInt64((uint64_t)NXConvertHostDoubleToSwapped(x));
370}
371
372static __inline__ __attribute__((deprecated))
373NXSwappedFloat
374NXSwapHostFloatToLittle(
375 float x
376)
377{
378 return (NXSwappedFloat)OSSwapHostToLittleInt32((uint32_t)NXConvertHostFloatToSwapped(x));
379}
380
381#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */
lib/libc/include/aarch64-macos-gnu/arm/_limits.h created+9
......@@ -0,0 +1,9 @@
1/*
2 * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
3 */
4#ifndef _ARM__LIMITS_H_
5#define _ARM__LIMITS_H_
6
7#define __DARWIN_CLK_TCK 100 /* ticks per second */
8
9#endif /* _ARM__LIMITS_H_ */
lib/libc/include/aarch64-macos-gnu/arm/_mcontext.h created+91
......@@ -0,0 +1,91 @@
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#ifndef __ARM_MCONTEXT_H_
30#define __ARM_MCONTEXT_H_
31
32#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
33#include <sys/appleapiopts.h>
34#include <mach/machine/_structs.h>
35
36#ifndef _STRUCT_MCONTEXT32
37#if __DARWIN_UNIX03
38#define _STRUCT_MCONTEXT32 struct __darwin_mcontext32
39_STRUCT_MCONTEXT32
40{
41 _STRUCT_ARM_EXCEPTION_STATE __es;
42 _STRUCT_ARM_THREAD_STATE __ss;
43 _STRUCT_ARM_VFP_STATE __fs;
44};
45
46#else /* !__DARWIN_UNIX03 */
47#define _STRUCT_MCONTEXT32 struct mcontext32
48_STRUCT_MCONTEXT32
49{
50 _STRUCT_ARM_EXCEPTION_STATE es;
51 _STRUCT_ARM_THREAD_STATE ss;
52 _STRUCT_ARM_VFP_STATE fs;
53};
54
55#endif /* __DARWIN_UNIX03 */
56#endif /* _STRUCT_MCONTEXT32 */
57
58
59#ifndef _STRUCT_MCONTEXT64
60#if __DARWIN_UNIX03
61#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
62_STRUCT_MCONTEXT64
63{
64 _STRUCT_ARM_EXCEPTION_STATE64 __es;
65 _STRUCT_ARM_THREAD_STATE64 __ss;
66 _STRUCT_ARM_NEON_STATE64 __ns;
67};
68
69#else /* !__DARWIN_UNIX03 */
70#define _STRUCT_MCONTEXT64 struct mcontext64
71_STRUCT_MCONTEXT64
72{
73 _STRUCT_ARM_EXCEPTION_STATE64 es;
74 _STRUCT_ARM_THREAD_STATE64 ss;
75 _STRUCT_ARM_NEON_STATE64 ns;
76};
77#endif /* __DARWIN_UNIX03 */
78#endif /* _STRUCT_MCONTEXT32 */
79
80#ifndef _MCONTEXT_T
81#define _MCONTEXT_T
82#if defined(__arm64__)
83typedef _STRUCT_MCONTEXT64 *mcontext_t;
84#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
85#else
86typedef _STRUCT_MCONTEXT32 *mcontext_t;
87#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32
88#endif
89#endif /* _MCONTEXT_T */
90
91#endif /* __ARM_MCONTEXT_H_ */
lib/libc/include/aarch64-macos-gnu/arm/_param.h created+22
......@@ -0,0 +1,22 @@
1/*
2 * Copyright (c) 2006-2007 Apple Inc. All rights reserved.
3 */
4
5#ifndef _ARM__PARAM_H_
6#define _ARM__PARAM_H_
7
8#include <arm/_types.h>
9
10/*
11 * Round p (pointer or byte index) up to a correctly-aligned value for all
12 * data types (int, long, ...). The result is unsigned int and must be
13 * cast to any desired pointer type.
14 */
15#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1)
16#define __DARWIN_ALIGN(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
17
18#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
19#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
20
21
22#endif /* _ARM__PARAM_H_ */
lib/libc/include/aarch64-macos-gnu/arm/_types.h created+98
......@@ -0,0 +1,98 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 */
4#ifndef _BSD_ARM__TYPES_H_
5#define _BSD_ARM__TYPES_H_
6
7/*
8 * This header file contains integer types. It's intended to also contain
9 * flotaing point and other arithmetic types, as needed, later.
10 */
11
12#ifdef __GNUC__
13typedef __signed char __int8_t;
14#else /* !__GNUC__ */
15typedef char __int8_t;
16#endif /* !__GNUC__ */
17typedef unsigned char __uint8_t;
18typedef short __int16_t;
19typedef unsigned short __uint16_t;
20typedef int __int32_t;
21typedef unsigned int __uint32_t;
22typedef long long __int64_t;
23typedef unsigned long long __uint64_t;
24
25typedef long __darwin_intptr_t;
26typedef unsigned int __darwin_natural_t;
27
28/*
29 * The rune type below is declared to be an ``int'' instead of the more natural
30 * ``unsigned long'' or ``long''. Two things are happening here. It is not
31 * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
32 * it looks like 10646 will be a 31 bit standard. This means that if your
33 * ints cannot hold 32 bits, you will be in trouble. The reason an int was
34 * chosen over a long is that the is*() and to*() routines take ints (says
35 * ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it
36 * here, you lose a bit of ANSI conformance, but your programs will still
37 * work.
38 *
39 * NOTE: rune_t is not covered by ANSI nor other standards, and should not
40 * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
41 * rune_t must be the same type. Also wint_t must be no narrower than
42 * wchar_t, and should also be able to hold all members of the largest
43 * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
44 */
45
46typedef int __darwin_ct_rune_t; /* ct_rune_t */
47
48/*
49 * mbstate_t is an opaque object to keep conversion state, during multibyte
50 * stream conversions. The content must not be referenced by user programs.
51 */
52typedef union {
53 char __mbstate8[128];
54 long long _mbstateL; /* for alignment */
55} __mbstate_t;
56
57typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
58
59#if defined(__PTRDIFF_TYPE__)
60typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
61#elif defined(__LP64__)
62typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
63#else
64typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
65#endif /* __GNUC__ */
66
67#if defined(__SIZE_TYPE__)
68typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
69#else
70typedef unsigned long __darwin_size_t; /* sizeof() */
71#endif
72
73#if (__GNUC__ > 2)
74typedef __builtin_va_list __darwin_va_list; /* va_list */
75#else
76typedef void * __darwin_va_list; /* va_list */
77#endif
78
79#if defined(__WCHAR_TYPE__)
80typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
81#else
82typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
83#endif
84
85typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */
86
87#if defined(__WINT_TYPE__)
88typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */
89#else
90typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */
91#endif
92
93typedef unsigned long __darwin_clock_t; /* clock() */
94typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
95typedef long __darwin_ssize_t; /* byte count or error */
96typedef long __darwin_time_t; /* time() */
97
98#endif /* _BSD_ARM__TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/arm/arch.h created+67
......@@ -0,0 +1,67 @@
1/*
2 * Copyright (c) 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#ifndef _ARM_ARCH_H
29#define _ARM_ARCH_H
30
31/* Collect the __ARM_ARCH_*__ compiler flags into something easier to use. */
32#if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7S__) || defined (__ARM_ARCH_7F__) || defined (__ARM_ARCH_7K__)
33#define _ARM_ARCH_7
34#endif
35
36#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
37#define _ARM_ARCH_6K
38#endif
39
40#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__)
41#define _ARM_ARCH_6Z
42#endif
43
44#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \
45 defined (_ARM_ARCH_6Z) || defined (_ARM_ARCH_6K)
46#define _ARM_ARCH_6
47#endif
48
49#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5E__) || \
50 defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
51#define _ARM_ARCH_5E
52#endif
53
54#if defined (_ARM_ARCH_5E) || defined (__ARM_ARCH_5__) || \
55 defined (__ARM_ARCH_5T__)
56#define _ARM_ARCH_5
57#endif
58
59#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
60#define _ARM_ARCH_4T
61#endif
62
63#if defined (_ARM_ARCH_4T) || defined (__ARM_ARCH_4__)
64#define _ARM_ARCH_4
65#endif
66
67#endif
lib/libc/include/aarch64-macos-gnu/arm/endian.h created+78
......@@ -0,0 +1,78 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 */
4/*
5 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
6 */
7/*
8 * Copyright (c) 1987, 1991, 1993
9 * The Regents of the University of California. 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 * @(#)endian.h 8.1 (Berkeley) 6/11/93
40 */
41
42#ifndef _ARM__ENDIAN_H_
43#define _ARM__ENDIAN_H_
44
45#include <sys/cdefs.h>
46/*
47 * Define _NOQUAD if the compiler does NOT support 64-bit integers.
48 */
49/* #define _NOQUAD */
50
51/*
52 * Define the order of 32-bit words in 64-bit words.
53 */
54#define _QUAD_HIGHWORD 1
55#define _QUAD_LOWWORD 0
56
57/*
58 * Definitions for byte order, according to byte significance from low
59 * address to high.
60 */
61#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
62#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
63#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
64
65#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
66
67#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
68
69#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
70#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
71#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
72
73#define BYTE_ORDER __DARWIN_BYTE_ORDER
74
75#include <sys/_endian.h>
76
77#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
78#endif /* !_ARM__ENDIAN_H_ */
lib/libc/include/aarch64-macos-gnu/arm/limits.h created+110
......@@ -0,0 +1,110 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 */
4/*
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. 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. 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 * @(#)limits.h 8.3 (Berkeley) 1/4/94
37 */
38
39#ifndef _ARM_LIMITS_H_
40#define _ARM_LIMITS_H_
41
42#include <sys/cdefs.h>
43#include <arm/_limits.h>
44
45#define CHAR_BIT 8 /* number of bits in a char */
46#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
47
48#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
49#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */
50#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
51
52/*
53 * According to ANSI (section 2.2.4.2), the values below must be usable by
54 * #if preprocessing directives. Additionally, the expression must have the
55 * same type as would an expression that is an object of the corresponding
56 * type converted according to the integral promotions. The subtraction for
57 * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
58 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
59 * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values
60 * are written as hex so that GCC will be quiet about large integer constants.
61 */
62#define SCHAR_MAX 127 /* min value for a signed char */
63#define SCHAR_MIN (-128) /* max value for a signed char */
64
65#define UCHAR_MAX 255 /* max value for an unsigned char */
66#define CHAR_MAX 127 /* max value for a char */
67#define CHAR_MIN (-128) /* min value for a char */
68
69#define USHRT_MAX 65535 /* max value for an unsigned short */
70#define SHRT_MAX 32767 /* max value for a short */
71#define SHRT_MIN (-32768) /* min value for a short */
72
73#define UINT_MAX 0xffffffff /* max value for an unsigned int */
74#define INT_MAX 2147483647 /* max value for an int */
75#define INT_MIN (-2147483647-1) /* min value for an int */
76
77#ifdef __LP64__
78#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */
79#define LONG_MAX 0x7fffffffffffffffL /* max signed long */
80#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */
81#else /* !__LP64__ */
82#define ULONG_MAX 0xffffffffUL /* max unsigned long */
83#define LONG_MAX 2147483647L /* max signed long */
84#define LONG_MIN (-2147483647L-1) /* min signed long */
85#endif /* __LP64__ */
86
87#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */
88#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
89#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
90
91#if !defined(_ANSI_SOURCE)
92#ifdef __LP64__
93#define LONG_BIT 64
94#else /* !__LP64__ */
95#define LONG_BIT 32
96#endif /* __LP64__ */
97#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
98#define WORD_BIT 32
99
100#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
101#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */
102
103#define UQUAD_MAX ULLONG_MAX
104#define QUAD_MAX LLONG_MAX
105#define QUAD_MIN LLONG_MIN
106
107#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
108#endif /* !_ANSI_SOURCE */
109
110#endif /* _ARM_LIMITS_H_ */
lib/libc/include/aarch64-macos-gnu/arm/param.h created+147
......@@ -0,0 +1,147 @@
1/*
2 * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
3 */
4/*-
5 * Copyright (c) 1990, 1993
6 * The Regents of the University of California. All rights reserved.
7 * (c) UNIX System Laboratories, Inc.
8 * All or some portions of this file are derived from material licensed
9 * to the University of California by American Telephone and Telegraph
10 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
11 * the permission of UNIX System Laboratories, Inc.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 *
41 * @(#)param.h 8.1 (Berkeley) 4/4/95
42 */
43
44/*
45 * Machine dependent constants for ARM
46 */
47
48#ifndef _ARM_PARAM_H_
49#define _ARM_PARAM_H_
50
51#include <arm/_param.h>
52
53/*
54 * Round p (pointer or byte index) up to a correctly-aligned value for all
55 * data types (int, long, ...). The result is unsigned int and must be
56 * cast to any desired pointer type.
57 */
58#define ALIGNBYTES __DARWIN_ALIGNBYTES
59#define ALIGN(p) __DARWIN_ALIGN(p)
60
61#define NBPG 4096 /* bytes/page */
62#define PGOFSET (NBPG-1) /* byte offset into page */
63#define PGSHIFT 12 /* LOG2(NBPG) */
64
65#define DEV_BSIZE 512
66#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
67#define BLKDEV_IOSIZE 2048
68#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
69
70#define CLSIZE 1
71#define CLSIZELOG2 0
72
73/*
74 * Constants related to network buffer management.
75 * MCLBYTES must be no larger than CLBYTES (the software page size), and,
76 * on machines that exchange pages of input or output buffers with mbuf
77 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
78 * of the hardware page size.
79 */
80#define MSIZESHIFT 8 /* 256 */
81#define MSIZE (1 << MSIZESHIFT) /* size of an mbuf */
82#define MCLSHIFT 11 /* 2048 */
83#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
84#define MBIGCLSHIFT 12 /* 4096 */
85#define MBIGCLBYTES (1 << MBIGCLSHIFT) /* size of a big cluster */
86#define M16KCLSHIFT 14 /* 16384 */
87#define M16KCLBYTES (1 << M16KCLSHIFT) /* size of a jumbo cluster */
88
89#define MCLOFSET (MCLBYTES - 1)
90#ifndef NMBCLUSTERS
91#define NMBCLUSTERS CONFIG_NMBCLUSTERS /* cl map size */
92#endif
93
94/*
95 * Some macros for units conversion
96 */
97/* Core clicks (NeXT_page_size bytes) to segments and vice versa */
98#define ctos(x) (x)
99#define stoc(x) (x)
100
101/* Core clicks (4096 bytes) to disk blocks */
102#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
103#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
104#define dtob(x) ((x)<<DEV_BSHIFT)
105
106/* clicks to bytes */
107#define ctob(x) ((x)<<PGSHIFT)
108
109/* bytes to clicks */
110#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
111
112#ifdef __APPLE__
113#define btodb(bytes, devBlockSize) \
114 ((unsigned)(bytes) / devBlockSize)
115#define dbtob(db, devBlockSize) \
116 ((unsigned)(db) * devBlockSize)
117#else
118#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
119 ((unsigned)(bytes) >> DEV_BSHIFT)
120#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
121 ((unsigned)(db) << DEV_BSHIFT)
122#endif
123
124/*
125 * Map a ``block device block'' to a file system block.
126 * This should be device dependent, and will be if we
127 * add an entry to cdevsw/bdevsw for that purpose.
128 * For now though just use DEV_BSIZE.
129 */
130#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
131
132/*
133 * Macros to decode (and encode) processor status word.
134 */
135#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl))
136#define USERMODE(x) (((x) & 3) == 3)
137#define BASEPRI(x) (((x) & (255 << 8)) == 0)
138
139
140#if defined(KERNEL) || defined(STANDALONE)
141#define DELAY(n) delay(n)
142
143#else /* defined(KERNEL) || defined(STANDALONE) */
144#define DELAY(n) { int N = (n); while (--N > 0); }
145#endif /* defined(KERNEL) || defined(STANDALONE) */
146
147#endif /* _ARM_PARAM_H_ */
lib/libc/include/aarch64-macos-gnu/arm/signal.h created+18
......@@ -0,0 +1,18 @@
1/*
2 * Copyright (c) 2000-2009 Apple, Inc. All rights reserved.
3 */
4/*
5 * Copyright (c) 1992 NeXT Computer, Inc.
6 *
7 */
8
9#ifndef _ARM_SIGNAL_
10#define _ARM_SIGNAL_ 1
11
12#include <sys/cdefs.h>
13
14#ifndef _ANSI_SOURCE
15typedef int sig_atomic_t;
16#endif /* ! _ANSI_SOURCE */
17
18#endif /* _ARM_SIGNAL_ */
lib/libc/include/aarch64-macos-gnu/arm/types.h created+107
......@@ -0,0 +1,107 @@
1/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
3 */
4/*
5 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
6 */
7/*
8 * Copyright (c) 1990, 1993
9 * The Regents of the University of California. 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 * @(#)types.h 8.3 (Berkeley) 1/5/94
40 */
41
42#ifndef _MACHTYPES_H_
43#define _MACHTYPES_H_
44
45#ifndef __ASSEMBLER__
46#include <arm/_types.h>
47#include <sys/cdefs.h>
48/*
49 * Basic integral types. Omit the typedef if
50 * not possible for a machine/compiler combination.
51 */
52#include <sys/_types/_int8_t.h>
53#include <sys/_types/_int16_t.h>
54#include <sys/_types/_int32_t.h>
55#include <sys/_types/_int64_t.h>
56
57#include <sys/_types/_u_int8_t.h>
58#include <sys/_types/_u_int16_t.h>
59#include <sys/_types/_u_int32_t.h>
60#include <sys/_types/_u_int64_t.h>
61
62#if __LP64__
63typedef int64_t register_t;
64#else
65typedef int32_t register_t;
66#endif
67
68#include <sys/_types/_intptr_t.h>
69#include <sys/_types/_uintptr_t.h>
70
71#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
72/* These types are used for reserving the largest possible size. */
73#ifdef __arm64__
74typedef u_int64_t user_addr_t;
75typedef u_int64_t user_size_t;
76typedef int64_t user_ssize_t;
77typedef int64_t user_long_t;
78typedef u_int64_t user_ulong_t;
79typedef int64_t user_time_t;
80typedef int64_t user_off_t;
81#else
82typedef u_int32_t user_addr_t;
83typedef u_int32_t user_size_t;
84typedef int32_t user_ssize_t;
85typedef int32_t user_long_t;
86typedef u_int32_t user_ulong_t;
87typedef int32_t user_time_t;
88typedef int64_t user_off_t;
89#endif
90
91#define USER_ADDR_NULL ((user_addr_t) 0)
92#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
93
94
95#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
96
97/* This defines the size of syscall arguments after copying into the kernel: */
98#if defined(__arm__)
99typedef u_int32_t syscall_arg_t;
100#elif defined(__arm64__)
101typedef u_int64_t syscall_arg_t;
102#else
103#error Unknown architecture.
104#endif
105
106#endif /* __ASSEMBLER__ */
107#endif /* _MACHTYPES_H_ */
lib/libc/include/aarch64-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
75in_addr_t inet_addr(const char *);
76char *inet_ntoa(struct in_addr);
77const char *inet_ntop(int, const void *, char *, socklen_t);
78int inet_pton(int, const char *, void *);
79
80#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
81int ascii2addr(int, const char *, void *);
82char *addr2ascii(int, const void *, int, char *);
83int inet_aton(const char *, struct in_addr *);
84in_addr_t inet_lnaof(struct in_addr);
85struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
86in_addr_t inet_netof(struct in_addr);
87in_addr_t inet_network(const char *);
88char *inet_net_ntop(int, const void *, int, char *, __darwin_size_t);
89int inet_net_pton(int, const char *, void *, __darwin_size_t);
90char *inet_neta(in_addr_t, char *, __darwin_size_t);
91unsigned int inet_nsap_addr(const char *, unsigned char *, int);
92char *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/aarch64-macos-gnu/assert.h created+111
......@@ -0,0 +1,111 @@
1/*-
2 * Copyright (c) 1992, 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 * @(#)assert.h 8.2 (Berkeley) 1/21/94
39 * $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $
40 */
41
42#include <sys/cdefs.h>
43#ifdef __cplusplus
44#include <stdlib.h>
45#endif /* __cplusplus */
46
47/*
48 * Unlike other ANSI header files, <assert.h> may usefully be included
49 * multiple times, with and without NDEBUG defined.
50 */
51
52#undef assert
53#undef __assert
54
55#ifdef NDEBUG
56#define assert(e) ((void)0)
57#else
58
59#ifndef __GNUC__
60
61__BEGIN_DECLS
62#ifndef __cplusplus
63void abort(void) __dead2 __cold;
64#endif /* !__cplusplus */
65int printf(const char * __restrict, ...);
66__END_DECLS
67
68#define assert(e) \
69 ((void) ((e) ? ((void)0) : __assert (#e, __FILE__, __LINE__)))
70#define __assert(e, file, line) \
71 ((void)printf ("%s:%d: failed assertion `%s'\n", file, line, e), abort())
72
73#else /* __GNUC__ */
74
75__BEGIN_DECLS
76void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls;
77#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
78void __eprintf(const char *, const char *, unsigned, const char *) __dead2 __cold;
79#endif
80__END_DECLS
81
82#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
83#define __assert(e, file, line) \
84 __eprintf ("%s:%d: failed assertion `%s'\n", file, line, e)
85#else
86/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
87#define __assert(e, file, line) \
88 __assert_rtn ((const char *)-1L, file, line, e)
89#endif
90
91#if __DARWIN_UNIX03
92#define assert(e) \
93 (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
94#else /* !__DARWIN_UNIX03 */
95#define assert(e) \
96 (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0)
97#endif /* __DARWIN_UNIX03 */
98
99#endif /* __GNUC__ */
100#endif /* NDEBUG */
101
102#ifndef _ASSERT_H_
103#define _ASSERT_H_
104
105#ifndef __cplusplus
106#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
107#define static_assert _Static_assert
108#endif /* __STDC_VERSION__ */
109#endif /* !__cplusplus */
110
111#endif /* _ASSERT_H_ */
lib/libc/include/aarch64-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
194typedef uid_t au_id_t;
195typedef pid_t au_asid_t;
196typedef u_int16_t au_event_t;
197typedef u_int16_t au_emod_t;
198typedef u_int32_t au_class_t;
199typedef u_int64_t au_asflgs_t __attribute__ ((aligned(8)));
200typedef unsigned char au_ctlmode_t;
201
202struct au_tid {
203 dev_t port;
204 u_int32_t machine;
205};
206typedef struct au_tid au_tid_t;
207
208struct au_tid_addr {
209 dev_t at_port;
210 u_int32_t at_type;
211 u_int32_t at_addr[4];
212};
213typedef struct au_tid_addr au_tid_addr_t;
214
215struct au_mask {
216 unsigned int am_success; /* Success bits. */
217 unsigned int am_failure; /* Failure bits. */
218};
219typedef struct au_mask au_mask_t;
220
221struct 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};
227typedef struct auditinfo auditinfo_t;
228
229struct 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};
236typedef struct auditinfo_addr auditinfo_addr_t;
237
238struct 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};
245typedef struct auditpinfo auditpinfo_t;
246
247struct 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};
255typedef struct auditpinfo_addr auditpinfo_addr_t;
256
257struct au_session {
258 auditinfo_addr_t *as_aia_p; /* Ptr to full audit info. */
259 au_mask_t as_mask; /* Process Audit Masks. */
260};
261typedef struct au_session au_session_t;
262
263struct 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};
268typedef struct au_expire_after au_expire_after_t;
269
270/*
271 * Contents of token_t are opaque outside of libbsm.
272 */
273typedef 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 */
283struct 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};
294typedef struct au_qctrl au_qctrl_t;
295
296/*
297 * Structure for the audit statistics.
298 */
299struct 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};
315typedef struct audit_stat au_stat_t;
316
317/*
318 * Structure for the audit file statistics.
319 */
320struct audit_fstat {
321 u_int64_t af_filesz;
322 u_int64_t af_currsz;
323};
324typedef struct audit_fstat au_fstat_t;
325
326/*
327 * Audit to event class mapping.
328 */
329struct au_evclass_map {
330 au_event_t ec_number;
331 au_class_t ec_class;
332};
333typedef 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)
347int audit(const void *, int)
348__AUDIT_API_DEPRECATED;
349int auditon(int, void *, int)
350__AUDIT_API_DEPRECATED;
351int auditctl(const char *)
352__AUDIT_API_DEPRECATED;
353int getauid(au_id_t *);
354int setauid(const au_id_t *);
355int getaudit_addr(struct auditinfo_addr *, int);
356int 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
366int getaudit(struct auditinfo *)
367__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
368 __IPHONE_2_0, __IPHONE_6_0);
369int 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
374int getaudit(struct auditinfo *)
375__AUDIT_API_DEPRECATED;
376int setaudit(const struct auditinfo *)
377__AUDIT_API_DEPRECATED;
378#endif /* !__APPLE__ */
379
380#ifdef __APPLE_API_PRIVATE
381#include <mach/port.h>
382mach_port_name_t audit_session_self(void);
383au_asid_t audit_session_join(mach_port_name_t port);
384int 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/aarch64-macos-gnu/complex.h created+167
......@@ -0,0 +1,167 @@
1/*
2 * Copyright (c) 2002-2013 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/******************************************************************************
24 * *
25 * File: complex.h *
26 * *
27 * Contains: prototypes and macros germane to C99 complex math. *
28 * *
29 ******************************************************************************/
30
31#ifndef __COMPLEX_H__
32#define __COMPLEX_H__
33
34#include <sys/cdefs.h>
35
36#undef complex
37#define complex _Complex
38#undef _Complex_I
39/* Constant expression of type const float _Complex */
40#define _Complex_I (__extension__ 1.0iF)
41#undef I
42#define I _Complex_I
43
44#if (__STDC_VERSION__ > 199901L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL) \
45 && defined __clang__
46
47/* Complex initializer macros. These are a C11 feature, but are also provided
48 as an extension in C99 so long as strict POSIX conformance is not
49 requested. They are available only when building with the llvm-clang
50 compiler, as there is no way to support them with the gcc-4.2 frontend.
51 These may be used for static initialization of complex values, like so:
52
53 static const float complex someVariable = CMPLXF(1.0, INFINITY);
54
55 they may, of course, be used outside of static contexts as well. */
56
57#define CMPLX(__real,__imag) \
58 _Pragma("clang diagnostic push") \
59 _Pragma("clang diagnostic ignored \"-Wcomplex-component-init\"") \
60 (double _Complex){(__real),(__imag)} \
61 _Pragma("clang diagnostic pop")
62
63#define CMPLXF(__real,__imag) \
64 _Pragma("clang diagnostic push") \
65 _Pragma("clang diagnostic ignored \"-Wcomplex-component-init\"") \
66 (float _Complex){(__real),(__imag)} \
67 _Pragma("clang diagnostic pop")
68
69#define CMPLXL(__real,__imag) \
70 _Pragma("clang diagnostic push") \
71 _Pragma("clang diagnostic ignored \"-Wcomplex-component-init\"") \
72 (long double _Complex){(__real),(__imag)} \
73 _Pragma("clang diagnostic pop")
74
75#endif /* End C11 features. */
76
77__BEGIN_DECLS
78extern float complex cacosf(float complex);
79extern double complex cacos(double complex);
80extern long double complex cacosl(long double complex);
81
82extern float complex casinf(float complex);
83extern double complex casin(double complex);
84extern long double complex casinl(long double complex);
85
86extern float complex catanf(float complex);
87extern double complex catan(double complex);
88extern long double complex catanl(long double complex);
89
90extern float complex ccosf(float complex);
91extern double complex ccos(double complex);
92extern long double complex ccosl(long double complex);
93
94extern float complex csinf(float complex);
95extern double complex csin(double complex);
96extern long double complex csinl(long double complex);
97
98extern float complex ctanf(float complex);
99extern double complex ctan(double complex);
100extern long double complex ctanl(long double complex);
101
102extern float complex cacoshf(float complex);
103extern double complex cacosh(double complex);
104extern long double complex cacoshl(long double complex);
105
106extern float complex casinhf(float complex);
107extern double complex casinh(double complex);
108extern long double complex casinhl(long double complex);
109
110extern float complex catanhf(float complex);
111extern double complex catanh(double complex);
112extern long double complex catanhl(long double complex);
113
114extern float complex ccoshf(float complex);
115extern double complex ccosh(double complex);
116extern long double complex ccoshl(long double complex);
117
118extern float complex csinhf(float complex);
119extern double complex csinh(double complex);
120extern long double complex csinhl(long double complex);
121
122extern float complex ctanhf(float complex);
123extern double complex ctanh(double complex);
124extern long double complex ctanhl(long double complex);
125
126extern float complex cexpf(float complex);
127extern double complex cexp(double complex);
128extern long double complex cexpl(long double complex);
129
130extern float complex clogf(float complex);
131extern double complex clog(double complex);
132extern long double complex clogl(long double complex);
133
134extern float cabsf(float complex);
135extern double cabs(double complex);
136extern long double cabsl(long double complex);
137
138extern float complex cpowf(float complex, float complex);
139extern double complex cpow(double complex, double complex);
140extern long double complex cpowl(long double complex, long double complex);
141
142extern float complex csqrtf(float complex);
143extern double complex csqrt(double complex);
144extern long double complex csqrtl(long double complex);
145
146extern float cargf(float complex);
147extern double carg(double complex);
148extern long double cargl(long double complex);
149
150extern float cimagf(float complex);
151extern double cimag(double complex);
152extern long double cimagl(long double complex);
153
154extern float complex conjf(float complex);
155extern double complex conj(double complex);
156extern long double complex conjl(long double complex);
157
158extern float complex cprojf(float complex);
159extern double complex cproj(double complex);
160extern long double complex cprojl(long double complex);
161
162extern float crealf(float complex);
163extern double creal(double complex);
164extern long double creall(long double complex);
165__END_DECLS
166
167#endif /* __COMPLEX_H__ */
lib/libc/include/aarch64-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
39struct _copyfile_state;
40typedef struct _copyfile_state * copyfile_state_t;
41typedef 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
55int copyfile(const char *from, const char *to, copyfile_state_t state, copyfile_flags_t flags);
56int fcopyfile(int from_fd, int to_fd, copyfile_state_t, copyfile_flags_t flags);
57
58int copyfile_state_free(copyfile_state_t);
59copyfile_state_t copyfile_state_alloc(void);
60
61
62int copyfile_state_get(copyfile_state_t s, uint32_t flag, void * dst);
63int copyfile_state_set(copyfile_state_t s, uint32_t flag, const void * src);
64
65typedef 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/aarch64-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/aarch64-macos-gnu/crt_externs.h created+47
......@@ -0,0 +1,47 @@
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
25 */
26
27/*
28** Prototypes for the functions to get environment information in
29** the world of dynamic libraries. Lifted from .c file of same name.
30** Fri Jun 23 12:56:47 PDT 1995
31** AOF (afreier@next.com)
32*/
33
34#include <sys/cdefs.h>
35
36__BEGIN_DECLS
37extern char ***_NSGetArgv(void);
38extern int *_NSGetArgc(void);
39extern char ***_NSGetEnviron(void);
40extern char **_NSGetProgname(void);
41#ifdef __LP64__
42extern struct mach_header_64 *
43#else /* !__LP64__ */
44extern struct mach_header *
45#endif /* __LP64__ */
46 _NSGetMachExecuteHeader(void);
47__END_DECLS
lib/libc/include/aarch64-macos-gnu/ctype.h created+75
......@@ -0,0 +1,75 @@
1/*
2 * Copyright (c) 2000, 2005, 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 * (c) UNIX System Laboratories, Inc.
27 * All or some portions of this file are derived from material licensed
28 * to the University of California by American Telephone and Telegraph
29 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30 * the permission of UNIX System Laboratories, Inc.
31 *
32 * This code is derived from software contributed to Berkeley by
33 * Paul Borman at Krystal Technologies.
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 * 1. Redistributions of source code must retain the above copyright
39 * notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright
41 * notice, this list of conditions and the following disclaimer in the
42 * documentation and/or other materials provided with the distribution.
43 * 3. All advertising materials mentioning features or use of this software
44 * must display the following acknowledgement:
45 * This product includes software developed by the University of
46 * California, Berkeley and its contributors.
47 * 4. Neither the name of the University nor the names of its contributors
48 * may be used to endorse or promote products derived from this software
49 * without specific prior written permission.
50 *
51 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
52 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
55 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
57 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 * SUCH DAMAGE.
62 *
63 * @(#)ctype.h 8.4 (Berkeley) 1/21/94
64 */
65
66#ifndef _CTYPE_H_
67#define _CTYPE_H_
68
69#include <_ctype.h>
70
71#ifdef _USE_EXTENDED_LOCALES_
72#include <xlocale/_ctype.h>
73#endif /* _USE_EXTENDED_LOCALES_ */
74
75#endif /* !_CTYPE_H_ */
lib/libc/include/aarch64-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 */
79typedef char * io_buf_ptr_t;
80
81/*
82 * Some types for IOKit.
83 */
84
85#ifdef IOKIT
86
87/* must match device_types.defs */
88typedef char io_name_t[128];
89typedef char io_string_t[512];
90typedef char io_string_inband_t[4096];
91typedef char io_struct_inband_t[4096];
92
93#if __LP64__
94typedef uint64_t io_user_scalar_t;
95typedef uint64_t io_user_reference_t;
96typedef io_user_scalar_t io_scalar_inband_t[16];
97typedef io_user_reference_t io_async_ref_t[8];
98typedef io_user_scalar_t io_scalar_inband64_t[16];
99typedef io_user_reference_t io_async_ref64_t[8];
100#else
101typedef int io_user_scalar_t;
102typedef natural_t io_user_reference_t;
103typedef io_user_scalar_t io_scalar_inband_t[16];
104typedef io_user_reference_t io_async_ref_t[8];
105typedef uint64_t io_scalar_inband64_t[16];
106typedef uint64_t io_async_ref64_t[8];
107#endif // __LP64__
108
109
110#ifndef __IOKIT_PORTS_DEFINED__
111#define __IOKIT_PORTS_DEFINED__
112typedef 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/aarch64-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
70struct _telldir; /* forward reference */
71
72/* structure describing an open directory. */
73typedef 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
105int closedir(DIR *) __DARWIN_ALIAS(closedir);
106
107DIR *opendir(const char *) __DARWIN_ALIAS_I(opendir);
108
109struct dirent *readdir(DIR *) __DARWIN_INODE64(readdir);
110int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
111
112void rewinddir(DIR *) __DARWIN_ALIAS_I(rewinddir);
113
114void seekdir(DIR *, long) __DARWIN_ALIAS_I(seekdir);
115
116long 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)
129DIR *fdopendir(int) __DARWIN_ALIAS_I(fdopendir);
130
131int 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
146int dirfd(DIR *dirp) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
147#endif
148
149int 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
158int 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
171int 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
184DIR *__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/aarch64-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
304typedef void (*dispatch_function_t)(void *_Nullable);
305
306#endif
lib/libc/include/aarch64-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
35DISPATCH_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 */
103DISPATCH_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 */
168API_AVAILABLE(macos(10.10), ios(8.0))
169DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_RETURNS_RETAINED_BLOCK
170DISPATCH_WARN_RESULT DISPATCH_NOTHROW
171dispatch_block_t
172dispatch_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 */
240API_AVAILABLE(macos(10.10), ios(8.0))
241DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_RETURNS_RETAINED_BLOCK
242DISPATCH_WARN_RESULT DISPATCH_NOTHROW
243dispatch_block_t
244dispatch_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 */
273API_AVAILABLE(macos(10.10), ios(8.0))
274DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW
275void
276dispatch_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 */
324API_AVAILABLE(macos(10.10), ios(8.0))
325DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
326intptr_t
327dispatch_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 */
365API_AVAILABLE(macos(10.10), ios(8.0))
366DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
367void
368dispatch_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 */
397API_AVAILABLE(macos(10.10), ios(8.0))
398DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
399void
400dispatch_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 */
416API_AVAILABLE(macos(10.10), ios(8.0))
417DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
418DISPATCH_NOTHROW
419intptr_t
420dispatch_block_testcancel(dispatch_block_t block);
421
422__END_DECLS
423
424DISPATCH_ASSUME_NONNULL_END
425
426#endif // __BLOCKS__
427
428#endif // __DISPATCH_BLOCK__
lib/libc/include/aarch64-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
29DISPATCH_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 */
44DISPATCH_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)
53API_AVAILABLE(macos(10.7), ios(5.0))
54DISPATCH_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)
81API_AVAILABLE(macos(10.7), ios(5.0))
82DISPATCH_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)
90API_AVAILABLE(macos(10.9), ios(7.0))
91DISPATCH_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 */
115API_AVAILABLE(macos(10.7), ios(5.0))
116DISPATCH_EXPORT DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT DISPATCH_NOTHROW
117dispatch_data_t
118dispatch_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 */
132API_AVAILABLE(macos(10.7), ios(5.0))
133DISPATCH_EXPORT DISPATCH_PURE DISPATCH_NONNULL1 DISPATCH_NOTHROW
134size_t
135dispatch_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 */
156API_AVAILABLE(macos(10.7), ios(5.0))
157DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_RETURNS_RETAINED
158DISPATCH_WARN_RESULT DISPATCH_NOTHROW
159dispatch_data_t
160dispatch_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 */
179API_AVAILABLE(macos(10.7), ios(5.0))
180DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_RETURNS_RETAINED
181DISPATCH_WARN_RESULT DISPATCH_NOTHROW
182dispatch_data_t
183dispatch_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 */
200API_AVAILABLE(macos(10.7), ios(5.0))
201DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_RETURNS_RETAINED
202DISPATCH_WARN_RESULT DISPATCH_NOTHROW
203dispatch_data_t
204dispatch_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 */
220typedef 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 */
245API_AVAILABLE(macos(10.7), ios(5.0))
246DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
247bool
248dispatch_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 */
266API_AVAILABLE(macos(10.7), ios(5.0))
267DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_RETURNS_RETAINED
268DISPATCH_WARN_RESULT DISPATCH_NOTHROW
269dispatch_data_t
270dispatch_data_copy_region(dispatch_data_t data,
271 size_t location,
272 size_t *offset_ptr);
273
274__END_DECLS
275
276DISPATCH_ASSUME_NONNULL_END
277
278#endif /* __DISPATCH_DATA__ */
lib/libc/include/aarch64-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/aarch64-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
29DISPATCH_ASSUME_NONNULL_BEGIN
30
31/*!
32 * @typedef dispatch_group_t
33 * @abstract
34 * A group of blocks submitted to queues for asynchronous invocation.
35 */
36DISPATCH_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 */
54API_AVAILABLE(macos(10.6), ios(4.0))
55DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
56DISPATCH_NOTHROW
57dispatch_group_t
58dispatch_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__
84API_AVAILABLE(macos(10.6), ios(4.0))
85DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
86void
87dispatch_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 */
118API_AVAILABLE(macos(10.6), ios(4.0))
119DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL2 DISPATCH_NONNULL4
120DISPATCH_NOTHROW
121void
122dispatch_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 */
161API_AVAILABLE(macos(10.6), ios(4.0))
162DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
163intptr_t
164dispatch_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__
197API_AVAILABLE(macos(10.6), ios(4.0))
198DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
199void
200dispatch_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 */
227API_AVAILABLE(macos(10.6), ios(4.0))
228DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL2 DISPATCH_NONNULL4
229DISPATCH_NOTHROW
230void
231dispatch_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 */
251API_AVAILABLE(macos(10.6), ios(4.0))
252DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
253void
254dispatch_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 */
270API_AVAILABLE(macos(10.6), ios(4.0))
271DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
272void
273dispatch_group_leave(dispatch_group_t group);
274
275__END_DECLS
276
277DISPATCH_ASSUME_NONNULL_END
278
279#endif
lib/libc/include/aarch64-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
29DISPATCH_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)
54typedef intptr_t dispatch_fd_t;
55#else
56typedef 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 */
109API_AVAILABLE(macos(10.7), ios(5.0))
110DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NONNULL4 DISPATCH_NOTHROW
111void
112dispatch_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 */
147API_AVAILABLE(macos(10.7), ios(5.0))
148DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL3 DISPATCH_NONNULL4
149DISPATCH_NOTHROW
150void
151dispatch_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 */
167DISPATCH_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
190typedef 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 */
218API_AVAILABLE(macos(10.7), ios(5.0))
219DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
220DISPATCH_NOTHROW
221dispatch_io_t
222dispatch_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 */
254API_AVAILABLE(macos(10.7), ios(5.0))
255DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED
256DISPATCH_WARN_RESULT DISPATCH_NOTHROW
257dispatch_io_t
258dispatch_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 */
294API_AVAILABLE(macos(10.7), ios(5.0))
295DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED
296DISPATCH_WARN_RESULT DISPATCH_NOTHROW
297dispatch_io_t
298dispatch_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 */
311typedef 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 */
356API_AVAILABLE(macos(10.7), ios(5.0))
357DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL4 DISPATCH_NONNULL5
358DISPATCH_NOTHROW
359void
360dispatch_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 */
409API_AVAILABLE(macos(10.7), ios(5.0))
410DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NONNULL4
411DISPATCH_NONNULL5 DISPATCH_NOTHROW
412void
413dispatch_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
429typedef 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 */
448API_AVAILABLE(macos(10.7), ios(5.0))
449DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
450void
451dispatch_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 */
475API_AVAILABLE(macos(10.7), ios(5.0))
476DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
477void
478dispatch_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 */
495API_AVAILABLE(macos(10.7), ios(5.0))
496DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_NOTHROW
497dispatch_fd_t
498dispatch_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 */
516API_AVAILABLE(macos(10.7), ios(5.0))
517DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
518void
519dispatch_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 */
547API_AVAILABLE(macos(10.7), ios(5.0))
548DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
549void
550dispatch_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
562typedef 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 */
586API_AVAILABLE(macos(10.7), ios(5.0))
587DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
588void
589dispatch_io_set_interval(dispatch_io_t channel,
590 uint64_t interval,
591 dispatch_io_interval_flags_t flags);
592
593__END_DECLS
594
595DISPATCH_ASSUME_NONNULL_END
596
597#endif /* __DISPATCH_IO__ */
lib/libc/include/aarch64-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
33DISPATCH_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 */
55OS_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
64DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
65void
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 */
80typedef struct dispatch_object_s {
81private:
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 */
94typedef 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 */
179typedef 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>)
189typedef qos_class_t dispatch_qos_class_t;
190#else
191typedef 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 */
208API_AVAILABLE(macos(10.6), ios(4.0))
209DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
210DISPATCH_SWIFT_UNAVAILABLE("Can't be used with ARC")
211void
212dispatch_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 */
236API_AVAILABLE(macos(10.6), ios(4.0))
237DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
238DISPATCH_SWIFT_UNAVAILABLE("Can't be used with ARC")
239void
240dispatch_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 */
260API_AVAILABLE(macos(10.6), ios(4.0))
261DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_PURE DISPATCH_WARN_RESULT
262DISPATCH_NOTHROW
263void *_Nullable
264dispatch_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 */
279API_AVAILABLE(macos(10.6), ios(4.0))
280DISPATCH_EXPORT DISPATCH_NOTHROW
281void
282dispatch_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 */
305API_AVAILABLE(macos(10.6), ios(4.0))
306DISPATCH_EXPORT DISPATCH_NOTHROW
307void
308dispatch_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 */
333API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
334DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
335void
336dispatch_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 */
356API_AVAILABLE(macos(10.6), ios(4.0))
357DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
358void
359dispatch_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 */
385API_AVAILABLE(macos(10.6), ios(4.0))
386DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
387void
388dispatch_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 */
427API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
428DISPATCH_EXPORT DISPATCH_NOTHROW
429void
430dispatch_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 */
457DISPATCH_UNAVAILABLE
458DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
459intptr_t
460dispatch_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 */
494DISPATCH_UNAVAILABLE
495DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
496void
497dispatch_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 */
523DISPATCH_UNAVAILABLE
524DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
525void
526dispatch_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 */
554DISPATCH_UNAVAILABLE
555DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
556DISPATCH_NOTHROW
557intptr_t
558dispatch_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 */
590API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0))
591DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW DISPATCH_COLD
592__attribute__((__format__(printf,2,3)))
593void
594dispatch_debug(dispatch_object_t object, const char *message, ...);
595
596API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0))
597DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW DISPATCH_COLD
598__attribute__((__format__(printf,2,0)))
599void
600dispatch_debugv(dispatch_object_t object, const char *message, va_list ap);
601
602__END_DECLS
603
604DISPATCH_ASSUME_NONNULL_END
605
606#endif
lib/libc/include/aarch64-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
29DISPATCH_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 */
40DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
41typedef 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__
69API_AVAILABLE(macos(10.6), ios(4.0))
70DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
71DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
72void
73dispatch_once(dispatch_once_t *predicate,
74 DISPATCH_NOESCAPE dispatch_block_t block);
75
76#if DISPATCH_ONCE_INLINE_FASTPATH
77DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
78DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
79void
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
95API_AVAILABLE(macos(10.6), ios(4.0))
96DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
97DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
98void
99dispatch_once_f(dispatch_once_t *predicate, void *_Nullable context,
100 dispatch_function_t function);
101
102#if DISPATCH_ONCE_INLINE_FASTPATH
103DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL1 DISPATCH_NONNULL3
104DISPATCH_NOTHROW
105DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
106void
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
123DISPATCH_ASSUME_NONNULL_END
124
125#endif
lib/libc/include/aarch64-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
29DISPATCH_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 */
69DISPATCH_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 */
101DISPATCH_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 */
127DISPATCH_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 */
149DISPATCH_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 */
179DISPATCH_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__
212API_AVAILABLE(macos(10.6), ios(4.0))
213DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
214void
215dispatch_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 */
242API_AVAILABLE(macos(10.6), ios(4.0))
243DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
244void
245dispatch_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__
285API_AVAILABLE(macos(10.6), ios(4.0))
286DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
287void
288dispatch_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 */
313API_AVAILABLE(macos(10.6), ios(4.0))
314DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
315void
316dispatch_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__
380API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
381DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
382void
383dispatch_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 */
409API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
410DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
411void
412dispatch_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__
478API_AVAILABLE(macos(10.6), ios(4.0))
479DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NOTHROW
480void
481dispatch_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 */
513API_AVAILABLE(macos(10.6), ios(4.0))
514DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_NOTHROW
515void
516dispatch_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 */
549API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0))
550DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
551dispatch_queue_t
552dispatch_get_current_queue(void);
553
554API_AVAILABLE(macos(10.6), ios(4.0))
555DISPATCH_EXPORT
556struct 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 */
582DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_CONST DISPATCH_NOTHROW
583dispatch_queue_main_t
584dispatch_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
622typedef 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 */
661API_AVAILABLE(macos(10.6), ios(4.0))
662DISPATCH_EXPORT DISPATCH_CONST DISPATCH_WARN_RESULT DISPATCH_NOTHROW
663dispatch_queue_global_t
664dispatch_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 */
672DISPATCH_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)
710API_AVAILABLE(macos(10.7), ios(4.3))
711DISPATCH_EXPORT
712struct 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 */
756API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
757DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW
758dispatch_queue_attr_t
759dispatch_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 */
812DISPATCH_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 */
858API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
859DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW
860dispatch_queue_attr_t
861dispatch_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 */
922API_AVAILABLE(macos(10.10), ios(8.0))
923DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW
924dispatch_queue_attr_t
925dispatch_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 */
987API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
988DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
989DISPATCH_NOTHROW
990dispatch_queue_t
991dispatch_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 */
1038API_AVAILABLE(macos(10.6), ios(4.0))
1039DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
1040DISPATCH_NOTHROW
1041dispatch_queue_t
1042dispatch_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 */
1068API_AVAILABLE(macos(10.6), ios(4.0))
1069DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
1070const char *
1071dispatch_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 */
1107API_AVAILABLE(macos(10.10), ios(8.0))
1108DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NONNULL1 DISPATCH_NOTHROW
1109dispatch_qos_class_t
1110dispatch_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 */
1172API_AVAILABLE(macos(10.6), ios(4.0))
1173DISPATCH_EXPORT DISPATCH_NOTHROW
1174void
1175dispatch_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 */
1191API_AVAILABLE(macos(10.6), ios(4.0))
1192DISPATCH_EXPORT DISPATCH_NOTHROW DISPATCH_NORETURN
1193void
1194dispatch_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__
1219API_AVAILABLE(macos(10.6), ios(4.0))
1220DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL3 DISPATCH_NOTHROW
1221void
1222dispatch_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 */
1251API_AVAILABLE(macos(10.6), ios(4.0))
1252DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL4 DISPATCH_NOTHROW
1253void
1254dispatch_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__
1297API_AVAILABLE(macos(10.7), ios(4.3))
1298DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
1299void
1300dispatch_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 */
1332API_AVAILABLE(macos(10.7), ios(4.3))
1333DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
1334void
1335dispatch_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__
1360API_AVAILABLE(macos(10.7), ios(4.3))
1361DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
1362void
1363dispatch_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 */
1392API_AVAILABLE(macos(10.7), ios(4.3))
1393DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
1394void
1395dispatch_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__
1420API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
1421DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
1422void
1423dispatch_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 */
1453API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
1454DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
1455void
1456dispatch_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 */
1495API_AVAILABLE(macos(10.7), ios(5.0))
1496DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
1497void
1498dispatch_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 */
1524API_AVAILABLE(macos(10.7), ios(5.0))
1525DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_PURE DISPATCH_WARN_RESULT
1526DISPATCH_NOTHROW
1527void *_Nullable
1528dispatch_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 */
1551API_AVAILABLE(macos(10.7), ios(5.0))
1552DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
1553void *_Nullable
1554dispatch_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 */
1605API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
1606DISPATCH_EXPORT DISPATCH_NONNULL1
1607void
1608dispatch_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 */
1631API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
1632DISPATCH_EXPORT DISPATCH_NONNULL1
1633void
1634dispatch_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 */
1654API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
1655DISPATCH_EXPORT DISPATCH_NONNULL1
1656void
1657dispatch_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
1672DISPATCH_ASSUME_NONNULL_END
1673
1674#endif
lib/libc/include/aarch64-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
29DISPATCH_ASSUME_NONNULL_BEGIN
30
31/*!
32 * @typedef dispatch_semaphore_t
33 *
34 * @abstract
35 * A counting semaphore.
36 */
37DISPATCH_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 */
60API_AVAILABLE(macos(10.6), ios(4.0))
61DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
62DISPATCH_NOTHROW
63dispatch_semaphore_t
64dispatch_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 */
86API_AVAILABLE(macos(10.6), ios(4.0))
87DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
88intptr_t
89dispatch_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 */
108API_AVAILABLE(macos(10.6), ios(4.0))
109DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
110intptr_t
111dispatch_semaphore_signal(dispatch_semaphore_t dsema);
112
113__END_DECLS
114
115DISPATCH_ASSUME_NONNULL_END
116
117#endif /* __DISPATCH_SEMAPHORE__ */
lib/libc/include/aarch64-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
38DISPATCH_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 */
57DISPATCH_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 */
72typedef 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)
82API_AVAILABLE(macos(10.6), ios(4.0))
83DISPATCH_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)
93API_AVAILABLE(macos(10.6), ios(4.0))
94DISPATCH_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)
108API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0))
109DISPATCH_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)
119API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
120DISPATCH_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)
130API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
131DISPATCH_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)
143API_AVAILABLE(macos(10.9), ios(8.0)) DISPATCH_LINUX_UNAVAILABLE()
144DISPATCH_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)
154API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
155DISPATCH_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)
165API_AVAILABLE(macos(10.6), ios(4.0))
166DISPATCH_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)
175API_AVAILABLE(macos(10.6), ios(4.0))
176DISPATCH_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)
186API_AVAILABLE(macos(10.6), ios(4.0))
187DISPATCH_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)
197API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
198DISPATCH_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)
208API_AVAILABLE(macos(10.6), ios(4.0))
209DISPATCH_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
220typedef 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 */
226typedef 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
256typedef 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
280typedef 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
320typedef 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
340typedef 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 */
386API_AVAILABLE(macos(10.6), ios(4.0))
387DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
388DISPATCH_NOTHROW
389dispatch_source_t
390dispatch_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__
409API_AVAILABLE(macos(10.6), ios(4.0))
410DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
411void
412dispatch_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 */
431API_AVAILABLE(macos(10.6), ios(4.0))
432DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
433void
434dispatch_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__
466API_AVAILABLE(macos(10.6), ios(4.0))
467DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
468void
469dispatch_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 */
491API_AVAILABLE(macos(10.6), ios(4.0))
492DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
493void
494dispatch_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 */
519API_AVAILABLE(macos(10.6), ios(4.0))
520DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
521void
522dispatch_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 */
537API_AVAILABLE(macos(10.6), ios(4.0))
538DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
539DISPATCH_NOTHROW
540intptr_t
541dispatch_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 */
569API_AVAILABLE(macos(10.6), ios(4.0))
570DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
571DISPATCH_NOTHROW
572uintptr_t
573dispatch_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 */
601API_AVAILABLE(macos(10.6), ios(4.0))
602DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
603DISPATCH_NOTHROW
604uintptr_t
605dispatch_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 */
640API_AVAILABLE(macos(10.6), ios(4.0))
641DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
642DISPATCH_NOTHROW
643uintptr_t
644dispatch_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 */
662API_AVAILABLE(macos(10.6), ios(4.0))
663DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
664void
665dispatch_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 */
715API_AVAILABLE(macos(10.6), ios(4.0))
716DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
717void
718dispatch_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__
745API_AVAILABLE(macos(10.7), ios(4.3))
746DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
747void
748dispatch_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 */
770API_AVAILABLE(macos(10.7), ios(4.3))
771DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
772void
773dispatch_source_set_registration_handler_f(dispatch_source_t source,
774 dispatch_function_t _Nullable handler);
775
776__END_DECLS
777
778DISPATCH_ASSUME_NONNULL_END
779
780#endif
lib/libc/include/aarch64-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
36DISPATCH_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
57struct 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 */
67typedef uint64_t dispatch_time_t;
68
69enum {
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 */
101API_AVAILABLE(macos(10.6), ios(4.0))
102DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NOTHROW
103dispatch_time_t
104dispatch_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 */
127API_AVAILABLE(macos(10.6), ios(4.0))
128DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NOTHROW
129dispatch_time_t
130dispatch_walltime(const struct timespec *_Nullable when, int64_t delta);
131
132__END_DECLS
133
134DISPATCH_ASSUME_NONNULL_END
135
136#endif
lib/libc/include/aarch64-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
29DISPATCH_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 */
60DISPATCH_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 */
74API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
75DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
76DISPATCH_NOTHROW
77dispatch_workloop_t
78dispatch_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 */
100API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
101DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
102DISPATCH_NOTHROW
103dispatch_workloop_t
104dispatch_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 */
126API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
127DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
128void
129dispatch_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 */
153API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
154DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
155void
156dispatch_workloop_set_os_workgroup(dispatch_workloop_t workloop,
157 os_workgroup_t workgroup);
158
159__END_DECLS
160
161DISPATCH_ASSUME_NONNULL_END
162
163#endif
lib/libc/include/aarch64-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
34extern "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 */
52typedef 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
59extern int dladdr(const void *, Dl_info *);
60#else
61 #define __DYLDDL_DRIVERKIT_UNAVAILABLE
62#endif /* not POSIX */
63
64extern int dlclose(void * __handle) __DYLDDL_DRIVERKIT_UNAVAILABLE;
65extern char * dlerror(void) __DYLDDL_DRIVERKIT_UNAVAILABLE;
66extern void * dlopen(const char * __path, int __mode) __DYLDDL_DRIVERKIT_UNAVAILABLE;
67extern void * dlsym(void * __handle, const char * __symbol) __DYLDDL_DRIVERKIT_UNAVAILABLE;
68
69#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
70extern 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/aarch64-macos-gnu/errno.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/errno.h>
24
lib/libc/include/aarch64-macos-gnu/execinfo.h created+63
......@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23#ifndef _EXECINFO_H_
24#define _EXECINFO_H_ 1
25
26#include <sys/cdefs.h>
27#include <Availability.h>
28#include <os/base.h>
29#include <os/availability.h>
30#include <stdint.h>
31#include <uuid/uuid.h>
32
33__BEGIN_DECLS
34
35int backtrace(void**,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
36
37API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0))
38OS_EXPORT
39int backtrace_from_fp(void *startfp, void **array, int size);
40
41char** backtrace_symbols(void* const*,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
42void backtrace_symbols_fd(void* const*,int,int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
43
44struct image_offset {
45 /*
46 * The UUID of the image.
47 */
48 uuid_t uuid;
49
50 /*
51 * The offset is relative to the __TEXT section of the image.
52 */
53 uint32_t offset;
54};
55
56API_AVAILABLE(macosx(10.14), ios(12.0), tvos(12.0), watchos(5.0))
57OS_EXPORT
58void backtrace_image_offsets(void* const* array,
59 struct image_offset *image_offsets, int size);
60
61__END_DECLS
62
63#endif /* !_EXECINFO_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/fenv.h created+361
......@@ -0,0 +1,361 @@
1/*
2 * Copyright (c) 2002-2013 Apple Computer, 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/******************************************************************************
24 * *
25 * File: fenv.h *
26 * *
27 * Contains: typedefs and prototypes for C99 floating point environment. *
28 * *
29 * A collection of functions designed to provide access to the floating *
30 * point environment for numerical programming. It is compliant with the *
31 * floating-point requirements in C99. *
32 * *
33 * The file <fenv.h> declares many functions in support of numerical *
34 * programming. Programs that test flags or run under non-default mode *
35 * must do so under the effect of an enabling "fenv_access" pragma: *
36 * *
37 * #pragma STDC FENV_ACCESS on *
38 * *
39 ******************************************************************************/
40
41#ifndef __FENV_H__
42#define __FENV_H__
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48/******************************************************************************
49 * *
50 * Architecture-specific types and macros. *
51 * *
52 * fenv_t a type for representing the entire floating-point *
53 * environment in a single object. *
54 * *
55 * fexcept_t a type for representing the floating-point *
56 * exception flag state collectively. *
57 * *
58 * FE_INEXACT macros representing the various floating-point *
59 * FE_UNDERFLOW exceptions. *
60 * FE_OVERFLOW *
61 * FE_DIVBYZERO *
62 * FE_INVALID *
63 * FE_ALL_EXCEPT *
64 * *
65 * FE_TONEAREST macros representing the various floating-point *
66 * FE_UPWARD rounding modes *
67 * FE_DOWNWARD *
68 * FE_TOWARDZERO *
69 * *
70 * FE_DFL_ENV a macro expanding to a pointer to an object *
71 * representing the default floating-point environemnt *
72 * *
73 ******************************************************************************/
74
75/******************************************************************************
76 * ARM definitions of architecture-specific types and macros. *
77 ******************************************************************************/
78
79#if defined __arm__ && !defined __SOFTFP__
80
81typedef struct {
82 unsigned int __fpscr;
83 unsigned int __reserved0;
84 unsigned int __reserved1;
85 unsigned int __reserved2;
86} fenv_t;
87
88typedef unsigned short fexcept_t;
89
90#define FE_INEXACT 0x0010
91#define FE_UNDERFLOW 0x0008
92#define FE_OVERFLOW 0x0004
93#define FE_DIVBYZERO 0x0002
94#define FE_INVALID 0x0001
95/* FE_FLUSHTOZERO
96 An ARM-specific flag that is raised when a denormal is flushed to zero.
97 This is also called the "input denormal exception" */
98#define FE_FLUSHTOZERO 0x0080
99#define FE_ALL_EXCEPT 0x009f
100
101#define FE_TONEAREST 0x00000000
102#define FE_UPWARD 0x00400000
103#define FE_DOWNWARD 0x00800000
104#define FE_TOWARDZERO 0x00C00000
105
106/* Masks for values that may be controlled in the FPSCR. Modifying any other
107 bits invokes undefined behavior. */
108enum {
109 __fpscr_trap_invalid = 0x00000100,
110 __fpscr_trap_divbyzero = 0x00000200,
111 __fpscr_trap_overflow = 0x00000400,
112 __fpscr_trap_underflow = 0x00000800,
113 __fpscr_trap_inexact = 0x00001000,
114 __fpscr_trap_denormal = 0x00008000,
115 __fpscr_flush_to_zero = 0x01000000,
116 __fpscr_default_nan = 0x02000000,
117 __fpscr_saturation = 0x08000000,
118};
119
120extern const fenv_t _FE_DFL_ENV;
121#define FE_DFL_ENV &_FE_DFL_ENV
122
123/******************************************************************************
124 * ARM64 definitions of architecture-specific types and macros. *
125 ******************************************************************************/
126
127#elif defined __arm64__
128
129typedef struct {
130 unsigned long long __fpsr;
131 unsigned long long __fpcr;
132} fenv_t;
133
134typedef unsigned short fexcept_t;
135
136#define FE_INEXACT 0x0010
137#define FE_UNDERFLOW 0x0008
138#define FE_OVERFLOW 0x0004
139#define FE_DIVBYZERO 0x0002
140#define FE_INVALID 0x0001
141/* FE_FLUSHTOZERO
142 An ARM-specific flag that is raised when a denormal is flushed to zero.
143 This is also called the "input denormal exception" */
144#define FE_FLUSHTOZERO 0x0080
145#define FE_ALL_EXCEPT 0x009f
146
147#define FE_TONEAREST 0x00000000
148#define FE_UPWARD 0x00400000
149#define FE_DOWNWARD 0x00800000
150#define FE_TOWARDZERO 0x00C00000
151
152/* Masks for values that may be controlled in the FPCR. Modifying any other
153 bits invokes undefined behavior. */
154enum {
155 __fpcr_trap_invalid = 0x00000100,
156 __fpcr_trap_divbyzero = 0x00000200,
157 __fpcr_trap_overflow = 0x00000400,
158 __fpcr_trap_underflow = 0x00000800,
159 __fpcr_trap_inexact = 0x00001000,
160 __fpcr_trap_denormal = 0x00008000,
161 __fpcr_flush_to_zero = 0x01000000,
162};
163
164/* Mask for the QC bit of the FPSR */
165enum { __fpsr_saturation = 0x08000000 };
166
167extern const fenv_t _FE_DFL_ENV;
168#define FE_DFL_ENV &_FE_DFL_ENV
169
170/* FE_DFL_DISABLE_DENORMS_ENV
171
172 A pointer to a fenv_t object with the default floating-point state modified
173 to set the FZ (flush to zero) bit in the FPCR. When using this environment
174 denormals encountered by floating-point calculations will be treated as
175 zero. Denormal results of floating-point operations will also be treated
176 as zero. This calculation mode is not IEEE-754 compliant, but it may
177 prevent lengthy stalls that occur in code that encounters denormals. It is
178 suggested that you do not use this mode unless you have established that
179 denormals are the source of measurable performance problems.
180
181 Note that the math library, and other system libraries, are not guaranteed
182 to do the right thing if called in this mode. Edge cases may be incorrect.
183 Use at your own risk. */
184extern const fenv_t _FE_DFL_DISABLE_DENORMS_ENV;
185#define FE_DFL_DISABLE_DENORMS_ENV &_FE_DFL_DISABLE_DENORMS_ENV
186
187/******************************************************************************
188 * x86 definitions of architecture-specific types and macros. *
189 ******************************************************************************/
190
191#elif defined __i386__ || defined __x86_64__
192
193typedef struct {
194 unsigned short __control; /* x87 control word */
195 unsigned short __status; /* x87 status word */
196 unsigned int __mxcsr; /* SSE status/control register */
197 char __reserved[8]; /* Reserved for future expansion */
198} fenv_t;
199
200typedef unsigned short fexcept_t;
201
202#define FE_INEXACT 0x0020
203#define FE_UNDERFLOW 0x0010
204#define FE_OVERFLOW 0x0008
205#define FE_DIVBYZERO 0x0004
206#define FE_INVALID 0x0001
207/* FE_DENORMALOPERAND
208 An Intel-specific flag that is raised when an operand to a floating-point
209 arithmetic operation is denormal, or a single- or double-precision denormal
210 value is loaded on the x87 stack. This flag is not raised by SSE
211 arithmetic when the DAZ control bit is set. */
212#define FE_DENORMALOPERAND 0x0002
213#define FE_ALL_EXCEPT 0x003f
214
215#define FE_TONEAREST 0x0000
216#define FE_DOWNWARD 0x0400
217#define FE_UPWARD 0x0800
218#define FE_TOWARDZERO 0x0c00
219
220extern const fenv_t _FE_DFL_ENV;
221#define FE_DFL_ENV &_FE_DFL_ENV
222
223/* FE_DFL_DISABLE_SSE_DENORMS_ENV
224
225 A pointer to a fenv_t object with the default floating-point state modifed
226 to set the DAZ and FZ bits in the SSE status/control register. When using
227 this environment, denormals encountered by SSE based calculation (which
228 normally should be all single and double precision scalar floating point
229 calculations, and all SSE/SSE2/SSE3 computation) will be treated as zero.
230 Calculation results that are denormals will also be truncated to zero.
231 This calculation mode is not IEEE-754 compliant, but may prevent lengthy
232 stalls that occur in code that encounters denormals. It is suggested that
233 you do not use this mode unless you have established that denormals are
234 causing trouble for your code. Please use wisely.
235
236 CAUTION: The math library currently is not architected to do the right
237 thing in the face of DAZ + FZ mode. For example, ceil( +denormal) might
238 return +denormal rather than 1.0 in some versions of MacOS X. In some
239 circumstances this may lead to unexpected application behavior. Use at
240 your own risk.
241
242 It is not possible to disable denormal stalls for calculations performed
243 on the x87 FPU */
244extern const fenv_t _FE_DFL_DISABLE_SSE_DENORMS_ENV;
245#define FE_DFL_DISABLE_SSE_DENORMS_ENV &_FE_DFL_DISABLE_SSE_DENORMS_ENV
246
247/******************************************************************************
248 * Totally generic definitions and macros if we don't know anything about *
249 * the target platform, or if the platform does not have hardware floating- *
250 * point support. *
251 ******************************************************************************/
252
253#else /* Unknown architectures */
254
255typedef int fenv_t;
256typedef unsigned short fexcept_t;
257#define FE_ALL_EXCEPT 0
258#define FE_TONEAREST 0
259extern const fenv_t _FE_DFL_ENV;
260#define FE_DFL_ENV &_FE_DFL_ENV
261
262#endif
263
264/******************************************************************************
265 * The following functions provide high level access to the exception flags. *
266 * The "int" input argument can be constructed by bitwise ORs of the *
267 * exception macros: for example: FE_OVERFLOW | FE_INEXACT. *
268 * *
269 * The function "feclearexcept" clears the supported floating point *
270 * exceptions represented by its argument. *
271 * *
272 * The function "fegetexceptflag" stores a implementation-defined *
273 * representation of the states of the floating-point status flags indicated *
274 * by its integer argument excepts in the object pointed to by the argument, *
275 * flagp. *
276 * *
277 * The function "feraiseexcept" raises the supported floating-point *
278 * exceptions represented by its argument. The order in which these *
279 * floating-point exceptions are raised is unspecified. *
280 * *
281 * The function "fesetexceptflag" sets or clears the floating point status *
282 * flags indicated by the argument excepts to the states stored in the *
283 * object pointed to by flagp. The value of the *flagp shall have been set *
284 * by a previous call to fegetexceptflag whose second argument represented *
285 * at least those floating-point exceptions represented by the argument *
286 * excepts. This function does not raise floating-point exceptions; it just *
287 * sets the state of the flags. *
288 * *
289 * The function "fetestexcept" determines which of the specified subset of *
290 * the floating-point exception flags are currently set. The excepts *
291 * argument specifies the floating-point status flags to be queried. This *
292 * function returns the value of the bitwise OR of the floating-point *
293 * exception macros corresponding to the currently set floating-point *
294 * exceptions included in excepts. *
295 ******************************************************************************/
296
297extern int feclearexcept(int /* excepts */);
298extern int fegetexceptflag(fexcept_t * /* flagp */, int /* excepts */);
299extern int feraiseexcept(int /* excepts */);
300extern int fesetexceptflag(const fexcept_t * /* flagp */, int /* excepts */);
301extern int fetestexcept(int /* excepts */);
302
303/******************************************************************************
304 * The following functions provide control of rounding direction modes. *
305 * *
306 * The function "fegetround" returns the value of the rounding direction *
307 * macro which represents the current rounding direction, or a negative *
308 * if there is no such rounding direction macro or the current rounding *
309 * direction is not determinable. *
310 * *
311 * The function "fesetround" establishes the rounding direction represented *
312 * by its argument "round". If the argument is not equal to the value of a *
313 * rounding direction macro, the rounding direction is not changed. It *
314 * returns zero if and only if the argument is equal to a rounding *
315 * direction macro. *
316 ******************************************************************************/
317
318extern int fegetround(void);
319extern int fesetround(int /* round */);
320
321/******************************************************************************
322 * The following functions manage the floating-point environment, exception *
323 * flags and dynamic modes, as one entity. *
324 * *
325 * The fegetenv function stores the current floating-point enviornment in *
326 * the object pointed to by envp. *
327 * *
328 * The feholdexcept function saves the current floating-point environment in *
329 * the object pointed to by envp, clears the floating-point status flags, *
330 * and then installs a non-stop (continue on floating-point exceptions) *
331 * mode, if available, for all floating-point exceptions. The feholdexcept *
332 * function returns zero if and only if non-stop floating-point exceptions *
333 * handling was successfully installed. *
334 * *
335 * The fesetnv function establishes the floating-point environment *
336 * represented by the object pointed to by envp. The argument envp shall *
337 * point to an object set by a call to fegetenv or feholdexcept, or equal to *
338 * a floating-point environment macro to be C99 standard compliant and *
339 * portable to other architectures. Note that fesetnv merely installs the *
340 * state of the floating-point status flags represented through its *
341 * argument, and does not raise these floating-point exceptions. *
342 * *
343 * The feupdateenv function saves the currently raised floating-point *
344 * exceptions in its automatic storage, installs the floating-point *
345 * environment represented by the object pointed to by envp, and then raises *
346 * the saved floating-point exceptions. The argument envp shall point to an *
347 * object set by a call to feholdexcept or fegetenv or equal a *
348 * floating-point environment macro. *
349 ******************************************************************************/
350
351extern int fegetenv(fenv_t * /* envp */);
352extern int feholdexcept(fenv_t * /* envp */);
353extern int fesetenv(const fenv_t * /* envp */);
354extern int feupdateenv(const fenv_t * /* envp */);
355
356#ifdef __cplusplus
357}
358#endif
359
360#endif /* __FENV_H__ */
361
lib/libc/include/aarch64-macos-gnu/float.h created+140
......@@ -0,0 +1,140 @@
1/* Copyright (c) 2017 Apple Inc. All rights reserved.
2 *
3 * @APPLE_LICENSE_HEADER_START@
4 *
5 * The contents of this file constitute Original Code as defined in and
6 * are subject to the Apple Public Source License Version 1.1 (the
7 * "License"). You may not use this file except in compliance with the
8 * License. Please obtain a copy of the License at
9 * http://www.apple.com/publicsource and read it before using this file.
10 *
11 * This Original Code and all software distributed under the License are
12 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
13 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
14 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
16 * License for the specific language governing rights and limitations
17 * under the License.
18 *
19 * @APPLE_LICENSE_HEADER_END@
20 */
21
22#ifndef __FLOAT_H
23#define __FLOAT_H
24
25/* Undefine anything that we'll be redefining below. */
26#undef FLT_EVAL_METHOD
27#undef FLT_ROUNDS
28#undef FLT_RADIX
29#undef FLT_MANT_DIG
30#undef DBL_MANT_DIG
31#undef LDBL_MANT_DIG
32#undef FLT_DIG
33#undef DBL_DIG
34#undef LDBL_DIG
35#undef FLT_MIN_EXP
36#undef DBL_MIN_EXP
37#undef LDBL_MIN_EXP
38#undef FLT_MIN_10_EXP
39#undef DBL_MIN_10_EXP
40#undef LDBL_MIN_10_EXP
41#undef FLT_MAX_EXP
42#undef DBL_MAX_EXP
43#undef LDBL_MAX_EXP
44#undef FLT_MAX_10_EXP
45#undef DBL_MAX_10_EXP
46#undef LDBL_MAX_10_EXP
47#undef FLT_MAX
48#undef DBL_MAX
49#undef LDBL_MAX
50#undef FLT_EPSILON
51#undef DBL_EPSILON
52#undef LDBL_EPSILON
53#undef FLT_MIN
54#undef DBL_MIN
55#undef LDBL_MIN
56
57#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
58# undef DECIMAL_DIG
59#endif
60
61#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
62# undef FLT_HAS_SUBNORM
63# undef DBL_HAS_SUBNORM
64# undef LDBL_HAS_SUBNORM
65# undef FLT_TRUE_MIN
66# undef DBL_TRUE_MIN
67# undef LDBL_TRUE_MIN
68# undef FLT_DECIMAL_DIG
69# undef DBL_DECIMAL_DIG
70# undef LDBL_DECIMAL_DIG
71#endif
72
73/* Characteristics of floating point types, C99 5.2.4.2.2 */
74
75#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
76#define FLT_ROUNDS (__builtin_flt_rounds())
77#define FLT_RADIX __FLT_RADIX__
78
79#define FLT_MANT_DIG __FLT_MANT_DIG__
80#define DBL_MANT_DIG __DBL_MANT_DIG__
81#define LDBL_MANT_DIG __LDBL_MANT_DIG__
82
83#define FLT_DIG __FLT_DIG__
84#define DBL_DIG __DBL_DIG__
85#define LDBL_DIG __LDBL_DIG__
86
87#define FLT_MIN_EXP __FLT_MIN_EXP__
88#define DBL_MIN_EXP __DBL_MIN_EXP__
89#define LDBL_MIN_EXP __LDBL_MIN_EXP__
90
91#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
92#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
93#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
94
95#define FLT_MAX_EXP __FLT_MAX_EXP__
96#define DBL_MAX_EXP __DBL_MAX_EXP__
97#define LDBL_MAX_EXP __LDBL_MAX_EXP__
98
99#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
100#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
101#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
102
103#define FLT_MAX __FLT_MAX__
104#define DBL_MAX __DBL_MAX__
105#define LDBL_MAX __LDBL_MAX__
106
107#define FLT_EPSILON __FLT_EPSILON__
108#define DBL_EPSILON __DBL_EPSILON__
109#define LDBL_EPSILON __LDBL_EPSILON__
110
111#define FLT_MIN __FLT_MIN__
112#define DBL_MIN __DBL_MIN__
113#define LDBL_MIN __LDBL_MIN__
114
115#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
116# define DECIMAL_DIG __DECIMAL_DIG__
117#endif
118
119#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
120# if defined __arm__ /* On 32-bit arm, denorms are not supported. */
121# define FLT_HAS_SUBNORM 0
122# define DBL_HAS_SUBNORM 0
123# define LDBL_HAS_SUBNORM 0
124# define FLT_TRUE_MIN __FLT_MIN__
125# define DBL_TRUE_MIN __DBL_MIN__
126# define LDBL_TRUE_MIN __LDBL_MIN__
127# else /* All Apple platforms except 32-bit arm have denorms. */
128# define FLT_HAS_SUBNORM 1
129# define DBL_HAS_SUBNORM 1
130# define LDBL_HAS_SUBNORM 1
131# define FLT_TRUE_MIN __FLT_DENORM_MIN__
132# define DBL_TRUE_MIN __DBL_DENORM_MIN__
133# define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
134# endif
135# define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
136# define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
137# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
138#endif
139
140#endif /* __FLOAT_H */
lib/libc/include/aarch64-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
70int fmtmsg(long, const char *, int, const char *, const char *,
71 const char *);
72
73#endif /* !_FMTMSG_H_ */
lib/libc/include/aarch64-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
79int fnmatch(const char *, const char *, int) __DARWIN_ALIAS(fnmatch);
80__END_DECLS
81
82#endif /* !_FNMATCH_H_ */
lib/libc/include/aarch64-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
48struct FTW {
49 int base;
50 int level;
51};
52
53__BEGIN_DECLS
54int ftw(const char *, int (*)(const char *, const struct stat *, int), int)
55 __DARWIN_ALIAS_I(ftw);
56int 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/aarch64-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)
37int 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
39int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
40#endif
41
42#endif /* __GETHOSTUUID_H */
lib/libc/include/aarch64-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)
45struct dirent;
46struct stat;
47#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
48typedef 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
116int 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
124int 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__ */
127void globfree(glob_t *);
128__END_DECLS
129
130#endif /* !_GLOB_H_ */
lib/libc/include/aarch64-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
53struct 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] */
64struct group *getgrgid(gid_t);
65struct group *getgrnam(const char *);
66/* [TSF] */
67int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
68int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
69/* [XSI] */
70struct group *getgrent(void);
71void setgrent(void);
72void 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
78char *group_from_gid(gid_t, int);
79struct group *getgruuid(uuid_t);
80int 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)
87void setgrfile(const char *);
88#endif
89int setgroupent(int);
90__END_DECLS
91#endif
92
93#endif /* !_GRP_H_ */
lib/libc/include/aarch64-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
45extern "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 */
51enum {
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 */
120enum {
121 kHardLinkFileType = 0x686C6E6B, /* 'hlnk' */
122 kHFSPlusCreator = 0x6866732B /* 'hfs+' */
123};
124
125
126/*
127 * File type and creator for symbolic links
128 */
129enum {
130 kSymLinkFileType = 0x736C6E6B, /* 'slnk' */
131 kSymLinkCreator = 0x72686170 /* 'rhap' */
132};
133
134
135enum {
136 kHFSMaxVolumeNameChars = 27,
137 kHFSMaxFileNameChars = 31,
138 kHFSPlusMaxFileNameChars = 255
139};
140
141
142/* Extent overflow file data structures */
143
144/* HFS Extent key */
145struct 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));
151typedef struct HFSExtentKey HFSExtentKey;
152
153/* HFS Plus Extent key */
154struct 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));
161typedef struct HFSPlusExtentKey HFSPlusExtentKey;
162
163/* Number of extent descriptors per extent record */
164enum {
165 kHFSExtentDensity = 3,
166 kHFSPlusExtentDensity = 8
167};
168
169/* HFS extent descriptor */
170struct HFSExtentDescriptor {
171 u_int16_t startBlock; /* first allocation block */
172 u_int16_t blockCount; /* number of allocation blocks */
173} __attribute__((aligned(2), packed));
174typedef struct HFSExtentDescriptor HFSExtentDescriptor;
175
176/* HFS Plus extent descriptor */
177struct HFSPlusExtentDescriptor {
178 u_int32_t startBlock; /* first allocation block */
179 u_int32_t blockCount; /* number of allocation blocks */
180} __attribute__((aligned(2), packed));
181typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
182
183/* HFS extent record */
184typedef HFSExtentDescriptor HFSExtentRecord[3];
185
186/* HFS Plus extent record */
187typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
188
189
190/* Finder information */
191struct 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));
201typedef struct FndrFileInfo FndrFileInfo;
202
203struct 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));
217typedef struct FndrDirInfo FndrDirInfo;
218
219struct FndrOpaqueInfo {
220 int8_t opaque[16];
221} __attribute__((aligned(2), packed));
222typedef struct FndrOpaqueInfo FndrOpaqueInfo;
223
224struct 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
232struct 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 */
241struct 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));
247typedef 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 */
255struct 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));
267typedef 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
291enum {
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 */
308struct 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));
314typedef struct HFSCatalogKey HFSCatalogKey;
315
316/* HFS Plus catalog key */
317struct 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));
322typedef struct HFSPlusCatalogKey HFSPlusCatalogKey;
323
324/* Catalog record types */
325enum {
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 */
341enum {
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 */
384struct 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));
396typedef struct HFSCatalogFolder HFSCatalogFolder;
397
398/* HFS Plus catalog folder record - 88 bytes */
399struct 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));
415typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder;
416
417/* HFS catalog file record - 102 bytes */
418struct 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));
439typedef struct HFSCatalogFile HFSCatalogFile;
440
441/* HFS Plus catalog file record - 248 bytes */
442struct 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));
462typedef struct HFSPlusCatalogFile HFSPlusCatalogFile;
463
464/* HFS catalog thread record - 46 bytes */
465struct 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));
471typedef struct HFSCatalogThread HFSCatalogThread;
472
473/* HFS Plus catalog thread record -- 264 bytes */
474struct 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));
480typedef 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 */
487enum {
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 */
500struct 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));
505typedef struct HFSPlusAttrForkData HFSPlusAttrForkData;
506
507/*
508 * HFSPlusAttrExtents
509 * This record contains information about overflow extents for large,
510 * fragmented attributes.
511 */
512struct HFSPlusAttrExtents {
513 u_int32_t recordType; /* == kHFSPlusAttrExtents*/
514 u_int32_t reserved;
515 HFSPlusExtentRecord extents; /* additional extents*/
516} __attribute__((aligned(2), packed));
517typedef 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 */
525struct 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));
531typedef struct HFSPlusAttrData HFSPlusAttrData;
532
533
534/* HFSPlusAttrInlineData is obsolete use HFSPlusAttrData instead */
535struct 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));
541typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData;
542
543
544/* A generic Attribute Record */
545union HFSPlusAttrRecord {
546 u_int32_t recordType;
547 HFSPlusAttrInlineData inlineData; /* NOT USED */
548 HFSPlusAttrData attrData;
549 HFSPlusAttrForkData forkData;
550 HFSPlusAttrExtents overflowExtents;
551};
552typedef union HFSPlusAttrRecord HFSPlusAttrRecord;
553
554/* Attribute key */
555enum { kHFSMaxAttrNameLen = 127 };
556struct 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));
564typedef 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 */
573enum {
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 */
586enum {
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
623enum {
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. */
629struct 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));
660typedef 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. */
673struct 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));
708typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;
709
710
711/* B-tree structures */
712
713enum BTreeKeyLimits{
714 kMaxKeyLength = 520
715};
716
717union BTreeKey{
718 u_int8_t length8;
719 u_int16_t length16;
720 u_int8_t rawData [kMaxKeyLength+2];
721};
722typedef union BTreeKey BTreeKey;
723
724/* BTNodeDescriptor -- Every B-tree node starts with these fields. */
725struct 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));
733typedef struct BTNodeDescriptor BTNodeDescriptor;
734
735/* Constants for BTNodeDescriptor kind */
736enum {
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 */
744struct 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));
761typedef struct BTHeaderRec BTHeaderRec;
762
763/* Constants for BTHeaderRec attributes */
764enum {
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 */
772enum {
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
789struct 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));
798typedef struct JournalInfoBlock JournalInfoBlock;
799
800enum {
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/aarch64-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
43extern "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 */
50struct HFSUniStr255 {
51 u_int16_t length; /* number of unicode characters */
52 u_int16_t unicode[255]; /* unicode characters */
53} __attribute__((aligned(2), packed));
54typedef struct HFSUniStr255 HFSUniStr255;
55typedef const HFSUniStr255 *ConstHFSUniStr255Param;
56#endif /* _HFSUNISTR255_DEFINED_ */
57
58
59#ifdef __cplusplus
60}
61#endif
62
63
64#endif /* __HFS_UNISTR__ */
lib/libc/include/aarch64-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
35extern __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
57typedef void* iconv_t;
58#endif
59
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65
66/* Allocates descriptor for code conversion from encoding `fromcode' to
67 encoding `tocode'. */
68extern __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. */
75extern __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'. */
78extern __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. */
87extern __LIBICONV_DLL_EXPORTED int iconvctl (iconv_t cd, int request, void* argument);
88
89/* Hook performed after every successful conversion of a Unicode character. */
90typedef void (*iconv_unicode_char_hook) (unsigned int uc, void* data);
91/* Hook performed after every successful conversion of a wide character. */
92typedef void (*iconv_wide_char_hook) (wchar_t wc, void* data);
93/* Set of hooks. */
94struct 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. */
104typedef 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. */
114typedef 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. */
125typedef 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. */
135typedef 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. */
144typedef void (*iconv_wchar_mb_to_wc_fallback) ();
145typedef void (*iconv_wchar_wc_to_mb_fallback) ();
146#endif
147/* Set of fallbacks. */
148struct 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. */
166extern __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. */
173extern __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 "/"). */
182extern __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/aarch64-macos-gnu/ifaddrs.h created+70
......@@ -0,0 +1,70 @@
1/*
2 * Copyright (c) 2018 Apple Inc. All rights reserved.
3 */
4/* $FreeBSD: src/include/ifaddrs.h,v 1.3.32.1.4.1 2010/06/14 02:09:06 kensmith Exp $ */
5
6/*
7 * Copyright (c) 1995, 1999
8 * Berkeley Software Design, Inc. All rights reserved.
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 *
16 * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
29 */
30
31#ifndef _IFADDRS_H_
32#define _IFADDRS_H_
33
34#include <os/availability.h>
35
36struct ifaddrs {
37 struct ifaddrs *ifa_next;
38 char *ifa_name;
39 unsigned int ifa_flags;
40 struct sockaddr *ifa_addr;
41 struct sockaddr *ifa_netmask;
42 struct sockaddr *ifa_dstaddr;
43 void *ifa_data;
44};
45
46/*
47 * This may have been defined in <net/if.h>. Note that if <net/if.h> is
48 * to be included it must be included before this header file.
49 */
50#ifndef ifa_broadaddr
51#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
52#endif
53
54struct ifmaddrs {
55 struct ifmaddrs *ifma_next;
56 struct sockaddr *ifma_name;
57 struct sockaddr *ifma_addr;
58 struct sockaddr *ifma_lladdr;
59};
60
61#include <sys/cdefs.h>
62
63__BEGIN_DECLS
64extern int getifaddrs(struct ifaddrs **);
65extern void freeifaddrs(struct ifaddrs *);
66extern int getifmaddrs(struct ifmaddrs **) API_AVAILABLE(macos(10.7), ios(4.3), watchos(4.0), tvos(11.0));
67extern void freeifmaddrs(struct ifmaddrs *) API_AVAILABLE(macos(10.7), ios(4.3), watchos(4.0), tvos(11.0));
68__END_DECLS
69
70#endif
lib/libc/include/aarch64-macos-gnu/inttypes.h created+297
......@@ -0,0 +1,297 @@
1/*
2 * Copyright (c) 2000-2004, 2013 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 * <inttypes.h> -- Standard C header, defined in ISO/IEC 9899:1999
26 * (aka "C99"), section 7.8. This defines format string conversion
27 * specifiers suitable for use within arguments to fprintf and fscanf
28 * and their ilk.
29 */
30
31#if !defined(_INTTYPES_H_)
32#define _INTTYPES_H_
33
34# define __PRI_8_LENGTH_MODIFIER__ "hh"
35# define __PRI_64_LENGTH_MODIFIER__ "ll"
36# define __SCN_64_LENGTH_MODIFIER__ "ll"
37# define __PRI_MAX_LENGTH_MODIFIER__ "j"
38# define __SCN_MAX_LENGTH_MODIFIER__ "j"
39
40# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
41# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
42# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
43# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
44# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
45# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
46
47# define PRId16 "hd"
48# define PRIi16 "hi"
49# define PRIo16 "ho"
50# define PRIu16 "hu"
51# define PRIx16 "hx"
52# define PRIX16 "hX"
53
54# define PRId32 "d"
55# define PRIi32 "i"
56# define PRIo32 "o"
57# define PRIu32 "u"
58# define PRIx32 "x"
59# define PRIX32 "X"
60
61# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
62# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
63# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
64# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
65# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
66# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
67
68# define PRIdLEAST8 PRId8
69# define PRIiLEAST8 PRIi8
70# define PRIoLEAST8 PRIo8
71# define PRIuLEAST8 PRIu8
72# define PRIxLEAST8 PRIx8
73# define PRIXLEAST8 PRIX8
74
75# define PRIdLEAST16 PRId16
76# define PRIiLEAST16 PRIi16
77# define PRIoLEAST16 PRIo16
78# define PRIuLEAST16 PRIu16
79# define PRIxLEAST16 PRIx16
80# define PRIXLEAST16 PRIX16
81
82# define PRIdLEAST32 PRId32
83# define PRIiLEAST32 PRIi32
84# define PRIoLEAST32 PRIo32
85# define PRIuLEAST32 PRIu32
86# define PRIxLEAST32 PRIx32
87# define PRIXLEAST32 PRIX32
88
89# define PRIdLEAST64 PRId64
90# define PRIiLEAST64 PRIi64
91# define PRIoLEAST64 PRIo64
92# define PRIuLEAST64 PRIu64
93# define PRIxLEAST64 PRIx64
94# define PRIXLEAST64 PRIX64
95
96# define PRIdFAST8 PRId8
97# define PRIiFAST8 PRIi8
98# define PRIoFAST8 PRIo8
99# define PRIuFAST8 PRIu8
100# define PRIxFAST8 PRIx8
101# define PRIXFAST8 PRIX8
102
103# define PRIdFAST16 PRId16
104# define PRIiFAST16 PRIi16
105# define PRIoFAST16 PRIo16
106# define PRIuFAST16 PRIu16
107# define PRIxFAST16 PRIx16
108# define PRIXFAST16 PRIX16
109
110# define PRIdFAST32 PRId32
111# define PRIiFAST32 PRIi32
112# define PRIoFAST32 PRIo32
113# define PRIuFAST32 PRIu32
114# define PRIxFAST32 PRIx32
115# define PRIXFAST32 PRIX32
116
117# define PRIdFAST64 PRId64
118# define PRIiFAST64 PRIi64
119# define PRIoFAST64 PRIo64
120# define PRIuFAST64 PRIu64
121# define PRIxFAST64 PRIx64
122# define PRIXFAST64 PRIX64
123
124/* int32_t is 'int', but intptr_t is 'long'. */
125# define PRIdPTR "ld"
126# define PRIiPTR "li"
127# define PRIoPTR "lo"
128# define PRIuPTR "lu"
129# define PRIxPTR "lx"
130# define PRIXPTR "lX"
131
132# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d"
133# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i"
134# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o"
135# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u"
136# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x"
137# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X"
138
139# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d"
140# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i"
141# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o"
142# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u"
143# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x"
144
145# define SCNd16 "hd"
146# define SCNi16 "hi"
147# define SCNo16 "ho"
148# define SCNu16 "hu"
149# define SCNx16 "hx"
150
151# define SCNd32 "d"
152# define SCNi32 "i"
153# define SCNo32 "o"
154# define SCNu32 "u"
155# define SCNx32 "x"
156
157# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d"
158# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i"
159# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o"
160# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u"
161# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x"
162
163# define SCNdLEAST8 SCNd8
164# define SCNiLEAST8 SCNi8
165# define SCNoLEAST8 SCNo8
166# define SCNuLEAST8 SCNu8
167# define SCNxLEAST8 SCNx8
168
169# define SCNdLEAST16 SCNd16
170# define SCNiLEAST16 SCNi16
171# define SCNoLEAST16 SCNo16
172# define SCNuLEAST16 SCNu16
173# define SCNxLEAST16 SCNx16
174
175# define SCNdLEAST32 SCNd32
176# define SCNiLEAST32 SCNi32
177# define SCNoLEAST32 SCNo32
178# define SCNuLEAST32 SCNu32
179# define SCNxLEAST32 SCNx32
180
181# define SCNdLEAST64 SCNd64
182# define SCNiLEAST64 SCNi64
183# define SCNoLEAST64 SCNo64
184# define SCNuLEAST64 SCNu64
185# define SCNxLEAST64 SCNx64
186
187# define SCNdFAST8 SCNd8
188# define SCNiFAST8 SCNi8
189# define SCNoFAST8 SCNo8
190# define SCNuFAST8 SCNu8
191# define SCNxFAST8 SCNx8
192
193# define SCNdFAST16 SCNd16
194# define SCNiFAST16 SCNi16
195# define SCNoFAST16 SCNo16
196# define SCNuFAST16 SCNu16
197# define SCNxFAST16 SCNx16
198
199# define SCNdFAST32 SCNd32
200# define SCNiFAST32 SCNi32
201# define SCNoFAST32 SCNo32
202# define SCNuFAST32 SCNu32
203# define SCNxFAST32 SCNx32
204
205# define SCNdFAST64 SCNd64
206# define SCNiFAST64 SCNi64
207# define SCNoFAST64 SCNo64
208# define SCNuFAST64 SCNu64
209# define SCNxFAST64 SCNx64
210
211# define SCNdPTR "ld"
212# define SCNiPTR "li"
213# define SCNoPTR "lo"
214# define SCNuPTR "lu"
215# define SCNxPTR "lx"
216
217# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d"
218# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i"
219# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o"
220# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u"
221# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x"
222
223#include <sys/cdefs.h>
224#include <Availability.h>
225
226#include <_types.h>
227#include <sys/_types/_wchar_t.h>
228
229#include <stdint.h>
230
231__BEGIN_DECLS
232
233/* 7.8.2.1 */
234__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
235extern intmax_t
236imaxabs(intmax_t j);
237
238/* 7.8.2.2 */
239typedef struct {
240 intmax_t quot;
241 intmax_t rem;
242} imaxdiv_t;
243
244__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
245extern imaxdiv_t
246imaxdiv(intmax_t __numer, intmax_t __denom);
247
248/* 7.8.2.3 */
249__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
250extern intmax_t
251strtoimax(const char * __restrict __nptr,
252 char ** __restrict __endptr,
253 int __base);
254
255__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
256extern uintmax_t
257strtoumax(const char * __restrict __nptr,
258 char ** __restrict __endptr,
259 int __base);
260
261/* 7.8.2.4 */
262__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
263extern intmax_t
264wcstoimax(const wchar_t * __restrict __nptr,
265 wchar_t ** __restrict __endptr,
266 int __base);
267
268__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
269extern uintmax_t
270wcstoumax(const wchar_t * __restrict __nptr,
271 wchar_t ** __restrict __endptr,
272 int __base);
273
274/* Poison the following routines if -fshort-wchar is set */
275#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
276#pragma GCC poison wcstoimax wcstoumax
277#endif
278
279__END_DECLS
280
281#ifdef _USE_EXTENDED_LOCALES_
282#include <xlocale/_inttypes.h>
283#endif /* _USE_EXTENDED_LOCALES_ */
284
285/*
286 No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros;
287 in fact, you can't #undef them, because later uses of any of
288 their dependents will *not* then do the intended substitution.
289 Expansion of a #define like this one:
290
291 #define x IDENT y
292
293 uses the cpp value of IDENT at the location where x is *expanded*,
294 not where it is #defined.
295*/
296
297#endif /* !_INTTYPES_H_ */
lib/libc/include/aarch64-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
113char *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/aarch64-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)
194OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL2 OS_NONNULL3
195int
196launch_activate_socket(const char *name,
197 int * _Nonnull * _Nullable fds, size_t *cnt);
198
199typedef struct _launch_data *launch_data_t;
200typedef void (*launch_data_dict_iterator_t)(const launch_data_t lval,
201 const char *key, void * _Nullable ctx);
202
203typedef 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)
217OS_EXPORT OS_MALLOC OS_WARN_RESULT
218launch_data_t
219launch_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)
222OS_EXPORT OS_MALLOC OS_WARN_RESULT OS_NONNULL1
223launch_data_t
224launch_data_copy(launch_data_t ld);
225
226__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
227OS_EXPORT OS_WARN_RESULT OS_NONNULL1
228launch_data_type_t
229launch_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)
232OS_EXPORT OS_NONNULL1
233void
234launch_data_free(launch_data_t ld);
235
236__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
237OS_EXPORT OS_NONNULL1 OS_NONNULL2 OS_NONNULL3
238bool
239launch_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)
243OS_EXPORT OS_WARN_RESULT OS_NONNULL1 OS_NONNULL2
244launch_data_t _Nullable
245launch_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)
248OS_EXPORT OS_NONNULL1 OS_NONNULL2
249bool
250launch_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)
253OS_EXPORT OS_NONNULL1 OS_NONNULL2
254void
255launch_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)
259OS_EXPORT OS_WARN_RESULT OS_NONNULL1
260size_t
261launch_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)
264OS_EXPORT OS_NONNULL1 OS_NONNULL2
265bool
266launch_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)
270OS_EXPORT OS_WARN_RESULT OS_NONNULL1
271launch_data_t
272launch_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)
275OS_EXPORT OS_WARN_RESULT OS_NONNULL1
276size_t
277launch_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)
280OS_EXPORT OS_MALLOC OS_WARN_RESULT
281launch_data_t
282launch_data_new_fd(int fd);
283
284__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
285OS_EXPORT OS_MALLOC OS_WARN_RESULT
286launch_data_t
287launch_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)
290OS_EXPORT OS_MALLOC OS_WARN_RESULT
291launch_data_t
292launch_data_new_integer(long long val);
293
294__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
295OS_EXPORT OS_MALLOC OS_WARN_RESULT
296launch_data_t
297launch_data_new_bool(bool val);
298
299__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
300OS_EXPORT OS_MALLOC OS_WARN_RESULT
301launch_data_t
302launch_data_new_real(double val);
303
304__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
305OS_EXPORT OS_MALLOC OS_WARN_RESULT
306launch_data_t
307launch_data_new_string(const char *val);
308
309__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
310OS_EXPORT OS_MALLOC OS_WARN_RESULT
311launch_data_t
312launch_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)
315OS_EXPORT OS_NONNULL1
316bool
317launch_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)
320OS_EXPORT OS_NONNULL1
321bool
322launch_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)
325OS_EXPORT OS_NONNULL1
326bool
327launch_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)
330OS_EXPORT OS_NONNULL1
331bool
332launch_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)
335OS_EXPORT OS_NONNULL1
336bool
337launch_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)
340OS_EXPORT OS_NONNULL1
341bool
342launch_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)
345OS_EXPORT OS_NONNULL1
346bool
347launch_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)
350OS_EXPORT OS_WARN_RESULT OS_NONNULL1
351int
352launch_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)
355OS_EXPORT OS_WARN_RESULT OS_NONNULL1
356mach_port_t
357launch_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)
360OS_EXPORT OS_WARN_RESULT OS_NONNULL1
361long long
362launch_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)
365OS_EXPORT OS_WARN_RESULT OS_NONNULL1
366bool
367launch_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)
370OS_EXPORT OS_WARN_RESULT OS_NONNULL1
371double
372launch_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)
375OS_EXPORT OS_WARN_RESULT OS_NONNULL1
376const char *
377launch_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)
380OS_EXPORT OS_WARN_RESULT OS_NONNULL1
381void *
382launch_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)
385OS_EXPORT OS_WARN_RESULT OS_NONNULL1
386size_t
387launch_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)
390OS_EXPORT OS_WARN_RESULT OS_NONNULL1
391int
392launch_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)
395OS_EXPORT OS_WARN_RESULT
396int
397launch_get_fd(void);
398
399__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_10, __IPHONE_2_0, __IPHONE_8_0)
400OS_EXPORT OS_MALLOC OS_WARN_RESULT OS_NONNULL1
401launch_data_t
402launch_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/aarch64-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
40char *basename(char *);
41char *dirname(char *);
42
43#else /* !__DARWIN_UNIX03 */
44
45char *basename(const char *);
46char *dirname(const char *);
47
48#endif /* __DARWIN_UNIX_03 */
49
50#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
51#include <Availability.h>
52char *basename_r(const char *, char *)
53 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
54 __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
55
56char *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/aarch64-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/aarch64-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)
128typedef int64_t __attribute__((__aligned__((sizeof(int64_t)))))
129 OSAtomic_int64_aligned64_t;
130#else
131typedef 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 */
145OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
146__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
147int32_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 */
160OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
161__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
162int32_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 */
170OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
171__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
172int32_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 */
181OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
182__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
183int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue );
184
185
186/*! @abstract Atomically decrements a 32-bit value.
187 @result Returns the new value.
188 */
189OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_sub)
190__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
191int32_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 */
200OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_sub)
201__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
202int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue );
203
204#else
205__inline static
206int32_t OSAtomicIncrement32( volatile int32_t *__theValue )
207 { return OSAtomicAdd32( 1, __theValue); }
208
209__inline static
210int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue )
211 { return OSAtomicAdd32Barrier( 1, __theValue); }
212
213__inline static
214int32_t OSAtomicDecrement32( volatile int32_t *__theValue )
215 { return OSAtomicAdd32( -1, __theValue); }
216
217__inline static
218int32_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 */
230OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
231__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
232int64_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 */
246OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
247__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_3_2)
248int64_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 */
257OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
258__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
259int64_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 */
268OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add)
269__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
270int64_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 */
276OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_sub)
277__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
278int64_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 */
287OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_sub)
288__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1)
289int64_t OSAtomicDecrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue );
290
291#else
292__inline static
293int64_t OSAtomicIncrement64( volatile OSAtomic_int64_aligned64_t *__theValue )
294 { return OSAtomicAdd64( 1, __theValue); }
295
296__inline static
297int64_t OSAtomicIncrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue )
298 { return OSAtomicAdd64Barrier( 1, __theValue); }
299
300__inline static
301int64_t OSAtomicDecrement64( volatile OSAtomic_int64_aligned64_t *__theValue )
302 { return OSAtomicAdd64( -1, __theValue); }
303
304__inline static
305int64_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 */
328OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or)
329__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
330int32_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 */
343OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or)
344__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
345int32_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 */
355OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or)
356__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
357int32_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 */
370OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or)
371__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
372int32_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 */
384OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
385__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
386int32_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 */
399OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
400__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
401int32_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 */
411OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
412__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
413int32_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 */
426OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
427__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
428int32_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 */
440OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_xor)
441__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
442int32_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 */
455OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor)
456__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
457int32_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 */
467OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_xor)
468__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
469int32_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 */
482OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor)
483__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
484int32_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 */
501OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
502__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
503bool 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 */
517OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
518__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
519bool 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 */
530OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
531__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
532bool 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 */
546OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
547__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
548bool 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 */
561OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
562__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
563bool 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 */
579OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
580__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
581bool 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 */
595OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
596__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
597bool 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 */
614OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
615__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
616bool 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 */
627OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
628__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
629bool 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 */
644OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong)
645__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_3_2)
646bool 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 */
669OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or)
670__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
671bool 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 */
692OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or)
693__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
694bool 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 */
714OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
715__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
716bool 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 */
737OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
738__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
739bool 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 */
748OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_thread_fence)
749__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
750void 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
769extern "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>
774typedef std::atomic<uint8_t> _OSAtomic_uint8_t;
775typedef std::atomic<int32_t> _OSAtomic_int32_t;
776typedef std::atomic<uint32_t> _OSAtomic_uint32_t;
777typedef std::atomic<int64_t> _OSAtomic_int64_t;
778typedef 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>
786typedef _Atomic(uint8_t) _OSAtomic_uint8_t;
787typedef _Atomic(int32_t) _OSAtomic_int32_t;
788typedef _Atomic(uint32_t) _OSAtomic_uint32_t;
789typedef _Atomic(int64_t) _OSAtomic_int64_t;
790typedef _Atomic(void*) _OSAtomic_void_ptr_t;
791#define OSATOMIC_STD(_a) _a
792#endif
793
794#if __has_extension(c_alignof) && __has_attribute(aligned)
795typedef int64_t __attribute__((__aligned__(_Alignof(_OSAtomic_int64_t))))
796 OSAtomic_int64_aligned64_t;
797#elif __has_attribute(aligned)
798typedef int64_t __attribute__((__aligned__((sizeof(_OSAtomic_int64_t)))))
799 OSAtomic_int64_aligned64_t;
800#else
801typedef 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
810OSATOMIC_INLINE
811int32_t
812OSAtomicAdd32(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
819OSATOMIC_INLINE
820int32_t
821OSAtomicAdd32Barrier(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
828OSATOMIC_INLINE
829int32_t
830OSAtomicIncrement32(volatile int32_t *__theValue)
831{
832 return OSAtomicAdd32(1, __theValue);
833}
834
835OSATOMIC_INLINE
836int32_t
837OSAtomicIncrement32Barrier(volatile int32_t *__theValue)
838{
839 return OSAtomicAdd32Barrier(1, __theValue);
840}
841
842OSATOMIC_INLINE
843int32_t
844OSAtomicDecrement32(volatile int32_t *__theValue)
845{
846 return OSAtomicAdd32(-1, __theValue);
847}
848
849OSATOMIC_INLINE
850int32_t
851OSAtomicDecrement32Barrier(volatile int32_t *__theValue)
852{
853 return OSAtomicAdd32Barrier(-1, __theValue);
854}
855
856OSATOMIC_INLINE
857int64_t
858OSAtomicAdd64(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
866OSATOMIC_INLINE
867int64_t
868OSAtomicAdd64Barrier(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
876OSATOMIC_INLINE
877int64_t
878OSAtomicIncrement64(volatile OSAtomic_int64_aligned64_t *__theValue)
879{
880 return OSAtomicAdd64(1, __theValue);
881}
882
883OSATOMIC_INLINE
884int64_t
885OSAtomicIncrement64Barrier(volatile OSAtomic_int64_aligned64_t *__theValue)
886{
887 return OSAtomicAdd64Barrier(1, __theValue);
888}
889
890OSATOMIC_INLINE
891int64_t
892OSAtomicDecrement64(volatile OSAtomic_int64_aligned64_t *__theValue)
893{
894 return OSAtomicAdd64(-1, __theValue);
895}
896
897OSATOMIC_INLINE
898int64_t
899OSAtomicDecrement64Barrier(volatile OSAtomic_int64_aligned64_t *__theValue)
900{
901 return OSAtomicAdd64Barrier(-1, __theValue);
902}
903
904OSATOMIC_INLINE
905int32_t
906OSAtomicOr32(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
913OSATOMIC_INLINE
914int32_t
915OSAtomicOr32Barrier(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
922OSATOMIC_INLINE
923int32_t
924OSAtomicOr32Orig(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
931OSATOMIC_INLINE
932int32_t
933OSAtomicOr32OrigBarrier(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
940OSATOMIC_INLINE
941int32_t
942OSAtomicAnd32(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
949OSATOMIC_INLINE
950int32_t
951OSAtomicAnd32Barrier(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
958OSATOMIC_INLINE
959int32_t
960OSAtomicAnd32Orig(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
967OSATOMIC_INLINE
968int32_t
969OSAtomicAnd32OrigBarrier(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
976OSATOMIC_INLINE
977int32_t
978OSAtomicXor32(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
985OSATOMIC_INLINE
986int32_t
987OSAtomicXor32Barrier(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
994OSATOMIC_INLINE
995int32_t
996OSAtomicXor32Orig(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
1003OSATOMIC_INLINE
1004int32_t
1005OSAtomicXor32OrigBarrier(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
1012OSATOMIC_INLINE
1013bool
1014OSAtomicCompareAndSwap32(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
1023OSATOMIC_INLINE
1024bool
1025OSAtomicCompareAndSwap32Barrier(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
1034OSATOMIC_INLINE
1035bool
1036OSAtomicCompareAndSwapPtr(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
1045OSATOMIC_INLINE
1046bool
1047OSAtomicCompareAndSwapPtrBarrier(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
1056OSATOMIC_INLINE
1057bool
1058OSAtomicCompareAndSwapInt(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
1067OSATOMIC_INLINE
1068bool
1069OSAtomicCompareAndSwapIntBarrier(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
1078OSATOMIC_INLINE
1079bool
1080OSAtomicCompareAndSwapLong(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
1089OSATOMIC_INLINE
1090bool
1091OSAtomicCompareAndSwapLongBarrier(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
1100OSATOMIC_INLINE
1101bool
1102OSAtomicCompareAndSwap64(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
1111OSATOMIC_INLINE
1112bool
1113OSAtomicCompareAndSwap64Barrier(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
1122OSATOMIC_INLINE
1123bool
1124OSAtomicTestAndSet(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
1132OSATOMIC_INLINE
1133bool
1134OSAtomicTestAndSetBarrier(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
1142OSATOMIC_INLINE
1143bool
1144OSAtomicTestAndClear(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
1152OSATOMIC_INLINE
1153bool
1154OSAtomicTestAndClearBarrier(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
1162OSATOMIC_INLINE
1163void
1164OSMemoryBarrier(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
1195typedef volatile struct {
1196 void *opaque1;
1197 void *opaque2;
1198 int opaque3;
1199} __attribute__ ((aligned (16))) OSFifoQueueHead;
1200
1201#else
1202
1203typedef 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))
1235void 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))
1260void* 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/aarch64-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
48typedef volatile struct {
49 void *opaque1;
50 long opaque2;
51} __attribute__ ((aligned (16))) OSQueueHead;
52
53#else
54
55typedef 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)
84void 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)
111void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset);
112
113__END_DECLS
114
115#endif /* _OSATOMICQUEUE_H_ */
lib/libc/include/aarch64-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
70enum {
71 OSUnknownByteOrder,
72 OSLittleEndian,
73 OSBigEndian
74};
75
76__DARWIN_OS_INLINE
77int32_t
78OSHostByteOrder(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
101uint16_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
111uint32_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
121uint64_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
133void
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
144void
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
155void
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/aarch64-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 */
79typedef 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 */
87OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock)
88__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
89bool 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 */
97OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock)
98__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
99void OSSpinLockLock( volatile OSSpinLock *__lock );
100
101
102/*! @abstract Unlocks a spinlock */
103OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock)
104__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
105void 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
134typedef 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
141OSSPINLOCK_INLINE
142void
143OSSpinLockLock(volatile OSSpinLock *__lock)
144{
145 os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
146 return os_unfair_lock_lock(lock);
147}
148
149OSSPINLOCK_INLINE
150bool
151OSSpinLockTry(volatile OSSpinLock *__lock)
152{
153 os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
154 return os_unfair_lock_trylock(lock);
155}
156
157OSSPINLOCK_INLINE
158void
159OSSpinLockUnlock(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
184typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock);
185typedef volatile OSSpinLock *_os_nospin_lock_t
186 OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_t);
187
188OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock)
189OS_NOSPIN_LOCK_AVAILABILITY
190void _os_nospin_lock_lock(_os_nospin_lock_t lock);
191#undef OSSpinLockLock
192#define OSSpinLockLock(lock) _os_nospin_lock_lock(lock)
193
194OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock)
195OS_NOSPIN_LOCK_AVAILABILITY
196bool _os_nospin_lock_trylock(_os_nospin_lock_t lock);
197#undef OSSpinLockTry
198#define OSSpinLockTry(lock) _os_nospin_lock_trylock(lock)
199
200OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock)
201OS_NOSPIN_LOCK_AVAILABILITY
202void _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/aarch64-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
36typedef unsigned int UInt;
37typedef signed int SInt;
38
39
40#include <sys/_types/_os_inline.h>
41
42#endif /* _OS_OSTYPES_H */
lib/libc/include/aarch64-macos-gnu/libkern/_OSByteOrder.h created+133
......@@ -0,0 +1,133 @@
1/*
2 * Copyright (c) 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/*
33 * This header is normally included from <libkern/OSByteOrder.h>. However,
34 * <sys/_endian.h> also includes this in the case of little-endian
35 * architectures, so that we can map OSByteOrder routines to the hton* and ntoh*
36 * macros. This results in the asymmetry below; we only include
37 * <libkern/arch/_OSByteOrder.h> for little-endian architectures.
38 */
39
40#include <sys/_types.h>
41
42/* Macros for swapping constant values in the preprocessing stage. */
43#define __DARWIN_OSSwapConstInt16(x) \
44 ((__uint16_t)((((__uint16_t)(x) & 0xff00U) >> 8) | \
45 (((__uint16_t)(x) & 0x00ffU) << 8)))
46
47#define __DARWIN_OSSwapConstInt32(x) \
48 ((__uint32_t)((((__uint32_t)(x) & 0xff000000U) >> 24) | \
49 (((__uint32_t)(x) & 0x00ff0000U) >> 8) | \
50 (((__uint32_t)(x) & 0x0000ff00U) << 8) | \
51 (((__uint32_t)(x) & 0x000000ffU) << 24)))
52
53#define __DARWIN_OSSwapConstInt64(x) \
54 ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \
55 (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \
56 (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \
57 (((__uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \
58 (((__uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \
59 (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \
60 (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \
61 (((__uint64_t)(x) & 0x00000000000000ffULL) << 56)))
62
63#if defined(__GNUC__)
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
75#if defined(__i386__) || defined(__x86_64__)
76#include <libkern/i386/_OSByteOrder.h>
77#endif
78
79#if defined (__arm__) || defined(__arm64__)
80#include <libkern/arm/OSByteOrder.h>
81#endif
82
83
84#define __DARWIN_OSSwapInt16(x) \
85 ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
86
87#define __DARWIN_OSSwapInt32(x) \
88 (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x))
89
90#define __DARWIN_OSSwapInt64(x) \
91 (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
92
93#else /* ! __GNUC__ */
94
95#if defined(__i386__) || defined(__x86_64__)
96
97__DARWIN_OS_INLINE
98uint16_t
99_OSSwapInt16(
100 uint16_t data
101 )
102{
103 return __DARWIN_OSSwapConstInt16(data);
104}
105
106__DARWIN_OS_INLINE
107uint32_t
108_OSSwapInt32(
109 uint32_t data
110 )
111{
112 return __DARWIN_OSSwapConstInt32(data);
113}
114
115__DARWIN_OS_INLINE
116uint64_t
117_OSSwapInt64(
118 uint64_t data
119 )
120{
121 return __DARWIN_OSSwapConstInt64(data);
122}
123#endif
124
125#define __DARWIN_OSSwapInt16(x) _OSSwapInt16(x)
126
127#define __DARWIN_OSSwapInt32(x) _OSSwapInt32(x)
128
129#define __DARWIN_OSSwapInt64(x) _OSSwapInt64(x)
130
131#endif /* __GNUC__ */
132
133#endif /* ! _OS__OSBYTEORDER_H */
lib/libc/include/aarch64-macos-gnu/libkern/arm/OSByteOrder.h created+216
......@@ -0,0 +1,216 @@
1/*
2 * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
3 */
4
5#ifndef _OS_OSBYTEORDERARM_H
6#define _OS_OSBYTEORDERARM_H
7
8#include <stdint.h>
9#include <arm/arch.h> /* for _ARM_ARCH_6 */
10
11/* Generic byte swapping functions. */
12
13__DARWIN_OS_INLINE
14uint16_t
15_OSSwapInt16(
16 uint16_t _data
17 )
18{
19 /* Reduces to 'rev16' with clang */
20 return (uint16_t)(_data << 8 | _data >> 8);
21}
22
23__DARWIN_OS_INLINE
24uint32_t
25_OSSwapInt32(
26 uint32_t _data
27 )
28{
29#if defined(__llvm__)
30 _data = __builtin_bswap32(_data);
31#else
32 /* This actually generates the best code */
33 _data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
34#endif
35
36 return _data;
37}
38
39__DARWIN_OS_INLINE
40uint64_t
41_OSSwapInt64(
42 uint64_t _data
43 )
44{
45#if defined(__llvm__)
46 return __builtin_bswap64(_data);
47#else
48 union {
49 uint64_t _ull;
50 uint32_t _ul[2];
51 } _u;
52
53 /* This actually generates the best code */
54 _u._ul[0] = (uint32_t)(_data >> 32);
55 _u._ul[1] = (uint32_t)(_data & 0xffffffff);
56 _u._ul[0] = _OSSwapInt32(_u._ul[0]);
57 _u._ul[1] = _OSSwapInt32(_u._ul[1]);
58 return _u._ull;
59#endif
60}
61
62/* Functions for byte reversed loads. */
63
64struct _OSUnalignedU16 {
65 volatile uint16_t __val;
66} __attribute__((__packed__));
67
68struct _OSUnalignedU32 {
69 volatile uint32_t __val;
70} __attribute__((__packed__));
71
72struct _OSUnalignedU64 {
73 volatile uint64_t __val;
74} __attribute__((__packed__));
75
76#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
77__DARWIN_OS_INLINE
78uint16_t
79_OSReadSwapInt16(
80 const volatile void * _base,
81 uintptr_t _offset
82 )
83{
84 return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
85}
86#else
87__DARWIN_OS_INLINE
88uint16_t
89OSReadSwapInt16(
90 const volatile void * _base,
91 uintptr_t _offset
92 )
93{
94 return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
95}
96#endif
97
98#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
99__DARWIN_OS_INLINE
100uint32_t
101_OSReadSwapInt32(
102 const volatile void * _base,
103 uintptr_t _offset
104 )
105{
106 return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
107}
108#else
109__DARWIN_OS_INLINE
110uint32_t
111OSReadSwapInt32(
112 const volatile void * _base,
113 uintptr_t _offset
114 )
115{
116 return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
117}
118#endif
119
120#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
121__DARWIN_OS_INLINE
122uint64_t
123_OSReadSwapInt64(
124 const volatile void * _base,
125 uintptr_t _offset
126 )
127{
128 return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
129}
130#else
131__DARWIN_OS_INLINE
132uint64_t
133OSReadSwapInt64(
134 const volatile void * _base,
135 uintptr_t _offset
136 )
137{
138 return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
139}
140#endif
141
142/* Functions for byte reversed stores. */
143
144#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
145__DARWIN_OS_INLINE
146void
147_OSWriteSwapInt16(
148 volatile void * _base,
149 uintptr_t _offset,
150 uint16_t _data
151 )
152{
153 ((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
154}
155#else
156__DARWIN_OS_INLINE
157void
158OSWriteSwapInt16(
159 volatile void * _base,
160 uintptr_t _offset,
161 uint16_t _data
162 )
163{
164 ((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
165}
166#endif
167
168#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
169__DARWIN_OS_INLINE
170void
171_OSWriteSwapInt32(
172 volatile void * _base,
173 uintptr_t _offset,
174 uint32_t _data
175 )
176{
177 ((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
178}
179#else
180__DARWIN_OS_INLINE
181void
182OSWriteSwapInt32(
183 volatile void * _base,
184 uintptr_t _offset,
185 uint32_t _data
186 )
187{
188 ((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
189}
190#endif
191
192#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
193__DARWIN_OS_INLINE
194void
195_OSWriteSwapInt64(
196 volatile void * _base,
197 uintptr_t _offset,
198 uint64_t _data
199 )
200{
201 ((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
202}
203#else
204__DARWIN_OS_INLINE
205void
206OSWriteSwapInt64(
207 volatile void * _base,
208 uintptr_t _offset,
209 uint64_t _data
210 )
211{
212 ((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
213}
214#endif
215
216#endif /* ! _OS_OSBYTEORDERARM_H */
lib/libc/include/aarch64-macos-gnu/limits.h created+167
......@@ -0,0 +1,167 @@
1/*
2 * Copyright (c) 2000, 2004-2007, 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/* $NetBSD: limits.h,v 1.8 1996/10/21 05:10:50 jtc Exp $ */
24
25/*
26 * Copyright (c) 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 * @(#)limits.h 8.2 (Berkeley) 1/4/94
58 */
59
60#ifndef _LIMITS_H_
61#define _LIMITS_H_
62
63#include <sys/cdefs.h>
64#include <machine/limits.h>
65#include <sys/syslimits.h>
66
67#if __DARWIN_C_LEVEL > __DARWIN_C_ANSI
68#define _POSIX_ARG_MAX 4096
69#define _POSIX_CHILD_MAX 25
70#define _POSIX_LINK_MAX 8
71#define _POSIX_MAX_CANON 255
72#define _POSIX_MAX_INPUT 255
73#define _POSIX_NAME_MAX 14
74#define _POSIX_NGROUPS_MAX 8
75#define _POSIX_OPEN_MAX 20
76#define _POSIX_PATH_MAX 256
77#define _POSIX_PIPE_BUF 512
78#define _POSIX_SSIZE_MAX 32767
79#define _POSIX_STREAM_MAX 8
80#define _POSIX_TZNAME_MAX 6
81
82#define _POSIX2_BC_BASE_MAX 99
83#define _POSIX2_BC_DIM_MAX 2048
84#define _POSIX2_BC_SCALE_MAX 99
85#define _POSIX2_BC_STRING_MAX 1000
86#define _POSIX2_EQUIV_CLASS_MAX 2
87#define _POSIX2_EXPR_NEST_MAX 32
88#define _POSIX2_LINE_MAX 2048
89#define _POSIX2_RE_DUP_MAX 255
90#endif /* __DARWIN_C_LEVEL > __DARWIN_C_ANSI */
91
92#if __DARWIN_C_LEVEL >= 199309L
93#define _POSIX_AIO_LISTIO_MAX 2
94#define _POSIX_AIO_MAX 1
95#define _POSIX_DELAYTIMER_MAX 32
96#define _POSIX_MQ_OPEN_MAX 8
97#define _POSIX_MQ_PRIO_MAX 32
98#define _POSIX_RTSIG_MAX 8
99#define _POSIX_SEM_NSEMS_MAX 256
100#define _POSIX_SEM_VALUE_MAX 32767
101#define _POSIX_SIGQUEUE_MAX 32
102#define _POSIX_TIMER_MAX 32
103
104#define _POSIX_CLOCKRES_MIN 20000000
105#endif /* __DARWIN_C_LEVEL >= 199309L */
106
107#if __DARWIN_C_LEVEL >= 199506L
108#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
109#define _POSIX_THREAD_KEYS_MAX 128
110#define _POSIX_THREAD_THREADS_MAX 64
111
112#define PTHREAD_DESTRUCTOR_ITERATIONS 4
113#define PTHREAD_KEYS_MAX 512
114#if defined(__arm__) || defined(__arm64__)
115#define PTHREAD_STACK_MIN 16384
116#else
117#define PTHREAD_STACK_MIN 8192
118#endif
119#endif /* __DARWIN_C_LEVEL >= 199506L */
120
121#if __DARWIN_C_LEVEL >= 200112
122#define _POSIX_HOST_NAME_MAX 255
123#define _POSIX_LOGIN_NAME_MAX 9
124#define _POSIX_SS_REPL_MAX 4
125#define _POSIX_SYMLINK_MAX 255
126#define _POSIX_SYMLOOP_MAX 8
127#define _POSIX_TRACE_EVENT_NAME_MAX 30
128#define _POSIX_TRACE_NAME_MAX 8
129#define _POSIX_TRACE_SYS_MAX 8
130#define _POSIX_TRACE_USER_EVENT_MAX 32
131#define _POSIX_TTY_NAME_MAX 9
132#define _POSIX2_CHARCLASS_NAME_MAX 14
133#define _POSIX2_COLL_WEIGHTS_MAX 2
134
135#define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX
136#endif /* __DARWIN_C_LEVEL >= 200112 */
137
138#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
139#define OFF_MIN LLONG_MIN /* min value for an off_t */
140#define OFF_MAX LLONG_MAX /* max value for an off_t */
141#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
142
143/* Actually for XSI Visible */
144#if __DARWIN_C_LEVEL > __DARWIN_C_ANSI
145
146/* Removed in Issue 6 */
147#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
148#define PASS_MAX 128
149#endif
150
151#define NL_ARGMAX 9
152#define NL_LANGMAX 14
153#define NL_MSGMAX 32767
154#define NL_NMAX 1
155#define NL_SETMAX 255
156#define NL_TEXTMAX 2048
157
158#define _XOPEN_IOV_MAX 16
159#define IOV_MAX 1024
160#define _XOPEN_NAME_MAX 255
161#define _XOPEN_PATH_MAX 1024
162
163#endif /* __DARWIN_C_LEVEL > __DARWIN_C_ANSI */
164
165/* NZERO to be defined here. TBD. See also sys/param.h */
166
167#endif /* !_LIMITS_H_ */
lib/libc/include/aarch64-macos-gnu/locale.h created+56
......@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) 1991, 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 * @(#)locale.h 8.1 (Berkeley) 6/2/93
34 * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $
35 */
36
37#ifndef _LOCALE_H_
38#define _LOCALE_H_
39
40#include <_locale.h>
41
42#define LC_ALL 0
43#define LC_COLLATE 1
44#define LC_CTYPE 2
45#define LC_MONETARY 3
46#define LC_NUMERIC 4
47#define LC_TIME 5
48#define LC_MESSAGES 6
49
50#define _LC_LAST 7 /* marks end */
51
52__BEGIN_DECLS
53char *setlocale(int, const char *);
54__END_DECLS
55
56#endif /* _LOCALE_H_ */
lib/libc/include/aarch64-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
35extern "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 */
53extern uint32_t _dyld_image_count(void) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
54extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
55extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
56extern 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 */
67extern 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);
68extern 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 */
76extern 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 */
85extern 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 */
98extern 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 */
106extern 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 */
113extern 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 */
121extern 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 */
151typedef 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
160typedef struct __NSObjectFileImage* NSObjectFileImage;
161
162
163
164/* NSObjectFileImage can only be used with MH_BUNDLE files */
165extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
166extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
167extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlclose()");
168
169extern uint32_t NSSymbolDefinitionCountInObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
170extern const char* NSSymbolDefinitionNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
171extern uint32_t NSSymbolReferenceCountInObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
172extern 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, "");
173extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
174extern 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
176typedef struct __NSModule* NSModule;
177extern const char* NSNameOfModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
178extern const char* NSLibraryNameForModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
179
180extern 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
188extern 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 */
194typedef struct __NSSymbol* NSSymbol;
195extern bool NSIsSymbolNameDefined(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
196extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
197extern 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()");
198extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
199extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
200extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
201extern 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
206extern const char* NSNameOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
207extern void * NSAddressOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
208extern NSModule NSModuleForSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dladdr()");
209
210/* error handling API */
211typedef 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 */
228typedef enum {
229 NSOtherErrorRelocation,
230 NSOtherErrorLazyBind,
231 NSOtherErrorIndrLoop,
232 NSOtherErrorLazyInit,
233 NSOtherErrorInvalidArgs
234} NSOtherErrorNumbers;
235
236extern 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
238typedef 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
245extern void NSInstallLinkEditErrorHandlers(const NSLinkEditErrorHandlers *handlers) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
246
247extern bool NSAddLibrary(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()");
248extern bool NSAddLibraryWithSearching(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()");
249extern 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
256extern bool _dyld_present(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "always true");
257extern bool _dyld_launched_prebound(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "moot");
258extern bool _dyld_all_twolevel_modules_prebound(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "moot");
259extern 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)");
260extern bool _dyld_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()");
261extern 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()");
262extern 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()");
263extern 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
265extern 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/aarch64-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 */
54struct 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 */
72struct 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 */
249struct 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 */
338union 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 */
357struct 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 */
377struct 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 */
437struct 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
451struct 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 */
641struct 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 */
654struct 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 */
669struct 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 */
683struct 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 */
700struct 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 */
715struct 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 */
734struct 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 */
755struct 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 */
770struct 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 */
786struct 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 */
814struct 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 */
831struct 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 */
848struct 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 */
867struct 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 */
916struct 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 */
1044struct 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 */
1052struct 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 */
1079struct 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 */
1113struct 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 */
1122struct 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 */
1145struct 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 */
1161struct 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 */
1171struct 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 */
1181struct 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 */
1191struct 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 */
1207struct 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 */
1220struct 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 */
1235struct 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 */
1250struct 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
1260struct 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 */
1290struct 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 */
1463struct 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 */
1480struct 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 */
1493struct 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 */
1504struct 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 */
1518struct 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 */
1530struct 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 */
1542struct 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 */
1559struct 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 */
1570struct 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 */
1584struct 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/aarch64-macos-gnu/mach/arm/_structs.h created+645
......@@ -0,0 +1,645 @@
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/*
29 * @OSF_COPYRIGHT@
30 */
31#ifndef _MACH_ARM__STRUCTS_H_
32#define _MACH_ARM__STRUCTS_H_
33
34#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
35#include <machine/types.h> /* __uint32_t */
36
37#if __DARWIN_UNIX03
38#define _STRUCT_ARM_EXCEPTION_STATE struct __darwin_arm_exception_state
39_STRUCT_ARM_EXCEPTION_STATE
40{
41 __uint32_t __exception; /* number of arm exception taken */
42 __uint32_t __fsr; /* Fault status */
43 __uint32_t __far; /* Virtual Fault Address */
44};
45#else /* !__DARWIN_UNIX03 */
46#define _STRUCT_ARM_EXCEPTION_STATE struct arm_exception_state
47_STRUCT_ARM_EXCEPTION_STATE
48{
49 __uint32_t exception; /* number of arm exception taken */
50 __uint32_t fsr; /* Fault status */
51 __uint32_t far; /* Virtual Fault Address */
52};
53#endif /* __DARWIN_UNIX03 */
54
55#if __DARWIN_UNIX03
56#define _STRUCT_ARM_EXCEPTION_STATE64 struct __darwin_arm_exception_state64
57_STRUCT_ARM_EXCEPTION_STATE64
58{
59 __uint64_t __far; /* Virtual Fault Address */
60 __uint32_t __esr; /* Exception syndrome */
61 __uint32_t __exception; /* number of arm exception taken */
62};
63#else /* !__DARWIN_UNIX03 */
64#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
65_STRUCT_ARM_EXCEPTION_STATE64
66{
67 __uint64_t far; /* Virtual Fault Address */
68 __uint32_t esr; /* Exception syndrome */
69 __uint32_t exception; /* number of arm exception taken */
70};
71#endif /* __DARWIN_UNIX03 */
72
73#if __DARWIN_UNIX03
74#define _STRUCT_ARM_THREAD_STATE struct __darwin_arm_thread_state
75_STRUCT_ARM_THREAD_STATE
76{
77 __uint32_t __r[13]; /* General purpose register r0-r12 */
78 __uint32_t __sp; /* Stack pointer r13 */
79 __uint32_t __lr; /* Link register r14 */
80 __uint32_t __pc; /* Program counter r15 */
81 __uint32_t __cpsr; /* Current program status register */
82};
83#else /* !__DARWIN_UNIX03 */
84#define _STRUCT_ARM_THREAD_STATE struct arm_thread_state
85_STRUCT_ARM_THREAD_STATE
86{
87 __uint32_t r[13]; /* General purpose register r0-r12 */
88 __uint32_t sp; /* Stack pointer r13 */
89 __uint32_t lr; /* Link register r14 */
90 __uint32_t pc; /* Program counter r15 */
91 __uint32_t cpsr; /* Current program status register */
92};
93#endif /* __DARWIN_UNIX03 */
94
95
96/*
97 * By default, the pointer fields in the arm_thread_state64_t structure are
98 * opaque on the arm64e architecture and require the use of accessor macros.
99 * This mode can also be enabled on the arm64 architecture by building with
100 * -D__DARWIN_OPAQUE_ARM_THREAD_STATE64=1.
101 */
102#if defined(__arm64__) && defined(__LP64__)
103
104#if __has_feature(ptrauth_calls)
105#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 1
106#define __DARWIN_PTRAUTH_ARM_THREAD_STATE64 1
107#endif /* __has_feature(ptrauth_calls) */
108
109#ifndef __DARWIN_OPAQUE_ARM_THREAD_STATE64
110#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
111#endif
112
113#else /* defined(__arm64__) && defined(__LP64__) */
114
115#undef __DARWIN_OPAQUE_ARM_THREAD_STATE64
116#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
117
118#endif /* defined(__arm64__) && defined(__LP64__) */
119
120#if __DARWIN_UNIX03
121#define _STRUCT_ARM_THREAD_STATE64 struct __darwin_arm_thread_state64
122#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
123_STRUCT_ARM_THREAD_STATE64
124{
125 __uint64_t __x[29]; /* General purpose registers x0-x28 */
126 void* __opaque_fp; /* Frame pointer x29 */
127 void* __opaque_lr; /* Link register x30 */
128 void* __opaque_sp; /* Stack pointer x31 */
129 void* __opaque_pc; /* Program counter */
130 __uint32_t __cpsr; /* Current program status register */
131 __uint32_t __opaque_flags; /* Flags describing structure format */
132};
133#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
134_STRUCT_ARM_THREAD_STATE64
135{
136 __uint64_t __x[29]; /* General purpose registers x0-x28 */
137 __uint64_t __fp; /* Frame pointer x29 */
138 __uint64_t __lr; /* Link register x30 */
139 __uint64_t __sp; /* Stack pointer x31 */
140 __uint64_t __pc; /* Program counter */
141 __uint32_t __cpsr; /* Current program status register */
142 __uint32_t __pad; /* Same size for 32-bit or 64-bit clients */
143};
144#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
145#else /* !__DARWIN_UNIX03 */
146#define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64
147#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
148_STRUCT_ARM_THREAD_STATE64
149{
150 __uint64_t x[29]; /* General purpose registers x0-x28 */
151 void* __opaque_fp; /* Frame pointer x29 */
152 void* __opaque_lr; /* Link register x30 */
153 void* __opaque_sp; /* Stack pointer x31 */
154 void* __opaque_pc; /* Program counter */
155 __uint32_t cpsr; /* Current program status register */
156 __uint32_t __opaque_flags; /* Flags describing structure format */
157};
158#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
159_STRUCT_ARM_THREAD_STATE64
160{
161 __uint64_t x[29]; /* General purpose registers x0-x28 */
162 __uint64_t fp; /* Frame pointer x29 */
163 __uint64_t lr; /* Link register x30 */
164 __uint64_t sp; /* Stack pointer x31 */
165 __uint64_t pc; /* Program counter */
166 __uint32_t cpsr; /* Current program status register */
167 __uint32_t __pad; /* Same size for 32-bit or 64-bit clients */
168};
169#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
170#endif /* __DARWIN_UNIX03 */
171
172#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
173
174/* Accessor macros for arm_thread_state64_t pointer fields */
175
176#if __has_feature(ptrauth_calls) && defined(__LP64__)
177#include <ptrauth.h>
178
179#if !__DARWIN_OPAQUE_ARM_THREAD_STATE64 || !__DARWIN_PTRAUTH_ARM_THREAD_STATE64
180#error "Invalid configuration"
181#endif
182
183#define __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH 0x1
184#define __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR 0x2
185
186/* Return pc field of arm_thread_state64_t as a data pointer value */
187#define __darwin_arm_thread_state64_get_pc(ts) \
188 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
189 (uintptr_t)(__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
190 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
191 ptrauth_auth_data(__tsp->__opaque_pc, \
192 ptrauth_key_process_independent_code, \
193 ptrauth_string_discriminator("pc")) : __tsp->__opaque_pc); })
194/* Return pc field of arm_thread_state64_t as a function pointer. May return
195 * NULL if a valid function pointer cannot be constructed, the caller should
196 * fall back to the __darwin_arm_thread_state64_get_pc() macro in that case. */
197#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
198 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
199 (__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
200 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
201 ptrauth_auth_function(__tsp->__opaque_pc, \
202 ptrauth_key_process_independent_code, \
203 ptrauth_string_discriminator("pc")) : NULL); })
204/* Set pc field of arm_thread_state64_t to a function pointer */
205#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
206 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
207 __typeof__(fptr) __f = (fptr); __tsp->__opaque_pc = \
208 (__f ? (!(__tsp->__opaque_flags & \
209 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
210 ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
211 ptrauth_key_process_independent_code, \
212 ptrauth_string_discriminator("pc")) : ptrauth_auth_data(__f, \
213 ptrauth_key_function_pointer, 0)) : __f); })
214/* Return lr field of arm_thread_state64_t as a data pointer value */
215#define __darwin_arm_thread_state64_get_lr(ts) \
216 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
217 (uintptr_t)(__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
218 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
219 __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
220 ptrauth_auth_data(__tsp->__opaque_lr, \
221 ptrauth_key_process_independent_code, \
222 ptrauth_string_discriminator("lr")) : __tsp->__opaque_lr); })
223/* Return lr field of arm_thread_state64_t as a function pointer. May return
224 * NULL if a valid function pointer cannot be constructed, the caller should
225 * fall back to the __darwin_arm_thread_state64_get_lr() macro in that case. */
226#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
227 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
228 (__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
229 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
230 __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
231 ptrauth_auth_function(__tsp->__opaque_lr, \
232 ptrauth_key_process_independent_code, \
233 ptrauth_string_discriminator("lr")) : NULL); })
234/* Set lr field of arm_thread_state64_t to a function pointer */
235#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
236 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
237 __typeof__(fptr) __f = (fptr); __tsp->__opaque_lr = \
238 (__f ? (!(__tsp->__opaque_flags & \
239 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? (__tsp->__opaque_flags \
240 &= ~__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR , \
241 ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
242 ptrauth_key_process_independent_code, \
243 ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
244 ptrauth_key_function_pointer, 0)) : __f); })
245/* Return sp field of arm_thread_state64_t as a data pointer value */
246#define __darwin_arm_thread_state64_get_sp(ts) \
247 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
248 (uintptr_t)(__tsp->__opaque_sp && !(__tsp->__opaque_flags & \
249 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
250 ptrauth_auth_data(__tsp->__opaque_sp, \
251 ptrauth_key_process_independent_data, \
252 ptrauth_string_discriminator("sp")) : __tsp->__opaque_sp); })
253/* Set sp field of arm_thread_state64_t to a data pointer value */
254#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
255 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
256 void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_sp = \
257 (__p && !(__tsp->__opaque_flags & \
258 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
259 ptrauth_sign_unauthenticated(__p, \
260 ptrauth_key_process_independent_data, \
261 ptrauth_string_discriminator("sp")) : __p); })
262/* Return fp field of arm_thread_state64_t as a data pointer value */
263#define __darwin_arm_thread_state64_get_fp(ts) \
264 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
265 (uintptr_t)(__tsp->__opaque_fp && !(__tsp->__opaque_flags & \
266 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
267 ptrauth_auth_data(__tsp->__opaque_fp, \
268 ptrauth_key_process_independent_data, \
269 ptrauth_string_discriminator("fp")) : __tsp->__opaque_fp); })
270/* Set fp field of arm_thread_state64_t to a data pointer value */
271#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
272 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
273 void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_fp = \
274 (__p && !(__tsp->__opaque_flags & \
275 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
276 ptrauth_sign_unauthenticated(__p, \
277 ptrauth_key_process_independent_data, \
278 ptrauth_string_discriminator("fp")) : __p); })
279
280/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
281#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
282 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
283 __tsp->__opaque_pc = ((__tsp->__opaque_flags & \
284 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_pc : \
285 ptrauth_strip(__tsp->__opaque_pc, ptrauth_key_process_independent_code)); \
286 __tsp->__opaque_lr = ((__tsp->__opaque_flags & \
287 (__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
288 __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? __tsp->__opaque_lr : \
289 ptrauth_strip(__tsp->__opaque_lr, ptrauth_key_process_independent_code)); \
290 __tsp->__opaque_sp = ((__tsp->__opaque_flags & \
291 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_sp : \
292 ptrauth_strip(__tsp->__opaque_sp, ptrauth_key_process_independent_data)); \
293 __tsp->__opaque_fp = ((__tsp->__opaque_flags & \
294 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_fp : \
295 ptrauth_strip(__tsp->__opaque_fp, ptrauth_key_process_independent_data)); \
296 __tsp->__opaque_flags |= \
297 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH; })
298
299#else /* __has_feature(ptrauth_calls) && defined(__LP64__) */
300
301#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
302
303#ifndef __LP64__
304#error "Invalid configuration"
305#endif
306
307/* Return pc field of arm_thread_state64_t as a data pointer value */
308#define __darwin_arm_thread_state64_get_pc(ts) \
309 ((uintptr_t)((ts).__opaque_pc))
310/* Return pc field of arm_thread_state64_t as a function pointer */
311#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
312 ((ts).__opaque_pc)
313/* Set pc field of arm_thread_state64_t to a function pointer */
314#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
315 ((ts).__opaque_pc = (fptr))
316/* Return lr field of arm_thread_state64_t as a data pointer value */
317#define __darwin_arm_thread_state64_get_lr(ts) \
318 ((uintptr_t)((ts).__opaque_lr))
319/* Return lr field of arm_thread_state64_t as a function pointer */
320#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
321 ((ts).__opaque_lr)
322/* Set lr field of arm_thread_state64_t to a function pointer */
323#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
324 ((ts).__opaque_lr = (fptr))
325/* Return sp field of arm_thread_state64_t as a data pointer value */
326#define __darwin_arm_thread_state64_get_sp(ts) \
327 ((uintptr_t)((ts).__opaque_sp))
328/* Set sp field of arm_thread_state64_t to a data pointer value */
329#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
330 ((ts).__opaque_sp = (void*)(uintptr_t)(ptr))
331/* Return fp field of arm_thread_state64_t as a data pointer value */
332#define __darwin_arm_thread_state64_get_fp(ts) \
333 ((uintptr_t)((ts).__opaque_fp))
334/* Set fp field of arm_thread_state64_t to a data pointer value */
335#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
336 ((ts).__opaque_fp = (void*)(uintptr_t)(ptr))
337/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
338#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
339 (void)(ts)
340
341#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
342#if __DARWIN_UNIX03
343
344/* Return pc field of arm_thread_state64_t as a data pointer value */
345#define __darwin_arm_thread_state64_get_pc(ts) \
346 ((ts).__pc)
347/* Return pc field of arm_thread_state64_t as a function pointer */
348#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
349 ((void*)(uintptr_t)((ts).__pc))
350/* Set pc field of arm_thread_state64_t to a function pointer */
351#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
352 ((ts).__pc = (uintptr_t)(fptr))
353/* Return lr field of arm_thread_state64_t as a data pointer value */
354#define __darwin_arm_thread_state64_get_lr(ts) \
355 ((ts).__lr)
356/* Return lr field of arm_thread_state64_t as a function pointer */
357#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
358 ((void*)(uintptr_t)((ts).__lr))
359/* Set lr field of arm_thread_state64_t to a function pointer */
360#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
361 ((ts).__lr = (uintptr_t)(fptr))
362/* Return sp field of arm_thread_state64_t as a data pointer value */
363#define __darwin_arm_thread_state64_get_sp(ts) \
364 ((ts).__sp)
365/* Set sp field of arm_thread_state64_t to a data pointer value */
366#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
367 ((ts).__sp = (uintptr_t)(ptr))
368/* Return fp field of arm_thread_state64_t as a data pointer value */
369#define __darwin_arm_thread_state64_get_fp(ts) \
370 ((ts).__fp)
371/* Set fp field of arm_thread_state64_t to a data pointer value */
372#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
373 ((ts).__fp = (uintptr_t)(ptr))
374/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
375#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
376 (void)(ts)
377
378#else /* __DARWIN_UNIX03 */
379
380/* Return pc field of arm_thread_state64_t as a data pointer value */
381#define __darwin_arm_thread_state64_get_pc(ts) \
382 ((ts).pc)
383/* Return pc field of arm_thread_state64_t as a function pointer */
384#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
385 ((void*)(uintptr_t)((ts).pc))
386/* Set pc field of arm_thread_state64_t to a function pointer */
387#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
388 ((ts).pc = (uintptr_t)(fptr))
389/* Return lr field of arm_thread_state64_t as a data pointer value */
390#define __darwin_arm_thread_state64_get_lr(ts) \
391 ((ts).lr)
392/* Return lr field of arm_thread_state64_t as a function pointer */
393#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
394 ((void*)(uintptr_t)((ts).lr))
395/* Set lr field of arm_thread_state64_t to a function pointer */
396#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
397 ((ts).lr = (uintptr_t)(fptr))
398/* Return sp field of arm_thread_state64_t as a data pointer value */
399#define __darwin_arm_thread_state64_get_sp(ts) \
400 ((ts).sp)
401/* Set sp field of arm_thread_state64_t to a data pointer value */
402#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
403 ((ts).sp = (uintptr_t)(ptr))
404/* Return fp field of arm_thread_state64_t as a data pointer value */
405#define __darwin_arm_thread_state64_get_fp(ts) \
406 ((ts).fp)
407/* Set fp field of arm_thread_state64_t to a data pointer value */
408#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
409 ((ts).fp = (uintptr_t)(ptr))
410/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
411#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
412 (void)(ts)
413
414#endif /* __DARWIN_UNIX03 */
415#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
416
417#endif /* __has_feature(ptrauth_calls) && defined(__LP64__) */
418#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
419
420#if __DARWIN_UNIX03
421#define _STRUCT_ARM_VFP_STATE struct __darwin_arm_vfp_state
422_STRUCT_ARM_VFP_STATE
423{
424 __uint32_t __r[64];
425 __uint32_t __fpscr;
426};
427#else /* !__DARWIN_UNIX03 */
428#define _STRUCT_ARM_VFP_STATE struct arm_vfp_state
429_STRUCT_ARM_VFP_STATE
430{
431 __uint32_t r[64];
432 __uint32_t fpscr;
433};
434#endif /* __DARWIN_UNIX03 */
435
436#if __DARWIN_UNIX03
437#define _STRUCT_ARM_NEON_STATE64 struct __darwin_arm_neon_state64
438#define _STRUCT_ARM_NEON_STATE struct __darwin_arm_neon_state
439
440#if defined(__arm64__)
441_STRUCT_ARM_NEON_STATE64
442{
443 __uint128_t __v[32];
444 __uint32_t __fpsr;
445 __uint32_t __fpcr;
446};
447
448_STRUCT_ARM_NEON_STATE
449{
450 __uint128_t __v[16];
451 __uint32_t __fpsr;
452 __uint32_t __fpcr;
453};
454#elif defined(__arm__)
455/*
456 * No 128-bit intrinsic for ARM; leave it opaque for now.
457 */
458_STRUCT_ARM_NEON_STATE64
459{
460 char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
461} __attribute__((aligned(16)));
462
463_STRUCT_ARM_NEON_STATE
464{
465 char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
466} __attribute__((aligned(16)));
467
468#else
469#error Unknown architecture.
470#endif
471
472#else /* !__DARWIN_UNIX03 */
473#define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64
474#define _STRUCT_ARM_NEON_STATE struct arm_neon_state
475
476#if defined(__arm64__)
477_STRUCT_ARM_NEON_STATE64
478{
479 __uint128_t q[32];
480 uint32_t fpsr;
481 uint32_t fpcr;
482};
483
484_STRUCT_ARM_NEON_STATE
485{
486 __uint128_t q[16];
487 uint32_t fpsr;
488 uint32_t fpcr;
489};
490#elif defined(__arm__)
491/*
492 * No 128-bit intrinsic for ARM; leave it opaque for now.
493 */
494_STRUCT_ARM_NEON_STATE64
495{
496 char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
497} __attribute__((aligned(16)));
498
499_STRUCT_ARM_NEON_STATE
500{
501 char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
502} __attribute__((aligned(16)));
503
504#else
505#error Unknown architecture.
506#endif
507
508#endif /* __DARWIN_UNIX03 */
509
510#if __DARWIN_UNIX03
511#define _STRUCT_ARM_AMX_STATE_V1 struct __darwin_arm_amx_state_v1
512_STRUCT_ARM_AMX_STATE_V1
513{
514 __uint8_t __x[8][64]; /* 8 64-byte registers */
515 __uint8_t __y[8][64]; /* 8 64-byte registers */
516 __uint8_t __z[64][64]; /* 64 64-byte registers in an M-by-N matrix */
517 __uint64_t __amx_state_t_el1; /* AMX_STATE_T_EL1 value */
518} __attribute__((aligned(64)));
519#else /* !__DARWIN_UNIX03 */
520#define _STRUCT_ARM_AMX_STATE_V1 struct arm_amx_state_v1
521_STRUCT_ARM_AMX_STATE_V1
522{
523 __uint8_t x[8][64]; /* 8 64-byte registers */
524 __uint8_t y[8][64]; /* 8 64-byte registers */
525 __uint8_t z[64][64]; /* 64 64-byte registers in an M-by-N matrix */
526 __uint64_t amx_state_t_el1; /* AMX_STATE_T_EL1 value. */
527} __attribute__((aligned(64)));
528#endif /* __DARWIN_UNIX03 */
529
530#define _STRUCT_ARM_PAGEIN_STATE struct __arm_pagein_state
531_STRUCT_ARM_PAGEIN_STATE
532{
533 int __pagein_error;
534};
535
536/*
537 * Debug State
538 */
539#if defined(__arm__)
540/* Old-fashioned debug state is only for ARM */
541
542#if __DARWIN_UNIX03
543#define _STRUCT_ARM_DEBUG_STATE struct __darwin_arm_debug_state
544_STRUCT_ARM_DEBUG_STATE
545{
546 __uint32_t __bvr[16];
547 __uint32_t __bcr[16];
548 __uint32_t __wvr[16];
549 __uint32_t __wcr[16];
550};
551#else /* !__DARWIN_UNIX03 */
552#define _STRUCT_ARM_DEBUG_STATE struct arm_debug_state
553_STRUCT_ARM_DEBUG_STATE
554{
555 __uint32_t bvr[16];
556 __uint32_t bcr[16];
557 __uint32_t wvr[16];
558 __uint32_t wcr[16];
559};
560#endif /* __DARWIN_UNIX03 */
561
562#elif defined(__arm64__)
563
564/* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */
565
566#if __DARWIN_UNIX03
567#define _STRUCT_ARM_LEGACY_DEBUG_STATE struct __arm_legacy_debug_state
568_STRUCT_ARM_LEGACY_DEBUG_STATE
569{
570 __uint32_t __bvr[16];
571 __uint32_t __bcr[16];
572 __uint32_t __wvr[16];
573 __uint32_t __wcr[16];
574};
575#else /* __DARWIN_UNIX03 */
576#define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state
577_STRUCT_ARM_LEGACY_DEBUG_STATE
578{
579 __uint32_t bvr[16];
580 __uint32_t bcr[16];
581 __uint32_t wvr[16];
582 __uint32_t wcr[16];
583};
584#endif /* __DARWIN_UNIX03 */
585#else
586#error unknown architecture
587#endif
588
589#if __DARWIN_UNIX03
590#define _STRUCT_ARM_DEBUG_STATE32 struct __darwin_arm_debug_state32
591_STRUCT_ARM_DEBUG_STATE32
592{
593 __uint32_t __bvr[16];
594 __uint32_t __bcr[16];
595 __uint32_t __wvr[16];
596 __uint32_t __wcr[16];
597 __uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
598};
599
600#define _STRUCT_ARM_DEBUG_STATE64 struct __darwin_arm_debug_state64
601_STRUCT_ARM_DEBUG_STATE64
602{
603 __uint64_t __bvr[16];
604 __uint64_t __bcr[16];
605 __uint64_t __wvr[16];
606 __uint64_t __wcr[16];
607 __uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
608};
609#else /* !__DARWIN_UNIX03 */
610#define _STRUCT_ARM_DEBUG_STATE32 struct arm_debug_state32
611_STRUCT_ARM_DEBUG_STATE32
612{
613 __uint32_t bvr[16];
614 __uint32_t bcr[16];
615 __uint32_t wvr[16];
616 __uint32_t wcr[16];
617 __uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
618};
619
620#define _STRUCT_ARM_DEBUG_STATE64 struct arm_debug_state64
621_STRUCT_ARM_DEBUG_STATE64
622{
623 __uint64_t bvr[16];
624 __uint64_t bcr[16];
625 __uint64_t wvr[16];
626 __uint64_t wcr[16];
627 __uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
628};
629#endif /* __DARWIN_UNIX03 */
630
631#if __DARWIN_UNIX03
632#define _STRUCT_ARM_CPMU_STATE64 struct __darwin_arm_cpmu_state64
633_STRUCT_ARM_CPMU_STATE64
634{
635 __uint64_t __ctrs[16];
636};
637#else /* __DARWIN_UNIX03 */
638#define _STRUCT_ARM_CPMU_STATE64 struct arm_cpmu_state64
639_STRUCT_ARM_CPMU_STATE64
640{
641 __uint64_t ctrs[16];
642};
643#endif /* !__DARWIN_UNIX03 */
644
645#endif /* _MACH_ARM__STRUCTS_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/boolean.h created+70
......@@ -0,0 +1,70 @@
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 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 ARM.
63 */
64
65#ifndef _MACH_ARM_BOOLEAN_H_
66#define _MACH_ARM_BOOLEAN_H_
67
68typedef int boolean_t;
69
70#endif /* _MACH_ARM_BOOLEAN_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/exception.h created+79
......@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 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_ARM_EXCEPTION_H_
30#define _MACH_ARM_EXCEPTION_H_
31
32#define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */
33
34#define EXC_MASK_MACHINE 0
35
36#define EXCEPTION_CODE_MAX 2 /* code and subcode */
37
38
39/*
40 * Trap numbers as defined by the hardware exception vectors.
41 */
42
43/*
44 * EXC_BAD_INSTRUCTION
45 */
46
47#define EXC_ARM_UNDEFINED 1 /* Undefined */
48
49/*
50 * EXC_ARITHMETIC
51 */
52
53#define EXC_ARM_FP_UNDEFINED 0 /* Undefined Floating Point Exception */
54#define EXC_ARM_FP_IO 1 /* Invalid Floating Point Operation */
55#define EXC_ARM_FP_DZ 2 /* Floating Point Divide by Zero */
56#define EXC_ARM_FP_OF 3 /* Floating Point Overflow */
57#define EXC_ARM_FP_UF 4 /* Floating Point Underflow */
58#define EXC_ARM_FP_IX 5 /* Inexact Floating Point Result */
59#define EXC_ARM_FP_ID 6 /* Floating Point Denormal Input */
60
61/*
62 * EXC_BAD_ACCESS
63 * Note: do not conflict with kern_return_t values returned by vm_fault
64 */
65
66#define EXC_ARM_DA_ALIGN 0x101 /* Alignment Fault */
67#define EXC_ARM_DA_DEBUG 0x102 /* Debug (watch/break) Fault */
68#define EXC_ARM_SP_ALIGN 0x103 /* SP Alignment Fault */
69#define EXC_ARM_SWP 0x104 /* SWP instruction */
70#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
71
72/*
73 * EXC_BREAKPOINT
74 */
75
76#define EXC_ARM_BREAKPOINT 1 /* breakpoint trap */
77
78
79#endif /* _MACH_ARM_EXCEPTION_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/kern_return.h created+74
......@@ -0,0 +1,74 @@
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 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_ARM_KERN_RETURN_H_
68#define _MACH_ARM_KERN_RETURN_H_
69
70#ifndef ASSEMBLER
71typedef int kern_return_t;
72#endif /* ASSEMBLER */
73
74#endif /* _MACH_ARM_KERN_RETURN_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/processor_info.h created+72
......@@ -0,0 +1,72 @@
1/*
2 * Copyright (c) 2007-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 _MACH_ARM_PROCESSOR_INFO_H_
30#define _MACH_ARM_PROCESSOR_INFO_H_
31
32#define PROCESSOR_CPU_STAT 0x10000003 /* Low-level CPU statistics */
33#define PROCESSOR_CPU_STAT64 0x10000004 /* Low-level CPU statistics, in full 64-bit */
34
35#include <stdint.h> /* uint32_t, uint64_t */
36
37struct processor_cpu_stat {
38 uint32_t irq_ex_cnt;
39 uint32_t ipi_cnt;
40 uint32_t timer_cnt;
41 uint32_t undef_ex_cnt;
42 uint32_t unaligned_cnt;
43 uint32_t vfp_cnt;
44 uint32_t vfp_shortv_cnt;
45 uint32_t data_ex_cnt;
46 uint32_t instr_ex_cnt;
47};
48
49typedef struct processor_cpu_stat processor_cpu_stat_data_t;
50typedef struct processor_cpu_stat *processor_cpu_stat_t;
51#define PROCESSOR_CPU_STAT_COUNT ((mach_msg_type_number_t) \
52 (sizeof(processor_cpu_stat_data_t) / sizeof(natural_t)))
53
54struct processor_cpu_stat64 {
55 uint64_t irq_ex_cnt;
56 uint64_t ipi_cnt;
57 uint64_t timer_cnt;
58 uint64_t undef_ex_cnt;
59 uint64_t unaligned_cnt;
60 uint64_t vfp_cnt;
61 uint64_t vfp_shortv_cnt;
62 uint64_t data_ex_cnt;
63 uint64_t instr_ex_cnt;
64 uint64_t pmi_cnt;
65} __attribute__((packed, aligned(4)));
66
67typedef struct processor_cpu_stat64 processor_cpu_stat64_data_t;
68typedef struct processor_cpu_stat64 *processor_cpu_stat64_t;
69#define PROCESSOR_CPU_STAT64_COUNT ((mach_msg_type_number_t) \
70 (sizeof(processor_cpu_stat64_data_t) / sizeof(integer_t)))
71
72#endif /* _MACH_ARM_PROCESSOR_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/rpc.h created+35
......@@ -0,0 +1,35 @@
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#ifndef _MACH_ARM_RPC_H_
33#define _MACH_ARM_RPC_H_
34
35#endif /* _MACH_ARM_RPC_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/thread_state.h created+44
......@@ -0,0 +1,44 @@
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#ifndef _MACH_ARM_THREAD_STATE_H_
33#define _MACH_ARM_THREAD_STATE_H_
34
35/* Size of maximum exported thread state in words */
36#define ARM_THREAD_STATE_MAX (1296) /* Size of biggest state possible */
37
38#if defined (__arm__) || defined(__arm64__)
39#define THREAD_STATE_MAX ARM_THREAD_STATE_MAX
40#else
41#error Unsupported arch
42#endif
43
44#endif /* _MACH_ARM_THREAD_STATE_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/thread_status.h created+249
......@@ -0,0 +1,249 @@
1/*
2 * Copyright (c) 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 * FILE_ID: thread_status.h
30 */
31
32
33#ifndef _ARM_THREAD_STATUS_H_
34#define _ARM_THREAD_STATUS_H_
35
36#include <mach/machine/_structs.h>
37#include <mach/message.h>
38#include <mach/vm_types.h>
39#include <mach/arm/thread_state.h>
40
41/*
42 * Support for determining the state of a thread
43 */
44
45
46/*
47 * Flavors
48 */
49
50#define ARM_THREAD_STATE 1
51#define ARM_UNIFIED_THREAD_STATE ARM_THREAD_STATE
52#define ARM_VFP_STATE 2
53#define ARM_EXCEPTION_STATE 3
54#define ARM_DEBUG_STATE 4 /* pre-armv8 */
55#define THREAD_STATE_NONE 5
56#define ARM_THREAD_STATE64 6
57#define ARM_EXCEPTION_STATE64 7
58// ARM_THREAD_STATE_LAST 8 /* legacy */
59#define ARM_THREAD_STATE32 9
60
61
62/* API */
63#define ARM_DEBUG_STATE32 14
64#define ARM_DEBUG_STATE64 15
65#define ARM_NEON_STATE 16
66#define ARM_NEON_STATE64 17
67#define ARM_CPMU_STATE64 18
68
69
70/* API */
71#define ARM_AMX_STATE 24
72#define ARM_AMX_STATE_V1 25
73#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) \
74 ((_flavor_) == ARM_AMX_STATE_V1)
75#define ARM_PAGEIN_STATE 27
76
77#define VALID_THREAD_STATE_FLAVOR(x) \
78 ((x == ARM_THREAD_STATE) || \
79 (x == ARM_VFP_STATE) || \
80 (x == ARM_EXCEPTION_STATE) || \
81 (x == ARM_DEBUG_STATE) || \
82 (x == THREAD_STATE_NONE) || \
83 (x == ARM_THREAD_STATE32) || \
84 (x == ARM_THREAD_STATE64) || \
85 (x == ARM_EXCEPTION_STATE64) || \
86 (x == ARM_NEON_STATE) || \
87 (x == ARM_NEON_STATE64) || \
88 (x == ARM_DEBUG_STATE32) || \
89 (x == ARM_DEBUG_STATE64) || \
90 (x == ARM_PAGEIN_STATE) || \
91 (ARM_STATE_FLAVOR_IS_OTHER_VALID(x)))
92
93struct arm_state_hdr {
94 uint32_t flavor;
95 uint32_t count;
96};
97typedef struct arm_state_hdr arm_state_hdr_t;
98
99typedef _STRUCT_ARM_THREAD_STATE arm_thread_state_t;
100typedef _STRUCT_ARM_THREAD_STATE arm_thread_state32_t;
101typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
102
103#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
104
105/* Accessor macros for arm_thread_state64_t pointer fields */
106
107/* Return pc field of arm_thread_state64_t as a data pointer value */
108#define arm_thread_state64_get_pc(ts) \
109 __darwin_arm_thread_state64_get_pc(ts)
110/* Return pc field of arm_thread_state64_t as a function pointer. May return
111 * NULL if a valid function pointer cannot be constructed, the caller should
112 * fall back to the arm_thread_state64_get_pc() macro in that case. */
113#define arm_thread_state64_get_pc_fptr(ts) \
114 __darwin_arm_thread_state64_get_pc_fptr(ts)
115/* Set pc field of arm_thread_state64_t to a function pointer */
116#define arm_thread_state64_set_pc_fptr(ts, fptr) \
117 __darwin_arm_thread_state64_set_pc_fptr(ts, fptr)
118/* Return lr field of arm_thread_state64_t as a data pointer value */
119#define arm_thread_state64_get_lr(ts) \
120 __darwin_arm_thread_state64_get_lr(ts)
121/* Return lr field of arm_thread_state64_t as a function pointer. May return
122 * NULL if a valid function pointer cannot be constructed, the caller should
123 * fall back to the arm_thread_state64_get_lr() macro in that case. */
124#define arm_thread_state64_get_lr_fptr(ts) \
125 __darwin_arm_thread_state64_get_lr_fptr(ts)
126/* Set lr field of arm_thread_state64_t to a function pointer */
127#define arm_thread_state64_set_lr_fptr(ts, fptr) \
128 __darwin_arm_thread_state64_set_lr_fptr(ts, fptr)
129/* Return sp field of arm_thread_state64_t as a data pointer value */
130#define arm_thread_state64_get_sp(ts) \
131 __darwin_arm_thread_state64_get_sp(ts)
132/* Set sp field of arm_thread_state64_t to a data pointer value */
133#define arm_thread_state64_set_sp(ts, ptr) \
134 __darwin_arm_thread_state64_set_sp(ts, ptr)
135/* Return fp field of arm_thread_state64_t as a data pointer value */
136#define arm_thread_state64_get_fp(ts) \
137 __darwin_arm_thread_state64_get_fp(ts)
138/* Set fp field of arm_thread_state64_t to a data pointer value */
139#define arm_thread_state64_set_fp(ts, ptr) \
140 __darwin_arm_thread_state64_set_fp(ts, ptr)
141/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
142#define arm_thread_state64_ptrauth_strip(ts) \
143 __darwin_arm_thread_state64_ptrauth_strip(ts)
144
145#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
146
147struct arm_unified_thread_state {
148 arm_state_hdr_t ash;
149 union {
150 arm_thread_state32_t ts_32;
151 arm_thread_state64_t ts_64;
152 } uts;
153};
154#define ts_32 uts.ts_32
155#define ts_64 uts.ts_64
156typedef struct arm_unified_thread_state arm_unified_thread_state_t;
157
158#define ARM_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
159 (sizeof (arm_thread_state_t)/sizeof(uint32_t)))
160#define ARM_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \
161 (sizeof (arm_thread_state32_t)/sizeof(uint32_t)))
162#define ARM_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \
163 (sizeof (arm_thread_state64_t)/sizeof(uint32_t)))
164#define ARM_UNIFIED_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
165 (sizeof (arm_unified_thread_state_t)/sizeof(uint32_t)))
166
167
168typedef _STRUCT_ARM_VFP_STATE arm_vfp_state_t;
169typedef _STRUCT_ARM_NEON_STATE arm_neon_state_t;
170typedef _STRUCT_ARM_NEON_STATE arm_neon_state32_t;
171typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
172
173typedef _STRUCT_ARM_AMX_STATE_V1 arm_amx_state_v1_t;
174
175typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
176typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
177typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;
178
179typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;
180typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;
181
182typedef _STRUCT_ARM_PAGEIN_STATE arm_pagein_state_t;
183
184/*
185 * Otherwise not ARM64 kernel and we must preserve legacy ARM definitions of
186 * arm_debug_state for binary compatability of userland consumers of this file.
187 */
188#if defined(__arm__)
189typedef _STRUCT_ARM_DEBUG_STATE arm_debug_state_t;
190#elif defined(__arm64__)
191typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
192#else /* defined(__arm__) */
193#error Undefined architecture
194#endif /* defined(__arm__) */
195
196#define ARM_VFP_STATE_COUNT ((mach_msg_type_number_t) \
197 (sizeof (arm_vfp_state_t)/sizeof(uint32_t)))
198
199#define ARM_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \
200 (sizeof (arm_exception_state_t)/sizeof(uint32_t)))
201
202#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
203 (sizeof (arm_exception_state64_t)/sizeof(uint32_t)))
204
205#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
206 (sizeof (arm_debug_state_t)/sizeof(uint32_t)))
207
208#define ARM_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \
209 (sizeof (arm_debug_state32_t)/sizeof(uint32_t)))
210
211#define ARM_PAGEIN_STATE_COUNT ((mach_msg_type_number_t) \
212 (sizeof (arm_pagein_state_t)/sizeof(uint32_t)))
213
214#define ARM_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \
215 (sizeof (arm_debug_state64_t)/sizeof(uint32_t)))
216
217#define ARM_NEON_STATE_COUNT ((mach_msg_type_number_t) \
218 (sizeof (arm_neon_state_t)/sizeof(uint32_t)))
219
220#define ARM_NEON_STATE64_COUNT ((mach_msg_type_number_t) \
221 (sizeof (arm_neon_state64_t)/sizeof(uint32_t)))
222
223#define MACHINE_THREAD_STATE ARM_THREAD_STATE
224#define MACHINE_THREAD_STATE_COUNT ARM_UNIFIED_THREAD_STATE_COUNT
225
226
227struct arm_amx_state {
228 arm_state_hdr_t ash;
229 union {
230 arm_amx_state_v1_t as_v1;
231 } uas;
232};
233#define as_v1 uas.as_v1
234typedef struct arm_amx_state arm_amx_state_t;
235
236#define ARM_AMX_STATE_V1_COUNT ((mach_msg_type_number_t) \
237 (sizeof(arm_amx_state_v1_t)/sizeof(unsigned int)))
238
239#define ARM_AMX_STATE_COUNT ((mach_msg_type_number_t) \
240 (sizeof(arm_amx_state_t)/sizeof(unsigned int)))
241
242
243/*
244 * Largest state on this machine:
245 */
246#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX
247
248
249#endif /* _ARM_THREAD_STATUS_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/vm_param.h created+103
......@@ -0,0 +1,103 @@
1/*
2 * Copyright (c) 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 * FILE_ID: vm_param.h
30 */
31
32/*
33 * ARM machine dependent virtual memory parameters.
34 */
35
36#ifndef _MACH_ARM_VM_PARAM_H_
37#define _MACH_ARM_VM_PARAM_H_
38
39
40#if !defined (KERNEL) && !defined (__ASSEMBLER__)
41#include <mach/vm_page_size.h>
42#endif
43
44#define BYTE_SIZE 8 /* byte size in bits */
45
46
47#define PAGE_SHIFT vm_page_shift
48#define PAGE_SIZE vm_page_size
49#define PAGE_MASK vm_page_mask
50
51#define VM_PAGE_SIZE vm_page_size
52
53#define machine_ptob(x) ((x) << PAGE_SHIFT)
54
55
56#define PAGE_MAX_SHIFT 14
57#define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT)
58#define PAGE_MAX_MASK (PAGE_MAX_SIZE-1)
59
60#define PAGE_MIN_SHIFT 12
61#define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT)
62#define PAGE_MIN_MASK (PAGE_MIN_SIZE-1)
63
64#define VM_MAX_PAGE_ADDRESS MACH_VM_MAX_ADDRESS
65
66#ifndef __ASSEMBLER__
67
68
69#if defined (__arm__)
70
71#define VM_MIN_ADDRESS ((vm_address_t) 0x00000000)
72#define VM_MAX_ADDRESS ((vm_address_t) 0x80000000)
73
74/* system-wide values */
75#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
76#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_ADDRESS)
77
78#elif defined (__arm64__)
79
80#define VM_MIN_ADDRESS ((vm_address_t) 0x0000000000000000ULL)
81#define VM_MAX_ADDRESS ((vm_address_t) 0x0000000080000000ULL)
82
83/* system-wide values */
84#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL
85#define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL
86
87#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)
88#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW)
89
90
91#else /* defined(__arm64__) */
92#error architecture not supported
93#endif
94
95#define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS
96#define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS
97
98
99#endif /* !__ASSEMBLER__ */
100
101#define SWI_SYSCALL 0x80
102
103#endif /* _MACH_ARM_VM_PARAM_H_ */
lib/libc/include/aarch64-macos-gnu/mach/arm/vm_types.h created+157
......@@ -0,0 +1,157 @@
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 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. ARM version.
65 */
66
67#ifndef _MACH_ARM_VM_TYPES_H_
68#define _MACH_ARM_VM_TYPES_H_
69
70#ifndef ASSEMBLER
71
72#include <arm/_types.h>
73#include <stdint.h>
74#include <Availability.h>
75
76/*
77 * natural_t and integer_t are Mach's legacy types for machine-
78 * independent integer types (unsigned, and signed, respectively).
79 * Their original purpose was to define other types in a machine/
80 * compiler independent way.
81 *
82 * They also had an implicit "same size as pointer" characteristic
83 * to them (i.e. Mach's traditional types are very ILP32 or ILP64
84 * centric). We will likely support x86 ABIs that do not follow
85 * either ofthese models (specifically LP64). Therefore, we had to
86 * make a choice between making these types scale with pointers or stay
87 * tied to integers. Because their use is predominantly tied to
88 * to the size of an integer, we are keeping that association and
89 * breaking free from pointer size guarantees.
90 *
91 * New use of these types is discouraged.
92 */
93typedef __darwin_natural_t natural_t;
94typedef int integer_t;
95
96/*
97 * A vm_offset_t is a type-neutral pointer,
98 * e.g. an offset into a virtual memory space.
99 */
100#ifdef __LP64__
101typedef uintptr_t vm_offset_t;
102typedef uintptr_t vm_size_t;
103
104typedef uint64_t mach_vm_address_t;
105typedef uint64_t mach_vm_offset_t;
106typedef uint64_t mach_vm_size_t;
107
108typedef uint64_t vm_map_offset_t;
109typedef uint64_t vm_map_address_t;
110typedef uint64_t vm_map_size_t;
111#else
112typedef natural_t vm_offset_t;
113/*
114 * A vm_size_t is the proper type for e.g.
115 * expressing the difference between two
116 * vm_offset_t entities.
117 */
118typedef natural_t vm_size_t;
119
120/*
121 * This new type is independent of a particular vm map's
122 * implementation size - and represents appropriate types
123 * for all possible maps. This is used for interfaces
124 * where the size of the map is not known - or we don't
125 * want to have to distinguish.
126 */
127#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0)
128typedef uint32_t mach_vm_address_t;
129typedef uint32_t mach_vm_offset_t;
130typedef uint32_t mach_vm_size_t;
131#else
132typedef uint64_t mach_vm_address_t;
133typedef uint64_t mach_vm_offset_t;
134typedef uint64_t mach_vm_size_t;
135#endif
136
137typedef uint32_t vm_map_offset_t;
138typedef uint32_t vm_map_address_t;
139typedef uint32_t vm_map_size_t;
140#endif /* __LP64__ */
141
142
143typedef uint32_t vm32_offset_t;
144typedef uint32_t vm32_address_t;
145typedef uint32_t vm32_size_t;
146
147typedef vm_offset_t mach_port_context_t;
148
149
150#endif /* ASSEMBLER */
151
152/*
153 * If composing messages by hand (please do not)
154 */
155#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
156
157#endif /* _MACH_ARM_VM_TYPES_H_ */
lib/libc/include/aarch64-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/aarch64-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
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef clock_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
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_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
83mig_external
84#else
85extern
86#endif /* mig_external */
87kern_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
97mig_external
98#else
99extern
100#endif /* mig_external */
101kern_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
172union __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
227union __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/aarch64-macos-gnu/mach/clock_priv.h created+199
......@@ -0,0 +1,199 @@
1#ifndef _clock_priv_user_
2#define _clock_priv_user_
3
4/* Module clock_priv */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef clock_priv_MSG_COUNT
52#define clock_priv_MSG_COUNT 2
53#endif /* clock_priv_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach/mach_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine clock_set_time */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t clock_set_time
76(
77 clock_ctrl_t clock_ctrl,
78 mach_timespec_t new_time
79);
80
81/* Routine clock_set_attributes */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87kern_return_t clock_set_attributes
88(
89 clock_ctrl_t clock_ctrl,
90 clock_flavor_t flavor,
91 clock_attr_t clock_attr,
92 mach_msg_type_number_t clock_attrCnt
93);
94
95__END_DECLS
96
97/********************** Caution **************************/
98/* The following data types should be used to calculate */
99/* maximum message sizes only. The actual message may be */
100/* smaller, and the position of the arguments within the */
101/* message layout may vary from what is presented here. */
102/* For example, if any of the arguments are variable- */
103/* sized, and less than the maximum is sent, the data */
104/* will be packed tight in the actual message to reduce */
105/* the presence of holes. */
106/********************** Caution **************************/
107
108/* typedefs for all requests */
109
110#ifndef __Request__clock_priv_subsystem__defined
111#define __Request__clock_priv_subsystem__defined
112
113#ifdef __MigPackStructs
114#pragma pack(push, 4)
115#endif
116 typedef struct {
117 mach_msg_header_t Head;
118 NDR_record_t NDR;
119 mach_timespec_t new_time;
120 } __Request__clock_set_time_t __attribute__((unused));
121#ifdef __MigPackStructs
122#pragma pack(pop)
123#endif
124
125#ifdef __MigPackStructs
126#pragma pack(push, 4)
127#endif
128 typedef struct {
129 mach_msg_header_t Head;
130 NDR_record_t NDR;
131 clock_flavor_t flavor;
132 mach_msg_type_number_t clock_attrCnt;
133 int clock_attr[1];
134 } __Request__clock_set_attributes_t __attribute__((unused));
135#ifdef __MigPackStructs
136#pragma pack(pop)
137#endif
138#endif /* !__Request__clock_priv_subsystem__defined */
139
140/* union of all requests */
141
142#ifndef __RequestUnion__clock_priv_subsystem__defined
143#define __RequestUnion__clock_priv_subsystem__defined
144union __RequestUnion__clock_priv_subsystem {
145 __Request__clock_set_time_t Request_clock_set_time;
146 __Request__clock_set_attributes_t Request_clock_set_attributes;
147};
148#endif /* !__RequestUnion__clock_priv_subsystem__defined */
149/* typedefs for all replies */
150
151#ifndef __Reply__clock_priv_subsystem__defined
152#define __Reply__clock_priv_subsystem__defined
153
154#ifdef __MigPackStructs
155#pragma pack(push, 4)
156#endif
157 typedef struct {
158 mach_msg_header_t Head;
159 NDR_record_t NDR;
160 kern_return_t RetCode;
161 } __Reply__clock_set_time_t __attribute__((unused));
162#ifdef __MigPackStructs
163#pragma pack(pop)
164#endif
165
166#ifdef __MigPackStructs
167#pragma pack(push, 4)
168#endif
169 typedef struct {
170 mach_msg_header_t Head;
171 NDR_record_t NDR;
172 kern_return_t RetCode;
173 } __Reply__clock_set_attributes_t __attribute__((unused));
174#ifdef __MigPackStructs
175#pragma pack(pop)
176#endif
177#endif /* !__Reply__clock_priv_subsystem__defined */
178
179/* union of all replies */
180
181#ifndef __ReplyUnion__clock_priv_subsystem__defined
182#define __ReplyUnion__clock_priv_subsystem__defined
183union __ReplyUnion__clock_priv_subsystem {
184 __Reply__clock_set_time_t Reply_clock_set_time;
185 __Reply__clock_set_attributes_t Reply_clock_set_attributes;
186};
187#endif /* !__RequestUnion__clock_priv_subsystem__defined */
188
189#ifndef subsystem_to_name_map_clock_priv
190#define subsystem_to_name_map_clock_priv \
191 { "clock_set_time", 1200 },\
192 { "clock_set_attributes", 1201 }
193#endif
194
195#ifdef __AfterMigUserHeader
196__AfterMigUserHeader
197#endif /* __AfterMigUserHeader */
198
199#endif /* _clock_priv_user_ */
lib/libc/include/aarch64-macos-gnu/mach/clock_types.h created+127
......@@ -0,0 +1,127 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * File: clock_types.h
33 * Purpose: Clock facility header definitions. These
34 * definitons are needed by both kernel and
35 * user-level software.
36 */
37
38/*
39 * All interfaces defined here are obsolete.
40 */
41
42#ifndef _MACH_CLOCK_TYPES_H_
43#define _MACH_CLOCK_TYPES_H_
44
45#include <stdint.h>
46#include <mach/time_value.h>
47
48/*
49 * Type definitions.
50 */
51typedef int alarm_type_t; /* alarm time type */
52typedef int sleep_type_t; /* sleep time type */
53typedef int clock_id_t; /* clock identification type */
54typedef int clock_flavor_t; /* clock flavor type */
55typedef int *clock_attr_t; /* clock attribute type */
56typedef int clock_res_t; /* clock resolution type */
57
58/*
59 * Normal time specification used by the kernel clock facility.
60 */
61struct mach_timespec {
62 unsigned int tv_sec; /* seconds */
63 clock_res_t tv_nsec; /* nanoseconds */
64};
65typedef struct mach_timespec mach_timespec_t;
66
67/*
68 * Reserved clock id values for default clocks.
69 */
70#define SYSTEM_CLOCK 0
71#define CALENDAR_CLOCK 1
72
73#define REALTIME_CLOCK 0
74
75/*
76 * Attribute names.
77 */
78#define CLOCK_GET_TIME_RES 1 /* get_time call resolution */
79/* 2 * was map_time call resolution */
80#define CLOCK_ALARM_CURRES 3 /* current alarm resolution */
81#define CLOCK_ALARM_MINRES 4 /* minimum alarm resolution */
82#define CLOCK_ALARM_MAXRES 5 /* maximum alarm resolution */
83
84#define NSEC_PER_USEC 1000ull /* nanoseconds per microsecond */
85#define USEC_PER_SEC 1000000ull /* microseconds per second */
86#define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */
87#define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */
88
89#define BAD_MACH_TIMESPEC(t) \
90 ((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)
91
92/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */
93#define CMP_MACH_TIMESPEC(t1, t2) \
94 ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
95 ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
96 (t1)->tv_nsec - (t2)->tv_nsec))
97
98/* t1 += t2 */
99#define ADD_MACH_TIMESPEC(t1, t2) \
100 do { \
101 if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
102 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \
103 (t1)->tv_sec += 1; \
104 } \
105 (t1)->tv_sec += (t2)->tv_sec; \
106 } while (0)
107
108/* t1 -= t2 */
109#define SUB_MACH_TIMESPEC(t1, t2) \
110 do { \
111 if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
112 (t1)->tv_nsec += (long) NSEC_PER_SEC; \
113 (t1)->tv_sec -= 1; \
114 } \
115 (t1)->tv_sec -= (t2)->tv_sec; \
116 } while (0)
117
118/*
119 * Alarm parameter defines.
120 */
121#define ALRMTYPE 0xff /* type (8-bit field) */
122#define TIME_ABSOLUTE 0x00 /* absolute time */
123#define TIME_RELATIVE 0x01 /* relative time */
124
125#define BAD_ALRMTYPE(t) (((t) &~ TIME_RELATIVE) != 0)
126
127#endif /* _MACH_CLOCK_TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/mach/dyld_kernel.h created+66
......@@ -0,0 +1,66 @@
1/*
2 * Copyright (c) 2016 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_DYLIB_INFO_H_
30#define _MACH_DYLIB_INFO_H_
31
32#include <mach/boolean.h>
33#include <stdint.h>
34#include <sys/_types/_fsid_t.h>
35#include <sys/_types/_u_int32_t.h>
36#include <sys/_types/_fsobj_id_t.h>
37#include <sys/_types/_uuid_t.h>
38
39/* These definitions must be kept in sync with the ones in
40 * osfmk/mach/mach_types.defs.
41 */
42
43struct dyld_kernel_image_info {
44 uuid_t uuid;
45 fsobj_id_t fsobjid;
46 fsid_t fsid;
47 uint64_t load_addr;
48};
49
50struct dyld_kernel_process_info {
51 struct dyld_kernel_image_info cache_image_info;
52 uint64_t timestamp; // mach_absolute_time of last time dyld change to image list
53 uint32_t imageCount; // number of images currently loaded into process
54 uint32_t initialImageCount; // number of images statically loaded into process (before any dlopen() calls)
55 uint8_t dyldState; // one of dyld_process_state_* values
56 boolean_t no_cache; // process is running without a dyld cache
57 boolean_t private_cache; // process is using a private copy of its dyld cache
58};
59
60/* typedefs so our MIG is sane */
61
62typedef struct dyld_kernel_image_info dyld_kernel_image_info_t;
63typedef struct dyld_kernel_process_info dyld_kernel_process_info_t;
64typedef dyld_kernel_image_info_t *dyld_kernel_image_info_array_t;
65
66#endif /* _MACH_DYLIB_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach/error.h created+114
......@@ -0,0 +1,114 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/error.h
60 * Purpose:
61 * error module definitions
62 *
63 */
64
65#ifndef _MACH_ERROR_H_
66#define _MACH_ERROR_H_
67
68#include <mach/kern_return.h>
69
70/*
71 * error number layout as follows:
72 *
73 * hi lo
74 * | system(6) | subsystem(12) | code(14) |
75 */
76
77
78#define err_none (mach_error_t)0
79#define ERR_SUCCESS (mach_error_t)0
80#define ERR_ROUTINE_NIL (mach_error_fn_t)0
81
82
83#define err_system(x) ((signed)((((unsigned)(x))&0x3f)<<26))
84#define err_sub(x) (((x)&0xfff)<<14)
85
86#define err_get_system(err) (((err)>>26)&0x3f)
87#define err_get_sub(err) (((err)>>14)&0xfff)
88#define err_get_code(err) ((err)&0x3fff)
89
90#define system_emask (err_system(0x3f))
91#define sub_emask (err_sub(0xfff))
92#define code_emask (0x3fff)
93
94
95/* major error systems */
96#define err_kern err_system(0x0) /* kernel */
97#define err_us err_system(0x1) /* user space library */
98#define err_server err_system(0x2) /* user space servers */
99#define err_ipc err_system(0x3) /* old ipc errors */
100#define err_mach_ipc err_system(0x4) /* mach-ipc errors */
101#define err_dipc err_system(0x7) /* distributed ipc */
102#define err_local err_system(0x3e) /* user defined errors */
103#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
104
105#define err_max_system 0x3f
106
107
108/* unix errors get lumped into one subsystem */
109#define unix_err(errno) (err_kern|err_sub(3)|errno)
110
111typedef kern_return_t mach_error_t;
112typedef mach_error_t (* mach_error_fn_t)( void );
113
114#endif /* _MACH_ERROR_H_ */
lib/libc/include/aarch64-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
188typedef int exception_type_t;
189typedef integer_t exception_data_type_t;
190typedef int64_t mach_exception_data_type_t;
191typedef int exception_behavior_t;
192typedef exception_data_type_t *exception_data_t;
193typedef mach_exception_data_type_t *mach_exception_data_t;
194typedef unsigned int exception_mask_t;
195typedef exception_mask_t *exception_mask_array_t;
196typedef exception_behavior_t *exception_behavior_array_t;
197typedef thread_state_flavor_t *exception_flavor_array_t;
198typedef mach_port_t *exception_port_array_t;
199typedef mach_exception_data_type_t mach_exception_code_t;
200typedef mach_exception_data_type_t mach_exception_subcode_t;
201
202#endif /* ASSEMBLER */
203
204#endif /* _MACH_EXCEPTION_TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/mach/host_info.h created+260
......@@ -0,0 +1,260 @@
1/*
2 * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56
57/*
58 * File: mach/host_info.h
59 *
60 * Definitions for host_info call.
61 */
62
63#ifndef _MACH_HOST_INFO_H_
64#define _MACH_HOST_INFO_H_
65
66#include <mach/message.h>
67#include <mach/vm_statistics.h>
68#include <mach/machine.h>
69#include <mach/machine/vm_types.h>
70#include <mach/time_value.h>
71
72#include <sys/cdefs.h>
73
74/*
75 * Generic information structure to allow for expansion.
76 */
77typedef integer_t *host_info_t; /* varying array of int. */
78typedef integer_t *host_info64_t; /* varying array of int. */
79
80#define HOST_INFO_MAX (1024) /* max array size */
81typedef integer_t host_info_data_t[HOST_INFO_MAX];
82
83#define KERNEL_VERSION_MAX (512)
84typedef char kernel_version_t[KERNEL_VERSION_MAX];
85
86#define KERNEL_BOOT_INFO_MAX (4096)
87typedef char kernel_boot_info_t[KERNEL_BOOT_INFO_MAX];
88
89/*
90 * Currently defined information.
91 */
92/* host_info() */
93typedef integer_t host_flavor_t;
94#define HOST_BASIC_INFO 1 /* basic info */
95#define HOST_SCHED_INFO 3 /* scheduling info */
96#define HOST_RESOURCE_SIZES 4 /* kernel struct sizes */
97#define HOST_PRIORITY_INFO 5 /* priority information */
98#define HOST_SEMAPHORE_TRAPS 7 /* Has semaphore traps */
99#define HOST_MACH_MSG_TRAP 8 /* Has mach_msg_trap */
100#define HOST_VM_PURGABLE 9 /* purg'e'able memory info */
101#define HOST_DEBUG_INFO_INTERNAL 10 /* Used for kernel internal development tests only */
102#define HOST_CAN_HAS_DEBUGGER 11
103#define HOST_PREFERRED_USER_ARCH 12 /* Get the preferred user-space architecture */
104
105
106struct host_can_has_debugger_info {
107 boolean_t can_has_debugger;
108};
109typedef struct host_can_has_debugger_info host_can_has_debugger_info_data_t;
110typedef struct host_can_has_debugger_info *host_can_has_debugger_info_t;
111#define HOST_CAN_HAS_DEBUGGER_COUNT ((mach_msg_type_number_t) \
112 (sizeof(host_can_has_debugger_info_data_t)/sizeof(integer_t)))
113
114#pragma pack(push, 4)
115
116struct host_basic_info {
117 integer_t max_cpus; /* max number of CPUs possible */
118 integer_t avail_cpus; /* number of CPUs now available */
119 natural_t memory_size; /* size of memory in bytes, capped at 2 GB */
120 cpu_type_t cpu_type; /* cpu type */
121 cpu_subtype_t cpu_subtype; /* cpu subtype */
122 cpu_threadtype_t cpu_threadtype; /* cpu threadtype */
123 integer_t physical_cpu; /* number of physical CPUs now available */
124 integer_t physical_cpu_max; /* max number of physical CPUs possible */
125 integer_t logical_cpu; /* number of logical cpu now available */
126 integer_t logical_cpu_max; /* max number of physical CPUs possible */
127 uint64_t max_mem; /* actual size of physical memory */
128};
129
130#pragma pack(pop)
131
132typedef struct host_basic_info host_basic_info_data_t;
133typedef struct host_basic_info *host_basic_info_t;
134#define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
135 (sizeof(host_basic_info_data_t)/sizeof(integer_t)))
136
137struct host_sched_info {
138 integer_t min_timeout; /* minimum timeout in milliseconds */
139 integer_t min_quantum; /* minimum quantum in milliseconds */
140};
141
142typedef struct host_sched_info host_sched_info_data_t;
143typedef struct host_sched_info *host_sched_info_t;
144#define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) \
145 (sizeof(host_sched_info_data_t)/sizeof(integer_t)))
146
147struct kernel_resource_sizes {
148 natural_t task;
149 natural_t thread;
150 natural_t port;
151 natural_t memory_region;
152 natural_t memory_object;
153};
154
155typedef struct kernel_resource_sizes kernel_resource_sizes_data_t;
156typedef struct kernel_resource_sizes *kernel_resource_sizes_t;
157#define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) \
158 (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t)))
159
160struct host_priority_info {
161 integer_t kernel_priority;
162 integer_t system_priority;
163 integer_t server_priority;
164 integer_t user_priority;
165 integer_t depress_priority;
166 integer_t idle_priority;
167 integer_t minimum_priority;
168 integer_t maximum_priority;
169};
170
171typedef struct host_priority_info host_priority_info_data_t;
172typedef struct host_priority_info *host_priority_info_t;
173#define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) \
174 (sizeof(host_priority_info_data_t)/sizeof(integer_t)))
175
176/* host_statistics() */
177#define HOST_LOAD_INFO 1 /* System loading stats */
178#define HOST_VM_INFO 2 /* Virtual memory stats */
179#define HOST_CPU_LOAD_INFO 3 /* CPU load stats */
180
181/* host_statistics64() */
182#define HOST_VM_INFO64 4 /* 64-bit virtual memory stats */
183#define HOST_EXTMOD_INFO64 5 /* External modification stats */
184#define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */
185
186
187struct host_load_info {
188 integer_t avenrun[3]; /* scaled by LOAD_SCALE */
189 integer_t mach_factor[3]; /* scaled by LOAD_SCALE */
190};
191
192typedef struct host_load_info host_load_info_data_t;
193typedef struct host_load_info *host_load_info_t;
194#define HOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
195 (sizeof(host_load_info_data_t)/sizeof(integer_t)))
196
197typedef struct vm_purgeable_info host_purgable_info_data_t;
198typedef struct vm_purgeable_info *host_purgable_info_t;
199#define HOST_VM_PURGABLE_COUNT ((mach_msg_type_number_t) \
200 (sizeof(host_purgable_info_data_t)/sizeof(integer_t)))
201
202/* in <mach/vm_statistics.h> */
203/* vm_statistics64 */
204#define HOST_VM_INFO64_COUNT ((mach_msg_type_number_t) \
205 (sizeof(vm_statistics64_data_t)/sizeof(integer_t)))
206
207/* size of the latest version of the structure */
208#define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT
209#define HOST_VM_INFO64_REV1_COUNT HOST_VM_INFO64_LATEST_COUNT
210/* previous versions: adjust the size according to what was added each time */
211#define HOST_VM_INFO64_REV0_COUNT /* added compression and swapper info (14 ints) */ \
212 ((mach_msg_type_number_t) \
213 (HOST_VM_INFO64_REV1_COUNT - 14))
214
215/* in <mach/vm_statistics.h> */
216/* vm_extmod_statistics */
217#define HOST_EXTMOD_INFO64_COUNT ((mach_msg_type_number_t) \
218 (sizeof(vm_extmod_statistics_data_t)/sizeof(integer_t)))
219
220/* size of the latest version of the structure */
221#define HOST_EXTMOD_INFO64_LATEST_COUNT HOST_EXTMOD_INFO64_COUNT
222
223/* vm_statistics */
224#define HOST_VM_INFO_COUNT ((mach_msg_type_number_t) \
225 (sizeof(vm_statistics_data_t)/sizeof(integer_t)))
226
227/* size of the latest version of the structure */
228#define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT
229#define HOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT
230/* previous versions: adjust the size according to what was added each time */
231#define HOST_VM_INFO_REV1_COUNT /* added "speculative_count" (1 int) */ \
232 ((mach_msg_type_number_t) \
233 (HOST_VM_INFO_REV2_COUNT - 1))
234#define HOST_VM_INFO_REV0_COUNT /* added "purgable" info (2 ints) */ \
235 ((mach_msg_type_number_t) \
236 (HOST_VM_INFO_REV1_COUNT - 2))
237
238struct host_cpu_load_info { /* number of ticks while running... */
239 natural_t cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */
240};
241
242typedef struct host_cpu_load_info host_cpu_load_info_data_t;
243typedef struct host_cpu_load_info *host_cpu_load_info_t;
244#define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
245 (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t)))
246
247struct host_preferred_user_arch {
248 cpu_type_t cpu_type; /* Preferred user-space cpu type */
249 cpu_subtype_t cpu_subtype; /* Preferred user-space cpu subtype */
250};
251
252typedef struct host_preferred_user_arch host_preferred_user_arch_data_t;
253typedef struct host_preferred_user_arch *host_preferred_user_arch_t;
254#define HOST_PREFERRED_USER_ARCH_COUNT ((mach_msg_type_number_t) \
255 (sizeof(host_preferred_user_arch_data_t)/sizeof(integer_t)))
256
257
258
259
260#endif /* _MACH_HOST_INFO_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/mach/host_priv.h created+1163
......@@ -0,0 +1,1163 @@
1#ifndef _host_priv_user_
2#define _host_priv_user_
3
4/* Module host_priv */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef host_priv_MSG_COUNT
52#define host_priv_MSG_COUNT 26
53#endif /* host_priv_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach/mach_types.h>
60#include <mach_debug/mach_debug_types.h>
61
62#ifdef __BeforeMigUserHeader
63__BeforeMigUserHeader
64#endif /* __BeforeMigUserHeader */
65
66#include <sys/cdefs.h>
67__BEGIN_DECLS
68
69
70/* Routine host_get_boot_info */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t host_get_boot_info
77(
78 host_priv_t host_priv,
79 kernel_boot_info_t boot_info
80);
81
82/* Routine host_reboot */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t host_reboot
89(
90 host_priv_t host_priv,
91 int options
92);
93
94/* Routine host_priv_statistics */
95#ifdef mig_external
96mig_external
97#else
98extern
99#endif /* mig_external */
100kern_return_t host_priv_statistics
101(
102 host_priv_t host_priv,
103 host_flavor_t flavor,
104 host_info_t host_info_out,
105 mach_msg_type_number_t *host_info_outCnt
106);
107
108/* Routine host_default_memory_manager */
109#ifdef mig_external
110mig_external
111#else
112extern
113#endif /* mig_external */
114kern_return_t host_default_memory_manager
115(
116 host_priv_t host_priv,
117 memory_object_default_t *default_manager,
118 memory_object_cluster_size_t cluster_size
119);
120
121/* Routine vm_wire */
122#ifdef mig_external
123mig_external
124#else
125extern
126#endif /* mig_external */
127kern_return_t vm_wire
128(
129 host_priv_t host_priv,
130 vm_map_t task,
131 vm_address_t address,
132 vm_size_t size,
133 vm_prot_t desired_access
134);
135
136/* Routine thread_wire */
137#ifdef mig_external
138mig_external
139#else
140extern
141#endif /* mig_external */
142kern_return_t thread_wire
143(
144 host_priv_t host_priv,
145 thread_act_t thread,
146 boolean_t wired
147);
148
149/* Routine vm_allocate_cpm */
150#ifdef mig_external
151mig_external
152#else
153extern
154#endif /* mig_external */
155kern_return_t vm_allocate_cpm
156(
157 host_priv_t host_priv,
158 vm_map_t task,
159 vm_address_t *address,
160 vm_size_t size,
161 int flags
162);
163
164/* Routine host_processors */
165#ifdef mig_external
166mig_external
167#else
168extern
169#endif /* mig_external */
170kern_return_t host_processors
171(
172 host_priv_t host_priv,
173 processor_array_t *out_processor_list,
174 mach_msg_type_number_t *out_processor_listCnt
175);
176
177/* Routine host_get_clock_control */
178#ifdef mig_external
179mig_external
180#else
181extern
182#endif /* mig_external */
183kern_return_t host_get_clock_control
184(
185 host_priv_t host_priv,
186 clock_id_t clock_id,
187 clock_ctrl_t *clock_ctrl
188);
189
190/* Routine kmod_create */
191#ifdef mig_external
192mig_external
193#else
194extern
195#endif /* mig_external */
196kern_return_t kmod_create
197(
198 host_priv_t host_priv,
199 vm_address_t info,
200 kmod_t *module
201);
202
203/* Routine kmod_destroy */
204#ifdef mig_external
205mig_external
206#else
207extern
208#endif /* mig_external */
209kern_return_t kmod_destroy
210(
211 host_priv_t host_priv,
212 kmod_t module
213);
214
215/* Routine kmod_control */
216#ifdef mig_external
217mig_external
218#else
219extern
220#endif /* mig_external */
221kern_return_t kmod_control
222(
223 host_priv_t host_priv,
224 kmod_t module,
225 kmod_control_flavor_t flavor,
226 kmod_args_t *data,
227 mach_msg_type_number_t *dataCnt
228);
229
230/* Routine host_get_special_port */
231#ifdef mig_external
232mig_external
233#else
234extern
235#endif /* mig_external */
236kern_return_t host_get_special_port
237(
238 host_priv_t host_priv,
239 int node,
240 int which,
241 mach_port_t *port
242);
243
244/* Routine host_set_special_port */
245#ifdef mig_external
246mig_external
247#else
248extern
249#endif /* mig_external */
250kern_return_t host_set_special_port
251(
252 host_priv_t host_priv,
253 int which,
254 mach_port_t port
255);
256
257/* Routine host_set_exception_ports */
258#ifdef mig_external
259mig_external
260#else
261extern
262#endif /* mig_external */
263kern_return_t host_set_exception_ports
264(
265 host_priv_t host_priv,
266 exception_mask_t exception_mask,
267 mach_port_t new_port,
268 exception_behavior_t behavior,
269 thread_state_flavor_t new_flavor
270);
271
272/* Routine host_get_exception_ports */
273#ifdef mig_external
274mig_external
275#else
276extern
277#endif /* mig_external */
278kern_return_t host_get_exception_ports
279(
280 host_priv_t host_priv,
281 exception_mask_t exception_mask,
282 exception_mask_array_t masks,
283 mach_msg_type_number_t *masksCnt,
284 exception_handler_array_t old_handlers,
285 exception_behavior_array_t old_behaviors,
286 exception_flavor_array_t old_flavors
287);
288
289/* Routine host_swap_exception_ports */
290#ifdef mig_external
291mig_external
292#else
293extern
294#endif /* mig_external */
295kern_return_t host_swap_exception_ports
296(
297 host_priv_t host_priv,
298 exception_mask_t exception_mask,
299 mach_port_t new_port,
300 exception_behavior_t behavior,
301 thread_state_flavor_t new_flavor,
302 exception_mask_array_t masks,
303 mach_msg_type_number_t *masksCnt,
304 exception_handler_array_t old_handlerss,
305 exception_behavior_array_t old_behaviors,
306 exception_flavor_array_t old_flavors
307);
308
309/* Routine mach_vm_wire */
310#ifdef mig_external
311mig_external
312#else
313extern
314#endif /* mig_external */
315kern_return_t mach_vm_wire
316(
317 host_priv_t host_priv,
318 vm_map_t task,
319 mach_vm_address_t address,
320 mach_vm_size_t size,
321 vm_prot_t desired_access
322);
323
324/* Routine host_processor_sets */
325#ifdef mig_external
326mig_external
327#else
328extern
329#endif /* mig_external */
330kern_return_t host_processor_sets
331(
332 host_priv_t host_priv,
333 processor_set_name_array_t *processor_sets,
334 mach_msg_type_number_t *processor_setsCnt
335);
336
337/* Routine host_processor_set_priv */
338#ifdef mig_external
339mig_external
340#else
341extern
342#endif /* mig_external */
343kern_return_t host_processor_set_priv
344(
345 host_priv_t host_priv,
346 processor_set_name_t set_name,
347 processor_set_t *set
348);
349
350/* Routine host_set_UNDServer */
351#ifdef mig_external
352mig_external
353#else
354extern
355#endif /* mig_external */
356kern_return_t host_set_UNDServer
357(
358 host_priv_t host,
359 UNDServerRef server
360);
361
362/* Routine host_get_UNDServer */
363#ifdef mig_external
364mig_external
365#else
366extern
367#endif /* mig_external */
368kern_return_t host_get_UNDServer
369(
370 host_priv_t host,
371 UNDServerRef *server
372);
373
374/* Routine kext_request */
375#ifdef mig_external
376mig_external
377#else
378extern
379#endif /* mig_external */
380kern_return_t kext_request
381(
382 host_priv_t host_priv,
383 uint32_t user_log_flags,
384 vm_offset_t request_data,
385 mach_msg_type_number_t request_dataCnt,
386 vm_offset_t *response_data,
387 mach_msg_type_number_t *response_dataCnt,
388 vm_offset_t *log_data,
389 mach_msg_type_number_t *log_dataCnt,
390 kern_return_t *op_result
391);
392
393__END_DECLS
394
395/********************** Caution **************************/
396/* The following data types should be used to calculate */
397/* maximum message sizes only. The actual message may be */
398/* smaller, and the position of the arguments within the */
399/* message layout may vary from what is presented here. */
400/* For example, if any of the arguments are variable- */
401/* sized, and less than the maximum is sent, the data */
402/* will be packed tight in the actual message to reduce */
403/* the presence of holes. */
404/********************** Caution **************************/
405
406/* typedefs for all requests */
407
408#ifndef __Request__host_priv_subsystem__defined
409#define __Request__host_priv_subsystem__defined
410
411#ifdef __MigPackStructs
412#pragma pack(push, 4)
413#endif
414 typedef struct {
415 mach_msg_header_t Head;
416 } __Request__host_get_boot_info_t __attribute__((unused));
417#ifdef __MigPackStructs
418#pragma pack(pop)
419#endif
420
421#ifdef __MigPackStructs
422#pragma pack(push, 4)
423#endif
424 typedef struct {
425 mach_msg_header_t Head;
426 NDR_record_t NDR;
427 int options;
428 } __Request__host_reboot_t __attribute__((unused));
429#ifdef __MigPackStructs
430#pragma pack(pop)
431#endif
432
433#ifdef __MigPackStructs
434#pragma pack(push, 4)
435#endif
436 typedef struct {
437 mach_msg_header_t Head;
438 NDR_record_t NDR;
439 host_flavor_t flavor;
440 mach_msg_type_number_t host_info_outCnt;
441 } __Request__host_priv_statistics_t __attribute__((unused));
442#ifdef __MigPackStructs
443#pragma pack(pop)
444#endif
445
446#ifdef __MigPackStructs
447#pragma pack(push, 4)
448#endif
449 typedef struct {
450 mach_msg_header_t Head;
451 /* start of the kernel processed data */
452 mach_msg_body_t msgh_body;
453 mach_msg_port_descriptor_t default_manager;
454 /* end of the kernel processed data */
455 NDR_record_t NDR;
456 memory_object_cluster_size_t cluster_size;
457 } __Request__host_default_memory_manager_t __attribute__((unused));
458#ifdef __MigPackStructs
459#pragma pack(pop)
460#endif
461
462#ifdef __MigPackStructs
463#pragma pack(push, 4)
464#endif
465 typedef struct {
466 mach_msg_header_t Head;
467 /* start of the kernel processed data */
468 mach_msg_body_t msgh_body;
469 mach_msg_port_descriptor_t task;
470 /* end of the kernel processed data */
471 NDR_record_t NDR;
472 vm_address_t address;
473 vm_size_t size;
474 vm_prot_t desired_access;
475 } __Request__vm_wire_t __attribute__((unused));
476#ifdef __MigPackStructs
477#pragma pack(pop)
478#endif
479
480#ifdef __MigPackStructs
481#pragma pack(push, 4)
482#endif
483 typedef struct {
484 mach_msg_header_t Head;
485 /* start of the kernel processed data */
486 mach_msg_body_t msgh_body;
487 mach_msg_port_descriptor_t thread;
488 /* end of the kernel processed data */
489 NDR_record_t NDR;
490 boolean_t wired;
491 } __Request__thread_wire_t __attribute__((unused));
492#ifdef __MigPackStructs
493#pragma pack(pop)
494#endif
495
496#ifdef __MigPackStructs
497#pragma pack(push, 4)
498#endif
499 typedef struct {
500 mach_msg_header_t Head;
501 /* start of the kernel processed data */
502 mach_msg_body_t msgh_body;
503 mach_msg_port_descriptor_t task;
504 /* end of the kernel processed data */
505 NDR_record_t NDR;
506 vm_address_t address;
507 vm_size_t size;
508 int flags;
509 } __Request__vm_allocate_cpm_t __attribute__((unused));
510#ifdef __MigPackStructs
511#pragma pack(pop)
512#endif
513
514#ifdef __MigPackStructs
515#pragma pack(push, 4)
516#endif
517 typedef struct {
518 mach_msg_header_t Head;
519 } __Request__host_processors_t __attribute__((unused));
520#ifdef __MigPackStructs
521#pragma pack(pop)
522#endif
523
524#ifdef __MigPackStructs
525#pragma pack(push, 4)
526#endif
527 typedef struct {
528 mach_msg_header_t Head;
529 NDR_record_t NDR;
530 clock_id_t clock_id;
531 } __Request__host_get_clock_control_t __attribute__((unused));
532#ifdef __MigPackStructs
533#pragma pack(pop)
534#endif
535
536#ifdef __MigPackStructs
537#pragma pack(push, 4)
538#endif
539 typedef struct {
540 mach_msg_header_t Head;
541 NDR_record_t NDR;
542 vm_address_t info;
543 } __Request__kmod_create_t __attribute__((unused));
544#ifdef __MigPackStructs
545#pragma pack(pop)
546#endif
547
548#ifdef __MigPackStructs
549#pragma pack(push, 4)
550#endif
551 typedef struct {
552 mach_msg_header_t Head;
553 NDR_record_t NDR;
554 kmod_t module;
555 } __Request__kmod_destroy_t __attribute__((unused));
556#ifdef __MigPackStructs
557#pragma pack(pop)
558#endif
559
560#ifdef __MigPackStructs
561#pragma pack(push, 4)
562#endif
563 typedef struct {
564 mach_msg_header_t Head;
565 /* start of the kernel processed data */
566 mach_msg_body_t msgh_body;
567 mach_msg_ool_descriptor_t data;
568 /* end of the kernel processed data */
569 NDR_record_t NDR;
570 kmod_t module;
571 kmod_control_flavor_t flavor;
572 mach_msg_type_number_t dataCnt;
573 } __Request__kmod_control_t __attribute__((unused));
574#ifdef __MigPackStructs
575#pragma pack(pop)
576#endif
577
578#ifdef __MigPackStructs
579#pragma pack(push, 4)
580#endif
581 typedef struct {
582 mach_msg_header_t Head;
583 NDR_record_t NDR;
584 int node;
585 int which;
586 } __Request__host_get_special_port_t __attribute__((unused));
587#ifdef __MigPackStructs
588#pragma pack(pop)
589#endif
590
591#ifdef __MigPackStructs
592#pragma pack(push, 4)
593#endif
594 typedef struct {
595 mach_msg_header_t Head;
596 /* start of the kernel processed data */
597 mach_msg_body_t msgh_body;
598 mach_msg_port_descriptor_t port;
599 /* end of the kernel processed data */
600 NDR_record_t NDR;
601 int which;
602 } __Request__host_set_special_port_t __attribute__((unused));
603#ifdef __MigPackStructs
604#pragma pack(pop)
605#endif
606
607#ifdef __MigPackStructs
608#pragma pack(push, 4)
609#endif
610 typedef struct {
611 mach_msg_header_t Head;
612 /* start of the kernel processed data */
613 mach_msg_body_t msgh_body;
614 mach_msg_port_descriptor_t new_port;
615 /* end of the kernel processed data */
616 NDR_record_t NDR;
617 exception_mask_t exception_mask;
618 exception_behavior_t behavior;
619 thread_state_flavor_t new_flavor;
620 } __Request__host_set_exception_ports_t __attribute__((unused));
621#ifdef __MigPackStructs
622#pragma pack(pop)
623#endif
624
625#ifdef __MigPackStructs
626#pragma pack(push, 4)
627#endif
628 typedef struct {
629 mach_msg_header_t Head;
630 NDR_record_t NDR;
631 exception_mask_t exception_mask;
632 } __Request__host_get_exception_ports_t __attribute__((unused));
633#ifdef __MigPackStructs
634#pragma pack(pop)
635#endif
636
637#ifdef __MigPackStructs
638#pragma pack(push, 4)
639#endif
640 typedef struct {
641 mach_msg_header_t Head;
642 /* start of the kernel processed data */
643 mach_msg_body_t msgh_body;
644 mach_msg_port_descriptor_t new_port;
645 /* end of the kernel processed data */
646 NDR_record_t NDR;
647 exception_mask_t exception_mask;
648 exception_behavior_t behavior;
649 thread_state_flavor_t new_flavor;
650 } __Request__host_swap_exception_ports_t __attribute__((unused));
651#ifdef __MigPackStructs
652#pragma pack(pop)
653#endif
654
655#ifdef __MigPackStructs
656#pragma pack(push, 4)
657#endif
658 typedef struct {
659 mach_msg_header_t Head;
660 /* start of the kernel processed data */
661 mach_msg_body_t msgh_body;
662 mach_msg_port_descriptor_t task;
663 /* end of the kernel processed data */
664 NDR_record_t NDR;
665 mach_vm_address_t address;
666 mach_vm_size_t size;
667 vm_prot_t desired_access;
668 } __Request__mach_vm_wire_t __attribute__((unused));
669#ifdef __MigPackStructs
670#pragma pack(pop)
671#endif
672
673#ifdef __MigPackStructs
674#pragma pack(push, 4)
675#endif
676 typedef struct {
677 mach_msg_header_t Head;
678 } __Request__host_processor_sets_t __attribute__((unused));
679#ifdef __MigPackStructs
680#pragma pack(pop)
681#endif
682
683#ifdef __MigPackStructs
684#pragma pack(push, 4)
685#endif
686 typedef struct {
687 mach_msg_header_t Head;
688 /* start of the kernel processed data */
689 mach_msg_body_t msgh_body;
690 mach_msg_port_descriptor_t set_name;
691 /* end of the kernel processed data */
692 } __Request__host_processor_set_priv_t __attribute__((unused));
693#ifdef __MigPackStructs
694#pragma pack(pop)
695#endif
696
697#ifdef __MigPackStructs
698#pragma pack(push, 4)
699#endif
700 typedef struct {
701 mach_msg_header_t Head;
702 /* start of the kernel processed data */
703 mach_msg_body_t msgh_body;
704 mach_msg_port_descriptor_t server;
705 /* end of the kernel processed data */
706 } __Request__host_set_UNDServer_t __attribute__((unused));
707#ifdef __MigPackStructs
708#pragma pack(pop)
709#endif
710
711#ifdef __MigPackStructs
712#pragma pack(push, 4)
713#endif
714 typedef struct {
715 mach_msg_header_t Head;
716 } __Request__host_get_UNDServer_t __attribute__((unused));
717#ifdef __MigPackStructs
718#pragma pack(pop)
719#endif
720
721#ifdef __MigPackStructs
722#pragma pack(push, 4)
723#endif
724 typedef struct {
725 mach_msg_header_t Head;
726 /* start of the kernel processed data */
727 mach_msg_body_t msgh_body;
728 mach_msg_ool_descriptor_t request_data;
729 /* end of the kernel processed data */
730 NDR_record_t NDR;
731 uint32_t user_log_flags;
732 mach_msg_type_number_t request_dataCnt;
733 } __Request__kext_request_t __attribute__((unused));
734#ifdef __MigPackStructs
735#pragma pack(pop)
736#endif
737#endif /* !__Request__host_priv_subsystem__defined */
738
739/* union of all requests */
740
741#ifndef __RequestUnion__host_priv_subsystem__defined
742#define __RequestUnion__host_priv_subsystem__defined
743union __RequestUnion__host_priv_subsystem {
744 __Request__host_get_boot_info_t Request_host_get_boot_info;
745 __Request__host_reboot_t Request_host_reboot;
746 __Request__host_priv_statistics_t Request_host_priv_statistics;
747 __Request__host_default_memory_manager_t Request_host_default_memory_manager;
748 __Request__vm_wire_t Request_vm_wire;
749 __Request__thread_wire_t Request_thread_wire;
750 __Request__vm_allocate_cpm_t Request_vm_allocate_cpm;
751 __Request__host_processors_t Request_host_processors;
752 __Request__host_get_clock_control_t Request_host_get_clock_control;
753 __Request__kmod_create_t Request_kmod_create;
754 __Request__kmod_destroy_t Request_kmod_destroy;
755 __Request__kmod_control_t Request_kmod_control;
756 __Request__host_get_special_port_t Request_host_get_special_port;
757 __Request__host_set_special_port_t Request_host_set_special_port;
758 __Request__host_set_exception_ports_t Request_host_set_exception_ports;
759 __Request__host_get_exception_ports_t Request_host_get_exception_ports;
760 __Request__host_swap_exception_ports_t Request_host_swap_exception_ports;
761 __Request__mach_vm_wire_t Request_mach_vm_wire;
762 __Request__host_processor_sets_t Request_host_processor_sets;
763 __Request__host_processor_set_priv_t Request_host_processor_set_priv;
764 __Request__host_set_UNDServer_t Request_host_set_UNDServer;
765 __Request__host_get_UNDServer_t Request_host_get_UNDServer;
766 __Request__kext_request_t Request_kext_request;
767};
768#endif /* !__RequestUnion__host_priv_subsystem__defined */
769/* typedefs for all replies */
770
771#ifndef __Reply__host_priv_subsystem__defined
772#define __Reply__host_priv_subsystem__defined
773
774#ifdef __MigPackStructs
775#pragma pack(push, 4)
776#endif
777 typedef struct {
778 mach_msg_header_t Head;
779 NDR_record_t NDR;
780 kern_return_t RetCode;
781 mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */
782 mach_msg_type_number_t boot_infoCnt;
783 char boot_info[4096];
784 } __Reply__host_get_boot_info_t __attribute__((unused));
785#ifdef __MigPackStructs
786#pragma pack(pop)
787#endif
788
789#ifdef __MigPackStructs
790#pragma pack(push, 4)
791#endif
792 typedef struct {
793 mach_msg_header_t Head;
794 NDR_record_t NDR;
795 kern_return_t RetCode;
796 } __Reply__host_reboot_t __attribute__((unused));
797#ifdef __MigPackStructs
798#pragma pack(pop)
799#endif
800
801#ifdef __MigPackStructs
802#pragma pack(push, 4)
803#endif
804 typedef struct {
805 mach_msg_header_t Head;
806 NDR_record_t NDR;
807 kern_return_t RetCode;
808 mach_msg_type_number_t host_info_outCnt;
809 integer_t host_info_out[68];
810 } __Reply__host_priv_statistics_t __attribute__((unused));
811#ifdef __MigPackStructs
812#pragma pack(pop)
813#endif
814
815#ifdef __MigPackStructs
816#pragma pack(push, 4)
817#endif
818 typedef struct {
819 mach_msg_header_t Head;
820 /* start of the kernel processed data */
821 mach_msg_body_t msgh_body;
822 mach_msg_port_descriptor_t default_manager;
823 /* end of the kernel processed data */
824 } __Reply__host_default_memory_manager_t __attribute__((unused));
825#ifdef __MigPackStructs
826#pragma pack(pop)
827#endif
828
829#ifdef __MigPackStructs
830#pragma pack(push, 4)
831#endif
832 typedef struct {
833 mach_msg_header_t Head;
834 NDR_record_t NDR;
835 kern_return_t RetCode;
836 } __Reply__vm_wire_t __attribute__((unused));
837#ifdef __MigPackStructs
838#pragma pack(pop)
839#endif
840
841#ifdef __MigPackStructs
842#pragma pack(push, 4)
843#endif
844 typedef struct {
845 mach_msg_header_t Head;
846 NDR_record_t NDR;
847 kern_return_t RetCode;
848 } __Reply__thread_wire_t __attribute__((unused));
849#ifdef __MigPackStructs
850#pragma pack(pop)
851#endif
852
853#ifdef __MigPackStructs
854#pragma pack(push, 4)
855#endif
856 typedef struct {
857 mach_msg_header_t Head;
858 NDR_record_t NDR;
859 kern_return_t RetCode;
860 vm_address_t address;
861 } __Reply__vm_allocate_cpm_t __attribute__((unused));
862#ifdef __MigPackStructs
863#pragma pack(pop)
864#endif
865
866#ifdef __MigPackStructs
867#pragma pack(push, 4)
868#endif
869 typedef struct {
870 mach_msg_header_t Head;
871 /* start of the kernel processed data */
872 mach_msg_body_t msgh_body;
873 mach_msg_ool_ports_descriptor_t out_processor_list;
874 /* end of the kernel processed data */
875 NDR_record_t NDR;
876 mach_msg_type_number_t out_processor_listCnt;
877 } __Reply__host_processors_t __attribute__((unused));
878#ifdef __MigPackStructs
879#pragma pack(pop)
880#endif
881
882#ifdef __MigPackStructs
883#pragma pack(push, 4)
884#endif
885 typedef struct {
886 mach_msg_header_t Head;
887 /* start of the kernel processed data */
888 mach_msg_body_t msgh_body;
889 mach_msg_port_descriptor_t clock_ctrl;
890 /* end of the kernel processed data */
891 } __Reply__host_get_clock_control_t __attribute__((unused));
892#ifdef __MigPackStructs
893#pragma pack(pop)
894#endif
895
896#ifdef __MigPackStructs
897#pragma pack(push, 4)
898#endif
899 typedef struct {
900 mach_msg_header_t Head;
901 NDR_record_t NDR;
902 kern_return_t RetCode;
903 kmod_t module;
904 } __Reply__kmod_create_t __attribute__((unused));
905#ifdef __MigPackStructs
906#pragma pack(pop)
907#endif
908
909#ifdef __MigPackStructs
910#pragma pack(push, 4)
911#endif
912 typedef struct {
913 mach_msg_header_t Head;
914 NDR_record_t NDR;
915 kern_return_t RetCode;
916 } __Reply__kmod_destroy_t __attribute__((unused));
917#ifdef __MigPackStructs
918#pragma pack(pop)
919#endif
920
921#ifdef __MigPackStructs
922#pragma pack(push, 4)
923#endif
924 typedef struct {
925 mach_msg_header_t Head;
926 /* start of the kernel processed data */
927 mach_msg_body_t msgh_body;
928 mach_msg_ool_descriptor_t data;
929 /* end of the kernel processed data */
930 NDR_record_t NDR;
931 mach_msg_type_number_t dataCnt;
932 } __Reply__kmod_control_t __attribute__((unused));
933#ifdef __MigPackStructs
934#pragma pack(pop)
935#endif
936
937#ifdef __MigPackStructs
938#pragma pack(push, 4)
939#endif
940 typedef struct {
941 mach_msg_header_t Head;
942 /* start of the kernel processed data */
943 mach_msg_body_t msgh_body;
944 mach_msg_port_descriptor_t port;
945 /* end of the kernel processed data */
946 } __Reply__host_get_special_port_t __attribute__((unused));
947#ifdef __MigPackStructs
948#pragma pack(pop)
949#endif
950
951#ifdef __MigPackStructs
952#pragma pack(push, 4)
953#endif
954 typedef struct {
955 mach_msg_header_t Head;
956 NDR_record_t NDR;
957 kern_return_t RetCode;
958 } __Reply__host_set_special_port_t __attribute__((unused));
959#ifdef __MigPackStructs
960#pragma pack(pop)
961#endif
962
963#ifdef __MigPackStructs
964#pragma pack(push, 4)
965#endif
966 typedef struct {
967 mach_msg_header_t Head;
968 NDR_record_t NDR;
969 kern_return_t RetCode;
970 } __Reply__host_set_exception_ports_t __attribute__((unused));
971#ifdef __MigPackStructs
972#pragma pack(pop)
973#endif
974
975#ifdef __MigPackStructs
976#pragma pack(push, 4)
977#endif
978 typedef struct {
979 mach_msg_header_t Head;
980 /* start of the kernel processed data */
981 mach_msg_body_t msgh_body;
982 mach_msg_port_descriptor_t old_handlers[32];
983 /* end of the kernel processed data */
984 NDR_record_t NDR;
985 mach_msg_type_number_t masksCnt;
986 exception_mask_t masks[32];
987 exception_behavior_t old_behaviors[32];
988 thread_state_flavor_t old_flavors[32];
989 } __Reply__host_get_exception_ports_t __attribute__((unused));
990#ifdef __MigPackStructs
991#pragma pack(pop)
992#endif
993
994#ifdef __MigPackStructs
995#pragma pack(push, 4)
996#endif
997 typedef struct {
998 mach_msg_header_t Head;
999 /* start of the kernel processed data */
1000 mach_msg_body_t msgh_body;
1001 mach_msg_port_descriptor_t old_handlerss[32];
1002 /* end of the kernel processed data */
1003 NDR_record_t NDR;
1004 mach_msg_type_number_t masksCnt;
1005 exception_mask_t masks[32];
1006 exception_behavior_t old_behaviors[32];
1007 thread_state_flavor_t old_flavors[32];
1008 } __Reply__host_swap_exception_ports_t __attribute__((unused));
1009#ifdef __MigPackStructs
1010#pragma pack(pop)
1011#endif
1012
1013#ifdef __MigPackStructs
1014#pragma pack(push, 4)
1015#endif
1016 typedef struct {
1017 mach_msg_header_t Head;
1018 NDR_record_t NDR;
1019 kern_return_t RetCode;
1020 } __Reply__mach_vm_wire_t __attribute__((unused));
1021#ifdef __MigPackStructs
1022#pragma pack(pop)
1023#endif
1024
1025#ifdef __MigPackStructs
1026#pragma pack(push, 4)
1027#endif
1028 typedef struct {
1029 mach_msg_header_t Head;
1030 /* start of the kernel processed data */
1031 mach_msg_body_t msgh_body;
1032 mach_msg_ool_ports_descriptor_t processor_sets;
1033 /* end of the kernel processed data */
1034 NDR_record_t NDR;
1035 mach_msg_type_number_t processor_setsCnt;
1036 } __Reply__host_processor_sets_t __attribute__((unused));
1037#ifdef __MigPackStructs
1038#pragma pack(pop)
1039#endif
1040
1041#ifdef __MigPackStructs
1042#pragma pack(push, 4)
1043#endif
1044 typedef struct {
1045 mach_msg_header_t Head;
1046 /* start of the kernel processed data */
1047 mach_msg_body_t msgh_body;
1048 mach_msg_port_descriptor_t set;
1049 /* end of the kernel processed data */
1050 } __Reply__host_processor_set_priv_t __attribute__((unused));
1051#ifdef __MigPackStructs
1052#pragma pack(pop)
1053#endif
1054
1055#ifdef __MigPackStructs
1056#pragma pack(push, 4)
1057#endif
1058 typedef struct {
1059 mach_msg_header_t Head;
1060 NDR_record_t NDR;
1061 kern_return_t RetCode;
1062 } __Reply__host_set_UNDServer_t __attribute__((unused));
1063#ifdef __MigPackStructs
1064#pragma pack(pop)
1065#endif
1066
1067#ifdef __MigPackStructs
1068#pragma pack(push, 4)
1069#endif
1070 typedef struct {
1071 mach_msg_header_t Head;
1072 /* start of the kernel processed data */
1073 mach_msg_body_t msgh_body;
1074 mach_msg_port_descriptor_t server;
1075 /* end of the kernel processed data */
1076 } __Reply__host_get_UNDServer_t __attribute__((unused));
1077#ifdef __MigPackStructs
1078#pragma pack(pop)
1079#endif
1080
1081#ifdef __MigPackStructs
1082#pragma pack(push, 4)
1083#endif
1084 typedef struct {
1085 mach_msg_header_t Head;
1086 /* start of the kernel processed data */
1087 mach_msg_body_t msgh_body;
1088 mach_msg_ool_descriptor_t response_data;
1089 mach_msg_ool_descriptor_t log_data;
1090 /* end of the kernel processed data */
1091 NDR_record_t NDR;
1092 mach_msg_type_number_t response_dataCnt;
1093 mach_msg_type_number_t log_dataCnt;
1094 kern_return_t op_result;
1095 } __Reply__kext_request_t __attribute__((unused));
1096#ifdef __MigPackStructs
1097#pragma pack(pop)
1098#endif
1099#endif /* !__Reply__host_priv_subsystem__defined */
1100
1101/* union of all replies */
1102
1103#ifndef __ReplyUnion__host_priv_subsystem__defined
1104#define __ReplyUnion__host_priv_subsystem__defined
1105union __ReplyUnion__host_priv_subsystem {
1106 __Reply__host_get_boot_info_t Reply_host_get_boot_info;
1107 __Reply__host_reboot_t Reply_host_reboot;
1108 __Reply__host_priv_statistics_t Reply_host_priv_statistics;
1109 __Reply__host_default_memory_manager_t Reply_host_default_memory_manager;
1110 __Reply__vm_wire_t Reply_vm_wire;
1111 __Reply__thread_wire_t Reply_thread_wire;
1112 __Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm;
1113 __Reply__host_processors_t Reply_host_processors;
1114 __Reply__host_get_clock_control_t Reply_host_get_clock_control;
1115 __Reply__kmod_create_t Reply_kmod_create;
1116 __Reply__kmod_destroy_t Reply_kmod_destroy;
1117 __Reply__kmod_control_t Reply_kmod_control;
1118 __Reply__host_get_special_port_t Reply_host_get_special_port;
1119 __Reply__host_set_special_port_t Reply_host_set_special_port;
1120 __Reply__host_set_exception_ports_t Reply_host_set_exception_ports;
1121 __Reply__host_get_exception_ports_t Reply_host_get_exception_ports;
1122 __Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports;
1123 __Reply__mach_vm_wire_t Reply_mach_vm_wire;
1124 __Reply__host_processor_sets_t Reply_host_processor_sets;
1125 __Reply__host_processor_set_priv_t Reply_host_processor_set_priv;
1126 __Reply__host_set_UNDServer_t Reply_host_set_UNDServer;
1127 __Reply__host_get_UNDServer_t Reply_host_get_UNDServer;
1128 __Reply__kext_request_t Reply_kext_request;
1129};
1130#endif /* !__RequestUnion__host_priv_subsystem__defined */
1131
1132#ifndef subsystem_to_name_map_host_priv
1133#define subsystem_to_name_map_host_priv \
1134 { "host_get_boot_info", 400 },\
1135 { "host_reboot", 401 },\
1136 { "host_priv_statistics", 402 },\
1137 { "host_default_memory_manager", 403 },\
1138 { "vm_wire", 404 },\
1139 { "thread_wire", 405 },\
1140 { "vm_allocate_cpm", 406 },\
1141 { "host_processors", 407 },\
1142 { "host_get_clock_control", 408 },\
1143 { "kmod_create", 409 },\
1144 { "kmod_destroy", 410 },\
1145 { "kmod_control", 411 },\
1146 { "host_get_special_port", 412 },\
1147 { "host_set_special_port", 413 },\
1148 { "host_set_exception_ports", 414 },\
1149 { "host_get_exception_ports", 415 },\
1150 { "host_swap_exception_ports", 416 },\
1151 { "mach_vm_wire", 418 },\
1152 { "host_processor_sets", 419 },\
1153 { "host_processor_set_priv", 420 },\
1154 { "host_set_UNDServer", 423 },\
1155 { "host_get_UNDServer", 424 },\
1156 { "kext_request", 425 }
1157#endif
1158
1159#ifdef __AfterMigUserHeader
1160__AfterMigUserHeader
1161#endif /* __AfterMigUserHeader */
1162
1163#endif /* _host_priv_user_ */
lib/libc/include/aarch64-macos-gnu/mach/host_security.h created+221
......@@ -0,0 +1,221 @@
1#ifndef _host_security_user_
2#define _host_security_user_
3
4/* Module host_security */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef host_security_MSG_COUNT
52#define host_security_MSG_COUNT 2
53#endif /* host_security_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine host_security_create_task_token */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t host_security_create_task_token
75(
76 host_security_t host_security,
77 task_t parent_task,
78 security_token_t sec_token,
79 audit_token_t audit_token,
80 host_t host,
81 ledger_array_t ledgers,
82 mach_msg_type_number_t ledgersCnt,
83 boolean_t inherit_memory,
84 task_t *child_task
85);
86
87/* Routine host_security_set_task_token */
88#ifdef mig_external
89mig_external
90#else
91extern
92#endif /* mig_external */
93kern_return_t host_security_set_task_token
94(
95 host_security_t host_security,
96 task_t target_task,
97 security_token_t sec_token,
98 audit_token_t audit_token,
99 host_t host
100);
101
102__END_DECLS
103
104/********************** Caution **************************/
105/* The following data types should be used to calculate */
106/* maximum message sizes only. The actual message may be */
107/* smaller, and the position of the arguments within the */
108/* message layout may vary from what is presented here. */
109/* For example, if any of the arguments are variable- */
110/* sized, and less than the maximum is sent, the data */
111/* will be packed tight in the actual message to reduce */
112/* the presence of holes. */
113/********************** Caution **************************/
114
115/* typedefs for all requests */
116
117#ifndef __Request__host_security_subsystem__defined
118#define __Request__host_security_subsystem__defined
119
120#ifdef __MigPackStructs
121#pragma pack(push, 4)
122#endif
123 typedef struct {
124 mach_msg_header_t Head;
125 /* start of the kernel processed data */
126 mach_msg_body_t msgh_body;
127 mach_msg_port_descriptor_t parent_task;
128 mach_msg_port_descriptor_t host;
129 mach_msg_ool_ports_descriptor_t ledgers;
130 /* end of the kernel processed data */
131 NDR_record_t NDR;
132 security_token_t sec_token;
133 audit_token_t audit_token;
134 mach_msg_type_number_t ledgersCnt;
135 boolean_t inherit_memory;
136 } __Request__host_security_create_task_token_t __attribute__((unused));
137#ifdef __MigPackStructs
138#pragma pack(pop)
139#endif
140
141#ifdef __MigPackStructs
142#pragma pack(push, 4)
143#endif
144 typedef struct {
145 mach_msg_header_t Head;
146 /* start of the kernel processed data */
147 mach_msg_body_t msgh_body;
148 mach_msg_port_descriptor_t target_task;
149 mach_msg_port_descriptor_t host;
150 /* end of the kernel processed data */
151 NDR_record_t NDR;
152 security_token_t sec_token;
153 audit_token_t audit_token;
154 } __Request__host_security_set_task_token_t __attribute__((unused));
155#ifdef __MigPackStructs
156#pragma pack(pop)
157#endif
158#endif /* !__Request__host_security_subsystem__defined */
159
160/* union of all requests */
161
162#ifndef __RequestUnion__host_security_subsystem__defined
163#define __RequestUnion__host_security_subsystem__defined
164union __RequestUnion__host_security_subsystem {
165 __Request__host_security_create_task_token_t Request_host_security_create_task_token;
166 __Request__host_security_set_task_token_t Request_host_security_set_task_token;
167};
168#endif /* !__RequestUnion__host_security_subsystem__defined */
169/* typedefs for all replies */
170
171#ifndef __Reply__host_security_subsystem__defined
172#define __Reply__host_security_subsystem__defined
173
174#ifdef __MigPackStructs
175#pragma pack(push, 4)
176#endif
177 typedef struct {
178 mach_msg_header_t Head;
179 /* start of the kernel processed data */
180 mach_msg_body_t msgh_body;
181 mach_msg_port_descriptor_t child_task;
182 /* end of the kernel processed data */
183 } __Reply__host_security_create_task_token_t __attribute__((unused));
184#ifdef __MigPackStructs
185#pragma pack(pop)
186#endif
187
188#ifdef __MigPackStructs
189#pragma pack(push, 4)
190#endif
191 typedef struct {
192 mach_msg_header_t Head;
193 NDR_record_t NDR;
194 kern_return_t RetCode;
195 } __Reply__host_security_set_task_token_t __attribute__((unused));
196#ifdef __MigPackStructs
197#pragma pack(pop)
198#endif
199#endif /* !__Reply__host_security_subsystem__defined */
200
201/* union of all replies */
202
203#ifndef __ReplyUnion__host_security_subsystem__defined
204#define __ReplyUnion__host_security_subsystem__defined
205union __ReplyUnion__host_security_subsystem {
206 __Reply__host_security_create_task_token_t Reply_host_security_create_task_token;
207 __Reply__host_security_set_task_token_t Reply_host_security_set_task_token;
208};
209#endif /* !__RequestUnion__host_security_subsystem__defined */
210
211#ifndef subsystem_to_name_map_host_security
212#define subsystem_to_name_map_host_security \
213 { "host_security_create_task_token", 600 },\
214 { "host_security_set_task_token", 601 }
215#endif
216
217#ifdef __AfterMigUserHeader
218__AfterMigUserHeader
219#endif /* __AfterMigUserHeader */
220
221#endif /* _host_security_user_ */
lib/libc/include/aarch64-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/aarch64-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/aarch64-macos-gnu/mach/kmod.h created+180
......@@ -0,0 +1,180 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
30 * support for mandatory and extensible security protections. This notice
31 * is included in support of clause 2.2 (b) of the Apple Public License,
32 * Version 2.0.
33 */
34
35#ifndef _MACH_KMOD_H_
36#define _MACH_KMOD_H_
37
38#include <mach/kern_return.h>
39#include <mach/mach_types.h>
40
41#include <sys/cdefs.h>
42
43__BEGIN_DECLS
44
45#if PRAGMA_MARK
46#pragma mark Basic macros & typedefs
47#endif
48/***********************************************************************
49* Basic macros & typedefs
50***********************************************************************/
51#define KMOD_MAX_NAME 64
52
53#define KMOD_RETURN_SUCCESS KERN_SUCCESS
54#define KMOD_RETURN_FAILURE KERN_FAILURE
55
56typedef int kmod_t;
57
58struct kmod_info;
59typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data);
60typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data);
61
62#if PRAGMA_MARK
63#pragma mark Structure definitions
64#endif
65/***********************************************************************
66* Structure definitions
67*
68* All structures must be #pragma pack(4).
69***********************************************************************/
70#pragma pack(push, 4)
71
72/* Run-time struct only; never saved to a file */
73typedef struct kmod_reference {
74 struct kmod_reference * next;
75 struct kmod_info * info;
76} kmod_reference_t;
77
78/***********************************************************************
79* Warning: Any changes to the kmod_info structure affect the
80* KMOD_..._DECL macros below.
81***********************************************************************/
82
83/* The kmod_info_t structure is only safe to use inside the running
84 * kernel. If you need to work with a kmod_info_t structure outside
85 * the kernel, please use the compatibility definitions below.
86 */
87typedef struct kmod_info {
88 struct kmod_info * next;
89 int32_t info_version; // version of this structure
90 uint32_t id;
91 char name[KMOD_MAX_NAME];
92 char version[KMOD_MAX_NAME];
93 int32_t reference_count; // # linkage refs to this
94 kmod_reference_t * reference_list; // who this refs (links on)
95 vm_address_t address; // starting address
96 vm_size_t size; // total size
97 vm_size_t hdr_size; // unwired hdr size
98 kmod_start_func_t * start;
99 kmod_stop_func_t * stop;
100} kmod_info_t;
101
102/* A compatibility definition of kmod_info_t for 32-bit kexts.
103 */
104typedef struct kmod_info_32_v1 {
105 uint32_t next_addr;
106 int32_t info_version;
107 uint32_t id;
108 uint8_t name[KMOD_MAX_NAME];
109 uint8_t version[KMOD_MAX_NAME];
110 int32_t reference_count;
111 uint32_t reference_list_addr;
112 uint32_t address;
113 uint32_t size;
114 uint32_t hdr_size;
115 uint32_t start_addr;
116 uint32_t stop_addr;
117} kmod_info_32_v1_t;
118
119/* A compatibility definition of kmod_info_t for 64-bit kexts.
120 */
121typedef struct kmod_info_64_v1 {
122 uint64_t next_addr;
123 int32_t info_version;
124 uint32_t id;
125 uint8_t name[KMOD_MAX_NAME];
126 uint8_t version[KMOD_MAX_NAME];
127 int32_t reference_count;
128 uint64_t reference_list_addr;
129 uint64_t address;
130 uint64_t size;
131 uint64_t hdr_size;
132 uint64_t start_addr;
133 uint64_t stop_addr;
134} kmod_info_64_v1_t;
135
136#pragma pack(pop)
137
138#if PRAGMA_MARK
139#pragma mark Kmod structure declaration macros
140#endif
141/***********************************************************************
142* Kmod structure declaration macros
143***********************************************************************/
144#define KMOD_INFO_NAME kmod_info
145#define KMOD_INFO_VERSION 1
146
147#define KMOD_DECL(name, version) \
148 static kmod_start_func_t name ## _module_start; \
149 static kmod_stop_func_t name ## _module_stop; \
150 kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \
151 { #name }, { version }, -1, 0, 0, 0, 0, \
152 name ## _module_start, \
153 name ## _module_stop };
154
155#define KMOD_EXPLICIT_DECL(name, version, start, stop) \
156 kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \
157 { #name }, { version }, -1, 0, 0, 0, 0, \
158 start, stop };
159
160#if PRAGMA_MARK
161#pragma mark Kernel private declarations
162#endif
163/***********************************************************************
164* Kernel private declarations.
165***********************************************************************/
166
167
168#if PRAGMA_MARK
169#pragma mark Obsolete kmod stuff
170#endif
171/***********************************************************************
172* These 3 should be dropped but they're referenced by MIG declarations.
173***********************************************************************/
174typedef void * kmod_args_t;
175typedef int kmod_control_flavor_t;
176typedef kmod_info_t * kmod_info_array_t;
177
178__END_DECLS
179
180#endif /* _MACH_KMOD_H_ */
lib/libc/include/aarch64-macos-gnu/mach/lock_set.h created+350
......@@ -0,0 +1,350 @@
1#ifndef _lock_set_user_
2#define _lock_set_user_
3
4/* Module lock_set */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef lock_set_MSG_COUNT
52#define lock_set_MSG_COUNT 6
53#endif /* lock_set_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine lock_acquire */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t lock_acquire
75(
76 lock_set_t lock_set,
77 int lock_id
78);
79
80/* Routine lock_release */
81#ifdef mig_external
82mig_external
83#else
84extern
85#endif /* mig_external */
86kern_return_t lock_release
87(
88 lock_set_t lock_set,
89 int lock_id
90);
91
92/* Routine lock_try */
93#ifdef mig_external
94mig_external
95#else
96extern
97#endif /* mig_external */
98kern_return_t lock_try
99(
100 lock_set_t lock_set,
101 int lock_id
102);
103
104/* Routine lock_make_stable */
105#ifdef mig_external
106mig_external
107#else
108extern
109#endif /* mig_external */
110kern_return_t lock_make_stable
111(
112 lock_set_t lock_set,
113 int lock_id
114);
115
116/* Routine lock_handoff */
117#ifdef mig_external
118mig_external
119#else
120extern
121#endif /* mig_external */
122kern_return_t lock_handoff
123(
124 lock_set_t lock_set,
125 int lock_id
126);
127
128/* Routine lock_handoff_accept */
129#ifdef mig_external
130mig_external
131#else
132extern
133#endif /* mig_external */
134kern_return_t lock_handoff_accept
135(
136 lock_set_t lock_set,
137 int lock_id
138);
139
140__END_DECLS
141
142/********************** Caution **************************/
143/* The following data types should be used to calculate */
144/* maximum message sizes only. The actual message may be */
145/* smaller, and the position of the arguments within the */
146/* message layout may vary from what is presented here. */
147/* For example, if any of the arguments are variable- */
148/* sized, and less than the maximum is sent, the data */
149/* will be packed tight in the actual message to reduce */
150/* the presence of holes. */
151/********************** Caution **************************/
152
153/* typedefs for all requests */
154
155#ifndef __Request__lock_set_subsystem__defined
156#define __Request__lock_set_subsystem__defined
157
158#ifdef __MigPackStructs
159#pragma pack(push, 4)
160#endif
161 typedef struct {
162 mach_msg_header_t Head;
163 NDR_record_t NDR;
164 int lock_id;
165 } __Request__lock_acquire_t __attribute__((unused));
166#ifdef __MigPackStructs
167#pragma pack(pop)
168#endif
169
170#ifdef __MigPackStructs
171#pragma pack(push, 4)
172#endif
173 typedef struct {
174 mach_msg_header_t Head;
175 NDR_record_t NDR;
176 int lock_id;
177 } __Request__lock_release_t __attribute__((unused));
178#ifdef __MigPackStructs
179#pragma pack(pop)
180#endif
181
182#ifdef __MigPackStructs
183#pragma pack(push, 4)
184#endif
185 typedef struct {
186 mach_msg_header_t Head;
187 NDR_record_t NDR;
188 int lock_id;
189 } __Request__lock_try_t __attribute__((unused));
190#ifdef __MigPackStructs
191#pragma pack(pop)
192#endif
193
194#ifdef __MigPackStructs
195#pragma pack(push, 4)
196#endif
197 typedef struct {
198 mach_msg_header_t Head;
199 NDR_record_t NDR;
200 int lock_id;
201 } __Request__lock_make_stable_t __attribute__((unused));
202#ifdef __MigPackStructs
203#pragma pack(pop)
204#endif
205
206#ifdef __MigPackStructs
207#pragma pack(push, 4)
208#endif
209 typedef struct {
210 mach_msg_header_t Head;
211 NDR_record_t NDR;
212 int lock_id;
213 } __Request__lock_handoff_t __attribute__((unused));
214#ifdef __MigPackStructs
215#pragma pack(pop)
216#endif
217
218#ifdef __MigPackStructs
219#pragma pack(push, 4)
220#endif
221 typedef struct {
222 mach_msg_header_t Head;
223 NDR_record_t NDR;
224 int lock_id;
225 } __Request__lock_handoff_accept_t __attribute__((unused));
226#ifdef __MigPackStructs
227#pragma pack(pop)
228#endif
229#endif /* !__Request__lock_set_subsystem__defined */
230
231/* union of all requests */
232
233#ifndef __RequestUnion__lock_set_subsystem__defined
234#define __RequestUnion__lock_set_subsystem__defined
235union __RequestUnion__lock_set_subsystem {
236 __Request__lock_acquire_t Request_lock_acquire;
237 __Request__lock_release_t Request_lock_release;
238 __Request__lock_try_t Request_lock_try;
239 __Request__lock_make_stable_t Request_lock_make_stable;
240 __Request__lock_handoff_t Request_lock_handoff;
241 __Request__lock_handoff_accept_t Request_lock_handoff_accept;
242};
243#endif /* !__RequestUnion__lock_set_subsystem__defined */
244/* typedefs for all replies */
245
246#ifndef __Reply__lock_set_subsystem__defined
247#define __Reply__lock_set_subsystem__defined
248
249#ifdef __MigPackStructs
250#pragma pack(push, 4)
251#endif
252 typedef struct {
253 mach_msg_header_t Head;
254 NDR_record_t NDR;
255 kern_return_t RetCode;
256 } __Reply__lock_acquire_t __attribute__((unused));
257#ifdef __MigPackStructs
258#pragma pack(pop)
259#endif
260
261#ifdef __MigPackStructs
262#pragma pack(push, 4)
263#endif
264 typedef struct {
265 mach_msg_header_t Head;
266 NDR_record_t NDR;
267 kern_return_t RetCode;
268 } __Reply__lock_release_t __attribute__((unused));
269#ifdef __MigPackStructs
270#pragma pack(pop)
271#endif
272
273#ifdef __MigPackStructs
274#pragma pack(push, 4)
275#endif
276 typedef struct {
277 mach_msg_header_t Head;
278 NDR_record_t NDR;
279 kern_return_t RetCode;
280 } __Reply__lock_try_t __attribute__((unused));
281#ifdef __MigPackStructs
282#pragma pack(pop)
283#endif
284
285#ifdef __MigPackStructs
286#pragma pack(push, 4)
287#endif
288 typedef struct {
289 mach_msg_header_t Head;
290 NDR_record_t NDR;
291 kern_return_t RetCode;
292 } __Reply__lock_make_stable_t __attribute__((unused));
293#ifdef __MigPackStructs
294#pragma pack(pop)
295#endif
296
297#ifdef __MigPackStructs
298#pragma pack(push, 4)
299#endif
300 typedef struct {
301 mach_msg_header_t Head;
302 NDR_record_t NDR;
303 kern_return_t RetCode;
304 } __Reply__lock_handoff_t __attribute__((unused));
305#ifdef __MigPackStructs
306#pragma pack(pop)
307#endif
308
309#ifdef __MigPackStructs
310#pragma pack(push, 4)
311#endif
312 typedef struct {
313 mach_msg_header_t Head;
314 NDR_record_t NDR;
315 kern_return_t RetCode;
316 } __Reply__lock_handoff_accept_t __attribute__((unused));
317#ifdef __MigPackStructs
318#pragma pack(pop)
319#endif
320#endif /* !__Reply__lock_set_subsystem__defined */
321
322/* union of all replies */
323
324#ifndef __ReplyUnion__lock_set_subsystem__defined
325#define __ReplyUnion__lock_set_subsystem__defined
326union __ReplyUnion__lock_set_subsystem {
327 __Reply__lock_acquire_t Reply_lock_acquire;
328 __Reply__lock_release_t Reply_lock_release;
329 __Reply__lock_try_t Reply_lock_try;
330 __Reply__lock_make_stable_t Reply_lock_make_stable;
331 __Reply__lock_handoff_t Reply_lock_handoff;
332 __Reply__lock_handoff_accept_t Reply_lock_handoff_accept;
333};
334#endif /* !__RequestUnion__lock_set_subsystem__defined */
335
336#ifndef subsystem_to_name_map_lock_set
337#define subsystem_to_name_map_lock_set \
338 { "lock_acquire", 617000 },\
339 { "lock_release", 617001 },\
340 { "lock_try", 617002 },\
341 { "lock_make_stable", 617003 },\
342 { "lock_handoff", 617004 },\
343 { "lock_handoff_accept", 617005 }
344#endif
345
346#ifdef __AfterMigUserHeader
347__AfterMigUserHeader
348#endif /* __AfterMigUserHeader */
349
350#endif /* _lock_set_user_ */
lib/libc/include/aarch64-macos-gnu/mach/mach.h created+245
......@@ -0,0 +1,245 @@
1/*
2 * Copyright (c) 1999-2014 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
52 */
53
54/*
55 * Includes all the types that a normal user
56 * of Mach programs should need
57 */
58
59#ifndef _MACH_H_
60#define _MACH_H_
61
62#define __MACH30__
63#define MACH_IPC_FLAVOR UNTYPED
64
65#include <mach/std_types.h>
66#include <mach/mach_types.h>
67#include <mach/mach_interface.h>
68#include <mach/mach_port.h>
69#include <mach/mach_init.h>
70#include <mach/mach_host.h>
71#include <mach/thread_switch.h>
72
73#include <mach/rpc.h> /* for compatibility only */
74#include <mach/mig.h>
75
76#include <mach/mig_errors.h>
77#include <mach/mach_error.h>
78
79#include <sys/cdefs.h>
80
81__BEGIN_DECLS
82/*
83 * Standard prototypes
84 */
85extern void panic_init(mach_port_t);
86extern void panic(const char *, ...);
87
88extern void safe_gets(char *,
89 char *,
90 int);
91
92extern void slot_name(cpu_type_t,
93 cpu_subtype_t,
94 char **,
95 char **);
96
97extern void mig_reply_setup(mach_msg_header_t *,
98 mach_msg_header_t *);
99
100__WATCHOS_PROHIBITED __TVOS_PROHIBITED
101extern void mach_msg_destroy(mach_msg_header_t *);
102
103__WATCHOS_PROHIBITED __TVOS_PROHIBITED
104extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *);
105
106__WATCHOS_PROHIBITED __TVOS_PROHIBITED
107extern mach_msg_return_t mach_msg_send(mach_msg_header_t *);
108
109__WATCHOS_PROHIBITED __TVOS_PROHIBITED
110extern mach_msg_return_t mach_msg_server_once(boolean_t (*)
111 (mach_msg_header_t *,
112 mach_msg_header_t *),
113 mach_msg_size_t,
114 mach_port_t,
115 mach_msg_options_t);
116
117__WATCHOS_PROHIBITED __TVOS_PROHIBITED
118extern mach_msg_return_t mach_msg_server(boolean_t (*)
119 (mach_msg_header_t *,
120 mach_msg_header_t *),
121 mach_msg_size_t,
122 mach_port_t,
123 mach_msg_options_t);
124
125__WATCHOS_PROHIBITED __TVOS_PROHIBITED
126extern mach_msg_return_t mach_msg_server_importance(boolean_t (*)
127 (mach_msg_header_t *,
128 mach_msg_header_t *),
129 mach_msg_size_t,
130 mach_port_t,
131 mach_msg_options_t);
132
133/*
134 * Prototypes for compatibility
135 */
136extern kern_return_t clock_get_res(mach_port_t,
137 clock_res_t *);
138extern kern_return_t clock_set_res(mach_port_t,
139 clock_res_t);
140
141extern kern_return_t clock_sleep(mach_port_t,
142 int,
143 mach_timespec_t,
144 mach_timespec_t *);
145
146/*!
147 * @group voucher_mach_msg Prototypes
148 */
149
150#define VOUCHER_MACH_MSG_API_VERSION 20140205
151
152/*!
153 * @typedef voucher_mach_msg_state_t
154 *
155 * @abstract
156 * Opaque object encapsulating state changed by voucher_mach_msg_adopt().
157 */
158typedef struct voucher_mach_msg_state_s *voucher_mach_msg_state_t;
159
160/*!
161 * @const VOUCHER_MACH_MSG_STATE_UNCHANGED
162 *
163 * @discussion
164 * Constant indicating no state change occurred.
165 */
166#define VOUCHER_MACH_MSG_STATE_UNCHANGED ((voucher_mach_msg_state_t)~0ul)
167
168/*!
169 * @function voucher_mach_msg_set
170 *
171 * @abstract
172 * Change specified message header to contain current mach voucher with a
173 * COPY_SEND disposition.
174 * Does not change message if it already has non-zero MACH_MSGH_BITS_VOUCHER.
175 *
176 * @discussion
177 * Borrows reference to current thread voucher so message should be sent
178 * immediately (without intervening calls that might change that voucher).
179 *
180 * @param msg
181 * The message to modify.
182 *
183 * @result
184 * True if header was changed.
185 */
186extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg);
187
188/*!
189 * @function voucher_mach_msg_clear
190 *
191 * @abstract
192 * Removes changes made to specified message header by voucher_mach_msg_set()
193 * and any mach_msg() send operations (successful or not).
194 * If the message is not needed further, mach_msg_destroy() should be called
195 * instead.
196 *
197 * @discussion
198 * Not intended to be called if voucher_mach_msg_set() returned false.
199 * Releases reference to message mach voucher if an extra reference was
200 * acquired due to an unsuccessful send operation (pseudo-receive).
201 *
202 * @param msg
203 * The message to modify.
204 */
205extern void voucher_mach_msg_clear(mach_msg_header_t *msg);
206
207/*!
208 * @function voucher_mach_msg_adopt
209 *
210 * @abstract
211 * Adopt the voucher contained in the specified message on the current thread
212 * and return the previous thread voucher state.
213 *
214 * @discussion
215 * Ownership of the mach voucher in the message is transferred to the current
216 * thread and the message header voucher fields are cleared.
217 *
218 * @param msg
219 * The message to query and modify.
220 *
221 * @result
222 * The previous thread voucher state or VOUCHER_MACH_MSG_STATE_UNCHANGED if no
223 * state change occurred.
224 */
225extern voucher_mach_msg_state_t voucher_mach_msg_adopt(mach_msg_header_t *msg);
226
227/*!
228 * @function voucher_mach_msg_revert
229 *
230 * @abstract
231 * Restore thread voucher state previously modified by voucher_mach_msg_adopt().
232 *
233 * @discussion
234 * Current thread voucher reference is released.
235 * No change to thread voucher state if passed VOUCHER_MACH_MSG_STATE_UNCHANGED.
236 *
237 * @param state
238 * The thread voucher state to restore.
239 */
240
241extern void voucher_mach_msg_revert(voucher_mach_msg_state_t state);
242
243__END_DECLS
244
245#endif /* _MACH_H_ */
lib/libc/include/aarch64-macos-gnu/mach/mach_error.h created+93
......@@ -0,0 +1,93 @@
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie the
51 * rights to redistribute these changes.
52 */
53
54/*
55 * File: mach_error.h
56 * Author: Douglas Orr, Carnegie Mellon University
57 * Date: Mar. 1988
58 *
59 * Definitions of routines in mach_error.c
60 */
61
62#ifndef _MACH_ERROR_
63#define _MACH_ERROR_ 1
64
65#include <mach/error.h>
66
67#include <sys/cdefs.h>
68
69__BEGIN_DECLS
70char *mach_error_string(
71/*
72 * Returns a string appropriate to the error argument given
73 */
74 mach_error_t error_value
75 );
76
77void mach_error(
78/*
79 * Prints an appropriate message on the standard error stream
80 */
81 const char *str,
82 mach_error_t error_value
83 );
84
85char *mach_error_type(
86/*
87 * Returns a string with the error system, subsystem and code
88 */
89 mach_error_t error_value
90 );
91__END_DECLS
92
93#endif /* _MACH_ERROR_ */
lib/libc/include/aarch64-macos-gnu/mach/mach_host.h created+1295
......@@ -0,0 +1,1295 @@
1#ifndef _mach_host_user_
2#define _mach_host_user_
3
4/* Module mach_host */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef mach_host_MSG_COUNT
52#define mach_host_MSG_COUNT 35
53#endif /* mach_host_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach/mach_types.h>
60#include <mach_debug/mach_debug_types.h>
61#include <mach/mach_init.h>
62
63#ifdef __BeforeMigUserHeader
64__BeforeMigUserHeader
65#endif /* __BeforeMigUserHeader */
66
67#include <sys/cdefs.h>
68__BEGIN_DECLS
69
70
71/* Routine host_info */
72#ifdef mig_external
73mig_external
74#else
75extern
76#endif /* mig_external */
77__WATCHOS_PROHIBITED
78__TVOS_PROHIBITED
79kern_return_t host_info
80(
81 host_t host,
82 host_flavor_t flavor,
83 host_info_t host_info_out,
84 mach_msg_type_number_t *host_info_outCnt
85);
86
87/* Routine host_kernel_version */
88#ifdef mig_external
89mig_external
90#else
91extern
92#endif /* mig_external */
93kern_return_t host_kernel_version
94(
95 host_t host,
96 kernel_version_t kernel_version
97);
98
99/* Routine _host_page_size */
100#ifdef mig_external
101mig_external
102#else
103extern
104#endif /* mig_external */
105kern_return_t _host_page_size
106(
107 host_t host,
108 vm_size_t *out_page_size
109);
110
111/* Routine mach_memory_object_memory_entry */
112#ifdef mig_external
113mig_external
114#else
115extern
116#endif /* mig_external */
117kern_return_t mach_memory_object_memory_entry
118(
119 host_t host,
120 boolean_t internal,
121 vm_size_t size,
122 vm_prot_t permission,
123 memory_object_t pager,
124 mach_port_t *entry_handle
125);
126
127/* Routine host_processor_info */
128#ifdef mig_external
129mig_external
130#else
131extern
132#endif /* mig_external */
133kern_return_t host_processor_info
134(
135 host_t host,
136 processor_flavor_t flavor,
137 natural_t *out_processor_count,
138 processor_info_array_t *out_processor_info,
139 mach_msg_type_number_t *out_processor_infoCnt
140);
141
142/* Routine host_get_io_master */
143#ifdef mig_external
144mig_external
145#else
146extern
147#endif /* mig_external */
148kern_return_t host_get_io_master
149(
150 host_t host,
151 io_master_t *io_master
152);
153
154/* Routine host_get_clock_service */
155#ifdef mig_external
156mig_external
157#else
158extern
159#endif /* mig_external */
160kern_return_t host_get_clock_service
161(
162 host_t host,
163 clock_id_t clock_id,
164 clock_serv_t *clock_serv
165);
166
167/* Routine kmod_get_info */
168#ifdef mig_external
169mig_external
170#else
171extern
172#endif /* mig_external */
173kern_return_t kmod_get_info
174(
175 host_t host,
176 kmod_args_t *modules,
177 mach_msg_type_number_t *modulesCnt
178);
179
180/* Routine host_virtual_physical_table_info */
181#ifdef mig_external
182mig_external
183#else
184extern
185#endif /* mig_external */
186kern_return_t host_virtual_physical_table_info
187(
188 host_t host,
189 hash_info_bucket_array_t *info,
190 mach_msg_type_number_t *infoCnt
191);
192
193/* Routine processor_set_default */
194#ifdef mig_external
195mig_external
196#else
197extern
198#endif /* mig_external */
199kern_return_t processor_set_default
200(
201 host_t host,
202 processor_set_name_t *default_set
203);
204
205/* Routine processor_set_create */
206#ifdef mig_external
207mig_external
208#else
209extern
210#endif /* mig_external */
211kern_return_t processor_set_create
212(
213 host_t host,
214 processor_set_t *new_set,
215 processor_set_name_t *new_name
216);
217
218/* Routine mach_memory_object_memory_entry_64 */
219#ifdef mig_external
220mig_external
221#else
222extern
223#endif /* mig_external */
224kern_return_t mach_memory_object_memory_entry_64
225(
226 host_t host,
227 boolean_t internal,
228 memory_object_size_t size,
229 vm_prot_t permission,
230 memory_object_t pager,
231 mach_port_t *entry_handle
232);
233
234/* Routine host_statistics */
235#ifdef mig_external
236mig_external
237#else
238extern
239#endif /* mig_external */
240kern_return_t host_statistics
241(
242 host_t host_priv,
243 host_flavor_t flavor,
244 host_info_t host_info_out,
245 mach_msg_type_number_t *host_info_outCnt
246);
247
248/* Routine host_request_notification */
249#ifdef mig_external
250mig_external
251#else
252extern
253#endif /* mig_external */
254__WATCHOS_PROHIBITED
255__TVOS_PROHIBITED
256kern_return_t host_request_notification
257(
258 host_t host,
259 host_flavor_t notify_type,
260 mach_port_t notify_port
261);
262
263/* Routine host_lockgroup_info */
264#ifdef mig_external
265mig_external
266#else
267extern
268#endif /* mig_external */
269kern_return_t host_lockgroup_info
270(
271 host_t host,
272 lockgroup_info_array_t *lockgroup_info,
273 mach_msg_type_number_t *lockgroup_infoCnt
274);
275
276/* Routine host_statistics64 */
277#ifdef mig_external
278mig_external
279#else
280extern
281#endif /* mig_external */
282kern_return_t host_statistics64
283(
284 host_t host_priv,
285 host_flavor_t flavor,
286 host_info64_t host_info64_out,
287 mach_msg_type_number_t *host_info64_outCnt
288);
289
290/* Routine mach_zone_info */
291#ifdef mig_external
292mig_external
293#else
294extern
295#endif /* mig_external */
296kern_return_t mach_zone_info
297(
298 host_priv_t host,
299 mach_zone_name_array_t *names,
300 mach_msg_type_number_t *namesCnt,
301 mach_zone_info_array_t *info,
302 mach_msg_type_number_t *infoCnt
303);
304
305/* Routine host_create_mach_voucher */
306#ifdef mig_external
307mig_external
308#else
309extern
310#endif /* mig_external */
311__WATCHOS_PROHIBITED
312__TVOS_PROHIBITED
313kern_return_t host_create_mach_voucher
314(
315 host_t host,
316 mach_voucher_attr_raw_recipe_array_t recipes,
317 mach_msg_type_number_t recipesCnt,
318 ipc_voucher_t *voucher
319);
320
321/* Routine host_register_mach_voucher_attr_manager */
322#ifdef mig_external
323mig_external
324#else
325extern
326#endif /* mig_external */
327__WATCHOS_PROHIBITED
328__TVOS_PROHIBITED
329kern_return_t host_register_mach_voucher_attr_manager
330(
331 host_t host,
332 mach_voucher_attr_manager_t attr_manager,
333 mach_voucher_attr_value_handle_t default_value,
334 mach_voucher_attr_key_t *new_key,
335 ipc_voucher_attr_control_t *new_attr_control
336);
337
338/* Routine host_register_well_known_mach_voucher_attr_manager */
339#ifdef mig_external
340mig_external
341#else
342extern
343#endif /* mig_external */
344__WATCHOS_PROHIBITED
345__TVOS_PROHIBITED
346kern_return_t host_register_well_known_mach_voucher_attr_manager
347(
348 host_t host,
349 mach_voucher_attr_manager_t attr_manager,
350 mach_voucher_attr_value_handle_t default_value,
351 mach_voucher_attr_key_t key,
352 ipc_voucher_attr_control_t *new_attr_control
353);
354
355/* Routine host_set_atm_diagnostic_flag */
356#ifdef mig_external
357mig_external
358#else
359extern
360#endif /* mig_external */
361__WATCHOS_PROHIBITED
362__TVOS_PROHIBITED
363kern_return_t host_set_atm_diagnostic_flag
364(
365 host_t host,
366 uint32_t diagnostic_flag
367);
368
369/* Routine host_get_atm_diagnostic_flag */
370#ifdef mig_external
371mig_external
372#else
373extern
374#endif /* mig_external */
375__WATCHOS_PROHIBITED
376__TVOS_PROHIBITED
377kern_return_t host_get_atm_diagnostic_flag
378(
379 host_t host,
380 uint32_t *diagnostic_flag
381);
382
383/* Routine mach_memory_info */
384#ifdef mig_external
385mig_external
386#else
387extern
388#endif /* mig_external */
389kern_return_t mach_memory_info
390(
391 host_priv_t host,
392 mach_zone_name_array_t *names,
393 mach_msg_type_number_t *namesCnt,
394 mach_zone_info_array_t *info,
395 mach_msg_type_number_t *infoCnt,
396 mach_memory_info_array_t *memory_info,
397 mach_msg_type_number_t *memory_infoCnt
398);
399
400/* Routine host_set_multiuser_config_flags */
401#ifdef mig_external
402mig_external
403#else
404extern
405#endif /* mig_external */
406kern_return_t host_set_multiuser_config_flags
407(
408 host_priv_t host_priv,
409 uint32_t multiuser_flags
410);
411
412/* Routine host_get_multiuser_config_flags */
413#ifdef mig_external
414mig_external
415#else
416extern
417#endif /* mig_external */
418kern_return_t host_get_multiuser_config_flags
419(
420 host_t host,
421 uint32_t *multiuser_flags
422);
423
424/* Routine host_check_multiuser_mode */
425#ifdef mig_external
426mig_external
427#else
428extern
429#endif /* mig_external */
430kern_return_t host_check_multiuser_mode
431(
432 host_t host,
433 uint32_t *multiuser_mode
434);
435
436/* Routine mach_zone_info_for_zone */
437#ifdef mig_external
438mig_external
439#else
440extern
441#endif /* mig_external */
442kern_return_t mach_zone_info_for_zone
443(
444 host_priv_t host,
445 mach_zone_name_t name,
446 mach_zone_info_t *info
447);
448
449__END_DECLS
450
451/********************** Caution **************************/
452/* The following data types should be used to calculate */
453/* maximum message sizes only. The actual message may be */
454/* smaller, and the position of the arguments within the */
455/* message layout may vary from what is presented here. */
456/* For example, if any of the arguments are variable- */
457/* sized, and less than the maximum is sent, the data */
458/* will be packed tight in the actual message to reduce */
459/* the presence of holes. */
460/********************** Caution **************************/
461
462/* typedefs for all requests */
463
464#ifndef __Request__mach_host_subsystem__defined
465#define __Request__mach_host_subsystem__defined
466
467#ifdef __MigPackStructs
468#pragma pack(push, 4)
469#endif
470 typedef struct {
471 mach_msg_header_t Head;
472 NDR_record_t NDR;
473 host_flavor_t flavor;
474 mach_msg_type_number_t host_info_outCnt;
475 } __Request__host_info_t __attribute__((unused));
476#ifdef __MigPackStructs
477#pragma pack(pop)
478#endif
479
480#ifdef __MigPackStructs
481#pragma pack(push, 4)
482#endif
483 typedef struct {
484 mach_msg_header_t Head;
485 } __Request__host_kernel_version_t __attribute__((unused));
486#ifdef __MigPackStructs
487#pragma pack(pop)
488#endif
489
490#ifdef __MigPackStructs
491#pragma pack(push, 4)
492#endif
493 typedef struct {
494 mach_msg_header_t Head;
495 } __Request___host_page_size_t __attribute__((unused));
496#ifdef __MigPackStructs
497#pragma pack(pop)
498#endif
499
500#ifdef __MigPackStructs
501#pragma pack(push, 4)
502#endif
503 typedef struct {
504 mach_msg_header_t Head;
505 /* start of the kernel processed data */
506 mach_msg_body_t msgh_body;
507 mach_msg_port_descriptor_t pager;
508 /* end of the kernel processed data */
509 NDR_record_t NDR;
510 boolean_t internal;
511 vm_size_t size;
512 vm_prot_t permission;
513 } __Request__mach_memory_object_memory_entry_t __attribute__((unused));
514#ifdef __MigPackStructs
515#pragma pack(pop)
516#endif
517
518#ifdef __MigPackStructs
519#pragma pack(push, 4)
520#endif
521 typedef struct {
522 mach_msg_header_t Head;
523 NDR_record_t NDR;
524 processor_flavor_t flavor;
525 } __Request__host_processor_info_t __attribute__((unused));
526#ifdef __MigPackStructs
527#pragma pack(pop)
528#endif
529
530#ifdef __MigPackStructs
531#pragma pack(push, 4)
532#endif
533 typedef struct {
534 mach_msg_header_t Head;
535 } __Request__host_get_io_master_t __attribute__((unused));
536#ifdef __MigPackStructs
537#pragma pack(pop)
538#endif
539
540#ifdef __MigPackStructs
541#pragma pack(push, 4)
542#endif
543 typedef struct {
544 mach_msg_header_t Head;
545 NDR_record_t NDR;
546 clock_id_t clock_id;
547 } __Request__host_get_clock_service_t __attribute__((unused));
548#ifdef __MigPackStructs
549#pragma pack(pop)
550#endif
551
552#ifdef __MigPackStructs
553#pragma pack(push, 4)
554#endif
555 typedef struct {
556 mach_msg_header_t Head;
557 } __Request__kmod_get_info_t __attribute__((unused));
558#ifdef __MigPackStructs
559#pragma pack(pop)
560#endif
561
562#ifdef __MigPackStructs
563#pragma pack(push, 4)
564#endif
565 typedef struct {
566 mach_msg_header_t Head;
567 } __Request__host_virtual_physical_table_info_t __attribute__((unused));
568#ifdef __MigPackStructs
569#pragma pack(pop)
570#endif
571
572#ifdef __MigPackStructs
573#pragma pack(push, 4)
574#endif
575 typedef struct {
576 mach_msg_header_t Head;
577 } __Request__processor_set_default_t __attribute__((unused));
578#ifdef __MigPackStructs
579#pragma pack(pop)
580#endif
581
582#ifdef __MigPackStructs
583#pragma pack(push, 4)
584#endif
585 typedef struct {
586 mach_msg_header_t Head;
587 } __Request__processor_set_create_t __attribute__((unused));
588#ifdef __MigPackStructs
589#pragma pack(pop)
590#endif
591
592#ifdef __MigPackStructs
593#pragma pack(push, 4)
594#endif
595 typedef struct {
596 mach_msg_header_t Head;
597 /* start of the kernel processed data */
598 mach_msg_body_t msgh_body;
599 mach_msg_port_descriptor_t pager;
600 /* end of the kernel processed data */
601 NDR_record_t NDR;
602 boolean_t internal;
603 memory_object_size_t size;
604 vm_prot_t permission;
605 } __Request__mach_memory_object_memory_entry_64_t __attribute__((unused));
606#ifdef __MigPackStructs
607#pragma pack(pop)
608#endif
609
610#ifdef __MigPackStructs
611#pragma pack(push, 4)
612#endif
613 typedef struct {
614 mach_msg_header_t Head;
615 NDR_record_t NDR;
616 host_flavor_t flavor;
617 mach_msg_type_number_t host_info_outCnt;
618 } __Request__host_statistics_t __attribute__((unused));
619#ifdef __MigPackStructs
620#pragma pack(pop)
621#endif
622
623#ifdef __MigPackStructs
624#pragma pack(push, 4)
625#endif
626 typedef struct {
627 mach_msg_header_t Head;
628 /* start of the kernel processed data */
629 mach_msg_body_t msgh_body;
630 mach_msg_port_descriptor_t notify_port;
631 /* end of the kernel processed data */
632 NDR_record_t NDR;
633 host_flavor_t notify_type;
634 } __Request__host_request_notification_t __attribute__((unused));
635#ifdef __MigPackStructs
636#pragma pack(pop)
637#endif
638
639#ifdef __MigPackStructs
640#pragma pack(push, 4)
641#endif
642 typedef struct {
643 mach_msg_header_t Head;
644 } __Request__host_lockgroup_info_t __attribute__((unused));
645#ifdef __MigPackStructs
646#pragma pack(pop)
647#endif
648
649#ifdef __MigPackStructs
650#pragma pack(push, 4)
651#endif
652 typedef struct {
653 mach_msg_header_t Head;
654 NDR_record_t NDR;
655 host_flavor_t flavor;
656 mach_msg_type_number_t host_info64_outCnt;
657 } __Request__host_statistics64_t __attribute__((unused));
658#ifdef __MigPackStructs
659#pragma pack(pop)
660#endif
661
662#ifdef __MigPackStructs
663#pragma pack(push, 4)
664#endif
665 typedef struct {
666 mach_msg_header_t Head;
667 } __Request__mach_zone_info_t __attribute__((unused));
668#ifdef __MigPackStructs
669#pragma pack(pop)
670#endif
671
672#ifdef __MigPackStructs
673#pragma pack(push, 4)
674#endif
675 typedef struct {
676 mach_msg_header_t Head;
677 NDR_record_t NDR;
678 mach_msg_type_number_t recipesCnt;
679 uint8_t recipes[5120];
680 } __Request__host_create_mach_voucher_t __attribute__((unused));
681#ifdef __MigPackStructs
682#pragma pack(pop)
683#endif
684
685#ifdef __MigPackStructs
686#pragma pack(push, 4)
687#endif
688 typedef struct {
689 mach_msg_header_t Head;
690 /* start of the kernel processed data */
691 mach_msg_body_t msgh_body;
692 mach_msg_port_descriptor_t attr_manager;
693 /* end of the kernel processed data */
694 NDR_record_t NDR;
695 mach_voucher_attr_value_handle_t default_value;
696 } __Request__host_register_mach_voucher_attr_manager_t __attribute__((unused));
697#ifdef __MigPackStructs
698#pragma pack(pop)
699#endif
700
701#ifdef __MigPackStructs
702#pragma pack(push, 4)
703#endif
704 typedef struct {
705 mach_msg_header_t Head;
706 /* start of the kernel processed data */
707 mach_msg_body_t msgh_body;
708 mach_msg_port_descriptor_t attr_manager;
709 /* end of the kernel processed data */
710 NDR_record_t NDR;
711 mach_voucher_attr_value_handle_t default_value;
712 mach_voucher_attr_key_t key;
713 } __Request__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
714#ifdef __MigPackStructs
715#pragma pack(pop)
716#endif
717
718#ifdef __MigPackStructs
719#pragma pack(push, 4)
720#endif
721 typedef struct {
722 mach_msg_header_t Head;
723 NDR_record_t NDR;
724 uint32_t diagnostic_flag;
725 } __Request__host_set_atm_diagnostic_flag_t __attribute__((unused));
726#ifdef __MigPackStructs
727#pragma pack(pop)
728#endif
729
730#ifdef __MigPackStructs
731#pragma pack(push, 4)
732#endif
733 typedef struct {
734 mach_msg_header_t Head;
735 } __Request__host_get_atm_diagnostic_flag_t __attribute__((unused));
736#ifdef __MigPackStructs
737#pragma pack(pop)
738#endif
739
740#ifdef __MigPackStructs
741#pragma pack(push, 4)
742#endif
743 typedef struct {
744 mach_msg_header_t Head;
745 } __Request__mach_memory_info_t __attribute__((unused));
746#ifdef __MigPackStructs
747#pragma pack(pop)
748#endif
749
750#ifdef __MigPackStructs
751#pragma pack(push, 4)
752#endif
753 typedef struct {
754 mach_msg_header_t Head;
755 NDR_record_t NDR;
756 uint32_t multiuser_flags;
757 } __Request__host_set_multiuser_config_flags_t __attribute__((unused));
758#ifdef __MigPackStructs
759#pragma pack(pop)
760#endif
761
762#ifdef __MigPackStructs
763#pragma pack(push, 4)
764#endif
765 typedef struct {
766 mach_msg_header_t Head;
767 } __Request__host_get_multiuser_config_flags_t __attribute__((unused));
768#ifdef __MigPackStructs
769#pragma pack(pop)
770#endif
771
772#ifdef __MigPackStructs
773#pragma pack(push, 4)
774#endif
775 typedef struct {
776 mach_msg_header_t Head;
777 } __Request__host_check_multiuser_mode_t __attribute__((unused));
778#ifdef __MigPackStructs
779#pragma pack(pop)
780#endif
781
782#ifdef __MigPackStructs
783#pragma pack(push, 4)
784#endif
785 typedef struct {
786 mach_msg_header_t Head;
787 NDR_record_t NDR;
788 mach_zone_name_t name;
789 } __Request__mach_zone_info_for_zone_t __attribute__((unused));
790#ifdef __MigPackStructs
791#pragma pack(pop)
792#endif
793#endif /* !__Request__mach_host_subsystem__defined */
794
795/* union of all requests */
796
797#ifndef __RequestUnion__mach_host_subsystem__defined
798#define __RequestUnion__mach_host_subsystem__defined
799union __RequestUnion__mach_host_subsystem {
800 __Request__host_info_t Request_host_info;
801 __Request__host_kernel_version_t Request_host_kernel_version;
802 __Request___host_page_size_t Request__host_page_size;
803 __Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry;
804 __Request__host_processor_info_t Request_host_processor_info;
805 __Request__host_get_io_master_t Request_host_get_io_master;
806 __Request__host_get_clock_service_t Request_host_get_clock_service;
807 __Request__kmod_get_info_t Request_kmod_get_info;
808 __Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info;
809 __Request__processor_set_default_t Request_processor_set_default;
810 __Request__processor_set_create_t Request_processor_set_create;
811 __Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64;
812 __Request__host_statistics_t Request_host_statistics;
813 __Request__host_request_notification_t Request_host_request_notification;
814 __Request__host_lockgroup_info_t Request_host_lockgroup_info;
815 __Request__host_statistics64_t Request_host_statistics64;
816 __Request__mach_zone_info_t Request_mach_zone_info;
817 __Request__host_create_mach_voucher_t Request_host_create_mach_voucher;
818 __Request__host_register_mach_voucher_attr_manager_t Request_host_register_mach_voucher_attr_manager;
819 __Request__host_register_well_known_mach_voucher_attr_manager_t Request_host_register_well_known_mach_voucher_attr_manager;
820 __Request__host_set_atm_diagnostic_flag_t Request_host_set_atm_diagnostic_flag;
821 __Request__host_get_atm_diagnostic_flag_t Request_host_get_atm_diagnostic_flag;
822 __Request__mach_memory_info_t Request_mach_memory_info;
823 __Request__host_set_multiuser_config_flags_t Request_host_set_multiuser_config_flags;
824 __Request__host_get_multiuser_config_flags_t Request_host_get_multiuser_config_flags;
825 __Request__host_check_multiuser_mode_t Request_host_check_multiuser_mode;
826 __Request__mach_zone_info_for_zone_t Request_mach_zone_info_for_zone;
827};
828#endif /* !__RequestUnion__mach_host_subsystem__defined */
829/* typedefs for all replies */
830
831#ifndef __Reply__mach_host_subsystem__defined
832#define __Reply__mach_host_subsystem__defined
833
834#ifdef __MigPackStructs
835#pragma pack(push, 4)
836#endif
837 typedef struct {
838 mach_msg_header_t Head;
839 NDR_record_t NDR;
840 kern_return_t RetCode;
841 mach_msg_type_number_t host_info_outCnt;
842 integer_t host_info_out[68];
843 } __Reply__host_info_t __attribute__((unused));
844#ifdef __MigPackStructs
845#pragma pack(pop)
846#endif
847
848#ifdef __MigPackStructs
849#pragma pack(push, 4)
850#endif
851 typedef struct {
852 mach_msg_header_t Head;
853 NDR_record_t NDR;
854 kern_return_t RetCode;
855 mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */
856 mach_msg_type_number_t kernel_versionCnt;
857 char kernel_version[512];
858 } __Reply__host_kernel_version_t __attribute__((unused));
859#ifdef __MigPackStructs
860#pragma pack(pop)
861#endif
862
863#ifdef __MigPackStructs
864#pragma pack(push, 4)
865#endif
866 typedef struct {
867 mach_msg_header_t Head;
868 NDR_record_t NDR;
869 kern_return_t RetCode;
870 vm_size_t out_page_size;
871 } __Reply___host_page_size_t __attribute__((unused));
872#ifdef __MigPackStructs
873#pragma pack(pop)
874#endif
875
876#ifdef __MigPackStructs
877#pragma pack(push, 4)
878#endif
879 typedef struct {
880 mach_msg_header_t Head;
881 /* start of the kernel processed data */
882 mach_msg_body_t msgh_body;
883 mach_msg_port_descriptor_t entry_handle;
884 /* end of the kernel processed data */
885 } __Reply__mach_memory_object_memory_entry_t __attribute__((unused));
886#ifdef __MigPackStructs
887#pragma pack(pop)
888#endif
889
890#ifdef __MigPackStructs
891#pragma pack(push, 4)
892#endif
893 typedef struct {
894 mach_msg_header_t Head;
895 /* start of the kernel processed data */
896 mach_msg_body_t msgh_body;
897 mach_msg_ool_descriptor_t out_processor_info;
898 /* end of the kernel processed data */
899 NDR_record_t NDR;
900 natural_t out_processor_count;
901 mach_msg_type_number_t out_processor_infoCnt;
902 } __Reply__host_processor_info_t __attribute__((unused));
903#ifdef __MigPackStructs
904#pragma pack(pop)
905#endif
906
907#ifdef __MigPackStructs
908#pragma pack(push, 4)
909#endif
910 typedef struct {
911 mach_msg_header_t Head;
912 /* start of the kernel processed data */
913 mach_msg_body_t msgh_body;
914 mach_msg_port_descriptor_t io_master;
915 /* end of the kernel processed data */
916 } __Reply__host_get_io_master_t __attribute__((unused));
917#ifdef __MigPackStructs
918#pragma pack(pop)
919#endif
920
921#ifdef __MigPackStructs
922#pragma pack(push, 4)
923#endif
924 typedef struct {
925 mach_msg_header_t Head;
926 /* start of the kernel processed data */
927 mach_msg_body_t msgh_body;
928 mach_msg_port_descriptor_t clock_serv;
929 /* end of the kernel processed data */
930 } __Reply__host_get_clock_service_t __attribute__((unused));
931#ifdef __MigPackStructs
932#pragma pack(pop)
933#endif
934
935#ifdef __MigPackStructs
936#pragma pack(push, 4)
937#endif
938 typedef struct {
939 mach_msg_header_t Head;
940 /* start of the kernel processed data */
941 mach_msg_body_t msgh_body;
942 mach_msg_ool_descriptor_t modules;
943 /* end of the kernel processed data */
944 NDR_record_t NDR;
945 mach_msg_type_number_t modulesCnt;
946 } __Reply__kmod_get_info_t __attribute__((unused));
947#ifdef __MigPackStructs
948#pragma pack(pop)
949#endif
950
951#ifdef __MigPackStructs
952#pragma pack(push, 4)
953#endif
954 typedef struct {
955 mach_msg_header_t Head;
956 /* start of the kernel processed data */
957 mach_msg_body_t msgh_body;
958 mach_msg_ool_descriptor_t info;
959 /* end of the kernel processed data */
960 NDR_record_t NDR;
961 mach_msg_type_number_t infoCnt;
962 } __Reply__host_virtual_physical_table_info_t __attribute__((unused));
963#ifdef __MigPackStructs
964#pragma pack(pop)
965#endif
966
967#ifdef __MigPackStructs
968#pragma pack(push, 4)
969#endif
970 typedef struct {
971 mach_msg_header_t Head;
972 /* start of the kernel processed data */
973 mach_msg_body_t msgh_body;
974 mach_msg_port_descriptor_t default_set;
975 /* end of the kernel processed data */
976 } __Reply__processor_set_default_t __attribute__((unused));
977#ifdef __MigPackStructs
978#pragma pack(pop)
979#endif
980
981#ifdef __MigPackStructs
982#pragma pack(push, 4)
983#endif
984 typedef struct {
985 mach_msg_header_t Head;
986 /* start of the kernel processed data */
987 mach_msg_body_t msgh_body;
988 mach_msg_port_descriptor_t new_set;
989 mach_msg_port_descriptor_t new_name;
990 /* end of the kernel processed data */
991 } __Reply__processor_set_create_t __attribute__((unused));
992#ifdef __MigPackStructs
993#pragma pack(pop)
994#endif
995
996#ifdef __MigPackStructs
997#pragma pack(push, 4)
998#endif
999 typedef struct {
1000 mach_msg_header_t Head;
1001 /* start of the kernel processed data */
1002 mach_msg_body_t msgh_body;
1003 mach_msg_port_descriptor_t entry_handle;
1004 /* end of the kernel processed data */
1005 } __Reply__mach_memory_object_memory_entry_64_t __attribute__((unused));
1006#ifdef __MigPackStructs
1007#pragma pack(pop)
1008#endif
1009
1010#ifdef __MigPackStructs
1011#pragma pack(push, 4)
1012#endif
1013 typedef struct {
1014 mach_msg_header_t Head;
1015 NDR_record_t NDR;
1016 kern_return_t RetCode;
1017 mach_msg_type_number_t host_info_outCnt;
1018 integer_t host_info_out[68];
1019 } __Reply__host_statistics_t __attribute__((unused));
1020#ifdef __MigPackStructs
1021#pragma pack(pop)
1022#endif
1023
1024#ifdef __MigPackStructs
1025#pragma pack(push, 4)
1026#endif
1027 typedef struct {
1028 mach_msg_header_t Head;
1029 NDR_record_t NDR;
1030 kern_return_t RetCode;
1031 } __Reply__host_request_notification_t __attribute__((unused));
1032#ifdef __MigPackStructs
1033#pragma pack(pop)
1034#endif
1035
1036#ifdef __MigPackStructs
1037#pragma pack(push, 4)
1038#endif
1039 typedef struct {
1040 mach_msg_header_t Head;
1041 /* start of the kernel processed data */
1042 mach_msg_body_t msgh_body;
1043 mach_msg_ool_descriptor_t lockgroup_info;
1044 /* end of the kernel processed data */
1045 NDR_record_t NDR;
1046 mach_msg_type_number_t lockgroup_infoCnt;
1047 } __Reply__host_lockgroup_info_t __attribute__((unused));
1048#ifdef __MigPackStructs
1049#pragma pack(pop)
1050#endif
1051
1052#ifdef __MigPackStructs
1053#pragma pack(push, 4)
1054#endif
1055 typedef struct {
1056 mach_msg_header_t Head;
1057 NDR_record_t NDR;
1058 kern_return_t RetCode;
1059 mach_msg_type_number_t host_info64_outCnt;
1060 integer_t host_info64_out[256];
1061 } __Reply__host_statistics64_t __attribute__((unused));
1062#ifdef __MigPackStructs
1063#pragma pack(pop)
1064#endif
1065
1066#ifdef __MigPackStructs
1067#pragma pack(push, 4)
1068#endif
1069 typedef struct {
1070 mach_msg_header_t Head;
1071 /* start of the kernel processed data */
1072 mach_msg_body_t msgh_body;
1073 mach_msg_ool_descriptor_t names;
1074 mach_msg_ool_descriptor_t info;
1075 /* end of the kernel processed data */
1076 NDR_record_t NDR;
1077 mach_msg_type_number_t namesCnt;
1078 mach_msg_type_number_t infoCnt;
1079 } __Reply__mach_zone_info_t __attribute__((unused));
1080#ifdef __MigPackStructs
1081#pragma pack(pop)
1082#endif
1083
1084#ifdef __MigPackStructs
1085#pragma pack(push, 4)
1086#endif
1087 typedef struct {
1088 mach_msg_header_t Head;
1089 /* start of the kernel processed data */
1090 mach_msg_body_t msgh_body;
1091 mach_msg_port_descriptor_t voucher;
1092 /* end of the kernel processed data */
1093 } __Reply__host_create_mach_voucher_t __attribute__((unused));
1094#ifdef __MigPackStructs
1095#pragma pack(pop)
1096#endif
1097
1098#ifdef __MigPackStructs
1099#pragma pack(push, 4)
1100#endif
1101 typedef struct {
1102 mach_msg_header_t Head;
1103 /* start of the kernel processed data */
1104 mach_msg_body_t msgh_body;
1105 mach_msg_port_descriptor_t new_attr_control;
1106 /* end of the kernel processed data */
1107 NDR_record_t NDR;
1108 mach_voucher_attr_key_t new_key;
1109 } __Reply__host_register_mach_voucher_attr_manager_t __attribute__((unused));
1110#ifdef __MigPackStructs
1111#pragma pack(pop)
1112#endif
1113
1114#ifdef __MigPackStructs
1115#pragma pack(push, 4)
1116#endif
1117 typedef struct {
1118 mach_msg_header_t Head;
1119 /* start of the kernel processed data */
1120 mach_msg_body_t msgh_body;
1121 mach_msg_port_descriptor_t new_attr_control;
1122 /* end of the kernel processed data */
1123 } __Reply__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
1124#ifdef __MigPackStructs
1125#pragma pack(pop)
1126#endif
1127
1128#ifdef __MigPackStructs
1129#pragma pack(push, 4)
1130#endif
1131 typedef struct {
1132 mach_msg_header_t Head;
1133 NDR_record_t NDR;
1134 kern_return_t RetCode;
1135 } __Reply__host_set_atm_diagnostic_flag_t __attribute__((unused));
1136#ifdef __MigPackStructs
1137#pragma pack(pop)
1138#endif
1139
1140#ifdef __MigPackStructs
1141#pragma pack(push, 4)
1142#endif
1143 typedef struct {
1144 mach_msg_header_t Head;
1145 NDR_record_t NDR;
1146 kern_return_t RetCode;
1147 uint32_t diagnostic_flag;
1148 } __Reply__host_get_atm_diagnostic_flag_t __attribute__((unused));
1149#ifdef __MigPackStructs
1150#pragma pack(pop)
1151#endif
1152
1153#ifdef __MigPackStructs
1154#pragma pack(push, 4)
1155#endif
1156 typedef struct {
1157 mach_msg_header_t Head;
1158 /* start of the kernel processed data */
1159 mach_msg_body_t msgh_body;
1160 mach_msg_ool_descriptor_t names;
1161 mach_msg_ool_descriptor_t info;
1162 mach_msg_ool_descriptor_t memory_info;
1163 /* end of the kernel processed data */
1164 NDR_record_t NDR;
1165 mach_msg_type_number_t namesCnt;
1166 mach_msg_type_number_t infoCnt;
1167 mach_msg_type_number_t memory_infoCnt;
1168 } __Reply__mach_memory_info_t __attribute__((unused));
1169#ifdef __MigPackStructs
1170#pragma pack(pop)
1171#endif
1172
1173#ifdef __MigPackStructs
1174#pragma pack(push, 4)
1175#endif
1176 typedef struct {
1177 mach_msg_header_t Head;
1178 NDR_record_t NDR;
1179 kern_return_t RetCode;
1180 } __Reply__host_set_multiuser_config_flags_t __attribute__((unused));
1181#ifdef __MigPackStructs
1182#pragma pack(pop)
1183#endif
1184
1185#ifdef __MigPackStructs
1186#pragma pack(push, 4)
1187#endif
1188 typedef struct {
1189 mach_msg_header_t Head;
1190 NDR_record_t NDR;
1191 kern_return_t RetCode;
1192 uint32_t multiuser_flags;
1193 } __Reply__host_get_multiuser_config_flags_t __attribute__((unused));
1194#ifdef __MigPackStructs
1195#pragma pack(pop)
1196#endif
1197
1198#ifdef __MigPackStructs
1199#pragma pack(push, 4)
1200#endif
1201 typedef struct {
1202 mach_msg_header_t Head;
1203 NDR_record_t NDR;
1204 kern_return_t RetCode;
1205 uint32_t multiuser_mode;
1206 } __Reply__host_check_multiuser_mode_t __attribute__((unused));
1207#ifdef __MigPackStructs
1208#pragma pack(pop)
1209#endif
1210
1211#ifdef __MigPackStructs
1212#pragma pack(push, 4)
1213#endif
1214 typedef struct {
1215 mach_msg_header_t Head;
1216 NDR_record_t NDR;
1217 kern_return_t RetCode;
1218 mach_zone_info_t info;
1219 } __Reply__mach_zone_info_for_zone_t __attribute__((unused));
1220#ifdef __MigPackStructs
1221#pragma pack(pop)
1222#endif
1223#endif /* !__Reply__mach_host_subsystem__defined */
1224
1225/* union of all replies */
1226
1227#ifndef __ReplyUnion__mach_host_subsystem__defined
1228#define __ReplyUnion__mach_host_subsystem__defined
1229union __ReplyUnion__mach_host_subsystem {
1230 __Reply__host_info_t Reply_host_info;
1231 __Reply__host_kernel_version_t Reply_host_kernel_version;
1232 __Reply___host_page_size_t Reply__host_page_size;
1233 __Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry;
1234 __Reply__host_processor_info_t Reply_host_processor_info;
1235 __Reply__host_get_io_master_t Reply_host_get_io_master;
1236 __Reply__host_get_clock_service_t Reply_host_get_clock_service;
1237 __Reply__kmod_get_info_t Reply_kmod_get_info;
1238 __Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info;
1239 __Reply__processor_set_default_t Reply_processor_set_default;
1240 __Reply__processor_set_create_t Reply_processor_set_create;
1241 __Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64;
1242 __Reply__host_statistics_t Reply_host_statistics;
1243 __Reply__host_request_notification_t Reply_host_request_notification;
1244 __Reply__host_lockgroup_info_t Reply_host_lockgroup_info;
1245 __Reply__host_statistics64_t Reply_host_statistics64;
1246 __Reply__mach_zone_info_t Reply_mach_zone_info;
1247 __Reply__host_create_mach_voucher_t Reply_host_create_mach_voucher;
1248 __Reply__host_register_mach_voucher_attr_manager_t Reply_host_register_mach_voucher_attr_manager;
1249 __Reply__host_register_well_known_mach_voucher_attr_manager_t Reply_host_register_well_known_mach_voucher_attr_manager;
1250 __Reply__host_set_atm_diagnostic_flag_t Reply_host_set_atm_diagnostic_flag;
1251 __Reply__host_get_atm_diagnostic_flag_t Reply_host_get_atm_diagnostic_flag;
1252 __Reply__mach_memory_info_t Reply_mach_memory_info;
1253 __Reply__host_set_multiuser_config_flags_t Reply_host_set_multiuser_config_flags;
1254 __Reply__host_get_multiuser_config_flags_t Reply_host_get_multiuser_config_flags;
1255 __Reply__host_check_multiuser_mode_t Reply_host_check_multiuser_mode;
1256 __Reply__mach_zone_info_for_zone_t Reply_mach_zone_info_for_zone;
1257};
1258#endif /* !__RequestUnion__mach_host_subsystem__defined */
1259
1260#ifndef subsystem_to_name_map_mach_host
1261#define subsystem_to_name_map_mach_host \
1262 { "host_info", 200 },\
1263 { "host_kernel_version", 201 },\
1264 { "_host_page_size", 202 },\
1265 { "mach_memory_object_memory_entry", 203 },\
1266 { "host_processor_info", 204 },\
1267 { "host_get_io_master", 205 },\
1268 { "host_get_clock_service", 206 },\
1269 { "kmod_get_info", 207 },\
1270 { "host_virtual_physical_table_info", 209 },\
1271 { "processor_set_default", 213 },\
1272 { "processor_set_create", 214 },\
1273 { "mach_memory_object_memory_entry_64", 215 },\
1274 { "host_statistics", 216 },\
1275 { "host_request_notification", 217 },\
1276 { "host_lockgroup_info", 218 },\
1277 { "host_statistics64", 219 },\
1278 { "mach_zone_info", 220 },\
1279 { "host_create_mach_voucher", 222 },\
1280 { "host_register_mach_voucher_attr_manager", 223 },\
1281 { "host_register_well_known_mach_voucher_attr_manager", 224 },\
1282 { "host_set_atm_diagnostic_flag", 225 },\
1283 { "host_get_atm_diagnostic_flag", 226 },\
1284 { "mach_memory_info", 227 },\
1285 { "host_set_multiuser_config_flags", 228 },\
1286 { "host_get_multiuser_config_flags", 229 },\
1287 { "host_check_multiuser_mode", 230 },\
1288 { "mach_zone_info_for_zone", 231 }
1289#endif
1290
1291#ifdef __AfterMigUserHeader
1292__AfterMigUserHeader
1293#endif /* __AfterMigUserHeader */
1294
1295#endif /* _mach_host_user_ */
lib/libc/include/aarch64-macos-gnu/mach/mach_init.h created+110
......@@ -0,0 +1,110 @@
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
52 */
53
54/*
55 * Items provided by the Mach environment initialization.
56 */
57
58#ifndef _MACH_INIT_
59#define _MACH_INIT_ 1
60
61#include <mach/mach_types.h>
62#include <mach/vm_page_size.h>
63#include <stdarg.h>
64
65#include <sys/cdefs.h>
66
67/*
68 * Kernel-related ports; how a task/thread controls itself
69 */
70
71__BEGIN_DECLS
72extern mach_port_t mach_host_self(void);
73extern mach_port_t mach_thread_self(void);
74extern kern_return_t host_page_size(host_t, vm_size_t *);
75
76extern mach_port_t mach_task_self_;
77#define mach_task_self() mach_task_self_
78#define current_task() mach_task_self()
79
80__END_DECLS
81#include <mach/mach_traps.h>
82__BEGIN_DECLS
83
84/*
85 * Other important ports in the Mach user environment
86 */
87
88extern mach_port_t bootstrap_port;
89
90/*
91 * Where these ports occur in the "mach_ports_register"
92 * collection... only servers or the runtime library need know.
93 */
94
95#define NAME_SERVER_SLOT 0
96#define ENVIRONMENT_SLOT 1
97#define SERVICE_SLOT 2
98
99#define MACH_PORTS_SLOTS_USED 3
100
101/*
102 * fprintf_stderr uses vprintf_stderr_func to produce
103 * error messages, this can be overridden by a user
104 * application to point to a user-specified output function
105 */
106extern int (*vprintf_stderr_func)(const char *format, va_list ap);
107
108__END_DECLS
109
110#endif /* _MACH_INIT_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/mach/mach_port.h created+1808
......@@ -0,0 +1,1808 @@
1#ifndef _mach_port_user_
2#define _mach_port_user_
3
4/* Module mach_port */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef mach_port_MSG_COUNT
52#define mach_port_MSG_COUNT 40
53#endif /* mach_port_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach_debug/mach_debug_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine mach_port_names */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t mach_port_names
76(
77 ipc_space_t task,
78 mach_port_name_array_t *names,
79 mach_msg_type_number_t *namesCnt,
80 mach_port_type_array_t *types,
81 mach_msg_type_number_t *typesCnt
82);
83
84/* Routine mach_port_type */
85#ifdef mig_external
86mig_external
87#else
88extern
89#endif /* mig_external */
90kern_return_t mach_port_type
91(
92 ipc_space_t task,
93 mach_port_name_t name,
94 mach_port_type_t *ptype
95);
96
97/* Routine mach_port_rename */
98#ifdef mig_external
99mig_external
100#else
101extern
102#endif /* mig_external */
103kern_return_t mach_port_rename
104(
105 ipc_space_t task,
106 mach_port_name_t old_name,
107 mach_port_name_t new_name
108);
109
110/* Routine mach_port_allocate_name */
111#ifdef mig_external
112mig_external
113#else
114extern
115#endif /* mig_external */
116__WATCHOS_PROHIBITED
117__TVOS_PROHIBITED
118kern_return_t mach_port_allocate_name
119(
120 ipc_space_t task,
121 mach_port_right_t right,
122 mach_port_name_t name
123);
124
125/* Routine mach_port_allocate */
126#ifdef mig_external
127mig_external
128#else
129extern
130#endif /* mig_external */
131kern_return_t mach_port_allocate
132(
133 ipc_space_t task,
134 mach_port_right_t right,
135 mach_port_name_t *name
136);
137
138/* Routine mach_port_destroy */
139#ifdef mig_external
140mig_external
141#else
142extern
143#endif /* mig_external */
144kern_return_t mach_port_destroy
145(
146 ipc_space_t task,
147 mach_port_name_t name
148);
149
150/* Routine mach_port_deallocate */
151#ifdef mig_external
152mig_external
153#else
154extern
155#endif /* mig_external */
156kern_return_t mach_port_deallocate
157(
158 ipc_space_t task,
159 mach_port_name_t name
160);
161
162/* Routine mach_port_get_refs */
163#ifdef mig_external
164mig_external
165#else
166extern
167#endif /* mig_external */
168kern_return_t mach_port_get_refs
169(
170 ipc_space_t task,
171 mach_port_name_t name,
172 mach_port_right_t right,
173 mach_port_urefs_t *refs
174);
175
176/* Routine mach_port_mod_refs */
177#ifdef mig_external
178mig_external
179#else
180extern
181#endif /* mig_external */
182kern_return_t mach_port_mod_refs
183(
184 ipc_space_t task,
185 mach_port_name_t name,
186 mach_port_right_t right,
187 mach_port_delta_t delta
188);
189
190/* Routine mach_port_peek */
191#ifdef mig_external
192mig_external
193#else
194extern
195#endif /* mig_external */
196kern_return_t mach_port_peek
197(
198 ipc_space_t task,
199 mach_port_name_t name,
200 mach_msg_trailer_type_t trailer_type,
201 mach_port_seqno_t *request_seqnop,
202 mach_msg_size_t *msg_sizep,
203 mach_msg_id_t *msg_idp,
204 mach_msg_trailer_info_t trailer_infop,
205 mach_msg_type_number_t *trailer_infopCnt
206);
207
208/* Routine mach_port_set_mscount */
209#ifdef mig_external
210mig_external
211#else
212extern
213#endif /* mig_external */
214kern_return_t mach_port_set_mscount
215(
216 ipc_space_t task,
217 mach_port_name_t name,
218 mach_port_mscount_t mscount
219);
220
221/* Routine mach_port_get_set_status */
222#ifdef mig_external
223mig_external
224#else
225extern
226#endif /* mig_external */
227kern_return_t mach_port_get_set_status
228(
229 ipc_space_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
237mig_external
238#else
239extern
240#endif /* mig_external */
241kern_return_t mach_port_move_member
242(
243 ipc_space_t task,
244 mach_port_name_t member,
245 mach_port_name_t after
246);
247
248/* Routine mach_port_request_notification */
249#ifdef mig_external
250mig_external
251#else
252extern
253#endif /* mig_external */
254kern_return_t mach_port_request_notification
255(
256 ipc_space_t task,
257 mach_port_name_t name,
258 mach_msg_id_t msgid,
259 mach_port_mscount_t sync,
260 mach_port_t notify,
261 mach_msg_type_name_t notifyPoly,
262 mach_port_t *previous
263);
264
265/* Routine mach_port_insert_right */
266#ifdef mig_external
267mig_external
268#else
269extern
270#endif /* mig_external */
271kern_return_t mach_port_insert_right
272(
273 ipc_space_t task,
274 mach_port_name_t name,
275 mach_port_t poly,
276 mach_msg_type_name_t polyPoly
277);
278
279/* Routine mach_port_extract_right */
280#ifdef mig_external
281mig_external
282#else
283extern
284#endif /* mig_external */
285kern_return_t mach_port_extract_right
286(
287 ipc_space_t task,
288 mach_port_name_t name,
289 mach_msg_type_name_t msgt_name,
290 mach_port_t *poly,
291 mach_msg_type_name_t *polyPoly
292);
293
294/* Routine mach_port_set_seqno */
295#ifdef mig_external
296mig_external
297#else
298extern
299#endif /* mig_external */
300kern_return_t mach_port_set_seqno
301(
302 ipc_space_t task,
303 mach_port_name_t name,
304 mach_port_seqno_t seqno
305);
306
307/* Routine mach_port_get_attributes */
308#ifdef mig_external
309mig_external
310#else
311extern
312#endif /* mig_external */
313kern_return_t mach_port_get_attributes
314(
315 ipc_space_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
324mig_external
325#else
326extern
327#endif /* mig_external */
328kern_return_t mach_port_set_attributes
329(
330 ipc_space_t task,
331 mach_port_name_t name,
332 mach_port_flavor_t flavor,
333 mach_port_info_t port_info,
334 mach_msg_type_number_t port_infoCnt
335);
336
337/* Routine mach_port_allocate_qos */
338#ifdef mig_external
339mig_external
340#else
341extern
342#endif /* mig_external */
343kern_return_t mach_port_allocate_qos
344(
345 ipc_space_t task,
346 mach_port_right_t right,
347 mach_port_qos_t *qos,
348 mach_port_name_t *name
349);
350
351/* Routine mach_port_allocate_full */
352#ifdef mig_external
353mig_external
354#else
355extern
356#endif /* mig_external */
357kern_return_t mach_port_allocate_full
358(
359 ipc_space_t task,
360 mach_port_right_t right,
361 mach_port_t proto,
362 mach_port_qos_t *qos,
363 mach_port_name_t *name
364);
365
366/* Routine task_set_port_space */
367#ifdef mig_external
368mig_external
369#else
370extern
371#endif /* mig_external */
372__WATCHOS_PROHIBITED
373__TVOS_PROHIBITED
374kern_return_t task_set_port_space
375(
376 ipc_space_t task,
377 int table_entries
378);
379
380/* Routine mach_port_get_srights */
381#ifdef mig_external
382mig_external
383#else
384extern
385#endif /* mig_external */
386kern_return_t mach_port_get_srights
387(
388 ipc_space_t task,
389 mach_port_name_t name,
390 mach_port_rights_t *srights
391);
392
393/* Routine mach_port_space_info */
394#ifdef mig_external
395mig_external
396#else
397extern
398#endif /* mig_external */
399kern_return_t mach_port_space_info
400(
401 ipc_space_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
411mig_external
412#else
413extern
414#endif /* mig_external */
415kern_return_t mach_port_dnrequest_info
416(
417 ipc_space_t task,
418 mach_port_name_t name,
419 unsigned *dnr_total,
420 unsigned *dnr_used
421);
422
423/* Routine mach_port_kernel_object */
424#ifdef mig_external
425mig_external
426#else
427extern
428#endif /* mig_external */
429kern_return_t mach_port_kernel_object
430(
431 ipc_space_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
439mig_external
440#else
441extern
442#endif /* mig_external */
443kern_return_t mach_port_insert_member
444(
445 ipc_space_t task,
446 mach_port_name_t name,
447 mach_port_name_t pset
448);
449
450/* Routine mach_port_extract_member */
451#ifdef mig_external
452mig_external
453#else
454extern
455#endif /* mig_external */
456kern_return_t mach_port_extract_member
457(
458 ipc_space_t task,
459 mach_port_name_t name,
460 mach_port_name_t pset
461);
462
463/* Routine mach_port_get_context */
464#ifdef mig_external
465mig_external
466#else
467extern
468#endif /* mig_external */
469kern_return_t mach_port_get_context
470(
471 ipc_space_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
478mig_external
479#else
480extern
481#endif /* mig_external */
482kern_return_t mach_port_set_context
483(
484 ipc_space_t task,
485 mach_port_name_t name,
486 mach_port_context_t context
487);
488
489/* Routine mach_port_kobject */
490#ifdef mig_external
491mig_external
492#else
493extern
494#endif /* mig_external */
495kern_return_t mach_port_kobject
496(
497 ipc_space_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
505mig_external
506#else
507extern
508#endif /* mig_external */
509kern_return_t mach_port_construct
510(
511 ipc_space_t task,
512 mach_port_options_ptr_t options,
513 mach_port_context_t context,
514 mach_port_name_t *name
515);
516
517/* Routine mach_port_destruct */
518#ifdef mig_external
519mig_external
520#else
521extern
522#endif /* mig_external */
523kern_return_t mach_port_destruct
524(
525 ipc_space_t task,
526 mach_port_name_t name,
527 mach_port_delta_t srdelta,
528 mach_port_context_t guard
529);
530
531/* Routine mach_port_guard */
532#ifdef mig_external
533mig_external
534#else
535extern
536#endif /* mig_external */
537kern_return_t mach_port_guard
538(
539 ipc_space_t task,
540 mach_port_name_t name,
541 mach_port_context_t guard,
542 boolean_t strict
543);
544
545/* Routine mach_port_unguard */
546#ifdef mig_external
547mig_external
548#else
549extern
550#endif /* mig_external */
551kern_return_t mach_port_unguard
552(
553 ipc_space_t task,
554 mach_port_name_t name,
555 mach_port_context_t guard
556);
557
558/* Routine mach_port_space_basic_info */
559#ifdef mig_external
560mig_external
561#else
562extern
563#endif /* mig_external */
564kern_return_t mach_port_space_basic_info
565(
566 ipc_space_inspect_t task,
567 ipc_info_space_basic_t *basic_info
568);
569
570/* Routine mach_port_guard_with_flags */
571#ifdef mig_external
572mig_external
573#else
574extern
575#endif /* mig_external */
576kern_return_t mach_port_guard_with_flags
577(
578 ipc_space_t task,
579 mach_port_name_t name,
580 mach_port_context_t guard,
581 uint64_t flags
582);
583
584/* Routine mach_port_swap_guard */
585#ifdef mig_external
586mig_external
587#else
588extern
589#endif /* mig_external */
590kern_return_t mach_port_swap_guard
591(
592 ipc_space_t task,
593 mach_port_name_t name,
594 mach_port_context_t old_guard,
595 mach_port_context_t new_guard
596);
597
598/* Routine mach_port_kobject_description */
599#ifdef mig_external
600mig_external
601#else
602extern
603#endif /* mig_external */
604kern_return_t mach_port_kobject_description
605(
606 ipc_space_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
1148union __RequestUnion__mach_port_subsystem {
1149 __Request__mach_port_names_t Request_mach_port_names;
1150 __Request__mach_port_type_t Request_mach_port_type;
1151 __Request__mach_port_rename_t Request_mach_port_rename;
1152 __Request__mach_port_allocate_name_t Request_mach_port_allocate_name;
1153 __Request__mach_port_allocate_t Request_mach_port_allocate;
1154 __Request__mach_port_destroy_t Request_mach_port_destroy;
1155 __Request__mach_port_deallocate_t Request_mach_port_deallocate;
1156 __Request__mach_port_get_refs_t Request_mach_port_get_refs;
1157 __Request__mach_port_mod_refs_t Request_mach_port_mod_refs;
1158 __Request__mach_port_peek_t Request_mach_port_peek;
1159 __Request__mach_port_set_mscount_t Request_mach_port_set_mscount;
1160 __Request__mach_port_get_set_status_t Request_mach_port_get_set_status;
1161 __Request__mach_port_move_member_t Request_mach_port_move_member;
1162 __Request__mach_port_request_notification_t Request_mach_port_request_notification;
1163 __Request__mach_port_insert_right_t Request_mach_port_insert_right;
1164 __Request__mach_port_extract_right_t Request_mach_port_extract_right;
1165 __Request__mach_port_set_seqno_t Request_mach_port_set_seqno;
1166 __Request__mach_port_get_attributes_t Request_mach_port_get_attributes;
1167 __Request__mach_port_set_attributes_t Request_mach_port_set_attributes;
1168 __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos;
1169 __Request__mach_port_allocate_full_t Request_mach_port_allocate_full;
1170 __Request__task_set_port_space_t Request_task_set_port_space;
1171 __Request__mach_port_get_srights_t Request_mach_port_get_srights;
1172 __Request__mach_port_space_info_t Request_mach_port_space_info;
1173 __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info;
1174 __Request__mach_port_kernel_object_t Request_mach_port_kernel_object;
1175 __Request__mach_port_insert_member_t Request_mach_port_insert_member;
1176 __Request__mach_port_extract_member_t Request_mach_port_extract_member;
1177 __Request__mach_port_get_context_t Request_mach_port_get_context;
1178 __Request__mach_port_set_context_t Request_mach_port_set_context;
1179 __Request__mach_port_kobject_t Request_mach_port_kobject;
1180 __Request__mach_port_construct_t Request_mach_port_construct;
1181 __Request__mach_port_destruct_t Request_mach_port_destruct;
1182 __Request__mach_port_guard_t Request_mach_port_guard;
1183 __Request__mach_port_unguard_t Request_mach_port_unguard;
1184 __Request__mach_port_space_basic_info_t Request_mach_port_space_basic_info;
1185 __Request__mach_port_guard_with_flags_t Request_mach_port_guard_with_flags;
1186 __Request__mach_port_swap_guard_t Request_mach_port_swap_guard;
1187 __Request__mach_port_kobject_description_t Request_mach_port_kobject_description;
1188};
1189#endif /* !__RequestUnion__mach_port_subsystem__defined */
1190/* typedefs for all replies */
1191
1192#ifndef __Reply__mach_port_subsystem__defined
1193#define __Reply__mach_port_subsystem__defined
1194
1195#ifdef __MigPackStructs
1196#pragma pack(push, 4)
1197#endif
1198 typedef struct {
1199 mach_msg_header_t Head;
1200 /* start of the kernel processed data */
1201 mach_msg_body_t msgh_body;
1202 mach_msg_ool_descriptor_t names;
1203 mach_msg_ool_descriptor_t types;
1204 /* end of the kernel processed data */
1205 NDR_record_t NDR;
1206 mach_msg_type_number_t namesCnt;
1207 mach_msg_type_number_t typesCnt;
1208 } __Reply__mach_port_names_t __attribute__((unused));
1209#ifdef __MigPackStructs
1210#pragma pack(pop)
1211#endif
1212
1213#ifdef __MigPackStructs
1214#pragma pack(push, 4)
1215#endif
1216 typedef struct {
1217 mach_msg_header_t Head;
1218 NDR_record_t NDR;
1219 kern_return_t RetCode;
1220 mach_port_type_t ptype;
1221 } __Reply__mach_port_type_t __attribute__((unused));
1222#ifdef __MigPackStructs
1223#pragma pack(pop)
1224#endif
1225
1226#ifdef __MigPackStructs
1227#pragma pack(push, 4)
1228#endif
1229 typedef struct {
1230 mach_msg_header_t Head;
1231 NDR_record_t NDR;
1232 kern_return_t RetCode;
1233 } __Reply__mach_port_rename_t __attribute__((unused));
1234#ifdef __MigPackStructs
1235#pragma pack(pop)
1236#endif
1237
1238#ifdef __MigPackStructs
1239#pragma pack(push, 4)
1240#endif
1241 typedef struct {
1242 mach_msg_header_t Head;
1243 NDR_record_t NDR;
1244 kern_return_t RetCode;
1245 } __Reply__mach_port_allocate_name_t __attribute__((unused));
1246#ifdef __MigPackStructs
1247#pragma pack(pop)
1248#endif
1249
1250#ifdef __MigPackStructs
1251#pragma pack(push, 4)
1252#endif
1253 typedef struct {
1254 mach_msg_header_t Head;
1255 NDR_record_t NDR;
1256 kern_return_t RetCode;
1257 mach_port_name_t name;
1258 } __Reply__mach_port_allocate_t __attribute__((unused));
1259#ifdef __MigPackStructs
1260#pragma pack(pop)
1261#endif
1262
1263#ifdef __MigPackStructs
1264#pragma pack(push, 4)
1265#endif
1266 typedef struct {
1267 mach_msg_header_t Head;
1268 NDR_record_t NDR;
1269 kern_return_t RetCode;
1270 } __Reply__mach_port_destroy_t __attribute__((unused));
1271#ifdef __MigPackStructs
1272#pragma pack(pop)
1273#endif
1274
1275#ifdef __MigPackStructs
1276#pragma pack(push, 4)
1277#endif
1278 typedef struct {
1279 mach_msg_header_t Head;
1280 NDR_record_t NDR;
1281 kern_return_t RetCode;
1282 } __Reply__mach_port_deallocate_t __attribute__((unused));
1283#ifdef __MigPackStructs
1284#pragma pack(pop)
1285#endif
1286
1287#ifdef __MigPackStructs
1288#pragma pack(push, 4)
1289#endif
1290 typedef struct {
1291 mach_msg_header_t Head;
1292 NDR_record_t NDR;
1293 kern_return_t RetCode;
1294 mach_port_urefs_t refs;
1295 } __Reply__mach_port_get_refs_t __attribute__((unused));
1296#ifdef __MigPackStructs
1297#pragma pack(pop)
1298#endif
1299
1300#ifdef __MigPackStructs
1301#pragma pack(push, 4)
1302#endif
1303 typedef struct {
1304 mach_msg_header_t Head;
1305 NDR_record_t NDR;
1306 kern_return_t RetCode;
1307 } __Reply__mach_port_mod_refs_t __attribute__((unused));
1308#ifdef __MigPackStructs
1309#pragma pack(pop)
1310#endif
1311
1312#ifdef __MigPackStructs
1313#pragma pack(push, 4)
1314#endif
1315 typedef struct {
1316 mach_msg_header_t Head;
1317 NDR_record_t NDR;
1318 kern_return_t RetCode;
1319 mach_port_seqno_t request_seqnop;
1320 mach_msg_size_t msg_sizep;
1321 mach_msg_id_t msg_idp;
1322 mach_msg_type_number_t trailer_infopCnt;
1323 char trailer_infop[68];
1324 } __Reply__mach_port_peek_t __attribute__((unused));
1325#ifdef __MigPackStructs
1326#pragma pack(pop)
1327#endif
1328
1329#ifdef __MigPackStructs
1330#pragma pack(push, 4)
1331#endif
1332 typedef struct {
1333 mach_msg_header_t Head;
1334 NDR_record_t NDR;
1335 kern_return_t RetCode;
1336 } __Reply__mach_port_set_mscount_t __attribute__((unused));
1337#ifdef __MigPackStructs
1338#pragma pack(pop)
1339#endif
1340
1341#ifdef __MigPackStructs
1342#pragma pack(push, 4)
1343#endif
1344 typedef struct {
1345 mach_msg_header_t Head;
1346 /* start of the kernel processed data */
1347 mach_msg_body_t msgh_body;
1348 mach_msg_ool_descriptor_t members;
1349 /* end of the kernel processed data */
1350 NDR_record_t NDR;
1351 mach_msg_type_number_t membersCnt;
1352 } __Reply__mach_port_get_set_status_t __attribute__((unused));
1353#ifdef __MigPackStructs
1354#pragma pack(pop)
1355#endif
1356
1357#ifdef __MigPackStructs
1358#pragma pack(push, 4)
1359#endif
1360 typedef struct {
1361 mach_msg_header_t Head;
1362 NDR_record_t NDR;
1363 kern_return_t RetCode;
1364 } __Reply__mach_port_move_member_t __attribute__((unused));
1365#ifdef __MigPackStructs
1366#pragma pack(pop)
1367#endif
1368
1369#ifdef __MigPackStructs
1370#pragma pack(push, 4)
1371#endif
1372 typedef struct {
1373 mach_msg_header_t Head;
1374 /* start of the kernel processed data */
1375 mach_msg_body_t msgh_body;
1376 mach_msg_port_descriptor_t previous;
1377 /* end of the kernel processed data */
1378 } __Reply__mach_port_request_notification_t __attribute__((unused));
1379#ifdef __MigPackStructs
1380#pragma pack(pop)
1381#endif
1382
1383#ifdef __MigPackStructs
1384#pragma pack(push, 4)
1385#endif
1386 typedef struct {
1387 mach_msg_header_t Head;
1388 NDR_record_t NDR;
1389 kern_return_t RetCode;
1390 } __Reply__mach_port_insert_right_t __attribute__((unused));
1391#ifdef __MigPackStructs
1392#pragma pack(pop)
1393#endif
1394
1395#ifdef __MigPackStructs
1396#pragma pack(push, 4)
1397#endif
1398 typedef struct {
1399 mach_msg_header_t Head;
1400 /* start of the kernel processed data */
1401 mach_msg_body_t msgh_body;
1402 mach_msg_port_descriptor_t poly;
1403 /* end of the kernel processed data */
1404 } __Reply__mach_port_extract_right_t __attribute__((unused));
1405#ifdef __MigPackStructs
1406#pragma pack(pop)
1407#endif
1408
1409#ifdef __MigPackStructs
1410#pragma pack(push, 4)
1411#endif
1412 typedef struct {
1413 mach_msg_header_t Head;
1414 NDR_record_t NDR;
1415 kern_return_t RetCode;
1416 } __Reply__mach_port_set_seqno_t __attribute__((unused));
1417#ifdef __MigPackStructs
1418#pragma pack(pop)
1419#endif
1420
1421#ifdef __MigPackStructs
1422#pragma pack(push, 4)
1423#endif
1424 typedef struct {
1425 mach_msg_header_t Head;
1426 NDR_record_t NDR;
1427 kern_return_t RetCode;
1428 mach_msg_type_number_t port_info_outCnt;
1429 integer_t port_info_out[17];
1430 } __Reply__mach_port_get_attributes_t __attribute__((unused));
1431#ifdef __MigPackStructs
1432#pragma pack(pop)
1433#endif
1434
1435#ifdef __MigPackStructs
1436#pragma pack(push, 4)
1437#endif
1438 typedef struct {
1439 mach_msg_header_t Head;
1440 NDR_record_t NDR;
1441 kern_return_t RetCode;
1442 } __Reply__mach_port_set_attributes_t __attribute__((unused));
1443#ifdef __MigPackStructs
1444#pragma pack(pop)
1445#endif
1446
1447#ifdef __MigPackStructs
1448#pragma pack(push, 4)
1449#endif
1450 typedef struct {
1451 mach_msg_header_t Head;
1452 NDR_record_t NDR;
1453 kern_return_t RetCode;
1454 mach_port_qos_t qos;
1455 mach_port_name_t name;
1456 } __Reply__mach_port_allocate_qos_t __attribute__((unused));
1457#ifdef __MigPackStructs
1458#pragma pack(pop)
1459#endif
1460
1461#ifdef __MigPackStructs
1462#pragma pack(push, 4)
1463#endif
1464 typedef struct {
1465 mach_msg_header_t Head;
1466 NDR_record_t NDR;
1467 kern_return_t RetCode;
1468 mach_port_qos_t qos;
1469 mach_port_name_t name;
1470 } __Reply__mach_port_allocate_full_t __attribute__((unused));
1471#ifdef __MigPackStructs
1472#pragma pack(pop)
1473#endif
1474
1475#ifdef __MigPackStructs
1476#pragma pack(push, 4)
1477#endif
1478 typedef struct {
1479 mach_msg_header_t Head;
1480 NDR_record_t NDR;
1481 kern_return_t RetCode;
1482 } __Reply__task_set_port_space_t __attribute__((unused));
1483#ifdef __MigPackStructs
1484#pragma pack(pop)
1485#endif
1486
1487#ifdef __MigPackStructs
1488#pragma pack(push, 4)
1489#endif
1490 typedef struct {
1491 mach_msg_header_t Head;
1492 NDR_record_t NDR;
1493 kern_return_t RetCode;
1494 mach_port_rights_t srights;
1495 } __Reply__mach_port_get_srights_t __attribute__((unused));
1496#ifdef __MigPackStructs
1497#pragma pack(pop)
1498#endif
1499
1500#ifdef __MigPackStructs
1501#pragma pack(push, 4)
1502#endif
1503 typedef struct {
1504 mach_msg_header_t Head;
1505 /* start of the kernel processed data */
1506 mach_msg_body_t msgh_body;
1507 mach_msg_ool_descriptor_t table_info;
1508 mach_msg_ool_descriptor_t tree_info;
1509 /* end of the kernel processed data */
1510 NDR_record_t NDR;
1511 ipc_info_space_t space_info;
1512 mach_msg_type_number_t table_infoCnt;
1513 mach_msg_type_number_t tree_infoCnt;
1514 } __Reply__mach_port_space_info_t __attribute__((unused));
1515#ifdef __MigPackStructs
1516#pragma pack(pop)
1517#endif
1518
1519#ifdef __MigPackStructs
1520#pragma pack(push, 4)
1521#endif
1522 typedef struct {
1523 mach_msg_header_t Head;
1524 NDR_record_t NDR;
1525 kern_return_t RetCode;
1526 unsigned dnr_total;
1527 unsigned dnr_used;
1528 } __Reply__mach_port_dnrequest_info_t __attribute__((unused));
1529#ifdef __MigPackStructs
1530#pragma pack(pop)
1531#endif
1532
1533#ifdef __MigPackStructs
1534#pragma pack(push, 4)
1535#endif
1536 typedef struct {
1537 mach_msg_header_t Head;
1538 NDR_record_t NDR;
1539 kern_return_t RetCode;
1540 unsigned object_type;
1541 unsigned object_addr;
1542 } __Reply__mach_port_kernel_object_t __attribute__((unused));
1543#ifdef __MigPackStructs
1544#pragma pack(pop)
1545#endif
1546
1547#ifdef __MigPackStructs
1548#pragma pack(push, 4)
1549#endif
1550 typedef struct {
1551 mach_msg_header_t Head;
1552 NDR_record_t NDR;
1553 kern_return_t RetCode;
1554 } __Reply__mach_port_insert_member_t __attribute__((unused));
1555#ifdef __MigPackStructs
1556#pragma pack(pop)
1557#endif
1558
1559#ifdef __MigPackStructs
1560#pragma pack(push, 4)
1561#endif
1562 typedef struct {
1563 mach_msg_header_t Head;
1564 NDR_record_t NDR;
1565 kern_return_t RetCode;
1566 } __Reply__mach_port_extract_member_t __attribute__((unused));
1567#ifdef __MigPackStructs
1568#pragma pack(pop)
1569#endif
1570
1571#ifdef __MigPackStructs
1572#pragma pack(push, 4)
1573#endif
1574 typedef struct {
1575 mach_msg_header_t Head;
1576 NDR_record_t NDR;
1577 kern_return_t RetCode;
1578 mach_port_context_t context;
1579 } __Reply__mach_port_get_context_t __attribute__((unused));
1580#ifdef __MigPackStructs
1581#pragma pack(pop)
1582#endif
1583
1584#ifdef __MigPackStructs
1585#pragma pack(push, 4)
1586#endif
1587 typedef struct {
1588 mach_msg_header_t Head;
1589 NDR_record_t NDR;
1590 kern_return_t RetCode;
1591 } __Reply__mach_port_set_context_t __attribute__((unused));
1592#ifdef __MigPackStructs
1593#pragma pack(pop)
1594#endif
1595
1596#ifdef __MigPackStructs
1597#pragma pack(push, 4)
1598#endif
1599 typedef struct {
1600 mach_msg_header_t Head;
1601 NDR_record_t NDR;
1602 kern_return_t RetCode;
1603 natural_t object_type;
1604 mach_vm_address_t object_addr;
1605 } __Reply__mach_port_kobject_t __attribute__((unused));
1606#ifdef __MigPackStructs
1607#pragma pack(pop)
1608#endif
1609
1610#ifdef __MigPackStructs
1611#pragma pack(push, 4)
1612#endif
1613 typedef struct {
1614 mach_msg_header_t Head;
1615 NDR_record_t NDR;
1616 kern_return_t RetCode;
1617 mach_port_name_t name;
1618 } __Reply__mach_port_construct_t __attribute__((unused));
1619#ifdef __MigPackStructs
1620#pragma pack(pop)
1621#endif
1622
1623#ifdef __MigPackStructs
1624#pragma pack(push, 4)
1625#endif
1626 typedef struct {
1627 mach_msg_header_t Head;
1628 NDR_record_t NDR;
1629 kern_return_t RetCode;
1630 } __Reply__mach_port_destruct_t __attribute__((unused));
1631#ifdef __MigPackStructs
1632#pragma pack(pop)
1633#endif
1634
1635#ifdef __MigPackStructs
1636#pragma pack(push, 4)
1637#endif
1638 typedef struct {
1639 mach_msg_header_t Head;
1640 NDR_record_t NDR;
1641 kern_return_t RetCode;
1642 } __Reply__mach_port_guard_t __attribute__((unused));
1643#ifdef __MigPackStructs
1644#pragma pack(pop)
1645#endif
1646
1647#ifdef __MigPackStructs
1648#pragma pack(push, 4)
1649#endif
1650 typedef struct {
1651 mach_msg_header_t Head;
1652 NDR_record_t NDR;
1653 kern_return_t RetCode;
1654 } __Reply__mach_port_unguard_t __attribute__((unused));
1655#ifdef __MigPackStructs
1656#pragma pack(pop)
1657#endif
1658
1659#ifdef __MigPackStructs
1660#pragma pack(push, 4)
1661#endif
1662 typedef struct {
1663 mach_msg_header_t Head;
1664 NDR_record_t NDR;
1665 kern_return_t RetCode;
1666 ipc_info_space_basic_t basic_info;
1667 } __Reply__mach_port_space_basic_info_t __attribute__((unused));
1668#ifdef __MigPackStructs
1669#pragma pack(pop)
1670#endif
1671
1672#ifdef __MigPackStructs
1673#pragma pack(push, 4)
1674#endif
1675 typedef struct {
1676 mach_msg_header_t Head;
1677 NDR_record_t NDR;
1678 kern_return_t RetCode;
1679 } __Reply__mach_port_guard_with_flags_t __attribute__((unused));
1680#ifdef __MigPackStructs
1681#pragma pack(pop)
1682#endif
1683
1684#ifdef __MigPackStructs
1685#pragma pack(push, 4)
1686#endif
1687 typedef struct {
1688 mach_msg_header_t Head;
1689 NDR_record_t NDR;
1690 kern_return_t RetCode;
1691 } __Reply__mach_port_swap_guard_t __attribute__((unused));
1692#ifdef __MigPackStructs
1693#pragma pack(pop)
1694#endif
1695
1696#ifdef __MigPackStructs
1697#pragma pack(push, 4)
1698#endif
1699 typedef struct {
1700 mach_msg_header_t Head;
1701 NDR_record_t NDR;
1702 kern_return_t RetCode;
1703 natural_t object_type;
1704 mach_vm_address_t object_addr;
1705 mach_msg_type_number_t descriptionOffset; /* MiG doesn't use it */
1706 mach_msg_type_number_t descriptionCnt;
1707 char description[512];
1708 } __Reply__mach_port_kobject_description_t __attribute__((unused));
1709#ifdef __MigPackStructs
1710#pragma pack(pop)
1711#endif
1712#endif /* !__Reply__mach_port_subsystem__defined */
1713
1714/* union of all replies */
1715
1716#ifndef __ReplyUnion__mach_port_subsystem__defined
1717#define __ReplyUnion__mach_port_subsystem__defined
1718union __ReplyUnion__mach_port_subsystem {
1719 __Reply__mach_port_names_t Reply_mach_port_names;
1720 __Reply__mach_port_type_t Reply_mach_port_type;
1721 __Reply__mach_port_rename_t Reply_mach_port_rename;
1722 __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name;
1723 __Reply__mach_port_allocate_t Reply_mach_port_allocate;
1724 __Reply__mach_port_destroy_t Reply_mach_port_destroy;
1725 __Reply__mach_port_deallocate_t Reply_mach_port_deallocate;
1726 __Reply__mach_port_get_refs_t Reply_mach_port_get_refs;
1727 __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs;
1728 __Reply__mach_port_peek_t Reply_mach_port_peek;
1729 __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount;
1730 __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status;
1731 __Reply__mach_port_move_member_t Reply_mach_port_move_member;
1732 __Reply__mach_port_request_notification_t Reply_mach_port_request_notification;
1733 __Reply__mach_port_insert_right_t Reply_mach_port_insert_right;
1734 __Reply__mach_port_extract_right_t Reply_mach_port_extract_right;
1735 __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno;
1736 __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes;
1737 __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes;
1738 __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos;
1739 __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full;
1740 __Reply__task_set_port_space_t Reply_task_set_port_space;
1741 __Reply__mach_port_get_srights_t Reply_mach_port_get_srights;
1742 __Reply__mach_port_space_info_t Reply_mach_port_space_info;
1743 __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info;
1744 __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object;
1745 __Reply__mach_port_insert_member_t Reply_mach_port_insert_member;
1746 __Reply__mach_port_extract_member_t Reply_mach_port_extract_member;
1747 __Reply__mach_port_get_context_t Reply_mach_port_get_context;
1748 __Reply__mach_port_set_context_t Reply_mach_port_set_context;
1749 __Reply__mach_port_kobject_t Reply_mach_port_kobject;
1750 __Reply__mach_port_construct_t Reply_mach_port_construct;
1751 __Reply__mach_port_destruct_t Reply_mach_port_destruct;
1752 __Reply__mach_port_guard_t Reply_mach_port_guard;
1753 __Reply__mach_port_unguard_t Reply_mach_port_unguard;
1754 __Reply__mach_port_space_basic_info_t Reply_mach_port_space_basic_info;
1755 __Reply__mach_port_guard_with_flags_t Reply_mach_port_guard_with_flags;
1756 __Reply__mach_port_swap_guard_t Reply_mach_port_swap_guard;
1757 __Reply__mach_port_kobject_description_t Reply_mach_port_kobject_description;
1758};
1759#endif /* !__RequestUnion__mach_port_subsystem__defined */
1760
1761#ifndef subsystem_to_name_map_mach_port
1762#define subsystem_to_name_map_mach_port \
1763 { "mach_port_names", 3200 },\
1764 { "mach_port_type", 3201 },\
1765 { "mach_port_rename", 3202 },\
1766 { "mach_port_allocate_name", 3203 },\
1767 { "mach_port_allocate", 3204 },\
1768 { "mach_port_destroy", 3205 },\
1769 { "mach_port_deallocate", 3206 },\
1770 { "mach_port_get_refs", 3207 },\
1771 { "mach_port_mod_refs", 3208 },\
1772 { "mach_port_peek", 3209 },\
1773 { "mach_port_set_mscount", 3210 },\
1774 { "mach_port_get_set_status", 3211 },\
1775 { "mach_port_move_member", 3212 },\
1776 { "mach_port_request_notification", 3213 },\
1777 { "mach_port_insert_right", 3214 },\
1778 { "mach_port_extract_right", 3215 },\
1779 { "mach_port_set_seqno", 3216 },\
1780 { "mach_port_get_attributes", 3217 },\
1781 { "mach_port_set_attributes", 3218 },\
1782 { "mach_port_allocate_qos", 3219 },\
1783 { "mach_port_allocate_full", 3220 },\
1784 { "task_set_port_space", 3221 },\
1785 { "mach_port_get_srights", 3222 },\
1786 { "mach_port_space_info", 3223 },\
1787 { "mach_port_dnrequest_info", 3224 },\
1788 { "mach_port_kernel_object", 3225 },\
1789 { "mach_port_insert_member", 3226 },\
1790 { "mach_port_extract_member", 3227 },\
1791 { "mach_port_get_context", 3228 },\
1792 { "mach_port_set_context", 3229 },\
1793 { "mach_port_kobject", 3230 },\
1794 { "mach_port_construct", 3231 },\
1795 { "mach_port_destruct", 3232 },\
1796 { "mach_port_guard", 3233 },\
1797 { "mach_port_unguard", 3234 },\
1798 { "mach_port_space_basic_info", 3235 },\
1799 { "mach_port_guard_with_flags", 3237 },\
1800 { "mach_port_swap_guard", 3238 },\
1801 { "mach_port_kobject_description", 3239 }
1802#endif
1803
1804#ifdef __AfterMigUserHeader
1805__AfterMigUserHeader
1806#endif /* __AfterMigUserHeader */
1807
1808#endif /* _mach_port_user_ */
lib/libc/include/aarch64-macos-gnu/mach/mach_time.h created+73
......@@ -0,0 +1,73 @@
1/*
2 * Copyright (c) 2001-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_MACH_TIME_H_
30#define _MACH_MACH_TIME_H_
31
32#include <mach/mach_types.h>
33#include <sys/cdefs.h>
34#include <Availability.h>
35
36struct mach_timebase_info {
37 uint32_t numer;
38 uint32_t denom;
39};
40
41typedef struct mach_timebase_info *mach_timebase_info_t;
42typedef struct mach_timebase_info mach_timebase_info_data_t;
43
44__BEGIN_DECLS
45
46kern_return_t mach_timebase_info(
47 mach_timebase_info_t info);
48
49kern_return_t mach_wait_until(
50 uint64_t deadline);
51
52
53uint64_t mach_absolute_time(void);
54
55__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
56uint64_t mach_approximate_time(void);
57
58/*
59 * like mach_absolute_time, but advances during sleep
60 */
61__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
62uint64_t mach_continuous_time(void);
63
64/*
65 * like mach_approximate_time, but advances during sleep
66 */
67__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
68uint64_t mach_continuous_approximate_time(void);
69
70
71__END_DECLS
72
73#endif /* _MACH_MACH_TIME_H_ */
lib/libc/include/aarch64-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
86extern kern_return_t clock_sleep_trap(
87 mach_port_name_t clock_name,
88 sleep_type_t sleep_type,
89 int sleep_sec,
90 int sleep_nsec,
91 mach_timespec_t *wakeup_time);
92
93extern kern_return_t _kernelrpc_mach_vm_allocate_trap(
94 mach_port_name_t target,
95 mach_vm_offset_t *addr,
96 mach_vm_size_t size,
97 int flags);
98
99extern kern_return_t _kernelrpc_mach_vm_deallocate_trap(
100 mach_port_name_t target,
101 mach_vm_address_t address,
102 mach_vm_size_t size
103 );
104
105extern kern_return_t _kernelrpc_mach_vm_protect_trap(
106 mach_port_name_t target,
107 mach_vm_address_t address,
108 mach_vm_size_t size,
109 boolean_t set_maximum,
110 vm_prot_t new_protection
111 );
112
113extern kern_return_t _kernelrpc_mach_vm_map_trap(
114 mach_port_name_t target,
115 mach_vm_offset_t *address,
116 mach_vm_size_t size,
117 mach_vm_offset_t mask,
118 int flags,
119 vm_prot_t cur_protection
120 );
121
122extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap(
123 mach_port_name_t target,
124 mach_vm_offset_t address,
125 vm_purgable_t control,
126 int *state);
127
128extern kern_return_t _kernelrpc_mach_port_allocate_trap(
129 mach_port_name_t target,
130 mach_port_right_t right,
131 mach_port_name_t *name
132 );
133
134extern kern_return_t _kernelrpc_mach_port_deallocate_trap(
135 mach_port_name_t target,
136 mach_port_name_t name
137 );
138
139extern 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
146extern 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
152extern 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
159extern 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
167extern 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
173extern 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
179extern 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
186extern 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
193extern 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
200extern 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
206extern kern_return_t mach_generate_activity_id(
207 mach_port_name_t target,
208 int count,
209 uint64_t *activity_id
210 );
211
212extern kern_return_t macx_swapon(
213 uint64_t filename,
214 int flags,
215 int size,
216 int priority);
217
218extern kern_return_t macx_swapoff(
219 uint64_t filename,
220 int flags);
221
222extern kern_return_t macx_triggers(
223 int hi_water,
224 int low_water,
225 int flags,
226 mach_port_t alert_port);
227
228extern kern_return_t macx_backing_store_suspend(
229 boolean_t suspend);
230
231extern kern_return_t macx_backing_store_recovery(
232 int pid);
233
234extern boolean_t swtch_pri(int pri);
235
236extern boolean_t swtch(void);
237
238extern kern_return_t thread_switch(
239 mach_port_name_t thread_name,
240 int option,
241 mach_msg_timeout_t option_time);
242
243extern mach_port_name_t task_self_trap(void);
244
245extern 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
251extern 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
257extern 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
262extern 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
275extern kern_return_t task_for_pid(
276 mach_port_name_t target_tport,
277 int pid,
278 mach_port_name_t *t);
279
280extern kern_return_t task_name_for_pid(
281 mach_port_name_t target_tport,
282 int pid,
283 mach_port_name_t *tn);
284
285extern kern_return_t pid_for_task(
286 mach_port_name_t t,
287 int *x);
288
289extern 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/aarch64-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 */
118typedef mach_port_t task_t;
119typedef mach_port_t task_name_t;
120typedef mach_port_t task_policy_set_t;
121typedef mach_port_t task_policy_get_t;
122typedef mach_port_t task_inspect_t;
123typedef mach_port_t task_read_t;
124typedef mach_port_t task_suspension_token_t;
125typedef mach_port_t thread_t;
126typedef mach_port_t thread_act_t;
127typedef mach_port_t thread_inspect_t;
128typedef mach_port_t thread_read_t;
129typedef mach_port_t ipc_space_t;
130typedef mach_port_t ipc_space_read_t;
131typedef mach_port_t ipc_space_inspect_t;
132typedef mach_port_t coalition_t;
133typedef mach_port_t host_t;
134typedef mach_port_t host_priv_t;
135typedef mach_port_t host_security_t;
136typedef mach_port_t processor_t;
137typedef mach_port_t processor_set_t;
138typedef mach_port_t processor_set_control_t;
139typedef mach_port_t semaphore_t;
140typedef mach_port_t lock_set_t;
141typedef mach_port_t ledger_t;
142typedef mach_port_t alarm_t;
143typedef mach_port_t clock_serv_t;
144typedef mach_port_t clock_ctrl_t;
145typedef mach_port_t arcade_register_t;
146typedef mach_port_t ipc_eventlink_t;
147typedef mach_port_t eventlink_port_pair_t[2];
148typedef 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 */
156typedef processor_set_t processor_set_name_t;
157
158/*
159 * These types are just hard-coded as ports
160 */
161typedef mach_port_t clock_reply_t;
162typedef mach_port_t bootstrap_t;
163typedef mach_port_t mem_entry_name_port_t;
164typedef mach_port_t exception_handler_t;
165typedef exception_handler_t *exception_handler_array_t;
166typedef mach_port_t vm_task_entry_t;
167typedef mach_port_t io_master_t;
168typedef mach_port_t UNDServerRef;
169typedef 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 */
178typedef task_t *task_array_t;
179typedef thread_t *thread_array_t;
180typedef processor_set_t *processor_set_array_t;
181typedef processor_set_t *processor_set_name_array_t;
182typedef processor_t *processor_array_t;
183typedef thread_act_t *thread_act_array_t;
184typedef 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 */
192typedef task_t task_port_t;
193typedef task_array_t task_port_array_t;
194typedef thread_t thread_port_t;
195typedef thread_array_t thread_port_array_t;
196typedef ipc_space_t ipc_space_port_t;
197typedef host_t host_name_t;
198typedef host_t host_name_port_t;
199typedef processor_set_t processor_set_port_t;
200typedef processor_set_t processor_set_name_port_t;
201typedef processor_set_array_t processor_set_name_port_array_t;
202typedef processor_set_t processor_set_control_port_t;
203typedef processor_t processor_port_t;
204typedef processor_array_t processor_port_array_t;
205typedef thread_act_t thread_act_port_t;
206typedef thread_act_array_t thread_act_port_array_t;
207typedef semaphore_t semaphore_port_t;
208typedef lock_set_t lock_set_port_t;
209typedef ledger_t ledger_port_t;
210typedef ledger_array_t ledger_port_array_t;
211typedef alarm_t alarm_port_t;
212typedef clock_serv_t clock_serv_port_t;
213typedef clock_ctrl_t clock_ctrl_port_t;
214typedef exception_handler_t exception_port_t;
215typedef exception_handler_array_t exception_port_arrary_t;
216typedef char vfs_path_t[4096];
217typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */
218typedef char suid_cred_path_t[1024];
219typedef 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 */
254typedef 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_ */
261typedef 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 */
267typedef natural_t ledger_item_t;
268#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
269
270typedef int64_t ledger_amount_t;
271#define LEDGER_LIMIT_INFINITY ((ledger_amount_t)((1ULL << 63) - 1))
272
273typedef mach_vm_offset_t *emulation_vector_t;
274typedef char *user_subsystem_t;
275
276typedef 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/aarch64-macos-gnu/mach/mach_voucher_types.h created+245
......@@ -0,0 +1,245 @@
1/*
2 * Copyright (c) 2013 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_VOUCHER_TYPES_H_
30#define _MACH_VOUCHER_TYPES_H_
31
32#include <mach/std_types.h>
33#include <mach/port.h>
34
35/*
36 * Mach Voucher - an immutable collection of attribute value handles.
37 *
38 * The mach voucher is such that it can be passed between processes
39 * as a Mach port send right (by convention in the mach_msg_header_t’s
40 * msgh_voucher field).
41 *
42 * You may construct a new mach voucher by passing a construction
43 * recipe to host_create_mach_voucher(). The construction recipe supports
44 * generic commands for copying, removing, and redeeming attribute value
45 * handles from previous vouchers, or running attribute-mananger-specific
46 * commands within the recipe.
47 *
48 * Once the set of attribute value handles is constructed and returned,
49 * that set will not change for the life of the voucher (just because the
50 * attribute value handle itself doesn't change, the value the handle refers
51 * to is free to change at will).
52 */
53typedef mach_port_t mach_voucher_t;
54#define MACH_VOUCHER_NULL ((mach_voucher_t) 0)
55
56typedef mach_port_name_t mach_voucher_name_t;
57#define MACH_VOUCHER_NAME_NULL ((mach_voucher_name_t) 0)
58
59typedef mach_voucher_name_t *mach_voucher_name_array_t;
60#define MACH_VOUCHER_NAME_ARRAY_NULL ((mach_voucher_name_array_t) 0)
61
62/*
63 * This type changes appearance between user-space and kernel. It is
64 * a port at user-space and a reference to an ipc_voucher structure in-kernel.
65 */
66typedef mach_voucher_t ipc_voucher_t;
67#define IPC_VOUCHER_NULL ((ipc_voucher_t) 0)
68
69/*
70 * mach_voucher_selector_t - A means of specifying which thread/task value to extract -
71 * the current voucher set at this level, or a voucher representing
72 * the full [layered] effective value for the task/thread.
73 */
74typedef uint32_t mach_voucher_selector_t;
75#define MACH_VOUCHER_SELECTOR_CURRENT ((mach_voucher_selector_t)0)
76#define MACH_VOUCHER_SELECTOR_EFFECTIVE ((mach_voucher_selector_t)1)
77
78
79/*
80 * mach_voucher_attr_key_t - The key used to identify a particular managed resource or
81 * to select the specific resource manager’s data associated
82 * with a given voucher.
83 */
84typedef uint32_t mach_voucher_attr_key_t;
85typedef mach_voucher_attr_key_t *mach_voucher_attr_key_array_t;
86
87#define MACH_VOUCHER_ATTR_KEY_ALL ((mach_voucher_attr_key_t)~0)
88#define MACH_VOUCHER_ATTR_KEY_NONE ((mach_voucher_attr_key_t)0)
89
90/* other well-known-keys will be added here */
91#define MACH_VOUCHER_ATTR_KEY_ATM ((mach_voucher_attr_key_t)1)
92#define MACH_VOUCHER_ATTR_KEY_IMPORTANCE ((mach_voucher_attr_key_t)2)
93#define MACH_VOUCHER_ATTR_KEY_BANK ((mach_voucher_attr_key_t)3)
94#define MACH_VOUCHER_ATTR_KEY_PTHPRIORITY ((mach_voucher_attr_key_t)4)
95
96#define MACH_VOUCHER_ATTR_KEY_USER_DATA ((mach_voucher_attr_key_t)7)
97#define MACH_VOUCHER_ATTR_KEY_BITS MACH_VOUCHER_ATTR_KEY_USER_DATA /* deprecated */
98#define MACH_VOUCHER_ATTR_KEY_TEST ((mach_voucher_attr_key_t)8)
99
100#define MACH_VOUCHER_ATTR_KEY_NUM_WELL_KNOWN MACH_VOUCHER_ATTR_KEY_TEST
101
102/*
103 * mach_voucher_attr_content_t
104 *
105 * Data passed to a resource manager for modifying an attribute
106 * value or returned from the resource manager in response to a
107 * request to externalize the current value for that attribute.
108 */
109typedef uint8_t *mach_voucher_attr_content_t;
110typedef uint32_t mach_voucher_attr_content_size_t;
111
112/*
113 * mach_voucher_attr_command_t - The private verbs implemented by each voucher
114 * attribute manager via mach_voucher_attr_command().
115 */
116typedef uint32_t mach_voucher_attr_command_t;
117
118/*
119 * mach_voucher_attr_recipe_command_t
120 *
121 * The verbs used to create/morph a voucher attribute value.
122 * We define some system-wide commands here - related to creation, and transport of
123 * vouchers and attributes. Additional commands can be defined by, and supported by,
124 * individual attribute resource managers.
125 */
126typedef uint32_t mach_voucher_attr_recipe_command_t;
127typedef mach_voucher_attr_recipe_command_t *mach_voucher_attr_recipe_command_array_t;
128
129#define MACH_VOUCHER_ATTR_NOOP ((mach_voucher_attr_recipe_command_t)0)
130#define MACH_VOUCHER_ATTR_COPY ((mach_voucher_attr_recipe_command_t)1)
131#define MACH_VOUCHER_ATTR_REMOVE ((mach_voucher_attr_recipe_command_t)2)
132#define MACH_VOUCHER_ATTR_SET_VALUE_HANDLE ((mach_voucher_attr_recipe_command_t)3)
133#define MACH_VOUCHER_ATTR_AUTO_REDEEM ((mach_voucher_attr_recipe_command_t)4)
134#define MACH_VOUCHER_ATTR_SEND_PREPROCESS ((mach_voucher_attr_recipe_command_t)5)
135
136/* redeem is on its way out? */
137#define MACH_VOUCHER_ATTR_REDEEM ((mach_voucher_attr_recipe_command_t)10)
138
139/* recipe command(s) for importance attribute manager */
140#define MACH_VOUCHER_ATTR_IMPORTANCE_SELF ((mach_voucher_attr_recipe_command_t)200)
141
142/* recipe command(s) for bit-store attribute manager */
143#define MACH_VOUCHER_ATTR_USER_DATA_STORE ((mach_voucher_attr_recipe_command_t)211)
144#define MACH_VOUCHER_ATTR_BITS_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE /* deprecated */
145
146/* recipe command(s) for test attribute manager */
147#define MACH_VOUCHER_ATTR_TEST_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE
148
149/*
150 * mach_voucher_attr_recipe_t
151 *
152 * An element in a recipe list to create a voucher.
153 */
154#pragma pack(push, 1)
155
156typedef struct mach_voucher_attr_recipe_data {
157 mach_voucher_attr_key_t key;
158 mach_voucher_attr_recipe_command_t command;
159 mach_voucher_name_t previous_voucher;
160 mach_voucher_attr_content_size_t content_size;
161 uint8_t content[];
162} mach_voucher_attr_recipe_data_t;
163typedef mach_voucher_attr_recipe_data_t *mach_voucher_attr_recipe_t;
164typedef mach_msg_type_number_t mach_voucher_attr_recipe_size_t;
165
166/* Make the above palatable to MIG */
167typedef uint8_t *mach_voucher_attr_raw_recipe_t;
168typedef mach_voucher_attr_raw_recipe_t mach_voucher_attr_raw_recipe_array_t;
169typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_size_t;
170typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_array_size_t;
171
172#define MACH_VOUCHER_ATTR_MAX_RAW_RECIPE_ARRAY_SIZE 5120
173#define MACH_VOUCHER_TRAP_STACK_LIMIT 256
174
175#pragma pack(pop)
176
177/*
178 * VOUCHER ATTRIBUTE MANAGER Writer types
179 */
180
181/*
182 * mach_voucher_attr_manager_t
183 *
184 * A handle through which the mach voucher mechanism communicates with the voucher
185 * attribute manager for a given attribute key.
186 */
187typedef mach_port_t mach_voucher_attr_manager_t;
188#define MACH_VOUCHER_ATTR_MANAGER_NULL ((mach_voucher_attr_manager_t) 0)
189
190/*
191 * mach_voucher_attr_control_t
192 *
193 * A handle provided to the voucher attribute manager for a given attribute key
194 * through which it makes inquiries or control operations of the mach voucher mechanism.
195 */
196typedef mach_port_t mach_voucher_attr_control_t;
197#define MACH_VOUCHER_ATTR_CONTROL_NULL ((mach_voucher_attr_control_t) 0)
198
199/*
200 * These types are different in-kernel vs user-space. They are ports in user-space,
201 * pointers to opaque structs in most of the kernel, and pointers to known struct
202 * types in the Mach portion of the kernel.
203 */
204typedef mach_port_t ipc_voucher_attr_manager_t;
205typedef mach_port_t ipc_voucher_attr_control_t;
206#define IPC_VOUCHER_ATTR_MANAGER_NULL ((ipc_voucher_attr_manager_t) 0)
207#define IPC_VOUCHER_ATTR_CONTROL_NULL ((ipc_voucher_attr_control_t) 0)
208
209/*
210 * mach_voucher_attr_value_handle_t
211 *
212 * The private handle that the voucher attribute manager provides to
213 * the mach voucher mechanism to represent a given attr content/value.
214 */
215typedef uint64_t mach_voucher_attr_value_handle_t;
216typedef mach_voucher_attr_value_handle_t *mach_voucher_attr_value_handle_array_t;
217
218typedef mach_msg_type_number_t mach_voucher_attr_value_handle_array_size_t;
219#define MACH_VOUCHER_ATTR_VALUE_MAX_NESTED ((mach_voucher_attr_value_handle_array_size_t)4)
220
221typedef uint32_t mach_voucher_attr_value_reference_t;
222typedef uint32_t mach_voucher_attr_value_flags_t;
223#define MACH_VOUCHER_ATTR_VALUE_FLAGS_NONE ((mach_voucher_attr_value_flags_t)0)
224#define MACH_VOUCHER_ATTR_VALUE_FLAGS_PERSIST ((mach_voucher_attr_value_flags_t)1)
225
226/* USE - TBD */
227typedef uint32_t mach_voucher_attr_control_flags_t;
228#define MACH_VOUCHER_ATTR_CONTROL_FLAGS_NONE ((mach_voucher_attr_control_flags_t)0)
229
230/*
231 * Commands and types for the IPC Importance Attribute Manager
232 *
233 * These are the valid mach_voucher_attr_command() options with the
234 * MACH_VOUCHER_ATTR_KEY_IMPORTANCE key.
235 */
236#define MACH_VOUCHER_IMPORTANCE_ATTR_ADD_EXTERNAL 1 /* Add some number of external refs (not supported) */
237#define MACH_VOUCHER_IMPORTANCE_ATTR_DROP_EXTERNAL 2 /* Drop some number of external refs */
238typedef uint32_t mach_voucher_attr_importance_refs;
239
240/*
241 * Activity id Generation defines
242 */
243#define MACH_ACTIVITY_ID_COUNT_MAX 16
244
245#endif /* _MACH_VOUCHER_TYPES_H_ */
lib/libc/include/aarch64-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
70typedef integer_t cpu_type_t;
71typedef integer_t cpu_subtype_t;
72typedef 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/aarch64-macos-gnu/mach/machine/_structs.h created+40
......@@ -0,0 +1,40 @@
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_MACHINE__STRUCTS_H_
30#define _MACH_MACHINE__STRUCTS_H_
31
32#if defined (__i386__) || defined(__x86_64__)
33#include "mach/i386/_structs.h"
34#elif defined (__arm__) || defined (__arm64__)
35#include "mach/arm/_structs.h"
36#else
37#error architecture not supported
38#endif
39
40#endif /* _MACH_MACHINE__STRUCTS_H_ */
lib/libc/include/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-macos-gnu/mach/memory_object_types.h created+299
......@@ -0,0 +1,299 @@
1/*
2 * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: memory_object.h
60 * Author: Michael Wayne Young
61 *
62 * External memory management interface definition.
63 */
64
65#ifndef _MACH_MEMORY_OBJECT_TYPES_H_
66#define _MACH_MEMORY_OBJECT_TYPES_H_
67
68/*
69 * User-visible types used in the external memory
70 * management interface:
71 */
72
73#include <mach/port.h>
74#include <mach/message.h>
75#include <mach/vm_prot.h>
76#include <mach/vm_sync.h>
77#include <mach/vm_types.h>
78#include <mach/machine/vm_types.h>
79
80#include <sys/cdefs.h>
81
82#define VM_64_BIT_DATA_OBJECTS
83
84typedef unsigned long long memory_object_offset_t;
85typedef unsigned long long memory_object_size_t;
86typedef natural_t memory_object_cluster_size_t;
87typedef natural_t * memory_object_fault_info_t;
88
89typedef unsigned long long vm_object_id_t;
90
91
92/*
93 * Temporary until real EMMI version gets re-implemented
94 */
95
96
97typedef mach_port_t memory_object_t;
98typedef mach_port_t memory_object_control_t;
99
100
101typedef memory_object_t *memory_object_array_t;
102/* A memory object ... */
103/* Used by the kernel to retrieve */
104/* or store data */
105
106typedef mach_port_t memory_object_name_t;
107/* Used to describe the memory ... */
108/* object in vm_regions() calls */
109
110typedef mach_port_t memory_object_default_t;
111/* Registered with the host ... */
112/* for creating new internal objects */
113
114#define MEMORY_OBJECT_NULL ((memory_object_t) 0)
115#define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0)
116#define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0)
117#define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0)
118
119
120typedef int memory_object_copy_strategy_t;
121/* How memory manager handles copy: */
122#define MEMORY_OBJECT_COPY_NONE 0
123/* ... No special support */
124#define MEMORY_OBJECT_COPY_CALL 1
125/* ... Make call on memory manager */
126#define MEMORY_OBJECT_COPY_DELAY 2
127/* ... Memory manager doesn't
128 * change data externally.
129 */
130#define MEMORY_OBJECT_COPY_TEMPORARY 3
131/* ... Memory manager doesn't
132 * change data externally, and
133 * doesn't need to see changes.
134 */
135#define MEMORY_OBJECT_COPY_SYMMETRIC 4
136/* ... Memory manager doesn't
137 * change data externally,
138 * doesn't need to see changes,
139 * and object will not be
140 * multiply mapped.
141 *
142 * XXX
143 * Not yet safe for non-kernel use.
144 */
145
146#define MEMORY_OBJECT_COPY_INVALID 5
147/* ... An invalid copy strategy,
148 * for external objects which
149 * have not been initialized.
150 * Allows copy_strategy to be
151 * examined without also
152 * examining pager_ready and
153 * internal.
154 */
155
156typedef int memory_object_return_t;
157/* Which pages to return to manager
158 * this time (lock_request) */
159#define MEMORY_OBJECT_RETURN_NONE 0
160/* ... don't return any. */
161#define MEMORY_OBJECT_RETURN_DIRTY 1
162/* ... only dirty pages. */
163#define MEMORY_OBJECT_RETURN_ALL 2
164/* ... dirty and precious pages. */
165#define MEMORY_OBJECT_RETURN_ANYTHING 3
166/* ... any resident page. */
167
168/*
169 * Data lock request flags
170 */
171
172#define MEMORY_OBJECT_DATA_FLUSH 0x1
173#define MEMORY_OBJECT_DATA_NO_CHANGE 0x2
174#define MEMORY_OBJECT_DATA_PURGE 0x4
175#define MEMORY_OBJECT_COPY_SYNC 0x8
176#define MEMORY_OBJECT_DATA_SYNC 0x10
177#define MEMORY_OBJECT_IO_SYNC 0x20
178#define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40
179
180/*
181 * Types for the memory object flavor interfaces
182 */
183
184#define MEMORY_OBJECT_INFO_MAX (1024)
185typedef int *memory_object_info_t;
186typedef int memory_object_flavor_t;
187typedef int memory_object_info_data_t[MEMORY_OBJECT_INFO_MAX];
188
189
190#define MEMORY_OBJECT_PERFORMANCE_INFO 11
191#define MEMORY_OBJECT_ATTRIBUTE_INFO 14
192#define MEMORY_OBJECT_BEHAVIOR_INFO 15
193
194
195struct memory_object_perf_info {
196 memory_object_cluster_size_t cluster_size;
197 boolean_t may_cache;
198};
199
200struct memory_object_attr_info {
201 memory_object_copy_strategy_t copy_strategy;
202 memory_object_cluster_size_t cluster_size;
203 boolean_t may_cache_object;
204 boolean_t temporary;
205};
206
207struct memory_object_behave_info {
208 memory_object_copy_strategy_t copy_strategy;
209 boolean_t temporary;
210 boolean_t invalidate;
211 boolean_t silent_overwrite;
212 boolean_t advisory_pageout;
213};
214
215
216typedef struct memory_object_behave_info *memory_object_behave_info_t;
217typedef struct memory_object_behave_info memory_object_behave_info_data_t;
218
219typedef struct memory_object_perf_info *memory_object_perf_info_t;
220typedef struct memory_object_perf_info memory_object_perf_info_data_t;
221
222typedef struct memory_object_attr_info *memory_object_attr_info_t;
223typedef struct memory_object_attr_info memory_object_attr_info_data_t;
224
225#define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) \
226 (sizeof(memory_object_behave_info_data_t)/sizeof(int)))
227#define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) \
228 (sizeof(memory_object_perf_info_data_t)/sizeof(int)))
229#define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) \
230 (sizeof(memory_object_attr_info_data_t)/sizeof(int)))
231
232#define invalid_memory_object_flavor(f) \
233 (f != MEMORY_OBJECT_ATTRIBUTE_INFO && \
234 f != MEMORY_OBJECT_PERFORMANCE_INFO && \
235 f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && \
236 f != MEMORY_OBJECT_BEHAVIOR_INFO && \
237 f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO)
238
239
240/*
241 * Used to support options on memory_object_release_name call
242 */
243#define MEMORY_OBJECT_TERMINATE_IDLE 0x1
244#define MEMORY_OBJECT_RESPECT_CACHE 0x2
245#define MEMORY_OBJECT_RELEASE_NO_OP 0x4
246
247
248/* named entry processor mapping options */
249/* enumerated */
250#define MAP_MEM_NOOP 0
251#define MAP_MEM_COPYBACK 1
252#define MAP_MEM_IO 2
253#define MAP_MEM_WTHRU 3
254#define MAP_MEM_WCOMB 4 /* Write combining mode */
255 /* aka store gather */
256#define MAP_MEM_INNERWBACK 5
257#define MAP_MEM_POSTED 6
258#define MAP_MEM_RT 7
259#define MAP_MEM_POSTED_REORDERED 8
260#define MAP_MEM_POSTED_COMBINED_REORDERED 9
261
262#define GET_MAP_MEM(flags) \
263 ((((unsigned int)(flags)) >> 24) & 0xFF)
264
265#define SET_MAP_MEM(caching, flags) \
266 ((flags) = ((((unsigned int)(caching)) << 24) \
267 & 0xFF000000) | ((flags) & 0xFFFFFF));
268
269/* leave room for vm_prot bits (0xFF ?) */
270#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */
271#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */
272#define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */
273#define MAP_MEM_ONLY 0x010000 /* change processor caching */
274#define MAP_MEM_NAMED_CREATE 0x020000 /* create extant object */
275#define MAP_MEM_PURGABLE 0x040000 /* create a purgable VM object */
276#define MAP_MEM_NAMED_REUSE 0x080000 /* reuse provided entry if identical */
277#define MAP_MEM_USE_DATA_ADDR 0x100000 /* preserve address of data, rather than base of page */
278#define MAP_MEM_VM_COPY 0x200000 /* make a copy of a VM range */
279#define MAP_MEM_VM_SHARE 0x400000 /* extract a VM range for remap */
280#define MAP_MEM_4K_DATA_ADDR 0x800000 /* preserve 4K aligned address of data */
281
282#define MAP_MEM_FLAGS_MASK 0x00FFFF00
283#define MAP_MEM_FLAGS_USER ( \
284 MAP_MEM_PURGABLE_KERNEL_ONLY | \
285 MAP_MEM_GRAB_SECLUDED | \
286 MAP_MEM_ONLY | \
287 MAP_MEM_NAMED_CREATE | \
288 MAP_MEM_PURGABLE | \
289 MAP_MEM_NAMED_REUSE | \
290 MAP_MEM_USE_DATA_ADDR | \
291 MAP_MEM_VM_COPY | \
292 MAP_MEM_VM_SHARE | \
293 MAP_MEM_LEDGER_TAGGED | \
294 MAP_MEM_4K_DATA_ADDR)
295#define MAP_MEM_FLAGS_ALL ( \
296 MAP_MEM_FLAGS_USER)
297
298
299#endif /* _MACH_MEMORY_OBJECT_TYPES_H_ */
lib/libc/include/aarch64-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
91typedef 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
221typedef unsigned int mach_msg_bits_t;
222typedef natural_t mach_msg_size_t;
223typedef integer_t mach_msg_id_t;
224
225#define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0
226
227typedef unsigned int mach_msg_priority_t;
228
229#define MACH_MSG_PRIORITY_UNSPECIFIED (mach_msg_priority_t) 0
230
231
232typedef 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
245typedef 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 */
259typedef 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
273typedef 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
283typedef 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
290typedef 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
299typedef 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
308typedef 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
317typedef 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
331typedef 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
340typedef 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
349typedef 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
363typedef 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
371typedef 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
379typedef 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 */
397typedef 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
405typedef 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
412typedef 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
424typedef struct{
425 mach_msg_header_t header;
426 mach_msg_body_t body;
427} mach_msg_base_t;
428
429typedef unsigned int mach_msg_trailer_type_t;
430
431#define MACH_MSG_TRAILER_FORMAT_0 0
432
433typedef unsigned int mach_msg_trailer_size_t;
434typedef char *mach_msg_trailer_info_t;
435
436typedef 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 */
450typedef 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
456typedef struct{
457 unsigned int val[2];
458} security_token_t;
459
460typedef 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 */
476typedef struct{
477 unsigned int val[8];
478} audit_token_t;
479
480typedef 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
488typedef 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
499typedef struct{
500 mach_port_name_t sender;
501} msg_labels_t;
502
503typedef 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
511typedef 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
535typedef 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 */
545typedef 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} }
553extern const security_token_t KERNEL_SECURITY_TOKEN;
554
555#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} }
556extern const audit_token_t KERNEL_AUDIT_TOKEN;
557
558typedef integer_t mach_msg_options_t;
559
560typedef struct{
561 mach_msg_header_t header;
562} mach_msg_empty_send_t;
563
564typedef struct{
565 mach_msg_header_t header;
566 mach_msg_trailer_t trailer;
567} mach_msg_empty_rcv_t;
568
569typedef 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
606typedef natural_t mach_msg_type_size_t;
607typedef 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
650typedef 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
752typedef 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
865extern 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
886extern 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
902extern 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/aarch64-macos-gnu/mach/mig.h created+180
......@@ -0,0 +1,180 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32/*
33 * Mach MIG Subsystem Interfaces
34 */
35
36#ifndef _MACH_MIG_H_
37#define _MACH_MIG_H_
38
39#include <stdint.h>
40#include <mach/port.h>
41#include <mach/message.h>
42#include <mach/vm_types.h>
43
44#include <sys/cdefs.h>
45
46#if defined(MACH_KERNEL)
47
48#if !defined(__MigTypeCheck)
49/* Turn MIG type checking on by default for kernel */
50#define __MigTypeCheck 1
51#endif
52
53#define __MigKernelSpecificCode 1
54#define _MIG_KERNEL_SPECIFIC_CODE_ 1
55
56#elif !defined(__MigTypeCheck)
57
58#if defined(TypeCheck)
59/* use legacy setting (temporary) */
60#define __MigTypeCheck TypeCheck
61#else
62/* default MIG type checking on */
63#define __MigTypeCheck 1
64#endif
65
66#endif /* !defined(MACH_KERNEL) && !defined(__MigTypeCheck) */
67
68/*
69 * Pack MIG message structs.
70 * This is an indicator of the need to view shared structs in a
71 * binary-compatible format - and MIG message structs are no different.
72 */
73#define __MigPackStructs 1
74
75/*
76 * Definition for MIG-generated server stub routines. These routines
77 * unpack the request message, call the server procedure, and pack the
78 * reply message.
79 */
80typedef void (*mig_stub_routine_t) (mach_msg_header_t *InHeadP,
81 mach_msg_header_t *OutHeadP);
82
83typedef mig_stub_routine_t mig_routine_t;
84
85/*
86 * Definition for MIG-generated server routine. This routine takes a
87 * message, and returns the appropriate stub function for handling that
88 * message.
89 */
90typedef mig_routine_t (*mig_server_routine_t) (mach_msg_header_t *InHeadP);
91
92/*
93 * Generic definition for implementation routines. These routines do
94 * the real work associated with this request. This generic type is
95 * used for keeping the pointers in the subsystem array.
96 */
97typedef kern_return_t (*mig_impl_routine_t)(void);
98
99typedef mach_msg_type_descriptor_t routine_arg_descriptor;
100typedef mach_msg_type_descriptor_t *routine_arg_descriptor_t;
101typedef mach_msg_type_descriptor_t *mig_routine_arg_descriptor_t;
102
103#define MIG_ROUTINE_ARG_DESCRIPTOR_NULL ((mig_routine_arg_descriptor_t)0)
104
105struct routine_descriptor {
106 mig_impl_routine_t impl_routine; /* Server work func pointer */
107 mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */
108 unsigned int argc; /* Number of argument words */
109 unsigned int descr_count; /* Number complex descriptors */
110 routine_arg_descriptor_t
111 arg_descr; /* pointer to descriptor array*/
112 unsigned int max_reply_msg; /* Max size for reply msg */
113};
114typedef struct routine_descriptor *routine_descriptor_t;
115
116typedef struct routine_descriptor mig_routine_descriptor;
117typedef mig_routine_descriptor *mig_routine_descriptor_t;
118
119#define MIG_ROUTINE_DESCRIPTOR_NULL ((mig_routine_descriptor_t)0)
120
121typedef struct mig_subsystem {
122 mig_server_routine_t server; /* pointer to demux routine */
123 mach_msg_id_t start; /* Min routine number */
124 mach_msg_id_t end; /* Max routine number + 1 */
125 mach_msg_size_t maxsize; /* Max reply message size */
126 vm_address_t reserved; /* reserved for MIG use */
127 mig_routine_descriptor
128 routine[1]; /* Routine descriptor array */
129} *mig_subsystem_t;
130
131#define MIG_SUBSYSTEM_NULL ((mig_subsystem_t)0)
132
133typedef struct mig_symtab {
134 char *ms_routine_name;
135 int ms_routine_number;
136 void (*ms_routine)(void); /* Since the functions in the
137 * symbol table have unknown
138 * signatures, this is the best
139 * we can do...
140 */
141} mig_symtab_t;
142
143/*
144 * A compiler attribute for annotating all MIG server routines and other
145 * functions that should behave similarly. Allows the compiler to perform
146 * additional static bug-finding over them.
147 */
148#if __has_attribute(mig_server_routine)
149#define MIG_SERVER_ROUTINE __attribute__((mig_server_routine))
150#else
151#define MIG_SERVER_ROUTINE
152#endif
153
154
155__BEGIN_DECLS
156
157/* Client side reply port allocate */
158extern mach_port_t mig_get_reply_port(void);
159
160/* Client side reply port deallocate */
161extern void mig_dealloc_reply_port(mach_port_t reply_port);
162
163/* Client side reply port "deallocation" */
164extern void mig_put_reply_port(mach_port_t reply_port);
165
166/* Bounded string copy */
167extern int mig_strncpy(char *dest, const char *src, int len);
168extern int mig_strncpy_zerofill(char *dest, const char *src, int len);
169
170
171/* Allocate memory for out-of-line mig structures */
172extern void mig_allocate(vm_address_t *, vm_size_t);
173
174/* Deallocate memory used for out-of-line mig structures */
175extern void mig_deallocate(vm_address_t, vm_size_t);
176
177
178__END_DECLS
179
180#endif /* _MACH_MIG_H_ */
lib/libc/include/aarch64-macos-gnu/mach/mig_errors.h created+125
......@@ -0,0 +1,125 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * Mach Interface Generator errors
60 *
61 */
62
63#ifndef _MACH_MIG_ERRORS_H_
64#define _MACH_MIG_ERRORS_H_
65
66#include <mach/mig.h>
67#include <mach/ndr.h>
68#include <mach/message.h>
69#include <mach/kern_return.h>
70
71#include <sys/cdefs.h>
72
73/*
74 * These error codes should be specified as system 4, subsytem 2.
75 * But alas backwards compatibility makes that impossible.
76 * The problem is old clients of new servers (eg, the kernel)
77 * which get strange large error codes when there is a Mig problem
78 * in the server. Unfortunately, the IPC system doesn't have
79 * the knowledge to convert the codes in this situation.
80 */
81
82#define MIG_TYPE_ERROR -300 /* client type check failure */
83#define MIG_REPLY_MISMATCH -301 /* wrong reply message ID */
84#define MIG_REMOTE_ERROR -302 /* server detected error */
85#define MIG_BAD_ID -303 /* bad request message ID */
86#define MIG_BAD_ARGUMENTS -304 /* server type check failure */
87#define MIG_NO_REPLY -305 /* no reply should be send */
88#define MIG_EXCEPTION -306 /* server raised exception */
89#define MIG_ARRAY_TOO_LARGE -307 /* array not large enough */
90#define MIG_SERVER_DIED -308 /* server died */
91#define MIG_TRAILER_ERROR -309 /* trailer has an unknown format */
92
93/*
94 * Whenever MIG detects an error, it sends back a generic
95 * mig_reply_error_t format message. Clients must accept
96 * these in addition to the expected reply message format.
97 */
98#pragma pack(4)
99typedef struct {
100 mach_msg_header_t Head;
101 NDR_record_t NDR;
102 kern_return_t RetCode;
103} mig_reply_error_t;
104#pragma pack()
105
106
107__BEGIN_DECLS
108
109#if !defined(__NDR_convert__mig_reply_error_t__defined)
110#define __NDR_convert__mig_reply_error_t__defined
111
112static __inline__ void
113__NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x)
114{
115#if defined(__NDR_convert__int_rep__kern_return_t__defined)
116 if (x->NDR.int_rep != NDR_record.int_rep) {
117 __NDR_convert__int_rep__kern_return_t(&x->RetCode, x->NDR.int_rep);
118 }
119#endif /* __NDR_convert__int_rep__kern_return_t__defined */
120}
121#endif /* !defined(__NDR_convert__mig_reply_error_t__defined) */
122
123__END_DECLS
124
125#endif /* _MACH_MIG_ERRORS_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/mach/ndr.h created+207
......@@ -0,0 +1,207 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32#ifndef _MACH_NDR_H_
33#define _MACH_NDR_H_
34
35#include <stdint.h>
36#include <sys/cdefs.h>
37#include <libkern/OSByteOrder.h>
38
39
40typedef struct {
41 unsigned char mig_vers;
42 unsigned char if_vers;
43 unsigned char reserved1;
44 unsigned char mig_encoding;
45 unsigned char int_rep;
46 unsigned char char_rep;
47 unsigned char float_rep;
48 unsigned char reserved2;
49} NDR_record_t;
50
51/*
52 * MIG supported protocols for Network Data Representation
53 */
54#define NDR_PROTOCOL_2_0 0
55
56/*
57 * NDR 2.0 format flag type definition and values.
58 */
59#define NDR_INT_BIG_ENDIAN 0
60#define NDR_INT_LITTLE_ENDIAN 1
61#define NDR_FLOAT_IEEE 0
62#define NDR_FLOAT_VAX 1
63#define NDR_FLOAT_CRAY 2
64#define NDR_FLOAT_IBM 3
65#define NDR_CHAR_ASCII 0
66#define NDR_CHAR_EBCDIC 1
67
68extern NDR_record_t NDR_record;
69
70/* NDR conversion off by default */
71
72#if !defined(__NDR_convert__)
73#define __NDR_convert__ 0
74#endif /* !defined(__NDR_convert__) */
75
76#ifndef __NDR_convert__int_rep__
77#define __NDR_convert__int_rep__ __NDR_convert__
78#endif /* __NDR_convert__int_rep__ */
79
80#ifndef __NDR_convert__char_rep__
81#define __NDR_convert__char_rep__ 0
82#endif /* __NDR_convert__char_rep__ */
83
84#ifndef __NDR_convert__float_rep__
85#define __NDR_convert__float_rep__ 0
86#endif /* __NDR_convert__float_rep__ */
87
88#if __NDR_convert__
89
90#define __NDR_convert__NOOP do ; while (0)
91#define __NDR_convert__UNKNOWN(s) __NDR_convert__NOOP
92#define __NDR_convert__SINGLE(a, f, r) do { r((a), (f)); } while (0)
93#define __NDR_convert__ARRAY(a, f, c, r) \
94 do { int __i__, __C__ = (c); \
95 for (__i__ = 0; __i__ < __C__; __i__++) \
96 r(&(a)[__i__], f); } while (0)
97#define __NDR_convert__2DARRAY(a, f, s, c, r) \
98 do { int __i__, __C__ = (c), __S__ = (s); \
99 for (__i__ = 0; __i__ < __C__; __i__++) \
100 r(&(a)[__i__ * __S__], f, __S__); } while (0)
101
102#if __NDR_convert__int_rep__
103
104#define __NDR_READSWAP_assign(a, rs) do { *(a) = rs(a); } while (0)
105
106#define __NDR_READSWAP__uint16_t(a) OSReadSwapInt16((void *)a, 0)
107#define __NDR_READSWAP__int16_t(a) (int16_t)OSReadSwapInt16((void *)a, 0)
108#define __NDR_READSWAP__uint32_t(a) OSReadSwapInt32((void *)a, 0)
109#define __NDR_READSWAP__int32_t(a) (int32_t)OSReadSwapInt32((void *)a, 0)
110#define __NDR_READSWAP__uint64_t(a) OSReadSwapInt64((void *)a, 0)
111#define __NDR_READSWAP__int64_t(a) (int64_t)OSReadSwapInt64((void *)a, 0)
112
113__BEGIN_DECLS
114
115static __inline__ float
116__NDR_READSWAP__float(float *argp)
117{
118 union {
119 float sv;
120 uint32_t ull;
121 } result;
122 result.ull = __NDR_READSWAP__uint32_t((uint32_t *)argp);
123 return result.sv;
124}
125
126static __inline__ double
127__NDR_READSWAP__double(double *argp)
128{
129 union {
130 double sv;
131 uint64_t ull;
132 } result;
133 result.ull = __NDR_READSWAP__uint64_t((uint64_t *)argp);
134 return result.sv;
135}
136
137__END_DECLS
138
139#define __NDR_convert__int_rep__int16_t__defined
140#define __NDR_convert__int_rep__int16_t(v, f) \
141 __NDR_READSWAP_assign(v, __NDR_READSWAP__int16_t)
142
143#define __NDR_convert__int_rep__uint16_t__defined
144#define __NDR_convert__int_rep__uint16_t(v, f) \
145 __NDR_READSWAP_assign(v, __NDR_READSWAP__uint16_t)
146
147#define __NDR_convert__int_rep__int32_t__defined
148#define __NDR_convert__int_rep__int32_t(v, f) \
149 __NDR_READSWAP_assign(v, __NDR_READSWAP__int32_t)
150
151#define __NDR_convert__int_rep__uint32_t__defined
152#define __NDR_convert__int_rep__uint32_t(v, f) \
153 __NDR_READSWAP_assign(v, __NDR_READSWAP__uint32_t)
154
155#define __NDR_convert__int_rep__int64_t__defined
156#define __NDR_convert__int_rep__int64_t(v, f) \
157 __NDR_READSWAP_assign(v, __NDR_READSWAP__int64_t)
158
159#define __NDR_convert__int_rep__uint64_t__defined
160#define __NDR_convert__int_rep__uint64_t(v, f) \
161 __NDR_READSWAP_assign(v, __NDR_READSWAP__uint64_t)
162
163#define __NDR_convert__int_rep__float__defined
164#define __NDR_convert__int_rep__float(v, f) \
165 __NDR_READSWAP_assign(v, __NDR_READSWAP__float)
166
167#define __NDR_convert__int_rep__double__defined
168#define __NDR_convert__int_rep__double(v, f) \
169 __NDR_READSWAP_assign(v, __NDR_READSWAP__double)
170
171#define __NDR_convert__int_rep__boolean_t__defined
172#define __NDR_convert__int_rep__boolean_t(v, f) \
173 __NDR_convert__int_rep__int32_t(v,f)
174
175#define __NDR_convert__int_rep__kern_return_t__defined
176#define __NDR_convert__int_rep__kern_return_t(v, f) \
177 __NDR_convert__int_rep__int32_t(v,f)
178
179#define __NDR_convert__int_rep__mach_port_name_t__defined
180#define __NDR_convert__int_rep__mach_port_name_t(v, f) \
181 __NDR_convert__int_rep__uint32_t(v,f)
182
183#define __NDR_convert__int_rep__mach_msg_type_number_t__defined
184#define __NDR_convert__int_rep__mach_msg_type_number_t(v, f) \
185 __NDR_convert__int_rep__uint32_t(v,f)
186
187#endif /* __NDR_convert__int_rep__ */
188
189#if __NDR_convert__char_rep__
190
191#warning NDR character representation conversions not implemented yet!
192#define __NDR_convert__char_rep__char(v, f) __NDR_convert__NOOP
193#define __NDR_convert__char_rep__string(v, f, l) __NDR_convert__NOOP
194
195#endif /* __NDR_convert__char_rep__ */
196
197#if __NDR_convert__float_rep__
198
199#warning NDR floating point representation conversions not implemented yet!
200#define __NDR_convert__float_rep__float(v, f) __NDR_convert__NOOP
201#define __NDR_convert__float_rep__double(v, f) __NDR_convert__NOOP
202
203#endif /* __NDR_convert__float_rep__ */
204
205#endif /* __NDR_convert__ */
206
207#endif /* _MACH_NDR_H_ */
lib/libc/include/aarch64-macos-gnu/mach/notify.h created+141
......@@ -0,0 +1,141 @@
1/*
2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/notify.h
60 *
61 * Kernel notification message definitions.
62 */
63
64#ifndef _MACH_NOTIFY_H_
65#define _MACH_NOTIFY_H_
66
67#include <mach/port.h>
68#include <mach/message.h>
69#include <mach/ndr.h>
70
71/*
72 * An alternative specification of the notification interface
73 * may be found in mach/notify.defs.
74 */
75
76#define MACH_NOTIFY_FIRST 0100
77#define MACH_NOTIFY_PORT_DELETED (MACH_NOTIFY_FIRST + 001)
78/* A send or send-once right was deleted. */
79#define MACH_NOTIFY_SEND_POSSIBLE (MACH_NOTIFY_FIRST + 002)
80/* Now possible to send using specified right */
81#define MACH_NOTIFY_PORT_DESTROYED (MACH_NOTIFY_FIRST + 005)
82/* A receive right was (would have been) deallocated */
83#define MACH_NOTIFY_NO_SENDERS (MACH_NOTIFY_FIRST + 006)
84/* Receive right has no extant send rights */
85#define MACH_NOTIFY_SEND_ONCE (MACH_NOTIFY_FIRST + 007)
86/* An extant send-once right died */
87#define MACH_NOTIFY_DEAD_NAME (MACH_NOTIFY_FIRST + 010)
88/* Send or send-once right died, leaving a dead-name */
89#define MACH_NOTIFY_LAST (MACH_NOTIFY_FIRST + 015)
90
91typedef mach_port_t notify_port_t;
92
93/*
94 * Hard-coded message structures for receiving Mach port notification
95 * messages. However, they are not actual large enough to receive
96 * the largest trailers current exported by Mach IPC (so they cannot
97 * be used for space allocations in situations using these new larger
98 * trailers). Instead, the MIG-generated server routines (and
99 * related prototypes should be used).
100 */
101typedef struct {
102 mach_msg_header_t not_header;
103 NDR_record_t NDR;
104 mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
105 mach_msg_format_0_trailer_t trailer;
106} mach_port_deleted_notification_t;
107
108typedef struct {
109 mach_msg_header_t not_header;
110 NDR_record_t NDR;
111 mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
112 mach_msg_format_0_trailer_t trailer;
113} mach_send_possible_notification_t;
114
115typedef struct {
116 mach_msg_header_t not_header;
117 mach_msg_body_t not_body;
118 mach_msg_port_descriptor_t not_port;/* MACH_MSG_TYPE_PORT_RECEIVE */
119 mach_msg_format_0_trailer_t trailer;
120} mach_port_destroyed_notification_t;
121
122typedef struct {
123 mach_msg_header_t not_header;
124 NDR_record_t NDR;
125 mach_msg_type_number_t not_count;
126 mach_msg_format_0_trailer_t trailer;
127} mach_no_senders_notification_t;
128
129typedef struct {
130 mach_msg_header_t not_header;
131 mach_msg_format_0_trailer_t trailer;
132} mach_send_once_notification_t;
133
134typedef struct {
135 mach_msg_header_t not_header;
136 NDR_record_t NDR;
137 mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
138 mach_msg_format_0_trailer_t trailer;
139} mach_dead_name_notification_t;
140
141#endif /* _MACH_NOTIFY_H_ */
lib/libc/include/aarch64-macos-gnu/mach/policy.h created+235
......@@ -0,0 +1,235 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_POLICY_H_
60#define _MACH_POLICY_H_
61
62/*
63 * mach/policy.h
64 *
65 * Definitions for scheduing policy.
66 */
67
68/*
69 * All interfaces defined here are obsolete.
70 */
71
72#include <mach/boolean.h>
73#include <mach/message.h>
74#include <mach/vm_types.h>
75
76/*
77 * Old scheduling control interface
78 */
79typedef int policy_t;
80typedef integer_t *policy_info_t;
81typedef integer_t *policy_base_t;
82typedef integer_t *policy_limit_t;
83
84/*
85 * Policy definitions. Policies should be powers of 2,
86 * but cannot be or'd together other than to test for a
87 * policy 'class'.
88 */
89#define POLICY_NULL 0 /* none */
90#define POLICY_TIMESHARE 1 /* timesharing */
91#define POLICY_RR 2 /* fixed round robin */
92#define POLICY_FIFO 4 /* fixed fifo */
93
94#define __NEW_SCHEDULING_FRAMEWORK__
95
96/*
97 * Check if policy is of 'class' fixed-priority.
98 */
99#define POLICYCLASS_FIXEDPRI (POLICY_RR | POLICY_FIFO)
100
101/*
102 * Check if policy is valid.
103 */
104#define invalid_policy(policy) \
105 ((policy) != POLICY_TIMESHARE && \
106 (policy) != POLICY_RR && \
107 (policy) != POLICY_FIFO)
108
109
110/*
111 * Types for TIMESHARE policy
112 */
113struct policy_timeshare_base {
114 integer_t base_priority;
115};
116struct policy_timeshare_limit {
117 integer_t max_priority;
118};
119struct policy_timeshare_info {
120 integer_t max_priority;
121 integer_t base_priority;
122 integer_t cur_priority;
123 boolean_t depressed;
124 integer_t depress_priority;
125};
126
127typedef struct policy_timeshare_base *policy_timeshare_base_t;
128typedef struct policy_timeshare_limit *policy_timeshare_limit_t;
129typedef struct policy_timeshare_info *policy_timeshare_info_t;
130
131typedef struct policy_timeshare_base policy_timeshare_base_data_t;
132typedef struct policy_timeshare_limit policy_timeshare_limit_data_t;
133typedef struct policy_timeshare_info policy_timeshare_info_data_t;
134
135
136#define POLICY_TIMESHARE_BASE_COUNT ((mach_msg_type_number_t) \
137 (sizeof(struct policy_timeshare_base)/sizeof(integer_t)))
138#define POLICY_TIMESHARE_LIMIT_COUNT ((mach_msg_type_number_t) \
139 (sizeof(struct policy_timeshare_limit)/sizeof(integer_t)))
140#define POLICY_TIMESHARE_INFO_COUNT ((mach_msg_type_number_t) \
141 (sizeof(struct policy_timeshare_info)/sizeof(integer_t)))
142
143
144/*
145 * Types for the ROUND ROBIN (RR) policy
146 */
147struct policy_rr_base {
148 integer_t base_priority;
149 integer_t quantum;
150};
151struct policy_rr_limit {
152 integer_t max_priority;
153};
154struct policy_rr_info {
155 integer_t max_priority;
156 integer_t base_priority;
157 integer_t quantum;
158 boolean_t depressed;
159 integer_t depress_priority;
160};
161
162typedef struct policy_rr_base *policy_rr_base_t;
163typedef struct policy_rr_limit *policy_rr_limit_t;
164typedef struct policy_rr_info *policy_rr_info_t;
165
166typedef struct policy_rr_base policy_rr_base_data_t;
167typedef struct policy_rr_limit policy_rr_limit_data_t;
168typedef struct policy_rr_info policy_rr_info_data_t;
169
170#define POLICY_RR_BASE_COUNT ((mach_msg_type_number_t) \
171 (sizeof(struct policy_rr_base)/sizeof(integer_t)))
172#define POLICY_RR_LIMIT_COUNT ((mach_msg_type_number_t) \
173 (sizeof(struct policy_rr_limit)/sizeof(integer_t)))
174#define POLICY_RR_INFO_COUNT ((mach_msg_type_number_t) \
175 (sizeof(struct policy_rr_info)/sizeof(integer_t)))
176
177
178/*
179 * Types for the FIRST-IN-FIRST-OUT (FIFO) policy
180 */
181struct policy_fifo_base {
182 integer_t base_priority;
183};
184struct policy_fifo_limit {
185 integer_t max_priority;
186};
187struct policy_fifo_info {
188 integer_t max_priority;
189 integer_t base_priority;
190 boolean_t depressed;
191 integer_t depress_priority;
192};
193
194typedef struct policy_fifo_base *policy_fifo_base_t;
195typedef struct policy_fifo_limit *policy_fifo_limit_t;
196typedef struct policy_fifo_info *policy_fifo_info_t;
197
198typedef struct policy_fifo_base policy_fifo_base_data_t;
199typedef struct policy_fifo_limit policy_fifo_limit_data_t;
200typedef struct policy_fifo_info policy_fifo_info_data_t;
201
202#define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t) \
203 (sizeof(struct policy_fifo_base)/sizeof(integer_t)))
204#define POLICY_FIFO_LIMIT_COUNT ((mach_msg_type_number_t) \
205 (sizeof(struct policy_fifo_limit)/sizeof(integer_t)))
206#define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t) \
207 (sizeof(struct policy_fifo_info)/sizeof(integer_t)))
208
209/*
210 * Aggregate policy types
211 */
212
213struct policy_bases {
214 policy_timeshare_base_data_t ts;
215 policy_rr_base_data_t rr;
216 policy_fifo_base_data_t fifo;
217};
218
219struct policy_limits {
220 policy_timeshare_limit_data_t ts;
221 policy_rr_limit_data_t rr;
222 policy_fifo_limit_data_t fifo;
223};
224
225struct policy_infos {
226 policy_timeshare_info_data_t ts;
227 policy_rr_info_data_t rr;
228 policy_fifo_info_data_t fifo;
229};
230
231typedef struct policy_bases policy_base_data_t;
232typedef struct policy_limits policy_limit_data_t;
233typedef struct policy_infos policy_info_data_t;
234
235#endif /* _MACH_POLICY_H_ */
lib/libc/include/aarch64-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
106typedef natural_t mach_port_name_t;
107typedef 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
130typedef 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
188typedef 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
199typedef natural_t mach_port_type_t;
200typedef 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
236typedef natural_t mach_port_urefs_t;
237typedef integer_t mach_port_delta_t; /* change in urefs */
238
239/* Attributes of ports. (See mach_port_get_receive_status.) */
240
241typedef natural_t mach_port_seqno_t; /* sequence number */
242typedef natural_t mach_port_mscount_t; /* make-send count */
243typedef natural_t mach_port_msgcount_t; /* number of msgs */
244typedef 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 */
251typedef unsigned int mach_port_srights_t; /* status of send rights */
252
253typedef 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
276typedef 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
290typedef 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
296typedef integer_t *mach_port_info_t; /* varying array of natural_t */
297
298/* Flavors for mach_port_get/set_attributes() */
299typedef 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 */
319typedef 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 */
349typedef 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
358typedef 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 */
368enum 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 */
418typedef mach_port_t port_t;
419typedef mach_port_name_t port_name_t;
420typedef 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/aarch64-macos-gnu/mach/processor.h created+360
......@@ -0,0 +1,360 @@
1#ifndef _processor_user_
2#define _processor_user_
3
4/* Module processor */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef processor_MSG_COUNT
52#define processor_MSG_COUNT 6
53#endif /* processor_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59
60#ifdef __BeforeMigUserHeader
61__BeforeMigUserHeader
62#endif /* __BeforeMigUserHeader */
63
64#include <sys/cdefs.h>
65__BEGIN_DECLS
66
67
68/* Routine processor_start */
69#ifdef mig_external
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t processor_start
75(
76 processor_t processor
77);
78
79/* Routine processor_exit */
80#ifdef mig_external
81mig_external
82#else
83extern
84#endif /* mig_external */
85kern_return_t processor_exit
86(
87 processor_t processor
88);
89
90/* Routine processor_info */
91#ifdef mig_external
92mig_external
93#else
94extern
95#endif /* mig_external */
96kern_return_t processor_info
97(
98 processor_t processor,
99 processor_flavor_t flavor,
100 host_t *host,
101 processor_info_t processor_info_out,
102 mach_msg_type_number_t *processor_info_outCnt
103);
104
105/* Routine processor_control */
106#ifdef mig_external
107mig_external
108#else
109extern
110#endif /* mig_external */
111kern_return_t processor_control
112(
113 processor_t processor,
114 processor_info_t processor_cmd,
115 mach_msg_type_number_t processor_cmdCnt
116);
117
118/* Routine processor_assign */
119#ifdef mig_external
120mig_external
121#else
122extern
123#endif /* mig_external */
124kern_return_t processor_assign
125(
126 processor_t processor,
127 processor_set_t new_set,
128 boolean_t wait
129);
130
131/* Routine processor_get_assignment */
132#ifdef mig_external
133mig_external
134#else
135extern
136#endif /* mig_external */
137kern_return_t processor_get_assignment
138(
139 processor_t processor,
140 processor_set_name_t *assigned_set
141);
142
143__END_DECLS
144
145/********************** Caution **************************/
146/* The following data types should be used to calculate */
147/* maximum message sizes only. The actual message may be */
148/* smaller, and the position of the arguments within the */
149/* message layout may vary from what is presented here. */
150/* For example, if any of the arguments are variable- */
151/* sized, and less than the maximum is sent, the data */
152/* will be packed tight in the actual message to reduce */
153/* the presence of holes. */
154/********************** Caution **************************/
155
156/* typedefs for all requests */
157
158#ifndef __Request__processor_subsystem__defined
159#define __Request__processor_subsystem__defined
160
161#ifdef __MigPackStructs
162#pragma pack(push, 4)
163#endif
164 typedef struct {
165 mach_msg_header_t Head;
166 } __Request__processor_start_t __attribute__((unused));
167#ifdef __MigPackStructs
168#pragma pack(pop)
169#endif
170
171#ifdef __MigPackStructs
172#pragma pack(push, 4)
173#endif
174 typedef struct {
175 mach_msg_header_t Head;
176 } __Request__processor_exit_t __attribute__((unused));
177#ifdef __MigPackStructs
178#pragma pack(pop)
179#endif
180
181#ifdef __MigPackStructs
182#pragma pack(push, 4)
183#endif
184 typedef struct {
185 mach_msg_header_t Head;
186 NDR_record_t NDR;
187 processor_flavor_t flavor;
188 mach_msg_type_number_t processor_info_outCnt;
189 } __Request__processor_info_t __attribute__((unused));
190#ifdef __MigPackStructs
191#pragma pack(pop)
192#endif
193
194#ifdef __MigPackStructs
195#pragma pack(push, 4)
196#endif
197 typedef struct {
198 mach_msg_header_t Head;
199 NDR_record_t NDR;
200 mach_msg_type_number_t processor_cmdCnt;
201 integer_t processor_cmd[20];
202 } __Request__processor_control_t __attribute__((unused));
203#ifdef __MigPackStructs
204#pragma pack(pop)
205#endif
206
207#ifdef __MigPackStructs
208#pragma pack(push, 4)
209#endif
210 typedef struct {
211 mach_msg_header_t Head;
212 /* start of the kernel processed data */
213 mach_msg_body_t msgh_body;
214 mach_msg_port_descriptor_t new_set;
215 /* end of the kernel processed data */
216 NDR_record_t NDR;
217 boolean_t wait;
218 } __Request__processor_assign_t __attribute__((unused));
219#ifdef __MigPackStructs
220#pragma pack(pop)
221#endif
222
223#ifdef __MigPackStructs
224#pragma pack(push, 4)
225#endif
226 typedef struct {
227 mach_msg_header_t Head;
228 } __Request__processor_get_assignment_t __attribute__((unused));
229#ifdef __MigPackStructs
230#pragma pack(pop)
231#endif
232#endif /* !__Request__processor_subsystem__defined */
233
234/* union of all requests */
235
236#ifndef __RequestUnion__processor_subsystem__defined
237#define __RequestUnion__processor_subsystem__defined
238union __RequestUnion__processor_subsystem {
239 __Request__processor_start_t Request_processor_start;
240 __Request__processor_exit_t Request_processor_exit;
241 __Request__processor_info_t Request_processor_info;
242 __Request__processor_control_t Request_processor_control;
243 __Request__processor_assign_t Request_processor_assign;
244 __Request__processor_get_assignment_t Request_processor_get_assignment;
245};
246#endif /* !__RequestUnion__processor_subsystem__defined */
247/* typedefs for all replies */
248
249#ifndef __Reply__processor_subsystem__defined
250#define __Reply__processor_subsystem__defined
251
252#ifdef __MigPackStructs
253#pragma pack(push, 4)
254#endif
255 typedef struct {
256 mach_msg_header_t Head;
257 NDR_record_t NDR;
258 kern_return_t RetCode;
259 } __Reply__processor_start_t __attribute__((unused));
260#ifdef __MigPackStructs
261#pragma pack(pop)
262#endif
263
264#ifdef __MigPackStructs
265#pragma pack(push, 4)
266#endif
267 typedef struct {
268 mach_msg_header_t Head;
269 NDR_record_t NDR;
270 kern_return_t RetCode;
271 } __Reply__processor_exit_t __attribute__((unused));
272#ifdef __MigPackStructs
273#pragma pack(pop)
274#endif
275
276#ifdef __MigPackStructs
277#pragma pack(push, 4)
278#endif
279 typedef struct {
280 mach_msg_header_t Head;
281 /* start of the kernel processed data */
282 mach_msg_body_t msgh_body;
283 mach_msg_port_descriptor_t host;
284 /* end of the kernel processed data */
285 NDR_record_t NDR;
286 mach_msg_type_number_t processor_info_outCnt;
287 integer_t processor_info_out[20];
288 } __Reply__processor_info_t __attribute__((unused));
289#ifdef __MigPackStructs
290#pragma pack(pop)
291#endif
292
293#ifdef __MigPackStructs
294#pragma pack(push, 4)
295#endif
296 typedef struct {
297 mach_msg_header_t Head;
298 NDR_record_t NDR;
299 kern_return_t RetCode;
300 } __Reply__processor_control_t __attribute__((unused));
301#ifdef __MigPackStructs
302#pragma pack(pop)
303#endif
304
305#ifdef __MigPackStructs
306#pragma pack(push, 4)
307#endif
308 typedef struct {
309 mach_msg_header_t Head;
310 NDR_record_t NDR;
311 kern_return_t RetCode;
312 } __Reply__processor_assign_t __attribute__((unused));
313#ifdef __MigPackStructs
314#pragma pack(pop)
315#endif
316
317#ifdef __MigPackStructs
318#pragma pack(push, 4)
319#endif
320 typedef struct {
321 mach_msg_header_t Head;
322 /* start of the kernel processed data */
323 mach_msg_body_t msgh_body;
324 mach_msg_port_descriptor_t assigned_set;
325 /* end of the kernel processed data */
326 } __Reply__processor_get_assignment_t __attribute__((unused));
327#ifdef __MigPackStructs
328#pragma pack(pop)
329#endif
330#endif /* !__Reply__processor_subsystem__defined */
331
332/* union of all replies */
333
334#ifndef __ReplyUnion__processor_subsystem__defined
335#define __ReplyUnion__processor_subsystem__defined
336union __ReplyUnion__processor_subsystem {
337 __Reply__processor_start_t Reply_processor_start;
338 __Reply__processor_exit_t Reply_processor_exit;
339 __Reply__processor_info_t Reply_processor_info;
340 __Reply__processor_control_t Reply_processor_control;
341 __Reply__processor_assign_t Reply_processor_assign;
342 __Reply__processor_get_assignment_t Reply_processor_get_assignment;
343};
344#endif /* !__RequestUnion__processor_subsystem__defined */
345
346#ifndef subsystem_to_name_map_processor
347#define subsystem_to_name_map_processor \
348 { "processor_start", 3000 },\
349 { "processor_exit", 3001 },\
350 { "processor_info", 3002 },\
351 { "processor_control", 3003 },\
352 { "processor_assign", 3004 },\
353 { "processor_get_assignment", 3005 }
354#endif
355
356#ifdef __AfterMigUserHeader
357__AfterMigUserHeader
358#endif /* __AfterMigUserHeader */
359
360#endif /* _processor_user_ */
lib/libc/include/aarch64-macos-gnu/mach/processor_info.h created+153
......@@ -0,0 +1,153 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59/*
60 * File: mach/processor_info.h
61 * Author: David L. Black
62 * Date: 1988
63 *
64 * Data structure definitions for processor_info, processor_set_info
65 */
66
67#ifndef _MACH_PROCESSOR_INFO_H_
68#define _MACH_PROCESSOR_INFO_H_
69
70#include <mach/message.h>
71#include <mach/machine.h>
72#include <mach/machine/processor_info.h>
73
74/*
75 * Generic information structure to allow for expansion.
76 */
77typedef integer_t *processor_info_t; /* varying array of int. */
78typedef integer_t *processor_info_array_t; /* varying array of int */
79
80#define PROCESSOR_INFO_MAX (1024) /* max array size */
81typedef integer_t processor_info_data_t[PROCESSOR_INFO_MAX];
82
83
84typedef integer_t *processor_set_info_t; /* varying array of int. */
85
86#define PROCESSOR_SET_INFO_MAX (1024) /* max array size */
87typedef integer_t processor_set_info_data_t[PROCESSOR_SET_INFO_MAX];
88
89/*
90 * Currently defined information.
91 */
92typedef int processor_flavor_t;
93#define PROCESSOR_BASIC_INFO 1 /* basic information */
94#define PROCESSOR_CPU_LOAD_INFO 2 /* cpu load information */
95#define PROCESSOR_PM_REGS_INFO 0x10000001 /* performance monitor register info */
96#define PROCESSOR_TEMPERATURE 0x10000002 /* Processor core temperature */
97
98struct processor_basic_info {
99 cpu_type_t cpu_type; /* type of cpu */
100 cpu_subtype_t cpu_subtype; /* subtype of cpu */
101 boolean_t running; /* is processor running */
102 int slot_num; /* slot number */
103 boolean_t is_master; /* is this the master processor */
104};
105
106typedef struct processor_basic_info processor_basic_info_data_t;
107typedef struct processor_basic_info *processor_basic_info_t;
108#define PROCESSOR_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
109 (sizeof(processor_basic_info_data_t)/sizeof(natural_t)))
110
111struct processor_cpu_load_info { /* number of ticks while running... */
112 unsigned int cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */
113};
114
115typedef struct processor_cpu_load_info processor_cpu_load_info_data_t;
116typedef struct processor_cpu_load_info *processor_cpu_load_info_t;
117#define PROCESSOR_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
118 (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t)))
119
120/*
121 * Scaling factor for load_average, mach_factor.
122 */
123#define LOAD_SCALE 1000
124
125typedef int processor_set_flavor_t;
126#define PROCESSOR_SET_BASIC_INFO 5 /* basic information */
127
128struct processor_set_basic_info {
129 int processor_count; /* How many processors */
130 int default_policy; /* When others not enabled */
131};
132
133typedef struct processor_set_basic_info processor_set_basic_info_data_t;
134typedef struct processor_set_basic_info *processor_set_basic_info_t;
135#define PROCESSOR_SET_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
136 (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t)))
137
138#define PROCESSOR_SET_LOAD_INFO 4 /* scheduling statistics */
139
140struct processor_set_load_info {
141 int task_count; /* How many tasks */
142 int thread_count; /* How many threads */
143 integer_t load_average; /* Scaled */
144 integer_t mach_factor; /* Scaled */
145};
146
147typedef struct processor_set_load_info processor_set_load_info_data_t;
148typedef struct processor_set_load_info *processor_set_load_info_t;
149#define PROCESSOR_SET_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
150 (sizeof(processor_set_load_info_data_t)/sizeof(natural_t)))
151
152
153#endif /* _MACH_PROCESSOR_INFO_H_ */
lib/libc/include/aarch64-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
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef processor_set_MSG_COUNT
52#define processor_set_MSG_COUNT 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
70mig_external
71#else
72extern
73#endif /* mig_external */
74kern_return_t processor_set_statistics
75(
76 processor_set_name_t pset,
77 processor_set_flavor_t flavor,
78 processor_set_info_t info_out,
79 mach_msg_type_number_t *info_outCnt
80);
81
82/* Routine processor_set_destroy */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t processor_set_destroy
89(
90 processor_set_t set
91);
92
93/* Routine processor_set_max_priority */
94#ifdef mig_external
95mig_external
96#else
97extern
98#endif /* mig_external */
99kern_return_t processor_set_max_priority
100(
101 processor_set_t processor_set,
102 int max_priority,
103 boolean_t change_threads
104);
105
106/* Routine processor_set_policy_enable */
107#ifdef mig_external
108mig_external
109#else
110extern
111#endif /* mig_external */
112kern_return_t processor_set_policy_enable
113(
114 processor_set_t processor_set,
115 int policy
116);
117
118/* Routine processor_set_policy_disable */
119#ifdef mig_external
120mig_external
121#else
122extern
123#endif /* mig_external */
124kern_return_t processor_set_policy_disable
125(
126 processor_set_t processor_set,
127 int policy,
128 boolean_t change_threads
129);
130
131/* Routine processor_set_tasks */
132#ifdef mig_external
133mig_external
134#else
135extern
136#endif /* mig_external */
137kern_return_t processor_set_tasks
138(
139 processor_set_t processor_set,
140 task_array_t *task_list,
141 mach_msg_type_number_t *task_listCnt
142);
143
144/* Routine processor_set_threads */
145#ifdef mig_external
146mig_external
147#else
148extern
149#endif /* mig_external */
150kern_return_t processor_set_threads
151(
152 processor_set_t processor_set,
153 thread_act_array_t *thread_list,
154 mach_msg_type_number_t *thread_listCnt
155);
156
157/* Routine processor_set_policy_control */
158#ifdef mig_external
159mig_external
160#else
161extern
162#endif /* mig_external */
163kern_return_t processor_set_policy_control
164(
165 processor_set_t pset,
166 processor_set_flavor_t flavor,
167 processor_set_info_t policy_info,
168 mach_msg_type_number_t policy_infoCnt,
169 boolean_t change
170);
171
172/* Routine processor_set_stack_usage */
173#ifdef mig_external
174mig_external
175#else
176extern
177#endif /* mig_external */
178kern_return_t processor_set_stack_usage
179(
180 processor_set_t pset,
181 unsigned *ltotal,
182 vm_size_t *space,
183 vm_size_t *resident,
184 vm_size_t *maxusage,
185 vm_offset_t *maxstack
186);
187
188/* Routine processor_set_info */
189#ifdef mig_external
190mig_external
191#else
192extern
193#endif /* mig_external */
194kern_return_t processor_set_info
195(
196 processor_set_name_t set_name,
197 int flavor,
198 host_t *host,
199 processor_set_info_t info_out,
200 mach_msg_type_number_t *info_outCnt
201);
202
203/* Routine processor_set_tasks_with_flavor */
204#ifdef mig_external
205mig_external
206#else
207extern
208#endif /* mig_external */
209kern_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
371union __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
551union __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/aarch64-macos-gnu/mach/rpc.h created+135
......@@ -0,0 +1,135 @@
1/*
2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32/*
33 * Mach RPC Subsystem Interfaces
34 */
35
36#ifndef _MACH_RPC_H_
37#define _MACH_RPC_H_
38
39#include <mach/boolean.h>
40#include <mach/kern_return.h>
41#include <mach/port.h>
42#include <mach/vm_types.h>
43
44#include <mach/mig.h>
45#include <mach/mig_errors.h>
46#include <mach/machine/rpc.h>
47#include <mach/thread_status.h>
48
49/*
50 * These are the types for RPC-specific variants of the MIG routine
51 * descriptor and subsystem data types.
52 *
53 * THIS IS ONLY FOR COMPATIBILITY. WE WILL NOT BE IMPLEMENTING THIS.
54 */
55
56/*
57 * Basic mach rpc types.
58 */
59typedef unsigned int routine_arg_type;
60typedef unsigned int routine_arg_offset;
61typedef unsigned int routine_arg_size;
62
63/*
64 * Definitions for a signature's argument and routine descriptor's.
65 */
66struct rpc_routine_arg_descriptor {
67 routine_arg_type type; /* Port, Array, etc. */
68 routine_arg_size size; /* element size in bytes */
69 routine_arg_size count; /* number of elements */
70 routine_arg_offset offset; /* Offset in list of routine args */
71};
72typedef struct rpc_routine_arg_descriptor *rpc_routine_arg_descriptor_t;
73
74struct rpc_routine_descriptor {
75 mig_impl_routine_t impl_routine; /* Server work func pointer */
76 mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */
77 unsigned int argc; /* Number of argument words */
78 unsigned int descr_count; /* Number of complex argument */
79 /* descriptors */
80 rpc_routine_arg_descriptor_t
81 arg_descr; /* Pointer to beginning of */
82 /* the arg_descr array */
83 unsigned int max_reply_msg; /* Max size for reply msg */
84};
85typedef struct rpc_routine_descriptor *rpc_routine_descriptor_t;
86
87#define RPC_DESCR_SIZE(x) ((x)->descr_count * \
88 sizeof(struct rpc_routine_arg_descriptor))
89
90struct rpc_signature {
91 struct rpc_routine_descriptor rd;
92 struct rpc_routine_arg_descriptor rad[1];
93};
94
95#define RPC_SIGBUF_SIZE 8
96
97/*
98 * A subsystem describes a set of server routines that can be invoked by
99 * mach_rpc() on the ports that are registered with the subsystem. For
100 * each routine, the routine number is given, along with the
101 * address of the implementation function in the server and a
102 * description of the arguments of the routine (it's "signature").
103 *
104 * This structure definition is only a template for what is really a
105 * variable-length structure (generated by MIG for each subsystem).
106 * The actual structures do not always have one entry in the routine
107 * array, and also have a varying number of entries in the arg_descr
108 * array. Each routine has an array of zero or more arg descriptors
109 * one for each complex arg. These arrays are all catenated together
110 * to form the arg_descr field of the subsystem struct. The
111 * arg_descr field of each routine entry points to a unique sub-sequence
112 * within this catenated array. The goal is to keep everything
113 * contiguous.
114 */
115struct rpc_subsystem {
116 void *reserved; /* Reserved for system use */
117
118 mach_msg_id_t start; /* Min routine number */
119 mach_msg_id_t end; /* Max routine number + 1 */
120 unsigned int maxsize; /* Max mach_msg size */
121 vm_address_t base_addr; /* Address of this struct in user */
122
123 struct rpc_routine_descriptor /* Array of routine descriptors */
124 routine[1 /* Actually, (start-end+1) */
125 ];
126
127 struct rpc_routine_arg_descriptor
128 arg_descriptor[1 /* Actually, the sum of the descr_ */
129 ]; /* count fields for all routines */
130};
131typedef struct rpc_subsystem *rpc_subsystem_t;
132
133#define RPC_SUBSYSTEM_NULL ((rpc_subsystem_t) 0)
134
135#endif /* _MACH_RPC_H_ */
lib/libc/include/aarch64-macos-gnu/mach/semaphore.h created+78
......@@ -0,0 +1,78 @@
1/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_SEMAPHORE_H_
30#define _MACH_SEMAPHORE_H_
31
32#include <mach/port.h>
33#include <mach/mach_types.h>
34#include <mach/kern_return.h>
35#include <mach/sync_policy.h>
36
37/*
38 * Forward Declarations
39 *
40 * The semaphore creation and deallocation routines are
41 * defined with the Mach task APIs in <mach/task.h>.
42 *
43 * kern_return_t semaphore_create(task_t task,
44 * semaphore_t *new_semaphore,
45 * sync_policy_t policy,
46 * int value);
47 *
48 * kern_return_t semaphore_destroy(task_t task,
49 * semaphore_t semaphore);
50 */
51
52#include <sys/cdefs.h>
53__BEGIN_DECLS
54
55extern kern_return_t semaphore_signal(semaphore_t semaphore);
56extern kern_return_t semaphore_signal_all(semaphore_t semaphore);
57
58extern kern_return_t semaphore_wait(semaphore_t semaphore);
59
60
61extern kern_return_t semaphore_timedwait(semaphore_t semaphore,
62 mach_timespec_t wait_time);
63
64extern kern_return_t semaphore_timedwait_signal(semaphore_t wait_semaphore,
65 semaphore_t signal_semaphore,
66 mach_timespec_t wait_time);
67
68extern kern_return_t semaphore_wait_signal(semaphore_t wait_semaphore,
69 semaphore_t signal_semaphore);
70
71extern kern_return_t semaphore_signal_thread(semaphore_t semaphore,
72 thread_t thread);
73
74
75__END_DECLS
76
77
78#endif /* _MACH_SEMAPHORE_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/mach/sync_policy.h created+49
......@@ -0,0 +1,49 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
32#ifndef _MACH_SYNC_POLICY_H_
33#define _MACH_SYNC_POLICY_H_
34
35typedef int sync_policy_t;
36
37/*
38 * These options define the wait ordering of the synchronizers
39 */
40#define SYNC_POLICY_FIFO 0x0
41#define SYNC_POLICY_FIXED_PRIORITY 0x1
42#define SYNC_POLICY_REVERSED 0x2
43#define SYNC_POLICY_ORDER_MASK 0x3
44#define SYNC_POLICY_LIFO (SYNC_POLICY_FIFO|SYNC_POLICY_REVERSED)
45
46
47#define SYNC_POLICY_MAX 0x7
48
49#endif /* _MACH_SYNC_POLICY_H_ */
lib/libc/include/aarch64-macos-gnu/mach/task.h created+2523
......@@ -0,0 +1,2523 @@
1#ifndef _task_user_
2#define _task_user_
3
4/* Module task */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef task_MSG_COUNT
52#define task_MSG_COUNT 55
53#endif /* task_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach_debug/mach_debug_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine task_create */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t task_create
76(
77 task_t target_task,
78 ledger_array_t ledgers,
79 mach_msg_type_number_t ledgersCnt,
80 boolean_t inherit_memory,
81 task_t *child_task
82);
83
84/* Routine task_terminate */
85#ifdef mig_external
86mig_external
87#else
88extern
89#endif /* mig_external */
90kern_return_t task_terminate
91(
92 task_t target_task
93);
94
95/* Routine task_threads */
96#ifdef mig_external
97mig_external
98#else
99extern
100#endif /* mig_external */
101kern_return_t task_threads
102(
103 task_inspect_t target_task,
104 thread_act_array_t *act_list,
105 mach_msg_type_number_t *act_listCnt
106);
107
108/* Routine mach_ports_register */
109#ifdef mig_external
110mig_external
111#else
112extern
113#endif /* mig_external */
114__WATCHOS_PROHIBITED
115__TVOS_PROHIBITED
116kern_return_t mach_ports_register
117(
118 task_t target_task,
119 mach_port_array_t init_port_set,
120 mach_msg_type_number_t init_port_setCnt
121);
122
123/* Routine mach_ports_lookup */
124#ifdef mig_external
125mig_external
126#else
127extern
128#endif /* mig_external */
129__WATCHOS_PROHIBITED
130__TVOS_PROHIBITED
131kern_return_t mach_ports_lookup
132(
133 task_t target_task,
134 mach_port_array_t *init_port_set,
135 mach_msg_type_number_t *init_port_setCnt
136);
137
138/* Routine task_info */
139#ifdef mig_external
140mig_external
141#else
142extern
143#endif /* mig_external */
144kern_return_t task_info
145(
146 task_name_t target_task,
147 task_flavor_t flavor,
148 task_info_t task_info_out,
149 mach_msg_type_number_t *task_info_outCnt
150);
151
152/* Routine task_set_info */
153#ifdef mig_external
154mig_external
155#else
156extern
157#endif /* mig_external */
158__WATCHOS_PROHIBITED
159__TVOS_PROHIBITED
160kern_return_t task_set_info
161(
162 task_t target_task,
163 task_flavor_t flavor,
164 task_info_t task_info_in,
165 mach_msg_type_number_t task_info_inCnt
166);
167
168/* Routine task_suspend */
169#ifdef mig_external
170mig_external
171#else
172extern
173#endif /* mig_external */
174__WATCHOS_PROHIBITED
175__TVOS_PROHIBITED
176kern_return_t task_suspend
177(
178 task_t target_task
179);
180
181/* Routine task_resume */
182#ifdef mig_external
183mig_external
184#else
185extern
186#endif /* mig_external */
187__WATCHOS_PROHIBITED
188__TVOS_PROHIBITED
189kern_return_t task_resume
190(
191 task_t target_task
192);
193
194/* Routine task_get_special_port */
195#ifdef mig_external
196mig_external
197#else
198extern
199#endif /* mig_external */
200__WATCHOS_PROHIBITED
201__TVOS_PROHIBITED
202kern_return_t task_get_special_port
203(
204 task_inspect_t task,
205 int which_port,
206 mach_port_t *special_port
207);
208
209/* Routine task_set_special_port */
210#ifdef mig_external
211mig_external
212#else
213extern
214#endif /* mig_external */
215__WATCHOS_PROHIBITED
216__TVOS_PROHIBITED
217kern_return_t task_set_special_port
218(
219 task_t task,
220 int which_port,
221 mach_port_t special_port
222);
223
224/* Routine thread_create */
225#ifdef mig_external
226mig_external
227#else
228extern
229#endif /* mig_external */
230__WATCHOS_PROHIBITED
231__TVOS_PROHIBITED
232kern_return_t thread_create
233(
234 task_t parent_task,
235 thread_act_t *child_act
236);
237
238/* Routine thread_create_running */
239#ifdef mig_external
240mig_external
241#else
242extern
243#endif /* mig_external */
244__WATCHOS_PROHIBITED
245__TVOS_PROHIBITED
246kern_return_t thread_create_running
247(
248 task_t parent_task,
249 thread_state_flavor_t flavor,
250 thread_state_t new_state,
251 mach_msg_type_number_t new_stateCnt,
252 thread_act_t *child_act
253);
254
255/* Routine task_set_exception_ports */
256#ifdef mig_external
257mig_external
258#else
259extern
260#endif /* mig_external */
261__WATCHOS_PROHIBITED
262__TVOS_PROHIBITED
263kern_return_t task_set_exception_ports
264(
265 task_t task,
266 exception_mask_t exception_mask,
267 mach_port_t new_port,
268 exception_behavior_t behavior,
269 thread_state_flavor_t new_flavor
270);
271
272/* Routine task_get_exception_ports */
273#ifdef mig_external
274mig_external
275#else
276extern
277#endif /* mig_external */
278__WATCHOS_PROHIBITED
279__TVOS_PROHIBITED
280kern_return_t task_get_exception_ports
281(
282 task_t task,
283 exception_mask_t exception_mask,
284 exception_mask_array_t masks,
285 mach_msg_type_number_t *masksCnt,
286 exception_handler_array_t old_handlers,
287 exception_behavior_array_t old_behaviors,
288 exception_flavor_array_t old_flavors
289);
290
291/* Routine task_swap_exception_ports */
292#ifdef mig_external
293mig_external
294#else
295extern
296#endif /* mig_external */
297__WATCHOS_PROHIBITED
298__TVOS_PROHIBITED
299kern_return_t task_swap_exception_ports
300(
301 task_t task,
302 exception_mask_t exception_mask,
303 mach_port_t new_port,
304 exception_behavior_t behavior,
305 thread_state_flavor_t new_flavor,
306 exception_mask_array_t masks,
307 mach_msg_type_number_t *masksCnt,
308 exception_handler_array_t old_handlerss,
309 exception_behavior_array_t old_behaviors,
310 exception_flavor_array_t old_flavors
311);
312
313/* Routine lock_set_create */
314#ifdef mig_external
315mig_external
316#else
317extern
318#endif /* mig_external */
319kern_return_t lock_set_create
320(
321 task_t task,
322 lock_set_t *new_lock_set,
323 int n_ulocks,
324 int policy
325);
326
327/* Routine lock_set_destroy */
328#ifdef mig_external
329mig_external
330#else
331extern
332#endif /* mig_external */
333kern_return_t lock_set_destroy
334(
335 task_t task,
336 lock_set_t lock_set
337);
338
339/* Routine semaphore_create */
340#ifdef mig_external
341mig_external
342#else
343extern
344#endif /* mig_external */
345kern_return_t semaphore_create
346(
347 task_t task,
348 semaphore_t *semaphore,
349 int policy,
350 int value
351);
352
353/* Routine semaphore_destroy */
354#ifdef mig_external
355mig_external
356#else
357extern
358#endif /* mig_external */
359kern_return_t semaphore_destroy
360(
361 task_t task,
362 semaphore_t semaphore
363);
364
365/* Routine task_policy_set */
366#ifdef mig_external
367mig_external
368#else
369extern
370#endif /* mig_external */
371__WATCHOS_PROHIBITED
372__TVOS_PROHIBITED
373kern_return_t task_policy_set
374(
375 task_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
383mig_external
384#else
385extern
386#endif /* mig_external */
387__WATCHOS_PROHIBITED
388__TVOS_PROHIBITED
389kern_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
400mig_external
401#else
402extern
403#endif /* mig_external */
404kern_return_t task_sample
405(
406 task_t task,
407 mach_port_t reply
408);
409
410/* Routine task_policy */
411#ifdef mig_external
412mig_external
413#else
414extern
415#endif /* mig_external */
416kern_return_t task_policy
417(
418 task_t task,
419 policy_t policy,
420 policy_base_t base,
421 mach_msg_type_number_t baseCnt,
422 boolean_t set_limit,
423 boolean_t change
424);
425
426/* Routine task_set_emulation */
427#ifdef mig_external
428mig_external
429#else
430extern
431#endif /* mig_external */
432kern_return_t task_set_emulation
433(
434 task_t target_port,
435 vm_address_t routine_entry_pt,
436 int routine_number
437);
438
439/* Routine task_get_emulation_vector */
440#ifdef mig_external
441mig_external
442#else
443extern
444#endif /* mig_external */
445kern_return_t task_get_emulation_vector
446(
447 task_t task,
448 int *vector_start,
449 emulation_vector_t *emulation_vector,
450 mach_msg_type_number_t *emulation_vectorCnt
451);
452
453/* Routine task_set_emulation_vector */
454#ifdef mig_external
455mig_external
456#else
457extern
458#endif /* mig_external */
459kern_return_t task_set_emulation_vector
460(
461 task_t task,
462 int vector_start,
463 emulation_vector_t emulation_vector,
464 mach_msg_type_number_t emulation_vectorCnt
465);
466
467/* Routine task_set_ras_pc */
468#ifdef mig_external
469mig_external
470#else
471extern
472#endif /* mig_external */
473kern_return_t task_set_ras_pc
474(
475 task_t target_task,
476 vm_address_t basepc,
477 vm_address_t boundspc
478);
479
480/* Routine task_zone_info */
481#ifdef mig_external
482mig_external
483#else
484extern
485#endif /* mig_external */
486__WATCHOS_PROHIBITED
487__TVOS_PROHIBITED
488kern_return_t task_zone_info
489(
490 task_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
499mig_external
500#else
501extern
502#endif /* mig_external */
503kern_return_t task_assign
504(
505 task_t task,
506 processor_set_t new_set,
507 boolean_t assign_threads
508);
509
510/* Routine task_assign_default */
511#ifdef mig_external
512mig_external
513#else
514extern
515#endif /* mig_external */
516kern_return_t task_assign_default
517(
518 task_t task,
519 boolean_t assign_threads
520);
521
522/* Routine task_get_assignment */
523#ifdef mig_external
524mig_external
525#else
526extern
527#endif /* mig_external */
528kern_return_t task_get_assignment
529(
530 task_inspect_t task,
531 processor_set_name_t *assigned_set
532);
533
534/* Routine task_set_policy */
535#ifdef mig_external
536mig_external
537#else
538extern
539#endif /* mig_external */
540kern_return_t task_set_policy
541(
542 task_t task,
543 processor_set_t pset,
544 policy_t policy,
545 policy_base_t base,
546 mach_msg_type_number_t baseCnt,
547 policy_limit_t limit,
548 mach_msg_type_number_t limitCnt,
549 boolean_t change
550);
551
552/* Routine task_get_state */
553#ifdef mig_external
554mig_external
555#else
556extern
557#endif /* mig_external */
558__WATCHOS_PROHIBITED
559__TVOS_PROHIBITED
560kern_return_t task_get_state
561(
562 task_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
570mig_external
571#else
572extern
573#endif /* mig_external */
574__WATCHOS_PROHIBITED
575__TVOS_PROHIBITED
576kern_return_t task_set_state
577(
578 task_t task,
579 thread_state_flavor_t flavor,
580 thread_state_t new_state,
581 mach_msg_type_number_t new_stateCnt
582);
583
584/* Routine task_set_phys_footprint_limit */
585#ifdef mig_external
586mig_external
587#else
588extern
589#endif /* mig_external */
590__WATCHOS_PROHIBITED
591__TVOS_PROHIBITED
592kern_return_t task_set_phys_footprint_limit
593(
594 task_t task,
595 int new_limit,
596 int *old_limit
597);
598
599/* Routine task_suspend2 */
600#ifdef mig_external
601mig_external
602#else
603extern
604#endif /* mig_external */
605__WATCHOS_PROHIBITED
606__TVOS_PROHIBITED
607kern_return_t task_suspend2
608(
609 task_t target_task,
610 task_suspension_token_t *suspend_token
611);
612
613/* Routine task_resume2 */
614#ifdef mig_external
615mig_external
616#else
617extern
618#endif /* mig_external */
619__WATCHOS_PROHIBITED
620__TVOS_PROHIBITED
621kern_return_t task_resume2
622(
623 task_suspension_token_t suspend_token
624);
625
626/* Routine task_purgable_info */
627#ifdef mig_external
628mig_external
629#else
630extern
631#endif /* mig_external */
632kern_return_t task_purgable_info
633(
634 task_inspect_t task,
635 task_purgable_info_t *stats
636);
637
638/* Routine task_get_mach_voucher */
639#ifdef mig_external
640mig_external
641#else
642extern
643#endif /* mig_external */
644__WATCHOS_PROHIBITED
645__TVOS_PROHIBITED
646kern_return_t task_get_mach_voucher
647(
648 task_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
655mig_external
656#else
657extern
658#endif /* mig_external */
659__WATCHOS_PROHIBITED
660__TVOS_PROHIBITED
661kern_return_t task_set_mach_voucher
662(
663 task_t task,
664 ipc_voucher_t voucher
665);
666
667/* Routine task_swap_mach_voucher */
668#ifdef mig_external
669mig_external
670#else
671extern
672#endif /* mig_external */
673__WATCHOS_PROHIBITED
674__TVOS_PROHIBITED
675kern_return_t task_swap_mach_voucher
676(
677 task_t task,
678 ipc_voucher_t new_voucher,
679 ipc_voucher_t *old_voucher
680);
681
682/* Routine task_generate_corpse */
683#ifdef mig_external
684mig_external
685#else
686extern
687#endif /* mig_external */
688kern_return_t task_generate_corpse
689(
690 task_t task,
691 mach_port_t *corpse_task_port
692);
693
694/* Routine task_map_corpse_info */
695#ifdef mig_external
696mig_external
697#else
698extern
699#endif /* mig_external */
700kern_return_t task_map_corpse_info
701(
702 task_t task,
703 task_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
710mig_external
711#else
712extern
713#endif /* mig_external */
714kern_return_t task_register_dyld_image_infos
715(
716 task_t task,
717 dyld_kernel_image_info_array_t dyld_images,
718 mach_msg_type_number_t dyld_imagesCnt
719);
720
721/* Routine task_unregister_dyld_image_infos */
722#ifdef mig_external
723mig_external
724#else
725extern
726#endif /* mig_external */
727kern_return_t task_unregister_dyld_image_infos
728(
729 task_t task,
730 dyld_kernel_image_info_array_t dyld_images,
731 mach_msg_type_number_t dyld_imagesCnt
732);
733
734/* Routine task_get_dyld_image_infos */
735#ifdef mig_external
736mig_external
737#else
738extern
739#endif /* mig_external */
740kern_return_t task_get_dyld_image_infos
741(
742 task_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
749mig_external
750#else
751extern
752#endif /* mig_external */
753kern_return_t task_register_dyld_shared_cache_image_info
754(
755 task_t task,
756 dyld_kernel_image_info_t dyld_cache_image,
757 boolean_t no_cache,
758 boolean_t private_cache
759);
760
761/* Routine task_register_dyld_set_dyld_state */
762#ifdef mig_external
763mig_external
764#else
765extern
766#endif /* mig_external */
767kern_return_t task_register_dyld_set_dyld_state
768(
769 task_t task,
770 uint8_t dyld_state
771);
772
773/* Routine task_register_dyld_get_process_state */
774#ifdef mig_external
775mig_external
776#else
777extern
778#endif /* mig_external */
779kern_return_t task_register_dyld_get_process_state
780(
781 task_t task,
782 dyld_kernel_process_info_t *dyld_process_state
783);
784
785/* Routine task_map_corpse_info_64 */
786#ifdef mig_external
787mig_external
788#else
789extern
790#endif /* mig_external */
791kern_return_t task_map_corpse_info_64
792(
793 task_t task,
794 task_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
801mig_external
802#else
803extern
804#endif /* mig_external */
805kern_return_t task_inspect
806(
807 task_inspect_t task,
808 task_inspect_flavor_t flavor,
809 task_inspect_info_t info_out,
810 mach_msg_type_number_t *info_outCnt
811);
812
813/* Routine task_get_exc_guard_behavior */
814#ifdef mig_external
815mig_external
816#else
817extern
818#endif /* mig_external */
819kern_return_t task_get_exc_guard_behavior
820(
821 task_inspect_t task,
822 task_exc_guard_behavior_t *behavior
823);
824
825/* Routine task_set_exc_guard_behavior */
826#ifdef mig_external
827mig_external
828#else
829extern
830#endif /* mig_external */
831kern_return_t task_set_exc_guard_behavior
832(
833 task_t task,
834 task_exc_guard_behavior_t behavior
835);
836
837/* Routine task_create_suid_cred */
838#ifdef mig_external
839mig_external
840#else
841extern
842#endif /* mig_external */
843kern_return_t task_create_suid_cred
844(
845 task_t task,
846 suid_cred_path_t path,
847 suid_cred_uid_t uid,
848 suid_cred_t *delegation
849);
850
851__END_DECLS
852
853/********************** Caution **************************/
854/* The following data types should be used to calculate */
855/* maximum message sizes only. The actual message may be */
856/* smaller, and the position of the arguments within the */
857/* message layout may vary from what is presented here. */
858/* For example, if any of the arguments are variable- */
859/* sized, and less than the maximum is sent, the data */
860/* will be packed tight in the actual message to reduce */
861/* the presence of holes. */
862/********************** Caution **************************/
863
864/* typedefs for all requests */
865
866#ifndef __Request__task_subsystem__defined
867#define __Request__task_subsystem__defined
868
869#ifdef __MigPackStructs
870#pragma pack(push, 4)
871#endif
872 typedef struct {
873 mach_msg_header_t Head;
874 /* start of the kernel processed data */
875 mach_msg_body_t msgh_body;
876 mach_msg_ool_ports_descriptor_t ledgers;
877 /* end of the kernel processed data */
878 NDR_record_t NDR;
879 mach_msg_type_number_t ledgersCnt;
880 boolean_t inherit_memory;
881 } __Request__task_create_t __attribute__((unused));
882#ifdef __MigPackStructs
883#pragma pack(pop)
884#endif
885
886#ifdef __MigPackStructs
887#pragma pack(push, 4)
888#endif
889 typedef struct {
890 mach_msg_header_t Head;
891 } __Request__task_terminate_t __attribute__((unused));
892#ifdef __MigPackStructs
893#pragma pack(pop)
894#endif
895
896#ifdef __MigPackStructs
897#pragma pack(push, 4)
898#endif
899 typedef struct {
900 mach_msg_header_t Head;
901 } __Request__task_threads_t __attribute__((unused));
902#ifdef __MigPackStructs
903#pragma pack(pop)
904#endif
905
906#ifdef __MigPackStructs
907#pragma pack(push, 4)
908#endif
909 typedef struct {
910 mach_msg_header_t Head;
911 /* start of the kernel processed data */
912 mach_msg_body_t msgh_body;
913 mach_msg_ool_ports_descriptor_t init_port_set;
914 /* end of the kernel processed data */
915 NDR_record_t NDR;
916 mach_msg_type_number_t init_port_setCnt;
917 } __Request__mach_ports_register_t __attribute__((unused));
918#ifdef __MigPackStructs
919#pragma pack(pop)
920#endif
921
922#ifdef __MigPackStructs
923#pragma pack(push, 4)
924#endif
925 typedef struct {
926 mach_msg_header_t Head;
927 } __Request__mach_ports_lookup_t __attribute__((unused));
928#ifdef __MigPackStructs
929#pragma pack(pop)
930#endif
931
932#ifdef __MigPackStructs
933#pragma pack(push, 4)
934#endif
935 typedef struct {
936 mach_msg_header_t Head;
937 NDR_record_t NDR;
938 task_flavor_t flavor;
939 mach_msg_type_number_t task_info_outCnt;
940 } __Request__task_info_t __attribute__((unused));
941#ifdef __MigPackStructs
942#pragma pack(pop)
943#endif
944
945#ifdef __MigPackStructs
946#pragma pack(push, 4)
947#endif
948 typedef struct {
949 mach_msg_header_t Head;
950 NDR_record_t NDR;
951 task_flavor_t flavor;
952 mach_msg_type_number_t task_info_inCnt;
953 integer_t task_info_in[87];
954 } __Request__task_set_info_t __attribute__((unused));
955#ifdef __MigPackStructs
956#pragma pack(pop)
957#endif
958
959#ifdef __MigPackStructs
960#pragma pack(push, 4)
961#endif
962 typedef struct {
963 mach_msg_header_t Head;
964 } __Request__task_suspend_t __attribute__((unused));
965#ifdef __MigPackStructs
966#pragma pack(pop)
967#endif
968
969#ifdef __MigPackStructs
970#pragma pack(push, 4)
971#endif
972 typedef struct {
973 mach_msg_header_t Head;
974 } __Request__task_resume_t __attribute__((unused));
975#ifdef __MigPackStructs
976#pragma pack(pop)
977#endif
978
979#ifdef __MigPackStructs
980#pragma pack(push, 4)
981#endif
982 typedef struct {
983 mach_msg_header_t Head;
984 NDR_record_t NDR;
985 int which_port;
986 } __Request__task_get_special_port_t __attribute__((unused));
987#ifdef __MigPackStructs
988#pragma pack(pop)
989#endif
990
991#ifdef __MigPackStructs
992#pragma pack(push, 4)
993#endif
994 typedef struct {
995 mach_msg_header_t Head;
996 /* start of the kernel processed data */
997 mach_msg_body_t msgh_body;
998 mach_msg_port_descriptor_t special_port;
999 /* end of the kernel processed data */
1000 NDR_record_t NDR;
1001 int which_port;
1002 } __Request__task_set_special_port_t __attribute__((unused));
1003#ifdef __MigPackStructs
1004#pragma pack(pop)
1005#endif
1006
1007#ifdef __MigPackStructs
1008#pragma pack(push, 4)
1009#endif
1010 typedef struct {
1011 mach_msg_header_t Head;
1012 } __Request__thread_create_t __attribute__((unused));
1013#ifdef __MigPackStructs
1014#pragma pack(pop)
1015#endif
1016
1017#ifdef __MigPackStructs
1018#pragma pack(push, 4)
1019#endif
1020 typedef struct {
1021 mach_msg_header_t Head;
1022 NDR_record_t NDR;
1023 thread_state_flavor_t flavor;
1024 mach_msg_type_number_t new_stateCnt;
1025 natural_t new_state[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
1595union __RequestUnion__task_subsystem {
1596 __Request__task_create_t Request_task_create;
1597 __Request__task_terminate_t Request_task_terminate;
1598 __Request__task_threads_t Request_task_threads;
1599 __Request__mach_ports_register_t Request_mach_ports_register;
1600 __Request__mach_ports_lookup_t Request_mach_ports_lookup;
1601 __Request__task_info_t Request_task_info;
1602 __Request__task_set_info_t Request_task_set_info;
1603 __Request__task_suspend_t Request_task_suspend;
1604 __Request__task_resume_t Request_task_resume;
1605 __Request__task_get_special_port_t Request_task_get_special_port;
1606 __Request__task_set_special_port_t Request_task_set_special_port;
1607 __Request__thread_create_t Request_thread_create;
1608 __Request__thread_create_running_t Request_thread_create_running;
1609 __Request__task_set_exception_ports_t Request_task_set_exception_ports;
1610 __Request__task_get_exception_ports_t Request_task_get_exception_ports;
1611 __Request__task_swap_exception_ports_t Request_task_swap_exception_ports;
1612 __Request__lock_set_create_t Request_lock_set_create;
1613 __Request__lock_set_destroy_t Request_lock_set_destroy;
1614 __Request__semaphore_create_t Request_semaphore_create;
1615 __Request__semaphore_destroy_t Request_semaphore_destroy;
1616 __Request__task_policy_set_t Request_task_policy_set;
1617 __Request__task_policy_get_t Request_task_policy_get;
1618 __Request__task_sample_t Request_task_sample;
1619 __Request__task_policy_t Request_task_policy;
1620 __Request__task_set_emulation_t Request_task_set_emulation;
1621 __Request__task_get_emulation_vector_t Request_task_get_emulation_vector;
1622 __Request__task_set_emulation_vector_t Request_task_set_emulation_vector;
1623 __Request__task_set_ras_pc_t Request_task_set_ras_pc;
1624 __Request__task_zone_info_t Request_task_zone_info;
1625 __Request__task_assign_t Request_task_assign;
1626 __Request__task_assign_default_t Request_task_assign_default;
1627 __Request__task_get_assignment_t Request_task_get_assignment;
1628 __Request__task_set_policy_t Request_task_set_policy;
1629 __Request__task_get_state_t Request_task_get_state;
1630 __Request__task_set_state_t Request_task_set_state;
1631 __Request__task_set_phys_footprint_limit_t Request_task_set_phys_footprint_limit;
1632 __Request__task_suspend2_t Request_task_suspend2;
1633 __Request__task_resume2_t Request_task_resume2;
1634 __Request__task_purgable_info_t Request_task_purgable_info;
1635 __Request__task_get_mach_voucher_t Request_task_get_mach_voucher;
1636 __Request__task_set_mach_voucher_t Request_task_set_mach_voucher;
1637 __Request__task_swap_mach_voucher_t Request_task_swap_mach_voucher;
1638 __Request__task_generate_corpse_t Request_task_generate_corpse;
1639 __Request__task_map_corpse_info_t Request_task_map_corpse_info;
1640 __Request__task_register_dyld_image_infos_t Request_task_register_dyld_image_infos;
1641 __Request__task_unregister_dyld_image_infos_t Request_task_unregister_dyld_image_infos;
1642 __Request__task_get_dyld_image_infos_t Request_task_get_dyld_image_infos;
1643 __Request__task_register_dyld_shared_cache_image_info_t Request_task_register_dyld_shared_cache_image_info;
1644 __Request__task_register_dyld_set_dyld_state_t Request_task_register_dyld_set_dyld_state;
1645 __Request__task_register_dyld_get_process_state_t Request_task_register_dyld_get_process_state;
1646 __Request__task_map_corpse_info_64_t Request_task_map_corpse_info_64;
1647 __Request__task_inspect_t Request_task_inspect;
1648 __Request__task_get_exc_guard_behavior_t Request_task_get_exc_guard_behavior;
1649 __Request__task_set_exc_guard_behavior_t Request_task_set_exc_guard_behavior;
1650 __Request__task_create_suid_cred_t Request_task_create_suid_cred;
1651};
1652#endif /* !__RequestUnion__task_subsystem__defined */
1653/* typedefs for all replies */
1654
1655#ifndef __Reply__task_subsystem__defined
1656#define __Reply__task_subsystem__defined
1657
1658#ifdef __MigPackStructs
1659#pragma pack(push, 4)
1660#endif
1661 typedef struct {
1662 mach_msg_header_t Head;
1663 /* start of the kernel processed data */
1664 mach_msg_body_t msgh_body;
1665 mach_msg_port_descriptor_t child_task;
1666 /* end of the kernel processed data */
1667 } __Reply__task_create_t __attribute__((unused));
1668#ifdef __MigPackStructs
1669#pragma pack(pop)
1670#endif
1671
1672#ifdef __MigPackStructs
1673#pragma pack(push, 4)
1674#endif
1675 typedef struct {
1676 mach_msg_header_t Head;
1677 NDR_record_t NDR;
1678 kern_return_t RetCode;
1679 } __Reply__task_terminate_t __attribute__((unused));
1680#ifdef __MigPackStructs
1681#pragma pack(pop)
1682#endif
1683
1684#ifdef __MigPackStructs
1685#pragma pack(push, 4)
1686#endif
1687 typedef struct {
1688 mach_msg_header_t Head;
1689 /* start of the kernel processed data */
1690 mach_msg_body_t msgh_body;
1691 mach_msg_ool_ports_descriptor_t act_list;
1692 /* end of the kernel processed data */
1693 NDR_record_t NDR;
1694 mach_msg_type_number_t act_listCnt;
1695 } __Reply__task_threads_t __attribute__((unused));
1696#ifdef __MigPackStructs
1697#pragma pack(pop)
1698#endif
1699
1700#ifdef __MigPackStructs
1701#pragma pack(push, 4)
1702#endif
1703 typedef struct {
1704 mach_msg_header_t Head;
1705 NDR_record_t NDR;
1706 kern_return_t RetCode;
1707 } __Reply__mach_ports_register_t __attribute__((unused));
1708#ifdef __MigPackStructs
1709#pragma pack(pop)
1710#endif
1711
1712#ifdef __MigPackStructs
1713#pragma pack(push, 4)
1714#endif
1715 typedef struct {
1716 mach_msg_header_t Head;
1717 /* start of the kernel processed data */
1718 mach_msg_body_t msgh_body;
1719 mach_msg_ool_ports_descriptor_t init_port_set;
1720 /* end of the kernel processed data */
1721 NDR_record_t NDR;
1722 mach_msg_type_number_t init_port_setCnt;
1723 } __Reply__mach_ports_lookup_t __attribute__((unused));
1724#ifdef __MigPackStructs
1725#pragma pack(pop)
1726#endif
1727
1728#ifdef __MigPackStructs
1729#pragma pack(push, 4)
1730#endif
1731 typedef struct {
1732 mach_msg_header_t Head;
1733 NDR_record_t NDR;
1734 kern_return_t RetCode;
1735 mach_msg_type_number_t task_info_outCnt;
1736 integer_t task_info_out[87];
1737 } __Reply__task_info_t __attribute__((unused));
1738#ifdef __MigPackStructs
1739#pragma pack(pop)
1740#endif
1741
1742#ifdef __MigPackStructs
1743#pragma pack(push, 4)
1744#endif
1745 typedef struct {
1746 mach_msg_header_t Head;
1747 NDR_record_t NDR;
1748 kern_return_t RetCode;
1749 } __Reply__task_set_info_t __attribute__((unused));
1750#ifdef __MigPackStructs
1751#pragma pack(pop)
1752#endif
1753
1754#ifdef __MigPackStructs
1755#pragma pack(push, 4)
1756#endif
1757 typedef struct {
1758 mach_msg_header_t Head;
1759 NDR_record_t NDR;
1760 kern_return_t RetCode;
1761 } __Reply__task_suspend_t __attribute__((unused));
1762#ifdef __MigPackStructs
1763#pragma pack(pop)
1764#endif
1765
1766#ifdef __MigPackStructs
1767#pragma pack(push, 4)
1768#endif
1769 typedef struct {
1770 mach_msg_header_t Head;
1771 NDR_record_t NDR;
1772 kern_return_t RetCode;
1773 } __Reply__task_resume_t __attribute__((unused));
1774#ifdef __MigPackStructs
1775#pragma pack(pop)
1776#endif
1777
1778#ifdef __MigPackStructs
1779#pragma pack(push, 4)
1780#endif
1781 typedef struct {
1782 mach_msg_header_t Head;
1783 /* start of the kernel processed data */
1784 mach_msg_body_t msgh_body;
1785 mach_msg_port_descriptor_t special_port;
1786 /* end of the kernel processed data */
1787 } __Reply__task_get_special_port_t __attribute__((unused));
1788#ifdef __MigPackStructs
1789#pragma pack(pop)
1790#endif
1791
1792#ifdef __MigPackStructs
1793#pragma pack(push, 4)
1794#endif
1795 typedef struct {
1796 mach_msg_header_t Head;
1797 NDR_record_t NDR;
1798 kern_return_t RetCode;
1799 } __Reply__task_set_special_port_t __attribute__((unused));
1800#ifdef __MigPackStructs
1801#pragma pack(pop)
1802#endif
1803
1804#ifdef __MigPackStructs
1805#pragma pack(push, 4)
1806#endif
1807 typedef struct {
1808 mach_msg_header_t Head;
1809 /* start of the kernel processed data */
1810 mach_msg_body_t msgh_body;
1811 mach_msg_port_descriptor_t child_act;
1812 /* end of the kernel processed data */
1813 } __Reply__thread_create_t __attribute__((unused));
1814#ifdef __MigPackStructs
1815#pragma pack(pop)
1816#endif
1817
1818#ifdef __MigPackStructs
1819#pragma pack(push, 4)
1820#endif
1821 typedef struct {
1822 mach_msg_header_t Head;
1823 /* start of the kernel processed data */
1824 mach_msg_body_t msgh_body;
1825 mach_msg_port_descriptor_t child_act;
1826 /* end of the kernel processed data */
1827 } __Reply__thread_create_running_t __attribute__((unused));
1828#ifdef __MigPackStructs
1829#pragma pack(pop)
1830#endif
1831
1832#ifdef __MigPackStructs
1833#pragma pack(push, 4)
1834#endif
1835 typedef struct {
1836 mach_msg_header_t Head;
1837 NDR_record_t NDR;
1838 kern_return_t RetCode;
1839 } __Reply__task_set_exception_ports_t __attribute__((unused));
1840#ifdef __MigPackStructs
1841#pragma pack(pop)
1842#endif
1843
1844#ifdef __MigPackStructs
1845#pragma pack(push, 4)
1846#endif
1847 typedef struct {
1848 mach_msg_header_t Head;
1849 /* start of the kernel processed data */
1850 mach_msg_body_t msgh_body;
1851 mach_msg_port_descriptor_t old_handlers[32];
1852 /* end of the kernel processed data */
1853 NDR_record_t NDR;
1854 mach_msg_type_number_t masksCnt;
1855 exception_mask_t masks[32];
1856 exception_behavior_t old_behaviors[32];
1857 thread_state_flavor_t old_flavors[32];
1858 } __Reply__task_get_exception_ports_t __attribute__((unused));
1859#ifdef __MigPackStructs
1860#pragma pack(pop)
1861#endif
1862
1863#ifdef __MigPackStructs
1864#pragma pack(push, 4)
1865#endif
1866 typedef struct {
1867 mach_msg_header_t Head;
1868 /* start of the kernel processed data */
1869 mach_msg_body_t msgh_body;
1870 mach_msg_port_descriptor_t old_handlerss[32];
1871 /* end of the kernel processed data */
1872 NDR_record_t NDR;
1873 mach_msg_type_number_t masksCnt;
1874 exception_mask_t masks[32];
1875 exception_behavior_t old_behaviors[32];
1876 thread_state_flavor_t old_flavors[32];
1877 } __Reply__task_swap_exception_ports_t __attribute__((unused));
1878#ifdef __MigPackStructs
1879#pragma pack(pop)
1880#endif
1881
1882#ifdef __MigPackStructs
1883#pragma pack(push, 4)
1884#endif
1885 typedef struct {
1886 mach_msg_header_t Head;
1887 /* start of the kernel processed data */
1888 mach_msg_body_t msgh_body;
1889 mach_msg_port_descriptor_t new_lock_set;
1890 /* end of the kernel processed data */
1891 } __Reply__lock_set_create_t __attribute__((unused));
1892#ifdef __MigPackStructs
1893#pragma pack(pop)
1894#endif
1895
1896#ifdef __MigPackStructs
1897#pragma pack(push, 4)
1898#endif
1899 typedef struct {
1900 mach_msg_header_t Head;
1901 NDR_record_t NDR;
1902 kern_return_t RetCode;
1903 } __Reply__lock_set_destroy_t __attribute__((unused));
1904#ifdef __MigPackStructs
1905#pragma pack(pop)
1906#endif
1907
1908#ifdef __MigPackStructs
1909#pragma pack(push, 4)
1910#endif
1911 typedef struct {
1912 mach_msg_header_t Head;
1913 /* start of the kernel processed data */
1914 mach_msg_body_t msgh_body;
1915 mach_msg_port_descriptor_t semaphore;
1916 /* end of the kernel processed data */
1917 } __Reply__semaphore_create_t __attribute__((unused));
1918#ifdef __MigPackStructs
1919#pragma pack(pop)
1920#endif
1921
1922#ifdef __MigPackStructs
1923#pragma pack(push, 4)
1924#endif
1925 typedef struct {
1926 mach_msg_header_t Head;
1927 NDR_record_t NDR;
1928 kern_return_t RetCode;
1929 } __Reply__semaphore_destroy_t __attribute__((unused));
1930#ifdef __MigPackStructs
1931#pragma pack(pop)
1932#endif
1933
1934#ifdef __MigPackStructs
1935#pragma pack(push, 4)
1936#endif
1937 typedef struct {
1938 mach_msg_header_t Head;
1939 NDR_record_t NDR;
1940 kern_return_t RetCode;
1941 } __Reply__task_policy_set_t __attribute__((unused));
1942#ifdef __MigPackStructs
1943#pragma pack(pop)
1944#endif
1945
1946#ifdef __MigPackStructs
1947#pragma pack(push, 4)
1948#endif
1949 typedef struct {
1950 mach_msg_header_t Head;
1951 NDR_record_t NDR;
1952 kern_return_t RetCode;
1953 mach_msg_type_number_t policy_infoCnt;
1954 integer_t policy_info[16];
1955 boolean_t get_default;
1956 } __Reply__task_policy_get_t __attribute__((unused));
1957#ifdef __MigPackStructs
1958#pragma pack(pop)
1959#endif
1960
1961#ifdef __MigPackStructs
1962#pragma pack(push, 4)
1963#endif
1964 typedef struct {
1965 mach_msg_header_t Head;
1966 NDR_record_t NDR;
1967 kern_return_t RetCode;
1968 } __Reply__task_sample_t __attribute__((unused));
1969#ifdef __MigPackStructs
1970#pragma pack(pop)
1971#endif
1972
1973#ifdef __MigPackStructs
1974#pragma pack(push, 4)
1975#endif
1976 typedef struct {
1977 mach_msg_header_t Head;
1978 NDR_record_t NDR;
1979 kern_return_t RetCode;
1980 } __Reply__task_policy_t __attribute__((unused));
1981#ifdef __MigPackStructs
1982#pragma pack(pop)
1983#endif
1984
1985#ifdef __MigPackStructs
1986#pragma pack(push, 4)
1987#endif
1988 typedef struct {
1989 mach_msg_header_t Head;
1990 NDR_record_t NDR;
1991 kern_return_t RetCode;
1992 } __Reply__task_set_emulation_t __attribute__((unused));
1993#ifdef __MigPackStructs
1994#pragma pack(pop)
1995#endif
1996
1997#ifdef __MigPackStructs
1998#pragma pack(push, 4)
1999#endif
2000 typedef struct {
2001 mach_msg_header_t Head;
2002 /* start of the kernel processed data */
2003 mach_msg_body_t msgh_body;
2004 mach_msg_ool_descriptor_t emulation_vector;
2005 /* end of the kernel processed data */
2006 NDR_record_t NDR;
2007 int vector_start;
2008 mach_msg_type_number_t emulation_vectorCnt;
2009 } __Reply__task_get_emulation_vector_t __attribute__((unused));
2010#ifdef __MigPackStructs
2011#pragma pack(pop)
2012#endif
2013
2014#ifdef __MigPackStructs
2015#pragma pack(push, 4)
2016#endif
2017 typedef struct {
2018 mach_msg_header_t Head;
2019 NDR_record_t NDR;
2020 kern_return_t RetCode;
2021 } __Reply__task_set_emulation_vector_t __attribute__((unused));
2022#ifdef __MigPackStructs
2023#pragma pack(pop)
2024#endif
2025
2026#ifdef __MigPackStructs
2027#pragma pack(push, 4)
2028#endif
2029 typedef struct {
2030 mach_msg_header_t Head;
2031 NDR_record_t NDR;
2032 kern_return_t RetCode;
2033 } __Reply__task_set_ras_pc_t __attribute__((unused));
2034#ifdef __MigPackStructs
2035#pragma pack(pop)
2036#endif
2037
2038#ifdef __MigPackStructs
2039#pragma pack(push, 4)
2040#endif
2041 typedef struct {
2042 mach_msg_header_t Head;
2043 /* start of the kernel processed data */
2044 mach_msg_body_t msgh_body;
2045 mach_msg_ool_descriptor_t names;
2046 mach_msg_ool_descriptor_t info;
2047 /* end of the kernel processed data */
2048 NDR_record_t NDR;
2049 mach_msg_type_number_t namesCnt;
2050 mach_msg_type_number_t infoCnt;
2051 } __Reply__task_zone_info_t __attribute__((unused));
2052#ifdef __MigPackStructs
2053#pragma pack(pop)
2054#endif
2055
2056#ifdef __MigPackStructs
2057#pragma pack(push, 4)
2058#endif
2059 typedef struct {
2060 mach_msg_header_t Head;
2061 NDR_record_t NDR;
2062 kern_return_t RetCode;
2063 } __Reply__task_assign_t __attribute__((unused));
2064#ifdef __MigPackStructs
2065#pragma pack(pop)
2066#endif
2067
2068#ifdef __MigPackStructs
2069#pragma pack(push, 4)
2070#endif
2071 typedef struct {
2072 mach_msg_header_t Head;
2073 NDR_record_t NDR;
2074 kern_return_t RetCode;
2075 } __Reply__task_assign_default_t __attribute__((unused));
2076#ifdef __MigPackStructs
2077#pragma pack(pop)
2078#endif
2079
2080#ifdef __MigPackStructs
2081#pragma pack(push, 4)
2082#endif
2083 typedef struct {
2084 mach_msg_header_t Head;
2085 /* start of the kernel processed data */
2086 mach_msg_body_t msgh_body;
2087 mach_msg_port_descriptor_t assigned_set;
2088 /* end of the kernel processed data */
2089 } __Reply__task_get_assignment_t __attribute__((unused));
2090#ifdef __MigPackStructs
2091#pragma pack(pop)
2092#endif
2093
2094#ifdef __MigPackStructs
2095#pragma pack(push, 4)
2096#endif
2097 typedef struct {
2098 mach_msg_header_t Head;
2099 NDR_record_t NDR;
2100 kern_return_t RetCode;
2101 } __Reply__task_set_policy_t __attribute__((unused));
2102#ifdef __MigPackStructs
2103#pragma pack(pop)
2104#endif
2105
2106#ifdef __MigPackStructs
2107#pragma pack(push, 4)
2108#endif
2109 typedef struct {
2110 mach_msg_header_t Head;
2111 NDR_record_t NDR;
2112 kern_return_t RetCode;
2113 mach_msg_type_number_t old_stateCnt;
2114 natural_t old_state[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
2401union __ReplyUnion__task_subsystem {
2402 __Reply__task_create_t Reply_task_create;
2403 __Reply__task_terminate_t Reply_task_terminate;
2404 __Reply__task_threads_t Reply_task_threads;
2405 __Reply__mach_ports_register_t Reply_mach_ports_register;
2406 __Reply__mach_ports_lookup_t Reply_mach_ports_lookup;
2407 __Reply__task_info_t Reply_task_info;
2408 __Reply__task_set_info_t Reply_task_set_info;
2409 __Reply__task_suspend_t Reply_task_suspend;
2410 __Reply__task_resume_t Reply_task_resume;
2411 __Reply__task_get_special_port_t Reply_task_get_special_port;
2412 __Reply__task_set_special_port_t Reply_task_set_special_port;
2413 __Reply__thread_create_t Reply_thread_create;
2414 __Reply__thread_create_running_t Reply_thread_create_running;
2415 __Reply__task_set_exception_ports_t Reply_task_set_exception_ports;
2416 __Reply__task_get_exception_ports_t Reply_task_get_exception_ports;
2417 __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports;
2418 __Reply__lock_set_create_t Reply_lock_set_create;
2419 __Reply__lock_set_destroy_t Reply_lock_set_destroy;
2420 __Reply__semaphore_create_t Reply_semaphore_create;
2421 __Reply__semaphore_destroy_t Reply_semaphore_destroy;
2422 __Reply__task_policy_set_t Reply_task_policy_set;
2423 __Reply__task_policy_get_t Reply_task_policy_get;
2424 __Reply__task_sample_t Reply_task_sample;
2425 __Reply__task_policy_t Reply_task_policy;
2426 __Reply__task_set_emulation_t Reply_task_set_emulation;
2427 __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector;
2428 __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector;
2429 __Reply__task_set_ras_pc_t Reply_task_set_ras_pc;
2430 __Reply__task_zone_info_t Reply_task_zone_info;
2431 __Reply__task_assign_t Reply_task_assign;
2432 __Reply__task_assign_default_t Reply_task_assign_default;
2433 __Reply__task_get_assignment_t Reply_task_get_assignment;
2434 __Reply__task_set_policy_t Reply_task_set_policy;
2435 __Reply__task_get_state_t Reply_task_get_state;
2436 __Reply__task_set_state_t Reply_task_set_state;
2437 __Reply__task_set_phys_footprint_limit_t Reply_task_set_phys_footprint_limit;
2438 __Reply__task_suspend2_t Reply_task_suspend2;
2439 __Reply__task_resume2_t Reply_task_resume2;
2440 __Reply__task_purgable_info_t Reply_task_purgable_info;
2441 __Reply__task_get_mach_voucher_t Reply_task_get_mach_voucher;
2442 __Reply__task_set_mach_voucher_t Reply_task_set_mach_voucher;
2443 __Reply__task_swap_mach_voucher_t Reply_task_swap_mach_voucher;
2444 __Reply__task_generate_corpse_t Reply_task_generate_corpse;
2445 __Reply__task_map_corpse_info_t Reply_task_map_corpse_info;
2446 __Reply__task_register_dyld_image_infos_t Reply_task_register_dyld_image_infos;
2447 __Reply__task_unregister_dyld_image_infos_t Reply_task_unregister_dyld_image_infos;
2448 __Reply__task_get_dyld_image_infos_t Reply_task_get_dyld_image_infos;
2449 __Reply__task_register_dyld_shared_cache_image_info_t Reply_task_register_dyld_shared_cache_image_info;
2450 __Reply__task_register_dyld_set_dyld_state_t Reply_task_register_dyld_set_dyld_state;
2451 __Reply__task_register_dyld_get_process_state_t Reply_task_register_dyld_get_process_state;
2452 __Reply__task_map_corpse_info_64_t Reply_task_map_corpse_info_64;
2453 __Reply__task_inspect_t Reply_task_inspect;
2454 __Reply__task_get_exc_guard_behavior_t Reply_task_get_exc_guard_behavior;
2455 __Reply__task_set_exc_guard_behavior_t Reply_task_set_exc_guard_behavior;
2456 __Reply__task_create_suid_cred_t Reply_task_create_suid_cred;
2457};
2458#endif /* !__RequestUnion__task_subsystem__defined */
2459
2460#ifndef subsystem_to_name_map_task
2461#define subsystem_to_name_map_task \
2462 { "task_create", 3400 },\
2463 { "task_terminate", 3401 },\
2464 { "task_threads", 3402 },\
2465 { "mach_ports_register", 3403 },\
2466 { "mach_ports_lookup", 3404 },\
2467 { "task_info", 3405 },\
2468 { "task_set_info", 3406 },\
2469 { "task_suspend", 3407 },\
2470 { "task_resume", 3408 },\
2471 { "task_get_special_port", 3409 },\
2472 { "task_set_special_port", 3410 },\
2473 { "thread_create", 3411 },\
2474 { "thread_create_running", 3412 },\
2475 { "task_set_exception_ports", 3413 },\
2476 { "task_get_exception_ports", 3414 },\
2477 { "task_swap_exception_ports", 3415 },\
2478 { "lock_set_create", 3416 },\
2479 { "lock_set_destroy", 3417 },\
2480 { "semaphore_create", 3418 },\
2481 { "semaphore_destroy", 3419 },\
2482 { "task_policy_set", 3420 },\
2483 { "task_policy_get", 3421 },\
2484 { "task_sample", 3422 },\
2485 { "task_policy", 3423 },\
2486 { "task_set_emulation", 3424 },\
2487 { "task_get_emulation_vector", 3425 },\
2488 { "task_set_emulation_vector", 3426 },\
2489 { "task_set_ras_pc", 3427 },\
2490 { "task_zone_info", 3428 },\
2491 { "task_assign", 3429 },\
2492 { "task_assign_default", 3430 },\
2493 { "task_get_assignment", 3431 },\
2494 { "task_set_policy", 3432 },\
2495 { "task_get_state", 3433 },\
2496 { "task_set_state", 3434 },\
2497 { "task_set_phys_footprint_limit", 3435 },\
2498 { "task_suspend2", 3436 },\
2499 { "task_resume2", 3437 },\
2500 { "task_purgable_info", 3438 },\
2501 { "task_get_mach_voucher", 3439 },\
2502 { "task_set_mach_voucher", 3440 },\
2503 { "task_swap_mach_voucher", 3441 },\
2504 { "task_generate_corpse", 3442 },\
2505 { "task_map_corpse_info", 3443 },\
2506 { "task_register_dyld_image_infos", 3444 },\
2507 { "task_unregister_dyld_image_infos", 3445 },\
2508 { "task_get_dyld_image_infos", 3446 },\
2509 { "task_register_dyld_shared_cache_image_info", 3447 },\
2510 { "task_register_dyld_set_dyld_state", 3448 },\
2511 { "task_register_dyld_get_process_state", 3449 },\
2512 { "task_map_corpse_info_64", 3450 },\
2513 { "task_inspect", 3451 },\
2514 { "task_get_exc_guard_behavior", 3452 },\
2515 { "task_set_exc_guard_behavior", 3453 },\
2516 { "task_create_suid_cred", 3454 }
2517#endif
2518
2519#ifdef __AfterMigUserHeader
2520__AfterMigUserHeader
2521#endif /* __AfterMigUserHeader */
2522
2523#endif /* _task_user_ */
lib/libc/include/aarch64-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 */
80typedef natural_t task_flavor_t;
81typedef integer_t *task_info_t; /* varying array of int */
82
83/* Deprecated, use per structure _data_t's instead */
84#define TASK_INFO_MAX (1024) /* maximum array size */
85typedef integer_t task_info_data_t[TASK_INFO_MAX];
86
87/*
88 * Currently defined information structures.
89 */
90
91#pragma pack(push, 4)
92
93/* Don't use this, use MACH_TASK_BASIC_INFO instead */
94#define TASK_BASIC_INFO_32 4 /* basic information */
95#define TASK_BASIC2_INFO_32 6
96
97struct task_basic_info_32 {
98 integer_t suspend_count; /* suspend count for task */
99 natural_t virtual_size; /* virtual memory size (bytes) */
100 natural_t resident_size; /* resident memory size (bytes) */
101 time_value_t user_time; /* total user run time for
102 * terminated threads */
103 time_value_t system_time; /* total system run time for
104 * terminated threads */
105 policy_t policy; /* default policy for new threads */
106};
107typedef struct task_basic_info_32 task_basic_info_32_data_t;
108typedef struct task_basic_info_32 *task_basic_info_32_t;
109#define TASK_BASIC_INFO_32_COUNT \
110 (sizeof(task_basic_info_32_data_t) / sizeof(natural_t))
111
112/* Don't use this, use MACH_TASK_BASIC_INFO instead */
113struct task_basic_info_64 {
114 integer_t suspend_count; /* suspend count for task */
115#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};
128typedef struct task_basic_info_64 task_basic_info_64_data_t;
129typedef 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 */
155struct 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
166typedef struct task_basic_info task_basic_info_data_t;
167typedef 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
180struct 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};
190typedef struct task_events_info task_events_info_data_t;
191typedef 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
198struct 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
205typedef struct task_thread_times_info task_thread_times_info_data_t;
206typedef 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
212struct 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
219typedef struct task_absolutetime_info task_absolutetime_info_data_t;
220typedef 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
226struct 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
233typedef struct task_kernelmemory_info task_kernelmemory_info_data_t;
234typedef 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
249struct task_affinity_tag_info {
250 integer_t set_count;
251 integer_t min;
252 integer_t max;
253 integer_t task_count;
254};
255typedef struct task_affinity_tag_info task_affinity_tag_info_data_t;
256typedef 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
262struct 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};
267typedef struct task_dyld_info task_dyld_info_data_t;
268typedef 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
280struct 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};
290typedef struct task_basic_info_64_2 task_basic_info_64_2_data_t;
291typedef 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
298struct task_extmod_info {
299 unsigned char task_uuid[16];
300 vm_extmod_statistics_data_t extmod_statistics;
301};
302typedef struct task_extmod_info task_extmod_info_data_t;
303typedef 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 */
309struct 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};
320typedef struct mach_task_basic_info mach_task_basic_info_data_t;
321typedef 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
328struct 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
337typedef struct task_power_info task_power_info_data_t;
338typedef 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
346struct 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};
404typedef struct task_vm_info task_vm_info_data_t;
405typedef 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
420typedef struct vm_purgeable_info task_purgable_info_t;
421
422
423#define TASK_TRACE_MEMORY_INFO 24 /* no longer supported */
424struct 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};
429typedef struct task_trace_memory_info task_trace_memory_info_data_t;
430typedef 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. */
435struct 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};
440typedef struct task_wait_state_info task_wait_state_info_data_t;
441typedef 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
447typedef 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
454typedef gpu_energy_data *gpu_energy_data_t;
455struct 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
465typedef struct task_power_info_v2 task_power_info_v2_data_t;
466typedef 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 */
476struct task_flags_info {
477 uint32_t flags; /* task flags */
478};
479typedef struct task_flags_info task_flags_info_data_t;
480typedef 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 */
494typedef 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/aarch64-macos-gnu/mach/task_inspect.h created+54
......@@ -0,0 +1,54 @@
1/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef MACH_TASK_INSPECT_H
30#define MACH_TASK_INSPECT_H
31
32/*
33 * XXX These interfaces are still in development -- they are subject to change
34 * without notice.
35 */
36
37typedef natural_t task_inspect_flavor_t;
38
39enum task_inspect_flavor {
40 TASK_INSPECT_BASIC_COUNTS = 1,
41};
42
43struct task_inspect_basic_counts {
44 uint64_t instructions;
45 uint64_t cycles;
46};
47#define TASK_INSPECT_BASIC_COUNTS_COUNT \
48 (sizeof(struct task_inspect_basic_counts) / sizeof(natural_t))
49typedef struct task_inspect_basic_counts task_inspect_basic_counts_data_t;
50typedef struct task_inspect_basic_counts *task_inspect_basic_counts_t;
51
52typedef integer_t *task_inspect_info_t;
53
54#endif /* !defined(MACH_TASK_INSPECT_H) */
lib/libc/include/aarch64-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
51typedef natural_t task_policy_flavor_t;
52typedef integer_t *task_policy_t;
53
54/*
55 * kern_return_t task_policy_set(
56 * task_t task,
57 * task_policy_flavor_t flavor,
58 * task_policy_t policy_info,
59 * mach_msg_type_number_t count);
60 *
61 * kern_return_t task_policy_get(
62 * task_t task,
63 * task_policy_flavor_t flavor,
64 * task_policy_t policy_info,
65 * mach_msg_type_number_t *count,
66 * boolean_t *get_default);
67 */
68
69/*
70 * Defined flavors.
71 */
72/*
73 * TASK_CATEGORY_POLICY:
74 *
75 * This provides information to the kernel about the role
76 * of the task in the system.
77 *
78 * Parameters:
79 *
80 * role: Enumerated as follows:
81 *
82 * TASK_UNSPECIFIED is the default, since the role is not
83 * inherited from the parent.
84 *
85 * TASK_FOREGROUND_APPLICATION should be assigned when the
86 * task is a normal UI application in the foreground from
87 * the HI point of view.
88 * **N.B. There may be more than one of these at a given time.
89 *
90 * TASK_BACKGROUND_APPLICATION should be assigned when the
91 * task is a normal UI application in the background from
92 * the HI point of view.
93 *
94 * TASK_CONTROL_APPLICATION should be assigned to the unique
95 * UI application which implements the pop-up application dialog.
96 * There can only be one task at a time with this designation,
97 * which is assigned FCFS.
98 *
99 * TASK_GRAPHICS_SERVER should be assigned to the graphics
100 * management (window) server. There can only be one task at
101 * a time with this designation, which is assigned FCFS.
102 */
103
104#define TASK_CATEGORY_POLICY 1
105
106#define TASK_SUPPRESSION_POLICY 3
107#define TASK_POLICY_STATE 4
108#define TASK_BASE_QOS_POLICY 8
109#define TASK_OVERRIDE_QOS_POLICY 9
110#define TASK_BASE_LATENCY_QOS_POLICY 10
111#define TASK_BASE_THROUGHPUT_QOS_POLICY 11
112
113typedef 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
126struct task_category_policy {
127 task_role_t role;
128};
129
130typedef struct task_category_policy task_category_policy_data_t;
131typedef 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
137enum 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};
146typedef integer_t task_latency_qos_t;
147enum 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
160typedef integer_t task_throughput_qos_t;
161
162struct task_qos_policy {
163 task_latency_qos_t task_latency_qos_tier;
164 task_throughput_qos_t task_throughput_qos_tier;
165};
166
167typedef 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/aarch64-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
70typedef 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/aarch64-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
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef thread_act_MSG_COUNT
52#define thread_act_MSG_COUNT 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
70mig_external
71#else
72extern
73#endif /* mig_external */
74__WATCHOS_PROHIBITED
75__TVOS_PROHIBITED
76kern_return_t thread_terminate
77(
78 thread_act_t target_act
79);
80
81/* Routine act_get_state */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87__WATCHOS_PROHIBITED
88__TVOS_PROHIBITED
89kern_return_t act_get_state
90(
91 thread_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
99mig_external
100#else
101extern
102#endif /* mig_external */
103__WATCHOS_PROHIBITED
104__TVOS_PROHIBITED
105kern_return_t act_set_state
106(
107 thread_act_t target_act,
108 int flavor,
109 thread_state_t new_state,
110 mach_msg_type_number_t new_stateCnt
111);
112
113/* Routine thread_get_state */
114#ifdef mig_external
115mig_external
116#else
117extern
118#endif /* mig_external */
119__WATCHOS_PROHIBITED
120kern_return_t thread_get_state
121(
122 thread_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
130mig_external
131#else
132extern
133#endif /* mig_external */
134__WATCHOS_PROHIBITED
135kern_return_t thread_set_state
136(
137 thread_act_t target_act,
138 thread_state_flavor_t flavor,
139 thread_state_t new_state,
140 mach_msg_type_number_t new_stateCnt
141);
142
143/* Routine thread_suspend */
144#ifdef mig_external
145mig_external
146#else
147extern
148#endif /* mig_external */
149__WATCHOS_PROHIBITED
150kern_return_t thread_suspend
151(
152 thread_act_t target_act
153);
154
155/* Routine thread_resume */
156#ifdef mig_external
157mig_external
158#else
159extern
160#endif /* mig_external */
161__WATCHOS_PROHIBITED
162kern_return_t thread_resume
163(
164 thread_act_t target_act
165);
166
167/* Routine thread_abort */
168#ifdef mig_external
169mig_external
170#else
171extern
172#endif /* mig_external */
173__WATCHOS_PROHIBITED
174kern_return_t thread_abort
175(
176 thread_act_t target_act
177);
178
179/* Routine thread_abort_safely */
180#ifdef mig_external
181mig_external
182#else
183extern
184#endif /* mig_external */
185__WATCHOS_PROHIBITED
186kern_return_t thread_abort_safely
187(
188 thread_act_t target_act
189);
190
191/* Routine thread_depress_abort */
192#ifdef mig_external
193mig_external
194#else
195extern
196#endif /* mig_external */
197__WATCHOS_PROHIBITED
198__TVOS_PROHIBITED
199kern_return_t thread_depress_abort
200(
201 thread_act_t thread
202);
203
204/* Routine thread_get_special_port */
205#ifdef mig_external
206mig_external
207#else
208extern
209#endif /* mig_external */
210__WATCHOS_PROHIBITED
211__TVOS_PROHIBITED
212kern_return_t thread_get_special_port
213(
214 thread_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
221mig_external
222#else
223extern
224#endif /* mig_external */
225__WATCHOS_PROHIBITED
226__TVOS_PROHIBITED
227kern_return_t thread_set_special_port
228(
229 thread_act_t thr_act,
230 int which_port,
231 mach_port_t special_port
232);
233
234/* Routine thread_info */
235#ifdef mig_external
236mig_external
237#else
238extern
239#endif /* mig_external */
240kern_return_t thread_info
241(
242 thread_inspect_t target_act,
243 thread_flavor_t flavor,
244 thread_info_t thread_info_out,
245 mach_msg_type_number_t *thread_info_outCnt
246);
247
248/* Routine thread_set_exception_ports */
249#ifdef mig_external
250mig_external
251#else
252extern
253#endif /* mig_external */
254__WATCHOS_PROHIBITED
255__TVOS_PROHIBITED
256kern_return_t thread_set_exception_ports
257(
258 thread_act_t thread,
259 exception_mask_t exception_mask,
260 mach_port_t new_port,
261 exception_behavior_t behavior,
262 thread_state_flavor_t new_flavor
263);
264
265/* Routine thread_get_exception_ports */
266#ifdef mig_external
267mig_external
268#else
269extern
270#endif /* mig_external */
271__WATCHOS_PROHIBITED
272__TVOS_PROHIBITED
273kern_return_t thread_get_exception_ports
274(
275 thread_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
286mig_external
287#else
288extern
289#endif /* mig_external */
290__WATCHOS_PROHIBITED
291__TVOS_PROHIBITED
292kern_return_t thread_swap_exception_ports
293(
294 thread_act_t thread,
295 exception_mask_t exception_mask,
296 mach_port_t new_port,
297 exception_behavior_t behavior,
298 thread_state_flavor_t new_flavor,
299 exception_mask_array_t masks,
300 mach_msg_type_number_t *masksCnt,
301 exception_handler_array_t old_handlers,
302 exception_behavior_array_t old_behaviors,
303 exception_flavor_array_t old_flavors
304);
305
306/* Routine thread_policy */
307#ifdef mig_external
308mig_external
309#else
310extern
311#endif /* mig_external */
312kern_return_t thread_policy
313(
314 thread_act_t thr_act,
315 policy_t policy,
316 policy_base_t base,
317 mach_msg_type_number_t baseCnt,
318 boolean_t set_limit
319);
320
321/* Routine thread_policy_set */
322#ifdef mig_external
323mig_external
324#else
325extern
326#endif /* mig_external */
327kern_return_t thread_policy_set
328(
329 thread_act_t thread,
330 thread_policy_flavor_t flavor,
331 thread_policy_t policy_info,
332 mach_msg_type_number_t policy_infoCnt
333);
334
335/* Routine thread_policy_get */
336#ifdef mig_external
337mig_external
338#else
339extern
340#endif /* mig_external */
341kern_return_t thread_policy_get
342(
343 thread_inspect_t thread,
344 thread_policy_flavor_t flavor,
345 thread_policy_t policy_info,
346 mach_msg_type_number_t *policy_infoCnt,
347 boolean_t *get_default
348);
349
350/* Routine thread_sample */
351#ifdef mig_external
352mig_external
353#else
354extern
355#endif /* mig_external */
356kern_return_t thread_sample
357(
358 thread_act_t thread,
359 mach_port_t reply
360);
361
362/* Routine etap_trace_thread */
363#ifdef mig_external
364mig_external
365#else
366extern
367#endif /* mig_external */
368kern_return_t etap_trace_thread
369(
370 thread_act_t target_act,
371 boolean_t trace_status
372);
373
374/* Routine thread_assign */
375#ifdef mig_external
376mig_external
377#else
378extern
379#endif /* mig_external */
380kern_return_t thread_assign
381(
382 thread_act_t thread,
383 processor_set_t new_set
384);
385
386/* Routine thread_assign_default */
387#ifdef mig_external
388mig_external
389#else
390extern
391#endif /* mig_external */
392kern_return_t thread_assign_default
393(
394 thread_act_t thread
395);
396
397/* Routine thread_get_assignment */
398#ifdef mig_external
399mig_external
400#else
401extern
402#endif /* mig_external */
403kern_return_t thread_get_assignment
404(
405 thread_inspect_t thread,
406 processor_set_name_t *assigned_set
407);
408
409/* Routine thread_set_policy */
410#ifdef mig_external
411mig_external
412#else
413extern
414#endif /* mig_external */
415kern_return_t thread_set_policy
416(
417 thread_act_t thr_act,
418 processor_set_t pset,
419 policy_t policy,
420 policy_base_t base,
421 mach_msg_type_number_t baseCnt,
422 policy_limit_t limit,
423 mach_msg_type_number_t limitCnt
424);
425
426/* Routine thread_get_mach_voucher */
427#ifdef mig_external
428mig_external
429#else
430extern
431#endif /* mig_external */
432__WATCHOS_PROHIBITED
433__TVOS_PROHIBITED
434kern_return_t thread_get_mach_voucher
435(
436 thread_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
443mig_external
444#else
445extern
446#endif /* mig_external */
447__WATCHOS_PROHIBITED
448__TVOS_PROHIBITED
449kern_return_t thread_set_mach_voucher
450(
451 thread_act_t thr_act,
452 ipc_voucher_t voucher
453);
454
455/* Routine thread_swap_mach_voucher */
456#ifdef mig_external
457mig_external
458#else
459extern
460#endif /* mig_external */
461__WATCHOS_PROHIBITED
462__TVOS_PROHIBITED
463kern_return_t thread_swap_mach_voucher
464(
465 thread_act_t thr_act,
466 ipc_voucher_t new_voucher,
467 ipc_voucher_t *old_voucher
468);
469
470/* Routine thread_convert_thread_state */
471#ifdef mig_external
472mig_external
473#else
474extern
475#endif /* mig_external */
476kern_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
893union __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
1316union __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/aarch64-macos-gnu/mach/thread_info.h created+211
......@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2000-2005, 2015 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/thread_info
60 *
61 * Thread information structure and definitions.
62 *
63 * The defintions in this file are exported to the user. The kernel
64 * will translate its internal data structures to these structures
65 * as appropriate.
66 *
67 */
68
69#ifndef _MACH_THREAD_INFO_H_
70#define _MACH_THREAD_INFO_H_
71
72#include <mach/boolean.h>
73#include <mach/policy.h>
74#include <mach/time_value.h>
75#include <mach/message.h>
76#include <mach/machine/vm_types.h>
77
78/*
79 * Generic information structure to allow for expansion.
80 */
81typedef natural_t thread_flavor_t;
82typedef integer_t *thread_info_t; /* varying array of int */
83
84#define THREAD_INFO_MAX (32) /* maximum array size */
85typedef integer_t thread_info_data_t[THREAD_INFO_MAX];
86
87/*
88 * Currently defined information.
89 */
90#define THREAD_BASIC_INFO 3 /* basic information */
91
92struct thread_basic_info {
93 time_value_t user_time; /* user run time */
94 time_value_t system_time; /* system run time */
95 integer_t cpu_usage; /* scaled cpu usage percentage */
96 policy_t policy; /* scheduling policy in effect */
97 integer_t run_state; /* run state (see below) */
98 integer_t flags; /* various flags (see below) */
99 integer_t suspend_count; /* suspend count for thread */
100 integer_t sleep_time; /* number of seconds that thread
101 * has been sleeping */
102};
103
104typedef struct thread_basic_info thread_basic_info_data_t;
105typedef struct thread_basic_info *thread_basic_info_t;
106#define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
107 (sizeof(thread_basic_info_data_t) / sizeof(natural_t)))
108
109#define THREAD_IDENTIFIER_INFO 4 /* thread id and other information */
110
111struct thread_identifier_info {
112 uint64_t thread_id; /* system-wide unique 64-bit thread id */
113 uint64_t thread_handle; /* handle to be used by libproc */
114 uint64_t dispatch_qaddr; /* libdispatch queue address */
115};
116
117typedef struct thread_identifier_info thread_identifier_info_data_t;
118typedef struct thread_identifier_info *thread_identifier_info_t;
119#define THREAD_IDENTIFIER_INFO_COUNT ((mach_msg_type_number_t) \
120 (sizeof(thread_identifier_info_data_t) / sizeof(natural_t)))
121
122/*
123 * Scale factor for usage field.
124 */
125
126#define TH_USAGE_SCALE 1000
127
128/*
129 * Thread run states (state field).
130 */
131
132#define TH_STATE_RUNNING 1 /* thread is running normally */
133#define TH_STATE_STOPPED 2 /* thread is stopped */
134#define TH_STATE_WAITING 3 /* thread is waiting normally */
135#define TH_STATE_UNINTERRUPTIBLE 4 /* thread is in an uninterruptible
136 * wait */
137#define TH_STATE_HALTED 5 /* thread is halted at a
138 * clean point */
139
140/*
141 * Thread flags (flags field).
142 */
143#define TH_FLAGS_SWAPPED 0x1 /* thread is swapped out */
144#define TH_FLAGS_IDLE 0x2 /* thread is an idle thread */
145#define TH_FLAGS_GLOBAL_FORCED_IDLE 0x4 /* thread performs global forced idle */
146
147/*
148 * Thread extended info (returns same info as proc_pidinfo(...,PROC_PIDTHREADINFO,...)
149 */
150#define THREAD_EXTENDED_INFO 5
151#define MAXTHREADNAMESIZE 64
152struct thread_extended_info { // same as proc_threadinfo (from proc_info.h) & proc_threadinfo_internal (from bsd_taskinfo.h)
153 uint64_t pth_user_time; /* user run time */
154 uint64_t pth_system_time; /* system run time */
155 int32_t pth_cpu_usage; /* scaled cpu usage percentage */
156 int32_t pth_policy; /* scheduling policy in effect */
157 int32_t pth_run_state; /* run state (see below) */
158 int32_t pth_flags; /* various flags (see below) */
159 int32_t pth_sleep_time; /* number of seconds that thread */
160 int32_t pth_curpri; /* cur priority*/
161 int32_t pth_priority; /* priority*/
162 int32_t pth_maxpriority; /* max priority*/
163 char pth_name[MAXTHREADNAMESIZE]; /* thread name, if any */
164};
165typedef struct thread_extended_info thread_extended_info_data_t;
166typedef struct thread_extended_info * thread_extended_info_t;
167#define THREAD_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) \
168 (sizeof(thread_extended_info_data_t) / sizeof (natural_t)))
169
170#define THREAD_DEBUG_INFO_INTERNAL 6 /* for kernel development internal info */
171
172
173#define IO_NUM_PRIORITIES 4
174
175#define UPDATE_IO_STATS(info, size) \
176{ \
177 info.count++; \
178 info.size += size; \
179}
180
181#define UPDATE_IO_STATS_ATOMIC(info, io_size) \
182{ \
183 OSIncrementAtomic64((SInt64 *)&(info.count)); \
184 OSAddAtomic64(io_size, (SInt64 *)&(info.size)); \
185}
186
187struct io_stat_entry {
188 uint64_t count;
189 uint64_t size;
190};
191
192struct io_stat_info {
193 struct io_stat_entry disk_reads;
194 struct io_stat_entry io_priority[IO_NUM_PRIORITIES];
195 struct io_stat_entry paging;
196 struct io_stat_entry metadata;
197 struct io_stat_entry total_io;
198};
199
200typedef struct io_stat_info *io_stat_info_t;
201
202
203/*
204 * Obsolete interfaces.
205 */
206
207#define THREAD_SCHED_TIMESHARE_INFO 10
208#define THREAD_SCHED_RR_INFO 11
209#define THREAD_SCHED_FIFO_INFO 12
210
211#endif /* _MACH_THREAD_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach/thread_policy.h created+266
......@@ -0,0 +1,266 @@
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _MACH_THREAD_POLICY_H_
30#define _MACH_THREAD_POLICY_H_
31
32#include <mach/mach_types.h>
33
34/*
35 * These are the calls for accessing the policy parameters
36 * of a particular thread.
37 *
38 * The extra 'get_default' parameter to the second call is
39 * IN/OUT as follows:
40 * 1) if asserted on the way in it indicates that the default
41 * values should be returned, not the ones currently set, in
42 * this case 'get_default' will always be asserted on return;
43 * 2) if unasserted on the way in, the current settings are
44 * desired and if still unasserted on return, then the info
45 * returned reflects the current settings, otherwise if
46 * 'get_default' returns asserted, it means that there are no
47 * current settings due to other parameters taking precedence,
48 * and the default ones are being returned instead.
49 */
50
51typedef natural_t thread_policy_flavor_t;
52typedef integer_t *thread_policy_t;
53
54/*
55 * kern_return_t thread_policy_set(
56 * thread_t thread,
57 * thread_policy_flavor_t flavor,
58 * thread_policy_t policy_info,
59 * mach_msg_type_number_t count);
60 *
61 * kern_return_t thread_policy_get(
62 * thread_t thread,
63 * thread_policy_flavor_t flavor,
64 * thread_policy_t policy_info,
65 * mach_msg_type_number_t *count,
66 * boolean_t *get_default);
67 */
68
69/*
70 * Defined flavors.
71 */
72/*
73 * THREAD_STANDARD_POLICY:
74 *
75 * This is the standard (fair) scheduling mode, assigned to new
76 * threads. The thread will be given processor time in a manner
77 * which apportions approximately equal share to long running
78 * computations.
79 *
80 * Parameters:
81 * [none]
82 */
83
84#define THREAD_STANDARD_POLICY 1
85
86struct thread_standard_policy {
87 natural_t no_data;
88};
89
90typedef struct thread_standard_policy thread_standard_policy_data_t;
91typedef struct thread_standard_policy *thread_standard_policy_t;
92
93#define THREAD_STANDARD_POLICY_COUNT 0
94
95/*
96 * THREAD_EXTENDED_POLICY:
97 *
98 * Extended form of THREAD_STANDARD_POLICY, which supplies a
99 * hint indicating whether this is a long running computation.
100 *
101 * Parameters:
102 *
103 * timeshare: TRUE (the default) results in identical scheduling
104 * behavior as THREAD_STANDARD_POLICY.
105 */
106
107#define THREAD_EXTENDED_POLICY 1
108
109struct thread_extended_policy {
110 boolean_t timeshare;
111};
112
113typedef struct thread_extended_policy thread_extended_policy_data_t;
114typedef struct thread_extended_policy *thread_extended_policy_t;
115
116#define THREAD_EXTENDED_POLICY_COUNT ((mach_msg_type_number_t) \
117 (sizeof (thread_extended_policy_data_t) / sizeof (integer_t)))
118
119/*
120 * THREAD_TIME_CONSTRAINT_POLICY:
121 *
122 * This scheduling mode is for threads which have real time
123 * constraints on their execution.
124 *
125 * Parameters:
126 *
127 * period: This is the nominal amount of time between separate
128 * processing arrivals, specified in absolute time units. A
129 * value of 0 indicates that there is no inherent periodicity in
130 * the computation.
131 *
132 * computation: This is the nominal amount of computation
133 * time needed during a separate processing arrival, specified
134 * in absolute time units.
135 *
136 * constraint: This is the maximum amount of real time that
137 * may elapse from the start of a separate processing arrival
138 * to the end of computation for logically correct functioning,
139 * specified in absolute time units. Must be (>= computation).
140 * Note that latency = (constraint - computation).
141 *
142 * preemptible: This indicates that the computation may be
143 * interrupted, subject to the constraint specified above.
144 */
145
146#define THREAD_TIME_CONSTRAINT_POLICY 2
147
148struct thread_time_constraint_policy {
149 uint32_t period;
150 uint32_t computation;
151 uint32_t constraint;
152 boolean_t preemptible;
153};
154
155typedef struct thread_time_constraint_policy \
156 thread_time_constraint_policy_data_t;
157typedef struct thread_time_constraint_policy \
158 *thread_time_constraint_policy_t;
159
160#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \
161 (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t)))
162
163/*
164 * THREAD_PRECEDENCE_POLICY:
165 *
166 * This may be used to indicate the relative value of the
167 * computation compared to the other threads in the task.
168 *
169 * Parameters:
170 *
171 * importance: The importance is specified as a signed value.
172 */
173
174#define THREAD_PRECEDENCE_POLICY 3
175
176struct thread_precedence_policy {
177 integer_t importance;
178};
179
180typedef struct thread_precedence_policy thread_precedence_policy_data_t;
181typedef struct thread_precedence_policy *thread_precedence_policy_t;
182
183#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \
184 (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t)))
185
186/*
187 * THREAD_AFFINITY_POLICY:
188 *
189 * This policy is experimental.
190 * This may be used to express affinity relationships
191 * between threads in the task. Threads with the same affinity tag will
192 * be scheduled to share an L2 cache if possible. That is, affinity tags
193 * are a hint to the scheduler for thread placement.
194 *
195 * The namespace of affinity tags is generally local to one task. However,
196 * a child task created after the assignment of affinity tags by its parent
197 * will share that namespace. In particular, a family of forked processes
198 * may be created with a shared affinity namespace.
199 *
200 * Parameters:
201 * tag: The affinity set identifier.
202 */
203
204#define THREAD_AFFINITY_POLICY 4
205
206struct thread_affinity_policy {
207 integer_t affinity_tag;
208};
209
210#define THREAD_AFFINITY_TAG_NULL 0
211
212typedef struct thread_affinity_policy thread_affinity_policy_data_t;
213typedef struct thread_affinity_policy *thread_affinity_policy_t;
214
215#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \
216 (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t)))
217
218/*
219 * THREAD_BACKGROUND_POLICY:
220 */
221
222#define THREAD_BACKGROUND_POLICY 5
223
224struct thread_background_policy {
225 integer_t priority;
226};
227
228#define THREAD_BACKGROUND_POLICY_DARWIN_BG 0x1000
229
230typedef struct thread_background_policy thread_background_policy_data_t;
231typedef struct thread_background_policy *thread_background_policy_t;
232
233#define THREAD_BACKGROUND_POLICY_COUNT ((mach_msg_type_number_t) \
234 (sizeof (thread_background_policy_data_t) / sizeof (integer_t)))
235
236
237#define THREAD_LATENCY_QOS_POLICY 7
238typedef integer_t thread_latency_qos_t;
239
240struct thread_latency_qos_policy {
241 thread_latency_qos_t thread_latency_qos_tier;
242};
243
244typedef struct thread_latency_qos_policy thread_latency_qos_policy_data_t;
245typedef struct thread_latency_qos_policy *thread_latency_qos_policy_t;
246
247#define THREAD_LATENCY_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
248 (sizeof (thread_latency_qos_policy_data_t) / sizeof (integer_t)))
249
250#define THREAD_THROUGHPUT_QOS_POLICY 8
251typedef integer_t thread_throughput_qos_t;
252
253struct thread_throughput_qos_policy {
254 thread_throughput_qos_t thread_throughput_qos_tier;
255};
256
257typedef struct thread_throughput_qos_policy thread_throughput_qos_policy_data_t;
258typedef struct thread_throughput_qos_policy *thread_throughput_qos_policy_t;
259
260#define THREAD_THROUGHPUT_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
261 (sizeof (thread_throughput_qos_policy_data_t) / sizeof (integer_t)))
262
263
264
265
266#endif /* _MACH_THREAD_POLICY_H_ */
lib/libc/include/aarch64-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/aarch64-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
83typedef natural_t *thread_state_t; /* Variable-length array */
84
85/* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */
86typedef 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
94typedef int thread_state_flavor_t;
95typedef 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/aarch64-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/aarch64-macos-gnu/mach/time_value.h created+96
......@@ -0,0 +1,96 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56
57#ifndef _MACH_TIME_VALUE_H_
58#define _MACH_TIME_VALUE_H_
59
60#include <mach/machine/vm_types.h>
61
62/*
63 * Time value returned by kernel.
64 */
65
66struct time_value {
67 integer_t seconds;
68 integer_t microseconds;
69};
70
71typedef struct time_value time_value_t;
72
73/*
74 * Macros to manipulate time values. Assume that time values
75 * are normalized (microseconds <= 999999).
76 */
77#define TIME_MICROS_MAX (1000000)
78
79#define time_value_add_usec(val, micros) { \
80 if (((val)->microseconds += (micros)) \
81 >= TIME_MICROS_MAX) { \
82 (val)->microseconds -= TIME_MICROS_MAX; \
83 (val)->seconds++; \
84 } \
85}
86
87#define time_value_add(result, addend) { \
88 (result)->microseconds += (addend)->microseconds; \
89 (result)->seconds += (addend)->seconds; \
90 if ((result)->microseconds >= TIME_MICROS_MAX) { \
91 (result)->microseconds -= TIME_MICROS_MAX; \
92 (result)->seconds++; \
93 } \
94}
95
96#endif /* _MACH_TIME_VALUE_H_ */
lib/libc/include/aarch64-macos-gnu/mach/vm_attributes.h created+99
......@@ -0,0 +1,99 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/vm_attributes.h
60 * Author: Alessandro Forin
61 *
62 * Virtual memory attributes definitions.
63 *
64 * These definitions are in addition to the machine-independent
65 * ones (e.g. protection), and are only selectively supported
66 * on specific machine architectures.
67 *
68 */
69
70#ifndef _MACH_VM_ATTRIBUTES_H_
71#define _MACH_VM_ATTRIBUTES_H_
72
73/*
74 * Types of machine-dependent attributes
75 */
76typedef unsigned int vm_machine_attribute_t;
77
78#define MATTR_CACHE 1 /* cachability */
79#define MATTR_MIGRATE 2 /* migrability */
80#define MATTR_REPLICATE 4 /* replicability */
81
82/*
83 * Values for the above, e.g. operations on attribute
84 */
85typedef int vm_machine_attribute_val_t;
86
87#define MATTR_VAL_OFF 0 /* (generic) turn attribute off */
88#define MATTR_VAL_ON 1 /* (generic) turn attribute on */
89#define MATTR_VAL_GET 2 /* (generic) return current value */
90
91#define MATTR_VAL_CACHE_FLUSH 6 /* flush from all caches */
92#define MATTR_VAL_DCACHE_FLUSH 7 /* flush from data caches */
93#define MATTR_VAL_ICACHE_FLUSH 8 /* flush from instruction caches */
94#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */
95#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */
96
97#define MATTR_VAL_GET_INFO 10 /* get page info (stats) */
98
99#endif /* _MACH_VM_ATTRIBUTES_H_ */
lib/libc/include/aarch64-macos-gnu/mach/vm_behavior.h created+79
......@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * File: mach/vm_behavior.h
33 *
34 * Virtual memory map behavior definitions.
35 *
36 */
37
38#ifndef _MACH_VM_BEHAVIOR_H_
39#define _MACH_VM_BEHAVIOR_H_
40
41/*
42 * Types defined:
43 *
44 * vm_behavior_t behavior codes.
45 */
46
47typedef int vm_behavior_t;
48
49/*
50 * Enumeration of valid values for vm_behavior_t.
51 * These describe expected page reference behavior for
52 * for a given range of virtual memory. For implementation
53 * details see vm/vm_fault.c
54 */
55
56
57/*
58 * The following behaviors affect the memory region's future behavior
59 * and are stored in the VM map entry data structure.
60 */
61#define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0) /* default */
62#define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1) /* random */
63#define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2) /* forward sequential */
64#define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3) /* reverse sequential */
65
66/*
67 * The following "behaviors" affect the memory region only at the time of the
68 * call and are not stored in the VM map entry.
69 */
70#define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4) /* will need in near future */
71#define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5) /* dont need in near future */
72#define VM_BEHAVIOR_FREE ((vm_behavior_t) 6) /* free memory without write-back */
73#define VM_BEHAVIOR_ZERO_WIRED_PAGES ((vm_behavior_t) 7) /* zero out the wired pages of an entry if it is being deleted without unwiring them first */
74#define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8)
75#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
76#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
77#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11)
78
79#endif /*_MACH_VM_BEHAVIOR_H_*/
lib/libc/include/aarch64-macos-gnu/mach/vm_inherit.h created+89
......@@ -0,0 +1,89 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach/vm_inherit.h
60 * Author: Avadis Tevanian, Jr., Michael Wayne Young
61 *
62 * Virtual memory map inheritance definitions.
63 *
64 */
65
66#ifndef _MACH_VM_INHERIT_H_
67#define _MACH_VM_INHERIT_H_
68
69/*
70 * Types defined:
71 *
72 * vm_inherit_t inheritance codes.
73 */
74
75typedef unsigned int vm_inherit_t; /* might want to change this */
76
77/*
78 * Enumeration of valid values for vm_inherit_t.
79 */
80
81#define VM_INHERIT_SHARE ((vm_inherit_t) 0) /* share with child */
82#define VM_INHERIT_COPY ((vm_inherit_t) 1) /* copy into child */
83#define VM_INHERIT_NONE ((vm_inherit_t) 2) /* absent from child */
84#define VM_INHERIT_DONATE_COPY ((vm_inherit_t) 3) /* copy and delete */
85
86#define VM_INHERIT_DEFAULT VM_INHERIT_COPY
87#define VM_INHERIT_LAST_VALID VM_INHERIT_NONE
88
89#endif /* _MACH_VM_INHERIT_H_ */
lib/libc/include/aarch64-macos-gnu/mach/vm_map.h created+1440
......@@ -0,0 +1,1440 @@
1#ifndef _vm_map_user_
2#define _vm_map_user_
3
4/* Module vm_map */
5
6#include <string.h>
7#include <mach/ndr.h>
8#include <mach/boolean.h>
9#include <mach/kern_return.h>
10#include <mach/notify.h>
11#include <mach/mach_types.h>
12#include <mach/message.h>
13#include <mach/mig_errors.h>
14#include <mach/port.h>
15
16/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
17
18#if defined(__has_include)
19#if __has_include(<mach/mig_strncpy_zerofill_support.h>)
20#ifndef USING_MIG_STRNCPY_ZEROFILL
21#define USING_MIG_STRNCPY_ZEROFILL
22#endif
23#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
24#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
25#ifdef __cplusplus
26extern "C" {
27#endif
28 extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
29#ifdef __cplusplus
30}
31#endif
32#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
33#endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
34#endif /* __has_include */
35
36/* END MIG_STRNCPY_ZEROFILL CODE */
37
38
39#ifdef AUTOTEST
40#ifndef FUNCTION_PTR_T
41#define FUNCTION_PTR_T
42typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
43typedef struct {
44 char *name;
45 function_ptr_t function;
46} function_table_entry;
47typedef function_table_entry *function_table_t;
48#endif /* FUNCTION_PTR_T */
49#endif /* AUTOTEST */
50
51#ifndef vm_map_MSG_COUNT
52#define vm_map_MSG_COUNT 32
53#endif /* vm_map_MSG_COUNT */
54
55#include <mach/std_types.h>
56#include <mach/mig.h>
57#include <mach/mig.h>
58#include <mach/mach_types.h>
59#include <mach_debug/mach_debug_types.h>
60
61#ifdef __BeforeMigUserHeader
62__BeforeMigUserHeader
63#endif /* __BeforeMigUserHeader */
64
65#include <sys/cdefs.h>
66__BEGIN_DECLS
67
68
69/* Routine vm_region */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t vm_region
76(
77 vm_map_t target_task,
78 vm_address_t *address,
79 vm_size_t *size,
80 vm_region_flavor_t flavor,
81 vm_region_info_t info,
82 mach_msg_type_number_t *infoCnt,
83 mach_port_t *object_name
84);
85
86/* Routine vm_allocate */
87#ifdef mig_external
88mig_external
89#else
90extern
91#endif /* mig_external */
92kern_return_t vm_allocate
93(
94 vm_map_t target_task,
95 vm_address_t *address,
96 vm_size_t size,
97 int flags
98);
99
100/* Routine vm_deallocate */
101#ifdef mig_external
102mig_external
103#else
104extern
105#endif /* mig_external */
106kern_return_t vm_deallocate
107(
108 vm_map_t target_task,
109 vm_address_t address,
110 vm_size_t size
111);
112
113/* Routine vm_protect */
114#ifdef mig_external
115mig_external
116#else
117extern
118#endif /* mig_external */
119kern_return_t vm_protect
120(
121 vm_map_t target_task,
122 vm_address_t address,
123 vm_size_t size,
124 boolean_t set_maximum,
125 vm_prot_t new_protection
126);
127
128/* Routine vm_inherit */
129#ifdef mig_external
130mig_external
131#else
132extern
133#endif /* mig_external */
134kern_return_t vm_inherit
135(
136 vm_map_t target_task,
137 vm_address_t address,
138 vm_size_t size,
139 vm_inherit_t new_inheritance
140);
141
142/* Routine vm_read */
143#ifdef mig_external
144mig_external
145#else
146extern
147#endif /* mig_external */
148kern_return_t vm_read
149(
150 vm_map_t target_task,
151 vm_address_t address,
152 vm_size_t size,
153 vm_offset_t *data,
154 mach_msg_type_number_t *dataCnt
155);
156
157/* Routine vm_read_list */
158#ifdef mig_external
159mig_external
160#else
161extern
162#endif /* mig_external */
163kern_return_t vm_read_list
164(
165 vm_map_t target_task,
166 vm_read_entry_t data_list,
167 natural_t count
168);
169
170/* Routine vm_write */
171#ifdef mig_external
172mig_external
173#else
174extern
175#endif /* mig_external */
176kern_return_t vm_write
177(
178 vm_map_t target_task,
179 vm_address_t address,
180 vm_offset_t data,
181 mach_msg_type_number_t dataCnt
182);
183
184/* Routine vm_copy */
185#ifdef mig_external
186mig_external
187#else
188extern
189#endif /* mig_external */
190kern_return_t vm_copy
191(
192 vm_map_t target_task,
193 vm_address_t source_address,
194 vm_size_t size,
195 vm_address_t dest_address
196);
197
198/* Routine vm_read_overwrite */
199#ifdef mig_external
200mig_external
201#else
202extern
203#endif /* mig_external */
204kern_return_t vm_read_overwrite
205(
206 vm_map_t target_task,
207 vm_address_t address,
208 vm_size_t size,
209 vm_address_t data,
210 vm_size_t *outsize
211);
212
213/* Routine vm_msync */
214#ifdef mig_external
215mig_external
216#else
217extern
218#endif /* mig_external */
219kern_return_t vm_msync
220(
221 vm_map_t target_task,
222 vm_address_t address,
223 vm_size_t size,
224 vm_sync_t sync_flags
225);
226
227/* Routine vm_behavior_set */
228#ifdef mig_external
229mig_external
230#else
231extern
232#endif /* mig_external */
233kern_return_t vm_behavior_set
234(
235 vm_map_t target_task,
236 vm_address_t address,
237 vm_size_t size,
238 vm_behavior_t new_behavior
239);
240
241/* Routine vm_map */
242#ifdef mig_external
243mig_external
244#else
245extern
246#endif /* mig_external */
247kern_return_t vm_map
248(
249 vm_map_t target_task,
250 vm_address_t *address,
251 vm_size_t size,
252 vm_address_t mask,
253 int flags,
254 mem_entry_name_port_t object,
255 vm_offset_t offset,
256 boolean_t copy,
257 vm_prot_t cur_protection,
258 vm_prot_t max_protection,
259 vm_inherit_t inheritance
260);
261
262/* Routine vm_machine_attribute */
263#ifdef mig_external
264mig_external
265#else
266extern
267#endif /* mig_external */
268kern_return_t vm_machine_attribute
269(
270 vm_map_t target_task,
271 vm_address_t address,
272 vm_size_t size,
273 vm_machine_attribute_t attribute,
274 vm_machine_attribute_val_t *value
275);
276
277/* Routine vm_remap */
278#ifdef mig_external
279mig_external
280#else
281extern
282#endif /* mig_external */
283kern_return_t vm_remap
284(
285 vm_map_t target_task,
286 vm_address_t *target_address,
287 vm_size_t size,
288 vm_address_t mask,
289 int flags,
290 vm_map_t src_task,
291 vm_address_t src_address,
292 boolean_t copy,
293 vm_prot_t *cur_protection,
294 vm_prot_t *max_protection,
295 vm_inherit_t inheritance
296);
297
298/* Routine task_wire */
299#ifdef mig_external
300mig_external
301#else
302extern
303#endif /* mig_external */
304__WATCHOS_PROHIBITED
305__TVOS_PROHIBITED
306kern_return_t task_wire
307(
308 vm_map_t target_task,
309 boolean_t must_wire
310);
311
312/* Routine mach_make_memory_entry */
313#ifdef mig_external
314mig_external
315#else
316extern
317#endif /* mig_external */
318kern_return_t mach_make_memory_entry
319(
320 vm_map_t target_task,
321 vm_size_t *size,
322 vm_offset_t offset,
323 vm_prot_t permission,
324 mem_entry_name_port_t *object_handle,
325 mem_entry_name_port_t parent_entry
326);
327
328/* Routine vm_map_page_query */
329#ifdef mig_external
330mig_external
331#else
332extern
333#endif /* mig_external */
334kern_return_t vm_map_page_query
335(
336 vm_map_t target_map,
337 vm_offset_t offset,
338 integer_t *disposition,
339 integer_t *ref_count
340);
341
342/* Routine mach_vm_region_info */
343#ifdef mig_external
344mig_external
345#else
346extern
347#endif /* mig_external */
348kern_return_t mach_vm_region_info
349(
350 vm_map_t task,
351 vm_address_t address,
352 vm_info_region_t *region,
353 vm_info_object_array_t *objects,
354 mach_msg_type_number_t *objectsCnt
355);
356
357/* Routine vm_mapped_pages_info */
358#ifdef mig_external
359mig_external
360#else
361extern
362#endif /* mig_external */
363kern_return_t vm_mapped_pages_info
364(
365 vm_map_t task,
366 page_address_array_t *pages,
367 mach_msg_type_number_t *pagesCnt
368);
369
370/* Routine vm_region_recurse */
371#ifdef mig_external
372mig_external
373#else
374extern
375#endif /* mig_external */
376kern_return_t vm_region_recurse
377(
378 vm_map_t target_task,
379 vm_address_t *address,
380 vm_size_t *size,
381 natural_t *nesting_depth,
382 vm_region_recurse_info_t info,
383 mach_msg_type_number_t *infoCnt
384);
385
386/* Routine vm_region_recurse_64 */
387#ifdef mig_external
388mig_external
389#else
390extern
391#endif /* mig_external */
392kern_return_t vm_region_recurse_64
393(
394 vm_map_t target_task,
395 vm_address_t *address,
396 vm_size_t *size,
397 natural_t *nesting_depth,
398 vm_region_recurse_info_t info,
399 mach_msg_type_number_t *infoCnt
400);
401
402/* Routine mach_vm_region_info_64 */
403#ifdef mig_external
404mig_external
405#else
406extern
407#endif /* mig_external */
408kern_return_t mach_vm_region_info_64
409(
410 vm_map_t task,
411 vm_address_t address,
412 vm_info_region_64_t *region,
413 vm_info_object_array_t *objects,
414 mach_msg_type_number_t *objectsCnt
415);
416
417/* Routine vm_region_64 */
418#ifdef mig_external
419mig_external
420#else
421extern
422#endif /* mig_external */
423kern_return_t vm_region_64
424(
425 vm_map_t target_task,
426 vm_address_t *address,
427 vm_size_t *size,
428 vm_region_flavor_t flavor,
429 vm_region_info_t info,
430 mach_msg_type_number_t *infoCnt,
431 mach_port_t *object_name
432);
433
434/* Routine mach_make_memory_entry_64 */
435#ifdef mig_external
436mig_external
437#else
438extern
439#endif /* mig_external */
440kern_return_t mach_make_memory_entry_64
441(
442 vm_map_t target_task,
443 memory_object_size_t *size,
444 memory_object_offset_t offset,
445 vm_prot_t permission,
446 mach_port_t *object_handle,
447 mem_entry_name_port_t parent_entry
448);
449
450/* Routine vm_map_64 */
451#ifdef mig_external
452mig_external
453#else
454extern
455#endif /* mig_external */
456kern_return_t vm_map_64
457(
458 vm_map_t target_task,
459 vm_address_t *address,
460 vm_size_t size,
461 vm_address_t mask,
462 int flags,
463 mem_entry_name_port_t object,
464 memory_object_offset_t offset,
465 boolean_t copy,
466 vm_prot_t cur_protection,
467 vm_prot_t max_protection,
468 vm_inherit_t inheritance
469);
470
471/* Routine vm_purgable_control */
472#ifdef mig_external
473mig_external
474#else
475extern
476#endif /* mig_external */
477kern_return_t vm_purgable_control
478(
479 vm_map_t target_task,
480 vm_address_t address,
481 vm_purgable_t control,
482 int *state
483);
484
485/* Routine vm_map_exec_lockdown */
486#ifdef mig_external
487mig_external
488#else
489extern
490#endif /* mig_external */
491kern_return_t vm_map_exec_lockdown
492(
493 vm_map_t target_task
494);
495
496__END_DECLS
497
498/********************** Caution **************************/
499/* The following data types should be used to calculate */
500/* maximum message sizes only. The actual message may be */
501/* smaller, and the position of the arguments within the */
502/* message layout may vary from what is presented here. */
503/* For example, if any of the arguments are variable- */
504/* sized, and less than the maximum is sent, the data */
505/* will be packed tight in the actual message to reduce */
506/* the presence of holes. */
507/********************** Caution **************************/
508
509/* typedefs for all requests */
510
511#ifndef __Request__vm_map_subsystem__defined
512#define __Request__vm_map_subsystem__defined
513
514#ifdef __MigPackStructs
515#pragma pack(push, 4)
516#endif
517 typedef struct {
518 mach_msg_header_t Head;
519 NDR_record_t NDR;
520 vm_address_t address;
521 vm_region_flavor_t flavor;
522 mach_msg_type_number_t infoCnt;
523 } __Request__vm_region_t __attribute__((unused));
524#ifdef __MigPackStructs
525#pragma pack(pop)
526#endif
527
528#ifdef __MigPackStructs
529#pragma pack(push, 4)
530#endif
531 typedef struct {
532 mach_msg_header_t Head;
533 NDR_record_t NDR;
534 vm_address_t address;
535 vm_size_t size;
536 int flags;
537 } __Request__vm_allocate_t __attribute__((unused));
538#ifdef __MigPackStructs
539#pragma pack(pop)
540#endif
541
542#ifdef __MigPackStructs
543#pragma pack(push, 4)
544#endif
545 typedef struct {
546 mach_msg_header_t Head;
547 NDR_record_t NDR;
548 vm_address_t address;
549 vm_size_t size;
550 } __Request__vm_deallocate_t __attribute__((unused));
551#ifdef __MigPackStructs
552#pragma pack(pop)
553#endif
554
555#ifdef __MigPackStructs
556#pragma pack(push, 4)
557#endif
558 typedef struct {
559 mach_msg_header_t Head;
560 NDR_record_t NDR;
561 vm_address_t address;
562 vm_size_t size;
563 boolean_t set_maximum;
564 vm_prot_t new_protection;
565 } __Request__vm_protect_t __attribute__((unused));
566#ifdef __MigPackStructs
567#pragma pack(pop)
568#endif
569
570#ifdef __MigPackStructs
571#pragma pack(push, 4)
572#endif
573 typedef struct {
574 mach_msg_header_t Head;
575 NDR_record_t NDR;
576 vm_address_t address;
577 vm_size_t size;
578 vm_inherit_t new_inheritance;
579 } __Request__vm_inherit_t __attribute__((unused));
580#ifdef __MigPackStructs
581#pragma pack(pop)
582#endif
583
584#ifdef __MigPackStructs
585#pragma pack(push, 4)
586#endif
587 typedef struct {
588 mach_msg_header_t Head;
589 NDR_record_t NDR;
590 vm_address_t address;
591 vm_size_t size;
592 } __Request__vm_read_t __attribute__((unused));
593#ifdef __MigPackStructs
594#pragma pack(pop)
595#endif
596
597#ifdef __MigPackStructs
598#pragma pack(push, 4)
599#endif
600 typedef struct {
601 mach_msg_header_t Head;
602 NDR_record_t NDR;
603 vm_read_entry_t data_list;
604 natural_t count;
605 } __Request__vm_read_list_t __attribute__((unused));
606#ifdef __MigPackStructs
607#pragma pack(pop)
608#endif
609
610#ifdef __MigPackStructs
611#pragma pack(push, 4)
612#endif
613 typedef struct {
614 mach_msg_header_t Head;
615 /* start of the kernel processed data */
616 mach_msg_body_t msgh_body;
617 mach_msg_ool_descriptor_t data;
618 /* end of the kernel processed data */
619 NDR_record_t NDR;
620 vm_address_t address;
621 mach_msg_type_number_t dataCnt;
622 } __Request__vm_write_t __attribute__((unused));
623#ifdef __MigPackStructs
624#pragma pack(pop)
625#endif
626
627#ifdef __MigPackStructs
628#pragma pack(push, 4)
629#endif
630 typedef struct {
631 mach_msg_header_t Head;
632 NDR_record_t NDR;
633 vm_address_t source_address;
634 vm_size_t size;
635 vm_address_t dest_address;
636 } __Request__vm_copy_t __attribute__((unused));
637#ifdef __MigPackStructs
638#pragma pack(pop)
639#endif
640
641#ifdef __MigPackStructs
642#pragma pack(push, 4)
643#endif
644 typedef struct {
645 mach_msg_header_t Head;
646 NDR_record_t NDR;
647 vm_address_t address;
648 vm_size_t size;
649 vm_address_t data;
650 } __Request__vm_read_overwrite_t __attribute__((unused));
651#ifdef __MigPackStructs
652#pragma pack(pop)
653#endif
654
655#ifdef __MigPackStructs
656#pragma pack(push, 4)
657#endif
658 typedef struct {
659 mach_msg_header_t Head;
660 NDR_record_t NDR;
661 vm_address_t address;
662 vm_size_t size;
663 vm_sync_t sync_flags;
664 } __Request__vm_msync_t __attribute__((unused));
665#ifdef __MigPackStructs
666#pragma pack(pop)
667#endif
668
669#ifdef __MigPackStructs
670#pragma pack(push, 4)
671#endif
672 typedef struct {
673 mach_msg_header_t Head;
674 NDR_record_t NDR;
675 vm_address_t address;
676 vm_size_t size;
677 vm_behavior_t new_behavior;
678 } __Request__vm_behavior_set_t __attribute__((unused));
679#ifdef __MigPackStructs
680#pragma pack(pop)
681#endif
682
683#ifdef __MigPackStructs
684#pragma pack(push, 4)
685#endif
686 typedef struct {
687 mach_msg_header_t Head;
688 /* start of the kernel processed data */
689 mach_msg_body_t msgh_body;
690 mach_msg_port_descriptor_t object;
691 /* end of the kernel processed data */
692 NDR_record_t NDR;
693 vm_address_t address;
694 vm_size_t size;
695 vm_address_t mask;
696 int flags;
697 vm_offset_t offset;
698 boolean_t copy;
699 vm_prot_t cur_protection;
700 vm_prot_t max_protection;
701 vm_inherit_t inheritance;
702 } __Request__vm_map_t __attribute__((unused));
703#ifdef __MigPackStructs
704#pragma pack(pop)
705#endif
706
707#ifdef __MigPackStructs
708#pragma pack(push, 4)
709#endif
710 typedef struct {
711 mach_msg_header_t Head;
712 NDR_record_t NDR;
713 vm_address_t address;
714 vm_size_t size;
715 vm_machine_attribute_t attribute;
716 vm_machine_attribute_val_t value;
717 } __Request__vm_machine_attribute_t __attribute__((unused));
718#ifdef __MigPackStructs
719#pragma pack(pop)
720#endif
721
722#ifdef __MigPackStructs
723#pragma pack(push, 4)
724#endif
725 typedef struct {
726 mach_msg_header_t Head;
727 /* start of the kernel processed data */
728 mach_msg_body_t msgh_body;
729 mach_msg_port_descriptor_t src_task;
730 /* end of the kernel processed data */
731 NDR_record_t NDR;
732 vm_address_t target_address;
733 vm_size_t size;
734 vm_address_t mask;
735 int flags;
736 vm_address_t src_address;
737 boolean_t copy;
738 vm_inherit_t inheritance;
739 } __Request__vm_remap_t __attribute__((unused));
740#ifdef __MigPackStructs
741#pragma pack(pop)
742#endif
743
744#ifdef __MigPackStructs
745#pragma pack(push, 4)
746#endif
747 typedef struct {
748 mach_msg_header_t Head;
749 NDR_record_t NDR;
750 boolean_t must_wire;
751 } __Request__task_wire_t __attribute__((unused));
752#ifdef __MigPackStructs
753#pragma pack(pop)
754#endif
755
756#ifdef __MigPackStructs
757#pragma pack(push, 4)
758#endif
759 typedef struct {
760 mach_msg_header_t Head;
761 /* start of the kernel processed data */
762 mach_msg_body_t msgh_body;
763 mach_msg_port_descriptor_t parent_entry;
764 /* end of the kernel processed data */
765 NDR_record_t NDR;
766 vm_size_t size;
767 vm_offset_t offset;
768 vm_prot_t permission;
769 } __Request__mach_make_memory_entry_t __attribute__((unused));
770#ifdef __MigPackStructs
771#pragma pack(pop)
772#endif
773
774#ifdef __MigPackStructs
775#pragma pack(push, 4)
776#endif
777 typedef struct {
778 mach_msg_header_t Head;
779 NDR_record_t NDR;
780 vm_offset_t offset;
781 } __Request__vm_map_page_query_t __attribute__((unused));
782#ifdef __MigPackStructs
783#pragma pack(pop)
784#endif
785
786#ifdef __MigPackStructs
787#pragma pack(push, 4)
788#endif
789 typedef struct {
790 mach_msg_header_t Head;
791 NDR_record_t NDR;
792 vm_address_t address;
793 } __Request__mach_vm_region_info_t __attribute__((unused));
794#ifdef __MigPackStructs
795#pragma pack(pop)
796#endif
797
798#ifdef __MigPackStructs
799#pragma pack(push, 4)
800#endif
801 typedef struct {
802 mach_msg_header_t Head;
803 } __Request__vm_mapped_pages_info_t __attribute__((unused));
804#ifdef __MigPackStructs
805#pragma pack(pop)
806#endif
807
808#ifdef __MigPackStructs
809#pragma pack(push, 4)
810#endif
811 typedef struct {
812 mach_msg_header_t Head;
813 NDR_record_t NDR;
814 vm_address_t address;
815 natural_t nesting_depth;
816 mach_msg_type_number_t infoCnt;
817 } __Request__vm_region_recurse_t __attribute__((unused));
818#ifdef __MigPackStructs
819#pragma pack(pop)
820#endif
821
822#ifdef __MigPackStructs
823#pragma pack(push, 4)
824#endif
825 typedef struct {
826 mach_msg_header_t Head;
827 NDR_record_t NDR;
828 vm_address_t address;
829 natural_t nesting_depth;
830 mach_msg_type_number_t infoCnt;
831 } __Request__vm_region_recurse_64_t __attribute__((unused));
832#ifdef __MigPackStructs
833#pragma pack(pop)
834#endif
835
836#ifdef __MigPackStructs
837#pragma pack(push, 4)
838#endif
839 typedef struct {
840 mach_msg_header_t Head;
841 NDR_record_t NDR;
842 vm_address_t address;
843 } __Request__mach_vm_region_info_64_t __attribute__((unused));
844#ifdef __MigPackStructs
845#pragma pack(pop)
846#endif
847
848#ifdef __MigPackStructs
849#pragma pack(push, 4)
850#endif
851 typedef struct {
852 mach_msg_header_t Head;
853 NDR_record_t NDR;
854 vm_address_t address;
855 vm_region_flavor_t flavor;
856 mach_msg_type_number_t infoCnt;
857 } __Request__vm_region_64_t __attribute__((unused));
858#ifdef __MigPackStructs
859#pragma pack(pop)
860#endif
861
862#ifdef __MigPackStructs
863#pragma pack(push, 4)
864#endif
865 typedef struct {
866 mach_msg_header_t Head;
867 /* start of the kernel processed data */
868 mach_msg_body_t msgh_body;
869 mach_msg_port_descriptor_t parent_entry;
870 /* end of the kernel processed data */
871 NDR_record_t NDR;
872 memory_object_size_t size;
873 memory_object_offset_t offset;
874 vm_prot_t permission;
875 } __Request__mach_make_memory_entry_64_t __attribute__((unused));
876#ifdef __MigPackStructs
877#pragma pack(pop)
878#endif
879
880#ifdef __MigPackStructs
881#pragma pack(push, 4)
882#endif
883 typedef struct {
884 mach_msg_header_t Head;
885 /* start of the kernel processed data */
886 mach_msg_body_t msgh_body;
887 mach_msg_port_descriptor_t object;
888 /* end of the kernel processed data */
889 NDR_record_t NDR;
890 vm_address_t address;
891 vm_size_t size;
892 vm_address_t mask;
893 int flags;
894 memory_object_offset_t offset;
895 boolean_t copy;
896 vm_prot_t cur_protection;
897 vm_prot_t max_protection;
898 vm_inherit_t inheritance;
899 } __Request__vm_map_64_t __attribute__((unused));
900#ifdef __MigPackStructs
901#pragma pack(pop)
902#endif
903
904#ifdef __MigPackStructs
905#pragma pack(push, 4)
906#endif
907 typedef struct {
908 mach_msg_header_t Head;
909 NDR_record_t NDR;
910 vm_address_t address;
911 vm_purgable_t control;
912 int state;
913 } __Request__vm_purgable_control_t __attribute__((unused));
914#ifdef __MigPackStructs
915#pragma pack(pop)
916#endif
917
918#ifdef __MigPackStructs
919#pragma pack(push, 4)
920#endif
921 typedef struct {
922 mach_msg_header_t Head;
923 } __Request__vm_map_exec_lockdown_t __attribute__((unused));
924#ifdef __MigPackStructs
925#pragma pack(pop)
926#endif
927#endif /* !__Request__vm_map_subsystem__defined */
928
929/* union of all requests */
930
931#ifndef __RequestUnion__vm_map_subsystem__defined
932#define __RequestUnion__vm_map_subsystem__defined
933union __RequestUnion__vm_map_subsystem {
934 __Request__vm_region_t Request_vm_region;
935 __Request__vm_allocate_t Request_vm_allocate;
936 __Request__vm_deallocate_t Request_vm_deallocate;
937 __Request__vm_protect_t Request_vm_protect;
938 __Request__vm_inherit_t Request_vm_inherit;
939 __Request__vm_read_t Request_vm_read;
940 __Request__vm_read_list_t Request_vm_read_list;
941 __Request__vm_write_t Request_vm_write;
942 __Request__vm_copy_t Request_vm_copy;
943 __Request__vm_read_overwrite_t Request_vm_read_overwrite;
944 __Request__vm_msync_t Request_vm_msync;
945 __Request__vm_behavior_set_t Request_vm_behavior_set;
946 __Request__vm_map_t Request_vm_map;
947 __Request__vm_machine_attribute_t Request_vm_machine_attribute;
948 __Request__vm_remap_t Request_vm_remap;
949 __Request__task_wire_t Request_task_wire;
950 __Request__mach_make_memory_entry_t Request_mach_make_memory_entry;
951 __Request__vm_map_page_query_t Request_vm_map_page_query;
952 __Request__mach_vm_region_info_t Request_mach_vm_region_info;
953 __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info;
954 __Request__vm_region_recurse_t Request_vm_region_recurse;
955 __Request__vm_region_recurse_64_t Request_vm_region_recurse_64;
956 __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64;
957 __Request__vm_region_64_t Request_vm_region_64;
958 __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64;
959 __Request__vm_map_64_t Request_vm_map_64;
960 __Request__vm_purgable_control_t Request_vm_purgable_control;
961 __Request__vm_map_exec_lockdown_t Request_vm_map_exec_lockdown;
962};
963#endif /* !__RequestUnion__vm_map_subsystem__defined */
964/* typedefs for all replies */
965
966#ifndef __Reply__vm_map_subsystem__defined
967#define __Reply__vm_map_subsystem__defined
968
969#ifdef __MigPackStructs
970#pragma pack(push, 4)
971#endif
972 typedef struct {
973 mach_msg_header_t Head;
974 /* start of the kernel processed data */
975 mach_msg_body_t msgh_body;
976 mach_msg_port_descriptor_t object_name;
977 /* end of the kernel processed data */
978 NDR_record_t NDR;
979 vm_address_t address;
980 vm_size_t size;
981 mach_msg_type_number_t infoCnt;
982 int info[10];
983 } __Reply__vm_region_t __attribute__((unused));
984#ifdef __MigPackStructs
985#pragma pack(pop)
986#endif
987
988#ifdef __MigPackStructs
989#pragma pack(push, 4)
990#endif
991 typedef struct {
992 mach_msg_header_t Head;
993 NDR_record_t NDR;
994 kern_return_t RetCode;
995 vm_address_t address;
996 } __Reply__vm_allocate_t __attribute__((unused));
997#ifdef __MigPackStructs
998#pragma pack(pop)
999#endif
1000
1001#ifdef __MigPackStructs
1002#pragma pack(push, 4)
1003#endif
1004 typedef struct {
1005 mach_msg_header_t Head;
1006 NDR_record_t NDR;
1007 kern_return_t RetCode;
1008 } __Reply__vm_deallocate_t __attribute__((unused));
1009#ifdef __MigPackStructs
1010#pragma pack(pop)
1011#endif
1012
1013#ifdef __MigPackStructs
1014#pragma pack(push, 4)
1015#endif
1016 typedef struct {
1017 mach_msg_header_t Head;
1018 NDR_record_t NDR;
1019 kern_return_t RetCode;
1020 } __Reply__vm_protect_t __attribute__((unused));
1021#ifdef __MigPackStructs
1022#pragma pack(pop)
1023#endif
1024
1025#ifdef __MigPackStructs
1026#pragma pack(push, 4)
1027#endif
1028 typedef struct {
1029 mach_msg_header_t Head;
1030 NDR_record_t NDR;
1031 kern_return_t RetCode;
1032 } __Reply__vm_inherit_t __attribute__((unused));
1033#ifdef __MigPackStructs
1034#pragma pack(pop)
1035#endif
1036
1037#ifdef __MigPackStructs
1038#pragma pack(push, 4)
1039#endif
1040 typedef struct {
1041 mach_msg_header_t Head;
1042 /* start of the kernel processed data */
1043 mach_msg_body_t msgh_body;
1044 mach_msg_ool_descriptor_t data;
1045 /* end of the kernel processed data */
1046 NDR_record_t NDR;
1047 mach_msg_type_number_t dataCnt;
1048 } __Reply__vm_read_t __attribute__((unused));
1049#ifdef __MigPackStructs
1050#pragma pack(pop)
1051#endif
1052
1053#ifdef __MigPackStructs
1054#pragma pack(push, 4)
1055#endif
1056 typedef struct {
1057 mach_msg_header_t Head;
1058 NDR_record_t NDR;
1059 kern_return_t RetCode;
1060 vm_read_entry_t data_list;
1061 } __Reply__vm_read_list_t __attribute__((unused));
1062#ifdef __MigPackStructs
1063#pragma pack(pop)
1064#endif
1065
1066#ifdef __MigPackStructs
1067#pragma pack(push, 4)
1068#endif
1069 typedef struct {
1070 mach_msg_header_t Head;
1071 NDR_record_t NDR;
1072 kern_return_t RetCode;
1073 } __Reply__vm_write_t __attribute__((unused));
1074#ifdef __MigPackStructs
1075#pragma pack(pop)
1076#endif
1077
1078#ifdef __MigPackStructs
1079#pragma pack(push, 4)
1080#endif
1081 typedef struct {
1082 mach_msg_header_t Head;
1083 NDR_record_t NDR;
1084 kern_return_t RetCode;
1085 } __Reply__vm_copy_t __attribute__((unused));
1086#ifdef __MigPackStructs
1087#pragma pack(pop)
1088#endif
1089
1090#ifdef __MigPackStructs
1091#pragma pack(push, 4)
1092#endif
1093 typedef struct {
1094 mach_msg_header_t Head;
1095 NDR_record_t NDR;
1096 kern_return_t RetCode;
1097 vm_size_t outsize;
1098 } __Reply__vm_read_overwrite_t __attribute__((unused));
1099#ifdef __MigPackStructs
1100#pragma pack(pop)
1101#endif
1102
1103#ifdef __MigPackStructs
1104#pragma pack(push, 4)
1105#endif
1106 typedef struct {
1107 mach_msg_header_t Head;
1108 NDR_record_t NDR;
1109 kern_return_t RetCode;
1110 } __Reply__vm_msync_t __attribute__((unused));
1111#ifdef __MigPackStructs
1112#pragma pack(pop)
1113#endif
1114
1115#ifdef __MigPackStructs
1116#pragma pack(push, 4)
1117#endif
1118 typedef struct {
1119 mach_msg_header_t Head;
1120 NDR_record_t NDR;
1121 kern_return_t RetCode;
1122 } __Reply__vm_behavior_set_t __attribute__((unused));
1123#ifdef __MigPackStructs
1124#pragma pack(pop)
1125#endif
1126
1127#ifdef __MigPackStructs
1128#pragma pack(push, 4)
1129#endif
1130 typedef struct {
1131 mach_msg_header_t Head;
1132 NDR_record_t NDR;
1133 kern_return_t RetCode;
1134 vm_address_t address;
1135 } __Reply__vm_map_t __attribute__((unused));
1136#ifdef __MigPackStructs
1137#pragma pack(pop)
1138#endif
1139
1140#ifdef __MigPackStructs
1141#pragma pack(push, 4)
1142#endif
1143 typedef struct {
1144 mach_msg_header_t Head;
1145 NDR_record_t NDR;
1146 kern_return_t RetCode;
1147 vm_machine_attribute_val_t value;
1148 } __Reply__vm_machine_attribute_t __attribute__((unused));
1149#ifdef __MigPackStructs
1150#pragma pack(pop)
1151#endif
1152
1153#ifdef __MigPackStructs
1154#pragma pack(push, 4)
1155#endif
1156 typedef struct {
1157 mach_msg_header_t Head;
1158 NDR_record_t NDR;
1159 kern_return_t RetCode;
1160 vm_address_t target_address;
1161 vm_prot_t cur_protection;
1162 vm_prot_t max_protection;
1163 } __Reply__vm_remap_t __attribute__((unused));
1164#ifdef __MigPackStructs
1165#pragma pack(pop)
1166#endif
1167
1168#ifdef __MigPackStructs
1169#pragma pack(push, 4)
1170#endif
1171 typedef struct {
1172 mach_msg_header_t Head;
1173 NDR_record_t NDR;
1174 kern_return_t RetCode;
1175 } __Reply__task_wire_t __attribute__((unused));
1176#ifdef __MigPackStructs
1177#pragma pack(pop)
1178#endif
1179
1180#ifdef __MigPackStructs
1181#pragma pack(push, 4)
1182#endif
1183 typedef struct {
1184 mach_msg_header_t Head;
1185 /* start of the kernel processed data */
1186 mach_msg_body_t msgh_body;
1187 mach_msg_port_descriptor_t object_handle;
1188 /* end of the kernel processed data */
1189 NDR_record_t NDR;
1190 vm_size_t size;
1191 } __Reply__mach_make_memory_entry_t __attribute__((unused));
1192#ifdef __MigPackStructs
1193#pragma pack(pop)
1194#endif
1195
1196#ifdef __MigPackStructs
1197#pragma pack(push, 4)
1198#endif
1199 typedef struct {
1200 mach_msg_header_t Head;
1201 NDR_record_t NDR;
1202 kern_return_t RetCode;
1203 integer_t disposition;
1204 integer_t ref_count;
1205 } __Reply__vm_map_page_query_t __attribute__((unused));
1206#ifdef __MigPackStructs
1207#pragma pack(pop)
1208#endif
1209
1210#ifdef __MigPackStructs
1211#pragma pack(push, 4)
1212#endif
1213 typedef struct {
1214 mach_msg_header_t Head;
1215 /* start of the kernel processed data */
1216 mach_msg_body_t msgh_body;
1217 mach_msg_ool_descriptor_t objects;
1218 /* end of the kernel processed data */
1219 NDR_record_t NDR;
1220 vm_info_region_t region;
1221 mach_msg_type_number_t objectsCnt;
1222 } __Reply__mach_vm_region_info_t __attribute__((unused));
1223#ifdef __MigPackStructs
1224#pragma pack(pop)
1225#endif
1226
1227#ifdef __MigPackStructs
1228#pragma pack(push, 4)
1229#endif
1230 typedef struct {
1231 mach_msg_header_t Head;
1232 /* start of the kernel processed data */
1233 mach_msg_body_t msgh_body;
1234 mach_msg_ool_descriptor_t pages;
1235 /* end of the kernel processed data */
1236 NDR_record_t NDR;
1237 mach_msg_type_number_t pagesCnt;
1238 } __Reply__vm_mapped_pages_info_t __attribute__((unused));
1239#ifdef __MigPackStructs
1240#pragma pack(pop)
1241#endif
1242
1243#ifdef __MigPackStructs
1244#pragma pack(push, 4)
1245#endif
1246 typedef struct {
1247 mach_msg_header_t Head;
1248 NDR_record_t NDR;
1249 kern_return_t RetCode;
1250 vm_address_t address;
1251 vm_size_t size;
1252 natural_t nesting_depth;
1253 mach_msg_type_number_t infoCnt;
1254 int info[19];
1255 } __Reply__vm_region_recurse_t __attribute__((unused));
1256#ifdef __MigPackStructs
1257#pragma pack(pop)
1258#endif
1259
1260#ifdef __MigPackStructs
1261#pragma pack(push, 4)
1262#endif
1263 typedef struct {
1264 mach_msg_header_t Head;
1265 NDR_record_t NDR;
1266 kern_return_t RetCode;
1267 vm_address_t address;
1268 vm_size_t size;
1269 natural_t nesting_depth;
1270 mach_msg_type_number_t infoCnt;
1271 int info[19];
1272 } __Reply__vm_region_recurse_64_t __attribute__((unused));
1273#ifdef __MigPackStructs
1274#pragma pack(pop)
1275#endif
1276
1277#ifdef __MigPackStructs
1278#pragma pack(push, 4)
1279#endif
1280 typedef struct {
1281 mach_msg_header_t Head;
1282 /* start of the kernel processed data */
1283 mach_msg_body_t msgh_body;
1284 mach_msg_ool_descriptor_t objects;
1285 /* end of the kernel processed data */
1286 NDR_record_t NDR;
1287 vm_info_region_64_t region;
1288 mach_msg_type_number_t objectsCnt;
1289 } __Reply__mach_vm_region_info_64_t __attribute__((unused));
1290#ifdef __MigPackStructs
1291#pragma pack(pop)
1292#endif
1293
1294#ifdef __MigPackStructs
1295#pragma pack(push, 4)
1296#endif
1297 typedef struct {
1298 mach_msg_header_t Head;
1299 /* start of the kernel processed data */
1300 mach_msg_body_t msgh_body;
1301 mach_msg_port_descriptor_t object_name;
1302 /* end of the kernel processed data */
1303 NDR_record_t NDR;
1304 vm_address_t address;
1305 vm_size_t size;
1306 mach_msg_type_number_t infoCnt;
1307 int info[10];
1308 } __Reply__vm_region_64_t __attribute__((unused));
1309#ifdef __MigPackStructs
1310#pragma pack(pop)
1311#endif
1312
1313#ifdef __MigPackStructs
1314#pragma pack(push, 4)
1315#endif
1316 typedef struct {
1317 mach_msg_header_t Head;
1318 /* start of the kernel processed data */
1319 mach_msg_body_t msgh_body;
1320 mach_msg_port_descriptor_t object_handle;
1321 /* end of the kernel processed data */
1322 NDR_record_t NDR;
1323 memory_object_size_t size;
1324 } __Reply__mach_make_memory_entry_64_t __attribute__((unused));
1325#ifdef __MigPackStructs
1326#pragma pack(pop)
1327#endif
1328
1329#ifdef __MigPackStructs
1330#pragma pack(push, 4)
1331#endif
1332 typedef struct {
1333 mach_msg_header_t Head;
1334 NDR_record_t NDR;
1335 kern_return_t RetCode;
1336 vm_address_t address;
1337 } __Reply__vm_map_64_t __attribute__((unused));
1338#ifdef __MigPackStructs
1339#pragma pack(pop)
1340#endif
1341
1342#ifdef __MigPackStructs
1343#pragma pack(push, 4)
1344#endif
1345 typedef struct {
1346 mach_msg_header_t Head;
1347 NDR_record_t NDR;
1348 kern_return_t RetCode;
1349 int state;
1350 } __Reply__vm_purgable_control_t __attribute__((unused));
1351#ifdef __MigPackStructs
1352#pragma pack(pop)
1353#endif
1354
1355#ifdef __MigPackStructs
1356#pragma pack(push, 4)
1357#endif
1358 typedef struct {
1359 mach_msg_header_t Head;
1360 NDR_record_t NDR;
1361 kern_return_t RetCode;
1362 } __Reply__vm_map_exec_lockdown_t __attribute__((unused));
1363#ifdef __MigPackStructs
1364#pragma pack(pop)
1365#endif
1366#endif /* !__Reply__vm_map_subsystem__defined */
1367
1368/* union of all replies */
1369
1370#ifndef __ReplyUnion__vm_map_subsystem__defined
1371#define __ReplyUnion__vm_map_subsystem__defined
1372union __ReplyUnion__vm_map_subsystem {
1373 __Reply__vm_region_t Reply_vm_region;
1374 __Reply__vm_allocate_t Reply_vm_allocate;
1375 __Reply__vm_deallocate_t Reply_vm_deallocate;
1376 __Reply__vm_protect_t Reply_vm_protect;
1377 __Reply__vm_inherit_t Reply_vm_inherit;
1378 __Reply__vm_read_t Reply_vm_read;
1379 __Reply__vm_read_list_t Reply_vm_read_list;
1380 __Reply__vm_write_t Reply_vm_write;
1381 __Reply__vm_copy_t Reply_vm_copy;
1382 __Reply__vm_read_overwrite_t Reply_vm_read_overwrite;
1383 __Reply__vm_msync_t Reply_vm_msync;
1384 __Reply__vm_behavior_set_t Reply_vm_behavior_set;
1385 __Reply__vm_map_t Reply_vm_map;
1386 __Reply__vm_machine_attribute_t Reply_vm_machine_attribute;
1387 __Reply__vm_remap_t Reply_vm_remap;
1388 __Reply__task_wire_t Reply_task_wire;
1389 __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry;
1390 __Reply__vm_map_page_query_t Reply_vm_map_page_query;
1391 __Reply__mach_vm_region_info_t Reply_mach_vm_region_info;
1392 __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info;
1393 __Reply__vm_region_recurse_t Reply_vm_region_recurse;
1394 __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64;
1395 __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64;
1396 __Reply__vm_region_64_t Reply_vm_region_64;
1397 __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64;
1398 __Reply__vm_map_64_t Reply_vm_map_64;
1399 __Reply__vm_purgable_control_t Reply_vm_purgable_control;
1400 __Reply__vm_map_exec_lockdown_t Reply_vm_map_exec_lockdown;
1401};
1402#endif /* !__RequestUnion__vm_map_subsystem__defined */
1403
1404#ifndef subsystem_to_name_map_vm_map
1405#define subsystem_to_name_map_vm_map \
1406 { "vm_region", 3800 },\
1407 { "vm_allocate", 3801 },\
1408 { "vm_deallocate", 3802 },\
1409 { "vm_protect", 3803 },\
1410 { "vm_inherit", 3804 },\
1411 { "vm_read", 3805 },\
1412 { "vm_read_list", 3806 },\
1413 { "vm_write", 3807 },\
1414 { "vm_copy", 3808 },\
1415 { "vm_read_overwrite", 3809 },\
1416 { "vm_msync", 3810 },\
1417 { "vm_behavior_set", 3811 },\
1418 { "vm_map", 3812 },\
1419 { "vm_machine_attribute", 3813 },\
1420 { "vm_remap", 3814 },\
1421 { "task_wire", 3815 },\
1422 { "mach_make_memory_entry", 3816 },\
1423 { "vm_map_page_query", 3817 },\
1424 { "mach_vm_region_info", 3818 },\
1425 { "vm_mapped_pages_info", 3819 },\
1426 { "vm_region_recurse", 3821 },\
1427 { "vm_region_recurse_64", 3822 },\
1428 { "mach_vm_region_info_64", 3823 },\
1429 { "vm_region_64", 3824 },\
1430 { "mach_make_memory_entry_64", 3825 },\
1431 { "vm_map_64", 3826 },\
1432 { "vm_purgable_control", 3830 },\
1433 { "vm_map_exec_lockdown", 3831 }
1434#endif
1435
1436#ifdef __AfterMigUserHeader
1437__AfterMigUserHeader
1438#endif /* __AfterMigUserHeader */
1439
1440#endif /* _vm_map_user_ */
lib/libc/include/aarch64-macos-gnu/mach/vm_page_size.h created+68
......@@ -0,0 +1,68 @@
1/*
2 * Copyright (c) 2013 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _VM_PAGE_SIZE_H_
30#define _VM_PAGE_SIZE_H_
31
32#include <Availability.h>
33#include <mach/mach_types.h>
34#include <sys/cdefs.h>
35
36__BEGIN_DECLS
37
38/*
39 * Globally interesting numbers.
40 * These macros assume vm_page_size is a power-of-2.
41 */
42extern vm_size_t vm_page_size;
43extern vm_size_t vm_page_mask;
44extern int vm_page_shift;
45
46/*
47 * These macros assume vm_page_size is a power-of-2.
48 */
49#define trunc_page(x) ((x) & (~(vm_page_size - 1)))
50#define round_page(x) trunc_page((x) + (vm_page_size - 1))
51
52/*
53 * Page-size rounding macros for the fixed-width VM types.
54 */
55#define mach_vm_trunc_page(x) ((mach_vm_offset_t)(x) & ~((signed)vm_page_mask))
56#define mach_vm_round_page(x) (((mach_vm_offset_t)(x) + vm_page_mask) & ~((signed)vm_page_mask))
57
58
59extern vm_size_t vm_kernel_page_size __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
60extern vm_size_t vm_kernel_page_mask __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
61extern int vm_kernel_page_shift __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
62
63#define trunc_page_kernel(x) ((x) & (~vm_kernel_page_mask))
64#define round_page_kernel(x) trunc_page_kernel((x) + vm_kernel_page_mask)
65
66__END_DECLS
67
68#endif
lib/libc/include/aarch64-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
75typedef 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/aarch64-macos-gnu/mach/vm_purgable.h created+162
......@@ -0,0 +1,162 @@
1/*
2 * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*
30 * Virtual memory map purgeable object definitions.
31 * Objects that will be needed in the future (forward cached objects) should be queued LIFO.
32 * Objects that have been used and are cached for reuse (backward cached) should be queued FIFO.
33 * Every user of purgeable memory is entitled to using the highest volatile group (7).
34 * Only if a client wants some of its objects to definitely be purged earlier, it can put those in
35 * another group. This could be used to make all FIFO objects (in the lower group) go away before
36 * any LIFO objects (in the higher group) go away.
37 * Objects that should not get any chance to stay around can be marked as "obsolete". They will
38 * be emptied before any other objects or pages are reclaimed. Obsolete objects are not emptied
39 * in any particular order.
40 * 'purgeable' is recognized as the correct spelling. For historical reasons, definitions
41 * in this file are spelled 'purgable'.
42 */
43
44#ifndef _MACH_VM_PURGABLE_H_
45#define _MACH_VM_PURGABLE_H_
46
47/*
48 * Types defined:
49 *
50 * vm_purgable_t purgeable object control codes.
51 */
52
53typedef int vm_purgable_t;
54
55/*
56 * Enumeration of valid values for vm_purgable_t.
57 */
58#define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0) /* set state of purgeable object */
59#define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1) /* get state of purgeable object */
60#define VM_PURGABLE_PURGE_ALL ((vm_purgable_t) 2) /* purge all volatile objects now */
61#define VM_PURGABLE_SET_STATE_FROM_KERNEL ((vm_purgable_t) 3) /* set state from kernel */
62
63/*
64 * Purgeable state:
65 *
66 * 31 15 14 13 12 11 10 8 7 6 5 4 3 2 1 0
67 * +-----+--+-----+--+----+-+-+---+---+---+
68 * | |NA|DEBUG| | GRP| |B|ORD| |STA|
69 * +-----+--+-----+--+----+-+-+---+---+---+
70 * " ": unused (i.e. reserved)
71 * STA: purgeable state
72 * see: VM_PURGABLE_NONVOLATILE=0 to VM_PURGABLE_DENY=3
73 * ORD: order
74 * see:VM_VOLATILE_ORDER_*
75 * B: behavior
76 * see: VM_PURGABLE_BEHAVIOR_*
77 * GRP: group
78 * see: VM_VOLATILE_GROUP_*
79 * DEBUG: debug
80 * see: VM_PURGABLE_DEBUG_*
81 * NA: no aging
82 * see: VM_PURGABLE_NO_AGING*
83 */
84
85#define VM_PURGABLE_NO_AGING_SHIFT 16
86#define VM_PURGABLE_NO_AGING_MASK (0x1 << VM_PURGABLE_NO_AGING_SHIFT)
87#define VM_PURGABLE_NO_AGING (0x1 << VM_PURGABLE_NO_AGING_SHIFT)
88
89#define VM_PURGABLE_DEBUG_SHIFT 12
90#define VM_PURGABLE_DEBUG_MASK (0x3 << VM_PURGABLE_DEBUG_SHIFT)
91#define VM_PURGABLE_DEBUG_EMPTY (0x1 << VM_PURGABLE_DEBUG_SHIFT)
92#define VM_PURGABLE_DEBUG_FAULT (0x2 << VM_PURGABLE_DEBUG_SHIFT)
93
94/*
95 * Volatile memory ordering groups (group zero objects are purged before group 1, etc...
96 * It is implementation dependent as to whether these groups are global or per-address space.
97 * (for the moment, they are global).
98 */
99#define VM_VOLATILE_GROUP_SHIFT 8
100#define VM_VOLATILE_GROUP_MASK (7 << VM_VOLATILE_GROUP_SHIFT)
101#define VM_VOLATILE_GROUP_DEFAULT VM_VOLATILE_GROUP_0
102
103#define VM_VOLATILE_GROUP_0 (0 << VM_VOLATILE_GROUP_SHIFT)
104#define VM_VOLATILE_GROUP_1 (1 << VM_VOLATILE_GROUP_SHIFT)
105#define VM_VOLATILE_GROUP_2 (2 << VM_VOLATILE_GROUP_SHIFT)
106#define VM_VOLATILE_GROUP_3 (3 << VM_VOLATILE_GROUP_SHIFT)
107#define VM_VOLATILE_GROUP_4 (4 << VM_VOLATILE_GROUP_SHIFT)
108#define VM_VOLATILE_GROUP_5 (5 << VM_VOLATILE_GROUP_SHIFT)
109#define VM_VOLATILE_GROUP_6 (6 << VM_VOLATILE_GROUP_SHIFT)
110#define VM_VOLATILE_GROUP_7 (7 << VM_VOLATILE_GROUP_SHIFT)
111
112/*
113 * Purgeable behavior
114 * Within the same group, FIFO objects will be emptied before objects that are added later.
115 * LIFO objects will be emptied after objects that are added later.
116 * - Input only, not returned on state queries.
117 */
118#define VM_PURGABLE_BEHAVIOR_SHIFT 6
119#define VM_PURGABLE_BEHAVIOR_MASK (1 << VM_PURGABLE_BEHAVIOR_SHIFT)
120#define VM_PURGABLE_BEHAVIOR_FIFO (0 << VM_PURGABLE_BEHAVIOR_SHIFT)
121#define VM_PURGABLE_BEHAVIOR_LIFO (1 << VM_PURGABLE_BEHAVIOR_SHIFT)
122
123/*
124 * Obsolete object.
125 * Disregard volatile group, and put object into obsolete queue instead, so it is the next object
126 * to be purged.
127 * - Input only, not returned on state queries.
128 */
129#define VM_PURGABLE_ORDERING_SHIFT 5
130#define VM_PURGABLE_ORDERING_MASK (1 << VM_PURGABLE_ORDERING_SHIFT)
131#define VM_PURGABLE_ORDERING_OBSOLETE (1 << VM_PURGABLE_ORDERING_SHIFT)
132#define VM_PURGABLE_ORDERING_NORMAL (0 << VM_PURGABLE_ORDERING_SHIFT)
133
134
135/*
136 * Obsolete parameter - do not use
137 */
138#define VM_VOLATILE_ORDER_SHIFT 4
139#define VM_VOLATILE_ORDER_MASK (1 << VM_VOLATILE_ORDER_SHIFT)
140#define VM_VOLATILE_MAKE_FIRST_IN_GROUP (1 << VM_VOLATILE_ORDER_SHIFT)
141#define VM_VOLATILE_MAKE_LAST_IN_GROUP (0 << VM_VOLATILE_ORDER_SHIFT)
142
143/*
144 * Valid states of a purgeable object.
145 */
146#define VM_PURGABLE_STATE_MIN 0 /* minimum purgeable object state value */
147#define VM_PURGABLE_STATE_MAX 3 /* maximum purgeable object state value */
148#define VM_PURGABLE_STATE_MASK 3 /* mask to separate state from group */
149
150#define VM_PURGABLE_NONVOLATILE 0 /* purgeable object is non-volatile */
151#define VM_PURGABLE_VOLATILE 1 /* purgeable object is volatile */
152#define VM_PURGABLE_EMPTY 2 /* purgeable object is volatile and empty */
153#define VM_PURGABLE_DENY 3 /* (mark) object not purgeable */
154
155#define VM_PURGABLE_ALL_MASKS (VM_PURGABLE_STATE_MASK | \
156 VM_VOLATILE_ORDER_MASK | \
157 VM_PURGABLE_ORDERING_MASK | \
158 VM_PURGABLE_BEHAVIOR_MASK | \
159 VM_VOLATILE_GROUP_MASK | \
160 VM_PURGABLE_DEBUG_MASK | \
161 VM_PURGABLE_NO_AGING_MASK)
162#endif /* _MACH_VM_PURGABLE_H_ */
lib/libc/include/aarch64-macos-gnu/mach/vm_region.h created+349
......@@ -0,0 +1,349 @@
1/*
2 * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * File: mach/vm_region.h
33 *
34 * Define the attributes of a task's memory region
35 *
36 */
37
38#ifndef _MACH_VM_REGION_H_
39#define _MACH_VM_REGION_H_
40
41#include <mach/boolean.h>
42#include <mach/vm_prot.h>
43#include <mach/vm_inherit.h>
44#include <mach/vm_behavior.h>
45#include <mach/vm_types.h>
46#include <mach/message.h>
47#include <mach/machine/vm_param.h>
48#include <mach/machine/vm_types.h>
49#include <mach/memory_object_types.h>
50
51#include <sys/cdefs.h>
52
53#pragma pack(push, 4)
54
55// LP64todo: all the current tools are 32bit, obviously never worked for 64b
56// so probably should be a real 32b ID vs. ptr.
57// Current users just check for equality
58typedef uint32_t vm32_object_id_t;
59
60/*
61 * Types defined:
62 *
63 * vm_region_info_t memory region attributes
64 */
65
66#define VM_REGION_INFO_MAX (1024)
67typedef int *vm_region_info_t;
68typedef int *vm_region_info_64_t;
69typedef int *vm_region_recurse_info_t;
70typedef int *vm_region_recurse_info_64_t;
71typedef int vm_region_flavor_t;
72typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];
73
74#define VM_REGION_BASIC_INFO_64 9
75struct vm_region_basic_info_64 {
76 vm_prot_t protection;
77 vm_prot_t max_protection;
78 vm_inherit_t inheritance;
79 boolean_t shared;
80 boolean_t reserved;
81 memory_object_offset_t offset;
82 vm_behavior_t behavior;
83 unsigned short user_wired_count;
84};
85typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t;
86typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t;
87
88#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) \
89 (sizeof(vm_region_basic_info_data_64_t)/sizeof(int)))
90
91/*
92 * Passing VM_REGION_BASIC_INFO to vm_region_64
93 * automatically converts it to a VM_REGION_BASIC_INFO_64.
94 * Please use that explicitly instead.
95 */
96#define VM_REGION_BASIC_INFO 10
97
98/*
99 * This is the legacy basic info structure. It is
100 * deprecated because it passes only a 32-bit memory object
101 * offset back - too small for many larger objects (e.g. files).
102 */
103struct vm_region_basic_info {
104 vm_prot_t protection;
105 vm_prot_t max_protection;
106 vm_inherit_t inheritance;
107 boolean_t shared;
108 boolean_t reserved;
109 uint32_t offset; /* too small for a real offset */
110 vm_behavior_t behavior;
111 unsigned short user_wired_count;
112};
113
114typedef struct vm_region_basic_info *vm_region_basic_info_t;
115typedef struct vm_region_basic_info vm_region_basic_info_data_t;
116
117#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
118 (sizeof(vm_region_basic_info_data_t)/sizeof(int)))
119
120#define SM_COW 1
121#define SM_PRIVATE 2
122#define SM_EMPTY 3
123#define SM_SHARED 4
124#define SM_TRUESHARED 5
125#define SM_PRIVATE_ALIASED 6
126#define SM_SHARED_ALIASED 7
127#define SM_LARGE_PAGE 8
128
129/*
130 * For submap info, the SM flags above are overlayed when a submap
131 * is encountered. The field denotes whether or not machine level mapping
132 * information is being shared. PTE's etc. When such sharing is taking
133 * place the value returned is SM_TRUESHARED otherwise SM_PRIVATE is passed
134 * back.
135 */
136
137
138
139
140#define VM_REGION_EXTENDED_INFO 13
141struct vm_region_extended_info {
142 vm_prot_t protection;
143 unsigned int user_tag;
144 unsigned int pages_resident;
145 unsigned int pages_shared_now_private;
146 unsigned int pages_swapped_out;
147 unsigned int pages_dirtied;
148 unsigned int ref_count;
149 unsigned short shadow_depth;
150 unsigned char external_pager;
151 unsigned char share_mode;
152 unsigned int pages_reusable;
153};
154typedef struct vm_region_extended_info *vm_region_extended_info_t;
155typedef struct vm_region_extended_info vm_region_extended_info_data_t;
156#define VM_REGION_EXTENDED_INFO_COUNT \
157 ((mach_msg_type_number_t) \
158 (sizeof (vm_region_extended_info_data_t) / sizeof (natural_t)))
159
160
161
162
163#define VM_REGION_TOP_INFO 12
164
165struct vm_region_top_info {
166 unsigned int obj_id;
167 unsigned int ref_count;
168 unsigned int private_pages_resident;
169 unsigned int shared_pages_resident;
170 unsigned char share_mode;
171};
172
173typedef struct vm_region_top_info *vm_region_top_info_t;
174typedef struct vm_region_top_info vm_region_top_info_data_t;
175
176#define VM_REGION_TOP_INFO_COUNT \
177 ((mach_msg_type_number_t) \
178 (sizeof(vm_region_top_info_data_t) / sizeof(natural_t)))
179
180
181
182/*
183 * vm_region_submap_info will return information on a submap or object.
184 * The user supplies a nesting level on the call. When a walk of the
185 * user's map is done and a submap is encountered, the nesting count is
186 * checked. If the nesting count is greater than 1 the submap is entered and
187 * the offset relative to the address in the base map is examined. If the
188 * nesting count is zero, the information on the submap is returned.
189 * The caller may thus learn about a submap and its contents by judicious
190 * choice of the base map address and nesting count. The nesting count
191 * allows penetration of recursively mapped submaps. If a submap is
192 * encountered as a mapped entry of another submap, the caller may bump
193 * the nesting count and call vm_region_recurse again on the target address
194 * range. The "is_submap" field tells the caller whether or not a submap
195 * has been encountered.
196 *
197 * Object only fields are filled in through a walking of the object shadow
198 * chain (where one is present), and a walking of the resident page queue.
199 *
200 */
201
202struct vm_region_submap_info {
203 vm_prot_t protection; /* present access protection */
204 vm_prot_t max_protection; /* max avail through vm_prot */
205 vm_inherit_t inheritance;/* behavior of map/obj on fork */
206 uint32_t offset; /* offset into object/map */
207 unsigned int user_tag; /* user tag on map entry */
208 unsigned int pages_resident; /* only valid for objects */
209 unsigned int pages_shared_now_private; /* only for objects */
210 unsigned int pages_swapped_out; /* only for objects */
211 unsigned int pages_dirtied; /* only for objects */
212 unsigned int ref_count; /* obj/map mappers, etc */
213 unsigned short shadow_depth; /* only for obj */
214 unsigned char external_pager; /* only for obj */
215 unsigned char share_mode; /* see enumeration */
216 boolean_t is_submap; /* submap vs obj */
217 vm_behavior_t behavior; /* access behavior hint */
218 vm32_object_id_t object_id; /* obj/map name, not a handle */
219 unsigned short user_wired_count;
220};
221
222typedef struct vm_region_submap_info *vm_region_submap_info_t;
223typedef struct vm_region_submap_info vm_region_submap_info_data_t;
224
225#define VM_REGION_SUBMAP_INFO_COUNT \
226 ((mach_msg_type_number_t) \
227 (sizeof(vm_region_submap_info_data_t) / sizeof(natural_t)))
228
229struct vm_region_submap_info_64 {
230 vm_prot_t protection; /* present access protection */
231 vm_prot_t max_protection; /* max avail through vm_prot */
232 vm_inherit_t inheritance;/* behavior of map/obj on fork */
233 memory_object_offset_t offset; /* offset into object/map */
234 unsigned int user_tag; /* user tag on map entry */
235 unsigned int pages_resident; /* only valid for objects */
236 unsigned int pages_shared_now_private; /* only for objects */
237 unsigned int pages_swapped_out; /* only for objects */
238 unsigned int pages_dirtied; /* only for objects */
239 unsigned int ref_count; /* obj/map mappers, etc */
240 unsigned short shadow_depth; /* only for obj */
241 unsigned char external_pager; /* only for obj */
242 unsigned char share_mode; /* see enumeration */
243 boolean_t is_submap; /* submap vs obj */
244 vm_behavior_t behavior; /* access behavior hint */
245 vm32_object_id_t object_id; /* obj/map name, not a handle */
246 unsigned short user_wired_count;
247 unsigned int pages_reusable;
248 vm_object_id_t object_id_full;
249};
250
251typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t;
252typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t;
253
254#define VM_REGION_SUBMAP_INFO_V2_SIZE \
255 (sizeof (vm_region_submap_info_data_64_t))
256#define VM_REGION_SUBMAP_INFO_V1_SIZE \
257 (VM_REGION_SUBMAP_INFO_V2_SIZE - \
258 sizeof (vm_object_id_t) /* object_id_full */ )
259#define VM_REGION_SUBMAP_INFO_V0_SIZE \
260 (VM_REGION_SUBMAP_INFO_V1_SIZE - \
261 sizeof (unsigned int) /* pages_reusable */ )
262
263#define VM_REGION_SUBMAP_INFO_V2_COUNT_64 \
264 ((mach_msg_type_number_t) \
265 (VM_REGION_SUBMAP_INFO_V2_SIZE / sizeof (natural_t)))
266#define VM_REGION_SUBMAP_INFO_V1_COUNT_64 \
267 ((mach_msg_type_number_t) \
268 (VM_REGION_SUBMAP_INFO_V1_SIZE / sizeof (natural_t)))
269#define VM_REGION_SUBMAP_INFO_V0_COUNT_64 \
270 ((mach_msg_type_number_t) \
271 (VM_REGION_SUBMAP_INFO_V0_SIZE / sizeof (natural_t)))
272
273/* set this to the latest version */
274#define VM_REGION_SUBMAP_INFO_COUNT_64 VM_REGION_SUBMAP_INFO_V2_COUNT_64
275
276struct vm_region_submap_short_info_64 {
277 vm_prot_t protection; /* present access protection */
278 vm_prot_t max_protection; /* max avail through vm_prot */
279 vm_inherit_t inheritance;/* behavior of map/obj on fork */
280 memory_object_offset_t offset; /* offset into object/map */
281 unsigned int user_tag; /* user tag on map entry */
282 unsigned int ref_count; /* obj/map mappers, etc */
283 unsigned short shadow_depth; /* only for obj */
284 unsigned char external_pager; /* only for obj */
285 unsigned char share_mode; /* see enumeration */
286 boolean_t is_submap; /* submap vs obj */
287 vm_behavior_t behavior; /* access behavior hint */
288 vm32_object_id_t object_id; /* obj/map name, not a handle */
289 unsigned short user_wired_count;
290};
291
292typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t;
293typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t;
294
295#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 \
296 ((mach_msg_type_number_t) \
297 (sizeof (vm_region_submap_short_info_data_64_t) / sizeof (natural_t)))
298
299struct mach_vm_read_entry {
300 mach_vm_address_t address;
301 mach_vm_size_t size;
302};
303
304struct vm_read_entry {
305 vm_address_t address;
306 vm_size_t size;
307};
308
309#ifdef VM32_SUPPORT
310struct vm32_read_entry {
311 vm32_address_t address;
312 vm32_size_t size;
313};
314#endif
315
316
317#define VM_MAP_ENTRY_MAX (256)
318
319typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX];
320typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX];
321#ifdef VM32_SUPPORT
322typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX];
323#endif
324
325#pragma pack(pop)
326
327
328#define VM_PAGE_INFO_MAX
329typedef int *vm_page_info_t;
330typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX];
331typedef int vm_page_info_flavor_t;
332
333#define VM_PAGE_INFO_BASIC 1
334struct vm_page_info_basic {
335 int disposition;
336 int ref_count;
337 vm_object_id_t object_id;
338 memory_object_offset_t offset;
339 int depth;
340 int __pad; /* pad to 64-bit boundary */
341};
342typedef struct vm_page_info_basic *vm_page_info_basic_t;
343typedef struct vm_page_info_basic vm_page_info_basic_data_t;
344
345#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) \
346 (sizeof(vm_page_info_basic_data_t)/sizeof(int)))
347
348
349#endif /*_MACH_VM_REGION_H_*/
lib/libc/include/aarch64-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
70extern "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
88struct 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 */
117typedef struct vm_statistics *vm_statistics_t;
118typedef 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
136struct 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
171typedef struct vm_statistics64 *vm_statistics64_t;
172typedef struct vm_statistics64 vm_statistics64_data_t;
173
174kern_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
194struct 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
203typedef struct vm_extmod_statistics *vm_extmod_statistics_t;
204typedef struct vm_extmod_statistics vm_extmod_statistics_data_t;
205
206typedef struct vm_purgeable_stat {
207 uint64_t count;
208 uint64_t size;
209}vm_purgeable_stat_t;
210
211struct 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
217typedef 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 */
326enum 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/aarch64-macos-gnu/mach/vm_sync.h created+80
......@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 * File: mach/vm_sync.h
58 *
59 * Virtual memory synchronisation definitions.
60 *
61 */
62
63#ifndef _MACH_VM_SYNC_H_
64#define _MACH_VM_SYNC_H_
65
66typedef unsigned vm_sync_t;
67
68/*
69 * Synchronization flags, defined as bits within the vm_sync_t type
70 */
71
72#define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01)
73#define VM_SYNC_SYNCHRONOUS ((vm_sync_t) 0x02)
74#define VM_SYNC_INVALIDATE ((vm_sync_t) 0x04)
75#define VM_SYNC_KILLPAGES ((vm_sync_t) 0x08)
76#define VM_SYNC_DEACTIVATE ((vm_sync_t) 0x10)
77#define VM_SYNC_CONTIGUOUS ((vm_sync_t) 0x20)
78#define VM_SYNC_REUSABLEPAGES ((vm_sync_t) 0x40)
79
80#endif /* _MACH_VM_SYNC_H_ */
lib/libc/include/aarch64-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
40typedef vm_offset_t pointer_t;
41typedef vm_offset_t vm_address_t;
42
43/*
44 * We use addr64_t for 64-bit addresses that are used on both
45 * 32 and 64-bit machines. On PPC, they are passed and returned as
46 * two adjacent 32-bit GPRs. We use addr64_t in places where
47 * common code must be useable both on 32 and 64-bit machines.
48 */
49typedef uint64_t addr64_t; /* Basic effective address */
50
51/*
52 * We use reg64_t for addresses that are 32 bits on a 32-bit
53 * machine, and 64 bits on a 64-bit machine, but are always
54 * passed and returned in a single GPR on PPC. This type
55 * cannot be used in generic 32-bit c, since on a 64-bit
56 * machine the upper half of the register will be ignored
57 * by the c compiler in 32-bit mode. In c, we can only use the
58 * type in prototypes of functions that are written in and called
59 * from assembly language. This type is basically a comment.
60 */
61typedef uint32_t reg64_t;
62
63/*
64 * To minimize the use of 64-bit fields, we keep some physical
65 * addresses (that are page aligned) as 32-bit page numbers.
66 * This limits the physical address space to 16TB of RAM.
67 */
68typedef uint32_t ppnum_t; /* Physical page number */
69#define PPNUM_MAX UINT32_MAX
70
71
72
73typedef mach_port_t vm_map_t, 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
84typedef uint64_t vm_object_offset_t;
85typedef uint64_t vm_object_size_t;
86
87
88
89
90typedef mach_port_t upl_t;
91typedef 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/aarch64-macos-gnu/mach_debug/hash_info.h created+75
......@@ -0,0 +1,75 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_DEBUG_HASH_INFO_H_
60#define _MACH_DEBUG_HASH_INFO_H_
61
62#include <mach/machine/vm_types.h> /* natural_t */
63
64/*
65 * Remember to update the mig type definitions
66 * in mach_debug_types.defs when adding/removing fields.
67 */
68
69typedef struct hash_info_bucket {
70 natural_t hib_count; /* number of records in bucket */
71} hash_info_bucket_t;
72
73typedef hash_info_bucket_t *hash_info_bucket_array_t;
74
75#endif /* _MACH_DEBUG_HASH_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach_debug/ipc_info.h created+116
......@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File: mach_debug/ipc_info.h
60 * Author: Rich Draves
61 * Date: March, 1990
62 *
63 * Definitions for the IPC debugging interface.
64 */
65
66#ifndef _MACH_DEBUG_IPC_INFO_H_
67#define _MACH_DEBUG_IPC_INFO_H_
68
69#include <mach/boolean.h>
70#include <mach/port.h>
71#include <mach/machine/vm_types.h>
72
73/*
74 * Remember to update the mig type definitions
75 * in mach_debug_types.defs when adding/removing fields.
76 */
77
78typedef struct ipc_info_space {
79 natural_t iis_genno_mask; /* generation number mask */
80 natural_t iis_table_size; /* size of table */
81 natural_t iis_table_next; /* next possible size of table */
82 natural_t iis_tree_size; /* size of tree (UNUSED) */
83 natural_t iis_tree_small; /* # of small entries in tree (UNUSED) */
84 natural_t iis_tree_hash; /* # of hashed entries in tree (UNUSED) */
85} ipc_info_space_t;
86
87typedef struct ipc_info_space_basic {
88 natural_t iisb_genno_mask; /* generation number mask */
89 natural_t iisb_table_size; /* size of table */
90 natural_t iisb_table_next; /* next possible size of table */
91 natural_t iisb_table_inuse; /* number of entries in use */
92 natural_t iisb_reserved[2]; /* future expansion */
93} ipc_info_space_basic_t;
94
95typedef struct ipc_info_name {
96 mach_port_name_t iin_name; /* port name, including gen number */
97/*boolean_t*/ integer_t iin_collision; /* collision at this entry? */
98 mach_port_type_t iin_type; /* straight port type */
99 mach_port_urefs_t iin_urefs; /* user-references */
100 natural_t iin_object; /* object pointer/identifier */
101 natural_t iin_next; /* marequest/next in free list */
102 natural_t iin_hash; /* hash index */
103} ipc_info_name_t;
104
105typedef ipc_info_name_t *ipc_info_name_array_t;
106
107/* UNUSED */
108typedef struct ipc_info_tree_name {
109 ipc_info_name_t iitn_name;
110 mach_port_name_t iitn_lchild; /* name of left child */
111 mach_port_name_t iitn_rchild; /* name of right child */
112} ipc_info_tree_name_t;
113
114typedef ipc_info_tree_name_t *ipc_info_tree_name_array_t;
115
116#endif /* _MACH_DEBUG_IPC_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach_debug/lockgroup_info.h created+74
......@@ -0,0 +1,74 @@
1/*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * File: mach/lockgroup_info.h
30 *
31 * Definitions for host_lockgroup_info call.
32 */
33
34#ifndef _MACH_DEBUG_LOCKGROUP_INFO_H_
35#define _MACH_DEBUG_LOCKGROUP_INFO_H_
36
37#include <mach/mach_types.h>
38
39#define LOCKGROUP_MAX_NAME 64
40
41#define LOCKGROUP_ATTR_STAT 0x01ULL
42
43typedef struct lockgroup_info {
44 char lockgroup_name[LOCKGROUP_MAX_NAME];
45 uint64_t lockgroup_attr;
46 uint64_t lock_spin_cnt;
47 uint64_t lock_spin_util_cnt;
48 uint64_t lock_spin_held_cnt;
49 uint64_t lock_spin_miss_cnt;
50 uint64_t lock_spin_held_max;
51 uint64_t lock_spin_held_cum;
52 uint64_t lock_mtx_cnt;
53 uint64_t lock_mtx_util_cnt;
54 uint64_t lock_mtx_held_cnt;
55 uint64_t lock_mtx_miss_cnt;
56 uint64_t lock_mtx_wait_cnt;
57 uint64_t lock_mtx_held_max;
58 uint64_t lock_mtx_held_cum;
59 uint64_t lock_mtx_wait_max;
60 uint64_t lock_mtx_wait_cum;
61 uint64_t lock_rw_cnt;
62 uint64_t lock_rw_util_cnt;
63 uint64_t lock_rw_held_cnt;
64 uint64_t lock_rw_miss_cnt;
65 uint64_t lock_rw_wait_cnt;
66 uint64_t lock_rw_held_max;
67 uint64_t lock_rw_held_cum;
68 uint64_t lock_rw_wait_max;
69 uint64_t lock_rw_wait_cum;
70} lockgroup_info_t;
71
72typedef lockgroup_info_t *lockgroup_info_array_t;
73
74#endif /* _MACH_DEBUG_LOCKGROUP_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach_debug/mach_debug_types.h created+95
......@@ -0,0 +1,95 @@
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * Mach kernel debugging interface type declarations
60 */
61
62#ifndef _MACH_DEBUG_MACH_DEBUG_TYPES_H_
63#define _MACH_DEBUG_MACH_DEBUG_TYPES_H_
64
65#include <mach_debug/ipc_info.h>
66#include <mach_debug/vm_info.h>
67#include <mach_debug/zone_info.h>
68#include <mach_debug/page_info.h>
69#include <mach_debug/hash_info.h>
70#include <mach_debug/lockgroup_info.h>
71
72#define MACH_CORE_FILEHEADER_SIGNATURE 0x0063614d20646152ULL
73#define MACH_CORE_FILEHEADER_MAXFILES 16
74#define MACH_CORE_FILEHEADER_NAMELEN 16
75
76typedef char symtab_name_t[32];
77
78struct mach_core_details {
79 uint64_t gzip_offset;
80 uint64_t gzip_length;
81 char core_name[MACH_CORE_FILEHEADER_NAMELEN];
82};
83
84struct mach_core_fileheader {
85 uint64_t signature;
86 uint64_t log_offset;
87 uint64_t log_length;
88 uint64_t num_files;
89 struct mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES];
90};
91
92#define KOBJECT_DESCRIPTION_LENGTH 512
93typedef char kobject_description_t[KOBJECT_DESCRIPTION_LENGTH];
94
95#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/mach_debug/page_info.h created+64
......@@ -0,0 +1,64 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58#ifndef MACH_DEBUG_PAGE_INFO_H
59#define MACH_DEBUG_PAGE_INFO_H
60
61#include <mach/machine/vm_types.h>
62
63typedef vm_offset_t *page_address_array_t;
64#endif /* MACH_DEBUG_PAGE_INFO_H */
lib/libc/include/aarch64-macos-gnu/mach_debug/vm_info.h created+149
......@@ -0,0 +1,149 @@
1/*
2 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 * File: mach_debug/vm_info.h
58 * Author: Rich Draves
59 * Date: March, 1990
60 *
61 * Definitions for the VM debugging interface.
62 */
63
64#ifndef _MACH_DEBUG_VM_INFO_H_
65#define _MACH_DEBUG_VM_INFO_H_
66
67#include <mach/boolean.h>
68#include <mach/machine/vm_types.h>
69#include <mach/vm_inherit.h>
70#include <mach/vm_prot.h>
71#include <mach/memory_object_types.h>
72
73#pragma pack(4)
74
75/*
76 * Remember to update the mig type definitions
77 * in mach_debug_types.defs when adding/removing fields.
78 */
79typedef struct mach_vm_info_region {
80 mach_vm_offset_t vir_start; /* start of region */
81 mach_vm_offset_t vir_end; /* end of region */
82 mach_vm_offset_t vir_object; /* the mapped object(kernal addr) */
83 memory_object_offset_t vir_offset; /* offset into object */
84 boolean_t vir_needs_copy; /* does object need to be copied? */
85 vm_prot_t vir_protection; /* protection code */
86 vm_prot_t vir_max_protection; /* maximum protection */
87 vm_inherit_t vir_inheritance; /* inheritance */
88 natural_t vir_wired_count; /* number of times wired */
89 natural_t vir_user_wired_count; /* number of times user has wired */
90} mach_vm_info_region_t;
91
92typedef struct vm_info_region_64 {
93 natural_t vir_start; /* start of region */
94 natural_t vir_end; /* end of region */
95 natural_t vir_object; /* the mapped object */
96 memory_object_offset_t vir_offset; /* offset into object */
97 boolean_t vir_needs_copy; /* does object need to be copied? */
98 vm_prot_t vir_protection; /* protection code */
99 vm_prot_t vir_max_protection; /* maximum protection */
100 vm_inherit_t vir_inheritance; /* inheritance */
101 natural_t vir_wired_count; /* number of times wired */
102 natural_t vir_user_wired_count; /* number of times user has wired */
103} vm_info_region_64_t;
104
105typedef struct vm_info_region {
106 natural_t vir_start; /* start of region */
107 natural_t vir_end; /* end of region */
108 natural_t vir_object; /* the mapped object */
109 natural_t vir_offset; /* offset into object */
110 boolean_t vir_needs_copy; /* does object need to be copied? */
111 vm_prot_t vir_protection; /* protection code */
112 vm_prot_t vir_max_protection; /* maximum protection */
113 vm_inherit_t vir_inheritance; /* inheritance */
114 natural_t vir_wired_count; /* number of times wired */
115 natural_t vir_user_wired_count; /* number of times user has wired */
116} vm_info_region_t;
117
118
119typedef struct vm_info_object {
120 natural_t vio_object; /* this object */
121 natural_t vio_size; /* object size (valid if internal - but too small) */
122 unsigned int vio_ref_count; /* number of references */
123 unsigned int vio_resident_page_count; /* number of resident pages */
124 unsigned int vio_absent_count; /* number requested but not filled */
125 natural_t vio_copy; /* copy object */
126 natural_t vio_shadow; /* shadow object */
127 natural_t vio_shadow_offset; /* offset into shadow object */
128 natural_t vio_paging_offset; /* offset into memory object */
129 memory_object_copy_strategy_t vio_copy_strategy;
130 /* how to handle data copy */
131 vm_offset_t vio_last_alloc; /* offset of last allocation */
132 /* many random attributes */
133 unsigned int vio_paging_in_progress;
134 boolean_t vio_pager_created;
135 boolean_t vio_pager_initialized;
136 boolean_t vio_pager_ready;
137 boolean_t vio_can_persist;
138 boolean_t vio_internal;
139 boolean_t vio_temporary;
140 boolean_t vio_alive;
141 boolean_t vio_purgable;
142 boolean_t vio_purgable_volatile;
143} vm_info_object_t;
144
145typedef vm_info_object_t *vm_info_object_array_t;
146
147#pragma pack()
148
149#endif /* _MACH_DEBUG_VM_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/mach_debug/zone_info.h created+201
......@@ -0,0 +1,201 @@
1/*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59#ifndef _MACH_DEBUG_ZONE_INFO_H_
60#define _MACH_DEBUG_ZONE_INFO_H_
61
62#include <mach/boolean.h>
63#include <mach/machine/vm_types.h>
64
65/*
66 * Legacy definitions for host_zone_info(). This interface, and
67 * these definitions have been deprecated in favor of the new
68 * mach_zone_info() inteface and types below.
69 */
70
71#define ZONE_NAME_MAX_LEN 80
72
73typedef struct zone_name {
74 char zn_name[ZONE_NAME_MAX_LEN];
75} zone_name_t;
76
77typedef zone_name_t *zone_name_array_t;
78
79
80typedef struct zone_info {
81 integer_t zi_count; /* Number of elements used now */
82 vm_size_t zi_cur_size; /* current memory utilization */
83 vm_size_t zi_max_size; /* how large can this zone grow */
84 vm_size_t zi_elem_size; /* size of an element */
85 vm_size_t zi_alloc_size; /* size used for more memory */
86 integer_t zi_pageable; /* zone pageable? */
87 integer_t zi_sleepable; /* sleep if empty? */
88 integer_t zi_exhaustible; /* merely return if empty? */
89 integer_t zi_collectable; /* garbage collect elements? */
90} zone_info_t;
91
92typedef zone_info_t *zone_info_array_t;
93
94
95/*
96 * Remember to update the mig type definitions
97 * in mach_debug_types.defs when adding/removing fields.
98 */
99
100#define MACH_ZONE_NAME_MAX_LEN 80
101
102typedef struct mach_zone_name {
103 char mzn_name[ZONE_NAME_MAX_LEN];
104} mach_zone_name_t;
105
106typedef mach_zone_name_t *mach_zone_name_array_t;
107
108typedef struct mach_zone_info_data {
109 uint64_t mzi_count; /* count of elements in use */
110 uint64_t mzi_cur_size; /* current memory utilization */
111 uint64_t mzi_max_size; /* how large can this zone grow */
112 uint64_t mzi_elem_size; /* size of an element */
113 uint64_t mzi_alloc_size; /* size used for more memory */
114 uint64_t mzi_sum_size; /* sum of all allocs (life of zone) */
115 uint64_t mzi_exhaustible; /* merely return if empty? */
116 uint64_t mzi_collectable; /* garbage collect elements? and how much? */
117} mach_zone_info_t;
118
119typedef mach_zone_info_t *mach_zone_info_array_t;
120
121/*
122 * The lowest bit of mzi_collectable indicates whether or not the zone
123 * is collectable by zone_gc(). The higher bits contain the size in bytes
124 * that can be collected.
125 */
126#define GET_MZI_COLLECTABLE_BYTES(val) ((val) >> 1)
127#define GET_MZI_COLLECTABLE_FLAG(val) ((val) & 1)
128
129#define SET_MZI_COLLECTABLE_BYTES(val, size) \
130 (val) = ((val) & 1) | ((size) << 1)
131#define SET_MZI_COLLECTABLE_FLAG(val, flag) \
132 (val) = (flag) ? ((val) | 1) : (val)
133
134typedef struct task_zone_info_data {
135 uint64_t tzi_count; /* count of elements in use */
136 uint64_t tzi_cur_size; /* current memory utilization */
137 uint64_t tzi_max_size; /* how large can this zone grow */
138 uint64_t tzi_elem_size; /* size of an element */
139 uint64_t tzi_alloc_size; /* size used for more memory */
140 uint64_t tzi_sum_size; /* sum of all allocs (life of zone) */
141 uint64_t tzi_exhaustible; /* merely return if empty? */
142 uint64_t tzi_collectable; /* garbage collect elements? */
143 uint64_t tzi_caller_acct; /* charged to caller (or kernel) */
144 uint64_t tzi_task_alloc; /* sum of all allocs by this task */
145 uint64_t tzi_task_free; /* sum of all frees by this task */
146} task_zone_info_t;
147
148typedef task_zone_info_t *task_zone_info_array_t;
149
150#define MACH_MEMORY_INFO_NAME_MAX_LEN 80
151
152typedef struct mach_memory_info {
153 uint64_t flags;
154 uint64_t site;
155 uint64_t size;
156 uint64_t free;
157 uint64_t largest;
158 uint64_t collectable_bytes;
159 uint64_t mapped;
160 uint64_t peak;
161 uint16_t tag;
162 uint16_t zone;
163 uint16_t _resvA[2];
164 uint64_t _resv[3];
165 char name[MACH_MEMORY_INFO_NAME_MAX_LEN];
166} mach_memory_info_t;
167
168typedef mach_memory_info_t *mach_memory_info_array_t;
169
170/*
171 * MAX_ZTRACE_DEPTH configures how deep of a stack trace is taken on each zalloc in the zone of interest. 15
172 * levels is usually enough to get past all the layers of code in kalloc and IOKit and see who the actual
173 * caller is up above these lower levels.
174 *
175 * This is used both for the zone leak detector and the zone corruption log. Make sure this isn't greater than
176 * BTLOG_MAX_DEPTH defined in btlog.h. Also make sure to update the definition of zone_btrecord_t in
177 * mach_debug_types.defs if this changes.
178 */
179
180#define MAX_ZTRACE_DEPTH 15
181
182/*
183 * Opcodes for the btlog operation field:
184 */
185
186#define ZOP_ALLOC 1
187#define ZOP_FREE 0
188
189/*
190 * Structure used to copy out btlog records to userspace, via the MIG call
191 * mach_zone_get_btlog_records().
192 */
193typedef struct zone_btrecord {
194 uint32_t ref_count; /* no. of active references on the record */
195 uint32_t operation_type; /* operation type (alloc/free) */
196 uint64_t bt[MAX_ZTRACE_DEPTH]; /* backtrace */
197} zone_btrecord_t;
198
199typedef zone_btrecord_t *zone_btrecord_array_t;
200
201#endif /* _MACH_DEBUG_ZONE_INFO_H_ */
lib/libc/include/aarch64-macos-gnu/machine/_mcontext.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 (__i386__) || defined (__x86_64__)
29#include "i386/_mcontext.h"
30#elif defined (__arm__) || defined (__arm64__)
31#include "arm/_mcontext.h"
32#else
33#error architecture not supported
34#endif
lib/libc/include/aarch64-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/aarch64-macos-gnu/machine/_types.h created+39
......@@ -0,0 +1,39 @@
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#ifndef _BSD_MACHINE__TYPES_H_
29#define _BSD_MACHINE__TYPES_H_
30
31#if defined (__i386__) || defined(__x86_64__)
32#include "i386/_types.h"
33#elif defined (__arm__) || defined (__arm64__)
34#include "arm/_types.h"
35#else
36#error architecture not supported
37#endif
38
39#endif /* _BSD_MACHINE__TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/machine/endian.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_ENDIAN_H_
32#define _BSD_MACHINE_ENDIAN_H_
33
34#if defined (__i386__) || defined(__x86_64__)
35#include "i386/endian.h"
36#elif defined (__arm__) || defined (__arm64__)
37#include "arm/endian.h"
38#else
39#error architecture not supported
40#endif
41
42#endif /* _BSD_MACHINE_ENDIAN_H_ */
lib/libc/include/aarch64-macos-gnu/machine/limits.h created+11
......@@ -0,0 +1,11 @@
1/* This is the `system' limits.h, independent of any particular
2 * compiler. GCC provides its own limits.h which can be found in
3 * /usr/lib/gcc, although it is not very informative.
4 * This file is public domain. */
5#if defined (__i386__) || defined(__x86_64__)
6#include <i386/limits.h>
7#elif defined (__arm__) || defined (__arm64__)
8#include <arm/limits.h>
9#else
10#error architecture not supported
11#endif
lib/libc/include/aarch64-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/aarch64-macos-gnu/machine/signal.h created+39
......@@ -0,0 +1,39 @@
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#ifndef _BSD_MACHINE_SIGNAL_H_
29#define _BSD_MACHINE_SIGNAL_H_
30
31#if defined (__i386__) || defined(__x86_64__)
32#include "i386/signal.h"
33#elif defined (__arm__) || defined (__arm64__)
34#include "arm/signal.h"
35#else
36#error architecture not supported
37#endif
38
39#endif /* _BSD_MACHINE_SIGNAL_H_ */
lib/libc/include/aarch64-macos-gnu/machine/types.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_TYPES_H_
32#define _BSD_MACHINE_TYPES_H_
33
34#if defined (__i386__) || defined(__x86_64__)
35#include "i386/types.h"
36#elif defined (__arm__) || defined (__arm64__)
37#include "arm/types.h"
38#else
39#error architecture not supported
40#endif
41
42#endif /* _BSD_MACHINE_TYPES_H_ */
lib/libc/include/aarch64-macos-gnu/malloc/_malloc.h created+56
......@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) 2018 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 _MALLOC_UNDERSCORE_MALLOC_H_
25#define _MALLOC_UNDERSCORE_MALLOC_H_
26
27/*
28 * This header is included from <stdlib.h>, so the contents of this file have
29 * broad source compatibility and POSIX conformance implications.
30 * Be cautious about what is included and declared here.
31 */
32
33#include <Availability.h>
34#include <sys/cdefs.h>
35#include <_types.h>
36#include <sys/_types/_size_t.h>
37
38__BEGIN_DECLS
39
40void *malloc(size_t __size) __result_use_check __alloc_size(1);
41void *calloc(size_t __count, size_t __size) __result_use_check __alloc_size(1,2);
42void free(void *);
43void *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))
45void *valloc(size_t) __alloc_size(1);
46#endif // !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
47#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
48 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
49 (defined(__cplusplus) && __cplusplus >= 201703L)
50void *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
52int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
53
54__END_DECLS
55
56#endif /* _MALLOC_UNDERSCORE_MALLOC_H_ */
lib/libc/include/aarch64-macos-gnu/malloc/malloc.h created+314
......@@ -0,0 +1,314 @@
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#ifndef _MALLOC_MALLOC_H_
25#define _MALLOC_MALLOC_H_
26
27#include <stddef.h>
28#include <mach/mach_types.h>
29#include <sys/cdefs.h>
30#include <Availability.h>
31
32#if __has_feature(ptrauth_calls)
33#include <ptrauth.h>
34
35// Zone function pointer, type-diversified but not address-diversified (because
36// the zone can be copied). Process-independent because the zone structure may
37// be in the shared library cache.
38#define MALLOC_ZONE_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
39 FALSE, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn
40
41// Introspection function pointer, address- and type-diversified.
42// Process-independent because the malloc_introspection_t structure that contains
43// these pointers may be in the shared library cache.
44#define MALLOC_INTROSPECT_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
45 TRUE, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn
46
47// Pointer to the introspection pointer table, type-diversified but not
48// address-diversified (because the zone can be copied).
49// Process-independent because the table pointer may be in the shared library cache.
50#define MALLOC_INTROSPECT_TBL_PTR(ptr) __ptrauth(ptrauth_key_process_independent_data,\
51 FALSE, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr
52
53#endif // __has_feature(ptrauth_calls)
54
55#ifndef MALLOC_ZONE_FN_PTR
56#define MALLOC_ZONE_FN_PTR(fn) fn
57#define MALLOC_INTROSPECT_FN_PTR(fn) fn
58#define MALLOC_INTROSPECT_TBL_PTR(ptr) ptr
59#endif // MALLOC_ZONE_FN_PTR
60
61__BEGIN_DECLS
62/********* Type definitions ************/
63
64typedef struct _malloc_zone_t {
65 /* Only zone implementors should depend on the layout of this structure;
66 Regular callers should use the access functions below */
67 void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */
68 void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */
69 size_t (* MALLOC_ZONE_FN_PTR(size))(struct _malloc_zone_t *zone, const void *ptr); /* returns the size of a block or 0 if not in this zone; must be fast, especially for negative answers */
70 void *(* MALLOC_ZONE_FN_PTR(malloc))(struct _malloc_zone_t *zone, size_t size);
71 void *(* MALLOC_ZONE_FN_PTR(calloc))(struct _malloc_zone_t *zone, size_t num_items, size_t size); /* same as malloc, but block returned is set to zero */
72 void *(* MALLOC_ZONE_FN_PTR(valloc))(struct _malloc_zone_t *zone, size_t size); /* same as malloc, but block returned is set to zero and is guaranteed to be page aligned */
73 void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone, void *ptr);
74 void *(* MALLOC_ZONE_FN_PTR(realloc))(struct _malloc_zone_t *zone, void *ptr, size_t size);
75 void (* MALLOC_ZONE_FN_PTR(destroy))(struct _malloc_zone_t *zone); /* zone is destroyed and all memory reclaimed */
76 const char *zone_name;
77
78 /* Optional batch callbacks; these may be NULL */
79 unsigned (* MALLOC_ZONE_FN_PTR(batch_malloc))(struct _malloc_zone_t *zone, size_t size, void **results, unsigned num_requested); /* given a size, returns pointers capable of holding that size; returns the number of pointers allocated (maybe 0 or less than num_requested) */
80 void (* MALLOC_ZONE_FN_PTR(batch_free))(struct _malloc_zone_t *zone, void **to_be_freed, unsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process */
81
82 struct malloc_introspection_t * MALLOC_INTROSPECT_TBL_PTR(introspect);
83 unsigned version;
84
85 /* aligned memory allocation. The callback may be NULL. Present in version >= 5. */
86 void *(* MALLOC_ZONE_FN_PTR(memalign))(struct _malloc_zone_t *zone, size_t alignment, size_t size);
87
88 /* free a pointer known to be in zone and known to have the given size. The callback may be NULL. Present in version >= 6.*/
89 void (* MALLOC_ZONE_FN_PTR(free_definite_size))(struct _malloc_zone_t *zone, void *ptr, size_t size);
90
91 /* Empty out caches in the face of memory pressure. The callback may be NULL. Present in version >= 8. */
92 size_t (* MALLOC_ZONE_FN_PTR(pressure_relief))(struct _malloc_zone_t *zone, size_t goal);
93
94 /*
95 * Checks whether an address might belong to the zone. May be NULL. Present in version >= 10.
96 * False positives are allowed (e.g. the pointer was freed, or it's in zone space that has
97 * not yet been allocated. False negatives are not allowed.
98 */
99 boolean_t (* MALLOC_ZONE_FN_PTR(claimed_address))(struct _malloc_zone_t *zone, void *ptr);
100} malloc_zone_t;
101
102/********* Creation and destruction ************/
103
104extern malloc_zone_t *malloc_default_zone(void);
105 /* The initial zone */
106
107extern malloc_zone_t *malloc_create_zone(vm_size_t start_size, unsigned flags);
108 /* Creates a new zone with default behavior and registers it */
109
110extern void malloc_destroy_zone(malloc_zone_t *zone);
111 /* Destroys zone and everything it allocated */
112
113/********* Block creation and manipulation ************/
114
115extern void *malloc_zone_malloc(malloc_zone_t *zone, size_t size) __alloc_size(2);
116 /* Allocates a new pointer of size size; zone must be non-NULL */
117
118extern void *malloc_zone_calloc(malloc_zone_t *zone, size_t num_items, size_t size) __alloc_size(2,3);
119 /* Allocates a new pointer of size num_items * size; block is cleared; zone must be non-NULL */
120
121extern void *malloc_zone_valloc(malloc_zone_t *zone, size_t size) __alloc_size(2);
122 /* Allocates a new pointer of size size; zone must be non-NULL; Pointer is guaranteed to be page-aligned and block is cleared */
123
124extern void malloc_zone_free(malloc_zone_t *zone, void *ptr);
125 /* Frees pointer in zone; zone must be non-NULL */
126
127extern void *malloc_zone_realloc(malloc_zone_t *zone, void *ptr, size_t size) __alloc_size(3);
128 /* Enlarges block if necessary; zone must be non-NULL */
129
130extern malloc_zone_t *malloc_zone_from_ptr(const void *ptr);
131 /* Returns the zone for a pointer, or NULL if not in any zone.
132 The ptr must have been returned from a malloc or realloc call. */
133
134extern size_t malloc_size(const void *ptr);
135 /* Returns size of given ptr */
136
137extern size_t malloc_good_size(size_t size);
138 /* Returns number of bytes greater than or equal to size that can be allocated without padding */
139
140extern void *malloc_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) __alloc_size(3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
141 /*
142 * Allocates a new pointer of size size whose address is an exact multiple of alignment.
143 * alignment must be a power of two and at least as large as sizeof(void *).
144 * zone must be non-NULL.
145 */
146
147/********* Batch methods ************/
148
149extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t size, void **results, unsigned num_requested);
150 /* Allocates num blocks of the same size; Returns the number truly allocated (may be 0) */
151
152extern void malloc_zone_batch_free(malloc_zone_t *zone, void **to_be_freed, unsigned num);
153 /* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process; This function will always free even if the zone has no batch callback */
154
155/********* Functions for libcache ************/
156
157extern malloc_zone_t *malloc_default_purgeable_zone(void) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
158 /* Returns a pointer to the default purgeable_zone. */
159
160extern void malloc_make_purgeable(void *ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
161 /* Make an allocation from the purgeable zone purgeable if possible. */
162
163extern int malloc_make_nonpurgeable(void *ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
164 /* Makes an allocation from the purgeable zone nonpurgeable.
165 * Returns zero if the contents were not purged since the last
166 * call to malloc_make_purgeable, else returns non-zero. */
167
168/********* Functions for zone implementors ************/
169
170extern void malloc_zone_register(malloc_zone_t *zone);
171 /* Registers a custom malloc zone; Should typically be called after a
172 * malloc_zone_t has been filled in with custom methods by a client. See
173 * malloc_create_zone for creating additional malloc zones with the
174 * default allocation and free behavior. */
175
176extern void malloc_zone_unregister(malloc_zone_t *zone);
177 /* De-registers a zone
178 Should typically be called before calling the zone destruction routine */
179
180extern void malloc_set_zone_name(malloc_zone_t *zone, const char *name);
181 /* Sets the name of a zone */
182
183extern const char *malloc_get_zone_name(malloc_zone_t *zone);
184 /* Returns the name of a zone */
185
186size_t malloc_zone_pressure_relief(malloc_zone_t *zone, size_t goal) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
187 /* malloc_zone_pressure_relief() advises the malloc subsystem that the process is under memory pressure and
188 * that the subsystem should make its best effort towards releasing (i.e. munmap()-ing) "goal" bytes from "zone".
189 * If "goal" is passed as zero, the malloc subsystem will attempt to achieve maximal pressure relief in "zone".
190 * If "zone" is passed as NULL, all zones are examined for pressure relief opportunities.
191 * malloc_zone_pressure_relief() returns the number of bytes released.
192 */
193
194typedef struct {
195 vm_address_t address;
196 vm_size_t size;
197} vm_range_t;
198
199typedef struct malloc_statistics_t {
200 unsigned blocks_in_use;
201 size_t size_in_use;
202 size_t max_size_in_use; /* high water mark of touched memory */
203 size_t size_allocated; /* reserved in memory */
204} malloc_statistics_t;
205
206typedef kern_return_t memory_reader_t(task_t remote_task, vm_address_t remote_address, vm_size_t size, void **local_memory);
207 /* given a task, "reads" the memory at the given address and size
208local_memory: set to a contiguous chunk of memory; validity of local_memory is assumed to be limited (until next call) */
209
210#define MALLOC_PTR_IN_USE_RANGE_TYPE 1 /* for allocated pointers */
211#define MALLOC_PTR_REGION_RANGE_TYPE 2 /* for region containing pointers */
212#define MALLOC_ADMIN_REGION_RANGE_TYPE 4 /* for region used internally */
213#define MALLOC_ZONE_SPECIFIC_FLAGS 0xff00 /* bits reserved for zone-specific purposes */
214
215typedef void vm_range_recorder_t(task_t, void *, unsigned type, vm_range_t *, unsigned);
216 /* given a task and context, "records" the specified addresses */
217
218/* Print function for the print_task() operation. */
219typedef void print_task_printer_t(const char *fmt, ...) __printflike(1,2);
220
221typedef struct malloc_introspection_t {
222 kern_return_t (* MALLOC_INTROSPECT_FN_PTR(enumerator))(task_t task, void *, unsigned type_mask, vm_address_t zone_address, memory_reader_t reader, vm_range_recorder_t recorder); /* enumerates all the malloc pointers in use */
223 size_t (* MALLOC_INTROSPECT_FN_PTR(good_size))(malloc_zone_t *zone, size_t size);
224 boolean_t (* MALLOC_INTROSPECT_FN_PTR(check))(malloc_zone_t *zone); /* Consistency checker */
225 void (* MALLOC_INTROSPECT_FN_PTR(print))(malloc_zone_t *zone, boolean_t verbose); /* Prints zone */
226 void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void *address); /* Enables logging of activity */
227 void (* MALLOC_INTROSPECT_FN_PTR(force_lock))(malloc_zone_t *zone); /* Forces locking zone */
228 void (* MALLOC_INTROSPECT_FN_PTR(force_unlock))(malloc_zone_t *zone); /* Forces unlocking zone */
229 void (* MALLOC_INTROSPECT_FN_PTR(statistics))(malloc_zone_t *zone, malloc_statistics_t *stats); /* Fills statistics */
230 boolean_t (* MALLOC_INTROSPECT_FN_PTR(zone_locked))(malloc_zone_t *zone); /* Are any zone locks held */
231
232 /* Discharge checking. Present in version >= 7. */
233 boolean_t (* MALLOC_INTROSPECT_FN_PTR(enable_discharge_checking))(malloc_zone_t *zone);
234 void (* MALLOC_INTROSPECT_FN_PTR(disable_discharge_checking))(malloc_zone_t *zone);
235 void (* MALLOC_INTROSPECT_FN_PTR(discharge))(malloc_zone_t *zone, void *memory);
236#ifdef __BLOCKS__
237 void (* MALLOC_INTROSPECT_FN_PTR(enumerate_discharged_pointers))(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info));
238 #else
239 void *enumerate_unavailable_without_blocks;
240#endif /* __BLOCKS__ */
241 void (* MALLOC_INTROSPECT_FN_PTR(reinit_lock))(malloc_zone_t *zone); /* Reinitialize zone locks, called only from atfork_child handler. Present in version >= 9. */
242 void (* MALLOC_INTROSPECT_FN_PTR(print_task))(task_t task, unsigned level, vm_address_t zone_address, memory_reader_t reader, print_task_printer_t printer); /* debug print for another process. Present in version >= 11. */
243 void (* MALLOC_INTROSPECT_FN_PTR(task_statistics))(task_t task, vm_address_t zone_address, memory_reader_t reader, malloc_statistics_t *stats); /* Present in version >= 12 */
244} malloc_introspection_t;
245
246// The value of "level" when passed to print_task() that corresponds to
247// verbose passed to print()
248#define MALLOC_VERBOSE_PRINT_LEVEL 2
249
250extern void malloc_printf(const char *format, ...);
251 /* Convenience for logging errors and warnings;
252 No allocation is performed during execution of this function;
253 Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)
254 */
255
256/********* Functions for performance tools ************/
257
258extern kern_return_t malloc_get_all_zones(task_t task, memory_reader_t reader, vm_address_t **addresses, unsigned *count);
259 /* Fills addresses and count with the addresses of the zones in task;
260 Note that the validity of the addresses returned correspond to the validity of the memory returned by reader */
261
262/********* Debug helpers ************/
263
264extern void malloc_zone_print_ptr_info(void *ptr);
265 /* print to stdout if this pointer is in the malloc heap, free status, and size */
266
267extern boolean_t malloc_zone_check(malloc_zone_t *zone);
268 /* Checks zone is well formed; if !zone, checks all zones */
269
270extern void malloc_zone_print(malloc_zone_t *zone, boolean_t verbose);
271 /* Prints summary on zone; if !zone, prints all zones */
272
273extern void malloc_zone_statistics(malloc_zone_t *zone, malloc_statistics_t *stats);
274 /* Fills statistics for zone; if !zone, sums up all zones */
275
276extern void malloc_zone_log(malloc_zone_t *zone, void *address);
277 /* Controls logging of all activity; if !zone, for all zones;
278 If address==0 nothing is logged;
279 If address==-1 all activity is logged;
280 Else only the activity regarding address is logged */
281
282struct mstats {
283 size_t bytes_total;
284 size_t chunks_used;
285 size_t bytes_used;
286 size_t chunks_free;
287 size_t bytes_free;
288};
289
290extern struct mstats mstats(void);
291
292extern boolean_t malloc_zone_enable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
293/* Increment the discharge checking enabled counter for a zone. Returns true if the zone supports checking, false if it does not. */
294
295extern void malloc_zone_disable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
296/* Decrement the discharge checking enabled counter for a zone. */
297
298extern void malloc_zone_discharge(malloc_zone_t *zone, void *memory) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
299/* Register memory that the programmer expects to be freed soon.
300 zone may be NULL in which case the zone is determined using malloc_zone_from_ptr().
301 If discharge checking is off for the zone this function is a no-op. */
302
303#ifdef __BLOCKS__
304extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info)) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
305/* Calls report_discharged for each block that was registered using malloc_zone_discharge() but has not yet been freed.
306 info is used to provide zone defined information about the memory block.
307 If zone is NULL then the enumeration covers all zones. */
308#else
309extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
310#endif /* __BLOCKS__ */
311
312__END_DECLS
313
314#endif /* _MALLOC_MALLOC_H_ */
lib/libc/include/aarch64-macos-gnu/math.h created+775
......@@ -0,0 +1,775 @@
1/*
2 * Copyright (c) 2002-2017 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 __MATH_H__
24#define __MATH_H__
25
26#ifndef __MATH__
27#define __MATH__
28#endif
29
30#include <sys/cdefs.h>
31#include <Availability.h>
32
33__BEGIN_DECLS
34
35/******************************************************************************
36 * Floating point data types *
37 ******************************************************************************/
38
39/* Define float_t and double_t per C standard, ISO/IEC 9899:2011 7.12 2,
40 taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may
41 define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a
42 compiler must define only in float.h). */
43#if __FLT_EVAL_METHOD__ == 0
44 typedef float float_t;
45 typedef double double_t;
46#elif __FLT_EVAL_METHOD__ == 1
47 typedef double float_t;
48 typedef double double_t;
49#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
50 typedef long double float_t;
51 typedef long double double_t;
52#else /* __FLT_EVAL_METHOD__ */
53# error "Unsupported value of __FLT_EVAL_METHOD__."
54#endif /* __FLT_EVAL_METHOD__ */
55
56#if defined(__GNUC__)
57# define HUGE_VAL __builtin_huge_val()
58# define HUGE_VALF __builtin_huge_valf()
59# define HUGE_VALL __builtin_huge_vall()
60# define NAN __builtin_nanf("0x7fc00000")
61#else
62# define HUGE_VAL 1e500
63# define HUGE_VALF 1e50f
64# define HUGE_VALL 1e5000L
65# define NAN __nan()
66#endif
67
68#define INFINITY HUGE_VALF
69
70/******************************************************************************
71 * Taxonomy of floating point data types *
72 ******************************************************************************/
73
74#define FP_NAN 1
75#define FP_INFINITE 2
76#define FP_ZERO 3
77#define FP_NORMAL 4
78#define FP_SUBNORMAL 5
79#define FP_SUPERNORMAL 6 /* legacy PowerPC support; this is otherwise unused */
80
81#if defined __arm64__ || defined __ARM_VFPV4__
82/* On these architectures, fma(), fmaf( ), and fmal( ) are generally about as
83 fast as (or faster than) separate multiply and add of the same operands. */
84# define FP_FAST_FMA 1
85# define FP_FAST_FMAF 1
86# define FP_FAST_FMAL 1
87#elif (defined __i386__ || defined __x86_64__) && (defined __FMA__ || defined __AVX512F__)
88/* When targeting the FMA ISA extension, fma() and fmaf( ) are generally
89 about as fast as (or faster than) separate multiply and add of the same
90 operands, but fmal( ) may be more costly. */
91# define FP_FAST_FMA 1
92# define FP_FAST_FMAF 1
93# undef FP_FAST_FMAL
94#else
95/* On these architectures, fma( ), fmaf( ), and fmal( ) function calls are
96 significantly more costly than separate multiply and add operations. */
97# undef FP_FAST_FMA
98# undef FP_FAST_FMAF
99# undef FP_FAST_FMAL
100#endif
101
102/* The values returned by `ilogb' for 0 and NaN respectively. */
103#define FP_ILOGB0 (-2147483647 - 1)
104#define FP_ILOGBNAN (-2147483647 - 1)
105
106/* Bitmasks for the math_errhandling macro. */
107#define MATH_ERRNO 1 /* errno set by math functions. */
108#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */
109
110#define math_errhandling (__math_errhandling())
111extern int __math_errhandling(void);
112
113/******************************************************************************
114 * *
115 * Inquiry macros *
116 * *
117 * fpclassify Returns one of the FP_* values. *
118 * isnormal Non-zero if and only if the argument x is normalized. *
119 * isfinite Non-zero if and only if the argument x is finite. *
120 * isnan Non-zero if and only if the argument x is a NaN. *
121 * signbit Non-zero if and only if the sign of the argument x is *
122 * negative. This includes, NaNs, infinities and zeros. *
123 * *
124 ******************************************************************************/
125
126#define fpclassify(x) \
127 ( sizeof(x) == sizeof(float) ? __fpclassifyf((float)(x)) \
128 : sizeof(x) == sizeof(double) ? __fpclassifyd((double)(x)) \
129 : __fpclassifyl((long double)(x)))
130
131extern int __fpclassifyf(float);
132extern int __fpclassifyd(double);
133extern int __fpclassifyl(long double);
134
135#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__)
136/* These inline functions may fail to return expected results if unsafe
137 math optimizations like those enabled by -ffast-math are turned on.
138 Thus, (somewhat surprisingly) you only get the fast inline
139 implementations if such compiler options are NOT enabled. This is
140 because the inline functions require the compiler to be adhering to
141 the standard in order to work properly; -ffast-math, among other
142 things, implies that NaNs don't happen, which allows the compiler to
143 optimize away checks like x != x, which might lead to things like
144 isnan(NaN) returning false.
145
146 Thus, if you compile with -ffast-math, actual function calls are
147 generated for these utilities. */
148
149#define isnormal(x) \
150 ( sizeof(x) == sizeof(float) ? __inline_isnormalf((float)(x)) \
151 : sizeof(x) == sizeof(double) ? __inline_isnormald((double)(x)) \
152 : __inline_isnormall((long double)(x)))
153
154#define isfinite(x) \
155 ( sizeof(x) == sizeof(float) ? __inline_isfinitef((float)(x)) \
156 : sizeof(x) == sizeof(double) ? __inline_isfinited((double)(x)) \
157 : __inline_isfinitel((long double)(x)))
158
159#define isinf(x) \
160 ( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
161 : sizeof(x) == sizeof(double) ? __inline_isinfd((double)(x)) \
162 : __inline_isinfl((long double)(x)))
163
164#define isnan(x) \
165 ( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
166 : sizeof(x) == sizeof(double) ? __inline_isnand((double)(x)) \
167 : __inline_isnanl((long double)(x)))
168
169#define signbit(x) \
170 ( sizeof(x) == sizeof(float) ? __inline_signbitf((float)(x)) \
171 : sizeof(x) == sizeof(double) ? __inline_signbitd((double)(x)) \
172 : __inline_signbitl((long double)(x)))
173
174__header_always_inline int __inline_isfinitef(float);
175__header_always_inline int __inline_isfinited(double);
176__header_always_inline int __inline_isfinitel(long double);
177__header_always_inline int __inline_isinff(float);
178__header_always_inline int __inline_isinfd(double);
179__header_always_inline int __inline_isinfl(long double);
180__header_always_inline int __inline_isnanf(float);
181__header_always_inline int __inline_isnand(double);
182__header_always_inline int __inline_isnanl(long double);
183__header_always_inline int __inline_isnormalf(float);
184__header_always_inline int __inline_isnormald(double);
185__header_always_inline int __inline_isnormall(long double);
186__header_always_inline int __inline_signbitf(float);
187__header_always_inline int __inline_signbitd(double);
188__header_always_inline int __inline_signbitl(long double);
189
190__header_always_inline int __inline_isfinitef(float __x) {
191 return __x == __x && __builtin_fabsf(__x) != __builtin_inff();
192}
193__header_always_inline int __inline_isfinited(double __x) {
194 return __x == __x && __builtin_fabs(__x) != __builtin_inf();
195}
196__header_always_inline int __inline_isfinitel(long double __x) {
197 return __x == __x && __builtin_fabsl(__x) != __builtin_infl();
198}
199__header_always_inline int __inline_isinff(float __x) {
200 return __builtin_fabsf(__x) == __builtin_inff();
201}
202__header_always_inline int __inline_isinfd(double __x) {
203 return __builtin_fabs(__x) == __builtin_inf();
204}
205__header_always_inline int __inline_isinfl(long double __x) {
206 return __builtin_fabsl(__x) == __builtin_infl();
207}
208__header_always_inline int __inline_isnanf(float __x) {
209 return __x != __x;
210}
211__header_always_inline int __inline_isnand(double __x) {
212 return __x != __x;
213}
214__header_always_inline int __inline_isnanl(long double __x) {
215 return __x != __x;
216}
217__header_always_inline int __inline_signbitf(float __x) {
218 union { float __f; unsigned int __u; } __u;
219 __u.__f = __x;
220 return (int)(__u.__u >> 31);
221}
222__header_always_inline int __inline_signbitd(double __x) {
223 union { double __f; unsigned long long __u; } __u;
224 __u.__f = __x;
225 return (int)(__u.__u >> 63);
226}
227#if defined __i386__ || defined __x86_64__
228__header_always_inline int __inline_signbitl(long double __x) {
229 union {
230 long double __ld;
231 struct{ unsigned long long __m; unsigned short __sexp; } __p;
232 } __u;
233 __u.__ld = __x;
234 return (int)(__u.__p.__sexp >> 15);
235}
236#else
237__header_always_inline int __inline_signbitl(long double __x) {
238 union { long double __f; unsigned long long __u;} __u;
239 __u.__f = __x;
240 return (int)(__u.__u >> 63);
241}
242#endif
243__header_always_inline int __inline_isnormalf(float __x) {
244 return __inline_isfinitef(__x) && __builtin_fabsf(__x) >= __FLT_MIN__;
245}
246__header_always_inline int __inline_isnormald(double __x) {
247 return __inline_isfinited(__x) && __builtin_fabs(__x) >= __DBL_MIN__;
248}
249__header_always_inline int __inline_isnormall(long double __x) {
250 return __inline_isfinitel(__x) && __builtin_fabsl(__x) >= __LDBL_MIN__;
251}
252
253#else /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
254
255/* Implementations making function calls to fall back on when -ffast-math
256 or similar is specified. These are not available in iOS versions prior
257 to 6.0. If you need them, you must target that version or later. */
258
259#define isnormal(x) \
260 ( sizeof(x) == sizeof(float) ? __isnormalf((float)(x)) \
261 : sizeof(x) == sizeof(double) ? __isnormald((double)(x)) \
262 : __isnormall((long double)(x)))
263
264#define isfinite(x) \
265 ( sizeof(x) == sizeof(float) ? __isfinitef((float)(x)) \
266 : sizeof(x) == sizeof(double) ? __isfinited((double)(x)) \
267 : __isfinitel((long double)(x)))
268
269#define isinf(x) \
270 ( sizeof(x) == sizeof(float) ? __isinff((float)(x)) \
271 : sizeof(x) == sizeof(double) ? __isinfd((double)(x)) \
272 : __isinfl((long double)(x)))
273
274#define isnan(x) \
275 ( sizeof(x) == sizeof(float) ? __isnanf((float)(x)) \
276 : sizeof(x) == sizeof(double) ? __isnand((double)(x)) \
277 : __isnanl((long double)(x)))
278
279#define signbit(x) \
280 ( sizeof(x) == sizeof(float) ? __signbitf((float)(x)) \
281 : sizeof(x) == sizeof(double) ? __signbitd((double)(x)) \
282 : __signbitl((long double)(x)))
283
284extern int __isnormalf(float);
285extern int __isnormald(double);
286extern int __isnormall(long double);
287extern int __isfinitef(float);
288extern int __isfinited(double);
289extern int __isfinitel(long double);
290extern int __isinff(float);
291extern int __isinfd(double);
292extern int __isinfl(long double);
293extern int __isnanf(float);
294extern int __isnand(double);
295extern int __isnanl(long double);
296extern int __signbitf(float);
297extern int __signbitd(double);
298extern int __signbitl(long double);
299
300#endif /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
301
302/******************************************************************************
303 * *
304 * Math Functions *
305 * *
306 ******************************************************************************/
307
308extern float acosf(float);
309extern double acos(double);
310extern long double acosl(long double);
311
312extern float asinf(float);
313extern double asin(double);
314extern long double asinl(long double);
315
316extern float atanf(float);
317extern double atan(double);
318extern long double atanl(long double);
319
320extern float atan2f(float, float);
321extern double atan2(double, double);
322extern long double atan2l(long double, long double);
323
324extern float cosf(float);
325extern double cos(double);
326extern long double cosl(long double);
327
328extern float sinf(float);
329extern double sin(double);
330extern long double sinl(long double);
331
332extern float tanf(float);
333extern double tan(double);
334extern long double tanl(long double);
335
336extern float acoshf(float);
337extern double acosh(double);
338extern long double acoshl(long double);
339
340extern float asinhf(float);
341extern double asinh(double);
342extern long double asinhl(long double);
343
344extern float atanhf(float);
345extern double atanh(double);
346extern long double atanhl(long double);
347
348extern float coshf(float);
349extern double cosh(double);
350extern long double coshl(long double);
351
352extern float sinhf(float);
353extern double sinh(double);
354extern long double sinhl(long double);
355
356extern float tanhf(float);
357extern double tanh(double);
358extern long double tanhl(long double);
359
360extern float expf(float);
361extern double exp(double);
362extern long double expl(long double);
363
364extern float exp2f(float);
365extern double exp2(double);
366extern long double exp2l(long double);
367
368extern float expm1f(float);
369extern double expm1(double);
370extern long double expm1l(long double);
371
372extern float logf(float);
373extern double log(double);
374extern long double logl(long double);
375
376extern float log10f(float);
377extern double log10(double);
378extern long double log10l(long double);
379
380extern float log2f(float);
381extern double log2(double);
382extern long double log2l(long double);
383
384extern float log1pf(float);
385extern double log1p(double);
386extern long double log1pl(long double);
387
388extern float logbf(float);
389extern double logb(double);
390extern long double logbl(long double);
391
392extern float modff(float, float *);
393extern double modf(double, double *);
394extern long double modfl(long double, long double *);
395
396extern float ldexpf(float, int);
397extern double ldexp(double, int);
398extern long double ldexpl(long double, int);
399
400extern float frexpf(float, int *);
401extern double frexp(double, int *);
402extern long double frexpl(long double, int *);
403
404extern int ilogbf(float);
405extern int ilogb(double);
406extern int ilogbl(long double);
407
408extern float scalbnf(float, int);
409extern double scalbn(double, int);
410extern long double scalbnl(long double, int);
411
412extern float scalblnf(float, long int);
413extern double scalbln(double, long int);
414extern long double scalblnl(long double, long int);
415
416extern float fabsf(float);
417extern double fabs(double);
418extern long double fabsl(long double);
419
420extern float cbrtf(float);
421extern double cbrt(double);
422extern long double cbrtl(long double);
423
424extern float hypotf(float, float);
425extern double hypot(double, double);
426extern long double hypotl(long double, long double);
427
428extern float powf(float, float);
429extern double pow(double, double);
430extern long double powl(long double, long double);
431
432extern float sqrtf(float);
433extern double sqrt(double);
434extern long double sqrtl(long double);
435
436extern float erff(float);
437extern double erf(double);
438extern long double erfl(long double);
439
440extern float erfcf(float);
441extern double erfc(double);
442extern long double erfcl(long double);
443
444/* lgammaf, lgamma, and lgammal are not thread-safe. The thread-safe
445 variants lgammaf_r, lgamma_r, and lgammal_r are made available if
446 you define the _REENTRANT symbol before including <math.h> */
447extern float lgammaf(float);
448extern double lgamma(double);
449extern long double lgammal(long double);
450
451extern float tgammaf(float);
452extern double tgamma(double);
453extern long double tgammal(long double);
454
455extern float ceilf(float);
456extern double ceil(double);
457extern long double ceill(long double);
458
459extern float floorf(float);
460extern double floor(double);
461extern long double floorl(long double);
462
463extern float nearbyintf(float);
464extern double nearbyint(double);
465extern long double nearbyintl(long double);
466
467extern float rintf(float);
468extern double rint(double);
469extern long double rintl(long double);
470
471extern long int lrintf(float);
472extern long int lrint(double);
473extern long int lrintl(long double);
474
475extern float roundf(float);
476extern double round(double);
477extern long double roundl(long double);
478
479extern long int lroundf(float);
480extern long int lround(double);
481extern long int lroundl(long double);
482
483/* long long is not part of C90. Make sure you are passing -std=c99 or
484 -std=gnu99 or higher if you need these functions returning long longs */
485#if !(__DARWIN_NO_LONG_LONG)
486extern long long int llrintf(float);
487extern long long int llrint(double);
488extern long long int llrintl(long double);
489
490extern long long int llroundf(float);
491extern long long int llround(double);
492extern long long int llroundl(long double);
493#endif /* !(__DARWIN_NO_LONG_LONG) */
494
495extern float truncf(float);
496extern double trunc(double);
497extern long double truncl(long double);
498
499extern float fmodf(float, float);
500extern double fmod(double, double);
501extern long double fmodl(long double, long double);
502
503extern float remainderf(float, float);
504extern double remainder(double, double);
505extern long double remainderl(long double, long double);
506
507extern float remquof(float, float, int *);
508extern double remquo(double, double, int *);
509extern long double remquol(long double, long double, int *);
510
511extern float copysignf(float, float);
512extern double copysign(double, double);
513extern long double copysignl(long double, long double);
514
515extern float nanf(const char *);
516extern double nan(const char *);
517extern long double nanl(const char *);
518
519extern float nextafterf(float, float);
520extern double nextafter(double, double);
521extern long double nextafterl(long double, long double);
522
523extern double nexttoward(double, long double);
524extern float nexttowardf(float, long double);
525extern long double nexttowardl(long double, long double);
526
527extern float fdimf(float, float);
528extern double fdim(double, double);
529extern long double fdiml(long double, long double);
530
531extern float fmaxf(float, float);
532extern double fmax(double, double);
533extern long double fmaxl(long double, long double);
534
535extern float fminf(float, float);
536extern double fmin(double, double);
537extern long double fminl(long double, long double);
538
539extern float fmaf(float, float, float);
540extern double fma(double, double, double);
541extern long double fmal(long double, long double, long double);
542
543#define isgreater(x, y) __builtin_isgreater((x),(y))
544#define isgreaterequal(x, y) __builtin_isgreaterequal((x),(y))
545#define isless(x, y) __builtin_isless((x),(y))
546#define islessequal(x, y) __builtin_islessequal((x),(y))
547#define islessgreater(x, y) __builtin_islessgreater((x),(y))
548#define isunordered(x, y) __builtin_isunordered((x),(y))
549
550#if defined __i386__ || defined __x86_64__
551/* Deprecated functions; use the INFINITY and NAN macros instead. */
552extern float __inff(void)
553__API_DEPRECATED("use `(float)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
554extern double __inf(void)
555__API_DEPRECATED("use `INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
556extern long double __infl(void)
557__API_DEPRECATED("use `(long double)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
558extern float __nan(void)
559__API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios, watchos, tvos);
560#endif
561
562/******************************************************************************
563 * Reentrant variants of lgamma[fl] *
564 ******************************************************************************/
565
566#ifdef _REENTRANT
567/* Reentrant variants of the lgamma[fl] functions. */
568extern float lgammaf_r(float, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
569extern double lgamma_r(double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
570extern long double lgammal_r(long double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
571#endif /* _REENTRANT */
572
573/******************************************************************************
574 * Apple extensions to the C standard *
575 ******************************************************************************/
576
577/* Because these functions are not specified by any relevant standard, they
578 are prefixed with __, which places them in the implementor's namespace, so
579 they should not conflict with any developer or third-party code. If they
580 are added to a relevant standard in the future, un-prefixed names may be
581 added to the library and they may be moved out of this section of the
582 header.
583
584 Because these functions are non-standard, they may not be available on non-
585 Apple platforms. */
586
587/* __exp10(x) returns 10**x. Edge cases match those of exp( ) and exp2( ). */
588extern float __exp10f(float) __API_AVAILABLE(macos(10.9), ios(7.0));
589extern double __exp10(double) __API_AVAILABLE(macos(10.9), ios(7.0));
590
591/* __sincos(x,sinp,cosp) computes the sine and cosine of x with a single
592 function call, storing the sine in the memory pointed to by sinp, and
593 the cosine in the memory pointed to by cosp. Edge cases match those of
594 separate calls to sin( ) and cos( ). */
595__header_always_inline void __sincosf(float __x, float *__sinp, float *__cosp);
596__header_always_inline void __sincos(double __x, double *__sinp, double *__cosp);
597
598/* __sinpi(x) returns the sine of pi times x; __cospi(x) and __tanpi(x) return
599 the cosine and tangent, respectively. These functions can produce a more
600 accurate answer than expressions of the form sin(M_PI * x) because they
601 avoid any loss of precision that results from rounding the result of the
602 multiplication M_PI * x. They may also be significantly more efficient in
603 some cases because the argument reduction for these functions is easier
604 to compute. Consult the man pages for edge case details. */
605extern float __cospif(float) __API_AVAILABLE(macos(10.9), ios(7.0));
606extern double __cospi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
607extern float __sinpif(float) __API_AVAILABLE(macos(10.9), ios(7.0));
608extern double __sinpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
609extern float __tanpif(float) __API_AVAILABLE(macos(10.9), ios(7.0));
610extern double __tanpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
611
612#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || \
613 (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)
614/* __sincos and __sincosf were introduced in OSX 10.9 and iOS 7.0. When
615 targeting an older system, we simply split them up into discrete calls
616 to sin( ) and cos( ). */
617__header_always_inline void __sincosf(float __x, float *__sinp, float *__cosp) {
618 *__sinp = sinf(__x);
619 *__cosp = cosf(__x);
620}
621
622__header_always_inline void __sincos(double __x, double *__sinp, double *__cosp) {
623 *__sinp = sin(__x);
624 *__cosp = cos(__x);
625}
626#else
627/* __sincospi(x,sinp,cosp) computes the sine and cosine of pi times x with a
628 single function call, storing the sine in the memory pointed to by sinp,
629 and the cosine in the memory pointed to by cosp. Edge cases match those
630 of separate calls to __sinpi( ) and __cospi( ), and are documented in the
631 man pages.
632
633 These functions were introduced in OSX 10.9 and iOS 7.0. Because they are
634 implemented as header inlines, weak-linking does not function as normal,
635 and they are simply hidden when targeting earlier OS versions. */
636__header_always_inline void __sincospif(float __x, float *__sinp, float *__cosp);
637__header_always_inline void __sincospi(double __x, double *__sinp, double *__cosp);
638
639/* Implementation details of __sincos and __sincospi allowing them to return
640 two results while allowing the compiler to optimize away unnecessary load-
641 store traffic. Although these interfaces are exposed in the math.h header
642 to allow compilers to generate better code, users should call __sincos[f]
643 and __sincospi[f] instead and allow the compiler to emit these calls. */
644struct __float2 { float __sinval; float __cosval; };
645struct __double2 { double __sinval; double __cosval; };
646
647extern struct __float2 __sincosf_stret(float);
648extern struct __double2 __sincos_stret(double);
649extern struct __float2 __sincospif_stret(float);
650extern struct __double2 __sincospi_stret(double);
651
652__header_always_inline void __sincosf(float __x, float *__sinp, float *__cosp) {
653 const struct __float2 __stret = __sincosf_stret(__x);
654 *__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
655}
656
657__header_always_inline void __sincos(double __x, double *__sinp, double *__cosp) {
658 const struct __double2 __stret = __sincos_stret(__x);
659 *__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
660}
661
662__header_always_inline void __sincospif(float __x, float *__sinp, float *__cosp) {
663 const struct __float2 __stret = __sincospif_stret(__x);
664 *__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
665}
666
667__header_always_inline void __sincospi(double __x, double *__sinp, double *__cosp) {
668 const struct __double2 __stret = __sincospi_stret(__x);
669 *__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
670}
671#endif
672
673/******************************************************************************
674 * POSIX/UNIX extensions to the C standard *
675 ******************************************************************************/
676
677#if __DARWIN_C_LEVEL >= 199506L
678extern double j0(double) __API_AVAILABLE(macos(10.0), ios(3.2));
679extern double j1(double) __API_AVAILABLE(macos(10.0), ios(3.2));
680extern double jn(int, double) __API_AVAILABLE(macos(10.0), ios(3.2));
681extern double y0(double) __API_AVAILABLE(macos(10.0), ios(3.2));
682extern double y1(double) __API_AVAILABLE(macos(10.0), ios(3.2));
683extern double yn(int, double) __API_AVAILABLE(macos(10.0), ios(3.2));
684extern double scalb(double, double);
685extern int signgam;
686
687/* Even though these might be more useful as long doubles, POSIX requires
688 that they be double-precision literals. */
689#define M_E 2.71828182845904523536028747135266250 /* e */
690#define M_LOG2E 1.44269504088896340735992468100189214 /* log2(e) */
691#define M_LOG10E 0.434294481903251827651128918916605082 /* log10(e) */
692#define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */
693#define M_LN10 2.30258509299404568401799145468436421 /* loge(10) */
694#define M_PI 3.14159265358979323846264338327950288 /* pi */
695#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */
696#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */
697#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */
698#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */
699#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */
700#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */
701#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
702
703#define MAXFLOAT 0x1.fffffep+127f
704#endif /* __DARWIN_C_LEVEL >= 199506L */
705
706/* Long-double versions of M_E, etc for convenience on Intel where long-
707 double is not the same as double. Define __MATH_LONG_DOUBLE_CONSTANTS
708 to make these constants available. */
709#if defined __MATH_LONG_DOUBLE_CONSTANTS
710#define M_El 0xa.df85458a2bb4a9bp-2L
711#define M_LOG2El 0xb.8aa3b295c17f0bcp-3L
712#define M_LOG10El 0xd.e5bd8a937287195p-5L
713#define M_LN2l 0xb.17217f7d1cf79acp-4L
714#define M_LN10l 0x9.35d8dddaaa8ac17p-2L
715#define M_PIl 0xc.90fdaa22168c235p-2L
716#define M_PI_2l 0xc.90fdaa22168c235p-3L
717#define M_PI_4l 0xc.90fdaa22168c235p-4L
718#define M_1_PIl 0xa.2f9836e4e44152ap-5L
719#define M_2_PIl 0xa.2f9836e4e44152ap-4L
720#define M_2_SQRTPIl 0x9.06eba8214db688dp-3L
721#define M_SQRT2l 0xb.504f333f9de6484p-3L
722#define M_SQRT1_2l 0xb.504f333f9de6484p-4L
723#endif /* defined __MATH_LONG_DOUBLE_CONSTANTS */
724
725/******************************************************************************
726 * Legacy BSD extensions to the C standard *
727 ******************************************************************************/
728
729#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
730#define FP_SNAN FP_NAN
731#define FP_QNAN FP_NAN
732#define HUGE MAXFLOAT
733#define X_TLOSS 1.41484755040568800000e+16
734#define DOMAIN 1
735#define SING 2
736#define OVERFLOW 3
737#define UNDERFLOW 4
738#define TLOSS 5
739#define PLOSS 6
740
741#if defined __i386__ || defined __x86_64__
742/* Legacy BSD API; use the C99 `lrint( )` function instead. */
743extern long int rinttol(double)
744__API_DEPRECATED_WITH_REPLACEMENT("lrint", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
745/* Legacy BSD API; use the C99 `lround( )` function instead. */
746extern long int roundtol(double)
747__API_DEPRECATED_WITH_REPLACEMENT("lround", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
748/* Legacy BSD API; use the C99 `remainder( )` function instead. */
749extern double drem(double, double)
750__API_DEPRECATED_WITH_REPLACEMENT("remainder", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
751/* Legacy BSD API; use the C99 `isfinite( )` macro instead. */
752extern int finite(double)
753__API_DEPRECATED("Use `isfinite((double)x)` instead.", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
754/* Legacy BSD API; use the C99 `tgamma( )` function instead. */
755extern double gamma(double)
756__API_DEPRECATED_WITH_REPLACEMENT("tgamma", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
757/* Legacy BSD API; use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead. */
758extern double significand(double)
759__API_DEPRECATED("Use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead.", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos);
760#endif
761
762#if !defined __cplusplus
763struct exception {
764 int type;
765 char *name;
766 double arg1;
767 double arg2;
768 double retval;
769};
770
771#endif /* !defined __cplusplus */
772#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
773
774__END_DECLS
775#endif /* __MATH_H__ */
lib/libc/include/aarch64-macos-gnu/memory.h created+36
......@@ -0,0 +1,36 @@
1/*
2 * Copyright (c) 1988, 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 * @(#)memory.h 8.1 (Berkeley) 6/2/93
34 */
35
36#include <string.h>
lib/libc/include/aarch64-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
38ssize_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/aarch64-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
86typedef struct {
87 void *dptr;
88 size_t dsize;
89} datum;
90
91#ifndef _DBM
92#define _DBM
93typedef 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
103int dbm_clearerr( DBM *);
104void dbm_close(DBM *);
105int dbm_delete(DBM *, datum);
106#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
107int dbm_dirfno(DBM *);
108#endif
109int dbm_error( DBM *);
110datum dbm_fetch(DBM *, datum);
111datum dbm_firstkey(DBM *);
112#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
113long dbm_forder(DBM *, datum);
114#endif
115datum dbm_nextkey(DBM *);
116DBM *dbm_open(const char *, int, mode_t);
117int dbm_store(DBM *, datum, datum, int);
118__END_DECLS
119
120#endif /* !_NDBM_H_ */
lib/libc/include/aarch64-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
81struct 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 */
159struct 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 */
173struct 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 */
187struct 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 */
200struct 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 */
218struct 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 */
233struct 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
266struct 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 */
287struct 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
347struct 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
354struct rslvmulti_req {
355 struct sockaddr *sa;
356 struct sockaddr **llsa;
357};
358
359#pragma pack(4)
360
361struct 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)
376struct 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 */
393struct 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)
405struct 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 */
420struct 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
429struct if_nameindex {
430 unsigned int if_index; /* 1, 2, ... */
431 char *if_name; /* null terminated name: "le0", ... */
432};
433
434__BEGIN_DECLS
435unsigned int if_nametoindex(const char *);
436char *if_indextoname(unsigned int, char *);
437struct if_nameindex *if_nameindex(void);
438void if_freenameindex(struct if_nameindex *);
439__END_DECLS
440
441
442#endif /* !_NET_IF_H_ */
lib/libc/include/aarch64-macos-gnu/net/if_dl.h created+121
......@@ -0,0 +1,121 @@
1/*
2 * Copyright (c) 2000-2011 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 *
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_dl.h 8.1 (Berkeley) 6/10/93
61 * $FreeBSD: src/sys/net/if_dl.h,v 1.10 2000/03/01 02:46:25 archie Exp $
62 */
63
64#ifndef _NET_IF_DL_H_
65#define _NET_IF_DL_H_
66#include <sys/appleapiopts.h>
67
68#include <sys/types.h>
69
70
71/*
72 * A Link-Level Sockaddr may specify the interface in one of two
73 * ways: either by means of a system-provided index number (computed
74 * anew and possibly differently on every reboot), or by a human-readable
75 * string such as "il0" (for managerial convenience).
76 *
77 * Census taking actions, such as something akin to SIOCGCONF would return
78 * both the index and the human name.
79 *
80 * High volume transactions (such as giving a link-level ``from'' address
81 * in a recvfrom or recvmsg call) may be likely only to provide the indexed
82 * form, (which requires fewer copy operations and less space).
83 *
84 * The form and interpretation of the link-level address is purely a matter
85 * of convention between the device driver and its consumers; however, it is
86 * expected that all drivers for an interface of a given if_type will agree.
87 */
88
89/*
90 * Structure of a Link-Level sockaddr:
91 */
92struct sockaddr_dl {
93 u_char sdl_len; /* Total length of sockaddr */
94 u_char sdl_family; /* AF_LINK */
95 u_short sdl_index; /* if != 0, system given index for interface */
96 u_char sdl_type; /* interface type */
97 u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
98 u_char sdl_alen; /* link level address length */
99 u_char sdl_slen; /* link layer selector length */
100 char sdl_data[12]; /* minimum work area, can be larger;
101 * contains both if name and ll address */
102#ifndef __APPLE__
103 /* For TokenRing */
104 u_short sdl_rcf; /* source routing control */
105 u_short sdl_route[16]; /* source routing information */
106#endif
107};
108
109#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
110
111
112
113#include <sys/cdefs.h>
114
115__BEGIN_DECLS
116void link_addr(const char *, struct sockaddr_dl *);
117char *link_ntoa(const struct sockaddr_dl *);
118__END_DECLS
119
120
121#endif
lib/libc/include/aarch64-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
137struct 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 */
156struct 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 */
194struct 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 */
230struct 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/aarch64-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/aarch64-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
101extern 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 */
112struct 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 */
127struct 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
134struct 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
141struct protoent {
142 char *p_name; /* official protocol name */
143 char **p_aliases; /* alias list */
144 int p_proto; /* protocol # */
145};
146
147struct 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)
159struct 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
264void endhostent(void);
265void endnetent(void);
266void endprotoent(void);
267void endservent(void);
268
269void freeaddrinfo(struct addrinfo *);
270const char *gai_strerror(int);
271int getaddrinfo(const char * __restrict, const char * __restrict,
272 const struct addrinfo * __restrict,
273 struct addrinfo ** __restrict);
274struct hostent *gethostbyaddr(const void *, socklen_t, int);
275struct hostent *gethostbyname(const char *);
276struct hostent *gethostent(void);
277int getnameinfo(const struct sockaddr * __restrict, socklen_t,
278 char * __restrict, socklen_t, char * __restrict,
279 socklen_t, int);
280struct netent *getnetbyaddr(uint32_t, int);
281struct netent *getnetbyname(const char *);
282struct netent *getnetent(void);
283struct protoent *getprotobyname(const char *);
284struct protoent *getprotobynumber(int);
285struct protoent *getprotoent(void);
286struct servent *getservbyname(const char *, const char *);
287struct servent *getservbyport(int, const char *);
288struct servent *getservent(void);
289void sethostent(int);
290/* void sethostfile(const char *); */
291void setnetent(int);
292void setprotoent(int);
293void setservent(int);
294
295#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
296void freehostent(struct hostent *);
297struct hostent *gethostbyname2(const char *, int);
298struct hostent *getipnodebyaddr(const void *, size_t, int, int *);
299struct hostent *getipnodebyname(const char *, int, int, int *);
300struct rpcent *getrpcbyname(const char *name);
301#ifdef __LP64__
302struct rpcent *getrpcbynumber(int number);
303#else
304struct rpcent *getrpcbynumber(long number);
305#endif
306struct rpcent *getrpcent(void);
307void setrpcent(int stayopen);
308void endrpcent(void);
309void herror(const char *);
310const char *hstrerror(int);
311int innetgr(const char *, const char *, const char *, const char *);
312int getnetgrent(char **, char **, char **);
313void endnetgrent(void);
314void setnetgrent(const char *);
315#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
316
317__END_DECLS
318
319#endif /* !_NETDB_H_ */
lib/libc/include/aarch64-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 */
301struct 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 */
375struct 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 */
398struct 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 */
507struct 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 */
517struct 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 */
527struct 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 */
537struct group_req {
538 uint32_t gr_interface; /* interface index */
539 struct sockaddr_storage gr_group; /* group address */
540};
541
542struct 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 */
555struct __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()
567struct 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 */
574int 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);
576int 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);
578int 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);
580int 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 */
618struct 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
667int bindresvport(int, struct sockaddr_in *);
668struct sockaddr;
669int bindresvport_sa(int, struct sockaddr *);
670__END_DECLS
671#endif
672#endif /* _NETINET_IN_H_ */
lib/libc/include/aarch64-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)
74typedef __uint32_t tcp_seq;
75typedef __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 */
84struct 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
235struct 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/aarch64-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 */
152typedef 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) */
170struct 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
214extern const struct in6_addr in6addr_any;
215extern const struct in6_addr in6addr_loopback;
216#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
217extern const struct in6_addr in6addr_nodelocal_allnodes;
218extern const struct in6_addr in6addr_linklocal_allnodes;
219extern const struct in6_addr in6addr_linklocal_allrouters;
220extern 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 */
541struct 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 */
549struct 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 */
557struct 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
640struct cmsghdr;
641
642extern int inet6_option_space(int);
643extern int inet6_option_init(void *, struct cmsghdr **, int);
644extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, int, int);
645extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);
646extern int inet6_option_next(const struct cmsghdr *, __uint8_t **);
647extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int);
648
649extern size_t inet6_rthdr_space(int, int);
650extern struct cmsghdr *inet6_rthdr_init(void *, int);
651extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,
652 unsigned int);
653extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
654#if 0 /* not implemented yet */
655extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);
656#endif
657extern int inet6_rthdr_segments(const struct cmsghdr *);
658extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);
659extern int inet6_rthdr_getflags(const struct cmsghdr *, int);
660
661extern int inet6_opt_init(void *, socklen_t);
662extern int inet6_opt_append(void *, socklen_t, int, __uint8_t, socklen_t,
663 __uint8_t, void **);
664extern int inet6_opt_finish(void *, socklen_t, int);
665extern int inet6_opt_set_val(void *, int, void *, socklen_t);
666
667extern int inet6_opt_next(void *, socklen_t, int, __uint8_t *, socklen_t *,
668 void **);
669extern int inet6_opt_find(void *, socklen_t, int, __uint8_t, socklen_t *,
670 void **);
671extern int inet6_opt_get_val(void *, int, void *, socklen_t);
672extern socklen_t inet6_rth_space(int, int);
673extern void *inet6_rth_init(void *, socklen_t, int, int);
674extern int inet6_rth_add(void *, const struct in6_addr *);
675extern int inet6_rth_reverse(const void *, void *);
676extern int inet6_rth_segments(const void *);
677extern 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/aarch64-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
64struct _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
72struct _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
78struct _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
89typedef struct __nl_cat_d {
90 void *__data;
91 int __size;
92} *nl_catd;
93
94#include <_types/_nl_item.h>
95
96__BEGIN_DECLS
97nl_catd catopen(const char *, int);
98char *catgets(nl_catd, int, int, const char *)
99 __attribute__((__format_arg__(4)));
100int catclose(nl_catd);
101__END_DECLS
102
103#endif /* _NL_TYPES_H_ */
lib/libc/include/aarch64-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
12typedef long NSInteger;
13typedef unsigned long NSUInteger;
14#else
15typedef int NSInteger;
16typedef 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/aarch64-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
50OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0)
51OBJC_ROOT_CLASS
52OBJC_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/aarch64-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.
34struct 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"
62OBJC_EXPORT void
63objc_msgSend(void /* id self, SEL op, ... */ )
64 OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
65
66OBJC_EXPORT void
67objc_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 */
87OBJC_EXPORT id _Nullable
88objc_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 */
104OBJC_EXPORT id _Nullable
105objc_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"
122OBJC_EXPORT void
123objc_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
127OBJC_EXPORT void
128objc_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 */
138OBJC_EXPORT void
139objc_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 */
148OBJC_EXPORT void
149objc_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
179OBJC_EXPORT void
180objc_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
185OBJC_EXPORT void
186objc_msgSend_fpret(void /* id self, SEL op, ... */ )
187 OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
188
189OBJC_EXPORT void
190objc_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"
212OBJC_EXPORT double
213objc_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 */
226OBJC_EXPORT long double
227objc_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
231OBJC_EXPORT _Complex long double
232objc_msgSend_fp2ret(id _Nullable self, SEL _Nonnull op, ...)
233 OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
234# else
235OBJC_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"
260OBJC_EXPORT void
261method_invoke(void /* id receiver, Method m, ... */ )
262 OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
263
264OBJC_EXPORT void
265method_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
270OBJC_EXPORT id _Nullable
271method_invoke(id _Nullable receiver, Method _Nonnull m, ...)
272 OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);
273
274OBJC_EXPORT void
275method_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"
299OBJC_EXPORT void
300_objc_msgForward(void /* id receiver, SEL sel, ... */ )
301 OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
302
303OBJC_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
309OBJC_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
313OBJC_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
333typedef void* marg_list;
334
335OBJC_EXPORT id _Nullable
336objc_msgSendv(id _Nullable self, SEL _Nonnull op, size_t arg_size,
337 marg_list _Nonnull arg_frame)
338 OBJC2_UNAVAILABLE;
339
340OBJC_EXPORT void
341objc_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__)
350OBJC_EXPORT double
351objc_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/aarch64-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/aarch64-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.
38typedef struct objc_class *Class;
39
40/// Represents an instance of a class.
41struct objc_object {
42 Class _Nonnull isa OBJC_ISA_AVAILABILITY;
43};
44
45/// A pointer to an instance of a class.
46typedef struct objc_object *id;
47#endif
48
49/// An opaque type that represents a method selector.
50typedef struct objc_selector *SEL;
51
52/// A pointer to the function of a method implementation.
53#if !OBJC_OLD_DISPATCH_PROTOTYPES
54typedef void (*IMP)(void /* id, SEL, ... */ );
55#else
56typedef 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 */
138OBJC_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 */
153OBJC_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 */
163OBJC_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 */
182OBJC_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 */
195OBJC_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 */
210OBJC_EXPORT SEL _Nonnull sel_getUid(const char * _Nonnull str)
211 OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
212
213typedef const void* objc_objectptr_t;
214
215
216// Obsolete ARC conversions.
217
218OBJC_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 ;
223OBJC_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 ;
228OBJC_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
249typedef 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/aarch64-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.
44typedef struct objc_method *Method;
45
46/// An opaque type that represents an instance variable.
47typedef struct objc_ivar *Ivar;
48
49/// An opaque type that represents a category.
50typedef struct objc_category *Category;
51
52/// An opaque type that represents an Objective-C declared property.
53typedef struct objc_property *objc_property_t;
54
55struct 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
78typedef struct objc_object Protocol;
79#endif
80
81/// Defines a method
82struct 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
88typedef 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 */
106OBJC_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 */
117OBJC_EXPORT id _Nullable
118object_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 */
130OBJC_EXPORT Class _Nullable
131object_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 */
142OBJC_EXPORT Class _Nullable
143object_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 */
154OBJC_EXPORT BOOL
155object_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 */
170OBJC_EXPORT id _Nullable
171object_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 */
187OBJC_EXPORT void
188object_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 */
204OBJC_EXPORT void
205object_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 */
224OBJC_EXPORT Ivar _Nullable
225object_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 */
245OBJC_EXPORT Ivar _Nullable
246object_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 */
263OBJC_EXPORT Ivar _Nullable
264object_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 */
288OBJC_EXPORT Class _Nullable
289objc_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 */
305OBJC_EXPORT Class _Nullable
306objc_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 */
321OBJC_EXPORT Class _Nullable
322objc_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 */
335OBJC_EXPORT Class _Nonnull
336objc_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 */
358OBJC_EXPORT int
359objc_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 */
372OBJC_EXPORT Class _Nonnull * _Nullable
373objc_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 */
386OBJC_EXPORT const char * _Nonnull
387class_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 */
398OBJC_EXPORT BOOL
399class_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 */
412OBJC_EXPORT Class _Nullable
413class_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 */
426OBJC_EXPORT Class _Nonnull
427class_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 */
445OBJC_EXPORT int
446class_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 */
463OBJC_EXPORT void
464class_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 */
474OBJC_EXPORT size_t
475class_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 */
487OBJC_EXPORT Ivar _Nullable
488class_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 */
499OBJC_EXPORT Ivar _Nullable
500class_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 */
516OBJC_EXPORT Ivar _Nonnull * _Nullable
517class_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 */
532OBJC_EXPORT Method _Nullable
533class_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 */
549OBJC_EXPORT Method _Nullable
550class_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 */
568OBJC_EXPORT IMP _Nullable
569class_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 */
582OBJC_EXPORT IMP _Nullable
583class_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 */
598OBJC_EXPORT BOOL
599class_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 */
619OBJC_EXPORT Method _Nonnull * _Nullable
620class_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 */
633OBJC_EXPORT BOOL
634class_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 */
650OBJC_EXPORT Protocol * __unsafe_unretained _Nonnull * _Nullable
651class_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 */
664OBJC_EXPORT objc_property_t _Nullable
665class_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 */
681OBJC_EXPORT objc_property_t _Nonnull * _Nullable
682class_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 */
692OBJC_EXPORT const uint8_t * _Nullable
693class_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 */
703OBJC_EXPORT const uint8_t * _Nullable
704class_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 */
722OBJC_EXPORT BOOL
723class_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 */
745OBJC_EXPORT IMP _Nullable
746class_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 */
763OBJC_EXPORT BOOL
764class_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 */
777OBJC_EXPORT BOOL
778class_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 */
792OBJC_EXPORT BOOL
793class_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 */
806OBJC_EXPORT void
807class_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 */
818OBJC_EXPORT void
819class_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 */
828OBJC_EXPORT void
829class_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 */
842OBJC_EXPORT Class _Nonnull
843objc_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 */
861OBJC_EXPORT id _Nullable
862class_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 */
879OBJC_EXPORT id _Nullable
880objc_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 */
894OBJC_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 */
918OBJC_EXPORT Class _Nullable
919objc_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 */
928OBJC_EXPORT void
929objc_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 */
937OBJC_EXPORT Class _Nonnull
938objc_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 */
950OBJC_EXPORT void
951objc_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 */
966OBJC_EXPORT SEL _Nonnull
967method_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 */
977OBJC_EXPORT IMP _Nonnull
978method_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 */
988OBJC_EXPORT const char * _Nullable
989method_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 */
999OBJC_EXPORT unsigned int
1000method_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 */
1010OBJC_EXPORT char * _Nonnull
1011method_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 */
1023OBJC_EXPORT char * _Nullable
1024method_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 */
1037OBJC_EXPORT void
1038method_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 */
1053OBJC_EXPORT void
1054method_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
1058OBJC_EXPORT struct objc_method_description * _Nonnull
1059method_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 */
1070OBJC_EXPORT IMP _Nonnull
1071method_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 */
1088OBJC_EXPORT void
1089method_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 */
1102OBJC_EXPORT const char * _Nullable
1103ivar_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 */
1115OBJC_EXPORT const char * _Nullable
1116ivar_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 */
1129OBJC_EXPORT ptrdiff_t
1130ivar_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 */
1143OBJC_EXPORT const char * _Nonnull
1144property_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 */
1156OBJC_EXPORT const char * _Nullable
1157property_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 */
1168OBJC_EXPORT objc_property_attribute_t * _Nullable
1169property_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 */
1182OBJC_EXPORT char * _Nullable
1183property_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 */
1199OBJC_EXPORT Protocol * _Nullable
1200objc_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 */
1213OBJC_EXPORT Protocol * __unsafe_unretained _Nonnull * _Nullable
1214objc_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 */
1232OBJC_EXPORT BOOL
1233protocol_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 */
1245OBJC_EXPORT BOOL
1246protocol_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 */
1256OBJC_EXPORT const char * _Nonnull
1257protocol_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 */
1275OBJC_EXPORT struct objc_method_description
1276protocol_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 */
1297OBJC_EXPORT struct objc_method_description * _Nullable
1298protocol_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 */
1315OBJC_EXPORT objc_property_t _Nullable
1316protocol_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 */
1329OBJC_EXPORT objc_property_t _Nonnull * _Nullable
1330protocol_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 */
1347OBJC_EXPORT objc_property_t _Nonnull * _Nullable
1348protocol_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 */
1363OBJC_EXPORT Protocol * __unsafe_unretained _Nonnull * _Nullable
1364protocol_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 */
1378OBJC_EXPORT Protocol * _Nullable
1379objc_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 */
1388OBJC_EXPORT void
1389objc_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 */
1401OBJC_EXPORT void
1402protocol_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 */
1415OBJC_EXPORT void
1416protocol_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 */
1431OBJC_EXPORT void
1432protocol_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 */
1449OBJC_EXPORT const char * _Nonnull * _Nonnull
1450objc_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 */
1460OBJC_EXPORT const char * _Nullable
1461class_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 */
1472OBJC_EXPORT const char * _Nonnull * _Nullable
1473objc_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 */
1487OBJC_EXPORT const char * _Nonnull
1488sel_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 */
1504OBJC_EXPORT SEL _Nonnull
1505sel_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 */
1518OBJC_EXPORT BOOL
1519sel_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 */
1534OBJC_EXPORT void
1535objc_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 */
1543OBJC_EXPORT void
1544objc_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 */
1555OBJC_EXPORT void
1556objc_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 */
1571OBJC_EXPORT IMP _Nonnull
1572imp_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 */
1583OBJC_EXPORT id _Nullable
1584imp_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 */
1597OBJC_EXPORT BOOL
1598imp_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 */
1611OBJC_EXPORT id _Nullable
1612objc_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 */
1624OBJC_EXPORT id _Nullable
1625objc_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 */
1635typedef 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 */
1658OBJC_EXPORT void
1659objc_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 */
1673OBJC_EXPORT id _Nullable
1674objc_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 */
1691OBJC_EXPORT void
1692objc_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 */
1708typedef 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 */
1728OBJC_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 */
1742typedef 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
1763OBJC_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 */
1773struct mach_header;
1774typedef 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
1792OBJC_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 */
1803typedef 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
1821OBJC_EXPORT
1822void 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__)
1831typedef 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
1843OBJC_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
1925struct objc_method_description_list {
1926 int count;
1927 struct objc_method_description list[1];
1928};
1929
1930
1931struct objc_protocol_list {
1932 struct objc_protocol_list * _Nullable next;
1933 long count;
1934 __unsafe_unretained Protocol * _Nullable list[1];
1935};
1936
1937
1938struct 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
1947struct 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
1956struct 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
1966struct 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
1972struct 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
1984typedef struct objc_symtab *Symtab OBJC2_UNAVAILABLE;
1985
1986struct 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
1995typedef 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
2005struct 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
2012typedef struct objc_module *Module OBJC2_UNAVAILABLE;
2013
2014struct 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
2023struct objc_method_list;
2024
2025#endif
2026
2027
2028/* Obsolete functions */
2029
2030OBJC_EXPORT IMP _Nullable
2031class_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;
2038OBJC_EXPORT BOOL
2039class_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
2047OBJC_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
2056OBJC_EXPORT id _Nullable
2057object_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
2060OBJC_EXPORT id _Nullable
2061object_realloc(id _Nullable anObject, size_t nBytes)
2062 OBJC2_UNAVAILABLE;
2063
2064OBJC_EXPORT id _Nullable
2065object_reallocFromZone(id _Nullable anObject, size_t nBytes, void * _Nullable z)
2066 OBJC2_UNAVAILABLE;
2067
2068#define OBSOLETE_OBJC_GETCLASSES 1
2069OBJC_EXPORT void * _Nonnull
2070objc_getClasses(void)
2071 OBJC2_UNAVAILABLE;
2072
2073OBJC_EXPORT void
2074objc_addClass(Class _Nonnull myClass)
2075 OBJC2_UNAVAILABLE;
2076
2077OBJC_EXPORT void
2078objc_setClassHandler(int (* _Nullable )(const char * _Nonnull))
2079 OBJC2_UNAVAILABLE;
2080
2081OBJC_EXPORT void
2082objc_setMultithreaded(BOOL flag)
2083 OBJC2_UNAVAILABLE;
2084
2085OBJC_EXPORT id _Nullable
2086class_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
2090OBJC_EXPORT void
2091class_addMethods(Class _Nullable, struct objc_method_list * _Nonnull)
2092 OBJC2_UNAVAILABLE;
2093
2094OBJC_EXPORT void
2095class_removeMethods(Class _Nullable, struct objc_method_list * _Nonnull)
2096 OBJC2_UNAVAILABLE;
2097
2098OBJC_EXPORT void
2099_objc_resolve_categories_for_class(Class _Nonnull cls)
2100 OBJC2_UNAVAILABLE;
2101
2102OBJC_EXPORT Class _Nonnull
2103class_poseAs(Class _Nonnull imposter, Class _Nonnull original)
2104 OBJC2_UNAVAILABLE;
2105
2106OBJC_EXPORT unsigned int
2107method_getSizeOfArguments(Method _Nonnull m)
2108 OBJC2_UNAVAILABLE;
2109
2110OBJC_EXPORT unsigned
2111method_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
2117OBJC_EXPORT Class _Nullable
2118objc_getOrigClass(const char * _Nonnull name)
2119 OBJC2_UNAVAILABLE;
2120
2121#define OBJC_NEXT_METHOD_LIST 1
2122OBJC_EXPORT struct objc_method_list * _Nullable
2123class_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
2132OBJC_EXPORT id _Nullable
2133(* _Nonnull _alloc)(Class _Nullable, size_t)
2134 OBJC2_UNAVAILABLE;
2135
2136OBJC_EXPORT id _Nullable
2137(* _Nonnull _copy)(id _Nullable, size_t)
2138 OBJC2_UNAVAILABLE;
2139
2140OBJC_EXPORT id _Nullable
2141(* _Nonnull _realloc)(id _Nullable, size_t)
2142 OBJC2_UNAVAILABLE;
2143
2144OBJC_EXPORT id _Nullable
2145(* _Nonnull _dealloc)(id _Nullable)
2146 OBJC2_UNAVAILABLE;
2147
2148OBJC_EXPORT id _Nullable
2149(* _Nonnull _zoneAlloc)(Class _Nullable, size_t, void * _Nullable)
2150 OBJC2_UNAVAILABLE;
2151
2152OBJC_EXPORT id _Nullable
2153(* _Nonnull _zoneRealloc)(id _Nullable, size_t, void * _Nullable)
2154 OBJC2_UNAVAILABLE;
2155
2156OBJC_EXPORT id _Nullable
2157(* _Nonnull _zoneCopy)(id _Nullable, size_t, void * _Nullable)
2158 OBJC2_UNAVAILABLE;
2159
2160OBJC_EXPORT void
2161(* _Nonnull _error)(id _Nullable, const char * _Nonnull, va_list)
2162 OBJC2_UNAVAILABLE;
2163
2164#endif
lib/libc/include/aarch64-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/aarch64-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
274typedef 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 */
317typedef void (^os_block_t)(void);
318#endif
319
320
321
322#endif // __OS_BASE__
lib/libc/include/aarch64-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 */
14OS_ENUM(os_clockid, uint32_t,
15 OS_CLOCK_MACH_ABSOLUTE_TIME = 32,
16);
17
18#endif /* __OS_CLOCK__ */
lib/libc/include/aarch64-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
31OS_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 */
76OS_UNFAIR_LOCK_AVAILABILITY
77typedef 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 */
102OS_UNFAIR_LOCK_AVAILABILITY
103OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
104void 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 */
127OS_UNFAIR_LOCK_AVAILABILITY
128OS_EXPORT OS_NOTHROW OS_WARN_RESULT OS_NONNULL_ALL
129bool 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 */
140OS_UNFAIR_LOCK_AVAILABILITY
141OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
142void 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 */
160OS_UNFAIR_LOCK_AVAILABILITY
161OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
162void 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 */
181OS_UNFAIR_LOCK_AVAILABILITY
182OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
183void os_unfair_lock_assert_not_owner(os_unfair_lock_t lock);
184
185__END_DECLS
186
187OS_ASSUME_NONNULL_END
188
189#endif // __OS_LOCK__
lib/libc/include/aarch64-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
202OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE
203OS_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 */
270API_AVAILABLE(macos(10.10), ios(8.0))
271OS_EXPORT OS_SWIFT_UNAVAILABLE("Can't be used with ARC")
272void*
273os_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 */
292API_AVAILABLE(macos(10.10), ios(8.0))
293OS_EXPORT
294void OS_SWIFT_UNAVAILABLE("Can't be used with ARC")
295os_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/aarch64-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/aarch64-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
62struct 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
68struct OS_REFINED_FOR_SWIFT os_workgroup_interval_data_opaque_s {
69 uint32_t sig;
70 char opaque[__OS_WORKGROUP_INTERVAL_DATA_SIZE__];
71};
72
73struct 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/aarch64-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
31OS_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 */
40OS_WORKGROUP_SUBCLASS_DECL_PROTO(os_workgroup_interval, Repeatable);
41OS_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 */
55typedef struct os_workgroup_interval_data_opaque_s os_workgroup_interval_data_s;
56typedef 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 */
91API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
92OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT
93int
94os_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 */
120API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
121OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT
122int
123os_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 */
145API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
146OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT
147int
148os_workgroup_interval_finish(os_workgroup_interval_t wg,
149 os_workgroup_interval_data_t _Nullable data);
150
151OS_WORKGROUP_ASSUME_NONNULL_END
152
153__END_DECLS
154
155#endif /* __OS_WORKGROUP_INTERVAL__ */
lib/libc/include/aarch64-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
31OS_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 */
48OS_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 */
60typedef struct os_workgroup_attr_opaque_s os_workgroup_attr_s;
61typedef 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 */
89API_AVAILABLE(macos(11.0))
90API_UNAVAILABLE(ios, tvos, watchos)
91OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT
92int
93os_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 */
113API_AVAILABLE(macos(11.0))
114API_UNAVAILABLE(ios, tvos, watchos)
115OS_SWIFT_NAME(WorkGroup.init(__name:port:)) OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED
116os_workgroup_t _Nullable
117os_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 */
135API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
136OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED
137os_workgroup_t _Nullable
138os_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 */
147OS_REFINED_FOR_SWIFT
148typedef struct os_workgroup_join_token_opaque_s os_workgroup_join_token_s;
149OS_REFINED_FOR_SWIFT
150typedef 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 */
174API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
175OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT
176int
177os_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 */
199API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
200OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT
201void
202os_workgroup_leave(os_workgroup_t wg, os_workgroup_join_token_t token);
203
204/* Working Arena index of a thread in a workgroup */
205typedef uint32_t os_workgroup_index;
206/* Destructor for Working Arena */
207typedef 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 */
238API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
239OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT
240int
241os_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 */
268API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
269OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT
270void * _Nullable
271os_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 */
296API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
297OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT
298void
299os_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 */
308API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
309OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT
310bool
311os_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 */
322OS_REFINED_FOR_SWIFT
323typedef struct os_workgroup_max_parallel_threads_attr_s os_workgroup_mpt_attr_s;
324OS_REFINED_FOR_SWIFT
325typedef 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 */
347API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
348OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT
349int
350os_workgroup_max_parallel_threads(os_workgroup_t wg, os_workgroup_mpt_attr_t
351 _Nullable attr);
352
353OS_WORKGROUP_ASSUME_NONNULL_END
354
355__END_DECLS
356
357#endif /* __OS_WORKGROUP_OBJECT__ */
lib/libc/include/aarch64-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
33OS_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 */
41OS_WORKGROUP_SUBCLASS_DECL_PROTO(os_workgroup_parallel, Parallelizable);
42OS_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 */
63API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
64OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED
65OS_SWIFT_NAME(WorkGroupParallel.init(__name:attr:))
66os_workgroup_parallel_t _Nullable
67os_workgroup_parallel_create(const char * _Nullable name,
68 os_workgroup_attr_t _Nullable attr);
69
70OS_WORKGROUP_ASSUME_NONNULL_END
71
72__END_DECLS
73
74#endif /* __OS_WORKGROUP_PARALLEL__ */
lib/libc/include/aarch64-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/aarch64-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))
219int pthread_atfork(void (* _Nullable)(void), void (* _Nullable)(void),
220 void (* _Nullable)(void));
221
222__API_AVAILABLE(macos(10.4), ios(2.0))
223int pthread_attr_destroy(pthread_attr_t *);
224
225__API_AVAILABLE(macos(10.4), ios(2.0))
226int pthread_attr_getdetachstate(const pthread_attr_t *, int *);
227
228__API_AVAILABLE(macos(10.4), ios(2.0))
229int pthread_attr_getguardsize(const pthread_attr_t * __restrict, size_t * __restrict);
230
231__API_AVAILABLE(macos(10.4), ios(2.0))
232int pthread_attr_getinheritsched(const pthread_attr_t * __restrict, int * __restrict);
233
234__API_AVAILABLE(macos(10.4), ios(2.0))
235int pthread_attr_getschedparam(const pthread_attr_t * __restrict,
236 struct sched_param * __restrict);
237
238__API_AVAILABLE(macos(10.4), ios(2.0))
239int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict, int * __restrict);
240
241__API_AVAILABLE(macos(10.4), ios(2.0))
242int pthread_attr_getscope(const pthread_attr_t * __restrict, int * __restrict);
243
244__API_AVAILABLE(macos(10.4), ios(2.0))
245int 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))
249int pthread_attr_getstackaddr(const pthread_attr_t * __restrict,
250 void * _Nullable * _Nonnull __restrict);
251
252__API_AVAILABLE(macos(10.4), ios(2.0))
253int pthread_attr_getstacksize(const pthread_attr_t * __restrict, size_t * __restrict);
254
255__API_AVAILABLE(macos(10.4), ios(2.0))
256int pthread_attr_init(pthread_attr_t *);
257
258__API_AVAILABLE(macos(10.4), ios(2.0))
259int pthread_attr_setdetachstate(pthread_attr_t *, int);
260
261__API_AVAILABLE(macos(10.4), ios(2.0))
262int pthread_attr_setguardsize(pthread_attr_t *, size_t);
263
264__API_AVAILABLE(macos(10.4), ios(2.0))
265int pthread_attr_setinheritsched(pthread_attr_t *, int);
266
267__API_AVAILABLE(macos(10.4), ios(2.0))
268int pthread_attr_setschedparam(pthread_attr_t * __restrict,
269 const struct sched_param * __restrict);
270
271__API_AVAILABLE(macos(10.4), ios(2.0))
272int pthread_attr_setschedpolicy(pthread_attr_t *, int);
273
274__API_AVAILABLE(macos(10.4), ios(2.0))
275int pthread_attr_setscope(pthread_attr_t *, int);
276
277__API_AVAILABLE(macos(10.4), ios(2.0))
278int pthread_attr_setstack(pthread_attr_t *, void *, size_t);
279
280__API_AVAILABLE(macos(10.4), ios(2.0))
281int pthread_attr_setstackaddr(pthread_attr_t *, void *);
282
283__API_AVAILABLE(macos(10.4), ios(2.0))
284int pthread_attr_setstacksize(pthread_attr_t *, size_t);
285
286__API_AVAILABLE(macos(10.4), ios(2.0))
287int pthread_cancel(pthread_t) __DARWIN_ALIAS(pthread_cancel);
288
289__API_AVAILABLE(macos(10.4), ios(2.0))
290int pthread_cond_broadcast(pthread_cond_t *);
291
292__API_AVAILABLE(macos(10.4), ios(2.0))
293int pthread_cond_destroy(pthread_cond_t *);
294
295__API_AVAILABLE(macos(10.4), ios(2.0))
296int 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))
302int pthread_cond_signal(pthread_cond_t *);
303
304__API_AVAILABLE(macos(10.4), ios(2.0))
305int 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))
311int 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))
315int pthread_condattr_destroy(pthread_condattr_t *);
316
317__API_AVAILABLE(macos(10.4), ios(2.0))
318int pthread_condattr_init(pthread_condattr_t *);
319
320__API_AVAILABLE(macos(10.4), ios(2.0))
321int pthread_condattr_getpshared(const pthread_condattr_t * __restrict,
322 int * __restrict);
323
324__API_AVAILABLE(macos(10.4), ios(2.0))
325int pthread_condattr_setpshared(pthread_condattr_t *, int);
326
327__API_AVAILABLE(macos(10.4), ios(2.0))
328#if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
329int 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
334int 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))
340int pthread_detach(pthread_t);
341
342__API_AVAILABLE(macos(10.4), ios(2.0))
343int pthread_equal(pthread_t _Nullable, pthread_t _Nullable);
344
345__API_AVAILABLE(macos(10.4), ios(2.0))
346void pthread_exit(void * _Nullable) __dead2;
347
348__API_AVAILABLE(macos(10.4), ios(2.0))
349int pthread_getconcurrency(void);
350
351__API_AVAILABLE(macos(10.4), ios(2.0))
352int pthread_getschedparam(pthread_t , int * _Nullable __restrict,
353 struct sched_param * _Nullable __restrict);
354
355__API_AVAILABLE(macos(10.4), ios(2.0))
356void* _Nullable pthread_getspecific(pthread_key_t);
357
358__API_AVAILABLE(macos(10.4), ios(2.0))
359int pthread_join(pthread_t , void * _Nullable * _Nullable)
360 __DARWIN_ALIAS_C(pthread_join);
361
362__API_AVAILABLE(macos(10.4), ios(2.0))
363int pthread_key_create(pthread_key_t *, void (* _Nullable)(void *));
364
365__API_AVAILABLE(macos(10.4), ios(2.0))
366int pthread_key_delete(pthread_key_t);
367
368__API_AVAILABLE(macos(10.4), ios(2.0))
369int pthread_mutex_destroy(pthread_mutex_t *);
370
371__API_AVAILABLE(macos(10.4), ios(2.0))
372int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict,
373 int * __restrict);
374
375__API_AVAILABLE(macos(10.4), ios(2.0))
376int pthread_mutex_init(pthread_mutex_t * __restrict,
377 const pthread_mutexattr_t * _Nullable __restrict);
378
379__API_AVAILABLE(macos(10.4), ios(2.0))
380int pthread_mutex_lock(pthread_mutex_t *);
381
382__API_AVAILABLE(macos(10.4), ios(2.0))
383int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict, int,
384 int * __restrict);
385
386__API_AVAILABLE(macos(10.4), ios(2.0))
387int pthread_mutex_trylock(pthread_mutex_t *);
388
389__API_AVAILABLE(macos(10.4), ios(2.0))
390int pthread_mutex_unlock(pthread_mutex_t *);
391
392__API_AVAILABLE(macos(10.4), ios(2.0))
393int pthread_mutexattr_destroy(pthread_mutexattr_t *) __DARWIN_ALIAS(pthread_mutexattr_destroy);
394
395__API_AVAILABLE(macos(10.4), ios(2.0))
396int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict,
397 int * __restrict);
398
399__API_AVAILABLE(macos(10.4), ios(2.0))
400int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict,
401 int * __restrict);
402
403__API_AVAILABLE(macos(10.4), ios(2.0))
404int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __restrict,
405 int * __restrict);
406
407__API_AVAILABLE(macos(10.4), ios(2.0))
408int 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))
412int pthread_mutexattr_getpolicy_np(const pthread_mutexattr_t * __restrict,
413 int * __restrict);
414
415__API_AVAILABLE(macos(10.4), ios(2.0))
416int pthread_mutexattr_init(pthread_mutexattr_t *);
417
418__API_AVAILABLE(macos(10.4), ios(2.0))
419int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
420
421__API_AVAILABLE(macos(10.4), ios(2.0))
422int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
423
424__API_AVAILABLE(macos(10.4), ios(2.0))
425int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
426
427__API_AVAILABLE(macos(10.4), ios(2.0))
428int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
429
430__API_AVAILABLE(macos(10.7), ios(5.0))
431int 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))
435int pthread_once(pthread_once_t *, void (* _Nonnull)(void));
436
437__API_AVAILABLE(macos(10.4), ios(2.0))
438int pthread_rwlock_destroy(pthread_rwlock_t * ) __DARWIN_ALIAS(pthread_rwlock_destroy);
439
440__API_AVAILABLE(macos(10.4), ios(2.0))
441int 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))
446int pthread_rwlock_rdlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_rdlock);
447
448__API_AVAILABLE(macos(10.4), ios(2.0))
449int pthread_rwlock_tryrdlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_tryrdlock);
450
451__API_AVAILABLE(macos(10.4), ios(2.0))
452int pthread_rwlock_trywrlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_trywrlock);
453
454__API_AVAILABLE(macos(10.4), ios(2.0))
455int pthread_rwlock_wrlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_wrlock);
456
457__API_AVAILABLE(macos(10.4), ios(2.0))
458int pthread_rwlock_unlock(pthread_rwlock_t *) __DARWIN_ALIAS(pthread_rwlock_unlock);
459
460__API_AVAILABLE(macos(10.4), ios(2.0))
461int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
462
463__API_AVAILABLE(macos(10.4), ios(2.0))
464int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * __restrict,
465 int * __restrict);
466
467__API_AVAILABLE(macos(10.4), ios(2.0))
468int pthread_rwlockattr_init(pthread_rwlockattr_t *);
469
470__API_AVAILABLE(macos(10.4), ios(2.0))
471int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
472
473__API_AVAILABLE(macos(10.4), ios(2.0))
474pthread_t pthread_self(void);
475
476__API_AVAILABLE(macos(10.4), ios(2.0))
477int pthread_setcancelstate(int , int * _Nullable)
478 __DARWIN_ALIAS(pthread_setcancelstate);
479
480__API_AVAILABLE(macos(10.4), ios(2.0))
481int pthread_setcanceltype(int , int * _Nullable)
482 __DARWIN_ALIAS(pthread_setcanceltype);
483
484__API_AVAILABLE(macos(10.4), ios(2.0))
485int pthread_setconcurrency(int);
486
487__API_AVAILABLE(macos(10.4), ios(2.0))
488int pthread_setschedparam(pthread_t, int, const struct sched_param *);
489
490__API_AVAILABLE(macos(10.4), ios(2.0))
491int pthread_setspecific(pthread_key_t , const void * _Nullable);
492
493__API_AVAILABLE(macos(10.4), ios(2.0))
494void 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))
500int pthread_is_threaded_np(void);
501
502__API_AVAILABLE(macos(10.6), ios(3.2))
503int 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))
507int pthread_getname_np(pthread_t,char*,size_t);
508
509__API_AVAILABLE(macos(10.6), ios(3.2))
510int 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))
514int pthread_main_np(void);
515
516/* return the mach thread bound to the pthread */
517__API_AVAILABLE(macos(10.4), ios(2.0))
518mach_port_t pthread_mach_thread_np(pthread_t);
519
520__API_AVAILABLE(macos(10.4), ios(2.0))
521size_t pthread_get_stacksize_np(pthread_t);
522
523__API_AVAILABLE(macos(10.4), ios(2.0))
524void* 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))
528int 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))
532int 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
538int pthread_create_suspended_np(
539 pthread_t _Nullable * _Nonnull, const pthread_attr_t * _Nullable,
540 void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable);
541#else
542int 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))
547int 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))
553int 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))
557void pthread_yield_np(void);
558
559__API_AVAILABLE(macos(11.0))
560__API_UNAVAILABLE(ios, tvos, watchos)
561void pthread_jit_write_protect_np(int enabled);
562
563__API_AVAILABLE(macos(11.0))
564__API_UNAVAILABLE(ios, tvos, watchos)
565int 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))
583int
584pthread_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/aarch64-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/aarch64-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))
82int
83pthread_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))
113int
114pthread_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))
154int
155pthread_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))
185int
186pthread_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
211typedef 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))
264pthread_override_t
265pthread_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))
292int
293pthread_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/aarch64-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__
35struct sched_param { int sched_priority; char __opaque[__SCHED_PARAM_SIZE__]; };
36#else
37struct sched_param;
38#endif
39
40extern int sched_yield(void);
41extern int sched_get_priority_min(int);
42extern int sched_get_priority_max(int);
43__END_DECLS
44
45#endif /* _SCHED_H_ */
46
lib/libc/include/aarch64-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
84struct 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
100struct passwd *getpwuid(uid_t);
101struct passwd *getpwnam(const char *);
102int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
103int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);
104struct passwd *getpwent(void);
105void setpwent(void);
106void 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
112int setpassent(int);
113char *user_from_uid(uid_t, int);
114struct passwd *getpwuuid(uuid_t);
115int getpwuuid_r(uuid_t, struct passwd *, char *, size_t, struct passwd **);
116__END_DECLS
117#endif
118
119#endif /* !_PWD_H_ */
lib/libc/include/aarch64-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
181int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp);
182size_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 */
187int regexec(const regex_t * __restrict, const char * __restrict, size_t,
188 regmatch_t __pmatch[ __restrict], int);
189void regfree(regex_t *);
190
191#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
192
193/* Darwin extensions */
194int regncomp(regex_t * __restrict, const char * __restrict, size_t, int)
195 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
196int 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);
199int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int)
200 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
201int 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);
204int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int)
205 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
206int 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/aarch64-macos-gnu/runetype.h created+115
......@@ -0,0 +1,115 @@
1/*-
2 * Copyright (c) 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 * Paul Borman at Krystal Technologies.
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 * @(#)runetype.h 8.1 (Berkeley) 6/2/93
37 */
38
39#ifndef _RUNETYPE_H_
40#define _RUNETYPE_H_
41
42#include <_types.h>
43
44#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
45
46#include <sys/_types/_size_t.h>
47#include <sys/_types/_ct_rune_t.h>
48#include <sys/_types/_rune_t.h>
49#include <sys/_types/_wchar_t.h>
50#include <sys/_types/_wint_t.h>
51
52#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
53
54#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
55#define _CRMASK (~(_CACHED_RUNES - 1))
56
57/*
58 * The lower 8 bits of runetype[] contain the digit value of the rune.
59 */
60typedef struct {
61 __darwin_rune_t __min; /* First rune of the range */
62 __darwin_rune_t __max; /* Last rune (inclusive) of the range */
63 __darwin_rune_t __map; /* What first maps to in maps */
64 __uint32_t *__types; /* Array of types in range */
65} _RuneEntry;
66
67typedef struct {
68 int __nranges; /* Number of ranges stored */
69 _RuneEntry *__ranges; /* Pointer to the ranges */
70} _RuneRange;
71
72typedef struct {
73 char __name[14]; /* CHARCLASS_NAME_MAX = 14 */
74 __uint32_t __mask; /* charclass mask */
75} _RuneCharClass;
76
77typedef struct {
78 char __magic[8]; /* Magic saying what version we are */
79 char __encoding[32]; /* ASCII name of this encoding */
80
81 __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);
82 int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
83 __darwin_rune_t __invalid_rune;
84
85 __uint32_t __runetype[_CACHED_RUNES];
86 __darwin_rune_t __maplower[_CACHED_RUNES];
87 __darwin_rune_t __mapupper[_CACHED_RUNES];
88
89 /*
90 * The following are to deal with Runes larger than _CACHED_RUNES - 1.
91 * Their data is actually contiguous with this structure so as to make
92 * it easier to read/write from/to disk.
93 */
94 _RuneRange __runetype_ext;
95 _RuneRange __maplower_ext;
96 _RuneRange __mapupper_ext;
97
98 void *__variable; /* Data which depends on the encoding */
99 int __variable_len; /* how long that data is */
100
101 /*
102 * extra fields to deal with arbitrary character classes
103 */
104 int __ncharclasses;
105 _RuneCharClass *__charclasses;
106} _RuneLocale;
107
108#define _RUNE_MAGIC_A "RuneMagA" /* Indicates version A of RuneLocale */
109
110__BEGIN_DECLS
111extern _RuneLocale _DefaultRuneLocale;
112extern _RuneLocale *_CurrentRuneLocale;
113__END_DECLS
114
115#endif /* !_RUNETYPE_H_ */
lib/libc/include/aarch64-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__
35struct sched_param { int sched_priority; char __opaque[__SCHED_PARAM_SIZE__]; };
36#else
37struct sched_param;
38#endif
39
40extern int sched_yield(void);
41extern int sched_get_priority_min(int);
42extern int sched_get_priority_max(int);
43__END_DECLS
44
45#endif /* _SCHED_H_ */
46
lib/libc/include/aarch64-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
16typedef struct entry {
17 char *key;
18 void *data;
19} ENTRY;
20
21typedef enum {
22 FIND, ENTER
23} ACTION;
24
25typedef enum {
26 preorder,
27 postorder,
28 endorder,
29 leaf
30} VISIT;
31
32#ifdef _SEARCH_PRIVATE
33typedef struct node {
34 char *key;
35 struct node *llink, *rlink;
36} node_t;
37
38struct que_elem {
39 struct que_elem *next;
40 struct que_elem *prev;
41};
42#endif
43
44__BEGIN_DECLS
45int hcreate(size_t);
46void hdestroy(void);
47ENTRY *hsearch(ENTRY, ACTION);
48void insque(void *, void *);
49void *lfind(const void *, const void *, size_t *, size_t,
50 int (*)(const void *, const void *));
51void *lsearch(const void *, void *, size_t *, size_t,
52 int (*)(const void *, const void *));
53void remque(void *);
54void *tdelete(const void * __restrict, void ** __restrict,
55 int (*)(const void *, const void *));
56void *tfind(const void *, void * const *,
57 int (*)(const void *, const void *));
58void *tsearch(const void *, void **, int (*)(const void *, const void *));
59void twalk(const void *, void (*)(const void *, VISIT, int));
60__END_DECLS
61
62#endif /* !_SEARCH_H_ */
lib/libc/include/aarch64-macos-gnu/secure/_common.h created+41
......@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2007, 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#ifndef _SECURE__COMMON_H_
25#define _SECURE__COMMON_H_
26
27#undef _USE_FORTIFY_LEVEL
28#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
29# if _FORTIFY_SOURCE > 1
30# define _USE_FORTIFY_LEVEL 2
31# else
32# define _USE_FORTIFY_LEVEL 1
33# endif
34#else
35# define _USE_FORTIFY_LEVEL 0
36#endif
37
38#define __darwin_obsz0(object) __builtin_object_size (object, 0)
39#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
40
41#endif
lib/libc/include/aarch64-macos-gnu/secure/_stdio.h created+86
......@@ -0,0 +1,86 @@
1/*
2 * Copyright (c) 2007, 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 _STDIO_H_
25 #error error "Never use <secure/_stdio.h> directly; include <stdio.h> instead."
26#endif
27
28#ifndef _SECURE__STDIO_H_
29#define _SECURE__STDIO_H_
30
31#include <secure/_common.h>
32
33#if _USE_FORTIFY_LEVEL > 0
34
35#ifndef __has_builtin
36#define _undef__has_builtin
37#define __has_builtin(x) 0
38#endif
39
40/* sprintf, vsprintf, snprintf, vsnprintf */
41#if __has_builtin(__builtin___sprintf_chk) || defined(__GNUC__)
42extern int __sprintf_chk (char * __restrict, int, size_t,
43 const char * __restrict, ...);
44
45#undef sprintf
46#define sprintf(str, ...) \
47 __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
48#endif
49
50#if __DARWIN_C_LEVEL >= 200112L
51#if __has_builtin(__builtin___snprintf_chk) || defined(__GNUC__)
52extern int __snprintf_chk (char * __restrict, size_t, int, size_t,
53 const char * __restrict, ...);
54
55#undef snprintf
56#define snprintf(str, len, ...) \
57 __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
58#endif
59
60#if __has_builtin(__builtin___vsprintf_chk) || defined(__GNUC__)
61extern int __vsprintf_chk (char * __restrict, int, size_t,
62 const char * __restrict, va_list);
63
64#undef vsprintf
65#define vsprintf(str, format, ap) \
66 __builtin___vsprintf_chk (str, 0, __darwin_obsz(str), format, ap)
67#endif
68
69#if __has_builtin(__builtin___vsnprintf_chk) || defined(__GNUC__)
70extern int __vsnprintf_chk (char * __restrict, size_t, int, size_t,
71 const char * __restrict, va_list);
72
73#undef vsnprintf
74#define vsnprintf(str, len, format, ap) \
75 __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
76#endif
77
78#endif /* __DARWIN_C_LEVEL >= 200112L */
79
80#ifdef _undef__has_builtin
81#undef _undef__has_builtin
82#undef __has_builtin
83#endif
84
85#endif /* _USE_FORTIFY_LEVEL > 0 */
86#endif /* _SECURE__STDIO_H_ */
lib/libc/include/aarch64-macos-gnu/secure/_string.h created+150
......@@ -0,0 +1,150 @@
1/*
2 * Copyright (c) 2007,2017 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 _STRING_H_
25# error "Never use <secure/_string.h> directly; include <string.h> instead."
26#endif
27
28#ifndef _SECURE__STRING_H_
29#define _SECURE__STRING_H_
30
31#include <sys/cdefs.h>
32#include <Availability.h>
33#include <secure/_common.h>
34
35#if _USE_FORTIFY_LEVEL > 0
36
37/* <rdar://problem/12622659> */
38#if defined(__clang__) && \
39 ((defined(__apple_build_version__) && __apple_build_version__ >= 4260006) || \
40 (!defined(__apple_build_version__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 3))))
41#define __HAS_FIXED_CHK_PROTOTYPES 1
42#else
43#define __HAS_FIXED_CHK_PROTOTYPES 0
44#endif
45
46/* memccpy, memcpy, mempcpy, memmove, memset, strcpy, strlcpy, stpcpy,
47 strncpy, stpncpy, strcat, strlcat, and strncat */
48
49#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 || \
50 defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
51#if __has_builtin(__builtin___memccpy_chk) && __HAS_FIXED_CHK_PROTOTYPES
52#undef memccpy
53/* void *memccpy(void *dst, const void *src, int c, size_t n) */
54#define memccpy(dest, ...) \
55 __builtin___memccpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
56#endif
57#endif
58
59#if __has_builtin(__builtin___memcpy_chk) || defined(__GNUC__)
60#undef memcpy
61/* void *memcpy(void *dst, const void *src, size_t n) */
62#define memcpy(dest, ...) \
63 __builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
64#endif
65
66#if __has_builtin(__builtin___memmove_chk) || defined(__GNUC__)
67#undef memmove
68/* void *memmove(void *dst, const void *src, size_t len) */
69#define memmove(dest, ...) \
70 __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
71#endif
72
73#if __has_builtin(__builtin___memset_chk) || defined(__GNUC__)
74#undef memset
75/* void *memset(void *b, int c, size_t len) */
76#define memset(dest, ...) \
77 __builtin___memset_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
78#endif
79
80#if __has_builtin(__builtin___strcpy_chk) || defined(__GNUC__)
81#undef strcpy
82/* char *strcpy(char *dst, const char *src) */
83#define strcpy(dest, ...) \
84 __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
85#endif
86
87#if __DARWIN_C_LEVEL >= 200809L
88#if __has_builtin(__builtin___stpcpy_chk) || defined(__GNUC__)
89#undef stpcpy
90/* char *stpcpy(char *dst, const char *src) */
91#define stpcpy(dest, ...) \
92 __builtin___stpcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
93#endif
94#endif /* __DARWIN_C_LEVEL >= 200809L */
95
96#if __DARWIN_C_LEVEL >= 200809L
97#if __has_builtin(__builtin___stpncpy_chk) || __APPLE_CC__ >= 5666 || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
98#undef stpncpy
99/* char *stpncpy(char *dst, const char *src, size_t n) */
100#define stpncpy(dest, ...) \
101 __builtin___stpncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
102#endif
103#endif /* _DARWIN_C_LEVEL >= 200809L */
104
105#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
106#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 || \
107 defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
108#if __has_builtin(__builtin___strlcpy_chk) && __HAS_FIXED_CHK_PROTOTYPES
109#undef strlcpy
110/* size_t strlcpy(char *dst, const char *source, size_t size) */
111#define strlcpy(dest, ...) \
112 __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
113#endif
114
115#if __has_builtin(__builtin___strlcat_chk) && __HAS_FIXED_CHK_PROTOTYPES
116#undef strlcat
117/* size_t strlcat(char *dst, const char *source, size_t size) */
118#define strlcat(dest, ...) \
119 __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
120#endif
121#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 */
122#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
123
124#if __has_builtin(__builtin___strncpy_chk) || defined(__GNUC__)
125#undef strncpy
126/* char *strncpy(char *dst, const char *src, size_t n) */
127#define strncpy(dest, ...) \
128 __builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
129#endif
130
131#if __has_builtin(__builtin___strcat_chk) || defined(__GNUC__)
132#undef strcat
133/* char *strcat(char *s1, const char *s2) */
134#define strcat(dest, ...) \
135 __builtin___strcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
136#endif
137
138#if ! (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 32000)
139#if __has_builtin(__builtin___strncat_chk) || defined(__GNUC__)
140#undef strncat
141/* char *strncat(char *s1, const char *s2, size_t n) */
142#define strncat(dest, ...) \
143 __builtin___strncat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
144#endif
145#endif
146
147#undef __HAS_FIXED_CHK_PROTOTYPES
148
149#endif /* _USE_FORTIFY_LEVEL > 0 */
150#endif /* _SECURE__STRING_H_ */
lib/libc/include/aarch64-macos-gnu/secure/_strings.h created+59
......@@ -0,0 +1,59 @@
1/*
2 * Copyright (c) 2017 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 _STRINGS_H_
25# error "Never use <secure/_strings.h> directly; include <strings.h> instead."
26#endif
27
28#ifndef _SECURE__STRINGS_H_
29#define _SECURE__STRINGS_H_
30
31#include <sys/cdefs.h>
32#include <Availability.h>
33#include <secure/_common.h>
34
35#if _USE_FORTIFY_LEVEL > 0
36
37/* bcopy and bzero */
38
39/* Removed in Issue 7 */
40#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
41
42#if __has_builtin(__builtin___memmove_chk) || defined(__GNUC__)
43#undef bcopy
44/* void bcopy(const void *src, void *dst, size_t len) */
45#define bcopy(src, dest, ...) \
46 __builtin___memmove_chk (dest, src, __VA_ARGS__, __darwin_obsz0 (dest))
47#endif
48
49#if __has_builtin(__builtin___memset_chk) || defined(__GNUC__)
50#undef bzero
51/* void bzero(void *s, size_t n) */
52#define bzero(dest, ...) \
53 __builtin___memset_chk (dest, 0, __VA_ARGS__, __darwin_obsz0 (dest))
54#endif
55
56#endif
57
58#endif /* _USE_FORTIFY_LEVEL > 0 */
59#endif /* _SECURE__STRINGS_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/setjmp.h created+102
......@@ -0,0 +1,102 @@
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_SETJMP_H
24#define _BSD_SETJMP_H
25
26#include <sys/cdefs.h>
27#include <Availability.h>
28
29#if defined(__x86_64__)
30/*
31 * _JBLEN is number of ints required to save the following:
32 * rflags, rip, rbp, rsp, rbx, r12, r13, r14, r15... these are 8 bytes each
33 * mxcsr, fp control word, sigmask... these are 4 bytes each
34 * add 16 ints for future expansion needs...
35 */
36#define _JBLEN ((9 * 2) + 3 + 16)
37typedef int jmp_buf[_JBLEN];
38typedef int sigjmp_buf[_JBLEN + 1];
39
40#elif defined(__i386__)
41
42/*
43 * _JBLEN is number of ints required to save the following:
44 * eax, ebx, ecx, edx, edi, esi, ebp, esp, ss, eflags, eip,
45 * cs, de, es, fs, gs == 16 ints
46 * onstack, mask = 2 ints
47 */
48
49#define _JBLEN (18)
50typedef int jmp_buf[_JBLEN];
51typedef int sigjmp_buf[_JBLEN + 1];
52
53#elif defined(__arm__) && !defined(__ARM_ARCH_7K__)
54
55#include <machine/signal.h>
56
57/*
58 * _JBLEN is number of ints required to save the following:
59 * r4-r8, r10, fp, sp, lr, sig == 10 register_t sized
60 * s16-s31 == 16 register_t sized + 1 int for FSTMX
61 * 1 extra int for future use
62 */
63#define _JBLEN (10 + 16 + 2)
64#define _JBLEN_MAX _JBLEN
65
66typedef int jmp_buf[_JBLEN];
67typedef int sigjmp_buf[_JBLEN + 1];
68
69#elif defined(__arm64__) || defined(__ARM_ARCH_7K__)
70/*
71 * _JBLEN is the number of ints required to save the following:
72 * r21-r29, sp, fp, lr == 12 registers, 8 bytes each. d8-d15
73 * are another 8 registers, each 8 bytes long. (aapcs64 specifies
74 * that only 64-bit versions of FP registers need to be saved).
75 * Finally, two 8-byte fields for signal handling purposes.
76 */
77#define _JBLEN ((14 + 8 + 2) * 2)
78
79typedef int jmp_buf[_JBLEN];
80typedef int sigjmp_buf[_JBLEN + 1];
81
82#else
83# error Undefined platform for setjmp
84#endif
85
86__BEGIN_DECLS
87extern int setjmp(jmp_buf);
88extern void longjmp(jmp_buf, int) __dead2;
89
90#ifndef _ANSI_SOURCE
91int _setjmp(jmp_buf);
92void _longjmp(jmp_buf, int) __dead2;
93int sigsetjmp(sigjmp_buf, int);
94void siglongjmp(sigjmp_buf, int) __dead2;
95#endif /* _ANSI_SOURCE */
96
97#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
98void longjmperror(void);
99#endif /* neither ANSI nor POSIX */
100__END_DECLS
101
102#endif /* _BSD_SETJMP_H */
lib/libc/include/aarch64-macos-gnu/signal.h created+124
......@@ -0,0 +1,124 @@
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) 1991, 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 * @(#)signal.h 8.3 (Berkeley) 3/30/94
56 */
57
58#ifndef _USER_SIGNAL_H
59#define _USER_SIGNAL_H
60
61#include <sys/cdefs.h>
62#include <_types.h>
63#include <sys/signal.h>
64
65#include <sys/_pthread/_pthread_types.h>
66#include <sys/_pthread/_pthread_t.h>
67
68#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
69extern __const char *__const sys_signame[NSIG];
70extern __const char *__const sys_siglist[NSIG];
71#endif
72
73__BEGIN_DECLS
74int raise(int);
75__END_DECLS
76
77#ifndef _ANSI_SOURCE
78__BEGIN_DECLS
79void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);
80int kill(pid_t, int) __DARWIN_ALIAS(kill);
81int killpg(pid_t, int) __DARWIN_ALIAS(killpg);
82int pthread_kill(pthread_t, int);
83int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);
84int sigaction(int, const struct sigaction * __restrict,
85 struct sigaction * __restrict);
86int sigaddset(sigset_t *, int);
87int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
88int sigdelset(sigset_t *, int);
89int sigemptyset(sigset_t *);
90int sigfillset(sigset_t *);
91int sighold(int);
92int sigignore(int);
93int siginterrupt(int, int);
94int sigismember(const sigset_t *, int);
95int sigpause(int) __DARWIN_ALIAS_C(sigpause);
96int sigpending(sigset_t *);
97int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
98int sigrelse(int);
99void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
100int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend);
101int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
102#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
103void psignal(unsigned int, const char *);
104int sigblock(int);
105int sigsetmask(int);
106int sigvec(int, struct sigvec *, struct sigvec *);
107#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
108__END_DECLS
109
110/* List definitions after function declarations, or Reiser cpp gets upset. */
111__header_always_inline int
112__sigbits(int __signo)
113{
114 return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1));
115}
116
117#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0)
118#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0)
119#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0)
120#define sigemptyset(set) (*(set) = 0, 0)
121#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
122#endif /* !_ANSI_SOURCE */
123
124#endif /* !_USER_SIGNAL_H */
lib/libc/include/aarch64-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. */
111typedef bool simd_bool;
112#else
113/*! @abstract A boolean scalar. */
114typedef _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`. */
119typedef simd_bool __SIMD_BOOLEAN_TYPE__;
120
121# endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
122#endif /* defined SIMD_BASE */
lib/libc/include/aarch64-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
130extern "C" {
131#endif
132
133/*! @abstract The elementwise absolute value of x. */
134static inline SIMD_CFUNC simd_char2 simd_abs(simd_char2 x);
135/*! @abstract The elementwise absolute value of x. */
136static inline SIMD_CFUNC simd_char3 simd_abs(simd_char3 x);
137/*! @abstract The elementwise absolute value of x. */
138static inline SIMD_CFUNC simd_char4 simd_abs(simd_char4 x);
139/*! @abstract The elementwise absolute value of x. */
140static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x);
141/*! @abstract The elementwise absolute value of x. */
142static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x);
143/*! @abstract The elementwise absolute value of x. */
144static inline SIMD_CFUNC simd_char32 simd_abs(simd_char32 x);
145/*! @abstract The elementwise absolute value of x. */
146static inline SIMD_CFUNC simd_char64 simd_abs(simd_char64 x);
147/*! @abstract The elementwise absolute value of x. */
148static inline SIMD_CFUNC simd_short2 simd_abs(simd_short2 x);
149/*! @abstract The elementwise absolute value of x. */
150static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x);
151/*! @abstract The elementwise absolute value of x. */
152static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x);
153/*! @abstract The elementwise absolute value of x. */
154static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x);
155/*! @abstract The elementwise absolute value of x. */
156static inline SIMD_CFUNC simd_short16 simd_abs(simd_short16 x);
157/*! @abstract The elementwise absolute value of x. */
158static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x);
159/*! @abstract The elementwise absolute value of x. */
160static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x);
161/*! @abstract The elementwise absolute value of x. */
162static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x);
163/*! @abstract The elementwise absolute value of x. */
164static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x);
165/*! @abstract The elementwise absolute value of x. */
166static inline SIMD_CFUNC simd_int8 simd_abs(simd_int8 x);
167/*! @abstract The elementwise absolute value of x. */
168static inline SIMD_CFUNC simd_int16 simd_abs(simd_int16 x);
169/*! @abstract The elementwise absolute value of x. */
170static inline SIMD_CFUNC simd_float2 simd_abs(simd_float2 x);
171/*! @abstract The elementwise absolute value of x. */
172static inline SIMD_CFUNC simd_float3 simd_abs(simd_float3 x);
173/*! @abstract The elementwise absolute value of x. */
174static inline SIMD_CFUNC simd_float4 simd_abs(simd_float4 x);
175/*! @abstract The elementwise absolute value of x. */
176static inline SIMD_CFUNC simd_float8 simd_abs(simd_float8 x);
177/*! @abstract The elementwise absolute value of x. */
178static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x);
179/*! @abstract The elementwise absolute value of x. */
180static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x);
181/*! @abstract The elementwise absolute value of x. */
182static inline SIMD_CFUNC simd_long3 simd_abs(simd_long3 x);
183/*! @abstract The elementwise absolute value of x. */
184static inline SIMD_CFUNC simd_long4 simd_abs(simd_long4 x);
185/*! @abstract The elementwise absolute value of x. */
186static inline SIMD_CFUNC simd_long8 simd_abs(simd_long8 x);
187/*! @abstract The elementwise absolute value of x. */
188static inline SIMD_CFUNC simd_double2 simd_abs(simd_double2 x);
189/*! @abstract The elementwise absolute value of x. */
190static inline SIMD_CFUNC simd_double3 simd_abs(simd_double3 x);
191/*! @abstract The elementwise absolute value of x. */
192static inline SIMD_CFUNC simd_double4 simd_abs(simd_double4 x);
193/*! @abstract The elementwise absolute value of x. */
194static 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. */
200static inline SIMD_CFUNC simd_char2 simd_max(simd_char2 x, simd_char2 y);
201/*! @abstract The elementwise maximum of x and y. */
202static inline SIMD_CFUNC simd_char3 simd_max(simd_char3 x, simd_char3 y);
203/*! @abstract The elementwise maximum of x and y. */
204static inline SIMD_CFUNC simd_char4 simd_max(simd_char4 x, simd_char4 y);
205/*! @abstract The elementwise maximum of x and y. */
206static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y);
207/*! @abstract The elementwise maximum of x and y. */
208static inline SIMD_CFUNC simd_char16 simd_max(simd_char16 x, simd_char16 y);
209/*! @abstract The elementwise maximum of x and y. */
210static inline SIMD_CFUNC simd_char32 simd_max(simd_char32 x, simd_char32 y);
211/*! @abstract The elementwise maximum of x and y. */
212static inline SIMD_CFUNC simd_char64 simd_max(simd_char64 x, simd_char64 y);
213/*! @abstract The elementwise maximum of x and y. */
214static inline SIMD_CFUNC simd_uchar2 simd_max(simd_uchar2 x, simd_uchar2 y);
215/*! @abstract The elementwise maximum of x and y. */
216static inline SIMD_CFUNC simd_uchar3 simd_max(simd_uchar3 x, simd_uchar3 y);
217/*! @abstract The elementwise maximum of x and y. */
218static inline SIMD_CFUNC simd_uchar4 simd_max(simd_uchar4 x, simd_uchar4 y);
219/*! @abstract The elementwise maximum of x and y. */
220static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y);
221/*! @abstract The elementwise maximum of x and y. */
222static inline SIMD_CFUNC simd_uchar16 simd_max(simd_uchar16 x, simd_uchar16 y);
223/*! @abstract The elementwise maximum of x and y. */
224static inline SIMD_CFUNC simd_uchar32 simd_max(simd_uchar32 x, simd_uchar32 y);
225/*! @abstract The elementwise maximum of x and y. */
226static inline SIMD_CFUNC simd_uchar64 simd_max(simd_uchar64 x, simd_uchar64 y);
227/*! @abstract The elementwise maximum of x and y. */
228static inline SIMD_CFUNC simd_short2 simd_max(simd_short2 x, simd_short2 y);
229/*! @abstract The elementwise maximum of x and y. */
230static inline SIMD_CFUNC simd_short3 simd_max(simd_short3 x, simd_short3 y);
231/*! @abstract The elementwise maximum of x and y. */
232static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y);
233/*! @abstract The elementwise maximum of x and y. */
234static inline SIMD_CFUNC simd_short8 simd_max(simd_short8 x, simd_short8 y);
235/*! @abstract The elementwise maximum of x and y. */
236static inline SIMD_CFUNC simd_short16 simd_max(simd_short16 x, simd_short16 y);
237/*! @abstract The elementwise maximum of x and y. */
238static inline SIMD_CFUNC simd_short32 simd_max(simd_short32 x, simd_short32 y);
239/*! @abstract The elementwise maximum of x and y. */
240static inline SIMD_CFUNC simd_ushort2 simd_max(simd_ushort2 x, simd_ushort2 y);
241/*! @abstract The elementwise maximum of x and y. */
242static inline SIMD_CFUNC simd_ushort3 simd_max(simd_ushort3 x, simd_ushort3 y);
243/*! @abstract The elementwise maximum of x and y. */
244static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y);
245/*! @abstract The elementwise maximum of x and y. */
246static inline SIMD_CFUNC simd_ushort8 simd_max(simd_ushort8 x, simd_ushort8 y);
247/*! @abstract The elementwise maximum of x and y. */
248static inline SIMD_CFUNC simd_ushort16 simd_max(simd_ushort16 x, simd_ushort16 y);
249/*! @abstract The elementwise maximum of x and y. */
250static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y);
251/*! @abstract The elementwise maximum of x and y. */
252static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y);
253/*! @abstract The elementwise maximum of x and y. */
254static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y);
255/*! @abstract The elementwise maximum of x and y. */
256static inline SIMD_CFUNC simd_int4 simd_max(simd_int4 x, simd_int4 y);
257/*! @abstract The elementwise maximum of x and y. */
258static inline SIMD_CFUNC simd_int8 simd_max(simd_int8 x, simd_int8 y);
259/*! @abstract The elementwise maximum of x and y. */
260static inline SIMD_CFUNC simd_int16 simd_max(simd_int16 x, simd_int16 y);
261/*! @abstract The elementwise maximum of x and y. */
262static inline SIMD_CFUNC simd_uint2 simd_max(simd_uint2 x, simd_uint2 y);
263/*! @abstract The elementwise maximum of x and y. */
264static inline SIMD_CFUNC simd_uint3 simd_max(simd_uint3 x, simd_uint3 y);
265/*! @abstract The elementwise maximum of x and y. */
266static inline SIMD_CFUNC simd_uint4 simd_max(simd_uint4 x, simd_uint4 y);
267/*! @abstract The elementwise maximum of x and y. */
268static inline SIMD_CFUNC simd_uint8 simd_max(simd_uint8 x, simd_uint8 y);
269/*! @abstract The elementwise maximum of x and y. */
270static inline SIMD_CFUNC simd_uint16 simd_max(simd_uint16 x, simd_uint16 y);
271/*! @abstract The elementwise maximum of x and y. */
272static inline SIMD_CFUNC float simd_max(float x, float y);
273/*! @abstract The elementwise maximum of x and y. */
274static inline SIMD_CFUNC simd_float2 simd_max(simd_float2 x, simd_float2 y);
275/*! @abstract The elementwise maximum of x and y. */
276static inline SIMD_CFUNC simd_float3 simd_max(simd_float3 x, simd_float3 y);
277/*! @abstract The elementwise maximum of x and y. */
278static inline SIMD_CFUNC simd_float4 simd_max(simd_float4 x, simd_float4 y);
279/*! @abstract The elementwise maximum of x and y. */
280static inline SIMD_CFUNC simd_float8 simd_max(simd_float8 x, simd_float8 y);
281/*! @abstract The elementwise maximum of x and y. */
282static inline SIMD_CFUNC simd_float16 simd_max(simd_float16 x, simd_float16 y);
283/*! @abstract The elementwise maximum of x and y. */
284static inline SIMD_CFUNC simd_long2 simd_max(simd_long2 x, simd_long2 y);
285/*! @abstract The elementwise maximum of x and y. */
286static inline SIMD_CFUNC simd_long3 simd_max(simd_long3 x, simd_long3 y);
287/*! @abstract The elementwise maximum of x and y. */
288static inline SIMD_CFUNC simd_long4 simd_max(simd_long4 x, simd_long4 y);
289/*! @abstract The elementwise maximum of x and y. */
290static inline SIMD_CFUNC simd_long8 simd_max(simd_long8 x, simd_long8 y);
291/*! @abstract The elementwise maximum of x and y. */
292static inline SIMD_CFUNC simd_ulong2 simd_max(simd_ulong2 x, simd_ulong2 y);
293/*! @abstract The elementwise maximum of x and y. */
294static inline SIMD_CFUNC simd_ulong3 simd_max(simd_ulong3 x, simd_ulong3 y);
295/*! @abstract The elementwise maximum of x and y. */
296static inline SIMD_CFUNC simd_ulong4 simd_max(simd_ulong4 x, simd_ulong4 y);
297/*! @abstract The elementwise maximum of x and y. */
298static inline SIMD_CFUNC simd_ulong8 simd_max(simd_ulong8 x, simd_ulong8 y);
299/*! @abstract The elementwise maximum of x and y. */
300static inline SIMD_CFUNC double simd_max(double x, double y);
301/*! @abstract The elementwise maximum of x and y. */
302static inline SIMD_CFUNC simd_double2 simd_max(simd_double2 x, simd_double2 y);
303/*! @abstract The elementwise maximum of x and y. */
304static inline SIMD_CFUNC simd_double3 simd_max(simd_double3 x, simd_double3 y);
305/*! @abstract The elementwise maximum of x and y. */
306static inline SIMD_CFUNC simd_double4 simd_max(simd_double4 x, simd_double4 y);
307/*! @abstract The elementwise maximum of x and y. */
308static 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. */
314static inline SIMD_CFUNC simd_char2 simd_min(simd_char2 x, simd_char2 y);
315/*! @abstract The elementwise minimum of x and y. */
316static inline SIMD_CFUNC simd_char3 simd_min(simd_char3 x, simd_char3 y);
317/*! @abstract The elementwise minimum of x and y. */
318static inline SIMD_CFUNC simd_char4 simd_min(simd_char4 x, simd_char4 y);
319/*! @abstract The elementwise minimum of x and y. */
320static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y);
321/*! @abstract The elementwise minimum of x and y. */
322static inline SIMD_CFUNC simd_char16 simd_min(simd_char16 x, simd_char16 y);
323/*! @abstract The elementwise minimum of x and y. */
324static inline SIMD_CFUNC simd_char32 simd_min(simd_char32 x, simd_char32 y);
325/*! @abstract The elementwise minimum of x and y. */
326static inline SIMD_CFUNC simd_char64 simd_min(simd_char64 x, simd_char64 y);
327/*! @abstract The elementwise minimum of x and y. */
328static inline SIMD_CFUNC simd_uchar2 simd_min(simd_uchar2 x, simd_uchar2 y);
329/*! @abstract The elementwise minimum of x and y. */
330static inline SIMD_CFUNC simd_uchar3 simd_min(simd_uchar3 x, simd_uchar3 y);
331/*! @abstract The elementwise minimum of x and y. */
332static inline SIMD_CFUNC simd_uchar4 simd_min(simd_uchar4 x, simd_uchar4 y);
333/*! @abstract The elementwise minimum of x and y. */
334static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y);
335/*! @abstract The elementwise minimum of x and y. */
336static inline SIMD_CFUNC simd_uchar16 simd_min(simd_uchar16 x, simd_uchar16 y);
337/*! @abstract The elementwise minimum of x and y. */
338static inline SIMD_CFUNC simd_uchar32 simd_min(simd_uchar32 x, simd_uchar32 y);
339/*! @abstract The elementwise minimum of x and y. */
340static inline SIMD_CFUNC simd_uchar64 simd_min(simd_uchar64 x, simd_uchar64 y);
341/*! @abstract The elementwise minimum of x and y. */
342static inline SIMD_CFUNC simd_short2 simd_min(simd_short2 x, simd_short2 y);
343/*! @abstract The elementwise minimum of x and y. */
344static inline SIMD_CFUNC simd_short3 simd_min(simd_short3 x, simd_short3 y);
345/*! @abstract The elementwise minimum of x and y. */
346static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y);
347/*! @abstract The elementwise minimum of x and y. */
348static inline SIMD_CFUNC simd_short8 simd_min(simd_short8 x, simd_short8 y);
349/*! @abstract The elementwise minimum of x and y. */
350static inline SIMD_CFUNC simd_short16 simd_min(simd_short16 x, simd_short16 y);
351/*! @abstract The elementwise minimum of x and y. */
352static inline SIMD_CFUNC simd_short32 simd_min(simd_short32 x, simd_short32 y);
353/*! @abstract The elementwise minimum of x and y. */
354static inline SIMD_CFUNC simd_ushort2 simd_min(simd_ushort2 x, simd_ushort2 y);
355/*! @abstract The elementwise minimum of x and y. */
356static inline SIMD_CFUNC simd_ushort3 simd_min(simd_ushort3 x, simd_ushort3 y);
357/*! @abstract The elementwise minimum of x and y. */
358static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y);
359/*! @abstract The elementwise minimum of x and y. */
360static inline SIMD_CFUNC simd_ushort8 simd_min(simd_ushort8 x, simd_ushort8 y);
361/*! @abstract The elementwise minimum of x and y. */
362static inline SIMD_CFUNC simd_ushort16 simd_min(simd_ushort16 x, simd_ushort16 y);
363/*! @abstract The elementwise minimum of x and y. */
364static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y);
365/*! @abstract The elementwise minimum of x and y. */
366static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y);
367/*! @abstract The elementwise minimum of x and y. */
368static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y);
369/*! @abstract The elementwise minimum of x and y. */
370static inline SIMD_CFUNC simd_int4 simd_min(simd_int4 x, simd_int4 y);
371/*! @abstract The elementwise minimum of x and y. */
372static inline SIMD_CFUNC simd_int8 simd_min(simd_int8 x, simd_int8 y);
373/*! @abstract The elementwise minimum of x and y. */
374static inline SIMD_CFUNC simd_int16 simd_min(simd_int16 x, simd_int16 y);
375/*! @abstract The elementwise minimum of x and y. */
376static inline SIMD_CFUNC simd_uint2 simd_min(simd_uint2 x, simd_uint2 y);
377/*! @abstract The elementwise minimum of x and y. */
378static inline SIMD_CFUNC simd_uint3 simd_min(simd_uint3 x, simd_uint3 y);
379/*! @abstract The elementwise minimum of x and y. */
380static inline SIMD_CFUNC simd_uint4 simd_min(simd_uint4 x, simd_uint4 y);
381/*! @abstract The elementwise minimum of x and y. */
382static inline SIMD_CFUNC simd_uint8 simd_min(simd_uint8 x, simd_uint8 y);
383/*! @abstract The elementwise minimum of x and y. */
384static inline SIMD_CFUNC simd_uint16 simd_min(simd_uint16 x, simd_uint16 y);
385/*! @abstract The elementwise minimum of x and y. */
386static inline SIMD_CFUNC float simd_min(float x, float y);
387/*! @abstract The elementwise minimum of x and y. */
388static inline SIMD_CFUNC simd_float2 simd_min(simd_float2 x, simd_float2 y);
389/*! @abstract The elementwise minimum of x and y. */
390static inline SIMD_CFUNC simd_float3 simd_min(simd_float3 x, simd_float3 y);
391/*! @abstract The elementwise minimum of x and y. */
392static inline SIMD_CFUNC simd_float4 simd_min(simd_float4 x, simd_float4 y);
393/*! @abstract The elementwise minimum of x and y. */
394static inline SIMD_CFUNC simd_float8 simd_min(simd_float8 x, simd_float8 y);
395/*! @abstract The elementwise minimum of x and y. */
396static inline SIMD_CFUNC simd_float16 simd_min(simd_float16 x, simd_float16 y);
397/*! @abstract The elementwise minimum of x and y. */
398static inline SIMD_CFUNC simd_long2 simd_min(simd_long2 x, simd_long2 y);
399/*! @abstract The elementwise minimum of x and y. */
400static inline SIMD_CFUNC simd_long3 simd_min(simd_long3 x, simd_long3 y);
401/*! @abstract The elementwise minimum of x and y. */
402static inline SIMD_CFUNC simd_long4 simd_min(simd_long4 x, simd_long4 y);
403/*! @abstract The elementwise minimum of x and y. */
404static inline SIMD_CFUNC simd_long8 simd_min(simd_long8 x, simd_long8 y);
405/*! @abstract The elementwise minimum of x and y. */
406static inline SIMD_CFUNC simd_ulong2 simd_min(simd_ulong2 x, simd_ulong2 y);
407/*! @abstract The elementwise minimum of x and y. */
408static inline SIMD_CFUNC simd_ulong3 simd_min(simd_ulong3 x, simd_ulong3 y);
409/*! @abstract The elementwise minimum of x and y. */
410static inline SIMD_CFUNC simd_ulong4 simd_min(simd_ulong4 x, simd_ulong4 y);
411/*! @abstract The elementwise minimum of x and y. */
412static inline SIMD_CFUNC simd_ulong8 simd_min(simd_ulong8 x, simd_ulong8 y);
413/*! @abstract The elementwise minimum of x and y. */
414static inline SIMD_CFUNC double simd_min(double x, double y);
415/*! @abstract The elementwise minimum of x and y. */
416static inline SIMD_CFUNC simd_double2 simd_min(simd_double2 x, simd_double2 y);
417/*! @abstract The elementwise minimum of x and y. */
418static inline SIMD_CFUNC simd_double3 simd_min(simd_double3 x, simd_double3 y);
419/*! @abstract The elementwise minimum of x and y. */
420static inline SIMD_CFUNC simd_double4 simd_min(simd_double4 x, simd_double4 y);
421/*! @abstract The elementwise minimum of x and y. */
422static 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. */
431static 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. */
435static 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. */
439static 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. */
443static 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. */
447static 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. */
451static 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. */
455static 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. */
459static 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. */
463static 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. */
467static 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. */
471static 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. */
475static 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. */
479static 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. */
483static 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. */
487static 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. */
491static 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. */
495static 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. */
499static 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. */
503static 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. */
507static 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. */
511static 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. */
515static 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. */
519static 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. */
523static 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. */
527static 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. */
531static 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. */
535static 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. */
539static 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. */
543static 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. */
547static 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. */
551static 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. */
555static 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. */
559static 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. */
563static 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. */
567static 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. */
571static 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. */
575static 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. */
579static 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. */
583static 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. */
587static 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. */
591static 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. */
595static 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. */
599static 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. */
603static 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. */
607static 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. */
611static 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. */
615static 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. */
619static 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. */
623static 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. */
627static 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. */
631static 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. */
635static 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. */
639static 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. */
643static 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. */
647static 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. */
653static inline SIMD_CFUNC float simd_sign(float x);
654/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
655static 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. */
657static 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. */
659static 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. */
661static 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. */
663static 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. */
665static inline SIMD_CFUNC double simd_sign(double x);
666/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
667static 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. */
669static 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. */
671static 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. */
673static 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 */
680static 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 */
683static 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 */
686static 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 */
689static 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 */
692static 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 */
695static 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 */
698static 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 */
701static 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 */
704static 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 */
707static 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 */
710static 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). */
720static 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). */
725static 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). */
730static 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). */
735static 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). */
740static 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). */
745static 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). */
750static 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). */
755static 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). */
760static 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). */
765static 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). */
770static 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. */
779static 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. */
784static 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. */
789static 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. */
794static 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. */
799static 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. */
804static 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. */
809static 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. */
814static 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. */
819static 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. */
824static 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. */
829static 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. */
839static 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. */
845static 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. */
851static 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. */
857static 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. */
863static 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. */
869static 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. */
875static 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. */
881static 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. */
887static 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. */
893static 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. */
899static 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). */
907static 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). */
911static 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). */
915static 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). */
919static 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). */
923static 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). */
927static 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). */
931static 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). */
935static 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). */
939static 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). */
943static 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). */
947static 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. */
955static 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. */
959static 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. */
963static 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. */
967static 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. */
971static 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. */
975static 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. */
979static 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. */
983static 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. */
987static 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. */
991static 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. */
995static 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. */
1003static 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. */
1007static 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. */
1011static 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. */
1015static 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. */
1019static 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. */
1023static 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. */
1027static 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. */
1031static 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. */
1035static 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. */
1039static 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. */
1043static 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. */
1051static 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. */
1055static 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. */
1059static 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. */
1063static 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. */
1067static 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. */
1071static 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. */
1075static 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. */
1079static 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. */
1083static 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. */
1087static 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. */
1091static 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. */
1099static 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. */
1103static 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. */
1107static 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. */
1111static 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. */
1115static 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. */
1119static 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. */
1123static 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. */
1127static 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. */
1131static 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. */
1135static 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. */
1139static 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. */
1147static 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. */
1151static 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. */
1155static 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. */
1159static 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. */
1163static 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. */
1167static 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. */
1171static 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. */
1175static 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. */
1179static 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. */
1183static 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. */
1187static 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. */
1195static 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. */
1199static 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. */
1203static 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. */
1207static 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. */
1211static 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. */
1215static 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. */
1219static 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. */
1223static 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. */
1227static 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. */
1231static 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. */
1235static 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. */
1239static 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. */
1243static 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. */
1247static 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. */
1251static 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. */
1255static 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. */
1259static 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. */
1263static 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. */
1267static 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. */
1271static 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. */
1275static 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. */
1279static 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. */
1283static 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. */
1287static 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. */
1291static 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. */
1295static 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. */
1299static 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. */
1303static 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. */
1307static 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. */
1311static 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. */
1315static 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. */
1319static 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. */
1323static 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. */
1327static 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. */
1331static 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. */
1335static 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. */
1339static 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. */
1343static 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. */
1347static 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. */
1351static 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. */
1355static 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. */
1359static 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. */
1363static 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. */
1367static 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. */
1371static 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. */
1375static 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. */
1379static 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. */
1383static 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. */
1387static 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. */
1391static 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. */
1395static 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. */
1399static 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. */
1403static 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. */
1409static inline SIMD_CFUNC char simd_reduce_min(simd_char2 x);
1410/*! @abstract Minimum of elements in x. */
1411static inline SIMD_CFUNC char simd_reduce_min(simd_char3 x);
1412/*! @abstract Minimum of elements in x. */
1413static inline SIMD_CFUNC char simd_reduce_min(simd_char4 x);
1414/*! @abstract Minimum of elements in x. */
1415static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x);
1416/*! @abstract Minimum of elements in x. */
1417static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x);
1418/*! @abstract Minimum of elements in x. */
1419static inline SIMD_CFUNC char simd_reduce_min(simd_char32 x);
1420/*! @abstract Minimum of elements in x. */
1421static inline SIMD_CFUNC char simd_reduce_min(simd_char64 x);
1422/*! @abstract Minimum of elements in x. */
1423static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar2 x);
1424/*! @abstract Minimum of elements in x. */
1425static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar3 x);
1426/*! @abstract Minimum of elements in x. */
1427static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar4 x);
1428/*! @abstract Minimum of elements in x. */
1429static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar8 x);
1430/*! @abstract Minimum of elements in x. */
1431static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x);
1432/*! @abstract Minimum of elements in x. */
1433static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar32 x);
1434/*! @abstract Minimum of elements in x. */
1435static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar64 x);
1436/*! @abstract Minimum of elements in x. */
1437static inline SIMD_CFUNC short simd_reduce_min(simd_short2 x);
1438/*! @abstract Minimum of elements in x. */
1439static inline SIMD_CFUNC short simd_reduce_min(simd_short3 x);
1440/*! @abstract Minimum of elements in x. */
1441static inline SIMD_CFUNC short simd_reduce_min(simd_short4 x);
1442/*! @abstract Minimum of elements in x. */
1443static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x);
1444/*! @abstract Minimum of elements in x. */
1445static inline SIMD_CFUNC short simd_reduce_min(simd_short16 x);
1446/*! @abstract Minimum of elements in x. */
1447static inline SIMD_CFUNC short simd_reduce_min(simd_short32 x);
1448/*! @abstract Minimum of elements in x. */
1449static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort2 x);
1450/*! @abstract Minimum of elements in x. */
1451static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort3 x);
1452/*! @abstract Minimum of elements in x. */
1453static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort4 x);
1454/*! @abstract Minimum of elements in x. */
1455static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x);
1456/*! @abstract Minimum of elements in x. */
1457static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort16 x);
1458/*! @abstract Minimum of elements in x. */
1459static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x);
1460/*! @abstract Minimum of elements in x. */
1461static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x);
1462/*! @abstract Minimum of elements in x. */
1463static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x);
1464/*! @abstract Minimum of elements in x. */
1465static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x);
1466/*! @abstract Minimum of elements in x. */
1467static inline SIMD_CFUNC int simd_reduce_min(simd_int8 x);
1468/*! @abstract Minimum of elements in x. */
1469static inline SIMD_CFUNC int simd_reduce_min(simd_int16 x);
1470/*! @abstract Minimum of elements in x. */
1471static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint2 x);
1472/*! @abstract Minimum of elements in x. */
1473static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint3 x);
1474/*! @abstract Minimum of elements in x. */
1475static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x);
1476/*! @abstract Minimum of elements in x. */
1477static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint8 x);
1478/*! @abstract Minimum of elements in x. */
1479static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint16 x);
1480/*! @abstract Minimum of elements in x. */
1481static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x);
1482/*! @abstract Minimum of elements in x. */
1483static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x);
1484/*! @abstract Minimum of elements in x. */
1485static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x);
1486/*! @abstract Minimum of elements in x. */
1487static inline SIMD_CFUNC float simd_reduce_min(simd_float8 x);
1488/*! @abstract Minimum of elements in x. */
1489static inline SIMD_CFUNC float simd_reduce_min(simd_float16 x);
1490/*! @abstract Minimum of elements in x. */
1491static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long2 x);
1492/*! @abstract Minimum of elements in x. */
1493static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long3 x);
1494/*! @abstract Minimum of elements in x. */
1495static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long4 x);
1496/*! @abstract Minimum of elements in x. */
1497static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long8 x);
1498/*! @abstract Minimum of elements in x. */
1499static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong2 x);
1500/*! @abstract Minimum of elements in x. */
1501static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong3 x);
1502/*! @abstract Minimum of elements in x. */
1503static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong4 x);
1504/*! @abstract Minimum of elements in x. */
1505static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong8 x);
1506/*! @abstract Minimum of elements in x. */
1507static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x);
1508/*! @abstract Minimum of elements in x. */
1509static inline SIMD_CFUNC double simd_reduce_min(simd_double3 x);
1510/*! @abstract Minimum of elements in x. */
1511static inline SIMD_CFUNC double simd_reduce_min(simd_double4 x);
1512/*! @abstract Minimum of elements in x. */
1513static 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. */
1519static inline SIMD_CFUNC char simd_reduce_max(simd_char2 x);
1520/*! @abstract Maximum of elements in x. */
1521static inline SIMD_CFUNC char simd_reduce_max(simd_char3 x);
1522/*! @abstract Maximum of elements in x. */
1523static inline SIMD_CFUNC char simd_reduce_max(simd_char4 x);
1524/*! @abstract Maximum of elements in x. */
1525static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x);
1526/*! @abstract Maximum of elements in x. */
1527static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x);
1528/*! @abstract Maximum of elements in x. */
1529static inline SIMD_CFUNC char simd_reduce_max(simd_char32 x);
1530/*! @abstract Maximum of elements in x. */
1531static inline SIMD_CFUNC char simd_reduce_max(simd_char64 x);
1532/*! @abstract Maximum of elements in x. */
1533static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar2 x);
1534/*! @abstract Maximum of elements in x. */
1535static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar3 x);
1536/*! @abstract Maximum of elements in x. */
1537static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar4 x);
1538/*! @abstract Maximum of elements in x. */
1539static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar8 x);
1540/*! @abstract Maximum of elements in x. */
1541static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x);
1542/*! @abstract Maximum of elements in x. */
1543static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar32 x);
1544/*! @abstract Maximum of elements in x. */
1545static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar64 x);
1546/*! @abstract Maximum of elements in x. */
1547static inline SIMD_CFUNC short simd_reduce_max(simd_short2 x);
1548/*! @abstract Maximum of elements in x. */
1549static inline SIMD_CFUNC short simd_reduce_max(simd_short3 x);
1550/*! @abstract Maximum of elements in x. */
1551static inline SIMD_CFUNC short simd_reduce_max(simd_short4 x);
1552/*! @abstract Maximum of elements in x. */
1553static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x);
1554/*! @abstract Maximum of elements in x. */
1555static inline SIMD_CFUNC short simd_reduce_max(simd_short16 x);
1556/*! @abstract Maximum of elements in x. */
1557static inline SIMD_CFUNC short simd_reduce_max(simd_short32 x);
1558/*! @abstract Maximum of elements in x. */
1559static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort2 x);
1560/*! @abstract Maximum of elements in x. */
1561static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort3 x);
1562/*! @abstract Maximum of elements in x. */
1563static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort4 x);
1564/*! @abstract Maximum of elements in x. */
1565static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x);
1566/*! @abstract Maximum of elements in x. */
1567static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort16 x);
1568/*! @abstract Maximum of elements in x. */
1569static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x);
1570/*! @abstract Maximum of elements in x. */
1571static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x);
1572/*! @abstract Maximum of elements in x. */
1573static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x);
1574/*! @abstract Maximum of elements in x. */
1575static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x);
1576/*! @abstract Maximum of elements in x. */
1577static inline SIMD_CFUNC int simd_reduce_max(simd_int8 x);
1578/*! @abstract Maximum of elements in x. */
1579static inline SIMD_CFUNC int simd_reduce_max(simd_int16 x);
1580/*! @abstract Maximum of elements in x. */
1581static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint2 x);
1582/*! @abstract Maximum of elements in x. */
1583static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint3 x);
1584/*! @abstract Maximum of elements in x. */
1585static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x);
1586/*! @abstract Maximum of elements in x. */
1587static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint8 x);
1588/*! @abstract Maximum of elements in x. */
1589static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint16 x);
1590/*! @abstract Maximum of elements in x. */
1591static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x);
1592/*! @abstract Maximum of elements in x. */
1593static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x);
1594/*! @abstract Maximum of elements in x. */
1595static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x);
1596/*! @abstract Maximum of elements in x. */
1597static inline SIMD_CFUNC float simd_reduce_max(simd_float8 x);
1598/*! @abstract Maximum of elements in x. */
1599static inline SIMD_CFUNC float simd_reduce_max(simd_float16 x);
1600/*! @abstract Maximum of elements in x. */
1601static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long2 x);
1602/*! @abstract Maximum of elements in x. */
1603static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long3 x);
1604/*! @abstract Maximum of elements in x. */
1605static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long4 x);
1606/*! @abstract Maximum of elements in x. */
1607static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long8 x);
1608/*! @abstract Maximum of elements in x. */
1609static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong2 x);
1610/*! @abstract Maximum of elements in x. */
1611static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong3 x);
1612/*! @abstract Maximum of elements in x. */
1613static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong4 x);
1614/*! @abstract Maximum of elements in x. */
1615static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong8 x);
1616/*! @abstract Maximum of elements in x. */
1617static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x);
1618/*! @abstract Maximum of elements in x. */
1619static inline SIMD_CFUNC double simd_reduce_max(simd_double3 x);
1620/*! @abstract Maximum of elements in x. */
1621static inline SIMD_CFUNC double simd_reduce_max(simd_double4 x);
1622/*! @abstract Maximum of elements in x. */
1623static 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. */
1630static 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. */
1635static 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. */
1640static 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. */
1645static 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. */
1650static 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. */
1655static 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. */
1660static 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. */
1665static 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. */
1670static 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. */
1675static 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. */
1680static 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. */
1685static 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. */
1690static 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. */
1695static 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. */
1700static 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. */
1705static 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. */
1710static 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. */
1715static 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. */
1720static 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. */
1725static 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. */
1730static 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. */
1735static 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. */
1740static 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. */
1745static 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. */
1750static 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. */
1755static 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. */
1760static 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. */
1765static 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. */
1770static 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. */
1775static 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. */
1780static 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. */
1785static 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. */
1790static 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. */
1795static 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. */
1800static 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. */
1805static 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. */
1810static 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. */
1815static 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. */
1820static 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. */
1825static 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. */
1830static 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. */
1835static 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. */
1840static 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. */
1845static 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. */
1850static 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. */
1855static 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. */
1860static 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. */
1865static 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. */
1870static 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. */
1875static 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. */
1880static 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. */
1885static 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. */
1890static 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
1897namespace 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
1951extern "C" {
1952#endif /* __cplusplus */
1953
1954#pragma mark - Implementation
1955
1956static inline SIMD_CFUNC simd_char2 simd_abs(simd_char2 x) {
1957 return simd_make_char2(simd_abs(simd_make_char8_undef(x)));
1958}
1959
1960static inline SIMD_CFUNC simd_char3 simd_abs(simd_char3 x) {
1961 return simd_make_char3(simd_abs(simd_make_char8_undef(x)));
1962}
1963
1964static inline SIMD_CFUNC simd_char4 simd_abs(simd_char4 x) {
1965 return simd_make_char4(simd_abs(simd_make_char8_undef(x)));
1966}
1967
1968static 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
1976static 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
1986static 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
1994static 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
2002static inline SIMD_CFUNC simd_short2 simd_abs(simd_short2 x) {
2003 return simd_make_short2(simd_abs(simd_make_short4_undef(x)));
2004}
2005
2006static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x) {
2007 return simd_make_short3(simd_abs(simd_make_short4_undef(x)));
2008}
2009
2010static 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
2018static 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
2028static 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
2036static 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
2044static 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
2052static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x) {
2053 return simd_make_int3(simd_abs(simd_make_int4_undef(x)));
2054}
2055
2056static 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
2066static 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
2074static 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
2082static inline SIMD_CFUNC simd_float2 simd_abs(simd_float2 x) {
2083 return __tg_fabs(x);
2084}
2085
2086static inline SIMD_CFUNC simd_float3 simd_abs(simd_float3 x) {
2087 return __tg_fabs(x);
2088}
2089
2090static inline SIMD_CFUNC simd_float4 simd_abs(simd_float4 x) {
2091 return __tg_fabs(x);
2092}
2093
2094static inline SIMD_CFUNC simd_float8 simd_abs(simd_float8 x) {
2095 return __tg_fabs(x);
2096}
2097
2098static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x) {
2099 return __tg_fabs(x);
2100}
2101
2102static 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
2112static inline SIMD_CFUNC simd_long3 simd_abs(simd_long3 x) {
2113 return simd_make_long3(simd_abs(simd_make_long4_undef(x)));
2114}
2115
2116static 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
2124static 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
2132static inline SIMD_CFUNC simd_double2 simd_abs(simd_double2 x) {
2133 return __tg_fabs(x);
2134}
2135
2136static inline SIMD_CFUNC simd_double3 simd_abs(simd_double3 x) {
2137 return __tg_fabs(x);
2138}
2139
2140static inline SIMD_CFUNC simd_double4 simd_abs(simd_double4 x) {
2141 return __tg_fabs(x);
2142}
2143
2144static inline SIMD_CFUNC simd_double8 simd_abs(simd_double8 x) {
2145 return __tg_fabs(x);
2146}
2147
2148static 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
2152static 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
2156static 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
2160static 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
2169static 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
2179static 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
2187static 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
2195static 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
2199static 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
2203static 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
2207static 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
2216static 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
2226static 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
2234static 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
2242static 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
2246static 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
2250static 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
2259static 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
2269static 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
2277static 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
2285static 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
2289static 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
2293static 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
2302static 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
2312static 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
2320static 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
2328static 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
2337static 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
2341static 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
2351static 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
2359static 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
2367static 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
2376static 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
2380static 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
2390static 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
2398static 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
2406static inline SIMD_CFUNC float simd_min(float x, float y) {
2407 return __tg_fmin(x,y);
2408}
2409
2410static inline SIMD_CFUNC simd_float2 simd_min(simd_float2 x, simd_float2 y) {
2411 return __tg_fmin(x,y);
2412}
2413
2414static inline SIMD_CFUNC simd_float3 simd_min(simd_float3 x, simd_float3 y) {
2415 return __tg_fmin(x,y);
2416}
2417
2418static inline SIMD_CFUNC simd_float4 simd_min(simd_float4 x, simd_float4 y) {
2419 return __tg_fmin(x,y);
2420}
2421
2422static inline SIMD_CFUNC simd_float8 simd_min(simd_float8 x, simd_float8 y) {
2423 return __tg_fmin(x,y);
2424}
2425
2426static inline SIMD_CFUNC simd_float16 simd_min(simd_float16 x, simd_float16 y) {
2427 return __tg_fmin(x,y);
2428}
2429
2430static 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
2438static 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
2442static 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
2450static 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
2458static 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
2466static 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
2470static 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
2478static 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
2486static inline SIMD_CFUNC double simd_min(double x, double y) {
2487 return __tg_fmin(x,y);
2488}
2489
2490static inline SIMD_CFUNC simd_double2 simd_min(simd_double2 x, simd_double2 y) {
2491 return __tg_fmin(x,y);
2492}
2493
2494static inline SIMD_CFUNC simd_double3 simd_min(simd_double3 x, simd_double3 y) {
2495 return __tg_fmin(x,y);
2496}
2497
2498static inline SIMD_CFUNC simd_double4 simd_min(simd_double4 x, simd_double4 y) {
2499 return __tg_fmin(x,y);
2500}
2501
2502static inline SIMD_CFUNC simd_double8 simd_min(simd_double8 x, simd_double8 y) {
2503 return __tg_fmin(x,y);
2504}
2505
2506static 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
2510static 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
2514static 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
2518static 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
2527static 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
2537static 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
2545static 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
2553static 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
2557static 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
2561static 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
2565static 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
2574static 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
2584static 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
2592static 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
2600static 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
2604static 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
2608static 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
2617static 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
2627static 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
2635static 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
2643static 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
2647static 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
2651static 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
2660static 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
2670static 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
2678static 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
2686static 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
2695static 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
2699static 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
2709static 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
2717static 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
2725static 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
2734static 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
2738static 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
2748static 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
2756static 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
2764static inline SIMD_CFUNC float simd_max(float x, float y) {
2765 return __tg_fmax(x,y);
2766}
2767
2768static inline SIMD_CFUNC simd_float2 simd_max(simd_float2 x, simd_float2 y) {
2769 return __tg_fmax(x,y);
2770}
2771
2772static inline SIMD_CFUNC simd_float3 simd_max(simd_float3 x, simd_float3 y) {
2773 return __tg_fmax(x,y);
2774}
2775
2776static inline SIMD_CFUNC simd_float4 simd_max(simd_float4 x, simd_float4 y) {
2777 return __tg_fmax(x,y);
2778}
2779
2780static inline SIMD_CFUNC simd_float8 simd_max(simd_float8 x, simd_float8 y) {
2781 return __tg_fmax(x,y);
2782}
2783
2784static inline SIMD_CFUNC simd_float16 simd_max(simd_float16 x, simd_float16 y) {
2785 return __tg_fmax(x,y);
2786}
2787
2788static 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
2796static 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
2800static 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
2808static 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
2816static 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
2824static 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
2828static 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
2836static 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
2844static inline SIMD_CFUNC double simd_max(double x, double y) {
2845 return __tg_fmax(x,y);
2846}
2847
2848static inline SIMD_CFUNC simd_double2 simd_max(simd_double2 x, simd_double2 y) {
2849 return __tg_fmax(x,y);
2850}
2851
2852static inline SIMD_CFUNC simd_double3 simd_max(simd_double3 x, simd_double3 y) {
2853 return __tg_fmax(x,y);
2854}
2855
2856static inline SIMD_CFUNC simd_double4 simd_max(simd_double4 x, simd_double4 y) {
2857 return __tg_fmax(x,y);
2858}
2859
2860static inline SIMD_CFUNC simd_double8 simd_max(simd_double8 x, simd_double8 y) {
2861 return __tg_fmax(x,y);
2862}
2863
2864static 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
2868static 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
2872static 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
2876static 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
2880static 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
2884static 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
2888static 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
2892static 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
2896static 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
2900static 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
2904static 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
2908static 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
2912static 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
2916static 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
2920static 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
2924static 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
2928static 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
2932static 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
2936static 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
2940static 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
2944static 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
2948static 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
2952static 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
2956static 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
2960static 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
2964static 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
2968static 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
2972static 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
2976static 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
2980static 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
2984static 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
2988static 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
2992static 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
2996static 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
3000static 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
3004static 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
3008static inline SIMD_CFUNC float simd_clamp(float x, float min, float max) {
3009 return simd_min(simd_max(x, min), max);
3010}
3011
3012static 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
3016static 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
3020static 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
3024static 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
3028static 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
3032static 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
3036static 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
3040static 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
3044static 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
3048static 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
3052static 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
3056static 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
3060static 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
3064static inline SIMD_CFUNC double simd_clamp(double x, double min, double max) {
3065 return simd_min(simd_max(x, min), max);
3066}
3067
3068static 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
3072static 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
3076static 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
3080static 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
3085static inline SIMD_CFUNC float simd_sign(float x) {
3086 return (x == 0 | x != x) ? 0 : copysign(1,x);
3087}
3088
3089static 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
3093static 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
3097static 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
3101static 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
3105static 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
3109static inline SIMD_CFUNC double simd_sign(double x) {
3110 return (x == 0 | x != x) ? 0 : copysign(1,x);
3111}
3112
3113static 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
3117static 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
3121static 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
3125static 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
3129static inline SIMD_CFUNC float simd_mix(float x, float y, float t) {
3130 return x + t*(y - x);
3131}
3132
3133static inline SIMD_CFUNC simd_float2 simd_mix(simd_float2 x, simd_float2 y, simd_float2 t) {
3134 return x + t*(y - x);
3135}
3136
3137static inline SIMD_CFUNC simd_float3 simd_mix(simd_float3 x, simd_float3 y, simd_float3 t) {
3138 return x + t*(y - x);
3139}
3140
3141static inline SIMD_CFUNC simd_float4 simd_mix(simd_float4 x, simd_float4 y, simd_float4 t) {
3142 return x + t*(y - x);
3143}
3144
3145static inline SIMD_CFUNC simd_float8 simd_mix(simd_float8 x, simd_float8 y, simd_float8 t) {
3146 return x + t*(y - x);
3147}
3148
3149static inline SIMD_CFUNC simd_float16 simd_mix(simd_float16 x, simd_float16 y, simd_float16 t) {
3150 return x + t*(y - x);
3151}
3152
3153static inline SIMD_CFUNC double simd_mix(double x, double y, double t) {
3154 return x + t*(y - x);
3155}
3156
3157static inline SIMD_CFUNC simd_double2 simd_mix(simd_double2 x, simd_double2 y, simd_double2 t) {
3158 return x + t*(y - x);
3159}
3160
3161static inline SIMD_CFUNC simd_double3 simd_mix(simd_double3 x, simd_double3 y, simd_double3 t) {
3162 return x + t*(y - x);
3163}
3164
3165static inline SIMD_CFUNC simd_double4 simd_mix(simd_double4 x, simd_double4 y, simd_double4 t) {
3166 return x + t*(y - x);
3167}
3168
3169static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t) {
3170 return x + t*(y - x);
3171}
3172
3173static 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
3181static 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
3189static 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
3197static 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
3205static 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
3213static 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
3221static 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
3229static 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
3237static 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
3245static 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
3253static 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
3261static 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
3274static 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
3285static 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
3289static 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
3302static 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
3312static 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
3320static inline SIMD_CFUNC double simd_fast_recip(double x) {
3321 return simd_precise_recip(x);
3322}
3323
3324static inline SIMD_CFUNC simd_double2 simd_fast_recip(simd_double2 x) {
3325 return simd_precise_recip(x);
3326}
3327
3328static inline SIMD_CFUNC simd_double3 simd_fast_recip(simd_double3 x) {
3329 return simd_precise_recip(x);
3330}
3331
3332static inline SIMD_CFUNC simd_double4 simd_fast_recip(simd_double4 x) {
3333 return simd_precise_recip(x);
3334}
3335
3336static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x) {
3337 return simd_precise_recip(x);
3338}
3339
3340static 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
3351static 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
3362static 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
3366static 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
3378static 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
3387static 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
3396static inline SIMD_CFUNC double simd_precise_recip(double x) {
3397 return 1/x;
3398}
3399
3400static inline SIMD_CFUNC simd_double2 simd_precise_recip(simd_double2 x) {
3401 return 1/x;
3402}
3403
3404static inline SIMD_CFUNC simd_double3 simd_precise_recip(simd_double3 x) {
3405 return 1/x;
3406}
3407
3408static inline SIMD_CFUNC simd_double4 simd_precise_recip(simd_double4 x) {
3409 return 1/x;
3410}
3411
3412static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x) {
3413 return 1/x;
3414}
3415
3416static 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
3424static 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
3432static 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
3440static 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
3448static 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
3456static 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
3464static 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
3472static 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
3480static 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
3488static 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
3496static 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
3504static 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
3517static 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
3528static 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
3532static 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
3545static 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
3555static 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
3563static inline SIMD_CFUNC double simd_fast_rsqrt(double x) {
3564 return simd_precise_rsqrt(x);
3565}
3566
3567static inline SIMD_CFUNC simd_double2 simd_fast_rsqrt(simd_double2 x) {
3568 return simd_precise_rsqrt(x);
3569}
3570
3571static inline SIMD_CFUNC simd_double3 simd_fast_rsqrt(simd_double3 x) {
3572 return simd_precise_rsqrt(x);
3573}
3574
3575static inline SIMD_CFUNC simd_double4 simd_fast_rsqrt(simd_double4 x) {
3576 return simd_precise_rsqrt(x);
3577}
3578
3579static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x) {
3580 return simd_precise_rsqrt(x);
3581}
3582
3583static 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
3594static 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
3605static 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
3609static 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
3621static 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
3630static 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
3639static inline SIMD_CFUNC double simd_precise_rsqrt(double x) {
3640 return 1/sqrt(x);
3641}
3642
3643static inline SIMD_CFUNC simd_double2 simd_precise_rsqrt(simd_double2 x) {
3644 return 1/__tg_sqrt(x);
3645}
3646
3647static inline SIMD_CFUNC simd_double3 simd_precise_rsqrt(simd_double3 x) {
3648 return 1/__tg_sqrt(x);
3649}
3650
3651static inline SIMD_CFUNC simd_double4 simd_precise_rsqrt(simd_double4 x) {
3652 return 1/__tg_sqrt(x);
3653}
3654
3655static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x) {
3656 return 1/__tg_sqrt(x);
3657}
3658
3659static inline SIMD_CFUNC float simd_fract(float x) {
3660 return fmin(x - floor(x), 0x1.fffffep-1f);
3661}
3662
3663static inline SIMD_CFUNC simd_float2 simd_fract(simd_float2 x) {
3664 return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f);
3665}
3666
3667static inline SIMD_CFUNC simd_float3 simd_fract(simd_float3 x) {
3668 return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f);
3669}
3670
3671static inline SIMD_CFUNC simd_float4 simd_fract(simd_float4 x) {
3672 return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f);
3673}
3674
3675static inline SIMD_CFUNC simd_float8 simd_fract(simd_float8 x) {
3676 return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f);
3677}
3678
3679static inline SIMD_CFUNC simd_float16 simd_fract(simd_float16 x) {
3680 return __tg_fmin(x - __tg_floor(x), 0x1.fffffep-1f);
3681}
3682
3683static inline SIMD_CFUNC double simd_fract(double x) {
3684 return fmin(x - floor(x), 0x1.fffffffffffffp-1);
3685}
3686
3687static inline SIMD_CFUNC simd_double2 simd_fract(simd_double2 x) {
3688 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);
3689}
3690
3691static inline SIMD_CFUNC simd_double3 simd_fract(simd_double3 x) {
3692 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);
3693}
3694
3695static inline SIMD_CFUNC simd_double4 simd_fract(simd_double4 x) {
3696 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);
3697}
3698
3699static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x) {
3700 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);
3701}
3702
3703static inline SIMD_CFUNC float simd_step(float edge, float x) {
3704 return !(x < edge);
3705}
3706
3707static 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
3711static 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
3715static 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
3719static 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
3723static 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
3727static inline SIMD_CFUNC double simd_step(double edge, double x) {
3728 return !(x < edge);
3729}
3730
3731static 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
3735static 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
3739static 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
3743static 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
3747static 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
3752static 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
3757static 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
3762static 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
3767static 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
3772static 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
3777static 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
3782static 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
3787static 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
3792static 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
3797static 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
3802static inline SIMD_CFUNC char simd_reduce_add(simd_char2 x) {
3803 return x.x + x.y;
3804}
3805
3806static inline SIMD_CFUNC char simd_reduce_add(simd_char3 x) {
3807 return x.x + x.y + x.z;
3808}
3809
3810static inline SIMD_CFUNC char simd_reduce_add(simd_char4 x) {
3811 return simd_reduce_add(x.lo + x.hi);
3812}
3813
3814static inline SIMD_CFUNC char simd_reduce_add(simd_char8 x) {
3815 return simd_reduce_add(x.lo + x.hi);
3816}
3817
3818static inline SIMD_CFUNC char simd_reduce_add(simd_char16 x) {
3819 return simd_reduce_add(x.lo + x.hi);
3820}
3821
3822static inline SIMD_CFUNC char simd_reduce_add(simd_char32 x) {
3823 return simd_reduce_add(x.lo + x.hi);
3824}
3825
3826static inline SIMD_CFUNC char simd_reduce_add(simd_char64 x) {
3827 return simd_reduce_add(x.lo + x.hi);
3828}
3829
3830static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar2 x) {
3831 return x.x + x.y;
3832}
3833
3834static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar3 x) {
3835 return x.x + x.y + x.z;
3836}
3837
3838static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar4 x) {
3839 return simd_reduce_add(x.lo + x.hi);
3840}
3841
3842static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar8 x) {
3843 return simd_reduce_add(x.lo + x.hi);
3844}
3845
3846static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar16 x) {
3847 return simd_reduce_add(x.lo + x.hi);
3848}
3849
3850static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar32 x) {
3851 return simd_reduce_add(x.lo + x.hi);
3852}
3853
3854static inline SIMD_CFUNC unsigned char simd_reduce_add(simd_uchar64 x) {
3855 return simd_reduce_add(x.lo + x.hi);
3856}
3857
3858static inline SIMD_CFUNC short simd_reduce_add(simd_short2 x) {
3859 return x.x + x.y;
3860}
3861
3862static inline SIMD_CFUNC short simd_reduce_add(simd_short3 x) {
3863 return x.x + x.y + x.z;
3864}
3865
3866static inline SIMD_CFUNC short simd_reduce_add(simd_short4 x) {
3867 return simd_reduce_add(x.lo + x.hi);
3868}
3869
3870static inline SIMD_CFUNC short simd_reduce_add(simd_short8 x) {
3871 return simd_reduce_add(x.lo + x.hi);
3872}
3873
3874static inline SIMD_CFUNC short simd_reduce_add(simd_short16 x) {
3875 return simd_reduce_add(x.lo + x.hi);
3876}
3877
3878static inline SIMD_CFUNC short simd_reduce_add(simd_short32 x) {
3879 return simd_reduce_add(x.lo + x.hi);
3880}
3881
3882static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort2 x) {
3883 return x.x + x.y;
3884}
3885
3886static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort3 x) {
3887 return x.x + x.y + x.z;
3888}
3889
3890static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort4 x) {
3891 return simd_reduce_add(x.lo + x.hi);
3892}
3893
3894static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort8 x) {
3895 return simd_reduce_add(x.lo + x.hi);
3896}
3897
3898static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort16 x) {
3899 return simd_reduce_add(x.lo + x.hi);
3900}
3901
3902static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x) {
3903 return simd_reduce_add(x.lo + x.hi);
3904}
3905
3906static inline SIMD_CFUNC int simd_reduce_add(simd_int2 x) {
3907 return x.x + x.y;
3908}
3909
3910static inline SIMD_CFUNC int simd_reduce_add(simd_int3 x) {
3911 return x.x + x.y + x.z;
3912}
3913
3914static inline SIMD_CFUNC int simd_reduce_add(simd_int4 x) {
3915 return simd_reduce_add(x.lo + x.hi);
3916}
3917
3918static inline SIMD_CFUNC int simd_reduce_add(simd_int8 x) {
3919 return simd_reduce_add(x.lo + x.hi);
3920}
3921
3922static inline SIMD_CFUNC int simd_reduce_add(simd_int16 x) {
3923 return simd_reduce_add(x.lo + x.hi);
3924}
3925
3926static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint2 x) {
3927 return x.x + x.y;
3928}
3929
3930static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint3 x) {
3931 return x.x + x.y + x.z;
3932}
3933
3934static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint4 x) {
3935 return simd_reduce_add(x.lo + x.hi);
3936}
3937
3938static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint8 x) {
3939 return simd_reduce_add(x.lo + x.hi);
3940}
3941
3942static inline SIMD_CFUNC unsigned int simd_reduce_add(simd_uint16 x) {
3943 return simd_reduce_add(x.lo + x.hi);
3944}
3945
3946static inline SIMD_CFUNC float simd_reduce_add(simd_float2 x) {
3947 return x.x + x.y;
3948}
3949
3950static inline SIMD_CFUNC float simd_reduce_add(simd_float3 x) {
3951 return x.x + x.y + x.z;
3952}
3953
3954static inline SIMD_CFUNC float simd_reduce_add(simd_float4 x) {
3955 return simd_reduce_add(x.lo + x.hi);
3956}
3957
3958static inline SIMD_CFUNC float simd_reduce_add(simd_float8 x) {
3959 return simd_reduce_add(x.lo + x.hi);
3960}
3961
3962static inline SIMD_CFUNC float simd_reduce_add(simd_float16 x) {
3963 return simd_reduce_add(x.lo + x.hi);
3964}
3965
3966static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long2 x) {
3967 return x.x + x.y;
3968}
3969
3970static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long3 x) {
3971 return x.x + x.y + x.z;
3972}
3973
3974static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long4 x) {
3975 return simd_reduce_add(x.lo + x.hi);
3976}
3977
3978static inline SIMD_CFUNC simd_long1 simd_reduce_add(simd_long8 x) {
3979 return simd_reduce_add(x.lo + x.hi);
3980}
3981
3982static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong2 x) {
3983 return x.x + x.y;
3984}
3985
3986static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong3 x) {
3987 return x.x + x.y + x.z;
3988}
3989
3990static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong4 x) {
3991 return simd_reduce_add(x.lo + x.hi);
3992}
3993
3994static inline SIMD_CFUNC simd_ulong1 simd_reduce_add(simd_ulong8 x) {
3995 return simd_reduce_add(x.lo + x.hi);
3996}
3997
3998static inline SIMD_CFUNC double simd_reduce_add(simd_double2 x) {
3999 return x.x + x.y;
4000}
4001
4002static inline SIMD_CFUNC double simd_reduce_add(simd_double3 x) {
4003 return x.x + x.y + x.z;
4004}
4005
4006static inline SIMD_CFUNC double simd_reduce_add(simd_double4 x) {
4007 return simd_reduce_add(x.lo + x.hi);
4008}
4009
4010static inline SIMD_CFUNC double simd_reduce_add(simd_double8 x) {
4011 return simd_reduce_add(x.lo + x.hi);
4012}
4013
4014static inline SIMD_CFUNC char simd_reduce_min(simd_char2 x) {
4015 return x.y < x.x ? x.y : x.x;
4016}
4017
4018static 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
4023static inline SIMD_CFUNC char simd_reduce_min(simd_char4 x) {
4024 return simd_reduce_min(simd_min(x.lo, x.hi));
4025}
4026
4027static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x) {
4028 return simd_reduce_min(simd_min(x.lo, x.hi));
4029}
4030
4031static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x) {
4032 return simd_reduce_min(simd_min(x.lo, x.hi));
4033}
4034
4035static inline SIMD_CFUNC char simd_reduce_min(simd_char32 x) {
4036 return simd_reduce_min(simd_min(x.lo, x.hi));
4037}
4038
4039static inline SIMD_CFUNC char simd_reduce_min(simd_char64 x) {
4040 return simd_reduce_min(simd_min(x.lo, x.hi));
4041}
4042
4043static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar2 x) {
4044 return x.y < x.x ? x.y : x.x;
4045}
4046
4047static 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
4052static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar4 x) {
4053 return simd_reduce_min(simd_min(x.lo, x.hi));
4054}
4055
4056static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar8 x) {
4057 return simd_reduce_min(simd_min(x.lo, x.hi));
4058}
4059
4060static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x) {
4061 return simd_reduce_min(simd_min(x.lo, x.hi));
4062}
4063
4064static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar32 x) {
4065 return simd_reduce_min(simd_min(x.lo, x.hi));
4066}
4067
4068static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar64 x) {
4069 return simd_reduce_min(simd_min(x.lo, x.hi));
4070}
4071
4072static inline SIMD_CFUNC short simd_reduce_min(simd_short2 x) {
4073 return x.y < x.x ? x.y : x.x;
4074}
4075
4076static 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
4081static inline SIMD_CFUNC short simd_reduce_min(simd_short4 x) {
4082 return simd_reduce_min(simd_min(x.lo, x.hi));
4083}
4084
4085static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x) {
4086 return simd_reduce_min(simd_min(x.lo, x.hi));
4087}
4088
4089static inline SIMD_CFUNC short simd_reduce_min(simd_short16 x) {
4090 return simd_reduce_min(simd_min(x.lo, x.hi));
4091}
4092
4093static inline SIMD_CFUNC short simd_reduce_min(simd_short32 x) {
4094 return simd_reduce_min(simd_min(x.lo, x.hi));
4095}
4096
4097static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort2 x) {
4098 return x.y < x.x ? x.y : x.x;
4099}
4100
4101static 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
4106static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort4 x) {
4107 return simd_reduce_min(simd_min(x.lo, x.hi));
4108}
4109
4110static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x) {
4111 return simd_reduce_min(simd_min(x.lo, x.hi));
4112}
4113
4114static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort16 x) {
4115 return simd_reduce_min(simd_min(x.lo, x.hi));
4116}
4117
4118static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x) {
4119 return simd_reduce_min(simd_min(x.lo, x.hi));
4120}
4121
4122static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x) {
4123 return x.y < x.x ? x.y : x.x;
4124}
4125
4126static 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
4131static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x) {
4132 return simd_reduce_min(simd_min(x.lo, x.hi));
4133}
4134
4135static inline SIMD_CFUNC int simd_reduce_min(simd_int8 x) {
4136 return simd_reduce_min(simd_min(x.lo, x.hi));
4137}
4138
4139static inline SIMD_CFUNC int simd_reduce_min(simd_int16 x) {
4140 return simd_reduce_min(simd_min(x.lo, x.hi));
4141}
4142
4143static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint2 x) {
4144 return x.y < x.x ? x.y : x.x;
4145}
4146
4147static 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
4152static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x) {
4153 return simd_reduce_min(simd_min(x.lo, x.hi));
4154}
4155
4156static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint8 x) {
4157 return simd_reduce_min(simd_min(x.lo, x.hi));
4158}
4159
4160static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint16 x) {
4161 return simd_reduce_min(simd_min(x.lo, x.hi));
4162}
4163
4164static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x) {
4165 return fmin(x.x, x.y);
4166}
4167
4168static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x) {
4169 return fmin(fmin(x.x, x.z), x.y);
4170}
4171
4172static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x) {
4173 return simd_reduce_min(simd_min(x.lo, x.hi));
4174}
4175
4176static inline SIMD_CFUNC float simd_reduce_min(simd_float8 x) {
4177 return simd_reduce_min(simd_min(x.lo, x.hi));
4178}
4179
4180static inline SIMD_CFUNC float simd_reduce_min(simd_float16 x) {
4181 return simd_reduce_min(simd_min(x.lo, x.hi));
4182}
4183
4184static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long2 x) {
4185 return x.y < x.x ? x.y : x.x;
4186}
4187
4188static 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
4193static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long4 x) {
4194 return simd_reduce_min(simd_min(x.lo, x.hi));
4195}
4196
4197static inline SIMD_CFUNC simd_long1 simd_reduce_min(simd_long8 x) {
4198 return simd_reduce_min(simd_min(x.lo, x.hi));
4199}
4200
4201static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong2 x) {
4202 return x.y < x.x ? x.y : x.x;
4203}
4204
4205static 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
4210static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong4 x) {
4211 return simd_reduce_min(simd_min(x.lo, x.hi));
4212}
4213
4214static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong8 x) {
4215 return simd_reduce_min(simd_min(x.lo, x.hi));
4216}
4217
4218static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x) {
4219 return fmin(x.x, x.y);
4220}
4221
4222static inline SIMD_CFUNC double simd_reduce_min(simd_double3 x) {
4223 return fmin(fmin(x.x, x.z), x.y);
4224}
4225
4226static inline SIMD_CFUNC double simd_reduce_min(simd_double4 x) {
4227 return simd_reduce_min(simd_min(x.lo, x.hi));
4228}
4229
4230static inline SIMD_CFUNC double simd_reduce_min(simd_double8 x) {
4231 return simd_reduce_min(simd_min(x.lo, x.hi));
4232}
4233
4234static inline SIMD_CFUNC char simd_reduce_max(simd_char2 x) {
4235 return x.y > x.x ? x.y : x.x;
4236}
4237
4238static 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
4243static inline SIMD_CFUNC char simd_reduce_max(simd_char4 x) {
4244 return simd_reduce_max(simd_max(x.lo, x.hi));
4245}
4246
4247static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x) {
4248 return simd_reduce_max(simd_max(x.lo, x.hi));
4249}
4250
4251static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x) {
4252 return simd_reduce_max(simd_max(x.lo, x.hi));
4253}
4254
4255static inline SIMD_CFUNC char simd_reduce_max(simd_char32 x) {
4256 return simd_reduce_max(simd_max(x.lo, x.hi));
4257}
4258
4259static inline SIMD_CFUNC char simd_reduce_max(simd_char64 x) {
4260 return simd_reduce_max(simd_max(x.lo, x.hi));
4261}
4262
4263static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar2 x) {
4264 return x.y > x.x ? x.y : x.x;
4265}
4266
4267static 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
4272static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar4 x) {
4273 return simd_reduce_max(simd_max(x.lo, x.hi));
4274}
4275
4276static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar8 x) {
4277 return simd_reduce_max(simd_max(x.lo, x.hi));
4278}
4279
4280static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x) {
4281 return simd_reduce_max(simd_max(x.lo, x.hi));
4282}
4283
4284static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar32 x) {
4285 return simd_reduce_max(simd_max(x.lo, x.hi));
4286}
4287
4288static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar64 x) {
4289 return simd_reduce_max(simd_max(x.lo, x.hi));
4290}
4291
4292static inline SIMD_CFUNC short simd_reduce_max(simd_short2 x) {
4293 return x.y > x.x ? x.y : x.x;
4294}
4295
4296static 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
4301static inline SIMD_CFUNC short simd_reduce_max(simd_short4 x) {
4302 return simd_reduce_max(simd_max(x.lo, x.hi));
4303}
4304
4305static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x) {
4306 return simd_reduce_max(simd_max(x.lo, x.hi));
4307}
4308
4309static inline SIMD_CFUNC short simd_reduce_max(simd_short16 x) {
4310 return simd_reduce_max(simd_max(x.lo, x.hi));
4311}
4312
4313static inline SIMD_CFUNC short simd_reduce_max(simd_short32 x) {
4314 return simd_reduce_max(simd_max(x.lo, x.hi));
4315}
4316
4317static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort2 x) {
4318 return x.y > x.x ? x.y : x.x;
4319}
4320
4321static 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
4326static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort4 x) {
4327 return simd_reduce_max(simd_max(x.lo, x.hi));
4328}
4329
4330static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x) {
4331 return simd_reduce_max(simd_max(x.lo, x.hi));
4332}
4333
4334static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort16 x) {
4335 return simd_reduce_max(simd_max(x.lo, x.hi));
4336}
4337
4338static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x) {
4339 return simd_reduce_max(simd_max(x.lo, x.hi));
4340}
4341
4342static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x) {
4343 return x.y > x.x ? x.y : x.x;
4344}
4345
4346static 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
4351static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x) {
4352 return simd_reduce_max(simd_max(x.lo, x.hi));
4353}
4354
4355static inline SIMD_CFUNC int simd_reduce_max(simd_int8 x) {
4356 return simd_reduce_max(simd_max(x.lo, x.hi));
4357}
4358
4359static inline SIMD_CFUNC int simd_reduce_max(simd_int16 x) {
4360 return simd_reduce_max(simd_max(x.lo, x.hi));
4361}
4362
4363static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint2 x) {
4364 return x.y > x.x ? x.y : x.x;
4365}
4366
4367static 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
4372static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x) {
4373 return simd_reduce_max(simd_max(x.lo, x.hi));
4374}
4375
4376static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint8 x) {
4377 return simd_reduce_max(simd_max(x.lo, x.hi));
4378}
4379
4380static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint16 x) {
4381 return simd_reduce_max(simd_max(x.lo, x.hi));
4382}
4383
4384static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x) {
4385 return fmax(x.x, x.y);
4386}
4387
4388static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x) {
4389 return fmax(fmax(x.x, x.z), x.y);
4390}
4391
4392static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x) {
4393 return simd_reduce_max(simd_max(x.lo, x.hi));
4394}
4395
4396static inline SIMD_CFUNC float simd_reduce_max(simd_float8 x) {
4397 return simd_reduce_max(simd_max(x.lo, x.hi));
4398}
4399
4400static inline SIMD_CFUNC float simd_reduce_max(simd_float16 x) {
4401 return simd_reduce_max(simd_max(x.lo, x.hi));
4402}
4403
4404static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long2 x) {
4405 return x.y > x.x ? x.y : x.x;
4406}
4407
4408static 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
4413static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long4 x) {
4414 return simd_reduce_max(simd_max(x.lo, x.hi));
4415}
4416
4417static inline SIMD_CFUNC simd_long1 simd_reduce_max(simd_long8 x) {
4418 return simd_reduce_max(simd_max(x.lo, x.hi));
4419}
4420
4421static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong2 x) {
4422 return x.y > x.x ? x.y : x.x;
4423}
4424
4425static 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
4430static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong4 x) {
4431 return simd_reduce_max(simd_max(x.lo, x.hi));
4432}
4433
4434static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong8 x) {
4435 return simd_reduce_max(simd_max(x.lo, x.hi));
4436}
4437
4438static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x) {
4439 return fmax(x.x, x.y);
4440}
4441
4442static inline SIMD_CFUNC double simd_reduce_max(simd_double3 x) {
4443 return fmax(fmax(x.x, x.z), x.y);
4444}
4445
4446static inline SIMD_CFUNC double simd_reduce_max(simd_double4 x) {
4447 return simd_reduce_max(simd_max(x.lo, x.hi));
4448}
4449
4450static 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/aarch64-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
45extern "C" {
46#endif
47
48static simd_char2 SIMD_CFUNC simd_char(simd_char2 __x);
49static simd_char3 SIMD_CFUNC simd_char(simd_char3 __x);
50static simd_char4 SIMD_CFUNC simd_char(simd_char4 __x);
51static simd_char8 SIMD_CFUNC simd_char(simd_char8 __x);
52static simd_char16 SIMD_CFUNC simd_char(simd_char16 __x);
53static simd_char32 SIMD_CFUNC simd_char(simd_char32 __x);
54static simd_char2 SIMD_CFUNC simd_char(simd_uchar2 __x);
55static simd_char3 SIMD_CFUNC simd_char(simd_uchar3 __x);
56static simd_char4 SIMD_CFUNC simd_char(simd_uchar4 __x);
57static simd_char8 SIMD_CFUNC simd_char(simd_uchar8 __x);
58static simd_char16 SIMD_CFUNC simd_char(simd_uchar16 __x);
59static simd_char32 SIMD_CFUNC simd_char(simd_uchar32 __x);
60static simd_char2 SIMD_CFUNC simd_char(simd_short2 __x);
61static simd_char3 SIMD_CFUNC simd_char(simd_short3 __x);
62static simd_char4 SIMD_CFUNC simd_char(simd_short4 __x);
63static simd_char8 SIMD_CFUNC simd_char(simd_short8 __x);
64static simd_char16 SIMD_CFUNC simd_char(simd_short16 __x);
65static simd_char32 SIMD_CFUNC simd_char(simd_short32 __x);
66static simd_char2 SIMD_CFUNC simd_char(simd_ushort2 __x);
67static simd_char3 SIMD_CFUNC simd_char(simd_ushort3 __x);
68static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x);
69static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x);
70static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x);
71static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x);
72static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x);
73static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x);
74static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x);
75static simd_char8 SIMD_CFUNC simd_char(simd_int8 __x);
76static simd_char16 SIMD_CFUNC simd_char(simd_int16 __x);
77static simd_char2 SIMD_CFUNC simd_char(simd_uint2 __x);
78static simd_char3 SIMD_CFUNC simd_char(simd_uint3 __x);
79static simd_char4 SIMD_CFUNC simd_char(simd_uint4 __x);
80static simd_char8 SIMD_CFUNC simd_char(simd_uint8 __x);
81static simd_char16 SIMD_CFUNC simd_char(simd_uint16 __x);
82static simd_char2 SIMD_CFUNC simd_char(simd_float2 __x);
83static simd_char3 SIMD_CFUNC simd_char(simd_float3 __x);
84static simd_char4 SIMD_CFUNC simd_char(simd_float4 __x);
85static simd_char8 SIMD_CFUNC simd_char(simd_float8 __x);
86static simd_char16 SIMD_CFUNC simd_char(simd_float16 __x);
87static simd_char2 SIMD_CFUNC simd_char(simd_long2 __x);
88static simd_char3 SIMD_CFUNC simd_char(simd_long3 __x);
89static simd_char4 SIMD_CFUNC simd_char(simd_long4 __x);
90static simd_char8 SIMD_CFUNC simd_char(simd_long8 __x);
91static simd_char2 SIMD_CFUNC simd_char(simd_ulong2 __x);
92static simd_char3 SIMD_CFUNC simd_char(simd_ulong3 __x);
93static simd_char4 SIMD_CFUNC simd_char(simd_ulong4 __x);
94static simd_char8 SIMD_CFUNC simd_char(simd_ulong8 __x);
95static simd_char2 SIMD_CFUNC simd_char(simd_double2 __x);
96static simd_char3 SIMD_CFUNC simd_char(simd_double3 __x);
97static simd_char4 SIMD_CFUNC simd_char(simd_double4 __x);
98static simd_char8 SIMD_CFUNC simd_char(simd_double8 __x);
99static simd_char2 SIMD_CFUNC simd_char_sat(simd_char2 __x);
100static simd_char3 SIMD_CFUNC simd_char_sat(simd_char3 __x);
101static simd_char4 SIMD_CFUNC simd_char_sat(simd_char4 __x);
102static simd_char8 SIMD_CFUNC simd_char_sat(simd_char8 __x);
103static simd_char16 SIMD_CFUNC simd_char_sat(simd_char16 __x);
104static simd_char32 SIMD_CFUNC simd_char_sat(simd_char32 __x);
105static simd_char2 SIMD_CFUNC simd_char_sat(simd_short2 __x);
106static simd_char3 SIMD_CFUNC simd_char_sat(simd_short3 __x);
107static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x);
108static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x);
109static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x);
110static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x);
111static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x);
112static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x);
113static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x);
114static simd_char8 SIMD_CFUNC simd_char_sat(simd_int8 __x);
115static simd_char16 SIMD_CFUNC simd_char_sat(simd_int16 __x);
116static simd_char2 SIMD_CFUNC simd_char_sat(simd_float2 __x);
117static simd_char3 SIMD_CFUNC simd_char_sat(simd_float3 __x);
118static simd_char4 SIMD_CFUNC simd_char_sat(simd_float4 __x);
119static simd_char8 SIMD_CFUNC simd_char_sat(simd_float8 __x);
120static simd_char16 SIMD_CFUNC simd_char_sat(simd_float16 __x);
121static simd_char2 SIMD_CFUNC simd_char_sat(simd_long2 __x);
122static simd_char3 SIMD_CFUNC simd_char_sat(simd_long3 __x);
123static simd_char4 SIMD_CFUNC simd_char_sat(simd_long4 __x);
124static simd_char8 SIMD_CFUNC simd_char_sat(simd_long8 __x);
125static simd_char2 SIMD_CFUNC simd_char_sat(simd_double2 __x);
126static simd_char3 SIMD_CFUNC simd_char_sat(simd_double3 __x);
127static simd_char4 SIMD_CFUNC simd_char_sat(simd_double4 __x);
128static simd_char8 SIMD_CFUNC simd_char_sat(simd_double8 __x);
129static simd_char2 SIMD_CFUNC simd_char_sat(simd_uchar2 __x);
130static simd_char3 SIMD_CFUNC simd_char_sat(simd_uchar3 __x);
131static simd_char4 SIMD_CFUNC simd_char_sat(simd_uchar4 __x);
132static simd_char8 SIMD_CFUNC simd_char_sat(simd_uchar8 __x);
133static simd_char16 SIMD_CFUNC simd_char_sat(simd_uchar16 __x);
134static simd_char32 SIMD_CFUNC simd_char_sat(simd_uchar32 __x);
135static simd_char2 SIMD_CFUNC simd_char_sat(simd_ushort2 __x);
136static simd_char3 SIMD_CFUNC simd_char_sat(simd_ushort3 __x);
137static simd_char4 SIMD_CFUNC simd_char_sat(simd_ushort4 __x);
138static simd_char8 SIMD_CFUNC simd_char_sat(simd_ushort8 __x);
139static simd_char16 SIMD_CFUNC simd_char_sat(simd_ushort16 __x);
140static simd_char32 SIMD_CFUNC simd_char_sat(simd_ushort32 __x);
141static simd_char2 SIMD_CFUNC simd_char_sat(simd_uint2 __x);
142static simd_char3 SIMD_CFUNC simd_char_sat(simd_uint3 __x);
143static simd_char4 SIMD_CFUNC simd_char_sat(simd_uint4 __x);
144static simd_char8 SIMD_CFUNC simd_char_sat(simd_uint8 __x);
145static simd_char16 SIMD_CFUNC simd_char_sat(simd_uint16 __x);
146static simd_char2 SIMD_CFUNC simd_char_sat(simd_ulong2 __x);
147static simd_char3 SIMD_CFUNC simd_char_sat(simd_ulong3 __x);
148static simd_char4 SIMD_CFUNC simd_char_sat(simd_ulong4 __x);
149static 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
153static simd_uchar2 SIMD_CFUNC simd_uchar(simd_char2 __x);
154static simd_uchar3 SIMD_CFUNC simd_uchar(simd_char3 __x);
155static simd_uchar4 SIMD_CFUNC simd_uchar(simd_char4 __x);
156static simd_uchar8 SIMD_CFUNC simd_uchar(simd_char8 __x);
157static simd_uchar16 SIMD_CFUNC simd_uchar(simd_char16 __x);
158static simd_uchar32 SIMD_CFUNC simd_uchar(simd_char32 __x);
159static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uchar2 __x);
160static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uchar3 __x);
161static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uchar4 __x);
162static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uchar8 __x);
163static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uchar16 __x);
164static simd_uchar32 SIMD_CFUNC simd_uchar(simd_uchar32 __x);
165static simd_uchar2 SIMD_CFUNC simd_uchar(simd_short2 __x);
166static simd_uchar3 SIMD_CFUNC simd_uchar(simd_short3 __x);
167static simd_uchar4 SIMD_CFUNC simd_uchar(simd_short4 __x);
168static simd_uchar8 SIMD_CFUNC simd_uchar(simd_short8 __x);
169static simd_uchar16 SIMD_CFUNC simd_uchar(simd_short16 __x);
170static simd_uchar32 SIMD_CFUNC simd_uchar(simd_short32 __x);
171static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ushort2 __x);
172static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ushort3 __x);
173static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x);
174static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x);
175static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x);
176static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x);
177static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x);
178static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x);
179static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x);
180static simd_uchar8 SIMD_CFUNC simd_uchar(simd_int8 __x);
181static simd_uchar16 SIMD_CFUNC simd_uchar(simd_int16 __x);
182static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uint2 __x);
183static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uint3 __x);
184static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uint4 __x);
185static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uint8 __x);
186static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uint16 __x);
187static simd_uchar2 SIMD_CFUNC simd_uchar(simd_float2 __x);
188static simd_uchar3 SIMD_CFUNC simd_uchar(simd_float3 __x);
189static simd_uchar4 SIMD_CFUNC simd_uchar(simd_float4 __x);
190static simd_uchar8 SIMD_CFUNC simd_uchar(simd_float8 __x);
191static simd_uchar16 SIMD_CFUNC simd_uchar(simd_float16 __x);
192static simd_uchar2 SIMD_CFUNC simd_uchar(simd_long2 __x);
193static simd_uchar3 SIMD_CFUNC simd_uchar(simd_long3 __x);
194static simd_uchar4 SIMD_CFUNC simd_uchar(simd_long4 __x);
195static simd_uchar8 SIMD_CFUNC simd_uchar(simd_long8 __x);
196static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ulong2 __x);
197static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ulong3 __x);
198static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ulong4 __x);
199static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ulong8 __x);
200static simd_uchar2 SIMD_CFUNC simd_uchar(simd_double2 __x);
201static simd_uchar3 SIMD_CFUNC simd_uchar(simd_double3 __x);
202static simd_uchar4 SIMD_CFUNC simd_uchar(simd_double4 __x);
203static simd_uchar8 SIMD_CFUNC simd_uchar(simd_double8 __x);
204static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_char2 __x);
205static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_char3 __x);
206static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_char4 __x);
207static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_char8 __x);
208static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_char16 __x);
209static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_char32 __x);
210static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_short2 __x);
211static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_short3 __x);
212static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x);
213static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x);
214static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x);
215static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x);
216static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x);
217static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x);
218static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x);
219static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_int8 __x);
220static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_int16 __x);
221static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_float2 __x);
222static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_float3 __x);
223static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_float4 __x);
224static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_float8 __x);
225static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_float16 __x);
226static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_long2 __x);
227static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_long3 __x);
228static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_long4 __x);
229static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_long8 __x);
230static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_double2 __x);
231static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_double3 __x);
232static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_double4 __x);
233static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_double8 __x);
234static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uchar2 __x);
235static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uchar3 __x);
236static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uchar4 __x);
237static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uchar8 __x);
238static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uchar16 __x);
239static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_uchar32 __x);
240static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ushort2 __x);
241static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ushort3 __x);
242static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ushort4 __x);
243static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ushort8 __x);
244static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_ushort16 __x);
245static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_ushort32 __x);
246static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uint2 __x);
247static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uint3 __x);
248static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uint4 __x);
249static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uint8 __x);
250static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uint16 __x);
251static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ulong2 __x);
252static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ulong3 __x);
253static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ulong4 __x);
254static 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
258static simd_short2 SIMD_CFUNC simd_short(simd_char2 __x);
259static simd_short3 SIMD_CFUNC simd_short(simd_char3 __x);
260static simd_short4 SIMD_CFUNC simd_short(simd_char4 __x);
261static simd_short8 SIMD_CFUNC simd_short(simd_char8 __x);
262static simd_short16 SIMD_CFUNC simd_short(simd_char16 __x);
263static simd_short32 SIMD_CFUNC simd_short(simd_char32 __x);
264static simd_short2 SIMD_CFUNC simd_short(simd_uchar2 __x);
265static simd_short3 SIMD_CFUNC simd_short(simd_uchar3 __x);
266static simd_short4 SIMD_CFUNC simd_short(simd_uchar4 __x);
267static simd_short8 SIMD_CFUNC simd_short(simd_uchar8 __x);
268static simd_short16 SIMD_CFUNC simd_short(simd_uchar16 __x);
269static simd_short32 SIMD_CFUNC simd_short(simd_uchar32 __x);
270static simd_short2 SIMD_CFUNC simd_short(simd_short2 __x);
271static simd_short3 SIMD_CFUNC simd_short(simd_short3 __x);
272static simd_short4 SIMD_CFUNC simd_short(simd_short4 __x);
273static simd_short8 SIMD_CFUNC simd_short(simd_short8 __x);
274static simd_short16 SIMD_CFUNC simd_short(simd_short16 __x);
275static simd_short32 SIMD_CFUNC simd_short(simd_short32 __x);
276static simd_short2 SIMD_CFUNC simd_short(simd_ushort2 __x);
277static simd_short3 SIMD_CFUNC simd_short(simd_ushort3 __x);
278static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x);
279static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x);
280static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x);
281static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x);
282static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x);
283static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x);
284static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x);
285static simd_short8 SIMD_CFUNC simd_short(simd_int8 __x);
286static simd_short16 SIMD_CFUNC simd_short(simd_int16 __x);
287static simd_short2 SIMD_CFUNC simd_short(simd_uint2 __x);
288static simd_short3 SIMD_CFUNC simd_short(simd_uint3 __x);
289static simd_short4 SIMD_CFUNC simd_short(simd_uint4 __x);
290static simd_short8 SIMD_CFUNC simd_short(simd_uint8 __x);
291static simd_short16 SIMD_CFUNC simd_short(simd_uint16 __x);
292static simd_short2 SIMD_CFUNC simd_short(simd_float2 __x);
293static simd_short3 SIMD_CFUNC simd_short(simd_float3 __x);
294static simd_short4 SIMD_CFUNC simd_short(simd_float4 __x);
295static simd_short8 SIMD_CFUNC simd_short(simd_float8 __x);
296static simd_short16 SIMD_CFUNC simd_short(simd_float16 __x);
297static simd_short2 SIMD_CFUNC simd_short(simd_long2 __x);
298static simd_short3 SIMD_CFUNC simd_short(simd_long3 __x);
299static simd_short4 SIMD_CFUNC simd_short(simd_long4 __x);
300static simd_short8 SIMD_CFUNC simd_short(simd_long8 __x);
301static simd_short2 SIMD_CFUNC simd_short(simd_ulong2 __x);
302static simd_short3 SIMD_CFUNC simd_short(simd_ulong3 __x);
303static simd_short4 SIMD_CFUNC simd_short(simd_ulong4 __x);
304static simd_short8 SIMD_CFUNC simd_short(simd_ulong8 __x);
305static simd_short2 SIMD_CFUNC simd_short(simd_double2 __x);
306static simd_short3 SIMD_CFUNC simd_short(simd_double3 __x);
307static simd_short4 SIMD_CFUNC simd_short(simd_double4 __x);
308static simd_short8 SIMD_CFUNC simd_short(simd_double8 __x);
309static simd_short2 SIMD_CFUNC simd_short_sat(simd_char2 __x);
310static simd_short3 SIMD_CFUNC simd_short_sat(simd_char3 __x);
311static simd_short4 SIMD_CFUNC simd_short_sat(simd_char4 __x);
312static simd_short8 SIMD_CFUNC simd_short_sat(simd_char8 __x);
313static simd_short16 SIMD_CFUNC simd_short_sat(simd_char16 __x);
314static simd_short32 SIMD_CFUNC simd_short_sat(simd_char32 __x);
315static simd_short2 SIMD_CFUNC simd_short_sat(simd_short2 __x);
316static simd_short3 SIMD_CFUNC simd_short_sat(simd_short3 __x);
317static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x);
318static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x);
319static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x);
320static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x);
321static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x);
322static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x);
323static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x);
324static simd_short8 SIMD_CFUNC simd_short_sat(simd_int8 __x);
325static simd_short16 SIMD_CFUNC simd_short_sat(simd_int16 __x);
326static simd_short2 SIMD_CFUNC simd_short_sat(simd_float2 __x);
327static simd_short3 SIMD_CFUNC simd_short_sat(simd_float3 __x);
328static simd_short4 SIMD_CFUNC simd_short_sat(simd_float4 __x);
329static simd_short8 SIMD_CFUNC simd_short_sat(simd_float8 __x);
330static simd_short16 SIMD_CFUNC simd_short_sat(simd_float16 __x);
331static simd_short2 SIMD_CFUNC simd_short_sat(simd_long2 __x);
332static simd_short3 SIMD_CFUNC simd_short_sat(simd_long3 __x);
333static simd_short4 SIMD_CFUNC simd_short_sat(simd_long4 __x);
334static simd_short8 SIMD_CFUNC simd_short_sat(simd_long8 __x);
335static simd_short2 SIMD_CFUNC simd_short_sat(simd_double2 __x);
336static simd_short3 SIMD_CFUNC simd_short_sat(simd_double3 __x);
337static simd_short4 SIMD_CFUNC simd_short_sat(simd_double4 __x);
338static simd_short8 SIMD_CFUNC simd_short_sat(simd_double8 __x);
339static simd_short2 SIMD_CFUNC simd_short_sat(simd_uchar2 __x);
340static simd_short3 SIMD_CFUNC simd_short_sat(simd_uchar3 __x);
341static simd_short4 SIMD_CFUNC simd_short_sat(simd_uchar4 __x);
342static simd_short8 SIMD_CFUNC simd_short_sat(simd_uchar8 __x);
343static simd_short16 SIMD_CFUNC simd_short_sat(simd_uchar16 __x);
344static simd_short32 SIMD_CFUNC simd_short_sat(simd_uchar32 __x);
345static simd_short2 SIMD_CFUNC simd_short_sat(simd_ushort2 __x);
346static simd_short3 SIMD_CFUNC simd_short_sat(simd_ushort3 __x);
347static simd_short4 SIMD_CFUNC simd_short_sat(simd_ushort4 __x);
348static simd_short8 SIMD_CFUNC simd_short_sat(simd_ushort8 __x);
349static simd_short16 SIMD_CFUNC simd_short_sat(simd_ushort16 __x);
350static simd_short32 SIMD_CFUNC simd_short_sat(simd_ushort32 __x);
351static simd_short2 SIMD_CFUNC simd_short_sat(simd_uint2 __x);
352static simd_short3 SIMD_CFUNC simd_short_sat(simd_uint3 __x);
353static simd_short4 SIMD_CFUNC simd_short_sat(simd_uint4 __x);
354static simd_short8 SIMD_CFUNC simd_short_sat(simd_uint8 __x);
355static simd_short16 SIMD_CFUNC simd_short_sat(simd_uint16 __x);
356static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x);
357static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x);
358static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x);
359static 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
363static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x);
364static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x);
365static simd_ushort4 SIMD_CFUNC simd_ushort(simd_char4 __x);
366static simd_ushort8 SIMD_CFUNC simd_ushort(simd_char8 __x);
367static simd_ushort16 SIMD_CFUNC simd_ushort(simd_char16 __x);
368static simd_ushort32 SIMD_CFUNC simd_ushort(simd_char32 __x);
369static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uchar2 __x);
370static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uchar3 __x);
371static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uchar4 __x);
372static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uchar8 __x);
373static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uchar16 __x);
374static simd_ushort32 SIMD_CFUNC simd_ushort(simd_uchar32 __x);
375static simd_ushort2 SIMD_CFUNC simd_ushort(simd_short2 __x);
376static simd_ushort3 SIMD_CFUNC simd_ushort(simd_short3 __x);
377static simd_ushort4 SIMD_CFUNC simd_ushort(simd_short4 __x);
378static simd_ushort8 SIMD_CFUNC simd_ushort(simd_short8 __x);
379static simd_ushort16 SIMD_CFUNC simd_ushort(simd_short16 __x);
380static simd_ushort32 SIMD_CFUNC simd_ushort(simd_short32 __x);
381static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ushort2 __x);
382static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ushort3 __x);
383static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x);
384static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x);
385static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x);
386static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x);
387static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x);
388static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x);
389static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x);
390static simd_ushort8 SIMD_CFUNC simd_ushort(simd_int8 __x);
391static simd_ushort16 SIMD_CFUNC simd_ushort(simd_int16 __x);
392static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uint2 __x);
393static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uint3 __x);
394static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uint4 __x);
395static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uint8 __x);
396static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uint16 __x);
397static simd_ushort2 SIMD_CFUNC simd_ushort(simd_float2 __x);
398static simd_ushort3 SIMD_CFUNC simd_ushort(simd_float3 __x);
399static simd_ushort4 SIMD_CFUNC simd_ushort(simd_float4 __x);
400static simd_ushort8 SIMD_CFUNC simd_ushort(simd_float8 __x);
401static simd_ushort16 SIMD_CFUNC simd_ushort(simd_float16 __x);
402static simd_ushort2 SIMD_CFUNC simd_ushort(simd_long2 __x);
403static simd_ushort3 SIMD_CFUNC simd_ushort(simd_long3 __x);
404static simd_ushort4 SIMD_CFUNC simd_ushort(simd_long4 __x);
405static simd_ushort8 SIMD_CFUNC simd_ushort(simd_long8 __x);
406static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ulong2 __x);
407static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ulong3 __x);
408static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ulong4 __x);
409static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ulong8 __x);
410static simd_ushort2 SIMD_CFUNC simd_ushort(simd_double2 __x);
411static simd_ushort3 SIMD_CFUNC simd_ushort(simd_double3 __x);
412static simd_ushort4 SIMD_CFUNC simd_ushort(simd_double4 __x);
413static simd_ushort8 SIMD_CFUNC simd_ushort(simd_double8 __x);
414static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_char2 __x);
415static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_char3 __x);
416static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_char4 __x);
417static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_char8 __x);
418static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_char16 __x);
419static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_char32 __x);
420static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_short2 __x);
421static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_short3 __x);
422static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x);
423static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x);
424static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x);
425static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x);
426static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x);
427static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x);
428static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x);
429static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_int8 __x);
430static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_int16 __x);
431static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_float2 __x);
432static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_float3 __x);
433static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_float4 __x);
434static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_float8 __x);
435static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_float16 __x);
436static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_long2 __x);
437static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_long3 __x);
438static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_long4 __x);
439static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_long8 __x);
440static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_double2 __x);
441static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_double3 __x);
442static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_double4 __x);
443static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_double8 __x);
444static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uchar2 __x);
445static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uchar3 __x);
446static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uchar4 __x);
447static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uchar8 __x);
448static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uchar16 __x);
449static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_uchar32 __x);
450static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ushort2 __x);
451static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ushort3 __x);
452static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ushort4 __x);
453static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ushort8 __x);
454static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_ushort16 __x);
455static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_ushort32 __x);
456static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uint2 __x);
457static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uint3 __x);
458static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uint4 __x);
459static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uint8 __x);
460static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uint16 __x);
461static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x);
462static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x);
463static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x);
464static 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
468static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x);
469static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x);
470static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x);
471static simd_int8 SIMD_CFUNC simd_int(simd_char8 __x);
472static simd_int16 SIMD_CFUNC simd_int(simd_char16 __x);
473static simd_int2 SIMD_CFUNC simd_int(simd_uchar2 __x);
474static simd_int3 SIMD_CFUNC simd_int(simd_uchar3 __x);
475static simd_int4 SIMD_CFUNC simd_int(simd_uchar4 __x);
476static simd_int8 SIMD_CFUNC simd_int(simd_uchar8 __x);
477static simd_int16 SIMD_CFUNC simd_int(simd_uchar16 __x);
478static simd_int2 SIMD_CFUNC simd_int(simd_short2 __x);
479static simd_int3 SIMD_CFUNC simd_int(simd_short3 __x);
480static simd_int4 SIMD_CFUNC simd_int(simd_short4 __x);
481static simd_int8 SIMD_CFUNC simd_int(simd_short8 __x);
482static simd_int16 SIMD_CFUNC simd_int(simd_short16 __x);
483static simd_int2 SIMD_CFUNC simd_int(simd_ushort2 __x);
484static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x);
485static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x);
486static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x);
487static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x);
488static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x);
489static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x);
490static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x);
491static simd_int8 SIMD_CFUNC simd_int(simd_int8 __x);
492static simd_int16 SIMD_CFUNC simd_int(simd_int16 __x);
493static simd_int2 SIMD_CFUNC simd_int(simd_uint2 __x);
494static simd_int3 SIMD_CFUNC simd_int(simd_uint3 __x);
495static simd_int4 SIMD_CFUNC simd_int(simd_uint4 __x);
496static simd_int8 SIMD_CFUNC simd_int(simd_uint8 __x);
497static simd_int16 SIMD_CFUNC simd_int(simd_uint16 __x);
498static simd_int2 SIMD_CFUNC simd_int(simd_float2 __x);
499static simd_int3 SIMD_CFUNC simd_int(simd_float3 __x);
500static simd_int4 SIMD_CFUNC simd_int(simd_float4 __x);
501static simd_int8 SIMD_CFUNC simd_int(simd_float8 __x);
502static simd_int16 SIMD_CFUNC simd_int(simd_float16 __x);
503static simd_int2 SIMD_CFUNC simd_int(simd_long2 __x);
504static simd_int3 SIMD_CFUNC simd_int(simd_long3 __x);
505static simd_int4 SIMD_CFUNC simd_int(simd_long4 __x);
506static simd_int8 SIMD_CFUNC simd_int(simd_long8 __x);
507static simd_int2 SIMD_CFUNC simd_int(simd_ulong2 __x);
508static simd_int3 SIMD_CFUNC simd_int(simd_ulong3 __x);
509static simd_int4 SIMD_CFUNC simd_int(simd_ulong4 __x);
510static simd_int8 SIMD_CFUNC simd_int(simd_ulong8 __x);
511static simd_int2 SIMD_CFUNC simd_int(simd_double2 __x);
512static simd_int3 SIMD_CFUNC simd_int(simd_double3 __x);
513static simd_int4 SIMD_CFUNC simd_int(simd_double4 __x);
514static simd_int8 SIMD_CFUNC simd_int(simd_double8 __x);
515static simd_int2 SIMD_CFUNC simd_int_sat(simd_char2 __x);
516static simd_int3 SIMD_CFUNC simd_int_sat(simd_char3 __x);
517static simd_int4 SIMD_CFUNC simd_int_sat(simd_char4 __x);
518static simd_int8 SIMD_CFUNC simd_int_sat(simd_char8 __x);
519static simd_int16 SIMD_CFUNC simd_int_sat(simd_char16 __x);
520static simd_int2 SIMD_CFUNC simd_int_sat(simd_short2 __x);
521static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x);
522static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x);
523static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x);
524static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x);
525static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x);
526static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x);
527static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x);
528static simd_int8 SIMD_CFUNC simd_int_sat(simd_int8 __x);
529static simd_int16 SIMD_CFUNC simd_int_sat(simd_int16 __x);
530static simd_int2 SIMD_CFUNC simd_int_sat(simd_float2 __x);
531static simd_int3 SIMD_CFUNC simd_int_sat(simd_float3 __x);
532static simd_int4 SIMD_CFUNC simd_int_sat(simd_float4 __x);
533static simd_int8 SIMD_CFUNC simd_int_sat(simd_float8 __x);
534static simd_int16 SIMD_CFUNC simd_int_sat(simd_float16 __x);
535static simd_int2 SIMD_CFUNC simd_int_sat(simd_long2 __x);
536static simd_int3 SIMD_CFUNC simd_int_sat(simd_long3 __x);
537static simd_int4 SIMD_CFUNC simd_int_sat(simd_long4 __x);
538static simd_int8 SIMD_CFUNC simd_int_sat(simd_long8 __x);
539static simd_int2 SIMD_CFUNC simd_int_sat(simd_double2 __x);
540static simd_int3 SIMD_CFUNC simd_int_sat(simd_double3 __x);
541static simd_int4 SIMD_CFUNC simd_int_sat(simd_double4 __x);
542static simd_int8 SIMD_CFUNC simd_int_sat(simd_double8 __x);
543static simd_int2 SIMD_CFUNC simd_int_sat(simd_uchar2 __x);
544static simd_int3 SIMD_CFUNC simd_int_sat(simd_uchar3 __x);
545static simd_int4 SIMD_CFUNC simd_int_sat(simd_uchar4 __x);
546static simd_int8 SIMD_CFUNC simd_int_sat(simd_uchar8 __x);
547static simd_int16 SIMD_CFUNC simd_int_sat(simd_uchar16 __x);
548static simd_int2 SIMD_CFUNC simd_int_sat(simd_ushort2 __x);
549static simd_int3 SIMD_CFUNC simd_int_sat(simd_ushort3 __x);
550static simd_int4 SIMD_CFUNC simd_int_sat(simd_ushort4 __x);
551static simd_int8 SIMD_CFUNC simd_int_sat(simd_ushort8 __x);
552static simd_int16 SIMD_CFUNC simd_int_sat(simd_ushort16 __x);
553static simd_int2 SIMD_CFUNC simd_int_sat(simd_uint2 __x);
554static simd_int3 SIMD_CFUNC simd_int_sat(simd_uint3 __x);
555static simd_int4 SIMD_CFUNC simd_int_sat(simd_uint4 __x);
556static simd_int8 SIMD_CFUNC simd_int_sat(simd_uint8 __x);
557static simd_int16 SIMD_CFUNC simd_int_sat(simd_uint16 __x);
558static simd_int2 SIMD_CFUNC simd_int_sat(simd_ulong2 __x);
559static simd_int3 SIMD_CFUNC simd_int_sat(simd_ulong3 __x);
560static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x);
561static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x);
562static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x);
563static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x);
564static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x);
565static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x);
566static 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
570static simd_uint2 SIMD_CFUNC simd_uint(simd_char2 __x);
571static simd_uint3 SIMD_CFUNC simd_uint(simd_char3 __x);
572static simd_uint4 SIMD_CFUNC simd_uint(simd_char4 __x);
573static simd_uint8 SIMD_CFUNC simd_uint(simd_char8 __x);
574static simd_uint16 SIMD_CFUNC simd_uint(simd_char16 __x);
575static simd_uint2 SIMD_CFUNC simd_uint(simd_uchar2 __x);
576static simd_uint3 SIMD_CFUNC simd_uint(simd_uchar3 __x);
577static simd_uint4 SIMD_CFUNC simd_uint(simd_uchar4 __x);
578static simd_uint8 SIMD_CFUNC simd_uint(simd_uchar8 __x);
579static simd_uint16 SIMD_CFUNC simd_uint(simd_uchar16 __x);
580static simd_uint2 SIMD_CFUNC simd_uint(simd_short2 __x);
581static simd_uint3 SIMD_CFUNC simd_uint(simd_short3 __x);
582static simd_uint4 SIMD_CFUNC simd_uint(simd_short4 __x);
583static simd_uint8 SIMD_CFUNC simd_uint(simd_short8 __x);
584static simd_uint16 SIMD_CFUNC simd_uint(simd_short16 __x);
585static simd_uint2 SIMD_CFUNC simd_uint(simd_ushort2 __x);
586static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x);
587static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x);
588static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x);
589static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x);
590static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x);
591static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x);
592static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x);
593static simd_uint8 SIMD_CFUNC simd_uint(simd_int8 __x);
594static simd_uint16 SIMD_CFUNC simd_uint(simd_int16 __x);
595static simd_uint2 SIMD_CFUNC simd_uint(simd_uint2 __x);
596static simd_uint3 SIMD_CFUNC simd_uint(simd_uint3 __x);
597static simd_uint4 SIMD_CFUNC simd_uint(simd_uint4 __x);
598static simd_uint8 SIMD_CFUNC simd_uint(simd_uint8 __x);
599static simd_uint16 SIMD_CFUNC simd_uint(simd_uint16 __x);
600static simd_uint2 SIMD_CFUNC simd_uint(simd_float2 __x);
601static simd_uint3 SIMD_CFUNC simd_uint(simd_float3 __x);
602static simd_uint4 SIMD_CFUNC simd_uint(simd_float4 __x);
603static simd_uint8 SIMD_CFUNC simd_uint(simd_float8 __x);
604static simd_uint16 SIMD_CFUNC simd_uint(simd_float16 __x);
605static simd_uint2 SIMD_CFUNC simd_uint(simd_long2 __x);
606static simd_uint3 SIMD_CFUNC simd_uint(simd_long3 __x);
607static simd_uint4 SIMD_CFUNC simd_uint(simd_long4 __x);
608static simd_uint8 SIMD_CFUNC simd_uint(simd_long8 __x);
609static simd_uint2 SIMD_CFUNC simd_uint(simd_ulong2 __x);
610static simd_uint3 SIMD_CFUNC simd_uint(simd_ulong3 __x);
611static simd_uint4 SIMD_CFUNC simd_uint(simd_ulong4 __x);
612static simd_uint8 SIMD_CFUNC simd_uint(simd_ulong8 __x);
613static simd_uint2 SIMD_CFUNC simd_uint(simd_double2 __x);
614static simd_uint3 SIMD_CFUNC simd_uint(simd_double3 __x);
615static simd_uint4 SIMD_CFUNC simd_uint(simd_double4 __x);
616static simd_uint8 SIMD_CFUNC simd_uint(simd_double8 __x);
617static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_char2 __x);
618static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_char3 __x);
619static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_char4 __x);
620static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_char8 __x);
621static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_char16 __x);
622static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_short2 __x);
623static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x);
624static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x);
625static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x);
626static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x);
627static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x);
628static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x);
629static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x);
630static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_int8 __x);
631static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_int16 __x);
632static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_float2 __x);
633static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_float3 __x);
634static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_float4 __x);
635static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_float8 __x);
636static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_float16 __x);
637static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_long2 __x);
638static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_long3 __x);
639static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_long4 __x);
640static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_long8 __x);
641static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_double2 __x);
642static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_double3 __x);
643static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_double4 __x);
644static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_double8 __x);
645static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uchar2 __x);
646static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uchar3 __x);
647static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uchar4 __x);
648static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uchar8 __x);
649static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uchar16 __x);
650static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ushort2 __x);
651static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ushort3 __x);
652static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ushort4 __x);
653static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ushort8 __x);
654static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_ushort16 __x);
655static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uint2 __x);
656static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uint3 __x);
657static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uint4 __x);
658static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uint8 __x);
659static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uint16 __x);
660static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x);
661static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x);
662static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x);
663static 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
667static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x);
668static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x);
669static simd_float4 SIMD_CFUNC simd_float(simd_char4 __x);
670static simd_float8 SIMD_CFUNC simd_float(simd_char8 __x);
671static simd_float16 SIMD_CFUNC simd_float(simd_char16 __x);
672static simd_float2 SIMD_CFUNC simd_float(simd_uchar2 __x);
673static simd_float3 SIMD_CFUNC simd_float(simd_uchar3 __x);
674static simd_float4 SIMD_CFUNC simd_float(simd_uchar4 __x);
675static simd_float8 SIMD_CFUNC simd_float(simd_uchar8 __x);
676static simd_float16 SIMD_CFUNC simd_float(simd_uchar16 __x);
677static simd_float2 SIMD_CFUNC simd_float(simd_short2 __x);
678static simd_float3 SIMD_CFUNC simd_float(simd_short3 __x);
679static simd_float4 SIMD_CFUNC simd_float(simd_short4 __x);
680static simd_float8 SIMD_CFUNC simd_float(simd_short8 __x);
681static simd_float16 SIMD_CFUNC simd_float(simd_short16 __x);
682static simd_float2 SIMD_CFUNC simd_float(simd_ushort2 __x);
683static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x);
684static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x);
685static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x);
686static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x);
687static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x);
688static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x);
689static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x);
690static simd_float8 SIMD_CFUNC simd_float(simd_int8 __x);
691static simd_float16 SIMD_CFUNC simd_float(simd_int16 __x);
692static simd_float2 SIMD_CFUNC simd_float(simd_uint2 __x);
693static simd_float3 SIMD_CFUNC simd_float(simd_uint3 __x);
694static simd_float4 SIMD_CFUNC simd_float(simd_uint4 __x);
695static simd_float8 SIMD_CFUNC simd_float(simd_uint8 __x);
696static simd_float16 SIMD_CFUNC simd_float(simd_uint16 __x);
697static simd_float2 SIMD_CFUNC simd_float(simd_float2 __x);
698static simd_float3 SIMD_CFUNC simd_float(simd_float3 __x);
699static simd_float4 SIMD_CFUNC simd_float(simd_float4 __x);
700static simd_float8 SIMD_CFUNC simd_float(simd_float8 __x);
701static simd_float16 SIMD_CFUNC simd_float(simd_float16 __x);
702static simd_float2 SIMD_CFUNC simd_float(simd_long2 __x);
703static simd_float3 SIMD_CFUNC simd_float(simd_long3 __x);
704static simd_float4 SIMD_CFUNC simd_float(simd_long4 __x);
705static simd_float8 SIMD_CFUNC simd_float(simd_long8 __x);
706static simd_float2 SIMD_CFUNC simd_float(simd_ulong2 __x);
707static simd_float3 SIMD_CFUNC simd_float(simd_ulong3 __x);
708static simd_float4 SIMD_CFUNC simd_float(simd_ulong4 __x);
709static simd_float8 SIMD_CFUNC simd_float(simd_ulong8 __x);
710static simd_float2 SIMD_CFUNC simd_float(simd_double2 __x);
711static simd_float3 SIMD_CFUNC simd_float(simd_double3 __x);
712static simd_float4 SIMD_CFUNC simd_float(simd_double4 __x);
713static simd_float8 SIMD_CFUNC simd_float(simd_double8 __x);
714#define vector_float simd_float
715
716static simd_long2 SIMD_CFUNC simd_long(simd_char2 __x);
717static simd_long3 SIMD_CFUNC simd_long(simd_char3 __x);
718static simd_long4 SIMD_CFUNC simd_long(simd_char4 __x);
719static simd_long8 SIMD_CFUNC simd_long(simd_char8 __x);
720static simd_long2 SIMD_CFUNC simd_long(simd_uchar2 __x);
721static simd_long3 SIMD_CFUNC simd_long(simd_uchar3 __x);
722static simd_long4 SIMD_CFUNC simd_long(simd_uchar4 __x);
723static simd_long8 SIMD_CFUNC simd_long(simd_uchar8 __x);
724static simd_long2 SIMD_CFUNC simd_long(simd_short2 __x);
725static simd_long3 SIMD_CFUNC simd_long(simd_short3 __x);
726static simd_long4 SIMD_CFUNC simd_long(simd_short4 __x);
727static simd_long8 SIMD_CFUNC simd_long(simd_short8 __x);
728static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x);
729static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x);
730static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x);
731static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x);
732static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x);
733static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x);
734static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x);
735static simd_long8 SIMD_CFUNC simd_long(simd_int8 __x);
736static simd_long2 SIMD_CFUNC simd_long(simd_uint2 __x);
737static simd_long3 SIMD_CFUNC simd_long(simd_uint3 __x);
738static simd_long4 SIMD_CFUNC simd_long(simd_uint4 __x);
739static simd_long8 SIMD_CFUNC simd_long(simd_uint8 __x);
740static simd_long2 SIMD_CFUNC simd_long(simd_float2 __x);
741static simd_long3 SIMD_CFUNC simd_long(simd_float3 __x);
742static simd_long4 SIMD_CFUNC simd_long(simd_float4 __x);
743static simd_long8 SIMD_CFUNC simd_long(simd_float8 __x);
744static simd_long2 SIMD_CFUNC simd_long(simd_long2 __x);
745static simd_long3 SIMD_CFUNC simd_long(simd_long3 __x);
746static simd_long4 SIMD_CFUNC simd_long(simd_long4 __x);
747static simd_long8 SIMD_CFUNC simd_long(simd_long8 __x);
748static simd_long2 SIMD_CFUNC simd_long(simd_ulong2 __x);
749static simd_long3 SIMD_CFUNC simd_long(simd_ulong3 __x);
750static simd_long4 SIMD_CFUNC simd_long(simd_ulong4 __x);
751static simd_long8 SIMD_CFUNC simd_long(simd_ulong8 __x);
752static simd_long2 SIMD_CFUNC simd_long(simd_double2 __x);
753static simd_long3 SIMD_CFUNC simd_long(simd_double3 __x);
754static simd_long4 SIMD_CFUNC simd_long(simd_double4 __x);
755static simd_long8 SIMD_CFUNC simd_long(simd_double8 __x);
756static simd_long2 SIMD_CFUNC simd_long_sat(simd_char2 __x);
757static simd_long3 SIMD_CFUNC simd_long_sat(simd_char3 __x);
758static simd_long4 SIMD_CFUNC simd_long_sat(simd_char4 __x);
759static simd_long8 SIMD_CFUNC simd_long_sat(simd_char8 __x);
760static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x);
761static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x);
762static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x);
763static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x);
764static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x);
765static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x);
766static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x);
767static simd_long8 SIMD_CFUNC simd_long_sat(simd_int8 __x);
768static simd_long2 SIMD_CFUNC simd_long_sat(simd_float2 __x);
769static simd_long3 SIMD_CFUNC simd_long_sat(simd_float3 __x);
770static simd_long4 SIMD_CFUNC simd_long_sat(simd_float4 __x);
771static simd_long8 SIMD_CFUNC simd_long_sat(simd_float8 __x);
772static simd_long2 SIMD_CFUNC simd_long_sat(simd_long2 __x);
773static simd_long3 SIMD_CFUNC simd_long_sat(simd_long3 __x);
774static simd_long4 SIMD_CFUNC simd_long_sat(simd_long4 __x);
775static simd_long8 SIMD_CFUNC simd_long_sat(simd_long8 __x);
776static simd_long2 SIMD_CFUNC simd_long_sat(simd_double2 __x);
777static simd_long3 SIMD_CFUNC simd_long_sat(simd_double3 __x);
778static simd_long4 SIMD_CFUNC simd_long_sat(simd_double4 __x);
779static simd_long8 SIMD_CFUNC simd_long_sat(simd_double8 __x);
780static simd_long2 SIMD_CFUNC simd_long_sat(simd_uchar2 __x);
781static simd_long3 SIMD_CFUNC simd_long_sat(simd_uchar3 __x);
782static simd_long4 SIMD_CFUNC simd_long_sat(simd_uchar4 __x);
783static simd_long8 SIMD_CFUNC simd_long_sat(simd_uchar8 __x);
784static simd_long2 SIMD_CFUNC simd_long_sat(simd_ushort2 __x);
785static simd_long3 SIMD_CFUNC simd_long_sat(simd_ushort3 __x);
786static simd_long4 SIMD_CFUNC simd_long_sat(simd_ushort4 __x);
787static simd_long8 SIMD_CFUNC simd_long_sat(simd_ushort8 __x);
788static simd_long2 SIMD_CFUNC simd_long_sat(simd_uint2 __x);
789static simd_long3 SIMD_CFUNC simd_long_sat(simd_uint3 __x);
790static simd_long4 SIMD_CFUNC simd_long_sat(simd_uint4 __x);
791static simd_long8 SIMD_CFUNC simd_long_sat(simd_uint8 __x);
792static simd_long2 SIMD_CFUNC simd_long_sat(simd_ulong2 __x);
793static simd_long3 SIMD_CFUNC simd_long_sat(simd_ulong3 __x);
794static simd_long4 SIMD_CFUNC simd_long_sat(simd_ulong4 __x);
795static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x);
796static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x);
797static simd_long3 SIMD_CFUNC simd_long_rte(simd_double3 __x);
798static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x);
799static 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
803static simd_ulong2 SIMD_CFUNC simd_ulong(simd_char2 __x);
804static simd_ulong3 SIMD_CFUNC simd_ulong(simd_char3 __x);
805static simd_ulong4 SIMD_CFUNC simd_ulong(simd_char4 __x);
806static simd_ulong8 SIMD_CFUNC simd_ulong(simd_char8 __x);
807static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uchar2 __x);
808static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uchar3 __x);
809static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uchar4 __x);
810static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uchar8 __x);
811static simd_ulong2 SIMD_CFUNC simd_ulong(simd_short2 __x);
812static simd_ulong3 SIMD_CFUNC simd_ulong(simd_short3 __x);
813static simd_ulong4 SIMD_CFUNC simd_ulong(simd_short4 __x);
814static simd_ulong8 SIMD_CFUNC simd_ulong(simd_short8 __x);
815static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x);
816static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x);
817static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x);
818static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x);
819static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x);
820static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x);
821static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x);
822static simd_ulong8 SIMD_CFUNC simd_ulong(simd_int8 __x);
823static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uint2 __x);
824static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uint3 __x);
825static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uint4 __x);
826static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uint8 __x);
827static simd_ulong2 SIMD_CFUNC simd_ulong(simd_float2 __x);
828static simd_ulong3 SIMD_CFUNC simd_ulong(simd_float3 __x);
829static simd_ulong4 SIMD_CFUNC simd_ulong(simd_float4 __x);
830static simd_ulong8 SIMD_CFUNC simd_ulong(simd_float8 __x);
831static simd_ulong2 SIMD_CFUNC simd_ulong(simd_long2 __x);
832static simd_ulong3 SIMD_CFUNC simd_ulong(simd_long3 __x);
833static simd_ulong4 SIMD_CFUNC simd_ulong(simd_long4 __x);
834static simd_ulong8 SIMD_CFUNC simd_ulong(simd_long8 __x);
835static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ulong2 __x);
836static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ulong3 __x);
837static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ulong4 __x);
838static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ulong8 __x);
839static simd_ulong2 SIMD_CFUNC simd_ulong(simd_double2 __x);
840static simd_ulong3 SIMD_CFUNC simd_ulong(simd_double3 __x);
841static simd_ulong4 SIMD_CFUNC simd_ulong(simd_double4 __x);
842static simd_ulong8 SIMD_CFUNC simd_ulong(simd_double8 __x);
843static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_char2 __x);
844static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_char3 __x);
845static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_char4 __x);
846static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_char8 __x);
847static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x);
848static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x);
849static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x);
850static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x);
851static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x);
852static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x);
853static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x);
854static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_int8 __x);
855static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_float2 __x);
856static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_float3 __x);
857static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_float4 __x);
858static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_float8 __x);
859static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_long2 __x);
860static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_long3 __x);
861static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_long4 __x);
862static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_long8 __x);
863static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_double2 __x);
864static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_double3 __x);
865static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_double4 __x);
866static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_double8 __x);
867static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uchar2 __x);
868static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uchar3 __x);
869static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uchar4 __x);
870static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uchar8 __x);
871static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ushort2 __x);
872static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ushort3 __x);
873static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ushort4 __x);
874static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ushort8 __x);
875static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uint2 __x);
876static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uint3 __x);
877static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uint4 __x);
878static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uint8 __x);
879static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x);
880static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x);
881static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x);
882static 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
886static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x);
887static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x);
888static simd_double4 SIMD_CFUNC simd_double(simd_char4 __x);
889static simd_double8 SIMD_CFUNC simd_double(simd_char8 __x);
890static simd_double2 SIMD_CFUNC simd_double(simd_uchar2 __x);
891static simd_double3 SIMD_CFUNC simd_double(simd_uchar3 __x);
892static simd_double4 SIMD_CFUNC simd_double(simd_uchar4 __x);
893static simd_double8 SIMD_CFUNC simd_double(simd_uchar8 __x);
894static simd_double2 SIMD_CFUNC simd_double(simd_short2 __x);
895static simd_double3 SIMD_CFUNC simd_double(simd_short3 __x);
896static simd_double4 SIMD_CFUNC simd_double(simd_short4 __x);
897static simd_double8 SIMD_CFUNC simd_double(simd_short8 __x);
898static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x);
899static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x);
900static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x);
901static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x);
902static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x);
903static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x);
904static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x);
905static simd_double8 SIMD_CFUNC simd_double(simd_int8 __x);
906static simd_double2 SIMD_CFUNC simd_double(simd_uint2 __x);
907static simd_double3 SIMD_CFUNC simd_double(simd_uint3 __x);
908static simd_double4 SIMD_CFUNC simd_double(simd_uint4 __x);
909static simd_double8 SIMD_CFUNC simd_double(simd_uint8 __x);
910static simd_double2 SIMD_CFUNC simd_double(simd_float2 __x);
911static simd_double3 SIMD_CFUNC simd_double(simd_float3 __x);
912static simd_double4 SIMD_CFUNC simd_double(simd_float4 __x);
913static simd_double8 SIMD_CFUNC simd_double(simd_float8 __x);
914static simd_double2 SIMD_CFUNC simd_double(simd_long2 __x);
915static simd_double3 SIMD_CFUNC simd_double(simd_long3 __x);
916static simd_double4 SIMD_CFUNC simd_double(simd_long4 __x);
917static simd_double8 SIMD_CFUNC simd_double(simd_long8 __x);
918static simd_double2 SIMD_CFUNC simd_double(simd_ulong2 __x);
919static simd_double3 SIMD_CFUNC simd_double(simd_ulong3 __x);
920static simd_double4 SIMD_CFUNC simd_double(simd_ulong4 __x);
921static simd_double8 SIMD_CFUNC simd_double(simd_ulong8 __x);
922static simd_double2 SIMD_CFUNC simd_double(simd_double2 __x);
923static simd_double3 SIMD_CFUNC simd_double(simd_double3 __x);
924static simd_double4 SIMD_CFUNC simd_double(simd_double4 __x);
925static simd_double8 SIMD_CFUNC simd_double(simd_double8 __x);
926#define vector_double simd_double
927
928static simd_char2 SIMD_CFUNC vector2(char __x, char __y) { return ( simd_char2){__x, __y}; }
929static simd_uchar2 SIMD_CFUNC vector2(unsigned char __x, unsigned char __y) { return ( simd_uchar2){__x, __y}; }
930static simd_short2 SIMD_CFUNC vector2(short __x, short __y) { return ( simd_short2){__x, __y}; }
931static simd_ushort2 SIMD_CFUNC vector2(unsigned short __x, unsigned short __y) { return (simd_ushort2){__x, __y}; }
932static simd_int2 SIMD_CFUNC vector2(int __x, int __y) { return ( simd_int2){__x, __y}; }
933static simd_uint2 SIMD_CFUNC vector2(unsigned int __x, unsigned int __y) { return ( simd_uint2){__x, __y}; }
934static simd_float2 SIMD_CFUNC vector2(float __x, float __y) { return ( simd_float2){__x, __y}; }
935static simd_long2 SIMD_CFUNC vector2(simd_long1 __x, simd_long1 __y) { return ( simd_long2){__x, __y}; }
936static simd_ulong2 SIMD_CFUNC vector2(simd_ulong1 __x, simd_ulong1 __y) { return ( simd_ulong2){__x, __y}; }
937static simd_double2 SIMD_CFUNC vector2(double __x, double __y) { return (simd_double2){__x, __y}; }
938
939static simd_char3 SIMD_CFUNC vector3(char __x, char __y, char __z) { return ( simd_char3){__x, __y, __z}; }
940static simd_uchar3 SIMD_CFUNC vector3(unsigned char __x, unsigned char __y, unsigned char __z) { return ( simd_uchar3){__x, __y, __z}; }
941static simd_short3 SIMD_CFUNC vector3(short __x, short __y, short __z) { return ( simd_short3){__x, __y, __z}; }
942static simd_ushort3 SIMD_CFUNC vector3(unsigned short __x, unsigned short __y, unsigned short __z) { return (simd_ushort3){__x, __y, __z}; }
943static simd_int3 SIMD_CFUNC vector3(int __x, int __y, int __z) { return ( simd_int3){__x, __y, __z}; }
944static simd_uint3 SIMD_CFUNC vector3(unsigned int __x, unsigned int __y, unsigned int __z) { return ( simd_uint3){__x, __y, __z}; }
945static simd_float3 SIMD_CFUNC vector3(float __x, float __y, float __z) { return ( simd_float3){__x, __y, __z}; }
946static simd_long3 SIMD_CFUNC vector3(simd_long1 __x, simd_long1 __y, simd_long1 __z) { return ( simd_long3){__x, __y, __z}; }
947static simd_ulong3 SIMD_CFUNC vector3(simd_ulong1 __x, simd_ulong1 __y, simd_ulong1 __z) { return ( simd_ulong3){__x, __y, __z}; }
948static simd_double3 SIMD_CFUNC vector3(double __x, double __y, double __z) { return (simd_double3){__x, __y, __z}; }
949
950static simd_char3 SIMD_CFUNC vector3(simd_char2 __xy, char __z) { simd_char3 __r; __r.xy = __xy; __r.z = __z; return __r; }
951static simd_uchar3 SIMD_CFUNC vector3(simd_uchar2 __xy, unsigned char __z) { simd_uchar3 __r; __r.xy = __xy; __r.z = __z; return __r; }
952static simd_short3 SIMD_CFUNC vector3(simd_short2 __xy, short __z) { simd_short3 __r; __r.xy = __xy; __r.z = __z; return __r; }
953static simd_ushort3 SIMD_CFUNC vector3(simd_ushort2 __xy, unsigned short __z) { simd_ushort3 __r; __r.xy = __xy; __r.z = __z; return __r; }
954static simd_int3 SIMD_CFUNC vector3(simd_int2 __xy, int __z) { simd_int3 __r; __r.xy = __xy; __r.z = __z; return __r; }
955static simd_uint3 SIMD_CFUNC vector3(simd_uint2 __xy, unsigned int __z) { simd_uint3 __r; __r.xy = __xy; __r.z = __z; return __r; }
956static simd_float3 SIMD_CFUNC vector3(simd_float2 __xy, float __z) { simd_float3 __r; __r.xy = __xy; __r.z = __z; return __r; }
957static simd_long3 SIMD_CFUNC vector3(simd_long2 __xy, simd_long1 __z) { simd_long3 __r; __r.xy = __xy; __r.z = __z; return __r; }
958static simd_ulong3 SIMD_CFUNC vector3(simd_ulong2 __xy, simd_ulong1 __z) { simd_ulong3 __r; __r.xy = __xy; __r.z = __z; return __r; }
959static simd_double3 SIMD_CFUNC vector3(simd_double2 __xy, double __z) { simd_double3 __r; __r.xy = __xy; __r.z = __z; return __r; }
960
961static simd_char4 SIMD_CFUNC vector4(char __x, char __y, char __z, char __w) { return ( simd_char4){__x, __y, __z, __w}; }
962static simd_uchar4 SIMD_CFUNC vector4(unsigned char __x, unsigned char __y, unsigned char __z, unsigned char __w) { return ( simd_uchar4){__x, __y, __z, __w}; }
963static simd_short4 SIMD_CFUNC vector4(short __x, short __y, short __z, short __w) { return ( simd_short4){__x, __y, __z, __w}; }
964static simd_ushort4 SIMD_CFUNC vector4(unsigned short __x, unsigned short __y, unsigned short __z, unsigned short __w) { return (simd_ushort4){__x, __y, __z, __w}; }
965static simd_int4 SIMD_CFUNC vector4(int __x, int __y, int __z, int __w) { return ( simd_int4){__x, __y, __z, __w}; }
966static simd_uint4 SIMD_CFUNC vector4(unsigned int __x, unsigned int __y, unsigned int __z, unsigned int __w) { return ( simd_uint4){__x, __y, __z, __w}; }
967static simd_float4 SIMD_CFUNC vector4(float __x, float __y, float __z, float __w) { return ( simd_float4){__x, __y, __z, __w}; }
968static simd_long4 SIMD_CFUNC vector4(simd_long1 __x, simd_long1 __y, simd_long1 __z, simd_long1 __w) { return ( simd_long4){__x, __y, __z, __w}; }
969static simd_ulong4 SIMD_CFUNC vector4(simd_ulong1 __x, simd_ulong1 __y, simd_ulong1 __z, simd_ulong1 __w) { return ( simd_ulong4){__x, __y, __z, __w}; }
970static simd_double4 SIMD_CFUNC vector4(double __x, double __y, double __z, double __w) { return (simd_double4){__x, __y, __z, __w}; }
971
972static simd_char4 SIMD_CFUNC vector4(simd_char2 __xy, simd_char2 __zw) { simd_char4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
973static simd_uchar4 SIMD_CFUNC vector4(simd_uchar2 __xy, simd_uchar2 __zw) { simd_uchar4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
974static simd_short4 SIMD_CFUNC vector4(simd_short2 __xy, simd_short2 __zw) { simd_short4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
975static simd_ushort4 SIMD_CFUNC vector4(simd_ushort2 __xy, simd_ushort2 __zw) { simd_ushort4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
976static simd_int4 SIMD_CFUNC vector4(simd_int2 __xy, simd_int2 __zw) { simd_int4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
977static simd_uint4 SIMD_CFUNC vector4(simd_uint2 __xy, simd_uint2 __zw) { simd_uint4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
978static simd_float4 SIMD_CFUNC vector4(simd_float2 __xy, simd_float2 __zw) { simd_float4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
979static simd_long4 SIMD_CFUNC vector4(simd_long2 __xy, simd_long2 __zw) { simd_long4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
980static simd_ulong4 SIMD_CFUNC vector4(simd_ulong2 __xy, simd_ulong2 __zw) { simd_ulong4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
981static simd_double4 SIMD_CFUNC vector4(simd_double2 __xy, simd_double2 __zw) { simd_double4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
982
983static simd_char4 SIMD_CFUNC vector4(simd_char3 __xyz, char __w) { simd_char4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
984static simd_uchar4 SIMD_CFUNC vector4(simd_uchar3 __xyz, unsigned char __w) { simd_uchar4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
985static simd_short4 SIMD_CFUNC vector4(simd_short3 __xyz, short __w) { simd_short4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
986static simd_ushort4 SIMD_CFUNC vector4(simd_ushort3 __xyz, unsigned short __w) { simd_ushort4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
987static simd_int4 SIMD_CFUNC vector4(simd_int3 __xyz, int __w) { simd_int4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
988static simd_uint4 SIMD_CFUNC vector4(simd_uint3 __xyz, unsigned int __w) { simd_uint4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
989static simd_float4 SIMD_CFUNC vector4(simd_float3 __xyz, float __w) { simd_float4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
990static simd_long4 SIMD_CFUNC vector4(simd_long3 __xyz, simd_long1 __w) { simd_long4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
991static simd_ulong4 SIMD_CFUNC vector4(simd_ulong3 __xyz, simd_ulong1 __w) { simd_ulong4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
992static simd_double4 SIMD_CFUNC vector4(simd_double3 __xyz, double __w) { simd_double4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
993
994static simd_char8 SIMD_CFUNC vector8(simd_char4 __lo, simd_char4 __hi) { simd_char8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
995static simd_uchar8 SIMD_CFUNC vector8(simd_uchar4 __lo, simd_uchar4 __hi) { simd_uchar8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
996static simd_short8 SIMD_CFUNC vector8(simd_short4 __lo, simd_short4 __hi) { simd_short8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
997static simd_ushort8 SIMD_CFUNC vector8(simd_ushort4 __lo, simd_ushort4 __hi) { simd_ushort8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
998static simd_int8 SIMD_CFUNC vector8(simd_int4 __lo, simd_int4 __hi) { simd_int8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
999static simd_uint8 SIMD_CFUNC vector8(simd_uint4 __lo, simd_uint4 __hi) { simd_uint8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1000static simd_float8 SIMD_CFUNC vector8(simd_float4 __lo, simd_float4 __hi) { simd_float8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1001static simd_long8 SIMD_CFUNC vector8(simd_long4 __lo, simd_long4 __hi) { simd_long8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1002static simd_ulong8 SIMD_CFUNC vector8(simd_ulong4 __lo, simd_ulong4 __hi) { simd_ulong8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1003static simd_double8 SIMD_CFUNC vector8(simd_double4 __lo, simd_double4 __hi) { simd_double8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1004
1005static simd_char16 SIMD_CFUNC vector16(simd_char8 __lo, simd_char8 __hi) { simd_char16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1006static simd_uchar16 SIMD_CFUNC vector16(simd_uchar8 __lo, simd_uchar8 __hi) { simd_uchar16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1007static simd_short16 SIMD_CFUNC vector16(simd_short8 __lo, simd_short8 __hi) { simd_short16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1008static simd_ushort16 SIMD_CFUNC vector16(simd_ushort8 __lo, simd_ushort8 __hi) { simd_ushort16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1009static simd_int16 SIMD_CFUNC vector16(simd_int8 __lo, simd_int8 __hi) { simd_int16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1010static simd_uint16 SIMD_CFUNC vector16(simd_uint8 __lo, simd_uint8 __hi) { simd_uint16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1011static simd_float16 SIMD_CFUNC vector16(simd_float8 __lo, simd_float8 __hi) { simd_float16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1012
1013static simd_char32 SIMD_CFUNC vector32(simd_char16 __lo, simd_char16 __hi) { simd_char32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1014static simd_uchar32 SIMD_CFUNC vector32(simd_uchar16 __lo, simd_uchar16 __hi) { simd_uchar32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1015static simd_short32 SIMD_CFUNC vector32(simd_short16 __lo, simd_short16 __hi) { simd_short32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1016static 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
1020static simd_char2 SIMD_CFUNC simd_char(simd_char2 __x) { return __x; }
1021static simd_char3 SIMD_CFUNC simd_char(simd_char3 __x) { return __x; }
1022static simd_char4 SIMD_CFUNC simd_char(simd_char4 __x) { return __x; }
1023static simd_char8 SIMD_CFUNC simd_char(simd_char8 __x) { return __x; }
1024static simd_char16 SIMD_CFUNC simd_char(simd_char16 __x) { return __x; }
1025static simd_char32 SIMD_CFUNC simd_char(simd_char32 __x) { return __x; }
1026static simd_char2 SIMD_CFUNC simd_char(simd_uchar2 __x) { return (simd_char2)__x; }
1027static simd_char3 SIMD_CFUNC simd_char(simd_uchar3 __x) { return (simd_char3)__x; }
1028static simd_char4 SIMD_CFUNC simd_char(simd_uchar4 __x) { return (simd_char4)__x; }
1029static simd_char8 SIMD_CFUNC simd_char(simd_uchar8 __x) { return (simd_char8)__x; }
1030static simd_char16 SIMD_CFUNC simd_char(simd_uchar16 __x) { return (simd_char16)__x; }
1031static simd_char32 SIMD_CFUNC simd_char(simd_uchar32 __x) { return (simd_char32)__x; }
1032static simd_char2 SIMD_CFUNC simd_char(simd_short2 __x) { return __builtin_convertvector(__x & 0xff, simd_char2); }
1033static simd_char3 SIMD_CFUNC simd_char(simd_short3 __x) { return __builtin_convertvector(__x & 0xff, simd_char3); }
1034static simd_char4 SIMD_CFUNC simd_char(simd_short4 __x) { return __builtin_convertvector(__x & 0xff, simd_char4); }
1035static simd_char8 SIMD_CFUNC simd_char(simd_short8 __x) { return __builtin_convertvector(__x & 0xff, simd_char8); }
1036static simd_char16 SIMD_CFUNC simd_char(simd_short16 __x) { return __builtin_convertvector(__x & 0xff, simd_char16); }
1037static simd_char32 SIMD_CFUNC simd_char(simd_short32 __x) { return __builtin_convertvector(__x & 0xff, simd_char32); }
1038static simd_char2 SIMD_CFUNC simd_char(simd_ushort2 __x) { return simd_char(simd_short(__x)); }
1039static simd_char3 SIMD_CFUNC simd_char(simd_ushort3 __x) { return simd_char(simd_short(__x)); }
1040static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x) { return simd_char(simd_short(__x)); }
1041static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x) { return simd_char(simd_short(__x)); }
1042static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x) { return simd_char(simd_short(__x)); }
1043static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x) { return simd_char(simd_short(__x)); }
1044static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x) { return simd_char(simd_short(__x)); }
1045static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x) { return simd_char(simd_short(__x)); }
1046static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x) { return simd_char(simd_short(__x)); }
1047static simd_char8 SIMD_CFUNC simd_char(simd_int8 __x) { return simd_char(simd_short(__x)); }
1048static simd_char16 SIMD_CFUNC simd_char(simd_int16 __x) { return simd_char(simd_short(__x)); }
1049static simd_char2 SIMD_CFUNC simd_char(simd_uint2 __x) { return simd_char(simd_short(__x)); }
1050static simd_char3 SIMD_CFUNC simd_char(simd_uint3 __x) { return simd_char(simd_short(__x)); }
1051static simd_char4 SIMD_CFUNC simd_char(simd_uint4 __x) { return simd_char(simd_short(__x)); }
1052static simd_char8 SIMD_CFUNC simd_char(simd_uint8 __x) { return simd_char(simd_short(__x)); }
1053static simd_char16 SIMD_CFUNC simd_char(simd_uint16 __x) { return simd_char(simd_short(__x)); }
1054static simd_char2 SIMD_CFUNC simd_char(simd_float2 __x) { return simd_char(simd_short(__x)); }
1055static simd_char3 SIMD_CFUNC simd_char(simd_float3 __x) { return simd_char(simd_short(__x)); }
1056static simd_char4 SIMD_CFUNC simd_char(simd_float4 __x) { return simd_char(simd_short(__x)); }
1057static simd_char8 SIMD_CFUNC simd_char(simd_float8 __x) { return simd_char(simd_short(__x)); }
1058static simd_char16 SIMD_CFUNC simd_char(simd_float16 __x) { return simd_char(simd_short(__x)); }
1059static simd_char2 SIMD_CFUNC simd_char(simd_long2 __x) { return simd_char(simd_short(__x)); }
1060static simd_char3 SIMD_CFUNC simd_char(simd_long3 __x) { return simd_char(simd_short(__x)); }
1061static simd_char4 SIMD_CFUNC simd_char(simd_long4 __x) { return simd_char(simd_short(__x)); }
1062static simd_char8 SIMD_CFUNC simd_char(simd_long8 __x) { return simd_char(simd_short(__x)); }
1063static simd_char2 SIMD_CFUNC simd_char(simd_ulong2 __x) { return simd_char(simd_short(__x)); }
1064static simd_char3 SIMD_CFUNC simd_char(simd_ulong3 __x) { return simd_char(simd_short(__x)); }
1065static simd_char4 SIMD_CFUNC simd_char(simd_ulong4 __x) { return simd_char(simd_short(__x)); }
1066static simd_char8 SIMD_CFUNC simd_char(simd_ulong8 __x) { return simd_char(simd_short(__x)); }
1067static simd_char2 SIMD_CFUNC simd_char(simd_double2 __x) { return simd_char(simd_short(__x)); }
1068static simd_char3 SIMD_CFUNC simd_char(simd_double3 __x) { return simd_char(simd_short(__x)); }
1069static simd_char4 SIMD_CFUNC simd_char(simd_double4 __x) { return simd_char(simd_short(__x)); }
1070static simd_char8 SIMD_CFUNC simd_char(simd_double8 __x) { return simd_char(simd_short(__x)); }
1071
1072static simd_char2 SIMD_CFUNC simd_char_sat(simd_char2 __x) { return __x; }
1073static simd_char3 SIMD_CFUNC simd_char_sat(simd_char3 __x) { return __x; }
1074static simd_char4 SIMD_CFUNC simd_char_sat(simd_char4 __x) { return __x; }
1075static simd_char8 SIMD_CFUNC simd_char_sat(simd_char8 __x) { return __x; }
1076static simd_char16 SIMD_CFUNC simd_char_sat(simd_char16 __x) { return __x; }
1077static simd_char32 SIMD_CFUNC simd_char_sat(simd_char32 __x) { return __x; }
1078static simd_char2 SIMD_CFUNC simd_char_sat(simd_short2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1079static simd_char3 SIMD_CFUNC simd_char_sat(simd_short3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1080static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1081static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1082static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1083static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1084static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1085static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1086static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1087static simd_char8 SIMD_CFUNC simd_char_sat(simd_int8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1088static simd_char16 SIMD_CFUNC simd_char_sat(simd_int16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1089static simd_char2 SIMD_CFUNC simd_char_sat(simd_float2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1090static simd_char3 SIMD_CFUNC simd_char_sat(simd_float3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1091static simd_char4 SIMD_CFUNC simd_char_sat(simd_float4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1092static simd_char8 SIMD_CFUNC simd_char_sat(simd_float8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1093static simd_char16 SIMD_CFUNC simd_char_sat(simd_float16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1094static simd_char2 SIMD_CFUNC simd_char_sat(simd_long2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1095static simd_char3 SIMD_CFUNC simd_char_sat(simd_long3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1096static simd_char4 SIMD_CFUNC simd_char_sat(simd_long4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1097static simd_char8 SIMD_CFUNC simd_char_sat(simd_long8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1098static simd_char2 SIMD_CFUNC simd_char_sat(simd_double2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1099static simd_char3 SIMD_CFUNC simd_char_sat(simd_double3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1100static simd_char4 SIMD_CFUNC simd_char_sat(simd_double4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1101static simd_char8 SIMD_CFUNC simd_char_sat(simd_double8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1102static simd_char2 SIMD_CFUNC simd_char_sat(simd_uchar2 __x) { return simd_char(simd_min(__x,0x7f)); }
1103static simd_char3 SIMD_CFUNC simd_char_sat(simd_uchar3 __x) { return simd_char(simd_min(__x,0x7f)); }
1104static simd_char4 SIMD_CFUNC simd_char_sat(simd_uchar4 __x) { return simd_char(simd_min(__x,0x7f)); }
1105static simd_char8 SIMD_CFUNC simd_char_sat(simd_uchar8 __x) { return simd_char(simd_min(__x,0x7f)); }
1106static simd_char16 SIMD_CFUNC simd_char_sat(simd_uchar16 __x) { return simd_char(simd_min(__x,0x7f)); }
1107static simd_char32 SIMD_CFUNC simd_char_sat(simd_uchar32 __x) { return simd_char(simd_min(__x,0x7f)); }
1108static simd_char2 SIMD_CFUNC simd_char_sat(simd_ushort2 __x) { return simd_char(simd_min(__x,0x7f)); }
1109static simd_char3 SIMD_CFUNC simd_char_sat(simd_ushort3 __x) { return simd_char(simd_min(__x,0x7f)); }
1110static simd_char4 SIMD_CFUNC simd_char_sat(simd_ushort4 __x) { return simd_char(simd_min(__x,0x7f)); }
1111static simd_char8 SIMD_CFUNC simd_char_sat(simd_ushort8 __x) { return simd_char(simd_min(__x,0x7f)); }
1112static simd_char16 SIMD_CFUNC simd_char_sat(simd_ushort16 __x) { return simd_char(simd_min(__x,0x7f)); }
1113static simd_char32 SIMD_CFUNC simd_char_sat(simd_ushort32 __x) { return simd_char(simd_min(__x,0x7f)); }
1114static simd_char2 SIMD_CFUNC simd_char_sat(simd_uint2 __x) { return simd_char(simd_min(__x,0x7f)); }
1115static simd_char3 SIMD_CFUNC simd_char_sat(simd_uint3 __x) { return simd_char(simd_min(__x,0x7f)); }
1116static simd_char4 SIMD_CFUNC simd_char_sat(simd_uint4 __x) { return simd_char(simd_min(__x,0x7f)); }
1117static simd_char8 SIMD_CFUNC simd_char_sat(simd_uint8 __x) { return simd_char(simd_min(__x,0x7f)); }
1118static simd_char16 SIMD_CFUNC simd_char_sat(simd_uint16 __x) { return simd_char(simd_min(__x,0x7f)); }
1119static simd_char2 SIMD_CFUNC simd_char_sat(simd_ulong2 __x) { return simd_char(simd_min(__x,0x7f)); }
1120static simd_char3 SIMD_CFUNC simd_char_sat(simd_ulong3 __x) { return simd_char(simd_min(__x,0x7f)); }
1121static simd_char4 SIMD_CFUNC simd_char_sat(simd_ulong4 __x) { return simd_char(simd_min(__x,0x7f)); }
1122static simd_char8 SIMD_CFUNC simd_char_sat(simd_ulong8 __x) { return simd_char(simd_min(__x,0x7f)); }
1123
1124
1125static simd_uchar2 SIMD_CFUNC simd_uchar(simd_char2 __x) { return (simd_uchar2)__x; }
1126static simd_uchar3 SIMD_CFUNC simd_uchar(simd_char3 __x) { return (simd_uchar3)__x; }
1127static simd_uchar4 SIMD_CFUNC simd_uchar(simd_char4 __x) { return (simd_uchar4)__x; }
1128static simd_uchar8 SIMD_CFUNC simd_uchar(simd_char8 __x) { return (simd_uchar8)__x; }
1129static simd_uchar16 SIMD_CFUNC simd_uchar(simd_char16 __x) { return (simd_uchar16)__x; }
1130static simd_uchar32 SIMD_CFUNC simd_uchar(simd_char32 __x) { return (simd_uchar32)__x; }
1131static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uchar2 __x) { return __x; }
1132static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uchar3 __x) { return __x; }
1133static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uchar4 __x) { return __x; }
1134static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uchar8 __x) { return __x; }
1135static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uchar16 __x) { return __x; }
1136static simd_uchar32 SIMD_CFUNC simd_uchar(simd_uchar32 __x) { return __x; }
1137static simd_uchar2 SIMD_CFUNC simd_uchar(simd_short2 __x) { return simd_uchar(simd_char(__x)); }
1138static simd_uchar3 SIMD_CFUNC simd_uchar(simd_short3 __x) { return simd_uchar(simd_char(__x)); }
1139static simd_uchar4 SIMD_CFUNC simd_uchar(simd_short4 __x) { return simd_uchar(simd_char(__x)); }
1140static simd_uchar8 SIMD_CFUNC simd_uchar(simd_short8 __x) { return simd_uchar(simd_char(__x)); }
1141static simd_uchar16 SIMD_CFUNC simd_uchar(simd_short16 __x) { return simd_uchar(simd_char(__x)); }
1142static simd_uchar32 SIMD_CFUNC simd_uchar(simd_short32 __x) { return simd_uchar(simd_char(__x)); }
1143static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ushort2 __x) { return simd_uchar(simd_char(__x)); }
1144static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ushort3 __x) { return simd_uchar(simd_char(__x)); }
1145static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x) { return simd_uchar(simd_char(__x)); }
1146static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x) { return simd_uchar(simd_char(__x)); }
1147static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x) { return simd_uchar(simd_char(__x)); }
1148static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x) { return simd_uchar(simd_char(__x)); }
1149static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x) { return simd_uchar(simd_char(__x)); }
1150static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x) { return simd_uchar(simd_char(__x)); }
1151static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x) { return simd_uchar(simd_char(__x)); }
1152static simd_uchar8 SIMD_CFUNC simd_uchar(simd_int8 __x) { return simd_uchar(simd_char(__x)); }
1153static simd_uchar16 SIMD_CFUNC simd_uchar(simd_int16 __x) { return simd_uchar(simd_char(__x)); }
1154static simd_uchar2 SIMD_CFUNC simd_uchar(simd_uint2 __x) { return simd_uchar(simd_char(__x)); }
1155static simd_uchar3 SIMD_CFUNC simd_uchar(simd_uint3 __x) { return simd_uchar(simd_char(__x)); }
1156static simd_uchar4 SIMD_CFUNC simd_uchar(simd_uint4 __x) { return simd_uchar(simd_char(__x)); }
1157static simd_uchar8 SIMD_CFUNC simd_uchar(simd_uint8 __x) { return simd_uchar(simd_char(__x)); }
1158static simd_uchar16 SIMD_CFUNC simd_uchar(simd_uint16 __x) { return simd_uchar(simd_char(__x)); }
1159static simd_uchar2 SIMD_CFUNC simd_uchar(simd_float2 __x) { return simd_uchar(simd_char(__x)); }
1160static simd_uchar3 SIMD_CFUNC simd_uchar(simd_float3 __x) { return simd_uchar(simd_char(__x)); }
1161static simd_uchar4 SIMD_CFUNC simd_uchar(simd_float4 __x) { return simd_uchar(simd_char(__x)); }
1162static simd_uchar8 SIMD_CFUNC simd_uchar(simd_float8 __x) { return simd_uchar(simd_char(__x)); }
1163static simd_uchar16 SIMD_CFUNC simd_uchar(simd_float16 __x) { return simd_uchar(simd_char(__x)); }
1164static simd_uchar2 SIMD_CFUNC simd_uchar(simd_long2 __x) { return simd_uchar(simd_char(__x)); }
1165static simd_uchar3 SIMD_CFUNC simd_uchar(simd_long3 __x) { return simd_uchar(simd_char(__x)); }
1166static simd_uchar4 SIMD_CFUNC simd_uchar(simd_long4 __x) { return simd_uchar(simd_char(__x)); }
1167static simd_uchar8 SIMD_CFUNC simd_uchar(simd_long8 __x) { return simd_uchar(simd_char(__x)); }
1168static simd_uchar2 SIMD_CFUNC simd_uchar(simd_ulong2 __x) { return simd_uchar(simd_char(__x)); }
1169static simd_uchar3 SIMD_CFUNC simd_uchar(simd_ulong3 __x) { return simd_uchar(simd_char(__x)); }
1170static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ulong4 __x) { return simd_uchar(simd_char(__x)); }
1171static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ulong8 __x) { return simd_uchar(simd_char(__x)); }
1172static simd_uchar2 SIMD_CFUNC simd_uchar(simd_double2 __x) { return simd_uchar(simd_char(__x)); }
1173static simd_uchar3 SIMD_CFUNC simd_uchar(simd_double3 __x) { return simd_uchar(simd_char(__x)); }
1174static simd_uchar4 SIMD_CFUNC simd_uchar(simd_double4 __x) { return simd_uchar(simd_char(__x)); }
1175static simd_uchar8 SIMD_CFUNC simd_uchar(simd_double8 __x) { return simd_uchar(simd_char(__x)); }
1176
1177static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_char2 __x) { return simd_uchar(simd_max(0,__x)); }
1178static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_char3 __x) { return simd_uchar(simd_max(0,__x)); }
1179static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_char4 __x) { return simd_uchar(simd_max(0,__x)); }
1180static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_char8 __x) { return simd_uchar(simd_max(0,__x)); }
1181static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_char16 __x) { return simd_uchar(simd_max(0,__x)); }
1182static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_char32 __x) { return simd_uchar(simd_max(0,__x)); }
1183static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_short2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1184static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_short3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1185static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1186static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1187static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1188static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1189static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1190static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1191static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1192static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_int8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1193static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_int16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1194static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_float2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1195static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_float3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1196static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_float4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1197static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_float8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1198static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_float16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1199static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_long2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1200static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_long3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1201static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_long4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1202static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_long8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1203static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_double2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1204static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_double3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1205static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_double4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1206static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_double8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1207static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uchar2 __x) { return __x; }
1208static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uchar3 __x) { return __x; }
1209static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uchar4 __x) { return __x; }
1210static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uchar8 __x) { return __x; }
1211static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uchar16 __x) { return __x; }
1212static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_uchar32 __x) { return __x; }
1213static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ushort2 __x) { return simd_uchar(simd_min(__x,0xff)); }
1214static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ushort3 __x) { return simd_uchar(simd_min(__x,0xff)); }
1215static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ushort4 __x) { return simd_uchar(simd_min(__x,0xff)); }
1216static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ushort8 __x) { return simd_uchar(simd_min(__x,0xff)); }
1217static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_ushort16 __x) { return simd_uchar(simd_min(__x,0xff)); }
1218static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_ushort32 __x) { return simd_uchar(simd_min(__x,0xff)); }
1219static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_uint2 __x) { return simd_uchar(simd_min(__x,0xff)); }
1220static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_uint3 __x) { return simd_uchar(simd_min(__x,0xff)); }
1221static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_uint4 __x) { return simd_uchar(simd_min(__x,0xff)); }
1222static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_uint8 __x) { return simd_uchar(simd_min(__x,0xff)); }
1223static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_uint16 __x) { return simd_uchar(simd_min(__x,0xff)); }
1224static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ulong2 __x) { return simd_uchar(simd_min(__x,0xff)); }
1225static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ulong3 __x) { return simd_uchar(simd_min(__x,0xff)); }
1226static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ulong4 __x) { return simd_uchar(simd_min(__x,0xff)); }
1227static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ulong8 __x) { return simd_uchar(simd_min(__x,0xff)); }
1228
1229
1230static simd_short2 SIMD_CFUNC simd_short(simd_char2 __x) { return __builtin_convertvector(__x, simd_short2); }
1231static simd_short3 SIMD_CFUNC simd_short(simd_char3 __x) { return __builtin_convertvector(__x, simd_short3); }
1232static simd_short4 SIMD_CFUNC simd_short(simd_char4 __x) { return __builtin_convertvector(__x, simd_short4); }
1233static simd_short8 SIMD_CFUNC simd_short(simd_char8 __x) { return __builtin_convertvector(__x, simd_short8); }
1234static simd_short16 SIMD_CFUNC simd_short(simd_char16 __x) { return __builtin_convertvector(__x, simd_short16); }
1235static simd_short32 SIMD_CFUNC simd_short(simd_char32 __x) { return __builtin_convertvector(__x, simd_short32); }
1236static simd_short2 SIMD_CFUNC simd_short(simd_uchar2 __x) { return __builtin_convertvector(__x, simd_short2); }
1237static simd_short3 SIMD_CFUNC simd_short(simd_uchar3 __x) { return __builtin_convertvector(__x, simd_short3); }
1238static simd_short4 SIMD_CFUNC simd_short(simd_uchar4 __x) { return __builtin_convertvector(__x, simd_short4); }
1239static simd_short8 SIMD_CFUNC simd_short(simd_uchar8 __x) { return __builtin_convertvector(__x, simd_short8); }
1240static simd_short16 SIMD_CFUNC simd_short(simd_uchar16 __x) { return __builtin_convertvector(__x, simd_short16); }
1241static simd_short32 SIMD_CFUNC simd_short(simd_uchar32 __x) { return __builtin_convertvector(__x, simd_short32); }
1242static simd_short2 SIMD_CFUNC simd_short(simd_short2 __x) { return __x; }
1243static simd_short3 SIMD_CFUNC simd_short(simd_short3 __x) { return __x; }
1244static simd_short4 SIMD_CFUNC simd_short(simd_short4 __x) { return __x; }
1245static simd_short8 SIMD_CFUNC simd_short(simd_short8 __x) { return __x; }
1246static simd_short16 SIMD_CFUNC simd_short(simd_short16 __x) { return __x; }
1247static simd_short32 SIMD_CFUNC simd_short(simd_short32 __x) { return __x; }
1248static simd_short2 SIMD_CFUNC simd_short(simd_ushort2 __x) { return (simd_short2)__x; }
1249static simd_short3 SIMD_CFUNC simd_short(simd_ushort3 __x) { return (simd_short3)__x; }
1250static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x) { return (simd_short4)__x; }
1251static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x) { return (simd_short8)__x; }
1252static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x) { return (simd_short16)__x; }
1253static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x) { return (simd_short32)__x; }
1254static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x) { return __builtin_convertvector(__x & 0xffff, simd_short2); }
1255static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x) { return __builtin_convertvector(__x & 0xffff, simd_short3); }
1256static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x) { return __builtin_convertvector(__x & 0xffff, simd_short4); }
1257static simd_short8 SIMD_CFUNC simd_short(simd_int8 __x) { return __builtin_convertvector(__x & 0xffff, simd_short8); }
1258static simd_short16 SIMD_CFUNC simd_short(simd_int16 __x) { return __builtin_convertvector(__x & 0xffff, simd_short16); }
1259static simd_short2 SIMD_CFUNC simd_short(simd_uint2 __x) { return simd_short(simd_int(__x)); }
1260static simd_short3 SIMD_CFUNC simd_short(simd_uint3 __x) { return simd_short(simd_int(__x)); }
1261static simd_short4 SIMD_CFUNC simd_short(simd_uint4 __x) { return simd_short(simd_int(__x)); }
1262static simd_short8 SIMD_CFUNC simd_short(simd_uint8 __x) { return simd_short(simd_int(__x)); }
1263static simd_short16 SIMD_CFUNC simd_short(simd_uint16 __x) { return simd_short(simd_int(__x)); }
1264static simd_short2 SIMD_CFUNC simd_short(simd_float2 __x) { return simd_short(simd_int(__x)); }
1265static simd_short3 SIMD_CFUNC simd_short(simd_float3 __x) { return simd_short(simd_int(__x)); }
1266static simd_short4 SIMD_CFUNC simd_short(simd_float4 __x) { return simd_short(simd_int(__x)); }
1267static simd_short8 SIMD_CFUNC simd_short(simd_float8 __x) { return simd_short(simd_int(__x)); }
1268static simd_short16 SIMD_CFUNC simd_short(simd_float16 __x) { return simd_short(simd_int(__x)); }
1269static simd_short2 SIMD_CFUNC simd_short(simd_long2 __x) { return simd_short(simd_int(__x)); }
1270static simd_short3 SIMD_CFUNC simd_short(simd_long3 __x) { return simd_short(simd_int(__x)); }
1271static simd_short4 SIMD_CFUNC simd_short(simd_long4 __x) { return simd_short(simd_int(__x)); }
1272static simd_short8 SIMD_CFUNC simd_short(simd_long8 __x) { return simd_short(simd_int(__x)); }
1273static simd_short2 SIMD_CFUNC simd_short(simd_ulong2 __x) { return simd_short(simd_int(__x)); }
1274static simd_short3 SIMD_CFUNC simd_short(simd_ulong3 __x) { return simd_short(simd_int(__x)); }
1275static simd_short4 SIMD_CFUNC simd_short(simd_ulong4 __x) { return simd_short(simd_int(__x)); }
1276static simd_short8 SIMD_CFUNC simd_short(simd_ulong8 __x) { return simd_short(simd_int(__x)); }
1277static simd_short2 SIMD_CFUNC simd_short(simd_double2 __x) { return simd_short(simd_int(__x)); }
1278static simd_short3 SIMD_CFUNC simd_short(simd_double3 __x) { return simd_short(simd_int(__x)); }
1279static simd_short4 SIMD_CFUNC simd_short(simd_double4 __x) { return simd_short(simd_int(__x)); }
1280static simd_short8 SIMD_CFUNC simd_short(simd_double8 __x) { return simd_short(simd_int(__x)); }
1281
1282static simd_short2 SIMD_CFUNC simd_short_sat(simd_char2 __x) { return simd_short(__x); }
1283static simd_short3 SIMD_CFUNC simd_short_sat(simd_char3 __x) { return simd_short(__x); }
1284static simd_short4 SIMD_CFUNC simd_short_sat(simd_char4 __x) { return simd_short(__x); }
1285static simd_short8 SIMD_CFUNC simd_short_sat(simd_char8 __x) { return simd_short(__x); }
1286static simd_short16 SIMD_CFUNC simd_short_sat(simd_char16 __x) { return simd_short(__x); }
1287static simd_short32 SIMD_CFUNC simd_short_sat(simd_char32 __x) { return simd_short(__x); }
1288static simd_short2 SIMD_CFUNC simd_short_sat(simd_short2 __x) { return __x; }
1289static simd_short3 SIMD_CFUNC simd_short_sat(simd_short3 __x) { return __x; }
1290static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x) { return __x; }
1291static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x) { return __x; }
1292static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x) { return __x; }
1293static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x) { return __x; }
1294static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1295static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1296static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1297static simd_short8 SIMD_CFUNC simd_short_sat(simd_int8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1298static simd_short16 SIMD_CFUNC simd_short_sat(simd_int16 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1299static simd_short2 SIMD_CFUNC simd_short_sat(simd_float2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1300static simd_short3 SIMD_CFUNC simd_short_sat(simd_float3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1301static simd_short4 SIMD_CFUNC simd_short_sat(simd_float4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1302static simd_short8 SIMD_CFUNC simd_short_sat(simd_float8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1303static simd_short16 SIMD_CFUNC simd_short_sat(simd_float16 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1304static simd_short2 SIMD_CFUNC simd_short_sat(simd_long2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1305static simd_short3 SIMD_CFUNC simd_short_sat(simd_long3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1306static simd_short4 SIMD_CFUNC simd_short_sat(simd_long4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1307static simd_short8 SIMD_CFUNC simd_short_sat(simd_long8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1308static simd_short2 SIMD_CFUNC simd_short_sat(simd_double2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1309static simd_short3 SIMD_CFUNC simd_short_sat(simd_double3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1310static simd_short4 SIMD_CFUNC simd_short_sat(simd_double4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1311static simd_short8 SIMD_CFUNC simd_short_sat(simd_double8 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1312static simd_short2 SIMD_CFUNC simd_short_sat(simd_uchar2 __x) { return simd_short(__x); }
1313static simd_short3 SIMD_CFUNC simd_short_sat(simd_uchar3 __x) { return simd_short(__x); }
1314static simd_short4 SIMD_CFUNC simd_short_sat(simd_uchar4 __x) { return simd_short(__x); }
1315static simd_short8 SIMD_CFUNC simd_short_sat(simd_uchar8 __x) { return simd_short(__x); }
1316static simd_short16 SIMD_CFUNC simd_short_sat(simd_uchar16 __x) { return simd_short(__x); }
1317static simd_short32 SIMD_CFUNC simd_short_sat(simd_uchar32 __x) { return simd_short(__x); }
1318static simd_short2 SIMD_CFUNC simd_short_sat(simd_ushort2 __x) { return simd_short(simd_min(__x,0x7fff)); }
1319static simd_short3 SIMD_CFUNC simd_short_sat(simd_ushort3 __x) { return simd_short(simd_min(__x,0x7fff)); }
1320static simd_short4 SIMD_CFUNC simd_short_sat(simd_ushort4 __x) { return simd_short(simd_min(__x,0x7fff)); }
1321static simd_short8 SIMD_CFUNC simd_short_sat(simd_ushort8 __x) { return simd_short(simd_min(__x,0x7fff)); }
1322static simd_short16 SIMD_CFUNC simd_short_sat(simd_ushort16 __x) { return simd_short(simd_min(__x,0x7fff)); }
1323static simd_short32 SIMD_CFUNC simd_short_sat(simd_ushort32 __x) { return simd_short(simd_min(__x,0x7fff)); }
1324static simd_short2 SIMD_CFUNC simd_short_sat(simd_uint2 __x) { return simd_short(simd_min(__x,0x7fff)); }
1325static simd_short3 SIMD_CFUNC simd_short_sat(simd_uint3 __x) { return simd_short(simd_min(__x,0x7fff)); }
1326static simd_short4 SIMD_CFUNC simd_short_sat(simd_uint4 __x) { return simd_short(simd_min(__x,0x7fff)); }
1327static simd_short8 SIMD_CFUNC simd_short_sat(simd_uint8 __x) { return simd_short(simd_min(__x,0x7fff)); }
1328static simd_short16 SIMD_CFUNC simd_short_sat(simd_uint16 __x) { return simd_short(simd_min(__x,0x7fff)); }
1329static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x) { return simd_short(simd_min(__x,0x7fff)); }
1330static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x) { return simd_short(simd_min(__x,0x7fff)); }
1331static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x) { return simd_short(simd_min(__x,0x7fff)); }
1332static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x) { return simd_short(simd_min(__x,0x7fff)); }
1333
1334
1335static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x) { return simd_ushort(simd_short(__x)); }
1336static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x) { return simd_ushort(simd_short(__x)); }
1337static simd_ushort4 SIMD_CFUNC simd_ushort(simd_char4 __x) { return simd_ushort(simd_short(__x)); }
1338static simd_ushort8 SIMD_CFUNC simd_ushort(simd_char8 __x) { return simd_ushort(simd_short(__x)); }
1339static simd_ushort16 SIMD_CFUNC simd_ushort(simd_char16 __x) { return simd_ushort(simd_short(__x)); }
1340static simd_ushort32 SIMD_CFUNC simd_ushort(simd_char32 __x) { return simd_ushort(simd_short(__x)); }
1341static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uchar2 __x) { return simd_ushort(simd_short(__x)); }
1342static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uchar3 __x) { return simd_ushort(simd_short(__x)); }
1343static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uchar4 __x) { return simd_ushort(simd_short(__x)); }
1344static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uchar8 __x) { return simd_ushort(simd_short(__x)); }
1345static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uchar16 __x) { return simd_ushort(simd_short(__x)); }
1346static simd_ushort32 SIMD_CFUNC simd_ushort(simd_uchar32 __x) { return simd_ushort(simd_short(__x)); }
1347static simd_ushort2 SIMD_CFUNC simd_ushort(simd_short2 __x) { return (simd_ushort2)__x; }
1348static simd_ushort3 SIMD_CFUNC simd_ushort(simd_short3 __x) { return (simd_ushort3)__x; }
1349static simd_ushort4 SIMD_CFUNC simd_ushort(simd_short4 __x) { return (simd_ushort4)__x; }
1350static simd_ushort8 SIMD_CFUNC simd_ushort(simd_short8 __x) { return (simd_ushort8)__x; }
1351static simd_ushort16 SIMD_CFUNC simd_ushort(simd_short16 __x) { return (simd_ushort16)__x; }
1352static simd_ushort32 SIMD_CFUNC simd_ushort(simd_short32 __x) { return (simd_ushort32)__x; }
1353static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ushort2 __x) { return __x; }
1354static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ushort3 __x) { return __x; }
1355static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x) { return __x; }
1356static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x) { return __x; }
1357static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x) { return __x; }
1358static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x) { return __x; }
1359static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x) { return simd_ushort(simd_short(__x)); }
1360static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x) { return simd_ushort(simd_short(__x)); }
1361static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x) { return simd_ushort(simd_short(__x)); }
1362static simd_ushort8 SIMD_CFUNC simd_ushort(simd_int8 __x) { return simd_ushort(simd_short(__x)); }
1363static simd_ushort16 SIMD_CFUNC simd_ushort(simd_int16 __x) { return simd_ushort(simd_short(__x)); }
1364static simd_ushort2 SIMD_CFUNC simd_ushort(simd_uint2 __x) { return simd_ushort(simd_short(__x)); }
1365static simd_ushort3 SIMD_CFUNC simd_ushort(simd_uint3 __x) { return simd_ushort(simd_short(__x)); }
1366static simd_ushort4 SIMD_CFUNC simd_ushort(simd_uint4 __x) { return simd_ushort(simd_short(__x)); }
1367static simd_ushort8 SIMD_CFUNC simd_ushort(simd_uint8 __x) { return simd_ushort(simd_short(__x)); }
1368static simd_ushort16 SIMD_CFUNC simd_ushort(simd_uint16 __x) { return simd_ushort(simd_short(__x)); }
1369static simd_ushort2 SIMD_CFUNC simd_ushort(simd_float2 __x) { return simd_ushort(simd_short(__x)); }
1370static simd_ushort3 SIMD_CFUNC simd_ushort(simd_float3 __x) { return simd_ushort(simd_short(__x)); }
1371static simd_ushort4 SIMD_CFUNC simd_ushort(simd_float4 __x) { return simd_ushort(simd_short(__x)); }
1372static simd_ushort8 SIMD_CFUNC simd_ushort(simd_float8 __x) { return simd_ushort(simd_short(__x)); }
1373static simd_ushort16 SIMD_CFUNC simd_ushort(simd_float16 __x) { return simd_ushort(simd_short(__x)); }
1374static simd_ushort2 SIMD_CFUNC simd_ushort(simd_long2 __x) { return simd_ushort(simd_short(__x)); }
1375static simd_ushort3 SIMD_CFUNC simd_ushort(simd_long3 __x) { return simd_ushort(simd_short(__x)); }
1376static simd_ushort4 SIMD_CFUNC simd_ushort(simd_long4 __x) { return simd_ushort(simd_short(__x)); }
1377static simd_ushort8 SIMD_CFUNC simd_ushort(simd_long8 __x) { return simd_ushort(simd_short(__x)); }
1378static simd_ushort2 SIMD_CFUNC simd_ushort(simd_ulong2 __x) { return simd_ushort(simd_short(__x)); }
1379static simd_ushort3 SIMD_CFUNC simd_ushort(simd_ulong3 __x) { return simd_ushort(simd_short(__x)); }
1380static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ulong4 __x) { return simd_ushort(simd_short(__x)); }
1381static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ulong8 __x) { return simd_ushort(simd_short(__x)); }
1382static simd_ushort2 SIMD_CFUNC simd_ushort(simd_double2 __x) { return simd_ushort(simd_short(__x)); }
1383static simd_ushort3 SIMD_CFUNC simd_ushort(simd_double3 __x) { return simd_ushort(simd_short(__x)); }
1384static simd_ushort4 SIMD_CFUNC simd_ushort(simd_double4 __x) { return simd_ushort(simd_short(__x)); }
1385static simd_ushort8 SIMD_CFUNC simd_ushort(simd_double8 __x) { return simd_ushort(simd_short(__x)); }
1386
1387static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_char2 __x) { return simd_ushort(simd_max(__x, 0)); }
1388static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_char3 __x) { return simd_ushort(simd_max(__x, 0)); }
1389static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_char4 __x) { return simd_ushort(simd_max(__x, 0)); }
1390static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_char8 __x) { return simd_ushort(simd_max(__x, 0)); }
1391static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_char16 __x) { return simd_ushort(simd_max(__x, 0)); }
1392static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_char32 __x) { return simd_ushort(simd_max(__x, 0)); }
1393static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_short2 __x) { return simd_ushort(simd_max(__x, 0)); }
1394static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_short3 __x) { return simd_ushort(simd_max(__x, 0)); }
1395static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x) { return simd_ushort(simd_max(__x, 0)); }
1396static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x) { return simd_ushort(simd_max(__x, 0)); }
1397static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x) { return simd_ushort(simd_max(__x, 0)); }
1398static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x) { return simd_ushort(simd_max(__x, 0)); }
1399static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1400static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1401static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1402static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_int8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1403static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_int16 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1404static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_float2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1405static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_float3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1406static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_float4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1407static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_float8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1408static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_float16 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1409static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_long2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1410static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_long3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1411static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_long4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1412static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_long8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1413static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_double2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1414static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_double3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1415static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_double4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1416static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_double8 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1417static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uchar2 __x) { return simd_ushort(__x); }
1418static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uchar3 __x) { return simd_ushort(__x); }
1419static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uchar4 __x) { return simd_ushort(__x); }
1420static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uchar8 __x) { return simd_ushort(__x); }
1421static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uchar16 __x) { return simd_ushort(__x); }
1422static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_uchar32 __x) { return simd_ushort(__x); }
1423static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ushort2 __x) { return __x; }
1424static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ushort3 __x) { return __x; }
1425static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ushort4 __x) { return __x; }
1426static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ushort8 __x) { return __x; }
1427static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_ushort16 __x) { return __x; }
1428static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_ushort32 __x) { return __x; }
1429static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_uint2 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1430static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_uint3 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1431static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_uint4 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1432static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_uint8 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1433static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_uint16 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1434static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1435static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1436static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1437static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1438
1439
1440static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x) { return __builtin_convertvector(__x, simd_int2); }
1441static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x) { return __builtin_convertvector(__x, simd_int3); }
1442static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x) { return __builtin_convertvector(__x, simd_int4); }
1443static simd_int8 SIMD_CFUNC simd_int(simd_char8 __x) { return __builtin_convertvector(__x, simd_int8); }
1444static simd_int16 SIMD_CFUNC simd_int(simd_char16 __x) { return __builtin_convertvector(__x, simd_int16); }
1445static simd_int2 SIMD_CFUNC simd_int(simd_uchar2 __x) { return __builtin_convertvector(__x, simd_int2); }
1446static simd_int3 SIMD_CFUNC simd_int(simd_uchar3 __x) { return __builtin_convertvector(__x, simd_int3); }
1447static simd_int4 SIMD_CFUNC simd_int(simd_uchar4 __x) { return __builtin_convertvector(__x, simd_int4); }
1448static simd_int8 SIMD_CFUNC simd_int(simd_uchar8 __x) { return __builtin_convertvector(__x, simd_int8); }
1449static simd_int16 SIMD_CFUNC simd_int(simd_uchar16 __x) { return __builtin_convertvector(__x, simd_int16); }
1450static simd_int2 SIMD_CFUNC simd_int(simd_short2 __x) { return __builtin_convertvector(__x, simd_int2); }
1451static simd_int3 SIMD_CFUNC simd_int(simd_short3 __x) { return __builtin_convertvector(__x, simd_int3); }
1452static simd_int4 SIMD_CFUNC simd_int(simd_short4 __x) { return __builtin_convertvector(__x, simd_int4); }
1453static simd_int8 SIMD_CFUNC simd_int(simd_short8 __x) { return __builtin_convertvector(__x, simd_int8); }
1454static simd_int16 SIMD_CFUNC simd_int(simd_short16 __x) { return __builtin_convertvector(__x, simd_int16); }
1455static simd_int2 SIMD_CFUNC simd_int(simd_ushort2 __x) { return __builtin_convertvector(__x, simd_int2); }
1456static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x) { return __builtin_convertvector(__x, simd_int3); }
1457static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x) { return __builtin_convertvector(__x, simd_int4); }
1458static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x) { return __builtin_convertvector(__x, simd_int8); }
1459static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x) { return __builtin_convertvector(__x, simd_int16); }
1460static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x) { return __x; }
1461static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x) { return __x; }
1462static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x) { return __x; }
1463static simd_int8 SIMD_CFUNC simd_int(simd_int8 __x) { return __x; }
1464static simd_int16 SIMD_CFUNC simd_int(simd_int16 __x) { return __x; }
1465static simd_int2 SIMD_CFUNC simd_int(simd_uint2 __x) { return (simd_int2)__x; }
1466static simd_int3 SIMD_CFUNC simd_int(simd_uint3 __x) { return (simd_int3)__x; }
1467static simd_int4 SIMD_CFUNC simd_int(simd_uint4 __x) { return (simd_int4)__x; }
1468static simd_int8 SIMD_CFUNC simd_int(simd_uint8 __x) { return (simd_int8)__x; }
1469static simd_int16 SIMD_CFUNC simd_int(simd_uint16 __x) { return (simd_int16)__x; }
1470static simd_int2 SIMD_CFUNC simd_int(simd_float2 __x) { return __builtin_convertvector(__x, simd_int2); }
1471static simd_int3 SIMD_CFUNC simd_int(simd_float3 __x) { return __builtin_convertvector(__x, simd_int3); }
1472static simd_int4 SIMD_CFUNC simd_int(simd_float4 __x) { return __builtin_convertvector(__x, simd_int4); }
1473static simd_int8 SIMD_CFUNC simd_int(simd_float8 __x) { return __builtin_convertvector(__x, simd_int8); }
1474static simd_int16 SIMD_CFUNC simd_int(simd_float16 __x) { return __builtin_convertvector(__x, simd_int16); }
1475static simd_int2 SIMD_CFUNC simd_int(simd_long2 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int2); }
1476static simd_int3 SIMD_CFUNC simd_int(simd_long3 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int3); }
1477static simd_int4 SIMD_CFUNC simd_int(simd_long4 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int4); }
1478static simd_int8 SIMD_CFUNC simd_int(simd_long8 __x) { return __builtin_convertvector(__x & 0xffffffff, simd_int8); }
1479static simd_int2 SIMD_CFUNC simd_int(simd_ulong2 __x) { return simd_int(simd_long(__x)); }
1480static simd_int3 SIMD_CFUNC simd_int(simd_ulong3 __x) { return simd_int(simd_long(__x)); }
1481static simd_int4 SIMD_CFUNC simd_int(simd_ulong4 __x) { return simd_int(simd_long(__x)); }
1482static simd_int8 SIMD_CFUNC simd_int(simd_ulong8 __x) { return simd_int(simd_long(__x)); }
1483static simd_int2 SIMD_CFUNC simd_int(simd_double2 __x) { return __builtin_convertvector(__x, simd_int2); }
1484static simd_int3 SIMD_CFUNC simd_int(simd_double3 __x) { return __builtin_convertvector(__x, simd_int3); }
1485static simd_int4 SIMD_CFUNC simd_int(simd_double4 __x) { return __builtin_convertvector(__x, simd_int4); }
1486static simd_int8 SIMD_CFUNC simd_int(simd_double8 __x) { return __builtin_convertvector(__x, simd_int8); }
1487
1488static simd_int2 SIMD_CFUNC simd_int_sat(simd_char2 __x) { return simd_int(__x); }
1489static simd_int3 SIMD_CFUNC simd_int_sat(simd_char3 __x) { return simd_int(__x); }
1490static simd_int4 SIMD_CFUNC simd_int_sat(simd_char4 __x) { return simd_int(__x); }
1491static simd_int8 SIMD_CFUNC simd_int_sat(simd_char8 __x) { return simd_int(__x); }
1492static simd_int16 SIMD_CFUNC simd_int_sat(simd_char16 __x) { return simd_int(__x); }
1493static simd_int2 SIMD_CFUNC simd_int_sat(simd_short2 __x) { return simd_int(__x); }
1494static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x) { return simd_int(__x); }
1495static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x) { return simd_int(__x); }
1496static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x) { return simd_int(__x); }
1497static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x) { return simd_int(__x); }
1498static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x) { return __x; }
1499static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x) { return __x; }
1500static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x) { return __x; }
1501static simd_int8 SIMD_CFUNC simd_int_sat(simd_int8 __x) { return __x; }
1502static simd_int16 SIMD_CFUNC simd_int_sat(simd_int16 __x) { return __x; }
1503static simd_int2 SIMD_CFUNC simd_int_sat(simd_float2 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); }
1504static simd_int3 SIMD_CFUNC simd_int_sat(simd_float3 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); }
1505static simd_int4 SIMD_CFUNC simd_int_sat(simd_float4 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); }
1506static simd_int8 SIMD_CFUNC simd_int_sat(simd_float8 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); }
1507static simd_int16 SIMD_CFUNC simd_int_sat(simd_float16 __x) { return simd_bitselect(simd_int(simd_max(__x,-0x1.0p31f)), 0x7fffffff, __x >= 0x1.0p31f); }
1508static simd_int2 SIMD_CFUNC simd_int_sat(simd_long2 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); }
1509static simd_int3 SIMD_CFUNC simd_int_sat(simd_long3 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); }
1510static simd_int4 SIMD_CFUNC simd_int_sat(simd_long4 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); }
1511static simd_int8 SIMD_CFUNC simd_int_sat(simd_long8 __x) { return simd_int(simd_clamp(__x,-0x80000000LL,0x7fffffffLL)); }
1512static simd_int2 SIMD_CFUNC simd_int_sat(simd_double2 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); }
1513static simd_int3 SIMD_CFUNC simd_int_sat(simd_double3 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); }
1514static simd_int4 SIMD_CFUNC simd_int_sat(simd_double4 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); }
1515static simd_int8 SIMD_CFUNC simd_int_sat(simd_double8 __x) { return simd_int(simd_clamp(__x,-0x1.0p31,0x1.fffffffcp30)); }
1516static simd_int2 SIMD_CFUNC simd_int_sat(simd_uchar2 __x) { return simd_int(__x); }
1517static simd_int3 SIMD_CFUNC simd_int_sat(simd_uchar3 __x) { return simd_int(__x); }
1518static simd_int4 SIMD_CFUNC simd_int_sat(simd_uchar4 __x) { return simd_int(__x); }
1519static simd_int8 SIMD_CFUNC simd_int_sat(simd_uchar8 __x) { return simd_int(__x); }
1520static simd_int16 SIMD_CFUNC simd_int_sat(simd_uchar16 __x) { return simd_int(__x); }
1521static simd_int2 SIMD_CFUNC simd_int_sat(simd_ushort2 __x) { return simd_int(__x); }
1522static simd_int3 SIMD_CFUNC simd_int_sat(simd_ushort3 __x) { return simd_int(__x); }
1523static simd_int4 SIMD_CFUNC simd_int_sat(simd_ushort4 __x) { return simd_int(__x); }
1524static simd_int8 SIMD_CFUNC simd_int_sat(simd_ushort8 __x) { return simd_int(__x); }
1525static simd_int16 SIMD_CFUNC simd_int_sat(simd_ushort16 __x) { return simd_int(__x); }
1526static simd_int2 SIMD_CFUNC simd_int_sat(simd_uint2 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1527static simd_int3 SIMD_CFUNC simd_int_sat(simd_uint3 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1528static simd_int4 SIMD_CFUNC simd_int_sat(simd_uint4 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1529static simd_int8 SIMD_CFUNC simd_int_sat(simd_uint8 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1530static simd_int16 SIMD_CFUNC simd_int_sat(simd_uint16 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1531static simd_int2 SIMD_CFUNC simd_int_sat(simd_ulong2 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1532static simd_int3 SIMD_CFUNC simd_int_sat(simd_ulong3 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1533static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1534static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1535
1536static 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
1544static 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
1548static 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
1560static 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
1568static 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
1576static simd_uint2 SIMD_CFUNC simd_uint(simd_char2 __x) { return simd_uint(simd_int(__x)); }
1577static simd_uint3 SIMD_CFUNC simd_uint(simd_char3 __x) { return simd_uint(simd_int(__x)); }
1578static simd_uint4 SIMD_CFUNC simd_uint(simd_char4 __x) { return simd_uint(simd_int(__x)); }
1579static simd_uint8 SIMD_CFUNC simd_uint(simd_char8 __x) { return simd_uint(simd_int(__x)); }
1580static simd_uint16 SIMD_CFUNC simd_uint(simd_char16 __x) { return simd_uint(simd_int(__x)); }
1581static simd_uint2 SIMD_CFUNC simd_uint(simd_uchar2 __x) { return simd_uint(simd_int(__x)); }
1582static simd_uint3 SIMD_CFUNC simd_uint(simd_uchar3 __x) { return simd_uint(simd_int(__x)); }
1583static simd_uint4 SIMD_CFUNC simd_uint(simd_uchar4 __x) { return simd_uint(simd_int(__x)); }
1584static simd_uint8 SIMD_CFUNC simd_uint(simd_uchar8 __x) { return simd_uint(simd_int(__x)); }
1585static simd_uint16 SIMD_CFUNC simd_uint(simd_uchar16 __x) { return simd_uint(simd_int(__x)); }
1586static simd_uint2 SIMD_CFUNC simd_uint(simd_short2 __x) { return simd_uint(simd_int(__x)); }
1587static simd_uint3 SIMD_CFUNC simd_uint(simd_short3 __x) { return simd_uint(simd_int(__x)); }
1588static simd_uint4 SIMD_CFUNC simd_uint(simd_short4 __x) { return simd_uint(simd_int(__x)); }
1589static simd_uint8 SIMD_CFUNC simd_uint(simd_short8 __x) { return simd_uint(simd_int(__x)); }
1590static simd_uint16 SIMD_CFUNC simd_uint(simd_short16 __x) { return simd_uint(simd_int(__x)); }
1591static simd_uint2 SIMD_CFUNC simd_uint(simd_ushort2 __x) { return simd_uint(simd_int(__x)); }
1592static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x) { return simd_uint(simd_int(__x)); }
1593static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x) { return simd_uint(simd_int(__x)); }
1594static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x) { return simd_uint(simd_int(__x)); }
1595static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x) { return simd_uint(simd_int(__x)); }
1596static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x) { return (simd_uint2)__x; }
1597static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x) { return (simd_uint3)__x; }
1598static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x) { return (simd_uint4)__x; }
1599static simd_uint8 SIMD_CFUNC simd_uint(simd_int8 __x) { return (simd_uint8)__x; }
1600static simd_uint16 SIMD_CFUNC simd_uint(simd_int16 __x) { return (simd_uint16)__x; }
1601static simd_uint2 SIMD_CFUNC simd_uint(simd_uint2 __x) { return __x; }
1602static simd_uint3 SIMD_CFUNC simd_uint(simd_uint3 __x) { return __x; }
1603static simd_uint4 SIMD_CFUNC simd_uint(simd_uint4 __x) { return __x; }
1604static simd_uint8 SIMD_CFUNC simd_uint(simd_uint8 __x) { return __x; }
1605static simd_uint16 SIMD_CFUNC simd_uint(simd_uint16 __x) { return __x; }
1606static 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); }
1607static 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); }
1608static 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); }
1609static 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); }
1610static 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); }
1611static simd_uint2 SIMD_CFUNC simd_uint(simd_long2 __x) { return simd_uint(simd_int(__x)); }
1612static simd_uint3 SIMD_CFUNC simd_uint(simd_long3 __x) { return simd_uint(simd_int(__x)); }
1613static simd_uint4 SIMD_CFUNC simd_uint(simd_long4 __x) { return simd_uint(simd_int(__x)); }
1614static simd_uint8 SIMD_CFUNC simd_uint(simd_long8 __x) { return simd_uint(simd_int(__x)); }
1615static simd_uint2 SIMD_CFUNC simd_uint(simd_ulong2 __x) { return simd_uint(simd_int(__x)); }
1616static simd_uint3 SIMD_CFUNC simd_uint(simd_ulong3 __x) { return simd_uint(simd_int(__x)); }
1617static simd_uint4 SIMD_CFUNC simd_uint(simd_ulong4 __x) { return simd_uint(simd_int(__x)); }
1618static simd_uint8 SIMD_CFUNC simd_uint(simd_ulong8 __x) { return simd_uint(simd_int(__x)); }
1619static 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)); }
1620static 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)); }
1621static 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)); }
1622static 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
1624static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_char2 __x) { return simd_uint(simd_max(__x,0)); }
1625static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_char3 __x) { return simd_uint(simd_max(__x,0)); }
1626static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_char4 __x) { return simd_uint(simd_max(__x,0)); }
1627static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_char8 __x) { return simd_uint(simd_max(__x,0)); }
1628static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_char16 __x) { return simd_uint(simd_max(__x,0)); }
1629static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_short2 __x) { return simd_uint(simd_max(__x,0)); }
1630static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x) { return simd_uint(simd_max(__x,0)); }
1631static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x) { return simd_uint(simd_max(__x,0)); }
1632static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x) { return simd_uint(simd_max(__x,0)); }
1633static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x) { return simd_uint(simd_max(__x,0)); }
1634static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x) { return simd_uint(simd_max(__x,0)); }
1635static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x) { return simd_uint(simd_max(__x,0)); }
1636static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x) { return simd_uint(simd_max(__x,0)); }
1637static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_int8 __x) { return simd_uint(simd_max(__x,0)); }
1638static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_int16 __x) { return simd_uint(simd_max(__x,0)); }
1639static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_float2 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); }
1640static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_float3 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); }
1641static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_float4 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); }
1642static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_float8 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); }
1643static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_float16 __x) { return simd_bitselect(simd_uint(simd_max(__x,0)), 0xffffffff, __x >= 0x1.0p32f); }
1644static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_long2 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1645static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_long3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1646static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_long4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1647static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_long8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1648static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_double2 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1649static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_double3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1650static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_double4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1651static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_double8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1652static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uchar2 __x) { return simd_uint(__x); }
1653static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uchar3 __x) { return simd_uint(__x); }
1654static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uchar4 __x) { return simd_uint(__x); }
1655static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uchar8 __x) { return simd_uint(__x); }
1656static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uchar16 __x) { return simd_uint(__x); }
1657static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ushort2 __x) { return simd_uint(__x); }
1658static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ushort3 __x) { return simd_uint(__x); }
1659static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ushort4 __x) { return simd_uint(__x); }
1660static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ushort8 __x) { return simd_uint(__x); }
1661static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_ushort16 __x) { return simd_uint(__x); }
1662static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_uint2 __x) { return __x; }
1663static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_uint3 __x) { return __x; }
1664static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_uint4 __x) { return __x; }
1665static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_uint8 __x) { return __x; }
1666static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_uint16 __x) { return __x; }
1667static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1668static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1669static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1670static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1671
1672
1673static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1674static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1675static simd_float4 SIMD_CFUNC simd_float(simd_char4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1676static simd_float8 SIMD_CFUNC simd_float(simd_char8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1677static simd_float16 SIMD_CFUNC simd_float(simd_char16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1678static simd_float2 SIMD_CFUNC simd_float(simd_uchar2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1679static simd_float3 SIMD_CFUNC simd_float(simd_uchar3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1680static simd_float4 SIMD_CFUNC simd_float(simd_uchar4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1681static simd_float8 SIMD_CFUNC simd_float(simd_uchar8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1682static simd_float16 SIMD_CFUNC simd_float(simd_uchar16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1683static simd_float2 SIMD_CFUNC simd_float(simd_short2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1684static simd_float3 SIMD_CFUNC simd_float(simd_short3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1685static simd_float4 SIMD_CFUNC simd_float(simd_short4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1686static simd_float8 SIMD_CFUNC simd_float(simd_short8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1687static simd_float16 SIMD_CFUNC simd_float(simd_short16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1688static simd_float2 SIMD_CFUNC simd_float(simd_ushort2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1689static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1690static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1691static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1692static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1693static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x) { return __builtin_convertvector(__x,simd_float2); }
1694static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x) { return __builtin_convertvector(__x,simd_float3); }
1695static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x) { return __builtin_convertvector(__x,simd_float4); }
1696static simd_float8 SIMD_CFUNC simd_float(simd_int8 __x) { return __builtin_convertvector(__x,simd_float8); }
1697static simd_float16 SIMD_CFUNC simd_float(simd_int16 __x) { return __builtin_convertvector(__x,simd_float16); }
1698static simd_float2 SIMD_CFUNC simd_float(simd_uint2 __x) { return __builtin_convertvector(__x,simd_float2); }
1699static simd_float3 SIMD_CFUNC simd_float(simd_uint3 __x) { return __builtin_convertvector(__x,simd_float3); }
1700static simd_float4 SIMD_CFUNC simd_float(simd_uint4 __x) { return __builtin_convertvector(__x,simd_float4); }
1701static simd_float8 SIMD_CFUNC simd_float(simd_uint8 __x) { return __builtin_convertvector(__x,simd_float8); }
1702static simd_float16 SIMD_CFUNC simd_float(simd_uint16 __x) { return __builtin_convertvector(__x,simd_float16); }
1703static simd_float2 SIMD_CFUNC simd_float(simd_float2 __x) { return __x; }
1704static simd_float3 SIMD_CFUNC simd_float(simd_float3 __x) { return __x; }
1705static simd_float4 SIMD_CFUNC simd_float(simd_float4 __x) { return __x; }
1706static simd_float8 SIMD_CFUNC simd_float(simd_float8 __x) { return __x; }
1707static simd_float16 SIMD_CFUNC simd_float(simd_float16 __x) { return __x; }
1708static simd_float2 SIMD_CFUNC simd_float(simd_long2 __x) { return __builtin_convertvector(__x,simd_float2); }
1709static simd_float3 SIMD_CFUNC simd_float(simd_long3 __x) { return __builtin_convertvector(__x,simd_float3); }
1710static simd_float4 SIMD_CFUNC simd_float(simd_long4 __x) { return __builtin_convertvector(__x,simd_float4); }
1711static simd_float8 SIMD_CFUNC simd_float(simd_long8 __x) { return __builtin_convertvector(__x,simd_float8); }
1712static simd_float2 SIMD_CFUNC simd_float(simd_ulong2 __x) { return __builtin_convertvector(__x,simd_float2); }
1713static simd_float3 SIMD_CFUNC simd_float(simd_ulong3 __x) { return __builtin_convertvector(__x,simd_float3); }
1714static simd_float4 SIMD_CFUNC simd_float(simd_ulong4 __x) { return __builtin_convertvector(__x,simd_float4); }
1715static simd_float8 SIMD_CFUNC simd_float(simd_ulong8 __x) { return __builtin_convertvector(__x,simd_float8); }
1716static simd_float2 SIMD_CFUNC simd_float(simd_double2 __x) { return __builtin_convertvector(__x,simd_float2); }
1717static simd_float3 SIMD_CFUNC simd_float(simd_double3 __x) { return __builtin_convertvector(__x,simd_float3); }
1718static simd_float4 SIMD_CFUNC simd_float(simd_double4 __x) { return __builtin_convertvector(__x,simd_float4); }
1719static simd_float8 SIMD_CFUNC simd_float(simd_double8 __x) { return __builtin_convertvector(__x,simd_float8); }
1720
1721
1722static simd_long2 SIMD_CFUNC simd_long(simd_char2 __x) { return __builtin_convertvector(__x,simd_long2); }
1723static simd_long3 SIMD_CFUNC simd_long(simd_char3 __x) { return __builtin_convertvector(__x,simd_long3); }
1724static simd_long4 SIMD_CFUNC simd_long(simd_char4 __x) { return __builtin_convertvector(__x,simd_long4); }
1725static simd_long8 SIMD_CFUNC simd_long(simd_char8 __x) { return __builtin_convertvector(__x,simd_long8); }
1726static simd_long2 SIMD_CFUNC simd_long(simd_uchar2 __x) { return __builtin_convertvector(__x,simd_long2); }
1727static simd_long3 SIMD_CFUNC simd_long(simd_uchar3 __x) { return __builtin_convertvector(__x,simd_long3); }
1728static simd_long4 SIMD_CFUNC simd_long(simd_uchar4 __x) { return __builtin_convertvector(__x,simd_long4); }
1729static simd_long8 SIMD_CFUNC simd_long(simd_uchar8 __x) { return __builtin_convertvector(__x,simd_long8); }
1730static simd_long2 SIMD_CFUNC simd_long(simd_short2 __x) { return __builtin_convertvector(__x,simd_long2); }
1731static simd_long3 SIMD_CFUNC simd_long(simd_short3 __x) { return __builtin_convertvector(__x,simd_long3); }
1732static simd_long4 SIMD_CFUNC simd_long(simd_short4 __x) { return __builtin_convertvector(__x,simd_long4); }
1733static simd_long8 SIMD_CFUNC simd_long(simd_short8 __x) { return __builtin_convertvector(__x,simd_long8); }
1734static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x) { return __builtin_convertvector(__x,simd_long2); }
1735static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x) { return __builtin_convertvector(__x,simd_long3); }
1736static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x) { return __builtin_convertvector(__x,simd_long4); }
1737static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x) { return __builtin_convertvector(__x,simd_long8); }
1738static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x) { return __builtin_convertvector(__x,simd_long2); }
1739static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x) { return __builtin_convertvector(__x,simd_long3); }
1740static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x) { return __builtin_convertvector(__x,simd_long4); }
1741static simd_long8 SIMD_CFUNC simd_long(simd_int8 __x) { return __builtin_convertvector(__x,simd_long8); }
1742static simd_long2 SIMD_CFUNC simd_long(simd_uint2 __x) { return __builtin_convertvector(__x,simd_long2); }
1743static simd_long3 SIMD_CFUNC simd_long(simd_uint3 __x) { return __builtin_convertvector(__x,simd_long3); }
1744static simd_long4 SIMD_CFUNC simd_long(simd_uint4 __x) { return __builtin_convertvector(__x,simd_long4); }
1745static simd_long8 SIMD_CFUNC simd_long(simd_uint8 __x) { return __builtin_convertvector(__x,simd_long8); }
1746static simd_long2 SIMD_CFUNC simd_long(simd_float2 __x) { return __builtin_convertvector(__x,simd_long2); }
1747static simd_long3 SIMD_CFUNC simd_long(simd_float3 __x) { return __builtin_convertvector(__x,simd_long3); }
1748static simd_long4 SIMD_CFUNC simd_long(simd_float4 __x) { return __builtin_convertvector(__x,simd_long4); }
1749static simd_long8 SIMD_CFUNC simd_long(simd_float8 __x) { return __builtin_convertvector(__x,simd_long8); }
1750static simd_long2 SIMD_CFUNC simd_long(simd_long2 __x) { return __x; }
1751static simd_long3 SIMD_CFUNC simd_long(simd_long3 __x) { return __x; }
1752static simd_long4 SIMD_CFUNC simd_long(simd_long4 __x) { return __x; }
1753static simd_long8 SIMD_CFUNC simd_long(simd_long8 __x) { return __x; }
1754static simd_long2 SIMD_CFUNC simd_long(simd_ulong2 __x) { return (simd_long2)__x; }
1755static simd_long3 SIMD_CFUNC simd_long(simd_ulong3 __x) { return (simd_long3)__x; }
1756static simd_long4 SIMD_CFUNC simd_long(simd_ulong4 __x) { return (simd_long4)__x; }
1757static simd_long8 SIMD_CFUNC simd_long(simd_ulong8 __x) { return (simd_long8)__x; }
1758static simd_long2 SIMD_CFUNC simd_long(simd_double2 __x) { return __builtin_convertvector(__x,simd_long2); }
1759static simd_long3 SIMD_CFUNC simd_long(simd_double3 __x) { return __builtin_convertvector(__x,simd_long3); }
1760static simd_long4 SIMD_CFUNC simd_long(simd_double4 __x) { return __builtin_convertvector(__x,simd_long4); }
1761static simd_long8 SIMD_CFUNC simd_long(simd_double8 __x) { return __builtin_convertvector(__x,simd_long8); }
1762
1763static simd_long2 SIMD_CFUNC simd_long_sat(simd_char2 __x) { return simd_long(__x); }
1764static simd_long3 SIMD_CFUNC simd_long_sat(simd_char3 __x) { return simd_long(__x); }
1765static simd_long4 SIMD_CFUNC simd_long_sat(simd_char4 __x) { return simd_long(__x); }
1766static simd_long8 SIMD_CFUNC simd_long_sat(simd_char8 __x) { return simd_long(__x); }
1767static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x) { return simd_long(__x); }
1768static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x) { return simd_long(__x); }
1769static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x) { return simd_long(__x); }
1770static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x) { return simd_long(__x); }
1771static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x) { return simd_long(__x); }
1772static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x) { return simd_long(__x); }
1773static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x) { return simd_long(__x); }
1774static simd_long8 SIMD_CFUNC simd_long_sat(simd_int8 __x) { return simd_long(__x); }
1775static 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)); }
1776static 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)); }
1777static 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)); }
1778static 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)); }
1779static simd_long2 SIMD_CFUNC simd_long_sat(simd_long2 __x) { return __x; }
1780static simd_long3 SIMD_CFUNC simd_long_sat(simd_long3 __x) { return __x; }
1781static simd_long4 SIMD_CFUNC simd_long_sat(simd_long4 __x) { return __x; }
1782static simd_long8 SIMD_CFUNC simd_long_sat(simd_long8 __x) { return __x; }
1783static simd_long2 SIMD_CFUNC simd_long_sat(simd_double2 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); }
1784static simd_long3 SIMD_CFUNC simd_long_sat(simd_double3 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); }
1785static simd_long4 SIMD_CFUNC simd_long_sat(simd_double4 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); }
1786static simd_long8 SIMD_CFUNC simd_long_sat(simd_double8 __x) { return simd_bitselect(simd_long(simd_max(__x,-0x1.0p63)), 0x7fffffffffffffff, __x >= 0x1.0p63); }
1787static simd_long2 SIMD_CFUNC simd_long_sat(simd_uchar2 __x) { return simd_long(__x); }
1788static simd_long3 SIMD_CFUNC simd_long_sat(simd_uchar3 __x) { return simd_long(__x); }
1789static simd_long4 SIMD_CFUNC simd_long_sat(simd_uchar4 __x) { return simd_long(__x); }
1790static simd_long8 SIMD_CFUNC simd_long_sat(simd_uchar8 __x) { return simd_long(__x); }
1791static simd_long2 SIMD_CFUNC simd_long_sat(simd_ushort2 __x) { return simd_long(__x); }
1792static simd_long3 SIMD_CFUNC simd_long_sat(simd_ushort3 __x) { return simd_long(__x); }
1793static simd_long4 SIMD_CFUNC simd_long_sat(simd_ushort4 __x) { return simd_long(__x); }
1794static simd_long8 SIMD_CFUNC simd_long_sat(simd_ushort8 __x) { return simd_long(__x); }
1795static simd_long2 SIMD_CFUNC simd_long_sat(simd_uint2 __x) { return simd_long(__x); }
1796static simd_long3 SIMD_CFUNC simd_long_sat(simd_uint3 __x) { return simd_long(__x); }
1797static simd_long4 SIMD_CFUNC simd_long_sat(simd_uint4 __x) { return simd_long(__x); }
1798static simd_long8 SIMD_CFUNC simd_long_sat(simd_uint8 __x) { return simd_long(__x); }
1799static simd_long2 SIMD_CFUNC simd_long_sat(simd_ulong2 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); }
1800static simd_long3 SIMD_CFUNC simd_long_sat(simd_ulong3 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); }
1801static simd_long4 SIMD_CFUNC simd_long_sat(simd_ulong4 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); }
1802static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); }
1803
1804static 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
1816static 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
1820static 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
1828static 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
1837static simd_ulong2 SIMD_CFUNC simd_ulong(simd_char2 __x) { return simd_ulong(simd_long(__x)); }
1838static simd_ulong3 SIMD_CFUNC simd_ulong(simd_char3 __x) { return simd_ulong(simd_long(__x)); }
1839static simd_ulong4 SIMD_CFUNC simd_ulong(simd_char4 __x) { return simd_ulong(simd_long(__x)); }
1840static simd_ulong8 SIMD_CFUNC simd_ulong(simd_char8 __x) { return simd_ulong(simd_long(__x)); }
1841static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uchar2 __x) { return simd_ulong(simd_long(__x)); }
1842static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uchar3 __x) { return simd_ulong(simd_long(__x)); }
1843static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uchar4 __x) { return simd_ulong(simd_long(__x)); }
1844static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uchar8 __x) { return simd_ulong(simd_long(__x)); }
1845static simd_ulong2 SIMD_CFUNC simd_ulong(simd_short2 __x) { return simd_ulong(simd_long(__x)); }
1846static simd_ulong3 SIMD_CFUNC simd_ulong(simd_short3 __x) { return simd_ulong(simd_long(__x)); }
1847static simd_ulong4 SIMD_CFUNC simd_ulong(simd_short4 __x) { return simd_ulong(simd_long(__x)); }
1848static simd_ulong8 SIMD_CFUNC simd_ulong(simd_short8 __x) { return simd_ulong(simd_long(__x)); }
1849static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x) { return simd_ulong(simd_long(__x)); }
1850static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x) { return simd_ulong(simd_long(__x)); }
1851static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x) { return simd_ulong(simd_long(__x)); }
1852static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x) { return simd_ulong(simd_long(__x)); }
1853static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x) { return simd_ulong(simd_long(__x)); }
1854static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x) { return simd_ulong(simd_long(__x)); }
1855static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x) { return simd_ulong(simd_long(__x)); }
1856static simd_ulong8 SIMD_CFUNC simd_ulong(simd_int8 __x) { return simd_ulong(simd_long(__x)); }
1857static simd_ulong2 SIMD_CFUNC simd_ulong(simd_uint2 __x) { return simd_ulong(simd_long(__x)); }
1858static simd_ulong3 SIMD_CFUNC simd_ulong(simd_uint3 __x) { return simd_ulong(simd_long(__x)); }
1859static simd_ulong4 SIMD_CFUNC simd_ulong(simd_uint4 __x) { return simd_ulong(simd_long(__x)); }
1860static simd_ulong8 SIMD_CFUNC simd_ulong(simd_uint8 __x) { return simd_ulong(simd_long(__x)); }
1861static 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)); }
1862static 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)); }
1863static 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)); }
1864static 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)); }
1865static simd_ulong2 SIMD_CFUNC simd_ulong(simd_long2 __x) { return (simd_ulong2)__x; }
1866static simd_ulong3 SIMD_CFUNC simd_ulong(simd_long3 __x) { return (simd_ulong3)__x; }
1867static simd_ulong4 SIMD_CFUNC simd_ulong(simd_long4 __x) { return (simd_ulong4)__x; }
1868static simd_ulong8 SIMD_CFUNC simd_ulong(simd_long8 __x) { return (simd_ulong8)__x; }
1869static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ulong2 __x) { return __x; }
1870static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ulong3 __x) { return __x; }
1871static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ulong4 __x) { return __x; }
1872static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ulong8 __x) { return __x; }
1873static 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); }
1874static 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); }
1875static 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); }
1876static 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
1878static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_char2 __x) { return simd_ulong(simd_max(__x,0)); }
1879static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_char3 __x) { return simd_ulong(simd_max(__x,0)); }
1880static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_char4 __x) { return simd_ulong(simd_max(__x,0)); }
1881static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_char8 __x) { return simd_ulong(simd_max(__x,0)); }
1882static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x) { return simd_ulong(simd_max(__x,0)); }
1883static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x) { return simd_ulong(simd_max(__x,0)); }
1884static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x) { return simd_ulong(simd_max(__x,0)); }
1885static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x) { return simd_ulong(simd_max(__x,0)); }
1886static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x) { return simd_ulong(simd_max(__x,0)); }
1887static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x) { return simd_ulong(simd_max(__x,0)); }
1888static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x) { return simd_ulong(simd_max(__x,0)); }
1889static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_int8 __x) { return simd_ulong(simd_max(__x,0)); }
1890static 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)); }
1891static 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)); }
1892static 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)); }
1893static 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)); }
1894static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_long2 __x) { return simd_ulong(simd_max(__x,0)); }
1895static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_long3 __x) { return simd_ulong(simd_max(__x,0)); }
1896static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_long4 __x) { return simd_ulong(simd_max(__x,0)); }
1897static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_long8 __x) { return simd_ulong(simd_max(__x,0)); }
1898static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_double2 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); }
1899static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_double3 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); }
1900static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_double4 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); }
1901static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_double8 __x) { return simd_bitselect(simd_ulong(simd_max(__x,0.0)), 0xffffffffffffffff, __x >= 0x1.0p64); }
1902static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uchar2 __x) { return simd_ulong(__x); }
1903static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uchar3 __x) { return simd_ulong(__x); }
1904static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uchar4 __x) { return simd_ulong(__x); }
1905static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uchar8 __x) { return simd_ulong(__x); }
1906static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ushort2 __x) { return simd_ulong(__x); }
1907static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ushort3 __x) { return simd_ulong(__x); }
1908static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ushort4 __x) { return simd_ulong(__x); }
1909static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ushort8 __x) { return simd_ulong(__x); }
1910static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_uint2 __x) { return simd_ulong(__x); }
1911static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_uint3 __x) { return simd_ulong(__x); }
1912static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_uint4 __x) { return simd_ulong(__x); }
1913static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_uint8 __x) { return simd_ulong(__x); }
1914static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x) { return __x; }
1915static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x) { return __x; }
1916static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x) { return __x; }
1917static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x) { return __x; }
1918
1919
1920static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x) { return simd_double(simd_int(__x)); }
1921static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x) { return simd_double(simd_int(__x)); }
1922static simd_double4 SIMD_CFUNC simd_double(simd_char4 __x) { return simd_double(simd_int(__x)); }
1923static simd_double8 SIMD_CFUNC simd_double(simd_char8 __x) { return simd_double(simd_int(__x)); }
1924static simd_double2 SIMD_CFUNC simd_double(simd_uchar2 __x) { return simd_double(simd_int(__x)); }
1925static simd_double3 SIMD_CFUNC simd_double(simd_uchar3 __x) { return simd_double(simd_int(__x)); }
1926static simd_double4 SIMD_CFUNC simd_double(simd_uchar4 __x) { return simd_double(simd_int(__x)); }
1927static simd_double8 SIMD_CFUNC simd_double(simd_uchar8 __x) { return simd_double(simd_int(__x)); }
1928static simd_double2 SIMD_CFUNC simd_double(simd_short2 __x) { return simd_double(simd_int(__x)); }
1929static simd_double3 SIMD_CFUNC simd_double(simd_short3 __x) { return simd_double(simd_int(__x)); }
1930static simd_double4 SIMD_CFUNC simd_double(simd_short4 __x) { return simd_double(simd_int(__x)); }
1931static simd_double8 SIMD_CFUNC simd_double(simd_short8 __x) { return simd_double(simd_int(__x)); }
1932static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x) { return simd_double(simd_int(__x)); }
1933static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x) { return simd_double(simd_int(__x)); }
1934static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x) { return simd_double(simd_int(__x)); }
1935static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x) { return simd_double(simd_int(__x)); }
1936static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x) { return __builtin_convertvector(__x, simd_double2); }
1937static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x) { return __builtin_convertvector(__x, simd_double3); }
1938static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x) { return __builtin_convertvector(__x, simd_double4); }
1939static simd_double8 SIMD_CFUNC simd_double(simd_int8 __x) { return __builtin_convertvector(__x, simd_double8); }
1940static simd_double2 SIMD_CFUNC simd_double(simd_uint2 __x) { return __builtin_convertvector(__x, simd_double2); }
1941static simd_double3 SIMD_CFUNC simd_double(simd_uint3 __x) { return __builtin_convertvector(__x, simd_double3); }
1942static simd_double4 SIMD_CFUNC simd_double(simd_uint4 __x) { return __builtin_convertvector(__x, simd_double4); }
1943static simd_double8 SIMD_CFUNC simd_double(simd_uint8 __x) { return __builtin_convertvector(__x, simd_double8); }
1944static simd_double2 SIMD_CFUNC simd_double(simd_float2 __x) { return __builtin_convertvector(__x, simd_double2); }
1945static simd_double3 SIMD_CFUNC simd_double(simd_float3 __x) { return __builtin_convertvector(__x, simd_double3); }
1946static simd_double4 SIMD_CFUNC simd_double(simd_float4 __x) { return __builtin_convertvector(__x, simd_double4); }
1947static simd_double8 SIMD_CFUNC simd_double(simd_float8 __x) { return __builtin_convertvector(__x, simd_double8); }
1948static simd_double2 SIMD_CFUNC simd_double(simd_long2 __x) { return __builtin_convertvector(__x, simd_double2); }
1949static simd_double3 SIMD_CFUNC simd_double(simd_long3 __x) { return __builtin_convertvector(__x, simd_double3); }
1950static simd_double4 SIMD_CFUNC simd_double(simd_long4 __x) { return __builtin_convertvector(__x, simd_double4); }
1951static simd_double8 SIMD_CFUNC simd_double(simd_long8 __x) { return __builtin_convertvector(__x, simd_double8); }
1952static simd_double2 SIMD_CFUNC simd_double(simd_ulong2 __x) { return __builtin_convertvector(__x, simd_double2); }
1953static simd_double3 SIMD_CFUNC simd_double(simd_ulong3 __x) { return __builtin_convertvector(__x, simd_double3); }
1954static simd_double4 SIMD_CFUNC simd_double(simd_ulong4 __x) { return __builtin_convertvector(__x, simd_double4); }
1955static simd_double8 SIMD_CFUNC simd_double(simd_ulong8 __x) { return __builtin_convertvector(__x, simd_double8); }
1956static simd_double2 SIMD_CFUNC simd_double(simd_double2 __x) { return __builtin_convertvector(__x, simd_double2); }
1957static simd_double3 SIMD_CFUNC simd_double(simd_double3 __x) { return __builtin_convertvector(__x, simd_double3); }
1958static simd_double4 SIMD_CFUNC simd_double(simd_double4 __x) { return __builtin_convertvector(__x, simd_double4); }
1959static 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/aarch64-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
11extern "C" {
12#endif
13
14#pragma mark - geometry
15#if SIMD_LIBRARY_VERSION >= 2
16extern float _simd_orient_vf2(simd_float2, simd_float2);
17extern float _simd_orient_pf2(simd_float2, simd_float2, simd_float2);
18extern float _simd_incircle_pf2(simd_float2, simd_float2, simd_float2, simd_float2);
19
20extern float _simd_orient_vf3(simd_float3, simd_float3, simd_float3);
21extern float _simd_orient_pf3(simd_float3, simd_float3, simd_float3, simd_float3);
22extern float _simd_insphere_pf3(simd_float3, simd_float3, simd_float3, simd_float3, simd_float3);
23
24extern double _simd_orient_vd2(simd_double2, simd_double2);
25extern double _simd_orient_pd2(simd_double2, simd_double2, simd_double2);
26extern 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. */
32extern double _simd_orient_vd3(const double *);
33extern double _simd_orient_pd3(const double *);
34extern double _simd_insphere_pd3(const double *);
35#endif /* SIMD_LIBRARY_VERSION */
36
37#pragma mark - matrix
38extern simd_float2x2 __invert_f2(simd_float2x2);
39extern simd_double2x2 __invert_d2(simd_double2x2);
40extern simd_float3x3 __invert_f3(simd_float3x3);
41extern simd_double3x3 __invert_d3(simd_double3x3);
42extern simd_float4x4 __invert_f4(simd_float4x4);
43extern 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/aarch64-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
130extern "C" {
131#endif
132
133static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y);
134static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y);
135static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y);
136static float SIMD_CFUNC simd_dot(simd_float8 __x, simd_float8 __y);
137static float SIMD_CFUNC simd_dot(simd_float16 __x, simd_float16 __y);
138static double SIMD_CFUNC simd_dot(simd_double2 __x, simd_double2 __y);
139static double SIMD_CFUNC simd_dot(simd_double3 __x, simd_double3 __y);
140static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y);
141static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y);
142#define vector_dot simd_dot
143
144static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y);
145static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y);
146static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y);
147static simd_float8 SIMD_CFUNC simd_precise_project(simd_float8 __x, simd_float8 __y);
148static simd_float16 SIMD_CFUNC simd_precise_project(simd_float16 __x, simd_float16 __y);
149static simd_double2 SIMD_CFUNC simd_precise_project(simd_double2 __x, simd_double2 __y);
150static simd_double3 SIMD_CFUNC simd_precise_project(simd_double3 __x, simd_double3 __y);
151static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y);
152static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y);
153#define vector_precise_project simd_precise_project
154
155static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y);
156static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y);
157static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y);
158static simd_float8 SIMD_CFUNC simd_fast_project(simd_float8 __x, simd_float8 __y);
159static simd_float16 SIMD_CFUNC simd_fast_project(simd_float16 __x, simd_float16 __y);
160static simd_double2 SIMD_CFUNC simd_fast_project(simd_double2 __x, simd_double2 __y);
161static simd_double3 SIMD_CFUNC simd_fast_project(simd_double3 __x, simd_double3 __y);
162static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4 __y);
163static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y);
164#define vector_fast_project simd_fast_project
165
166static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y);
167static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y);
168static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y);
169static simd_float8 SIMD_CFUNC simd_project(simd_float8 __x, simd_float8 __y);
170static simd_float16 SIMD_CFUNC simd_project(simd_float16 __x, simd_float16 __y);
171static simd_double2 SIMD_CFUNC simd_project(simd_double2 __x, simd_double2 __y);
172static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y);
173static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y);
174static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y);
175#define vector_project simd_project
176
177static float SIMD_CFUNC simd_precise_length(simd_float2 __x);
178static float SIMD_CFUNC simd_precise_length(simd_float3 __x);
179static float SIMD_CFUNC simd_precise_length(simd_float4 __x);
180static float SIMD_CFUNC simd_precise_length(simd_float8 __x);
181static float SIMD_CFUNC simd_precise_length(simd_float16 __x);
182static double SIMD_CFUNC simd_precise_length(simd_double2 __x);
183static double SIMD_CFUNC simd_precise_length(simd_double3 __x);
184static double SIMD_CFUNC simd_precise_length(simd_double4 __x);
185static double SIMD_CFUNC simd_precise_length(simd_double8 __x);
186#define vector_precise_length simd_precise_length
187
188static float SIMD_CFUNC simd_fast_length(simd_float2 __x);
189static float SIMD_CFUNC simd_fast_length(simd_float3 __x);
190static float SIMD_CFUNC simd_fast_length(simd_float4 __x);
191static float SIMD_CFUNC simd_fast_length(simd_float8 __x);
192static float SIMD_CFUNC simd_fast_length(simd_float16 __x);
193static double SIMD_CFUNC simd_fast_length(simd_double2 __x);
194static double SIMD_CFUNC simd_fast_length(simd_double3 __x);
195static double SIMD_CFUNC simd_fast_length(simd_double4 __x);
196static double SIMD_CFUNC simd_fast_length(simd_double8 __x);
197#define vector_fast_length simd_fast_length
198
199static float SIMD_CFUNC simd_length(simd_float2 __x);
200static float SIMD_CFUNC simd_length(simd_float3 __x);
201static float SIMD_CFUNC simd_length(simd_float4 __x);
202static float SIMD_CFUNC simd_length(simd_float8 __x);
203static float SIMD_CFUNC simd_length(simd_float16 __x);
204static double SIMD_CFUNC simd_length(simd_double2 __x);
205static double SIMD_CFUNC simd_length(simd_double3 __x);
206static double SIMD_CFUNC simd_length(simd_double4 __x);
207static double SIMD_CFUNC simd_length(simd_double8 __x);
208#define vector_length simd_length
209
210static float SIMD_CFUNC simd_length_squared(simd_float2 __x);
211static float SIMD_CFUNC simd_length_squared(simd_float3 __x);
212static float SIMD_CFUNC simd_length_squared(simd_float4 __x);
213static float SIMD_CFUNC simd_length_squared(simd_float8 __x);
214static float SIMD_CFUNC simd_length_squared(simd_float16 __x);
215static double SIMD_CFUNC simd_length_squared(simd_double2 __x);
216static double SIMD_CFUNC simd_length_squared(simd_double3 __x);
217static double SIMD_CFUNC simd_length_squared(simd_double4 __x);
218static double SIMD_CFUNC simd_length_squared(simd_double8 __x);
219#define vector_length_squared simd_length_squared
220
221static float SIMD_CFUNC simd_norm_one(simd_float2 __x);
222static float SIMD_CFUNC simd_norm_one(simd_float3 __x);
223static float SIMD_CFUNC simd_norm_one(simd_float4 __x);
224static float SIMD_CFUNC simd_norm_one(simd_float8 __x);
225static float SIMD_CFUNC simd_norm_one(simd_float16 __x);
226static double SIMD_CFUNC simd_norm_one(simd_double2 __x);
227static double SIMD_CFUNC simd_norm_one(simd_double3 __x);
228static double SIMD_CFUNC simd_norm_one(simd_double4 __x);
229static double SIMD_CFUNC simd_norm_one(simd_double8 __x);
230#define vector_norm_one simd_norm_one
231
232static float SIMD_CFUNC simd_norm_inf(simd_float2 __x);
233static float SIMD_CFUNC simd_norm_inf(simd_float3 __x);
234static float SIMD_CFUNC simd_norm_inf(simd_float4 __x);
235static float SIMD_CFUNC simd_norm_inf(simd_float8 __x);
236static float SIMD_CFUNC simd_norm_inf(simd_float16 __x);
237static double SIMD_CFUNC simd_norm_inf(simd_double2 __x);
238static double SIMD_CFUNC simd_norm_inf(simd_double3 __x);
239static double SIMD_CFUNC simd_norm_inf(simd_double4 __x);
240static double SIMD_CFUNC simd_norm_inf(simd_double8 __x);
241#define vector_norm_inf simd_norm_inf
242
243static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y);
244static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y);
245static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y);
246static float SIMD_CFUNC simd_precise_distance(simd_float8 __x, simd_float8 __y);
247static float SIMD_CFUNC simd_precise_distance(simd_float16 __x, simd_float16 __y);
248static double SIMD_CFUNC simd_precise_distance(simd_double2 __x, simd_double2 __y);
249static double SIMD_CFUNC simd_precise_distance(simd_double3 __x, simd_double3 __y);
250static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y);
251static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y);
252#define vector_precise_distance simd_precise_distance
253
254static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y);
255static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y);
256static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y);
257static float SIMD_CFUNC simd_fast_distance(simd_float8 __x, simd_float8 __y);
258static float SIMD_CFUNC simd_fast_distance(simd_float16 __x, simd_float16 __y);
259static double SIMD_CFUNC simd_fast_distance(simd_double2 __x, simd_double2 __y);
260static double SIMD_CFUNC simd_fast_distance(simd_double3 __x, simd_double3 __y);
261static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y);
262static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y);
263#define vector_fast_distance simd_fast_distance
264
265static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y);
266static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y);
267static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y);
268static float SIMD_CFUNC simd_distance(simd_float8 __x, simd_float8 __y);
269static float SIMD_CFUNC simd_distance(simd_float16 __x, simd_float16 __y);
270static double SIMD_CFUNC simd_distance(simd_double2 __x, simd_double2 __y);
271static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y);
272static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y);
273static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y);
274#define vector_distance simd_distance
275
276static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y);
277static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y);
278static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y);
279static float SIMD_CFUNC simd_distance_squared(simd_float8 __x, simd_float8 __y);
280static float SIMD_CFUNC simd_distance_squared(simd_float16 __x, simd_float16 __y);
281static double SIMD_CFUNC simd_distance_squared(simd_double2 __x, simd_double2 __y);
282static double SIMD_CFUNC simd_distance_squared(simd_double3 __x, simd_double3 __y);
283static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y);
284static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y);
285#define vector_distance_squared simd_distance_squared
286
287static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x);
288static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x);
289static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x);
290static simd_float8 SIMD_CFUNC simd_precise_normalize(simd_float8 __x);
291static simd_float16 SIMD_CFUNC simd_precise_normalize(simd_float16 __x);
292static simd_double2 SIMD_CFUNC simd_precise_normalize(simd_double2 __x);
293static simd_double3 SIMD_CFUNC simd_precise_normalize(simd_double3 __x);
294static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x);
295static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x);
296#define vector_precise_normalize simd_precise_normalize
297
298static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x);
299static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x);
300static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x);
301static simd_float8 SIMD_CFUNC simd_fast_normalize(simd_float8 __x);
302static simd_float16 SIMD_CFUNC simd_fast_normalize(simd_float16 __x);
303static simd_double2 SIMD_CFUNC simd_fast_normalize(simd_double2 __x);
304static simd_double3 SIMD_CFUNC simd_fast_normalize(simd_double3 __x);
305static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x);
306static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x);
307#define vector_fast_normalize simd_fast_normalize
308
309static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x);
310static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x);
311static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x);
312static simd_float8 SIMD_CFUNC simd_normalize(simd_float8 __x);
313static simd_float16 SIMD_CFUNC simd_normalize(simd_float16 __x);
314static simd_double2 SIMD_CFUNC simd_normalize(simd_double2 __x);
315static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x);
316static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x);
317static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x);
318#define vector_normalize simd_normalize
319
320static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y);
321static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y);
322static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y);
323static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y);
324#define vector_cross simd_cross
325
326static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n);
327static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n);
328static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n);
329static simd_double2 SIMD_CFUNC simd_reflect(simd_double2 __x, simd_double2 __n);
330static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n);
331static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n);
332#define vector_reflect simd_reflect
333
334static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta);
335static simd_float3 SIMD_CFUNC simd_refract(simd_float3 __x, simd_float3 __n, float __eta);
336static simd_float4 SIMD_CFUNC simd_refract(simd_float4 __x, simd_float4 __n, float __eta);
337static simd_double2 SIMD_CFUNC simd_refract(simd_double2 __x, simd_double2 __n, double __eta);
338static simd_double3 SIMD_CFUNC simd_refract(simd_double3 __x, simd_double3 __n, double __eta);
339static 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. */
381static 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. */
395static 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. */
410static 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. */
425static 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. */
452static 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. */
468static 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. */
484static 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. */
500static 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. */
529static 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. */
543static 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. */
558static 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. */
573static 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
579namespace 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
775extern "C" {
776#endif /* __cplusplus */
777
778#pragma mark - Implementation
779
780static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y) { return simd_reduce_add(__x*__y); }
781static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y) { return simd_reduce_add(__x*__y); }
782static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y) { return simd_reduce_add(__x*__y); }
783static float SIMD_CFUNC simd_dot(simd_float8 __x, simd_float8 __y) { return simd_reduce_add(__x*__y); }
784static float SIMD_CFUNC simd_dot(simd_float16 __x, simd_float16 __y) { return simd_reduce_add(__x*__y); }
785static double SIMD_CFUNC simd_dot(simd_double2 __x, simd_double2 __y) { return simd_reduce_add(__x*__y); }
786static double SIMD_CFUNC simd_dot(simd_double3 __x, simd_double3 __y) { return simd_reduce_add(__x*__y); }
787static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y) { return simd_reduce_add(__x*__y); }
788static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y) { return simd_reduce_add(__x*__y); }
789
790static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
791static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
792static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
793static simd_float8 SIMD_CFUNC simd_precise_project(simd_float8 __x, simd_float8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
794static simd_float16 SIMD_CFUNC simd_precise_project(simd_float16 __x, simd_float16 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
795static simd_double2 SIMD_CFUNC simd_precise_project(simd_double2 __x, simd_double2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
796static simd_double3 SIMD_CFUNC simd_precise_project(simd_double3 __x, simd_double3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
797static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
798static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
799
800static 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)); }
801static 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)); }
802static 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)); }
803static 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)); }
804static 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)); }
805static 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)); }
806static 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)); }
807static 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)); }
808static 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__
811static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_fast_project(__x,__y); }
812static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_fast_project(__x,__y); }
813static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_fast_project(__x,__y); }
814static simd_float8 SIMD_CFUNC simd_project(simd_float8 __x, simd_float8 __y) { return simd_fast_project(__x,__y); }
815static simd_float16 SIMD_CFUNC simd_project(simd_float16 __x, simd_float16 __y) { return simd_fast_project(__x,__y); }
816static simd_double2 SIMD_CFUNC simd_project(simd_double2 __x, simd_double2 __y) { return simd_fast_project(__x,__y); }
817static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y) { return simd_fast_project(__x,__y); }
818static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_fast_project(__x,__y); }
819static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_fast_project(__x,__y); }
820#else
821static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_precise_project(__x,__y); }
822static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_precise_project(__x,__y); }
823static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_precise_project(__x,__y); }
824static simd_float8 SIMD_CFUNC simd_project(simd_float8 __x, simd_float8 __y) { return simd_precise_project(__x,__y); }
825static simd_float16 SIMD_CFUNC simd_project(simd_float16 __x, simd_float16 __y) { return simd_precise_project(__x,__y); }
826static simd_double2 SIMD_CFUNC simd_project(simd_double2 __x, simd_double2 __y) { return simd_precise_project(__x,__y); }
827static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y) { return simd_precise_project(__x,__y); }
828static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_precise_project(__x,__y); }
829static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_precise_project(__x,__y); }
830#endif
831
832static float SIMD_CFUNC simd_precise_length(simd_float2 __x) { return sqrtf(simd_length_squared(__x)); }
833static float SIMD_CFUNC simd_precise_length(simd_float3 __x) { return sqrtf(simd_length_squared(__x)); }
834static float SIMD_CFUNC simd_precise_length(simd_float4 __x) { return sqrtf(simd_length_squared(__x)); }
835static float SIMD_CFUNC simd_precise_length(simd_float8 __x) { return sqrtf(simd_length_squared(__x)); }
836static float SIMD_CFUNC simd_precise_length(simd_float16 __x) { return sqrtf(simd_length_squared(__x)); }
837static double SIMD_CFUNC simd_precise_length(simd_double2 __x) { return sqrt(simd_length_squared(__x)); }
838static double SIMD_CFUNC simd_precise_length(simd_double3 __x) { return sqrt(simd_length_squared(__x)); }
839static double SIMD_CFUNC simd_precise_length(simd_double4 __x) { return sqrt(simd_length_squared(__x)); }
840static double SIMD_CFUNC simd_precise_length(simd_double8 __x) { return sqrt(simd_length_squared(__x)); }
841
842static float SIMD_CFUNC simd_fast_length(simd_float2 __x) { return simd_precise_length(__x); }
843static float SIMD_CFUNC simd_fast_length(simd_float3 __x) { return simd_precise_length(__x); }
844static float SIMD_CFUNC simd_fast_length(simd_float4 __x) { return simd_precise_length(__x); }
845static float SIMD_CFUNC simd_fast_length(simd_float8 __x) { return simd_precise_length(__x); }
846static float SIMD_CFUNC simd_fast_length(simd_float16 __x) { return simd_precise_length(__x); }
847static double SIMD_CFUNC simd_fast_length(simd_double2 __x) { return simd_precise_length(__x); }
848static double SIMD_CFUNC simd_fast_length(simd_double3 __x) { return simd_precise_length(__x); }
849static double SIMD_CFUNC simd_fast_length(simd_double4 __x) { return simd_precise_length(__x); }
850static double SIMD_CFUNC simd_fast_length(simd_double8 __x) { return simd_precise_length(__x); }
851
852#if defined __FAST_MATH__
853static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_fast_length(__x); }
854static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_fast_length(__x); }
855static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_fast_length(__x); }
856static float SIMD_CFUNC simd_length(simd_float8 __x) { return simd_fast_length(__x); }
857static float SIMD_CFUNC simd_length(simd_float16 __x) { return simd_fast_length(__x); }
858static double SIMD_CFUNC simd_length(simd_double2 __x) { return simd_fast_length(__x); }
859static double SIMD_CFUNC simd_length(simd_double3 __x) { return simd_fast_length(__x); }
860static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_fast_length(__x); }
861static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_fast_length(__x); }
862#else
863static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_precise_length(__x); }
864static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_precise_length(__x); }
865static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_precise_length(__x); }
866static float SIMD_CFUNC simd_length(simd_float8 __x) { return simd_precise_length(__x); }
867static float SIMD_CFUNC simd_length(simd_float16 __x) { return simd_precise_length(__x); }
868static double SIMD_CFUNC simd_length(simd_double2 __x) { return simd_precise_length(__x); }
869static double SIMD_CFUNC simd_length(simd_double3 __x) { return simd_precise_length(__x); }
870static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_precise_length(__x); }
871static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_precise_length(__x); }
872#endif
873
874static float SIMD_CFUNC simd_length_squared(simd_float2 __x) { return simd_dot(__x,__x); }
875static float SIMD_CFUNC simd_length_squared(simd_float3 __x) { return simd_dot(__x,__x); }
876static float SIMD_CFUNC simd_length_squared(simd_float4 __x) { return simd_dot(__x,__x); }
877static float SIMD_CFUNC simd_length_squared(simd_float8 __x) { return simd_dot(__x,__x); }
878static float SIMD_CFUNC simd_length_squared(simd_float16 __x) { return simd_dot(__x,__x); }
879static double SIMD_CFUNC simd_length_squared(simd_double2 __x) { return simd_dot(__x,__x); }
880static double SIMD_CFUNC simd_length_squared(simd_double3 __x) { return simd_dot(__x,__x); }
881static double SIMD_CFUNC simd_length_squared(simd_double4 __x) { return simd_dot(__x,__x); }
882static double SIMD_CFUNC simd_length_squared(simd_double8 __x) { return simd_dot(__x,__x); }
883
884static float SIMD_CFUNC simd_norm_one(simd_float2 __x) { return simd_reduce_add(__tg_fabs(__x)); }
885static float SIMD_CFUNC simd_norm_one(simd_float3 __x) { return simd_reduce_add(__tg_fabs(__x)); }
886static float SIMD_CFUNC simd_norm_one(simd_float4 __x) { return simd_reduce_add(__tg_fabs(__x)); }
887static float SIMD_CFUNC simd_norm_one(simd_float8 __x) { return simd_reduce_add(__tg_fabs(__x)); }
888static float SIMD_CFUNC simd_norm_one(simd_float16 __x) { return simd_reduce_add(__tg_fabs(__x)); }
889static double SIMD_CFUNC simd_norm_one(simd_double2 __x) { return simd_reduce_add(__tg_fabs(__x)); }
890static double SIMD_CFUNC simd_norm_one(simd_double3 __x) { return simd_reduce_add(__tg_fabs(__x)); }
891static double SIMD_CFUNC simd_norm_one(simd_double4 __x) { return simd_reduce_add(__tg_fabs(__x)); }
892static double SIMD_CFUNC simd_norm_one(simd_double8 __x) { return simd_reduce_add(__tg_fabs(__x)); }
893
894static float SIMD_CFUNC simd_norm_inf(simd_float2 __x) { return simd_reduce_max(__tg_fabs(__x)); }
895static float SIMD_CFUNC simd_norm_inf(simd_float3 __x) { return simd_reduce_max(__tg_fabs(__x)); }
896static float SIMD_CFUNC simd_norm_inf(simd_float4 __x) { return simd_reduce_max(__tg_fabs(__x)); }
897static float SIMD_CFUNC simd_norm_inf(simd_float8 __x) { return simd_reduce_max(__tg_fabs(__x)); }
898static float SIMD_CFUNC simd_norm_inf(simd_float16 __x) { return simd_reduce_max(__tg_fabs(__x)); }
899static double SIMD_CFUNC simd_norm_inf(simd_double2 __x) { return simd_reduce_max(__tg_fabs(__x)); }
900static double SIMD_CFUNC simd_norm_inf(simd_double3 __x) { return simd_reduce_max(__tg_fabs(__x)); }
901static double SIMD_CFUNC simd_norm_inf(simd_double4 __x) { return simd_reduce_max(__tg_fabs(__x)); }
902static double SIMD_CFUNC simd_norm_inf(simd_double8 __x) { return simd_reduce_max(__tg_fabs(__x)); }
903
904static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_length(__x - __y); }
905static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_length(__x - __y); }
906static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_length(__x - __y); }
907static float SIMD_CFUNC simd_precise_distance(simd_float8 __x, simd_float8 __y) { return simd_precise_length(__x - __y); }
908static float SIMD_CFUNC simd_precise_distance(simd_float16 __x, simd_float16 __y) { return simd_precise_length(__x - __y); }
909static double SIMD_CFUNC simd_precise_distance(simd_double2 __x, simd_double2 __y) { return simd_precise_length(__x - __y); }
910static double SIMD_CFUNC simd_precise_distance(simd_double3 __x, simd_double3 __y) { return simd_precise_length(__x - __y); }
911static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_length(__x - __y); }
912static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_length(__x - __y); }
913
914static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_length(__x - __y); }
915static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_length(__x - __y); }
916static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_length(__x - __y); }
917static float SIMD_CFUNC simd_fast_distance(simd_float8 __x, simd_float8 __y) { return simd_fast_length(__x - __y); }
918static float SIMD_CFUNC simd_fast_distance(simd_float16 __x, simd_float16 __y) { return simd_fast_length(__x - __y); }
919static double SIMD_CFUNC simd_fast_distance(simd_double2 __x, simd_double2 __y) { return simd_fast_length(__x - __y); }
920static double SIMD_CFUNC simd_fast_distance(simd_double3 __x, simd_double3 __y) { return simd_fast_length(__x - __y); }
921static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_length(__x - __y); }
922static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_length(__x - __y); }
923
924#if defined __FAST_MATH__
925static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_distance(__x,__y); }
926static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_distance(__x,__y); }
927static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_distance(__x,__y); }
928static float SIMD_CFUNC simd_distance(simd_float8 __x, simd_float8 __y) { return simd_fast_distance(__x,__y); }
929static float SIMD_CFUNC simd_distance(simd_float16 __x, simd_float16 __y) { return simd_fast_distance(__x,__y); }
930static double SIMD_CFUNC simd_distance(simd_double2 __x, simd_double2 __y) { return simd_fast_distance(__x,__y); }
931static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y) { return simd_fast_distance(__x,__y); }
932static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_distance(__x,__y); }
933static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_distance(__x,__y); }
934#else
935static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_distance(__x,__y); }
936static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_distance(__x,__y); }
937static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_distance(__x,__y); }
938static float SIMD_CFUNC simd_distance(simd_float8 __x, simd_float8 __y) { return simd_precise_distance(__x,__y); }
939static float SIMD_CFUNC simd_distance(simd_float16 __x, simd_float16 __y) { return simd_precise_distance(__x,__y); }
940static double SIMD_CFUNC simd_distance(simd_double2 __x, simd_double2 __y) { return simd_precise_distance(__x,__y); }
941static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y) { return simd_precise_distance(__x,__y); }
942static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_distance(__x,__y); }
943static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_distance(__x,__y); }
944#endif
945
946static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y) { return simd_length_squared(__x - __y); }
947static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y) { return simd_length_squared(__x - __y); }
948static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y) { return simd_length_squared(__x - __y); }
949static float SIMD_CFUNC simd_distance_squared(simd_float8 __x, simd_float8 __y) { return simd_length_squared(__x - __y); }
950static float SIMD_CFUNC simd_distance_squared(simd_float16 __x, simd_float16 __y) { return simd_length_squared(__x - __y); }
951static double SIMD_CFUNC simd_distance_squared(simd_double2 __x, simd_double2 __y) { return simd_length_squared(__x - __y); }
952static double SIMD_CFUNC simd_distance_squared(simd_double3 __x, simd_double3 __y) { return simd_length_squared(__x - __y); }
953static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y) { return simd_length_squared(__x - __y); }
954static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y) { return simd_length_squared(__x - __y); }
955
956static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
957static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
958static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
959static simd_float8 SIMD_CFUNC simd_precise_normalize(simd_float8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
960static simd_float16 SIMD_CFUNC simd_precise_normalize(simd_float16 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
961static simd_double2 SIMD_CFUNC simd_precise_normalize(simd_double2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
962static simd_double3 SIMD_CFUNC simd_precise_normalize(simd_double3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
963static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
964static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
965
966static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
967static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
968static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
969static simd_float8 SIMD_CFUNC simd_fast_normalize(simd_float8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
970static simd_float16 SIMD_CFUNC simd_fast_normalize(simd_float16 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
971static simd_double2 SIMD_CFUNC simd_fast_normalize(simd_double2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
972static simd_double3 SIMD_CFUNC simd_fast_normalize(simd_double3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
973static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
974static 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__
977static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_fast_normalize(__x); }
978static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_fast_normalize(__x); }
979static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_fast_normalize(__x); }
980static simd_float8 SIMD_CFUNC simd_normalize(simd_float8 __x) { return simd_fast_normalize(__x); }
981static simd_float16 SIMD_CFUNC simd_normalize(simd_float16 __x) { return simd_fast_normalize(__x); }
982static simd_double2 SIMD_CFUNC simd_normalize(simd_double2 __x) { return simd_fast_normalize(__x); }
983static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x) { return simd_fast_normalize(__x); }
984static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_fast_normalize(__x); }
985static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_fast_normalize(__x); }
986#else
987static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_precise_normalize(__x); }
988static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_precise_normalize(__x); }
989static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_precise_normalize(__x); }
990static simd_float8 SIMD_CFUNC simd_normalize(simd_float8 __x) { return simd_precise_normalize(__x); }
991static simd_float16 SIMD_CFUNC simd_normalize(simd_float16 __x) { return simd_precise_normalize(__x); }
992static simd_double2 SIMD_CFUNC simd_normalize(simd_double2 __x) { return simd_precise_normalize(__x); }
993static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x) { return simd_precise_normalize(__x); }
994static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_precise_normalize(__x); }
995static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_precise_normalize(__x); }
996#endif
997
998static 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 }; }
999static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }
1000static 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 }; }
1001static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }
1002
1003static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1004static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1005static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1006static simd_double2 SIMD_CFUNC simd_reflect(simd_double2 __x, simd_double2 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1007static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1008static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1009
1010static 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}
1014static 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}
1018static 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}
1022static 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}
1026static 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}
1030static 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
1036static float SIMD_CFUNC simd_orient(simd_float2 __x, simd_float2 __y) {
1037 return _simd_orient_vf2(__x, __y);
1038}
1039static double SIMD_CFUNC simd_orient(simd_double2 __x, simd_double2 __y) {
1040 return _simd_orient_vd2(__x, __y);
1041}
1042static float SIMD_CFUNC simd_orient(simd_float3 __x, simd_float3 __y, simd_float3 __z) {
1043 return _simd_orient_vf3(__x, __y, __z);
1044}
1045static 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
1050static float SIMD_CFUNC simd_orient(simd_float2 __a, simd_float2 __b, simd_float2 __c) {
1051 return _simd_orient_pf2(__a, __b, __c);
1052}
1053static double SIMD_CFUNC simd_orient(simd_double2 __a, simd_double2 __b, simd_double2 __c) {
1054 return _simd_orient_pd2(__a, __b, __c);
1055}
1056static 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}
1059static 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
1064static 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}
1067static 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}
1070static 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}
1073static 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/aarch64-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
69extern "C" {
70#endif
71
72/*! @abstract True if and only if the high-order bit of any lane of the
73 * vector is set. */
74static 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. */
77static 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. */
80static 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. */
83static 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. */
86static 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. */
89static 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. */
92static 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. */
95static 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. */
98static 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. */
101static 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. */
104static 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. */
107static 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. */
110static 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. */
113static 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. */
116static 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. */
119static 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. */
122static 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. */
125static 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. */
128static 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. */
131static 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. */
134static 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. */
137static 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. */
140static 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. */
143static 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. */
146static 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. */
149static 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. */
152static 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. */
155static 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. */
158static 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. */
161static 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. */
164static 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. */
167static 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. */
170static 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. */
173static 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. */
176static 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. */
179static 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. */
182static 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. */
185static 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. */
188static 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. */
191static 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. */
194static 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. */
197static 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. */
200static 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. */
203static 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. */
211static 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. */
214static 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. */
217static 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. */
220static 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. */
223static 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. */
226static 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. */
229static 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. */
232static 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. */
235static 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. */
238static 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. */
241static 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. */
244static 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. */
247static 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. */
250static 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. */
253static 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. */
256static 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. */
259static 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. */
262static 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. */
265static 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. */
268static 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. */
271static 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. */
274static 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. */
277static 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. */
280static 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. */
283static 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. */
286static 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. */
289static 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. */
292static 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. */
295static 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. */
298static 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. */
301static 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. */
304static 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. */
307static 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. */
310static 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. */
313static 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. */
316static 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. */
319static 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. */
322static 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. */
325static 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. */
328static 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. */
331static 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. */
334static 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. */
337static 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. */
340static 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. */
349static 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. */
353static 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. */
357static 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. */
361static 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. */
365static 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. */
369static 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. */
373static 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. */
377static 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. */
381static 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. */
391static 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. */
395static 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. */
399static 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. */
403static 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. */
407static 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. */
411static 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. */
415static 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. */
419static 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. */
423static 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. */
427static 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. */
431static 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. */
435static 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. */
439static 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. */
443static 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. */
447static 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. */
451static 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. */
455static 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. */
459static 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. */
463static 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. */
467static 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. */
471static 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. */
475static 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. */
479static 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. */
483static 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. */
487static 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. */
491static 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. */
495static 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. */
499static 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. */
503static 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. */
507static 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. */
511static 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. */
515static 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. */
519static 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. */
523static 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. */
527static 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. */
531static 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. */
535static 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. */
539static 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. */
543static 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. */
547static 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. */
551static 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. */
555static 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. */
559static 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. */
563static 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. */
567static 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. */
571static 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. */
575static 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. */
579static 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. */
583static 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. */
587static 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. */
591static 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. */
595static 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. */
599static 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
609namespace 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
624extern "C" {
625#endif /* __cplusplus */
626
627#pragma mark - Implementations
628
629static 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}
639static 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}
649static 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}
659static 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}
669static 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}
678static 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}
685static inline SIMD_CFUNC simd_bool simd_any(simd_char64 x) {
686 return simd_any(x.lo | x.hi);
687}
688static inline SIMD_CFUNC simd_bool simd_any(simd_uchar2 x) {
689 return simd_any((simd_char2)x);
690}
691static inline SIMD_CFUNC simd_bool simd_any(simd_uchar3 x) {
692 return simd_any((simd_char3)x);
693}
694static inline SIMD_CFUNC simd_bool simd_any(simd_uchar4 x) {
695 return simd_any((simd_char4)x);
696}
697static inline SIMD_CFUNC simd_bool simd_any(simd_uchar8 x) {
698 return simd_any((simd_char8)x);
699}
700static inline SIMD_CFUNC simd_bool simd_any(simd_uchar16 x) {
701 return simd_any((simd_char16)x);
702}
703static inline SIMD_CFUNC simd_bool simd_any(simd_uchar32 x) {
704 return simd_any((simd_char32)x);
705}
706static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x) {
707 return simd_any((simd_char64)x);
708}
709static 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}
719static 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}
729static 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}
739static 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}
748static 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}
755static inline SIMD_CFUNC simd_bool simd_any(simd_short32 x) {
756 return simd_any(x.lo | x.hi);
757}
758static inline SIMD_CFUNC simd_bool simd_any(simd_ushort2 x) {
759 return simd_any((simd_short2)x);
760}
761static inline SIMD_CFUNC simd_bool simd_any(simd_ushort3 x) {
762 return simd_any((simd_short3)x);
763}
764static inline SIMD_CFUNC simd_bool simd_any(simd_ushort4 x) {
765 return simd_any((simd_short4)x);
766}
767static inline SIMD_CFUNC simd_bool simd_any(simd_ushort8 x) {
768 return simd_any((simd_short8)x);
769}
770static inline SIMD_CFUNC simd_bool simd_any(simd_ushort16 x) {
771 return simd_any((simd_short16)x);
772}
773static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x) {
774 return simd_any((simd_short32)x);
775}
776static 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}
786static 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}
795static 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}
804static 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}
811static inline SIMD_CFUNC simd_bool simd_any(simd_int16 x) {
812 return simd_any(x.lo | x.hi);
813}
814static inline SIMD_CFUNC simd_bool simd_any(simd_uint2 x) {
815 return simd_any((simd_int2)x);
816}
817static inline SIMD_CFUNC simd_bool simd_any(simd_uint3 x) {
818 return simd_any((simd_int3)x);
819}
820static inline SIMD_CFUNC simd_bool simd_any(simd_uint4 x) {
821 return simd_any((simd_int4)x);
822}
823static inline SIMD_CFUNC simd_bool simd_any(simd_uint8 x) {
824 return simd_any((simd_int8)x);
825}
826static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x) {
827 return simd_any((simd_int16)x);
828}
829static 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}
838static 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}
845static 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}
852static inline SIMD_CFUNC simd_bool simd_any(simd_long8 x) {
853 return simd_any(x.lo | x.hi);
854}
855static inline SIMD_CFUNC simd_bool simd_any(simd_ulong2 x) {
856 return simd_any((simd_long2)x);
857}
858static inline SIMD_CFUNC simd_bool simd_any(simd_ulong3 x) {
859 return simd_any((simd_long3)x);
860}
861static inline SIMD_CFUNC simd_bool simd_any(simd_ulong4 x) {
862 return simd_any((simd_long4)x);
863}
864static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x) {
865 return simd_any((simd_long8)x);
866}
867
868static 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}
878static 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}
888static 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}
898static 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}
908static 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}
917static 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}
924static inline SIMD_CFUNC simd_bool simd_all(simd_char64 x) {
925 return simd_all(x.lo & x.hi);
926}
927static inline SIMD_CFUNC simd_bool simd_all(simd_uchar2 x) {
928 return simd_all((simd_char2)x);
929}
930static inline SIMD_CFUNC simd_bool simd_all(simd_uchar3 x) {
931 return simd_all((simd_char3)x);
932}
933static inline SIMD_CFUNC simd_bool simd_all(simd_uchar4 x) {
934 return simd_all((simd_char4)x);
935}
936static inline SIMD_CFUNC simd_bool simd_all(simd_uchar8 x) {
937 return simd_all((simd_char8)x);
938}
939static inline SIMD_CFUNC simd_bool simd_all(simd_uchar16 x) {
940 return simd_all((simd_char16)x);
941}
942static inline SIMD_CFUNC simd_bool simd_all(simd_uchar32 x) {
943 return simd_all((simd_char32)x);
944}
945static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x) {
946 return simd_all((simd_char64)x);
947}
948static 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}
958static 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}
968static 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}
978static 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}
987static 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}
994static inline SIMD_CFUNC simd_bool simd_all(simd_short32 x) {
995 return simd_all(x.lo & x.hi);
996}
997static inline SIMD_CFUNC simd_bool simd_all(simd_ushort2 x) {
998 return simd_all((simd_short2)x);
999}
1000static inline SIMD_CFUNC simd_bool simd_all(simd_ushort3 x) {
1001 return simd_all((simd_short3)x);
1002}
1003static inline SIMD_CFUNC simd_bool simd_all(simd_ushort4 x) {
1004 return simd_all((simd_short4)x);
1005}
1006static inline SIMD_CFUNC simd_bool simd_all(simd_ushort8 x) {
1007 return simd_all((simd_short8)x);
1008}
1009static inline SIMD_CFUNC simd_bool simd_all(simd_ushort16 x) {
1010 return simd_all((simd_short16)x);
1011}
1012static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x) {
1013 return simd_all((simd_short32)x);
1014}
1015static 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}
1025static 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}
1034static 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}
1043static 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}
1050static inline SIMD_CFUNC simd_bool simd_all(simd_int16 x) {
1051 return simd_all(x.lo & x.hi);
1052}
1053static inline SIMD_CFUNC simd_bool simd_all(simd_uint2 x) {
1054 return simd_all((simd_int2)x);
1055}
1056static inline SIMD_CFUNC simd_bool simd_all(simd_uint3 x) {
1057 return simd_all((simd_int3)x);
1058}
1059static inline SIMD_CFUNC simd_bool simd_all(simd_uint4 x) {
1060 return simd_all((simd_int4)x);
1061}
1062static inline SIMD_CFUNC simd_bool simd_all(simd_uint8 x) {
1063 return simd_all((simd_int8)x);
1064}
1065static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x) {
1066 return simd_all((simd_int16)x);
1067}
1068static 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}
1077static 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}
1084static 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}
1091static inline SIMD_CFUNC simd_bool simd_all(simd_long8 x) {
1092 return simd_all(x.lo & x.hi);
1093}
1094static inline SIMD_CFUNC simd_bool simd_all(simd_ulong2 x) {
1095 return simd_all((simd_long2)x);
1096}
1097static inline SIMD_CFUNC simd_bool simd_all(simd_ulong3 x) {
1098 return simd_all((simd_long3)x);
1099}
1100static inline SIMD_CFUNC simd_bool simd_all(simd_ulong4 x) {
1101 return simd_all((simd_long4)x);
1102}
1103static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x) {
1104 return simd_all((simd_long8)x);
1105}
1106
1107static 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}
1110static 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}
1113static 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}
1120static 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}
1127static 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}
1130static 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}
1137static 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}
1140static 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}
1147static 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
1151static inline SIMD_CFUNC simd_char2 simd_bitselect(simd_char2 x, simd_char2 y, simd_char2 mask) {
1152 return (x & ~mask) | (y & mask);
1153}
1154static inline SIMD_CFUNC simd_char3 simd_bitselect(simd_char3 x, simd_char3 y, simd_char3 mask) {
1155 return (x & ~mask) | (y & mask);
1156}
1157static inline SIMD_CFUNC simd_char4 simd_bitselect(simd_char4 x, simd_char4 y, simd_char4 mask) {
1158 return (x & ~mask) | (y & mask);
1159}
1160static inline SIMD_CFUNC simd_char8 simd_bitselect(simd_char8 x, simd_char8 y, simd_char8 mask) {
1161 return (x & ~mask) | (y & mask);
1162}
1163static inline SIMD_CFUNC simd_char16 simd_bitselect(simd_char16 x, simd_char16 y, simd_char16 mask) {
1164 return (x & ~mask) | (y & mask);
1165}
1166static inline SIMD_CFUNC simd_char32 simd_bitselect(simd_char32 x, simd_char32 y, simd_char32 mask) {
1167 return (x & ~mask) | (y & mask);
1168}
1169static inline SIMD_CFUNC simd_char64 simd_bitselect(simd_char64 x, simd_char64 y, simd_char64 mask) {
1170 return (x & ~mask) | (y & mask);
1171}
1172static 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}
1175static 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}
1178static 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}
1181static 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}
1184static 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}
1187static 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}
1190static 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}
1193static inline SIMD_CFUNC simd_short2 simd_bitselect(simd_short2 x, simd_short2 y, simd_short2 mask) {
1194 return (x & ~mask) | (y & mask);
1195}
1196static inline SIMD_CFUNC simd_short3 simd_bitselect(simd_short3 x, simd_short3 y, simd_short3 mask) {
1197 return (x & ~mask) | (y & mask);
1198}
1199static inline SIMD_CFUNC simd_short4 simd_bitselect(simd_short4 x, simd_short4 y, simd_short4 mask) {
1200 return (x & ~mask) | (y & mask);
1201}
1202static inline SIMD_CFUNC simd_short8 simd_bitselect(simd_short8 x, simd_short8 y, simd_short8 mask) {
1203 return (x & ~mask) | (y & mask);
1204}
1205static inline SIMD_CFUNC simd_short16 simd_bitselect(simd_short16 x, simd_short16 y, simd_short16 mask) {
1206 return (x & ~mask) | (y & mask);
1207}
1208static inline SIMD_CFUNC simd_short32 simd_bitselect(simd_short32 x, simd_short32 y, simd_short32 mask) {
1209 return (x & ~mask) | (y & mask);
1210}
1211static 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}
1214static 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}
1217static 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}
1220static 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}
1223static 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}
1226static 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}
1229static inline SIMD_CFUNC simd_int2 simd_bitselect(simd_int2 x, simd_int2 y, simd_int2 mask) {
1230 return (x & ~mask) | (y & mask);
1231}
1232static inline SIMD_CFUNC simd_int3 simd_bitselect(simd_int3 x, simd_int3 y, simd_int3 mask) {
1233 return (x & ~mask) | (y & mask);
1234}
1235static inline SIMD_CFUNC simd_int4 simd_bitselect(simd_int4 x, simd_int4 y, simd_int4 mask) {
1236 return (x & ~mask) | (y & mask);
1237}
1238static inline SIMD_CFUNC simd_int8 simd_bitselect(simd_int8 x, simd_int8 y, simd_int8 mask) {
1239 return (x & ~mask) | (y & mask);
1240}
1241static inline SIMD_CFUNC simd_int16 simd_bitselect(simd_int16 x, simd_int16 y, simd_int16 mask) {
1242 return (x & ~mask) | (y & mask);
1243}
1244static 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}
1247static 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}
1250static 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}
1253static 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}
1256static 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}
1259static 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}
1262static 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}
1265static 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}
1268static 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}
1271static 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}
1274static inline SIMD_CFUNC simd_long2 simd_bitselect(simd_long2 x, simd_long2 y, simd_long2 mask) {
1275 return (x & ~mask) | (y & mask);
1276}
1277static inline SIMD_CFUNC simd_long3 simd_bitselect(simd_long3 x, simd_long3 y, simd_long3 mask) {
1278 return (x & ~mask) | (y & mask);
1279}
1280static inline SIMD_CFUNC simd_long4 simd_bitselect(simd_long4 x, simd_long4 y, simd_long4 mask) {
1281 return (x & ~mask) | (y & mask);
1282}
1283static inline SIMD_CFUNC simd_long8 simd_bitselect(simd_long8 x, simd_long8 y, simd_long8 mask) {
1284 return (x & ~mask) | (y & mask);
1285}
1286static 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}
1289static 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}
1292static 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}
1295static 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}
1298static 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}
1301static 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}
1304static 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}
1307static 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/aarch64-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
94extern "C" {
95#endif
96/*! @abstract Do not call this function; instead use `acos` in C and
97 * Objective-C, and `simd::acos` in C++. */
98static 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++. */
101static 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++. */
104static 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++. */
107static 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++. */
110static 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++. */
113static 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++. */
116static 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++. */
119static 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++. */
122static 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++. */
126static 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++. */
129static 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++. */
132static 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++. */
135static 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++. */
138static 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++. */
141static 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++. */
144static 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++. */
147static 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++. */
150static 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++. */
154static 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++. */
157static 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++. */
160static 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++. */
163static 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++. */
166static 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++. */
169static 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++. */
172static 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++. */
175static 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++. */
178static 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++. */
182static 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++. */
185static 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++. */
188static 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++. */
191static 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++. */
194static 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++. */
197static 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++. */
200static 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++. */
203static 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++. */
206static 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++. */
210static 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++. */
213static 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++. */
216static 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++. */
219static 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++. */
222static 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++. */
225static 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++. */
228static 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++. */
231static 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++. */
234static 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++. */
238static 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++. */
241static 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++. */
244static 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++. */
247static 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++. */
250static 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++. */
253static 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++. */
256static 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++. */
259static 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++. */
262static 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++. */
267static 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++. */
270static 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++. */
273static 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++. */
276static 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++. */
279static 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++. */
282static 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++. */
285static 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++. */
288static 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++. */
291static 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++. */
297static 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++. */
300static 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++. */
303static 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++. */
306static 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++. */
309static 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++. */
312static 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++. */
315static 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++. */
318static 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++. */
321static 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++. */
327static 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++. */
330static 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++. */
333static 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++. */
336static 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++. */
339static 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++. */
342static 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++. */
345static 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++. */
348static 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++. */
351static 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++. */
356static 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++. */
359static 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++. */
362static 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++. */
365static 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++. */
368static 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++. */
371static 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++. */
374static 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++. */
377static 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++. */
380static 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++. */
384static 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++. */
387static 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++. */
390static 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++. */
393static 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++. */
396static 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++. */
399static 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++. */
402static 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++. */
405static 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++. */
408static 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++. */
412static 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++. */
415static 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++. */
418static 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++. */
421static 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++. */
424static 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++. */
427static 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++. */
430static 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++. */
433static 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++. */
436static 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++. */
440static 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++. */
443static 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++. */
446static 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++. */
449static 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++. */
452static 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++. */
455static 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++. */
458static 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++. */
461static 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++. */
464static 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++. */
468static 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++. */
471static 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++. */
474static 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++. */
477static 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++. */
480static 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++. */
483static 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++. */
486static 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++. */
489static 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++. */
492static 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++. */
496static 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++. */
499static 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++. */
502static 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++. */
505static 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++. */
508static 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++. */
511static 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++. */
514static 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++. */
517static 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++. */
520static 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++. */
524static 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++. */
527static 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++. */
530static 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++. */
533static 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++. */
536static 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++. */
539static 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++. */
542static 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++. */
545static 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++. */
548static 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++. */
552static 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++. */
555static 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++. */
558static 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++. */
561static 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++. */
564static 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++. */
567static 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++. */
570static 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++. */
573static 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++. */
576static 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++. */
581static 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++. */
584static 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++. */
587static 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++. */
590static 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++. */
593static 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++. */
596static 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++. */
599static 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++. */
602static 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++. */
605static 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++. */
610static 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++. */
613static 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++. */
616static 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++. */
619static 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++. */
622static 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++. */
625static 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++. */
628static 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++. */
631static 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++. */
634static 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++. */
638static 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++. */
641static 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++. */
644static 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++. */
647static 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++. */
650static 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++. */
653static 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++. */
656static 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++. */
659static 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++. */
662static 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++. */
666static 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++. */
669static 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++. */
672static 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++. */
675static 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++. */
678static 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++. */
681static 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++. */
684static 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++. */
687static 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++. */
690static 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++. */
694static 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++. */
697static 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++. */
700static 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++. */
703static 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++. */
706static 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++. */
709static 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++. */
712static 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++. */
715static 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++. */
718static 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++. */
722static 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++. */
725static 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++. */
728static 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++. */
731static 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++. */
734static 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++. */
737static 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++. */
740static 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++. */
743static 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++. */
746static 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++. */
750static 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++. */
753static 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++. */
756static 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++. */
759static 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++. */
762static 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++. */
765static 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++. */
768static 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++. */
771static 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++. */
774static 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++. */
778static 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++. */
781static 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++. */
784static 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++. */
787static 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++. */
790static 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++. */
793static 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++. */
796static 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++. */
799static 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++. */
802static 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++. */
806static 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++. */
809static 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++. */
812static 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++. */
815static 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++. */
818static 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++. */
821static 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++. */
824static 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++. */
827static 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++. */
830static 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++. */
834static 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++. */
837static 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++. */
840static 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++. */
843static 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++. */
846static 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++. */
849static 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++. */
852static 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++. */
855static 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++. */
858static 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++. */
862static 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++. */
865static 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++. */
868static 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++. */
871static 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++. */
874static 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++. */
877static 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++. */
880static 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++. */
883static 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++. */
886static 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++. */
890static 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++. */
893static 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++. */
896static 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++. */
899static 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++. */
902static 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++. */
905static 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++. */
908static 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++. */
911static 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++. */
914static 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++. */
918static 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++. */
921static 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++. */
924static 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++. */
927static 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++. */
930static 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++. */
933static 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++. */
936static 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++. */
939static 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++. */
942static 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++. */
946static 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++. */
949static 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++. */
952static 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++. */
955static 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++. */
958static 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++. */
961static 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++. */
964static 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++. */
967static 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++. */
970static 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++. */
974static 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++. */
977static 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++. */
980static 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++. */
983static 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++. */
986static 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++. */
989static 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++. */
992static 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++. */
995static 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++. */
998static 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++. */
1002static 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++. */
1005static 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++. */
1008static 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++. */
1011static 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++. */
1014static 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++. */
1017static 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++. */
1020static 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++. */
1023static 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++. */
1026static 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++. */
1030static 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++. */
1033static 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++. */
1036static 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++. */
1039static 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++. */
1042static 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++. */
1045static 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++. */
1048static 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++. */
1051static 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++. */
1054static 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++. */
1059static 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++. */
1062static 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++. */
1065static 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++. */
1068static 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++. */
1071static 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++. */
1074static 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++. */
1077static 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++. */
1080static 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++. */
1083static 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++. */
1087static 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++. */
1090static 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++. */
1093static 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++. */
1096static 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++. */
1099static 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++. */
1102static 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++. */
1105static 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++. */
1108static 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++. */
1111static 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++. */
1115static 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++. */
1118static 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++. */
1121static 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++. */
1124static 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++. */
1127static 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++. */
1130static 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++. */
1133static 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++. */
1136static 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++. */
1139static 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++. */
1143static 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++. */
1146static 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++. */
1149static 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++. */
1152static 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++. */
1155static 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++. */
1158static 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++. */
1161static 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++. */
1164static 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++. */
1167static 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++. */
1171static 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++. */
1174static 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++. */
1177static 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++. */
1180static 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++. */
1183static 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++. */
1186static 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++. */
1189static 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++. */
1192static 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++. */
1195static 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++. */
1199static 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++. */
1202static 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++. */
1205static 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++. */
1208static 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++. */
1211static 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++. */
1214static 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++. */
1217static 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++. */
1220static 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++. */
1223static 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++. */
1227static 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++. */
1230static 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++. */
1233static 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++. */
1236static 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++. */
1239static 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++. */
1242static 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++. */
1245static 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++. */
1248static 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++. */
1251static 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++. */
1255static 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++. */
1258static 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++. */
1261static 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++. */
1264static 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++. */
1267static 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++. */
1270static 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++. */
1273static 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++. */
1276static 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++. */
1279static 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++. */
1283static 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++. */
1286static 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++. */
1289static 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++. */
1292static 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++. */
1295static 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++. */
1298static 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++. */
1301static 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++. */
1304static 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++. */
1307static 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++. */
1311static 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++. */
1314static 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++. */
1317static 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++. */
1320static 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++. */
1323static 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++. */
1326static 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++. */
1329static 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++. */
1332static 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++. */
1335static 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++. */
1340static 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++. */
1343static 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++. */
1346static 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++. */
1349static 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++. */
1352static 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++. */
1355static 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++. */
1358static 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++. */
1361static 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++. */
1364static 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. */
1368static 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. */
1371static 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. */
1374static 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. */
1377static 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. */
1380static 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. */
1383static 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. */
1386static 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. */
1389static 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. */
1392static 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. */
1395static 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. */
1398static 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. */
1405static SIMD_CPPFUNC float __tg_acos(float x) { return ::acos(x); }
1406/*! @abstract Do not call this function directly; use simd::acos instead. */
1407static SIMD_CPPFUNC double __tg_acos(double x) { return ::acos(x); }
1408/*! @abstract Do not call this function directly; use simd::asin instead. */
1409static SIMD_CPPFUNC float __tg_asin(float x) { return ::asin(x); }
1410/*! @abstract Do not call this function directly; use simd::asin instead. */
1411static SIMD_CPPFUNC double __tg_asin(double x) { return ::asin(x); }
1412/*! @abstract Do not call this function directly; use simd::atan instead. */
1413static SIMD_CPPFUNC float __tg_atan(float x) { return ::atan(x); }
1414/*! @abstract Do not call this function directly; use simd::atan instead. */
1415static SIMD_CPPFUNC double __tg_atan(double x) { return ::atan(x); }
1416/*! @abstract Do not call this function directly; use simd::cos instead. */
1417static SIMD_CPPFUNC float __tg_cos(float x) { return ::cos(x); }
1418/*! @abstract Do not call this function directly; use simd::cos instead. */
1419static SIMD_CPPFUNC double __tg_cos(double x) { return ::cos(x); }
1420/*! @abstract Do not call this function directly; use simd::sin instead. */
1421static SIMD_CPPFUNC float __tg_sin(float x) { return ::sin(x); }
1422/*! @abstract Do not call this function directly; use simd::sin instead. */
1423static SIMD_CPPFUNC double __tg_sin(double x) { return ::sin(x); }
1424/*! @abstract Do not call this function directly; use simd::tan instead. */
1425static SIMD_CPPFUNC float __tg_tan(float x) { return ::tan(x); }
1426/*! @abstract Do not call this function directly; use simd::tan instead. */
1427static SIMD_CPPFUNC double __tg_tan(double x) { return ::tan(x); }
1428/*! @abstract Do not call this function directly; use simd::cospi instead. */
1429static SIMD_CPPFUNC float __tg_cospi(float x) { return ::__cospi(x); }
1430/*! @abstract Do not call this function directly; use simd::cospi instead. */
1431static SIMD_CPPFUNC double __tg_cospi(double x) { return ::__cospi(x); }
1432/*! @abstract Do not call this function directly; use simd::sinpi instead. */
1433static SIMD_CPPFUNC float __tg_sinpi(float x) { return ::__sinpi(x); }
1434/*! @abstract Do not call this function directly; use simd::sinpi instead. */
1435static SIMD_CPPFUNC double __tg_sinpi(double x) { return ::__sinpi(x); }
1436/*! @abstract Do not call this function directly; use simd::tanpi instead. */
1437static SIMD_CPPFUNC float __tg_tanpi(float x) { return ::__tanpi(x); }
1438/*! @abstract Do not call this function directly; use simd::tanpi instead. */
1439static SIMD_CPPFUNC double __tg_tanpi(double x) { return ::__tanpi(x); }
1440/*! @abstract Do not call this function directly; use simd::acosh instead. */
1441static SIMD_CPPFUNC float __tg_acosh(float x) { return ::acosh(x); }
1442/*! @abstract Do not call this function directly; use simd::acosh instead. */
1443static SIMD_CPPFUNC double __tg_acosh(double x) { return ::acosh(x); }
1444/*! @abstract Do not call this function directly; use simd::asinh instead. */
1445static SIMD_CPPFUNC float __tg_asinh(float x) { return ::asinh(x); }
1446/*! @abstract Do not call this function directly; use simd::asinh instead. */
1447static SIMD_CPPFUNC double __tg_asinh(double x) { return ::asinh(x); }
1448/*! @abstract Do not call this function directly; use simd::atanh instead. */
1449static SIMD_CPPFUNC float __tg_atanh(float x) { return ::atanh(x); }
1450/*! @abstract Do not call this function directly; use simd::atanh instead. */
1451static SIMD_CPPFUNC double __tg_atanh(double x) { return ::atanh(x); }
1452/*! @abstract Do not call this function directly; use simd::cosh instead. */
1453static SIMD_CPPFUNC float __tg_cosh(float x) { return ::cosh(x); }
1454/*! @abstract Do not call this function directly; use simd::cosh instead. */
1455static SIMD_CPPFUNC double __tg_cosh(double x) { return ::cosh(x); }
1456/*! @abstract Do not call this function directly; use simd::sinh instead. */
1457static SIMD_CPPFUNC float __tg_sinh(float x) { return ::sinh(x); }
1458/*! @abstract Do not call this function directly; use simd::sinh instead. */
1459static SIMD_CPPFUNC double __tg_sinh(double x) { return ::sinh(x); }
1460/*! @abstract Do not call this function directly; use simd::tanh instead. */
1461static SIMD_CPPFUNC float __tg_tanh(float x) { return ::tanh(x); }
1462/*! @abstract Do not call this function directly; use simd::tanh instead. */
1463static SIMD_CPPFUNC double __tg_tanh(double x) { return ::tanh(x); }
1464/*! @abstract Do not call this function directly; use simd::exp instead. */
1465static SIMD_CPPFUNC float __tg_exp(float x) { return ::exp(x); }
1466/*! @abstract Do not call this function directly; use simd::exp instead. */
1467static SIMD_CPPFUNC double __tg_exp(double x) { return ::exp(x); }
1468/*! @abstract Do not call this function directly; use simd::exp2 instead. */
1469static SIMD_CPPFUNC float __tg_exp2(float x) { return ::exp2(x); }
1470/*! @abstract Do not call this function directly; use simd::exp2 instead. */
1471static SIMD_CPPFUNC double __tg_exp2(double x) { return ::exp2(x); }
1472/*! @abstract Do not call this function directly; use simd::exp10 instead. */
1473static SIMD_CPPFUNC float __tg_exp10(float x) { return ::__exp10(x); }
1474/*! @abstract Do not call this function directly; use simd::exp10 instead. */
1475static SIMD_CPPFUNC double __tg_exp10(double x) { return ::__exp10(x); }
1476/*! @abstract Do not call this function directly; use simd::expm1 instead. */
1477static SIMD_CPPFUNC float __tg_expm1(float x) { return ::expm1(x); }
1478/*! @abstract Do not call this function directly; use simd::expm1 instead. */
1479static SIMD_CPPFUNC double __tg_expm1(double x) { return ::expm1(x); }
1480/*! @abstract Do not call this function directly; use simd::log instead. */
1481static SIMD_CPPFUNC float __tg_log(float x) { return ::log(x); }
1482/*! @abstract Do not call this function directly; use simd::log instead. */
1483static SIMD_CPPFUNC double __tg_log(double x) { return ::log(x); }
1484/*! @abstract Do not call this function directly; use simd::log2 instead. */
1485static SIMD_CPPFUNC float __tg_log2(float x) { return ::log2(x); }
1486/*! @abstract Do not call this function directly; use simd::log2 instead. */
1487static SIMD_CPPFUNC double __tg_log2(double x) { return ::log2(x); }
1488/*! @abstract Do not call this function directly; use simd::log10 instead. */
1489static SIMD_CPPFUNC float __tg_log10(float x) { return ::log10(x); }
1490/*! @abstract Do not call this function directly; use simd::log10 instead. */
1491static SIMD_CPPFUNC double __tg_log10(double x) { return ::log10(x); }
1492/*! @abstract Do not call this function directly; use simd::log1p instead. */
1493static SIMD_CPPFUNC float __tg_log1p(float x) { return ::log1p(x); }
1494/*! @abstract Do not call this function directly; use simd::log1p instead. */
1495static SIMD_CPPFUNC double __tg_log1p(double x) { return ::log1p(x); }
1496/*! @abstract Do not call this function directly; use simd::fabs instead. */
1497static SIMD_CPPFUNC float __tg_fabs(float x) { return ::fabs(x); }
1498/*! @abstract Do not call this function directly; use simd::fabs instead. */
1499static SIMD_CPPFUNC double __tg_fabs(double x) { return ::fabs(x); }
1500/*! @abstract Do not call this function directly; use simd::cbrt instead. */
1501static SIMD_CPPFUNC float __tg_cbrt(float x) { return ::cbrt(x); }
1502/*! @abstract Do not call this function directly; use simd::cbrt instead. */
1503static SIMD_CPPFUNC double __tg_cbrt(double x) { return ::cbrt(x); }
1504/*! @abstract Do not call this function directly; use simd::sqrt instead. */
1505static SIMD_CPPFUNC float __tg_sqrt(float x) { return ::sqrt(x); }
1506/*! @abstract Do not call this function directly; use simd::sqrt instead. */
1507static SIMD_CPPFUNC double __tg_sqrt(double x) { return ::sqrt(x); }
1508/*! @abstract Do not call this function directly; use simd::erf instead. */
1509static SIMD_CPPFUNC float __tg_erf(float x) { return ::erf(x); }
1510/*! @abstract Do not call this function directly; use simd::erf instead. */
1511static SIMD_CPPFUNC double __tg_erf(double x) { return ::erf(x); }
1512/*! @abstract Do not call this function directly; use simd::erfc instead. */
1513static SIMD_CPPFUNC float __tg_erfc(float x) { return ::erfc(x); }
1514/*! @abstract Do not call this function directly; use simd::erfc instead. */
1515static SIMD_CPPFUNC double __tg_erfc(double x) { return ::erfc(x); }
1516/*! @abstract Do not call this function directly; use simd::tgamma instead. */
1517static SIMD_CPPFUNC float __tg_tgamma(float x) { return ::tgamma(x); }
1518/*! @abstract Do not call this function directly; use simd::tgamma instead. */
1519static SIMD_CPPFUNC double __tg_tgamma(double x) { return ::tgamma(x); }
1520/*! @abstract Do not call this function directly; use simd::ceil instead. */
1521static SIMD_CPPFUNC float __tg_ceil(float x) { return ::ceil(x); }
1522/*! @abstract Do not call this function directly; use simd::ceil instead. */
1523static SIMD_CPPFUNC double __tg_ceil(double x) { return ::ceil(x); }
1524/*! @abstract Do not call this function directly; use simd::floor instead. */
1525static SIMD_CPPFUNC float __tg_floor(float x) { return ::floor(x); }
1526/*! @abstract Do not call this function directly; use simd::floor instead. */
1527static SIMD_CPPFUNC double __tg_floor(double x) { return ::floor(x); }
1528/*! @abstract Do not call this function directly; use simd::rint instead. */
1529static SIMD_CPPFUNC float __tg_rint(float x) { return ::rint(x); }
1530/*! @abstract Do not call this function directly; use simd::rint instead. */
1531static SIMD_CPPFUNC double __tg_rint(double x) { return ::rint(x); }
1532/*! @abstract Do not call this function directly; use simd::round instead. */
1533static SIMD_CPPFUNC float __tg_round(float x) { return ::round(x); }
1534/*! @abstract Do not call this function directly; use simd::round instead. */
1535static SIMD_CPPFUNC double __tg_round(double x) { return ::round(x); }
1536/*! @abstract Do not call this function directly; use simd::trunc instead. */
1537static SIMD_CPPFUNC float __tg_trunc(float x) { return ::trunc(x); }
1538/*! @abstract Do not call this function directly; use simd::trunc instead. */
1539static SIMD_CPPFUNC double __tg_trunc(double x) { return ::trunc(x); }
1540/*! @abstract Do not call this function directly; use simd::atan2 instead. */
1541static 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. */
1543static 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. */
1545static 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. */
1547static 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. */
1549static 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. */
1551static 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. */
1553static 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. */
1555static 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. */
1558static 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. */
1561static 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. */
1564static 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. */
1567static 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. */
1570static 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. */
1573static 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. */
1575static 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. */
1577static 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. */
1579static 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. */
1581static 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. */
1583static 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. */
1585static 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. */
1587static 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. */
1589static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); }
1590
1591namespace 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
1831extern "C" {
1832#else
1833#include <tgmath.h>
1834/* C and Objective-C, we need some infrastructure to piggyback on tgmath.h */
1835static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2);
1836static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3);
1837static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4);
1838static SIMD_OVERLOAD simd_float8 __tg_promote(simd_float8);
1839static SIMD_OVERLOAD simd_float16 __tg_promote(simd_float16);
1840static SIMD_OVERLOAD simd_double2 __tg_promote(simd_double2);
1841static SIMD_OVERLOAD simd_double3 __tg_promote(simd_double3);
1842static SIMD_OVERLOAD simd_double4 __tg_promote(simd_double4);
1843static 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
1849static inline SIMD_CFUNC float __tg_cospi(float x) { return __cospif(x); }
1850static 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
1859static inline SIMD_CFUNC float __tg_sinpi(float x) { return __sinpif(x); }
1860static 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
1869static inline SIMD_CFUNC float __tg_tanpi(float x) { return __tanpif(x); }
1870static 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
1879static inline SIMD_CFUNC float __tg_exp10(float x) { return __exp10f(x); }
1880static 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
1894static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
1895static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
1896static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
1897static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
1898static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
1899static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
1900static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
1901static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
1902static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
1903
1904#pragma mark - fmin, fmax implementation
1905static 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
1917static 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
1921static 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
1937static 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
1949static 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
1961static 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
1975static 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
1979static 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
1991static 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
2003static 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
2015static 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
2019static 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
2035static 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
2047static 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
2059static 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
2073static 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
2077static 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
2089static 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
2102static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); }
2103static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); }
2104static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y) { return simd_bitselect(y, x, 0x7fffffff); }
2105static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y) { return simd_bitselect(y, x, 0x7fffffff); }
2106static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y) { return simd_bitselect(y, x, 0x7fffffff); }
2107static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2108static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2109static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2110static 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
2113static 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
2123static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) {
2124 return simd_make_float3(__tg_sqrt(simd_make_float4_undef(x)));
2125}
2126
2127static 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
2137static 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
2145static 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
2153static 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
2163static SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x) {
2164 return simd_make_double3(__tg_sqrt(simd_make_double4_undef(x)));
2165}
2166
2167static 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
2175static 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
2184static 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
2192static 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
2197extern simd_float4 _simd_ceil_f4(simd_float4 x);
2198#endif
2199
2200static 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
2214static 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
2222static 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
2231extern simd_double2 _simd_ceil_d2(simd_double2 x);
2232#endif
2233
2234static 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
2248static SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x) {
2249 return simd_make_double3(__tg_ceil(simd_make_double4_undef(x)));
2250}
2251
2252static 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
2260static 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
2268static 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
2276static 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
2281extern simd_float4 _simd_floor_f4(simd_float4 x);
2282#endif
2283
2284static 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
2298static 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
2306static 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
2315extern simd_double2 _simd_floor_d2(simd_double2 x);
2316#endif
2317
2318static 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
2332static SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x) {
2333 return simd_make_double3(__tg_floor(simd_make_double4_undef(x)));
2334}
2335
2336static 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
2344static 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
2352static 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
2360static 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
2365extern simd_float4 _simd_rint_f4(simd_float4 x);
2366#endif
2367
2368static 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
2382static 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
2390static 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
2399extern simd_double2 _simd_rint_d2(simd_double2 x);
2400#endif
2401
2402static 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
2416static SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x) {
2417 return simd_make_double3(__tg_rint(simd_make_double4_undef(x)));
2418}
2419
2420static 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
2428static 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
2436static 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
2444static 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
2449extern simd_float4 _simd_trunc_f4(simd_float4 x);
2450#endif
2451
2452static 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
2467static 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
2475static 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
2484extern simd_double2 _simd_trunc_d2(simd_double2 x);
2485#endif
2486
2487static 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
2502static SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x) {
2503 return simd_make_double3(__tg_trunc(simd_make_double4_undef(x)));
2504}
2505
2506static 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
2514static 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
2523static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x) {
2524 return simd_make_float2(__tg_sin(simd_make_float4(x)));
2525}
2526
2527static 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
2532extern simd_float4 _simd_sin_f4(simd_float4 x);
2533static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2534 return _simd_sin_f4(x);
2535}
2536#elif SIMD_LIBRARY_VERSION == 1
2537extern simd_float4 __sin_f4(simd_float4 x);
2538static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2539 return __sin_f4(x);
2540}
2541#else
2542static 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__
2548extern simd_float8 _simd_sin_f8(simd_float8 x);
2549static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) {
2550 return _simd_sin_f8(x);
2551}
2552#else
2553static 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__
2559extern simd_float16 _simd_sin_f16(simd_float16 x);
2560static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) {
2561 return _simd_sin_f16(x);
2562}
2563#else
2564static 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
2570extern simd_double2 _simd_sin_d2(simd_double2 x);
2571static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2572 return _simd_sin_d2(x);
2573}
2574#elif SIMD_LIBRARY_VERSION == 1
2575extern simd_double2 __sin_d2(simd_double2 x);
2576static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2577 return __sin_d2(x);
2578}
2579#else
2580static 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
2585static 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__
2590extern simd_double4 _simd_sin_d4(simd_double4 x);
2591static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) {
2592 return _simd_sin_d4(x);
2593}
2594#else
2595static 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__
2601extern simd_double8 _simd_sin_d8(simd_double8 x);
2602static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) {
2603 return _simd_sin_d8(x);
2604}
2605#else
2606static 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
2611static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x) {
2612 return simd_make_float2(__tg_cos(simd_make_float4(x)));
2613}
2614
2615static 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
2620extern simd_float4 _simd_cos_f4(simd_float4 x);
2621static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2622 return _simd_cos_f4(x);
2623}
2624#elif SIMD_LIBRARY_VERSION == 1
2625extern simd_float4 __cos_f4(simd_float4 x);
2626static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2627 return __cos_f4(x);
2628}
2629#else
2630static 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__
2636extern simd_float8 _simd_cos_f8(simd_float8 x);
2637static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) {
2638 return _simd_cos_f8(x);
2639}
2640#else
2641static 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__
2647extern simd_float16 _simd_cos_f16(simd_float16 x);
2648static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) {
2649 return _simd_cos_f16(x);
2650}
2651#else
2652static 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
2658extern simd_double2 _simd_cos_d2(simd_double2 x);
2659static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2660 return _simd_cos_d2(x);
2661}
2662#elif SIMD_LIBRARY_VERSION == 1
2663extern simd_double2 __cos_d2(simd_double2 x);
2664static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2665 return __cos_d2(x);
2666}
2667#else
2668static 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
2673static 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__
2678extern simd_double4 _simd_cos_d4(simd_double4 x);
2679static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) {
2680 return _simd_cos_d4(x);
2681}
2682#else
2683static 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__
2689extern simd_double8 _simd_cos_d8(simd_double8 x);
2690static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) {
2691 return _simd_cos_d8(x);
2692}
2693#else
2694static 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
2701static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x) {
2702 return simd_make_float2(__tg_acos(simd_make_float4(x)));
2703}
2704
2705static 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
2710extern simd_float4 _simd_acos_f4(simd_float4 x);
2711static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) {
2712 return _simd_acos_f4(x);
2713}
2714#else
2715static 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__
2721extern simd_float8 _simd_acos_f8(simd_float8 x);
2722static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) {
2723 return _simd_acos_f8(x);
2724}
2725#else
2726static 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__
2732extern simd_float16 _simd_acos_f16(simd_float16 x);
2733static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) {
2734 return _simd_acos_f16(x);
2735}
2736#else
2737static 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
2743extern simd_double2 _simd_acos_d2(simd_double2 x);
2744static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) {
2745 return _simd_acos_d2(x);
2746}
2747#else
2748static 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
2753static 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__
2758extern simd_double4 _simd_acos_d4(simd_double4 x);
2759static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) {
2760 return _simd_acos_d4(x);
2761}
2762#else
2763static 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__
2769extern simd_double8 _simd_acos_d8(simd_double8 x);
2770static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) {
2771 return _simd_acos_d8(x);
2772}
2773#else
2774static 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
2780static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x) {
2781 return simd_make_float2(__tg_asin(simd_make_float4(x)));
2782}
2783
2784static 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
2789extern simd_float4 _simd_asin_f4(simd_float4 x);
2790static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) {
2791 return _simd_asin_f4(x);
2792}
2793#else
2794static 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__
2800extern simd_float8 _simd_asin_f8(simd_float8 x);
2801static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) {
2802 return _simd_asin_f8(x);
2803}
2804#else
2805static 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__
2811extern simd_float16 _simd_asin_f16(simd_float16 x);
2812static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) {
2813 return _simd_asin_f16(x);
2814}
2815#else
2816static 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
2822extern simd_double2 _simd_asin_d2(simd_double2 x);
2823static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) {
2824 return _simd_asin_d2(x);
2825}
2826#else
2827static 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
2832static 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__
2837extern simd_double4 _simd_asin_d4(simd_double4 x);
2838static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) {
2839 return _simd_asin_d4(x);
2840}
2841#else
2842static 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__
2848extern simd_double8 _simd_asin_d8(simd_double8 x);
2849static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) {
2850 return _simd_asin_d8(x);
2851}
2852#else
2853static 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
2859static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x) {
2860 return simd_make_float2(__tg_atan(simd_make_float4(x)));
2861}
2862
2863static 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
2868extern simd_float4 _simd_atan_f4(simd_float4 x);
2869static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) {
2870 return _simd_atan_f4(x);
2871}
2872#else
2873static 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__
2879extern simd_float8 _simd_atan_f8(simd_float8 x);
2880static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) {
2881 return _simd_atan_f8(x);
2882}
2883#else
2884static 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__
2890extern simd_float16 _simd_atan_f16(simd_float16 x);
2891static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) {
2892 return _simd_atan_f16(x);
2893}
2894#else
2895static 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
2901extern simd_double2 _simd_atan_d2(simd_double2 x);
2902static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) {
2903 return _simd_atan_d2(x);
2904}
2905#else
2906static 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
2911static 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__
2916extern simd_double4 _simd_atan_d4(simd_double4 x);
2917static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) {
2918 return _simd_atan_d4(x);
2919}
2920#else
2921static 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__
2927extern simd_double8 _simd_atan_d8(simd_double8 x);
2928static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) {
2929 return _simd_atan_d8(x);
2930}
2931#else
2932static 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
2938static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x) {
2939 return simd_make_float2(__tg_tan(simd_make_float4(x)));
2940}
2941
2942static 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
2947extern simd_float4 _simd_tan_f4(simd_float4 x);
2948static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) {
2949 return _simd_tan_f4(x);
2950}
2951#else
2952static 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__
2958extern simd_float8 _simd_tan_f8(simd_float8 x);
2959static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) {
2960 return _simd_tan_f8(x);
2961}
2962#else
2963static 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__
2969extern simd_float16 _simd_tan_f16(simd_float16 x);
2970static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) {
2971 return _simd_tan_f16(x);
2972}
2973#else
2974static 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
2980extern simd_double2 _simd_tan_d2(simd_double2 x);
2981static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) {
2982 return _simd_tan_d2(x);
2983}
2984#else
2985static 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
2990static 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__
2995extern simd_double4 _simd_tan_d4(simd_double4 x);
2996static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) {
2997 return _simd_tan_d4(x);
2998}
2999#else
3000static 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__
3006extern simd_double8 _simd_tan_d8(simd_double8 x);
3007static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) {
3008 return _simd_tan_d8(x);
3009}
3010#else
3011static 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
3018static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x) {
3019 return simd_make_float2(__tg_cospi(simd_make_float4(x)));
3020}
3021
3022static 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
3027extern simd_float4 _simd_cospi_f4(simd_float4 x);
3028static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) {
3029 return _simd_cospi_f4(x);
3030}
3031#else
3032static 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__
3038extern simd_float8 _simd_cospi_f8(simd_float8 x);
3039static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) {
3040 return _simd_cospi_f8(x);
3041}
3042#else
3043static 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__
3049extern simd_float16 _simd_cospi_f16(simd_float16 x);
3050static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) {
3051 return _simd_cospi_f16(x);
3052}
3053#else
3054static 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
3060extern simd_double2 _simd_cospi_d2(simd_double2 x);
3061static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) {
3062 return _simd_cospi_d2(x);
3063}
3064#else
3065static 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
3070static 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__
3075extern simd_double4 _simd_cospi_d4(simd_double4 x);
3076static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) {
3077 return _simd_cospi_d4(x);
3078}
3079#else
3080static 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__
3086extern simd_double8 _simd_cospi_d8(simd_double8 x);
3087static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) {
3088 return _simd_cospi_d8(x);
3089}
3090#else
3091static 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
3099static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x) {
3100 return simd_make_float2(__tg_sinpi(simd_make_float4(x)));
3101}
3102
3103static 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
3108extern simd_float4 _simd_sinpi_f4(simd_float4 x);
3109static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) {
3110 return _simd_sinpi_f4(x);
3111}
3112#else
3113static 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__
3119extern simd_float8 _simd_sinpi_f8(simd_float8 x);
3120static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) {
3121 return _simd_sinpi_f8(x);
3122}
3123#else
3124static 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__
3130extern simd_float16 _simd_sinpi_f16(simd_float16 x);
3131static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) {
3132 return _simd_sinpi_f16(x);
3133}
3134#else
3135static 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
3141extern simd_double2 _simd_sinpi_d2(simd_double2 x);
3142static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) {
3143 return _simd_sinpi_d2(x);
3144}
3145#else
3146static 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
3151static 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__
3156extern simd_double4 _simd_sinpi_d4(simd_double4 x);
3157static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) {
3158 return _simd_sinpi_d4(x);
3159}
3160#else
3161static 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__
3167extern simd_double8 _simd_sinpi_d8(simd_double8 x);
3168static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) {
3169 return _simd_sinpi_d8(x);
3170}
3171#else
3172static 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
3180static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x) {
3181 return simd_make_float2(__tg_tanpi(simd_make_float4(x)));
3182}
3183
3184static 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
3189extern simd_float4 _simd_tanpi_f4(simd_float4 x);
3190static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) {
3191 return _simd_tanpi_f4(x);
3192}
3193#else
3194static 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__
3200extern simd_float8 _simd_tanpi_f8(simd_float8 x);
3201static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) {
3202 return _simd_tanpi_f8(x);
3203}
3204#else
3205static 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__
3211extern simd_float16 _simd_tanpi_f16(simd_float16 x);
3212static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) {
3213 return _simd_tanpi_f16(x);
3214}
3215#else
3216static 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
3222extern simd_double2 _simd_tanpi_d2(simd_double2 x);
3223static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) {
3224 return _simd_tanpi_d2(x);
3225}
3226#else
3227static 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
3232static 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__
3237extern simd_double4 _simd_tanpi_d4(simd_double4 x);
3238static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) {
3239 return _simd_tanpi_d4(x);
3240}
3241#else
3242static 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__
3248extern simd_double8 _simd_tanpi_d8(simd_double8 x);
3249static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) {
3250 return _simd_tanpi_d8(x);
3251}
3252#else
3253static 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
3260static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x) {
3261 return simd_make_float2(__tg_acosh(simd_make_float4(x)));
3262}
3263
3264static 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
3269extern simd_float4 _simd_acosh_f4(simd_float4 x);
3270static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) {
3271 return _simd_acosh_f4(x);
3272}
3273#else
3274static 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__
3280extern simd_float8 _simd_acosh_f8(simd_float8 x);
3281static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) {
3282 return _simd_acosh_f8(x);
3283}
3284#else
3285static 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__
3291extern simd_float16 _simd_acosh_f16(simd_float16 x);
3292static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) {
3293 return _simd_acosh_f16(x);
3294}
3295#else
3296static 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
3302extern simd_double2 _simd_acosh_d2(simd_double2 x);
3303static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) {
3304 return _simd_acosh_d2(x);
3305}
3306#else
3307static 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
3312static 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__
3317extern simd_double4 _simd_acosh_d4(simd_double4 x);
3318static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) {
3319 return _simd_acosh_d4(x);
3320}
3321#else
3322static 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__
3328extern simd_double8 _simd_acosh_d8(simd_double8 x);
3329static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) {
3330 return _simd_acosh_d8(x);
3331}
3332#else
3333static 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
3339static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x) {
3340 return simd_make_float2(__tg_asinh(simd_make_float4(x)));
3341}
3342
3343static 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
3348extern simd_float4 _simd_asinh_f4(simd_float4 x);
3349static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) {
3350 return _simd_asinh_f4(x);
3351}
3352#else
3353static 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__
3359extern simd_float8 _simd_asinh_f8(simd_float8 x);
3360static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) {
3361 return _simd_asinh_f8(x);
3362}
3363#else
3364static 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__
3370extern simd_float16 _simd_asinh_f16(simd_float16 x);
3371static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) {
3372 return _simd_asinh_f16(x);
3373}
3374#else
3375static 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
3381extern simd_double2 _simd_asinh_d2(simd_double2 x);
3382static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) {
3383 return _simd_asinh_d2(x);
3384}
3385#else
3386static 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
3391static 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__
3396extern simd_double4 _simd_asinh_d4(simd_double4 x);
3397static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) {
3398 return _simd_asinh_d4(x);
3399}
3400#else
3401static 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__
3407extern simd_double8 _simd_asinh_d8(simd_double8 x);
3408static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) {
3409 return _simd_asinh_d8(x);
3410}
3411#else
3412static 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
3418static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x) {
3419 return simd_make_float2(__tg_atanh(simd_make_float4(x)));
3420}
3421
3422static 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
3427extern simd_float4 _simd_atanh_f4(simd_float4 x);
3428static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) {
3429 return _simd_atanh_f4(x);
3430}
3431#else
3432static 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__
3438extern simd_float8 _simd_atanh_f8(simd_float8 x);
3439static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) {
3440 return _simd_atanh_f8(x);
3441}
3442#else
3443static 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__
3449extern simd_float16 _simd_atanh_f16(simd_float16 x);
3450static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) {
3451 return _simd_atanh_f16(x);
3452}
3453#else
3454static 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
3460extern simd_double2 _simd_atanh_d2(simd_double2 x);
3461static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) {
3462 return _simd_atanh_d2(x);
3463}
3464#else
3465static 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
3470static 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__
3475extern simd_double4 _simd_atanh_d4(simd_double4 x);
3476static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) {
3477 return _simd_atanh_d4(x);
3478}
3479#else
3480static 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__
3486extern simd_double8 _simd_atanh_d8(simd_double8 x);
3487static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) {
3488 return _simd_atanh_d8(x);
3489}
3490#else
3491static 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
3497static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x) {
3498 return simd_make_float2(__tg_cosh(simd_make_float4(x)));
3499}
3500
3501static 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
3506extern simd_float4 _simd_cosh_f4(simd_float4 x);
3507static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) {
3508 return _simd_cosh_f4(x);
3509}
3510#else
3511static 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__
3517extern simd_float8 _simd_cosh_f8(simd_float8 x);
3518static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) {
3519 return _simd_cosh_f8(x);
3520}
3521#else
3522static 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__
3528extern simd_float16 _simd_cosh_f16(simd_float16 x);
3529static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) {
3530 return _simd_cosh_f16(x);
3531}
3532#else
3533static 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
3539extern simd_double2 _simd_cosh_d2(simd_double2 x);
3540static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) {
3541 return _simd_cosh_d2(x);
3542}
3543#else
3544static 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
3549static 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__
3554extern simd_double4 _simd_cosh_d4(simd_double4 x);
3555static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) {
3556 return _simd_cosh_d4(x);
3557}
3558#else
3559static 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__
3565extern simd_double8 _simd_cosh_d8(simd_double8 x);
3566static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) {
3567 return _simd_cosh_d8(x);
3568}
3569#else
3570static 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
3576static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x) {
3577 return simd_make_float2(__tg_sinh(simd_make_float4(x)));
3578}
3579
3580static 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
3585extern simd_float4 _simd_sinh_f4(simd_float4 x);
3586static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) {
3587 return _simd_sinh_f4(x);
3588}
3589#else
3590static 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__
3596extern simd_float8 _simd_sinh_f8(simd_float8 x);
3597static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) {
3598 return _simd_sinh_f8(x);
3599}
3600#else
3601static 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__
3607extern simd_float16 _simd_sinh_f16(simd_float16 x);
3608static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) {
3609 return _simd_sinh_f16(x);
3610}
3611#else
3612static 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
3618extern simd_double2 _simd_sinh_d2(simd_double2 x);
3619static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) {
3620 return _simd_sinh_d2(x);
3621}
3622#else
3623static 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
3628static 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__
3633extern simd_double4 _simd_sinh_d4(simd_double4 x);
3634static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) {
3635 return _simd_sinh_d4(x);
3636}
3637#else
3638static 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__
3644extern simd_double8 _simd_sinh_d8(simd_double8 x);
3645static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) {
3646 return _simd_sinh_d8(x);
3647}
3648#else
3649static 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
3655static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x) {
3656 return simd_make_float2(__tg_tanh(simd_make_float4(x)));
3657}
3658
3659static 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
3664extern simd_float4 _simd_tanh_f4(simd_float4 x);
3665static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) {
3666 return _simd_tanh_f4(x);
3667}
3668#else
3669static 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__
3675extern simd_float8 _simd_tanh_f8(simd_float8 x);
3676static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) {
3677 return _simd_tanh_f8(x);
3678}
3679#else
3680static 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__
3686extern simd_float16 _simd_tanh_f16(simd_float16 x);
3687static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) {
3688 return _simd_tanh_f16(x);
3689}
3690#else
3691static 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
3697extern simd_double2 _simd_tanh_d2(simd_double2 x);
3698static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) {
3699 return _simd_tanh_d2(x);
3700}
3701#else
3702static 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
3707static 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__
3712extern simd_double4 _simd_tanh_d4(simd_double4 x);
3713static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) {
3714 return _simd_tanh_d4(x);
3715}
3716#else
3717static 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__
3723extern simd_double8 _simd_tanh_d8(simd_double8 x);
3724static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) {
3725 return _simd_tanh_d8(x);
3726}
3727#else
3728static 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
3734static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x) {
3735 return simd_make_float2(__tg_exp(simd_make_float4(x)));
3736}
3737
3738static 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
3743extern simd_float4 _simd_exp_f4(simd_float4 x);
3744static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) {
3745 return _simd_exp_f4(x);
3746}
3747#else
3748static 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__
3754extern simd_float8 _simd_exp_f8(simd_float8 x);
3755static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) {
3756 return _simd_exp_f8(x);
3757}
3758#else
3759static 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__
3765extern simd_float16 _simd_exp_f16(simd_float16 x);
3766static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) {
3767 return _simd_exp_f16(x);
3768}
3769#else
3770static 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
3776extern simd_double2 _simd_exp_d2(simd_double2 x);
3777static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) {
3778 return _simd_exp_d2(x);
3779}
3780#else
3781static 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
3786static 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__
3791extern simd_double4 _simd_exp_d4(simd_double4 x);
3792static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) {
3793 return _simd_exp_d4(x);
3794}
3795#else
3796static 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__
3802extern simd_double8 _simd_exp_d8(simd_double8 x);
3803static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) {
3804 return _simd_exp_d8(x);
3805}
3806#else
3807static 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
3813static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x) {
3814 return simd_make_float2(__tg_exp2(simd_make_float4(x)));
3815}
3816
3817static 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
3822extern simd_float4 _simd_exp2_f4(simd_float4 x);
3823static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) {
3824 return _simd_exp2_f4(x);
3825}
3826#else
3827static 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__
3833extern simd_float8 _simd_exp2_f8(simd_float8 x);
3834static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) {
3835 return _simd_exp2_f8(x);
3836}
3837#else
3838static 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__
3844extern simd_float16 _simd_exp2_f16(simd_float16 x);
3845static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) {
3846 return _simd_exp2_f16(x);
3847}
3848#else
3849static 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
3855extern simd_double2 _simd_exp2_d2(simd_double2 x);
3856static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) {
3857 return _simd_exp2_d2(x);
3858}
3859#else
3860static 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
3865static 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__
3870extern simd_double4 _simd_exp2_d4(simd_double4 x);
3871static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) {
3872 return _simd_exp2_d4(x);
3873}
3874#else
3875static 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__
3881extern simd_double8 _simd_exp2_d8(simd_double8 x);
3882static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) {
3883 return _simd_exp2_d8(x);
3884}
3885#else
3886static 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
3893static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x) {
3894 return simd_make_float2(__tg_exp10(simd_make_float4(x)));
3895}
3896
3897static 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
3902extern simd_float4 _simd_exp10_f4(simd_float4 x);
3903static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) {
3904 return _simd_exp10_f4(x);
3905}
3906#else
3907static 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__
3913extern simd_float8 _simd_exp10_f8(simd_float8 x);
3914static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) {
3915 return _simd_exp10_f8(x);
3916}
3917#else
3918static 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__
3924extern simd_float16 _simd_exp10_f16(simd_float16 x);
3925static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) {
3926 return _simd_exp10_f16(x);
3927}
3928#else
3929static 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
3935extern simd_double2 _simd_exp10_d2(simd_double2 x);
3936static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) {
3937 return _simd_exp10_d2(x);
3938}
3939#else
3940static 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
3945static 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__
3950extern simd_double4 _simd_exp10_d4(simd_double4 x);
3951static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) {
3952 return _simd_exp10_d4(x);
3953}
3954#else
3955static 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__
3961extern simd_double8 _simd_exp10_d8(simd_double8 x);
3962static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) {
3963 return _simd_exp10_d8(x);
3964}
3965#else
3966static 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
3973static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x) {
3974 return simd_make_float2(__tg_expm1(simd_make_float4(x)));
3975}
3976
3977static 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
3982extern simd_float4 _simd_expm1_f4(simd_float4 x);
3983static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) {
3984 return _simd_expm1_f4(x);
3985}
3986#else
3987static 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__
3993extern simd_float8 _simd_expm1_f8(simd_float8 x);
3994static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) {
3995 return _simd_expm1_f8(x);
3996}
3997#else
3998static 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__
4004extern simd_float16 _simd_expm1_f16(simd_float16 x);
4005static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) {
4006 return _simd_expm1_f16(x);
4007}
4008#else
4009static 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
4015extern simd_double2 _simd_expm1_d2(simd_double2 x);
4016static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) {
4017 return _simd_expm1_d2(x);
4018}
4019#else
4020static 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
4025static 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__
4030extern simd_double4 _simd_expm1_d4(simd_double4 x);
4031static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) {
4032 return _simd_expm1_d4(x);
4033}
4034#else
4035static 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__
4041extern simd_double8 _simd_expm1_d8(simd_double8 x);
4042static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) {
4043 return _simd_expm1_d8(x);
4044}
4045#else
4046static 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
4052static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x) {
4053 return simd_make_float2(__tg_log(simd_make_float4(x)));
4054}
4055
4056static 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
4061extern simd_float4 _simd_log_f4(simd_float4 x);
4062static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) {
4063 return _simd_log_f4(x);
4064}
4065#else
4066static 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__
4072extern simd_float8 _simd_log_f8(simd_float8 x);
4073static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) {
4074 return _simd_log_f8(x);
4075}
4076#else
4077static 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__
4083extern simd_float16 _simd_log_f16(simd_float16 x);
4084static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) {
4085 return _simd_log_f16(x);
4086}
4087#else
4088static 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
4094extern simd_double2 _simd_log_d2(simd_double2 x);
4095static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) {
4096 return _simd_log_d2(x);
4097}
4098#else
4099static 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
4104static 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__
4109extern simd_double4 _simd_log_d4(simd_double4 x);
4110static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) {
4111 return _simd_log_d4(x);
4112}
4113#else
4114static 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__
4120extern simd_double8 _simd_log_d8(simd_double8 x);
4121static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) {
4122 return _simd_log_d8(x);
4123}
4124#else
4125static 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
4131static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x) {
4132 return simd_make_float2(__tg_log2(simd_make_float4(x)));
4133}
4134
4135static 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
4140extern simd_float4 _simd_log2_f4(simd_float4 x);
4141static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) {
4142 return _simd_log2_f4(x);
4143}
4144#else
4145static 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__
4151extern simd_float8 _simd_log2_f8(simd_float8 x);
4152static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) {
4153 return _simd_log2_f8(x);
4154}
4155#else
4156static 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__
4162extern simd_float16 _simd_log2_f16(simd_float16 x);
4163static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) {
4164 return _simd_log2_f16(x);
4165}
4166#else
4167static 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
4173extern simd_double2 _simd_log2_d2(simd_double2 x);
4174static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) {
4175 return _simd_log2_d2(x);
4176}
4177#else
4178static 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
4183static 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__
4188extern simd_double4 _simd_log2_d4(simd_double4 x);
4189static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) {
4190 return _simd_log2_d4(x);
4191}
4192#else
4193static 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__
4199extern simd_double8 _simd_log2_d8(simd_double8 x);
4200static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) {
4201 return _simd_log2_d8(x);
4202}
4203#else
4204static 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
4210static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x) {
4211 return simd_make_float2(__tg_log10(simd_make_float4(x)));
4212}
4213
4214static 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
4219extern simd_float4 _simd_log10_f4(simd_float4 x);
4220static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) {
4221 return _simd_log10_f4(x);
4222}
4223#else
4224static 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__
4230extern simd_float8 _simd_log10_f8(simd_float8 x);
4231static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) {
4232 return _simd_log10_f8(x);
4233}
4234#else
4235static 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__
4241extern simd_float16 _simd_log10_f16(simd_float16 x);
4242static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) {
4243 return _simd_log10_f16(x);
4244}
4245#else
4246static 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
4252extern simd_double2 _simd_log10_d2(simd_double2 x);
4253static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) {
4254 return _simd_log10_d2(x);
4255}
4256#else
4257static 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
4262static 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__
4267extern simd_double4 _simd_log10_d4(simd_double4 x);
4268static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) {
4269 return _simd_log10_d4(x);
4270}
4271#else
4272static 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__
4278extern simd_double8 _simd_log10_d8(simd_double8 x);
4279static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) {
4280 return _simd_log10_d8(x);
4281}
4282#else
4283static 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
4289static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x) {
4290 return simd_make_float2(__tg_log1p(simd_make_float4(x)));
4291}
4292
4293static 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
4298extern simd_float4 _simd_log1p_f4(simd_float4 x);
4299static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) {
4300 return _simd_log1p_f4(x);
4301}
4302#else
4303static 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__
4309extern simd_float8 _simd_log1p_f8(simd_float8 x);
4310static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) {
4311 return _simd_log1p_f8(x);
4312}
4313#else
4314static 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__
4320extern simd_float16 _simd_log1p_f16(simd_float16 x);
4321static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) {
4322 return _simd_log1p_f16(x);
4323}
4324#else
4325static 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
4331extern simd_double2 _simd_log1p_d2(simd_double2 x);
4332static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) {
4333 return _simd_log1p_d2(x);
4334}
4335#else
4336static 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
4341static 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__
4346extern simd_double4 _simd_log1p_d4(simd_double4 x);
4347static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) {
4348 return _simd_log1p_d4(x);
4349}
4350#else
4351static 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__
4357extern simd_double8 _simd_log1p_d8(simd_double8 x);
4358static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) {
4359 return _simd_log1p_d8(x);
4360}
4361#else
4362static 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
4368static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x) {
4369 return simd_make_float2(__tg_cbrt(simd_make_float4(x)));
4370}
4371
4372static 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
4377extern simd_float4 _simd_cbrt_f4(simd_float4 x);
4378static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) {
4379 return _simd_cbrt_f4(x);
4380}
4381#else
4382static 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__
4388extern simd_float8 _simd_cbrt_f8(simd_float8 x);
4389static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) {
4390 return _simd_cbrt_f8(x);
4391}
4392#else
4393static 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__
4399extern simd_float16 _simd_cbrt_f16(simd_float16 x);
4400static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) {
4401 return _simd_cbrt_f16(x);
4402}
4403#else
4404static 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
4410extern simd_double2 _simd_cbrt_d2(simd_double2 x);
4411static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) {
4412 return _simd_cbrt_d2(x);
4413}
4414#else
4415static 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
4420static 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__
4425extern simd_double4 _simd_cbrt_d4(simd_double4 x);
4426static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) {
4427 return _simd_cbrt_d4(x);
4428}
4429#else
4430static 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__
4436extern simd_double8 _simd_cbrt_d8(simd_double8 x);
4437static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) {
4438 return _simd_cbrt_d8(x);
4439}
4440#else
4441static 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
4447static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x) {
4448 return simd_make_float2(__tg_erf(simd_make_float4(x)));
4449}
4450
4451static 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
4456extern simd_float4 _simd_erf_f4(simd_float4 x);
4457static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) {
4458 return _simd_erf_f4(x);
4459}
4460#else
4461static 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__
4467extern simd_float8 _simd_erf_f8(simd_float8 x);
4468static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) {
4469 return _simd_erf_f8(x);
4470}
4471#else
4472static 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__
4478extern simd_float16 _simd_erf_f16(simd_float16 x);
4479static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) {
4480 return _simd_erf_f16(x);
4481}
4482#else
4483static 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
4489extern simd_double2 _simd_erf_d2(simd_double2 x);
4490static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) {
4491 return _simd_erf_d2(x);
4492}
4493#else
4494static 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
4499static 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__
4504extern simd_double4 _simd_erf_d4(simd_double4 x);
4505static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) {
4506 return _simd_erf_d4(x);
4507}
4508#else
4509static 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__
4515extern simd_double8 _simd_erf_d8(simd_double8 x);
4516static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) {
4517 return _simd_erf_d8(x);
4518}
4519#else
4520static 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
4526static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x) {
4527 return simd_make_float2(__tg_erfc(simd_make_float4(x)));
4528}
4529
4530static 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
4535extern simd_float4 _simd_erfc_f4(simd_float4 x);
4536static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) {
4537 return _simd_erfc_f4(x);
4538}
4539#else
4540static 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__
4546extern simd_float8 _simd_erfc_f8(simd_float8 x);
4547static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) {
4548 return _simd_erfc_f8(x);
4549}
4550#else
4551static 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__
4557extern simd_float16 _simd_erfc_f16(simd_float16 x);
4558static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) {
4559 return _simd_erfc_f16(x);
4560}
4561#else
4562static 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
4568extern simd_double2 _simd_erfc_d2(simd_double2 x);
4569static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) {
4570 return _simd_erfc_d2(x);
4571}
4572#else
4573static 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
4578static 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__
4583extern simd_double4 _simd_erfc_d4(simd_double4 x);
4584static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) {
4585 return _simd_erfc_d4(x);
4586}
4587#else
4588static 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__
4594extern simd_double8 _simd_erfc_d8(simd_double8 x);
4595static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) {
4596 return _simd_erfc_d8(x);
4597}
4598#else
4599static 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
4605static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x) {
4606 return simd_make_float2(__tg_tgamma(simd_make_float4(x)));
4607}
4608
4609static 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
4614extern simd_float4 _simd_tgamma_f4(simd_float4 x);
4615static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) {
4616 return _simd_tgamma_f4(x);
4617}
4618#else
4619static 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__
4625extern simd_float8 _simd_tgamma_f8(simd_float8 x);
4626static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) {
4627 return _simd_tgamma_f8(x);
4628}
4629#else
4630static 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__
4636extern simd_float16 _simd_tgamma_f16(simd_float16 x);
4637static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) {
4638 return _simd_tgamma_f16(x);
4639}
4640#else
4641static 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
4647extern simd_double2 _simd_tgamma_d2(simd_double2 x);
4648static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) {
4649 return _simd_tgamma_d2(x);
4650}
4651#else
4652static 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
4657static 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__
4662extern simd_double4 _simd_tgamma_d4(simd_double4 x);
4663static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) {
4664 return _simd_tgamma_d4(x);
4665}
4666#else
4667static 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__
4673extern simd_double8 _simd_tgamma_d8(simd_double8 x);
4674static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) {
4675 return _simd_tgamma_d8(x);
4676}
4677#else
4678static 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
4684static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x) {
4685 return simd_make_float2(__tg_round(simd_make_float4(x)));
4686}
4687
4688static 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
4693extern simd_float4 _simd_round_f4(simd_float4 x);
4694static 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
4702static 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__
4708extern simd_float8 _simd_round_f8(simd_float8 x);
4709static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) {
4710 return _simd_round_f8(x);
4711}
4712#else
4713static 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__
4719extern simd_float16 _simd_round_f16(simd_float16 x);
4720static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
4721 return _simd_round_f16(x);
4722}
4723#else
4724static 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
4730extern simd_double2 _simd_round_d2(simd_double2 x);
4731static 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
4739static 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
4744static 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__
4749extern simd_double4 _simd_round_d4(simd_double4 x);
4750static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) {
4751 return _simd_round_d4(x);
4752}
4753#else
4754static 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__
4760extern simd_double8 _simd_round_d8(simd_double8 x);
4761static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) {
4762 return _simd_round_d8(x);
4763}
4764#else
4765static 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
4771static 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
4775static 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
4780extern simd_float4 _simd_atan2_f4(simd_float4 y, simd_float4 x);
4781static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) {
4782 return _simd_atan2_f4(y, x);
4783}
4784#else
4785static 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__
4791extern simd_float8 _simd_atan2_f8(simd_float8 y, simd_float8 x);
4792static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) {
4793 return _simd_atan2_f8(y, x);
4794}
4795#else
4796static 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__
4802extern simd_float16 _simd_atan2_f16(simd_float16 y, simd_float16 x);
4803static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) {
4804 return _simd_atan2_f16(y, x);
4805}
4806#else
4807static 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
4813extern simd_double2 _simd_atan2_d2(simd_double2 y, simd_double2 x);
4814static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) {
4815 return _simd_atan2_d2(y, x);
4816}
4817#else
4818static 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
4823static 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__
4828extern simd_double4 _simd_atan2_d4(simd_double4 y, simd_double4 x);
4829static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) {
4830 return _simd_atan2_d4(y, x);
4831}
4832#else
4833static 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__
4839extern simd_double8 _simd_atan2_d8(simd_double8 y, simd_double8 x);
4840static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) {
4841 return _simd_atan2_d8(y, x);
4842}
4843#else
4844static 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
4850static 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
4854static 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
4859extern simd_float4 _simd_hypot_f4(simd_float4 x, simd_float4 y);
4860static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) {
4861 return _simd_hypot_f4(x, y);
4862}
4863#else
4864static 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__
4870extern simd_float8 _simd_hypot_f8(simd_float8 x, simd_float8 y);
4871static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) {
4872 return _simd_hypot_f8(x, y);
4873}
4874#else
4875static 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__
4881extern simd_float16 _simd_hypot_f16(simd_float16 x, simd_float16 y);
4882static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) {
4883 return _simd_hypot_f16(x, y);
4884}
4885#else
4886static 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
4892extern simd_double2 _simd_hypot_d2(simd_double2 x, simd_double2 y);
4893static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) {
4894 return _simd_hypot_d2(x, y);
4895}
4896#else
4897static 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
4902static 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__
4907extern simd_double4 _simd_hypot_d4(simd_double4 x, simd_double4 y);
4908static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) {
4909 return _simd_hypot_d4(x, y);
4910}
4911#else
4912static 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__
4918extern simd_double8 _simd_hypot_d8(simd_double8 x, simd_double8 y);
4919static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) {
4920 return _simd_hypot_d8(x, y);
4921}
4922#else
4923static 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
4929static 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
4933static 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
4938extern simd_float4 _simd_pow_f4(simd_float4 x, simd_float4 y);
4939static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) {
4940 return _simd_pow_f4(x, y);
4941}
4942#else
4943static 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__
4949extern simd_float8 _simd_pow_f8(simd_float8 x, simd_float8 y);
4950static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) {
4951 return _simd_pow_f8(x, y);
4952}
4953#else
4954static 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__
4960extern simd_float16 _simd_pow_f16(simd_float16 x, simd_float16 y);
4961static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) {
4962 return _simd_pow_f16(x, y);
4963}
4964#else
4965static 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
4971extern simd_double2 _simd_pow_d2(simd_double2 x, simd_double2 y);
4972static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) {
4973 return _simd_pow_d2(x, y);
4974}
4975#else
4976static 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
4981static 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__
4986extern simd_double4 _simd_pow_d4(simd_double4 x, simd_double4 y);
4987static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) {
4988 return _simd_pow_d4(x, y);
4989}
4990#else
4991static 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__
4997extern simd_double8 _simd_pow_d8(simd_double8 x, simd_double8 y);
4998static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) {
4999 return _simd_pow_d8(x, y);
5000}
5001#else
5002static 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
5008static 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
5012static 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
5017extern simd_float4 _simd_fmod_f4(simd_float4 x, simd_float4 y);
5018static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) {
5019 return _simd_fmod_f4(x, y);
5020}
5021#else
5022static 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__
5028extern simd_float8 _simd_fmod_f8(simd_float8 x, simd_float8 y);
5029static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) {
5030 return _simd_fmod_f8(x, y);
5031}
5032#else
5033static 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__
5039extern simd_float16 _simd_fmod_f16(simd_float16 x, simd_float16 y);
5040static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) {
5041 return _simd_fmod_f16(x, y);
5042}
5043#else
5044static 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
5050extern simd_double2 _simd_fmod_d2(simd_double2 x, simd_double2 y);
5051static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) {
5052 return _simd_fmod_d2(x, y);
5053}
5054#else
5055static 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
5060static 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__
5065extern simd_double4 _simd_fmod_d4(simd_double4 x, simd_double4 y);
5066static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) {
5067 return _simd_fmod_d4(x, y);
5068}
5069#else
5070static 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__
5076extern simd_double8 _simd_fmod_d8(simd_double8 x, simd_double8 y);
5077static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) {
5078 return _simd_fmod_d8(x, y);
5079}
5080#else
5081static 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
5087static 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
5091static 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
5096extern simd_float4 _simd_remainder_f4(simd_float4 x, simd_float4 y);
5097static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) {
5098 return _simd_remainder_f4(x, y);
5099}
5100#else
5101static 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__
5107extern simd_float8 _simd_remainder_f8(simd_float8 x, simd_float8 y);
5108static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) {
5109 return _simd_remainder_f8(x, y);
5110}
5111#else
5112static 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__
5118extern simd_float16 _simd_remainder_f16(simd_float16 x, simd_float16 y);
5119static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) {
5120 return _simd_remainder_f16(x, y);
5121}
5122#else
5123static 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
5129extern simd_double2 _simd_remainder_d2(simd_double2 x, simd_double2 y);
5130static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) {
5131 return _simd_remainder_d2(x, y);
5132}
5133#else
5134static 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
5139static 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__
5144extern simd_double4 _simd_remainder_d4(simd_double4 x, simd_double4 y);
5145static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) {
5146 return _simd_remainder_d4(x, y);
5147}
5148#else
5149static 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__
5155extern simd_double8 _simd_remainder_d8(simd_double8 x, simd_double8 y);
5156static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) {
5157 return _simd_remainder_d8(x, y);
5158}
5159#else
5160static 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
5166static 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
5170static 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
5175extern simd_float4 _simd_nextafter_f4(simd_float4 x, simd_float4 y);
5176static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) {
5177 return _simd_nextafter_f4(x, y);
5178}
5179#else
5180static 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__
5186extern simd_float8 _simd_nextafter_f8(simd_float8 x, simd_float8 y);
5187static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) {
5188 return _simd_nextafter_f8(x, y);
5189}
5190#else
5191static 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__
5197extern simd_float16 _simd_nextafter_f16(simd_float16 x, simd_float16 y);
5198static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) {
5199 return _simd_nextafter_f16(x, y);
5200}
5201#else
5202static 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
5208extern simd_double2 _simd_nextafter_d2(simd_double2 x, simd_double2 y);
5209static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) {
5210 return _simd_nextafter_d2(x, y);
5211}
5212#else
5213static 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
5218static 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__
5223extern simd_double4 _simd_nextafter_d4(simd_double4 x, simd_double4 y);
5224static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) {
5225 return _simd_nextafter_d4(x, y);
5226}
5227#else
5228static 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__
5234extern simd_double8 _simd_nextafter_d8(simd_double8 x, simd_double8 y);
5235static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) {
5236 return _simd_nextafter_d8(x, y);
5237}
5238#else
5239static 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
5244static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y) { return simd_bitselect(x-y, 0, x<y); }
5245static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y) { return simd_bitselect(x-y, 0, x<y); }
5246static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y) { return simd_bitselect(x-y, 0, x<y); }
5247static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y) { return simd_bitselect(x-y, 0, x<y); }
5248static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y) { return simd_bitselect(x-y, 0, x<y); }
5249static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y) { return simd_bitselect(x-y, 0, x<y); }
5250static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y) { return simd_bitselect(x-y, 0, x<y); }
5251static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y) { return simd_bitselect(x-y, 0, x<y); }
5252static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); }
5253
5254static 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
5262static 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
5267extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z);
5268#endif
5269static 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
5281static 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
5289static 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
5298extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z);
5299#endif
5300static 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
5312static 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
5316static 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
5324static 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
5332static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) {
5333#pragma STDC FP_CONTRACT ON
5334 return x*y + z;
5335}
5336static 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}
5340static 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}
5344static 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}
5348static 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}
5352static 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}
5356static inline SIMD_CFUNC double simd_muladd(double x, double y, double z) {
5357#pragma STDC FP_CONTRACT ON
5358 return x*y + z;
5359}
5360static 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}
5364static 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}
5368static 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}
5372static 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/aarch64-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
92extern const simd_float2x2 matrix_identity_float2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
93extern const simd_float3x3 matrix_identity_float3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
94extern const simd_float4x4 matrix_identity_float4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
95extern const simd_double2x2 matrix_identity_double2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
96extern const simd_double3x3 matrix_identity_double3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
97extern const simd_double4x4 matrix_identity_double4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
98
99static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x);
100static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x);
101static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x);
102static simd_double2x2 SIMD_CFUNC simd_diagonal_matrix(simd_double2 __x);
103static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x);
104static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x);
105#define matrix_from_diagonal simd_diagonal_matrix
106
107static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1);
108static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2);
109static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3);
110static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1);
111static simd_float3x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2);
112static simd_float4x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2, simd_float3 col3);
113static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1);
114static simd_float3x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2);
115static simd_float4x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2, simd_float4 col3);
116static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1);
117static simd_double3x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2);
118static simd_double4x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2, simd_double2 col3);
119static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1);
120static simd_double3x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2);
121static simd_double4x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2, simd_double3 col3);
122static simd_double2x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1);
123static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2);
124static 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
127static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1);
128static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2);
129static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3);
130static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1);
131static simd_float3x3 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2);
132static simd_float3x4 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2, simd_float3 row3);
133static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1);
134static simd_float4x3 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2);
135static simd_float4x4 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2, simd_float4 row3);
136static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1);
137static simd_double2x3 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2);
138static simd_double2x4 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2, simd_double2 row3);
139static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1);
140static simd_double3x3 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2);
141static simd_double3x4 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2, simd_double3 row3);
142static simd_double4x2 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1);
143static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2);
144static 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
147static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);
148static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);
149static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);
150static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);
151
152static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x);
153static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x);
154static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x);
155static simd_float2x3 SIMD_CFUNC simd_mul(float __a, simd_float2x3 __x);
156static simd_float3x3 SIMD_CFUNC simd_mul(float __a, simd_float3x3 __x);
157static simd_float4x3 SIMD_CFUNC simd_mul(float __a, simd_float4x3 __x);
158static simd_float2x4 SIMD_CFUNC simd_mul(float __a, simd_float2x4 __x);
159static simd_float3x4 SIMD_CFUNC simd_mul(float __a, simd_float3x4 __x);
160static simd_float4x4 SIMD_CFUNC simd_mul(float __a, simd_float4x4 __x);
161static simd_double2x2 SIMD_CFUNC simd_mul(double __a, simd_double2x2 __x);
162static simd_double3x2 SIMD_CFUNC simd_mul(double __a, simd_double3x2 __x);
163static simd_double4x2 SIMD_CFUNC simd_mul(double __a, simd_double4x2 __x);
164static simd_double2x3 SIMD_CFUNC simd_mul(double __a, simd_double2x3 __x);
165static simd_double3x3 SIMD_CFUNC simd_mul(double __a, simd_double3x3 __x);
166static simd_double4x3 SIMD_CFUNC simd_mul(double __a, simd_double4x3 __x);
167static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x);
168static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x);
169static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x);
170
171static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y);
172static simd_float3x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x2 __x, float __b, simd_float3x2 __y);
173static simd_float4x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x2 __x, float __b, simd_float4x2 __y);
174static simd_float2x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x3 __x, float __b, simd_float2x3 __y);
175static simd_float3x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x3 __x, float __b, simd_float3x3 __y);
176static simd_float4x3 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x3 __x, float __b, simd_float4x3 __y);
177static simd_float2x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x4 __x, float __b, simd_float2x4 __y);
178static simd_float3x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x4 __x, float __b, simd_float3x4 __y);
179static simd_float4x4 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x4 __x, float __b, simd_float4x4 __y);
180static simd_double2x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x2 __x, double __b, simd_double2x2 __y);
181static simd_double3x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x2 __x, double __b, simd_double3x2 __y);
182static simd_double4x2 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x2 __x, double __b, simd_double4x2 __y);
183static simd_double2x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x3 __x, double __b, simd_double2x3 __y);
184static simd_double3x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x3 __x, double __b, simd_double3x3 __y);
185static simd_double4x3 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x3 __x, double __b, simd_double4x3 __y);
186static simd_double2x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double2x4 __x, double __b, simd_double2x4 __y);
187static simd_double3x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double3x4 __x, double __b, simd_double3x4 __y);
188static 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
191static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y);
192static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y);
193static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y);
194static simd_float2x3 SIMD_CFUNC simd_add(simd_float2x3 __x, simd_float2x3 __y);
195static simd_float3x3 SIMD_CFUNC simd_add(simd_float3x3 __x, simd_float3x3 __y);
196static simd_float4x3 SIMD_CFUNC simd_add(simd_float4x3 __x, simd_float4x3 __y);
197static simd_float2x4 SIMD_CFUNC simd_add(simd_float2x4 __x, simd_float2x4 __y);
198static simd_float3x4 SIMD_CFUNC simd_add(simd_float3x4 __x, simd_float3x4 __y);
199static simd_float4x4 SIMD_CFUNC simd_add(simd_float4x4 __x, simd_float4x4 __y);
200static simd_double2x2 SIMD_CFUNC simd_add(simd_double2x2 __x, simd_double2x2 __y);
201static simd_double3x2 SIMD_CFUNC simd_add(simd_double3x2 __x, simd_double3x2 __y);
202static simd_double4x2 SIMD_CFUNC simd_add(simd_double4x2 __x, simd_double4x2 __y);
203static simd_double2x3 SIMD_CFUNC simd_add(simd_double2x3 __x, simd_double2x3 __y);
204static simd_double3x3 SIMD_CFUNC simd_add(simd_double3x3 __x, simd_double3x3 __y);
205static simd_double4x3 SIMD_CFUNC simd_add(simd_double4x3 __x, simd_double4x3 __y);
206static simd_double2x4 SIMD_CFUNC simd_add(simd_double2x4 __x, simd_double2x4 __y);
207static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y);
208static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y);
209#define matrix_add simd_add
210
211static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y);
212static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y);
213static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y);
214static simd_float2x3 SIMD_CFUNC simd_sub(simd_float2x3 __x, simd_float2x3 __y);
215static simd_float3x3 SIMD_CFUNC simd_sub(simd_float3x3 __x, simd_float3x3 __y);
216static simd_float4x3 SIMD_CFUNC simd_sub(simd_float4x3 __x, simd_float4x3 __y);
217static simd_float2x4 SIMD_CFUNC simd_sub(simd_float2x4 __x, simd_float2x4 __y);
218static simd_float3x4 SIMD_CFUNC simd_sub(simd_float3x4 __x, simd_float3x4 __y);
219static simd_float4x4 SIMD_CFUNC simd_sub(simd_float4x4 __x, simd_float4x4 __y);
220static simd_double2x2 SIMD_CFUNC simd_sub(simd_double2x2 __x, simd_double2x2 __y);
221static simd_double3x2 SIMD_CFUNC simd_sub(simd_double3x2 __x, simd_double3x2 __y);
222static simd_double4x2 SIMD_CFUNC simd_sub(simd_double4x2 __x, simd_double4x2 __y);
223static simd_double2x3 SIMD_CFUNC simd_sub(simd_double2x3 __x, simd_double2x3 __y);
224static simd_double3x3 SIMD_CFUNC simd_sub(simd_double3x3 __x, simd_double3x3 __y);
225static simd_double4x3 SIMD_CFUNC simd_sub(simd_double4x3 __x, simd_double4x3 __y);
226static simd_double2x4 SIMD_CFUNC simd_sub(simd_double2x4 __x, simd_double2x4 __y);
227static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y);
228static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y);
229#define matrix_sub simd_sub
230
231static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x);
232static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x);
233static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x);
234static simd_float3x2 SIMD_CFUNC simd_transpose(simd_float2x3 __x);
235static simd_float3x3 SIMD_CFUNC simd_transpose(simd_float3x3 __x);
236static simd_float3x4 SIMD_CFUNC simd_transpose(simd_float4x3 __x);
237static simd_float4x2 SIMD_CFUNC simd_transpose(simd_float2x4 __x);
238static simd_float4x3 SIMD_CFUNC simd_transpose(simd_float3x4 __x);
239static simd_float4x4 SIMD_CFUNC simd_transpose(simd_float4x4 __x);
240static simd_double2x2 SIMD_CFUNC simd_transpose(simd_double2x2 __x);
241static simd_double2x3 SIMD_CFUNC simd_transpose(simd_double3x2 __x);
242static simd_double2x4 SIMD_CFUNC simd_transpose(simd_double4x2 __x);
243static simd_double3x2 SIMD_CFUNC simd_transpose(simd_double2x3 __x);
244static simd_double3x3 SIMD_CFUNC simd_transpose(simd_double3x3 __x);
245static simd_double3x4 SIMD_CFUNC simd_transpose(simd_double4x3 __x);
246static simd_double4x2 SIMD_CFUNC simd_transpose(simd_double2x4 __x);
247static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x);
248static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x);
249#define matrix_transpose simd_transpose
250
251static float SIMD_CFUNC simd_determinant(simd_float2x2 __x);
252static float SIMD_CFUNC simd_determinant(simd_float3x3 __x);
253static float SIMD_CFUNC simd_determinant(simd_float4x4 __x);
254static double SIMD_CFUNC simd_determinant(simd_double2x2 __x);
255static double SIMD_CFUNC simd_determinant(simd_double3x3 __x);
256static double SIMD_CFUNC simd_determinant(simd_double4x4 __x);
257#define matrix_determinant simd_determinant
258
259static simd_float2x2 SIMD_CFUNC simd_inverse(simd_float2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
260static simd_float3x3 SIMD_CFUNC simd_inverse(simd_float3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
261static simd_float4x4 SIMD_CFUNC simd_inverse(simd_float4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
262static simd_double2x2 SIMD_CFUNC simd_inverse(simd_double2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
263static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
264static 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
267static simd_float2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2 __y);
268static simd_float2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3 __y);
269static simd_float2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4 __y);
270static simd_float3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float2 __y);
271static simd_float3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float3 __y);
272static simd_float3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float4 __y);
273static simd_float4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float2 __y);
274static simd_float4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float3 __y);
275static simd_float4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float4 __y);
276static simd_double2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2 __y);
277static simd_double2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3 __y);
278static simd_double2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4 __y);
279static simd_double3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2 __y);
280static simd_double3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3 __y);
281static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y);
282static simd_double4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2 __y);
283static simd_double4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3 __y);
284static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y);
285static simd_float2 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float2x2 __y);
286static simd_float3 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float3x2 __y);
287static simd_float4 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float4x2 __y);
288static simd_float2 SIMD_CFUNC simd_mul(simd_float3 __x, simd_float2x3 __y);
289static simd_float3 SIMD_CFUNC simd_mul(simd_float3 __x, simd_float3x3 __y);
290static simd_float4 SIMD_CFUNC simd_mul(simd_float3 __x, simd_float4x3 __y);
291static simd_float2 SIMD_CFUNC simd_mul(simd_float4 __x, simd_float2x4 __y);
292static simd_float3 SIMD_CFUNC simd_mul(simd_float4 __x, simd_float3x4 __y);
293static simd_float4 SIMD_CFUNC simd_mul(simd_float4 __x, simd_float4x4 __y);
294static simd_double2 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double2x2 __y);
295static simd_double3 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double3x2 __y);
296static simd_double4 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double4x2 __y);
297static simd_double2 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double2x3 __y);
298static simd_double3 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double3x3 __y);
299static simd_double4 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double4x3 __y);
300static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y);
301static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y);
302static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y);
303static simd_float2x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2x2 __y);
304static simd_float3x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float3x2 __y);
305static simd_float4x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float4x2 __y);
306static simd_float2x3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float2x2 __y);
307static simd_float3x3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float3x2 __y);
308static simd_float4x3 SIMD_CFUNC simd_mul(simd_float2x3 __x, simd_float4x2 __y);
309static simd_float2x4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float2x2 __y);
310static simd_float3x4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float3x2 __y);
311static simd_float4x4 SIMD_CFUNC simd_mul(simd_float2x4 __x, simd_float4x2 __y);
312static simd_double2x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2x2 __y);
313static simd_double3x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double3x2 __y);
314static simd_double4x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double4x2 __y);
315static simd_double2x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2x2 __y);
316static simd_double3x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double3x2 __y);
317static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y);
318static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y);
319static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y);
320static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y);
321static simd_float2x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float2x3 __y);
322static simd_float3x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3x3 __y);
323static simd_float4x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float4x3 __y);
324static simd_float2x3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float2x3 __y);
325static simd_float3x3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float3x3 __y);
326static simd_float4x3 SIMD_CFUNC simd_mul(simd_float3x3 __x, simd_float4x3 __y);
327static simd_float2x4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float2x3 __y);
328static simd_float3x4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float3x3 __y);
329static simd_float4x4 SIMD_CFUNC simd_mul(simd_float3x4 __x, simd_float4x3 __y);
330static simd_double2x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double2x3 __y);
331static simd_double3x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3x3 __y);
332static simd_double4x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double4x3 __y);
333static simd_double2x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double2x3 __y);
334static simd_double3x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3x3 __y);
335static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y);
336static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y);
337static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y);
338static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y);
339static simd_float2x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float2x4 __y);
340static simd_float3x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float3x4 __y);
341static simd_float4x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4x4 __y);
342static simd_float2x3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float2x4 __y);
343static simd_float3x3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float3x4 __y);
344static simd_float4x3 SIMD_CFUNC simd_mul(simd_float4x3 __x, simd_float4x4 __y);
345static simd_float2x4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float2x4 __y);
346static simd_float3x4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float3x4 __y);
347static simd_float4x4 SIMD_CFUNC simd_mul(simd_float4x4 __x, simd_float4x4 __y);
348static simd_double2x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double2x4 __y);
349static simd_double3x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double3x4 __y);
350static simd_double4x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4x4 __y);
351static simd_double2x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double2x4 __y);
352static simd_double3x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double3x4 __y);
353static simd_double4x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4x4 __y);
354static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y);
355static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y);
356static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y);
357
358static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y);
359static simd_bool SIMD_CFUNC simd_equal(simd_float2x3 __x, simd_float2x3 __y);
360static simd_bool SIMD_CFUNC simd_equal(simd_float2x4 __x, simd_float2x4 __y);
361static simd_bool SIMD_CFUNC simd_equal(simd_float3x2 __x, simd_float3x2 __y);
362static simd_bool SIMD_CFUNC simd_equal(simd_float3x3 __x, simd_float3x3 __y);
363static simd_bool SIMD_CFUNC simd_equal(simd_float3x4 __x, simd_float3x4 __y);
364static simd_bool SIMD_CFUNC simd_equal(simd_float4x2 __x, simd_float4x2 __y);
365static simd_bool SIMD_CFUNC simd_equal(simd_float4x3 __x, simd_float4x3 __y);
366static simd_bool SIMD_CFUNC simd_equal(simd_float4x4 __x, simd_float4x4 __y);
367static simd_bool SIMD_CFUNC simd_equal(simd_double2x2 __x, simd_double2x2 __y);
368static simd_bool SIMD_CFUNC simd_equal(simd_double2x3 __x, simd_double2x3 __y);
369static simd_bool SIMD_CFUNC simd_equal(simd_double2x4 __x, simd_double2x4 __y);
370static simd_bool SIMD_CFUNC simd_equal(simd_double3x2 __x, simd_double3x2 __y);
371static simd_bool SIMD_CFUNC simd_equal(simd_double3x3 __x, simd_double3x3 __y);
372static simd_bool SIMD_CFUNC simd_equal(simd_double3x4 __x, simd_double3x4 __y);
373static simd_bool SIMD_CFUNC simd_equal(simd_double4x2 __x, simd_double4x2 __y);
374static simd_bool SIMD_CFUNC simd_equal(simd_double4x3 __x, simd_double4x3 __y);
375static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y);
376#define matrix_equal simd_equal
377
378static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol);
379static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x3 __x, simd_float2x3 __y, float __tol);
380static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x4 __x, simd_float2x4 __y, float __tol);
381static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x2 __x, simd_float3x2 __y, float __tol);
382static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x3 __x, simd_float3x3 __y, float __tol);
383static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float3x4 __x, simd_float3x4 __y, float __tol);
384static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x2 __x, simd_float4x2 __y, float __tol);
385static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x3 __x, simd_float4x3 __y, float __tol);
386static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float4x4 __x, simd_float4x4 __y, float __tol);
387static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x2 __x, simd_double2x2 __y, double __tol);
388static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x3 __x, simd_double2x3 __y, double __tol);
389static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double2x4 __x, simd_double2x4 __y, double __tol);
390static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x2 __x, simd_double3x2 __y, double __tol);
391static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x3 __x, simd_double3x3 __y, double __tol);
392static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double3x4 __x, simd_double3x4 __y, double __tol);
393static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x2 __x, simd_double4x2 __y, double __tol);
394static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x3 __x, simd_double4x3 __y, double __tol);
395static 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
398static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol);
399static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x3 __x, simd_float2x3 __y, float __tol);
400static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x4 __x, simd_float2x4 __y, float __tol);
401static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x2 __x, simd_float3x2 __y, float __tol);
402static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x3 __x, simd_float3x3 __y, float __tol);
403static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float3x4 __x, simd_float3x4 __y, float __tol);
404static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x2 __x, simd_float4x2 __y, float __tol);
405static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x3 __x, simd_float4x3 __y, float __tol);
406static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float4x4 __x, simd_float4x4 __y, float __tol);
407static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x2 __x, simd_double2x2 __y, double __tol);
408static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x3 __x, simd_double2x3 __y, double __tol);
409static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double2x4 __x, simd_double2x4 __y, double __tol);
410static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x2 __x, simd_double3x2 __y, double __tol);
411static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x3 __x, simd_double3x3 __y, double __tol);
412static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double3x4 __x, simd_double3x4 __y, double __tol);
413static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x2 __x, simd_double4x2 __y, double __tol);
414static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x3 __x, simd_double4x3 __y, double __tol);
415static 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
421namespace 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
799extern "C" {
800#endif /* __cplusplus */
801
802#pragma mark - Implementation
803
804static 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; }
805static 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; }
806static 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; }
807static 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; }
808static 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; }
809static 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
811static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1) { simd_float2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
812static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1) { simd_float2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
813static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1) { simd_float2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
814static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1) { simd_double2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
815static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1) { simd_double2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
816static simd_double2x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1) { simd_double2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
817static 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; }
818static 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; }
819static 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; }
820static 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; }
821static 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; }
822static 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; }
823static 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; }
824static 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; }
825static 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; }
826static 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; }
827static 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; }
828static 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
830static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
831static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
832static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1) { return simd_transpose(simd_matrix(row0, row1)); }
833static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
834static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
835static simd_double4x2 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1) { return simd_transpose(simd_matrix(row0, row1)); }
836static 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)); }
837static 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)); }
838static 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)); }
839static 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)); }
840static 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)); }
841static 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)); }
842static 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)); }
843static 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)); }
844static 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)); }
845static 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)); }
846static 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)); }
847static 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
849static 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
854static 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
871static 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
876static 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
893static simd_float2x2 SIMD_CFUNC matrix_scale(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
894static 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; }
895static 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; }
896static simd_float2x3 SIMD_CFUNC matrix_scale(float __a, simd_float2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
897static 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; }
898static 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; }
899static simd_float2x4 SIMD_CFUNC matrix_scale(float __a, simd_float2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
900static 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; }
901static 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; }
902static simd_double2x2 SIMD_CFUNC matrix_scale(double __a, simd_double2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
903static 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; }
904static 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; }
905static simd_double2x3 SIMD_CFUNC matrix_scale(double __a, simd_double2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
906static 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; }
907static 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; }
908static simd_double2x4 SIMD_CFUNC matrix_scale(double __a, simd_double2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
909static 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; }
910static 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
912static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
913static 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; }
914static 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; }
915static simd_float2x3 SIMD_CFUNC simd_mul(float __a, simd_float2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
916static 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; }
917static 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; }
918static simd_float2x4 SIMD_CFUNC simd_mul(float __a, simd_float2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
919static 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; }
920static 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; }
921static simd_double2x2 SIMD_CFUNC simd_mul(double __a, simd_double2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
922static 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; }
923static 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; }
924static simd_double2x3 SIMD_CFUNC simd_mul(double __a, simd_double2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
925static 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; }
926static 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; }
927static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
928static 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; }
929static 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
931static 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}
936static 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}
942static 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}
949static 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}
954static 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}
960static 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}
967static 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}
972static 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}
978static 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}
985static 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}
990static 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}
996static 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}
1003static 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}
1008static 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}
1014static 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}
1021static 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}
1026static 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}
1032static 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
1040static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1041static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1042static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1043static simd_float2x3 SIMD_CFUNC simd_add(simd_float2x3 __x, simd_float2x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1044static simd_float3x3 SIMD_CFUNC simd_add(simd_float3x3 __x, simd_float3x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1045static simd_float4x3 SIMD_CFUNC simd_add(simd_float4x3 __x, simd_float4x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1046static simd_float2x4 SIMD_CFUNC simd_add(simd_float2x4 __x, simd_float2x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1047static simd_float3x4 SIMD_CFUNC simd_add(simd_float3x4 __x, simd_float3x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1048static simd_float4x4 SIMD_CFUNC simd_add(simd_float4x4 __x, simd_float4x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1049static simd_double2x2 SIMD_CFUNC simd_add(simd_double2x2 __x, simd_double2x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1050static simd_double3x2 SIMD_CFUNC simd_add(simd_double3x2 __x, simd_double3x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1051static simd_double4x2 SIMD_CFUNC simd_add(simd_double4x2 __x, simd_double4x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1052static simd_double2x3 SIMD_CFUNC simd_add(simd_double2x3 __x, simd_double2x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1053static simd_double3x3 SIMD_CFUNC simd_add(simd_double3x3 __x, simd_double3x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1054static simd_double4x3 SIMD_CFUNC simd_add(simd_double4x3 __x, simd_double4x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1055static simd_double2x4 SIMD_CFUNC simd_add(simd_double2x4 __x, simd_double2x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1056static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1057static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1058
1059static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1060static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1061static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1062static simd_float2x3 SIMD_CFUNC simd_sub(simd_float2x3 __x, simd_float2x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1063static simd_float3x3 SIMD_CFUNC simd_sub(simd_float3x3 __x, simd_float3x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1064static simd_float4x3 SIMD_CFUNC simd_sub(simd_float4x3 __x, simd_float4x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1065static simd_float2x4 SIMD_CFUNC simd_sub(simd_float2x4 __x, simd_float2x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1066static simd_float3x4 SIMD_CFUNC simd_sub(simd_float3x4 __x, simd_float3x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1067static simd_float4x4 SIMD_CFUNC simd_sub(simd_float4x4 __x, simd_float4x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1068static simd_double2x2 SIMD_CFUNC simd_sub(simd_double2x2 __x, simd_double2x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1069static simd_double3x2 SIMD_CFUNC simd_sub(simd_double3x2 __x, simd_double3x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1070static simd_double4x2 SIMD_CFUNC simd_sub(simd_double4x2 __x, simd_double4x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1071static simd_double2x3 SIMD_CFUNC simd_sub(simd_double2x3 __x, simd_double2x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1072static simd_double3x3 SIMD_CFUNC simd_sub(simd_double3x3 __x, simd_double3x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1073static simd_double4x3 SIMD_CFUNC simd_sub(simd_double4x3 __x, simd_double4x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1074static simd_double2x4 SIMD_CFUNC simd_sub(simd_double2x4 __x, simd_double2x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1075static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1076static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1077
1078static 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
1091static 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
1106static 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
1119static 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
1135static 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
1154static 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
1171static 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
1189static 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
1211static 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
1230static 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
1235static 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
1241static 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
1248static 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
1253static 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
1259static 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
1266static 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
1271static 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
1277static 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
1284static simd_float3 SIMD_CFUNC __rotate1( simd_float3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); }
1285static simd_float3 SIMD_CFUNC __rotate2( simd_float3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); }
1286static simd_float4 SIMD_CFUNC __rotate1( simd_float4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); }
1287static simd_float4 SIMD_CFUNC __rotate2( simd_float4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); }
1288static simd_float4 SIMD_CFUNC __rotate3( simd_float4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); }
1289static simd_double3 SIMD_CFUNC __rotate1(simd_double3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); }
1290static simd_double3 SIMD_CFUNC __rotate2(simd_double3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); }
1291static simd_double4 SIMD_CFUNC __rotate1(simd_double4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); }
1292static simd_double4 SIMD_CFUNC __rotate2(simd_double4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); }
1293static simd_double4 SIMD_CFUNC __rotate3(simd_double4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); }
1294
1295static 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]; }
1296static 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]; }
1297static 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]))); }
1298static 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]))); }
1299static 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}
1305static 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
1312static simd_float2x2 SIMD_CFUNC simd_inverse( simd_float2x2 __x) { return __invert_f2(__x); }
1313static simd_float3x3 SIMD_CFUNC simd_inverse( simd_float3x3 __x) { return __invert_f3(__x); }
1314static simd_float4x4 SIMD_CFUNC simd_inverse( simd_float4x4 __x) { return __invert_f4(__x); }
1315static simd_double2x2 SIMD_CFUNC simd_inverse(simd_double2x2 __x) { return __invert_d2(__x); }
1316static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) { return __invert_d3(__x); }
1317static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) { return __invert_d4(__x); }
1318
1319static 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; }
1320static 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; }
1321static 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; }
1322static 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; }
1323static 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; }
1324static 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; }
1325static 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; }
1326static 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; }
1327static 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; }
1328static 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; }
1329static 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; }
1330static 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; }
1331static 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; }
1332static 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; }
1333static 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; }
1334static 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; }
1335static 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; }
1336static 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
1338static simd_float2 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float2x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1339static simd_float3 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float3x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1340static simd_float4 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float4x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1341static simd_float2 SIMD_CFUNC simd_mul( simd_float3 __x, simd_float2x3 __y) { return simd_mul(simd_transpose(__y), __x); }
1342static simd_float3 SIMD_CFUNC simd_mul( simd_float3 __x, simd_float3x3 __y) { return simd_mul(simd_transpose(__y), __x); }
1343static simd_float4 SIMD_CFUNC simd_mul( simd_float3 __x, simd_float4x3 __y) { return simd_mul(simd_transpose(__y), __x); }
1344static simd_float2 SIMD_CFUNC simd_mul( simd_float4 __x, simd_float2x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1345static simd_float3 SIMD_CFUNC simd_mul( simd_float4 __x, simd_float3x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1346static simd_float4 SIMD_CFUNC simd_mul( simd_float4 __x, simd_float4x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1347static simd_double2 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double2x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1348static simd_double3 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double3x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1349static simd_double4 SIMD_CFUNC simd_mul(simd_double2 __x, simd_double4x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1350static simd_double2 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double2x3 __y) { return simd_mul(simd_transpose(__y), __x); }
1351static simd_double3 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double3x3 __y) { return simd_mul(simd_transpose(__y), __x); }
1352static simd_double4 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double4x3 __y) { return simd_mul(simd_transpose(__y), __x); }
1353static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1354static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1355static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1356
1357static 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; }
1358static 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; }
1359static 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; }
1360static 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; }
1361static 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; }
1362static 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; }
1363static 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; }
1364static 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; }
1365static 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; }
1366static 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; }
1367static 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; }
1368static 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; }
1369static 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; }
1370static 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; }
1371static 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; }
1372static 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; }
1373static 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; }
1374static 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
1376static 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; }
1377static 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; }
1378static 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; }
1379static 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; }
1380static 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; }
1381static 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; }
1382static 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; }
1383static 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; }
1384static 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; }
1385static 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; }
1386static 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; }
1387static 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; }
1388static 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; }
1389static 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; }
1390static 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; }
1391static 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; }
1392static 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; }
1393static 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
1395static 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; }
1396static 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; }
1397static 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; }
1398static 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; }
1399static 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; }
1400static 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; }
1401static 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; }
1402static 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; }
1403static 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; }
1404static 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; }
1405static 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; }
1406static 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; }
1407static 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; }
1408static 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; }
1409static 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; }
1410static 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; }
1411static 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; }
1412static 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
1414static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2 __y) { return simd_mul(__x, __y); }
1415static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2 __y) { return simd_mul(__x, __y); }
1416static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2 __y) { return simd_mul(__x, __y); }
1417static simd_float2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3 __y) { return simd_mul(__x, __y); }
1418static simd_float3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3 __y) { return simd_mul(__x, __y); }
1419static simd_float4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3 __y) { return simd_mul(__x, __y); }
1420static simd_float2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4 __y) { return simd_mul(__x, __y); }
1421static simd_float3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4 __y) { return simd_mul(__x, __y); }
1422static simd_float4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4 __y) { return simd_mul(__x, __y); }
1423static simd_double2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double2 __y) { return simd_mul(__x, __y); }
1424static simd_double3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double2 __y) { return simd_mul(__x, __y); }
1425static simd_double4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double2 __y) { return simd_mul(__x, __y); }
1426static simd_double2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double3 __y) { return simd_mul(__x, __y); }
1427static simd_double3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double3 __y) { return simd_mul(__x, __y); }
1428static simd_double4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double3 __y) { return simd_mul(__x, __y); }
1429static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4 __y) { return simd_mul(__x, __y); }
1430static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4 __y) { return simd_mul(__x, __y); }
1431static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4 __y) { return simd_mul(__x, __y); }
1432
1433static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1434static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1435static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1436static simd_float2 SIMD_CFUNC matrix_multiply( simd_float3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1437static simd_float3 SIMD_CFUNC matrix_multiply( simd_float3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1438static simd_float4 SIMD_CFUNC matrix_multiply( simd_float3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1439static simd_float2 SIMD_CFUNC matrix_multiply( simd_float4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1440static simd_float3 SIMD_CFUNC matrix_multiply( simd_float4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1441static simd_float4 SIMD_CFUNC matrix_multiply( simd_float4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1442static simd_double2 SIMD_CFUNC matrix_multiply(simd_double2 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
1443static simd_double3 SIMD_CFUNC matrix_multiply(simd_double2 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
1444static simd_double4 SIMD_CFUNC matrix_multiply(simd_double2 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
1445static simd_double2 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
1446static simd_double3 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
1447static simd_double4 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
1448static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
1449static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
1450static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
1451
1452static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1453static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
1454static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1455static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
1456static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1457static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
1458static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1459static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
1460static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1461static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
1462static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1463static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
1464static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1465static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
1466static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1467static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
1468static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1469static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
1470
1471static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1472static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
1473static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1474static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
1475static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1476static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
1477static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1478static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
1479static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1480static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
1481static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1482static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
1483static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1484static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
1485static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1486static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
1487static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1488static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
1489
1490static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1491static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
1492static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1493static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
1494static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1495static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
1496static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1497static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
1498static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1499static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
1500static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1501static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
1502static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1503static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
1504static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1505static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
1506static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1507static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
1508
1509static 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}
1513static 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}
1517static 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}
1521static 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}
1526static 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}
1531static 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}
1536static 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}
1542static 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}
1548static 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}
1554static 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}
1558static 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}
1562static 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}
1566static 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}
1571static 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}
1576static 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}
1581static 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}
1587static 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}
1593static 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
1600static 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}
1604static 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}
1608static 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}
1612static 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}
1617static 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}
1622static 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}
1627static 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}
1633static 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}
1639static 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}
1645static 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}
1649static 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}
1653static 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}
1657static 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}
1662static 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}
1667static 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}
1672static 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}
1678static 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}
1684static 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
1691static 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}
1695static 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}
1699static 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}
1703static 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}
1708static 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}
1713static 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}
1718static 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}
1724static 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}
1730static 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}
1736static 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}
1740static 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}
1744static 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}
1748static 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}
1753static 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}
1758static 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}
1763static 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}
1769static 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}
1775static 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/aarch64-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++ */
36typedef simd_float2x2 matrix_float2x2;
37typedef simd_float3x2 matrix_float3x2;
38typedef simd_float4x2 matrix_float4x2;
39
40typedef simd_float2x3 matrix_float2x3;
41typedef simd_float3x3 matrix_float3x3;
42typedef simd_float4x3 matrix_float4x3;
43
44typedef simd_float2x4 matrix_float2x4;
45typedef simd_float3x4 matrix_float3x4;
46typedef simd_float4x4 matrix_float4x4;
47
48typedef simd_double2x2 matrix_double2x2;
49typedef simd_double3x2 matrix_double3x2;
50typedef simd_double4x2 matrix_double4x2;
51
52typedef simd_double2x3 matrix_double2x3;
53typedef simd_double3x3 matrix_double3x3;
54typedef simd_double4x3 matrix_double4x3;
55
56typedef simd_double2x4 matrix_double2x4;
57typedef simd_double3x4 matrix_double3x4;
58typedef simd_double4x4 matrix_double4x4;
59
60#ifdef __cplusplus
61#if defined SIMD_MATRIX_HEADER
62static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);
63static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);
64static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);
65static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);
66#endif
67
68namespace 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/aarch64-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. */
41typedef __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. */
49typedef __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. */
57typedef __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. */
65typedef __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. */
73typedef __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. */
81typedef __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. */
89typedef __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. */
97typedef __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. */
105typedef __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. */
113typedef __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. */
121typedef __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. */
129typedef __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. */
137typedef __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. */
145typedef __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. */
153typedef __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. */
161typedef __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. */
169typedef __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. */
177typedef __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. */
185typedef __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. */
193typedef __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. */
201typedef __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. */
209typedef __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. */
217typedef __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. */
225typedef __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. */
233typedef __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. */
241typedef __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. */
249typedef __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. */
257typedef __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. */
265typedef __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. */
273typedef __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. */
281typedef __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. */
289typedef __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. */
297typedef __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. */
305typedef __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__
314typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) simd_long1 simd_packed_long2;
315#else
316typedef __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__
326typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) simd_long1 simd_packed_long4;
327#else
328typedef __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__
338typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) simd_long1 simd_packed_long8;
339#else
340typedef __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__
350typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) simd_ulong1 simd_packed_ulong2;
351#else
352typedef __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__
362typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) simd_ulong1 simd_packed_ulong4;
363#else
364typedef __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__
374typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) simd_ulong1 simd_packed_ulong8;
375#else
376typedef __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__
386typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) double simd_packed_double2;
387#else
388typedef __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__
398typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) double simd_packed_double4;
399#else
400typedef __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__
410typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) double simd_packed_double8;
411#else
412typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) double simd_packed_double8;
413#endif
414
415/* MARK: C++ vector types */
416#if defined __cplusplus
417namespace 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. */
425typedef ::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. */
433typedef ::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. */
441typedef ::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. */
449typedef ::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. */
457typedef ::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. */
465typedef ::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. */
473typedef ::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. */
481typedef ::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. */
489typedef ::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. */
497typedef ::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. */
505typedef ::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. */
513typedef ::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. */
521typedef ::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. */
529typedef ::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. */
537typedef ::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. */
545typedef ::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. */
553typedef ::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. */
561typedef ::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. */
569typedef ::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. */
577typedef ::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. */
585typedef ::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. */
593typedef ::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. */
601typedef ::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. */
609typedef ::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. */
617typedef ::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. */
625typedef ::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. */
633typedef ::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. */
641typedef ::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. */
649typedef ::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. */
657typedef ::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. */
665typedef ::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. */
673typedef ::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. */
681typedef ::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. */
689typedef ::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. */
697typedef ::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. */
705typedef ::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. */
713typedef ::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. */
721typedef ::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. */
729typedef ::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. */
737typedef ::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. */
745typedef ::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. */
753typedef ::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. */
761typedef ::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. */
776typedef 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. */
782typedef 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. */
788typedef 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. */
794typedef 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. */
800typedef 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. */
806typedef 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. */
812typedef 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. */
818typedef 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. */
824typedef 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. */
830typedef 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. */
836typedef 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. */
842typedef 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. */
848typedef 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. */
854typedef 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. */
860typedef 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. */
866typedef 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. */
872typedef 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. */
878typedef 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. */
884typedef 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. */
890typedef 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. */
896typedef 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. */
902typedef 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. */
908typedef 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. */
914typedef 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. */
920typedef 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. */
926typedef 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. */
932typedef 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. */
938typedef 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. */
944typedef 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. */
950typedef 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. */
956typedef 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. */
962typedef 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. */
968typedef 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. */
974typedef 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. */
980typedef 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. */
986typedef 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. */
992typedef 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. */
998typedef 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. */
1004typedef 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. */
1010typedef 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. */
1016typedef 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. */
1022typedef 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. */
1028typedef simd_packed_double8 packed_double8;
1029
1030# endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
1031#endif
lib/libc/include/aarch64-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
15extern "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. */
27static 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. */
35static 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. */
44static 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`. */
50static 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. */
60static 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. */
66static 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 . */
73static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float4x4 matrix);
74
75/*! @abstract The real (scalar) part of the quaternion `q`. */
76static 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`. */
81static 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`. */
86static 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. */
90static inline SIMD_CFUNC simd_float3 simd_axis(simd_quatf q);
91
92/*! @abstract The sum of the quaternions `p` and `q`. */
93static inline SIMD_CFUNC simd_quatf simd_add(simd_quatf p, simd_quatf q);
94
95/*! @abstract The difference of the quaternions `p` and `q`. */
96static inline SIMD_CFUNC simd_quatf simd_sub(simd_quatf p, simd_quatf q);
97
98/*! @abstract The product of the quaternions `p` and `q`. */
99static 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`. */
102static inline SIMD_CFUNC simd_quatf simd_mul(simd_quatf q, float a);
103
104/*! @abstract The quaternion `q` scaled by the real value `a`. */
105static inline SIMD_CFUNC simd_quatf simd_mul(float a, simd_quatf q);
106
107/*! @abstract The conjugate of the quaternion `q`. */
108static inline SIMD_CFUNC simd_quatf simd_conjugate(simd_quatf q);
109
110/*! @abstract The (multiplicative) inverse of the quaternion `q`. */
111static inline SIMD_CFUNC simd_quatf simd_inverse(simd_quatf q);
112
113/*! @abstract The negation (additive inverse) of the quaternion `q`. */
114static 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. */
118static inline SIMD_CFUNC float simd_dot(simd_quatf p, simd_quatf q);
119
120/*! @abstract The length of the quaternion `q`. */
121static inline SIMD_CFUNC float simd_length(simd_quatf q);
122
123/*! @abstract The unit quaternion obtained by normalizing `q`. */
124static inline SIMD_CFUNC simd_quatf simd_normalize(simd_quatf q);
125
126/*! @abstract Rotates the vector `v` by the quaternion `q`. */
127static 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; */
146static 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. */
150static 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`. */
154static 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`. */
158static 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. */
166static 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. */
175static 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
181namespace 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
288extern "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. */
298static 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. */
303static inline SIMD_CFUNC simd_quatf _simd_quaternion(simd_float3 imag, float real) {
304 return simd_quaternion(simd_make_float4(imag, real));
305}
306
307static 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
311static inline SIMD_CFUNC float simd_angle(simd_quatf q) {
312 return 2*atan2(simd_length(q.vector.xyz), q.vector.w);
313}
314
315static inline SIMD_CFUNC simd_float3 simd_axis(simd_quatf q) {
316 return simd_normalize(q.vector.xyz);
317}
318
319static inline SIMD_CFUNC simd_quatf simd_add(simd_quatf p, simd_quatf q) {
320 return simd_quaternion(p.vector + q.vector);
321}
322
323static inline SIMD_CFUNC simd_quatf simd_sub(simd_quatf p, simd_quatf q) {
324 return simd_quaternion(p.vector - q.vector);
325}
326
327static 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
335static inline SIMD_CFUNC simd_quatf simd_mul(simd_quatf q, float a) {
336 return simd_quaternion(a * q.vector);
337}
338
339static inline SIMD_CFUNC simd_quatf simd_mul(float a, simd_quatf q) {
340 return simd_mul(q,a);
341}
342
343static inline SIMD_CFUNC simd_quatf simd_conjugate(simd_quatf q) {
344 return simd_quaternion(q.vector * (simd_float4){-1,-1,-1, 1});
345}
346
347static 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
351static inline SIMD_CFUNC simd_quatf simd_negate(simd_quatf q) {
352 return simd_quaternion(-q.vector);
353}
354
355static inline SIMD_CFUNC float simd_dot(simd_quatf p, simd_quatf q) {
356 return simd_dot(p.vector, q.vector);
357}
358
359static inline SIMD_CFUNC float simd_length(simd_quatf q) {
360 return simd_length(q.vector);
361}
362
363static 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. */
378static 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
386static 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
396static 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
403static 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. */
422static 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
427static 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
459static 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
493static 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. */
532static 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. */
541static 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. */
552static 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
559static 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
565static 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. */
574static 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. */
583static 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
589static 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
595static 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. */
613static 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. */
621static 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. */
630static 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`. */
636static 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. */
646static 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. */
652static 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 . */
659static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double4x4 matrix);
660
661/*! @abstract The real (scalar) part of the quaternion `q`. */
662static 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`. */
667static 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`. */
672static 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. */
676static inline SIMD_CFUNC simd_double3 simd_axis(simd_quatd q);
677
678/*! @abstract The sum of the quaternions `p` and `q`. */
679static inline SIMD_CFUNC simd_quatd simd_add(simd_quatd p, simd_quatd q);
680
681/*! @abstract The difference of the quaternions `p` and `q`. */
682static inline SIMD_CFUNC simd_quatd simd_sub(simd_quatd p, simd_quatd q);
683
684/*! @abstract The product of the quaternions `p` and `q`. */
685static 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`. */
688static inline SIMD_CFUNC simd_quatd simd_mul(simd_quatd q, double a);
689
690/*! @abstract The quaternion `q` scaled by the real value `a`. */
691static inline SIMD_CFUNC simd_quatd simd_mul(double a, simd_quatd q);
692
693/*! @abstract The conjugate of the quaternion `q`. */
694static inline SIMD_CFUNC simd_quatd simd_conjugate(simd_quatd q);
695
696/*! @abstract The (multiplicative) inverse of the quaternion `q`. */
697static inline SIMD_CFUNC simd_quatd simd_inverse(simd_quatd q);
698
699/*! @abstract The negation (additive inverse) of the quaternion `q`. */
700static 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. */
704static inline SIMD_CFUNC double simd_dot(simd_quatd p, simd_quatd q);
705
706/*! @abstract The length of the quaternion `q`. */
707static inline SIMD_CFUNC double simd_length(simd_quatd q);
708
709/*! @abstract The unit quaternion obtained by normalizing `q`. */
710static inline SIMD_CFUNC simd_quatd simd_normalize(simd_quatd q);
711
712/*! @abstract Rotates the vector `v` by the quaternion `q`. */
713static 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; */
732static 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. */
736static 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`. */
740static 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`. */
744static 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. */
752static 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. */
761static 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
767namespace 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
874extern "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. */
884static 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. */
889static inline SIMD_CFUNC simd_quatd _simd_quaternion(simd_double3 imag, double real) {
890 return simd_quaternion(simd_make_double4(imag, real));
891}
892
893static 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
897static inline SIMD_CFUNC double simd_angle(simd_quatd q) {
898 return 2*atan2(simd_length(q.vector.xyz), q.vector.w);
899}
900
901static inline SIMD_CFUNC simd_double3 simd_axis(simd_quatd q) {
902 return simd_normalize(q.vector.xyz);
903}
904
905static inline SIMD_CFUNC simd_quatd simd_add(simd_quatd p, simd_quatd q) {
906 return simd_quaternion(p.vector + q.vector);
907}
908
909static inline SIMD_CFUNC simd_quatd simd_sub(simd_quatd p, simd_quatd q) {
910 return simd_quaternion(p.vector - q.vector);
911}
912
913static 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
921static inline SIMD_CFUNC simd_quatd simd_mul(simd_quatd q, double a) {
922 return simd_quaternion(a * q.vector);
923}
924
925static inline SIMD_CFUNC simd_quatd simd_mul(double a, simd_quatd q) {
926 return simd_mul(q,a);
927}
928
929static inline SIMD_CFUNC simd_quatd simd_conjugate(simd_quatd q) {
930 return simd_quaternion(q.vector * (simd_double4){-1,-1,-1, 1});
931}
932
933static 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
937static inline SIMD_CFUNC simd_quatd simd_negate(simd_quatd q) {
938 return simd_quaternion(-q.vector);
939}
940
941static inline SIMD_CFUNC double simd_dot(simd_quatd p, simd_quatd q) {
942 return simd_dot(p.vector, q.vector);
943}
944
945static inline SIMD_CFUNC double simd_length(simd_quatd q) {
946 return simd_length(q.vector);
947}
948
949static 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. */
964static 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
972static 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
982static 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
989static 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. */
1008static 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
1013static 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
1045static 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
1079static 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. */
1118static 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. */
1127static 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. */
1138static 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
1145static 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
1151static 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. */
1160static 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. */
1169static 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
1175static 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
1181static 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/aarch64-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/aarch64-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. */
40typedef struct { simd_float2 columns[2]; } simd_float2x2;
41
42/*! @abstract A matrix with 2 rows and 3 columns. */
43typedef struct { simd_float2 columns[3]; } simd_float3x2;
44
45/*! @abstract A matrix with 2 rows and 4 columns. */
46typedef struct { simd_float2 columns[4]; } simd_float4x2;
47
48/*! @abstract A matrix with 3 rows and 2 columns. */
49typedef struct { simd_float3 columns[2]; } simd_float2x3;
50
51/*! @abstract A matrix with 3 rows and 3 columns. */
52typedef struct { simd_float3 columns[3]; } simd_float3x3;
53
54/*! @abstract A matrix with 3 rows and 4 columns. */
55typedef struct { simd_float3 columns[4]; } simd_float4x3;
56
57/*! @abstract A matrix with 4 rows and 2 columns. */
58typedef struct { simd_float4 columns[2]; } simd_float2x4;
59
60/*! @abstract A matrix with 4 rows and 3 columns. */
61typedef struct { simd_float4 columns[3]; } simd_float3x4;
62
63/*! @abstract A matrix with 4 rows and 4 columns. */
64typedef struct { simd_float4 columns[4]; } simd_float4x4;
65
66/*! @abstract A matrix with 2 rows and 2 columns. */
67typedef struct { simd_double2 columns[2]; } simd_double2x2;
68
69/*! @abstract A matrix with 2 rows and 3 columns. */
70typedef struct { simd_double2 columns[3]; } simd_double3x2;
71
72/*! @abstract A matrix with 2 rows and 4 columns. */
73typedef struct { simd_double2 columns[4]; } simd_double4x2;
74
75/*! @abstract A matrix with 3 rows and 2 columns. */
76typedef struct { simd_double3 columns[2]; } simd_double2x3;
77
78/*! @abstract A matrix with 3 rows and 3 columns. */
79typedef struct { simd_double3 columns[3]; } simd_double3x3;
80
81/*! @abstract A matrix with 3 rows and 4 columns. */
82typedef struct { simd_double3 columns[4]; } simd_double4x3;
83
84/*! @abstract A matrix with 4 rows and 2 columns. */
85typedef struct { simd_double4 columns[2]; } simd_double2x4;
86
87/*! @abstract A matrix with 4 rows and 3 columns. */
88typedef struct { simd_double4 columns[3]; } simd_double3x4;
89
90/*! @abstract A matrix with 4 rows and 4 columns. */
91typedef 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. */
122typedef struct { simd_float4 vector; } simd_quatf;
123
124/*! @abstract A double-precision quaternion. */
125typedef struct { simd_double4 vector; } simd_quatd;
126
127#endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
128#endif /* SIMD_TYPES */
lib/libc/include/aarch64-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/aarch64-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
47extern "C" {
48#endif
49
50/*! @abstract Concatenates `x` and `y` to form a vector of two 8-bit signed
51 * (twos-complement) integers. */
52static 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. */
61static 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. */
70static 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. */
78static 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. */
84static 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. */
90static 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. */
96static 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. */
102static 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. */
108static 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. */
114static 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. */
120static 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. */
130static 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. */
139static 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. */
148static 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. */
157static 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. */
165static 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. */
174static 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. */
182static 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. */
188static 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. */
194static 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. */
200static 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. */
206static 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. */
212static 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. */
218static 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. */
229static 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. */
239static 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. */
249static 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. */
259static 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. */
268static 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. */
277static 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. */
286static 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. */
295static 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. */
303static 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. */
312static 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. */
320static 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. */
329static 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. */
337static 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. */
343static 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. */
349static 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. */
355static 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. */
361static 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. */
367static 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. */
376static 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. */
385static 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. */
393static 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. */
402static 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. */
410static 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. */
419static 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. */
427static 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. */
436static 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. */
444static 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. */
450static 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. */
456static 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. */
462static 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. */
468static 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. */
477static 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. */
486static 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. */
494static 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. */
503static 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. */
511static 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. */
520static 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. */
528static 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. */
537static 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. */
545static 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. */
554static 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. */
562static 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. */
568static 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. */
574static 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. */
580static 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. */
589static 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. */
598static 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. */
606static 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. */
615static 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. */
623static 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. */
632static 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. */
640static 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. */
649static 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. */
657static 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. */
666static 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. */
674static 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. */
683static 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. */
691static 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. */
697static 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. */
703static 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. */
712static 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. */
721static 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. */
729static 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. */
738static 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. */
746static 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. */
755static 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. */
763static 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. */
772static 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. */
780static 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. */
789static 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. */
797static 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. */
806static 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. */
814static 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. */
823static 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. */
831static 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. */
837static 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. */
846static 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. */
855static 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. */
863static 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. */
869static 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. */
875static 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. */
881static 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. */
887static 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. */
893static 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. */
899static 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. */
905static 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. */
915static 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. */
924static 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. */
933static 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. */
942static 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. */
950static 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. */
959static 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. */
967static 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. */
973static 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. */
979static 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. */
985static 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. */
991static 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. */
997static 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. */
1003static 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. */
1014static 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. */
1024static 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. */
1034static 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. */
1044static 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. */
1053static 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. */
1062static 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. */
1071static 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. */
1080static 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. */
1088static 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. */
1097static 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. */
1105static 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. */
1114static 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. */
1122static 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. */
1128static 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. */
1134static 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. */
1140static 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. */
1146static 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. */
1152static 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. */
1161static 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. */
1170static 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. */
1178static 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. */
1187static 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. */
1195static 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. */
1204static 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. */
1212static 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. */
1221static 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. */
1229static 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. */
1235static 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. */
1241static 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. */
1247static 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. */
1253static 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. */
1262static 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. */
1271static 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. */
1279static 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. */
1288static 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. */
1296static 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. */
1305static 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. */
1313static 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. */
1322static 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. */
1330static 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. */
1339static 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. */
1347static 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. */
1353static 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. */
1359static 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. */
1365static 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. */
1374static 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. */
1383static 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. */
1391static 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. */
1400static 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. */
1408static 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. */
1417static 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. */
1425static 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. */
1434static 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. */
1442static 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. */
1451static 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. */
1459static 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. */
1468static 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. */
1476static 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. */
1482static 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. */
1488static 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. */
1497static 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. */
1506static 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. */
1514static 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. */
1523static 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. */
1531static 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. */
1540static 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. */
1548static 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. */
1557static 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. */
1565static 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. */
1574static 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. */
1582static 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. */
1591static 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. */
1599static 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. */
1608static 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. */
1616static 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. */
1622static 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. */
1631static 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. */
1640static 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. */
1648static 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. */
1654static 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. */
1660static 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. */
1666static 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. */
1672static 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. */
1678static 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. */
1684static 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. */
1694static 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. */
1703static 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. */
1712static 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. */
1721static 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. */
1729static 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. */
1738static 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. */
1746static 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. */
1752static 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. */
1758static 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. */
1764static 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. */
1770static 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. */
1776static 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. */
1787static 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. */
1797static 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. */
1807static 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. */
1817static 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. */
1826static 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. */
1835static 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. */
1844static 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. */
1853static 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. */
1861static 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. */
1870static 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. */
1878static 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. */
1887static 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. */
1895static 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. */
1901static 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. */
1907static 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. */
1913static 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. */
1919static 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. */
1928static 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. */
1937static 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. */
1945static 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. */
1954static 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. */
1962static 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. */
1971static 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. */
1979static 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. */
1988static 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. */
1996static 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. */
2002static 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. */
2008static 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. */
2014static 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. */
2023static 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. */
2032static 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. */
2040static 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. */
2049static 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. */
2057static 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. */
2066static 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. */
2074static 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. */
2083static 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. */
2091static 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. */
2100static 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. */
2108static 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. */
2114static 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. */
2120static 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. */
2129static 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. */
2138static 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. */
2146static 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. */
2155static 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. */
2163static 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. */
2172static 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. */
2180static 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. */
2189static 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. */
2197static 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. */
2206static 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. */
2214static 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. */
2223static 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. */
2231static 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. */
2237static 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. */
2246static 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. */
2255static 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. */
2263static 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. */
2269static 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. */
2275static 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. */
2281static 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. */
2287static 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. */
2293static 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. */
2299static 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. */
2309static 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. */
2318static 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. */
2327static 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. */
2336static 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. */
2344static 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. */
2353static 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. */
2361static 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. */
2367static 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. */
2373static 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. */
2379static 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. */
2385static 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. */
2391static 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. */
2402static 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. */
2412static 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. */
2422static 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. */
2432static 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. */
2441static 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. */
2450static 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. */
2459static 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. */
2468static 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. */
2476static 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. */
2485static 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. */
2493static 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. */
2502static 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. */
2510static 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. */
2516static 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. */
2522static 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. */
2528static 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. */
2534static 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. */
2543static 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. */
2552static 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. */
2560static 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. */
2569static 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. */
2577static 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. */
2586static 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. */
2594static 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. */
2603static 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. */
2611static 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. */
2617static 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. */
2623static 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. */
2629static 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. */
2638static 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. */
2647static 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. */
2655static 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. */
2664static 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. */
2672static 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. */
2681static 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. */
2689static 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. */
2698static 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. */
2706static 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. */
2715static 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. */
2723static 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. */
2729static 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. */
2735static 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. */
2744static 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. */
2753static 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. */
2761static 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. */
2770static 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. */
2778static 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. */
2787static 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. */
2795static 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. */
2804static 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. */
2812static 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. */
2821static 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. */
2829static 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. */
2838static 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. */
2846static 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. */
2852static 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. */
2861static 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. */
2870static 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. */
2878static 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. */
2884static 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. */
2890static 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. */
2896static 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. */
2902static 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. */
2908static 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. */
2918static 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. */
2927static 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. */
2936static 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. */
2945static 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. */
2953static 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. */
2962static 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. */
2970static 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. */
2976static 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. */
2982static 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. */
2988static 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. */
2994static 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. */
3005static 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. */
3015static 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. */
3025static 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. */
3035static 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. */
3044static 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. */
3053static 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. */
3062static 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. */
3071static 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. */
3079static 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. */
3088static 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. */
3096static 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. */
3105static 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. */
3113static 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. */
3119static 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. */
3125static 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. */
3131static 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. */
3140static 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. */
3149static 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. */
3157static 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. */
3166static 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. */
3174static 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. */
3183static 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. */
3191static 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. */
3200static 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. */
3208static 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. */
3214static 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. */
3220static 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. */
3229static 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. */
3238static 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. */
3246static 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. */
3255static 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. */
3263static 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. */
3272static 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. */
3280static 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. */
3289static 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. */
3297static 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. */
3306static 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. */
3314static 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. */
3320static 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. */
3329static 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. */
3338static 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. */
3346static 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. */
3352static 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. */
3358static 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. */
3364static 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. */
3370static 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. */
3376static 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. */
3386static 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. */
3395static 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. */
3404static 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. */
3413static 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. */
3421static 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. */
3430static 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. */
3438static 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. */
3444static 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. */
3450static 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. */
3456static 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. */
3462static 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. */
3473static 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. */
3483static 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. */
3493static 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. */
3503static 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. */
3512static 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. */
3521static 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. */
3530static 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. */
3539static 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. */
3547static 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. */
3556static 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. */
3564static 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. */
3573static 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. */
3581static 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. */
3587static 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. */
3593static 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. */
3599static 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. */
3608static 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. */
3617static 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. */
3625static 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. */
3634static 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. */
3642static 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. */
3651static 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. */
3659static 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. */
3668static 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. */
3676static 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. */
3682static 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. */
3688static 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. */
3697static 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. */
3706static 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. */
3714static 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. */
3723static 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. */
3731static 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. */
3740static 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. */
3748static 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. */
3757static 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. */
3765static 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. */
3774static 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. */
3782static 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. */
3788static 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. */
3797static 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. */
3805static 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. */
3813static 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. */
3819static 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. */
3825static 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. */
3831static 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. */
3837static 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. */
3843static 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. */
3853static 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. */
3862static 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. */
3871static 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. */
3880static 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. */
3888static 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. */
3897static 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. */
3905static 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. */
3911static 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. */
3917static 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. */
3923static 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. */
3929static 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. */
3940static 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. */
3950static 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. */
3960static 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. */
3970static 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. */
3979static 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. */
3988static 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. */
3997static 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. */
4005static 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. */
4013static 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. */
4021static 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. */
4029static 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. */
4037static 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. */
4045static 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. */
4051static 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. */
4057static 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. */
4063static 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. */
4072static 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. */
4081static 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. */
4089static 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. */
4098static 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. */
4106static 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. */
4115static 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. */
4123static 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. */
4132static 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. */
4140static 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. */
4146static 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. */
4152static 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. */
4161static 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. */
4170static 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. */
4178static 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. */
4187static 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. */
4195static 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. */
4204static 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. */
4212static 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. */
4221static 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. */
4229static 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. */
4238static 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. */
4246static 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. */
4252static 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. */
4261static 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. */
4270static 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. */
4278static 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. */
4284static 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. */
4290static 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. */
4296static 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. */
4302static 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. */
4312static 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. */
4321static 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. */
4330static 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. */
4339static 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. */
4347static 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. */
4356static 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. */
4364static 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. */
4370static 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. */
4376static 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. */
4382static 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. */
4393static 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. */
4403static 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. */
4413static 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. */
4423static 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. */
4432static 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. */
4441static 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. */
4450static 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. */
4459static 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. */
4467static 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. */
4476static 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. */
4484static 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. */
4493static 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. */
4501static 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. */
4507static 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. */
4513static 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. */
4522static 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. */
4531static 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. */
4539static 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. */
4548static 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. */
4556static 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. */
4565static 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. */
4573static 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. */
4582static 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. */
4590static 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. */
4596static 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. */
4605static 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. */
4614static 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. */
4622static 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. */
4628static 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. */
4634static 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. */
4640static 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. */
4646static 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. */
4656static 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. */
4665static 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. */
4674static 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. */
4683static 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. */
4691static 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. */
4700static 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. */
4708static 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. */
4714static 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. */
4720static 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. */
4726static 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. */
4737static 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. */
4747static 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. */
4757static 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. */
4767static 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. */
4776static 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. */
4785static 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. */
4794static 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. */
4803static 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. */
4811static 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. */
4820static 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. */
4828static 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. */
4837static 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. */
4845static 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. */
4851static 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. */
4857static 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. */
4866static 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. */
4875static 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. */
4883static 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. */
4892static 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. */
4900static 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. */
4909static 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. */
4917static 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. */
4926static 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. */
4934static 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. */
4940static 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. */
4949static 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. */
4957static 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. */
4965static 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. */
4971static 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. */
4977static 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. */
4983static 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. */
4989static 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. */
4999static 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. */
5008static 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. */
5017static 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. */
5026static 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. */
5034static 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. */
5043static 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. */
5051static 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. */
5057static 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. */
5063static 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. */
5069static 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. */
5080static 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. */
5090static 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. */
5100static 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. */
5110static 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. */
5119static 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. */
5128static 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. */
5137static 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. */
5145static 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. */
5153static 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. */
5161static 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. */
5169static 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. */
5177static 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. */
5185static 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. */
5191static 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. */
5197static 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. */
5206static 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. */
5215static 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. */
5223static 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. */
5232static 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. */
5240static 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. */
5249static 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. */
5257static 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. */
5266static 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. */
5274static inline SIMD_CFUNC simd_double8 simd_make_double8(simd_double8 other) {
5275 return other;
5276}
5277
5278#ifdef __cplusplus
5279} /* extern "C" */
5280
5281namespace simd {
5282/*! @abstract Concatenates `x` and `y` to form a vector of two 8-bit signed
5283 * (twos-complement) integers. */
5284static 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. */
5290template <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. */
5297template <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. */
5303static 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. */
5309static 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. */
5315static 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. */
5321template <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. */
5328template <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. */
5334static 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. */
5340static 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. */
5346static 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. */
5352static 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. */
5358static 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. */
5364static 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. */
5370static 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. */
5376template <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. */
5383template <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. */
5389static 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. */
5395template <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. */
5402template <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. */
5408static 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. */
5414template <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. */
5421template <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. */
5427static 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. */
5433template <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. */
5440template <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. */
5446static 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. */
5452template <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. */
5459template <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. */
5465static 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. */
5471template <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. */
5478template <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. */
5484static 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. */
5490static 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. */
5496static 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. */
5502template <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. */
5509template <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. */
5515static 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. */
5521static 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. */
5527static 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. */
5533static 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. */
5539static 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. */
5545static 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. */
5551static 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. */
5557template <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. */
5564template <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. */
5570static 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. */
5576template <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. */
5583template <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. */
5589static 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. */
5595template <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. */
5602template <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. */
5608static 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. */
5614template <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. */
5621template <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. */
5627static 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. */
5633template <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. */
5640template <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. */
5646static 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. */
5652template <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. */
5659template <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. */
5665static 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. */
5671static 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. */
5677static 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. */
5683template <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. */
5690template <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. */
5696static 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. */
5702static 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. */
5708static 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. */
5714static 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. */
5720static 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. */
5726static 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. */
5732static 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. */
5738template <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. */
5745template <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. */
5751static 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. */
5757template <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. */
5764template <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. */
5770static 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. */
5776template <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. */
5783template <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. */
5789static 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. */
5795template <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. */
5802template <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. */
5808static 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. */
5814template <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. */
5821template <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. */
5827static 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. */
5833static 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. */
5839static 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. */
5845template <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. */
5852template <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. */
5858static 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. */
5864static 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. */
5870static 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. */
5876static 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. */
5882static 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. */
5888static 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. */
5894static 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. */
5900template <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. */
5907template <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. */
5913static 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. */
5919template <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. */
5926template <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. */
5932static 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. */
5938template <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. */
5945template <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. */
5951static 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. */
5957template <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. */
5964template <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. */
5970static 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. */
5976template <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. */
5983template <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. */
5989static 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. */
5995static 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. */
6001static 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. */
6007template <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. */
6014template <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. */
6020static 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. */
6026static 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. */
6032static 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. */
6038static 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. */
6044static 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. */
6050static 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. */
6056static 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. */
6062template <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. */
6069template <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. */
6075static 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. */
6081template <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. */
6088template <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. */
6094static 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. */
6100template <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. */
6107template <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. */
6113static 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. */
6119template <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. */
6126template <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. */
6132static 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. */
6138static 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. */
6144static 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. */
6150template <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. */
6157template <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. */
6163static 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. */
6169static 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. */
6175static 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. */
6181static 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. */
6187static 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. */
6193static 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. */
6199static 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. */
6205template <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. */
6212template <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. */
6218static 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. */
6224template <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. */
6231template <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. */
6237static 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. */
6243template <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. */
6250template <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. */
6256static 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. */
6262template <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. */
6268template <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. */
6274static 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. */
6280static 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. */
6286static 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. */
6292template <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. */
6299template <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. */
6305static 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. */
6311static 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. */
6317static 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. */
6323static 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. */
6329static 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. */
6335static 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. */
6341static 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. */
6347template <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. */
6353template <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. */
6359static 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. */
6365template <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. */
6372template <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. */
6378static 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. */
6384template <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. */
6391template <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. */
6397static 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. */
6403template <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. */
6410template <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. */
6416static 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. */
6422static 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. */
6428static 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. */
6434template <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. */
6441template <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. */
6447static 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. */
6453static 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. */
6459static 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. */
6465static 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. */
6471static 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. */
6477static 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. */
6483static 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. */
6489template <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. */
6496template <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. */
6502static 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. */
6508template <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. */
6515template <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. */
6521static 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. */
6527template <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. */
6534template <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. */
6540static 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. */
6546static 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. */
6552static 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. */
6558template <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. */
6565template <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. */
6571static 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. */
6577static 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. */
6583static 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. */
6589static 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. */
6595static 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. */
6601static 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. */
6607static 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. */
6613template <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. */
6620template <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. */
6626static 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. */
6632template <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. */
6639template <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. */
6645static 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. */
6651template <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. */
6657template <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. */
6663static 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. */
6669static 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. */
6675static 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. */
6681template <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. */
6688template <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. */
6694static 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. */
6700static 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. */
6706static 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. */
6712static 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. */
6718static 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. */
6724static 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. */
6730static 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. */
6736template <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. */
6742template <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. */
6748static 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. */
6754template <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. */
6761template <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/aarch64-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. */
101typedef 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. */
108typedef __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. */
114typedef __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. */
121typedef __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. */
129typedef __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. */
137typedef __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. */
146typedef __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. */
155typedef __attribute__((__ext_vector_type__(64),__aligned__(16))) char simd_char64;
156
157/*! @abstract A scalar 8-bit unsigned integer. */
158typedef 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. */
166typedef __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. */
172typedef __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. */
180typedef __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. */
188typedef __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. */
196typedef __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. */
204typedef __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. */
212typedef __attribute__((__ext_vector_type__(64),__aligned__(16))) unsigned char simd_uchar64;
213
214/*! @abstract A scalar 16-bit signed (twos-complement) integer. */
215typedef 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. */
223typedef __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. */
229typedef __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. */
237typedef __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. */
245typedef __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. */
253typedef __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. */
262typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) short simd_short32;
263
264/*! @abstract A scalar 16-bit unsigned integer. */
265typedef 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. */
273typedef __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. */
279typedef __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. */
287typedef __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. */
295typedef __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. */
303typedef __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. */
311typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned short simd_ushort32;
312
313/*! @abstract A scalar 32-bit signed (twos-complement) integer. */
314typedef 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. */
321typedef __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. */
327typedef __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. */
334typedef __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. */
342typedef __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. */
350typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) int simd_int16;
351
352/*! @abstract A scalar 32-bit unsigned integer. */
353typedef 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. */
361typedef __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. */
367typedef __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. */
375typedef __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. */
383typedef __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. */
391typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned int simd_uint16;
392
393/*! @abstract A scalar 32-bit floating-point number. */
394typedef 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. */
402typedef __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. */
408typedef __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. */
416typedef __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. */
424typedef __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. */
432typedef __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__
436typedef long simd_long1;
437#else
438typedef 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. */
447typedef __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. */
453typedef __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. */
461typedef __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. */
469typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) simd_long1 simd_long8;
470
471/*! @abstract A scalar 64-bit unsigned integer. */
472#if defined __LP64__
473typedef unsigned long simd_ulong1;
474#else
475typedef 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. */
484typedef __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. */
490typedef __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. */
498typedef __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. */
506typedef __attribute__((__ext_vector_type__(8),__aligned__(16))) simd_ulong1 simd_ulong8;
507
508/*! @abstract A scalar 64-bit floating-point number. */
509typedef 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. */
517typedef __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. */
523typedef __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. */
531typedef __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. */
539typedef __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. */
547namespace 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. */
551typedef ::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. */
559typedef ::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. */
565typedef ::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. */
573typedef ::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. */
581typedef ::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. */
589typedef ::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. */
598typedef ::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. */
607typedef ::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. */
612typedef ::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. */
620typedef ::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. */
626typedef ::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. */
634typedef ::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. */
642typedef ::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. */
650typedef ::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. */
658typedef ::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. */
666typedef ::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. */
671typedef ::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. */
679typedef ::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. */
685typedef ::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. */
693typedef ::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. */
701typedef ::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. */
710typedef ::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. */
719typedef ::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. */
724typedef ::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. */
732typedef ::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. */
738typedef ::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. */
746typedef ::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. */
754typedef ::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. */
762typedef ::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. */
770typedef ::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. */
774typedef ::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. */
781typedef ::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. */
787typedef ::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. */
794typedef ::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. */
802typedef ::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. */
811typedef ::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. */
816typedef ::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. */
824typedef ::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. */
830typedef ::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. */
838typedef ::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. */
846typedef ::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. */
854typedef ::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. */
859typedef ::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. */
867typedef ::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. */
873typedef ::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. */
881typedef ::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. */
889typedef ::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. */
897typedef ::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. */
902typedef ::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. */
910typedef ::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. */
916typedef ::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. */
924typedef ::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. */
932typedef ::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. */
937typedef ::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. */
945typedef ::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. */
951typedef ::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. */
959typedef ::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. */
967typedef ::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. */
972typedef ::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. */
980typedef ::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. */
986typedef ::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. */
994typedef ::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. */
1002typedef ::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. */
1016typedef 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. */
1021typedef 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. */
1026typedef 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. */
1031typedef 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. */
1036typedef 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. */
1042typedef 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. */
1047typedef 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. */
1052typedef 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. */
1057typedef 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. */
1062typedef 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. */
1067typedef 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. */
1072typedef 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. */
1077typedef 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. */
1082typedef 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. */
1087typedef 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. */
1092typedef 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. */
1097typedef 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. */
1103typedef 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. */
1108typedef 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. */
1113typedef 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. */
1118typedef 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. */
1123typedef 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. */
1128typedef 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. */
1133typedef 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. */
1138typedef 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. */
1143typedef 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. */
1148typedef 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. */
1153typedef 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. */
1158typedef 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. */
1163typedef 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. */
1168typedef 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. */
1173typedef 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. */
1178typedef 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. */
1183typedef 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. */
1188typedef 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. */
1193typedef 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. */
1198typedef 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. */
1203typedef 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. */
1208typedef 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. */
1213typedef 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. */
1218typedef 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. */
1223typedef 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. */
1228typedef 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. */
1233typedef 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. */
1238typedef 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. */
1243typedef 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. */
1248typedef 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. */
1253typedef 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. */
1258typedef 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. */
1263typedef 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. */
1268typedef 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. */
1273typedef 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. */
1278typedef simd_double8 vector_double8;
1279
1280# endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
1281#endif
lib/libc/include/aarch64-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 */
51typedef void *posix_spawnattr_t;
52typedef 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
60int 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
66int 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
72int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
73
74int 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
77int 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
81int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
82
83int posix_spawn_file_actions_init(posix_spawn_file_actions_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
84
85int posix_spawnattr_destroy(posix_spawnattr_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
86
87int 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
90int posix_spawnattr_getflags(const posix_spawnattr_t * __restrict,
91 short * __restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
92
93int 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
96int 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
99int posix_spawnattr_init(posix_spawnattr_t *) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
100
101int 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
104int posix_spawnattr_setflags(posix_spawnattr_t *, short) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
105
106int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos);
107
108int 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 */
112int posix_spawnattr_setschedparam(posix_spawnattr_t * __restrict,
113 const struct sched_param * __restrict);
114int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int);
115int posix_spawnattr_getschedparam(const posix_spawnattr_t * __restrict,
116 struct sched_param * __restrict);
117int 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
135int 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
138int 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
141int posix_spawnattr_setauditsessionport_np(posix_spawnattr_t * __restrict,
142 mach_port_t) __API_AVAILABLE(macos(10.6), ios(3.2));
143
144int 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
147int 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
150int 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
154int 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
157int posix_spawnattr_setsuidcredport_np(posix_spawnattr_t * __restrict, mach_port_t) __API_UNAVAILABLE(ios, macos);
158
159int 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 */
165int 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
175int 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
178int 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
181int 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/aarch64-macos-gnu/stdint.h created+205
......@@ -0,0 +1,205 @@
1/*
2 * Copyright (c) 2000-2010 Apple Inc.
3 * All rights reserved.
4 */
5
6#ifndef _STDINT_H_
7#define _STDINT_H_
8
9#if __LP64__
10#define __WORDSIZE 64
11#else
12#define __WORDSIZE 32
13#endif
14
15/* from ISO/IEC 988:1999 spec */
16
17/* 7.18.1.1 Exact-width integer types */
18#include <sys/_types/_int8_t.h>
19#include <sys/_types/_int16_t.h>
20#include <sys/_types/_int32_t.h>
21#include <sys/_types/_int64_t.h>
22
23#include <_types/_uint8_t.h>
24#include <_types/_uint16_t.h>
25#include <_types/_uint32_t.h>
26#include <_types/_uint64_t.h>
27
28/* 7.18.1.2 Minimum-width integer types */
29typedef int8_t int_least8_t;
30typedef int16_t int_least16_t;
31typedef int32_t int_least32_t;
32typedef int64_t int_least64_t;
33typedef uint8_t uint_least8_t;
34typedef uint16_t uint_least16_t;
35typedef uint32_t uint_least32_t;
36typedef uint64_t uint_least64_t;
37
38
39/* 7.18.1.3 Fastest-width integer types */
40typedef int8_t int_fast8_t;
41typedef int16_t int_fast16_t;
42typedef int32_t int_fast32_t;
43typedef int64_t int_fast64_t;
44typedef uint8_t uint_fast8_t;
45typedef uint16_t uint_fast16_t;
46typedef uint32_t uint_fast32_t;
47typedef uint64_t uint_fast64_t;
48
49
50/* 7.18.1.4 Integer types capable of holding object pointers */
51
52#include <sys/_types.h>
53#include <sys/_types/_intptr_t.h>
54#include <sys/_types/_uintptr_t.h>
55
56
57/* 7.18.1.5 Greatest-width integer types */
58#include <_types/_intmax_t.h>
59#include <_types/_uintmax_t.h>
60
61/* 7.18.4 Macros for integer constants */
62#define INT8_C(v) (v)
63#define INT16_C(v) (v)
64#define INT32_C(v) (v)
65#define INT64_C(v) (v ## LL)
66
67#define UINT8_C(v) (v)
68#define UINT16_C(v) (v)
69#define UINT32_C(v) (v ## U)
70#define UINT64_C(v) (v ## ULL)
71
72#ifdef __LP64__
73#define INTMAX_C(v) (v ## L)
74#define UINTMAX_C(v) (v ## UL)
75#else
76#define INTMAX_C(v) (v ## LL)
77#define UINTMAX_C(v) (v ## ULL)
78#endif
79
80/* 7.18.2 Limits of specified-width integer types:
81 * These #defines specify the minimum and maximum limits
82 * of each of the types declared above.
83 *
84 * They must have "the same type as would an expression that is an
85 * object of the corresponding type converted according to the integer
86 * promotion".
87 */
88
89
90/* 7.18.2.1 Limits of exact-width integer types */
91#define INT8_MAX 127
92#define INT16_MAX 32767
93#define INT32_MAX 2147483647
94#define INT64_MAX 9223372036854775807LL
95
96#define INT8_MIN -128
97#define INT16_MIN -32768
98 /*
99 Note: the literal "most negative int" cannot be written in C --
100 the rules in the standard (section 6.4.4.1 in C99) will give it
101 an unsigned type, so INT32_MIN (and the most negative member of
102 any larger signed type) must be written via a constant expression.
103 */
104#define INT32_MIN (-INT32_MAX-1)
105#define INT64_MIN (-INT64_MAX-1)
106
107#define UINT8_MAX 255
108#define UINT16_MAX 65535
109#define UINT32_MAX 4294967295U
110#define UINT64_MAX 18446744073709551615ULL
111
112/* 7.18.2.2 Limits of minimum-width integer types */
113#define INT_LEAST8_MIN INT8_MIN
114#define INT_LEAST16_MIN INT16_MIN
115#define INT_LEAST32_MIN INT32_MIN
116#define INT_LEAST64_MIN INT64_MIN
117
118#define INT_LEAST8_MAX INT8_MAX
119#define INT_LEAST16_MAX INT16_MAX
120#define INT_LEAST32_MAX INT32_MAX
121#define INT_LEAST64_MAX INT64_MAX
122
123#define UINT_LEAST8_MAX UINT8_MAX
124#define UINT_LEAST16_MAX UINT16_MAX
125#define UINT_LEAST32_MAX UINT32_MAX
126#define UINT_LEAST64_MAX UINT64_MAX
127
128/* 7.18.2.3 Limits of fastest minimum-width integer types */
129#define INT_FAST8_MIN INT8_MIN
130#define INT_FAST16_MIN INT16_MIN
131#define INT_FAST32_MIN INT32_MIN
132#define INT_FAST64_MIN INT64_MIN
133
134#define INT_FAST8_MAX INT8_MAX
135#define INT_FAST16_MAX INT16_MAX
136#define INT_FAST32_MAX INT32_MAX
137#define INT_FAST64_MAX INT64_MAX
138
139#define UINT_FAST8_MAX UINT8_MAX
140#define UINT_FAST16_MAX UINT16_MAX
141#define UINT_FAST32_MAX UINT32_MAX
142#define UINT_FAST64_MAX UINT64_MAX
143
144/* 7.18.2.4 Limits of integer types capable of holding object pointers */
145
146#if __WORDSIZE == 64
147#define INTPTR_MAX 9223372036854775807L
148#else
149#define INTPTR_MAX 2147483647L
150#endif
151#define INTPTR_MIN (-INTPTR_MAX-1)
152
153#if __WORDSIZE == 64
154#define UINTPTR_MAX 18446744073709551615UL
155#else
156#define UINTPTR_MAX 4294967295UL
157#endif
158
159/* 7.18.2.5 Limits of greatest-width integer types */
160#define INTMAX_MAX INTMAX_C(9223372036854775807)
161#define UINTMAX_MAX UINTMAX_C(18446744073709551615)
162#define INTMAX_MIN (-INTMAX_MAX-1)
163
164/* 7.18.3 "Other" */
165#if __WORDSIZE == 64
166#define PTRDIFF_MIN INTMAX_MIN
167#define PTRDIFF_MAX INTMAX_MAX
168#else
169#define PTRDIFF_MIN INT32_MIN
170#define PTRDIFF_MAX INT32_MAX
171#endif
172
173#define SIZE_MAX UINTPTR_MAX
174
175#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
176#define RSIZE_MAX (SIZE_MAX >> 1)
177#endif
178
179#ifndef WCHAR_MAX
180# ifdef __WCHAR_MAX__
181# define WCHAR_MAX __WCHAR_MAX__
182# else
183# define WCHAR_MAX 0x7fffffff
184# endif
185#endif
186
187/* WCHAR_MIN should be 0 if wchar_t is an unsigned type and
188 (-WCHAR_MAX-1) if wchar_t is a signed type. Unfortunately,
189 it turns out that -fshort-wchar changes the signedness of
190 the type. */
191#ifndef WCHAR_MIN
192# if WCHAR_MAX == 0xffff
193# define WCHAR_MIN 0
194# else
195# define WCHAR_MIN (-WCHAR_MAX-1)
196# endif
197#endif
198
199#define WINT_MIN INT32_MIN
200#define WINT_MAX INT32_MAX
201
202#define SIG_ATOMIC_MIN INT32_MIN
203#define SIG_ATOMIC_MAX INT32_MAX
204
205#endif /* _STDINT_H_ */
lib/libc/include/aarch64-macos-gnu/stdio.h created+410
......@@ -0,0 +1,410 @@
1/*
2 * Copyright (c) 2000, 2005, 2007, 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 * 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 * Chris Torek.
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 * @(#)stdio.h 8.5 (Berkeley) 4/29/95
59 */
60
61#ifndef _STDIO_H_
62#define _STDIO_H_
63
64#include <_stdio.h>
65
66__BEGIN_DECLS
67extern FILE *__stdinp;
68extern FILE *__stdoutp;
69extern FILE *__stderrp;
70__END_DECLS
71
72#define __SLBF 0x0001 /* line buffered */
73#define __SNBF 0x0002 /* unbuffered */
74#define __SRD 0x0004 /* OK to read */
75#define __SWR 0x0008 /* OK to write */
76 /* RD and WR are never simultaneously asserted */
77#define __SRW 0x0010 /* open for reading & writing */
78#define __SEOF 0x0020 /* found EOF */
79#define __SERR 0x0040 /* found error */
80#define __SMBF 0x0080 /* _buf is from malloc */
81#define __SAPP 0x0100 /* fdopen()ed in append mode */
82#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
83#define __SOPT 0x0400 /* do fseek() optimisation */
84#define __SNPT 0x0800 /* do not do fseek() optimisation */
85#define __SOFF 0x1000 /* set iff _offset is in fact correct */
86#define __SMOD 0x2000 /* true => fgetln modified _p text */
87#define __SALC 0x4000 /* allocate string space dynamically */
88#define __SIGN 0x8000 /* ignore this file in _fwalk */
89
90/*
91 * The following three definitions are for ANSI C, which took them
92 * from System V, which brilliantly took internal interface macros and
93 * made them official arguments to setvbuf(), without renaming them.
94 * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
95 *
96 * Although numbered as their counterparts above, the implementation
97 * does not rely on this.
98 */
99#define _IOFBF 0 /* setvbuf should set fully buffered */
100#define _IOLBF 1 /* setvbuf should set line buffered */
101#define _IONBF 2 /* setvbuf should set unbuffered */
102
103#define BUFSIZ 1024 /* size of buffer used by setbuf */
104#define EOF (-1)
105
106 /* must be == _POSIX_STREAM_MAX <limits.h> */
107#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
108#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
109
110/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
111#ifndef _ANSI_SOURCE
112#define P_tmpdir "/var/tmp/"
113#endif
114#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
115#define TMP_MAX 308915776
116
117#ifndef SEEK_SET
118#define SEEK_SET 0 /* set file offset to offset */
119#endif
120#ifndef SEEK_CUR
121#define SEEK_CUR 1 /* set file offset to current plus offset */
122#endif
123#ifndef SEEK_END
124#define SEEK_END 2 /* set file offset to EOF plus offset */
125#endif
126
127#define stdin __stdinp
128#define stdout __stdoutp
129#define stderr __stderrp
130
131#ifdef _DARWIN_UNLIMITED_STREAMS
132#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
133#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it."
134#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
135#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it."
136#endif
137#endif
138
139/* ANSI-C */
140
141__BEGIN_DECLS
142void clearerr(FILE *);
143int fclose(FILE *);
144int feof(FILE *);
145int ferror(FILE *);
146int fflush(FILE *);
147int fgetc(FILE *);
148int fgetpos(FILE * __restrict, fpos_t *);
149char *fgets(char * __restrict, int, FILE *);
150#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
151FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen));
152#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
153FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
154#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
155int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
156int fputc(int, FILE *);
157int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
158size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
159FILE *freopen(const char * __restrict, const char * __restrict,
160 FILE * __restrict) __DARWIN_ALIAS(freopen);
161int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
162int fseek(FILE *, long, int);
163int fsetpos(FILE *, const fpos_t *);
164long ftell(FILE *);
165size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
166int getc(FILE *);
167int getchar(void);
168char *gets(char *);
169void perror(const char *) __cold;
170int printf(const char * __restrict, ...) __printflike(1, 2);
171int putc(int, FILE *);
172int putchar(int);
173int puts(const char *);
174int remove(const char *);
175int rename (const char *__old, const char *__new);
176void rewind(FILE *);
177int scanf(const char * __restrict, ...) __scanflike(1, 2);
178void setbuf(FILE * __restrict, char * __restrict);
179int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
180int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("Use snprintf instead.");
181int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
182FILE *tmpfile(void);
183
184__swift_unavailable("Use mkstemp(3) instead.")
185#if !defined(_POSIX_C_SOURCE)
186__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
187#endif
188char *tmpnam(char *);
189int ungetc(int, FILE *);
190int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
191int vprintf(const char * __restrict, va_list) __printflike(1, 0);
192int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailable("Use vsnprintf instead.");
193__END_DECLS
194
195
196
197/* Additional functionality provided by:
198 * POSIX.1-1988
199 */
200
201#if __DARWIN_C_LEVEL >= 198808L
202#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
203
204__BEGIN_DECLS
205#include <_ctermid.h>
206
207#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
208FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
209#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
210FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
211#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
212int fileno(FILE *);
213__END_DECLS
214#endif /* __DARWIN_C_LEVEL >= 198808L */
215
216
217/* Additional functionality provided by:
218 * POSIX.2-1992 C Language Binding Option
219 */
220#if TARGET_OS_IPHONE
221#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
222#else
223#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
224#endif
225
226#if __DARWIN_C_LEVEL >= 199209L
227__BEGIN_DECLS
228int pclose(FILE *) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
229#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
230FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
231#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
232FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
233#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
234__END_DECLS
235#endif /* __DARWIN_C_LEVEL >= 199209L */
236
237#undef __swift_unavailable_on
238
239/* Additional functionality provided by:
240 * POSIX.1c-1995,
241 * POSIX.1i-1995,
242 * and the omnibus ISO/IEC 9945-1: 1996
243 */
244
245#if __DARWIN_C_LEVEL >= 199506L
246
247/* Functions internal to the implementation. */
248__BEGIN_DECLS
249int __srget(FILE *);
250int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
251int __swbuf(int, FILE *);
252__END_DECLS
253
254/*
255 * The __sfoo macros are here so that we can
256 * define function versions in the C library.
257 */
258#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
259#if defined(__GNUC__) && defined(__STDC__)
260__header_always_inline int __sputc(int _c, FILE *_p) {
261 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
262 return (*_p->_p++ = _c);
263 else
264 return (__swbuf(_c, _p));
265}
266#else
267/*
268 * This has been tuned to generate reasonable code on the vax using pcc.
269 */
270#define __sputc(c, p) \
271 (--(p)->_w < 0 ? \
272 (p)->_w >= (p)->_lbfsize ? \
273 (*(p)->_p = (c)), *(p)->_p != '\n' ? \
274 (int)*(p)->_p++ : \
275 __swbuf('\n', p) : \
276 __swbuf((int)(c), p) : \
277 (*(p)->_p = (c), (int)*(p)->_p++))
278#endif
279
280#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
281#define __sferror(p) (((p)->_flags & __SERR) != 0)
282#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
283#define __sfileno(p) ((p)->_file)
284
285__BEGIN_DECLS
286void flockfile(FILE *);
287int ftrylockfile(FILE *);
288void funlockfile(FILE *);
289int getc_unlocked(FILE *);
290int getchar_unlocked(void);
291int putc_unlocked(int, FILE *);
292int putchar_unlocked(int);
293
294/* Removed in Issue 6 */
295#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
296int getw(FILE *);
297int putw(int, FILE *);
298#endif
299
300__swift_unavailable("Use mkstemp(3) instead.")
301#if !defined(_POSIX_C_SOURCE)
302__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")
303#endif
304char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
305__END_DECLS
306
307#ifndef lint
308#define getc_unlocked(fp) __sgetc(fp)
309#define putc_unlocked(x, fp) __sputc(x, fp)
310#endif /* lint */
311
312#define getchar_unlocked() getc_unlocked(stdin)
313#define putchar_unlocked(x) putc_unlocked(x, stdout)
314#endif /* __DARWIN_C_LEVEL >= 199506L */
315
316
317
318/* Additional functionality provided by:
319 * POSIX.1-2001
320 * ISO C99
321 */
322
323#if __DARWIN_C_LEVEL >= 200112L
324#include <sys/_types/_off_t.h>
325
326__BEGIN_DECLS
327int fseeko(FILE * __stream, off_t __offset, int __whence);
328off_t ftello(FILE * __stream);
329__END_DECLS
330#endif /* __DARWIN_C_LEVEL >= 200112L */
331
332#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
333__BEGIN_DECLS
334int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
335int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
336int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
337int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
338int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
339__END_DECLS
340#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
341
342
343
344/* Additional functionality provided by:
345 * POSIX.1-2008
346 */
347
348#if __DARWIN_C_LEVEL >= 200809L
349#include <sys/_types/_ssize_t.h>
350
351__BEGIN_DECLS
352int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
353int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
354ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
355ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
356FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
357FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
358__END_DECLS
359#endif /* __DARWIN_C_LEVEL >= 200809L */
360
361
362
363/* Darwin extensions */
364
365#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
366__BEGIN_DECLS
367extern __const int sys_nerr; /* perror(3) external variables */
368extern __const char *__const sys_errlist[];
369
370int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
371char *ctermid_r(char *);
372char *fgetln(FILE *, size_t *);
373__const char *fmtcheck(const char *, const char *);
374int fpurge(FILE *);
375void setbuffer(FILE *, char *, int);
376int setlinebuf(FILE *);
377int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
378FILE *zopen(const char *, const char *, int);
379
380
381/*
382 * Stdio function-access interface.
383 */
384FILE *funopen(const void *,
385 int (* _Nullable)(void *, char *, int),
386 int (* _Nullable)(void *, const char *, int),
387 fpos_t (* _Nullable)(void *, fpos_t, int),
388 int (* _Nullable)(void *));
389__END_DECLS
390#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
391#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
392
393#define feof_unlocked(p) __sfeof(p)
394#define ferror_unlocked(p) __sferror(p)
395#define clearerr_unlocked(p) __sclearerr(p)
396#define fileno_unlocked(p) __sfileno(p)
397
398#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
399
400
401#ifdef _USE_EXTENDED_LOCALES_
402#include <xlocale/_stdio.h>
403#endif /* _USE_EXTENDED_LOCALES_ */
404
405#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
406/* Security checking functions. */
407#include <secure/_stdio.h>
408#endif
409
410#endif /* _STDIO_H_ */
lib/libc/include/aarch64-macos-gnu/stdlib.h created+373
......@@ -0,0 +1,373 @@
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) 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 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
56 */
57
58#ifndef _STDLIB_H_
59#define _STDLIB_H_
60
61#include <Availability.h>
62#include <sys/cdefs.h>
63
64#include <_types.h>
65#if !defined(_ANSI_SOURCE)
66#include <sys/wait.h>
67#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
68#include <alloca.h>
69#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
70#endif /* !_ANSI_SOURCE */
71
72/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
73 * _GCC_SIZE_T */
74#include <sys/_types/_size_t.h>
75
76#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
77#include <sys/_types/_ct_rune_t.h>
78#include <sys/_types/_rune_t.h>
79#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
80
81#include <sys/_types/_wchar_t.h>
82
83typedef struct {
84 int quot; /* quotient */
85 int rem; /* remainder */
86} div_t;
87
88typedef struct {
89 long quot; /* quotient */
90 long rem; /* remainder */
91} ldiv_t;
92
93#if !__DARWIN_NO_LONG_LONG
94typedef struct {
95 long long quot;
96 long long rem;
97} lldiv_t;
98#endif /* !__DARWIN_NO_LONG_LONG */
99
100#include <sys/_types/_null.h>
101
102#define EXIT_FAILURE 1
103#define EXIT_SUCCESS 0
104
105#define RAND_MAX 0x7fffffff
106
107#ifdef _USE_EXTENDED_LOCALES_
108#include <_xlocale.h>
109#endif /* _USE_EXTENDED_LOCALES_ */
110
111#ifndef MB_CUR_MAX
112#ifdef _USE_EXTENDED_LOCALES_
113#define MB_CUR_MAX (___mb_cur_max())
114#ifndef MB_CUR_MAX_L
115#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
116#endif /* !MB_CUR_MAX_L */
117#else /* !_USE_EXTENDED_LOCALES_ */
118extern int __mb_cur_max;
119#define MB_CUR_MAX __mb_cur_max
120#endif /* _USE_EXTENDED_LOCALES_ */
121#endif /* MB_CUR_MAX */
122
123#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \
124 && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L)
125#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
126#endif
127
128#include <malloc/_malloc.h>
129
130__BEGIN_DECLS
131void abort(void) __cold __dead2;
132int abs(int) __pure2;
133int atexit(void (* _Nonnull)(void));
134double atof(const char *);
135int atoi(const char *);
136long atol(const char *);
137#if !__DARWIN_NO_LONG_LONG
138long long
139 atoll(const char *);
140#endif /* !__DARWIN_NO_LONG_LONG */
141void *bsearch(const void *__key, const void *__base, size_t __nel,
142 size_t __width, int (* _Nonnull __compar)(const void *, const void *));
143/* calloc is now declared in _malloc.h */
144div_t div(int, int) __pure2;
145void exit(int) __dead2;
146/* free is now declared in _malloc.h */
147char *getenv(const char *);
148long labs(long) __pure2;
149ldiv_t ldiv(long, long) __pure2;
150#if !__DARWIN_NO_LONG_LONG
151long long
152 llabs(long long);
153lldiv_t lldiv(long long, long long);
154#endif /* !__DARWIN_NO_LONG_LONG */
155/* malloc is now declared in _malloc.h */
156int mblen(const char *__s, size_t __n);
157size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
158int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
159/* posix_memalign is now declared in _malloc.h */
160void qsort(void *__base, size_t __nel, size_t __width,
161 int (* _Nonnull __compar)(const void *, const void *));
162int rand(void) __swift_unavailable("Use arc4random instead.");
163/* realloc is now declared in _malloc.h */
164void srand(unsigned) __swift_unavailable("Use arc4random instead.");
165double strtod(const char *, char **) __DARWIN_ALIAS(strtod);
166float strtof(const char *, char **) __DARWIN_ALIAS(strtof);
167long strtol(const char *__str, char **__endptr, int __base);
168long double
169 strtold(const char *, char **);
170#if !__DARWIN_NO_LONG_LONG
171long long
172 strtoll(const char *__str, char **__endptr, int __base);
173#endif /* !__DARWIN_NO_LONG_LONG */
174unsigned long
175 strtoul(const char *__str, char **__endptr, int __base);
176#if !__DARWIN_NO_LONG_LONG
177unsigned long long
178 strtoull(const char *__str, char **__endptr, int __base);
179#endif /* !__DARWIN_NO_LONG_LONG */
180
181#if TARGET_OS_IPHONE
182#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
183#else
184#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
185#endif
186
187__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable")
188__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
189__WATCHOS_PROHIBITED __TVOS_PROHIBITED
190int system(const char *) __DARWIN_ALIAS_C(system);
191
192#undef __swift_unavailable_on
193
194size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
195int wctomb(char *, wchar_t);
196
197#ifndef _ANSI_SOURCE
198void _Exit(int) __dead2;
199long a64l(const char *);
200double drand48(void);
201char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
202double erand48(unsigned short[3]);
203char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
204char *gcvt(double, int, char *); /* LEGACY */
205int getsubopt(char **, char * const *, char **);
206int grantpt(int);
207#if __DARWIN_UNIX03
208char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
209#else /* !__DARWIN_UNIX03 */
210char *initstate(unsigned long, char *, long);
211#endif /* __DARWIN_UNIX03 */
212long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
213char *l64a(long);
214void lcong48(unsigned short[7]);
215long lrand48(void) __swift_unavailable("Use arc4random instead.");
216char *mktemp(char *);
217int mkstemp(char *);
218long mrand48(void) __swift_unavailable("Use arc4random instead.");
219long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
220int posix_openpt(int);
221char *ptsname(int);
222
223#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
224int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
225#endif
226
227int putenv(char *) __DARWIN_ALIAS(putenv);
228long random(void) __swift_unavailable("Use arc4random instead.");
229int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
230#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
231char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
232#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
233char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
234#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
235unsigned short
236 *seed48(unsigned short[3]);
237int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
238#if __DARWIN_UNIX03
239void setkey(const char *) __DARWIN_ALIAS(setkey);
240#else /* !__DARWIN_UNIX03 */
241int setkey(const char *);
242#endif /* __DARWIN_UNIX03 */
243char *setstate(const char *);
244void srand48(long);
245#if __DARWIN_UNIX03
246void srandom(unsigned);
247#else /* !__DARWIN_UNIX03 */
248void srandom(unsigned long);
249#endif /* __DARWIN_UNIX03 */
250int unlockpt(int);
251#if __DARWIN_UNIX03
252int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
253#else /* !__DARWIN_UNIX03 */
254void unsetenv(const char *);
255#endif /* __DARWIN_UNIX03 */
256#endif /* !_ANSI_SOURCE */
257
258#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
259#include <machine/types.h>
260#include <sys/_types/_dev_t.h>
261#include <sys/_types/_mode_t.h>
262#include <_types/_uint32_t.h>
263
264uint32_t arc4random(void);
265void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
266 __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
267 __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
268 __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
269 __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
270void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
271void arc4random_stir(void);
272uint32_t
273 arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
274#ifdef __BLOCKS__
275int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
276void *bsearch_b(const void *__key, const void *__base, size_t __nel,
277 size_t __width, int (^ _Nonnull __compar)(const void *, const void *)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
278#endif /* __BLOCKS__ */
279
280 /* getcap(3) functions */
281char *cgetcap(char *, const char *, int);
282int cgetclose(void);
283int cgetent(char **, char **, const char *);
284int cgetfirst(char **, char **);
285int cgetmatch(const char *, const char *);
286int cgetnext(char **, char **);
287int cgetnum(char *, const char *, long *);
288int cgetset(const char *);
289int cgetstr(char *, const char *, char **);
290int cgetustr(char *, const char *, char **);
291
292int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
293char *devname(dev_t, mode_t);
294char *devname_r(dev_t, mode_t, char *buf, int len);
295char *getbsize(int *, long *);
296int getloadavg(double [], int);
297const char
298 *getprogname(void);
299void setprogname(const char *);
300
301#ifdef __BLOCKS__
302#if __has_attribute(noescape)
303#define __sort_noescape __attribute__((__noescape__))
304#else
305#define __sort_noescape
306#endif
307#endif /* __BLOCKS__ */
308
309int heapsort(void *__base, size_t __nel, size_t __width,
310 int (* _Nonnull __compar)(const void *, const void *));
311#ifdef __BLOCKS__
312int heapsort_b(void *__base, size_t __nel, size_t __width,
313 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
314 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
315#endif /* __BLOCKS__ */
316int mergesort(void *__base, size_t __nel, size_t __width,
317 int (* _Nonnull __compar)(const void *, const void *));
318#ifdef __BLOCKS__
319int mergesort_b(void *__base, size_t __nel, size_t __width,
320 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
321 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
322#endif /* __BLOCKS__ */
323void psort(void *__base, size_t __nel, size_t __width,
324 int (* _Nonnull __compar)(const void *, const void *))
325 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
326#ifdef __BLOCKS__
327void psort_b(void *__base, size_t __nel, size_t __width,
328 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
329 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
330#endif /* __BLOCKS__ */
331void psort_r(void *__base, size_t __nel, size_t __width, void *,
332 int (* _Nonnull __compar)(void *, const void *, const void *))
333 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
334#ifdef __BLOCKS__
335void qsort_b(void *__base, size_t __nel, size_t __width,
336 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
337 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
338#endif /* __BLOCKS__ */
339void qsort_r(void *__base, size_t __nel, size_t __width, void *,
340 int (* _Nonnull __compar)(void *, const void *, const void *));
341int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
342 unsigned __endbyte);
343int rpmatch(const char *)
344 __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
345int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
346 unsigned __endbyte);
347void sranddev(void);
348void srandomdev(void);
349void *reallocf(void *__ptr, size_t __size) __alloc_size(2);
350long 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));
353#if !__DARWIN_NO_LONG_LONG
354long long
355 strtoq(const char *__str, char **__endptr, int __base);
356unsigned long long
357 strtouq(const char *__str, char **__endptr, int __base);
358#endif /* !__DARWIN_NO_LONG_LONG */
359extern char *suboptarg; /* getsubopt(3) external variable */
360/* valloc is now declared in _malloc.h */
361#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
362
363/* Poison the following routines if -fshort-wchar is set */
364#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
365#pragma GCC poison mbstowcs mbtowc wcstombs wctomb
366#endif
367__END_DECLS
368
369#ifdef _USE_EXTENDED_LOCALES_
370#include <xlocale/_stdlib.h>
371#endif /* _USE_EXTENDED_LOCALES_ */
372
373#endif /* _STDLIB_H_ */
lib/libc/include/aarch64-macos-gnu/string.h created+197
......@@ -0,0 +1,197 @@
1/*
2 * Copyright (c) 2000, 2007, 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 * 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 * @(#)string.h 8.1 (Berkeley) 6/2/93
56 */
57
58#ifndef _STRING_H_
59#define _STRING_H_
60
61#include <_types.h>
62#include <sys/cdefs.h>
63#include <Availability.h>
64#include <sys/_types/_size_t.h>
65#include <sys/_types/_null.h>
66
67/* ANSI-C */
68
69__BEGIN_DECLS
70void *memchr(const void *__s, int __c, size_t __n);
71int memcmp(const void *__s1, const void *__s2, size_t __n);
72void *memcpy(void *__dst, const void *__src, size_t __n);
73void *memmove(void *__dst, const void *__src, size_t __len);
74void *memset(void *__b, int __c, size_t __len);
75char *strcat(char *__s1, const char *__s2);
76char *strchr(const char *__s, int __c);
77int strcmp(const char *__s1, const char *__s2);
78int strcoll(const char *__s1, const char *__s2);
79char *strcpy(char *__dst, const char *__src);
80size_t strcspn(const char *__s, const char *__charset);
81char *strerror(int __errnum) __DARWIN_ALIAS(strerror);
82size_t strlen(const char *__s);
83char *strncat(char *__s1, const char *__s2, size_t __n);
84int strncmp(const char *__s1, const char *__s2, size_t __n);
85char *strncpy(char *__dst, const char *__src, size_t __n);
86char *strpbrk(const char *__s, const char *__charset);
87char *strrchr(const char *__s, int __c);
88size_t strspn(const char *__s, const char *__charset);
89char *strstr(const char *__big, const char *__little);
90char *strtok(char *__str, const char *__sep);
91size_t strxfrm(char *__s1, const char *__s2, size_t __n);
92__END_DECLS
93
94
95
96/* Additional functionality provided by:
97 * POSIX.1c-1995,
98 * POSIX.1i-1995,
99 * and the omnibus ISO/IEC 9945-1: 1996
100 */
101
102#if __DARWIN_C_LEVEL >= 199506L
103__BEGIN_DECLS
104char *strtok_r(char *__str, const char *__sep, char **__lasts);
105__END_DECLS
106#endif /* __DARWIN_C_LEVEL >= 199506L */
107
108
109
110/* Additional functionality provided by:
111 * POSIX.1-2001
112 */
113
114#if __DARWIN_C_LEVEL >= 200112L
115__BEGIN_DECLS
116int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen);
117char *strdup(const char *__s1);
118void *memccpy(void *__dst, const void *__src, int __c, size_t __n);
119__END_DECLS
120#endif /* __DARWIN_C_LEVEL >= 200112L */
121
122
123
124/* Additional functionality provided by:
125 * POSIX.1-2008
126 */
127
128#if __DARWIN_C_LEVEL >= 200809L
129__BEGIN_DECLS
130char *stpcpy(char *__dst, const char *__src);
131char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
132char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
133size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
134char *strsignal(int __sig);
135__END_DECLS
136#endif /* __DARWIN_C_LEVEL >= 200809L */
137
138/* C11 Annex K */
139
140#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
141#include <sys/_types/_rsize_t.h>
142#include <sys/_types/_errno_t.h>
143
144__BEGIN_DECLS
145errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
146__END_DECLS
147#endif
148
149/* Darwin extensions */
150
151#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
152#include <sys/_types/_ssize_t.h>
153
154__BEGIN_DECLS
155void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
156void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
157void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
158void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
159
160char *strcasestr(const char *__big, const char *__little);
161char *strnstr(const char *__big, const char *__little, size_t __len);
162size_t strlcat(char *__dst, const char *__source, size_t __size);
163size_t strlcpy(char *__dst, const char *__source, size_t __size);
164void strmode(int __mode, char *__bp);
165char *strsep(char **__stringp, const char *__delim);
166
167/* SUS places swab() in unistd.h. It is listed here for source compatibility */
168void swab(const void * __restrict, void * __restrict, ssize_t);
169
170__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1)
171__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1)
172int 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)
176int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen);
177__END_DECLS
178
179/* Some functions historically defined in string.h were placed in strings.h
180 * by SUS. We are using "strings.h" instead of <strings.h> to avoid an issue
181 * where /Developer/Headers/FlatCarbon/Strings.h could be included instead on
182 * case-insensitive file systems.
183 */
184#include "strings.h"
185#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
186
187
188#ifdef _USE_EXTENDED_LOCALES_
189#include <xlocale/_string.h>
190#endif /* _USE_EXTENDED_LOCALES_ */
191
192#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
193/* Security checking functions. */
194#include <secure/_string.h>
195#endif
196
197#endif /* _STRING_H_ */
lib/libc/include/aarch64-macos-gnu/strings.h created+101
......@@ -0,0 +1,101 @@
1/*
2 * Copyright (c) 2000, 2007, 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 * 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 * @(#)strings.h 8.1 (Berkeley) 6/2/93
56 */
57
58#ifndef _STRINGS_H_
59#define _STRINGS_H_
60
61#include <_types.h>
62
63#include <sys/cdefs.h>
64#include <Availability.h>
65#include <sys/_types/_size_t.h>
66
67__BEGIN_DECLS
68/* Removed in Issue 7 */
69#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
70int bcmp(const void *, const void *, size_t) __POSIX_C_DEPRECATED(200112L);
71void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
72void bzero(void *, size_t) __POSIX_C_DEPRECATED(200112L);
73char *index(const char *, int) __POSIX_C_DEPRECATED(200112L);
74char *rindex(const char *, int) __POSIX_C_DEPRECATED(200112L);
75#endif
76
77int ffs(int);
78int strcasecmp(const char *, const char *);
79int strncasecmp(const char *, const char *, size_t);
80__END_DECLS
81
82/* Darwin extensions */
83#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
84__BEGIN_DECLS
85int ffsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
86int ffsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
87int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
88int flsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
89int flsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
90__END_DECLS
91
92#include <string.h>
93#endif
94
95#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
96/* Security checking functions. */
97#include <secure/_strings.h>
98#endif
99
100#endif /* _STRINGS_H_ */
101
lib/libc/include/aarch64-macos-gnu/sys/_endian.h created+151
......@@ -0,0 +1,151 @@
1/*
2 * Copyright (c) 2004, 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/*
30 * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
31 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
32 *
33 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
34 *
35 * This file contains Original Code and/or Modifications of Original Code
36 * as defined in and that are subject to the Apple Public Source License
37 * Version 2.0 (the 'License'). You may not use this file except in
38 * compliance with the License. The rights granted to you under the License
39 * may not be used to create, or enable the creation or redistribution of,
40 * unlawful or unlicensed copies of an Apple operating system, or to
41 * circumvent, violate, or enable the circumvention or violation of, any
42 * terms of an Apple operating system software license agreement.
43 *
44 * Please obtain a copy of the License at
45 * http://www.opensource.apple.com/apsl/ and read it before using this file.
46 *
47 * The Original Code and all software distributed under the License are
48 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
49 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
50 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
51 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
52 * Please see the License for the specific language governing rights and
53 * limitations under the License.
54 *
55 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
56 */
57/*
58 * Copyright (c) 1987, 1991, 1993
59 * The Regents of the University of California. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 * 1. Redistributions of source code must retain the above copyright
65 * notice, this list of conditions and the following disclaimer.
66 * 2. Redistributions in binary form must reproduce the above copyright
67 * notice, this list of conditions and the following disclaimer in the
68 * documentation and/or other materials provided with the distribution.
69 * 3. All advertising materials mentioning features or use of this software
70 * must display the following acknowledgement:
71 * This product includes software developed by the University of
72 * California, Berkeley and its contributors.
73 * 4. Neither the name of the University nor the names of its contributors
74 * may be used to endorse or promote products derived from this software
75 * without specific prior written permission.
76 *
77 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
78 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
79 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
81 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
83 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
85 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87 * SUCH DAMAGE.
88 */
89
90#ifndef _SYS__ENDIAN_H_
91#define _SYS__ENDIAN_H_
92
93#include <sys/cdefs.h>
94
95/*
96 * Macros for network/external number representation conversion.
97 */
98
99#if defined(lint)
100
101__BEGIN_DECLS
102__uint16_t ntohs(__uint16_t);
103__uint16_t htons(__uint16_t);
104__uint32_t ntohl(__uint32_t);
105__uint32_t htonl(__uint32_t);
106__END_DECLS
107
108#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
109
110#define ntohl(x) ((__uint32_t)(x))
111#define ntohs(x) ((__uint16_t)(x))
112#define htonl(x) ((__uint32_t)(x))
113#define htons(x) ((__uint16_t)(x))
114
115#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
116
117#define ntohll(x) ((__uint64_t)(x))
118#define htonll(x) ((__uint64_t)(x))
119
120#define NTOHL(x) (x)
121#define NTOHS(x) (x)
122#define NTOHLL(x) (x)
123#define HTONL(x) (x)
124#define HTONS(x) (x)
125#define HTONLL(x) (x)
126#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
127
128#else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */
129
130#include <libkern/_OSByteOrder.h>
131
132#define ntohs(x) __DARWIN_OSSwapInt16(x)
133#define htons(x) __DARWIN_OSSwapInt16(x)
134
135#define ntohl(x) __DARWIN_OSSwapInt32(x)
136#define htonl(x) __DARWIN_OSSwapInt32(x)
137
138#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
139
140#define ntohll(x) __DARWIN_OSSwapInt64(x)
141#define htonll(x) __DARWIN_OSSwapInt64(x)
142
143#define NTOHL(x) (x) = ntohl((__uint32_t)x)
144#define NTOHS(x) (x) = ntohs((__uint16_t)x)
145#define NTOHLL(x) (x) = ntohll((__uint64_t)x)
146#define HTONL(x) (x) = htonl((__uint32_t)x)
147#define HTONS(x) (x) = htons((__uint16_t)x)
148#define HTONLL(x) (x) = htonll((__uint64_t)x)
149#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
150#endif /* __DARWIN_BYTE_ORDER */
151#endif /* !_SYS__ENDIAN_H_ */
lib/libc/include/aarch64-macos-gnu/sys/_posix_availability.h created+73
......@@ -0,0 +1,73 @@
1/* Copyright (c) 2010 Apple Inc. All rights reserved.
2 *
3 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
4 *
5 * This file contains Original Code and/or Modifications of Original Code
6 * as defined in and that are subject to the Apple Public Source License
7 * Version 2.0 (the 'License'). You may not use this file except in
8 * compliance with the License. The rights granted to you under the License
9 * may not be used to create, or enable the creation or redistribution of,
10 * unlawful or unlicensed copies of an Apple operating system, or to
11 * circumvent, violate, or enable the circumvention or violation of, any
12 * terms of an Apple operating system software license agreement.
13 *
14 * Please obtain a copy of the License at
15 * http://www.opensource.apple.com/apsl/ and read it before using this file.
16 *
17 * The Original Code and all software distributed under the License are
18 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
22 * Please see the License for the specific language governing rights and
23 * limitations under the License.
24 *
25 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
26 */
27
28#ifndef _CDEFS_H_
29# error "Never use <sys/_posix_availability.h> directly. Use <sys/cdefs.h> instead."
30#endif
31
32#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 198808L
33#define ___POSIX_C_DEPRECATED_STARTING_198808L __deprecated
34#else
35#define ___POSIX_C_DEPRECATED_STARTING_198808L
36#endif
37
38#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199009L
39#define ___POSIX_C_DEPRECATED_STARTING_199009L __deprecated
40#else
41#define ___POSIX_C_DEPRECATED_STARTING_199009L
42#endif
43
44#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199209L
45#define ___POSIX_C_DEPRECATED_STARTING_199209L __deprecated
46#else
47#define ___POSIX_C_DEPRECATED_STARTING_199209L
48#endif
49
50#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L
51#define ___POSIX_C_DEPRECATED_STARTING_199309L __deprecated
52#else
53#define ___POSIX_C_DEPRECATED_STARTING_199309L
54#endif
55
56#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199506L
57#define ___POSIX_C_DEPRECATED_STARTING_199506L __deprecated
58#else
59#define ___POSIX_C_DEPRECATED_STARTING_199506L
60#endif
61
62#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
63#define ___POSIX_C_DEPRECATED_STARTING_200112L __deprecated
64#else
65#define ___POSIX_C_DEPRECATED_STARTING_200112L
66#endif
67
68#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L
69#define ___POSIX_C_DEPRECATED_STARTING_200809L __deprecated
70#else
71#define ___POSIX_C_DEPRECATED_STARTING_200809L
72#endif
73
lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_attr_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_ATTR_T
29#define _PTHREAD_ATTR_T
30#include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_attr_t */
31typedef __darwin_pthread_attr_t pthread_attr_t;
32#endif /* _PTHREAD_ATTR_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_cond_t pthread_cond_t;
32#endif /* _PTHREAD_COND_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_condattr_t pthread_condattr_t;
32#endif /* _PTHREAD_CONDATTR_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_key_t pthread_key_t;
32#endif /* _PTHREAD_KEY_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_mutex_t pthread_mutex_t;
32#endif /*_PTHREAD_MUTEX_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t;
32#endif /* _PTHREAD_MUTEXATTR_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_once_t pthread_once_t;
32#endif /* _PTHREAD_ONCE_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
32#endif /* _PTHREAD_RWLOCK_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t;
32#endif /* _PTHREAD_RWLOCKATTR_T */
lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_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_T
29#define _PTHREAD_T
30#include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_t */
31typedef __darwin_pthread_t pthread_t;
32#endif /* _PTHREAD_T */
lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_types.h created+120
......@@ -0,0 +1,120 @@
1/*
2 * Copyright (c) 2003-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 _SYS__PTHREAD_TYPES_H_
30#define _SYS__PTHREAD_TYPES_H_
31
32#include <sys/cdefs.h>
33
34// pthread opaque structures
35#if defined(__LP64__)
36#define __PTHREAD_SIZE__ 8176
37#define __PTHREAD_ATTR_SIZE__ 56
38#define __PTHREAD_MUTEXATTR_SIZE__ 8
39#define __PTHREAD_MUTEX_SIZE__ 56
40#define __PTHREAD_CONDATTR_SIZE__ 8
41#define __PTHREAD_COND_SIZE__ 40
42#define __PTHREAD_ONCE_SIZE__ 8
43#define __PTHREAD_RWLOCK_SIZE__ 192
44#define __PTHREAD_RWLOCKATTR_SIZE__ 16
45#else // !__LP64__
46#define __PTHREAD_SIZE__ 4088
47#define __PTHREAD_ATTR_SIZE__ 36
48#define __PTHREAD_MUTEXATTR_SIZE__ 8
49#define __PTHREAD_MUTEX_SIZE__ 40
50#define __PTHREAD_CONDATTR_SIZE__ 4
51#define __PTHREAD_COND_SIZE__ 24
52#define __PTHREAD_ONCE_SIZE__ 4
53#define __PTHREAD_RWLOCK_SIZE__ 124
54#define __PTHREAD_RWLOCKATTR_SIZE__ 12
55#endif // !__LP64__
56
57struct __darwin_pthread_handler_rec {
58 void (*__routine)(void *); // Routine to call
59 void *__arg; // Argument to pass
60 struct __darwin_pthread_handler_rec *__next;
61};
62
63struct _opaque_pthread_attr_t {
64 long __sig;
65 char __opaque[__PTHREAD_ATTR_SIZE__];
66};
67
68struct _opaque_pthread_cond_t {
69 long __sig;
70 char __opaque[__PTHREAD_COND_SIZE__];
71};
72
73struct _opaque_pthread_condattr_t {
74 long __sig;
75 char __opaque[__PTHREAD_CONDATTR_SIZE__];
76};
77
78struct _opaque_pthread_mutex_t {
79 long __sig;
80 char __opaque[__PTHREAD_MUTEX_SIZE__];
81};
82
83struct _opaque_pthread_mutexattr_t {
84 long __sig;
85 char __opaque[__PTHREAD_MUTEXATTR_SIZE__];
86};
87
88struct _opaque_pthread_once_t {
89 long __sig;
90 char __opaque[__PTHREAD_ONCE_SIZE__];
91};
92
93struct _opaque_pthread_rwlock_t {
94 long __sig;
95 char __opaque[__PTHREAD_RWLOCK_SIZE__];
96};
97
98struct _opaque_pthread_rwlockattr_t {
99 long __sig;
100 char __opaque[__PTHREAD_RWLOCKATTR_SIZE__];
101};
102
103struct _opaque_pthread_t {
104 long __sig;
105 struct __darwin_pthread_handler_rec *__cleanup_stack;
106 char __opaque[__PTHREAD_SIZE__];
107};
108
109typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t;
110typedef struct _opaque_pthread_cond_t __darwin_pthread_cond_t;
111typedef struct _opaque_pthread_condattr_t __darwin_pthread_condattr_t;
112typedef unsigned long __darwin_pthread_key_t;
113typedef struct _opaque_pthread_mutex_t __darwin_pthread_mutex_t;
114typedef struct _opaque_pthread_mutexattr_t __darwin_pthread_mutexattr_t;
115typedef struct _opaque_pthread_once_t __darwin_pthread_once_t;
116typedef struct _opaque_pthread_rwlock_t __darwin_pthread_rwlock_t;
117typedef struct _opaque_pthread_rwlockattr_t __darwin_pthread_rwlockattr_t;
118typedef struct _opaque_pthread_t *__darwin_pthread_t;
119
120#endif // _SYS__PTHREAD_TYPES_H_
lib/libc/include/aarch64-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
43int 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/aarch64-macos-gnu/sys/_symbol_aliasing.h created+535
......@@ -0,0 +1,535 @@
1/* Copyright (c) 2010 Apple Inc. All rights reserved.
2 *
3 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
4 *
5 * This file contains Original Code and/or Modifications of Original Code
6 * as defined in and that are subject to the Apple Public Source License
7 * Version 2.0 (the 'License'). You may not use this file except in
8 * compliance with the License. The rights granted to you under the License
9 * may not be used to create, or enable the creation or redistribution of,
10 * unlawful or unlicensed copies of an Apple operating system, or to
11 * circumvent, violate, or enable the circumvention or violation of, any
12 * terms of an Apple operating system software license agreement.
13 *
14 * Please obtain a copy of the License at
15 * http://www.opensource.apple.com/apsl/ and read it before using this file.
16 *
17 * The Original Code and all software distributed under the License are
18 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
22 * Please see the License for the specific language governing rights and
23 * limitations under the License.
24 *
25 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
26 */
27
28#ifndef _CDEFS_H_
29# error "Never use <sys/_symbol_aliasing.h> directly. Use <sys/cdefs.h> instead."
30#endif
31
32#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
33#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_0(x) x
34#else
35#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_0(x)
36#endif
37
38#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20100
39#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_1(x) x
40#else
41#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_1(x)
42#endif
43
44#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20200
45#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_2(x) x
46#else
47#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_2(x)
48#endif
49
50#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30000
51#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_0(x) x
52#else
53#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_0(x)
54#endif
55
56#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30100
57#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_1(x) x
58#else
59#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_1(x)
60#endif
61
62#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30200
63#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_2(x) x
64#else
65#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_2(x)
66#endif
67
68#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
69#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_0(x) x
70#else
71#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_0(x)
72#endif
73
74#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40100
75#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_1(x) x
76#else
77#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_1(x)
78#endif
79
80#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40200
81#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_2(x) x
82#else
83#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_2(x)
84#endif
85
86#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40300
87#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_3(x) x
88#else
89#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_3(x)
90#endif
91
92#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 50000
93#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_5_0(x) x
94#else
95#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_5_0(x)
96#endif
97
98#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 50100
99#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_5_1(x) x
100#else
101#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_5_1(x)
102#endif
103
104#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 60000
105#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_6_0(x) x
106#else
107#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_6_0(x)
108#endif
109
110#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 60100
111#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_6_1(x) x
112#else
113#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_6_1(x)
114#endif
115
116#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 70000
117#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_7_0(x) x
118#else
119#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_7_0(x)
120#endif
121
122#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 70100
123#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_7_1(x) x
124#else
125#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_7_1(x)
126#endif
127
128#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 80000
129#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_0(x) x
130#else
131#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_0(x)
132#endif
133
134#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 80100
135#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_1(x) x
136#else
137#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_1(x)
138#endif
139
140#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 80200
141#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_2(x) x
142#else
143#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_2(x)
144#endif
145
146#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 80300
147#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_3(x) x
148#else
149#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_3(x)
150#endif
151
152#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 80400
153#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_4(x) x
154#else
155#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_8_4(x)
156#endif
157
158#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 90000
159#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_0(x) x
160#else
161#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_0(x)
162#endif
163
164#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 90100
165#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_1(x) x
166#else
167#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_1(x)
168#endif
169
170#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 90200
171#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_2(x) x
172#else
173#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_2(x)
174#endif
175
176#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 90300
177#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_3(x) x
178#else
179#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_9_3(x)
180#endif
181
182#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100000
183#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_0(x) x
184#else
185#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_0(x)
186#endif
187
188#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100100
189#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_1(x) x
190#else
191#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_1(x)
192#endif
193
194#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100200
195#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_2(x) x
196#else
197#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_2(x)
198#endif
199
200#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100300
201#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_3(x) x
202#else
203#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_10_3(x)
204#endif
205
206#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110000
207#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_0(x) x
208#else
209#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_0(x)
210#endif
211
212#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110100
213#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_1(x) x
214#else
215#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_1(x)
216#endif
217
218#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110200
219#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_2(x) x
220#else
221#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_2(x)
222#endif
223
224#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110300
225#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_3(x) x
226#else
227#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_3(x)
228#endif
229
230#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110400
231#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_4(x) x
232#else
233#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_11_4(x)
234#endif
235
236#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 120000
237#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_0(x) x
238#else
239#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_0(x)
240#endif
241
242#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 120100
243#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_1(x) x
244#else
245#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_1(x)
246#endif
247
248#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 120200
249#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_2(x) x
250#else
251#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_2(x)
252#endif
253
254#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 120300
255#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_3(x) x
256#else
257#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_3(x)
258#endif
259
260#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 120400
261#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_4(x) x
262#else
263#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_12_4(x)
264#endif
265
266#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000
267#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_0(x) x
268#else
269#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_0(x)
270#endif
271
272#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130100
273#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_1(x) x
274#else
275#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_1(x)
276#endif
277
278#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130200
279#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_2(x) x
280#else
281#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_2(x)
282#endif
283
284#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130300
285#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_3(x) x
286#else
287#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_3(x)
288#endif
289
290#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130400
291#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_4(x) x
292#else
293#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_4(x)
294#endif
295
296#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130500
297#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_5(x) x
298#else
299#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_5(x)
300#endif
301
302#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130600
303#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_6(x) x
304#else
305#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_6(x)
306#endif
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
332#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
333#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
334#else
335#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x)
336#endif
337
338#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1010
339#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_1(x) x
340#else
341#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_1(x)
342#endif
343
344#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1020
345#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_2(x) x
346#else
347#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_2(x)
348#endif
349
350#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1030
351#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_3(x) x
352#else
353#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_3(x)
354#endif
355
356#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
357#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_4(x) x
358#else
359#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_4(x)
360#endif
361
362#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
363#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_5(x) x
364#else
365#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_5(x)
366#endif
367
368#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060
369#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_6(x) x
370#else
371#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_6(x)
372#endif
373
374#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070
375#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_7(x) x
376#else
377#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_7(x)
378#endif
379
380#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1080
381#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_8(x) x
382#else
383#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_8(x)
384#endif
385
386#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090
387#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_9(x) x
388#else
389#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_9(x)
390#endif
391
392#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000
393#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_10(x) x
394#else
395#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_10(x)
396#endif
397
398#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101002
399#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_10_2(x) x
400#else
401#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_10_2(x)
402#endif
403
404#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101003
405#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_10_3(x) x
406#else
407#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_10_3(x)
408#endif
409
410#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101100
411#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11(x) x
412#else
413#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11(x)
414#endif
415
416#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101102
417#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11_2(x) x
418#else
419#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11_2(x)
420#endif
421
422#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101103
423#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11_3(x) x
424#else
425#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11_3(x)
426#endif
427
428#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101104
429#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11_4(x) x
430#else
431#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_11_4(x)
432#endif
433
434#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101200
435#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12(x) x
436#else
437#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12(x)
438#endif
439
440#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101201
441#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12_1(x) x
442#else
443#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12_1(x)
444#endif
445
446#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101202
447#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12_2(x) x
448#else
449#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12_2(x)
450#endif
451
452#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101204
453#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12_4(x) x
454#else
455#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_12_4(x)
456#endif
457
458#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101300
459#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13(x) x
460#else
461#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13(x)
462#endif
463
464#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101301
465#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13_1(x) x
466#else
467#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13_1(x)
468#endif
469
470#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101302
471#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13_2(x) x
472#else
473#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13_2(x)
474#endif
475
476#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101304
477#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13_4(x) x
478#else
479#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_13_4(x)
480#endif
481
482#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101400
483#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14(x) x
484#else
485#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14(x)
486#endif
487
488#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101401
489#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_1(x) x
490#else
491#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_1(x)
492#endif
493
494#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101404
495#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_4(x) x
496#else
497#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_4(x)
498#endif
499
500#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101405
501#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_5(x) x
502#else
503#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_5(x)
504#endif
505
506#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101406
507#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_6(x) x
508#else
509#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_14_6(x)
510#endif
511
512#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500
513#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15(x) x
514#else
515#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15(x)
516#endif
517
518#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101501
519#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15_1(x) x
520#else
521#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15_1(x)
522#endif
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/aarch64-macos-gnu/sys/_types.h created+89
......@@ -0,0 +1,89 @@
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#ifndef _SYS__TYPES_H_
30#define _SYS__TYPES_H_
31
32#include <sys/cdefs.h>
33#include <machine/_types.h>
34
35/*
36 * Type definitions; takes common type definitions that must be used
37 * in multiple header files due to [XSI], removes them from the system
38 * space, and puts them in the implementation space.
39 */
40
41#ifdef __cplusplus
42#ifdef __GNUG__
43#define __DARWIN_NULL __null
44#else /* ! __GNUG__ */
45#ifdef __LP64__
46#define __DARWIN_NULL (0L)
47#else /* !__LP64__ */
48#define __DARWIN_NULL 0
49#endif /* __LP64__ */
50#endif /* __GNUG__ */
51#else /* ! __cplusplus */
52#define __DARWIN_NULL ((void *)0)
53#endif /* __cplusplus */
54
55typedef __int64_t __darwin_blkcnt_t; /* total blocks */
56typedef __int32_t __darwin_blksize_t; /* preferred block size */
57typedef __int32_t __darwin_dev_t; /* dev_t */
58typedef unsigned int __darwin_fsblkcnt_t; /* Used by statvfs and fstatvfs */
59typedef unsigned int __darwin_fsfilcnt_t; /* Used by statvfs and fstatvfs */
60typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */
61typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/
62typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */
63#if __DARWIN_64_BIT_INO_T
64typedef __darwin_ino64_t __darwin_ino_t; /* [???] Used for inodes */
65#else /* !__DARWIN_64_BIT_INO_T */
66typedef __uint32_t __darwin_ino_t; /* [???] Used for inodes */
67#endif /* __DARWIN_64_BIT_INO_T */
68typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
69typedef __darwin_mach_port_name_t __darwin_mach_port_t; /* Used by mach */
70typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */
71typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */
72typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */
73typedef __uint32_t __darwin_sigset_t; /* [???] signal set */
74typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */
75typedef __uint32_t __darwin_uid_t; /* [???] user IDs */
76typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
77typedef unsigned char __darwin_uuid_t[16];
78typedef char __darwin_uuid_string_t[37];
79
80#include <sys/_pthread/_pthread_types.h>
81
82#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3)
83#define __offsetof(type, field) __builtin_offsetof(type, field)
84#else /* !(gcc >= 3.5) */
85#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
86#endif /* (gcc >= 3.5) */
87
88
89#endif /* _SYS__TYPES_H_ */
lib/libc/include/aarch64-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 */
31typedef __darwin_blkcnt_t blkcnt_t;
32#endif /* _BLKCNT_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_blksize_t blksize_t;
32#endif /* _BLKSIZE_T */
lib/libc/include/aarch64-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
30typedef char * caddr_t;
31#endif /* _CADDR_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_clock_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 _CLOCK_T
29#define _CLOCK_T
30#include <machine/types.h> /* __darwin_clock_t */
31typedef __darwin_clock_t clock_t;
32#endif /* _CLOCK_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_ct_rune_t.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 _CT_RUNE_T
30#define _CT_RUNE_T
31#include <machine/_types.h> /* __darwin_ct_rune_t */
32typedef __darwin_ct_rune_t ct_rune_t;
33#endif /* _CT_RUNE_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_dev_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 _DEV_T
29#define _DEV_T
30#include <sys/_types.h> /* __darwin_dev_t */
31typedef __darwin_dev_t dev_t; /* device number */
32#endif /* _DEV_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_errno_t.h created+31
......@@ -0,0 +1,31 @@
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 _ERRNO_T
29#define _ERRNO_T
30typedef int errno_t;
31#endif /* _ERRNO_T */
lib/libc/include/aarch64-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/aarch64-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/aarch64-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
50typedef struct fd_set {
51 __int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)];
52} fd_set;
53
54int __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/aarch64-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/aarch64-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/aarch64-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/aarch64-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/aarch64-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
30struct _filesec;
31typedef struct _filesec *filesec_t;
32#endif /* _FILESEC_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_fsblkcnt_t fsblkcnt_t;
32#endif /* _FSBLKCNT_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_fsfilcnt_t fsfilcnt_t;
32#endif /* _FSFILCNT_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_fsid_t.h created+32
......@@ -0,0 +1,32 @@
1/*
2 * Copyright (c) 2014 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28#ifndef _FSID_T
29#define _FSID_T
30#include <sys/_types/_int32_t.h> /* int32_t */
31typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */
32#endif /* _FSID_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_fsobj_id_t.h created+38
......@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2016 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28#ifndef _FSOBJ_ID_T
29#define _FSOBJ_ID_T
30
31#include <sys/_types/_u_int32_t.h> /* u_int32_t */
32
33typedef struct fsobj_id {
34 u_int32_t fid_objno;
35 u_int32_t fid_generation;
36} fsobj_id_t;
37
38#endif /* _FSOBJ_ID_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_gid_t gid_t;
32#endif
lib/libc/include/aarch64-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 */
31typedef 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/aarch64-macos-gnu/sys/_types/_id_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 _ID_T
29#define _ID_T
30#include <sys/_types.h> /* __darwin_id_t */
31typedef __darwin_id_t id_t; /* can hold pid_t, gid_t, or uid_t */
32#endif /* _ID_T */
lib/libc/include/aarch64-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 */
31typedef __uint32_t in_addr_t; /* base type for internet address */
32#endif /* _IN_ADDR_T */
lib/libc/include/aarch64-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 */
31typedef __uint16_t in_port_t;
32#endif /* _IN_PORT_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_ino64_t ino64_t; /* 64bit inode number */
32#endif /* _INO64_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_ino_t ino_t; /* inode number */
32#endif /* _INO_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_int16_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _INT16_T
29#define _INT16_T
30typedef short int16_t;
31#endif /* _INT16_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_int32_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _INT32_T
29#define _INT32_T
30typedef int int32_t;
31#endif /* _INT32_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_int64_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _INT64_T
29#define _INT64_T
30typedef long long int64_t;
31#endif /* _INT64_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_int8_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _INT8_T
29#define _INT8_T
30typedef signed char int8_t;
31#endif /* _INT8_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_intptr_t.h created+33
......@@ -0,0 +1,33 @@
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 _INTPTR_T
29#define _INTPTR_T
30#include <machine/types.h> /* __darwin_intptr_t */
31
32typedef __darwin_intptr_t intptr_t;
33#endif /* _INTPTR_T */
lib/libc/include/aarch64-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 */
31struct 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/aarch64-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 */
31typedef __int32_t key_t; /* IPC key (for Sys V IPC) */
32#endif /* _KEY_T */
lib/libc/include/aarch64-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 */
50typedef __darwin_mach_port_t mach_port_t;
51#endif /* _MACH_PORT_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_mbstate_t.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 _MBSTATE_T
30#define _MBSTATE_T
31#include <machine/types.h> /* __darwin_mbstate_t */
32typedef __darwin_mbstate_t mbstate_t;
33#endif /* _MBSTATE_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_mode_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 _MODE_T
29#define _MODE_T
30#include <sys/_types.h> /* __darwin_mode_t */
31typedef __darwin_mode_t mode_t;
32#endif /* _MODE_T */
lib/libc/include/aarch64-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 */
31typedef __uint16_t nlink_t; /* link count */
32#endif /* _NLINK_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_null.h created+31
......@@ -0,0 +1,31 @@
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 NULL
29#include <sys/_types.h> /* __DARWIN_NULL */
30#define NULL __DARWIN_NULL
31#endif /* NULL */
lib/libc/include/aarch64-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/aarch64-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/aarch64-macos-gnu/sys/_types/_off_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 _OFF_T
29#define _OFF_T
30#include <sys/_types.h> /* __darwin_off_t */
31typedef __darwin_off_t off_t;
32#endif /* _OFF_T */
lib/libc/include/aarch64-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/aarch64-macos-gnu/sys/_types/_pid_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 _PID_T
29#define _PID_T
30#include <sys/_types.h> /* __darwin_pid_t */
31typedef __darwin_pid_t pid_t;
32#endif /* _PID_T */
lib/libc/include/aarch64-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/aarch64-macos-gnu/sys/_types/_rsize_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 _RSIZE_T
29#define _RSIZE_T
30#include <machine/types.h> /* __darwin_size_t */
31typedef __darwin_size_t rsize_t;
32#endif /* _RSIZE_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_rune_t.h created+32
......@@ -0,0 +1,32 @@
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#ifndef _RUNE_T
29#define _RUNE_T
30#include <machine/_types.h> /* __darwin_rune_t */
31typedef __darwin_rune_t rune_t;
32#endif /* _RUNE_T */
lib/libc/include/aarch64-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/aarch64-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 */
31typedef __uint8_t sa_family_t;
32#endif /* _SA_FAMILY_T */
lib/libc/include/aarch64-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/aarch64-macos-gnu/sys/_types/_sigaltstack.h created+50
......@@ -0,0 +1,50 @@
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/* Structure used in sigaltstack call. */
30#ifndef _STRUCT_SIGALTSTACK
31
32#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
33
34#if __DARWIN_UNIX03
35#define _STRUCT_SIGALTSTACK struct __darwin_sigaltstack
36#else /* !__DARWIN_UNIX03 */
37#define _STRUCT_SIGALTSTACK struct sigaltstack
38#endif /* __DARWIN_UNIX03 */
39
40#include <machine/types.h> /* __darwin_size_t */
41
42_STRUCT_SIGALTSTACK
43{
44 void *ss_sp; /* signal stack base */
45 __darwin_size_t ss_size; /* signal stack length */
46 int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */
47};
48typedef _STRUCT_SIGALTSTACK stack_t; /* [???] signal stack */
49
50#endif /* _STRUCT_SIGALTSTACK */
lib/libc/include/aarch64-macos-gnu/sys/_types/_sigset_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 _SIGSET_T
29#define _SIGSET_T
30#include <sys/_types.h> /* __darwin_sigset_t */
31typedef __darwin_sigset_t sigset_t;
32#endif /* _SIGSET_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_size_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 _SIZE_T
29#define _SIZE_T
30#include <machine/_types.h> /* __darwin_size_t */
31typedef __darwin_size_t size_t;
32#endif /* _SIZE_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_socklen_t socklen_t;
32#endif
lib/libc/include/aarch64-macos-gnu/sys/_types/_ssize_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 _SSIZE_T
29#define _SSIZE_T
30#include <machine/types.h> /* __darwin_ssize_t */
31typedef __darwin_ssize_t ssize_t;
32#endif /* _SSIZE_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_suseconds_t suseconds_t;
32#endif /* _SUSECONDS_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_time_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 _TIME_T
29#define _TIME_T
30#include <machine/types.h> /* __darwin_time_t */
31typedef __darwin_time_t time_t;
32#endif /* _TIME_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_timespec.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_TIMESPEC
29#define _STRUCT_TIMESPEC struct timespec
30
31#include <machine/types.h> /* __darwin_time_t */
32
33_STRUCT_TIMESPEC
34{
35 __darwin_time_t tv_sec;
36 long tv_nsec;
37};
38#endif /* _STRUCT_TIMESPEC */
lib/libc/include/aarch64-macos-gnu/sys/_types/_timeval.h created+39
......@@ -0,0 +1,39 @@
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_TIMEVAL
29#define _STRUCT_TIMEVAL struct timeval
30
31#include <machine/types.h> /* __darwin_time_t */
32#include <sys/_types.h> /* __darwin_suseconds_t */
33
34_STRUCT_TIMEVAL
35{
36 __darwin_time_t tv_sec; /* seconds */
37 __darwin_suseconds_t tv_usec; /* and microseconds */
38};
39#endif /* _STRUCT_TIMEVAL */
lib/libc/include/aarch64-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/aarch64-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
34struct timeval64 {
35 __int64_t tv_sec; /* seconds */
36 __int64_t tv_usec; /* and microseconds */
37};
38#endif /* _STRUCT_TIMEVAL32 */
lib/libc/include/aarch64-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
30typedef unsigned char u_char;
31#endif /* _U_CHAR */
lib/libc/include/aarch64-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
30typedef unsigned int u_int;
31#endif /* _U_INT */
lib/libc/include/aarch64-macos-gnu/sys/_types/_u_int16_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _U_INT16_T
29#define _U_INT16_T
30typedef unsigned short u_int16_t;
31#endif /* _U_INT16_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_u_int32_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _U_INT32_T
29#define _U_INT32_T
30typedef unsigned int u_int32_t;
31#endif /* _U_INT32_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_u_int64_t.h created+31
......@@ -0,0 +1,31 @@
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#ifndef _U_INT64_T
29#define _U_INT64_T
30typedef unsigned long long u_int64_t;
31#endif /* _U_INT64_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_u_int8_t.h created+31
......@@ -0,0 +1,31 @@
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 _U_INT8_T
29#define _U_INT8_T
30typedef unsigned char u_int8_t;
31#endif /* _U_INT8_T */
lib/libc/include/aarch64-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
30typedef unsigned short u_short;
31#endif /* _U_SHORT */
lib/libc/include/aarch64-macos-gnu/sys/_types/_ucontext.h created+59
......@@ -0,0 +1,59 @@
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_UCONTEXT
29
30#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
31
32#if __DARWIN_UNIX03
33#define _STRUCT_UCONTEXT struct __darwin_ucontext
34#else /* !__DARWIN_UNIX03 */
35#define _STRUCT_UCONTEXT struct ucontext
36#endif /* __DARWIN_UNIX03 */
37
38#include <machine/types.h> /* __darwin_size_t */
39#include <machine/_mcontext.h> /* _STRUCT_MCONTEXT */
40#include <sys/_types.h> /* __darwin_sigset_t */
41#include <sys/_types/_sigaltstack.h> /* _STRUCT_SIGALTSTACK */
42
43_STRUCT_UCONTEXT
44{
45 int uc_onstack;
46 __darwin_sigset_t uc_sigmask; /* signal mask used by this context */
47 _STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */
48 _STRUCT_UCONTEXT *uc_link; /* pointer to resuming context */
49 __darwin_size_t uc_mcsize; /* size of the machine context passed in */
50 _STRUCT_MCONTEXT *uc_mcontext; /* pointer to machine specific context */
51#ifdef _XOPEN_SOURCE
52 _STRUCT_MCONTEXT __mcontext_data;
53#endif /* _XOPEN_SOURCE */
54};
55
56/* user context */
57typedef _STRUCT_UCONTEXT ucontext_t; /* [???] user context */
58
59#endif /* _STRUCT_UCONTEXT */
lib/libc/include/aarch64-macos-gnu/sys/_types/_uid_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 _UID_T
29#define _UID_T
30#include <sys/_types.h> /* __darwin_uid_t */
31typedef __darwin_uid_t uid_t;
32#endif /* _UID_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_uintptr_t.h created+31
......@@ -0,0 +1,31 @@
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 _UINTPTR_T
29#define _UINTPTR_T
30typedef unsigned long uintptr_t;
31#endif /* _UINTPTR_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_useconds_t useconds_t;
32#endif /* _USECONDS_T */
lib/libc/include/aarch64-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 */
31typedef __darwin_uuid_t uuid_t;
32#endif /* _UUID_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_va_list.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 _VA_LIST_T
30#define _VA_LIST_T
31#include <machine/types.h> /* __darwin_va_list */
32typedef __darwin_va_list va_list;
33#endif /* _VA_LIST_T */
lib/libc/include/aarch64-macos-gnu/sys/_types/_wchar_t.h created+36
......@@ -0,0 +1,36 @@
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/* wchar_t is a built-in type in C++ */
30#ifndef __cplusplus
31#ifndef _WCHAR_T
32#define _WCHAR_T
33#include <machine/_types.h> /* __darwin_wchar_t */
34typedef __darwin_wchar_t wchar_t;
35#endif /* _WCHAR_T */
36#endif /* __cplusplus */
lib/libc/include/aarch64-macos-gnu/sys/_types/_wint_t.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 _WINT_T
30#define _WINT_T
31#include <machine/_types.h> /* __darwin_wint_t */
32typedef __darwin_wint_t wint_t;
33#endif /* _WINT_T */
lib/libc/include/aarch64-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 */
69typedef 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 */
91typedef 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 */
98typedef 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 */
115typedef 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 */
122typedef 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
134struct _acl;
135struct _acl_entry;
136struct _acl_permset;
137struct _acl_flagset;
138
139typedef struct _acl *acl_t;
140typedef struct _acl_entry *acl_entry_t;
141typedef struct _acl_permset *acl_permset_t;
142typedef struct _acl_flagset *acl_flagset_t;
143
144typedef u_int64_t acl_permset_mask_t;
145
146__BEGIN_DECLS
147/* 23.1.6.1 ACL Storage Management */
148extern acl_t acl_dup(acl_t acl);
149extern int acl_free(void *obj_p);
150extern acl_t acl_init(int count);
151
152/* 23.1.6.2 (1) ACL Entry manipulation */
153extern int acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d);
154extern int acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p);
155extern int acl_create_entry_np(acl_t *acl_p, acl_entry_t *entry_p, int entry_index);
156extern int acl_delete_entry(acl_t acl, acl_entry_t entry_d);
157extern int acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p);
158extern int acl_valid(acl_t acl);
159extern int acl_valid_fd_np(int fd, acl_type_t type, acl_t acl);
160extern int acl_valid_file_np(const char *path, acl_type_t type, acl_t acl);
161extern 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 */
164extern int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm);
165extern int acl_calc_mask(acl_t *acl_p); /* not supported */
166extern int acl_clear_perms(acl_permset_t permset_d);
167extern int acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm);
168extern int acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm);
169extern int acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p);
170extern 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 */
173extern int acl_maximal_permset_mask_np(acl_permset_mask_t * mask_p) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
174extern 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);
175extern 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 */
178extern int acl_add_flag_np(acl_flagset_t flagset_d, acl_flag_t flag);
179extern int acl_clear_flags_np(acl_flagset_t flagset_d);
180extern int acl_delete_flag_np(acl_flagset_t flagset_d, acl_flag_t flag);
181extern int acl_get_flag_np(acl_flagset_t flagset_d, acl_flag_t flag);
182extern int acl_get_flagset_np(void *obj_p, acl_flagset_t *flagset_p);
183extern 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 */
186extern void *acl_get_qualifier(acl_entry_t entry_d);
187extern int acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p);
188extern int acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p);
189extern 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 */
192extern int acl_delete_def_file(const char *path_p); /* not supported */
193extern acl_t acl_get_fd(int fd);
194extern acl_t acl_get_fd_np(int fd, acl_type_t type);
195extern acl_t acl_get_file(const char *path_p, acl_type_t type);
196extern acl_t acl_get_link_np(const char *path_p, acl_type_t type);
197extern int acl_set_fd(int fd, acl_t acl);
198extern int acl_set_fd_np(int fd, acl_t acl, acl_type_t acl_type);
199extern int acl_set_file(const char *path_p, acl_type_t type, acl_t acl);
200extern 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 */
203extern ssize_t acl_copy_ext(void *buf_p, acl_t acl, ssize_t size);
204extern ssize_t acl_copy_ext_native(void *buf_p, acl_t acl, ssize_t size);
205extern acl_t acl_copy_int(const void *buf_p);
206extern acl_t acl_copy_int_native(const void *buf_p);
207extern acl_t acl_from_text(const char *buf_p);
208extern ssize_t acl_size(acl_t acl);
209extern char *acl_to_text(acl_t acl, ssize_t *len_p);
210__END_DECLS
211
212#endif /* _SYS_ACL_H */
lib/libc/include/aarch64-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
65struct 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 */
141int 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 */
151int 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 */
168int 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 */
185int 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 */
200ssize_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 */
216int 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 */
228int 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 */
242int 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/aarch64-macos-gnu/sys/appleapiopts.h created+61
......@@ -0,0 +1,61 @@
1/*
2 * Copyright (c) 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#ifndef __SYS_APPLEAPIOPTS_H__
30#define __SYS_APPLEAPIOPTS_H__
31
32
33#ifndef __APPLE_API_STANDARD
34#define __APPLE_API_STANDARD
35#endif /* __APPLE_API_STANDARD */
36
37#ifndef __APPLE_API_STABLE
38#define __APPLE_API_STABLE
39#endif /* __APPLE_API_STABLE */
40
41#ifndef __APPLE_API_STRICT_CONFORMANCE
42
43#ifndef __APPLE_API_EVOLVING
44#define __APPLE_API_EVOLVING
45#endif /* __APPLE_API_EVOLVING */
46
47#ifndef __APPLE_API_UNSTABLE
48#define __APPLE_API_UNSTABLE
49#endif /* __APPLE_API_UNSTABLE */
50
51#ifndef __APPLE_API_PRIVATE
52#define __APPLE_API_PRIVATE
53#endif /* __APPLE_API_PRIVATE */
54
55#ifndef __APPLE_API_OBSOLETE
56#define __APPLE_API_OBSOLETE
57#endif /* __APPLE_API_OBSOLETE */
58
59#endif /* __APPLE_API_STRICT_CONFORMANCE */
60
61#endif /* __SYS_APPLEAPIOPTS_H__ */
lib/libc/include/aarch64-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
63typedef u_int32_t text_encoding_t;
64
65typedef u_int32_t fsobj_type_t;
66
67typedef u_int32_t fsobj_tag_t;
68
69typedef u_int32_t fsfile_type_t;
70
71typedef u_int32_t fsvolid_t;
72
73#include <sys/_types/_fsobj_id_t.h> /* file object id type */
74
75typedef u_int32_t attrgroup_t;
76
77struct 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
88typedef 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
96typedef 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
103struct diskextent {
104 u_int32_t startblock; /* first block allocated */
105 u_int32_t blockcount; /* number of blocks allocated */
106};
107
108typedef struct diskextent extentrecord[8];
109
110typedef 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
117typedef 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
366typedef 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
563struct 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
577struct 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/aarch64-macos-gnu/sys/cdefs.h created+876
......@@ -0,0 +1,876 @@
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 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 * This code is derived from software contributed to Berkeley by
34 * 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 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95
65 */
66
67#ifndef _CDEFS_H_
68#define _CDEFS_H_
69
70#if defined(__cplusplus)
71#define __BEGIN_DECLS extern "C" {
72#define __END_DECLS }
73#else
74#define __BEGIN_DECLS
75#define __END_DECLS
76#endif
77
78/* This SDK is designed to work with clang and specific versions of
79 * gcc >= 4.0 with Apple's patch sets */
80#if !defined(__GNUC__) || __GNUC__ < 4
81#warning "Unsupported compiler detected"
82#endif
83
84/*
85 * Compatibility with compilers and environments that don't support compiler
86 * feature checking function-like macros.
87 */
88#ifndef __has_builtin
89#define __has_builtin(x) 0
90#endif
91#ifndef __has_include
92#define __has_include(x) 0
93#endif
94#ifndef __has_feature
95#define __has_feature(x) 0
96#endif
97#ifndef __has_attribute
98#define __has_attribute(x) 0
99#endif
100#ifndef __has_extension
101#define __has_extension(x) 0
102#endif
103
104/*
105 * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
106 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
107 * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
108 * in between its arguments. __CONCAT can also concatenate double-quoted
109 * strings produced by the __STRING macro, but this only works with ANSI C.
110 */
111#if defined(__STDC__) || defined(__cplusplus)
112#define __P(protos) protos /* full-blown ANSI C */
113#define __CONCAT(x, y) x ## y
114#define __STRING(x) #x
115
116#define __const const /* define reserved names to standard */
117#define __signed signed
118#define __volatile volatile
119#if defined(__cplusplus)
120#define __inline inline /* convert to C++ keyword */
121#else
122#ifndef __GNUC__
123#define __inline /* delete GCC keyword */
124#endif /* !__GNUC__ */
125#endif /* !__cplusplus */
126
127#else /* !(__STDC__ || __cplusplus) */
128#define __P(protos) () /* traditional C preprocessor */
129#define __CONCAT(x, y) x /**/ y
130#define __STRING(x) "x"
131
132#ifndef __GNUC__
133#define __const /* delete pseudo-ANSI C keywords */
134#define __inline
135#define __signed
136#define __volatile
137#endif /* !__GNUC__ */
138
139/*
140 * In non-ANSI C environments, new programs will want ANSI-only C keywords
141 * deleted from the program and old programs will want them left alone.
142 * When using a compiler other than gcc, programs using the ANSI C keywords
143 * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
144 * When using "gcc -traditional", we assume that this is the intent; if
145 * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
146 */
147#ifndef NO_ANSI_KEYWORDS
148#define const __const /* convert ANSI C keywords */
149#define inline __inline
150#define signed __signed
151#define volatile __volatile
152#endif /* !NO_ANSI_KEYWORDS */
153#endif /* !(__STDC__ || __cplusplus) */
154
155#define __dead2 __attribute__((__noreturn__))
156#define __pure2 __attribute__((__const__))
157
158/* __unused denotes variables and functions that may not be used, preventing
159 * the compiler from warning about it if not used.
160 */
161#define __unused __attribute__((__unused__))
162
163/* __used forces variables and functions to be included even if it appears
164 * to the compiler that they are not used (and would thust be discarded).
165 */
166#define __used __attribute__((__used__))
167
168/* __cold marks code used for debugging or that is rarely taken
169 * and tells the compiler to optimize for size and outline code.
170 */
171#if __has_attribute(cold)
172#define __cold __attribute__((__cold__))
173#else
174#define __cold
175#endif
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
186/* __deprecated causes the compiler to produce a warning when encountering
187 * code using the deprecated functionality.
188 * __deprecated_msg() does the same, and compilers that support it will print
189 * a message along with the deprecation warning.
190 * This may require turning on such warning with the -Wdeprecated flag.
191 * __deprecated_enum_msg() should be used on enums, and compilers that support
192 * it will print the deprecation warning.
193 * __kpi_deprecated() specifically indicates deprecation of kernel programming
194 * interfaces in Kernel.framework used by KEXTs.
195 */
196#define __deprecated __attribute__((__deprecated__))
197
198#if __has_extension(attribute_deprecated_with_message) || \
199 (defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))))
200 #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
201#else
202 #define __deprecated_msg(_msg) __attribute__((__deprecated__))
203#endif
204
205#if __has_extension(enumerator_attributes)
206 #define __deprecated_enum_msg(_msg) __deprecated_msg(_msg)
207#else
208 #define __deprecated_enum_msg(_msg)
209#endif
210
211#define __kpi_deprecated(_msg)
212
213/* __unavailable causes the compiler to error out when encountering
214 * code using the tagged function
215 */
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
225
226/* Delete pseudo-keywords wherever they are not available or needed. */
227#ifndef __dead
228#define __dead
229#define __pure
230#endif
231
232/*
233 * We use `__restrict' as a way to define the `restrict' type qualifier
234 * without disturbing older software that is unaware of C99 keywords.
235 */
236#if __STDC_VERSION__ < 199901
237#define __restrict
238#else
239#define __restrict restrict
240#endif
241
242/* Compatibility with compilers and environments that don't support the
243 * nullability feature.
244 */
245
246#if !__has_feature(nullability)
247#ifndef __nullable
248#define __nullable
249#endif
250#ifndef __nonnull
251#define __nonnull
252#endif
253#ifndef __null_unspecified
254#define __null_unspecified
255#endif
256#ifndef _Nullable
257#define _Nullable
258#endif
259#ifndef _Nonnull
260#define _Nonnull
261#endif
262#ifndef _Null_unspecified
263#define _Null_unspecified
264#endif
265#endif
266
267/*
268 * __disable_tail_calls causes the compiler to not perform tail call
269 * optimization inside the marked function.
270 */
271#if __has_attribute(disable_tail_calls)
272#define __disable_tail_calls __attribute__((__disable_tail_calls__))
273#else
274#define __disable_tail_calls
275#endif
276
277/*
278 * __not_tail_called causes the compiler to prevent tail call optimization
279 * on statically bound calls to the function. It has no effect on indirect
280 * calls. Virtual functions, objective-c methods, and functions marked as
281 * "always_inline" cannot be marked as __not_tail_called.
282 */
283#if __has_attribute(not_tail_called)
284#define __not_tail_called __attribute__((__not_tail_called__))
285#else
286#define __not_tail_called
287#endif
288
289/*
290 * __result_use_check warns callers of a function that not using the function
291 * return value is a bug, i.e. dismissing malloc() return value results in a
292 * memory leak.
293 */
294#if __has_attribute(warn_unused_result)
295#define __result_use_check __attribute__((__warn_unused_result__))
296#else
297#define __result_use_check
298#endif
299
300/*
301 * __swift_unavailable causes the compiler to mark a symbol as specifically
302 * unavailable in Swift, regardless of any other availability in C.
303 */
304#if __has_feature(attribute_availability_swift)
305#define __swift_unavailable(_msg) __attribute__((__availability__(swift, unavailable, message=_msg)))
306#else
307#define __swift_unavailable(_msg)
308#endif
309
310/*
311 * __abortlike is the attribute to put on functions like abort() that are
312 * typically used to mark assertions. These optimize the codegen
313 * for outlining while still maintaining debugability.
314 */
315#ifndef __abortlike
316#define __abortlike __dead2 __cold __not_tail_called
317#endif
318
319/* Declaring inline functions within headers is error-prone due to differences
320 * across various versions of the C language and extensions. __header_inline
321 * can be used to declare inline functions within system headers. In cases
322 * where you want to force inlining instead of letting the compiler make
323 * the decision, you can use __header_always_inline.
324 *
325 * Be aware that using inline for functions which compilers may also provide
326 * builtins can behave differently under various compilers. If you intend to
327 * provide an inline version of such a function, you may want to use a macro
328 * instead.
329 *
330 * The check for !__GNUC__ || __clang__ is because gcc doesn't correctly
331 * support c99 inline in some cases:
332 * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55965
333 */
334
335#if defined(__cplusplus) || \
336 (__STDC_VERSION__ >= 199901L && \
337 !defined(__GNUC_GNU_INLINE__) && \
338 (!defined(__GNUC__) || defined(__clang__)))
339# define __header_inline inline
340#elif defined(__GNUC__) && defined(__GNUC_STDC_INLINE__)
341# define __header_inline extern __inline __attribute__((__gnu_inline__))
342#elif defined(__GNUC__)
343# define __header_inline extern __inline
344#else
345/* If we land here, we've encountered an unsupported compiler,
346 * so hopefully it understands static __inline as a fallback.
347 */
348# define __header_inline static __inline
349#endif
350
351#ifdef __GNUC__
352# define __header_always_inline __header_inline __attribute__ ((__always_inline__))
353#else
354/* Unfortunately, we're using a compiler that we don't know how to force to
355 * inline. Oh well.
356 */
357# define __header_always_inline __header_inline
358#endif
359
360/*
361 * Compiler-dependent macros that bracket portions of code where the
362 * "-Wunreachable-code" warning should be ignored. Please use sparingly.
363 */
364#if defined(__clang__)
365# define __unreachable_ok_push \
366 _Pragma("clang diagnostic push") \
367 _Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
368# define __unreachable_ok_pop \
369 _Pragma("clang diagnostic pop")
370#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
371# define __unreachable_ok_push \
372 _Pragma("GCC diagnostic push") \
373 _Pragma("GCC diagnostic ignored \"-Wunreachable-code\"")
374# define __unreachable_ok_pop \
375 _Pragma("GCC diagnostic pop")
376#else
377# define __unreachable_ok_push
378# define __unreachable_ok_pop
379#endif
380
381/*
382 * Compiler-dependent macros to declare that functions take printf-like
383 * or scanf-like arguments. They are null except for versions of gcc
384 * that are known to support the features properly. Functions declared
385 * with these attributes will cause compilation warnings if there is a
386 * mismatch between the format string and subsequent function parameter
387 * types.
388 */
389#define __printflike(fmtarg, firstvararg) \
390 __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
391#define __printf0like(fmtarg, firstvararg) \
392 __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
393#define __scanflike(fmtarg, firstvararg) \
394 __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
395
396#define __IDSTRING(name, string) static const char name[] __used = string
397
398#ifndef __COPYRIGHT
399#define __COPYRIGHT(s) __IDSTRING(copyright,s)
400#endif
401
402#ifndef __RCSID
403#define __RCSID(s) __IDSTRING(rcsid,s)
404#endif
405
406#ifndef __SCCSID
407#define __SCCSID(s) __IDSTRING(sccsid,s)
408#endif
409
410#ifndef __PROJECT_VERSION
411#define __PROJECT_VERSION(s) __IDSTRING(project_version,s)
412#endif
413
414/* Source compatibility only, ID string not emitted in object file */
415#ifndef __FBSDID
416#define __FBSDID(s)
417#endif
418
419#ifndef __DECONST
420#define __DECONST(type, var) __CAST_AWAY_QUALIFIER(var, const, type)
421#endif
422
423#ifndef __DEVOLATILE
424#define __DEVOLATILE(type, var) __CAST_AWAY_QUALIFIER(var, volatile, type)
425#endif
426
427#ifndef __DEQUALIFY
428#define __DEQUALIFY(type, var) __CAST_AWAY_QUALIFIER(var, const volatile, type)
429#endif
430
431/*
432 * __alloc_size can be used to label function arguments that represent the
433 * size of memory that the function allocates and returns. The one-argument
434 * form labels a single argument that gives the allocation size (where the
435 * arguments are numbered from 1):
436 *
437 * void *malloc(size_t __size) __alloc_size(1);
438 *
439 * The two-argument form handles the case where the size is calculated as the
440 * product of two arguments:
441 *
442 * void *calloc(size_t __count, size_t __size) __alloc_size(1,2);
443 */
444#ifndef __alloc_size
445#if __has_attribute(alloc_size)
446#define __alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
447#else
448#define __alloc_size(...)
449#endif
450#endif // __alloc_size
451
452/*
453 * COMPILATION ENVIRONMENTS -- see compat(5) for additional detail
454 *
455 * DEFAULT By default newly complied code will get POSIX APIs plus
456 * Apple API extensions in scope.
457 *
458 * Most users will use this compilation environment to avoid
459 * behavioral differences between 32 and 64 bit code.
460 *
461 * LEGACY Defining _NONSTD_SOURCE will get pre-POSIX APIs plus Apple
462 * API extensions in scope.
463 *
464 * This is generally equivalent to the Tiger release compilation
465 * environment, except that it cannot be applied to 64 bit code;
466 * its use is discouraged.
467 *
468 * We expect this environment to be deprecated in the future.
469 *
470 * STRICT Defining _POSIX_C_SOURCE or _XOPEN_SOURCE restricts the
471 * available APIs to exactly the set of APIs defined by the
472 * corresponding standard, based on the value defined.
473 *
474 * A correct, portable definition for _POSIX_C_SOURCE is 200112L.
475 * A correct, portable definition for _XOPEN_SOURCE is 600L.
476 *
477 * Apple API extensions are not visible in this environment,
478 * which can cause Apple specific code to fail to compile,
479 * or behave incorrectly if prototypes are not in scope or
480 * warnings about missing prototypes are not enabled or ignored.
481 *
482 * In any compilation environment, for correct symbol resolution to occur,
483 * function prototypes must be in scope. It is recommended that all Apple
484 * tools users add either the "-Wall" or "-Wimplicit-function-declaration"
485 * compiler flags to their projects to be warned when a function is being
486 * used without a prototype in scope.
487 */
488
489/* These settings are particular to each product. */
490/* Platform: MacOSX */
491#if defined(__i386__)
492#define __DARWIN_ONLY_64_BIT_INO_T 0
493#define __DARWIN_ONLY_UNIX_CONFORMANCE 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
504
505/*
506 * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow
507 * legacy code to use the old symbol, thus maintaining binary compatibility
508 * while new code can use a standards compliant version of the same function.
509 *
510 * __DARWIN_ALIAS is used by itself if the function signature has not
511 * changed, it is used along with a #ifdef check for __DARWIN_UNIX03
512 * if the signature has changed. Because the __LP64__ environment
513 * only supports UNIX03 semantics it causes __DARWIN_UNIX03 to be
514 * defined, but causes __DARWIN_ALIAS to do no symbol mangling.
515 *
516 * As a special case, when XCode is used to target a specific version of the
517 * OS, the manifest constant __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
518 * will be defined by the compiler, with the digits representing major version
519 * time 100 + minor version times 10 (e.g. 10.5 := 1050). If we are targeting
520 * pre-10.5, and it is the default compilation environment, revert the
521 * compilation environment to pre-__DARWIN_UNIX03.
522 */
523#if !defined(__DARWIN_UNIX03)
524# if __DARWIN_ONLY_UNIX_CONFORMANCE
525# if defined(_NONSTD_SOURCE)
526# error "Can't define _NONSTD_SOURCE when only UNIX conformance is available."
527# endif /* _NONSTD_SOURCE */
528# define __DARWIN_UNIX03 1
529# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0) < 1040)
530# define __DARWIN_UNIX03 0
531# elif defined(_DARWIN_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE)
532# if defined(_NONSTD_SOURCE)
533# error "Can't define both _NONSTD_SOURCE and any of _DARWIN_C_SOURCE, _XOPEN_SOURCE or _POSIX_C_SOURCE."
534# endif /* _NONSTD_SOURCE */
535# define __DARWIN_UNIX03 1
536# elif defined(_NONSTD_SOURCE)
537# define __DARWIN_UNIX03 0
538# else /* default */
539# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0) < 1050)
540# define __DARWIN_UNIX03 0
541# else /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */
542# define __DARWIN_UNIX03 1
543# endif /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */
544# endif /* _DARWIN_C_SOURCE || _XOPEN_SOURCE || _POSIX_C_SOURCE || __LP64__ */
545#endif /* !__DARWIN_UNIX03 */
546
547#if !defined(__DARWIN_64_BIT_INO_T)
548# if defined(_DARWIN_USE_64_BIT_INODE)
549# if defined(_DARWIN_NO_64_BIT_INODE)
550# error "Can't define both _DARWIN_USE_64_BIT_INODE and _DARWIN_NO_64_BIT_INODE."
551# endif /* _DARWIN_NO_64_BIT_INODE */
552# define __DARWIN_64_BIT_INO_T 1
553# elif defined(_DARWIN_NO_64_BIT_INODE)
554# if __DARWIN_ONLY_64_BIT_INO_T
555# error "Can't define _DARWIN_NO_64_BIT_INODE when only 64-bit inodes are available."
556# endif /* __DARWIN_ONLY_64_BIT_INO_T */
557# define __DARWIN_64_BIT_INO_T 0
558# else /* default */
559# if __DARWIN_ONLY_64_BIT_INO_T
560# define __DARWIN_64_BIT_INO_T 1
561# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0) < 1060) || __DARWIN_UNIX03 == 0
562# define __DARWIN_64_BIT_INO_T 0
563# else /* default */
564# define __DARWIN_64_BIT_INO_T 1
565# endif /* __DARWIN_ONLY_64_BIT_INO_T */
566# endif
567#endif /* !__DARWIN_64_BIT_INO_T */
568
569#if !defined(__DARWIN_VERS_1050)
570# if __DARWIN_ONLY_VERS_1050
571# define __DARWIN_VERS_1050 1
572# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0) < 1050) || __DARWIN_UNIX03 == 0
573# define __DARWIN_VERS_1050 0
574# else /* default */
575# define __DARWIN_VERS_1050 1
576# endif
577#endif /* !__DARWIN_VERS_1050 */
578
579#if !defined(__DARWIN_NON_CANCELABLE)
580# define __DARWIN_NON_CANCELABLE 0
581#endif /* !__DARWIN_NON_CANCELABLE */
582
583/*
584 * symbol suffixes used for symbol versioning
585 */
586#if __DARWIN_UNIX03
587# if __DARWIN_ONLY_UNIX_CONFORMANCE
588# define __DARWIN_SUF_UNIX03 /* nothing */
589# else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */
590# define __DARWIN_SUF_UNIX03 "$UNIX2003"
591# endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */
592
593# if __DARWIN_64_BIT_INO_T
594# if __DARWIN_ONLY_64_BIT_INO_T
595# define __DARWIN_SUF_64_BIT_INO_T /* nothing */
596# else /* !__DARWIN_ONLY_64_BIT_INO_T */
597# define __DARWIN_SUF_64_BIT_INO_T "$INODE64"
598# endif /* __DARWIN_ONLY_64_BIT_INO_T */
599# else /* !__DARWIN_64_BIT_INO_T */
600# define __DARWIN_SUF_64_BIT_INO_T /* nothing */
601# endif /* __DARWIN_64_BIT_INO_T */
602
603# if __DARWIN_VERS_1050
604# if __DARWIN_ONLY_VERS_1050
605# define __DARWIN_SUF_1050 /* nothing */
606# else /* !__DARWIN_ONLY_VERS_1050 */
607# define __DARWIN_SUF_1050 "$1050"
608# endif /* __DARWIN_ONLY_VERS_1050 */
609# else /* !__DARWIN_VERS_1050 */
610# define __DARWIN_SUF_1050 /* nothing */
611# endif /* __DARWIN_VERS_1050 */
612
613# if __DARWIN_NON_CANCELABLE
614# define __DARWIN_SUF_NON_CANCELABLE "$NOCANCEL"
615# else /* !__DARWIN_NON_CANCELABLE */
616# define __DARWIN_SUF_NON_CANCELABLE /* nothing */
617# endif /* __DARWIN_NON_CANCELABLE */
618
619#else /* !__DARWIN_UNIX03 */
620# define __DARWIN_SUF_UNIX03 /* nothing */
621# define __DARWIN_SUF_64_BIT_INO_T /* nothing */
622# define __DARWIN_SUF_NON_CANCELABLE /* nothing */
623# define __DARWIN_SUF_1050 /* nothing */
624#endif /* __DARWIN_UNIX03 */
625
626#define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN"
627
628/*
629 * symbol versioning macros
630 */
631#define __DARWIN_ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_UNIX03)
632#define __DARWIN_ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
633#define __DARWIN_ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)
634#define __DARWIN_NOCANCEL(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE)
635#define __DARWIN_INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T)
636
637#define __DARWIN_1050(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050)
638#define __DARWIN_1050ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_UNIX03)
639#define __DARWIN_1050ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
640#define __DARWIN_1050ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)
641#define __DARWIN_1050INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T)
642
643#define __DARWIN_EXTSN(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN)
644#define __DARWIN_EXTSN_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN __DARWIN_SUF_NON_CANCELABLE)
645
646/*
647 * symbol release macros
648 */
649#include <sys/_symbol_aliasing.h>
650
651#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
652#define __DARWIN_ALIAS_STARTING(_mac, _iphone, x) __DARWIN_ALIAS_STARTING_IPHONE_##_iphone(x)
653#elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
654#define __DARWIN_ALIAS_STARTING(_mac, _iphone, x) __DARWIN_ALIAS_STARTING_MAC_##_mac(x)
655#else
656#define __DARWIN_ALIAS_STARTING(_mac, _iphone, x) x
657#endif
658
659
660/*
661 * POSIX.1 requires that the macros we test be defined before any standard
662 * header file is included. This permits us to convert values for feature
663 * testing, as necessary, using only _POSIX_C_SOURCE.
664 *
665 * Here's a quick run-down of the versions:
666 * defined(_POSIX_SOURCE) 1003.1-1988
667 * _POSIX_C_SOURCE == 1L 1003.1-1990
668 * _POSIX_C_SOURCE == 2L 1003.2-1992 C Language Binding Option
669 * _POSIX_C_SOURCE == 199309L 1003.1b-1993
670 * _POSIX_C_SOURCE == 199506L 1003.1c-1995, 1003.1i-1995,
671 * and the omnibus ISO/IEC 9945-1: 1996
672 * _POSIX_C_SOURCE == 200112L 1003.1-2001
673 * _POSIX_C_SOURCE == 200809L 1003.1-2008
674 *
675 * In addition, the X/Open Portability Guide, which is now the Single UNIX
676 * Specification, defines a feature-test macro which indicates the version of
677 * that specification, and which subsumes _POSIX_C_SOURCE.
678 */
679
680/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1L. */
681#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1L
682#undef _POSIX_C_SOURCE
683#define _POSIX_C_SOURCE 199009L
684#endif
685
686/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2L. */
687#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2L
688#undef _POSIX_C_SOURCE
689#define _POSIX_C_SOURCE 199209L
690#endif
691
692/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
693#ifdef _XOPEN_SOURCE
694#if _XOPEN_SOURCE - 0L >= 700L && (!defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE - 0L < 200809L)
695#undef _POSIX_C_SOURCE
696#define _POSIX_C_SOURCE 200809L
697#elif _XOPEN_SOURCE - 0L >= 600L && (!defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE - 0L < 200112L)
698#undef _POSIX_C_SOURCE
699#define _POSIX_C_SOURCE 200112L
700#elif _XOPEN_SOURCE - 0L >= 500L && (!defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE - 0L < 199506L)
701#undef _POSIX_C_SOURCE
702#define _POSIX_C_SOURCE 199506L
703#endif
704#endif
705
706/*
707 * Deal with all versions of POSIX. The ordering relative to the tests above is
708 * important.
709 */
710#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
711#define _POSIX_C_SOURCE 198808L
712#endif
713
714/* POSIX C deprecation macros */
715#include <sys/_posix_availability.h>
716
717#define __POSIX_C_DEPRECATED(ver) ___POSIX_C_DEPRECATED_STARTING_##ver
718
719/*
720 * Set a single macro which will always be defined and can be used to determine
721 * the appropriate namespace. For POSIX, these values will correspond to
722 * _POSIX_C_SOURCE value. Currently there are two additional levels corresponding
723 * to ANSI (_ANSI_SOURCE) and Darwin extensions (_DARWIN_C_SOURCE)
724 */
725#define __DARWIN_C_ANSI 010000L
726#define __DARWIN_C_FULL 900000L
727
728#if defined(_ANSI_SOURCE)
729#define __DARWIN_C_LEVEL __DARWIN_C_ANSI
730#elif defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE) && !defined(_NONSTD_SOURCE)
731#define __DARWIN_C_LEVEL _POSIX_C_SOURCE
732#else
733#define __DARWIN_C_LEVEL __DARWIN_C_FULL
734#endif
735
736/* If the developer has neither requested a strict language mode nor a version
737 * of POSIX, turn on functionality provided by __STDC_WANT_LIB_EXT1__ as part
738 * of __DARWIN_C_FULL.
739 */
740#if !defined(__STDC_WANT_LIB_EXT1__) && !defined(__STRICT_ANSI__) && __DARWIN_C_LEVEL >= __DARWIN_C_FULL
741#define __STDC_WANT_LIB_EXT1__ 1
742#endif
743
744/*
745 * long long is not supported in c89 (__STRICT_ANSI__), but g++ -ansi and
746 * c99 still want long longs. While not perfect, we allow long longs for
747 * g++.
748 */
749#if (defined(__STRICT_ANSI__) && (__STDC_VERSION__ - 0 < 199901L) && !defined(__GNUG__))
750#define __DARWIN_NO_LONG_LONG 1
751#else
752#define __DARWIN_NO_LONG_LONG 0
753#endif
754
755/*****************************************
756* Public darwin-specific feature macros
757*****************************************/
758
759/*
760 * _DARWIN_FEATURE_64_BIT_INODE indicates that the ino_t type is 64-bit, and
761 * structures modified for 64-bit inodes (like struct stat) will be used.
762 */
763#if __DARWIN_64_BIT_INO_T
764#define _DARWIN_FEATURE_64_BIT_INODE 1
765#endif
766
767/*
768 * _DARWIN_FEATURE_64_ONLY_BIT_INODE indicates that the ino_t type may only
769 * be 64-bit; there is no support for 32-bit ino_t when this macro is defined
770 * (and non-zero). There is no struct stat64 either, as the regular
771 * struct stat will already be the 64-bit version.
772 */
773#if __DARWIN_ONLY_64_BIT_INO_T
774#define _DARWIN_FEATURE_ONLY_64_BIT_INODE 1
775#endif
776
777/*
778 * _DARWIN_FEATURE_ONLY_VERS_1050 indicates that only those APIs updated
779 * in 10.5 exists; no pre-10.5 variants are available.
780 */
781#if __DARWIN_ONLY_VERS_1050
782#define _DARWIN_FEATURE_ONLY_VERS_1050 1
783#endif
784
785/*
786 * _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE indicates only UNIX conforming API
787 * are available (the legacy BSD APIs are not available)
788 */
789#if __DARWIN_ONLY_UNIX_CONFORMANCE
790#define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1
791#endif
792
793/*
794 * _DARWIN_FEATURE_UNIX_CONFORMANCE indicates whether UNIX conformance is on,
795 * and specifies the conformance level (3 is SUSv3)
796 */
797#if __DARWIN_UNIX03
798#define _DARWIN_FEATURE_UNIX_CONFORMANCE 3
799#endif
800
801
802/*
803 * This macro casts away the qualifier from the variable
804 *
805 * Note: use at your own risk, removing qualifiers can result in
806 * catastrophic run-time failures.
807 */
808#ifndef __CAST_AWAY_QUALIFIER
809#define __CAST_AWAY_QUALIFIER(variable, qualifier, type) (type) (long)(variable)
810#endif
811
812/*
813 * __XNU_PRIVATE_EXTERN is a linkage decoration indicating that a symbol can be
814 * used from other compilation units, but not other libraries or executables.
815 */
816#ifndef __XNU_PRIVATE_EXTERN
817#define __XNU_PRIVATE_EXTERN __attribute__((visibility("hidden")))
818#endif
819
820/*
821 * Architecture validation for current SDK
822 */
823#if !defined(__sys_cdefs_arch_unknown__) && defined(__i386__)
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__)
827#else
828#error Unsupported architecture
829#endif
830
831
832
833#define __compiler_barrier() __asm__ __volatile__("" ::: "memory")
834
835#if __has_attribute(enum_extensibility)
836#define __enum_open __attribute__((__enum_extensibility__(open)))
837#define __enum_closed __attribute__((__enum_extensibility__(closed)))
838#else
839#define __enum_open
840#define __enum_closed
841#endif // __has_attribute(enum_extensibility)
842
843#if __has_attribute(flag_enum)
844#define __enum_options __attribute__((__flag_enum__))
845#else
846#define __enum_options
847#endif
848
849/*
850 * Similar to OS_ENUM/OS_CLOSED_ENUM/OS_OPTIONS/OS_CLOSED_OPTIONS
851 *
852 * This provides more advanced type checking on compilers supporting
853 * the proper extensions, even in C.
854 */
855#if __has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum) || \
856 __has_extension(cxx_strong_enums)
857#define __enum_decl(_name, _type, ...) \
858 typedef enum : _type __VA_ARGS__ __enum_open _name
859#define __enum_closed_decl(_name, _type, ...) \
860 typedef enum : _type __VA_ARGS__ __enum_closed _name
861#define __options_decl(_name, _type, ...) \
862 typedef enum : _type __VA_ARGS__ __enum_open __enum_options _name
863#define __options_closed_decl(_name, _type, ...) \
864 typedef enum : _type __VA_ARGS__ __enum_closed __enum_options _name
865#else
866#define __enum_decl(_name, _type, ...) \
867 typedef _type _name; enum __VA_ARGS__ __enum_open
868#define __enum_closed_decl(_name, _type, ...) \
869 typedef _type _name; enum __VA_ARGS__ __enum_closed
870#define __options_decl(_name, _type, ...) \
871 typedef _type _name; enum __VA_ARGS__ __enum_open __enum_options
872#define __options_closed_decl(_name, _type, ...) \
873 typedef _type _name; enum __VA_ARGS__ __enum_closed __enum_options
874#endif
875
876#endif /* !_CDEFS_H_ */
lib/libc/include/aarch64-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
89struct 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
112struct 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/aarch64-macos-gnu/sys/errno.h created+266
......@@ -0,0 +1,266 @@
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/* 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 * @(#)errno.h 8.5 (Berkeley) 1/21/94
67 */
68
69#ifndef _SYS_ERRNO_H_
70#define _SYS_ERRNO_H_
71
72#include <sys/cdefs.h>
73
74
75#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
76#include <sys/_types/_errno_t.h>
77#endif
78
79__BEGIN_DECLS
80extern int * __error(void);
81#define errno (*__error())
82__END_DECLS
83
84/*
85 * Error codes
86 */
87
88#define EPERM 1 /* Operation not permitted */
89#define ENOENT 2 /* No such file or directory */
90#define ESRCH 3 /* No such process */
91#define EINTR 4 /* Interrupted system call */
92#define EIO 5 /* Input/output error */
93#define ENXIO 6 /* Device not configured */
94#define E2BIG 7 /* Argument list too long */
95#define ENOEXEC 8 /* Exec format error */
96#define EBADF 9 /* Bad file descriptor */
97#define ECHILD 10 /* No child processes */
98#define EDEADLK 11 /* Resource deadlock avoided */
99 /* 11 was EAGAIN */
100#define ENOMEM 12 /* Cannot allocate memory */
101#define EACCES 13 /* Permission denied */
102#define EFAULT 14 /* Bad address */
103#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
104#define ENOTBLK 15 /* Block device required */
105#endif
106#define EBUSY 16 /* Device / Resource busy */
107#define EEXIST 17 /* File exists */
108#define EXDEV 18 /* Cross-device link */
109#define ENODEV 19 /* Operation not supported by device */
110#define ENOTDIR 20 /* Not a directory */
111#define EISDIR 21 /* Is a directory */
112#define EINVAL 22 /* Invalid argument */
113#define ENFILE 23 /* Too many open files in system */
114#define EMFILE 24 /* Too many open files */
115#define ENOTTY 25 /* Inappropriate ioctl for device */
116#define ETXTBSY 26 /* Text file busy */
117#define EFBIG 27 /* File too large */
118#define ENOSPC 28 /* No space left on device */
119#define ESPIPE 29 /* Illegal seek */
120#define EROFS 30 /* Read-only file system */
121#define EMLINK 31 /* Too many links */
122#define EPIPE 32 /* Broken pipe */
123
124/* math software */
125#define EDOM 33 /* Numerical argument out of domain */
126#define ERANGE 34 /* Result too large */
127
128/* non-blocking and interrupt i/o */
129#define EAGAIN 35 /* Resource temporarily unavailable */
130#define EWOULDBLOCK EAGAIN /* Operation would block */
131#define EINPROGRESS 36 /* Operation now in progress */
132#define EALREADY 37 /* Operation already in progress */
133
134/* ipc/network software -- argument errors */
135#define ENOTSOCK 38 /* Socket operation on non-socket */
136#define EDESTADDRREQ 39 /* Destination address required */
137#define EMSGSIZE 40 /* Message too long */
138#define EPROTOTYPE 41 /* Protocol wrong type for socket */
139#define ENOPROTOOPT 42 /* Protocol not available */
140#define EPROTONOSUPPORT 43 /* Protocol not supported */
141#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
142#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
143#endif
144#define ENOTSUP 45 /* Operation not supported */
145#if !__DARWIN_UNIX03 && !defined(KERNEL)
146/*
147 * This is the same for binary and source copmpatability, unless compiling
148 * the kernel itself, or compiling __DARWIN_UNIX03; if compiling for the
149 * kernel, the correct value will be returned. If compiling non-POSIX
150 * source, the kernel return value will be converted by a stub in libc, and
151 * if compiling source with __DARWIN_UNIX03, the conversion in libc is not
152 * done, and the caller gets the expected (discrete) value.
153 */
154#define EOPNOTSUPP ENOTSUP /* Operation not supported on socket */
155#endif /* !__DARWIN_UNIX03 && !KERNEL */
156
157#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
158#define EPFNOSUPPORT 46 /* Protocol family not supported */
159#endif
160#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
161#define EADDRINUSE 48 /* Address already in use */
162#define EADDRNOTAVAIL 49 /* Can't assign requested address */
163
164/* ipc/network software -- operational errors */
165#define ENETDOWN 50 /* Network is down */
166#define ENETUNREACH 51 /* Network is unreachable */
167#define ENETRESET 52 /* Network dropped connection on reset */
168#define ECONNABORTED 53 /* Software caused connection abort */
169#define ECONNRESET 54 /* Connection reset by peer */
170#define ENOBUFS 55 /* No buffer space available */
171#define EISCONN 56 /* Socket is already connected */
172#define ENOTCONN 57 /* Socket is not connected */
173#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
174#define ESHUTDOWN 58 /* Can't send after socket shutdown */
175#define ETOOMANYREFS 59 /* Too many references: can't splice */
176#endif
177#define ETIMEDOUT 60 /* Operation timed out */
178#define ECONNREFUSED 61 /* Connection refused */
179
180#define ELOOP 62 /* Too many levels of symbolic links */
181#define ENAMETOOLONG 63 /* File name too long */
182
183/* should be rearranged */
184#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
185#define EHOSTDOWN 64 /* Host is down */
186#endif
187#define EHOSTUNREACH 65 /* No route to host */
188#define ENOTEMPTY 66 /* Directory not empty */
189
190/* quotas & mush */
191#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
192#define EPROCLIM 67 /* Too many processes */
193#define EUSERS 68 /* Too many users */
194#endif
195#define EDQUOT 69 /* Disc quota exceeded */
196
197/* Network File System */
198#define ESTALE 70 /* Stale NFS file handle */
199#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
200#define EREMOTE 71 /* Too many levels of remote in path */
201#define EBADRPC 72 /* RPC struct is bad */
202#define ERPCMISMATCH 73 /* RPC version wrong */
203#define EPROGUNAVAIL 74 /* RPC prog. not avail */
204#define EPROGMISMATCH 75 /* Program version wrong */
205#define EPROCUNAVAIL 76 /* Bad procedure for program */
206#endif
207
208#define ENOLCK 77 /* No locks available */
209#define ENOSYS 78 /* Function not implemented */
210
211#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
212#define EFTYPE 79 /* Inappropriate file type or format */
213#define EAUTH 80 /* Authentication error */
214#define ENEEDAUTH 81 /* Need authenticator */
215
216/* Intelligent device errors */
217#define EPWROFF 82 /* Device power is off */
218#define EDEVERR 83 /* Device error, e.g. paper out */
219#endif
220
221#define EOVERFLOW 84 /* Value too large to be stored in data type */
222
223/* Program loading errors */
224#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
225#define EBADEXEC 85 /* Bad executable */
226#define EBADARCH 86 /* Bad CPU type in executable */
227#define ESHLIBVERS 87 /* Shared library version mismatch */
228#define EBADMACHO 88 /* Malformed Macho file */
229#endif
230
231#define ECANCELED 89 /* Operation canceled */
232
233#define EIDRM 90 /* Identifier removed */
234#define ENOMSG 91 /* No message of desired type */
235#define EILSEQ 92 /* Illegal byte sequence */
236#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
237#define ENOATTR 93 /* Attribute not found */
238#endif
239
240#define EBADMSG 94 /* Bad message */
241#define EMULTIHOP 95 /* Reserved */
242#define ENODATA 96 /* No message available on STREAM */
243#define ENOLINK 97 /* Reserved */
244#define ENOSR 98 /* No STREAM resources */
245#define ENOSTR 99 /* Not a STREAM */
246#define EPROTO 100 /* Protocol error */
247#define ETIME 101 /* STREAM ioctl timeout */
248
249#if __DARWIN_UNIX03 || defined(KERNEL)
250/* This value is only discrete when compiling __DARWIN_UNIX03, or KERNEL */
251#define EOPNOTSUPP 102 /* Operation not supported on socket */
252#endif /* __DARWIN_UNIX03 || KERNEL */
253
254#define ENOPOLICY 103 /* No such policy registered */
255
256#if __DARWIN_C_LEVEL >= 200809L
257#define ENOTRECOVERABLE 104 /* State not recoverable */
258#define EOWNERDEAD 105 /* Previous owner died */
259#endif
260
261#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
262#define EQFULL 106 /* Interface output queue is full */
263#define ELAST 106 /* Must be equal largest errno */
264#endif
265
266#endif /* _SYS_ERRNO_H_ */
lib/libc/include/aarch64-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
84struct 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
96struct 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 */
256enum {
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 */
274enum {
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>
370struct knote;
371SLIST_HEAD(klist, knote);
372
373
374#include <sys/types.h>
375
376struct timespec;
377
378__BEGIN_DECLS
379int kqueue(void);
380int kevent(int kq,
381 const struct kevent *changelist, int nchanges,
382 struct kevent *eventlist, int nevents,
383 const struct timespec *timeout);
384int 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/aarch64-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 */
350struct 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 */
365struct 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
378struct 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
391typedef 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
403typedef 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 */
422typedef 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 */
436typedef 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
451typedef 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 */
460typedef 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 */
468typedef 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 */
474typedef 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
483typedef 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
513struct 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
536typedef 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
554int open(const char *, int, ...) __DARWIN_ALIAS_C(open);
555#if __DARWIN_C_LEVEL >= 200809L
556int openat(int, const char *, int, ...) __DARWIN_NOCANCEL(openat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
557#endif
558int creat(const char *, mode_t) __DARWIN_ALIAS_C(creat);
559int fcntl(int, int, ...) __DARWIN_ALIAS_C(fcntl);
560#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
561
562int 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 */
567int open_dprotected_np( const char *, int, int, int, ...);
568int flock(int, int);
569filesec_t filesec_init(void);
570filesec_t filesec_dup(filesec_t);
571void filesec_free(filesec_t);
572int filesec_get_property(filesec_t, filesec_property_t, void *);
573int filesec_query_property(filesec_t, filesec_property_t, int *);
574int filesec_set_property(filesec_t, filesec_property_t, const void *);
575int 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/aarch64-macos-gnu/sys/file.h created+86
......@@ -0,0 +1,86 @@
1/*
2 * Copyright (c) 2000-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/* 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 *
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 * @(#)file.h 8.3 (Berkeley) 1/9/95
62 */
63
64#ifndef _SYS_FILE_H_
65#define _SYS_FILE_H_
66
67#include <sys/appleapiopts.h>
68#include <sys/types.h>
69#include <sys/fcntl.h>
70#include <sys/unistd.h>
71#include <sys/queue.h>
72#include <sys/cdefs.h>
73
74
75#ifndef _KAUTH_CRED_T
76#define _KAUTH_CRED_T
77struct ucred;
78typedef struct ucred *kauth_cred_t;
79struct posix_cred;
80typedef struct posix_cred *posix_cred_t;
81#endif /* !_KAUTH_CRED_T */
82
83__BEGIN_DECLS
84
85__END_DECLS
86#endif /* !_SYS_FILE_H_ */
lib/libc/include/aarch64-macos-gnu/sys/filio.h created+85
......@@ -0,0 +1,85 @@
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 * (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 * @(#)filio.h 8.1 (Berkeley) 3/28/94
67 */
68
69#ifndef _SYS_FILIO_H_
70#define _SYS_FILIO_H_
71
72#include <sys/ioccom.h>
73
74/* Generic file-descriptor ioctl's. */
75#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
76#define FIONCLEX _IO('f', 2) /* remove close on exec */
77#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
78#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
79#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
80#define FIOSETOWN _IOW('f', 124, int) /* set owner */
81#define FIOGETOWN _IOR('f', 123, int) /* get owner */
82#define FIODTYPE _IOR('f', 122, int) /* get d_type */
83
84
85#endif /* !_SYS_FILIO_H_ */
lib/libc/include/aarch64-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/aarch64-macos-gnu/sys/ioctl.h created+110
......@@ -0,0 +1,110 @@
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 * (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 * @(#)ioctl.h 8.6 (Berkeley) 3/28/94
67 */
68
69#ifndef _SYS_IOCTL_H_
70#define _SYS_IOCTL_H_
71
72#include <sys/ttycom.h>
73
74/*
75 * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
76 * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
77 * nonwithstanding).
78 */
79struct ttysize {
80 unsigned short ts_lines;
81 unsigned short ts_cols;
82 unsigned short ts_xxx;
83 unsigned short ts_yyy;
84};
85#define TIOCGSIZE TIOCGWINSZ
86#define TIOCSSIZE TIOCSWINSZ
87
88#include <sys/ioccom.h>
89
90#include <sys/filio.h>
91#include <sys/sockio.h>
92
93
94#include <sys/cdefs.h>
95
96__BEGIN_DECLS
97int ioctl(int, unsigned long, ...);
98__END_DECLS
99#endif /* !_SYS_IOCTL_H_ */
100
101/*
102 * Keep outside _SYS_IOCTL_H_
103 * Compatability with old terminal driver
104 *
105 * Source level -> #define USE_OLD_TTY
106 * Kernel level -> always on
107 */
108#if defined(USE_OLD_TTY) || defined(BSD_KERNEL_PRIVATE)
109#include <sys/ioctl_compat.h>
110#endif /* !_SYS_IOCTL_H_ */
lib/libc/include/aarch64-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 */
107struct 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 */
127struct __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] */
172key_t ftok(const char *, int);
173__END_DECLS
174
175
176#endif /* !_SYS_IPC_H_ */
lib/libc/include/aarch64-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 */
60typedef 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 */
81struct 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
131struct 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
153typedef u_int32_t kauth_ace_rights_t;
154
155/* Access Control List Entry (ACE) */
156struct 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
187typedef struct kauth_ace *kauth_ace_t;
188#endif
189
190
191/* Access Control List */
192struct 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
237typedef struct kauth_acl *kauth_acl_t;
238#endif
239
240
241
242/*
243 * Extended File Security.
244 */
245
246/* File Security information */
247struct 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
268typedef 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/aarch64-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/aarch64-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] */
231int mlockall(int);
232int munlockall(void);
233/* [MR] */
234int mlock(const void *, size_t);
235#ifndef _MMAP
236#define _MMAP
237/* [MC3]*/
238void * mmap(void *, size_t, int, int, int, off_t) __DARWIN_ALIAS(mmap);
239#endif
240/* [MPR] */
241int mprotect(void *, size_t, int) __DARWIN_ALIAS(mprotect);
242/* [MF|SIO] */
243int msync(void *, size_t, int) __DARWIN_ALIAS_C(msync);
244/* [MR] */
245int munlock(const void *, size_t);
246/* [MC3]*/
247int munmap(void *, size_t) __DARWIN_ALIAS(munmap);
248/* [SHM] */
249int shm_open(const char *, int, ...);
250int shm_unlink(const char *);
251/* [ADV] */
252int posix_madvise(void *, size_t, int);
253
254#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
255int madvise(void *, size_t, int);
256int mincore(const void *, size_t, char *);
257int minherit(void *, size_t, int);
258#endif
259
260
261__END_DECLS
262
263#endif /* !_SYS_MMAN_H_ */
lib/libc/include/aarch64-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
123struct statfs64 __DARWIN_STRUCT_STATFS64;
124
125#endif /* !__DARWIN_ONLY_64_BIT_INO_T */
126
127#if __DARWIN_64_BIT_INO_T
128
129struct statfs __DARWIN_STRUCT_STATFS64;
130
131#else /* !__DARWIN_64_BIT_INO_T */
132
133/*
134 * LP64 - WARNING - must be kept in sync with struct user_statfs in mount_internal.h.
135 */
136struct statfs {
137 short f_otype; /* TEMPORARY SHADOW COPY OF f_type */
138 short f_oflags; /* TEMPORARY SHADOW COPY OF f_flags */
139 long f_bsize; /* fundamental file system block size */
140 long f_iosize; /* optimal transfer block size */
141 long f_blocks; /* total data blocks in file system */
142 long f_bfree; /* free blocks in fs */
143 long f_bavail; /* free blocks avail to non-superuser */
144 long f_files; /* total file nodes in file system */
145 long f_ffree; /* free file nodes in fs */
146 fsid_t f_fsid; /* file system id */
147 uid_t f_owner; /* user that mounted the filesystem */
148 short f_reserved1; /* spare for later */
149 short f_type; /* type of filesystem */
150 long f_flags; /* copy of mount exported flags */
151 long f_reserved2[2]; /* reserved for future use */
152 char f_fstypename[MFSNAMELEN]; /* fs type name */
153 char f_mntonname[MNAMELEN]; /* directory on which mounted */
154 char f_mntfromname[MNAMELEN];/* mounted filesystem */
155 char f_reserved3; /* For alignment */
156 long f_reserved4[4]; /* For future use */
157};
158
159#endif /* __DARWIN_64_BIT_INO_T */
160
161#pragma pack(4)
162
163struct vfsstatfs {
164 uint32_t f_bsize; /* fundamental file system block size */
165 size_t f_iosize; /* optimal transfer block size */
166 uint64_t f_blocks; /* total data blocks in file system */
167 uint64_t f_bfree; /* free blocks in fs */
168 uint64_t f_bavail; /* free blocks avail to non-superuser */
169 uint64_t f_bused; /* free blocks avail to non-superuser */
170 uint64_t f_files; /* total file nodes in file system */
171 uint64_t f_ffree; /* free file nodes in fs */
172 fsid_t f_fsid; /* file system id */
173 uid_t f_owner; /* user that mounted the filesystem */
174 uint64_t f_flags; /* copy of mount exported flags */
175 char f_fstypename[MFSTYPENAMELEN];/* fs type name inclus */
176 char f_mntonname[MAXPATHLEN];/* directory on which mounted */
177 char f_mntfromname[MAXPATHLEN];/* mounted filesystem */
178 uint32_t f_fssubtype; /* fs sub-type (flavor) */
179 void *f_reserved[2]; /* For future use == 0 */
180};
181
182#pragma pack()
183
184
185/*
186 * User specifiable flags.
187 *
188 * Unmount uses MNT_FORCE flag.
189 */
190#define MNT_RDONLY 0x00000001 /* read only filesystem */
191#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
192#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
193#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
194#define MNT_NODEV 0x00000010 /* don't interpret special files */
195#define MNT_UNION 0x00000020 /* union with underlying filesystem */
196#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
197#define MNT_CPROTECT 0x00000080 /* file system supports content protection */
198
199/*
200 * NFS export related mount flags.
201 */
202#define MNT_EXPORTED 0x00000100 /* file system is exported */
203
204/*
205 * Denotes storage which can be removed from the system by the user.
206 */
207
208#define MNT_REMOVABLE 0x00000200
209
210/*
211 * MAC labeled / "quarantined" flag
212 */
213#define MNT_QUARANTINE 0x00000400 /* file system is quarantined */
214
215/*
216 * Flags set by internal operations.
217 */
218#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
219#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
220#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
221#define MNT_DOVOLFS 0x00008000 /* FS supports volfs (deprecated flag in Mac OS X 10.5) */
222
223
224#define MNT_DONTBROWSE 0x00100000 /* file system is not appropriate path to user data */
225#define MNT_IGNORE_OWNERSHIP 0x00200000 /* VFS will ignore ownership information on filesystem objects */
226#define MNT_AUTOMOUNTED 0x00400000 /* filesystem was mounted by automounter */
227#define MNT_JOURNALED 0x00800000 /* filesystem is journaled */
228#define MNT_NOUSERXATTR 0x01000000 /* Don't allow user extended attributes */
229#define MNT_DEFWRITE 0x02000000 /* filesystem should defer writes */
230#define MNT_MULTILABEL 0x04000000 /* MAC support for individual labels */
231#define MNT_NOATIME 0x10000000 /* disable update of file access time */
232#define MNT_SNAPSHOT 0x40000000 /* The mount is a snapshot */
233#define MNT_STRICTATIME 0x80000000 /* enable strict update of file access time */
234
235/* backwards compatibility only */
236#define MNT_UNKNOWNPERMISSIONS MNT_IGNORE_OWNERSHIP
237
238
239/*
240 * XXX I think that this could now become (~(MNT_CMDFLAGS))
241 * but the 'mount' program may need changing to handle this.
242 */
243#define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | \
244 MNT_NOSUID | MNT_NODEV | MNT_UNION | \
245 MNT_ASYNC | MNT_EXPORTED | MNT_QUARANTINE | \
246 MNT_LOCAL | MNT_QUOTA | MNT_REMOVABLE | \
247 MNT_ROOTFS | MNT_DOVOLFS | MNT_DONTBROWSE | \
248 MNT_IGNORE_OWNERSHIP | MNT_AUTOMOUNTED | MNT_JOURNALED | \
249 MNT_NOUSERXATTR | MNT_DEFWRITE | MNT_MULTILABEL | \
250 MNT_NOATIME | MNT_STRICTATIME | MNT_SNAPSHOT | MNT_CPROTECT)
251/*
252 * External filesystem command modifier flags.
253 * Unmount can use the MNT_FORCE flag.
254 * XXX These are not STATES and really should be somewhere else.
255 * External filesystem control flags.
256 */
257#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
258#define MNT_NOBLOCK 0x00020000 /* don't block unmount if not responding */
259#define MNT_RELOAD 0x00040000 /* reload filesystem data */
260#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
261#define MNT_CMDFLAGS (MNT_UPDATE|MNT_NOBLOCK|MNT_RELOAD|MNT_FORCE)
262
263
264
265/*
266 * Sysctl CTL_VFS definitions.
267 *
268 * Second level identifier specifies which filesystem. Second level
269 * identifier VFS_GENERIC returns information about all filesystems.
270 */
271#define VFS_GENERIC 0 /* generic filesystem information */
272#define VFS_NUMMNTOPS 1 /* int: total num of vfs mount/unmount operations */
273/*
274 * Third level identifiers for VFS_GENERIC are given below; third
275 * level identifiers for specific filesystems are given in their
276 * mount specific header files.
277 */
278#define VFS_MAXTYPENUM 1 /* int: highest defined filesystem type */
279#define VFS_CONF 2 /* struct: vfsconf for filesystem given
280 * as next argument */
281
282/*
283 * Flags for various system call interfaces.
284 *
285 * waitfor flags to vfs_sync() and getfsstat()
286 */
287#define MNT_WAIT 1 /* synchronized I/O file integrity completion */
288#define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */
289#define MNT_DWAIT 4 /* synchronized I/O data integrity completion */
290
291
292#if !defined(KERNEL) && !defined(_KERN_SYS_KERNELTYPES_H_) /* also defined in kernel_types.h */
293struct mount;
294typedef struct mount * mount_t;
295struct vnode;
296typedef struct vnode * vnode_t;
297#endif
298
299/* Reserved fields preserve binary compatibility */
300struct vfsconf {
301 uint32_t vfc_reserved1; /* opaque */
302 char vfc_name[MFSNAMELEN]; /* filesystem type name */
303 int vfc_typenum; /* historic filesystem type number */
304 int vfc_refcount; /* number mounted of this type */
305 int vfc_flags; /* permanent flags */
306 uint32_t vfc_reserved2; /* opaque */
307 uint32_t vfc_reserved3; /* opaque */
308};
309
310struct vfsidctl {
311 int vc_vers; /* should be VFSIDCTL_VERS1 (below) */
312 fsid_t vc_fsid; /* fsid to operate on. */
313 void *vc_ptr; /* pointer to data structure. */
314 size_t vc_len; /* sizeof said structure. */
315 u_int32_t vc_spare[12]; /* spare (must be zero). */
316};
317
318
319/* vfsidctl API version. */
320#define VFS_CTL_VERS1 0x01
321
322
323/*
324 * New style VFS sysctls, do not reuse/conflict with the namespace for
325 * private sysctls.
326 */
327#define VFS_CTL_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
349struct vfsquery {
350 u_int32_t vq_flags;
351 u_int32_t vq_spare[31];
352};
353
354struct 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 */
362struct 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
399struct fhandle {
400 unsigned int fh_len; /* length of file handle */
401 unsigned char fh_data[NFS_MAX_FH_SIZE]; /* file handle value */
402};
403typedef struct fhandle fhandle_t;
404
405
406__BEGIN_DECLS
407int fhopen(const struct fhandle *, int);
408int fstatfs(int, struct statfs *) __DARWIN_INODE64(fstatfs);
409#if !__DARWIN_ONLY_64_BIT_INO_T
410int 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 */
412int getfh(const char *, fhandle_t *);
413int getfsstat(struct statfs *, int, int) __DARWIN_INODE64(getfsstat);
414#if !__DARWIN_ONLY_64_BIT_INO_T
415int 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 */
417int getmntinfo(struct statfs **, int) __DARWIN_INODE64(getmntinfo);
418int 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
422int 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 */
424int mount(const char *, const char *, int, void *);
425int fmount(const char *, int, int, void *) __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
426int statfs(const char *, struct statfs *) __DARWIN_INODE64(statfs);
427#if !__DARWIN_ONLY_64_BIT_INO_T
428int 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 */
430int unmount(const char *, int);
431int getvfsbyname(const char *, struct vfsconf *);
432__END_DECLS
433
434#endif /* !_SYS_MOUNT_H_ */
lib/libc/include/aarch64-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 */
83typedef unsigned long msgqnum_t;
84
85/* [XSI] Used for the number of bytes allowed in a message queue */
86typedef 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))
116struct msqid_ds
117#else
118#define msqid_ds __msqid_ds_new
119struct __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
144struct __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
169struct 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 */
187struct 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 */
202struct 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)
216int msgsys(int, ...);
217#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
218int msgctl(int, int, struct msqid_ds *) __DARWIN_ALIAS(msgctl);
219int msgget(key_t, int);
220ssize_t msgrcv(int, void *, size_t, long, int) __DARWIN_ALIAS_C(msgrcv);
221int msgsnd(int, const void *, size_t, int) __DARWIN_ALIAS_C(msgsnd);
222__END_DECLS
223
224
225#endif /* !_SYS_MSG_H_ */
lib/libc/include/aarch64-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/aarch64-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
96struct pollfd {
97 int fd;
98 short events;
99 short revents;
100};
101
102typedef 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 */
113extern 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/aarch64-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
84struct session;
85struct pgrp;
86struct proc;
87struct proc_ident;
88
89/* Exported fields for kern sysctls */
90struct 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/aarch64-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))
171qos_class_t
172qos_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))
193qos_class_t
194qos_class_main(void);
195
196__END_DECLS
197
198#endif // KERNEL
199
200#endif // _SYS_QOS_H
lib/libc/include/aarch64-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 */
149struct 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 \
239struct 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 \
251struct { \
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 \
298do { \
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 \
328struct 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 \
341struct { \
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 \
411do { \
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 \
446do { \
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 \
468struct 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 \
480struct { \
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 \
554do { \
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 \
572struct 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 \
586struct { \
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 \
729do { \
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 \
754struct 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 \
764struct { \
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
865struct 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
874static __inline void
875insque(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
887static __inline void
888remque(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
901void insque(void *a, void *b);
902void remque(void *a);
903
904#endif /* __GNUC__ */
905
906#endif /* NOTFB31 */
907#endif /* _KERNEL */
908
909#endif /* !_SYS_QUEUE_H_ */
lib/libc/include/aarch64-macos-gnu/sys/resource.h created+512
......@@ -0,0 +1,512 @@
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) 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 * @(#)resource.h 8.2 (Berkeley) 1/4/94
62 */
63
64#ifndef _SYS_RESOURCE_H_
65#define _SYS_RESOURCE_H_
66
67#include <sys/appleapiopts.h>
68#include <sys/cdefs.h>
69#include <sys/_types.h>
70
71#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
72#include <stdint.h>
73#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
74
75#include <Availability.h>
76
77/* [XSI] The timeval structure shall be defined as described in
78 * <sys/time.h>
79 */
80#include <sys/_types/_timeval.h>
81
82/* The id_t type shall be defined as described in <sys/types.h> */
83#include <sys/_types/_id_t.h>
84
85
86/*
87 * Resource limit type (low 63 bits, excluding the sign bit)
88 */
89typedef __uint64_t rlim_t;
90
91
92/*****
93 * PRIORITY
94 */
95
96/*
97 * Possible values of the first parameter to getpriority()/setpriority(),
98 * used to indicate the type of the second parameter.
99 */
100#define PRIO_PROCESS 0 /* Second argument is a PID */
101#define PRIO_PGRP 1 /* Second argument is a GID */
102#define PRIO_USER 2 /* Second argument is a UID */
103
104#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
105#define PRIO_DARWIN_THREAD 3 /* Second argument is always 0 (current thread) */
106#define PRIO_DARWIN_PROCESS 4 /* Second argument is a PID */
107
108
109/*
110 * Range limitations for the value of the third parameter to setpriority().
111 */
112#define PRIO_MIN -20
113#define PRIO_MAX 20
114
115/*
116 * use PRIO_DARWIN_BG to set the current thread into "background" state
117 * which lowers CPU, disk IO, and networking priorites until thread terminates
118 * or "background" state is revoked
119 */
120#define PRIO_DARWIN_BG 0x1000
121
122/*
123 * use PRIO_DARWIN_NONUI to restrict a process's ability to make calls to
124 * the GPU. (deprecated)
125 */
126#define PRIO_DARWIN_NONUI 0x1001
127
128#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
129
130
131
132/*****
133 * RESOURCE USAGE
134 */
135
136/*
137 * Possible values of the first parameter to getrusage(), used to indicate
138 * the scope of the information to be returned.
139 */
140#define RUSAGE_SELF 0 /* Current process information */
141#define RUSAGE_CHILDREN -1 /* Current process' children */
142
143/*
144 * A structure representing an accounting of resource utilization. The
145 * address of an instance of this structure is the second parameter to
146 * getrusage().
147 *
148 * Note: All values other than ru_utime and ru_stime are implementaiton
149 * defined and subject to change in a future release. Their use
150 * is discouraged for standards compliant programs.
151 */
152struct rusage {
153 struct timeval ru_utime; /* user time used (PL) */
154 struct timeval ru_stime; /* system time used (PL) */
155#if __DARWIN_C_LEVEL < __DARWIN_C_FULL
156 long ru_opaque[14]; /* implementation defined */
157#else
158 /*
159 * Informational aliases for source compatibility with programs
160 * that need more information than that provided by standards,
161 * and which do not mind being OS-dependent.
162 */
163 long ru_maxrss; /* max resident set size (PL) */
164#define ru_first ru_ixrss /* internal: ruadd() range start */
165 long ru_ixrss; /* integral shared memory size (NU) */
166 long ru_idrss; /* integral unshared data (NU) */
167 long ru_isrss; /* integral unshared stack (NU) */
168 long ru_minflt; /* page reclaims (NU) */
169 long ru_majflt; /* page faults (NU) */
170 long ru_nswap; /* swaps (NU) */
171 long ru_inblock; /* block input operations (atomic) */
172 long ru_oublock; /* block output operations (atomic) */
173 long ru_msgsnd; /* messages sent (atomic) */
174 long ru_msgrcv; /* messages received (atomic) */
175 long ru_nsignals; /* signals received (atomic) */
176 long ru_nvcsw; /* voluntary context switches (atomic) */
177 long ru_nivcsw; /* involuntary " */
178#define ru_last ru_nivcsw /* internal: ruadd() range end */
179#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
180};
181
182#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
183/*
184 * Flavors for proc_pid_rusage().
185 */
186#define RUSAGE_INFO_V0 0
187#define RUSAGE_INFO_V1 1
188#define RUSAGE_INFO_V2 2
189#define RUSAGE_INFO_V3 3
190#define RUSAGE_INFO_V4 4
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 */
198
199typedef void *rusage_info_t;
200
201struct rusage_info_v0 {
202 uint8_t ri_uuid[16];
203 uint64_t ri_user_time;
204 uint64_t ri_system_time;
205 uint64_t ri_pkg_idle_wkups;
206 uint64_t ri_interrupt_wkups;
207 uint64_t ri_pageins;
208 uint64_t ri_wired_size;
209 uint64_t ri_resident_size;
210 uint64_t ri_phys_footprint;
211 uint64_t ri_proc_start_abstime;
212 uint64_t ri_proc_exit_abstime;
213};
214
215struct rusage_info_v1 {
216 uint8_t ri_uuid[16];
217 uint64_t ri_user_time;
218 uint64_t ri_system_time;
219 uint64_t ri_pkg_idle_wkups;
220 uint64_t ri_interrupt_wkups;
221 uint64_t ri_pageins;
222 uint64_t ri_wired_size;
223 uint64_t ri_resident_size;
224 uint64_t ri_phys_footprint;
225 uint64_t ri_proc_start_abstime;
226 uint64_t ri_proc_exit_abstime;
227 uint64_t ri_child_user_time;
228 uint64_t ri_child_system_time;
229 uint64_t ri_child_pkg_idle_wkups;
230 uint64_t ri_child_interrupt_wkups;
231 uint64_t ri_child_pageins;
232 uint64_t ri_child_elapsed_abstime;
233};
234
235struct rusage_info_v2 {
236 uint8_t ri_uuid[16];
237 uint64_t ri_user_time;
238 uint64_t ri_system_time;
239 uint64_t ri_pkg_idle_wkups;
240 uint64_t ri_interrupt_wkups;
241 uint64_t ri_pageins;
242 uint64_t ri_wired_size;
243 uint64_t ri_resident_size;
244 uint64_t ri_phys_footprint;
245 uint64_t ri_proc_start_abstime;
246 uint64_t ri_proc_exit_abstime;
247 uint64_t ri_child_user_time;
248 uint64_t ri_child_system_time;
249 uint64_t ri_child_pkg_idle_wkups;
250 uint64_t ri_child_interrupt_wkups;
251 uint64_t ri_child_pageins;
252 uint64_t ri_child_elapsed_abstime;
253 uint64_t ri_diskio_bytesread;
254 uint64_t ri_diskio_byteswritten;
255};
256
257struct rusage_info_v3 {
258 uint8_t ri_uuid[16];
259 uint64_t ri_user_time;
260 uint64_t ri_system_time;
261 uint64_t ri_pkg_idle_wkups;
262 uint64_t ri_interrupt_wkups;
263 uint64_t ri_pageins;
264 uint64_t ri_wired_size;
265 uint64_t ri_resident_size;
266 uint64_t ri_phys_footprint;
267 uint64_t ri_proc_start_abstime;
268 uint64_t ri_proc_exit_abstime;
269 uint64_t ri_child_user_time;
270 uint64_t ri_child_system_time;
271 uint64_t ri_child_pkg_idle_wkups;
272 uint64_t ri_child_interrupt_wkups;
273 uint64_t ri_child_pageins;
274 uint64_t ri_child_elapsed_abstime;
275 uint64_t ri_diskio_bytesread;
276 uint64_t ri_diskio_byteswritten;
277 uint64_t ri_cpu_time_qos_default;
278 uint64_t ri_cpu_time_qos_maintenance;
279 uint64_t ri_cpu_time_qos_background;
280 uint64_t ri_cpu_time_qos_utility;
281 uint64_t ri_cpu_time_qos_legacy;
282 uint64_t ri_cpu_time_qos_user_initiated;
283 uint64_t ri_cpu_time_qos_user_interactive;
284 uint64_t ri_billed_system_time;
285 uint64_t ri_serviced_system_time;
286};
287
288struct rusage_info_v4 {
289 uint8_t ri_uuid[16];
290 uint64_t ri_user_time;
291 uint64_t ri_system_time;
292 uint64_t ri_pkg_idle_wkups;
293 uint64_t ri_interrupt_wkups;
294 uint64_t ri_pageins;
295 uint64_t ri_wired_size;
296 uint64_t ri_resident_size;
297 uint64_t ri_phys_footprint;
298 uint64_t ri_proc_start_abstime;
299 uint64_t ri_proc_exit_abstime;
300 uint64_t ri_child_user_time;
301 uint64_t ri_child_system_time;
302 uint64_t ri_child_pkg_idle_wkups;
303 uint64_t ri_child_interrupt_wkups;
304 uint64_t ri_child_pageins;
305 uint64_t ri_child_elapsed_abstime;
306 uint64_t ri_diskio_bytesread;
307 uint64_t ri_diskio_byteswritten;
308 uint64_t ri_cpu_time_qos_default;
309 uint64_t ri_cpu_time_qos_maintenance;
310 uint64_t ri_cpu_time_qos_background;
311 uint64_t ri_cpu_time_qos_utility;
312 uint64_t ri_cpu_time_qos_legacy;
313 uint64_t ri_cpu_time_qos_user_initiated;
314 uint64_t ri_cpu_time_qos_user_interactive;
315 uint64_t ri_billed_system_time;
316 uint64_t ri_serviced_system_time;
317 uint64_t ri_logical_writes;
318 uint64_t ri_lifetime_max_phys_footprint;
319 uint64_t ri_instructions;
320 uint64_t ri_cycles;
321 uint64_t ri_billed_energy;
322 uint64_t ri_serviced_energy;
323 uint64_t ri_interval_max_phys_footprint;
324 uint64_t ri_runnable_time;
325};
326
327struct 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
367typedef struct rusage_info_v5 rusage_info_current;
368
369#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
370
371
372
373/*****
374 * RESOURCE LIMITS
375 */
376
377/*
378 * Symbolic constants for resource limits; since all limits are representable
379 * as a type rlim_t, we are permitted to define RLIM_SAVED_* in terms of
380 * RLIM_INFINITY.
381 */
382#define RLIM_INFINITY (((__uint64_t)1 << 63) - 1) /* no limit */
383#define RLIM_SAVED_MAX RLIM_INFINITY /* Unrepresentable hard limit */
384#define RLIM_SAVED_CUR RLIM_INFINITY /* Unrepresentable soft limit */
385
386/*
387 * Possible values of the first parameter to getrlimit()/setrlimit(), to
388 * indicate for which resource the operation is being performed.
389 */
390#define RLIMIT_CPU 0 /* cpu time per process */
391#define RLIMIT_FSIZE 1 /* file size */
392#define RLIMIT_DATA 2 /* data segment size */
393#define RLIMIT_STACK 3 /* stack size */
394#define RLIMIT_CORE 4 /* core file size */
395#define RLIMIT_AS 5 /* address space (resident set size) */
396#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
397#define RLIMIT_RSS RLIMIT_AS /* source compatibility alias */
398#define RLIMIT_MEMLOCK 6 /* locked-in-memory address space */
399#define RLIMIT_NPROC 7 /* number of processes */
400#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
401#define RLIMIT_NOFILE 8 /* number of open files */
402#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
403#define RLIM_NLIMITS 9 /* total number of resource limits */
404#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
405#define _RLIMIT_POSIX_FLAG 0x1000 /* Set bit for strict POSIX */
406
407/*
408 * A structure representing a resource limit. The address of an instance
409 * of this structure is the second parameter to getrlimit()/setrlimit().
410 */
411struct rlimit {
412 rlim_t rlim_cur; /* current (soft) limit */
413 rlim_t rlim_max; /* maximum value for rlim_cur */
414};
415
416#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
417/*
418 * proc_rlimit_control()
419 *
420 * Resource limit flavors
421 */
422#define RLIMIT_WAKEUPS_MONITOR 0x1 /* Configure the wakeups monitor. */
423#define RLIMIT_CPU_USAGE_MONITOR 0x2 /* Configure the CPU usage monitor. */
424#define RLIMIT_THREAD_CPULIMITS 0x3 /* Configure a blocking, per-thread, CPU limits. */
425#define RLIMIT_FOOTPRINT_INTERVAL 0x4 /* Configure memory footprint interval tracking */
426
427/*
428 * Flags for wakeups monitor control.
429 */
430#define WAKEMON_ENABLE 0x01
431#define WAKEMON_DISABLE 0x02
432#define WAKEMON_GET_PARAMS 0x04
433#define WAKEMON_SET_DEFAULTS 0x08
434#define WAKEMON_MAKE_FATAL 0x10 /* Configure the task so that violations are fatal. */
435
436/*
437 * Flags for CPU usage monitor control.
438 */
439#define CPUMON_MAKE_FATAL 0x1000
440
441/*
442 * Flags for memory footprint interval tracking.
443 */
444#define FOOTPRINT_INTERVAL_RESET 0x1 /* Reset the footprint interval counter to zero */
445
446struct proc_rlimit_control_wakeupmon {
447 uint32_t wm_flags;
448 int32_t wm_rate;
449};
450
451
452
453/* I/O type */
454#define IOPOL_TYPE_DISK 0
455#define IOPOL_TYPE_VFS_ATIME_UPDATES 2
456#define IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES 3
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
460
461/* scope */
462#define IOPOL_SCOPE_PROCESS 0
463#define IOPOL_SCOPE_THREAD 1
464#define IOPOL_SCOPE_DARWIN_BG 2
465
466/* I/O Priority */
467#define IOPOL_DEFAULT 0
468#define IOPOL_IMPORTANT 1
469#define IOPOL_PASSIVE 2
470#define IOPOL_THROTTLE 3
471#define IOPOL_UTILITY 4
472#define IOPOL_STANDARD 5
473
474/* compatibility with older names */
475#define IOPOL_APPLICATION IOPOL_STANDARD
476#define IOPOL_NORMAL IOPOL_IMPORTANT
477
478
479#define IOPOL_ATIME_UPDATES_DEFAULT 0
480#define IOPOL_ATIME_UPDATES_OFF 1
481
482#define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0
483#define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1
484#define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2
485
486#define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0
487#define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1
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
495#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
496
497
498__BEGIN_DECLS
499int getpriority(int, id_t);
500#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
501int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
502#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
503int getrlimit(int, struct rlimit *) __DARWIN_ALIAS(getrlimit);
504int getrusage(int, struct rusage *);
505int setpriority(int, id_t, int);
506#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
507int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
508#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
509int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);
510__END_DECLS
511
512#endif /* !_SYS_RESOURCE_H_ */
lib/libc/include/aarch64-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__
114int 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/aarch64-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))
82struct semid_ds
83#else
84#define semid_ds __semid_ds_new
85struct __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
105struct __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 */
132struct 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 */
143struct 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 */
177union 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};
182typedef 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)
198int semsys(int, ...);
199#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
200int semctl(int, int, int, ...) __DARWIN_ALIAS(semctl);
201int semget(key_t, int, int);
202int semop(int, struct sembuf *, size_t);
203__END_DECLS
204
205
206#endif /* !_SEM_H_ */
lib/libc/include/aarch64-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
43typedef 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
52int sem_close(sem_t *);
53int sem_destroy(sem_t *) __deprecated;
54int sem_getvalue(sem_t * __restrict, int * __restrict) __deprecated;
55int sem_init(sem_t *, int, unsigned int) __deprecated;
56sem_t * sem_open(const char *, int, ...);
57int sem_post(sem_t *);
58int sem_trywait(sem_t *);
59int sem_unlink(const char *);
60int sem_wait(sem_t *) __DARWIN_ALIAS_C(sem_wait);
61__END_DECLS
62
63
64#endif /* _SYS_SEMAPHORE_H_ */
lib/libc/include/aarch64-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 */
93typedef 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))
142struct shmid_ds
143#else
144#define shmid_ds __shmid_ds_new
145struct __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
163struct __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)
181int shmsys(int, ...);
182#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
183void *shmat(int, const void *, int);
184int shmctl(int, int, struct shmid_ds *) __DARWIN_ALIAS(shmctl);
185int shmdt(const void *);
186int shmget(key_t, size_t, int);
187__END_DECLS
188
189
190#endif /* !_SYS_SHM_H_ */
lib/libc/include/aarch64-macos-gnu/sys/signal.h created+392
......@@ -0,0 +1,392 @@
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, 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 * @(#)signal.h 8.2 (Berkeley) 1/21/94
67 */
68
69#ifndef _SYS_SIGNAL_H_
70#define _SYS_SIGNAL_H_
71
72#include <sys/cdefs.h>
73#include <sys/appleapiopts.h>
74#include <Availability.h>
75
76#define __DARWIN_NSIG 32 /* counting 0; could be 33 (mask is 1-32) */
77
78#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
79#define NSIG __DARWIN_NSIG
80#endif
81
82#include <machine/signal.h> /* sigcontext; codes for SIGILL, SIGFPE */
83
84#define SIGHUP 1 /* hangup */
85#define SIGINT 2 /* interrupt */
86#define SIGQUIT 3 /* quit */
87#define SIGILL 4 /* illegal instruction (not reset when caught) */
88#define SIGTRAP 5 /* trace trap (not reset when caught) */
89#define SIGABRT 6 /* abort() */
90#if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE))
91#define SIGPOLL 7 /* pollable event ([XSR] generated, not supported) */
92#else /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
93#define SIGIOT SIGABRT /* compatibility */
94#define SIGEMT 7 /* EMT instruction */
95#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
96#define SIGFPE 8 /* floating point exception */
97#define SIGKILL 9 /* kill (cannot be caught or ignored) */
98#define SIGBUS 10 /* bus error */
99#define SIGSEGV 11 /* segmentation violation */
100#define SIGSYS 12 /* bad argument to system call */
101#define SIGPIPE 13 /* write on a pipe with no one to read it */
102#define SIGALRM 14 /* alarm clock */
103#define SIGTERM 15 /* software termination signal from kill */
104#define SIGURG 16 /* urgent condition on IO channel */
105#define SIGSTOP 17 /* sendable stop signal not from tty */
106#define SIGTSTP 18 /* stop signal from tty */
107#define SIGCONT 19 /* continue a stopped process */
108#define SIGCHLD 20 /* to parent on child stop or exit */
109#define SIGTTIN 21 /* to readers pgrp upon background tty read */
110#define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
111#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
112#define SIGIO 23 /* input/output possible signal */
113#endif
114#define SIGXCPU 24 /* exceeded CPU time limit */
115#define SIGXFSZ 25 /* exceeded file size limit */
116#define SIGVTALRM 26 /* virtual time alarm */
117#define SIGPROF 27 /* profiling time alarm */
118#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
119#define SIGWINCH 28 /* window size changes */
120#define SIGINFO 29 /* information request */
121#endif
122#define SIGUSR1 30 /* user defined signal 1 */
123#define SIGUSR2 31 /* user defined signal 2 */
124
125#if defined(_ANSI_SOURCE) || __DARWIN_UNIX03 || defined(__cplusplus)
126/*
127 * Language spec sez we must list exactly one parameter, even though we
128 * actually supply three. Ugh!
129 * SIG_HOLD is chosen to avoid KERN_SIG_* values in <sys/signalvar.h>
130 */
131#define SIG_DFL (void (*)(int))0
132#define SIG_IGN (void (*)(int))1
133#define SIG_HOLD (void (*)(int))5
134#define SIG_ERR ((void (*)(int))-1)
135#else
136/* DO NOT REMOVE THE COMMENTED OUT int: fixincludes needs to see them */
137#define SIG_DFL (void (*)( /*int*/ ))0
138#define SIG_IGN (void (*)( /*int*/ ))1
139#define SIG_HOLD (void (*)( /*int*/ ))5
140#define SIG_ERR ((void (*)( /*int*/ ))-1)
141#endif
142
143#ifndef _ANSI_SOURCE
144#include <sys/_types.h>
145
146#include <machine/_mcontext.h>
147
148#include <sys/_pthread/_pthread_attr_t.h>
149
150#include <sys/_types/_sigaltstack.h>
151#include <sys/_types/_ucontext.h>
152
153#include <sys/_types/_pid_t.h>
154#include <sys/_types/_sigset_t.h>
155#include <sys/_types/_size_t.h>
156#include <sys/_types/_uid_t.h>
157
158union sigval {
159 /* Members as suggested by Annex C of POSIX 1003.1b. */
160 int sival_int;
161 void *sival_ptr;
162};
163
164#define SIGEV_NONE 0 /* No async notification */
165#define SIGEV_SIGNAL 1 /* aio - completion notification */
166#define SIGEV_THREAD 3 /* [NOTIMP] [RTS] call notification function */
167
168struct sigevent {
169 int sigev_notify; /* Notification type */
170 int sigev_signo; /* Signal number */
171 union sigval sigev_value; /* Signal value */
172 void (*sigev_notify_function)(union sigval); /* Notification function */
173 pthread_attr_t *sigev_notify_attributes; /* Notification attributes */
174};
175
176
177typedef struct __siginfo {
178 int si_signo; /* signal number */
179 int si_errno; /* errno association */
180 int si_code; /* signal code */
181 pid_t si_pid; /* sending process */
182 uid_t si_uid; /* sender's ruid */
183 int si_status; /* exit value */
184 void *si_addr; /* faulting instruction */
185 union sigval si_value; /* signal value */
186 long si_band; /* band event for SIGPOLL */
187 unsigned long __pad[7]; /* Reserved for Future Use */
188} siginfo_t;
189
190
191/*
192 * When the signal is SIGILL or SIGFPE, si_addr contains the address of
193 * the faulting instruction.
194 * When the signal is SIGSEGV or SIGBUS, si_addr contains the address of
195 * the faulting memory reference. Although for x86 there are cases of SIGSEGV
196 * for which si_addr cannot be determined and is NULL.
197 * If the signal is SIGCHLD, the si_pid field will contain the child process ID,
198 * si_status contains the exit value or signal and
199 * si_uid contains the real user ID of the process that sent the signal.
200 */
201
202/* Values for si_code */
203
204/* Codes for SIGILL */
205#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
206#define ILL_NOOP 0 /* if only I knew... */
207#endif
208#define ILL_ILLOPC 1 /* [XSI] illegal opcode */
209#define ILL_ILLTRP 2 /* [XSI] illegal trap */
210#define ILL_PRVOPC 3 /* [XSI] privileged opcode */
211#define ILL_ILLOPN 4 /* [XSI] illegal operand -NOTIMP */
212#define ILL_ILLADR 5 /* [XSI] illegal addressing mode -NOTIMP */
213#define ILL_PRVREG 6 /* [XSI] privileged register -NOTIMP */
214#define ILL_COPROC 7 /* [XSI] coprocessor error -NOTIMP */
215#define ILL_BADSTK 8 /* [XSI] internal stack error -NOTIMP */
216
217/* Codes for SIGFPE */
218#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
219#define FPE_NOOP 0 /* if only I knew... */
220#endif
221#define FPE_FLTDIV 1 /* [XSI] floating point divide by zero */
222#define FPE_FLTOVF 2 /* [XSI] floating point overflow */
223#define FPE_FLTUND 3 /* [XSI] floating point underflow */
224#define FPE_FLTRES 4 /* [XSI] floating point inexact result */
225#define FPE_FLTINV 5 /* [XSI] invalid floating point operation */
226#define FPE_FLTSUB 6 /* [XSI] subscript out of range -NOTIMP */
227#define FPE_INTDIV 7 /* [XSI] integer divide by zero */
228#define FPE_INTOVF 8 /* [XSI] integer overflow */
229
230/* Codes for SIGSEGV */
231#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
232#define SEGV_NOOP 0 /* if only I knew... */
233#endif
234#define SEGV_MAPERR 1 /* [XSI] address not mapped to object */
235#define SEGV_ACCERR 2 /* [XSI] invalid permission for mapped object */
236
237/* Codes for SIGBUS */
238#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
239#define BUS_NOOP 0 /* if only I knew... */
240#endif
241#define BUS_ADRALN 1 /* [XSI] Invalid address alignment */
242#define BUS_ADRERR 2 /* [XSI] Nonexistent physical address -NOTIMP */
243#define BUS_OBJERR 3 /* [XSI] Object-specific HW error - NOTIMP */
244
245/* Codes for SIGTRAP */
246#define TRAP_BRKPT 1 /* [XSI] Process breakpoint -NOTIMP */
247#define TRAP_TRACE 2 /* [XSI] Process trace trap -NOTIMP */
248
249/* Codes for SIGCHLD */
250#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
251#define CLD_NOOP 0 /* if only I knew... */
252#endif
253#define CLD_EXITED 1 /* [XSI] child has exited */
254#define CLD_KILLED 2 /* [XSI] terminated abnormally, no core file */
255#define CLD_DUMPED 3 /* [XSI] terminated abnormally, core file */
256#define CLD_TRAPPED 4 /* [XSI] traced child has trapped */
257#define CLD_STOPPED 5 /* [XSI] child has stopped */
258#define CLD_CONTINUED 6 /* [XSI] stopped child has continued */
259
260/* Codes for SIGPOLL */
261#define POLL_IN 1 /* [XSR] Data input available */
262#define POLL_OUT 2 /* [XSR] Output buffers available */
263#define POLL_MSG 3 /* [XSR] Input message available */
264#define POLL_ERR 4 /* [XSR] I/O error */
265#define POLL_PRI 5 /* [XSR] High priority input available */
266#define POLL_HUP 6 /* [XSR] Device disconnected */
267
268/* union for signal handlers */
269union __sigaction_u {
270 void (*__sa_handler)(int);
271 void (*__sa_sigaction)(int, struct __siginfo *,
272 void *);
273};
274
275/* Signal vector template for Kernel user boundary */
276struct __sigaction {
277 union __sigaction_u __sigaction_u; /* signal handler */
278 void (*sa_tramp)(void *, int, int, siginfo_t *, void *);
279 sigset_t sa_mask; /* signal mask to apply */
280 int sa_flags; /* see signal options below */
281};
282
283/*
284 * Signal vector "template" used in sigaction call.
285 */
286struct sigaction {
287 union __sigaction_u __sigaction_u; /* signal handler */
288 sigset_t sa_mask; /* signal mask to apply */
289 int sa_flags; /* see signal options below */
290};
291
292
293
294/* if SA_SIGINFO is set, sa_sigaction is to be used instead of sa_handler. */
295#define sa_handler __sigaction_u.__sa_handler
296#define sa_sigaction __sigaction_u.__sa_sigaction
297
298#define SA_ONSTACK 0x0001 /* take signal on signal stack */
299#define SA_RESTART 0x0002 /* restart system on signal return */
300#define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */
301#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */
302#define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */
303#define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */
304#define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */
305#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
306#define SA_USERTRAMP 0x0100 /* do not bounce off kernel's sigtramp */
307/* This will provide 64bit register set in a 32bit user address space */
308#define SA_64REGSET 0x0200 /* signal handler with SA_SIGINFO args with 64bit regs information */
309#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
310
311/* the following are the only bits we support from user space, the
312 * rest are for kernel use only.
313 */
314#define SA_USERSPACE_MASK (SA_ONSTACK | SA_RESTART | SA_RESETHAND | SA_NOCLDSTOP | SA_NODEFER | SA_NOCLDWAIT | SA_SIGINFO)
315
316/*
317 * Flags for sigprocmask:
318 */
319#define SIG_BLOCK 1 /* block specified signal set */
320#define SIG_UNBLOCK 2 /* unblock specified signal set */
321#define SIG_SETMASK 3 /* set specified signal set */
322
323/* POSIX 1003.1b required values. */
324#define SI_USER 0x10001 /* [CX] signal from kill() */
325#define SI_QUEUE 0x10002 /* [CX] signal from sigqueue() */
326#define SI_TIMER 0x10003 /* [CX] timer expiration */
327#define SI_ASYNCIO 0x10004 /* [CX] aio request completion */
328#define SI_MESGQ 0x10005 /* [CX] from message arrival on empty queue */
329
330#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
331typedef void (*sig_t)(int); /* type of signal function */
332#endif
333
334/*
335 * Structure used in sigaltstack call.
336 */
337
338#define SS_ONSTACK 0x0001 /* take signal on signal stack */
339#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */
340#define MINSIGSTKSZ 32768 /* (32K)minimum allowable stack */
341#define SIGSTKSZ 131072 /* (128K)recommended stack size */
342
343#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
344/*
345 * 4.3 compatibility:
346 * Signal vector "template" used in sigvec call.
347 */
348struct sigvec {
349 void (*sv_handler)(int); /* signal handler */
350 int sv_mask; /* signal mask to apply */
351 int sv_flags; /* see signal options below */
352};
353
354#define SV_ONSTACK SA_ONSTACK
355#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */
356#define SV_RESETHAND SA_RESETHAND
357#define SV_NODEFER SA_NODEFER
358#define SV_NOCLDSTOP SA_NOCLDSTOP
359#define SV_SIGINFO SA_SIGINFO
360
361#define sv_onstack sv_flags /* isn't compatibility wonderful! */
362#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
363
364/*
365 * Structure used in sigstack call.
366 */
367struct sigstack {
368 char *ss_sp; /* signal stack pointer */
369 int ss_onstack; /* current status */
370};
371
372#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
373/*
374 * Macro for converting signal number to a mask suitable for
375 * sigblock().
376 */
377#define sigmask(m) (1 << ((m)-1))
378
379
380#define BADSIG SIG_ERR
381
382#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
383#endif /* !_ANSI_SOURCE */
384
385/*
386 * For historical reasons; programs expect signal's return value to be
387 * defined by <sys/signal.h>.
388 */
389__BEGIN_DECLS
390 void(*signal(int, void (*)(int)))(int);
391__END_DECLS
392#endif /* !_SYS_SIGNAL_H_ */
lib/libc/include/aarch64-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
289typedef __uint32_t sae_associd_t;
290#define SAE_ASSOCID_ANY 0
291#define SAE_ASSOCID_ALL ((sae_associd_t)(-1ULL))
292
293typedef __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 */
303typedef 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 */
315struct linger {
316 int l_onoff; /* option on/off */
317 int l_linger; /* linger time */
318};
319
320#ifndef __APPLE__
321struct 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 */
333struct 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 */
408struct 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 */
421struct 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 */
441struct 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 */
548struct 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 */
596struct 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 */
619struct 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 */
687struct 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
700int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
701__DARWIN_ALIAS_C(accept);
702int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind);
703int connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(connect);
704int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict)
705__DARWIN_ALIAS(getpeername);
706int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict)
707__DARWIN_ALIAS(getsockname);
708int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
709int listen(int, int) __DARWIN_ALIAS(listen);
710ssize_t recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv);
711ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict,
712 socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom);
713ssize_t recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg);
714ssize_t send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send);
715ssize_t sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg);
716ssize_t sendto(int, const void *, size_t,
717 int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto);
718int setsockopt(int, int, int, const void *, socklen_t);
719int shutdown(int, int);
720int sockatmark(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
721int socket(int, int, int);
722int socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair);
723
724#if !defined(_POSIX_C_SOURCE)
725int 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)
729void pfctlinput(int, struct sockaddr *);
730
731__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
732int 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))
736int 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/aarch64-macos-gnu/sys/sockio.h created+180
......@@ -0,0 +1,180 @@
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, 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 * @(#)sockio.h 8.1 (Berkeley) 3/28/94
62 */
63
64#ifndef _SYS_SOCKIO_H_
65#define _SYS_SOCKIO_H_
66
67#include <sys/appleapiopts.h>
68
69#include <sys/ioccom.h>
70
71/* Socket ioctl's. */
72#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
73#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
74#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
75#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
76#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
77#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
78#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
79
80/*
81 * OSIOCGIF* ioctls are deprecated; they are kept for binary compatibility.
82 */
83#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
84#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
85#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
86#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
87#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
88#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
89#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
90#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
91#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
92#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
93
94#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
95#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
96#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
97#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
98#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
99#define SIOCAUTOADDR _IOWR('i', 38, struct ifreq) /* autoconf address */
100#define SIOCAUTONETMASK _IOW('i', 39, struct ifreq) /* autoconf netmask */
101#define SIOCARPIPLL _IOWR('i', 40, struct ifreq) /* arp for IPv4LL address */
102
103#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
104#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
105#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
106#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
107#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
108#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
109#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
110
111/*
112 * The command SIOCGIFMEDIA does not allow a process to access the extended
113 * media subtype and extended subtype values are returned as IFM_OTHER.
114 */
115#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get compatible net media */
116
117#define SIOCSIFGENERIC _IOW('i', 57, struct ifreq) /* generic IF set op */
118#define SIOCGIFGENERIC _IOWR('i', 58, struct ifreq) /* generic IF get op */
119#define SIOCRSLVMULTI _IOWR('i', 59, struct rslvmulti_req)
120
121#define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set link level addr */
122#define SIOCGIFSTATUS _IOWR('i', 61, struct ifstat) /* get IF status */
123#define SIOCSIFPHYADDR _IOW('i', 62, struct ifaliasreq) /* set gif addres */
124#define SIOCGIFPSRCADDR _IOWR('i', 63, struct ifreq) /* get gif psrc addr */
125#define SIOCGIFPDSTADDR _IOWR('i', 64, struct ifreq) /* get gif pdst addr */
126#define SIOCDIFPHYADDR _IOW('i', 65, struct ifreq) /* delete gif addrs */
127
128#define SIOCGIFDEVMTU _IOWR('i', 68, struct ifreq) /* get if ifdevmtu */
129#define SIOCSIFALTMTU _IOW('i', 69, struct ifreq) /* set if alternate mtu */
130#define SIOCGIFALTMTU _IOWR('i', 72, struct ifreq) /* get if alternate mtu */
131#define SIOCSIFBOND _IOW('i', 70, struct ifreq) /* set bond if config */
132#define SIOCGIFBOND _IOWR('i', 71, struct ifreq) /* get bond if config */
133
134/*
135 * The command SIOCGIFXMEDIA is meant to be used by processes only to be able
136 * to access the extended media subtypes with the extended IFM_TMASK.
137 *
138 * An ifnet must not implement SIOCGIFXMEDIA as it gets the extended
139 * media subtypes by simply compiling with <net/if_media.h>
140 */
141#define SIOCGIFXMEDIA _IOWR('i', 72, struct ifmediareq) /* get net extended media */
142
143
144#define SIOCSIFCAP _IOW('i', 90, struct ifreq) /* set IF features */
145#define SIOCGIFCAP _IOWR('i', 91, struct ifreq) /* get IF features */
146
147#define SIOCIFCREATE _IOWR('i', 120, struct ifreq) /* create clone if */
148#define SIOCIFDESTROY _IOW('i', 121, struct ifreq) /* destroy clone if */
149#define SIOCIFCREATE2 _IOWR('i', 122, struct ifreq) /* create clone if with data */
150
151#define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific
152 * parameters */
153#define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific
154 * parameters */
155#define SIOCSIFVLAN _IOW('i', 126, struct ifreq) /* set VLAN config */
156#define SIOCGIFVLAN _IOWR('i', 127, struct ifreq) /* get VLAN config */
157#define SIOCSETVLAN SIOCSIFVLAN
158#define SIOCGETVLAN SIOCGIFVLAN
159
160#define SIOCIFGCLONERS _IOWR('i', 129, struct if_clonereq) /* get cloners */
161
162#define SIOCGIFASYNCMAP _IOWR('i', 124, struct ifreq) /* get ppp asyncmap */
163#define SIOCSIFASYNCMAP _IOW('i', 125, struct ifreq) /* set ppp asyncmap */
164
165
166
167#define SIOCGIFMAC _IOWR('i', 130, struct ifreq) /* deprecated */
168#define SIOCSIFMAC _IOW('i', 131, struct ifreq) /* deprecated */
169#define SIOCSIFKPI _IOW('i', 134, struct ifreq) /* set interface kext param - root only */
170#define SIOCGIFKPI _IOWR('i', 135, struct ifreq) /* get interface kext param */
171
172#define SIOCGIFWAKEFLAGS _IOWR('i', 136, struct ifreq) /* get interface wake property flags */
173
174#define SIOCGIFFUNCTIONALTYPE _IOWR('i', 173, struct ifreq) /* get interface functional type */
175
176#define SIOCSIF6LOWPAN _IOW('i', 196, struct ifreq) /* set 6LOWPAN config */
177#define SIOCGIF6LOWPAN _IOWR('i', 197, struct ifreq) /* get 6LOWPAN config */
178
179
180#endif /* !_SYS_SOCKIO_H_ */
lib/libc/include/aarch64-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/aarch64-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 */
110struct 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
182struct stat __DARWIN_STRUCT_STAT64;
183
184#else /* !__DARWIN_64_BIT_INO_T */
185
186struct 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
221struct 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] */
380int chmod(const char *, mode_t) __DARWIN_ALIAS(chmod);
381int fchmod(int, mode_t) __DARWIN_ALIAS(fchmod);
382int fstat(int, struct stat *) __DARWIN_INODE64(fstat);
383int lstat(const char *, struct stat *) __DARWIN_INODE64(lstat);
384int mkdir(const char *, mode_t);
385int mkfifo(const char *, mode_t);
386int stat(const char *, struct stat *) __DARWIN_INODE64(stat);
387int mknod(const char *, mode_t, dev_t);
388mode_t umask(mode_t);
389
390#if __DARWIN_C_LEVEL >= 200809L
391int fchmodat(int, const char *, mode_t, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
392int fstatat(int, const char *, struct stat *, int) __DARWIN_INODE64(fstatat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
393int 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
398int futimens(int __fd, const struct timespec __times[2]) __API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
399int 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
407int chflags(const char *, __uint32_t);
408int chmodx_np(const char *, filesec_t);
409int fchflags(int, __uint32_t);
410int fchmodx_np(int, filesec_t);
411int fstatx_np(int, struct stat *, filesec_t) __DARWIN_INODE64(fstatx_np);
412int lchflags(const char *, __uint32_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
413int lchmod(const char *, mode_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
414int lstatx_np(const char *, struct stat *, filesec_t) __DARWIN_INODE64(lstatx_np);
415int mkdirx_np(const char *, filesec_t);
416int mkfifox_np(const char *, filesec_t);
417int statx_np(const char *, struct stat *, filesec_t) __DARWIN_INODE64(statx_np);
418int 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 */
422int fstatx64_np(int, struct stat64 *, filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
423int lstatx64_np(const char *, struct stat64 *, filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
424int statx64_np(const char *, struct stat64 *, filesec_t) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
425int fstat64(int, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
426int lstat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_NA, __IPHONE_NA);
427int 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/aarch64-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 */
37struct 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
56int fstatvfs(int, struct statvfs *);
57int statvfs(const char * __restrict, struct statvfs * __restrict);
58__END_DECLS
59
60#endif /* _SYS_STATVFS_H_ */
lib/libc/include/aarch64-macos-gnu/sys/stdio.h created+55
......@@ -0,0 +1,55 @@
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 _SYS_STDIO_H_
30#define _SYS_STDIO_H_
31
32#include <sys/cdefs.h>
33
34#if __DARWIN_C_LEVEL >= 200809L
35#include <Availability.h>
36
37__BEGIN_DECLS
38
39int renameat(int, const char *, int, const char *) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
40
41#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
42
43#define RENAME_SECLUDE 0x00000001
44#define RENAME_SWAP 0x00000002
45#define RENAME_EXCL 0x00000004
46int renamex_np(const char *, const char *, unsigned int) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
47int renameatx_np(int, const char *, int, const char *, unsigned int) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
48
49#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
50
51__END_DECLS
52
53#endif /* __DARWIN_C_LEVEL >= 200809L */
54
55#endif /* _SYS_STDIO_H_ */
lib/libc/include/aarch64-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 */
133struct 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
448struct _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
458struct _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
465struct 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
532struct 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) */
543struct loadavg {
544 fixpt_t ldavg[3];
545 long fscale;
546};
547extern 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
769int sysctl(int *, u_int, void *, size_t *, void *, size_t);
770int sysctlbyname(const char *, void *, size_t *, void *, size_t);
771int 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/aarch64-macos-gnu/sys/syslimits.h created+125
......@@ -0,0 +1,125 @@
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/* $NetBSD: syslimits.h,v 1.15 1997/06/25 00:48:09 lukem Exp $ */
29
30/*
31 * Copyright (c) 1988, 1993
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 * @(#)syslimits.h 8.1 (Berkeley) 6/2/93
63 */
64
65#ifndef _SYS_SYSLIMITS_H_
66#define _SYS_SYSLIMITS_H_
67
68#include <sys/cdefs.h>
69
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
79/*
80 * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at
81 * compile time; you *cannot* set it higher than the hard limit!!
82 */
83
84#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
85#define CHILD_MAX 266 /* max simultaneous processes */
86#define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */
87#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
88#define LINK_MAX 32767 /* max file link count */
89#define MAX_CANON 1024 /* max bytes in term canon input line */
90#define MAX_INPUT 1024 /* max bytes in terminal input */
91#define NAME_MAX 255 /* max bytes in a file name */
92#define NGROUPS_MAX 16 /* max supplemental group id's */
93#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
94#define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */
95
96#define OPEN_MAX 10240 /* max open files per process - todo, make a config option? */
97
98#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
99#define PATH_MAX 1024 /* max bytes in pathname */
100#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
101
102#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
103#define BC_DIM_MAX 2048 /* max array elements in bc(1) */
104#define BC_SCALE_MAX 99 /* max scale value in bc(1) */
105#define BC_STRING_MAX 1000 /* max const string length in bc(1) */
106#define CHARCLASS_NAME_MAX 14 /* max character class name size */
107#define COLL_WEIGHTS_MAX 2 /* max weights for order keyword */
108#define EQUIV_CLASS_MAX 2
109#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */
110#define LINE_MAX 2048 /* max bytes in an input line */
111#define RE_DUP_MAX 255 /* max RE's in interval notation */
112
113#if __DARWIN_UNIX03
114#define NZERO 20 /* default priority [XSI] */
115 /* = ((PRIO_MAX - PRIO_MIN) / 2) + 1 */
116 /* range: 0 - 39 [(2 * NZERO) - 1] */
117 /* 0 is not actually used */
118#else /* !__DARWIN_UNIX03 */
119#define NZERO 0 /* default priority */
120 /* range: -20 - 20 */
121 /* (PRIO_MIN - PRIO_MAX) */
122#endif /* __DARWIN_UNIX03 */
123#endif /* !_ANSI_SOURCE */
124
125#endif /* !_SYS_SYSLIMITS_H_ */
lib/libc/include/aarch64-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)
96typedef struct _code {
97 const char *c_name;
98 int c_val;
99} CODE;
100
101CODE 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
160CODE 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
223void closelog(void);
224void openlog(const char *, int, int);
225int setlogmask(int);
226#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __DARWIN_C_LEVEL >= __DARWIN_C_FULL
227void syslog(int, const char *, ...) __DARWIN_ALIAS_STARTING(__MAC_10_13, __IPHONE_NA, __DARWIN_EXTSN(syslog)) __printflike(2, 3) __not_tail_called;
228#else
229void syslog(int, const char *, ...) __printflike(2, 3) __not_tail_called;
230#endif
231#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
232void 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/aarch64-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
263typedef unsigned long tcflag_t;
264typedef unsigned char cc_t;
265typedef unsigned long speed_t;
266
267struct 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
331speed_t cfgetispeed(const struct termios *);
332speed_t cfgetospeed(const struct termios *);
333int cfsetispeed(struct termios *, speed_t);
334int cfsetospeed(struct termios *, speed_t);
335int tcgetattr(int, struct termios *);
336int tcsetattr(int, int, const struct termios *);
337int tcdrain(int) __DARWIN_ALIAS_C(tcdrain);
338int tcflow(int, int);
339int tcflush(int, int);
340int tcsendbreak(int, int);
341
342#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
343void cfmakeraw(struct termios *);
344int 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/aarch64-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 */
91struct 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
129struct 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 */
172struct 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)
190int adjtime(const struct timeval *, struct timeval *);
191int futimes(int, const struct timeval *);
192int lutimes(const char *, const struct timeval *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
193int settimeofday(const struct timeval *, const struct timezone *);
194#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
195
196int getitimer(int, struct itimerval *);
197int gettimeofday(struct timeval * __restrict, void * __restrict);
198
199#include <sys/_select.h> /* select() prototype */
200
201int setitimer(int, const struct itimerval * __restrict,
202 struct itimerval * __restrict);
203int utimes(const char *, const struct timeval *);
204
205__END_DECLS
206
207
208#endif /* !_SYS_TIME_H_ */
lib/libc/include/aarch64-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 */
82struct 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
90clock_t times(struct tms *);
91__END_DECLS
92#endif /* !_SYS_TIMES_H_ */
lib/libc/include/aarch64-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 */
82struct 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/aarch64-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
118static 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/aarch64-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
88typedef unsigned long u_long;
89#define _U_LONG
90#endif
91typedef unsigned short ushort; /* Sys V compatibility */
92typedef unsigned int uint; /* Sys V compatibility */
93#endif
94
95typedef u_int64_t u_quad_t; /* quads */
96typedef int64_t quad_t;
97typedef quad_t * qaddr_t;
98
99#include <sys/_types/_caddr_t.h> /* core address */
100
101typedef int32_t daddr_t; /* disk address */
102
103#include <sys/_types/_dev_t.h> /* device number */
104
105typedef 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
125typedef int32_t segsz_t; /* segment size */
126typedef 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
138static inline __int32_t
139major(__uint32_t _x)
140{
141 return (__int32_t)(((__uint32_t)_x >> 24) & 0xff);
142}
143
144static inline __int32_t
145minor(__uint32_t _x)
146{
147 return (__int32_t)((_x) & 0xffffff);
148}
149
150static inline dev_t
151makedev(__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? */
189typedef __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/aarch64-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
78struct label;
79
80#ifdef __APPLE_API_UNSTABLE
81struct ucred;
82struct posix_cred;
83
84#ifndef _KAUTH_CRED_T
85#define _KAUTH_CRED_T
86typedef struct ucred *kauth_cred_t;
87typedef 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 */
100struct 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/aarch64-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 */
92enum uio_rw { UIO_READ, UIO_WRITE };
93#endif
94
95
96
97__BEGIN_DECLS
98ssize_t readv(int, const struct iovec *, int) __DARWIN_ALIAS_C(readv);
99ssize_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
103ssize_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));
104ssize_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/aarch64-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 */
76struct 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/aarch64-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)
132struct 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
187int getattrlistbulk(int, void *, void *, size_t, uint64_t) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
188int getattrlistat(int, const char *, void *, void *, size_t, unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
189int 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
207int faccessat(int, const char *, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
208int fchownat(int, const char *, uid_t, gid_t, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
209int linkat(int, const char *, int, const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
210ssize_t readlinkat(int, const char *, char *, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
211int symlinkat(const char *, int, const char *) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
212int 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/aarch64-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
74struct 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
83int uname(struct utsname *);
84__END_DECLS
85
86#endif /* !_SYS_UTSNAME_H */
lib/libc/include/aarch64-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 */
80struct 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/aarch64-macos-gnu/sys/wait.h created+258
......@@ -0,0 +1,258 @@
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, 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 * @(#)wait.h 8.2 (Berkeley) 7/10/94
62 */
63
64#ifndef _SYS_WAIT_H_
65#define _SYS_WAIT_H_
66
67#include <sys/cdefs.h>
68#include <sys/_types.h>
69
70/*
71 * This file holds definitions relevent to the wait4 system call
72 * and the alternate interfaces that use it (wait, wait3, waitpid).
73 */
74
75/*
76 * [XSI] The type idtype_t shall be defined as an enumeration type whose
77 * possible values shall include at least P_ALL, P_PID, and P_PGID.
78 */
79typedef enum {
80 P_ALL,
81 P_PID,
82 P_PGID
83} idtype_t;
84
85/*
86 * [XSI] The id_t and pid_t types shall be defined as described
87 * in <sys/types.h>
88 */
89#include <sys/_types/_pid_t.h>
90#include <sys/_types/_id_t.h>
91
92/*
93 * [XSI] The siginfo_t type shall be defined as described in <signal.h>
94 * [XSI] The rusage structure shall be defined as described in <sys/resource.h>
95 * [XSI] Inclusion of the <sys/wait.h> header may also make visible all
96 * symbols from <signal.h> and <sys/resource.h>
97 *
98 * NOTE: This requirement is currently being satisfied by the direct
99 * inclusion of <sys/signal.h> and <sys/resource.h>, below.
100 *
101 * Software should not depend on the exposure of anything other
102 * than the types siginfo_t and struct rusage as a result of
103 * this inclusion. If you depend on any types or manifest
104 * values othe than siginfo_t and struct rusage from either of
105 * those files, you should explicitly include them yourself, as
106 * well, or in future releases your stware may not compile
107 * without modification.
108 */
109#include <sys/signal.h> /* [XSI] for siginfo_t */
110#include <sys/resource.h> /* [XSI] for struct rusage */
111
112/*
113 * Option bits for the third argument of wait4. WNOHANG causes the
114 * wait to not hang if there are no stopped or terminated processes, rather
115 * returning an error indication in this case (pid==0). WUNTRACED
116 * indicates that the caller should receive status about untraced children
117 * which stop due to signals. If children are stopped and a wait without
118 * this option is done, it is as though they were still running... nothing
119 * about them is returned.
120 */
121#define WNOHANG 0x00000001 /* [XSI] no hang in wait/no child to reap */
122#define WUNTRACED 0x00000002 /* [XSI] notify on stop, untraced child */
123
124/*
125 * Macros to test the exit status returned by wait
126 * and extract the relevant values.
127 */
128#if defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE)
129#define _W_INT(i) (i)
130#else
131#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
132#define WCOREFLAG 0200
133#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
134
135/* These macros are permited, as they are in the implementation namespace */
136#define _WSTATUS(x) (_W_INT(x) & 0177)
137#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
138
139/*
140 * [XSI] The <sys/wait.h> header shall define the following macros for
141 * analysis of process status values
142 */
143#if __DARWIN_UNIX03
144#define WEXITSTATUS(x) ((_W_INT(x) >> 8) & 0x000000ff)
145#else /* !__DARWIN_UNIX03 */
146#define WEXITSTATUS(x) (_W_INT(x) >> 8)
147#endif /* !__DARWIN_UNIX03 */
148/* 0x13 == SIGCONT */
149#define WSTOPSIG(x) (_W_INT(x) >> 8)
150#define WIFCONTINUED(x) (_WSTATUS(x) == _WSTOPPED && WSTOPSIG(x) == 0x13)
151#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED && WSTOPSIG(x) != 0x13)
152#define WIFEXITED(x) (_WSTATUS(x) == 0)
153#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
154#define WTERMSIG(x) (_WSTATUS(x))
155#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
156#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
157
158#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
159#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
160#endif /* (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
161
162/*
163 * [XSI] The following symbolic constants shall be defined as possible
164 * values for the fourth argument to waitid().
165 */
166/* WNOHANG already defined for wait4() */
167/* WUNTRACED defined for wait4() but not for waitid() */
168#define WEXITED 0x00000004 /* [XSI] Processes which have exitted */
169#if __DARWIN_UNIX03
170/* waitid() parameter */
171#define WSTOPPED 0x00000008 /* [XSI] Any child stopped by signal */
172#endif
173#define WCONTINUED 0x00000010 /* [XSI] Any child stopped then continued */
174#define WNOWAIT 0x00000020 /* [XSI] Leave process returned waitable */
175
176
177#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
178/* POSIX extensions and 4.2/4.3 compatability: */
179
180/*
181 * Tokens for special values of the "pid" parameter to wait4.
182 */
183#define WAIT_ANY (-1) /* any process */
184#define WAIT_MYPGRP 0 /* any process in my process group */
185
186#include <machine/endian.h>
187
188/*
189 * Deprecated:
190 * Structure of the information in the status word returned by wait4.
191 * If w_stopval==_WSTOPPED, then the second structure describes
192 * the information returned, else the first.
193 */
194union wait {
195 int w_status; /* used in syscall */
196 /*
197 * Terminated process status.
198 */
199 struct {
200#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
201 unsigned int w_Termsig:7, /* termination signal */
202 w_Coredump:1, /* core dump indicator */
203 w_Retcode:8, /* exit code if w_termsig==0 */
204 w_Filler:16; /* upper bits filler */
205#endif
206#if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
207 unsigned int w_Filler:16, /* upper bits filler */
208 w_Retcode:8, /* exit code if w_termsig==0 */
209 w_Coredump:1, /* core dump indicator */
210 w_Termsig:7; /* termination signal */
211#endif
212 } w_T;
213 /*
214 * Stopped process status. Returned
215 * only for traced children unless requested
216 * with the WUNTRACED option bit.
217 */
218 struct {
219#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
220 unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
221 w_Stopsig:8, /* signal that stopped us */
222 w_Filler:16; /* upper bits filler */
223#endif
224#if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
225 unsigned int w_Filler:16, /* upper bits filler */
226 w_Stopsig:8, /* signal that stopped us */
227 w_Stopval:8; /* == W_STOPPED if stopped */
228#endif
229 } w_S;
230};
231#define w_termsig w_T.w_Termsig
232#define w_coredump w_T.w_Coredump
233#define w_retcode w_T.w_Retcode
234#define w_stopval w_S.w_Stopval
235#define w_stopsig w_S.w_Stopsig
236
237#endif /* (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
238
239#if !(__DARWIN_UNIX03 - 0)
240/*
241 * Stopped state value; cannot use waitid() parameter of the same name
242 * in the same scope
243 */
244#define WSTOPPED _WSTOPPED
245#endif /* !__DARWIN_UNIX03 */
246
247__BEGIN_DECLS
248pid_t wait(int *) __DARWIN_ALIAS_C(wait);
249pid_t waitpid(pid_t, int *, int) __DARWIN_ALIAS_C(waitpid);
250#ifndef _ANSI_SOURCE
251int waitid(idtype_t, id_t, siginfo_t *, int) __DARWIN_ALIAS_C(waitid);
252#endif /* !_ANSI_SOURCE */
253#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
254pid_t wait3(int *, int, struct rusage *);
255pid_t wait4(pid_t, int *, int, struct rusage *);
256#endif /* (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
257__END_DECLS
258#endif /* !_SYS_WAIT_H_ */
lib/libc/include/aarch64-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/aarch64-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/aarch64-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/aarch64-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
32pid_t tcgetsid(int);
33__END_DECLS
34
35#endif /* __TERMIOS_H__ */
lib/libc/include/aarch64-macos-gnu/tgmath.h created+1372
......@@ -0,0 +1,1372 @@
1/*
2 * Copyright (c) 2009 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 __TGMATH_H
24#define __TGMATH_H
25
26/* C99 7.22 Type-generic math <tgmath.h>. */
27#include <math.h>
28
29/* C++ handles type genericity with overloading in math.h. */
30#ifndef __cplusplus
31#include <complex.h>
32
33#define _TG_ATTRSp __attribute__((__overloadable__))
34#define _TG_ATTRS __attribute__((__overloadable__, __always_inline__))
35
36// promotion
37
38typedef void _Argument_type_is_not_arithmetic;
39static _Argument_type_is_not_arithmetic __tg_promote(...)
40 __attribute__((__unavailable__,__overloadable__));
41static double _TG_ATTRSp __tg_promote(int);
42static double _TG_ATTRSp __tg_promote(unsigned int);
43static double _TG_ATTRSp __tg_promote(long);
44static double _TG_ATTRSp __tg_promote(unsigned long);
45static double _TG_ATTRSp __tg_promote(long long);
46static double _TG_ATTRSp __tg_promote(unsigned long long);
47static float _TG_ATTRSp __tg_promote(float);
48static double _TG_ATTRSp __tg_promote(double);
49static long double _TG_ATTRSp __tg_promote(long double);
50static float _Complex _TG_ATTRSp __tg_promote(float _Complex);
51static double _Complex _TG_ATTRSp __tg_promote(double _Complex);
52static long double _Complex _TG_ATTRSp __tg_promote(long double _Complex);
53
54#define __tg_promote1(__x) (__typeof__(__tg_promote(__x)))
55#define __tg_promote2(__x, __y) (__typeof__(__tg_promote(__x) + \
56 __tg_promote(__y)))
57#define __tg_promote3(__x, __y, __z) (__typeof__(__tg_promote(__x) + \
58 __tg_promote(__y) + \
59 __tg_promote(__z)))
60
61// acos
62
63static float
64 _TG_ATTRS
65 __tg_acos(float __x) {return acosf(__x);}
66
67static double
68 _TG_ATTRS
69 __tg_acos(double __x) {return acos(__x);}
70
71static long double
72 _TG_ATTRS
73 __tg_acos(long double __x) {return acosl(__x);}
74
75static float _Complex
76 _TG_ATTRS
77 __tg_acos(float _Complex __x) {return cacosf(__x);}
78
79static double _Complex
80 _TG_ATTRS
81 __tg_acos(double _Complex __x) {return cacos(__x);}
82
83static long double _Complex
84 _TG_ATTRS
85 __tg_acos(long double _Complex __x) {return cacosl(__x);}
86
87#undef acos
88#define acos(__x) __tg_acos(__tg_promote1((__x))(__x))
89
90// asin
91
92static float
93 _TG_ATTRS
94 __tg_asin(float __x) {return asinf(__x);}
95
96static double
97 _TG_ATTRS
98 __tg_asin(double __x) {return asin(__x);}
99
100static long double
101 _TG_ATTRS
102 __tg_asin(long double __x) {return asinl(__x);}
103
104static float _Complex
105 _TG_ATTRS
106 __tg_asin(float _Complex __x) {return casinf(__x);}
107
108static double _Complex
109 _TG_ATTRS
110 __tg_asin(double _Complex __x) {return casin(__x);}
111
112static long double _Complex
113 _TG_ATTRS
114 __tg_asin(long double _Complex __x) {return casinl(__x);}
115
116#undef asin
117#define asin(__x) __tg_asin(__tg_promote1((__x))(__x))
118
119// atan
120
121static float
122 _TG_ATTRS
123 __tg_atan(float __x) {return atanf(__x);}
124
125static double
126 _TG_ATTRS
127 __tg_atan(double __x) {return atan(__x);}
128
129static long double
130 _TG_ATTRS
131 __tg_atan(long double __x) {return atanl(__x);}
132
133static float _Complex
134 _TG_ATTRS
135 __tg_atan(float _Complex __x) {return catanf(__x);}
136
137static double _Complex
138 _TG_ATTRS
139 __tg_atan(double _Complex __x) {return catan(__x);}
140
141static long double _Complex
142 _TG_ATTRS
143 __tg_atan(long double _Complex __x) {return catanl(__x);}
144
145#undef atan
146#define atan(__x) __tg_atan(__tg_promote1((__x))(__x))
147
148// acosh
149
150static float
151 _TG_ATTRS
152 __tg_acosh(float __x) {return acoshf(__x);}
153
154static double
155 _TG_ATTRS
156 __tg_acosh(double __x) {return acosh(__x);}
157
158static long double
159 _TG_ATTRS
160 __tg_acosh(long double __x) {return acoshl(__x);}
161
162static float _Complex
163 _TG_ATTRS
164 __tg_acosh(float _Complex __x) {return cacoshf(__x);}
165
166static double _Complex
167 _TG_ATTRS
168 __tg_acosh(double _Complex __x) {return cacosh(__x);}
169
170static long double _Complex
171 _TG_ATTRS
172 __tg_acosh(long double _Complex __x) {return cacoshl(__x);}
173
174#undef acosh
175#define acosh(__x) __tg_acosh(__tg_promote1((__x))(__x))
176
177// asinh
178
179static float
180 _TG_ATTRS
181 __tg_asinh(float __x) {return asinhf(__x);}
182
183static double
184 _TG_ATTRS
185 __tg_asinh(double __x) {return asinh(__x);}
186
187static long double
188 _TG_ATTRS
189 __tg_asinh(long double __x) {return asinhl(__x);}
190
191static float _Complex
192 _TG_ATTRS
193 __tg_asinh(float _Complex __x) {return casinhf(__x);}
194
195static double _Complex
196 _TG_ATTRS
197 __tg_asinh(double _Complex __x) {return casinh(__x);}
198
199static long double _Complex
200 _TG_ATTRS
201 __tg_asinh(long double _Complex __x) {return casinhl(__x);}
202
203#undef asinh
204#define asinh(__x) __tg_asinh(__tg_promote1((__x))(__x))
205
206// atanh
207
208static float
209 _TG_ATTRS
210 __tg_atanh(float __x) {return atanhf(__x);}
211
212static double
213 _TG_ATTRS
214 __tg_atanh(double __x) {return atanh(__x);}
215
216static long double
217 _TG_ATTRS
218 __tg_atanh(long double __x) {return atanhl(__x);}
219
220static float _Complex
221 _TG_ATTRS
222 __tg_atanh(float _Complex __x) {return catanhf(__x);}
223
224static double _Complex
225 _TG_ATTRS
226 __tg_atanh(double _Complex __x) {return catanh(__x);}
227
228static long double _Complex
229 _TG_ATTRS
230 __tg_atanh(long double _Complex __x) {return catanhl(__x);}
231
232#undef atanh
233#define atanh(__x) __tg_atanh(__tg_promote1((__x))(__x))
234
235// cos
236
237static float
238 _TG_ATTRS
239 __tg_cos(float __x) {return cosf(__x);}
240
241static double
242 _TG_ATTRS
243 __tg_cos(double __x) {return cos(__x);}
244
245static long double
246 _TG_ATTRS
247 __tg_cos(long double __x) {return cosl(__x);}
248
249static float _Complex
250 _TG_ATTRS
251 __tg_cos(float _Complex __x) {return ccosf(__x);}
252
253static double _Complex
254 _TG_ATTRS
255 __tg_cos(double _Complex __x) {return ccos(__x);}
256
257static long double _Complex
258 _TG_ATTRS
259 __tg_cos(long double _Complex __x) {return ccosl(__x);}
260
261#undef cos
262#define cos(__x) __tg_cos(__tg_promote1((__x))(__x))
263
264// sin
265
266static float
267 _TG_ATTRS
268 __tg_sin(float __x) {return sinf(__x);}
269
270static double
271 _TG_ATTRS
272 __tg_sin(double __x) {return sin(__x);}
273
274static long double
275 _TG_ATTRS
276 __tg_sin(long double __x) {return sinl(__x);}
277
278static float _Complex
279 _TG_ATTRS
280 __tg_sin(float _Complex __x) {return csinf(__x);}
281
282static double _Complex
283 _TG_ATTRS
284 __tg_sin(double _Complex __x) {return csin(__x);}
285
286static long double _Complex
287 _TG_ATTRS
288 __tg_sin(long double _Complex __x) {return csinl(__x);}
289
290#undef sin
291#define sin(__x) __tg_sin(__tg_promote1((__x))(__x))
292
293// tan
294
295static float
296 _TG_ATTRS
297 __tg_tan(float __x) {return tanf(__x);}
298
299static double
300 _TG_ATTRS
301 __tg_tan(double __x) {return tan(__x);}
302
303static long double
304 _TG_ATTRS
305 __tg_tan(long double __x) {return tanl(__x);}
306
307static float _Complex
308 _TG_ATTRS
309 __tg_tan(float _Complex __x) {return ctanf(__x);}
310
311static double _Complex
312 _TG_ATTRS
313 __tg_tan(double _Complex __x) {return ctan(__x);}
314
315static long double _Complex
316 _TG_ATTRS
317 __tg_tan(long double _Complex __x) {return ctanl(__x);}
318
319#undef tan
320#define tan(__x) __tg_tan(__tg_promote1((__x))(__x))
321
322// cosh
323
324static float
325 _TG_ATTRS
326 __tg_cosh(float __x) {return coshf(__x);}
327
328static double
329 _TG_ATTRS
330 __tg_cosh(double __x) {return cosh(__x);}
331
332static long double
333 _TG_ATTRS
334 __tg_cosh(long double __x) {return coshl(__x);}
335
336static float _Complex
337 _TG_ATTRS
338 __tg_cosh(float _Complex __x) {return ccoshf(__x);}
339
340static double _Complex
341 _TG_ATTRS
342 __tg_cosh(double _Complex __x) {return ccosh(__x);}
343
344static long double _Complex
345 _TG_ATTRS
346 __tg_cosh(long double _Complex __x) {return ccoshl(__x);}
347
348#undef cosh
349#define cosh(__x) __tg_cosh(__tg_promote1((__x))(__x))
350
351// sinh
352
353static float
354 _TG_ATTRS
355 __tg_sinh(float __x) {return sinhf(__x);}
356
357static double
358 _TG_ATTRS
359 __tg_sinh(double __x) {return sinh(__x);}
360
361static long double
362 _TG_ATTRS
363 __tg_sinh(long double __x) {return sinhl(__x);}
364
365static float _Complex
366 _TG_ATTRS
367 __tg_sinh(float _Complex __x) {return csinhf(__x);}
368
369static double _Complex
370 _TG_ATTRS
371 __tg_sinh(double _Complex __x) {return csinh(__x);}
372
373static long double _Complex
374 _TG_ATTRS
375 __tg_sinh(long double _Complex __x) {return csinhl(__x);}
376
377#undef sinh
378#define sinh(__x) __tg_sinh(__tg_promote1((__x))(__x))
379
380// tanh
381
382static float
383 _TG_ATTRS
384 __tg_tanh(float __x) {return tanhf(__x);}
385
386static double
387 _TG_ATTRS
388 __tg_tanh(double __x) {return tanh(__x);}
389
390static long double
391 _TG_ATTRS
392 __tg_tanh(long double __x) {return tanhl(__x);}
393
394static float _Complex
395 _TG_ATTRS
396 __tg_tanh(float _Complex __x) {return ctanhf(__x);}
397
398static double _Complex
399 _TG_ATTRS
400 __tg_tanh(double _Complex __x) {return ctanh(__x);}
401
402static long double _Complex
403 _TG_ATTRS
404 __tg_tanh(long double _Complex __x) {return ctanhl(__x);}
405
406#undef tanh
407#define tanh(__x) __tg_tanh(__tg_promote1((__x))(__x))
408
409// exp
410
411static float
412 _TG_ATTRS
413 __tg_exp(float __x) {return expf(__x);}
414
415static double
416 _TG_ATTRS
417 __tg_exp(double __x) {return exp(__x);}
418
419static long double
420 _TG_ATTRS
421 __tg_exp(long double __x) {return expl(__x);}
422
423static float _Complex
424 _TG_ATTRS
425 __tg_exp(float _Complex __x) {return cexpf(__x);}
426
427static double _Complex
428 _TG_ATTRS
429 __tg_exp(double _Complex __x) {return cexp(__x);}
430
431static long double _Complex
432 _TG_ATTRS
433 __tg_exp(long double _Complex __x) {return cexpl(__x);}
434
435#undef exp
436#define exp(__x) __tg_exp(__tg_promote1((__x))(__x))
437
438// log
439
440static float
441 _TG_ATTRS
442 __tg_log(float __x) {return logf(__x);}
443
444static double
445 _TG_ATTRS
446 __tg_log(double __x) {return log(__x);}
447
448static long double
449 _TG_ATTRS
450 __tg_log(long double __x) {return logl(__x);}
451
452static float _Complex
453 _TG_ATTRS
454 __tg_log(float _Complex __x) {return clogf(__x);}
455
456static double _Complex
457 _TG_ATTRS
458 __tg_log(double _Complex __x) {return clog(__x);}
459
460static long double _Complex
461 _TG_ATTRS
462 __tg_log(long double _Complex __x) {return clogl(__x);}
463
464#undef log
465#define log(__x) __tg_log(__tg_promote1((__x))(__x))
466
467// pow
468
469static float
470 _TG_ATTRS
471 __tg_pow(float __x, float __y) {return powf(__x, __y);}
472
473static double
474 _TG_ATTRS
475 __tg_pow(double __x, double __y) {return pow(__x, __y);}
476
477static long double
478 _TG_ATTRS
479 __tg_pow(long double __x, long double __y) {return powl(__x, __y);}
480
481static float _Complex
482 _TG_ATTRS
483 __tg_pow(float _Complex __x, float _Complex __y) {return cpowf(__x, __y);}
484
485static double _Complex
486 _TG_ATTRS
487 __tg_pow(double _Complex __x, double _Complex __y) {return cpow(__x, __y);}
488
489static long double _Complex
490 _TG_ATTRS
491 __tg_pow(long double _Complex __x, long double _Complex __y)
492 {return cpowl(__x, __y);}
493
494#undef pow
495#define pow(__x, __y) __tg_pow(__tg_promote2((__x), (__y))(__x), \
496 __tg_promote2((__x), (__y))(__y))
497
498// sqrt
499
500static float
501 _TG_ATTRS
502 __tg_sqrt(float __x) {return sqrtf(__x);}
503
504static double
505 _TG_ATTRS
506 __tg_sqrt(double __x) {return sqrt(__x);}
507
508static long double
509 _TG_ATTRS
510 __tg_sqrt(long double __x) {return sqrtl(__x);}
511
512static float _Complex
513 _TG_ATTRS
514 __tg_sqrt(float _Complex __x) {return csqrtf(__x);}
515
516static double _Complex
517 _TG_ATTRS
518 __tg_sqrt(double _Complex __x) {return csqrt(__x);}
519
520static long double _Complex
521 _TG_ATTRS
522 __tg_sqrt(long double _Complex __x) {return csqrtl(__x);}
523
524#undef sqrt
525#define sqrt(__x) __tg_sqrt(__tg_promote1((__x))(__x))
526
527// fabs
528
529static float
530 _TG_ATTRS
531 __tg_fabs(float __x) {return fabsf(__x);}
532
533static double
534 _TG_ATTRS
535 __tg_fabs(double __x) {return fabs(__x);}
536
537static long double
538 _TG_ATTRS
539 __tg_fabs(long double __x) {return fabsl(__x);}
540
541static float
542 _TG_ATTRS
543 __tg_fabs(float _Complex __x) {return cabsf(__x);}
544
545static double
546 _TG_ATTRS
547 __tg_fabs(double _Complex __x) {return cabs(__x);}
548
549static long double
550 _TG_ATTRS
551 __tg_fabs(long double _Complex __x) {return cabsl(__x);}
552
553#undef fabs
554#define fabs(__x) __tg_fabs(__tg_promote1((__x))(__x))
555
556// atan2
557
558static float
559 _TG_ATTRS
560 __tg_atan2(float __x, float __y) {return atan2f(__x, __y);}
561
562static double
563 _TG_ATTRS
564 __tg_atan2(double __x, double __y) {return atan2(__x, __y);}
565
566static long double
567 _TG_ATTRS
568 __tg_atan2(long double __x, long double __y) {return atan2l(__x, __y);}
569
570#undef atan2
571#define atan2(__x, __y) __tg_atan2(__tg_promote2((__x), (__y))(__x), \
572 __tg_promote2((__x), (__y))(__y))
573
574// cbrt
575
576static float
577 _TG_ATTRS
578 __tg_cbrt(float __x) {return cbrtf(__x);}
579
580static double
581 _TG_ATTRS
582 __tg_cbrt(double __x) {return cbrt(__x);}
583
584static long double
585 _TG_ATTRS
586 __tg_cbrt(long double __x) {return cbrtl(__x);}
587
588#undef cbrt
589#define cbrt(__x) __tg_cbrt(__tg_promote1((__x))(__x))
590
591// ceil
592
593static float
594 _TG_ATTRS
595 __tg_ceil(float __x) {return ceilf(__x);}
596
597static double
598 _TG_ATTRS
599 __tg_ceil(double __x) {return ceil(__x);}
600
601static long double
602 _TG_ATTRS
603 __tg_ceil(long double __x) {return ceill(__x);}
604
605#undef ceil
606#define ceil(__x) __tg_ceil(__tg_promote1((__x))(__x))
607
608// copysign
609
610static float
611 _TG_ATTRS
612 __tg_copysign(float __x, float __y) {return copysignf(__x, __y);}
613
614static double
615 _TG_ATTRS
616 __tg_copysign(double __x, double __y) {return copysign(__x, __y);}
617
618static long double
619 _TG_ATTRS
620 __tg_copysign(long double __x, long double __y) {return copysignl(__x, __y);}
621
622#undef copysign
623#define copysign(__x, __y) __tg_copysign(__tg_promote2((__x), (__y))(__x), \
624 __tg_promote2((__x), (__y))(__y))
625
626// erf
627
628static float
629 _TG_ATTRS
630 __tg_erf(float __x) {return erff(__x);}
631
632static double
633 _TG_ATTRS
634 __tg_erf(double __x) {return erf(__x);}
635
636static long double
637 _TG_ATTRS
638 __tg_erf(long double __x) {return erfl(__x);}
639
640#undef erf
641#define erf(__x) __tg_erf(__tg_promote1((__x))(__x))
642
643// erfc
644
645static float
646 _TG_ATTRS
647 __tg_erfc(float __x) {return erfcf(__x);}
648
649static double
650 _TG_ATTRS
651 __tg_erfc(double __x) {return erfc(__x);}
652
653static long double
654 _TG_ATTRS
655 __tg_erfc(long double __x) {return erfcl(__x);}
656
657#undef erfc
658#define erfc(__x) __tg_erfc(__tg_promote1((__x))(__x))
659
660// exp2
661
662static float
663 _TG_ATTRS
664 __tg_exp2(float __x) {return exp2f(__x);}
665
666static double
667 _TG_ATTRS
668 __tg_exp2(double __x) {return exp2(__x);}
669
670static long double
671 _TG_ATTRS
672 __tg_exp2(long double __x) {return exp2l(__x);}
673
674#undef exp2
675#define exp2(__x) __tg_exp2(__tg_promote1((__x))(__x))
676
677// expm1
678
679static float
680 _TG_ATTRS
681 __tg_expm1(float __x) {return expm1f(__x);}
682
683static double
684 _TG_ATTRS
685 __tg_expm1(double __x) {return expm1(__x);}
686
687static long double
688 _TG_ATTRS
689 __tg_expm1(long double __x) {return expm1l(__x);}
690
691#undef expm1
692#define expm1(__x) __tg_expm1(__tg_promote1((__x))(__x))
693
694// fdim
695
696static float
697 _TG_ATTRS
698 __tg_fdim(float __x, float __y) {return fdimf(__x, __y);}
699
700static double
701 _TG_ATTRS
702 __tg_fdim(double __x, double __y) {return fdim(__x, __y);}
703
704static long double
705 _TG_ATTRS
706 __tg_fdim(long double __x, long double __y) {return fdiml(__x, __y);}
707
708#undef fdim
709#define fdim(__x, __y) __tg_fdim(__tg_promote2((__x), (__y))(__x), \
710 __tg_promote2((__x), (__y))(__y))
711
712// floor
713
714static float
715 _TG_ATTRS
716 __tg_floor(float __x) {return floorf(__x);}
717
718static double
719 _TG_ATTRS
720 __tg_floor(double __x) {return floor(__x);}
721
722static long double
723 _TG_ATTRS
724 __tg_floor(long double __x) {return floorl(__x);}
725
726#undef floor
727#define floor(__x) __tg_floor(__tg_promote1((__x))(__x))
728
729// fma
730
731static float
732 _TG_ATTRS
733 __tg_fma(float __x, float __y, float __z)
734 {return fmaf(__x, __y, __z);}
735
736static double
737 _TG_ATTRS
738 __tg_fma(double __x, double __y, double __z)
739 {return fma(__x, __y, __z);}
740
741static long double
742 _TG_ATTRS
743 __tg_fma(long double __x,long double __y, long double __z)
744 {return fmal(__x, __y, __z);}
745
746#undef fma
747#define fma(__x, __y, __z) \
748 __tg_fma(__tg_promote3((__x), (__y), (__z))(__x), \
749 __tg_promote3((__x), (__y), (__z))(__y), \
750 __tg_promote3((__x), (__y), (__z))(__z))
751
752// fmax
753
754static float
755 _TG_ATTRS
756 __tg_fmax(float __x, float __y) {return fmaxf(__x, __y);}
757
758static double
759 _TG_ATTRS
760 __tg_fmax(double __x, double __y) {return fmax(__x, __y);}
761
762static long double
763 _TG_ATTRS
764 __tg_fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
765
766#undef fmax
767#define fmax(__x, __y) __tg_fmax(__tg_promote2((__x), (__y))(__x), \
768 __tg_promote2((__x), (__y))(__y))
769
770// fmin
771
772static float
773 _TG_ATTRS
774 __tg_fmin(float __x, float __y) {return fminf(__x, __y);}
775
776static double
777 _TG_ATTRS
778 __tg_fmin(double __x, double __y) {return fmin(__x, __y);}
779
780static long double
781 _TG_ATTRS
782 __tg_fmin(long double __x, long double __y) {return fminl(__x, __y);}
783
784#undef fmin
785#define fmin(__x, __y) __tg_fmin(__tg_promote2((__x), (__y))(__x), \
786 __tg_promote2((__x), (__y))(__y))
787
788// fmod
789
790static float
791 _TG_ATTRS
792 __tg_fmod(float __x, float __y) {return fmodf(__x, __y);}
793
794static double
795 _TG_ATTRS
796 __tg_fmod(double __x, double __y) {return fmod(__x, __y);}
797
798static long double
799 _TG_ATTRS
800 __tg_fmod(long double __x, long double __y) {return fmodl(__x, __y);}
801
802#undef fmod
803#define fmod(__x, __y) __tg_fmod(__tg_promote2((__x), (__y))(__x), \
804 __tg_promote2((__x), (__y))(__y))
805
806// frexp
807
808static float
809 _TG_ATTRS
810 __tg_frexp(float __x, int* __y) {return frexpf(__x, __y);}
811
812static double
813 _TG_ATTRS
814 __tg_frexp(double __x, int* __y) {return frexp(__x, __y);}
815
816static long double
817 _TG_ATTRS
818 __tg_frexp(long double __x, int* __y) {return frexpl(__x, __y);}
819
820#undef frexp
821#define frexp(__x, __y) __tg_frexp(__tg_promote1((__x))(__x), __y)
822
823// hypot
824
825static float
826 _TG_ATTRS
827 __tg_hypot(float __x, float __y) {return hypotf(__x, __y);}
828
829static double
830 _TG_ATTRS
831 __tg_hypot(double __x, double __y) {return hypot(__x, __y);}
832
833static long double
834 _TG_ATTRS
835 __tg_hypot(long double __x, long double __y) {return hypotl(__x, __y);}
836
837#undef hypot
838#define hypot(__x, __y) __tg_hypot(__tg_promote2((__x), (__y))(__x), \
839 __tg_promote2((__x), (__y))(__y))
840
841// ilogb
842
843static int
844 _TG_ATTRS
845 __tg_ilogb(float __x) {return ilogbf(__x);}
846
847static int
848 _TG_ATTRS
849 __tg_ilogb(double __x) {return ilogb(__x);}
850
851static int
852 _TG_ATTRS
853 __tg_ilogb(long double __x) {return ilogbl(__x);}
854
855#undef ilogb
856#define ilogb(__x) __tg_ilogb(__tg_promote1((__x))(__x))
857
858// ldexp
859
860static float
861 _TG_ATTRS
862 __tg_ldexp(float __x, int __y) {return ldexpf(__x, __y);}
863
864static double
865 _TG_ATTRS
866 __tg_ldexp(double __x, int __y) {return ldexp(__x, __y);}
867
868static long double
869 _TG_ATTRS
870 __tg_ldexp(long double __x, int __y) {return ldexpl(__x, __y);}
871
872#undef ldexp
873#define ldexp(__x, __y) __tg_ldexp(__tg_promote1((__x))(__x), __y)
874
875// lgamma
876
877static float
878 _TG_ATTRS
879 __tg_lgamma(float __x) {return lgammaf(__x);}
880
881static double
882 _TG_ATTRS
883 __tg_lgamma(double __x) {return lgamma(__x);}
884
885static long double
886 _TG_ATTRS
887 __tg_lgamma(long double __x) {return lgammal(__x);}
888
889#undef lgamma
890#define lgamma(__x) __tg_lgamma(__tg_promote1((__x))(__x))
891
892// llrint
893
894static long long
895 _TG_ATTRS
896 __tg_llrint(float __x) {return llrintf(__x);}
897
898static long long
899 _TG_ATTRS
900 __tg_llrint(double __x) {return llrint(__x);}
901
902static long long
903 _TG_ATTRS
904 __tg_llrint(long double __x) {return llrintl(__x);}
905
906#undef llrint
907#define llrint(__x) __tg_llrint(__tg_promote1((__x))(__x))
908
909// llround
910
911static long long
912 _TG_ATTRS
913 __tg_llround(float __x) {return llroundf(__x);}
914
915static long long
916 _TG_ATTRS
917 __tg_llround(double __x) {return llround(__x);}
918
919static long long
920 _TG_ATTRS
921 __tg_llround(long double __x) {return llroundl(__x);}
922
923#undef llround
924#define llround(__x) __tg_llround(__tg_promote1((__x))(__x))
925
926// log10
927
928static float
929 _TG_ATTRS
930 __tg_log10(float __x) {return log10f(__x);}
931
932static double
933 _TG_ATTRS
934 __tg_log10(double __x) {return log10(__x);}
935
936static long double
937 _TG_ATTRS
938 __tg_log10(long double __x) {return log10l(__x);}
939
940#undef log10
941#define log10(__x) __tg_log10(__tg_promote1((__x))(__x))
942
943// log1p
944
945static float
946 _TG_ATTRS
947 __tg_log1p(float __x) {return log1pf(__x);}
948
949static double
950 _TG_ATTRS
951 __tg_log1p(double __x) {return log1p(__x);}
952
953static long double
954 _TG_ATTRS
955 __tg_log1p(long double __x) {return log1pl(__x);}
956
957#undef log1p
958#define log1p(__x) __tg_log1p(__tg_promote1((__x))(__x))
959
960// log2
961
962static float
963 _TG_ATTRS
964 __tg_log2(float __x) {return log2f(__x);}
965
966static double
967 _TG_ATTRS
968 __tg_log2(double __x) {return log2(__x);}
969
970static long double
971 _TG_ATTRS
972 __tg_log2(long double __x) {return log2l(__x);}
973
974#undef log2
975#define log2(__x) __tg_log2(__tg_promote1((__x))(__x))
976
977// logb
978
979static float
980 _TG_ATTRS
981 __tg_logb(float __x) {return logbf(__x);}
982
983static double
984 _TG_ATTRS
985 __tg_logb(double __x) {return logb(__x);}
986
987static long double
988 _TG_ATTRS
989 __tg_logb(long double __x) {return logbl(__x);}
990
991#undef logb
992#define logb(__x) __tg_logb(__tg_promote1((__x))(__x))
993
994// lrint
995
996static long
997 _TG_ATTRS
998 __tg_lrint(float __x) {return lrintf(__x);}
999
1000static long
1001 _TG_ATTRS
1002 __tg_lrint(double __x) {return lrint(__x);}
1003
1004static long
1005 _TG_ATTRS
1006 __tg_lrint(long double __x) {return lrintl(__x);}
1007
1008#undef lrint
1009#define lrint(__x) __tg_lrint(__tg_promote1((__x))(__x))
1010
1011// lround
1012
1013static long
1014 _TG_ATTRS
1015 __tg_lround(float __x) {return lroundf(__x);}
1016
1017static long
1018 _TG_ATTRS
1019 __tg_lround(double __x) {return lround(__x);}
1020
1021static long
1022 _TG_ATTRS
1023 __tg_lround(long double __x) {return lroundl(__x);}
1024
1025#undef lround
1026#define lround(__x) __tg_lround(__tg_promote1((__x))(__x))
1027
1028// nearbyint
1029
1030static float
1031 _TG_ATTRS
1032 __tg_nearbyint(float __x) {return nearbyintf(__x);}
1033
1034static double
1035 _TG_ATTRS
1036 __tg_nearbyint(double __x) {return nearbyint(__x);}
1037
1038static long double
1039 _TG_ATTRS
1040 __tg_nearbyint(long double __x) {return nearbyintl(__x);}
1041
1042#undef nearbyint
1043#define nearbyint(__x) __tg_nearbyint(__tg_promote1((__x))(__x))
1044
1045// nextafter
1046
1047static float
1048 _TG_ATTRS
1049 __tg_nextafter(float __x, float __y) {return nextafterf(__x, __y);}
1050
1051static double
1052 _TG_ATTRS
1053 __tg_nextafter(double __x, double __y) {return nextafter(__x, __y);}
1054
1055static long double
1056 _TG_ATTRS
1057 __tg_nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
1058
1059#undef nextafter
1060#define nextafter(__x, __y) __tg_nextafter(__tg_promote2((__x), (__y))(__x), \
1061 __tg_promote2((__x), (__y))(__y))
1062
1063// nexttoward
1064
1065static float
1066 _TG_ATTRS
1067 __tg_nexttoward(float __x, long double __y) {return nexttowardf(__x, __y);}
1068
1069static double
1070 _TG_ATTRS
1071 __tg_nexttoward(double __x, long double __y) {return nexttoward(__x, __y);}
1072
1073static long double
1074 _TG_ATTRS
1075 __tg_nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
1076
1077#undef nexttoward
1078#define nexttoward(__x, __y) __tg_nexttoward(__tg_promote1((__x))(__x), (__y))
1079
1080// remainder
1081
1082static float
1083 _TG_ATTRS
1084 __tg_remainder(float __x, float __y) {return remainderf(__x, __y);}
1085
1086static double
1087 _TG_ATTRS
1088 __tg_remainder(double __x, double __y) {return remainder(__x, __y);}
1089
1090static long double
1091 _TG_ATTRS
1092 __tg_remainder(long double __x, long double __y) {return remainderl(__x, __y);}
1093
1094#undef remainder
1095#define remainder(__x, __y) __tg_remainder(__tg_promote2((__x), (__y))(__x), \
1096 __tg_promote2((__x), (__y))(__y))
1097
1098// remquo
1099
1100static float
1101 _TG_ATTRS
1102 __tg_remquo(float __x, float __y, int* __z)
1103 {return remquof(__x, __y, __z);}
1104
1105static double
1106 _TG_ATTRS
1107 __tg_remquo(double __x, double __y, int* __z)
1108 {return remquo(__x, __y, __z);}
1109
1110static long double
1111 _TG_ATTRS
1112 __tg_remquo(long double __x,long double __y, int* __z)
1113 {return remquol(__x, __y, __z);}
1114
1115#undef remquo
1116#define remquo(__x, __y, __z) \
1117 __tg_remquo(__tg_promote2((__x), (__y))(__x), \
1118 __tg_promote2((__x), (__y))(__y), \
1119 (__z))
1120
1121// rint
1122
1123static float
1124 _TG_ATTRS
1125 __tg_rint(float __x) {return rintf(__x);}
1126
1127static double
1128 _TG_ATTRS
1129 __tg_rint(double __x) {return rint(__x);}
1130
1131static long double
1132 _TG_ATTRS
1133 __tg_rint(long double __x) {return rintl(__x);}
1134
1135#undef rint
1136#define rint(__x) __tg_rint(__tg_promote1((__x))(__x))
1137
1138// round
1139
1140static float
1141 _TG_ATTRS
1142 __tg_round(float __x) {return roundf(__x);}
1143
1144static double
1145 _TG_ATTRS
1146 __tg_round(double __x) {return round(__x);}
1147
1148static long double
1149 _TG_ATTRS
1150 __tg_round(long double __x) {return roundl(__x);}
1151
1152#undef round
1153#define round(__x) __tg_round(__tg_promote1((__x))(__x))
1154
1155// scalbn
1156
1157static float
1158 _TG_ATTRS
1159 __tg_scalbn(float __x, int __y) {return scalbnf(__x, __y);}
1160
1161static double
1162 _TG_ATTRS
1163 __tg_scalbn(double __x, int __y) {return scalbn(__x, __y);}
1164
1165static long double
1166 _TG_ATTRS
1167 __tg_scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
1168
1169#undef scalbn
1170#define scalbn(__x, __y) __tg_scalbn(__tg_promote1((__x))(__x), __y)
1171
1172// scalbln
1173
1174static float
1175 _TG_ATTRS
1176 __tg_scalbln(float __x, long __y) {return scalblnf(__x, __y);}
1177
1178static double
1179 _TG_ATTRS
1180 __tg_scalbln(double __x, long __y) {return scalbln(__x, __y);}
1181
1182static long double
1183 _TG_ATTRS
1184 __tg_scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
1185
1186#undef scalbln
1187#define scalbln(__x, __y) __tg_scalbln(__tg_promote1((__x))(__x), __y)
1188
1189// tgamma
1190
1191static float
1192 _TG_ATTRS
1193 __tg_tgamma(float __x) {return tgammaf(__x);}
1194
1195static double
1196 _TG_ATTRS
1197 __tg_tgamma(double __x) {return tgamma(__x);}
1198
1199static long double
1200 _TG_ATTRS
1201 __tg_tgamma(long double __x) {return tgammal(__x);}
1202
1203#undef tgamma
1204#define tgamma(__x) __tg_tgamma(__tg_promote1((__x))(__x))
1205
1206// trunc
1207
1208static float
1209 _TG_ATTRS
1210 __tg_trunc(float __x) {return truncf(__x);}
1211
1212static double
1213 _TG_ATTRS
1214 __tg_trunc(double __x) {return trunc(__x);}
1215
1216static long double
1217 _TG_ATTRS
1218 __tg_trunc(long double __x) {return truncl(__x);}
1219
1220#undef trunc
1221#define trunc(__x) __tg_trunc(__tg_promote1((__x))(__x))
1222
1223// carg
1224
1225static float
1226 _TG_ATTRS
1227 __tg_carg(float __x) {return atan2f(0.F, __x);}
1228
1229static double
1230 _TG_ATTRS
1231 __tg_carg(double __x) {return atan2(0., __x);}
1232
1233static long double
1234 _TG_ATTRS
1235 __tg_carg(long double __x) {return atan2l(0.L, __x);}
1236
1237static float
1238 _TG_ATTRS
1239 __tg_carg(float _Complex __x) {return cargf(__x);}
1240
1241static double
1242 _TG_ATTRS
1243 __tg_carg(double _Complex __x) {return carg(__x);}
1244
1245static long double
1246 _TG_ATTRS
1247 __tg_carg(long double _Complex __x) {return cargl(__x);}
1248
1249#undef carg
1250#define carg(__x) __tg_carg(__tg_promote1((__x))(__x))
1251
1252// cimag
1253
1254static float
1255 _TG_ATTRS
1256 __tg_cimag(float __x) {return 0;}
1257
1258static double
1259 _TG_ATTRS
1260 __tg_cimag(double __x) {return 0;}
1261
1262static long double
1263 _TG_ATTRS
1264 __tg_cimag(long double __x) {return 0;}
1265
1266static float
1267 _TG_ATTRS
1268 __tg_cimag(float _Complex __x) {return cimagf(__x);}
1269
1270static double
1271 _TG_ATTRS
1272 __tg_cimag(double _Complex __x) {return cimag(__x);}
1273
1274static long double
1275 _TG_ATTRS
1276 __tg_cimag(long double _Complex __x) {return cimagl(__x);}
1277
1278#undef cimag
1279#define cimag(__x) __tg_cimag(__tg_promote1((__x))(__x))
1280
1281// conj
1282
1283static float _Complex
1284 _TG_ATTRS
1285 __tg_conj(float __x) {return __x;}
1286
1287static double _Complex
1288 _TG_ATTRS
1289 __tg_conj(double __x) {return __x;}
1290
1291static long double _Complex
1292 _TG_ATTRS
1293 __tg_conj(long double __x) {return __x;}
1294
1295static float _Complex
1296 _TG_ATTRS
1297 __tg_conj(float _Complex __x) {return conjf(__x);}
1298
1299static double _Complex
1300 _TG_ATTRS
1301 __tg_conj(double _Complex __x) {return conj(__x);}
1302
1303static long double _Complex
1304 _TG_ATTRS
1305 __tg_conj(long double _Complex __x) {return conjl(__x);}
1306
1307#undef conj
1308#define conj(__x) __tg_conj(__tg_promote1((__x))(__x))
1309
1310// cproj
1311
1312static float _Complex
1313 _TG_ATTRS
1314 __tg_cproj(float __x) {return cprojf(__x);}
1315
1316static double _Complex
1317 _TG_ATTRS
1318 __tg_cproj(double __x) {return cproj(__x);}
1319
1320static long double _Complex
1321 _TG_ATTRS
1322 __tg_cproj(long double __x) {return cprojl(__x);}
1323
1324static float _Complex
1325 _TG_ATTRS
1326 __tg_cproj(float _Complex __x) {return cprojf(__x);}
1327
1328static double _Complex
1329 _TG_ATTRS
1330 __tg_cproj(double _Complex __x) {return cproj(__x);}
1331
1332static long double _Complex
1333 _TG_ATTRS
1334 __tg_cproj(long double _Complex __x) {return cprojl(__x);}
1335
1336#undef cproj
1337#define cproj(__x) __tg_cproj(__tg_promote1((__x))(__x))
1338
1339// creal
1340
1341static float
1342 _TG_ATTRS
1343 __tg_creal(float __x) {return __x;}
1344
1345static double
1346 _TG_ATTRS
1347 __tg_creal(double __x) {return __x;}
1348
1349static long double
1350 _TG_ATTRS
1351 __tg_creal(long double __x) {return __x;}
1352
1353static float
1354 _TG_ATTRS
1355 __tg_creal(float _Complex __x) {return crealf(__x);}
1356
1357static double
1358 _TG_ATTRS
1359 __tg_creal(double _Complex __x) {return creal(__x);}
1360
1361static long double
1362 _TG_ATTRS
1363 __tg_creal(long double _Complex __x) {return creall(__x);}
1364
1365#undef creal
1366#define creal(__x) __tg_creal(__tg_promote1((__x))(__x))
1367
1368#undef _TG_ATTRSp
1369#undef _TG_ATTRS
1370
1371#endif /* __cplusplus */
1372#endif /* __TGMATH_H */
lib/libc/include/aarch64-macos-gnu/time.h created+208
......@@ -0,0 +1,208 @@
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) 1989, 1993
25 * The Regents of the University of California. All rights reserved.
26 * (c) UNIX System Laboratories, Inc.
27 * All or some portions of this file are derived from material licensed
28 * to the University of California by American Telephone and Telegraph
29 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30 * the permission of UNIX System Laboratories, Inc.
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 * @(#)time.h 8.3 (Berkeley) 1/21/94
61 */
62
63#ifndef _TIME_H_
64#define _TIME_H_
65
66#include <_types.h>
67#include <sys/cdefs.h>
68#include <Availability.h>
69#include <sys/_types/_clock_t.h>
70#include <sys/_types/_null.h>
71#include <sys/_types/_size_t.h>
72#include <sys/_types/_time_t.h>
73#include <sys/_types/_timespec.h>
74
75struct tm {
76 int tm_sec; /* seconds after the minute [0-60] */
77 int tm_min; /* minutes after the hour [0-59] */
78 int tm_hour; /* hours since midnight [0-23] */
79 int tm_mday; /* day of the month [1-31] */
80 int tm_mon; /* months since January [0-11] */
81 int tm_year; /* years since 1900 */
82 int tm_wday; /* days since Sunday [0-6] */
83 int tm_yday; /* days since January 1 [0-365] */
84 int tm_isdst; /* Daylight Savings Time flag */
85 long tm_gmtoff; /* offset from UTC in seconds */
86 char *tm_zone; /* timezone abbreviation */
87};
88
89#if __DARWIN_UNIX03
90#define CLOCKS_PER_SEC 1000000 /* [XSI] */
91#else /* !__DARWIN_UNIX03 */
92#include <machine/_limits.h> /* Include file containing CLK_TCK. */
93
94#define CLOCKS_PER_SEC (__DARWIN_CLK_TCK)
95#endif /* __DARWIN_UNIX03 */
96
97#ifndef _ANSI_SOURCE
98extern char *tzname[];
99#endif
100
101extern int getdate_err;
102#if __DARWIN_UNIX03
103extern long timezone __DARWIN_ALIAS(timezone);
104#endif /* __DARWIN_UNIX03 */
105extern int daylight;
106
107__BEGIN_DECLS
108char *asctime(const struct tm *);
109clock_t clock(void) __DARWIN_ALIAS(clock);
110char *ctime(const time_t *);
111double difftime(time_t, time_t);
112struct tm *getdate(const char *);
113struct tm *gmtime(const time_t *);
114struct tm *localtime(const time_t *);
115time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
116size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
117char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
118time_t time(time_t *);
119
120#ifndef _ANSI_SOURCE
121void tzset(void);
122#endif /* not ANSI */
123
124/* [TSF] Thread safe functions */
125char *asctime_r(const struct tm * __restrict, char * __restrict);
126char *ctime_r(const time_t *, char *);
127struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict);
128struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict);
129
130#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
131time_t posix2time(time_t);
132#if !__DARWIN_UNIX03
133char *timezone(int, int);
134#endif /* !__DARWIN_UNIX03 */
135void tzsetwall(void);
136time_t time2posix(time_t);
137time_t timelocal(struct tm * const);
138time_t timegm(struct tm * const);
139#endif /* neither ANSI nor POSIX */
140
141#if !defined(_ANSI_SOURCE)
142int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep);
143#endif
144
145#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0
146#if __DARWIN_C_LEVEL >= 199309L
147#if __has_feature(enumerator_attributes)
148#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
149#else
150#define __CLOCK_AVAILABILITY
151#endif
152
153typedef enum {
154_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0,
155#define CLOCK_REALTIME _CLOCK_REALTIME
156_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6,
157#define CLOCK_MONOTONIC _CLOCK_MONOTONIC
158#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
159_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4,
160#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW
161_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5,
162#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX
163_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8,
164#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW
165_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9,
166#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX
167#endif
168_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12,
169#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID
170_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16
171#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID
172} clockid_t;
173
174__CLOCK_AVAILABILITY
175int clock_getres(clockid_t __clock_id, struct timespec *__res);
176
177__CLOCK_AVAILABILITY
178int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
179
180#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
181__CLOCK_AVAILABILITY
182__uint64_t clock_gettime_nsec_np(clockid_t __clock_id);
183#endif
184
185__OSX_AVAILABLE(10.12) __IOS_PROHIBITED
186__TVOS_PROHIBITED __WATCHOS_PROHIBITED
187int clock_settime(clockid_t __clock_id, const struct timespec *__tp);
188
189#undef __CLOCK_AVAILABILITY
190#endif /* __DARWIN_C_LEVEL */
191#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */
192
193#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) && \
194 ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
195 (defined(__cplusplus) && __cplusplus >= 201703L))
196/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */
197#define TIME_UTC 1 /* time elapsed since epoch */
198__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0))
199int timespec_get(struct timespec *ts, int base);
200#endif
201
202__END_DECLS
203
204#ifdef _USE_EXTENDED_LOCALES_
205#include <xlocale/_time.h>
206#endif /* _USE_EXTENDED_LOCALES_ */
207
208#endif /* !_TIME_H_ */
lib/libc/include/aarch64-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
38long ulimit(int, ...);
39__END_DECLS
40
41#endif /* !_ULIMIT_H_ */
lib/libc/include/aarch64-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
430void _exit(int) __dead2;
431int access(const char *, int);
432unsigned int
433 alarm(unsigned int);
434int chdir(const char *);
435int chown(const char *, uid_t, gid_t);
436
437int close(int) __DARWIN_ALIAS_C(close);
438
439int dup(int);
440int dup2(int, int);
441int execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
442int execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
443int execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
444int execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
445int execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
446int execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
447pid_t fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
448long fpathconf(int, int);
449char *getcwd(char *, size_t);
450gid_t getegid(void);
451uid_t geteuid(void);
452gid_t getgid(void);
453#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE)
454int getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups));
455#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */
456int getgroups(int, gid_t []);
457#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */
458char *getlogin(void);
459pid_t getpgrp(void);
460pid_t getpid(void);
461pid_t getppid(void);
462uid_t getuid(void);
463int isatty(int);
464int link(const char *, const char *);
465off_t lseek(int, off_t, int);
466long pathconf(const char *, int);
467
468int pause(void) __DARWIN_ALIAS_C(pause);
469
470int pipe(int [2]);
471
472ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read);
473
474int rmdir(const char *);
475int setgid(gid_t);
476int setpgid(pid_t, pid_t);
477pid_t setsid(void);
478int setuid(uid_t);
479
480unsigned int
481 sleep(unsigned int) __DARWIN_ALIAS_C(sleep);
482
483long sysconf(int);
484pid_t tcgetpgrp(int);
485int tcsetpgrp(int, pid_t);
486char *ttyname(int);
487
488#if __DARWIN_UNIX03
489int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
490#else /* !__DARWIN_UNIX03 */
491char *ttyname_r(int, char *, size_t);
492#endif /* __DARWIN_UNIX03 */
493
494int unlink(const char *);
495
496ssize_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
507size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
508
509int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);
510
511extern char *optarg; /* getopt(3) external variables */
512extern 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
540void *brk(const void *);
541int chroot(const char *) __POSIX_C_DEPRECATED(199506L);
542#endif
543
544char *crypt(const char *, const char *);
545#if __DARWIN_UNIX03
546void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
547#else /* !__DARWIN_UNIX03 */
548int encrypt(char *, int);
549#endif /* __DARWIN_UNIX03 */
550int fchdir(int);
551long gethostid(void);
552pid_t getpgid(pid_t);
553pid_t getsid(pid_t);
554
555/* Removed in Issue 6 */
556#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
557int getdtablesize(void) __POSIX_C_DEPRECATED(199506L);
558int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L);
559char *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
564char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */
565#endif
566
567int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
568
569int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf);
570
571int nice(int) __DARWIN_ALIAS(nice);
572
573ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread);
574
575ssize_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
584void *sbrk(int);
585#endif
586
587#if __DARWIN_UNIX03
588pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
589#else /* !__DARWIN_UNIX03 */
590int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
591#endif /* __DARWIN_UNIX03 */
592
593int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
594
595int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid);
596
597void swab(const void * __restrict, void * __restrict, ssize_t);
598void sync(void);
599int truncate(const char *, off_t);
600useconds_t ualarm(useconds_t, useconds_t);
601int usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
602pid_t vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
603/* End XSI */
604
605int fsync(int) __DARWIN_ALIAS_C(fsync);
606
607int ftruncate(int, off_t);
608int 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
621int fchown(int, uid_t, gid_t);
622int gethostname(char *, size_t);
623ssize_t readlink(const char * __restrict, char * __restrict, size_t);
624int setegid(gid_t);
625int seteuid(uid_t);
626int 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
642void _Exit(int) __dead2;
643int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
644int acct(const char *);
645int add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
646void endusershell(void);
647int execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
648char *fflagstostr(unsigned long);
649int getdomainname(char *, int);
650int 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
660mode_t getmode(const void *, mode_t);
661int getpeereid(int, uid_t *, gid_t *);
662int getsgroups_np(int *, uuid_t);
663char *getusershell(void);
664int getwgroups_np(int *, uuid_t);
665int initgroups(const char *, int);
666int issetugid(void);
667char *mkdtemp(char *);
668int mknod(const char *, mode_t, dev_t);
669int mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */
670int 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);
673int mkstemp(char *);
674int mkstemps(char *, int);
675char *mktemp(char *);
676int mkostemp(char *path, int oflags)
677 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
678 __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
679int 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 */
683int 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);
686char *mkdtempat_np(int dfd, char *path)
687 __OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0)
688 __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
689int 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);
692int 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);
695int nfssvc(int, void *);
696int profil(char *, size_t, unsigned long, unsigned int);
697
698__deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.")
699int pthread_setugid_np(uid_t, gid_t);
700int pthread_getugid_np( uid_t *, gid_t *);
701
702int reboot(int);
703int 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
714int setdomainname(const char *, int);
715int setgroups(int, const gid_t *);
716void sethostid(long);
717int sethostname(const char *, int);
718#if __DARWIN_UNIX03
719void setkey(const char *) __DARWIN_ALIAS(setkey);
720#else /* !__DARWIN_UNIX03 */
721int setkey(const char *);
722#endif /* __DARWIN_UNIX03 */
723int setlogin(const char *);
724void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode));
725int setrgid(gid_t);
726int setruid(uid_t);
727int setsgroups_np(int, const uuid_t);
728void setusershell(void);
729int setwgroups_np(int, const uuid_t);
730int strtofflags(char **, unsigned long *, unsigned long *);
731int swapon(const char *);
732int ttyslot(void);
733int undelete(const char *);
734int unwhiteout(const char *);
735void *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().")
742int syscall(int, ...);
743
744extern char *suboptarg; /* getsubopt(3) external variable */
745int getsubopt(char **, char * const *, char **);
746
747/* HFS & HFS Plus semantics system calls go here */
748#ifdef __LP64__
749int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
750int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
751int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
752int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
753int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
754int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
755
756#else /* __LP64__ */
757int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
758int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
759int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
760int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
761int 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;
765int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
766
767#endif /* __LP64__ */
768
769struct fssearchblock;
770struct searchstate;
771
772int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
773int fsctl(const char *,unsigned long,void*,unsigned int);
774int 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
779int fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
780int sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
781
782extern int optreset;
783
784__END_DECLS
785#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
786
787#endif /* _UNISTD_H_ */
lib/libc/include/aarch64-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
64struct utimbuf {
65 time_t actime; /* Access time */
66 time_t modtime; /* Modification time */
67};
68
69#include <sys/cdefs.h>
70
71__BEGIN_DECLS
72int utime(const char *, const struct utimbuf *);
73__END_DECLS
74
75#endif /* !_UTIME_H_ */
lib/libc/include/aarch64-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
118struct 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)
130struct 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
139void endutxent(void);
140
141#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
142void endutxent_wtmp(void) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
143struct lastlogx *
144 getlastlogx(uid_t, struct lastlogx *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
145struct lastlogx *
146 getlastlogxbyname(const char*, struct lastlogx *)__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
147struct utmp; /* forward reference */
148void 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;
149void 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
152struct utmpx *
153 getutxent(void);
154
155#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
156struct utmpx *
157 getutxent_wtmp(void) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
158#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */
159
160struct utmpx *
161 getutxid(const struct utmpx *);
162struct utmpx *
163 getutxline(const struct utmpx *);
164struct utmpx *
165 pututxline(const struct utmpx *);
166void setutxent(void);
167
168#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
169void setutxent_wtmp(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
170int utmpxname(const char *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
171int 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/aarch64-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
43typedef __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
49UUID_DEFINE(UUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55void uuid_clear(uuid_t uu);
56
57int uuid_compare(const uuid_t uu1, const uuid_t uu2);
58
59void uuid_copy(uuid_t dst, const uuid_t src);
60
61void uuid_generate(uuid_t out);
62void uuid_generate_random(uuid_t out);
63void uuid_generate_time(uuid_t out);
64
65void uuid_generate_early_random(uuid_t out);
66
67int uuid_is_null(const uuid_t uu);
68
69int uuid_parse(const uuid_string_t in, uuid_t uu);
70
71void uuid_unparse(const uuid_t uu, uuid_string_t out);
72void uuid_unparse_lower(const uuid_t uu, uuid_string_t out);
73void 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/aarch64-macos-gnu/wchar.h created+231
......@@ -0,0 +1,231 @@
1/*-
2 * Copyright (c)1999 Citrus Project,
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/wchar.h,v 1.34 2003/03/13 06:29:53 tjr Exp $
27 */
28
29/*-
30 * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
31 * All rights reserved.
32 *
33 * This code is derived from software contributed to The NetBSD Foundation
34 * by Julian Coleman.
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 NetBSD
47 * Foundation, Inc. and its contributors.
48 * 4. Neither the name of The NetBSD Foundation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
53 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
54 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
55 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
56 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
57 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
58 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
59 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
60 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
61 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
62 * POSSIBILITY OF SUCH DAMAGE.
63 *
64 * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
65 */
66
67#ifndef _WCHAR_H_
68#define _WCHAR_H_
69
70#include <_types.h>
71#include <sys/cdefs.h>
72#include <Availability.h>
73
74#include <sys/_types/_null.h>
75#include <sys/_types/_size_t.h>
76#include <sys/_types/_mbstate_t.h>
77#include <sys/_types/_ct_rune_t.h>
78#include <sys/_types/_rune_t.h>
79#include <sys/_types/_wchar_t.h>
80
81#ifndef WCHAR_MIN
82#define WCHAR_MIN __DARWIN_WCHAR_MIN
83#endif
84
85#ifndef WCHAR_MAX
86#define WCHAR_MAX __DARWIN_WCHAR_MAX
87#endif
88
89#include <stdarg.h>
90#include <stdio.h>
91#include <time.h>
92#include <_wctype.h>
93
94
95/* Initially added in Issue 4 */
96__BEGIN_DECLS
97wint_t btowc(int);
98wint_t fgetwc(FILE *);
99wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);
100wint_t fputwc(wchar_t, FILE *);
101int fputws(const wchar_t * __restrict, FILE * __restrict);
102int fwide(FILE *, int);
103int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
104int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
105wint_t getwc(FILE *);
106wint_t getwchar(void);
107size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
108size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
109 mbstate_t * __restrict);
110int mbsinit(const mbstate_t *);
111size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
112 mbstate_t * __restrict);
113wint_t putwc(wchar_t, FILE *);
114wint_t putwchar(wchar_t);
115int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...);
116int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
117wint_t ungetwc(wint_t, FILE *);
118int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
119 __darwin_va_list);
120int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
121 __darwin_va_list);
122int vwprintf(const wchar_t * __restrict, __darwin_va_list);
123size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
124wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
125wchar_t *wcschr(const wchar_t *, wchar_t);
126int wcscmp(const wchar_t *, const wchar_t *);
127int wcscoll(const wchar_t *, const wchar_t *);
128wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
129size_t wcscspn(const wchar_t *, const wchar_t *);
130size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
131 const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
132size_t wcslen(const wchar_t *);
133wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
134int wcsncmp(const wchar_t *, const wchar_t *, size_t);
135wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
136wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
137wchar_t *wcsrchr(const wchar_t *, wchar_t);
138size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
139 mbstate_t * __restrict);
140size_t wcsspn(const wchar_t *, const wchar_t *);
141wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
142size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
143int wctob(wint_t);
144double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
145wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
146 wchar_t ** __restrict);
147long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
148unsigned long
149 wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
150wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
151int wmemcmp(const wchar_t *, const wchar_t *, size_t);
152wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
153wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
154wchar_t *wmemset(wchar_t *, wchar_t, size_t);
155int wprintf(const wchar_t * __restrict, ...);
156int wscanf(const wchar_t * __restrict, ...);
157int wcswidth(const wchar_t *, size_t);
158int wcwidth(wchar_t);
159__END_DECLS
160
161
162
163/* Additional functionality provided by:
164 * POSIX.1-2001
165 * ISO C99
166 */
167
168#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
169__BEGIN_DECLS
170int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
171 __darwin_va_list);
172int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
173 __darwin_va_list);
174int vwscanf(const wchar_t * __restrict, __darwin_va_list);
175float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
176long double
177 wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
178#if !__DARWIN_NO_LONG_LONG
179long long
180 wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
181unsigned long long
182 wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
183#endif /* !__DARWIN_NO_LONG_LONG */
184__END_DECLS
185#endif
186
187
188
189/* Additional functionality provided by:
190 * POSIX.1-2008
191 */
192
193#if __DARWIN_C_LEVEL >= 200809L
194__BEGIN_DECLS
195size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
196 size_t, mbstate_t * __restrict);
197wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
198wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
199wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
200int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
201int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
202size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
203size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
204 size_t, mbstate_t * __restrict);
205FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
206__END_DECLS
207#endif /* __DARWIN_C_LEVEL >= 200809L */
208
209
210
211/* Darwin extensions */
212
213#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
214__BEGIN_DECLS
215wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
216size_t wcslcat(wchar_t *, const wchar_t *, size_t);
217size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
218__END_DECLS
219#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
220
221
222/* Poison the following routines if -fshort-wchar is set */
223#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
224#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf
225#endif
226
227#ifdef _USE_EXTENDED_LOCALES_
228#include <xlocale/_wchar.h>
229#endif /* _USE_EXTENDED_LOCALES_ */
230
231#endif /* !_WCHAR_H_ */
lib/libc/include/aarch64-macos-gnu/wctype.h created+130
......@@ -0,0 +1,130 @@
1/*-
2 * Copyright (c)1999 Citrus Project,
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 * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp
27 * $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $
28 * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
29 */
30
31#ifndef _WCTYPE_H_
32#define _WCTYPE_H_
33
34#include <sys/cdefs.h>
35#include <_types.h>
36#include <_types/_wctrans_t.h>
37
38#define __DARWIN_WCTYPE_TOP_inline __header_inline
39
40#include <_wctype.h>
41#include <ctype.h>
42
43/*
44 * Use inline functions if we are allowed to and the compiler supports them.
45 */
46#if !defined(_DONT_USE_CTYPE_INLINE_) && \
47 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
48
49__DARWIN_WCTYPE_TOP_inline int
50iswblank(wint_t _wc)
51{
52 return (__istype(_wc, _CTYPE_B));
53}
54
55#if !defined(_ANSI_SOURCE)
56__DARWIN_WCTYPE_TOP_inline int
57iswascii(wint_t _wc)
58{
59 return ((_wc & ~0x7F) == 0);
60}
61
62__DARWIN_WCTYPE_TOP_inline int
63iswhexnumber(wint_t _wc)
64{
65 return (__istype(_wc, _CTYPE_X));
66}
67
68__DARWIN_WCTYPE_TOP_inline int
69iswideogram(wint_t _wc)
70{
71 return (__istype(_wc, _CTYPE_I));
72}
73
74__DARWIN_WCTYPE_TOP_inline int
75iswnumber(wint_t _wc)
76{
77 return (__istype(_wc, _CTYPE_D));
78}
79
80__DARWIN_WCTYPE_TOP_inline int
81iswphonogram(wint_t _wc)
82{
83 return (__istype(_wc, _CTYPE_Q));
84}
85
86__DARWIN_WCTYPE_TOP_inline int
87iswrune(wint_t _wc)
88{
89 return (__istype(_wc, 0xFFFFFFF0L));
90}
91
92__DARWIN_WCTYPE_TOP_inline int
93iswspecial(wint_t _wc)
94{
95 return (__istype(_wc, _CTYPE_T));
96}
97#endif /* !_ANSI_SOURCE */
98
99#else /* not using inlines */
100
101__BEGIN_DECLS
102int iswblank(wint_t);
103
104#if !defined(_ANSI_SOURCE)
105wint_t iswascii(wint_t);
106wint_t iswhexnumber(wint_t);
107wint_t iswideogram(wint_t);
108wint_t iswnumber(wint_t);
109wint_t iswphonogram(wint_t);
110wint_t iswrune(wint_t);
111wint_t iswspecial(wint_t);
112#endif
113__END_DECLS
114
115#endif /* using inlines */
116
117__BEGIN_DECLS
118#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
119wint_t nextwctype(wint_t, wctype_t);
120#endif
121wint_t towctrans(wint_t, wctrans_t);
122wctrans_t
123 wctrans(const char *);
124__END_DECLS
125
126#ifdef _USE_EXTENDED_LOCALES_
127#include <xlocale/_wctype.h>
128#endif /* _USE_EXTENDED_LOCALES_ */
129
130#endif /* _WCTYPE_H_ */
lib/libc/include/aarch64-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
10Copyright 1995-2002 University Corporation for Atmospheric Research/Unidata
11
12Portions of this software were developed by the Unidata Program at the
13University Corporation for Atmospheric Research.
14
15Access and use of this software shall impose the following obligations
16and understandings on the user. The user is granted the right, without
17any fee or cost, to use, copy, modify, alter, enhance and distribute
18this software, and any derivative works thereof, and its supporting
19documentation for any purpose whatsoever, provided that this entire
20notice appears in all copies of the software, derivative works and
21supporting documentation. Further, UCAR requests that the user credit
22UCAR/Unidata in any publications that result from the use of this
23software or in any product that includes this software. The names UCAR
24and/or Unidata, however, may not be used in any advertising or publicity
25to endorse or promote any products or commercial entity unless specific
26written permission is obtained from UCAR/Unidata. The user also
27understands that UCAR/Unidata is not obligated to provide the user with
28any support, consulting, training or assistance of any kind with regard
29to the use, operation and performance of this software nor to provide
30the user with any updates, revisions, new versions or "bug fixes."
31
32THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR
33IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL,
36INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
37FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
38NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
39WITH 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
54typedef 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
81int wordexp(const char * __restrict, wordexp_t * __restrict, int) __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA);
82void wordfree(wordexp_t *) __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA);
83__END_DECLS
84
85#endif /* _WORDEXP_H */
lib/libc/include/aarch64-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
64extern const locale_t _c_locale;
65
66locale_t duplocale(locale_t);
67int freelocale(locale_t);
68struct lconv * localeconv_l(locale_t);
69locale_t newlocale(int, __const char *, locale_t);
70__const char * querylocale(int, locale_t);
71locale_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/aarch64-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
34iswalnum_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
40iswalpha_l(wint_t _wc, locale_t _l)
41{
42 return (__istype_l(_wc, _CTYPE_A, _l));
43}
44
45__DARWIN_WCTYPE_TOP_inline int
46iswcntrl_l(wint_t _wc, locale_t _l)
47{
48 return (__istype_l(_wc, _CTYPE_C, _l));
49}
50
51__DARWIN_WCTYPE_TOP_inline int
52iswctype_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
58iswdigit_l(wint_t _wc, locale_t _l)
59{
60 return (__istype_l(_wc, _CTYPE_D, _l));
61}
62
63__DARWIN_WCTYPE_TOP_inline int
64iswgraph_l(wint_t _wc, locale_t _l)
65{
66 return (__istype_l(_wc, _CTYPE_G, _l));
67}
68
69__DARWIN_WCTYPE_TOP_inline int
70iswlower_l(wint_t _wc, locale_t _l)
71{
72 return (__istype_l(_wc, _CTYPE_L, _l));
73}
74
75__DARWIN_WCTYPE_TOP_inline int
76iswprint_l(wint_t _wc, locale_t _l)
77{
78 return (__istype_l(_wc, _CTYPE_R, _l));
79}
80
81__DARWIN_WCTYPE_TOP_inline int
82iswpunct_l(wint_t _wc, locale_t _l)
83{
84 return (__istype_l(_wc, _CTYPE_P, _l));
85}
86
87__DARWIN_WCTYPE_TOP_inline int
88iswspace_l(wint_t _wc, locale_t _l)
89{
90 return (__istype_l(_wc, _CTYPE_S, _l));
91}
92
93__DARWIN_WCTYPE_TOP_inline int
94iswupper_l(wint_t _wc, locale_t _l)
95{
96 return (__istype_l(_wc, _CTYPE_U, _l));
97}
98
99__DARWIN_WCTYPE_TOP_inline int
100iswxdigit_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
106towlower_l(wint_t _wc, locale_t _l)
107{
108 return (__tolower_l(_wc, _l));
109}
110
111__DARWIN_WCTYPE_TOP_inline wint_t
112towupper_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
120int iswalnum_l(wint_t, locale_t);
121int iswalpha_l(wint_t, locale_t);
122int iswcntrl_l(wint_t, locale_t);
123int iswctype_l(wint_t, wctype_t, locale_t);
124int iswdigit_l(wint_t, locale_t);
125int iswgraph_l(wint_t, locale_t);
126int iswlower_l(wint_t, locale_t);
127int iswprint_l(wint_t, locale_t);
128int iswpunct_l(wint_t, locale_t);
129int iswspace_l(wint_t, locale_t);
130int iswupper_l(wint_t, locale_t);
131int iswxdigit_l(wint_t, locale_t);
132wint_t towlower_l(wint_t, locale_t);
133wint_t towupper_l(wint_t, locale_t);
134__END_DECLS
135
136#endif /* using inlines */
137
138__BEGIN_DECLS
139wctype_t
140 wctype_l(const char *, locale_t);
141__END_DECLS
142
143#endif /* _XLOCALE___WCTYPE_H_ */
lib/libc/include/aarch64-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
38unsigned 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
44int __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
84digittoint_l(int c, locale_t l)
85{
86 return (__maskrune_l(c, 0x0F, l));
87}
88
89__DARWIN_CTYPE_TOP_inline int
90isalnum_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
96isalpha_l(int c, locale_t l)
97{
98 return (__istype_l(c, _CTYPE_A, l));
99}
100
101__DARWIN_CTYPE_TOP_inline int
102isblank_l(int c, locale_t l)
103{
104 return (__istype_l(c, _CTYPE_B, l));
105}
106
107__DARWIN_CTYPE_TOP_inline int
108iscntrl_l(int c, locale_t l)
109{
110 return (__istype_l(c, _CTYPE_C, l));
111}
112
113__DARWIN_CTYPE_TOP_inline int
114isdigit_l(int c, locale_t l)
115{
116 return (__istype_l(c, _CTYPE_D, l));
117}
118
119__DARWIN_CTYPE_TOP_inline int
120isgraph_l(int c, locale_t l)
121{
122 return (__istype_l(c, _CTYPE_G, l));
123}
124
125__DARWIN_CTYPE_TOP_inline int
126ishexnumber_l(int c, locale_t l)
127{
128 return (__istype_l(c, _CTYPE_X, l));
129}
130
131__DARWIN_CTYPE_TOP_inline int
132isideogram_l(int c, locale_t l)
133{
134 return (__istype_l(c, _CTYPE_I, l));
135}
136
137__DARWIN_CTYPE_TOP_inline int
138islower_l(int c, locale_t l)
139{
140 return (__istype_l(c, _CTYPE_L, l));
141}
142
143__DARWIN_CTYPE_TOP_inline int
144isnumber_l(int c, locale_t l)
145{
146 return (__istype_l(c, _CTYPE_D, l));
147}
148
149__DARWIN_CTYPE_TOP_inline int
150isphonogram_l(int c, locale_t l)
151{
152 return (__istype_l(c, _CTYPE_Q, l));
153}
154
155__DARWIN_CTYPE_TOP_inline int
156isprint_l(int c, locale_t l)
157{
158 return (__istype_l(c, _CTYPE_R, l));
159}
160
161__DARWIN_CTYPE_TOP_inline int
162ispunct_l(int c, locale_t l)
163{
164 return (__istype_l(c, _CTYPE_P, l));
165}
166
167__DARWIN_CTYPE_TOP_inline int
168isrune_l(int c, locale_t l)
169{
170 return (__istype_l(c, 0xFFFFFFF0L, l));
171}
172
173__DARWIN_CTYPE_TOP_inline int
174isspace_l(int c, locale_t l)
175{
176 return (__istype_l(c, _CTYPE_S, l));
177}
178
179__DARWIN_CTYPE_TOP_inline int
180isspecial_l(int c, locale_t l)
181{
182 return (__istype_l(c, _CTYPE_T, l));
183}
184
185__DARWIN_CTYPE_TOP_inline int
186isupper_l(int c, locale_t l)
187{
188 return (__istype_l(c, _CTYPE_U, l));
189}
190
191__DARWIN_CTYPE_TOP_inline int
192isxdigit_l(int c, locale_t l)
193{
194 return (__istype_l(c, _CTYPE_X, l));
195}
196
197__DARWIN_CTYPE_TOP_inline int
198tolower_l(int c, locale_t l)
199{
200 return (__tolower_l(c, l));
201}
202
203__DARWIN_CTYPE_TOP_inline int
204toupper_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
213int digittoint_l(int, locale_t);
214int isalnum_l(int, locale_t);
215int isalpha_l(int, locale_t);
216int isblank_l(int, locale_t);
217int iscntrl_l(int, locale_t);
218int isdigit_l(int, locale_t);
219int isgraph_l(int, locale_t);
220int ishexnumber_l(int, locale_t);
221int isideogram_l(int, locale_t);
222int islower_l(int, locale_t);
223int isnumber_l(int, locale_t);
224int isphonogram_l(int, locale_t);
225int isprint_l(int, locale_t);
226int ispunct_l(int, locale_t);
227int isrune_l(int, locale_t);
228int isspace_l(int, locale_t);
229int isspecial_l(int, locale_t);
230int isupper_l(int, locale_t);
231int isxdigit_l(int, locale_t);
232int tolower_l(int, locale_t);
233int toupper_l(int, locale_t);
234__END_DECLS
235#endif /* using inlines */
236
237#endif /* _XLOCALE__CTYPE_H_ */
lib/libc/include/aarch64-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
33intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr,
34 int base, locale_t);
35uintmax_t strtoumax_l(const char * __restrict nptr, char ** __restrict endptr,
36 int base, locale_t);
37intmax_t wcstoimax_l(const wchar_t * __restrict nptr,
38 wchar_t ** __restrict endptr, int base, locale_t);
39uintmax_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/aarch64-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
32char *nl_langinfo_l(nl_item, locale_t);
33__END_DECLS
34
35#endif /* _XLOCALE__LANGINFO_H_ */
lib/libc/include/aarch64-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
34ssize_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/aarch64-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
34int 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
40int regncomp_l(regex_t * __restrict, const char * __restrict, size_t,
41 int, locale_t __restrict)
42 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
43int regwcomp_l(regex_t * __restrict, const wchar_t * __restrict,
44 int, locale_t __restrict)
45 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
46int 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/aarch64-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
32int fprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...)
33 __printflike(3, 4);
34int fscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...)
35 __scanflike(3, 4);
36int printf_l(locale_t __restrict, const char * __restrict, ...)
37 __printflike(2, 3);
38int scanf_l(locale_t __restrict, const char * __restrict, ...)
39 __scanflike(2, 3);
40int sprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, ...)
41 __printflike(3, 4) __swift_unavailable("Use snprintf_l instead.");
42int sscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, ...)
43 __scanflike(3, 4);
44int vfprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list)
45 __printflike(3, 0);
46int vprintf_l(locale_t __restrict, const char * __restrict, va_list)
47 __printflike(2, 0);
48int 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)
52int snprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, ...)
53 __printflike(4, 5);
54int vfscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list)
55 __scanflike(3, 0);
56int vscanf_l(locale_t __restrict, const char * __restrict, va_list)
57 __scanflike(2, 0);
58int vsnprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, va_list)
59 __printflike(4, 0);
60int 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)
65int dprintf_l(int, locale_t __restrict, const char * __restrict, ...)
66 __printflike(3, 4) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
67int 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)
73int asprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, ...)
74 __printflike(3, 4);
75int 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/aarch64-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
33double atof_l(const char *, locale_t);
34int atoi_l(const char *, locale_t);
35long atol_l(const char *, locale_t);
36#if !__DARWIN_NO_LONG_LONG
37long long
38 atoll_l(const char *, locale_t);
39#endif /* !__DARWIN_NO_LONG_LONG */
40int mblen_l(const char *, size_t, locale_t);
41size_t mbstowcs_l(wchar_t * __restrict , const char * __restrict, size_t,
42 locale_t);
43int mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t,
44 locale_t);
45double strtod_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtod_l);
46float strtof_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtof_l);
47long strtol_l(const char *, char **, int, locale_t);
48long double
49 strtold_l(const char *, char **, locale_t);
50long long
51 strtoll_l(const char *, char **, int, locale_t);
52#if !__DARWIN_NO_LONG_LONG
53long long
54 strtoq_l(const char *, char **, int, locale_t);
55#endif /* !__DARWIN_NO_LONG_LONG */
56unsigned long
57 strtoul_l(const char *, char **, int, locale_t);
58unsigned long long
59 strtoull_l(const char *, char **, int, locale_t);
60#if !__DARWIN_NO_LONG_LONG
61unsigned long long
62 strtouq_l(const char *, char **, int, locale_t);
63#endif /* !__DARWIN_NO_LONG_LONG */
64size_t wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t,
65 locale_t);
66int 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/aarch64-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
32int strcoll_l(const char *, const char *, locale_t);
33size_t strxfrm_l(char *, const char *, size_t, locale_t);
34int strcasecmp_l(const char *, const char *, locale_t);
35char *strcasestr_l(const char *, const char *, locale_t);
36int strncasecmp_l(const char *, const char *, size_t, locale_t);
37__END_DECLS
38
39#endif /* _XLOCALE__STRING_H_ */
lib/libc/include/aarch64-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
33size_t strftime_l(char * __restrict, size_t, const char * __restrict,
34 const struct tm * __restrict, locale_t)
35 __DARWIN_ALIAS(strftime_l) __strftimelike(3);
36char *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/aarch64-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
35wint_t btowc_l(int, locale_t);
36wint_t fgetwc_l(FILE *, locale_t);
37wchar_t *fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t);
38wint_t fputwc_l(wchar_t, FILE *, locale_t);
39int fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t);
40int fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...);
41int fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...);
42wint_t getwc_l(FILE *, locale_t);
43wint_t getwchar_l(locale_t);
44size_t mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict,
45 locale_t);
46size_t mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t,
47 mbstate_t * __restrict, locale_t);
48int mbsinit_l(const mbstate_t *, locale_t);
49size_t mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
50 mbstate_t * __restrict, locale_t);
51wint_t putwc_l(wchar_t, FILE *, locale_t);
52wint_t putwchar_l(wchar_t, locale_t);
53int swprintf_l(wchar_t * __restrict, size_t n, locale_t,
54 const wchar_t * __restrict, ...);
55int swscanf_l(const wchar_t * __restrict, locale_t,
56 const wchar_t * __restrict, ...);
57wint_t ungetwc_l(wint_t, FILE *, locale_t);
58int vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict,
59 __darwin_va_list);
60int vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
61 const wchar_t * __restrict, __darwin_va_list);
62int vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
63size_t wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict,
64 locale_t);
65int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
66size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict,
67 const struct tm * __restrict, locale_t)
68 __DARWIN_ALIAS(wcsftime_l);
69size_t wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
70 mbstate_t * __restrict, locale_t);
71double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
72long wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
73 locale_t);
74unsigned long
75 wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
76 locale_t);
77int wcswidth_l(const wchar_t *, size_t, locale_t);
78size_t wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t,
79 locale_t);
80int wctob_l(wint_t, locale_t);
81int wcwidth_l(wchar_t, locale_t);
82int wprintf_l(locale_t, const wchar_t * __restrict, ...);
83int 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
94int vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict,
95 __darwin_va_list);
96int vswscanf_l(const wchar_t * __restrict, locale_t,
97 const wchar_t * __restrict, __darwin_va_list);
98int vwscanf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
99float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
100long double
101 wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
102#if !__DARWIN_NO_LONG_LONG
103long long
104 wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
105 locale_t);
106unsigned 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
121size_t mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
122 size_t, mbstate_t * __restrict, locale_t);
123int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
124int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
125size_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
136wchar_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/aarch64-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
35iswblank_l(wint_t _wc, locale_t _l)
36{
37 return (__istype_l(_wc, _CTYPE_B, _l));
38}
39
40__DARWIN_WCTYPE_TOP_inline int
41iswhexnumber_l(wint_t _wc, locale_t _l)
42{
43 return (__istype_l(_wc, _CTYPE_X, _l));
44}
45
46__DARWIN_WCTYPE_TOP_inline int
47iswideogram_l(wint_t _wc, locale_t _l)
48{
49 return (__istype_l(_wc, _CTYPE_I, _l));
50}
51
52__DARWIN_WCTYPE_TOP_inline int
53iswnumber_l(wint_t _wc, locale_t _l)
54{
55 return (__istype_l(_wc, _CTYPE_D, _l));
56}
57
58__DARWIN_WCTYPE_TOP_inline int
59iswphonogram_l(wint_t _wc, locale_t _l)
60{
61 return (__istype_l(_wc, _CTYPE_Q, _l));
62}
63
64__DARWIN_WCTYPE_TOP_inline int
65iswrune_l(wint_t _wc, locale_t _l)
66{
67 return (__istype_l(_wc, 0xFFFFFFF0L, _l));
68}
69
70__DARWIN_WCTYPE_TOP_inline int
71iswspecial_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
79int iswblank_l(wint_t, locale_t);
80wint_t iswhexnumber_l(wint_t, locale_t);
81wint_t iswideogram_l(wint_t, locale_t);
82wint_t iswnumber_l(wint_t, locale_t);
83wint_t iswphonogram_l(wint_t, locale_t);
84wint_t iswrune_l(wint_t, locale_t);
85wint_t iswspecial_l(wint_t, locale_t);
86__END_DECLS
87
88#endif /* using inlines */
89
90__BEGIN_DECLS
91wint_t nextwctype_l(wint_t, wctype_t, locale_t);
92wint_t towctrans_l(wint_t, wctrans_t, locale_t);
93wctrans_t
94 wctrans_l(const char *, locale_t);
95__END_DECLS
96
97#endif /* _XLOCALE__WCTYPE_H_ */
lib/libc/include/aarch64-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
12XPC_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)
37XPC_EXPORT
38const 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)
45XPC_EXPORT
46const 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)
54XPC_EXPORT
55const 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)
63XPC_EXPORT
64const char * const XPC_ACTIVITY_GRACE_PERIOD;
65
66
67__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
68XPC_EXPORT
69const int64_t XPC_ACTIVITY_INTERVAL_1_MIN;
70
71__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
72XPC_EXPORT
73const int64_t XPC_ACTIVITY_INTERVAL_5_MIN;
74
75__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
76XPC_EXPORT
77const int64_t XPC_ACTIVITY_INTERVAL_15_MIN;
78
79__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
80XPC_EXPORT
81const int64_t XPC_ACTIVITY_INTERVAL_30_MIN;
82
83__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
84XPC_EXPORT
85const int64_t XPC_ACTIVITY_INTERVAL_1_HOUR;
86
87__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
88XPC_EXPORT
89const int64_t XPC_ACTIVITY_INTERVAL_4_HOURS;
90
91__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
92XPC_EXPORT
93const int64_t XPC_ACTIVITY_INTERVAL_8_HOURS;
94
95__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
96XPC_EXPORT
97const int64_t XPC_ACTIVITY_INTERVAL_1_DAY;
98
99__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
100XPC_EXPORT
101const 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)
108XPC_EXPORT
109const 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)
125XPC_EXPORT
126const 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)
142XPC_EXPORT
143const 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)
152XPC_EXPORT
153const 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)
164XPC_EXPORT
165const 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")
175XPC_EXPORT
176const 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")
186XPC_EXPORT
187const 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)
195XPC_EXPORT
196XPC_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 */
212XPC_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 */
220XPC_NONNULL1
221typedef 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)
231XPC_EXPORT
232const 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)
270XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
271void
272xpc_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)
284XPC_EXPORT XPC_WARN_RESULT XPC_RETURNS_RETAINED XPC_NONNULL1
285xpc_object_t _Nullable
286xpc_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)
295XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
296void
297xpc_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 */
359enum {
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};
367typedef 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)
376XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
377xpc_activity_state_t
378xpc_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)
391XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
392bool
393xpc_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)
414XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
415bool
416xpc_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)
437XPC_EXPORT XPC_NONNULL1
438void
439xpc_activity_unregister(const char *identifier);
440
441__END_DECLS
442XPC_ASSUME_NONNULL_END
443
444#endif // __BLOCKS__
445
446#endif // __XPC_ACTIVITY_H__
447
lib/libc/include/aarch64-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/aarch64-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/aarch64-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
14XPC_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)
37XPC_EXPORT
38const 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)
56XPC_EXPORT
57const 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)
79XPC_EXPORT
80const 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 */
112typedef 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)
149XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
150xpc_connection_t
151xpc_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)
188XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
189xpc_connection_t
190xpc_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)
211XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
212xpc_connection_t
213xpc_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)
253XPC_EXPORT XPC_NONNULL1
254void
255xpc_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)
315XPC_EXPORT XPC_NONNULL_ALL
316void
317xpc_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)
341XPC_EXPORT XPC_NONNULL_ALL
342void
343xpc_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)
368XPC_EXPORT XPC_NONNULL_ALL
369void
370xpc_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)
393XPC_EXPORT XPC_NONNULL_ALL
394void
395xpc_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)
429XPC_EXPORT XPC_NONNULL_ALL
430void
431xpc_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)
480XPC_EXPORT XPC_NONNULL_ALL
481void
482xpc_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)
518XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL4
519void
520xpc_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)
557XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT XPC_RETURNS_RETAINED
558xpc_object_t
559xpc_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)
586XPC_EXPORT XPC_NONNULL_ALL
587void
588xpc_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)
602XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
603const char * _Nullable
604xpc_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)
617XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
618uid_t
619xpc_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)
632XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
633gid_t
634xpc_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)
658XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
659pid_t
660xpc_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)
673XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
674au_asid_t
675xpc_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)
698XPC_EXPORT XPC_NONNULL1
699void
700xpc_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)
715XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
716void * _Nullable
717xpc_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)
740XPC_EXPORT XPC_NONNULL1
741void
742xpc_connection_set_finalizer_f(xpc_connection_t connection,
743 xpc_finalizer_t _Nullable finalizer);
744
745__END_DECLS
746XPC_ASSUME_NONNULL_END
747
748#endif // __XPC_CONNECTION_H__
lib/libc/include/aarch64-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 */
19XPC_DEBUGGER_EXCL
20const char *
21xpc_debugger_api_misuse_info(void);
22
23#endif // __XPC_DEBUG_H__
lib/libc/include/aarch64-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)
18XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
19xpc_endpoint_t _Nonnull
20xpc_endpoint_create(xpc_connection_t _Nonnull connection);
21
22#endif // __XPC_ENDPOINT_H__
lib/libc/include/aarch64-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
33XPC_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 */
46typedef 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 */
69OS_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
76XPC_INLINE XPC_NONNULL_ALL
77void
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
82typedef 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__
101typedef 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)
112XPC_EXPORT
113XPC_TYPE(_xpc_type_connection);
114XPC_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 */
126typedef 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)
139XPC_EXPORT
140XPC_TYPE(_xpc_type_endpoint);
141XPC_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)
152XPC_EXPORT
153XPC_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)
161XPC_EXPORT
162XPC_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)
171XPC_EXPORT
172const 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)
181XPC_EXPORT
182const 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)
190XPC_EXPORT
191XPC_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)
199XPC_EXPORT
200XPC_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)
208XPC_EXPORT
209XPC_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)
219XPC_EXPORT
220XPC_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)
228XPC_EXPORT
229XPC_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)
237XPC_EXPORT
238XPC_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)
246XPC_EXPORT
247XPC_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)
255XPC_EXPORT
256XPC_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)
264XPC_EXPORT
265XPC_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)
276XPC_EXPORT
277XPC_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)
287XPC_EXPORT
288XPC_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)
305XPC_EXPORT
306XPC_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)
315XPC_EXPORT
316const 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)
325XPC_EXPORT
326const char * const _xpc_event_key_name;
327
328XPC_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__
339XPC_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)
359XPC_EXPORT XPC_NONNULL1
360xpc_object_t
361xpc_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)
384XPC_EXPORT XPC_NONNULL1
385void
386xpc_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)
407XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
408xpc_type_t
409xpc_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)
425XPC_EXPORT XPC_NONNULL1
426const char *
427xpc_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)
450XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT XPC_RETURNS_RETAINED
451xpc_object_t _Nullable
452xpc_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)
478XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_WARN_RESULT
479bool
480xpc_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)
501XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT
502size_t
503xpc_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)
519XPC_EXPORT XPC_MALLOC XPC_WARN_RESULT XPC_NONNULL1
520char *
521xpc_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)
535XPC_EXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
536xpc_object_t
537xpc_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)
553XPC_EXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
554xpc_object_t
555xpc_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)
571XPC_EXPORT
572bool
573xpc_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)
589XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
590xpc_object_t
591xpc_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)
607XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
608int64_t
609xpc_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)
625XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
626xpc_object_t
627xpc_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)
643XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
644uint64_t
645xpc_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)
661XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
662xpc_object_t
663xpc_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)
679XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
680double
681xpc_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)
699XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
700xpc_object_t
701xpc_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)
713XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
714xpc_object_t
715xpc_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)
731XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
732int64_t
733xpc_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)
758XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
759xpc_object_t
760xpc_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)
782XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
783xpc_object_t
784xpc_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)
800XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
801size_t
802xpc_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)
818XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
819const void * _Nullable
820xpc_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)
847XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2
848size_t
849xpc_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)
866XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
867xpc_object_t
868xpc_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)
888XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
889XPC_PRINTF(1, 2)
890xpc_object_t
891xpc_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)
912XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
913XPC_PRINTF(1, 0)
914xpc_object_t
915xpc_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)
931XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
932size_t
933xpc_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)
949XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
950const char * _Nullable
951xpc_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)
968XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
969xpc_object_t
970xpc_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)
987XPC_EXPORT XPC_NONNULL1
988const uint8_t * _Nullable
989xpc_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)
1021XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
1022xpc_object_t _Nullable
1023xpc_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)
1048XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1049int
1050xpc_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)
1088XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
1089xpc_object_t
1090xpc_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)
1119XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
1120size_t
1121xpc_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__
1138typedef 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)
1167XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
1168xpc_object_t
1169xpc_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 */
1183API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
1184XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
1185xpc_object_t
1186xpc_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)
1208XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
1209void
1210xpc_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)
1225XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
1226void
1227xpc_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)
1243XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1244size_t
1245xpc_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)
1269XPC_EXPORT XPC_NONNULL_ALL
1270xpc_object_t
1271xpc_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)
1295XPC_EXPORT XPC_NONNULL_ALL
1296bool
1297xpc_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)
1330XPC_EXPORT XPC_NONNULL1
1331void
1332xpc_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)
1355XPC_EXPORT XPC_NONNULL1
1356void
1357xpc_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)
1380XPC_EXPORT XPC_NONNULL1
1381void
1382xpc_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)
1405XPC_EXPORT XPC_NONNULL1
1406void
1407xpc_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)
1430XPC_EXPORT XPC_NONNULL1
1431void
1432xpc_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)
1458XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
1459void
1460xpc_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)
1484XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
1485void
1486xpc_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)
1509XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
1510void
1511xpc_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)
1535XPC_EXPORT XPC_NONNULL1
1536void
1537xpc_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)
1560XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
1561void
1562xpc_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)
1585XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1586bool
1587xpc_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)
1608XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1609int64_t
1610xpc_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)
1631XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1632uint64_t
1633xpc_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)
1654XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1655double
1656xpc_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)
1677XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1678int64_t
1679xpc_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)
1704XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1705const void * _Nullable
1706xpc_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)
1728XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1729const char * _Nullable
1730xpc_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)
1752XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1753const uint8_t * _Nullable
1754xpc_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)
1776XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
1777int
1778xpc_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)
1804XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
1805xpc_connection_t _Nullable
1806xpc_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)
1831XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
1832xpc_object_t _Nullable
1833xpc_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)
1858XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
1859xpc_object_t _Nullable
1860xpc_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__
1877typedef 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)
1912XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
1913xpc_object_t
1914xpc_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 */
1930API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0))
1931XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
1932xpc_object_t
1933xpc_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)
1956XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
1957xpc_object_t _Nullable
1958xpc_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)
1979XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
1980void
1981xpc_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)
2006XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2
2007xpc_object_t _Nullable
2008xpc_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)
2026XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
2027size_t
2028xpc_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)
2053XPC_EXPORT XPC_NONNULL_ALL
2054bool
2055xpc_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)
2075XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2076xpc_connection_t _Nullable
2077xpc_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)
2098XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2099void
2100xpc_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)
2120XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2121void
2122xpc_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)
2142XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2143void
2144xpc_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)
2164XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2165void
2166xpc_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)
2186XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2187void
2188xpc_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)
2211XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
2212void
2213xpc_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)
2234XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
2235void
2236xpc_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)
2257XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
2258void
2259xpc_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)
2280XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2281void
2282xpc_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)
2303XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
2304void
2305xpc_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)
2327XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2328bool
2329xpc_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)
2349XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2350int64_t
2351xpc_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)
2371XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2372uint64_t
2373xpc_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)
2393XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2394double
2395xpc_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)
2415XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2416int64_t
2417xpc_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)
2441XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
2442const void * _Nullable
2443xpc_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)
2464XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2465const char * _Nullable
2466xpc_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)
2486XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2
2487const uint8_t * _Nullable
2488xpc_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)
2509XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2510int
2511xpc_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)
2535XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
2536xpc_connection_t _Nullable
2537xpc_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)
2561XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2562xpc_object_t _Nullable
2563xpc_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)
2587XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2588xpc_object_t _Nullable
2589xpc_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)
2604XPC_EXPORT XPC_NORETURN XPC_NONNULL1
2605void
2606xpc_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)
2640XPC_TRANSACTION_DEPRECATED
2641XPC_EXPORT
2642void
2643xpc_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)
2657XPC_TRANSACTION_DEPRECATED
2658XPC_EXPORT
2659void
2660xpc_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)
2692XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
2693void
2694xpc_set_event_stream_handler(const char *stream,
2695 dispatch_queue_t _Nullable targetq, xpc_handler_t handler);
2696#endif // __BLOCKS__
2697
2698__END_DECLS
2699XPC_ASSUME_NONNULL_END
2700
2701#endif // __XPC_H__
src/target.zig+1
......@@ -14,6 +14,7 @@ pub const available_libcs = [_]ArchOsAbi{
1414 .{ .arch = .aarch64, .os = .linux, .abi = .gnu },
1515 .{ .arch = .aarch64, .os = .linux, .abi = .musl },
1616 .{ .arch = .aarch64, .os = .windows, .abi = .gnu },
17 .{ .arch = .aarch64, .os = .macos, .abi = .gnu },
1718 .{ .arch = .armeb, .os = .linux, .abi = .gnueabi },
1819 .{ .arch = .armeb, .os = .linux, .abi = .gnueabihf },
1920 .{ .arch = .armeb, .os = .linux, .abi = .musleabi },